diff --git a/.github/workflows/browser-tests.yaml b/.github/workflows/browser-tests.yaml index 041b8d56..608c582b 100644 --- a/.github/workflows/browser-tests.yaml +++ b/.github/workflows/browser-tests.yaml @@ -13,7 +13,7 @@ jobs: uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main with: project-edition: 'oss' - test-suite: '--profile=browser --suite=admin-ui-full' + test-suite: '--profile=browser --suite=admin-ui-full --tags=~@broken' test-setup-phase-1: '--profile=regression --suite=setup-oss --mode=standard' multirepository: true timeout: 40 diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c07a4da1..9c337a29 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,10 +1,5 @@ parameters: ignoreErrors: - - - message: "#^Method Ibexa\\\\Bundle\\\\Behat\\\\Cache\\\\JsRoutingDirectoryCacheDirectoryCreator\\:\\:warmUp\\(\\) should return array\\ but return statement is missing\\.$#" - count: 1 - path: src/bundle/Cache/JsRoutingDirectoryCacheDirectoryCreator.php - - message: "#^Method Ibexa\\\\Bundle\\\\Behat\\\\Command\\\\CreateExampleDataCommand\\:\\:configure\\(\\) has no return type specified\\.$#" count: 1 diff --git a/src/bundle/Cache/JsRoutingDirectoryCacheDirectoryCreator.php b/src/bundle/Cache/JsRoutingDirectoryCacheDirectoryCreator.php index b02abaab..04fb23d3 100644 --- a/src/bundle/Cache/JsRoutingDirectoryCacheDirectoryCreator.php +++ b/src/bundle/Cache/JsRoutingDirectoryCacheDirectoryCreator.php @@ -12,19 +12,21 @@ class JsRoutingDirectoryCacheDirectoryCreator implements CacheWarmerInterface { - private const FOS_JS_ROUTING_CACHE_DIR = 'fosJsRouting'; + private const string FOS_JS_ROUTING_CACHE_DIR = 'fosJsRouting'; - public function isOptional() + public function isOptional(): bool { return true; } - public function warmUp(string $cacheDir) + public function warmUp(string $cacheDir): array { // Workaround for https://github.com/FriendsOfSymfony/FOSJsRoutingBundle/pull/434 $cachePath = $cacheDir . \DIRECTORY_SEPARATOR . self::FOS_JS_ROUTING_CACHE_DIR; if (!file_exists($cachePath) && !mkdir($cachePath) && !is_dir($cachePath)) { throw new \RuntimeException('Unable to create JsRoutingBundle cache directory ' . $cachePath); } + + return []; } } diff --git a/src/bundle/Command/CreateExampleDataCommand.php b/src/bundle/Command/CreateExampleDataCommand.php index 43b98da7..89f9e929 100644 --- a/src/bundle/Command/CreateExampleDataCommand.php +++ b/src/bundle/Command/CreateExampleDataCommand.php @@ -56,7 +56,7 @@ protected function configure() ->addArgument('serializedTransitionData', InputArgument::REQUIRED); } - public function execute(InputInterface $input, OutputInterface $output) + public function execute(InputInterface $input, OutputInterface $output): int { $iterations = $input->getArgument('iterations'); $initialData = $this->parseInputData($input->getArgument('serializedTransitionData')); @@ -77,7 +77,7 @@ public function execute(InputInterface $input, OutputInterface $output) $this->logger->log(LogLevel::INFO, $statsEnd); $output->writeln($statsEnd); - return 0; + return self::SUCCESS; } private function parseInputData(string $serializedTransitionEvent): InitialEvent diff --git a/src/bundle/Command/CreateExampleDataManagerCommand.php b/src/bundle/Command/CreateExampleDataManagerCommand.php index b46f4fa9..18f8d092 100644 --- a/src/bundle/Command/CreateExampleDataManagerCommand.php +++ b/src/bundle/Command/CreateExampleDataManagerCommand.php @@ -52,7 +52,7 @@ public function __construct(string $env, string $projectDir) $this->stopwatch = new Stopwatch(); } - public function execute(InputInterface $input, OutputInterface $output) + public function execute(InputInterface $input, OutputInterface $output): int { $data = $this->getData(); $this->stopwatch->start('timer'); @@ -62,7 +62,7 @@ public function execute(InputInterface $input, OutputInterface $output) $event = $this->stopwatch->stop('timer'); $output->writeln(sprintf('Duration: %d s, memory: %s MB', $event->getDuration() / 1000, $event->getMemory() / 1024 / 1024)); - return 0; + return self::SUCCESS; } private function executeCommand(OutputInterface $output, $cmd, float $timeout = 1200) diff --git a/src/bundle/Command/CreateLanguageCommand.php b/src/bundle/Command/CreateLanguageCommand.php index d56b75a6..f4017470 100644 --- a/src/bundle/Command/CreateLanguageCommand.php +++ b/src/bundle/Command/CreateLanguageCommand.php @@ -70,6 +70,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->languageService->createLanguage($languageCreateStruct); - return 0; + return self::SUCCESS; } } diff --git a/src/bundle/Command/TestSiteaccessCommand.php b/src/bundle/Command/TestSiteaccessCommand.php index 1426114a..8a127322 100644 --- a/src/bundle/Command/TestSiteaccessCommand.php +++ b/src/bundle/Command/TestSiteaccessCommand.php @@ -37,6 +37,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln($this->siteaccess->name); - return 0; + return self::SUCCESS; } } diff --git a/src/bundle/Subscriber/EndScenarioSubscriber.php b/src/bundle/Subscriber/EndScenarioSubscriber.php index 331589db..e7617df4 100644 --- a/src/bundle/Subscriber/EndScenarioSubscriber.php +++ b/src/bundle/Subscriber/EndScenarioSubscriber.php @@ -17,7 +17,7 @@ class EndScenarioSubscriber implements EventSubscriberInterface { private const PRIORITY = -1000; - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ ScenarioTested::AFTER => ['resetLogProvider', self::PRIORITY], diff --git a/src/bundle/Subscriber/StartScenarioSubscriber.php b/src/bundle/Subscriber/StartScenarioSubscriber.php index 01f25da9..fb331954 100644 --- a/src/bundle/Subscriber/StartScenarioSubscriber.php +++ b/src/bundle/Subscriber/StartScenarioSubscriber.php @@ -34,7 +34,7 @@ public function __construct(KernelInterface $kernel, int $width, int $height) $this->height = $height; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ ScenarioTested::BEFORE => ['resizeWindow', self::PRIORITY], diff --git a/src/lib/Core/Debug/Command/GoBackCommand.php b/src/lib/Core/Debug/Command/GoBackCommand.php index 4c36b8d8..d3514957 100644 --- a/src/lib/Core/Debug/Command/GoBackCommand.php +++ b/src/lib/Core/Debug/Command/GoBackCommand.php @@ -33,12 +33,12 @@ protected function configure() ->setHelp(''); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $this->session->back(); $output->writeln("The last page from browser's history has been visited."); - return 0; + return self::SUCCESS; } } diff --git a/src/lib/Core/Debug/Command/RefreshPageCommand.php b/src/lib/Core/Debug/Command/RefreshPageCommand.php index 82790414..71ea4bd6 100644 --- a/src/lib/Core/Debug/Command/RefreshPageCommand.php +++ b/src/lib/Core/Debug/Command/RefreshPageCommand.php @@ -33,12 +33,12 @@ protected function configure() ->setHelp(''); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $this->session->reload(); $output->writeln('Page has been refreshed.'); - return 0; + return self::SUCCESS; } } diff --git a/src/lib/Core/Debug/Command/ShowHTMLCommand.php b/src/lib/Core/Debug/Command/ShowHTMLCommand.php index e356a293..03bada02 100644 --- a/src/lib/Core/Debug/Command/ShowHTMLCommand.php +++ b/src/lib/Core/Debug/Command/ShowHTMLCommand.php @@ -33,10 +33,10 @@ protected function configure() ->setHelp(''); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln($this->session->getPage()->getOuterHtml()); - return 0; + return self::SUCCESS; } } diff --git a/src/lib/Core/Debug/Command/ShowURLCommand.php b/src/lib/Core/Debug/Command/ShowURLCommand.php index 3af71aa0..60dccafc 100644 --- a/src/lib/Core/Debug/Command/ShowURLCommand.php +++ b/src/lib/Core/Debug/Command/ShowURLCommand.php @@ -33,10 +33,10 @@ protected function configure() ->setHelp(''); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln($this->session->getCurrentUrl()); - return 0; + return self::SUCCESS; } } diff --git a/src/lib/Core/Debug/Command/TakeScreenshotCommand.php b/src/lib/Core/Debug/Command/TakeScreenshotCommand.php index a2a7a3eb..1401ba11 100644 --- a/src/lib/Core/Debug/Command/TakeScreenshotCommand.php +++ b/src/lib/Core/Debug/Command/TakeScreenshotCommand.php @@ -41,7 +41,7 @@ protected function configure() ->setHelp(''); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $image = $this->session->getScreenshot(); $filePath = sys_get_temp_dir() . \DIRECTORY_SEPARATOR . uniqid('debug') . '.png'; @@ -54,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $response = Uploader::unsigned_upload($filePath, self::PRESET); $output->writeln(sprintf('Open image at %s', $response['secure_url'])); - return 0; + return self::SUCCESS; } catch (Exception $e) { $output->writeln(sprintf('Error while uploading image. %s', $e->getMessage())); diff --git a/src/lib/Subscriber/CreateContentDraft.php b/src/lib/Subscriber/CreateContentDraft.php index 855c8b14..f7f37406 100644 --- a/src/lib/Subscriber/CreateContentDraft.php +++ b/src/lib/Subscriber/CreateContentDraft.php @@ -27,7 +27,7 @@ class CreateContentDraft extends AbstractProcessStage implements EventSubscriber /** @var \Ibexa\Workflow\Behat\Facade\WorkflowFacade */ private $workflowFacade; - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ Events::START_TO_DRAFT => ['execute', 0], diff --git a/src/lib/Subscriber/EditContent.php b/src/lib/Subscriber/EditContent.php index 79b4fa4d..f5fba55a 100644 --- a/src/lib/Subscriber/EditContent.php +++ b/src/lib/Subscriber/EditContent.php @@ -38,7 +38,7 @@ protected function getTransitions(): array ]; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ Events::PUBLISH_TO_EDIT => 'execute', diff --git a/src/lib/Subscriber/InitialStage.php b/src/lib/Subscriber/InitialStage.php index e8315b7e..264d2fef 100644 --- a/src/lib/Subscriber/InitialStage.php +++ b/src/lib/Subscriber/InitialStage.php @@ -31,7 +31,7 @@ protected function getTransitions(): array ]; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ Events::START => 'onStart', diff --git a/src/lib/Subscriber/PublishDraft.php b/src/lib/Subscriber/PublishDraft.php index b852e001..ab480aa6 100644 --- a/src/lib/Subscriber/PublishDraft.php +++ b/src/lib/Subscriber/PublishDraft.php @@ -35,7 +35,7 @@ protected function getTransitions(): array ]; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ Events::REVIEW_TO_PUBLISH => 'execute', diff --git a/src/lib/Subscriber/PublishInTheFuture.php b/src/lib/Subscriber/PublishInTheFuture.php index fe3c2ee9..4617e7ab 100644 --- a/src/lib/Subscriber/PublishInTheFuture.php +++ b/src/lib/Subscriber/PublishInTheFuture.php @@ -56,7 +56,7 @@ protected function doExecute(TransitionEvent $event): void $this->dateBasedPublisherService->schedulePublish($event->content->versionInfo, $this->randomDataGenerator->getRandomDateInTheFuture()); } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ Events::REVIEW_TO_PUBLISH_LATER => 'execute', diff --git a/src/lib/Subscriber/Review.php b/src/lib/Subscriber/Review.php index df35a3f0..2372f2b3 100644 --- a/src/lib/Subscriber/Review.php +++ b/src/lib/Subscriber/Review.php @@ -41,7 +41,7 @@ protected function getTransitions(): array ]; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ Events::DRAFT_TO_REVIEW => 'execute',