From 02b0fdcf500a87c3a4255d70efb5d4916866f5fa Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Sat, 11 May 2024 11:41:49 +0200 Subject: [PATCH] Migrate to php-cs-fixer --- .github/workflows/php-workshop.yml | 2 +- .gitignore | 2 + .php-cs-fixer.php | 13 + app/config.php | 84 +- composer.json | 29 +- composer.lock | 359 ++-- src/Application.php | 18 +- src/Check/CodeExistsCheck.php | 11 +- src/Check/CodeParseCheck.php | 4 +- src/Check/ComposerCheck.php | 1 - src/Check/DatabaseCheck.php | 8 +- src/Check/FileComparisonCheck.php | 2 - src/Check/FileExistsCheck.php | 2 +- src/Check/FunctionRequirementsCheck.php | 5 +- src/Check/SimpleCheckInterface.php | 1 - src/CodeInsertion.php | 2 +- src/CodePatcher.php | 2 +- src/Command/CreditsCommand.php | 4 +- src/Command/HelpCommand.php | 4 +- src/Command/PrintCommand.php | 3 +- src/Command/RunCommand.php | 4 +- src/Command/VerifyCommand.php | 2 +- src/CommandDefinition.php | 4 +- src/CommandRouter.php | 2 +- src/Event/CgiExecuteEvent.php | 4 +- src/Event/CgiExerciseRunnerEvent.php | 10 +- src/Event/CliExecuteEvent.php | 4 +- src/Event/CliExerciseRunnerEvent.php | 4 +- src/Event/functions.php | 2 +- src/Exception/CheckNotApplicableException.php | 4 +- src/Exception/CodeExecutionException.php | 4 +- src/Exception/InvalidArgumentException.php | 12 +- src/Exception/MissingArgumentException.php | 4 +- .../ProblemFileDoesNotExistException.php | 2 +- src/Exception/RuntimeException.php | 4 +- src/Exception/SolutionExecutionException.php | 4 +- src/Exercise/AbstractExercise.php | 16 +- src/Exercise/CgiExercise.php | 1 - src/Exercise/ExerciseInterface.php | 1 - src/Exercise/MockExercise.php | 2 - src/ExerciseCheck/SelfCheck.php | 1 - src/ExerciseDispatcher.php | 5 +- src/ExerciseRenderer.php | 4 +- src/ExerciseRunner/CgiRunner.php | 47 +- src/ExerciseRunner/CliRunner.php | 41 +- .../Context/ExecutionContext.php | 7 +- src/ExerciseRunner/Context/TestContext.php | 12 +- src/ExerciseRunner/CustomVerifyingRunner.php | 4 +- src/ExerciseRunner/EnvironmentManager.php | 8 +- .../Factory/CgiRunnerFactory.php | 5 +- .../Factory/CliRunnerFactory.php | 4 +- .../Factory/CustomVerifyingRunnerFactory.php | 4 +- src/ExerciseRunner/RunnerManager.php | 2 +- src/Factory/EventDispatcherFactory.php | 12 +- src/Factory/MenuFactory.php | 4 +- src/Factory/ResultRendererFactory.php | 4 +- src/Listener/CodePatchListener.php | 5 +- src/Listener/ConfigureCommandListener.php | 4 +- src/Listener/InitialCodeListener.php | 5 +- src/Listener/LazyContainerListener.php | 4 +- src/Listener/PrepareSolutionListener.php | 2 +- src/Listener/SelfCheckListener.php | 5 +- src/Listener/TearDownListener.php | 1 - src/Logger/ConsoleLogger.php | 4 +- src/Logger/Logger.php | 4 +- src/Markdown/CurrentContext.php | 2 +- src/Markdown/Parser/HandleBarParser.php | 5 +- src/Markdown/ProblemFileExtension.php | 2 +- src/Markdown/Shorthands/Cli/AppName.php | 1 - src/Markdown/Shorthands/Cloud/AppName.php | 4 - src/Markdown/Shorthands/Documentation.php | 4 +- src/Output/StdOutput.php | 14 +- src/Patch/ForceStrictTypes.php | 4 +- src/Patch/WrapInTryCatch.php | 12 +- src/Process/DockerProcessFactory.php | 10 +- src/Process/HostProcessFactory.php | 5 +- src/Process/ProcessFactory.php | 2 - src/Process/ProcessInput.php | 5 +- src/Result/Cgi/CgiResult.php | 2 +- src/Result/Cgi/GenericFailure.php | 2 +- src/Result/Cgi/RequestFailure.php | 2 +- src/Result/Cgi/SuccessInterface.php | 4 +- src/Result/Cli/CliResult.php | 2 +- src/Result/Cli/RequestFailure.php | 2 +- src/Result/Cli/SuccessInterface.php | 4 +- src/Result/ComparisonFailure.php | 2 +- src/Result/ComposerFailure.php | 4 +- src/Result/Failure.php | 4 +- src/Result/FileComparisonFailure.php | 2 +- src/Result/FunctionRequirementsFailure.php | 2 +- src/Result/SuccessInterface.php | 4 +- src/ResultAggregator.php | 2 +- .../Cgi/RequestFailureRenderer.php | 4 +- .../Cli/RequestFailureRenderer.php | 6 +- .../ComparisonFailureRenderer.php | 6 +- .../ComposerFailureRenderer.php | 4 +- .../FileComparisonFailureRenderer.php | 6 +- .../FunctionRequirementsFailureRenderer.php | 8 +- src/ResultRenderer/ResultsRenderer.php | 20 +- src/Solution/DirectorySolution.php | 4 +- src/TestUtils/WorkshopExerciseTest.php | 18 +- src/UserState/LocalJsonSerializer.php | 6 +- src/Utils/Collection.php | 4 +- src/Utils/Path.php | 4 +- src/Utils/StringUtils.php | 4 +- test/ApplicationTest.php | 11 +- test/Asset/CgiExerciseImpl.php | 5 +- test/Asset/CliExerciseImpl.php | 4 +- test/Asset/CliExerciseMissingInterface.php | 2 - test/Asset/ComposerExercise.php | 7 +- test/Asset/ExerciseWithInitialCode.php | 6 +- test/Asset/FileComparisonExercise.php | 6 +- test/Asset/FunctionRequirementsExercise.php | 7 +- test/Asset/PatchableExercise.php | 6 +- test/Asset/ProvidesSolutionExercise.php | 6 +- test/Asset/SelfCheckExerciseInterface.php | 4 +- test/Check/CodeExistsCheckTest.php | 5 +- test/Check/CodeParseCheckTest.php | 8 +- test/Check/ComposerCheckTest.php | 12 +- test/Check/DatabaseCheckTest.php | 20 +- test/Check/FileComparisonCheckTest.php | 4 - test/Check/FileExistsCheckTest.php | 7 +- test/Check/FunctionRequirementsCheckTest.php | 11 +- test/Check/PhpLintCheckTest.php | 10 +- test/CodePatcherTest.php | 73 +- test/Command/CreditsCommandTest.php | 10 +- test/Command/HelpCommandTest.php | 2 +- test/Command/RunCommandTest.php | 2 - test/CommandDefinitionTest.php | 6 +- test/CommandRouterTest.php | 45 +- test/ContainerAwareTest.php | 4 +- test/Event/CgiExecuteEventTest.php | 7 +- test/Event/CgiExerciseRunnerEventTest.php | 7 +- test/Event/CliExecuteEventTest.php | 4 - test/Event/CliExerciseRunnerEventTest.php | 8 +- test/Event/EventDispatcherTest.php | 22 +- test/Event/ExerciseRunnerEventTest.php | 7 +- .../MissingArgumentExceptionTest.php | 2 +- test/Exercise/AbstractExerciseTest.php | 2 - test/Exercise/Scenario/CgiScenarioTest.php | 7 +- test/Exercise/Scenario/CliScenarioTest.php | 8 +- test/ExerciseDispatcherTest.php | 21 +- test/ExerciseRendererTest.php | 4 +- test/ExerciseRepositoryTest.php | 3 - test/ExerciseRunner/CgiRunnerTest.php | 22 +- test/ExerciseRunner/CliRunnerTest.php | 10 +- .../Context/ExecutionContextTest.php | 10 +- .../Context/TestContextTest.php | 3 - .../CustomVerifyingRunnerTest.php | 1 - .../ExerciseRunner/EnvironmentManagerTest.php | 3 - .../Factory/CgiRunnerFactoryTest.php | 1 - test/Factory/EventDispatcherFactoryTest.php | 91 +- test/Factory/MenuFactoryTest.php | 11 +- test/FunctionsTest.php | 4 +- test/Listener/CodePatchListenerTest.php | 13 +- .../Listener/ConfigureCommandListenerTest.php | 6 +- test/Listener/InitialCodeListenerTest.php | 18 +- test/Listener/LazyContainerListenerTest.php | 20 +- test/Listener/PrepareSolutionListenerTest.php | 14 +- test/Listener/RealPathListenerTest.php | 3 - test/Listener/SelfCheckListenerTest.php | 1 - test/Logger/LoggerTest.php | 8 +- test/Markdown/Parser/HandleBarParserTest.php | 10 +- test/MarkdownRendererTest.php | 1 - test/MockLogger.php | 2 +- test/Patch/ForceStrictTypesTest.php | 4 +- test/Patch/WrapInTryCatchTest.php | 6 +- test/PatchTest.php | 4 +- test/Result/Cgi/RequestFailureTest.php | 6 +- test/Result/ComposerFailureTest.php | 8 +- test/Result/FailureTest.php | 2 +- test/ResultAggregatorTest.php | 2 +- .../AbstractResultRendererTest.php | 2 +- .../Cgi/RequestFailureRendererTest.php | 6 +- test/ResultRenderer/CgiResultRendererTest.php | 20 +- test/ResultRenderer/CliResultRendererTest.php | 8 +- .../ComposerFailureRendererTest.php | 6 +- test/ResultRenderer/FailureRendererTest.php | 1 - .../FileComparisonFailureRendererTest.php | 2 +- ...unctionRequirementsFailureRendererTest.php | 2 +- test/ResultRenderer/ResultsRendererTest.php | 42 +- test/UserState/LocalJsonSerializerTest.php | 51 +- test/Utils/ArrayObjectTest.php | 2 +- test/Utils/PathTest.php | 18 +- test/Utils/RequestRendererTest.php | 4 +- test/Utils/StringUtilsTest.php | 2 +- vendor-bin/php-cs-fixer/composer.json | 5 + vendor-bin/php-cs-fixer/composer.lock | 1827 +++++++++++++++++ 188 files changed, 2655 insertions(+), 1058 deletions(-) create mode 100644 .php-cs-fixer.php create mode 100644 vendor-bin/php-cs-fixer/composer.json create mode 100644 vendor-bin/php-cs-fixer/composer.lock diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index 134c5709..9d319a28 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -21,7 +21,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - tools: composer:v2 + tools: php-cs-fixer,composer:v2 coverage: none - name: Install Dependencies diff --git a/.gitignore b/.gitignore index 2fce655d..c865fe62 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ program.php .phpunit.result.cache /build +/vendor-bin/**/vendor/ +.php-cs-fixer.cache \ No newline at end of file diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 00000000..4687719d --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,13 @@ +in(__DIR__) + ->exclude('test/res') +; + +return (new PhpCsFixer\Config()) + ->setRules([ + '@PER-CS2.0' => true, + 'no_unused_imports' => true, + ]) + ->setFinder($finder); \ No newline at end of file diff --git a/app/config.php b/app/config.php index e88cf3cc..8d246abf 100644 --- a/app/config.php +++ b/app/config.php @@ -58,7 +58,6 @@ use PhpSchool\PhpWorkshop\Logger\ConsoleLogger; use PhpSchool\PhpWorkshop\Logger\Logger; use PhpSchool\PhpWorkshop\Markdown\CurrentContext; -use PhpSchool\PhpWorkshop\Markdown\Parser\ContextSpecificBlockParser; use PhpSchool\PhpWorkshop\Markdown\ProblemFileExtension; use PhpSchool\PhpWorkshop\Markdown\Renderer\ContextSpecificRenderer; use PhpSchool\PhpWorkshop\Markdown\Shorthands\Cli\AppName; @@ -104,6 +103,7 @@ use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; use Symfony\Component\Filesystem\Filesystem; + use function DI\create; use function DI\factory; use function PhpSchool\PhpWorkshop\canonicalise_path; @@ -147,7 +147,7 @@ $c->get(ComposerCheck::class), $c->get(FunctionRequirementsCheck::class), $c->get(DatabaseCheck::class), - $c->get(FileComparisonCheck::class) + $c->get(FileComparisonCheck::class), ]); }, CommandRouter::class => function (ContainerInterface $c) { @@ -158,16 +158,16 @@ new CommandDefinition('print', [], PrintCommand::class), new CommandDefinition('verify', [], VerifyCommand::class), new CommandDefinition('run', [], RunCommand::class), - new CommandDefinition('credits', [], CreditsCommand::class) + new CommandDefinition('credits', [], CreditsCommand::class), ], 'menu', $c->get(EventDispatcher::class), - $c + $c, ); }, Color::class => function () { - $colors = new Color; + $colors = new Color(); $colors->setForceStyle(true); return $colors; }, @@ -179,7 +179,7 @@ return new ExerciseRepository( array_map(function ($exerciseClass) use ($c) { return $c->get($exerciseClass); - }, $c->get('exercises')) + }, $c->get('exercises')), ); }, @@ -196,12 +196,12 @@ $manager->addFactory(new CliRunnerFactory( $c->get(EventDispatcher::class), $c->get(ProcessFactory::class), - $c->get(EnvironmentManager::class) + $c->get(EnvironmentManager::class), )); $manager->addFactory(new CgiRunnerFactory( $c->get(EventDispatcher::class), $c->get(ProcessFactory::class), - $c->get(EnvironmentManager::class) + $c->get(EnvironmentManager::class), )); $manager->addFactory(new CustomVerifyingRunnerFactory()); return $manager; @@ -222,7 +222,7 @@ $c->get(ExerciseRepository::class), $c->get(UserState::class), $c->get(MarkdownRenderer::class), - $c->get(OutputInterface::class) + $c->get(OutputInterface::class), ); }, @@ -233,7 +233,7 @@ $c->get(UserState::class), $c->get(Serializer::class), $c->get(OutputInterface::class), - $c->get(ResultsRenderer::class) + $c->get(ResultsRenderer::class), ); }, @@ -242,7 +242,7 @@ $c->get(ExerciseRepository::class), $c->get(ExerciseDispatcher::class), $c->get(UserState::class), - $c->get(OutputInterface::class) + $c->get(OutputInterface::class), ); }, @@ -251,7 +251,7 @@ $c->get('coreContributors'), $c->get('appContributors'), $c->get(OutputInterface::class), - $c->get(Color::class) + $c->get(Color::class), ); }, @@ -259,7 +259,7 @@ return new HelpCommand( $c->get('appName'), $c->get(OutputInterface::class), - $c->get(Color::class) + $c->get(Color::class), ); }, @@ -269,14 +269,14 @@ }, PrepareSolutionListener::class => function (ContainerInterface $c) { return new PrepareSolutionListener( - $c->get(ProcessFactory::class) + $c->get(ProcessFactory::class), ); }, CodePatchListener::class => function (ContainerInterface $c) { return new CodePatchListener( $c->get(CodePatcher::class), $c->get(LoggerInterface::class), - $c->get('debugMode') + $c->get('debugMode'), ); }, SelfCheckListener::class => function (ContainerInterface $c) { @@ -289,7 +289,7 @@ return new ConfigureCommandListener( $c->get(UserState::class), $c->get(ExerciseRepository::class), - $c->get(RunnerManager::class) + $c->get(RunnerManager::class), ); }, RealPathListener::class => create(), @@ -320,14 +320,14 @@ //Utils Filesystem::class => create(), Parser::class => function () { - $parserFactory = new ParserFactory; + $parserFactory = new ParserFactory(); return $parserFactory->create(ParserFactory::PREFER_PHP7); }, CodePatcher::class => function (ContainerInterface $c) { $patch = (new Patch()) ->withInsertion(new Insertion(Insertion::TYPE_BEFORE, 'ini_set("display_errors", "1");')) ->withInsertion(new Insertion(Insertion::TYPE_BEFORE, 'error_reporting(E_ALL);')) - ->withInsertion(new Insertion(Insertion ::TYPE_BEFORE, 'date_default_timezone_set("Europe/London");')); + ->withInsertion(new Insertion(Insertion::TYPE_BEFORE, 'date_default_timezone_set("Europe/London");')); return new CodePatcher($c->get(Parser::class), new Standard(), $c->get(LoggerInterface::class), $patch); }, @@ -347,7 +347,7 @@ $c->get(Serializer::class), $c->get(MarkdownRenderer::class), $c->get(Color::class), - $c->get(OutputInterface::class) + $c->get(OutputInterface::class), ); }, ContextSpecificRenderer::class => function (ContainerInterface $c) { @@ -364,7 +364,7 @@ $environment = new Environment([ 'renderer' => [ - 'width' => $terminal->getWidth() + 'width' => $terminal->getWidth(), ], ]); @@ -377,8 +377,8 @@ new Documentation(), new Run($c->get('appName')), new Verify($c->get('appName')), - $c->get(Context::class) - ] + $c->get(Context::class), + ], )); return $environment; @@ -386,20 +386,20 @@ MarkdownRenderer::class => function (ContainerInterface $c) { return new MarkdownRenderer( new DocParser($c->get(Environment::class)), - $c->get(ElementRendererInterface::class) + $c->get(ElementRendererInterface::class), ); }, ElementRendererInterface::class => function (ContainerInterface $c) { return new CliRenderer( $c->get(Environment::class), - $c->get(Color::class) + $c->get(Color::class), ); }, Serializer::class => function (ContainerInterface $c) { return new LocalJsonSerializer( getenv('HOME'), $c->get('workshopTitle'), - $c->get(ExerciseRepository::class) + $c->get(ExerciseRepository::class), ); }, UserState::class => function (ContainerInterface $c) { @@ -409,7 +409,7 @@ return new ResetProgress($c->get(Serializer::class)); }, ResultRendererFactory::class => function (ContainerInterface $c) { - $factory = new ResultRendererFactory; + $factory = new ResultRendererFactory(); $factory->registerRenderer(FunctionRequirementsFailure::class, FunctionRequirementsFailureRenderer::class); $factory->registerRenderer(Failure::class, FailureRenderer::class); $factory->registerRenderer( @@ -417,7 +417,7 @@ CgiResultRenderer::class, function (CgiResult $result) use ($c) { return new CgiResultRenderer($result, $c->get(RequestRenderer::class)); - } + }, ); $factory->registerRenderer(CgiGenericFailure::class, FailureRenderer::class); $factory->registerRenderer(CgiRequestFailure::class, CgiRequestFailureRenderer::class); @@ -439,12 +439,12 @@ function (CgiResult $result) use ($c) { $c->get(Terminal::class), $c->get(ExerciseRepository::class), $c->get(KeyLighter::class), - $c->get(ResultRendererFactory::class) + $c->get(ResultRendererFactory::class), ); }, KeyLighter::class => function () { - $keylighter = new KeyLighter; + $keylighter = new KeyLighter(); $keylighter->init(); return $keylighter; }, @@ -453,26 +453,26 @@ function (CgiResult $result) use ($c) { '@AydinHassan' => 'Aydin Hassan', '@mikeymike' => 'Michael Woodward', '@shakeyShane' => 'Shane Osbourne', - '@chris3ailey' => 'Chris Bailey' + '@chris3ailey' => 'Chris Bailey', ], 'appContributors' => [], 'eventListeners' => [ 'realpath-student-submission' => [ 'verify.start' => [ - containerListener(RealPathListener::class) + containerListener(RealPathListener::class), ], 'run.start' => [ - containerListener(RealPathListener::class) + containerListener(RealPathListener::class), ], ], 'check-exercise-assigned' => [ 'route.pre.resolve.args' => [ - containerListener(CheckExerciseAssignedListener::class) + containerListener(CheckExerciseAssignedListener::class), ], ], 'configure-command-arguments' => [ 'route.pre.resolve.args' => [ - containerListener(ConfigureCommandListener::class) + containerListener(ConfigureCommandListener::class), ], ], 'prepare-solution' => [ @@ -511,26 +511,26 @@ function (CgiResult $result) use ($c) { ], 'self-check' => [ 'verify.post.check' => [ - containerListener(SelfCheckListener::class) + containerListener(SelfCheckListener::class), ], ], 'create-initial-code' => [ 'exercise.selected' => [ - containerListener(InitialCodeListener::class) - ] + containerListener(InitialCodeListener::class), + ], ], 'cleanup-filesystem' => [ 'application.tear-down' => [ - containerListener(TearDownListener::class, 'cleanupTempDir') - ] + containerListener(TearDownListener::class, 'cleanupTempDir'), + ], ], 'decorate-run-output' => [ 'cli.run.student-execute.pre' => [ - containerListener(OutputRunInfoListener::class) + containerListener(OutputRunInfoListener::class), ], 'cgi.run.student-execute.pre' => [ - containerListener(OutputRunInfoListener::class) - ] + containerListener(OutputRunInfoListener::class), + ], ], ], ]; diff --git a/composer.json b/composer.json index 1b092da9..f098d5e3 100644 --- a/composer.json +++ b/composer.json @@ -36,10 +36,10 @@ "require-dev": { "phpunit/phpunit": "^8.5", "composer/composer": "^2.0", - "squizlabs/php_codesniffer": "^3.7", "phpstan/phpstan": "^1.8", "phpstan/extension-installer": "^1.0", - "yoast/phpunit-polyfills": "^0.2.0" + "yoast/phpunit-polyfills": "^0.2.0", + "bamarni/composer-bin-plugin": "^1.8" }, "autoload" : { "psr-4" : { @@ -62,19 +62,26 @@ "@static" ], "unit-tests": "phpunit", - "cs" : [ - "phpcs src --standard=PSR12 --encoding=UTF-8 --exclude=Generic.Files.LineLength", - "phpcs test --standard=PSR12 --encoding=UTF-8 --exclude=Generic.Files.LineLength" - ], - "cs-fix" : [ - "phpcbf src --standard=PSR12 --encoding=UTF-8", - "phpcbf test --standard=PSR12 --encoding=UTF-8" - ], + "cs" : "@cs-fix --dry-run", + "cs-fix" : "php-cs-fixer fix", "static": "phpstan --ansi analyse --level max src" }, + "post-install-cmd": [ + "@composer bin all install --ansi" + ], + "post-update-cmd": [ + "@composer bin all update --ansi" + ], "config": { "allow-plugins": { - "phpstan/extension-installer": true + "phpstan/extension-installer": true, + "bamarni/composer-bin-plugin": true + } + }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false } } } diff --git a/composer.lock b/composer.lock index 3c3e867f..e96b1156 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7ea6de6abfae6d45fbabc34230da77bc", + "content-hash": "5c5d8be82389e614973f05624b5555dd", "packages": [ { "name": "beberlei/assert", @@ -734,21 +734,21 @@ }, { "name": "nikic/php-parser", - "version": "v4.18.0", + "version": "v4.19.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.1" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", @@ -784,9 +784,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" }, - "time": "2023-12-10T21:03:43+00:00" + "time": "2024-03-17T08:10:35+00:00" }, { "name": "php-di/invoker", @@ -1283,20 +1283,20 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -1320,7 +1320,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -1332,9 +1332,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", @@ -1485,16 +1485,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.4.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "shasum": "" }, "require": { @@ -1503,7 +1503,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.4-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -1532,7 +1532,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" }, "funding": [ { @@ -1548,26 +1548,27 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/filesystem", - "version": "v6.4.3", + "version": "v6.4.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb" + "reference": "78dde75f8f6dbbca4ec436a4b0087f7af02076d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb", - "reference": "7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/78dde75f8f6dbbca4ec436a4b0087f7af02076d4", + "reference": "78dde75f8f6dbbca4ec436a4b0087f7af02076d4", "shasum": "" }, "require": { "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" + "symfony/polyfill-mbstring": "~1.8", + "symfony/process": "^5.4|^6.4" }, "type": "library", "autoload": { @@ -1595,7 +1596,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.3" + "source": "https://github.com/symfony/filesystem/tree/v6.4.7" }, "funding": [ { @@ -1611,7 +1612,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:51:35+00:00" + "time": "2024-04-18T09:22:46+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1774,16 +1775,16 @@ }, { "name": "symfony/process", - "version": "v6.4.4", + "version": "v6.4.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "710e27879e9be3395de2b98da3f52a946039f297" + "reference": "cdb1c81c145fd5aa9b0038bab694035020943381" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/710e27879e9be3395de2b98da3f52a946039f297", - "reference": "710e27879e9be3395de2b98da3f52a946039f297", + "url": "https://api.github.com/repos/symfony/process/zipball/cdb1c81c145fd5aa9b0038bab694035020943381", + "reference": "cdb1c81c145fd5aa9b0038bab694035020943381", "shasum": "" }, "require": { @@ -1815,7 +1816,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.4" + "source": "https://github.com/symfony/process/tree/v6.4.7" }, "funding": [ { @@ -1831,34 +1832,91 @@ "type": "tidelift" } ], - "time": "2024-02-20T12:31:00+00:00" + "time": "2024-04-18T09:22:46+00:00" } ], "packages-dev": [ + { + "name": "bamarni/composer-bin-plugin", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/bamarni/composer-bin-plugin.git", + "reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880", + "reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "composer/composer": "^2.0", + "ext-json": "*", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.5", + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Bamarni\\Composer\\Bin\\BamarniBinPlugin" + }, + "autoload": { + "psr-4": { + "Bamarni\\Composer\\Bin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "No conflicts for your bin dependencies", + "keywords": [ + "composer", + "conflict", + "dependency", + "executable", + "isolation", + "tool" + ], + "support": { + "issues": "https://github.com/bamarni/composer-bin-plugin/issues", + "source": "https://github.com/bamarni/composer-bin-plugin/tree/1.8.2" + }, + "time": "2022-10-31T08:38:03+00:00" + }, { "name": "composer/ca-bundle", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "3ce240142f6d59b808dd65c1f52f7a1c252e6cfd" + "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/3ce240142f6d59b808dd65c1f52f7a1c252e6cfd", - "reference": "3ce240142f6d59b808dd65c1f52f7a1c252e6cfd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", + "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", "shasum": "" }, "require": { "ext-openssl": "*", "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan": "^1.10", "psr/log": "^1.0", "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { @@ -1893,7 +1951,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.4.1" + "source": "https://github.com/composer/ca-bundle/tree/1.5.0" }, "funding": [ { @@ -1909,20 +1967,20 @@ "type": "tidelift" } ], - "time": "2024-02-23T10:16:52+00:00" + "time": "2024-03-15T14:00:32+00:00" }, { "name": "composer/class-map-generator", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9" + "reference": "8286a62d243312ed99b3eee20d5005c961adb311" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9", - "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/8286a62d243312ed99b3eee20d5005c961adb311", + "reference": "8286a62d243312ed99b3eee20d5005c961adb311", "shasum": "" }, "require": { @@ -1966,7 +2024,7 @@ ], "support": { "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.1.0" + "source": "https://github.com/composer/class-map-generator/tree/1.1.1" }, "funding": [ { @@ -1982,20 +2040,20 @@ "type": "tidelift" } ], - "time": "2023-06-30T13:58:57+00:00" + "time": "2024-03-15T12:53:41+00:00" }, { "name": "composer/composer", - "version": "2.7.1", + "version": "2.7.6", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "aaf6ed5ccd27c23f79a545e351b4d7842a99d0bc" + "reference": "fabd995783b633829fd4280e272284b39b6ae702" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/aaf6ed5ccd27c23f79a545e351b4d7842a99d0bc", - "reference": "aaf6ed5ccd27c23f79a545e351b4d7842a99d0bc", + "url": "https://api.github.com/repos/composer/composer/zipball/fabd995783b633829fd4280e272284b39b6ae702", + "reference": "fabd995783b633829fd4280e272284b39b6ae702", "shasum": "" }, "require": { @@ -2080,7 +2138,7 @@ "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", "security": "https://github.com/composer/composer/security/policy", - "source": "https://github.com/composer/composer/tree/2.7.1" + "source": "https://github.com/composer/composer/tree/2.7.6" }, "funding": [ { @@ -2096,7 +2154,7 @@ "type": "tidelift" } ], - "time": "2024-02-09T14:26:28+00:00" + "time": "2024-05-04T21:03:15+00:00" }, { "name": "composer/metadata-minifier", @@ -2169,16 +2227,16 @@ }, { "name": "composer/pcre", - "version": "3.1.2", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "4775f35b2d70865807c89d32c8e7385b86eb0ace" + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4775f35b2d70865807c89d32c8e7385b86eb0ace", - "reference": "4775f35b2d70865807c89d32c8e7385b86eb0ace", + "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", "shasum": "" }, "require": { @@ -2220,7 +2278,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.2" + "source": "https://github.com/composer/pcre/tree/3.1.3" }, "funding": [ { @@ -2236,7 +2294,7 @@ "type": "tidelift" } ], - "time": "2024-03-07T15:38:35+00:00" + "time": "2024-03-19T10:26:25+00:00" }, { "name": "composer/semver", @@ -2401,16 +2459,16 @@ }, { "name": "composer/xdebug-handler", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { @@ -2421,7 +2479,7 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -2445,9 +2503,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { @@ -2463,7 +2521,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { "name": "doctrine/instantiator", @@ -2828,16 +2886,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.60", + "version": "1.10.67", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "95dcea7d6c628a3f2f56d091d8a0219485a86bbe" + "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/95dcea7d6c628a3f2f56d091d8a0219485a86bbe", - "reference": "95dcea7d6c628a3f2f56d091d8a0219485a86bbe", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/16ddbe776f10da6a95ebd25de7c1dbed397dc493", + "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493", "shasum": "" }, "require": { @@ -2880,13 +2938,9 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2024-03-07T13:30:19+00:00" + "time": "2024-04-16T07:22:02+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3187,16 +3241,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.37", + "version": "8.5.38", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fce30f306cee78be33ba00c8f9a853f41db0491b" + "reference": "1ecad678646c817a29e55a32c930f3601c3f5a8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fce30f306cee78be33ba00c8f9a853f41db0491b", - "reference": "fce30f306cee78be33ba00c8f9a853f41db0491b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1ecad678646c817a29e55a32c930f3601c3f5a8c", + "reference": "1ecad678646c817a29e55a32c930f3601c3f5a8c", "shasum": "" }, "require": { @@ -3265,7 +3319,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.37" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.38" }, "funding": [ { @@ -3281,7 +3335,7 @@ "type": "tidelift" } ], - "time": "2024-03-06T06:27:42+00:00" + "time": "2024-04-05T04:31:23+00:00" }, { "name": "react/promise", @@ -4257,98 +4311,18 @@ }, "time": "2023-09-03T09:24:00+00:00" }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.9.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" - }, - "bin": [ - "bin/phpcbf", - "bin/phpcs" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "Former lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "Current lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", - "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", - "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" - }, - "funding": [ - { - "url": "https://github.com/PHPCSStandards", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", - "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" - } - ], - "time": "2024-02-16T15:06:51+00:00" - }, { "name": "symfony/console", - "version": "v7.0.4", + "version": "v7.0.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6b099f3306f7c9c2d2786ed736d0026b2903205f" + "reference": "c981e0e9380ce9f146416bde3150c79197ce9986" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6b099f3306f7c9c2d2786ed736d0026b2903205f", - "reference": "6b099f3306f7c9c2d2786ed736d0026b2903205f", + "url": "https://api.github.com/repos/symfony/console/zipball/c981e0e9380ce9f146416bde3150c79197ce9986", + "reference": "c981e0e9380ce9f146416bde3150c79197ce9986", "shasum": "" }, "require": { @@ -4412,7 +4386,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.0.4" + "source": "https://github.com/symfony/console/tree/v7.0.7" }, "funding": [ { @@ -4428,20 +4402,20 @@ "type": "tidelift" } ], - "time": "2024-02-22T20:27:20+00:00" + "time": "2024-04-18T09:29:19+00:00" }, { "name": "symfony/finder", - "version": "v7.0.0", + "version": "v7.0.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56" + "reference": "4d58f0f4fe95a30d7b538d71197135483560b97c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", - "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", + "url": "https://api.github.com/repos/symfony/finder/zipball/4d58f0f4fe95a30d7b538d71197135483560b97c", + "reference": "4d58f0f4fe95a30d7b538d71197135483560b97c", "shasum": "" }, "require": { @@ -4476,7 +4450,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.0.0" + "source": "https://github.com/symfony/finder/tree/v7.0.7" }, "funding": [ { @@ -4492,7 +4466,7 @@ "type": "tidelift" } ], - "time": "2023-10-31T17:59:56+00:00" + "time": "2024-04-28T11:44:19+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -4887,21 +4861,22 @@ }, { "name": "symfony/service-contracts", - "version": "v3.4.1", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^1.1|^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -4909,7 +4884,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.4-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -4949,7 +4924,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" }, "funding": [ { @@ -4965,20 +4940,20 @@ "type": "tidelift" } ], - "time": "2023-12-26T14:02:43+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/string", - "version": "v7.0.4", + "version": "v7.0.7", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f5832521b998b0bec40bee688ad5de98d4cf111b" + "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f5832521b998b0bec40bee688ad5de98d4cf111b", - "reference": "f5832521b998b0bec40bee688ad5de98d4cf111b", + "url": "https://api.github.com/repos/symfony/string/zipball/e405b5424dc2528e02e31ba26b83a79fd4eb8f63", + "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63", "shasum": "" }, "require": { @@ -5035,7 +5010,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.4" + "source": "https://github.com/symfony/string/tree/v7.0.7" }, "funding": [ { @@ -5051,7 +5026,7 @@ "type": "tidelift" } ], - "time": "2024-02-01T13:17:36+00:00" + "time": "2024-04-18T09:29:19+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/Application.php b/src/Application.php index 8075c0cc..a2af0c00 100644 --- a/src/Application.php +++ b/src/Application.php @@ -133,7 +133,7 @@ public function addResult(string $resultClass, string $resultRendererClass): voi $this->results[] = [ 'resultClass' => $resultClass, - 'resultRendererClass' => $resultRendererClass + 'resultRendererClass' => $resultRendererClass, ]; } @@ -181,7 +181,7 @@ public function configure(bool $debugMode = false): ContainerInterface foreach ($this->exercises as $exercise) { if (false === $container->has($exercise)) { throw new RuntimeException( - sprintf('No DI config found for exercise: "%s". Register a factory.', $exercise) + sprintf('No DI config found for exercise: "%s". Register a factory.', $exercise), ); } } @@ -191,7 +191,7 @@ public function configure(bool $debugMode = false): ContainerInterface foreach ($this->checks as $check) { if (false === $container->has($check)) { throw new RuntimeException( - sprintf('No DI config found for check: "%s". Register a factory.', $check) + sprintf('No DI config found for check: "%s". Register a factory.', $check), ); } @@ -202,8 +202,8 @@ public function configure(bool $debugMode = false): ContainerInterface sprintf( 'Check: "%s" does not implement the required interface: "%s".', $check, - CheckInterface::class - ) + CheckInterface::class, + ), ); } @@ -265,8 +265,8 @@ public function run(): int 'Argument%s: "%s" %s missing!', count($e->getMissingArguments()) > 1 ? 's' : '', implode('", "', $e->getMissingArguments()), - count($e->getMissingArguments()) > 1 ? 'are' : 'is' - ) + count($e->getMissingArguments()) > 1 ? 'are' : 'is', + ), ); return 1; } catch (\Throwable $e) { @@ -303,7 +303,7 @@ private function getContainer(bool $debugMode): Container $fwConfig['eventListeners'] = array_merge_recursive( $fwConfig['eventListeners'], - $diConfig['eventListeners'] ?? [] + $diConfig['eventListeners'] ?? [], ); unset($diConfig['eventListeners']); @@ -318,7 +318,7 @@ private function getContainer(bool $debugMode): Container 'workshopLogo' => $this->logo, 'bgColour' => $this->bgColour, 'fgColour' => $this->fgColour, - ] + ], ); $containerBuilder->useAutowiring(false); diff --git a/src/Check/CodeExistsCheck.php b/src/Check/CodeExistsCheck.php index 79067833..a3b16621 100644 --- a/src/Check/CodeExistsCheck.php +++ b/src/Check/CodeExistsCheck.php @@ -7,7 +7,6 @@ use PhpParser\Error; use PhpParser\ErrorHandler; use PhpParser\Node\Stmt\InlineHTML; -use PhpParser\NodeFinder; use PhpParser\Parser; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; @@ -19,9 +18,7 @@ class CodeExistsCheck implements SimpleCheckInterface { - public function __construct(private Parser $parser) - { - } + public function __construct(private Parser $parser) {} public function getName(): string { @@ -36,10 +33,8 @@ public function getName(): string */ public function check(ExecutionContext $context): ResultInterface { - $noopHandler = new class implements ErrorHandler { - public function handleError(Error $error): void - { - } + $noopHandler = new class () implements ErrorHandler { + public function handleError(Error $error): void {} }; $code = (string) file_get_contents($context->getEntryPoint()); diff --git a/src/Check/CodeParseCheck.php b/src/Check/CodeParseCheck.php index 4be59113..cdf56fbd 100644 --- a/src/Check/CodeParseCheck.php +++ b/src/Check/CodeParseCheck.php @@ -20,9 +20,7 @@ */ class CodeParseCheck implements SimpleCheckInterface { - public function __construct(private Parser $parser) - { - } + public function __construct(private Parser $parser) {} /** * Return the check's name diff --git a/src/Check/ComposerCheck.php b/src/Check/ComposerCheck.php index 9e099082..c3088861 100644 --- a/src/Check/ComposerCheck.php +++ b/src/Check/ComposerCheck.php @@ -6,7 +6,6 @@ use InvalidArgumentException; use PhpSchool\PhpWorkshop\ComposerUtil\LockFileParser; -use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseCheck\ComposerExerciseCheck; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; diff --git a/src/Check/DatabaseCheck.php b/src/Check/DatabaseCheck.php index 658865b0..6d9545fe 100644 --- a/src/Check/DatabaseCheck.php +++ b/src/Check/DatabaseCheck.php @@ -66,7 +66,7 @@ public function attach(EventDispatcher $eventDispatcher): void { if (file_exists($this->databaseDirectory)) { throw new RuntimeException( - sprintf('Database directory: "%s" already exists', $this->databaseDirectory) + sprintf('Database directory: "%s" already exists', $this->databaseDirectory), ); } @@ -102,7 +102,7 @@ public function attach(EventDispatcher $eventDispatcher): void ['cli.verify.student-execute.pre', 'cli.run.student-execute.pre'], function (CliExecuteEvent $e) { $e->prependArg($this->userDsn); - } + }, ); $eventDispatcher->insertVerifier('verify.finish', function (Event $e) use ($db) { @@ -121,14 +121,14 @@ function (CliExecuteEvent $e) { [ 'cli.verify.reference-execute.fail', 'verify.finish', - 'run.finish' + 'run.finish', ], function () use ($db) { unset($db); $this->unlink($this->userDatabasePath); $this->unlink($this->solutionDatabasePath); rmdir($this->databaseDirectory); - } + }, ); } diff --git a/src/Check/FileComparisonCheck.php b/src/Check/FileComparisonCheck.php index 87bf5ddb..4f01dd08 100644 --- a/src/Check/FileComparisonCheck.php +++ b/src/Check/FileComparisonCheck.php @@ -6,9 +6,7 @@ use InvalidArgumentException; use PhpSchool\PhpWorkshop\Exception\SolutionFileDoesNotExistException; -use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; -use PhpSchool\PhpWorkshop\Exercise\ProvidesSolution; use PhpSchool\PhpWorkshop\ExerciseCheck\FileComparisonExerciseCheck; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; use PhpSchool\PhpWorkshop\Input\Input; diff --git a/src/Check/FileExistsCheck.php b/src/Check/FileExistsCheck.php index b8a9ee25..45a7ce05 100644 --- a/src/Check/FileExistsCheck.php +++ b/src/Check/FileExistsCheck.php @@ -39,7 +39,7 @@ public function check(ExecutionContext $context): ResultInterface return Failure::fromCheckAndReason( $this, - sprintf('File: "%s" does not exist', $context->getEntryPoint()) + sprintf('File: "%s" does not exist', $context->getEntryPoint()), ); } diff --git a/src/Check/FunctionRequirementsCheck.php b/src/Check/FunctionRequirementsCheck.php index d644a661..ce37bcd2 100644 --- a/src/Check/FunctionRequirementsCheck.php +++ b/src/Check/FunctionRequirementsCheck.php @@ -9,7 +9,6 @@ use PhpParser\Node\Expr\FuncCall; use PhpParser\NodeTraverser; use PhpParser\Parser; -use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseCheck\FunctionRequirementsExerciseCheck; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; @@ -26,9 +25,7 @@ */ class FunctionRequirementsCheck implements SimpleCheckInterface { - public function __construct(private Parser $parser) - { - } + public function __construct(private Parser $parser) {} /** * Return the check's name. diff --git a/src/Check/SimpleCheckInterface.php b/src/Check/SimpleCheckInterface.php index b1fbf63e..f977bf71 100644 --- a/src/Check/SimpleCheckInterface.php +++ b/src/Check/SimpleCheckInterface.php @@ -4,7 +4,6 @@ namespace PhpSchool\PhpWorkshop\Check; -use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; use PhpSchool\PhpWorkshop\Input\Input; diff --git a/src/CodeInsertion.php b/src/CodeInsertion.php index 981fa79b..9d1d2569 100644 --- a/src/CodeInsertion.php +++ b/src/CodeInsertion.php @@ -53,7 +53,7 @@ public function __construct(string $type, string $code) { if (!in_array($type, $this->types, true)) { throw new InvalidArgumentException( - sprintf('Value "%s" is not an element of the valid values: %s', $type, implode(', ', $this->types)) + sprintf('Value "%s" is not an element of the valid values: %s', $type, implode(', ', $this->types)), ); } diff --git a/src/CodePatcher.php b/src/CodePatcher.php index df4249ce..6d388235 100644 --- a/src/CodePatcher.php +++ b/src/CodePatcher.php @@ -151,7 +151,7 @@ private function applyCodeInsertion(CodeInsertion $codeInsertion, array $stateme } catch (Error $e) { $this->logger->critical( 'Code Insertion could not be parsed: ' . $e->getMessage(), - ['code' => $codeInsertion->getCode()] + ['code' => $codeInsertion->getCode()], ); return $statements; } diff --git a/src/Command/CreditsCommand.php b/src/Command/CreditsCommand.php index 6a7f7f42..7a274cc6 100644 --- a/src/Command/CreditsCommand.php +++ b/src/Command/CreditsCommand.php @@ -75,7 +75,7 @@ public function __invoke(): void } $this->output->writeLine( - $this->color->__invoke("PHP School is bought to you by...")->yellow()->__toString() + $this->color->__invoke("PHP School is bought to you by...")->yellow()->__toString(), ); $this->output->emptyLine(); $this->writeContributors($this->coreContributors); @@ -88,7 +88,7 @@ public function __invoke(): void $this->output->emptyLine(); $this->output->writeLine( - $this->color->__invoke("This workshop is brought to you by...")->yellow()->__toString() + $this->color->__invoke("This workshop is brought to you by...")->yellow()->__toString(), ); $this->output->writeLine(""); $this->writeContributors($this->appContributors); diff --git a/src/Command/HelpCommand.php b/src/Command/HelpCommand.php index bf402c0b..fd4c26aa 100644 --- a/src/Command/HelpCommand.php +++ b/src/Command/HelpCommand.php @@ -58,7 +58,7 @@ public function __invoke(): void $this->output->writeLine(" Show the people who made this happen."); $this->output->writeLine(""); $this->output->writeLine( - (string) $this->color->__invoke('Having trouble with a PHPSchool exercise?')->yellow()->bold() + (string) $this->color->__invoke('Having trouble with a PHPSchool exercise?')->yellow()->bold(), ); $this->output->writeLine(""); $this->output->writeLine(" A team of expert helper elves is eagerly waiting to assist you in"); @@ -73,7 +73,7 @@ public function __invoke(): void $this->output->writeLine(" https://chat.stackoverflow.com/rooms/11/php"); $this->output->writeLine(""); $this->output->writeLine( - (string) $this->color->__invoke('Found a bug with PHPSchool or just want to contribute?')->yellow()->bold() + (string) $this->color->__invoke('Found a bug with PHPSchool or just want to contribute?')->yellow()->bold(), ); $this->output->writeLine(" The official repository for PHPSchool is:"); $this->output->writeLine(" https://github.com/php-school/php-workshop"); diff --git a/src/Command/PrintCommand.php b/src/Command/PrintCommand.php index ebf27c45..fba683cb 100644 --- a/src/Command/PrintCommand.php +++ b/src/Command/PrintCommand.php @@ -4,7 +4,6 @@ namespace PhpSchool\PhpWorkshop\Command; -use PhpSchool\PhpWorkshop\Exception\InvalidArgumentException; use PhpSchool\PhpWorkshop\Exception\ProblemFileDoesNotExistException; use PhpSchool\PhpWorkshop\ExerciseRepository; use PhpSchool\PhpWorkshop\MarkdownRenderer; @@ -53,7 +52,7 @@ public function __construct( ExerciseRepository $exerciseRepository, UserState $userState, MarkdownRenderer $markdownRenderer, - OutputInterface $output + OutputInterface $output, ) { $this->appName = $appName; $this->markdownRenderer = $markdownRenderer; diff --git a/src/Command/RunCommand.php b/src/Command/RunCommand.php index 6de175eb..b343229d 100644 --- a/src/Command/RunCommand.php +++ b/src/Command/RunCommand.php @@ -4,12 +4,10 @@ namespace PhpSchool\PhpWorkshop\Command; -use PhpSchool\PhpWorkshop\Check\FileExistsCheck; use PhpSchool\PhpWorkshop\ExerciseDispatcher; use PhpSchool\PhpWorkshop\ExerciseRepository; use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Output\OutputInterface; -use PhpSchool\PhpWorkshop\Result\Success; use PhpSchool\PhpWorkshop\UserState\UserState; /** @@ -47,7 +45,7 @@ public function __construct( ExerciseRepository $exerciseRepository, ExerciseDispatcher $exerciseDispatcher, UserState $userState, - OutputInterface $output + OutputInterface $output, ) { $this->output = $output; $this->exerciseRepository = $exerciseRepository; diff --git a/src/Command/VerifyCommand.php b/src/Command/VerifyCommand.php index 51f37323..c8349756 100644 --- a/src/Command/VerifyCommand.php +++ b/src/Command/VerifyCommand.php @@ -61,7 +61,7 @@ public function __construct( UserState $userState, Serializer $userStateSerializer, OutputInterface $output, - ResultsRenderer $resultsRenderer + ResultsRenderer $resultsRenderer, ) { $this->output = $output; $this->exerciseRepository = $exerciseRepository; diff --git a/src/CommandDefinition.php b/src/CommandDefinition.php index e8996aaf..a32e77ab 100644 --- a/src/CommandDefinition.php +++ b/src/CommandDefinition.php @@ -53,7 +53,7 @@ public function addArgument($argument): self throw InvalidArgumentException::notValidParameter( 'argument', ['string', CommandArgument::class], - $argument + $argument, ); } @@ -69,7 +69,7 @@ public function addArgument($argument): self $previousArgument = end($this->args); if ($previousArgument->isOptional() && $argument->isRequired()) { throw new InvalidArgumentException(sprintf( - 'A required argument cannot follow an optional argument' + 'A required argument cannot follow an optional argument', )); } diff --git a/src/CommandRouter.php b/src/CommandRouter.php index 9043282c..605a6439 100644 --- a/src/CommandRouter.php +++ b/src/CommandRouter.php @@ -55,7 +55,7 @@ public function __construct( array $commands, string $default, EventDispatcher $eventDispatcher, - ContainerInterface $container + ContainerInterface $container, ) { foreach ($commands as $command) { $this->addCommand($command); diff --git a/src/Event/CgiExecuteEvent.php b/src/Event/CgiExecuteEvent.php index 67c0fa9f..a7e5cf28 100644 --- a/src/Event/CgiExecuteEvent.php +++ b/src/Event/CgiExecuteEvent.php @@ -4,10 +4,8 @@ namespace PhpSchool\PhpWorkshop\Event; -use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\Scenario\CgiScenario; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; -use PhpSchool\PhpWorkshop\Input\Input; use Psr\Http\Message\RequestInterface; /** @@ -28,7 +26,7 @@ public function __construct( ExecutionContext $context, CgiScenario $scenario, RequestInterface $request, - array $parameters = [] + array $parameters = [], ) { $parameters['request'] = $request; parent::__construct($name, $context, $scenario, $parameters); diff --git a/src/Event/CgiExerciseRunnerEvent.php b/src/Event/CgiExerciseRunnerEvent.php index de8f8362..dc4925b0 100644 --- a/src/Event/CgiExerciseRunnerEvent.php +++ b/src/Event/CgiExerciseRunnerEvent.php @@ -1,11 +1,9 @@ scenario = $scenario; parent::__construct($name, $context, $parameters); diff --git a/src/Event/CliExecuteEvent.php b/src/Event/CliExecuteEvent.php index ed855b06..b9ea0277 100644 --- a/src/Event/CliExecuteEvent.php +++ b/src/Event/CliExecuteEvent.php @@ -4,10 +4,8 @@ namespace PhpSchool\PhpWorkshop\Event; -use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\Scenario\CliScenario; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Utils\Collection; /** @@ -31,7 +29,7 @@ public function __construct( ExecutionContext $context, CliScenario $scenario, Collection $args, - array $parameters = [] + array $parameters = [], ) { $parameters['args'] = $args; parent::__construct($name, $context, $scenario, $parameters); diff --git a/src/Event/CliExerciseRunnerEvent.php b/src/Event/CliExerciseRunnerEvent.php index de635742..a2a46be7 100644 --- a/src/Event/CliExerciseRunnerEvent.php +++ b/src/Event/CliExerciseRunnerEvent.php @@ -2,10 +2,8 @@ namespace PhpSchool\PhpWorkshop\Event; -use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\Scenario\CliScenario; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; -use PhpSchool\PhpWorkshop\Input\Input; class CliExerciseRunnerEvent extends ExerciseRunnerEvent { @@ -18,7 +16,7 @@ public function __construct( string $name, ExecutionContext $context, CliScenario $scenario, - array $parameters = [] + array $parameters = [], ) { $this->scenario = $scenario; parent::__construct($name, $context, $parameters); diff --git a/src/Event/functions.php b/src/Event/functions.php index 70d5cd68..5f9436f4 100644 --- a/src/Event/functions.php +++ b/src/Event/functions.php @@ -8,6 +8,6 @@ function containerListener(string $service, string $method = '__invoke'): callable { - return fn () => new ContainerListenerHelper($service, $method); + return fn() => new ContainerListenerHelper($service, $method); } } diff --git a/src/Exception/CheckNotApplicableException.php b/src/Exception/CheckNotApplicableException.php index 68d7f0bd..0a9939c4 100644 --- a/src/Exception/CheckNotApplicableException.php +++ b/src/Exception/CheckNotApplicableException.php @@ -28,8 +28,8 @@ public static function fromCheckAndExercise(CheckInterface $check, ExerciseInter 'Check: "%s" cannot process exercise: "%s" with type: "%s"', $check->getName(), $exercise->getName(), - $exercise->getType() - ) + $exercise->getType(), + ), ); } } diff --git a/src/Exception/CodeExecutionException.php b/src/Exception/CodeExecutionException.php index 2e4e5561..aff5c67a 100644 --- a/src/Exception/CodeExecutionException.php +++ b/src/Exception/CodeExecutionException.php @@ -23,8 +23,8 @@ public static function fromProcess(Process $process): self return new self( sprintf( 'PHP Code failed to execute. Error: "%s"', - trim($process->getErrorOutput() ?: $process->getOutput()) - ) + trim($process->getErrorOutput() ?: $process->getOutput()), + ), ); } } diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index ddfab528..f66e96a2 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -22,8 +22,8 @@ public static function typeMisMatch(string $expected, $actual): self sprintf( 'Expected: "%s" Received: "%s"', $expected, - is_object($actual) ? get_class($actual) : gettype($actual) - ) + is_object($actual) ? get_class($actual) : gettype($actual), + ), ); } @@ -42,8 +42,8 @@ public static function notValidParameter(string $parameterName, array $allowedVa 'Parameter: "%s" can only be one of: "%s" Received: "%s"', $parameterName, self::stringify($allowedValues), - self::stringify($actualValue) - ) + self::stringify($actualValue), + ), ); } @@ -58,8 +58,8 @@ public static function missingImplements(object $object, string $requiredInterfa sprintf( '"%s" is required to implement "%s", but it does not', get_class($object), - $requiredInterface - ) + $requiredInterface, + ), ); } diff --git a/src/Exception/MissingArgumentException.php b/src/Exception/MissingArgumentException.php index d4dbcc65..b52d9d91 100644 --- a/src/Exception/MissingArgumentException.php +++ b/src/Exception/MissingArgumentException.php @@ -29,8 +29,8 @@ public function __construct(string $commandName, array $missingArguments) sprintf( 'Command: "%s" is missing the following arguments: "%s"', $commandName, - implode('", "', $missingArguments) - ) + implode('", "', $missingArguments), + ), ); } diff --git a/src/Exception/ProblemFileDoesNotExistException.php b/src/Exception/ProblemFileDoesNotExistException.php index 698e198a..54129972 100644 --- a/src/Exception/ProblemFileDoesNotExistException.php +++ b/src/Exception/ProblemFileDoesNotExistException.php @@ -12,7 +12,7 @@ public static function fromFile(string $file): self { return new self(sprintf( 'Exercise problem file: "%s" does not exist or is not readable', - canonicalise_path($file) + canonicalise_path($file), )); } } diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php index 1907349e..011f5948 100644 --- a/src/Exception/RuntimeException.php +++ b/src/Exception/RuntimeException.php @@ -4,6 +4,4 @@ namespace PhpSchool\PhpWorkshop\Exception; -class RuntimeException extends \RuntimeException -{ -} +class RuntimeException extends \RuntimeException {} diff --git a/src/Exception/SolutionExecutionException.php b/src/Exception/SolutionExecutionException.php index ecfd89c9..44515b77 100644 --- a/src/Exception/SolutionExecutionException.php +++ b/src/Exception/SolutionExecutionException.php @@ -10,6 +10,4 @@ * Represents the situation where a reference solution cannot be executed (this should only really happen during * workshop development). */ -class SolutionExecutionException extends RuntimeException -{ -} +class SolutionExecutionException extends RuntimeException {} diff --git a/src/Exercise/AbstractExercise.php b/src/Exercise/AbstractExercise.php index 87a0b241..30faac17 100644 --- a/src/Exercise/AbstractExercise.php +++ b/src/Exercise/AbstractExercise.php @@ -4,9 +4,7 @@ namespace PhpSchool\PhpWorkshop\Exercise; -use PhpSchool\PhpWorkshop\Check\FileComparisonCheck; use PhpSchool\PhpWorkshop\Event\EventDispatcher; -use PhpSchool\PhpWorkshop\ExerciseDispatcher; use PhpSchool\PhpWorkshop\Solution\SingleFileSolution; use PhpSchool\PhpWorkshop\Solution\SolutionInterface; use ReflectionClass; @@ -41,9 +39,9 @@ public function getSolution(): SolutionInterface sprintf( '%s/../../exercises/%s/solution/solution.php', dirname((string) (new ReflectionClass(static::class))->getFileName()), - self::normaliseName($this->getName()) - ) - ) + self::normaliseName($this->getName()), + ), + ), ); } @@ -66,9 +64,7 @@ public function getProblem(): string * * @return void */ - public function tearDown(): void - { - } + public function tearDown(): void {} /** * @param string $name @@ -87,7 +83,5 @@ public function getRequiredChecks(): array return []; } - public function defineListeners(EventDispatcher $dispatcher): void - { - } + public function defineListeners(EventDispatcher $dispatcher): void {} } diff --git a/src/Exercise/CgiExercise.php b/src/Exercise/CgiExercise.php index 6f556af9..14cef8a1 100644 --- a/src/Exercise/CgiExercise.php +++ b/src/Exercise/CgiExercise.php @@ -5,7 +5,6 @@ namespace PhpSchool\PhpWorkshop\Exercise; use PhpSchool\PhpWorkshop\Exercise\Scenario\CgiScenario; -use Psr\Http\Message\RequestInterface; /** * This interface describes the additional methods a CGI type exercise should implement. diff --git a/src/Exercise/ExerciseInterface.php b/src/Exercise/ExerciseInterface.php index 10443374..58d8d566 100644 --- a/src/Exercise/ExerciseInterface.php +++ b/src/Exercise/ExerciseInterface.php @@ -5,7 +5,6 @@ namespace PhpSchool\PhpWorkshop\Exercise; use PhpSchool\PhpWorkshop\Event\EventDispatcher; -use PhpSchool\PhpWorkshop\ExerciseDispatcher; /** * This interface describes all of the methods an exercise diff --git a/src/Exercise/MockExercise.php b/src/Exercise/MockExercise.php index a8268785..90cbe04f 100644 --- a/src/Exercise/MockExercise.php +++ b/src/Exercise/MockExercise.php @@ -2,8 +2,6 @@ namespace PhpSchool\PhpWorkshop\Exercise; -use PhpSchool\PhpWorkshop\ExerciseDispatcher; - class MockExercise extends AbstractExercise implements ExerciseInterface { public function getName(): string diff --git a/src/ExerciseCheck/SelfCheck.php b/src/ExerciseCheck/SelfCheck.php index 7063aa22..ba58893f 100644 --- a/src/ExerciseCheck/SelfCheck.php +++ b/src/ExerciseCheck/SelfCheck.php @@ -5,7 +5,6 @@ namespace PhpSchool\PhpWorkshop\ExerciseCheck; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Result\ResultInterface; /** diff --git a/src/ExerciseDispatcher.php b/src/ExerciseDispatcher.php index 1ff52300..b4c7142f 100644 --- a/src/ExerciseDispatcher.php +++ b/src/ExerciseDispatcher.php @@ -49,8 +49,7 @@ public function __construct( private ResultAggregator $results, private EventDispatcher $eventDispatcher, private CheckRepository $checkRepository, - ) { - } + ) {} /** * Queue a specific check to be run when the exercise is verified. When the exercise is verified @@ -80,7 +79,7 @@ public function requireCheck(string $requiredCheck): void throw InvalidArgumentException::notValidParameter( 'position', [SimpleCheckInterface::CHECK_BEFORE, SimpleCheckInterface::CHECK_AFTER], - $check->getPosition() + $check->getPosition(), ); } diff --git a/src/ExerciseRenderer.php b/src/ExerciseRenderer.php index 987b28e5..36dba649 100644 --- a/src/ExerciseRenderer.php +++ b/src/ExerciseRenderer.php @@ -68,7 +68,7 @@ public function __construct( Serializer $userStateSerializer, MarkdownRenderer $markdownRenderer, Color $color, - OutputInterface $output + OutputInterface $output, ) { $this->appName = $appName; $this->exerciseRepository = $exerciseRepository; @@ -133,7 +133,7 @@ private function helpLine(string $text, string $cmd): string " %s %s: %s\n", $this->color->__invoke("»")->bold()->__toString(), $text, - $cmd + $cmd, ); } } diff --git a/src/ExerciseRunner/CgiRunner.php b/src/ExerciseRunner/CgiRunner.php index b9677584..0986cef4 100644 --- a/src/ExerciseRunner/CgiRunner.php +++ b/src/ExerciseRunner/CgiRunner.php @@ -13,7 +13,6 @@ use PhpSchool\PhpWorkshop\Event\CgiExerciseRunnerEvent; use PhpSchool\PhpWorkshop\Event\Event; use PhpSchool\PhpWorkshop\Event\EventDispatcher; -use PhpSchool\PhpWorkshop\Event\ExerciseRunnerEvent; use PhpSchool\PhpWorkshop\Exception\CodeExecutionException; use PhpSchool\PhpWorkshop\Exception\SolutionExecutionException; use PhpSchool\PhpWorkshop\Exercise\CgiExercise; @@ -30,15 +29,10 @@ use PhpSchool\PhpWorkshop\Result\Cgi\Success; use PhpSchool\PhpWorkshop\Result\Cgi\ResultInterface as CgiResultInterface; use PhpSchool\PhpWorkshop\Result\ResultInterface; -use PhpSchool\PhpWorkshop\Utils\RequestRenderer; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -use RuntimeException; -use Symfony\Component\Process\ExecutableFinder; use Symfony\Component\Process\Process; -use function PHPStan\dumpType; - /** * The `CGI` runner. This runner executes solutions as if they were behind a web-server. They populate the `$_SERVER`, * `$_GET` & `$_POST` super globals with information based of the request objects returned from the exercise. @@ -66,9 +60,8 @@ public function __construct( private CgiExercise $exercise, private EventDispatcher $eventDispatcher, private ProcessFactory $processFactory, - private EnvironmentManager $environmentManager - ) { - } + private EnvironmentManager $environmentManager, + ) {} /** * @return string @@ -119,8 +112,8 @@ public function verify(ExecutionContext $context): ResultInterface function (RequestInterface $request) use ($context, $scenario) { return $this->doVerify($context, $scenario, $request); }, - $scenario->getExecutions() - ) + $scenario->getExecutions(), + ), ); $this->eventDispatcher->dispatch(new CgiExerciseRunnerEvent('cgi.verify.finish', $context, $scenario)); @@ -132,7 +125,7 @@ private function doVerify(ExecutionContext $context, CgiScenario $scenario, Requ try { /** @var CgiExecuteEvent $event */ $event = $this->eventDispatcher->dispatch( - new CgiExecuteEvent('cgi.verify.reference-execute.pre', $context, $scenario, $request) + new CgiExecuteEvent('cgi.verify.reference-execute.pre', $context, $scenario, $request), ); $solutionResponse = $this->executePhpFile( $context, @@ -140,7 +133,7 @@ private function doVerify(ExecutionContext $context, CgiScenario $scenario, Requ $context->getReferenceExecutionDirectory(), $this->exercise->getSolution()->getEntryPoint()->getRelativePath(), $event->getRequest(), - 'reference' + 'reference', ); } catch (CodeExecutionException $e) { $this->eventDispatcher->dispatch( @@ -149,8 +142,8 @@ private function doVerify(ExecutionContext $context, CgiScenario $scenario, Requ $context, $scenario, $request, - ['exception' => $e] - ) + ['exception' => $e], + ), ); throw new SolutionExecutionException($e->getMessage()); } @@ -158,7 +151,7 @@ private function doVerify(ExecutionContext $context, CgiScenario $scenario, Requ try { /** @var CgiExecuteEvent $event */ $event = $this->eventDispatcher->dispatch( - new CgiExecuteEvent('cgi.verify.student-execute.pre', $context, $scenario, $request) + new CgiExecuteEvent('cgi.verify.student-execute.pre', $context, $scenario, $request), ); $userResponse = $this->executePhpFile( $context, @@ -166,7 +159,7 @@ private function doVerify(ExecutionContext $context, CgiScenario $scenario, Requ $context->getStudentExecutionDirectory(), $context->getEntryPoint(), $event->getRequest(), - 'student' + 'student', ); } catch (CodeExecutionException $e) { $this->eventDispatcher->dispatch( @@ -175,8 +168,8 @@ private function doVerify(ExecutionContext $context, CgiScenario $scenario, Requ $context, $scenario, $request, - ['exception' => $e] - ) + ['exception' => $e], + ), ); return GenericFailure::fromRequestAndCodeExecutionFailure($request, $e); } @@ -218,13 +211,13 @@ private function executePhpFile( string $workingDirectory, string $fileName, RequestInterface $request, - string $type + string $type, ): ResponseInterface { $process = $this->getPhpProcess($workingDirectory, $fileName, $request); $process->start(); $this->eventDispatcher->dispatch( - new CgiExecuteEvent(sprintf('cgi.verify.%s.executing', $type), $context, $scenario, $request) + new CgiExecuteEvent(sprintf('cgi.verify.%s.executing', $type), $context, $scenario, $request), ); $process->wait(); @@ -274,7 +267,7 @@ private function getPhpProcess(string $workingDirectory, string $fileName, Reque ], $workingDirectory, $env, - $content + $content, ); return $this->processFactory->create($processInput); @@ -309,12 +302,12 @@ public function run(ExecutionContext $context, OutputInterface $output): bool foreach ($scenario->getExecutions() as $i => $request) { /** @var CgiExecuteEvent $event */ $event = $this->eventDispatcher->dispatch( - new CgiExecuteEvent('cgi.run.student-execute.pre', $context, $scenario, $request) + new CgiExecuteEvent('cgi.run.student-execute.pre', $context, $scenario, $request), ); $process = $this->getPhpProcess( $context->getStudentExecutionDirectory(), $context->getEntryPoint(), - $event->getRequest() + $event->getRequest(), ); $process->start(); @@ -324,8 +317,8 @@ public function run(ExecutionContext $context, OutputInterface $output): bool $context, $scenario, $request, - ['output' => $output] - ) + ['output' => $output], + ), ); $process->wait(function ($outputType, $outputBuffer) use ($output) { $output->write($outputBuffer); @@ -339,7 +332,7 @@ public function run(ExecutionContext $context, OutputInterface $output): bool $output->lineBreak(); $this->eventDispatcher->dispatch( - new CgiExecuteEvent('cgi.run.student-execute.post', $context, $scenario, $request) + new CgiExecuteEvent('cgi.run.student-execute.post', $context, $scenario, $request), ); } diff --git a/src/ExerciseRunner/CliRunner.php b/src/ExerciseRunner/CliRunner.php index 3d3b4088..2afbebde 100644 --- a/src/ExerciseRunner/CliRunner.php +++ b/src/ExerciseRunner/CliRunner.php @@ -12,7 +12,6 @@ use PhpSchool\PhpWorkshop\Event\CliExerciseRunnerEvent; use PhpSchool\PhpWorkshop\Event\Event; use PhpSchool\PhpWorkshop\Event\EventDispatcher; -use PhpSchool\PhpWorkshop\Event\ExerciseRunnerEvent; use PhpSchool\PhpWorkshop\Exception\CodeExecutionException; use PhpSchool\PhpWorkshop\Exception\SolutionExecutionException; use PhpSchool\PhpWorkshop\Exercise\CliExercise; @@ -29,10 +28,7 @@ use PhpSchool\PhpWorkshop\Result\Cli\Success; use PhpSchool\PhpWorkshop\Result\Cli\ResultInterface as CliResultInterface; use PhpSchool\PhpWorkshop\Result\ResultInterface; -use PhpSchool\PhpWorkshop\Utils\ArrayObject; use PhpSchool\PhpWorkshop\Utils\Collection; -use RuntimeException; -use Symfony\Component\Process\ExecutableFinder; use Symfony\Component\Process\Process; /** @@ -64,9 +60,8 @@ public function __construct( private CliExercise $exercise, private EventDispatcher $eventDispatcher, private ProcessFactory $processFactory, - private EnvironmentManager $environmentManager - ) { - } + private EnvironmentManager $environmentManager, + ) {} /** * @return string @@ -116,8 +111,8 @@ public function verify(ExecutionContext $context): ResultInterface function (Collection $args) use ($context, $scenario) { return $this->doVerify($context, $scenario, $args); }, - $scenario->getExecutions() - ) + $scenario->getExecutions(), + ), ); $this->eventDispatcher->dispatch(new CliExerciseRunnerEvent('cli.verify.finish', $context, $scenario)); @@ -133,7 +128,7 @@ private function doVerify(ExecutionContext $context, CliScenario $scenario, Coll try { /** @var CliExecuteEvent $event */ $event = $this->eventDispatcher->dispatch( - new CliExecuteEvent('cli.verify.reference-execute.pre', $context, $scenario, $args) + new CliExecuteEvent('cli.verify.reference-execute.pre', $context, $scenario, $args), ); $solutionOutput = $this->executePhpFile( $context, @@ -141,7 +136,7 @@ private function doVerify(ExecutionContext $context, CliScenario $scenario, Coll $context->getReferenceExecutionDirectory(), $this->exercise->getSolution()->getEntryPoint()->getRelativePath(), $event->getArgs(), - 'reference' + 'reference', ); } catch (CodeExecutionException $e) { $this->eventDispatcher->dispatch( @@ -150,8 +145,8 @@ private function doVerify(ExecutionContext $context, CliScenario $scenario, Coll $context, $scenario, $args, - ['exception' => $e] - ) + ['exception' => $e], + ), ); throw new SolutionExecutionException($e->getMessage()); } @@ -159,7 +154,7 @@ private function doVerify(ExecutionContext $context, CliScenario $scenario, Coll try { /** @var CliExecuteEvent $event */ $event = $this->eventDispatcher->dispatch( - new CliExecuteEvent('cli.verify.student-execute.pre', $context, $scenario, $args) + new CliExecuteEvent('cli.verify.student-execute.pre', $context, $scenario, $args), ); $userOutput = $this->executePhpFile( $context, @@ -167,7 +162,7 @@ private function doVerify(ExecutionContext $context, CliScenario $scenario, Coll $context->getStudentExecutionDirectory(), $context->getEntryPoint(), $event->getArgs(), - 'student' + 'student', ); } catch (CodeExecutionException $e) { $this->eventDispatcher->dispatch( @@ -176,8 +171,8 @@ private function doVerify(ExecutionContext $context, CliScenario $scenario, Coll $context, $scenario, $args, - ['exception' => $e] - ) + ['exception' => $e], + ), ); return GenericFailure::fromArgsAndCodeExecutionFailure($args, $e); } @@ -216,7 +211,7 @@ public function run(ExecutionContext $context, OutputInterface $output): bool foreach ($scenario->getExecutions() as $i => $args) { /** @var CliExecuteEvent $event */ $event = $this->eventDispatcher->dispatch( - new CliExecuteEvent('cli.run.student-execute.pre', $context, $scenario, $args) + new CliExecuteEvent('cli.run.student-execute.pre', $context, $scenario, $args), ); $args = $event->getArgs(); @@ -224,12 +219,12 @@ public function run(ExecutionContext $context, OutputInterface $output): bool $process = $this->getPhpProcess( $context->getStudentExecutionDirectory(), $context->getEntryPoint(), - $args + $args, ); $process->start(); $this->eventDispatcher->dispatch( - new CliExecuteEvent('cli.run.student.executing', $context, $scenario, $args, ['output' => $output]) + new CliExecuteEvent('cli.run.student.executing', $context, $scenario, $args, ['output' => $output]), ); $process->wait(function ($outputType, $outputBuffer) use ($output) { $output->write($outputBuffer); @@ -243,7 +238,7 @@ public function run(ExecutionContext $context, OutputInterface $output): bool $output->lineBreak(); $this->eventDispatcher->dispatch( - new CliExecuteEvent('cli.run.student-execute.post', $context, $scenario, $args) + new CliExecuteEvent('cli.run.student-execute.post', $context, $scenario, $args), ); } @@ -261,7 +256,7 @@ private function executePhpFile(ExecutionContext $context, CliScenario $scenario $process->start(); $this->eventDispatcher->dispatch( - new CliExecuteEvent(sprintf('cli.verify.%s.executing', $type), $context, $scenario, $args) + new CliExecuteEvent(sprintf('cli.verify.%s.executing', $type), $context, $scenario, $args), ); $process->wait(); @@ -278,7 +273,7 @@ private function executePhpFile(ExecutionContext $context, CliScenario $scenario private function getPhpProcess(string $workingDirectory, string $fileName, Collection $args): Process { return $this->processFactory->create( - new ProcessInput('php', [$fileName, ...$args->getArrayCopy()], $workingDirectory, []) + new ProcessInput('php', [$fileName, ...$args->getArrayCopy()], $workingDirectory, []), ); } } diff --git a/src/ExerciseRunner/Context/ExecutionContext.php b/src/ExerciseRunner/Context/ExecutionContext.php index ce407aac..ba1c300c 100644 --- a/src/ExerciseRunner/Context/ExecutionContext.php +++ b/src/ExerciseRunner/Context/ExecutionContext.php @@ -14,8 +14,7 @@ public function __construct( private string $referenceExecutionDirectory, private ExerciseInterface $exercise, private Input $input, - ) { - } + ) {} public static function fromInputAndExercise(Input $input, ExerciseInterface $exercise): ExecutionContext { @@ -25,7 +24,7 @@ public static function fromInputAndExercise(Input $input, ExerciseInterface $exe $program, System::randomTempDir(), $exercise, - $input + $input, ); } @@ -52,7 +51,7 @@ public function getEntryPoint(): string return Path::join( $this->studentExecutionDirectory, - basename($this->input->getRequiredArgument('program')) + basename($this->input->getRequiredArgument('program')), ); } diff --git a/src/ExerciseRunner/Context/TestContext.php b/src/ExerciseRunner/Context/TestContext.php index 6f271517..383f0d97 100644 --- a/src/ExerciseRunner/Context/TestContext.php +++ b/src/ExerciseRunner/Context/TestContext.php @@ -12,7 +12,6 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\EnvironmentManager; use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\ResultAggregator; -use PhpSchool\PhpWorkshop\Solution\SolutionInterface; use PhpSchool\PhpWorkshop\Utils\System; use Symfony\Component\Filesystem\Filesystem; use PhpSchool\PhpWorkshop\Utils\Path; @@ -63,12 +62,11 @@ public function importReferenceSolution(): void { if (!$this->referenceSolutionDirWasCreated) { throw new RuntimeException( - sprintf('Reference execution directory not created. Call %s::createReferenceSolutionDirectory() first.', self::class) + sprintf('Reference execution directory not created. Call %s::createReferenceSolutionDirectory() first.', self::class), ); } - $scenario = new class extends ExerciseScenario { - }; + $scenario = new class () extends ExerciseScenario {}; if ($this->exercise instanceof CliExercise || $this->exercise instanceof CgiExercise) { $scenario = $this->exercise->defineTestScenario(); } @@ -80,7 +78,7 @@ public function importStudentFileFromString(string $content, string $filename = { if (!$this->studentSolutionDirWasCreated) { throw new RuntimeException( - sprintf('Student execution directory not created. Call %s::createStudentSolutionDirectory() first.', self::class) + sprintf('Student execution directory not created. Call %s::createStudentSolutionDirectory() first.', self::class), ); } @@ -91,7 +89,7 @@ public function importReferenceFileFromString(string $content, string $filename { if (!$this->referenceSolutionDirWasCreated) { throw new RuntimeException( - sprintf('Reference execution directory not created. Call %s::createReferenceSolutionDirectory() first.', self::class) + sprintf('Reference execution directory not created. Call %s::createReferenceSolutionDirectory() first.', self::class), ); } @@ -108,7 +106,7 @@ public static function fromExerciseAndStudentSolution(ExerciseInterface $exercis return new self( exercise: $exercise, input: $input, - studentDirectory: dirname($file) + studentDirectory: dirname($file), ); } diff --git a/src/ExerciseRunner/CustomVerifyingRunner.php b/src/ExerciseRunner/CustomVerifyingRunner.php index f911fdea..d619733d 100644 --- a/src/ExerciseRunner/CustomVerifyingRunner.php +++ b/src/ExerciseRunner/CustomVerifyingRunner.php @@ -15,9 +15,7 @@ */ class CustomVerifyingRunner implements ExerciseRunnerInterface { - public function __construct(private CustomVerifyingExercise $exercise) - { - } + public function __construct(private CustomVerifyingExercise $exercise) {} /** * Get the name of the exercise runner. diff --git a/src/ExerciseRunner/EnvironmentManager.php b/src/ExerciseRunner/EnvironmentManager.php index c18312e2..39bb8119 100644 --- a/src/ExerciseRunner/EnvironmentManager.php +++ b/src/ExerciseRunner/EnvironmentManager.php @@ -11,9 +11,7 @@ class EnvironmentManager { - public function __construct(private Filesystem $filesystem, private EventDispatcher $eventDispatcher) - { - } + public function __construct(private Filesystem $filesystem, private EventDispatcher $eventDispatcher) {} public function prepareStudent(ExecutionContext $context, ExerciseScenario $scenario): void { @@ -43,7 +41,7 @@ public function prepareReference(ExecutionContext $context, ExerciseScenario $sc foreach ($solution->getFiles() as $file) { $this->filesystem->copy( $file->getAbsolutePath(), - Path::join($context->getReferenceExecutionDirectory(), $file->getRelativePath()) + Path::join($context->getReferenceExecutionDirectory(), $file->getRelativePath()), ); } @@ -61,7 +59,7 @@ private function copyExerciseFiles(ExerciseScenario $scenario, string $dir): voi foreach ($scenario->getFiles() as $fileName => $content) { $this->filesystem->dumpFile( Path::join($dir, $fileName), - $content + $content, ); } } diff --git a/src/ExerciseRunner/Factory/CgiRunnerFactory.php b/src/ExerciseRunner/Factory/CgiRunnerFactory.php index 3a90195a..a53fec95 100644 --- a/src/ExerciseRunner/Factory/CgiRunnerFactory.php +++ b/src/ExerciseRunner/Factory/CgiRunnerFactory.php @@ -14,7 +14,6 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\EnvironmentManager; use PhpSchool\PhpWorkshop\ExerciseRunner\ExerciseRunnerInterface; use PhpSchool\PhpWorkshop\Process\ProcessFactory; -use PhpSchool\PhpWorkshop\Utils\RequestRenderer; /** * Factory class for `CgiRunner` @@ -26,9 +25,7 @@ class CgiRunnerFactory implements ExerciseRunnerFactoryInterface */ private static string $type = ExerciseType::CGI; - public function __construct(private EventDispatcher $eventDispatcher, private ProcessFactory $processFactory, private EnvironmentManager $environmentManager) - { - } + public function __construct(private EventDispatcher $eventDispatcher, private ProcessFactory $processFactory, private EnvironmentManager $environmentManager) {} /** * Whether the factory supports this exercise type. diff --git a/src/ExerciseRunner/Factory/CliRunnerFactory.php b/src/ExerciseRunner/Factory/CliRunnerFactory.php index 61db3491..4ee13f18 100644 --- a/src/ExerciseRunner/Factory/CliRunnerFactory.php +++ b/src/ExerciseRunner/Factory/CliRunnerFactory.php @@ -25,9 +25,7 @@ class CliRunnerFactory implements ExerciseRunnerFactoryInterface */ private static string $type = ExerciseType::CLI; - public function __construct(private EventDispatcher $eventDispatcher, private ProcessFactory $processFactory, private EnvironmentManager $environmentManager) - { - } + public function __construct(private EventDispatcher $eventDispatcher, private ProcessFactory $processFactory, private EnvironmentManager $environmentManager) {} /** * Whether the factory supports this exercise type. diff --git a/src/ExerciseRunner/Factory/CustomVerifyingRunnerFactory.php b/src/ExerciseRunner/Factory/CustomVerifyingRunnerFactory.php index 6ef11290..80130cca 100644 --- a/src/ExerciseRunner/Factory/CustomVerifyingRunnerFactory.php +++ b/src/ExerciseRunner/Factory/CustomVerifyingRunnerFactory.php @@ -37,9 +37,7 @@ public function supports(ExerciseInterface $exercise): bool * * @param CommandDefinition $commandDefinition */ - public function configureInput(CommandDefinition $commandDefinition): void - { - } + public function configureInput(CommandDefinition $commandDefinition): void {} /** * Create and return an instance of the runner. diff --git a/src/ExerciseRunner/RunnerManager.php b/src/ExerciseRunner/RunnerManager.php index d1b96f9a..747e30b3 100644 --- a/src/ExerciseRunner/RunnerManager.php +++ b/src/ExerciseRunner/RunnerManager.php @@ -59,7 +59,7 @@ private function getFactory(ExerciseInterface $exercise): ExerciseRunnerFactoryI } throw new InvalidArgumentException( - sprintf('Exercise Type: "%s" not supported', $exercise->getType()->getValue()) + sprintf('Exercise Type: "%s" not supported', $exercise->getType()->getValue()), ); } } diff --git a/src/Factory/EventDispatcherFactory.php b/src/Factory/EventDispatcherFactory.php index a1d3638a..c84d44eb 100644 --- a/src/Factory/EventDispatcherFactory.php +++ b/src/Factory/EventDispatcherFactory.php @@ -78,12 +78,12 @@ private function mergeListenerGroups(array $listeners): array return $carry->set( $event, - array_merge($carry->get($event, []), $listeners) + array_merge($carry->get($event, []), $listeners), ); }, $carry); }, new Collection()); - return $mergedListeners->getArrayCopy(); + return $mergedListeners->getArrayCopy(); } /** @@ -97,26 +97,26 @@ private function attachListeners( string $eventName, array $listeners, ContainerInterface $container, - EventDispatcher $dispatcher + EventDispatcher $dispatcher, ): void { array_walk($listeners, function ($listener) use ($eventName, $dispatcher, $container) { if ($listener instanceof ContainerListenerHelper) { if (!$container->has($listener->getService())) { throw new InvalidArgumentException( - sprintf('Container has no entry named: "%s"', $listener->getService()) + sprintf('Container has no entry named: "%s"', $listener->getService()), ); } $dispatcher->listen( $eventName, - new LazyContainerListener($container, $listener) + new LazyContainerListener($container, $listener), ); return; } if (!is_callable($listener)) { throw new InvalidArgumentException( - 'Listener must be a callable or a container entry for a callable service.' + 'Listener must be a callable or a container entry for a callable service.', ); } $dispatcher->listen($eventName, $listener); diff --git a/src/Factory/MenuFactory.php b/src/Factory/MenuFactory.php index ed8bbf22..0715dfcd 100644 --- a/src/Factory/MenuFactory.php +++ b/src/Factory/MenuFactory.php @@ -78,7 +78,7 @@ function (CliMenu $menu) use ($exerciseRenderer, $eventDispatcher, $exercise) { $exerciseRenderer->__invoke($menu); }, $userState->completedExercise($exercise->getName()), - $this->isExerciseDisabled($exercise, $userState, $workshopType) + $this->isExerciseDisabled($exercise, $userState, $workshopType), ); } /** @var HelpCommand $helpCommand */ @@ -178,7 +178,7 @@ private function dispatchExerciseSelectedEvent(EventDispatcher $eventDispatcher, { $eventDispatcher->dispatch(new Event('exercise.selected', ['exercise' => $exercise])); $eventDispatcher->dispatch( - new Event(sprintf('exercise.selected.%s', AbstractExercise::normaliseName($exercise->getName()))) + new Event(sprintf('exercise.selected.%s', AbstractExercise::normaliseName($exercise->getName()))), ); } } diff --git a/src/Factory/ResultRendererFactory.php b/src/Factory/ResultRendererFactory.php index f1776d52..7232eafc 100644 --- a/src/Factory/ResultRendererFactory.php +++ b/src/Factory/ResultRendererFactory.php @@ -68,8 +68,8 @@ public function create(ResultInterface $result): ResultRendererInterface 'Renderer Factory for "%s" produced "%s" instead of expected "%s"', $class, is_object($renderer) ? get_class($renderer) : gettype($renderer), - $class - ) + $class, + ), ); } diff --git a/src/Listener/CodePatchListener.php b/src/Listener/CodePatchListener.php index afca93cd..49ca18e2 100644 --- a/src/Listener/CodePatchListener.php +++ b/src/Listener/CodePatchListener.php @@ -10,7 +10,6 @@ use PhpSchool\PhpWorkshop\Exercise\ProvidesSolution; use PhpSchool\PhpWorkshop\Utils\Path; use Psr\Log\LoggerInterface; -use RuntimeException; /** * Listener which patches internal and student's solutions @@ -60,7 +59,7 @@ public function patch(ExerciseRunnerEvent $event): void if ($exercise instanceof ProvidesSolution) { $files[] = Path::join( $event->getContext()->getReferenceExecutionDirectory(), - $exercise->getSolution()->getEntryPoint()->getRelativePath() + $exercise->getSolution()->getEntryPoint()->getRelativePath(), ); } @@ -71,7 +70,7 @@ public function patch(ExerciseRunnerEvent $event): void file_put_contents( $fileName, - $this->codePatcher->patch($event->getExercise(), $this->originalCode[$fileName]) + $this->codePatcher->patch($event->getExercise(), $this->originalCode[$fileName]), ); } } diff --git a/src/Listener/ConfigureCommandListener.php b/src/Listener/ConfigureCommandListener.php index 98037100..fcb45f85 100644 --- a/src/Listener/ConfigureCommandListener.php +++ b/src/Listener/ConfigureCommandListener.php @@ -38,7 +38,7 @@ class ConfigureCommandListener public function __construct( UserState $userState, ExerciseRepository $exerciseRepository, - RunnerManager $runnerManager + RunnerManager $runnerManager, ) { $this->userState = $userState; $this->exerciseRepository = $exerciseRepository; @@ -58,7 +58,7 @@ public function __invoke(Event $event): void } $currentExercise = $this->exerciseRepository->findByName( - $this->userState->getCurrentExercise() + $this->userState->getCurrentExercise(), ); $this->runnerManager->configureInput($currentExercise, $command); diff --git a/src/Listener/InitialCodeListener.php b/src/Listener/InitialCodeListener.php index 6fb353e3..ac580be9 100644 --- a/src/Listener/InitialCodeListener.php +++ b/src/Listener/InitialCodeListener.php @@ -7,7 +7,6 @@ use PhpSchool\PhpWorkshop\Event\Event; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ProvidesInitialCode; -use PhpSchool\PhpWorkshop\Solution\SolutionFile; use Psr\Log\LoggerInterface; /** @@ -60,8 +59,8 @@ public function __invoke(Event $event): void [ 'exercise' => $exercise->getName(), 'workingDir' => $this->workingDirectory, - 'file' => $file->getAbsolutePath() - ] + 'file' => $file->getAbsolutePath(), + ], ); } } diff --git a/src/Listener/LazyContainerListener.php b/src/Listener/LazyContainerListener.php index 5a06207f..efc8f29b 100644 --- a/src/Listener/LazyContainerListener.php +++ b/src/Listener/LazyContainerListener.php @@ -34,7 +34,7 @@ public function __invoke(...$args): void if (!method_exists($service, $this->listener->getMethod())) { throw new InvalidArgumentException( - sprintf('Method "%s" does not exist on "%s"', $this->listener->getMethod(), get_class($service)) + sprintf('Method "%s" does not exist on "%s"', $this->listener->getMethod(), get_class($service)), ); } @@ -49,7 +49,7 @@ public function getWrapped(): callable /** @var callable $listener */ $listener = [ $this->container->get($this->listener->getService()), - $this->listener->getMethod() + $this->listener->getMethod(), ]; return $listener; diff --git a/src/Listener/PrepareSolutionListener.php b/src/Listener/PrepareSolutionListener.php index 4528955e..cd8225de 100644 --- a/src/Listener/PrepareSolutionListener.php +++ b/src/Listener/PrepareSolutionListener.php @@ -41,7 +41,7 @@ public function __invoke(ExerciseRunnerEvent $event): void //only install if vendor folder not available if (!file_exists(sprintf('%s/vendor', $event->getContext()->getReferenceExecutionDirectory()))) { $process = $this->processFactory->create( - new ProcessInput('composer', ['install', '--no-interaction'], $event->getContext()->getReferenceExecutionDirectory(), []) + new ProcessInput('composer', ['install', '--no-interaction'], $event->getContext()->getReferenceExecutionDirectory(), []), ); try { diff --git a/src/Listener/SelfCheckListener.php b/src/Listener/SelfCheckListener.php index fc1ca971..200fd00d 100644 --- a/src/Listener/SelfCheckListener.php +++ b/src/Listener/SelfCheckListener.php @@ -4,7 +4,6 @@ namespace PhpSchool\PhpWorkshop\Listener; -use PhpSchool\PhpWorkshop\Event\Event; use PhpSchool\PhpWorkshop\Event\ExerciseRunnerEvent; use PhpSchool\PhpWorkshop\ExerciseCheck\SelfCheck; use PhpSchool\PhpWorkshop\Input\Input; @@ -15,9 +14,7 @@ */ class SelfCheckListener { - public function __construct(private ResultAggregator $results) - { - } + public function __construct(private ResultAggregator $results) {} public function __invoke(ExerciseRunnerEvent $event): void { diff --git a/src/Listener/TearDownListener.php b/src/Listener/TearDownListener.php index 82dec2ea..db808ef8 100644 --- a/src/Listener/TearDownListener.php +++ b/src/Listener/TearDownListener.php @@ -4,7 +4,6 @@ namespace PhpSchool\PhpWorkshop\Listener; -use PhpSchool\PhpWorkshop\Event\EventInterface; use PhpSchool\PhpWorkshop\Utils\System; use Symfony\Component\Filesystem\Filesystem; diff --git a/src/Logger/ConsoleLogger.php b/src/Logger/ConsoleLogger.php index 0ded0d82..b134ca61 100644 --- a/src/Logger/ConsoleLogger.php +++ b/src/Logger/ConsoleLogger.php @@ -37,9 +37,9 @@ public function log($level, $message, array $context = []): void '%s - %s - %s', $this->color->fg('yellow', (new \DateTime())->format('H:i:s')), $this->color->bg('red', strtoupper($level)), - $this->color->fg('red', $message) + $this->color->fg('red', $message), ), - json_encode($context, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) + json_encode($context, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), ]; $this->output->writeLine(implode("\n", $parts)); diff --git a/src/Logger/Logger.php b/src/Logger/Logger.php index 0bc328b8..93d5acb8 100644 --- a/src/Logger/Logger.php +++ b/src/Logger/Logger.php @@ -37,9 +37,9 @@ public function log($level, $message, array $context = []): void (new \DateTime())->format('d-m-y H:i:s'), $level, $message, - json_encode($context) + json_encode($context), ), - FILE_APPEND + FILE_APPEND, ); } } diff --git a/src/Markdown/CurrentContext.php b/src/Markdown/CurrentContext.php index 6c7efd73..90233e52 100644 --- a/src/Markdown/CurrentContext.php +++ b/src/Markdown/CurrentContext.php @@ -20,7 +20,7 @@ public function __construct(string $context) throw InvalidArgumentException::notValidParameter( 'context', [self::CONTEXT_CLI, self::CONTEXT_CLOUD], - $context + $context, ); } $this->context = $context; diff --git a/src/Markdown/Parser/HandleBarParser.php b/src/Markdown/Parser/HandleBarParser.php index 24a76808..ee0bf251 100644 --- a/src/Markdown/Parser/HandleBarParser.php +++ b/src/Markdown/Parser/HandleBarParser.php @@ -4,9 +4,6 @@ namespace PhpSchool\PhpWorkshop\Markdown\Parser; -use League\CommonMark\Delimiter\Delimiter; -use League\CommonMark\Inline\Element\Code; -use League\CommonMark\Inline\Element\Text; use League\CommonMark\InlineParserContext; use League\CommonMark\Inline\Parser\InlineParserInterface; use PhpSchool\PhpWorkshop\Markdown\Shorthands\ShorthandInterface; @@ -27,7 +24,7 @@ public function __construct(array $shorthands) array_map(function (ShorthandInterface $shorthand) { return $shorthand->getCode(); }, $shorthands), - $shorthands + $shorthands, ) ?: []; } diff --git a/src/Markdown/ProblemFileExtension.php b/src/Markdown/ProblemFileExtension.php index 80d96fc2..948e8f04 100644 --- a/src/Markdown/ProblemFileExtension.php +++ b/src/Markdown/ProblemFileExtension.php @@ -29,7 +29,7 @@ final class ProblemFileExtension implements ExtensionInterface */ public function __construct( ContextSpecificRenderer $contextSpecificRenderer, - array $shorthandExpanders + array $shorthandExpanders, ) { $this->contextSpecificRenderer = $contextSpecificRenderer; $this->shorthandExpanders = $shorthandExpanders; diff --git a/src/Markdown/Shorthands/Cli/AppName.php b/src/Markdown/Shorthands/Cli/AppName.php index b2c68c22..676a2169 100644 --- a/src/Markdown/Shorthands/Cli/AppName.php +++ b/src/Markdown/Shorthands/Cli/AppName.php @@ -8,7 +8,6 @@ use League\CommonMark\Inline\Element\Emphasis; use League\CommonMark\Inline\Element\Strong; use League\CommonMark\Inline\Element\Text; -use League\CommonMark\Node\Node; use PhpSchool\PhpWorkshop\Markdown\Shorthands\ShorthandInterface; final class AppName implements ShorthandInterface diff --git a/src/Markdown/Shorthands/Cloud/AppName.php b/src/Markdown/Shorthands/Cloud/AppName.php index a8d1dadb..2957719d 100644 --- a/src/Markdown/Shorthands/Cloud/AppName.php +++ b/src/Markdown/Shorthands/Cloud/AppName.php @@ -4,10 +4,6 @@ namespace PhpSchool\PhpWorkshop\Markdown\Shorthands\Cloud; -use League\CommonMark\Inline\Element\Code; -use League\CommonMark\Inline\Element\Emphasis; -use League\CommonMark\Inline\Element\Strong; -use League\CommonMark\Inline\Element\Text; use League\CommonMark\Node\Node; use PhpSchool\PhpWorkshop\Markdown\Shorthands\ShorthandInterface; diff --git a/src/Markdown/Shorthands/Documentation.php b/src/Markdown/Shorthands/Documentation.php index b3069231..b71c8308 100644 --- a/src/Markdown/Shorthands/Documentation.php +++ b/src/Markdown/Shorthands/Documentation.php @@ -31,9 +31,9 @@ public function __invoke(array $callArgs): array new Text('Documentation on '), new Code($callout), new Text(' can be found by pointing your browser here:'), - new Newline() + new Newline(), ], - $links + $links, ); } diff --git a/src/Output/StdOutput.php b/src/Output/StdOutput.php index 35119b21..e9cc6439 100644 --- a/src/Output/StdOutput.php +++ b/src/Output/StdOutput.php @@ -67,7 +67,7 @@ public function printException(Throwable $exception): void sprintf("In %s line %d:", $file, $exception->getLine()), sprintf("[%s (%s)]:", get_class($exception), $exception->getCode()), '', - $message + $message, ]; $length = max(array_map('strlen', $lines)) + 2; @@ -85,11 +85,13 @@ public function printException(Throwable $exception): void $this->writeLine( implode( "\n", - array_map(function ($l) { - return " $l"; - }, - explode("\n", $exception->getTraceAsString())) - ) + array_map( + function ($l) { + return " $l"; + }, + explode("\n", $exception->getTraceAsString()), + ), + ), ); } diff --git a/src/Patch/ForceStrictTypes.php b/src/Patch/ForceStrictTypes.php index 445996cf..ec4e314c 100644 --- a/src/Patch/ForceStrictTypes.php +++ b/src/Patch/ForceStrictTypes.php @@ -22,8 +22,8 @@ public function transform(array $statements): array $declare = new \PhpParser\Node\Stmt\Declare_([ new DeclareDeclare( new \PhpParser\Node\Identifier('strict_types'), - new LNumber(1) - ) + new LNumber(1), + ), ]); return array_merge([$declare], $statements); diff --git a/src/Patch/WrapInTryCatch.php b/src/Patch/WrapInTryCatch.php index c3d86428..4988fe73 100644 --- a/src/Patch/WrapInTryCatch.php +++ b/src/Patch/WrapInTryCatch.php @@ -31,8 +31,8 @@ public function __construct(string $exceptionClass = \Exception::class, array $s $this->exceptionClass = $exceptionClass; $this->statements = $statements ?: [ new Echo_([ - new MethodCall(new Variable('e'), 'getMessage') - ]) + new MethodCall(new Variable('e'), 'getMessage'), + ]), ]; } @@ -49,10 +49,10 @@ public function transform(array $statements): array new Catch_( [new Name($this->exceptionClass)], new Variable('e'), - $this->statements - ) - ] - ) + $this->statements, + ), + ], + ), ]; } } diff --git a/src/Process/DockerProcessFactory.php b/src/Process/DockerProcessFactory.php index ed4d965a..5f4ab810 100644 --- a/src/Process/DockerProcessFactory.php +++ b/src/Process/DockerProcessFactory.php @@ -4,10 +4,8 @@ namespace PhpSchool\PhpWorkshop\Process; -use PhpSchool\PhpWorkshop\Utils\Collection; use Symfony\Component\Process\ExecutableFinder; use Symfony\Component\Process\Process; -use PhpSchool\PhpWorkshop\Utils\System; final class DockerProcessFactory implements ProcessFactory { @@ -20,7 +18,7 @@ public function __construct( string $basePath, string $projectName, string $composerCacheDir, - ExecutableFinder $executableFinder = null + ExecutableFinder $executableFinder = null, ) { $this->executableFinder = $executableFinder ?? new ExecutableFinder(); $this->basePath = $basePath; @@ -45,12 +43,12 @@ public function create(ProcessInput $processInput): Process ...$this->baseComposeCommand($mounts, $env), 'runtime', $processInput->getExecutable(), - ...$processInput->getArgs() + ...$processInput->getArgs(), ], $this->basePath, ['SOLUTION' => $processInput->getWorkingDirectory()], $processInput->getInput(), - 10 + 10, ); } @@ -78,7 +76,7 @@ private function baseComposeCommand(array $mounts, array $env): array ...$env, '-w', '/solution', - ...array_merge(...array_map(fn ($mount) => ['-v', $mount], $mounts)), + ...array_merge(...array_map(fn($mount) => ['-v', $mount], $mounts)), ]; } } diff --git a/src/Process/HostProcessFactory.php b/src/Process/HostProcessFactory.php index 7ea0405b..453bffc1 100644 --- a/src/Process/HostProcessFactory.php +++ b/src/Process/HostProcessFactory.php @@ -4,7 +4,6 @@ namespace PhpSchool\PhpWorkshop\Process; -use PhpSchool\PhpWorkshop\Utils\Collection; use Symfony\Component\Process\ExecutableFinder; use Symfony\Component\Process\Process; @@ -40,8 +39,8 @@ public function create(ProcessInput $processInput): Process */ private function getDefaultEnv(): array { - $env = array_map(fn () => false, $_ENV); - $env + array_map(fn () => false, $_SERVER); + $env = array_map(fn() => false, $_ENV); + $env + array_map(fn() => false, $_SERVER); return $env; } diff --git a/src/Process/ProcessFactory.php b/src/Process/ProcessFactory.php index 37a79d92..8e7faffa 100644 --- a/src/Process/ProcessFactory.php +++ b/src/Process/ProcessFactory.php @@ -4,8 +4,6 @@ namespace PhpSchool\PhpWorkshop\Process; -use PhpSchool\PhpWorkshop\Utils\ArrayObject; -use PhpSchool\PhpWorkshop\Utils\Collection; use Symfony\Component\Process\Process; interface ProcessFactory diff --git a/src/Process/ProcessInput.php b/src/Process/ProcessInput.php index 98fa781d..067031d2 100644 --- a/src/Process/ProcessInput.php +++ b/src/Process/ProcessInput.php @@ -13,9 +13,8 @@ public function __construct( private array $args, private string $workingDirectory, private array $env, - private ?string $input = null - ) { - } + private ?string $input = null, + ) {} public function getExecutable(): string { diff --git a/src/Result/Cgi/CgiResult.php b/src/Result/Cgi/CgiResult.php index 12b570af..bef5b1c7 100644 --- a/src/Result/Cgi/CgiResult.php +++ b/src/Result/Cgi/CgiResult.php @@ -65,7 +65,7 @@ public function isSuccessful(): bool return count( array_filter($this->results, function ($result) { return $result instanceof FailureInterface; - }) + }), ) === 0; } diff --git a/src/Result/Cgi/GenericFailure.php b/src/Result/Cgi/GenericFailure.php index 48982bb6..7c186c4e 100644 --- a/src/Result/Cgi/GenericFailure.php +++ b/src/Result/Cgi/GenericFailure.php @@ -54,7 +54,7 @@ public static function fromRequestAndReason(RequestInterface $request, string $r */ public static function fromRequestAndCodeExecutionFailure( RequestInterface $request, - CodeExecutionException $e + CodeExecutionException $e, ): self { return new self($request, $e->getMessage()); } diff --git a/src/Result/Cgi/RequestFailure.php b/src/Result/Cgi/RequestFailure.php index 76d4d023..6774ea43 100644 --- a/src/Result/Cgi/RequestFailure.php +++ b/src/Result/Cgi/RequestFailure.php @@ -49,7 +49,7 @@ public function __construct( string $expectedOutput, string $actualOutput, array $expectedHeaders, - array $actualHeaders + array $actualHeaders, ) { $this->request = $request; $this->expectedOutput = $expectedOutput; diff --git a/src/Result/Cgi/SuccessInterface.php b/src/Result/Cgi/SuccessInterface.php index 1e35910b..ca2c232f 100644 --- a/src/Result/Cgi/SuccessInterface.php +++ b/src/Result/Cgi/SuccessInterface.php @@ -8,6 +8,4 @@ * This interface represents a success. Any result implementing this interface will * be treated as a success. */ -interface SuccessInterface extends ResultInterface -{ -} +interface SuccessInterface extends ResultInterface {} diff --git a/src/Result/Cli/CliResult.php b/src/Result/Cli/CliResult.php index af33c959..e9a4d50e 100644 --- a/src/Result/Cli/CliResult.php +++ b/src/Result/Cli/CliResult.php @@ -65,7 +65,7 @@ public function isSuccessful(): bool return count( array_filter($this->results, function ($result) { return $result instanceof FailureInterface; - }) + }), ) === 0; } diff --git a/src/Result/Cli/RequestFailure.php b/src/Result/Cli/RequestFailure.php index 62d83adb..981f5ffa 100644 --- a/src/Result/Cli/RequestFailure.php +++ b/src/Result/Cli/RequestFailure.php @@ -104,7 +104,7 @@ public function toArray(): array return [ 'args' => $this->getArgs()->getArrayCopy(), 'expected_output' => $this->getExpectedOutput(), - 'actual_output' => $this->getActualOutput() + 'actual_output' => $this->getActualOutput(), ]; } } diff --git a/src/Result/Cli/SuccessInterface.php b/src/Result/Cli/SuccessInterface.php index ddc1bd36..65508532 100644 --- a/src/Result/Cli/SuccessInterface.php +++ b/src/Result/Cli/SuccessInterface.php @@ -8,6 +8,4 @@ * This interface represents a success. Any result implementing this interface will * be treated as a success. */ -interface SuccessInterface extends ResultInterface -{ -} +interface SuccessInterface extends ResultInterface {} diff --git a/src/Result/ComparisonFailure.php b/src/Result/ComparisonFailure.php index 9af73a6f..57ba567c 100644 --- a/src/Result/ComparisonFailure.php +++ b/src/Result/ComparisonFailure.php @@ -84,7 +84,7 @@ public function toArray(): array { return [ 'expected_value' => $this->getExpectedValue(), - 'actual_value' => $this->getActualValue() + 'actual_value' => $this->getActualValue(), ]; } } diff --git a/src/Result/ComposerFailure.php b/src/Result/ComposerFailure.php index 9b60d4f7..2fefe188 100644 --- a/src/Result/ComposerFailure.php +++ b/src/Result/ComposerFailure.php @@ -43,7 +43,7 @@ public function __construct(CheckInterface $check, string $missingComponent = nu throw InvalidArgumentException::notValidParameter( 'missingComponent', self::$validComponents, - $missingComponent + $missingComponent, ); } $this->missingComponent = $missingComponent; @@ -99,7 +99,7 @@ public function toArray(): array 'is_missing_component' => $this->isMissingComponent(), 'is_missing_packages' => $this->isMissingPackages(), 'missing_component' => $this->getMissingComponent(), - 'missing_packages' => $this->getMissingPackages() + 'missing_packages' => $this->getMissingPackages(), ]; } } diff --git a/src/Result/Failure.php b/src/Result/Failure.php index ef6b281e..85bf227b 100644 --- a/src/Result/Failure.php +++ b/src/Result/Failure.php @@ -84,11 +84,11 @@ public static function fromNameAndCodeExecutionFailure(string $name, CodeExecuti public static function fromCheckAndCodeParseFailure( CheckInterface $check, ParseErrorException $e, - string $file + string $file, ): self { return new self( $check->getName(), - sprintf('File: "%s" could not be parsed. Error: "%s"', $file, $e->getMessage()) + sprintf('File: "%s" could not be parsed. Error: "%s"', $file, $e->getMessage()), ); } diff --git a/src/Result/FileComparisonFailure.php b/src/Result/FileComparisonFailure.php index 6f38a28d..93851761 100644 --- a/src/Result/FileComparisonFailure.php +++ b/src/Result/FileComparisonFailure.php @@ -80,7 +80,7 @@ public function toArray(): array return [ 'file_name' => $this->getFileName(), 'expected_value' => $this->getExpectedValue(), - 'actual_value' => $this->getActualValue() + 'actual_value' => $this->getActualValue(), ]; } } diff --git a/src/Result/FunctionRequirementsFailure.php b/src/Result/FunctionRequirementsFailure.php index 1fbc403e..2d745c4a 100644 --- a/src/Result/FunctionRequirementsFailure.php +++ b/src/Result/FunctionRequirementsFailure.php @@ -66,7 +66,7 @@ public function toArray(): array { return [ 'banned_functions' => $this->getBannedFunctions(), - 'missing_functions' => $this->getMissingFunctions() + 'missing_functions' => $this->getMissingFunctions(), ]; } } diff --git a/src/Result/SuccessInterface.php b/src/Result/SuccessInterface.php index 675fcaef..1248466c 100644 --- a/src/Result/SuccessInterface.php +++ b/src/Result/SuccessInterface.php @@ -8,6 +8,4 @@ * This interface represents a success. Any result implementing this interface will * be treated as a success. */ -interface SuccessInterface extends ResultInterface -{ -} +interface SuccessInterface extends ResultInterface {} diff --git a/src/ResultAggregator.php b/src/ResultAggregator.php index c750b82d..0c014334 100644 --- a/src/ResultAggregator.php +++ b/src/ResultAggregator.php @@ -47,7 +47,7 @@ public function isSuccessful(): bool return !$result->isSuccessful(); } return $result instanceof FailureInterface; - }) + }), ) === 0; } diff --git a/src/ResultRenderer/Cgi/RequestFailureRenderer.php b/src/ResultRenderer/Cgi/RequestFailureRenderer.php index 0bcd9cb7..a3864fc8 100644 --- a/src/ResultRenderer/Cgi/RequestFailureRenderer.php +++ b/src/ResultRenderer/Cgi/RequestFailureRenderer.php @@ -41,7 +41,7 @@ public function render(ResultsRenderer $renderer): string $renderer->style('YOUR HEADERS:', ['bold', 'yellow']), $this->headers($this->result->getActualHeaders(), $renderer), $renderer->style('EXPECTED HEADERS:', ['bold', 'yellow']), - $this->headers($this->result->getExpectedHeaders(), $renderer, false) + $this->headers($this->result->getExpectedHeaders(), $renderer, false), ); } @@ -55,7 +55,7 @@ public function render(ResultsRenderer $renderer): string $renderer->style('YOUR OUTPUT:', ['bold', 'yellow']), $renderer->style(sprintf('"%s"', $this->result->getActualOutput()), 'red'), $renderer->style('EXPECTED OUTPUT:', ['bold', 'yellow']), - $renderer->style(sprintf('"%s"', $this->result->getExpectedOutput()), 'green') + $renderer->style(sprintf('"%s"', $this->result->getExpectedOutput()), 'green'), ); } diff --git a/src/ResultRenderer/Cli/RequestFailureRenderer.php b/src/ResultRenderer/Cli/RequestFailureRenderer.php index 19f807eb..1bd12127 100644 --- a/src/ResultRenderer/Cli/RequestFailureRenderer.php +++ b/src/ResultRenderer/Cli/RequestFailureRenderer.php @@ -39,7 +39,7 @@ public function render(ResultsRenderer $renderer): string $renderer->style('YOUR OUTPUT:', ['bold', 'yellow']), $this->indent($renderer->style(sprintf('"%s"', $this->result->getActualOutput()), 'red')), $renderer->style('EXPECTED OUTPUT:', ['bold', 'yellow']), - $this->indent($renderer->style(sprintf('"%s"', $this->result->getExpectedOutput()), 'green')) + $this->indent($renderer->style(sprintf('"%s"', $this->result->getExpectedOutput()), 'green')), ); } @@ -55,8 +55,8 @@ private function indent(string $string): string function ($line) { return sprintf(" %s", $line); }, - explode("\n", $string) - ) + explode("\n", $string), + ), ); } } diff --git a/src/ResultRenderer/ComparisonFailureRenderer.php b/src/ResultRenderer/ComparisonFailureRenderer.php index b6559e31..a3f0ae7a 100644 --- a/src/ResultRenderer/ComparisonFailureRenderer.php +++ b/src/ResultRenderer/ComparisonFailureRenderer.php @@ -37,7 +37,7 @@ public function render(ResultsRenderer $renderer): string $renderer->style('YOUR OUTPUT:', ['bold', 'yellow']), $this->indent($renderer->style(sprintf('"%s"', $this->result->getActualValue()), 'red')), $renderer->style('EXPECTED OUTPUT:', ['bold', 'yellow']), - $this->indent($renderer->style(sprintf('"%s"', $this->result->getExpectedValue()), 'green')) + $this->indent($renderer->style(sprintf('"%s"', $this->result->getExpectedValue()), 'green')), ); } @@ -53,8 +53,8 @@ private function indent(string $string): string function ($line) { return sprintf(' %s', $line); }, - explode("\n", $string) - ) + explode("\n", $string), + ), ); } } diff --git a/src/ResultRenderer/ComposerFailureRenderer.php b/src/ResultRenderer/ComposerFailureRenderer.php index 750115f7..d60cce86 100644 --- a/src/ResultRenderer/ComposerFailureRenderer.php +++ b/src/ResultRenderer/ComposerFailureRenderer.php @@ -36,7 +36,7 @@ public function render(ResultsRenderer $renderer): string /** @var string $component */ $component = $this->result->getMissingComponent(); - $type = str_contains($component, '.') ? 'file' : 'folder'; + $type = str_contains($component, '.') ? 'file' : 'folder'; return $renderer->center("No $component $type found") . "\n"; } @@ -46,7 +46,7 @@ public function render(ResultsRenderer $renderer): string return $renderer->center(sprintf( "Lockfile doesn't include the following packages at any version: \"%s\"\n", - implode('", "', $missingPackages) + implode('", "', $missingPackages), )); } diff --git a/src/ResultRenderer/FileComparisonFailureRenderer.php b/src/ResultRenderer/FileComparisonFailureRenderer.php index 09914cba..9a2f6035 100644 --- a/src/ResultRenderer/FileComparisonFailureRenderer.php +++ b/src/ResultRenderer/FileComparisonFailureRenderer.php @@ -39,7 +39,7 @@ public function render(ResultsRenderer $renderer): string $this->indent($renderer->style(sprintf('"%s"', $this->result->getActualValue()), 'red')), $renderer->style('EXPECTED OUTPUT FOR: ', ['bold', 'yellow']), $renderer->style($this->result->getFileName(), ['bold', 'green']), - $this->indent($renderer->style(sprintf('"%s"', $this->result->getExpectedValue()), 'green')) + $this->indent($renderer->style(sprintf('"%s"', $this->result->getExpectedValue()), 'green')), ); } @@ -55,8 +55,8 @@ private function indent(string $string): string function ($line) { return sprintf(' %s', $line); }, - explode("\n", $string) - ) + explode("\n", $string), + ), ); } } diff --git a/src/ResultRenderer/FunctionRequirementsFailureRenderer.php b/src/ResultRenderer/FunctionRequirementsFailureRenderer.php index fb75f66e..7a908c1b 100644 --- a/src/ResultRenderer/FunctionRequirementsFailureRenderer.php +++ b/src/ResultRenderer/FunctionRequirementsFailureRenderer.php @@ -38,11 +38,11 @@ public function render(ResultsRenderer $renderer): string " %s\n%s\n", $renderer->style( "Some functions were used which should not be used in this exercise", - ['bold', 'underline', 'yellow'] + ['bold', 'underline', 'yellow'], ), implode("\n", array_map(function (array $call) { return sprintf(' %s on line %s', $call['function'], $call['line']); - }, $bannedFunctions)) + }, $bannedFunctions)), ); } @@ -51,11 +51,11 @@ public function render(ResultsRenderer $renderer): string " %s\n%s\n", $renderer->style( "Some function requirements were missing. You should use the functions", - ['bold', 'underline', 'yellow'] + ['bold', 'underline', 'yellow'], ), implode("\n", array_map(function ($function) { return sprintf(' %s', $function); - }, $missingFunctions)) + }, $missingFunctions)), ); } diff --git a/src/ResultRenderer/ResultsRenderer.php b/src/ResultRenderer/ResultsRenderer.php index 192d7692..76ac13e7 100644 --- a/src/ResultRenderer/ResultsRenderer.php +++ b/src/ResultRenderer/ResultsRenderer.php @@ -72,7 +72,7 @@ public function __construct( Terminal $terminal, ExerciseRepository $exerciseRepository, KeyLighter $keyLighter, - ResultRendererFactory $resultRendererFactory + ResultRendererFactory $resultRendererFactory, ) { $this->color = $color; $this->terminal = $terminal; @@ -95,7 +95,7 @@ public function render( ResultAggregator $results, ExerciseInterface $exercise, UserState $userState, - OutputInterface $output + OutputInterface $output, ): void { $successes = []; $failures = []; @@ -120,7 +120,7 @@ public function render( foreach ($successes as $success) { $output->writeLine($this->center($this->style(str_repeat(' ', $longest), ['bg_green']))); $output->writeLine( - $this->center($this->style(mb_str_pad($success, $longest), ['bg_green', 'white', 'bold'])) + $this->center($this->style(mb_str_pad($success, $longest), ['bg_green', 'white', 'bold'])), ); $output->writeLine($this->center($this->style(str_repeat(' ', $longest), ['bg_green']))); $output->emptyLine(); @@ -143,7 +143,7 @@ private function renderErrorInformation( array $failures, int $padLength, ExerciseInterface $exercise, - OutputInterface $output + OutputInterface $output, ): void { foreach ($failures as [$failure, $message]) { $output->writeLine($this->center($this->style(str_repeat(' ', $padLength), ['bg_red']))); @@ -161,7 +161,7 @@ private function renderErrorInformation( $output->emptyLine(); $output->writeLine( - $this->center(sprintf(" Your solution to %s didn't pass. Try again!", $exercise->getName())) + $this->center(sprintf(" Your solution to %s didn't pass. Try again!", $exercise->getName())), ); $output->emptyLine(); $output->emptyLine(); @@ -175,7 +175,7 @@ private function renderErrorInformation( private function renderSuccessInformation( ExerciseInterface $exercise, UserState $userState, - OutputInterface $output + OutputInterface $output, ): void { $output->lineBreak(); $output->emptyLine(); @@ -195,7 +195,7 @@ private function renderSuccessInformation( $code = $this->keyLighter->highlight( $file->getContents(), $this->keyLighter->languageByExt('.' . $file->getExtension()), - new CliFormatter() + new CliFormatter(), ); //make sure there is a new line at the end @@ -251,10 +251,10 @@ private function fullWidthBlock(OutputInterface $output, string $string, array $ '%s%s%s', str_repeat(' ', (int) $start), $string, - str_repeat(' ', (int) ($this->terminal->getWidth() - $stringLength - $start)) + str_repeat(' ', (int) ($this->terminal->getWidth() - $stringLength - $start)), ), - $style - ) + $style, + ), ); $output->writeLine($this->style(str_repeat(' ', $this->terminal->getWidth()), $style)); } diff --git a/src/Solution/DirectorySolution.php b/src/Solution/DirectorySolution.php index 6491db05..5f1425f3 100644 --- a/src/Solution/DirectorySolution.php +++ b/src/Solution/DirectorySolution.php @@ -50,7 +50,7 @@ public function __construct(string $directory, string $entryPoint, array $exclus new RecursiveCallbackFilterIterator($dir, function (SplFileInfo $current) use ($exclusions) { return !in_array($current->getBasename(), $exclusions, true); }), - RecursiveIteratorIterator::SELF_FIRST + RecursiveIteratorIterator::SELF_FIRST, ); $files = []; @@ -64,7 +64,7 @@ public function __construct(string $directory, string $entryPoint, array $exclus if (!in_array($entryPoint, $files, true)) { throw new InvalidArgumentException( - sprintf('Entry point: "%s" does not exist in: "%s"', $entryPoint, $directory) + sprintf('Entry point: "%s" does not exist in: "%s"', $entryPoint, $directory), ); } diff --git a/src/TestUtils/WorkshopExerciseTest.php b/src/TestUtils/WorkshopExerciseTest.php index db3c2823..46189cc6 100644 --- a/src/TestUtils/WorkshopExerciseTest.php +++ b/src/TestUtils/WorkshopExerciseTest.php @@ -13,7 +13,6 @@ use PhpSchool\PhpWorkshop\ExerciseCheck\ComposerExerciseCheck; use PhpSchool\PhpWorkshop\ExerciseDispatcher; use PhpSchool\PhpWorkshop\ExerciseRepository; -use PhpSchool\PhpWorkshop\Listener\PrepareSolutionListener; use PhpSchool\PhpWorkshop\Result\Cgi\CgiResult; use PhpSchool\PhpWorkshop\Result\Cli\CliResult; use PhpSchool\PhpWorkshop\Result\Failure; @@ -21,7 +20,6 @@ use PhpSchool\PhpWorkshop\Result\ResultGroupInterface; use PhpSchool\PhpWorkshop\Result\ResultInterface; use PhpSchool\PhpWorkshop\ResultAggregator; -use PhpSchool\PhpWorkshop\Utils\ArrayObject; use PhpSchool\PhpWorkshop\Utils\Collection; use PhpSchool\PhpWorkshop\Utils\System; use PHPUnit\Framework\ExpectationFailedException; @@ -83,7 +81,7 @@ public function runExercise(string $submissionFile): void '%s/test/solutions/%s/%s', rtrim($this->container->get('basePath'), '/'), AbstractExercise::normaliseName($exercise->getName()), - $submissionFile + $submissionFile, ); if (!file_exists($submissionFileAbsolute)) { @@ -91,8 +89,8 @@ public function runExercise(string $submissionFile): void sprintf( 'Submission file "%s" does not exist in "%s"', $submissionFile, - dirname($submissionFileAbsolute) - ) + dirname($submissionFileAbsolute), + ), ); } @@ -101,7 +99,7 @@ public function runExercise(string $submissionFile): void } $input = new Input($this->container->get('appName'), [ - 'program' => $submissionFileAbsolute + 'program' => $submissionFileAbsolute, ]); $this->results = $this->container->get(ExerciseDispatcher::class) @@ -120,7 +118,7 @@ private function installDeps(ExerciseInterface $exercise, string $directory): vo $process = new Process( [$execFinder->find('composer'), 'install', '--no-interaction'], - $directory + $directory, ); $process->mustRun(); } @@ -136,7 +134,7 @@ public function assertVerifyWasSuccessful(): void return sprintf( ' * %s%s', get_class($failure), - $failure instanceof Failure ? ": {$failure->getReason()}" : '' + $failure instanceof Failure ? ": {$failure->getReason()}" : '', ); }); @@ -175,7 +173,7 @@ public function assertResultsHasFailure(string $resultClass, string $reason): vo return sprintf( ' * %s%s', get_class($failure), - $failure instanceof Failure ? ": {$failure->getReason()}" : '' + $failure instanceof Failure ? ": {$failure->getReason()}" : '', ); }); @@ -246,7 +244,7 @@ public function removeSolutionAsset(string $file): void '%s/test/solutions/%s/%s', rtrim($this->container->get('basePath'), '/'), AbstractExercise::normaliseName($this->getExercise()->getName()), - $file + $file, ); (new Filesystem())->remove($path); diff --git a/src/UserState/LocalJsonSerializer.php b/src/UserState/LocalJsonSerializer.php index 99368303..1695ef69 100644 --- a/src/UserState/LocalJsonSerializer.php +++ b/src/UserState/LocalJsonSerializer.php @@ -44,7 +44,7 @@ class LocalJsonSerializer implements Serializer public function __construct( string $saveFileDirectory, string $workshopName, - ExerciseRepository $exerciseRepository + ExerciseRepository $exerciseRepository, ) { $this->workshopName = $workshopName; $this->path = $saveFileDirectory; @@ -129,7 +129,7 @@ public function deSerialize(): UserState return new UserState( $json['completed_exercises'], - $json['current_exercise'] + $json['current_exercise'], ); } @@ -172,7 +172,7 @@ private function migrateData(string $legacySaveFile): ?UserState $userState = new UserState( $data['completed_exercises'], - is_string($data['current_exercise']) ? $data['current_exercise'] : null + is_string($data['current_exercise']) ? $data['current_exercise'] : null, ); $this->serialize($userState); diff --git a/src/Utils/Collection.php b/src/Utils/Collection.php index f0dc1136..1029ac2c 100644 --- a/src/Utils/Collection.php +++ b/src/Utils/Collection.php @@ -10,6 +10,4 @@ * @template T * @extends ArrayObject */ -class Collection extends ArrayObject -{ -} +class Collection extends ArrayObject {} diff --git a/src/Utils/Path.php b/src/Utils/Path.php index d3a4db77..a12e4f7f 100644 --- a/src/Utils/Path.php +++ b/src/Utils/Path.php @@ -12,8 +12,8 @@ public static function join(string $base, string ...$parts): string [rtrim($base, '/')], array_map(function (string $part) { return trim($part, '/'); - }, array_filter($parts)) - ) + }, array_filter($parts)), + ), ); } } diff --git a/src/Utils/StringUtils.php b/src/Utils/StringUtils.php index d3f9cffd..e2073f5a 100644 --- a/src/Utils/StringUtils.php +++ b/src/Utils/StringUtils.php @@ -57,9 +57,9 @@ public static function pluralise(string $string, array $items, string ...$args): str_replace( array_keys(self::$pluraliseSearchReplace), array_values(self::$pluraliseSearchReplace), - $string + $string, ), - $args + $args, ); } } diff --git a/test/ApplicationTest.php b/test/ApplicationTest.php index dd43f743..d8edbc04 100644 --- a/test/ApplicationTest.php +++ b/test/ApplicationTest.php @@ -14,10 +14,7 @@ use PhpSchool\PhpWorkshop\Output\OutputInterface; use PhpSchool\PhpWorkshopTest\Asset\MockEventDispatcher; use Psr\Log\LoggerInterface; -use Psr\Log\NullLogger; use PhpSchool\PhpWorkshop\Logger\ConsoleLogger; -use PhpSchool\PhpWorkshop\Logger\Logger; -use PHPUnit\Framework\TestCase; class ApplicationTest extends BaseTest { @@ -66,9 +63,9 @@ public function testEventListenersFromLocalAndWorkshopConfigAreMerged(): void 'entry1', 'entry2', 'entry3', - ] + ], ], - $eventListeners + $eventListeners, ); } @@ -139,8 +136,8 @@ public function testLoggingExceptionDuringTearDown(): void static function () use ($exception) { throw $exception; }, - ] - ] + ], + ], ]); $commandRouter = $container->get(CommandRouter::class); diff --git a/test/Asset/CgiExerciseImpl.php b/test/Asset/CgiExerciseImpl.php index 643420cb..ea996b17 100644 --- a/test/Asset/CgiExerciseImpl.php +++ b/test/Asset/CgiExerciseImpl.php @@ -8,7 +8,6 @@ use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\Exercise\Scenario\CgiScenario; use PhpSchool\PhpWorkshop\Solution\SolutionInterface; -use Psr\Http\Message\RequestInterface; class CgiExerciseImpl implements ExerciseInterface, CgiExercise { @@ -62,9 +61,7 @@ public function getRequiredChecks(): array return []; } - public function defineListeners(EventDispatcher $dispatcher): void - { - } + public function defineListeners(EventDispatcher $dispatcher): void {} public function setScenario(CgiScenario $scenario): void { diff --git a/test/Asset/CliExerciseImpl.php b/test/Asset/CliExerciseImpl.php index ecb957ec..e216bfba 100644 --- a/test/Asset/CliExerciseImpl.php +++ b/test/Asset/CliExerciseImpl.php @@ -77,7 +77,5 @@ public function getRequiredChecks(): array return []; } - public function defineListeners(EventDispatcher $dispatcher): void - { - } + public function defineListeners(EventDispatcher $dispatcher): void {} } diff --git a/test/Asset/CliExerciseMissingInterface.php b/test/Asset/CliExerciseMissingInterface.php index 21c8d482..9275d788 100644 --- a/test/Asset/CliExerciseMissingInterface.php +++ b/test/Asset/CliExerciseMissingInterface.php @@ -2,8 +2,6 @@ namespace PhpSchool\PhpWorkshopTest\Asset; -use PhpSchool\PhpWorkshop\Check\FileComparisonCheck; -use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Exercise\AbstractExercise; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; diff --git a/test/Asset/ComposerExercise.php b/test/Asset/ComposerExercise.php index e7365893..cd8f5010 100644 --- a/test/Asset/ComposerExercise.php +++ b/test/Asset/ComposerExercise.php @@ -7,7 +7,6 @@ use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseCheck\ComposerExerciseCheck; -use PhpSchool\PhpWorkshop\ExerciseDispatcher; class ComposerExercise implements ExerciseInterface, ComposerExerciseCheck { @@ -45,7 +44,7 @@ public function getRequiredPackages(): array { return [ 'klein/klein', - 'danielstjules/stringy' + 'danielstjules/stringy', ]; } @@ -59,7 +58,5 @@ public function getRequiredChecks(): array return [ComposerCheck::class]; } - public function defineListeners(EventDispatcher $dispatcher): void - { - } + public function defineListeners(EventDispatcher $dispatcher): void {} } diff --git a/test/Asset/ExerciseWithInitialCode.php b/test/Asset/ExerciseWithInitialCode.php index 49282605..cf99292e 100644 --- a/test/Asset/ExerciseWithInitialCode.php +++ b/test/Asset/ExerciseWithInitialCode.php @@ -2,12 +2,10 @@ namespace PhpSchool\PhpWorkshopTest\Asset; -use PhpSchool\PhpWorkshop\Check\FileComparisonCheck; use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\Exercise\ProvidesInitialCode; -use PhpSchool\PhpWorkshop\ExerciseDispatcher; use PhpSchool\PhpWorkshop\Solution\SingleFileSolution; use PhpSchool\PhpWorkshop\Solution\SolutionInterface; @@ -53,7 +51,5 @@ public function getRequiredChecks(): array return []; } - public function defineListeners(EventDispatcher $dispatcher): void - { - } + public function defineListeners(EventDispatcher $dispatcher): void {} } diff --git a/test/Asset/FileComparisonExercise.php b/test/Asset/FileComparisonExercise.php index 8627a37c..5976575e 100644 --- a/test/Asset/FileComparisonExercise.php +++ b/test/Asset/FileComparisonExercise.php @@ -2,13 +2,11 @@ namespace PhpSchool\PhpWorkshopTest\Asset; -use PhpSchool\PhpWorkshop\Check\ComposerCheck; use PhpSchool\PhpWorkshop\Check\FileComparisonCheck; use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseCheck\FileComparisonExerciseCheck; -use PhpSchool\PhpWorkshop\ExerciseDispatcher; use PhpSchool\PhpWorkshop\Solution\SolutionInterface; class FileComparisonExercise implements ExerciseInterface, FileComparisonExerciseCheck @@ -78,7 +76,5 @@ public function getRequiredChecks(): array return [FileComparisonCheck::class]; } - public function defineListeners(EventDispatcher $dispatcher): void - { - } + public function defineListeners(EventDispatcher $dispatcher): void {} } diff --git a/test/Asset/FunctionRequirementsExercise.php b/test/Asset/FunctionRequirementsExercise.php index 4e243a3f..6720cc71 100644 --- a/test/Asset/FunctionRequirementsExercise.php +++ b/test/Asset/FunctionRequirementsExercise.php @@ -2,14 +2,11 @@ namespace PhpSchool\PhpWorkshopTest\Asset; -use PhpSchool\PhpWorkshop\Check\ComposerCheck; -use PhpSchool\PhpWorkshop\Check\FileComparisonCheck; use PhpSchool\PhpWorkshop\Check\FunctionRequirementsCheck; use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseCheck\FunctionRequirementsExerciseCheck; -use PhpSchool\PhpWorkshop\ExerciseDispatcher; class FunctionRequirementsExercise implements ExerciseInterface, FunctionRequirementsExerciseCheck { @@ -69,7 +66,5 @@ public function getRequiredChecks(): array return [FunctionRequirementsCheck::class]; } - public function defineListeners(EventDispatcher $dispatcher): void - { - } + public function defineListeners(EventDispatcher $dispatcher): void {} } diff --git a/test/Asset/PatchableExercise.php b/test/Asset/PatchableExercise.php index c232113e..0669fa41 100644 --- a/test/Asset/PatchableExercise.php +++ b/test/Asset/PatchableExercise.php @@ -2,12 +2,10 @@ namespace PhpSchool\PhpWorkshopTest\Asset; -use PhpSchool\PhpWorkshop\Check\FileComparisonCheck; use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\Exercise\SubmissionPatchable; -use PhpSchool\PhpWorkshop\ExerciseDispatcher; use PhpSchool\PhpWorkshop\Patch; class PatchableExercise implements ExerciseInterface, SubmissionPatchable @@ -52,7 +50,5 @@ public function getRequiredChecks(): array return []; } - public function defineListeners(EventDispatcher $dispatcher): void - { - } + public function defineListeners(EventDispatcher $dispatcher): void {} } diff --git a/test/Asset/ProvidesSolutionExercise.php b/test/Asset/ProvidesSolutionExercise.php index 503e1bf8..91241503 100644 --- a/test/Asset/ProvidesSolutionExercise.php +++ b/test/Asset/ProvidesSolutionExercise.php @@ -4,12 +4,10 @@ namespace PhpSchool\PhpWorkshopTest\Asset; -use PhpSchool\PhpWorkshop\Check\FileComparisonCheck; use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\Exercise\ProvidesSolution; -use PhpSchool\PhpWorkshop\ExerciseDispatcher; use PhpSchool\PhpWorkshop\Solution\SingleFileSolution; use PhpSchool\PhpWorkshop\Solution\SolutionInterface; @@ -50,7 +48,5 @@ public function getRequiredChecks(): array return []; } - public function defineListeners(EventDispatcher $dispatcher): void - { - } + public function defineListeners(EventDispatcher $dispatcher): void {} } diff --git a/test/Asset/SelfCheckExerciseInterface.php b/test/Asset/SelfCheckExerciseInterface.php index aa64a343..6dde6156 100644 --- a/test/Asset/SelfCheckExerciseInterface.php +++ b/test/Asset/SelfCheckExerciseInterface.php @@ -5,6 +5,4 @@ use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\ExerciseCheck\SelfCheck; -interface SelfCheckExerciseInterface extends ExerciseInterface, SelfCheck -{ -} +interface SelfCheckExerciseInterface extends ExerciseInterface, SelfCheck {} diff --git a/test/Check/CodeExistsCheckTest.php b/test/Check/CodeExistsCheckTest.php index 5998b0da..a87b6952 100644 --- a/test/Check/CodeExistsCheckTest.php +++ b/test/Check/CodeExistsCheckTest.php @@ -7,10 +7,7 @@ use PhpSchool\PhpWorkshop\Check\SimpleCheckInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshopTest\BaseTest; -use PHPUnit\Framework\TestCase; -use PhpSchool\PhpWorkshop\Check\FileExistsCheck; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Result\Failure; use PhpSchool\PhpWorkshop\Result\Success; @@ -42,7 +39,7 @@ public function testSuccess(): void $this->assertInstanceOf( Success::class, - $this->check->check($context) + $this->check->check($context), ); } diff --git a/test/Check/CodeParseCheckTest.php b/test/Check/CodeParseCheckTest.php index f9614628..a8f2ca52 100644 --- a/test/Check/CodeParseCheckTest.php +++ b/test/Check/CodeParseCheckTest.php @@ -8,11 +8,9 @@ use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Result\Failure; use PhpSchool\PhpWorkshop\Result\Success; use PhpSchool\PhpWorkshop\Utils\Path; -use PhpSchool\PhpWorkshopTest\BaseTest; use PHPUnit\Framework\TestCase; use Yoast\PHPUnitPolyfills\Polyfills\AssertionRenames; @@ -51,10 +49,10 @@ public function testUnParseableCodeReturnsFailure(): void sprintf( '|^File: "%s" could not be parsed\. Error: "|', preg_quote( - Path::join($context->getStudentExecutionDirectory(), 'solution.php') - ) + Path::join($context->getStudentExecutionDirectory(), 'solution.php'), + ), ), - $result->getReason() + $result->getReason(), ); } diff --git a/test/Check/ComposerCheckTest.php b/test/Check/ComposerCheckTest.php index bf2b6446..422b22a5 100644 --- a/test/Check/ComposerCheckTest.php +++ b/test/Check/ComposerCheckTest.php @@ -9,9 +9,7 @@ use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseCheck\ComposerExerciseCheck; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Result\ComposerFailure; -use PhpSchool\PhpWorkshop\Result\Failure; use PhpSchool\PhpWorkshop\Result\Success; use PhpSchool\PhpWorkshopTest\Asset\ComposerExercise; use PHPUnit\Framework\TestCase; @@ -48,7 +46,7 @@ public function testExceptionIsThrownIfNotValidExercise(): void public function testCheckReturnsFailureIfNoComposerFile(): void { $result = $this->check->check( - new TestContext($this->exercise) + new TestContext($this->exercise), ); $this->assertInstanceOf(ComposerFailure::class, $result); @@ -61,7 +59,7 @@ public function testCheckReturnsFailureIfNoComposerLockFile(): void { $context = TestContext::fromExerciseAndStudentSolution( $this->exercise, - __DIR__ . '/../res/composer/not-locked/solution.php' + __DIR__ . '/../res/composer/not-locked/solution.php', ); $result = $this->check->check($context); @@ -76,7 +74,7 @@ public function testCheckReturnsFailureIfNoVendorFolder(): void { $context = TestContext::fromExerciseAndStudentSolution( $this->exercise, - __DIR__ . '/../res/composer/no-vendor/solution.php' + __DIR__ . '/../res/composer/no-vendor/solution.php', ); $result = $this->check->check($context); @@ -114,7 +112,7 @@ public function dependencyProvider(): array { return [ ['klein/klein', __DIR__ . '/../res/composer/no-klein/solution.php'], - ['danielstjules/stringy', __DIR__ . '/../res/composer/no-stringy/solution.php'] + ['danielstjules/stringy', __DIR__ . '/../res/composer/no-stringy/solution.php'], ]; } @@ -122,7 +120,7 @@ public function testCheckReturnsSuccessIfCorrectLockFile(): void { $context = TestContext::fromExerciseAndStudentSolution( $this->exercise, - __DIR__ . '/../res/composer/good-solution/solution.php' + __DIR__ . '/../res/composer/good-solution/solution.php', ); $result = $this->check->check($context); diff --git a/test/Check/DatabaseCheckTest.php b/test/Check/DatabaseCheckTest.php index dbbac4e0..df3cdd5f 100644 --- a/test/Check/DatabaseCheckTest.php +++ b/test/Check/DatabaseCheckTest.php @@ -8,14 +8,10 @@ use PhpSchool\PhpWorkshop\Check\DatabaseCheck; use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; -use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\Exercise\Scenario\CliScenario; use PhpSchool\PhpWorkshop\ExerciseCheck\DatabaseExerciseCheck; use PhpSchool\PhpWorkshop\ExerciseDispatcher; use PhpSchool\PhpWorkshop\ExerciseRunner\CliRunner; -use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContextFactory; -use PhpSchool\PhpWorkshop\ExerciseRunner\Context\StaticExecutionContextFactory; -use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; use PhpSchool\PhpWorkshop\ExerciseRunner\EnvironmentManager; use PhpSchool\PhpWorkshop\ExerciseRunner\RunnerManager; use PhpSchool\PhpWorkshop\Input\Input; @@ -49,7 +45,7 @@ public function setUp(): void $this->exercise = new DatabaseExercise(); $this->dbDir = sprintf( '%s/php-school/PhpSchool_PhpWorkshop_Check_DatabaseCheck', - str_replace('\\', '/', realpath(sys_get_temp_dir())) + str_replace('\\', '/', realpath(sys_get_temp_dir())), ); } @@ -114,7 +110,7 @@ public function testIfPDOThrowsExceptionItCleansUp(): void $solution = SingleFileSolution::fromFile(realpath(__DIR__ . '/../res/database/solution.php')); $this->exercise->setSolution($solution); $this->exercise->setScenario((new CliScenario())->withExecution([1, 2, 3])); - $this->exercise->setVerifier(fn () => true); + $this->exercise->setVerifier(fn() => true); $this->checkRepository->registerCheck($this->check); @@ -137,7 +133,7 @@ public function testSuccessIsReturnedIfDatabaseVerificationPassed(): void $this->exercise->setSolution($solution); $this->exercise->setScenario((new CliScenario())->withExecution([1, 2, 3])); - $this->exercise->setVerifier(fn () => true); + $this->exercise->setVerifier(fn() => true); $this->checkRepository->registerCheck($this->check); $results = new ResultAggregator(); @@ -170,7 +166,7 @@ public function testRunExercise(): void $dispatcher->run( $this->exercise, new Input('app', ['program' => __DIR__ . '/../res/database/user-solution-alter-db.php']), - $this->createMock(OutputInterface::class) + $this->createMock(OutputInterface::class), ); } @@ -179,7 +175,7 @@ public function testFailureIsReturnedIfDatabaseVerificationFails(): void $solution = SingleFileSolution::fromFile(realpath(__DIR__ . '/../res/database/solution.php')); $this->exercise->setSolution($solution); $this->exercise->setScenario((new CliScenario())->withExecution([1, 2, 3])); - $this->exercise->setVerifier(fn () => false); + $this->exercise->setVerifier(fn() => false); $this->checkRepository->registerCheck($this->check); @@ -215,7 +211,7 @@ public function testAlteringDatabaseInSolutionDoesNotEffectDatabaseInUserSolutio ['id' => 1, 'name' => 'Jimi Hendrix', 'age' => '27', 'gender' => 'Male'], ['id' => 2, 'name' => 'Kurt Cobain', 'age' => '27', 'gender' => 'Male'], ], - $users + $users, ); return true; @@ -223,7 +219,7 @@ public function testAlteringDatabaseInSolutionDoesNotEffectDatabaseInUserSolutio $this->exercise->setSeeder(function (PDO $db) { $db->exec( - 'CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT, age INTEGER, gender TEXT)' + 'CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT, age INTEGER, gender TEXT)', ); $stmt = $db->prepare('INSERT into users (name, age, gender) VALUES (:name, :age, :gender)'); $stmt->execute([':name' => 'Jimi Hendrix', ':age' => 27, ':gender' => 'Male']); @@ -242,7 +238,7 @@ public function testAlteringDatabaseInSolutionDoesNotEffectDatabaseInUserSolutio $dispatcher->verify( $this->exercise, - new Input('app', ['program' => __DIR__ . '/../res/database/user-solution-alter-db.php']) + new Input('app', ['program' => __DIR__ . '/../res/database/user-solution-alter-db.php']), ); } diff --git a/test/Check/FileComparisonCheckTest.php b/test/Check/FileComparisonCheckTest.php index b2db8b7a..11d76b29 100644 --- a/test/Check/FileComparisonCheckTest.php +++ b/test/Check/FileComparisonCheckTest.php @@ -8,12 +8,8 @@ use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseCheck\FileComparisonExerciseCheck; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Result\FileComparisonFailure; -use PhpSchool\PhpWorkshop\Solution\SingleFileSolution; -use PhpSchool\PhpWorkshop\Solution\SolutionInterface; use PhpSchool\PhpWorkshopTest\Asset\FileComparisonExercise; -use PhpSchool\PhpWorkshopTest\BaseTest; use PhpSchool\PhpWorkshop\Result\Failure; use PhpSchool\PhpWorkshop\Result\Success; use PHPUnit\Framework\TestCase; diff --git a/test/Check/FileExistsCheckTest.php b/test/Check/FileExistsCheckTest.php index e4dfc0c8..a422bc08 100644 --- a/test/Check/FileExistsCheckTest.php +++ b/test/Check/FileExistsCheckTest.php @@ -5,7 +5,6 @@ use PhpSchool\PhpWorkshop\Check\SimpleCheckInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Utils\Path; use PHPUnit\Framework\TestCase; use PhpSchool\PhpWorkshop\Check\FileExistsCheck; @@ -40,7 +39,7 @@ public function testSuccess(): void $this->assertInstanceOf( Success::class, - $this->check->check($context) + $this->check->check($context), ); } @@ -53,9 +52,9 @@ public function testFailure(): void $this->assertEquals( sprintf( 'File: "%s" does not exist', - Path::join($context->getStudentExecutionDirectory(), 'solution.php') + Path::join($context->getStudentExecutionDirectory(), 'solution.php'), ), - $failure->getReason() + $failure->getReason(), ); } } diff --git a/test/Check/FunctionRequirementsCheckTest.php b/test/Check/FunctionRequirementsCheckTest.php index 924e58fb..e4693c07 100644 --- a/test/Check/FunctionRequirementsCheckTest.php +++ b/test/Check/FunctionRequirementsCheckTest.php @@ -8,7 +8,6 @@ use PhpSchool\PhpWorkshop\Check\SimpleCheckInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshopTest\Asset\FunctionRequirementsExercise; use PHPUnit\Framework\TestCase; use PhpSchool\PhpWorkshop\Check\FunctionRequirementsCheck; @@ -54,7 +53,7 @@ public function testFailureIsReturnedIfCodeCouldNotBeParsed(): void { $context = TestContext::fromExerciseAndStudentSolution( $this->exercise, - __DIR__ . '/../res/function-requirements/fail-invalid-code.php' + __DIR__ . '/../res/function-requirements/fail-invalid-code.php', ); $failure = $this->check->check($context); @@ -62,7 +61,7 @@ public function testFailureIsReturnedIfCodeCouldNotBeParsed(): void $this->assertInstanceOf(Failure::class, $failure); $message = sprintf( 'File: "%s/fail-invalid-code.php" could not be parsed. Error: "Syntax error, unexpected T_ECHO on line 4"', - $context->getStudentExecutionDirectory() + $context->getStudentExecutionDirectory(), ); $this->assertEquals($message, $failure->getReason()); } @@ -71,7 +70,7 @@ public function testFailureIsReturnedIfBannedFunctionsAreUsed(): void { $context = TestContext::fromExerciseAndStudentSolution( $this->exercise, - __DIR__ . '/../res/function-requirements/fail-banned-function.php' + __DIR__ . '/../res/function-requirements/fail-banned-function.php', ); $failure = $this->check->check($context); @@ -96,7 +95,7 @@ public function testFailureIsReturnedIfNotAllRequiredFunctionsHaveBeenUsed(): vo $context = TestContext::fromExerciseAndStudentSolution( $exercise, - __DIR__ . '/../res/function-requirements/fail-banned-function.php' + __DIR__ . '/../res/function-requirements/fail-banned-function.php', ); $failure = $this->check->check($context); @@ -121,7 +120,7 @@ public function testSuccess(): void $context = TestContext::fromExerciseAndStudentSolution( $exercise, - __DIR__ . '/../res/function-requirements/success.php' + __DIR__ . '/../res/function-requirements/success.php', ); $success = $this->check->check($context); diff --git a/test/Check/PhpLintCheckTest.php b/test/Check/PhpLintCheckTest.php index b905f4ba..3cc51649 100644 --- a/test/Check/PhpLintCheckTest.php +++ b/test/Check/PhpLintCheckTest.php @@ -4,9 +4,7 @@ use PhpSchool\PhpWorkshop\Check\SimpleCheckInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseType; -use PhpSchool\PhpWorkshop\ExerciseCheck\FunctionRequirementsExerciseCheck; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PHPUnit\Framework\TestCase; use PhpSchool\PhpWorkshop\Check\PhpLintCheck; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; @@ -41,14 +39,14 @@ public function testSuccess(): void { $context = TestContext::fromExerciseAndStudentSolution( $this->exercise, - __DIR__ . '/../res/lint/pass.php' + __DIR__ . '/../res/lint/pass.php', ); $res = $this->check->check($context); $this->assertInstanceOf( Success::class, - $this->check->check($context) + $this->check->check($context), ); } @@ -56,7 +54,7 @@ public function testFailure(): void { $context = TestContext::fromExerciseAndStudentSolution( $this->exercise, - __DIR__ . '/../res/lint/fail.php' + __DIR__ . '/../res/lint/fail.php', ); $failure = $this->check->check($context); @@ -64,7 +62,7 @@ public function testFailure(): void $this->assertInstanceOf(Failure::class, $failure); $this->assertMatchesRegularExpression( "/(PHP )?Parse error:\W+syntax error, unexpected end of file, expecting ['\"][,;]['\"] or ['\"][;,]['\"]/", - $failure->getReason() + $failure->getReason(), ); } } diff --git a/test/CodePatcherTest.php b/test/CodePatcherTest.php index 3db0d8a4..edab5a90 100644 --- a/test/CodePatcherTest.php +++ b/test/CodePatcherTest.php @@ -10,7 +10,6 @@ use PhpParser\Node\Stmt\TryCatch; use PhpParser\ParserFactory; use PhpParser\PrettyPrinter\Standard; -use PhpParser\PrettyPrinterAbstract; use PhpSchool\PhpWorkshop\CodePatcher; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\Patch; @@ -31,7 +30,7 @@ public function testDefaultPatchIsAppliedIfAvailable(): void (new ParserFactory())->create(ParserFactory::PREFER_PHP7), new Standard(), new NullLogger(), - $patch + $patch, ); $exercise = $this->createMock(ExerciseInterface::class); @@ -44,7 +43,7 @@ public function testPatcherDoesNotApplyPatchIfNotPatchableExercise(): void $patcher = new CodePatcher( (new ParserFactory())->create(ParserFactory::PREFER_PHP7), new Standard(), - new NullLogger() + new NullLogger(), ); $exercise = $this->createMock(ExerciseInterface::class); @@ -60,7 +59,7 @@ public function testPatcher(string $code, Patch $patch, string $expectedResult): $patcher = new CodePatcher( (new ParserFactory())->create(ParserFactory::PREFER_PHP7), new Standard(), - new NullLogger() + new NullLogger(), ); $exercise = $this->createMock(PatchableExercise::class); @@ -79,35 +78,35 @@ public function codeProvider(): array 'only-before-insertion' => [ 'withInsertion(new Insertion(Insertion::TYPE_BEFORE, '$before = "here";')), - " [ 'withInsertion(new Insertion(Insertion::TYPE_AFTER, '$after = "here";')), - " [ 'withInsertion(new Insertion(Insertion::TYPE_BEFORE, '$before = "here";')) ->withInsertion(new Insertion(Insertion::TYPE_AFTER, '$after = "here";')), - " [ 'withInsertion(new Insertion(Insertion::TYPE_BEFORE, '$before = "here"')), //no semicolon at the end - " [ 'withInsertion(new Insertion(Insertion::TYPE_BEFORE, ' [ 'withInsertion(new Insertion(Insertion::TYPE_BEFORE, ' [ ' [ ' [ 'withTransformer(new class implements Patch\Transformer { + ->withTransformer(new class () implements Patch\Transformer { public function transform(array $statements): array { return [ new TryCatch( $statements, - [new Catch_([new Name(\Exception::class)], new Variable('e'), [])] - ) + [new Catch_([new Name(\Exception::class)], new Variable('e'), [])], + ), ]; } }), - "create(ParserFactory::PREFER_PHP7), new Standard(), - new NullLogger() + new NullLogger(), ); $exercise = $this->createMock(PatchableExercise::class); @@ -175,7 +174,7 @@ public function testBeforeInsertionInsertsAfterStrictTypesDeclaration(): void $this->assertEquals( "patch($exercise, $code) + $patcher->patch($exercise, $code), ); } @@ -187,15 +186,15 @@ public function testTransformerWithStrictTypes(): void return [ new TryCatch( $statements, - [new Catch_([new Name(\Exception::class)], new Variable('e'), [])] - ) + [new Catch_([new Name(\Exception::class)], new Variable('e'), [])], + ), ]; }); $patcher = new CodePatcher( (new ParserFactory())->create(ParserFactory::PREFER_PHP7), new Standard(), - new NullLogger() + new NullLogger(), ); $exercise = $this->createMock(PatchableExercise::class); @@ -207,7 +206,7 @@ public function testTransformerWithStrictTypes(): void $this->assertEquals( "patch($exercise, $code) + $patcher->patch($exercise, $code), ); } @@ -219,15 +218,15 @@ public function testTransformerWhichAddsStrictTypesDoesNotResultInDoubleStrictTy return [new \PhpParser\Node\Stmt\Declare_([ new DeclareDeclare( new \PhpParser\Node\Identifier('strict_types'), - new LNumber(1) - ) + new LNumber(1), + ), ])]; }); $patcher = new CodePatcher( (new ParserFactory())->create(ParserFactory::PREFER_PHP7), new Standard(), - new NullLogger() + new NullLogger(), ); $exercise = $this->createMock(PatchableExercise::class); @@ -239,7 +238,7 @@ public function testTransformerWhichAddsStrictTypesDoesNotResultInDoubleStrictTy $this->assertEquals( "patch($exercise, $code) + $patcher->patch($exercise, $code), ); } @@ -251,8 +250,8 @@ public function testAddingStrictTypesDeclareDoesNotBreakBeforeInsertion(): void return array_merge([new \PhpParser\Node\Stmt\Declare_([ new DeclareDeclare( new \PhpParser\Node\Identifier('strict_types'), - new LNumber(1) - ) + new LNumber(1), + ), ])], $statements); }) ->withInsertion(new Insertion(Insertion::TYPE_BEFORE, '$before = "here";')); @@ -260,7 +259,7 @@ public function testAddingStrictTypesDeclareDoesNotBreakBeforeInsertion(): void $patcher = new CodePatcher( (new ParserFactory())->create(ParserFactory::PREFER_PHP7), new Standard(), - new NullLogger() + new NullLogger(), ); $exercise = $this->createMock(PatchableExercise::class); @@ -272,7 +271,7 @@ public function testAddingStrictTypesDeclareDoesNotBreakBeforeInsertion(): void $this->assertEquals( "patch($exercise, $code) + $patcher->patch($exercise, $code), ); } @@ -281,7 +280,7 @@ public function testExceptionIsLoggedIfCodeIsNotParseable(): void $patcher = new CodePatcher( (new ParserFactory())->create(ParserFactory::PREFER_PHP7), new Standard(), - $logger = $this->createMock(LoggerInterface::class) + $logger = $this->createMock(LoggerInterface::class), ); $exercise = $this->createMock(PatchableExercise::class); @@ -298,12 +297,12 @@ public function testExceptionIsLoggedIfCodeIsNotParseable(): void ->method('critical') ->with( 'Code Insertion could not be parsed: Syntax error, unexpected EOF on line 1', - ['code' => '$before = "here"'] + ['code' => '$before = "here"'], ); $this->assertEquals( "patch($exercise, 'patch($exercise, ' 'Aydin Hassan', '@mikeymike' => 'Michael Woodward', '@shakeyShane' => 'Shane Osbourne', - '@chris3ailey' => 'Chris Bailey' + '@chris3ailey' => 'Chris Bailey', ], [ '@AydinHassan' => 'Aydin Hassan', '@mikeymike' => 'Michael Woodward', ], new StdOutput($color, $this->createMock(Terminal::class)), - $color + $color, ); $command->__invoke(); @@ -47,11 +47,11 @@ public function testWithOnlyCoreContributors(): void '@AydinHassan' => 'Aydin Hassan', '@mikeymike' => 'Michael Woodward', '@shakeyShane' => 'Shane Osbourne', - '@chris3ailey' => 'Chris Bailey' + '@chris3ailey' => 'Chris Bailey', ], [], new StdOutput($color, $this->createMock(Terminal::class)), - $color + $color, ); $command->__invoke(); @@ -68,7 +68,7 @@ public function testWithNoContributors(): void [], [], new StdOutput($color, $this->createMock(Terminal::class)), - $color + $color, ); $command->__invoke(); diff --git a/test/Command/HelpCommandTest.php b/test/Command/HelpCommandTest.php index ec1a607f..968aa31d 100644 --- a/test/Command/HelpCommandTest.php +++ b/test/Command/HelpCommandTest.php @@ -20,7 +20,7 @@ public function testInvoke(): void $command = new HelpCommand( 'learnyouphp', new StdOutput($color, $this->createMock(Terminal::class)), - $color + $color, ); $command->__invoke(); diff --git a/test/Command/RunCommandTest.php b/test/Command/RunCommandTest.php index 7755220a..95745160 100644 --- a/test/Command/RunCommandTest.php +++ b/test/Command/RunCommandTest.php @@ -3,7 +3,6 @@ namespace PhpSchool\PhpWorkshopTest\Command; use Colors\Color; -use PhpSchool\PhpWorkshop\Exercise\TemporaryDirectoryTrait; use PhpSchool\PhpWorkshopTest\BaseTest; use PhpSchool\Terminal\Terminal; use PhpSchool\PhpWorkshop\Command\RunCommand; @@ -13,7 +12,6 @@ use PhpSchool\PhpWorkshop\Output\StdOutput; use PhpSchool\PhpWorkshop\UserState\UserState; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; -use PHPUnit\Framework\TestCase; class RunCommandTest extends BaseTest { diff --git a/test/CommandDefinitionTest.php b/test/CommandDefinitionTest.php index f6620528..5c3e2b64 100644 --- a/test/CommandDefinitionTest.php +++ b/test/CommandDefinitionTest.php @@ -11,8 +11,7 @@ class CommandDefinitionTest extends TestCase { public function testGettersSettersWithStringArgs(): void { - $callable = function () { - }; + $callable = function () {}; $definition = new CommandDefinition('animal', ['name'], $callable); $this->assertSame($definition->getName(), 'animal'); @@ -27,8 +26,7 @@ public function testGettersSettersWithStringArgs(): void public function testGettersSettersWithObjArgs(): void { - $callable = function () { - }; + $callable = function () {}; $definition = new CommandDefinition('animal', [new CommandArgument('name')], $callable); $this->assertSame($definition->getName(), 'animal'); diff --git a/test/CommandRouterTest.php b/test/CommandRouterTest.php index a7f20964..bf2aa36b 100644 --- a/test/CommandRouterTest.php +++ b/test/CommandRouterTest.php @@ -40,7 +40,7 @@ public function testAddCommandAppendsToExistingCommands(): void [new CommandDefinition('verify', [], $routeCallable)], 'verify', $eventDispatcher, - $c + $c, ); $router->addCommand(new CommandDefinition('run', [], $routeCallable)); @@ -111,8 +111,7 @@ public function testRouteCommandThrowsExceptionIfCommandWithNameNotExist(): void $c = $this->createMock(ContainerInterface::class); $eventDispatcher = $this->createMock(EventDispatcher::class); - $router = new CommandRouter([new CommandDefinition('cmd', [], function () { - }),], 'cmd', $eventDispatcher, $c); + $router = new CommandRouter([new CommandDefinition('cmd', [], function () {}),], 'cmd', $eventDispatcher, $c); $router->route(['app', 'not-a-cmd']); } @@ -124,11 +123,10 @@ public function testRouteCommandThrowsExceptionIfCommandIsMissingAllArguments(): $c = $this->createMock(ContainerInterface::class); $eventDispatcher = $this->createMock(EventDispatcher::class); $router = new CommandRouter( - [new CommandDefinition('verify', ['exercise', 'program'], function () { - }),], + [new CommandDefinition('verify', ['exercise', 'program'], function () {}),], 'verify', $eventDispatcher, - $c + $c, ); $router->route(['app', 'verify']); } @@ -141,11 +139,10 @@ public function testRouteCommandThrowsExceptionIfCommandIsMissingArguments(): vo $c = $this->createMock(ContainerInterface::class); $eventDispatcher = $this->createMock(EventDispatcher::class); $router = new CommandRouter( - [new CommandDefinition('verify', ['exercise', 'program'], function () { - }),], + [new CommandDefinition('verify', ['exercise', 'program'], function () {}),], 'verify', $eventDispatcher, - $c + $c, ); $router->route(['app', 'verify', 'some-exercise']); } @@ -171,7 +168,7 @@ public function testRouteCommandWithArgs(): void [new CommandDefinition('verify', ['exercise', 'program'], $mock),], 'verify', $eventDispatcher, - $c + $c, ); $router->route(['app', 'verify', 'some-exercise', 'program.php']); } @@ -187,7 +184,7 @@ public function testExceptionIsThrownIfCallableNotCallableAndNotContainerReferen [new CommandDefinition('verify', ['exercise', 'program'], new \stdClass()),], 'verify', $eventDispatcher, - $c + $c, ); $router->route(['app', 'verify', 'some-exercise', 'program.php']); } @@ -210,7 +207,7 @@ public function testExceptionIsThrownIfCallableNotCallableAndNotExistingContaine [new CommandDefinition('verify', ['exercise', 'program'], 'some.service'),], 'verify', $eventDispatcher, - $c + $c, ); $router->route(['app', 'verify', 'some-exercise', 'program.php']); } @@ -239,7 +236,7 @@ public function testExceptionIsThrownIfContainerEntryNotCallable(): void [new CommandDefinition('verify', ['exercise', 'program'], 'some.service'),], 'verify', $eventDispatcher, - $c + $c, ); $router->route(['app', 'verify', 'some-exercise', 'program.php']); } @@ -279,7 +276,7 @@ public function testCallableFromContainer(): void [new CommandDefinition('verify', ['exercise', 'program'], 'some.service'),], 'verify', $eventDispatcher, - $c + $c, ); $router->route(['app', 'verify', 'some-exercise', 'program.php']); } @@ -319,7 +316,7 @@ public function testCallableFromContainerWithIntegerReturnCode(): void [new CommandDefinition('verify', ['exercise', 'program'], 'some.service'),], 'verify', $eventDispatcher, - $c + $c, ); $res = $router->route(['app', 'verify', 'some-exercise', 'program.php']); $this->assertEquals(10, $res); @@ -347,7 +344,7 @@ public function testRouteCommandSpeltIncorrectlyStillRoutes(): void [new CommandDefinition('verify', ['exercise', 'program'], $mock),], 'verify', $eventDispatcher, - $c + $c, ); $router->route(['app', 'verifu', 'some-exercise', 'program.php']); } @@ -365,14 +362,14 @@ public function testRouteCommandWithOptionalArgument(): void $this->callback(function (Input $input) { return $input->getAppName() === 'app' && $input->getArgument('exercise') === 'some-exercise'; - }) + }), ], [ $this->callback(function (Input $input) { return $input->getAppName() === 'app' && $input->getArgument('exercise') === 'some-exercise' && $input->getArgument('program') === 'program.php'; - }) + }), ], [ $this->callback(function (Input $input) { @@ -380,8 +377,8 @@ public function testRouteCommandWithOptionalArgument(): void && $input->getArgument('exercise') === 'some-exercise' && $input->getArgument('program') === 'program.php' && $input->getArgument('some-other-arg') === 'some-other-arg-value'; - }) - ] + }), + ], ) ->willReturnOnConsecutiveCalls(1, null, 1); @@ -394,14 +391,14 @@ public function testRouteCommandWithOptionalArgument(): void [ 'exercise', new CommandArgument('program', true), - new CommandArgument('some-other-arg', true) + new CommandArgument('some-other-arg', true), ], - $mock - ) + $mock, + ), ], 'verify', $eventDispatcher, - $c + $c, ); $router->route(['app', 'verify', 'some-exercise']); $router->route(['app', 'verify', 'some-exercise', 'program.php']); diff --git a/test/ContainerAwareTest.php b/test/ContainerAwareTest.php index c54e5573..b3bda6c5 100644 --- a/test/ContainerAwareTest.php +++ b/test/ContainerAwareTest.php @@ -64,9 +64,9 @@ public function assertLoggerHasMessages(array $messages): void [ 'level' => $message['level'], 'message' => $message['message'], - 'context' => $message['context'] + 'context' => $message['context'], ], - $logged + $logged, ); } } diff --git a/test/Event/CgiExecuteEventTest.php b/test/Event/CgiExecuteEventTest.php index 53ca8450..a4cd3d21 100644 --- a/test/Event/CgiExecuteEventTest.php +++ b/test/Event/CgiExecuteEventTest.php @@ -4,11 +4,8 @@ use GuzzleHttp\Psr7\Request; use PhpSchool\PhpWorkshop\Event\CgiExecuteEvent; -use PhpSchool\PhpWorkshop\Exercise\MockExercise; use PhpSchool\PhpWorkshop\Exercise\Scenario\CgiScenario; -use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PHPUnit\Framework\TestCase; use Psr\Http\Message\RequestInterface; @@ -28,7 +25,7 @@ public function testAddHeader(): void 'Host' => ['some.site'], 'Content-Type' => ['text/html'], ], - $e->getRequest()->getHeaders() + $e->getRequest()->getHeaders(), ); $this->assertNotSame($request, $e->getRequest()); } @@ -51,7 +48,7 @@ public function testModifyRequest(): void 'Host' => ['some.site'], 'Content-Type' => ['text/html'], ], - $e->getRequest()->getHeaders() + $e->getRequest()->getHeaders(), ); $this->assertSame('POST', $e->getRequest()->getMethod()); $this->assertNotSame($request, $e->getRequest()); diff --git a/test/Event/CgiExerciseRunnerEventTest.php b/test/Event/CgiExerciseRunnerEventTest.php index 2e8caa72..ac10f1a6 100644 --- a/test/Event/CgiExerciseRunnerEventTest.php +++ b/test/Event/CgiExerciseRunnerEventTest.php @@ -3,11 +3,8 @@ namespace PhpSchool\PhpWorkshopTest\Event; use PhpSchool\PhpWorkshop\Event\CgiExerciseRunnerEvent; -use PhpSchool\PhpWorkshop\Exercise\MockExercise; use PhpSchool\PhpWorkshop\Exercise\Scenario\CgiScenario; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; -use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; class CgiExerciseRunnerEventTest extends TestCase @@ -26,9 +23,9 @@ public function testGetters(): void [ 'exercise' => $context->getExercise(), 'input' => $context->getInput(), - 'number' => 1 + 'number' => 1, ], - $event->getParameters() + $event->getParameters(), ); } } diff --git a/test/Event/CliExecuteEventTest.php b/test/Event/CliExecuteEventTest.php index 59bf9de3..243f2d0a 100644 --- a/test/Event/CliExecuteEventTest.php +++ b/test/Event/CliExecuteEventTest.php @@ -3,12 +3,8 @@ namespace PhpSchool\PhpWorkshopTest\Event; use PhpSchool\PhpWorkshop\Event\CliExecuteEvent; -use PhpSchool\PhpWorkshop\Exercise\MockExercise; -use PhpSchool\PhpWorkshop\Exercise\Scenario\CgiScenario; use PhpSchool\PhpWorkshop\Exercise\Scenario\CliScenario; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; -use PhpSchool\PhpWorkshop\Utils\ArrayObject; use PhpSchool\PhpWorkshop\Utils\Collection; use PHPUnit\Framework\TestCase; diff --git a/test/Event/CliExerciseRunnerEventTest.php b/test/Event/CliExerciseRunnerEventTest.php index d3f7c706..a32d7012 100644 --- a/test/Event/CliExerciseRunnerEventTest.php +++ b/test/Event/CliExerciseRunnerEventTest.php @@ -3,12 +3,8 @@ namespace PhpSchool\PhpWorkshopTest\Event; use PhpSchool\PhpWorkshop\Event\CliExerciseRunnerEvent; -use PhpSchool\PhpWorkshop\Exercise\MockExercise; -use PhpSchool\PhpWorkshop\Exercise\Scenario\CgiScenario; use PhpSchool\PhpWorkshop\Exercise\Scenario\CliScenario; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; -use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; class CliExerciseRunnerEventTest extends TestCase @@ -27,9 +23,9 @@ public function testGetters(): void [ 'exercise' => $context->getExercise(), 'input' => $context->getInput(), - 'number' => 1 + 'number' => 1, ], - $event->getParameters() + $event->getParameters(), ); } } diff --git a/test/Event/EventDispatcherTest.php b/test/Event/EventDispatcherTest.php index c517fb6a..58999a0f 100644 --- a/test/Event/EventDispatcherTest.php +++ b/test/Event/EventDispatcherTest.php @@ -144,11 +144,9 @@ public function testListenersAndVerifiersAreCalledInOrderOfAttachment(): void public function testRemoveListener(): void { - $listener = function () { - }; + $listener = function () {}; - $listener2 = function () { - }; + $listener2 = function () {}; $this->eventDispatcher->listen('some-event', $listener); $this->eventDispatcher->listen('some-event', $listener2); @@ -168,10 +166,8 @@ public function testRemoveLazyListeners(): void { $container = $this->createMock(ContainerInterface::class); - $myListener = new class { - public function __invoke() - { - } + $myListener = new class () { + public function __invoke() {} }; $container->expects($this->any()) @@ -181,7 +177,7 @@ public function __invoke() $lazy = new LazyContainerListener( $container, - new ContainerListenerHelper('my-listener') + new ContainerListenerHelper('my-listener'), ); $this->eventDispatcher->listen('some-event', $lazy); @@ -197,10 +193,8 @@ public function testRemoveLazyListenersWithAlternateMethod(): void { $container = $this->createMock(ContainerInterface::class); - $myListener = new class { - public function myMethod() - { - } + $myListener = new class () { + public function myMethod() {} }; $container->expects($this->any()) @@ -210,7 +204,7 @@ public function myMethod() $lazy = new LazyContainerListener( $container, - new ContainerListenerHelper('my-listener', 'myMethod') + new ContainerListenerHelper('my-listener', 'myMethod'), ); $this->eventDispatcher->listen('some-event', $lazy); diff --git a/test/Event/ExerciseRunnerEventTest.php b/test/Event/ExerciseRunnerEventTest.php index 4095b769..2b952e9e 100644 --- a/test/Event/ExerciseRunnerEventTest.php +++ b/test/Event/ExerciseRunnerEventTest.php @@ -3,10 +3,7 @@ namespace PhpSchool\PhpWorkshopTest\Event; use PhpSchool\PhpWorkshop\Event\ExerciseRunnerEvent; -use PhpSchool\PhpWorkshop\Exercise\Scenario\CliScenario; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; -use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; class ExerciseRunnerEventTest extends TestCase @@ -23,9 +20,9 @@ public function testGetters(): void [ 'exercise' => $context->getExercise(), 'input' => $context->getInput(), - 'number' => 1 + 'number' => 1, ], - $event->getParameters() + $event->getParameters(), ); } } diff --git a/test/Exception/MissingArgumentExceptionTest.php b/test/Exception/MissingArgumentExceptionTest.php index a17c7dc5..851c4db6 100644 --- a/test/Exception/MissingArgumentExceptionTest.php +++ b/test/Exception/MissingArgumentExceptionTest.php @@ -12,7 +12,7 @@ public function testException(): void $e = new MissingArgumentException('some-route', ['arg1', 'arg2']); $this->assertEquals( 'Command: "some-route" is missing the following arguments: "arg1", "arg2"', - $e->getMessage() + $e->getMessage(), ); $this->assertSame(['arg1', 'arg2'], $e->getMissingArguments()); diff --git a/test/Exercise/AbstractExerciseTest.php b/test/Exercise/AbstractExerciseTest.php index c500b0f7..4bedbae5 100644 --- a/test/Exercise/AbstractExerciseTest.php +++ b/test/Exercise/AbstractExerciseTest.php @@ -3,9 +3,7 @@ namespace PhpSchool\PhpWorkshopTest\Exercise; use PhpSchool\PhpWorkshop\Event\EventDispatcher; -use PhpSchool\PhpWorkshop\ExerciseDispatcher; use PhpSchool\PhpWorkshop\Solution\SolutionFile; -use PhpSchool\PhpWorkshop\Solution\SolutionInterface; use PhpSchool\PhpWorkshopTest\Asset\AbstractExerciseImpl; use PHPUnit\Framework\TestCase; use ReflectionClass; diff --git a/test/Exercise/Scenario/CgiScenarioTest.php b/test/Exercise/Scenario/CgiScenarioTest.php index 4c0782ca..8cebba7d 100644 --- a/test/Exercise/Scenario/CgiScenarioTest.php +++ b/test/Exercise/Scenario/CgiScenarioTest.php @@ -3,7 +3,6 @@ namespace PhpSchool\PhpWorkshopTest\Exercise\Scenario; use PhpSchool\PhpWorkshop\Exercise\Scenario\CgiScenario; -use PhpSchool\PhpWorkshop\Utils\Collection; use PHPUnit\Framework\TestCase; use Psr\Http\Message\RequestInterface; @@ -25,15 +24,15 @@ public function testScenario(): void 'file1.txt' => 'content1', 'file2.txt' => 'content2', ], - $scenario->getFiles() + $scenario->getFiles(), ); static::assertEquals( [ $requestOne, - $requestTwo + $requestTwo, ], - $scenario->getExecutions() + $scenario->getExecutions(), ); } } diff --git a/test/Exercise/Scenario/CliScenarioTest.php b/test/Exercise/Scenario/CliScenarioTest.php index 1ea86a9a..50967b7b 100644 --- a/test/Exercise/Scenario/CliScenarioTest.php +++ b/test/Exercise/Scenario/CliScenarioTest.php @@ -21,7 +21,7 @@ public function testScenario(): void 'file1.txt' => 'content1', 'file2.txt' => 'content2', ], - $scenario->getFiles() + $scenario->getFiles(), ); static::assertEquals( @@ -30,9 +30,9 @@ public function testScenario(): void ['arg3', 'arg4'], ], array_map( - fn (Collection $collection) => $collection->getArrayCopy(), - $scenario->getExecutions() - ) + fn(Collection $collection) => $collection->getArrayCopy(), + $scenario->getExecutions(), + ), ); } } diff --git a/test/ExerciseDispatcherTest.php b/test/ExerciseDispatcherTest.php index 4792b602..6a8fa1a4 100644 --- a/test/ExerciseDispatcherTest.php +++ b/test/ExerciseDispatcherTest.php @@ -15,7 +15,6 @@ use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\ExerciseDispatcher; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; -use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContextFactory; use PhpSchool\PhpWorkshop\ExerciseRunner\ExerciseRunnerInterface; use PhpSchool\PhpWorkshop\ExerciseRunner\RunnerManager; use PhpSchool\PhpWorkshop\Input\Input; @@ -435,28 +434,28 @@ public function testAllEventsAreDispatched(): void [ $this->callback(function ($event) { return $event instanceof EventInterface && $event->getName() === 'verify.start'; - }) + }), ], [ $this->callback(function ($event) { return $event instanceof EventInterface && $event->getName() === 'verify.pre.execute'; - }) + }), ], [ $this->callback(function ($event) { return $event instanceof EventInterface && $event->getName() === 'verify.post.execute'; - }) + }), ], [ $this->callback(function ($event) { return $event instanceof EventInterface && $event->getName() === 'verify.post.check'; - }) + }), ], [ $this->callback(function ($event) { return $event instanceof EventInterface && $event->getName() === 'verify.finish'; - }) - ] + }), + ], ); $runner = $this->createMock(ExerciseRunnerInterface::class); @@ -489,18 +488,18 @@ public function testVerifyPostExecuteIsStillDispatchedEvenIfRunnerThrowsExceptio [ $this->callback(function ($event) { return $event instanceof EventInterface && $event->getName() === 'verify.start'; - }) + }), ], [ $this->callback(function ($event) { return $event instanceof EventInterface && $event->getName() === 'verify.pre.execute'; - }) + }), ], [ $this->callback(function ($event) { return $event instanceof EventInterface && $event->getName() === 'verify.post.execute'; - }) - ] + }), + ], ); $runner = $this->createMock(ExerciseRunnerInterface::class); diff --git a/test/ExerciseRendererTest.php b/test/ExerciseRendererTest.php index de799e51..7457f89c 100644 --- a/test/ExerciseRendererTest.php +++ b/test/ExerciseRendererTest.php @@ -73,7 +73,7 @@ public function testExerciseRendererSetsCurrentExerciseAndRendersExercise(): voi $markdownRenderer = new MarkdownRenderer( new DocParser(Environment::createCommonMarkEnvironment()), - (new CliRendererFactory())->__invoke() + (new CliRendererFactory())->__invoke(), ); $color = new Color(); @@ -86,7 +86,7 @@ public function testExerciseRendererSetsCurrentExerciseAndRendersExercise(): voi $userStateSerializer, $markdownRenderer, $color, - new StdOutput($color, $this->createMock(Terminal::class)) + new StdOutput($color, $this->createMock(Terminal::class)), ); $this->expectOutputString(file_get_contents(__DIR__ . '/res/exercise-help-expected.txt')); diff --git a/test/ExerciseRepositoryTest.php b/test/ExerciseRepositoryTest.php index 92aaa031..75d86ab2 100644 --- a/test/ExerciseRepositoryTest.php +++ b/test/ExerciseRepositoryTest.php @@ -3,12 +3,9 @@ namespace PhpSchool\PhpWorkshopTest; use PhpSchool\PhpWorkshop\Exception\InvalidArgumentException; -use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; -use PhpSchool\PhpWorkshopTest\Asset\CliExerciseInterface; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseMissingInterface; use PHPUnit\Framework\TestCase; -use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\ExerciseRepository; class ExerciseRepositoryTest extends TestCase diff --git a/test/ExerciseRunner/CgiRunnerTest.php b/test/ExerciseRunner/CgiRunnerTest.php index e82c728d..5daee748 100644 --- a/test/ExerciseRunner/CgiRunnerTest.php +++ b/test/ExerciseRunner/CgiRunnerTest.php @@ -10,7 +10,6 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\EnvironmentManager; use PhpSchool\PhpWorkshop\Listener\OutputRunInfoListener; use PhpSchool\PhpWorkshop\Process\HostProcessFactory; -use PhpSchool\PhpWorkshop\Result\Cli\CliResult; use PhpSchool\PhpWorkshopTest\Asset\CgiExerciseImpl; use PhpSchool\Terminal\Terminal; use PhpSchool\PhpWorkshop\Check\CodeParseCheck; @@ -18,9 +17,7 @@ use PhpSchool\PhpWorkshop\Check\PhpLintCheck; use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Exception\SolutionExecutionException; -use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseRunner\CgiRunner; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Output\StdOutput; use PhpSchool\PhpWorkshop\Result\Cgi\RequestFailure; use PhpSchool\PhpWorkshop\Result\Cgi\CgiResult; @@ -28,7 +25,6 @@ use PhpSchool\PhpWorkshop\ResultAggregator; use PhpSchool\PhpWorkshop\Solution\SingleFileSolution; use PhpSchool\PhpWorkshop\Utils\RequestRenderer; -use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; use Yoast\PHPUnitPolyfills\Polyfills\AssertionRenames; @@ -67,7 +63,7 @@ public function testVerifyThrowsExceptionIfSolutionFailsExecution(): void $solution = SingleFileSolution::fromFile(__DIR__ . '/../res/cgi/solution-error.php'); $this->exercise->setSolution($solution); $this->exercise->setScenario( - (new CgiScenario())->withExecution((new Request('GET', 'http://some.site?number=5'))) + (new CgiScenario())->withExecution((new Request('GET', 'http://some.site?number=5'))), ); $regex = "/^PHP Code failed to execute\. Error: \"PHP Parse error: syntax error, unexpected end of file in/"; @@ -82,7 +78,7 @@ public function testVerifyReturnsSuccessIfGetSolutionOutputMatchesUserOutput(): $solution = SingleFileSolution::fromFile(__DIR__ . '/../res/cgi/get-solution.php'); $this->exercise->setSolution($solution); $this->exercise->setScenario( - (new CgiScenario())->withExecution((new Request('GET', 'http://some.site?number=5'))) + (new CgiScenario())->withExecution((new Request('GET', 'http://some.site?number=5'))), ); $context = TestContext::fromExerciseAndStudentSolution($this->exercise, __DIR__ . '/../res/cgi/get-solution.php'); @@ -198,16 +194,16 @@ public function testVerifyReturnsFailureIfSolutionOutputHeadersDoesNotMatchUserO $this->assertEquals( [ 'Pragma' => 'cache', - 'Content-type' => 'text/html; charset=UTF-8' + 'Content-type' => 'text/html; charset=UTF-8', ], - $result->getExpectedHeaders() + $result->getExpectedHeaders(), ); $this->assertEquals( [ 'Pragma' => 'no-cache', - 'Content-type' => 'text/html; charset=UTF-8' + 'Content-type' => 'text/html; charset=UTF-8', ], - $result->getActualHeaders() + $result->getActualHeaders(), ); } @@ -221,11 +217,11 @@ public function testRunPassesOutputAndReturnsSuccessIfAllRequestsAreSuccessful() $this->eventDispatcher->listen( 'cgi.run.student-execute.pre', - new OutputRunInfoListener($output, new RequestRenderer()) + new OutputRunInfoListener($output, new RequestRenderer()), ); $this->exercise->setScenario( - (new CgiScenario())->withExecution($request1)->withExecution($request2) + (new CgiScenario())->withExecution($request1)->withExecution($request2), ); $exp = "\n\e[1m\e[4mRequest"; @@ -266,7 +262,7 @@ public function testRunPassesOutputAndReturnsFailureIfARequestFails(): void $this->eventDispatcher->listen( 'cgi.run.student-execute.pre', - new OutputRunInfoListener($output, new RequestRenderer()) + new OutputRunInfoListener($output, new RequestRenderer()), ); $this->exercise->setScenario((new CgiScenario())->withExecution($request1)); diff --git a/test/ExerciseRunner/CliRunnerTest.php b/test/ExerciseRunner/CliRunnerTest.php index 59c74a51..9c02ea43 100644 --- a/test/ExerciseRunner/CliRunnerTest.php +++ b/test/ExerciseRunner/CliRunnerTest.php @@ -6,7 +6,6 @@ use PhpSchool\PhpWorkshop\Check\CodeExistsCheck; use PhpSchool\PhpWorkshop\Exercise\Scenario\CliScenario; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; use PhpSchool\PhpWorkshop\ExerciseRunner\EnvironmentManager; use PhpSchool\PhpWorkshop\Listener\OutputRunInfoListener; use PhpSchool\PhpWorkshop\Process\HostProcessFactory; @@ -19,16 +18,13 @@ use PhpSchool\PhpWorkshop\Event\CliExecuteEvent; use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Exception\SolutionExecutionException; -use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseRunner\CliRunner; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Output\StdOutput; use PhpSchool\PhpWorkshop\Result\Cli\CliResult; use PhpSchool\PhpWorkshop\Result\Cli\GenericFailure; use PhpSchool\PhpWorkshop\Result\Cli\RequestFailure; use PhpSchool\PhpWorkshop\ResultAggregator; use PhpSchool\PhpWorkshop\Solution\SingleFileSolution; -use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; use Yoast\PHPUnitPolyfills\Polyfills\AssertionRenames; @@ -149,7 +145,7 @@ public function testRunPassesOutputAndReturnsSuccessIfScriptIsSuccessful(): void $this->eventDispatcher->listen( 'cli.run.student-execute.pre', - new OutputRunInfoListener($output, new RequestRenderer()) + new OutputRunInfoListener($output, new RequestRenderer()), ); $exp = "\n\e[1m\e[4mArguments\e[0m\e[0m\n"; @@ -180,7 +176,7 @@ public function testRunPassesOutputAndReturnsFailureIfScriptFails(): void $this->exercise->setScenario((new CliScenario())->withExecution([1, 2, 3])); $this->expectOutputRegex( - "/(PHP )?Parse error:\W+syntax error, unexpected end of file, expecting ['\"][,;]['\"] or ['\"][;,]['\"] /" + "/(PHP )?Parse error:\W+syntax error, unexpected end of file, expecting ['\"][,;]['\"] or ['\"][;,]['\"] /", ); $context = TestContext::fromExerciseAndStudentSolution($this->exercise, __DIR__ . '/../res/cli/user-error.php'); @@ -195,7 +191,7 @@ public function testsArgsAppendedByEventsArePassedToResults(): void ['cli.verify.student-execute.pre', 'cli.verify.reference-execute.pre'], function (CliExecuteEvent $e) { $e->appendArg('4'); - } + }, ); $solution = SingleFileSolution::fromFile(realpath(__DIR__ . '/../res/cli/solution.php')); diff --git a/test/ExerciseRunner/Context/ExecutionContextTest.php b/test/ExerciseRunner/Context/ExecutionContextTest.php index 016b29af..09a0e291 100644 --- a/test/ExerciseRunner/Context/ExecutionContextTest.php +++ b/test/ExerciseRunner/Context/ExecutionContextTest.php @@ -19,7 +19,7 @@ public function testGetters(): void '/student-dir', '/reference-dir', $exercise, - $input + $input, ); static::assertSame($exercise, $context->getExercise()); @@ -36,7 +36,7 @@ public function testHasStudentSolution(): void '/student-dir', '/reference-dir', $exercise, - $input + $input, ); static::assertTrue($context->hasStudentSolution()); @@ -47,7 +47,7 @@ public function testHasStudentSolution(): void '/student-dir', '/reference-dir', $exercise, - $input + $input, ); static::assertFalse($context->hasStudentSolution()); @@ -61,7 +61,7 @@ public function testGetEntryPoint(): void '/student-dir', '/reference-dir', $exercise, - $input + $input, ); static::assertSame('/student-dir/solution.php', $context->getEntryPoint()); @@ -77,7 +77,7 @@ public function testGetEntryPointThrowsExceptionWhenNoStudentSolution(): void '/student-dir', '/reference-dir', $exercise, - $input + $input, ); $context->getEntryPoint(); diff --git a/test/ExerciseRunner/Context/TestContextTest.php b/test/ExerciseRunner/Context/TestContextTest.php index ac5ee0a9..72ad3d78 100644 --- a/test/ExerciseRunner/Context/TestContextTest.php +++ b/test/ExerciseRunner/Context/TestContextTest.php @@ -3,10 +3,7 @@ namespace PhpSchool\PhpWorkshopTest\ExerciseRunner\Context; use PhpSchool\PhpWorkshop\Exercise\MockExercise; -use PhpSchool\PhpWorkshop\Exercise\TemporaryDirectoryTrait; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Solution\DirectorySolution; -use PhpSchool\PhpWorkshop\Utils\System; use PHPUnit\Framework\TestCase; class TestContextTest extends TestCase diff --git a/test/ExerciseRunner/CustomVerifyingRunnerTest.php b/test/ExerciseRunner/CustomVerifyingRunnerTest.php index 5b16bf58..33ec59f1 100644 --- a/test/ExerciseRunner/CustomVerifyingRunnerTest.php +++ b/test/ExerciseRunner/CustomVerifyingRunnerTest.php @@ -6,7 +6,6 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; use PhpSchool\Terminal\Terminal; use PhpSchool\PhpWorkshop\ExerciseRunner\CustomVerifyingRunner; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Output\StdOutput; use PhpSchool\PhpWorkshopTest\Asset\CustomVerifyingExerciseImpl; use PHPUnit\Framework\TestCase; diff --git a/test/ExerciseRunner/EnvironmentManagerTest.php b/test/ExerciseRunner/EnvironmentManagerTest.php index 71aa37f9..90f9ea04 100644 --- a/test/ExerciseRunner/EnvironmentManagerTest.php +++ b/test/ExerciseRunner/EnvironmentManagerTest.php @@ -4,13 +4,10 @@ use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Event\ExerciseRunnerEvent; -use PhpSchool\PhpWorkshop\Exercise\MockExercise; use PhpSchool\PhpWorkshop\Exercise\Scenario\CliScenario; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; use PhpSchool\PhpWorkshop\ExerciseRunner\EnvironmentManager; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\ResultAggregator; -use PhpSchool\PhpWorkshop\Solution\DirectorySolution; use PhpSchool\PhpWorkshop\Solution\SingleFileSolution; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; diff --git a/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php b/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php index 29c32a75..5010b80c 100644 --- a/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php +++ b/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php @@ -10,7 +10,6 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\EnvironmentManager; use PhpSchool\PhpWorkshop\ExerciseRunner\Factory\CgiRunnerFactory; use PhpSchool\PhpWorkshop\Process\HostProcessFactory; -use PhpSchool\PhpWorkshop\Utils\RequestRenderer; use PhpSchool\PhpWorkshopTest\Asset\CgiExerciseImpl; use PHPUnit\Framework\TestCase; diff --git a/test/Factory/EventDispatcherFactoryTest.php b/test/Factory/EventDispatcherFactoryTest.php index f20bc1f7..52fa7358 100644 --- a/test/Factory/EventDispatcherFactoryTest.php +++ b/test/Factory/EventDispatcherFactoryTest.php @@ -5,7 +5,6 @@ use DI\ContainerBuilder; use PhpSchool\PhpWorkshop\Event\Event; use Psr\Container\ContainerInterface; -use PhpSchool\PhpWorkshop\Event\EventDispatcher; use PhpSchool\PhpWorkshop\Exception\InvalidArgumentException; use PhpSchool\PhpWorkshop\Factory\EventDispatcherFactory; use PhpSchool\PhpWorkshop\ResultAggregator; @@ -32,11 +31,11 @@ public function testExceptionIsThrownIfEventListenerGroupsNotArray(): void $c->method('get') ->withConsecutive( [ResultAggregator::class], - ['eventListeners'] + ['eventListeners'], ) ->willReturnOnConsecutiveCalls( new ResultAggregator(), - new \stdClass() + new \stdClass(), ); $c->method('has')->with('eventListeners')->willReturn(true); @@ -54,11 +53,11 @@ public function testExceptionIsThrownIfEventsNotArray(): void $c->method('get') ->withConsecutive( [ResultAggregator::class], - ['eventListeners'] + ['eventListeners'], ) ->willReturnOnConsecutiveCalls( new ResultAggregator(), - ['my-group' => new \stdClass()] + ['my-group' => new \stdClass()], ); $c->method('has')->with('eventListeners')->willReturn(true); @@ -73,8 +72,8 @@ public function testExceptionIsThrownIfEventListenersNotArray(): void { $eventConfig = [ 'my-group' => [ - 'someEvent' => new \stdClass() - ] + 'someEvent' => new \stdClass(), + ], ]; $c = $this->createMock(ContainerInterface::class); @@ -82,11 +81,11 @@ public function testExceptionIsThrownIfEventListenersNotArray(): void $c->method('get') ->withConsecutive( [ResultAggregator::class], - ['eventListeners'] + ['eventListeners'], ) ->willReturnOnConsecutiveCalls( new ResultAggregator(), - $eventConfig + $eventConfig, ); $c->method('has')->with('eventListeners')->willReturn(true); @@ -101,8 +100,8 @@ public function testExceptionIsThrownIfListenerNotCallable(): void { $eventConfig = [ 'my-group' => [ - 'someEvent' => [new \stdClass()] - ] + 'someEvent' => [new \stdClass()], + ], ]; $c = $this->createMock(ContainerInterface::class); @@ -110,11 +109,11 @@ public function testExceptionIsThrownIfListenerNotCallable(): void $c->method('get') ->withConsecutive( [ResultAggregator::class], - ['eventListeners'] + ['eventListeners'], ) ->willReturnOnConsecutiveCalls( new ResultAggregator(), - $eventConfig + $eventConfig, ); $c->method('has')->with('eventListeners')->willReturn(true); @@ -129,8 +128,8 @@ public function testExceptionIsThrownIfEventsListenerContainerEntryNotExist(): v { $eventConfig = [ 'my-group' => [ - 'someEvent' => [containerListener('nonExistingContainerEntry')()] - ] + 'someEvent' => [containerListener('nonExistingContainerEntry')()], + ], ]; $c = $this->createMock(ContainerInterface::class); @@ -138,21 +137,21 @@ public function testExceptionIsThrownIfEventsListenerContainerEntryNotExist(): v $c->method('get') ->withConsecutive( [ResultAggregator::class], - ['eventListeners'] + ['eventListeners'], ) ->willReturnOnConsecutiveCalls( new ResultAggregator(), - $eventConfig + $eventConfig, ); $c->method('has') ->withConsecutive( ['eventListeners'], - ['nonExistingContainerEntry'] + ['nonExistingContainerEntry'], ) ->willReturnOnConsecutiveCalls( true, - false + false, ); $this->expectException(InvalidArgumentException::class); @@ -163,13 +162,12 @@ public function testExceptionIsThrownIfEventsListenerContainerEntryNotExist(): v public function testConfigEventListenersWithAnonymousFunction(): void { - $callback = function () { - }; + $callback = function () {}; $eventConfig = [ 'my-group' => [ - 'someEvent' => [$callback] - ] + 'someEvent' => [$callback], + ], ]; $c = $this->createMock(ContainerInterface::class); @@ -177,11 +175,11 @@ public function testConfigEventListenersWithAnonymousFunction(): void $c->method('get') ->withConsecutive( [ResultAggregator::class], - ['eventListeners'] + ['eventListeners'], ) ->willReturnOnConsecutiveCalls( new ResultAggregator(), - $eventConfig + $eventConfig, ); $c->method('has')->with('eventListeners')->willReturn(true); @@ -190,10 +188,10 @@ public function testConfigEventListenersWithAnonymousFunction(): void $this->assertSame( [ 'someEvent' => [ - $callback - ] + $callback, + ], ], - $dispatcher->getListeners() + $dispatcher->getListeners(), ); } @@ -201,8 +199,8 @@ public function testListenerFromContainerIsNotFetchedDuringAttaching(): void { $eventConfig = [ 'my-group' => [ - 'someEvent' => [containerListener('containerEntry')] - ] + 'someEvent' => [containerListener('containerEntry')], + ], ]; $c = $this->createMock(ContainerInterface::class); @@ -210,21 +208,21 @@ public function testListenerFromContainerIsNotFetchedDuringAttaching(): void $c->method('get') ->withConsecutive( [ResultAggregator::class], - ['eventListeners'] + ['eventListeners'], ) ->willReturnOnConsecutiveCalls( new ResultAggregator(), - $eventConfig + $eventConfig, ); $c->method('has') ->withConsecutive( ['eventListeners'], - ['containerEntry'] + ['containerEntry'], ) ->willReturnOnConsecutiveCalls( true, - true + true, ); $dispatcher = (new EventDispatcherFactory())->__invoke($c); @@ -235,8 +233,8 @@ public function testListenerFromContainerIsFetchedWhenEventDispatched(): void { $eventConfig = [ 'my-group' => [ - 'someEvent' => [containerListener('containerEntry')] - ] + 'someEvent' => [containerListener('containerEntry')], + ], ]; $c = $this->createMock(ContainerInterface::class); @@ -245,23 +243,22 @@ public function testListenerFromContainerIsFetchedWhenEventDispatched(): void ->withConsecutive( [ResultAggregator::class], ['eventListeners'], - ['containerEntry'] + ['containerEntry'], ) ->willReturnOnConsecutiveCalls( new ResultAggregator(), $eventConfig, - function () { - } + function () {}, ); $c->method('has') ->withConsecutive( ['eventListeners'], - ['containerEntry'] + ['containerEntry'], ) ->willReturnOnConsecutiveCalls( true, - true + true, ); $dispatcher = (new EventDispatcherFactory())->__invoke($c); @@ -274,8 +271,8 @@ public function testExceptionIsThrownIfMethodDoesNotExistOnContainerEntry(): voi { $eventConfig = [ 'my-group' => [ - 'someEvent' => [containerListener('containerEntry', 'notHere')()] - ] + 'someEvent' => [containerListener('containerEntry', 'notHere')()], + ], ]; $c = $this->createMock(ContainerInterface::class); @@ -284,22 +281,22 @@ public function testExceptionIsThrownIfMethodDoesNotExistOnContainerEntry(): voi ->withConsecutive( [ResultAggregator::class], ['eventListeners'], - ['containerEntry'] + ['containerEntry'], ) ->willReturnOnConsecutiveCalls( new ResultAggregator(), $eventConfig, - new \stdClass() + new \stdClass(), ); $c->method('has') ->withConsecutive( ['eventListeners'], - ['containerEntry'] + ['containerEntry'], ) ->willReturnOnConsecutiveCalls( true, - true + true, ); $this->expectException(InvalidArgumentException::class); diff --git a/test/Factory/MenuFactoryTest.php b/test/Factory/MenuFactoryTest.php index 4ea1ff55..c8e1bd69 100644 --- a/test/Factory/MenuFactoryTest.php +++ b/test/Factory/MenuFactoryTest.php @@ -2,7 +2,6 @@ namespace PhpSchool\PhpWorkshopTest\Factory; -use PhpSchool\CliMenu\MenuItem\SelectableItem; use PhpSchool\PhpWorkshop\Event\EventInterface; use PhpSchool\PhpWorkshop\UserState\Serializer; use PhpSchool\PhpWorkshop\UserState\UserState; @@ -59,7 +58,7 @@ public function testFactoryReturnsInstance(): void 'workshopTitle' => 'TITLE', WorkshopType::class => WorkshopType::STANDARD(), EventDispatcher::class => $this->createMock(EventDispatcher::class), - Terminal::class => $terminal + Terminal::class => $terminal, ]; $container @@ -106,13 +105,13 @@ public function testSelectExercise(): void [ self::callback(function ($event) { return $event instanceof EventInterface && $event->getName() === 'exercise.selected'; - }) + }), ], [ self::callback(function ($event) { return $event instanceof EventInterface && $event->getName() === 'exercise.selected.exercise'; - }) - ] + }), + ], ); $exerciseRenderer = $this->createMock(ExerciseRenderer::class); @@ -133,7 +132,7 @@ public function testSelectExercise(): void 'workshopTitle' => 'TITLE', WorkshopType::class => WorkshopType::STANDARD(), EventDispatcher::class => $eventDispatcher, - Terminal::class => $terminal + Terminal::class => $terminal, ]; $container diff --git a/test/FunctionsTest.php b/test/FunctionsTest.php index c36e2e8e..be392134 100644 --- a/test/FunctionsTest.php +++ b/test/FunctionsTest.php @@ -40,8 +40,8 @@ public function camelCaseToKebabCaseProvider(): array ['camelCase', 'camel-case'], [ 'educationIsThePassportToTheFutureForTomorrowBelongsToThoseWhoPrepareForItToday', - 'education-is-the-passport-to-the-future-for-tomorrow-belongs-to-those-who-prepare-for-it-today' - ] + 'education-is-the-passport-to-the-future-for-tomorrow-belongs-to-those-who-prepare-for-it-today', + ], ]; } diff --git a/test/Listener/CodePatchListenerTest.php b/test/Listener/CodePatchListenerTest.php index 5374a2ba..4819ce05 100644 --- a/test/Listener/CodePatchListenerTest.php +++ b/test/Listener/CodePatchListenerTest.php @@ -6,15 +6,12 @@ use PhpSchool\PhpWorkshop\Event\ExerciseRunnerEvent; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Listener\CodePatchListener; use PhpSchool\PhpWorkshop\Utils\Path; -use PhpSchool\PhpWorkshop\Utils\System; use PhpSchool\PhpWorkshopTest\Asset\ProvidesSolutionExercise; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; -use Symfony\Component\Filesystem\Filesystem; class CodePatchListenerTest extends TestCase { @@ -50,7 +47,7 @@ public function testPatchUpdatesCode(): void self::assertStringEqualsFile( Path::join($context->getStudentExecutionDirectory(), 'solution.php'), - 'MODIFIED CONTENT' + 'MODIFIED CONTENT', ); } @@ -77,7 +74,7 @@ public function testRevertAfterPatch(): void self::assertStringEqualsFile( Path::join($context->getStudentExecutionDirectory(), 'solution.php'), - 'ORIGINAL CONTENT' + 'ORIGINAL CONTENT', ); } @@ -103,14 +100,14 @@ public function testPatchesProvidedSolution(): void self::assertStringEqualsFile( Path::join($context->getStudentExecutionDirectory(), 'solution.php'), - 'MODIFIED CONTENT' + 'MODIFIED CONTENT', ); self::assertStringEqualsFile( Path::join( $context->getReferenceExecutionDirectory(), $exercise->getSolution()->getEntryPoint()->getRelativePath(), ), - 'MODIFIED CONTENT' + 'MODIFIED CONTENT', ); } @@ -162,7 +159,7 @@ public function testRevertDoesNotRevertStudentSubmissionPatchIfInDebugMode(): vo self::assertStringEqualsFile( Path::join($context->getStudentExecutionDirectory(), 'solution.php'), - 'MODIFIED CONTENT' + 'MODIFIED CONTENT', ); } } diff --git a/test/Listener/ConfigureCommandListenerTest.php b/test/Listener/ConfigureCommandListenerTest.php index 3aff44bb..f6291d7e 100644 --- a/test/Listener/ConfigureCommandListenerTest.php +++ b/test/Listener/ConfigureCommandListenerTest.php @@ -18,8 +18,7 @@ class ConfigureCommandListenerTest extends TestCase */ public function testInputIsConfiguredForCorrectCommands(string $commandName): void { - $command = new CommandDefinition($commandName, [], function () { - }); + $command = new CommandDefinition($commandName, [], function () {}); $state = new UserState([], 'Exercise 1'); $exercise = new CliExerciseImpl('Exercise 1'); @@ -45,8 +44,7 @@ public function configurableCommands(): array */ public function testInputIsNotConfiguredForCorrectCommands(string $commandName): void { - $command = new CommandDefinition($commandName, [], function () { - }); + $command = new CommandDefinition($commandName, [], function () {}); $state = new UserState([], 'Exercise 1'); $exercise = new CliExerciseImpl('Exercise 1'); diff --git a/test/Listener/InitialCodeListenerTest.php b/test/Listener/InitialCodeListenerTest.php index 2faf1723..49752db4 100644 --- a/test/Listener/InitialCodeListenerTest.php +++ b/test/Listener/InitialCodeListenerTest.php @@ -32,7 +32,7 @@ public function testExerciseCodeIsCopiedIfExerciseProvidesInitialCode(): void $this->assertFileExists($this->getCurrentWorkingDirectory() . '/init-solution.php'); $this->assertFileEquals( $exercise->getInitialCode()->getFiles()[0]->getAbsolutePath(), - $this->getCurrentWorkingDirectory() . '/init-solution.php' + $this->getCurrentWorkingDirectory() . '/init-solution.php', ); $this->assertLoggerHasMessages( @@ -43,10 +43,10 @@ public function testExerciseCodeIsCopiedIfExerciseProvidesInitialCode(): void 'context' => [ 'exercise' => 'exercise-with-initial-code', 'workingDir' => $this->getCurrentWorkingDirectory(), - 'file' => $exercise->getInitialCode()->getFiles()[0]->getAbsolutePath() - ] - ] - ] + 'file' => $exercise->getInitialCode()->getFiles()[0]->getAbsolutePath(), + ], + ], + ], ); } @@ -71,10 +71,10 @@ public function testExerciseCodeIsNotCopiedIfFileWithSameNameExistsInWorkingDire 'context' => [ 'exercise' => 'exercise-with-initial-code', 'workingDir' => $this->getCurrentWorkingDirectory(), - 'file' => $exercise->getInitialCode()->getFiles()[0]->getAbsolutePath() - ] - ] - ] + 'file' => $exercise->getInitialCode()->getFiles()[0]->getAbsolutePath(), + ], + ], + ], ); } diff --git a/test/Listener/LazyContainerListenerTest.php b/test/Listener/LazyContainerListenerTest.php index beb9bb75..08f9d165 100644 --- a/test/Listener/LazyContainerListenerTest.php +++ b/test/Listener/LazyContainerListenerTest.php @@ -13,10 +13,8 @@ class LazyContainerListenerTest extends TestCase { public function testExceptionIsThrownIfServiceMethodDoesNotExist(): void { - $myListener = new class { - public function __invoke() - { - } + $myListener = new class () { + public function __invoke() {} }; $class = get_class($myListener); @@ -33,7 +31,7 @@ public function __invoke() $lazy = new LazyContainerListener( $container, - new ContainerListenerHelper('my-listener', 'myMethod') + new ContainerListenerHelper('my-listener', 'myMethod'), ); $lazy->__invoke(new Event('some-event')); @@ -41,7 +39,7 @@ public function __invoke() public function testThatUnderlyingListenerIsCalled(): void { - $myListener = new class { + $myListener = new class () { public $called = false; public function __invoke() { @@ -58,7 +56,7 @@ public function __invoke() $lazy = new LazyContainerListener( $container, - new ContainerListenerHelper('my-listener') + new ContainerListenerHelper('my-listener'), ); $lazy->__invoke(new Event('some-event')); @@ -68,10 +66,8 @@ public function __invoke() public function testWrappedReturnsUnderlyingListener(): void { - $myListener = new class { - public function __invoke() - { - } + $myListener = new class () { + public function __invoke() {} }; $container = $this->createMock(ContainerInterface::class); @@ -83,7 +79,7 @@ public function __invoke() $lazy = new LazyContainerListener( $container, - new ContainerListenerHelper('my-listener', '__invoke') + new ContainerListenerHelper('my-listener', '__invoke'), ); $wrapped = $lazy->getWrapped(); diff --git a/test/Listener/PrepareSolutionListenerTest.php b/test/Listener/PrepareSolutionListenerTest.php index c497cd9a..6ad72d2c 100644 --- a/test/Listener/PrepareSolutionListenerTest.php +++ b/test/Listener/PrepareSolutionListenerTest.php @@ -3,19 +3,13 @@ namespace PhpSchool\PhpWorkshopTest\Listener; use PhpSchool\PhpWorkshop\Event\ExerciseRunnerEvent; -use PhpSchool\PhpWorkshop\Exercise\CliExercise; -use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Listener\PrepareSolutionListener; use PhpSchool\PhpWorkshop\Process\HostProcessFactory; use PhpSchool\PhpWorkshop\Process\ProcessNotFoundException; use PhpSchool\PhpWorkshop\Solution\SolutionInterface; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; -use ReflectionProperty; -use RuntimeException; -use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Process\ExecutableFinder; use Yoast\PHPUnitPolyfills\Polyfills\AssertionRenames; @@ -78,10 +72,10 @@ public function testIfSolutionRequiresComposerComposerInstallIsExecuted(): void $context->importReferenceFileFromString( json_encode([ 'require' => [ - 'phpunit/phpunit' => '~5.0' + 'phpunit/phpunit' => '~5.0', ], ]), - 'composer.json' + 'composer.json', ); $solution = $this->createMock(SolutionInterface::class); @@ -113,10 +107,10 @@ public function testExceptionIsThrownIfDependenciesCannotBeResolved(): void $context->importReferenceFileFromString( json_encode([ 'require' => [ - 'phpunit/phpunit' => '1.0' + 'phpunit/phpunit' => '1.0', ], ]), - 'composer.json' + 'composer.json', ); $solution = $this->createMock(SolutionInterface::class); diff --git a/test/Listener/RealPathListenerTest.php b/test/Listener/RealPathListenerTest.php index a22ce8d0..a4b71916 100644 --- a/test/Listener/RealPathListenerTest.php +++ b/test/Listener/RealPathListenerTest.php @@ -2,15 +2,12 @@ namespace PhpSchool\PhpWorkshopTest\Listener; -use PhpSchool\PhpWorkshop\Event\Event; use PhpSchool\PhpWorkshop\Event\ExerciseRunnerEvent; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\ExerciseRunner\Context\ExecutionContext; use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Listener\RealPathListener; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PhpSchool\PhpWorkshopTest\BaseTest; -use PHPUnit\Framework\TestCase; class RealPathListenerTest extends BaseTest { diff --git a/test/Listener/SelfCheckListenerTest.php b/test/Listener/SelfCheckListenerTest.php index 0742d0d1..3e118d4f 100644 --- a/test/Listener/SelfCheckListenerTest.php +++ b/test/Listener/SelfCheckListenerTest.php @@ -5,7 +5,6 @@ use PhpSchool\PhpWorkshop\Event\ExerciseRunnerEvent; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; use PhpSchool\PhpWorkshop\ExerciseRunner\Context\TestContext; -use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Listener\SelfCheckListener; use PhpSchool\PhpWorkshop\Result\Success; use PhpSchool\PhpWorkshop\ResultAggregator; diff --git a/test/Logger/LoggerTest.php b/test/Logger/LoggerTest.php index a29cd95f..57738669 100644 --- a/test/Logger/LoggerTest.php +++ b/test/Logger/LoggerTest.php @@ -43,7 +43,7 @@ public function testLoggerCreatesFileWhenMessageIsLogged(): void $this->assertMatchesRegularExpression( $match, - file_get_contents($expectedFileName) + file_get_contents($expectedFileName), ); } @@ -63,7 +63,7 @@ public function testLoggerAppendsToFileWhenSecondMessageIsLogged(): void $this->assertMatchesRegularExpression( $match, - file_get_contents($expectedFileName) + file_get_contents($expectedFileName), ); } @@ -84,7 +84,7 @@ public function testLoggerAppendsToFileWhenItAlreadyExists(): void $this->assertMatchesRegularExpression( $match, - file_get_contents($expectedFileName) + file_get_contents($expectedFileName), ); } @@ -101,7 +101,7 @@ public function testLoggerWithContextIsEncoded(): void $match .= 'Context\: {"exercise":"my-exercise"}/'; $this->assertMatchesRegularExpression( $match, - file_get_contents($expectedFileName) + file_get_contents($expectedFileName), ); } } diff --git a/test/Markdown/Parser/HandleBarParserTest.php b/test/Markdown/Parser/HandleBarParserTest.php index 28c70257..2798c1fa 100644 --- a/test/Markdown/Parser/HandleBarParserTest.php +++ b/test/Markdown/Parser/HandleBarParserTest.php @@ -46,7 +46,7 @@ public function noShorthandsProvider(): array ['{{cloud wut}}'], ['{{ cloud wut}}'], ['{{ cloud wut }}'], - ['{{ cloud wut }}'] + ['{{ cloud wut }}'], ]; } @@ -69,7 +69,7 @@ public function testWithShorthand(string $content, bool $expectedParseResult, ar true, true, true, - ['appendChild'] + ['appendChild'], ); $container->expects($this->once()) ->method('appendChild') @@ -83,7 +83,7 @@ public function testWithShorthand(string $content, bool $expectedParseResult, ar $context->expects($this->never())->method('getContainer'); } - $shorthand = new class implements ShorthandInterface { + $shorthand = new class () implements ShorthandInterface { public $args = []; public function __invoke(array $callArgs): array { @@ -127,7 +127,7 @@ public function parseProvider(): array [ '{{ test "argument 1" \'a really long argument two\' arg3}}', true, - ['argument 1', 'a really long argument two', 'arg3'] + ['argument 1', 'a really long argument two', 'arg3'], ], ]; } @@ -147,7 +147,7 @@ public function testParsingWithContextShorthand(): void true, true, true, - ['appendChild'] + ['appendChild'], ); $container->expects($this->once()) ->method('appendChild') diff --git a/test/MarkdownRendererTest.php b/test/MarkdownRendererTest.php index e97caefa..94888f97 100644 --- a/test/MarkdownRendererTest.php +++ b/test/MarkdownRendererTest.php @@ -2,7 +2,6 @@ namespace PhpSchool\PhpWorkshopTest; -use PhpSchool\CliMdRenderer\CliRenderer; use PhpSchool\CliMdRenderer\CliRendererFactory; use League\CommonMark\DocParser; use League\CommonMark\Environment; diff --git a/test/MockLogger.php b/test/MockLogger.php index 2c908414..41c22fbd 100644 --- a/test/MockLogger.php +++ b/test/MockLogger.php @@ -19,7 +19,7 @@ public function log($level, $message, array $context = []): void $this->messages[] = [ 'level' => $level, 'message' => $message, - 'context' => $context + 'context' => $context, ]; } diff --git a/test/Patch/ForceStrictTypesTest.php b/test/Patch/ForceStrictTypesTest.php index 001ee9ac..30678bb6 100644 --- a/test/Patch/ForceStrictTypesTest.php +++ b/test/Patch/ForceStrictTypesTest.php @@ -19,7 +19,7 @@ public function testStrictTypesDeclareIsAppended(): void self::assertSame( "declare (strict_types=1);\necho 'Hello World';", - (new Standard())->prettyPrint($ast) + (new Standard())->prettyPrint($ast), ); } @@ -33,7 +33,7 @@ public function testStrictTypesDeclareIsNotAppendedIfItAlreadyExists(): void self::assertSame( "declare (strict_types=1);\necho 'Hello World';", - (new Standard())->prettyPrint($ast) + (new Standard())->prettyPrint($ast), ); } } diff --git a/test/Patch/WrapInTryCatchTest.php b/test/Patch/WrapInTryCatchTest.php index a25773d2..97687713 100644 --- a/test/Patch/WrapInTryCatchTest.php +++ b/test/Patch/WrapInTryCatchTest.php @@ -21,7 +21,7 @@ public function testStatementsAreWrappedInTryCatch(): void self::assertSame( "try {\n echo 'Hello World';\n} catch (Exception \$e) {\n echo \$e->getMessage();\n}", - (new Standard())->prettyPrint($ast) + (new Standard())->prettyPrint($ast), ); } @@ -35,7 +35,7 @@ public function testStatementsAreWrappedInTryCatchWithCustomExceptionClass(): vo self::assertSame( "try {\n echo 'Hello World';\n} catch (RuntimeException \$e) {\n echo \$e->getMessage();\n}", - (new Standard())->prettyPrint($ast) + (new Standard())->prettyPrint($ast), ); } @@ -49,7 +49,7 @@ public function testStatementsAreWrappedInTryCatchWithStatements(): void self::assertSame( "try {\n echo 'Hello World';\n} catch (RuntimeException \$e) {\n echo 'You caught me!';\n}", - (new Standard())->prettyPrint($ast) + (new Standard())->prettyPrint($ast), ); } } diff --git a/test/PatchTest.php b/test/PatchTest.php index d85e6d87..54a588ce 100644 --- a/test/PatchTest.php +++ b/test/PatchTest.php @@ -34,7 +34,7 @@ public function testWithTransformerWithClosure(): void public function testWithTransformerWithTransformer(): void { $patch = new Patch(); - $transformer = new class implements Patch\Transformer { + $transformer = new class () implements Patch\Transformer { public function transform(array $ast): array { return $ast; @@ -49,7 +49,7 @@ public function transform(array $ast): array public function testWithTransformerMultiple(): void { - $transformer1 = new class implements Patch\Transformer { + $transformer1 = new class () implements Patch\Transformer { public function transform(array $ast): array { return $ast; diff --git a/test/Result/Cgi/RequestFailureTest.php b/test/Result/Cgi/RequestFailureTest.php index d475021e..11ab359c 100644 --- a/test/Result/Cgi/RequestFailureTest.php +++ b/test/Result/Cgi/RequestFailureTest.php @@ -23,7 +23,7 @@ public function testWhenOnlyOutputDifferent(): void 'Expected Output', 'Actual Output', [], - [] + [], ); $this->assertEquals('Expected Output', $requestFailure->getExpectedOutput()); @@ -41,7 +41,7 @@ public function testWhenOnlyHeadersDifferent(): void 'Output', 'Output', ['header1' => 'some-value'], - ['header2' => 'some-value'] + ['header2' => 'some-value'], ); $this->assertEquals(['header1' => 'some-value'], $requestFailure->getExpectedHeaders()); @@ -59,7 +59,7 @@ public function testWhenOutputAndHeadersDifferent(): void 'Expected Output', 'Actual Output', ['header1' => 'some-value'], - ['header2' => 'some-value'] + ['header2' => 'some-value'], ); $this->assertTrue($requestFailure->headersDifferent()); diff --git a/test/Result/ComposerFailureTest.php b/test/Result/ComposerFailureTest.php index 6131b9ec..bfc659c5 100644 --- a/test/Result/ComposerFailureTest.php +++ b/test/Result/ComposerFailureTest.php @@ -44,9 +44,9 @@ public function testWithMissingComponent(): void 'is_missing_component' => true, 'is_missing_packages' => false, 'missing_component' => 'composer.json', - 'missing_packages' => [] + 'missing_packages' => [], ], - $failure->toArray() + $failure->toArray(), ); } @@ -72,9 +72,9 @@ public function testWithMissingPackages(): void 'is_missing_component' => false, 'is_missing_packages' => true, 'missing_component' => null, - 'missing_packages' => ['some/package'] + 'missing_packages' => ['some/package'], ], - $failure->toArray() + $failure->toArray(), ); } } diff --git a/test/Result/FailureTest.php b/test/Result/FailureTest.php index 262425c8..670324a0 100644 --- a/test/Result/FailureTest.php +++ b/test/Result/FailureTest.php @@ -67,7 +67,7 @@ public function testFailureFromCodeParseException(): void $this->assertInstanceOf(ResultInterface::class, $failure); $this->assertEquals( 'File: "exercise.php" could not be parsed. Error: "Something went wrong yo on unknown line"', - $failure->getReason() + $failure->getReason(), ); $this->assertEquals('Some Check', $failure->getCheckName()); } diff --git a/test/ResultAggregatorTest.php b/test/ResultAggregatorTest.php index 0d2a710a..ce6f73a5 100644 --- a/test/ResultAggregatorTest.php +++ b/test/ResultAggregatorTest.php @@ -59,7 +59,7 @@ public function testIterator(): void { $results = [ new Success('Some Check'), - new Failure('Some Check', 'nope') + new Failure('Some Check', 'nope'), ]; $resultAggregator = new ResultAggregator(); diff --git a/test/ResultRenderer/AbstractResultRendererTest.php b/test/ResultRenderer/AbstractResultRendererTest.php index 0718e4fc..2b0f8df4 100644 --- a/test/ResultRenderer/AbstractResultRendererTest.php +++ b/test/ResultRenderer/AbstractResultRendererTest.php @@ -53,7 +53,7 @@ protected function getRenderer(): ResultsRenderer $terminal, $exerciseRepo, new KeyLighter(), - $this->getResultRendererFactory() + $this->getResultRendererFactory(), ); } diff --git a/test/ResultRenderer/Cgi/RequestFailureRendererTest.php b/test/ResultRenderer/Cgi/RequestFailureRendererTest.php index a72d9ee0..e4c1d16a 100644 --- a/test/ResultRenderer/Cgi/RequestFailureRendererTest.php +++ b/test/ResultRenderer/Cgi/RequestFailureRendererTest.php @@ -16,7 +16,7 @@ public function testRenderWhenOnlyHeadersDifferent(): void 'OUTPUT', 'OUTPUT', ['header1' => 'val', 'header2' => 'val'], - ['header1' => 'val'] + ['header1' => 'val'], ); $renderer = new RequestFailureRenderer($failure); @@ -35,7 +35,7 @@ public function testRenderWhenOnlyOutputDifferent(): void 'EXPECTED OUTPUT', 'ACTUAL OUTPUT', ['header1' => 'val'], - ['header1' => 'val'] + ['header1' => 'val'], ); $renderer = new RequestFailureRenderer($failure); @@ -53,7 +53,7 @@ public function testRenderWhenOutputAndHeadersDifferent(): void 'EXPECTED OUTPUT', 'ACTUAL OUTPUT', ['header1' => 'val', 'header2' => 'val'], - ['header1' => 'val'] + ['header1' => 'val'], ); $renderer = new RequestFailureRenderer($failure); diff --git a/test/ResultRenderer/CgiResultRendererTest.php b/test/ResultRenderer/CgiResultRendererTest.php index 9b12870e..4aebb8b2 100644 --- a/test/ResultRenderer/CgiResultRendererTest.php +++ b/test/ResultRenderer/CgiResultRendererTest.php @@ -32,7 +32,7 @@ public function testRenderWithFailedRequest(): void RequestFailureRenderer::class, function (RequestFailure $failure) use ($failureRenderer) { return $failureRenderer; - } + }, ); $failure = new RequestFailure( @@ -40,7 +40,7 @@ function (RequestFailure $failure) use ($failureRenderer) { 'EXPECTED OUTPUT', 'ACTUAL OUTPUT', ['header1' => 'val', 'header2' => 'val'], - ['header1' => 'val'] + ['header1' => 'val'], ); $result = new CgiResult([$failure]); $renderer = new CgiResultRenderer($result, new RequestRenderer()); @@ -70,7 +70,7 @@ public function testMultipleFailedRequests(): void RequestFailureRenderer::class, function (RequestFailure $failure) use ($failureRenderer) { return $failureRenderer; - } + }, ); $failure1 = new RequestFailure( @@ -78,7 +78,7 @@ function (RequestFailure $failure) use ($failureRenderer) { 'EXPECTED OUTPUT 1', 'ACTUAL OUTPUT 1', ['header1' => 'val', 'header2' => 'val'], - ['header1' => 'val'] + ['header1' => 'val'], ); $failure2 = new RequestFailure( @@ -86,7 +86,7 @@ function (RequestFailure $failure) use ($failureRenderer) { 'EXPECTED OUTPUT 2', 'ACTUAL OUTPUT 2', ['header1' => 'val', 'header2' => 'val'], - ['header1' => 'val'] + ['header1' => 'val'], ); $result = new CgiResult([$failure1, $failure2]); $renderer = new CgiResultRenderer($result, new RequestRenderer()); @@ -128,7 +128,7 @@ public function testRenderWithFailedRequestAndSuccess(): void RequestFailureRenderer::class, function (RequestFailure $failure) use ($failureRenderer) { return $failureRenderer; - } + }, ); $failure = new RequestFailure( @@ -136,7 +136,7 @@ function (RequestFailure $failure) use ($failureRenderer) { 'EXPECTED OUTPUT', 'ACTUAL OUTPUT', ['header1' => 'val', 'header2' => 'val'], - ['header1' => 'val'] + ['header1' => 'val'], ); $result = new CgiResult([$failure, new Success($this->request())]); $renderer = new CgiResultRenderer($result, new RequestRenderer()); @@ -166,7 +166,7 @@ public function testRenderWithFailedRequestAndGenericFailure(): void RequestFailureRenderer::class, function (RequestFailure $failure) use ($failureRenderer) { return $failureRenderer; - } + }, ); $genericFailureRenderer = $this->createMock(FailureRenderer::class); @@ -177,7 +177,7 @@ function (RequestFailure $failure) use ($failureRenderer) { FailureRenderer::class, function (GenericFailure $failure) use ($genericFailureRenderer) { return $genericFailureRenderer; - } + }, ); $failure = new RequestFailure( @@ -185,7 +185,7 @@ function (GenericFailure $failure) use ($genericFailureRenderer) { 'EXPECTED OUTPUT', 'ACTUAL OUTPUT', ['header1' => 'val', 'header2' => 'val'], - ['header1' => 'val'] + ['header1' => 'val'], ); $codeExecutionFailure = new GenericFailure($this->request(), 'Code Execution Failure'); diff --git a/test/ResultRenderer/CliResultRendererTest.php b/test/ResultRenderer/CliResultRendererTest.php index 17849fe7..ed36ef42 100644 --- a/test/ResultRenderer/CliResultRendererTest.php +++ b/test/ResultRenderer/CliResultRendererTest.php @@ -29,13 +29,13 @@ public function testRenderWithFailedRequest(): void RequestFailureRenderer::class, function (RequestFailure $failure) use ($failureRenderer) { return $failureRenderer; - } + }, ); $failure = new RequestFailure( new ArrayObject(), 'EXPECTED OUTPUT', - 'ACTUAL OUTPUT' + 'ACTUAL OUTPUT', ); $result = new CliResult([$failure]); $renderer = new CliResultRenderer($result); @@ -59,13 +59,13 @@ public function testRenderWithFailedRequestWithMultipleArgs(): void RequestFailureRenderer::class, function (RequestFailure $failure) use ($failureRenderer) { return $failureRenderer; - } + }, ); $failure = new RequestFailure( new ArrayObject(['one', 'two', 'three']), 'EXPECTED OUTPUT', - 'ACTUAL OUTPUT' + 'ACTUAL OUTPUT', ); $result = new CliResult([$failure]); $renderer = new CliResultRenderer($result); diff --git a/test/ResultRenderer/ComposerFailureRendererTest.php b/test/ResultRenderer/ComposerFailureRendererTest.php index 64655f73..bf7b1191 100644 --- a/test/ResultRenderer/ComposerFailureRendererTest.php +++ b/test/ResultRenderer/ComposerFailureRendererTest.php @@ -17,7 +17,7 @@ public function testRenderWithMissingFiles(string $file, string $message): void { $failure = new ComposerFailure( $this->createMock(CheckInterface::class), - $file + $file, ); $renderer = new ComposerFailureRenderer($failure); @@ -40,7 +40,7 @@ public function testRenderWithMissingPackages(): void $failure = new ComposerFailure( $this->createMock(CheckInterface::class), null, - ['some/package'] + ['some/package'], ); $renderer = new ComposerFailureRenderer($failure); @@ -54,7 +54,7 @@ public function testRenderWithMultipleMissingPackages(): void $failure = new ComposerFailure( $this->createMock(CheckInterface::class), null, - ['some/package', 'some-other/package'] + ['some/package', 'some-other/package'], ); $renderer = new ComposerFailureRenderer($failure); diff --git a/test/ResultRenderer/FailureRendererTest.php b/test/ResultRenderer/FailureRendererTest.php index 9884f07f..306fb485 100644 --- a/test/ResultRenderer/FailureRendererTest.php +++ b/test/ResultRenderer/FailureRendererTest.php @@ -2,7 +2,6 @@ namespace PhpSchool\PhpWorkshopTest\ResultRenderer; -use PhpSchool\PhpWorkshop\Check\CheckInterface; use PhpSchool\PhpWorkshop\Result\Failure; use PhpSchool\PhpWorkshop\ResultRenderer\FailureRenderer; diff --git a/test/ResultRenderer/FileComparisonFailureRendererTest.php b/test/ResultRenderer/FileComparisonFailureRendererTest.php index d7607863..9747d226 100644 --- a/test/ResultRenderer/FileComparisonFailureRendererTest.php +++ b/test/ResultRenderer/FileComparisonFailureRendererTest.php @@ -16,7 +16,7 @@ public function testRender(): void $this->createMock(CheckInterface::class), 'some-file.text', 'EXPECTED OUTPUT', - 'ACTUAL OUTPUT' + 'ACTUAL OUTPUT', ); $renderer = new FileComparisonFailureRenderer($failure); diff --git a/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php b/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php index bda80c2f..4151f45c 100644 --- a/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php +++ b/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php @@ -13,7 +13,7 @@ public function testRenderer(): void $failure = new FunctionRequirementsFailure( $this->createMock(CheckInterface::class), [['function' => 'file', 'line' => 3], ['function' => 'explode', 'line' => 5]], - ['implode'] + ['implode'], ); $renderer = new FunctionRequirementsFailureRenderer($failure); diff --git a/test/ResultRenderer/ResultsRendererTest.php b/test/ResultRenderer/ResultsRendererTest.php index c3cc1636..cb84b8eb 100644 --- a/test/ResultRenderer/ResultsRendererTest.php +++ b/test/ResultRenderer/ResultsRendererTest.php @@ -11,7 +11,6 @@ use PhpSchool\PhpWorkshopTest\BaseTest; use PhpSchool\Terminal\Terminal; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; -use PhpSchool\PhpWorkshop\Exercise\ProvidesSolution; use PhpSchool\PhpWorkshop\ExerciseRepository; use PhpSchool\PhpWorkshop\Factory\ResultRendererFactory; use PhpSchool\PhpWorkshop\Output\StdOutput; @@ -21,7 +20,6 @@ use PhpSchool\PhpWorkshop\ResultRenderer\FailureRenderer; use PhpSchool\PhpWorkshop\ResultRenderer\ResultsRenderer; use PhpSchool\PhpWorkshop\Solution\SingleFileSolution; -use PHPUnit\Framework\TestCase; use function PhpSchool\PhpWorkshop\camel_case_to_kebab_case; @@ -44,7 +42,7 @@ public function testRenderIndividualResult(): void $terminal, new ExerciseRepository([]), new KeyLighter(), - $resultRendererFactory + $resultRendererFactory, ); @@ -66,7 +64,7 @@ public function testLineBreak(): void $terminal, new ExerciseRepository([]), new KeyLighter(), - new ResultRendererFactory() + new ResultRendererFactory(), ); $this->assertSame("\e[33m──────────\e[0m", $renderer->lineBreak()); @@ -91,7 +89,7 @@ public function testRenderSuccess(): void $terminal, $exerciseRepo, new KeyLighter(), - $resultRendererFactory + $resultRendererFactory, ); $resultSet = new ResultAggregator(); @@ -104,7 +102,7 @@ public function testRenderSuccess(): void $resultSet, $this->createMock(ExerciseInterface::class), new UserState(['exercise1']), - new StdOutput($color, $terminal) + new StdOutput($color, $terminal), ); } @@ -132,7 +130,7 @@ public function testRenderSuccessWithSolution(): void $terminal, $exerciseRepo, new KeyLighter(), - $resultRendererFactory + $resultRendererFactory, ); $resultSet = new ResultAggregator(); @@ -145,7 +143,7 @@ public function testRenderSuccessWithSolution(): void $resultSet, $exercise, new UserState(['exercise1']), - new StdOutput($color, $terminal) + new StdOutput($color, $terminal), ); } @@ -181,7 +179,7 @@ public function testRenderSuccessWithPhpSolutionFileIsSyntaxHighlighted(): void $terminal, $exerciseRepo, $syntaxHighlighter, - $resultRendererFactory + $resultRendererFactory, ); $resultSet = new ResultAggregator(); @@ -194,7 +192,7 @@ public function testRenderSuccessWithPhpSolutionFileIsSyntaxHighlighted(): void $resultSet, $exercise, new UserState(['exercise1']), - new StdOutput($color, $terminal) + new StdOutput($color, $terminal), ); } @@ -205,12 +203,12 @@ public function testRenderSuccessAndFailure(): void $resultRendererFactory = new ResultRendererFactory(); $resultRendererFactory->registerRenderer(Failure::class, FailureRenderer::class, function (Failure $failure) { - $renderer = $this->createMock(FailureRenderer::class); - $renderer - ->method('render') - ->with($this->isInstanceOf(ResultsRenderer::class)) - ->willReturn($failure->getReason() . "\n"); - return $renderer; + $renderer = $this->createMock(FailureRenderer::class); + $renderer + ->method('render') + ->with($this->isInstanceOf(ResultsRenderer::class)) + ->willReturn($failure->getReason() . "\n"); + return $renderer; }); $terminal = $this->createMock(Terminal::class); @@ -225,7 +223,7 @@ public function testRenderSuccessAndFailure(): void $terminal, $exerciseRepo, new KeyLighter(), - $resultRendererFactory + $resultRendererFactory, ); $resultSet = new ResultAggregator(); @@ -239,7 +237,7 @@ public function testRenderSuccessAndFailure(): void $resultSet, $this->createMock(ExerciseInterface::class), new UserState(), - new StdOutput($color, $terminal) + new StdOutput($color, $terminal), ); } @@ -270,7 +268,7 @@ public function testAllSuccessResultsAreHoistedToTheTop(): void $terminal, $exerciseRepo, new KeyLighter(), - $resultRendererFactory + $resultRendererFactory, ); $resultSet = new ResultAggregator(); @@ -285,7 +283,7 @@ public function testAllSuccessResultsAreHoistedToTheTop(): void $resultSet, $this->createMock(ExerciseInterface::class), new UserState(), - new StdOutput($color, $terminal) + new StdOutput($color, $terminal), ); } @@ -315,7 +313,7 @@ public function testRenderAllFailures(): void $terminal, $exerciseRepo, new KeyLighter(), - $resultRendererFactory + $resultRendererFactory, ); $resultSet = new ResultAggregator(); @@ -328,7 +326,7 @@ public function testRenderAllFailures(): void $resultSet, $this->createMock(ExerciseInterface::class), new UserState(), - new StdOutput($color, $terminal) + new StdOutput($color, $terminal), ); } diff --git a/test/UserState/LocalJsonSerializerTest.php b/test/UserState/LocalJsonSerializerTest.php index e028f88d..da840159 100644 --- a/test/UserState/LocalJsonSerializerTest.php +++ b/test/UserState/LocalJsonSerializerTest.php @@ -2,7 +2,6 @@ namespace PhpSchool\PhpWorkshopTest\UserState; -use PhpSchool\PhpWorkshop\Exercise\ExerciseType; use PhpSchool\PhpWorkshop\ExerciseRepository; use PhpSchool\PhpWorkshop\UserState\LocalJsonSerializer; use PhpSchool\PhpWorkshop\UserState\UserState; @@ -44,7 +43,7 @@ public function testSerializeEmptySate(): void $serializer = new LocalJsonSerializer( $this->getTemporaryDirectory(), $this->workshopName, - $this->exerciseRepository + $this->exerciseRepository, ); $state = new UserState(); @@ -53,7 +52,7 @@ public function testSerializeEmptySate(): void 'My Workshop' => [ 'completed_exercises' => [], 'current_exercise' => null, - ] + ], ]); $serializer->serialize($state); @@ -65,7 +64,7 @@ public function testSerialize(): void $serializer = new LocalJsonSerializer( $this->getTemporaryDirectory(), $this->workshopName, - $this->exerciseRepository + $this->exerciseRepository, ); $state = new UserState(['exercise1'], 'exercise2'); @@ -75,7 +74,7 @@ public function testSerialize(): void 'My Workshop' => [ 'completed_exercises' => ['exercise1'], 'current_exercise' => 'exercise2', - ] + ], ]); $serializer->serialize($state); @@ -88,7 +87,7 @@ public function testDeserializeNonExistingFile(): void $serializer = new LocalJsonSerializer( $this->getTemporaryDirectory(), $this->workshopName, - $this->exerciseRepository + $this->exerciseRepository, ); $state = $serializer->deSerialize(); @@ -102,7 +101,7 @@ public function testDeserializeEmptyFile(): void $serializer = new LocalJsonSerializer( $this->getTemporaryDirectory(), $this->workshopName, - $this->exerciseRepository + $this->exerciseRepository, ); $state = $serializer->deSerialize(); $this->assertFalse($state->isAssignedExercise()); @@ -115,7 +114,7 @@ public function testDeserializeNonValidJson(): void $serializer = new LocalJsonSerializer( $this->getTemporaryDirectory(), $this->workshopName, - $this->exerciseRepository + $this->exerciseRepository, ); $state = $serializer->deSerialize(); $this->assertFalse($state->isAssignedExercise()); @@ -131,14 +130,14 @@ public function testDeserialize(array $data, array $expected): void $serializer = new LocalJsonSerializer( $this->getTemporaryDirectory(), $this->workshopName, - $this->exerciseRepository + $this->exerciseRepository, ); $state = $serializer->deSerialize(); $this->assertEquals($expected['completed_exercises'], $state->getCompletedExercises()); $this->assertEquals( $expected['current_exercise'], - $state->isAssignedExercise() ? $state->getCurrentExercise() : null + $state->isAssignedExercise() ? $state->getCurrentExercise() : null, ); } @@ -147,40 +146,40 @@ public function deserializerProvider(): array return [ 'empty-array' => [ [], - ['completed_exercises' => [], 'current_exercise' => null] + ['completed_exercises' => [], 'current_exercise' => null], ], 'no-data-should-return-defaults' => [ ['My Workshop' => []], - ['completed_exercises' => [], 'current_exercise' => null] + ['completed_exercises' => [], 'current_exercise' => null], ], 'no-current-exercise-set' => [ ['My Workshop' => ['completed_exercises' => []]], - ['completed_exercises' => [], 'current_exercise' => null] + ['completed_exercises' => [], 'current_exercise' => null], ], 'completed-exercise-not-array' => [ ['My Workshop' => ['completed_exercises' => null, 'current_exercise' => null]], - ['completed_exercises' => [], 'current_exercise' => null] + ['completed_exercises' => [], 'current_exercise' => null], ], 'invalid-completed-exercise' => [ ['My Workshop' => ['completed_exercises' => [null], 'current_exercise' => null]], - ['completed_exercises' => [], 'current_exercise' => null] + ['completed_exercises' => [], 'current_exercise' => null], ], 'completed-exercises-no-current-exercise' => [ ['My Workshop' => ['completed_exercises' => ['exercise1']]], - ['completed_exercises' => [], 'current_exercise' => null] + ['completed_exercises' => [], 'current_exercise' => null], ], 'completed-exercise-invalid-current-exercise' => [ ['My Workshop' => ['completed_exercises' => ['exercise1'], 'current_exercise' => new \stdClass()]], - ['completed_exercises' => ['exercise1'], 'current_exercise' => null] + ['completed_exercises' => ['exercise1'], 'current_exercise' => null], ], 'completed-exercise-current-null' => [ ['My Workshop' => ['completed_exercises' => ['exercise1'], 'current_exercise' => null]], - ['completed_exercises' => ['exercise1'], 'current_exercise' => null] + ['completed_exercises' => ['exercise1'], 'current_exercise' => null], ], 'completed-exercise-with-current' => [ ['My Workshop' => ['completed_exercises' => ['exercise1'], 'current_exercise' => 'exercise2']], - ['completed_exercises' => ['exercise1'], 'current_exercise' => 'exercise2'] - ] + ['completed_exercises' => ['exercise1'], 'current_exercise' => 'exercise2'], + ], ]; } @@ -201,8 +200,8 @@ public function testOldDataWillBeMigratedWhenInCorrectWorkshop(): void $this->workshopName, new ExerciseRepository([ $exercise1, - $exercise2 - ]) + $exercise2, + ]), ); $state = $serializer->deSerialize(); @@ -221,7 +220,7 @@ public function testOldDataWillBeMigratedWhenInCorrectWorkshop(): void $this->assertFileExists(Path::join($this->getTemporaryDirectory(), '.phpschool-save.json')); $this->assertEquals( $expected, - json_decode(file_get_contents($this->getTemporaryFile('.phpschool-save.json')), true) + json_decode(file_get_contents($this->getTemporaryFile('.phpschool-save.json')), true), ); } @@ -232,7 +231,7 @@ public function testOldDataWillNotBeMigratedWhenNotInCorrectWorkshop(): void $exercises = [ $exercise1, - $exercise2 + $exercise2, ]; $repo = new ExerciseRepository($exercises); @@ -279,8 +278,8 @@ public function testOldDataWillNotBeMigratedWhenNotInCorrectWorkshopWithOtherWor $this->workshopName, new ExerciseRepository([ $exercise1, - $exercise2 - ]) + $exercise2, + ]), ); $state = $serializer->deSerialize(); diff --git a/test/Utils/ArrayObjectTest.php b/test/Utils/ArrayObjectTest.php index 803477e7..15e85dde 100644 --- a/test/Utils/ArrayObjectTest.php +++ b/test/Utils/ArrayObjectTest.php @@ -181,7 +181,7 @@ public function testKstort() $arrayObject = new ArrayObject([ 'z' => 'more test data', 'a' => 'test data', - 't' => 'yup moar test data' + 't' => 'yup moar test data', ]); $expected = [ diff --git a/test/Utils/PathTest.php b/test/Utils/PathTest.php index d75eb811..37d965e7 100644 --- a/test/Utils/PathTest.php +++ b/test/Utils/PathTest.php @@ -11,47 +11,47 @@ public function testJoin(): void { $this->assertEquals( '/some/path/some-folder/file.txt', - Path::join('/some/path', 'some-folder/file.txt') + Path::join('/some/path', 'some-folder/file.txt'), ); $this->assertEquals( '/some/path/some-folder/file.txt', - Path::join('/some/path/', 'some-folder/file.txt') + Path::join('/some/path/', 'some-folder/file.txt'), ); $this->assertEquals( '/some/path/some-folder/file.txt', - Path::join('/some/path', '/some-folder/file.txt') + Path::join('/some/path', '/some-folder/file.txt'), ); $this->assertEquals( '/some/path/some-folder/file.txt', - Path::join('/some/path/', '/some-folder/file.txt') + Path::join('/some/path/', '/some-folder/file.txt'), ); $this->assertEquals( '/some/path/some-folder/file.txt', - Path::join('/some/path//', '//some-folder/file.txt') + Path::join('/some/path//', '//some-folder/file.txt'), ); $this->assertEquals( '/some/path/some-folder/file.txt', - Path::join('/some/path/', 'some-folder', 'file.txt') + Path::join('/some/path/', 'some-folder', 'file.txt'), ); $this->assertEquals( '/some/path/some-folder/file.txt', - Path::join('/some/path/', '/some-folder/', '/file.txt') + Path::join('/some/path/', '/some-folder/', '/file.txt'), ); $this->assertEquals( '/some/path', - Path::join('/some/path/') + Path::join('/some/path/'), ); $this->assertEquals( '/some/path', - Path::join('/some/path/', '') + Path::join('/some/path/', ''), ); } } diff --git a/test/Utils/RequestRendererTest.php b/test/Utils/RequestRendererTest.php index 86c81926..04cca526 100644 --- a/test/Utils/RequestRendererTest.php +++ b/test/Utils/RequestRendererTest.php @@ -35,7 +35,7 @@ public function testWriteRequestWithPostBodyJson(): void ->withHeader('Content-Type', 'application/json'); $request->getBody()->write( - json_encode(['data' => 'test', 'other_data' => 'test2']) + json_encode(['data' => 'test', 'other_data' => 'test2']), ); $expected = "URL: /endpoint\n"; @@ -55,7 +55,7 @@ public function testWriteRequestWithPostBodyUrlEncoded(): void ->withHeader('Content-Type', 'application/x-www-form-urlencoded'); $request->getBody()->write( - http_build_query(['data' => 'test', 'other_data' => 'test2']) + http_build_query(['data' => 'test', 'other_data' => 'test2']), ); $expected = "URL: /endpoint\n"; diff --git a/test/Utils/StringUtilsTest.php b/test/Utils/StringUtilsTest.php index 362e4147..99e32217 100644 --- a/test/Utils/StringUtilsTest.php +++ b/test/Utils/StringUtilsTest.php @@ -44,7 +44,7 @@ public function pluraliseMultipleProvider(): array return [ [ 'Property "%s" should not have changed type', - 'Properties "propOne" & "propTwo" should not have changed type' + 'Properties "propOne" & "propTwo" should not have changed type', ], ['Property "%s" was not promoted', 'Properties "propOne" & "propTwo" were not promoted'], ['Property "%s" was missing', 'Properties "propOne" & "propTwo" were missing'], diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json new file mode 100644 index 00000000..8e2f14be --- /dev/null +++ b/vendor-bin/php-cs-fixer/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.56" + } +} diff --git a/vendor-bin/php-cs-fixer/composer.lock b/vendor-bin/php-cs-fixer/composer.lock new file mode 100644 index 00000000..edaef88f --- /dev/null +++ b/vendor-bin/php-cs-fixer/composer.lock @@ -0,0 +1,1827 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "42a90527cc8998493cafbc20093018a7", + "packages": [], + "packages-dev": [ + { + "name": "composer/pcre", + "version": "3.1.3", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-03-19T10:26:25+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.56.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "69c6168ae8bc96dc656c7f6c7271120a68ae5903" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/69c6168ae8bc96dc656c7f6c7271120a68ae5903", + "reference": "69c6168ae8bc96dc656c7f6c7271120a68ae5903", + "shasum": "" + }, + "require": { + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", + "infection/infection": "^0.27.11", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", + "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.56.1" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2024-05-10T11:31:15+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "sebastian/diff", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ab83243ecc233de5655b76f577711de9f842e712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ab83243ecc233de5655b76f577711de9f842e712", + "reference": "ab83243ecc233de5655b76f577711de9f842e712", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:30:33+00:00" + }, + { + "name": "symfony/console", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "c981e0e9380ce9f146416bde3150c79197ce9986" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/c981e0e9380ce9f146416bde3150c79197ce9986", + "reference": "c981e0e9380ce9f146416bde3150c79197ce9986", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:29:19+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db2a7fab994d67d92356bb39c367db115d9d30f9", + "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:29:19+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", + "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "cc168be6fbdcdf3401f50ae863ee3818ed4338f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/cc168be6fbdcdf3401f50ae863ee3818ed4338f5", + "reference": "cc168be6fbdcdf3401f50ae863ee3818ed4338f5", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/process": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v7.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:29:19+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "4d58f0f4fe95a30d7b538d71197135483560b97c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/4d58f0f4fe95a30d7b538d71197135483560b97c", + "reference": "4d58f0f4fe95a30d7b538d71197135483560b97c", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-28T11:44:19+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/23cc173858776ad451e31f053b1c9f47840b2cfa", + "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v7.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:29:19+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/process", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/3839e56b94dd1dbd13235d27504e66baf23faba0", + "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:29:19+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/41a7a24aa1dc82adf46a06bc292d1923acfe6b84", + "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:29:19+00:00" + }, + { + "name": "symfony/string", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/e405b5424dc2528e02e31ba26b83a79fd4eb8f63", + "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:29:19+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.3.0" +}