Skip to content

Commit

Permalink
TTK-26618 PHPCsFixer && PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurujai committed Oct 16, 2023
1 parent af1ddcb commit c66a085
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions Command/renewedVideosWithoutOwnerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace Pumukit\ExpiredVideoBundle\Command;

use Doctrine\ODM\MongoDB\DocumentManager;
use Pumukit\ExpiredVideoBundle\Services\ExpiredVideoConfigurationService;
use Pumukit\ExpiredVideoBundle\Services\ExpiredVideoService;
use Pumukit\SchemaBundle\Document\Role;
use Pumukit\SchemaBundle\Document\Tag;
use Symfony\Component\Console\Command\Command;
Expand All @@ -24,6 +26,16 @@ class renewedVideosWithoutOwnerCommand extends Command
private $addPublishTag;
private $renewDate;

public function __construct(
DocumentManager $documentManager,
ExpiredVideoService $expiredVideoService,
ExpiredVideoConfigurationService $expiredVideoConfigurationService
) {
$this->expiredVideoService = $expiredVideoService;
$this->expiredVideoConfigurationService = $expiredVideoConfigurationService;
$this->documentManager = $documentManager;
}

protected function configure(): void
{
$this
Expand Down Expand Up @@ -54,9 +66,6 @@ protected function configure(): void

protected function initialize(InputInterface $input, OutputInterface $output): void
{
$this->expiredVideoService = $this->getContainer()->get('pumukit_expired_video.expired_video');
$this->expiredVideoConfigurationService = $this->getContainer()->get('pumukit_expired_video.configuration');
$this->documentManager = $this->getContainer()->get('doctrine.odm.mongodb.document_manager');
$this->force = (true === $input->getOption('force'));
$this->user = $input->getOption('user');
$this->addPublishTag = $input->getOption('addPublishTag');
Expand Down
2 changes: 1 addition & 1 deletion Services/ExpiredVideoNotificationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private function generateDataForMultimediaObject(string $multimediaObjectId): ar
$mmObj = $this->getMultimediaObjectById($multimediaObjectId);

$renewMultimediaObjectToken = $mmObj->getProperty($this->expiredVideoConfigurationService->getMultimediaObjectPropertyRenewKey());
if (!$renewMultimediaObjectToken || empty($renewMultimediaObjectToken)) {
if (empty($renewMultimediaObjectToken)) {
$renewMultimediaObjectToken = TokenUtils::generateExpiredToken();
}

Expand Down

0 comments on commit c66a085

Please sign in to comment.