diff --git a/bin/build-configs b/bin/build-configs index 6f70bfe..dbcf25b 100755 --- a/bin/build-configs +++ b/bin/build-configs @@ -5,262 +5,39 @@ declare(strict_types=1); require __DIR__.'/../vendor/autoload.php'; -use Illuminate\Support\{Arr, Collection}; -use OliverDaviesLtd\BuildConfigs\ConfigurationData; -use OliverDaviesLtd\BuildConfigs\DataTransferObject\TemplateFile; -use OliverDaviesLtd\BuildConfigs\Enum\{Language, WebServer}; -use Silly\Application; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Serializer\Encoder\JsonEncoder; -use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter; -use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; -use Symfony\Component\Serializer\Serializer; -use Symfony\Component\Validator\{ConstraintViolationInterface, Validation}; -use Symfony\Component\Yaml\Yaml; -use Twig\Environment; -use Twig\Loader\FilesystemLoader; +use OliverDaviesLtd\BuildConfigs\Command\GenerateCommand; +use OliverDaviesLtd\BuildConfigs\Command\InitCommand; +use Silly\Edition\PhpDi\Application; -$app = new Application(); +$app = new Application('build-configs'); $app->command( - 'init [-p|--project-name=] [-l|--language=] [-t|--type=]', - function( - string $projectName, - string $language, - string $type, - ): void { - $projectName = str_replace('.', '-', $projectName); - - // TODO: validate the project type. - $output = <<descriptions('Initialise a new build.yaml file.', [ - '--project-name' => 'The name of the project.', - '--language' => 'The language used in the project.', - '--type' => 'The project type.', -]);; + expression: 'init [-p|--project-name=] [-l|--language=] [-t|--type=]', + callable: InitCommand::class, + ) + ->descriptions( + description: 'Initialise a new build.yaml file.', + argumentAndOptionDescriptions: [ + '--project-name' => 'The name of the project.', + '--language' => 'The language used in the project.', + '--type' => 'The project type.', + ], + ); $app->command( - 'generate [-c|--config-file=] [-o|--output-dir=]', - function ( - SymfonyStyle $io, - string $configFile = 'build.yaml', - string $outputDir = '.', - ): void { - $configurationData = array_merge( - Yaml::parseFile(__DIR__ . '/../resources/build.defaults.yaml'), - Yaml::parseFile($configFile), - ); - - // Convert the input to a configuration data object. - $normalizer = new ObjectNormalizer(null, new CamelCaseToSnakeCaseNameConverter()); - $serializer = new Serializer([$normalizer], [new JsonEncoder()]); - $configurationDataObject = $serializer->deserialize(json_encode($configurationData), ConfigurationData::class, 'json'); - - $validator = Validation::createValidatorBuilder()->enableAnnotationMapping()->getValidator(); - $violations = $validator->validate($configurationDataObject); - - if (0 < $violations->count()) { - $io->error('Configuration is invalid.'); - - $io->listing( - collect($violations) - ->map(fn (ConstraintViolationInterface $v) => "{$v->getPropertyPath()} - {$v->getMessage()}") - ->toArray() - ); - - return; - } - - if (isset($configurationData['docker-compose'])) { - $configurationData['dockerCompose'] = $configurationData['docker-compose']; - $configurationData['docker-compose'] = null; - } - - $configurationData['managedText'] = 'Do not edit this file. It is automatically generated by \'build-configs\'.'; - - $filesToGenerate = getFiles(configurationData: $configurationData); - - $io->info("Building configuration for {$configurationData['name']}."); - - $io->write('Generated files:'); - $io->listing(getListOfFiles(filesToGenerate: $filesToGenerate)->toArray()); - - generateFiles( - configurationData: $configurationData, - filesToGenerate: $filesToGenerate, - outputDir: $outputDir, - ); - } -)->descriptions('Generate project-specific configuration files.', [ - '--config-file' => 'The path to the project\'s build.yaml file', - '--output-dir' => 'The directory to create files in', -]); - -$app->run(); - -/** - * @param array $configurationData - * @param Collection $filesToGenerate - */ -function generateFiles( - Collection $filesToGenerate, - string $outputDir, - array $configurationData, -): void -{ - $filesystem = new Filesystem(); - $twig = new Environment(new FilesystemLoader([__DIR__ . '/../templates'])); - - $filesToGenerate->each(function(TemplateFile $templateFile) use ($configurationData, $filesystem, $outputDir, $twig): void { - if ($templateFile->path !== null) { - if (!$filesystem->exists($templateFile->path)) { - $filesystem->mkdir("{$outputDir}/{$templateFile->path}"); - } - } - - $sourceFile = "{$templateFile->data}.twig"; - $outputFile = collect([ - $outputDir, - $templateFile->path, - $templateFile->name, - ])->filter()->implode('/'); - - $filesystem->dumpFile($outputFile, $twig->render($sourceFile, $configurationData)); - }); - - // If the Docker entrypoint file is generated, ensure it is executable. - if ($filesystem->exists("{$outputDir}/tools/docker/images/php/root/usr/local/bin/docker-entrypoint-php")) { - $filesystem->chmod("{$outputDir}/tools/docker/images/php/root/usr/local/bin/docker-entrypoint-php", 0755); - } -} - -function getFiles(array $configurationData): Collection -{ - /** @var Collection */ - $filesToGenerate = collect([ - new TemplateFile(data: 'common/.dockerignore', name: '.dockerignore'), - new TemplateFile(data: 'common/.hadolint.yaml', name: '.hadolint.yaml'), - new TemplateFile(data: 'env.example', name: '.env.example'), + expression: 'generate [-c|--config-file=] [-o|--output-dir=]', + callable: GenerateCommand::class, + ) + ->descriptions( + description: 'Generate configuration files.', + argumentAndOptionDescriptions: [ + '--config-file' => 'The path to the project\'s build.yaml file', + '--output-dir' => 'The directory to create files in', + ], + ) + ->defaults(defaults: [ + 'config-file' => 'build.yaml', + 'output-dir' => '.', ]); - $extraDatabases = Arr::get($configurationData, 'database.extra_databases', []); - if (count($extraDatabases) > 0) { - $filesToGenerate[] = new TemplateFile( - data: 'extra-databases.sql', - name: 'extra-databases.sql', - path: 'tools/docker/images/database/root/docker-entrypoint-initdb.d', - ); - } - - if (false !== Arr::get($configurationData, "justfile", true)) { - $filesToGenerate[] = new TemplateFile(data: 'justfile', name: 'justfile'); - } - - if (isset($configurationData['dockerCompose']) && $configurationData['dockerCompose'] !== null) { - $filesToGenerate[] = new TemplateFile(data: 'docker-compose.yaml', name: 'docker-compose.yaml'); - } - - if (isPhp(Arr::get($configurationData, 'language'))) { - $filesToGenerate[] = new TemplateFile(data: 'php/Dockerfile', name: 'Dockerfile'); - $filesToGenerate[] = new TemplateFile(data: 'php/phpcs.xml', name: 'phpcs.xml.dist'); - $filesToGenerate[] = new TemplateFile(data: 'php/phpunit.xml', name: 'phpunit.xml.dist'); - $filesToGenerate[] = new TemplateFile( - data: 'php/docker-entrypoint-php', - name: 'docker-entrypoint-php', - path: 'tools/docker/images/php/root/usr/local/bin', - ); - - if (Arr::has(array: $configurationData, keys: 'php.phpstan')) { - $filesToGenerate[] = new TemplateFile(data: 'php/phpstan.neon', name: 'phpstan.neon.dist'); - } - } - - if (isNode(Arr::get($configurationData, 'language'))) { - $filesToGenerate[] = new TemplateFile(data: 'node/.yarnrc', name: '.yarnrc'); - $filesToGenerate[] = new TemplateFile(data: 'node/Dockerfile', name: 'Dockerfile'); - } - - if (isCaddy(Arr::get($configurationData, 'web.type'))) { - $filesToGenerate[] = new TemplateFile( - data: 'web/caddy/Caddyfile', - name: 'Caddyfile', - path: 'tools/docker/images/web/root/etc/caddy', - ); - } - - if (isNginx(Arr::get($configurationData, 'web.type'))) { - $filesToGenerate[] = new TemplateFile( - data: 'web/nginx/default.conf', - name: 'default.conf', - path: 'tools/docker/images/web/root/etc/nginx/conf.d', - ); - } - - if ('drupal-project' === Arr::get($configurationData, 'type')) { - // Add a Drupal version of phpunit.xml.dist. - $filesToGenerate[] = new TemplateFile(data: 'drupal-project/phpunit.xml.dist', name: 'phpunit.xml.dist'); - } - - if (Arr::get($configurationData, 'experimental.createGitHubActionsConfiguration', false) === true) { - $filesToGenerate[] = new TemplateFile( - data: 'ci/github-actions/ci.yml', - name: 'ci.yml', - path: '.github/workflows', - ); - } - - return $filesToGenerate; -} - -function getListOfFiles(Collection $filesToGenerate): Collection -{ - return $filesToGenerate - ->map(fn (TemplateFile $templateFile): string => - collect([$templateFile->path, $templateFile->name])->filter()->implode('/')) - ->unique() - ->sort(); -} - -function isCaddy(?string $webServer): bool -{ - if (is_null($webServer)) { - return false; - } - - return strtoupper($webServer) === WebServer::CADDY->name; -} - -function isNginx(?string $webServer): bool -{ - if (is_null($webServer)) { - return false; - } - - return strtoupper($webServer) === WebServer::NGINX->name; -} - -function isNode(?string $language): bool -{ - if (is_null($language)) { - return false; - } - - return strtoupper($language) === Language::NODE->name; -} - -function isPhp(?string $language): bool -{ - if (is_null($language)) { - return false; - } - - return strtoupper($language) === Language::PHP->name; -} +$app->run(); diff --git a/composer.json b/composer.json index 9ddb3b0..bfe4be5 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,8 @@ { "require": { "illuminate/support": "^9.50", - "mnapoli/silly": "^1.8", + "mnapoli/silly-php-di": "^1.2", + "php-di/php-di": "^6.3", "symfony/console": "^6.2", "symfony/filesystem": "^6.2", "symfony/property-access": "^6.2", @@ -24,7 +25,8 @@ "config": { "sort-packages": true, "allow-plugins": { - "pestphp/pest-plugin": true + "pestphp/pest-plugin": true, + "phpstan/extension-installer": true } } } diff --git a/composer.lock b/composer.lock index d92fc43..a1ed3c7 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": "94f4b4a5ef24faa3bb9781c9792c206c", + "content-hash": "6b410ac1d01ebfcf81d4a0244fc27699", "packages": [ { "name": "amphp/amp", @@ -174,16 +174,16 @@ }, { "name": "amphp/parallel", - "version": "v1.4.2", + "version": "v1.4.3", "source": { "type": "git", "url": "https://github.com/amphp/parallel.git", - "reference": "75853e1623efa5aa5e65e986ec9a97db573a5267" + "reference": "3aac213ba7858566fd83d38ccb85b91b2d652cb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/parallel/zipball/75853e1623efa5aa5e65e986ec9a97db573a5267", - "reference": "75853e1623efa5aa5e65e986ec9a97db573a5267", + "url": "https://api.github.com/repos/amphp/parallel/zipball/3aac213ba7858566fd83d38ccb85b91b2d652cb0", + "reference": "3aac213ba7858566fd83d38ccb85b91b2d652cb0", "shasum": "" }, "require": { @@ -236,7 +236,7 @@ ], "support": { "issues": "https://github.com/amphp/parallel/issues", - "source": "https://github.com/amphp/parallel/tree/v1.4.2" + "source": "https://github.com/amphp/parallel/tree/v1.4.3" }, "funding": [ { @@ -244,7 +244,7 @@ "type": "github" } ], - "time": "2022-12-30T00:21:42+00:00" + "time": "2023-03-23T08:04:23+00:00" }, { "name": "amphp/parallel-functions", @@ -775,6 +775,49 @@ ], "time": "2022-02-25T21:32:43+00:00" }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "time": "2022-05-02T15:47:09+00:00" + }, { "name": "doctrine/inflector", "version": "2.0.6", @@ -952,16 +995,16 @@ }, { "name": "humbug/box", - "version": "4.2.0", + "version": "4.3.8", "source": { "type": "git", "url": "https://github.com/box-project/box.git", - "reference": "afc3a4742c2a3a777e521af5e8e784a14e5c5958" + "reference": "55344067891d8be61e6efa50f7c2e59114f32704" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/box-project/box/zipball/afc3a4742c2a3a777e521af5e8e784a14e5c5958", - "reference": "afc3a4742c2a3a777e521af5e8e784a14e5c5958", + "url": "https://api.github.com/repos/box-project/box/zipball/55344067891d8be61e6efa50f7c2e59114f32704", + "reference": "55344067891d8be61e6efa50f7c2e59114f32704", "shasum": "" }, "require": { @@ -972,12 +1015,12 @@ "ext-phar": "*", "ext-sodium": "*", "fidry/console": "^0.5.3", - "humbug/php-scoper": "^0.17.7 || ^0.18", + "humbug/php-scoper": "^0.18.3", "justinrainbow/json-schema": "^5.2.12", "laravel/serializable-closure": "^1.2.2", "nikic/iter": "^2.2", "nikic/php-parser": "^4.15.2", - "paragonie/pharaoh": "^0.6", + "paragonie/constant_time_encoding": "^2.6", "php": "^8.1", "phpdocumentor/reflection-docblock": "^5.3", "psr/log": "^3.0", @@ -996,10 +1039,14 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", + "ergebnis/composer-normalize": "^2.29", + "fidry/makefile": "^0.2.1", "mikey179/vfsstream": "^1.6.11", "phpspec/prophecy-phpunit": "^2.0.1", "phpunit/phpunit": "^9.5.26", - "symfony/phpunit-bridge": "^4.2 || ^5.4.14 || ^6.1.6" + "symfony/phpunit-bridge": "^6.1.6", + "symfony/yaml": "^6.2", + "webmozarts/strict-phpunit": "^7.6" }, "suggest": { "ext-openssl": "To accelerate private key generation." @@ -1009,12 +1056,12 @@ ], "type": "library", "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - }, "bamarni-bin": { "bin-links": false, "forward-command": false + }, + "branch-alias": { + "dev-main": "4.x-dev" } }, "autoload": { @@ -1027,7 +1074,8 @@ "KevinGH\\Box\\": "src" }, "exclude-from-classmap": [ - "/Test/" + "/Test/", + "vendor/humbug/php-scoper/vendor-hotfix" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1051,22 +1099,22 @@ ], "support": { "issues": "https://github.com/box-project/box/issues", - "source": "https://github.com/box-project/box/tree/4.2.0" + "source": "https://github.com/box-project/box/tree/4.3.8" }, - "time": "2022-11-21T22:08:42+00:00" + "time": "2023-03-17T08:30:03+00:00" }, { "name": "humbug/php-scoper", - "version": "0.18.2", + "version": "0.18.3", "source": { "type": "git", "url": "https://github.com/humbug/php-scoper.git", - "reference": "5eb0484b1e0078f7558ced351bef12733d04559f" + "reference": "1a49b88b7961152daf534757137b8f86f67fde23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/humbug/php-scoper/zipball/5eb0484b1e0078f7558ced351bef12733d04559f", - "reference": "5eb0484b1e0078f7558ced351bef12733d04559f", + "url": "https://api.github.com/repos/humbug/php-scoper/zipball/1a49b88b7961152daf534757137b8f86f67fde23", + "reference": "1a49b88b7961152daf534757137b8f86f67fde23", "shasum": "" }, "require": { @@ -1133,22 +1181,22 @@ "description": "Prefixes all PHP namespaces in a file or directory.", "support": { "issues": "https://github.com/humbug/php-scoper/issues", - "source": "https://github.com/humbug/php-scoper/tree/0.18.2" + "source": "https://github.com/humbug/php-scoper/tree/0.18.3" }, - "time": "2023-01-05T23:55:04+00:00" + "time": "2023-03-16T22:49:19+00:00" }, { "name": "illuminate/collections", - "version": "v9.50.2", + "version": "v9.52.6", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "4059d5fcabbe9cc047e3fcd264df73aefc863da9" + "reference": "0168d0e44ea0c4fe5451fe08cde7049b9e9f9741" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/4059d5fcabbe9cc047e3fcd264df73aefc863da9", - "reference": "4059d5fcabbe9cc047e3fcd264df73aefc863da9", + "url": "https://api.github.com/repos/illuminate/collections/zipball/0168d0e44ea0c4fe5451fe08cde7049b9e9f9741", + "reference": "0168d0e44ea0c4fe5451fe08cde7049b9e9f9741", "shasum": "" }, "require": { @@ -1190,11 +1238,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-02-01T03:39:02+00:00" + "time": "2023-02-22T11:32:27+00:00" }, { "name": "illuminate/conditionable", - "version": "v9.50.2", + "version": "v9.52.6", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -1240,16 +1288,16 @@ }, { "name": "illuminate/contracts", - "version": "v9.50.2", + "version": "v9.52.6", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "d731949dd1deff07c5a9d01379b1c1918bfd0672" + "reference": "44f65d723b13823baa02ff69751a5948bde60c22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/d731949dd1deff07c5a9d01379b1c1918bfd0672", - "reference": "d731949dd1deff07c5a9d01379b1c1918bfd0672", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/44f65d723b13823baa02ff69751a5948bde60c22", + "reference": "44f65d723b13823baa02ff69751a5948bde60c22", "shasum": "" }, "require": { @@ -1284,11 +1332,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-01-27T22:43:58+00:00" + "time": "2023-02-08T14:36:30+00:00" }, { "name": "illuminate/macroable", - "version": "v9.50.2", + "version": "v9.52.6", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -1334,21 +1382,22 @@ }, { "name": "illuminate/support", - "version": "v9.50.2", + "version": "v9.52.6", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "e0b5a53d802ee15d54b91d1031ee307fb2f7dfc0" + "reference": "5c38d755c5fa767d5b689867888ee4e5f53fc8a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/e0b5a53d802ee15d54b91d1031ee307fb2f7dfc0", - "reference": "e0b5a53d802ee15d54b91d1031ee307fb2f7dfc0", + "url": "https://api.github.com/repos/illuminate/support/zipball/5c38d755c5fa767d5b689867888ee4e5f53fc8a6", + "reference": "5c38d755c5fa767d5b689867888ee4e5f53fc8a6", "shasum": "" }, "require": { "doctrine/inflector": "^2.0", - "ext-json": "*", + "ext-ctype": "*", + "ext-filter": "*", "ext-mbstring": "*", "illuminate/collections": "^9.0", "illuminate/conditionable": "^9.0", @@ -1400,7 +1449,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-02-02T15:48:07+00:00" + "time": "2023-04-04T18:35:58+00:00" }, { "name": "jetbrains/phpstorm-stubs", @@ -1522,16 +1571,16 @@ }, { "name": "laravel/serializable-closure", - "version": "v1.2.2", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae" + "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae", - "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", + "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", "shasum": "" }, "require": { @@ -1578,7 +1627,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2022-09-08T13:45:54+00:00" + "time": "2023-01-30T18:31:20+00:00" }, { "name": "mnapoli/silly", @@ -1640,6 +1689,44 @@ ], "time": "2022-09-06T14:21:36+00:00" }, + { + "name": "mnapoli/silly-php-di", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/mnapoli/silly-php-di.git", + "reference": "bd4af1c2cdf6141dc941a9a4728d1db4d4b01ef0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mnapoli/silly-php-di/zipball/bd4af1c2cdf6141dc941a9a4728d1db4d4b01ef0", + "reference": "bd4af1c2cdf6141dc941a9a4728d1db4d4b01ef0", + "shasum": "" + }, + "require": { + "mnapoli/silly": "~1.1", + "php-di/php-di": "~4.4 || ^5.0 || ^6.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Silly\\Edition\\PhpDi\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Silly framework edition configured with PHP-DI", + "support": { + "issues": "https://github.com/mnapoli/silly-php-di/issues", + "source": "https://github.com/mnapoli/silly-php-di/tree/master" + }, + "time": "2018-04-05T08:53:27+00:00" + }, { "name": "nesbot/carbon", "version": "2.66.0", @@ -1794,16 +1881,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.3", + "version": "v4.15.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", "shasum": "" }, "require": { @@ -1844,9 +1931,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" }, - "time": "2023-01-16T22:05:37+00:00" + "time": "2023-03-05T19:49:14+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -1915,66 +2002,6 @@ }, "time": "2022-06-14T06:56:20+00:00" }, - { - "name": "paragonie/pharaoh", - "version": "v0.6.0", - "source": { - "type": "git", - "url": "https://github.com/paragonie/pharaoh.git", - "reference": "d33976a45429edc9c4282e7b0f2b6c3a3a5783fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/pharaoh/zipball/d33976a45429edc9c4282e7b0f2b6c3a3a5783fc", - "reference": "d33976a45429edc9c4282e7b0f2b6c3a3a5783fc", - "shasum": "" - }, - "require": { - "paragonie/constant_time_encoding": "^2", - "paragonie/sodium_compat": "^1.3", - "php": "^7|^8", - "ulrichsg/getopt-php": "^3" - }, - "require-dev": { - "vimeo/psalm": "^1|^2|^3" - }, - "bin": [ - "pharaoh" - ], - "type": "library", - "autoload": { - "psr-4": { - "ParagonIE\\Pharaoh\\": "src/Pharaoh/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Scott Arciszewski", - "email": "scott@paragonie.com", - "homepage": "https://paragonie.com", - "role": "Developer" - } - ], - "description": "Compare PHARs from the Command Line", - "keywords": [ - "auditing", - "diff", - "phar", - "security", - "tool", - "utility" - ], - "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/pharaoh/issues", - "source": "https://github.com/paragonie/pharaoh" - }, - "time": "2020-12-03T04:57:05+00:00" - }, { "name": "php-di/invoker", "version": "2.3.3", @@ -2030,6 +2057,124 @@ ], "time": "2021-12-13T09:22:56+00:00" }, + { + "name": "php-di/php-di", + "version": "6.4.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-DI/PHP-DI.git", + "reference": "ae0f1b3b03d8b29dff81747063cbfd6276246cc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/ae0f1b3b03d8b29dff81747063cbfd6276246cc4", + "reference": "ae0f1b3b03d8b29dff81747063cbfd6276246cc4", + "shasum": "" + }, + "require": { + "laravel/serializable-closure": "^1.0", + "php": ">=7.4.0", + "php-di/invoker": "^2.0", + "php-di/phpdoc-reader": "^2.0.1", + "psr/container": "^1.0" + }, + "provide": { + "psr/container-implementation": "^1.0" + }, + "require-dev": { + "doctrine/annotations": "~1.10", + "friendsofphp/php-cs-fixer": "^2.4", + "mnapoli/phpunit-easymock": "^1.2", + "ocramius/proxy-manager": "^2.11.2", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "doctrine/annotations": "Install it if you want to use annotations (version ~1.2)", + "ocramius/proxy-manager": "Install it if you want to use lazy injection (version ~2.0)" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "DI\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The dependency injection container for humans", + "homepage": "https://php-di.org/", + "keywords": [ + "PSR-11", + "container", + "container-interop", + "dependency injection", + "di", + "ioc", + "psr11" + ], + "support": { + "issues": "https://github.com/PHP-DI/PHP-DI/issues", + "source": "https://github.com/PHP-DI/PHP-DI/tree/6.4.0" + }, + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/php-di/php-di", + "type": "tidelift" + } + ], + "time": "2022-04-09T16:46:38+00:00" + }, + { + "name": "php-di/phpdoc-reader", + "version": "2.2.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-DI/PhpDocReader.git", + "reference": "66daff34cbd2627740ffec9469ffbac9f8c8185c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-DI/PhpDocReader/zipball/66daff34cbd2627740ffec9469ffbac9f8c8185c", + "reference": "66daff34cbd2627740ffec9469ffbac9f8c8185c", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "require-dev": { + "mnapoli/hard-mode": "~0.3.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpDocReader\\": "src/PhpDocReader" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)", + "keywords": [ + "phpdoc", + "reflection" + ], + "support": { + "issues": "https://github.com/PHP-DI/PhpDocReader/issues", + "source": "https://github.com/PHP-DI/PhpDocReader/tree/2.2.1" + }, + "time": "2020-10-12T12:39:22+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -2142,24 +2287,27 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.2", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" + "reference": "dfc078e8af9c99210337325ff5aa152872c98714" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dfc078e8af9c99210337325ff5aa152872c98714", + "reference": "dfc078e8af9c99210337325ff5aa152872c98714", "shasum": "" }, "require": { + "doctrine/deprecations": "^1.0", "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" }, "require-dev": { "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", @@ -2191,33 +2339,73 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.1" }, - "time": "2022-10-14T12:47:21+00:00" + "time": "2023-03-27T19:02:04+00:00" }, { - "name": "psr/container", - "version": "2.0.2", + "name": "phpstan/phpdoc-parser", + "version": "1.20.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "10553ab3f0337ff1a71433c3417d7eb2a3eec1fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/10553ab3f0337ff1a71433c3417d7eb2a3eec1fd", + "reference": "10553ab3f0337ff1a71433c3417d7eb2a3eec1fd", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.20.0" + }, + "time": "2023-04-20T11:18:07+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { "php": ">=7.4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -2244,9 +2432,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-11-05T16:47:00+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "psr/event-dispatcher", @@ -2465,16 +2653,16 @@ }, { "name": "symfony/console", - "version": "v6.2.3", + "version": "v6.2.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0f579613e771dba2dbb8211c382342a641f5da06" + "reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0f579613e771dba2dbb8211c382342a641f5da06", - "reference": "0f579613e771dba2dbb8211c382342a641f5da06", + "url": "https://api.github.com/repos/symfony/console/zipball/3582d68a64a86ec25240aaa521ec8bc2342b369b", + "reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b", "shasum": "" }, "require": { @@ -2536,12 +2724,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.3" + "source": "https://github.com/symfony/console/tree/v6.2.8" }, "funding": [ { @@ -2557,20 +2745,20 @@ "type": "tidelift" } ], - "time": "2022-12-28T14:26:22+00:00" + "time": "2023-03-29T21:42:15+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.0", + "version": "v3.2.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", - "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", "shasum": "" }, "require": { @@ -2608,7 +2796,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.2.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" }, "funding": [ { @@ -2624,20 +2812,20 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2023-03-01T10:25:55+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.2.0", + "version": "v3.2.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0782b0b52a737a05b4383d0df35a474303cabdae" + "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0782b0b52a737a05b4383d0df35a474303cabdae", - "reference": "0782b0b52a737a05b4383d0df35a474303cabdae", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", + "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", "shasum": "" }, "require": { @@ -2687,7 +2875,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" }, "funding": [ { @@ -2703,20 +2891,20 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2023-03-01T10:32:47+00:00" }, { "name": "symfony/filesystem", - "version": "v6.2.0", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "50b2523c874605cf3d4acf7a9e2b30b6a440a016" + "reference": "82b6c62b959f642d000456f08c6d219d749215b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/50b2523c874605cf3d4acf7a9e2b30b6a440a016", - "reference": "50b2523c874605cf3d4acf7a9e2b30b6a440a016", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/82b6c62b959f642d000456f08c6d219d749215b3", + "reference": "82b6c62b959f642d000456f08c6d219d749215b3", "shasum": "" }, "require": { @@ -2750,7 +2938,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.2.0" + "source": "https://github.com/symfony/filesystem/tree/v6.2.7" }, "funding": [ { @@ -2766,20 +2954,20 @@ "type": "tidelift" } ], - "time": "2022-11-20T13:01:27+00:00" + "time": "2023-02-14T08:44:56+00:00" }, { "name": "symfony/finder", - "version": "v6.2.3", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "81eefbddfde282ee33b437ba5e13d7753211ae8e" + "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/81eefbddfde282ee33b437ba5e13d7753211ae8e", - "reference": "81eefbddfde282ee33b437ba5e13d7753211ae8e", + "url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb", + "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb", "shasum": "" }, "require": { @@ -2814,7 +3002,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.2.3" + "source": "https://github.com/symfony/finder/tree/v6.2.7" }, "funding": [ { @@ -2830,7 +3018,7 @@ "type": "tidelift" } ], - "time": "2022-12-22T17:55:15+00:00" + "time": "2023-02-16T09:57:23+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3164,16 +3352,16 @@ }, { "name": "symfony/process", - "version": "v6.2.0", + "version": "v6.2.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877" + "reference": "75ed64103df4f6615e15a7fe38b8111099f47416" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/ba6e55359f8f755fe996c58a81e00eaa67a35877", - "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877", + "url": "https://api.github.com/repos/symfony/process/zipball/75ed64103df4f6615e15a7fe38b8111099f47416", + "reference": "75ed64103df4f6615e15a7fe38b8111099f47416", "shasum": "" }, "require": { @@ -3205,7 +3393,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.2.0" + "source": "https://github.com/symfony/process/tree/v6.2.8" }, "funding": [ { @@ -3221,7 +3409,7 @@ "type": "tidelift" } ], - "time": "2022-11-02T09:08:04+00:00" + "time": "2023-03-09T16:20:02+00:00" }, { "name": "symfony/property-access", @@ -3495,21 +3683,22 @@ }, { "name": "symfony/service-contracts", - "version": "v3.2.0", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75" + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/aac98028c69df04ee77eb69b96b86ee51fbf4b75", - "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", "shasum": "" }, "require": { - "php": ">=8.1", - "psr/container": "^2.0" + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -3520,7 +3709,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3530,10 +3719,7 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3560,7 +3746,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" }, "funding": [ { @@ -3576,20 +3762,20 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2022-05-30T19:17:29+00:00" }, { "name": "symfony/string", - "version": "v6.2.2", + "version": "v6.2.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "863219fd713fa41cbcd285a79723f94672faff4d" + "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/863219fd713fa41cbcd285a79723f94672faff4d", - "reference": "863219fd713fa41cbcd285a79723f94672faff4d", + "url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef", + "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef", "shasum": "" }, "require": { @@ -3646,7 +3832,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.2" + "source": "https://github.com/symfony/string/tree/v6.2.8" }, "funding": [ { @@ -3662,20 +3848,20 @@ "type": "tidelift" } ], - "time": "2022-12-14T16:11:27+00:00" + "time": "2023-03-20T16:06:02+00:00" }, { "name": "symfony/translation", - "version": "v6.2.5", + "version": "v6.2.8", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "60556925a703cfbc1581cde3b3f35b0bb0ea904c" + "reference": "817535dbb1721df8b3a8f2489dc7e50bcd6209b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/60556925a703cfbc1581cde3b3f35b0bb0ea904c", - "reference": "60556925a703cfbc1581cde3b3f35b0bb0ea904c", + "url": "https://api.github.com/repos/symfony/translation/zipball/817535dbb1721df8b3a8f2489dc7e50bcd6209b5", + "reference": "817535dbb1721df8b3a8f2489dc7e50bcd6209b5", "shasum": "" }, "require": { @@ -3744,7 +3930,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.2.5" + "source": "https://github.com/symfony/translation/tree/v6.2.8" }, "funding": [ { @@ -3760,20 +3946,20 @@ "type": "tidelift" } ], - "time": "2023-01-05T07:00:27+00:00" + "time": "2023-03-31T09:14:44+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.2.0", + "version": "v3.2.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "68cce71402305a015f8c1589bfada1280dc64fe7" + "reference": "dfec258b9dd17a6b24420d464c43bffe347441c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/68cce71402305a015f8c1589bfada1280dc64fe7", - "reference": "68cce71402305a015f8c1589bfada1280dc64fe7", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/dfec258b9dd17a6b24420d464c43bffe347441c8", + "reference": "dfec258b9dd17a6b24420d464c43bffe347441c8", "shasum": "" }, "require": { @@ -3825,7 +4011,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.2.1" }, "funding": [ { @@ -3841,20 +4027,20 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2023-03-01T10:32:47+00:00" }, { "name": "symfony/validator", - "version": "v6.2.5", + "version": "v6.2.8", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "0ebfbe384790e61147e3d7f4aa0afbd6190198c4" + "reference": "c63584f84edbdba9d2519f888350dd90615abe35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/0ebfbe384790e61147e3d7f4aa0afbd6190198c4", - "reference": "0ebfbe384790e61147e3d7f4aa0afbd6190198c4", + "url": "https://api.github.com/repos/symfony/validator/zipball/c63584f84edbdba9d2519f888350dd90615abe35", + "reference": "c63584f84edbdba9d2519f888350dd90615abe35", "shasum": "" }, "require": { @@ -3933,7 +4119,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v6.2.5" + "source": "https://github.com/symfony/validator/tree/v6.2.8" }, "funding": [ { @@ -3949,20 +4135,20 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:45:48+00:00" + "time": "2023-03-20T16:06:02+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.2.3", + "version": "v6.2.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "fdbadd4803bc3c96ef89238c9c9e2ebe424ec2e0" + "reference": "d37ab6787be2db993747b6218fcc96e8e3bb4bd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/fdbadd4803bc3c96ef89238c9c9e2ebe424ec2e0", - "reference": "fdbadd4803bc3c96ef89238c9c9e2ebe424ec2e0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d37ab6787be2db993747b6218fcc96e8e3bb4bd0", + "reference": "d37ab6787be2db993747b6218fcc96e8e3bb4bd0", "shasum": "" }, "require": { @@ -4021,7 +4207,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.2.3" + "source": "https://github.com/symfony/var-dumper/tree/v6.2.8" }, "funding": [ { @@ -4037,20 +4223,20 @@ "type": "tidelift" } ], - "time": "2022-12-22T17:55:15+00:00" + "time": "2023-03-29T21:42:15+00:00" }, { "name": "symfony/yaml", - "version": "v6.2.2", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "6ed8243aa5f2cb5a57009f826b5e7fb3c4200cf3" + "reference": "e8e6a1d59e050525f27a1f530aa9703423cb7f57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/6ed8243aa5f2cb5a57009f826b5e7fb3c4200cf3", - "reference": "6ed8243aa5f2cb5a57009f826b5e7fb3c4200cf3", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e8e6a1d59e050525f27a1f530aa9703423cb7f57", + "reference": "e8e6a1d59e050525f27a1f530aa9703423cb7f57", "shasum": "" }, "require": { @@ -4095,7 +4281,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.2.2" + "source": "https://github.com/symfony/yaml/tree/v6.2.7" }, "funding": [ { @@ -4111,20 +4297,20 @@ "type": "tidelift" } ], - "time": "2022-12-14T16:11:27+00:00" + "time": "2023-02-16T09:57:23+00:00" }, { "name": "thecodingmachine/safe", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/thecodingmachine/safe.git", - "reference": "e788f3d09dcd36f806350aedb77eac348fafadd3" + "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/e788f3d09dcd36f806350aedb77eac348fafadd3", - "reference": "e788f3d09dcd36f806350aedb77eac348fafadd3", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0", + "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0", "shasum": "" }, "require": { @@ -4248,22 +4434,22 @@ "description": "PHP core functions that throw exceptions instead of returning FALSE on error", "support": { "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v2.4.0" + "source": "https://github.com/thecodingmachine/safe/tree/v2.5.0" }, - "time": "2022-10-07T14:02:17+00:00" + "time": "2023-04-05T11:54:14+00:00" }, { "name": "twig/twig", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3ffcf4b7d890770466da3b2666f82ac054e7ec72" + "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3ffcf4b7d890770466da3b2666f82ac054e7ec72", - "reference": "3ffcf4b7d890770466da3b2666f82ac054e7ec72", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/a6e0510cc793912b451fd40ab983a1d28f611c15", + "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15", "shasum": "" }, "require": { @@ -4314,7 +4500,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.5.0" + "source": "https://github.com/twigphp/Twig/tree/v3.5.1" }, "funding": [ { @@ -4326,57 +4512,7 @@ "type": "tidelift" } ], - "time": "2022-12-27T12:28:18+00:00" - }, - { - "name": "ulrichsg/getopt-php", - "version": "v3.4.0", - "source": { - "type": "git", - "url": "https://github.com/getopt-php/getopt-php.git", - "reference": "9121d7c2c51a6a59ee407c49a13b4d8cfae71075" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/getopt-php/getopt-php/zipball/9121d7c2c51a6a59ee407c49a13b4d8cfae71075", - "reference": "9121d7c2c51a6a59ee407c49a13b4d8cfae71075", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8", - "squizlabs/php_codesniffer": "^2.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "GetOpt\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ulrich Schmidt-Goertz", - "email": "ulrich@schmidt-goertz.de" - }, - { - "name": "Thomas Flori", - "email": "thflori@gmail.com" - } - ], - "description": "Command line arguments parser for PHP 5.4 - 7.3", - "homepage": "http://getopt-php.github.io/getopt-php", - "support": { - "issues": "https://github.com/getopt-php/getopt-php/issues", - "source": "https://github.com/getopt-php/getopt-php/tree/v3.4.0" - }, - "time": "2020-07-14T06:09:04+00:00" + "time": "2023-02-08T07:49:20+00:00" }, { "name": "voku/portable-ascii", @@ -4584,16 +4720,16 @@ }, { "name": "filp/whoops", - "version": "2.15.1", + "version": "2.15.2", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "e864ac957acd66e1565f25efda61e37791a5db0b" + "reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/e864ac957acd66e1565f25efda61e37791a5db0b", - "reference": "e864ac957acd66e1565f25efda61e37791a5db0b", + "url": "https://api.github.com/repos/filp/whoops/zipball/aac9304c5ed61bf7b1b7a6064bf9806ab842ce73", + "reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73", "shasum": "" }, "require": { @@ -4643,7 +4779,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.15.1" + "source": "https://github.com/filp/whoops/tree/2.15.2" }, "funding": [ { @@ -4651,7 +4787,7 @@ "type": "github" } ], - "time": "2023-03-06T18:09:13+00:00" + "time": "2023-04-12T12:00:00+00:00" }, { "name": "myclabs/deep-copy", @@ -4802,23 +4938,23 @@ }, { "name": "pestphp/pest", - "version": "v1.22.5", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "a1a0f049cddb7da097e7450e1a80da4d1a59571e" + "reference": "061c9de301531e500a8157b476a5899361e60068" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/a1a0f049cddb7da097e7450e1a80da4d1a59571e", - "reference": "a1a0f049cddb7da097e7450e1a80da4d1a59571e", + "url": "https://api.github.com/repos/pestphp/pest/zipball/061c9de301531e500a8157b476a5899361e60068", + "reference": "061c9de301531e500a8157b476a5899361e60068", "shasum": "" }, "require": { - "nunomaduro/collision": "^5.11.0|^6.3.0", + "nunomaduro/collision": "^5.11.0|^6.4.0", "pestphp/pest-plugin": "^1.1.0", "php": "^7.3 || ^8.0", - "phpunit/phpunit": "^9.6.4" + "phpunit/phpunit": "^9.6.7" }, "require-dev": { "illuminate/console": "^8.83.27", @@ -4879,35 +5015,19 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v1.22.5" + "source": "https://github.com/pestphp/pest/tree/v1.23.0" }, "funding": [ { "url": "https://www.paypal.com/paypalme/enunomaduro", "type": "custom" }, - { - "url": "https://github.com/lukeraymonddowning", - "type": "github" - }, { "url": "https://github.com/nunomaduro", "type": "github" - }, - { - "url": "https://github.com/olivernybroe", - "type": "github" - }, - { - "url": "https://github.com/owenvoke", - "type": "github" - }, - { - "url": "https://www.patreon.com/nunomaduro", - "type": "patreon" } ], - "time": "2023-03-03T10:16:59+00:00" + "time": "2023-04-19T20:10:22+00:00" }, { "name": "pestphp/pest-plugin", @@ -5094,16 +5214,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.14", + "version": "1.10.14", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58" + "reference": "d232901b09e67538e5c86a724be841bea5768a7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d232901b09e67538e5c86a724be841bea5768a7c", + "reference": "d232901b09e67538e5c86a724be841bea5768a7c", "shasum": "" }, "require": { @@ -5132,8 +5252,11 @@ "static analysis" ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.14" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -5149,7 +5272,7 @@ "type": "tidelift" } ], - "time": "2023-01-19T10:47:09+00:00" + "time": "2023-04-19T13:47:27+00:00" }, { "name": "phpunit/php-code-coverage", @@ -5471,16 +5594,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.5", + "version": "9.6.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5" + "reference": "c993f0d3b0489ffc42ee2fe0bd645af1538a63b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5", - "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c993f0d3b0489ffc42ee2fe0bd645af1538a63b2", + "reference": "c993f0d3b0489ffc42ee2fe0bd645af1538a63b2", "shasum": "" }, "require": { @@ -5553,7 +5676,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.5" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.7" }, "funding": [ { @@ -5569,7 +5693,7 @@ "type": "tidelift" } ], - "time": "2023-03-09T06:34:10+00:00" + "time": "2023-04-14T08:58:40+00:00" }, { "name": "sebastian/cli-parser", diff --git a/src/Command/GenerateCommand.php b/src/Command/GenerateCommand.php new file mode 100644 index 0000000..a401154 --- /dev/null +++ b/src/Command/GenerateCommand.php @@ -0,0 +1,236 @@ +info("Building configuration for {$configurationData['name']}."); + + // Convert the input to a configuration data object. + $normalizer = new ObjectNormalizer(null, new CamelCaseToSnakeCaseNameConverter()); + $serializer = new Serializer([$normalizer], [new JsonEncoder()]); + $configurationDataObject = $serializer->deserialize(json_encode($configurationData), ConfigurationData::class, 'json'); + + $validator = Validation::createValidatorBuilder()->enableAnnotationMapping()->getValidator(); + $violations = $validator->validate($configurationDataObject); + + if (0 < $violations->count()) { + $io->error('Configuration is invalid.'); + + $io->listing( + collect($violations) + ->map(fn (ConstraintViolationInterface $v) => "{$v->getPropertyPath()} - {$v->getMessage()}") + ->toArray() + ); + + return; + } + + if (isset($configurationData['docker-compose'])) { + $configurationData['dockerCompose'] = $configurationData['docker-compose']; + $configurationData['docker-compose'] = null; + } + + $configurationData['managedText'] = 'Do not edit this file. It is automatically generated by \'build-configs\'.'; + + $filesToGenerate = $this->getFiles(configurationData: $configurationData); + + $io->write('Generated files:'); + $io->listing($this->getListOfFiles(filesToGenerate: $filesToGenerate)->toArray()); + + $this->generateFiles( + configurationData: $configurationData, + filesToGenerate: $filesToGenerate, + outputDir: $outputDir, + ); + } + + /** + * @param array $configurationData + * @param Collection $filesToGenerate + */ + private function generateFiles( + Collection $filesToGenerate, + string $outputDir, + array $configurationData, + ): void + { + $filesystem = new Filesystem(); + $twig = new Environment(new FilesystemLoader([__DIR__ . '/../../templates'])); + + $filesToGenerate->each(function(TemplateFile $templateFile) use ($configurationData, $filesystem, $outputDir, $twig): void { + if ($templateFile->path !== null) { + if (!$filesystem->exists($templateFile->path)) { + $filesystem->mkdir("{$outputDir}/{$templateFile->path}"); + } + } + + $sourceFile = "{$templateFile->data}.twig"; + $outputFile = collect([ + $outputDir, + $templateFile->path, + $templateFile->name, + ])->filter()->implode('/'); + + $filesystem->dumpFile($outputFile, $twig->render($sourceFile, $configurationData)); + }); + + // If the Docker entrypoint file is generated, ensure it is executable. + if ($filesystem->exists("{$outputDir}/tools/docker/images/php/root/usr/local/bin/docker-entrypoint-php")) { + $filesystem->chmod("{$outputDir}/tools/docker/images/php/root/usr/local/bin/docker-entrypoint-php", 0755); + } + } + + private function getFiles(array $configurationData): Collection + { + /** @var Collection */ + $filesToGenerate = collect([ + new TemplateFile(data: 'common/.dockerignore', name: '.dockerignore'), + new TemplateFile(data: 'common/.hadolint.yaml', name: '.hadolint.yaml'), + new TemplateFile(data: 'env.example', name: '.env.example'), + ]); + + $extraDatabases = Arr::get($configurationData, 'database.extra_databases', []); + if (count($extraDatabases) > 0) { + $filesToGenerate[] = new TemplateFile( + data: 'extra-databases.sql', + name: 'extra-databases.sql', + path: 'tools/docker/images/database/root/docker-entrypoint-initdb.d', + ); + } + + if (false !== Arr::get($configurationData, "justfile", true)) { + $filesToGenerate[] = new TemplateFile(data: 'justfile', name: 'justfile'); + } + + if (isset($configurationData['dockerCompose']) && $configurationData['dockerCompose'] !== null) { + $filesToGenerate[] = new TemplateFile(data: 'docker-compose.yaml', name: 'docker-compose.yaml'); + } + + if (static::isPhp(Arr::get($configurationData, 'language'))) { + $filesToGenerate[] = new TemplateFile(data: 'php/Dockerfile', name: 'Dockerfile'); + $filesToGenerate[] = new TemplateFile(data: 'php/phpcs.xml', name: 'phpcs.xml.dist'); + $filesToGenerate[] = new TemplateFile(data: 'php/phpunit.xml', name: 'phpunit.xml.dist'); + $filesToGenerate[] = new TemplateFile( + data: 'php/docker-entrypoint-php', + name: 'docker-entrypoint-php', + path: 'tools/docker/images/php/root/usr/local/bin', + ); + + if (Arr::has(array: $configurationData, keys: 'php.phpstan')) { + $filesToGenerate[] = new TemplateFile(data: 'php/phpstan.neon', name: 'phpstan.neon.dist'); + } + } + + if (static::isNode(Arr::get($configurationData, 'language'))) { + $filesToGenerate[] = new TemplateFile(data: 'node/.yarnrc', name: '.yarnrc'); + $filesToGenerate[] = new TemplateFile(data: 'node/Dockerfile', name: 'Dockerfile'); + } + + if (static::isCaddy(Arr::get($configurationData, 'web.type'))) { + $filesToGenerate[] = new TemplateFile( + data: 'web/caddy/Caddyfile', + name: 'Caddyfile', + path: 'tools/docker/images/web/root/etc/caddy', + ); + } + + if (static::isNginx(Arr::get($configurationData, 'web.type'))) { + $filesToGenerate[] = new TemplateFile( + data: 'web/nginx/default.conf', + name: 'default.conf', + path: 'tools/docker/images/web/root/etc/nginx/conf.d', + ); + } + + if ('drupal-project' === Arr::get($configurationData, 'type')) { + // Add a Drupal version of phpunit.xml.dist. + $filesToGenerate[] = new TemplateFile(data: 'drupal-project/phpunit.xml.dist', name: 'phpunit.xml.dist'); + } + + if (Arr::get($configurationData, 'experimental.createGitHubActionsConfiguration', false) === true) { + $filesToGenerate[] = new TemplateFile( + data: 'ci/github-actions/ci.yml', + name: 'ci.yml', + path: '.github/workflows', + ); + } + + return $filesToGenerate; + } + + private function getListOfFiles(Collection $filesToGenerate): Collection + { + return $filesToGenerate + ->map(fn (TemplateFile $templateFile): string => + collect([$templateFile->path, $templateFile->name])->filter()->implode('/')) + ->unique() + ->sort(); + } + + private static function isCaddy(?string $webServer): bool + { + if (is_null($webServer)) { + return false; + } + + return strtoupper($webServer) === WebServer::CADDY->name; + } + + private static function isNginx(?string $webServer): bool + { + if (is_null($webServer)) { + return false; + } + + return strtoupper($webServer) === WebServer::NGINX->name; + } + + private static function isNode(?string $language): bool + { + if (is_null($language)) { + return false; + } + + return strtoupper($language) === Language::NODE->name; + } + + private static function isPhp(?string $language): bool + { + if (is_null($language)) { + return false; + } + + return strtoupper($language) === Language::PHP->name; + } +} diff --git a/src/Command/InitCommand.php b/src/Command/InitCommand.php new file mode 100644 index 0000000..65560cd --- /dev/null +++ b/src/Command/InitCommand.php @@ -0,0 +1,25 @@ +