From fef704997e959df50267a9ea7cf756b9f7d58d76 Mon Sep 17 00:00:00 2001 From: TavoNiievez Date: Tue, 16 Jan 2024 15:14:49 -0500 Subject: [PATCH] Sync with latest Symfony version --- .env | 5 +- .env.test | 4 +- .github/workflows/symfony.yml | 4 +- codeception.yml | 11 +- composer.json | 30 +- composer.lock | 289 +++++----- config/bundles.php | 2 +- config/packages/dev/debug.php | 3 +- config/packages/dev/framework.php | 5 +- config/packages/dev/web_profiler.php | 6 +- config/packages/doctrine.php | 44 +- config/packages/framework.php | 36 +- config/packages/prod/doctrine.php | 29 +- config/packages/prod/framework.php | 12 +- config/packages/security.php | 47 +- config/packages/test/doctrine.php | 8 +- config/packages/test/framework.php | 11 +- config/packages/test/twig.php | 3 +- config/packages/test/web_profiler.php | 6 +- config/packages/twig.php | 6 +- config/routes.php | 5 +- config/routes/dev/framework.php | 1 - config/routes/dev/web_profiler.php | 2 - config/services.php | 17 +- config/services_test.php | 5 +- phpcs.xml.dist | 8 +- psalm.xml | 15 - public/.htaccess | 4 +- rector.php | 61 ++- resources/views/blog/home.html.twig | 2 +- resources/views/dashboard/index.html.twig | 2 +- resources/views/layout.html.twig | 2 +- src/Command/ExampleCommand.php | 1 + src/Controller/RegistrationController.php | 17 +- src/Controller/SecurityController.php | 8 +- src/Doctrine/UserHashPasswordListener.php | 5 +- src/Entity/User.php | 27 +- src/Event/UserRegisteredEvent.php | 4 +- .../Model/UserRepositoryInterface.php | 2 - src/Security/SecurityAuthenticator.php | 5 +- src/Utils/Mailer.php | 5 +- symfony.lock | 510 ++---------------- tests/Functional.suite.yml | 10 +- tests/Functional/BrowserCest.php | 2 +- tests/Functional/ConsoleCest.php | 2 +- tests/Functional/DoctrineCest.php | 2 +- tests/Functional/EventsCest.php | 2 +- tests/Functional/FormCest.php | 2 +- tests/Functional/IssuesCest.php | 2 +- tests/Functional/MailerCest.php | 2 +- tests/Functional/MimeCest.php | 2 +- tests/Functional/ParameterCest.php | 6 +- tests/Functional/RouterCest.php | 2 +- tests/Functional/SecurityCest.php | 2 +- tests/Functional/ServicesCest.php | 4 +- tests/Functional/SessionCest.php | 2 +- tests/Functional/TimeCest.php | 2 +- tests/Functional/TwigCest.php | 2 +- tests/_build/data/.gitignore | 0 tests/_build/output/.gitignore | 2 - tests/_build/support/FunctionalTester.php | 12 - tests/_build/support/Helper/Functional.php | 10 - tests/_build/support/Page/.gitignore | 0 tests/_build/support/Utils/.gitignore | 0 tests/_build/support/_generated/.gitignore | 2 - 65 files changed, 405 insertions(+), 936 deletions(-) delete mode 100644 psalm.xml delete mode 100644 tests/_build/data/.gitignore delete mode 100644 tests/_build/output/.gitignore delete mode 100644 tests/_build/support/FunctionalTester.php delete mode 100644 tests/_build/support/Helper/Functional.php delete mode 100644 tests/_build/support/Page/.gitignore delete mode 100644 tests/_build/support/Utils/.gitignore delete mode 100644 tests/_build/support/_generated/.gitignore diff --git a/.env b/.env index 460d1b8..46b026c 100644 --- a/.env +++ b/.env @@ -1,11 +1,10 @@ ###> symfony/framework-bundle ### APP_ENV=dev -APP_SECRET=ad5e9ed11ff896949f234ec07bc075bf +APP_SECRET=c39972d23278f52101c810eea7d5a512 ###< symfony/framework-bundle ### ###> app ### -BUSINESS_SHORTNAME= -BUSINESS_FULLNAME= +BUSINESS_NAME=Codeception ###< app ### ###> doctrine/doctrine-bundle ### diff --git a/.env.test b/.env.test index 286a33a..3f898bf 100644 --- a/.env.test +++ b/.env.test @@ -2,5 +2,5 @@ APP_ENV=test APP_SECRET='$ecretf0rt3st' DATABASE_URL=sqlite:///%kernel.project_dir%/var/test.db3 KERNEL_CLASS='App\Kernel' -SYMFONY_DEPRECATIONS_HELPER=999999 -MAILER_DSN=null://null \ No newline at end of file +MAILER_DSN=null://null +SYMFONY_DEPRECATIONS_HELPER=999999 \ No newline at end of file diff --git a/.github/workflows/symfony.yml b/.github/workflows/symfony.yml index 9e5f925..496eac4 100644 --- a/.github/workflows/symfony.yml +++ b/.github/workflows/symfony.yml @@ -50,10 +50,10 @@ jobs: run: composer install --no-progress - name: Update database schema - run: php bin/console d:s:u -f + run: php bin/console doctrine:schema:update --force - name: Load Doctrine fixtures - run: php bin/console d:f:l -q + run: php bin/console doctrine:fixtures:load --quiet - name: Run functional tests run: vendor/bin/codecept run Functional diff --git a/codeception.yml b/codeception.yml index c46f46a..8b422dc 100644 --- a/codeception.yml +++ b/codeception.yml @@ -1,10 +1,11 @@ namespace: App\Tests +support_namespace: Support paths: tests: tests - support: tests/_build/support - data: tests/_build/data - envs: tests/_build/envs - output: tests/_build/output + output: tests/_output + data: tests/Support/Data + support: tests/Support + envs: tests/_envs actor_suffix: Tester extensions: enabled: @@ -15,4 +16,4 @@ params: settings: shuffle: true colors: true - report_useless_tests: true \ No newline at end of file + report_useless_tests: true diff --git a/composer.json b/composer.json index 097ac42..a3ae8b4 100644 --- a/composer.json +++ b/composer.json @@ -14,12 +14,11 @@ "php": ">=8.1.0", "ext-ctype": "*", "ext-iconv": "*", - "doctrine/annotations": "^2.0", - "doctrine/doctrine-bundle": "^2.6", + "doctrine/doctrine-bundle": "^2.11", "symfony/apache-pack": "^1.0", "symfony/console": "6.4.*", "symfony/dotenv": "6.4.*", - "symfony/flex": "^2.1", + "symfony/flex": "^2.4", "symfony/form": "6.4.*", "symfony/framework-bundle": "6.4.*", "symfony/mailer": "6.4.*", @@ -30,27 +29,27 @@ "symfony/yaml": "6.4.*" }, "require-dev": { - "codeception/codeception": "^5.0.0", + "codeception/codeception": "^5.0.8", "codeception/module-asserts": "^3.0", "codeception/module-doctrine2": "^3.0", "codeception/module-phpbrowser": "^3.0", - "codeception/module-symfony": "^3.0 | *@dev", - "doctrine/doctrine-fixtures-bundle": "^3.4.2", - "friendsofphp/php-cs-fixer": "^3.3", - "phpmd/phpmd": "^2.11", + "codeception/module-symfony": "^3.2 | *@dev", + "doctrine/doctrine-fixtures-bundle": "^3.5", + "friendsofphp/php-cs-fixer": "^3.46", + "phpmd/phpmd": "^2.15", + "phpstan/phpdoc-parser": "^1.25", "phpunit/phpunit": "^10.0", - "rector/rector": "^0.12.5", - "squizlabs/php_codesniffer": "^3.6", + "rector/rector": "^0.18.13", + "squizlabs/php_codesniffer": "^3.8", "symfony/debug-bundle": "6.4.*", - "symfony/maker-bundle": "^1.41", + "symfony/maker-bundle": "^1.52", "symfony/twig-bundle": "6.4.*", "symfony/var-dumper": "6.4.*", "symfony/web-profiler-bundle": "6.4.*", - "vlucas/phpdotenv": "^5.4" + "vlucas/phpdotenv": "^5.6" }, "config": { "allow-plugins": { - "composer/package-versions-deprecated": true, "php-http/discovery": true, "symfony/flex": true, "symfony/runtime": true @@ -70,9 +69,6 @@ } }, "autoload-dev": { - "classmap": [ - "tests/_build/support" - ], "psr-4": { "App\\Tests\\": "tests/" } @@ -97,8 +93,6 @@ "@psalm" ], "test": "vendor/bin/codecept run --colors", - "psalm": "vendor/bin/psalm --no-cache", - "rector": "vendor/bin/rector process src -c rector.php --no-progress-bar -n", "post-install-cmd": [ "@auto-scripts" ], diff --git a/composer.lock b/composer.lock index ae69aa6..4df75d5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,84 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9987bf0f57fa0d143655d32f2a1997fc", + "content-hash": "ccedca2df37ce03dea7fdd6d0c901bbb", "packages": [ - { - "name": "doctrine/annotations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^2 || ^3", - "ext-tokenizer": "*", - "php": "^7.2 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^2.0", - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/2.0.1" - }, - "time": "2023-02-02T22:02:53+00:00" - }, { "name": "doctrine/cache", "version": "2.2.0", @@ -5164,16 +5088,16 @@ }, { "name": "codeception/lib-web", - "version": "1.0.4", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/Codeception/lib-web.git", - "reference": "28cb2ed1169de18e720bec758015aadc37d8344c" + "reference": "cea9d53c9cd665498632acc417c9a96bff7eb2b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/lib-web/zipball/28cb2ed1169de18e720bec758015aadc37d8344c", - "reference": "28cb2ed1169de18e720bec758015aadc37d8344c", + "url": "https://api.github.com/repos/Codeception/lib-web/zipball/cea9d53c9cd665498632acc417c9a96bff7eb2b0", + "reference": "cea9d53c9cd665498632acc417c9a96bff7eb2b0", "shasum": "" }, "require": { @@ -5211,9 +5135,9 @@ ], "support": { "issues": "https://github.com/Codeception/lib-web/issues", - "source": "https://github.com/Codeception/lib-web/tree/1.0.4" + "source": "https://github.com/Codeception/lib-web/tree/1.0.5" }, - "time": "2023-12-01T11:38:22+00:00" + "time": "2024-01-13T11:54:18+00:00" }, { "name": "codeception/module-asserts", @@ -5405,47 +5329,47 @@ "source": { "type": "git", "url": "https://github.com/Codeception/module-symfony.git", - "reference": "5798e3e6328d20e9c41a5d1680f245e9881a4a43" + "reference": "be24b2b64759e5b4dd83ca091ecfe49c26cecc5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-symfony/zipball/5798e3e6328d20e9c41a5d1680f245e9881a4a43", - "reference": "5798e3e6328d20e9c41a5d1680f245e9881a4a43", + "url": "https://api.github.com/repos/Codeception/module-symfony/zipball/be24b2b64759e5b4dd83ca091ecfe49c26cecc5c", + "reference": "be24b2b64759e5b4dd83ca091ecfe49c26cecc5c", "shasum": "" }, "require": { "codeception/codeception": "^5.0.8", "codeception/lib-innerbrowser": "^3.1.1 | ^4.0", "ext-json": "*", - "php": "^8.0" + "php": "^8.1" }, "require-dev": { "codeception/module-asserts": "^3.0", "codeception/module-doctrine2": "^3.0", "doctrine/orm": "^2.10", - "symfony/browser-kit": "^4.4 | ^5.0 | ^6.0", - "symfony/cache": "^4.4 | ^5.0 | ^6.0", - "symfony/config": "^4.4 | ^5.0 | ^6.0", - "symfony/dependency-injection": "^4.4 | ^5.0 | ^6.0", - "symfony/dom-crawler": "^4.4 | ^5.0 | ^6.0", - "symfony/error-handler": "^4.4 | ^5.0 | ^6.0", - "symfony/filesystem": "^4.4 | ^5.0 | ^6.0", - "symfony/form": "^4.4 | ^5.0 | ^6.0", - "symfony/framework-bundle": "^4.4 | ^5.0 | ^6.0", - "symfony/http-foundation": "^4.4 | ^5.0 | ^6.0", - "symfony/http-kernel": "^4.4 | ^5.0 | ^6.0", - "symfony/mailer": "^4.4 | ^5.0 | ^6.0", - "symfony/mime": "^4.4 | ^5.0 | ^6.0", - "symfony/options-resolver": "^4.4 | ^5.0 | ^6.0", - "symfony/property-access": "^4.4 | ^5.0 | ^6.0", - "symfony/property-info": "^4.4 | ^5.0 | ^6.0", - "symfony/routing": "^4.4 | ^5.0 | ^6.0", - "symfony/security-bundle": "^4.4 | ^5.0 | ^6.0", - "symfony/security-core": "^4.4 | ^5.0 | ^6.0", - "symfony/security-csrf": "^4.4 | ^5.0 | ^6.0", - "symfony/security-http": "^4.4 | ^5.0 | ^6.0", - "symfony/twig-bundle": "^4.4 | ^5.0 | ^6.0", - "symfony/var-exporter": "^4.4 | ^5.0 | ^6.0", + "symfony/browser-kit": "^5.4 | ^6.4 | ^7.0", + "symfony/cache": "^5.4 | ^6.4 | ^7.0", + "symfony/config": "^5.4 | ^6.4 | ^7.0", + "symfony/dependency-injection": "^5.4 | ^6.4 | ^7.0", + "symfony/dom-crawler": "^5.4 | ^6.4 | ^7.0", + "symfony/error-handler": "^5.4 | ^6.4 | ^7.0", + "symfony/filesystem": "^5.4 | ^6.4 | ^7.0", + "symfony/form": "^5.4 | ^6.4 | ^7.0", + "symfony/framework-bundle": "^5.4 | ^6.4 | ^7.0", + "symfony/http-foundation": "^5.4 | ^6.4 | ^7.0", + "symfony/http-kernel": "^5.4 | ^6.4 | ^7.0", + "symfony/mailer": "^5.4 | ^6.4 | ^7.0", + "symfony/mime": "^5.4 | ^6.4 | ^7.0", + "symfony/options-resolver": "^5.4 | ^6.4 | ^7.0", + "symfony/property-access": "^5.4 | ^6.4 | ^7.0", + "symfony/property-info": "^5.4 | ^6.4 | ^7.0", + "symfony/routing": "^5.4 | ^6.4 | ^7.0", + "symfony/security-bundle": "^5.4 | ^6.4 | ^7.0", + "symfony/security-core": "^5.4 | ^6.4 | ^7.0", + "symfony/security-csrf": "^5.4 | ^6.4 | ^7.0", + "symfony/security-http": "^5.4 | ^6.4 | ^7.0", + "symfony/twig-bundle": "^5.4 | ^6.4 | ^7.0", + "symfony/var-exporter": "^5.4 | ^6.4 | ^7.0", "vlucas/phpdotenv": "^4.2 | ^5.4" }, "suggest": { @@ -5480,9 +5404,9 @@ ], "support": { "issues": "https://github.com/Codeception/module-symfony/issues", - "source": "https://github.com/Codeception/module-symfony/tree/3.2.0" + "source": "https://github.com/Codeception/module-symfony/tree/3.3.0" }, - "time": "2024-01-02T03:05:57+00:00" + "time": "2024-01-11T05:45:50+00:00" }, { "name": "codeception/stub", @@ -6093,16 +6017,16 @@ }, { "name": "doctrine/inflector", - "version": "2.0.8", + "version": "2.0.9", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff" + "reference": "2930cd5ef353871c821d5c43ed030d39ac8cfe65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/f9301a5b2fb1216b2b08f02ba04dc45423db6bff", - "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/2930cd5ef353871c821d5c43ed030d39ac8cfe65", + "reference": "2930cd5ef353871c821d5c43ed030d39ac8cfe65", "shasum": "" }, "require": { @@ -6164,7 +6088,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.8" + "source": "https://github.com/doctrine/inflector/tree/2.0.9" }, "funding": [ { @@ -6180,7 +6104,7 @@ "type": "tidelift" } ], - "time": "2023-06-16T13:40:37+00:00" + "time": "2024-01-15T18:05:13+00:00" }, { "name": "doctrine/instantiator", @@ -6355,16 +6279,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.46.0", + "version": "v3.47.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "be6831c9af1740470d2a773119b9273f8ac1c3d2" + "reference": "173c60d1eff911c9c54322704623a45561d3241d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/be6831c9af1740470d2a773119b9273f8ac1c3d2", - "reference": "be6831c9af1740470d2a773119b9273f8ac1c3d2", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/173c60d1eff911c9c54322704623a45561d3241d", + "reference": "173c60d1eff911c9c54322704623a45561d3241d", "shasum": "" }, "require": { @@ -6434,7 +6358,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.46.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.47.1" }, "funding": [ { @@ -6442,7 +6366,7 @@ "type": "github" } ], - "time": "2024-01-03T21:38:46+00:00" + "time": "2024-01-16T18:54:21+00:00" }, { "name": "graham-campbell/result-type", @@ -7345,18 +7269,65 @@ ], "time": "2023-11-12T21:59:55+00:00" }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.25.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bd84b629c8de41aa2ae82c067c955e06f1b00240", + "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "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.25.0" + }, + "time": "2024-01-04T17:06:16+00:00" + }, { "name": "phpstan/phpstan", - "version": "1.10.54", + "version": "1.10.56", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "3e25f279dada0adc14ffd7bad09af2e2fc3523bb" + "reference": "27816a01aea996191ee14d010f325434c0ee76fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3e25f279dada0adc14ffd7bad09af2e2fc3523bb", - "reference": "3e25f279dada0adc14ffd7bad09af2e2fc3523bb", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/27816a01aea996191ee14d010f325434c0ee76fa", + "reference": "27816a01aea996191ee14d010f325434c0ee76fa", "shasum": "" }, "require": { @@ -7405,7 +7376,7 @@ "type": "tidelift" } ], - "time": "2024-01-05T15:50:47+00:00" + "time": "2024-01-15T10:43:00+00:00" }, { "name": "phpunit/php-code-coverage", @@ -7730,16 +7701,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.5", + "version": "10.5.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856" + "reference": "e5c5b397a95cb0db013270a985726fcae93e61b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ed21115d505b4b4f7dc7b5651464e19a2c7f7856", - "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e5c5b397a95cb0db013270a985726fcae93e61b8", + "reference": "e5c5b397a95cb0db013270a985726fcae93e61b8", "shasum": "" }, "require": { @@ -7811,7 +7782,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.7" }, "funding": [ { @@ -7827,7 +7798,7 @@ "type": "tidelift" } ], - "time": "2023-12-27T15:13:52+00:00" + "time": "2024-01-14T16:40:30+00:00" }, { "name": "psr/http-client", @@ -8114,42 +8085,32 @@ }, { "name": "rector/rector", - "version": "0.12.23", + "version": "0.18.13", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "690b31768b322db886b35845f8452025eba2cacb" + "reference": "f8011a76d36aa4f839f60f3b4f97707d97176618" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/690b31768b322db886b35845f8452025eba2cacb", - "reference": "690b31768b322db886b35845f8452025eba2cacb", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/f8011a76d36aa4f839f60f3b4f97707d97176618", + "reference": "f8011a76d36aa4f839f60f3b4f97707d97176618", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.6" + "phpstan/phpstan": "^1.10.35" }, "conflict": { - "phpstan/phpdoc-parser": "<1.2", - "rector/rector-cakephp": "*", "rector/rector-doctrine": "*", - "rector/rector-laravel": "*", - "rector/rector-nette": "*", - "rector/rector-phpoffice": "*", + "rector/rector-downgrade-php": "*", "rector/rector-phpunit": "*", - "rector/rector-prefixed": "*", "rector/rector-symfony": "*" }, "bin": [ "bin/rector" ], "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.12-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -8160,9 +8121,15 @@ "MIT" ], "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.12.23" + "source": "https://github.com/rectorphp/rector/tree/0.18.13" }, "funding": [ { @@ -8170,7 +8137,7 @@ "type": "github" } ], - "time": "2022-05-01T15:50:16+00:00" + "time": "2023-12-20T16:08:01+00:00" }, { "name": "sebastian/cli-parser", @@ -9089,16 +9056,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7", + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7", "shasum": "" }, "require": { @@ -9108,11 +9075,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -9165,7 +9132,7 @@ "type": "open_collective" } ], - "time": "2023-12-08T12:32:31+00:00" + "time": "2024-01-11T20:47:48+00:00" }, { "name": "symfony/browser-kit", diff --git a/config/bundles.php b/config/bundles.php index edb66e2..417f6fe 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -5,8 +5,8 @@ Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true], + Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], - Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], ]; diff --git a/config/packages/dev/debug.php b/config/packages/dev/debug.php index ff1d38a..a553b5a 100644 --- a/config/packages/dev/debug.php +++ b/config/packages/dev/debug.php @@ -4,7 +4,6 @@ use Symfony\Config\DebugConfig; -return static function (DebugConfig $debug): void -{ +return static function (DebugConfig $debug): void { $debug->dumpDestination('tcp://%env(VAR_DUMPER_SERVER)%'); }; diff --git a/config/packages/dev/framework.php b/config/packages/dev/framework.php index c5884f8..e5d6b58 100644 --- a/config/packages/dev/framework.php +++ b/config/packages/dev/framework.php @@ -4,10 +4,9 @@ use Symfony\Config\FrameworkConfig; -return static function (FrameworkConfig $framework): void -{ +return static function (FrameworkConfig $framework): void { // Web Profiler $framework->profiler([ - 'only_exceptions' => false + 'only_exceptions' => false, ]); }; diff --git a/config/packages/dev/web_profiler.php b/config/packages/dev/web_profiler.php index fb0d9db..96873b6 100644 --- a/config/packages/dev/web_profiler.php +++ b/config/packages/dev/web_profiler.php @@ -4,10 +4,8 @@ use Symfony\Config\WebProfilerConfig; -return static function (WebProfilerConfig $webProfiler): void -{ +return static function (WebProfilerConfig $webProfiler): void { $webProfiler ->toolbar(true) - ->interceptRedirects(false) - ; + ->interceptRedirects(false); }; diff --git a/config/packages/doctrine.php b/config/packages/doctrine.php index e045520..10cabe4 100644 --- a/config/packages/doctrine.php +++ b/config/packages/doctrine.php @@ -4,26 +4,28 @@ use Symfony\Config\DoctrineConfig; -return static function (DoctrineConfig $doctrine): void -{ - $doctrineDbal = $doctrine->dbal(); - $doctrineDbal->connection('default', [ - 'url' => '%env(resolve:DATABASE_URL)%' - ]); - +return static function (DoctrineConfig $doctrine): void { $doctrineOrm = $doctrine->orm(); - $doctrineOrm->autoGenerateProxyClasses(true); - $doctrineOrm->entityManager('default', [ - 'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware', - 'auto_mapping' => true, - 'mappings' => [ - 'App' => [ - 'is_bundle' => false, - 'type' => 'annotation', - 'dir' => '%kernel.project_dir%/src/Entity', - 'prefix' => 'App\Entity', - 'alias' => 'App' - ] - ] - ]); + $defaultEm = $doctrineOrm->entityManager('default'); + $defaultConnection = $doctrine->dbal()->connection('default'); + + $defaultConnection + ->url('%env(resolve:DATABASE_URL)%') + ->profilingCollectBacktrace('%kernel.debug%'); + + $doctrineOrm + ->autoGenerateProxyClasses(true) + ->enableLazyGhostObjects(true); + $defaultEm + ->autoMapping(true) + ->namingStrategy('doctrine.orm.naming_strategy.underscore_number_aware') + ->reportFieldsWhereDeclared(true) + ->validateXmlMapping(true) + ->mapping('App', [ + 'alias' => 'App', + 'dir' => '%kernel.project_dir%/src/Entity', + 'is_bundle' => false, + 'prefix' => 'App\Entity', + 'type' => 'attribute', + ]); }; diff --git a/config/packages/framework.php b/config/packages/framework.php index 9a37ce0..9d3ccc7 100644 --- a/config/packages/framework.php +++ b/config/packages/framework.php @@ -4,39 +4,33 @@ use Symfony\Config\FrameworkConfig; -return static function (FrameworkConfig $framework): void -{ +return static function (FrameworkConfig $framework): void { // Cache $framework->cache(); // Framework $framework->secret('%env(APP_SECRET)%'); $framework->httpMethodOverride(false); - $framework->session([ - 'cookie_secure' => 'auto', - 'cookie_samesite' => 'lax', - 'storage_factory_id' => 'session.storage.factory.native' - ])->handlerId(null); - $framework->phpErrors([ - 'log' => true - ]); + $framework->session() + ->handlerId(null) + ->cookieSecure('auto') + ->cookieSamesite('lax'); + $framework->phpErrors() + ->log(); // Mailer - $framework->mailer([ - 'dsn' => '%env(MAILER_DSN)%' - ]); + $framework->mailer() + ->dsn('%env(MAILER_DSN)%'); // Routing - $framework->router([ - 'utf8' => true - ]); + $framework->router() + ->utf8(true); // Translation - $framework->defaultLocale('%locale%'); - $framework->translator([ - 'default_path' => '%kernel.project_dir%/resources/lang', - 'fallbacks' => ['%locale%'] - ]); + $framework->defaultLocale('en'); + $framework->translator() + ->defaultPath('%kernel.project_dir%/resources/lang') + ->fallbacks('en'); // Validator $framework->validation([ diff --git a/config/packages/prod/doctrine.php b/config/packages/prod/doctrine.php index 2f47fb4..0d1dd2e 100644 --- a/config/packages/prod/doctrine.php +++ b/config/packages/prod/doctrine.php @@ -4,22 +4,17 @@ use Symfony\Config\DoctrineConfig; -return static function (DoctrineConfig $doctrine): void -{ +return static function (DoctrineConfig $doctrine): void { $doctrineOrm = $doctrine->orm(); - $doctrineOrm->autoGenerateProxyClasses(false); - $doctrineOrm->entityManager('default', [ - 'metadata_cache_driver' => [ - 'type' => 'pool', - 'pool' => 'doctrine.system_cache_pool' - ], - 'query_cache_driver' => [ - 'type' => 'pool', - 'pool' => 'doctrine.system_cache_pool' - ], - 'result_cache_driver' => [ - 'type' => 'pool', - 'pool' => 'doctrine.result_cache_pool' - ] - ]); + $defaultEm = $doctrineOrm->entityManager('default'); + + $doctrineOrm + ->autoGenerateProxyClasses(false) + ->proxyDir('%kernel.build_dir%/doctrine/orm/Proxies'); + $defaultEm->resultCacheDriver() + ->type('pool') + ->pool('doctrine.result_cache_pool'); + $defaultEm->resultCacheDriver() + ->type('pool') + ->pool('doctrine.system_cache_pool'); }; diff --git a/config/packages/prod/framework.php b/config/packages/prod/framework.php index 71b1db3..1dcf821 100644 --- a/config/packages/prod/framework.php +++ b/config/packages/prod/framework.php @@ -4,13 +4,13 @@ use Symfony\Config\FrameworkConfig; -return static function (FrameworkConfig $framework): void -{ +return static function (FrameworkConfig $framework): void { // Doctrine - $cache = $framework->cache(); - $cache->pool('doctrine.result_cache_pool')->adapters(['cache.app']); - $cache->pool('doctrine.system_cache_pool')->adapters(['cache.system']); + $framework->cache() + ->pool('doctrine.result_cache_pool')->adapters(['cache.app']) + ->pool('doctrine.system_cache_pool')->adapters(['cache.system']); // Routing - $framework->router()->strictRequirements(null); + $framework->router() + ->strictRequirements(null); }; diff --git a/config/packages/security.php b/config/packages/security.php index 495ee03..cbb8691 100644 --- a/config/packages/security.php +++ b/config/packages/security.php @@ -4,39 +4,28 @@ use App\Entity\User; use App\Security\SecurityAuthenticator; +use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Config\SecurityConfig; -return static function (SecurityConfig $security): void -{ - $security->enableAuthenticatorManager(true); +return static function (SecurityConfig $security): void { + $security->passwordHasher(PasswordAuthenticatedUserInterface::class, 'auto'); + $userProvider = $security->provider('app_user_provider'); + $userProvider->entity() + ->class(User::class) + ->property('email'); - $security->passwordHasher(User::class, [ - 'algorithm' => 'auto' - ]); - $security->provider('app_user_provider', [ - 'entity' => [ - 'class' => User::class, - 'property' => 'email' - ] - ]); + $devFirewall = $security->firewall('dev'); + $devFirewall + ->pattern('^/(_(profiler|wdt)|css|images|js)/') + ->security(false); - $security->firewall('dev', [ - 'pattern' => '^/(_(profiler|wdt)|css|images|js)/', - 'security' => false - ]); - $mainFirewall = $security->firewall('main', [ - 'lazy' => true, - 'provider' => 'app_user_provider', - 'custom_authenticators' => [SecurityAuthenticator::class], - 'logout' => [ - 'path' => 'app_logout' - ], - 'remember_me' => [ - 'secret' => '%env(APP_SECRET)%' - ] - ]); - $mainFirewall->formLogin(); - $mainFirewall->entryPoint('form_login'); + $mainFirewall = $security->firewall('main'); + $mainFirewall + ->lazy(true) + ->provider('app_user_provider') + ->customAuthenticators([SecurityAuthenticator::class]); + $mainFirewall->logout(['path' => 'app_logout']); + $mainFirewall->rememberMe(['secret' => '%env(APP_SECRET)%']); $security->accessControl([ 'path' => '^/dashboard', 'roles' => 'ROLE_USER' diff --git a/config/packages/test/doctrine.php b/config/packages/test/doctrine.php index 7afadbb..c51665e 100644 --- a/config/packages/test/doctrine.php +++ b/config/packages/test/doctrine.php @@ -4,9 +4,7 @@ use Symfony\Config\DoctrineConfig; -return static function (DoctrineConfig $doctrine): void -{ - $doctrineDbal = $doctrine->dbal(); - $doctrineDbal->connection('default' - )->dbname('main_test%env(default::TEST_TOKEN)%'); +return static function (DoctrineConfig $doctrine): void { + $defaultConnection = $doctrine->dbal()->connection('default'); + $defaultConnection->dbnameSuffix('_test%env(default::TEST_TOKEN)%'); }; diff --git a/config/packages/test/framework.php b/config/packages/test/framework.php index 8129f8d..e65314f 100644 --- a/config/packages/test/framework.php +++ b/config/packages/test/framework.php @@ -4,19 +4,16 @@ use Symfony\Config\FrameworkConfig; -return static function (FrameworkConfig $framework): void -{ +return static function (FrameworkConfig $framework): void { // Framework $framework->test(true); - $framework->session([ - 'storage_factory_id' => 'session.storage.factory.mock_file' - ]); + $framework->session() + ->storageFactoryId('session.storage.factory.mock_file'); // Validator $framework->validation() ->notCompromisedPassword() - ->enabled(false) - ; + ->enabled(false); // Web Profiler $framework->profiler([ diff --git a/config/packages/test/twig.php b/config/packages/test/twig.php index 78c2d3b..625b3d7 100644 --- a/config/packages/test/twig.php +++ b/config/packages/test/twig.php @@ -4,7 +4,6 @@ use Symfony\Config\TwigConfig; -return static function (TwigConfig $twig): void -{ +return static function (TwigConfig $twig): void { $twig->strictVariables(true); }; diff --git a/config/packages/test/web_profiler.php b/config/packages/test/web_profiler.php index d516d8e..898dd4e 100644 --- a/config/packages/test/web_profiler.php +++ b/config/packages/test/web_profiler.php @@ -4,10 +4,8 @@ use Symfony\Config\WebProfilerConfig; -return static function (WebProfilerConfig $webProfiler): void -{ +return static function (WebProfilerConfig $webProfiler): void { $webProfiler ->toolbar(false) - ->interceptRedirects(false) - ; + ->interceptRedirects(false); }; diff --git a/config/packages/twig.php b/config/packages/twig.php index 865b045..324f788 100644 --- a/config/packages/twig.php +++ b/config/packages/twig.php @@ -4,9 +4,7 @@ use Symfony\Config\TwigConfig; -return static function (TwigConfig $twig): void -{ +return static function (TwigConfig $twig): void { $twig->defaultPath('%kernel.project_dir%/resources/views'); - $twig->global('business_shortname')->value('%app.business_shortname%'); - $twig->global('business_shortname')->value('%app.business_fullname%'); + $twig->global('business_name')->value('%app.business_name%'); }; diff --git a/config/routes.php b/config/routes.php index afa07a6..df16e1a 100644 --- a/config/routes.php +++ b/config/routes.php @@ -9,17 +9,16 @@ use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; return static function (RoutingConfigurator $routes): void { - $routes->add('index', '/') ->controller(HomeController::class) ->methods(['GET']); $routes->add('app_login', '/login') - ->controller(SecurityController::class . '::login') + ->controller([SecurityController::class, 'login']) ->methods(['GET', 'POST']); $routes->add('app_logout', '/logout') - ->controller(SecurityController::class . '::logout') + ->controller([SecurityController::class, 'logout']) ->methods(['GET']); $routes->add('dashboard', '/dashboard') diff --git a/config/routes/dev/framework.php b/config/routes/dev/framework.php index c19c60f..fb536c3 100644 --- a/config/routes/dev/framework.php +++ b/config/routes/dev/framework.php @@ -5,7 +5,6 @@ use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; return static function (RoutingConfigurator $routes): void { - $routes->import('@FrameworkBundle/Resources/config/routing/errors.xml') ->prefix('/_error'); }; diff --git a/config/routes/dev/web_profiler.php b/config/routes/dev/web_profiler.php index 923e72f..2aaf786 100644 --- a/config/routes/dev/web_profiler.php +++ b/config/routes/dev/web_profiler.php @@ -5,10 +5,8 @@ use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; return static function (RoutingConfigurator $routes): void { - $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml') ->prefix('/_wdt'); - $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml') ->prefix('/_profiler'); }; diff --git a/config/services.php b/config/services.php index 5ca4fbf..50577de 100644 --- a/config/services.php +++ b/config/services.php @@ -3,14 +3,13 @@ declare(strict_types=1); use App\Doctrine\UserHashPasswordListener; +use App\Entity\User; +use Doctrine\ORM\Events; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $config): void -{ +return static function (ContainerConfigurator $config): void { $config->parameters() - ->set('locale', 'es') - ->set('app.business_shortname', '%env(BUSINESS_SHORTNAME)%') - ->set('app.business_fullname', '%env(BUSINESS_FULLNAME)%'); + ->set('app.business_name', '%env(BUSINESS_NAME)%'); $services = $config->services(); @@ -19,8 +18,12 @@ ->autoconfigure(); $services->load('App\\', '../src/*') - ->exclude('../src/{DependencyInjection,Entity,Tests,Kernel.php}'); + ->exclude('../src/{DependencyInjection,Entity,Kernel.php}'); $services->set(UserHashPasswordListener::class) - ->tag('doctrine.orm.entity_listener', ['lazy' => true]); + ->tag('doctrine.orm.entity_listener', [ + 'event' => Events::prePersist, + 'entity' => User::class, + 'lazy' => true, + ]); }; diff --git a/config/services_test.php b/config/services_test.php index 587839d..4bf4d62 100644 --- a/config/services_test.php +++ b/config/services_test.php @@ -2,11 +2,10 @@ declare(strict_types=1); +use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -use Symfony\Component\Security\Core\Security; -return static function (ContainerConfigurator $config): void -{ +return static function (ContainerConfigurator $config): void { $services = $config->services(); $services->alias(Security::class, 'security.helper') diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 452d282..89195e2 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,8 +1,8 @@ - + + + diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 8f34572..0000000 --- a/psalm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/public/.htaccess b/public/.htaccess index 6abdcb2..b329d52 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -6,7 +6,7 @@ DirectoryIndex index.php - Options +FollowSymlinks + Options +SymLinksIfOwnerMatch RewriteEngine On @@ -20,7 +20,7 @@ DirectoryIndex index.php RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^(.*)$ %{ENV:BASE}/index.php [QSA,L] + RewriteRule ^ %{ENV:BASE}/index.php [L] diff --git a/rector.php b/rector.php index f5e0e53..899dc56 100644 --- a/rector.php +++ b/rector.php @@ -2,34 +2,47 @@ declare(strict_types=1); -use Rector\Core\Configuration\Option; -use Rector\Core\ValueObject\PhpVersion; +use Rector\Config\RectorConfig; use Rector\Doctrine\Set\DoctrineSetList; +use Rector\PHPUnit\Set\PHPUnitLevelSetList; use Rector\PHPUnit\Set\PHPUnitSetList; +use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; +use Rector\Symfony\Set\SymfonyLevelSetList; use Rector\Symfony\Set\SymfonySetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $config): void { - $parameters = $config->parameters(); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->paths([ + __DIR__ . '/src', + ]); - $config->import(SetList::ACTION_INJECTION_TO_CONSTRUCTOR_INJECTION); - $config->import(SetList::CODE_QUALITY); - $config->import(SetList::CODING_STYLE); - $config->import(SetList::FRAMEWORK_EXTRA_BUNDLE_50); - $config->import(SetList::PHP_74); - $config->import(SetList::PSR_4); - $config->import(SetList::TYPE_DECLARATION); - $config->import(SetList::TYPE_DECLARATION_STRICT); - $config->import(SymfonySetList::SYMFONY_52); - $config->import(SymfonySetList::SYMFONY_CODE_QUALITY); - $config->import(SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION); - $config->import(DoctrineSetList::DOCTRINE_ORM_29); - $config->import(DoctrineSetList::DOCTRINE_DBAL_30); - $config->import(DoctrineSetList::DOCTRINE_CODE_QUALITY); - $config->import(DoctrineSetList::DOCTRINE_25); - $config->import(PHPUnitSetList::PHPUNIT_91); - $config->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY); - - $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_74); + $rectorConfig->sets([ + DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, + DoctrineSetList::DOCTRINE_BUNDLE_210, + DoctrineSetList::DOCTRINE_CODE_QUALITY, + DoctrineSetList::DOCTRINE_COMMON_20, + DoctrineSetList::DOCTRINE_DBAL_40, + DoctrineSetList::DOCTRINE_ORM_214, + LevelSetList::UP_TO_PHP_82, + PHPUnitLevelSetList::UP_TO_PHPUNIT_100, + PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES, + PHPUnitSetList::PHPUNIT_100, + PHPUnitSetList::PHPUNIT_CODE_QUALITY, + SetList::CODE_QUALITY, + SetList::CODING_STYLE, + SetList::DEAD_CODE, + SetList::EARLY_RETURN, + SetList::INSTANCEOF, + SetList::NAMING, + SetList::PHP_82, + SetList::PRIVATIZATION, + SetList::STRICT_BOOLEANS, + SetList::TYPE_DECLARATION, + SymfonyLevelSetList::UP_TO_SYMFONY_63, + SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES, + SymfonySetList::CONFIGS, + SymfonySetList::SYMFONY_64, + SymfonySetList::SYMFONY_CODE_QUALITY, + SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, + ]); }; diff --git a/resources/views/blog/home.html.twig b/resources/views/blog/home.html.twig index cf793f1..57ceed8 100644 --- a/resources/views/blog/home.html.twig +++ b/resources/views/blog/home.html.twig @@ -1,2 +1,2 @@ {% extends 'layout.html.twig' %} -{% set page_title = 'Inicio | ' ~ business_shortname %} \ No newline at end of file +{% set page_title = 'Inicio | ' ~ business_name %} \ No newline at end of file diff --git a/resources/views/dashboard/index.html.twig b/resources/views/dashboard/index.html.twig index 582c740..3b904dd 100644 --- a/resources/views/dashboard/index.html.twig +++ b/resources/views/dashboard/index.html.twig @@ -1,5 +1,5 @@ {% extends 'layout.html.twig' %} -{% set page_title = 'Inicio | ' ~ business_shortname %} +{% set page_title = 'Inicio | ' ~ business_name %} {% block body %}

You are in the Dashboard!

diff --git a/resources/views/layout.html.twig b/resources/views/layout.html.twig index 2a8a54a..c773645 100644 --- a/resources/views/layout.html.twig +++ b/resources/views/layout.html.twig @@ -1,5 +1,5 @@ - + {{ page_title }} diff --git a/src/Command/ExampleCommand.php b/src/Command/ExampleCommand.php index dcfa2c5..ad0ec1a 100644 --- a/src/Command/ExampleCommand.php +++ b/src/Command/ExampleCommand.php @@ -10,6 +10,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; + #[AsCommand('app:example-command', 'An example command.')] final class ExampleCommand extends Command { diff --git a/src/Controller/RegistrationController.php b/src/Controller/RegistrationController.php index a0b3264..c020e8d 100644 --- a/src/Controller/RegistrationController.php +++ b/src/Controller/RegistrationController.php @@ -16,20 +16,11 @@ final class RegistrationController extends AbstractController { - private Mailer $mailer; - - private UserRepositoryInterface $userRepository; - - private EventDispatcherInterface $eventDispatcher; - public function __construct( - Mailer $mailer, - UserRepositoryInterface $userRepository, - EventDispatcherInterface $eventDispatcher + private readonly Mailer $mailer, + private readonly UserRepositoryInterface $userRepository, + private readonly EventDispatcherInterface $eventDispatcher ) { - $this->mailer = $mailer; - $this->userRepository = $userRepository; - $this->eventDispatcher = $eventDispatcher; } public function __invoke(Request $request): Response @@ -52,7 +43,7 @@ public function __invoke(Request $request): Response } return $this->render('security/register.html.twig', [ - 'registrationForm' => $form->createView(), + 'registrationForm' => $form, ]); } } diff --git a/src/Controller/SecurityController.php b/src/Controller/SecurityController.php index a1bb59c..b2b9bcb 100644 --- a/src/Controller/SecurityController.php +++ b/src/Controller/SecurityController.php @@ -4,16 +4,16 @@ namespace App\Controller; -use LogicException; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; final class SecurityController extends AbstractController { public function login(AuthenticationUtils $authenticationUtils): Response { - if ($this->getUser() !== null) { + if ($this->getUser() instanceof UserInterface) { return $this->redirectToRoute('dashboard'); } @@ -23,8 +23,8 @@ public function login(AuthenticationUtils $authenticationUtils): Response return $this->render('security/login.html.twig', ['last_username' => $lastUsername, 'error' => $error]); } - public function logout(): void + public function logout(): never { - throw new LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.'); + throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.'); } } diff --git a/src/Doctrine/UserHashPasswordListener.php b/src/Doctrine/UserHashPasswordListener.php index 9a1d801..365a834 100644 --- a/src/Doctrine/UserHashPasswordListener.php +++ b/src/Doctrine/UserHashPasswordListener.php @@ -9,11 +9,8 @@ final class UserHashPasswordListener { - private UserPasswordHasherInterface $hasher; - - public function __construct(UserPasswordHasherInterface $userPasswordHasher) + public function __construct(private UserPasswordHasherInterface $hasher) { - $this->hasher = $userPasswordHasher; } public function prePersist(User $user): void diff --git a/src/Entity/User.php b/src/Entity/User.php index e7f57b2..0f45e2c 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -10,33 +10,22 @@ use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Security\Core\User\UserInterface; -/** - * @ORM\Entity(repositoryClass=UserRepository::class) - * @ORM\EntityListeners({"App\Doctrine\UserHashPasswordListener"}) - * @UniqueEntity(fields={"email"}, message="There is already an account with this email") - */ +#[ORM\Entity(repositoryClass: UserRepository::class)] +#[UniqueEntity(fields: ['email'], message: 'There is already an account with this email')] class User implements UserInterface, PasswordAuthenticatedUserInterface { - /** - * @ORM\Id - * @ORM\GeneratedValue - * @ORM\Column(type="integer") - */ + #[ORM\Id] + #[ORM\GeneratedValue] + #[ORM\Column(type: 'integer')] private ?int $id = null; - /** - * @ORM\Column(type="string", length=180, unique=true) - */ + #[ORM\Column(type: 'string', length: 180, unique: true)] private string $email = ''; - /** - * @ORM\Column(type="json") - */ + #[ORM\Column(type: 'json')] private array $roles = []; - /** - * @ORM\Column(type="string") - */ + #[ORM\Column(type: 'string')] private string $password = ''; public static function create(string $email, string $password, array $roles = []): self diff --git a/src/Event/UserRegisteredEvent.php b/src/Event/UserRegisteredEvent.php index e968232..231f0ab 100644 --- a/src/Event/UserRegisteredEvent.php +++ b/src/Event/UserRegisteredEvent.php @@ -1,7 +1,9 @@ urlGenerator = $urlGenerator; } public function supports(Request $request): bool diff --git a/src/Utils/Mailer.php b/src/Utils/Mailer.php index f9873b2..e50e986 100644 --- a/src/Utils/Mailer.php +++ b/src/Utils/Mailer.php @@ -11,11 +11,8 @@ final class Mailer { - private MailerInterface $mailer; - - public function __construct(MailerInterface $mailer) + public function __construct(private MailerInterface $mailer) { - $this->mailer = $mailer; } public function sendConfirmationEmail(User $user): TemplatedEmail diff --git a/symfony.lock b/symfony.lock index 54d7291..18329f2 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,7 +1,4 @@ { - "behat/gherkin": { - "version": "4.x-dev" - }, "codeception/codeception": { "version": "5.0", "recipe": { @@ -9,98 +6,20 @@ "branch": "main", "version": "2.3", "ref": "89689e24507d8cb2c4a7937ece549db3836b608c" - }, - "files": [ - "codeception.yml", - "tests/_data/.gitignore", - "tests/_output/.gitignore", - "tests/_support/AcceptanceTester.php", - "tests/_support/FunctionalTester.php", - "tests/_support/Helper/Acceptance.php", - "tests/_support/Helper/Functional.php", - "tests/_support/Helper/Unit.php", - "tests/_support/UnitTester.php", - "tests/_support/_generated/.gitignore", - "tests/acceptance.suite.yml", - "tests/acceptance/.gitignore", - "tests/functional.suite.yml", - "tests/functional/.gitignore", - "tests/unit.suite.yml", - "tests/unit/.gitignore" - ] - }, - "codeception/lib-asserts": { - "version": "2.0.0" - }, - "codeception/lib-innerbrowser": { - "version": "3.1.2" - }, - "codeception/lib-web": { - "version": "1.0.1" - }, - "codeception/module-asserts": { - "version": "dev-master" - }, - "codeception/module-doctrine2": { - "version": "dev-master" - }, - "codeception/module-phpbrowser": { - "version": "dev-master" - }, - "codeception/module-symfony": { - "version": "dev-main" - }, - "codeception/stub": { - "version": "4.0.2" - }, - "composer/pcre": { - "version": "3.x-dev" - }, - "composer/semver": { - "version": "3.x-dev" - }, - "composer/xdebug-handler": { - "version": "3.0.3" - }, - "doctrine/annotations": { - "version": "1.14", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "1.10", - "ref": "64d8583af5ea57b7afa4aba4b159907f3a148b05" } }, - "doctrine/cache": { - "version": "2.1.x-dev" - }, - "doctrine/collections": { - "version": "1.7.x-dev" - }, - "doctrine/common": { - "version": "3.3.x-dev" - }, - "doctrine/data-fixtures": { - "version": "1.6.x-dev" - }, - "doctrine/dbal": { - "version": "3.4.x-dev" - }, - "doctrine/deprecations": { - "version": "v1.0.0" - }, "doctrine/doctrine-bundle": { - "version": "2.6", + "version": "2.11", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "2.4", - "ref": "5b7882dd9d05ef9b7e71fceed66af1ea573a70d4" + "version": "2.10", + "ref": "0b4a11ee7e60b36227502ed26874edd7e8b66353" }, "files": [ - "config/packages/doctrine.yaml", - "src/Entity/.gitignore", - "src/Repository/.gitignore" + "./config/packages/doctrine.yaml", + "./src/Entity/.gitignore", + "./src/Repository/.gitignore" ] }, "doctrine/doctrine-fixtures-bundle": { @@ -115,32 +34,8 @@ "./src/DataFixtures/AppFixtures.php" ] }, - "doctrine/event-manager": { - "version": "1.2.x-dev" - }, - "doctrine/inflector": { - "version": "2.1.x-dev" - }, - "doctrine/instantiator": { - "version": "1.5.x-dev" - }, - "doctrine/lexer": { - "version": "1.3.x-dev" - }, - "doctrine/orm": { - "version": "2.13.x-dev" - }, - "doctrine/persistence": { - "version": "3.1.x-dev" - }, - "doctrine/sql-formatter": { - "version": "1.2.x-dev" - }, - "egulias/email-validator": { - "version": "3.x-dev" - }, "friendsofphp/php-cs-fixer": { - "version": "3.8", + "version": "3.46", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", @@ -151,85 +46,22 @@ "./.php-cs-fixer.dist.php" ] }, - "graham-campbell/result-type": { - "version": "1.0.x-dev" - }, - "guzzlehttp/guzzle": { - "version": "7.4-dev" - }, - "guzzlehttp/promises": { - "version": "1.5-dev" - }, - "guzzlehttp/psr7": { - "version": "2.2-dev" - }, - "masterminds/html5": { - "version": "2.7.5" - }, - "monolog/monolog": { - "version": "2.x-dev" - }, - "myclabs/deep-copy": { - "version": "1.x-dev" - }, - "nikic/php-parser": { - "version": "v4.13.2" - }, - "pdepend/pdepend": { - "version": "2.x-dev" - }, - "phar-io/manifest": { - "version": "2.0.x-dev" - }, - "phar-io/version": { - "version": "3.2.1" - }, - "php-cs-fixer/diff": { - "version": "v2.0.2" - }, - "phpdocumentor/reflection-common": { - "version": "2.x-dev" - }, - "phpdocumentor/reflection-docblock": { - "version": "5.x-dev" - }, - "phpdocumentor/type-resolver": { - "version": "1.x-dev" - }, - "phpmd/phpmd": { - "version": "dev-master" - }, - "phpoption/phpoption": { - "version": "1.8-dev" - }, - "phpspec/prophecy": { - "version": "1.x-dev" - }, "phpstan/phpstan": { - "version": "1.7.x-dev" - }, - "phpunit/php-code-coverage": { - "version": "9.2.x-dev" - }, - "phpunit/php-file-iterator": { - "version": "3.0.x-dev" - }, - "phpunit/php-invoker": { - "version": "3.1.1" - }, - "phpunit/php-text-template": { - "version": "2.0.4" - }, - "phpunit/php-timer": { - "version": "5.0.3" + "version": "1.10", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.0", + "ref": "5e490cc197fb6bb1ae22e5abbc531ddc633b6767" + } }, "phpunit/phpunit": { - "version": "9.5", + "version": "10.5", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "9.3", - "ref": "a6249a6c4392e9169b87abf93225f7f9f59025e6" + "version": "9.6", + "ref": "7364a21d87e658eb363c5020c072ecfdc12e2326" }, "files": [ "./.env.test", @@ -237,86 +69,8 @@ "./tests/bootstrap.php" ] }, - "psr/cache": { - "version": "3.0.0" - }, - "psr/container": { - "version": "2.0.2" - }, - "psr/event-dispatcher": { - "version": "1.0.0" - }, - "psr/http-client": { - "version": "1.0.x-dev" - }, - "psr/http-factory": { - "version": "1.0.x-dev" - }, - "psr/http-message": { - "version": "1.0.x-dev" - }, - "psr/log": { - "version": "3.0.0" - }, - "psy/psysh": { - "version": "0.11.x-dev" - }, - "ralouphie/getallheaders": { - "version": "3.0.3" - }, - "rector/rector": { - "version": "0.12-dev" - }, - "roave/security-advisories": { - "version": "dev-latest" - }, - "sebastian/cli-parser": { - "version": "1.0.1" - }, - "sebastian/code-unit": { - "version": "1.0.8" - }, - "sebastian/code-unit-reverse-lookup": { - "version": "2.0.3" - }, - "sebastian/comparator": { - "version": "4.0.6" - }, - "sebastian/complexity": { - "version": "2.0.2" - }, - "sebastian/diff": { - "version": "4.0.4" - }, - "sebastian/environment": { - "version": "5.1.x-dev" - }, - "sebastian/exporter": { - "version": "4.0.x-dev" - }, - "sebastian/global-state": { - "version": "5.0.x-dev" - }, - "sebastian/lines-of-code": { - "version": "1.0.3" - }, - "sebastian/object-enumerator": { - "version": "4.0.4" - }, - "sebastian/object-reflector": { - "version": "2.0.4" - }, - "sebastian/recursion-context": { - "version": "4.0.4" - }, - "sebastian/type": { - "version": "3.0.x-dev" - }, - "sebastian/version": { - "version": "3.0.x-dev" - }, "squizlabs/php_codesniffer": { - "version": "4.0", + "version": "3.8", "recipe": { "repo": "github.com/symfony/recipes-contrib", "branch": "main", @@ -330,26 +84,11 @@ "repo": "github.com/symfony/recipes-contrib", "branch": "main", "version": "1.0", - "ref": "efb318193e48384eb5c5aadff15396ed698f8ffc" - }, - "files": [ - "public/.htaccess" - ] - }, - "symfony/browser-kit": { - "version": "6.0.x-dev" - }, - "symfony/cache": { - "version": "v6.0.8" - }, - "symfony/cache-contracts": { - "version": "v3.0.1" - }, - "symfony/config": { - "version": "v6.0.8" + "ref": "0f18b4decdf5695d692c1d0dfd65516a07a6adf1" + } }, "symfony/console": { - "version": "6.0", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", @@ -360,11 +99,8 @@ "./bin/console" ] }, - "symfony/css-selector": { - "version": "6.0.x-dev" - }, "symfony/debug-bundle": { - "version": "6.0", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", @@ -375,38 +111,8 @@ "./config/packages/debug.yaml" ] }, - "symfony/dependency-injection": { - "version": "v6.0.8" - }, - "symfony/deprecation-contracts": { - "version": "v3.0.1" - }, - "symfony/doctrine-bridge": { - "version": "6.0.x-dev" - }, - "symfony/dom-crawler": { - "version": "6.0.x-dev" - }, - "symfony/dotenv": { - "version": "v6.0.5" - }, - "symfony/error-handler": { - "version": "v6.0.8" - }, - "symfony/event-dispatcher": { - "version": "v6.0.3" - }, - "symfony/event-dispatcher-contracts": { - "version": "v3.0.1" - }, - "symfony/filesystem": { - "version": "v6.0.7" - }, - "symfony/finder": { - "version": "v6.0.8" - }, "symfony/flex": { - "version": "2.2", + "version": "2.4", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", @@ -414,39 +120,30 @@ "ref": "146251ae39e06a95be0fe3d13c807bcf3938b172" }, "files": [ - ".env" + "./.env" ] }, - "symfony/form": { - "version": "6.0.x-dev" - }, "symfony/framework-bundle": { - "version": "6.2", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.2", - "ref": "af47254c5e4cd543e6af3e4508298ffebbdaddd3" + "version": "7.0", + "ref": "de6e1b3e2bbbe69e36262d72c3f3db858b1ab391" }, "files": [ - "config/packages/cache.yaml", - "config/packages/framework.yaml", - "config/preload.php", - "config/routes/framework.yaml", - "config/services.yaml", - "public/index.php", - "src/Controller/.gitignore", - "src/Kernel.php" + "./config/packages/cache.yaml", + "./config/packages/framework.yaml", + "./config/preload.php", + "./config/routes/framework.yaml", + "./config/services.yaml", + "./public/index.php", + "./src/Controller/.gitignore", + "./src/Kernel.php" ] }, - "symfony/http-foundation": { - "version": "v6.0.8" - }, - "symfony/http-kernel": { - "version": "v6.0.8" - }, "symfony/mailer": { - "version": "6.2", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", @@ -454,11 +151,11 @@ "ref": "2bf89438209656b85b9a49238c4467bff1b1f939" }, "files": [ - "config/packages/mailer.yaml" + "./config/packages/mailer.yaml" ] }, "symfony/maker-bundle": { - "version": "1.41", + "version": "1.52", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", @@ -466,56 +163,8 @@ "ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f" } }, - "symfony/mime": { - "version": "6.0.x-dev" - }, - "symfony/monolog-bridge": { - "version": "6.0.x-dev" - }, - "symfony/monolog-bundle": { - "version": "3.9999999", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "3.7", - "ref": "213676c4ec929f046dfde5ea8e97625b81bc0578" - }, - "files": [ - "./config/packages/monolog.yaml" - ] - }, - "symfony/options-resolver": { - "version": "6.0.x-dev" - }, - "symfony/password-hasher": { - "version": "6.0.x-dev" - }, - "symfony/polyfill-intl-grapheme": { - "version": "v1.25.0" - }, - "symfony/polyfill-intl-icu": { - "version": "v1.25.0" - }, - "symfony/polyfill-intl-idn": { - "version": "v1.25.0" - }, - "symfony/polyfill-intl-normalizer": { - "version": "v1.25.0" - }, - "symfony/polyfill-mbstring": { - "version": "v1.25.0" - }, - "symfony/process": { - "version": "6.0.x-dev" - }, - "symfony/property-access": { - "version": "6.0.x-dev" - }, - "symfony/property-info": { - "version": "6.0.x-dev" - }, "symfony/routing": { - "version": "6.2", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", @@ -523,69 +172,43 @@ "ref": "e0a11b4ccb8c9e70b574ff5ad3dfdcd41dec5aa6" }, "files": [ - "config/packages/routing.yaml", - "config/routes.yaml" + "./config/packages/routing.yaml", + "./config/routes.yaml" ] }, - "symfony/runtime": { - "version": "v6.0.8" - }, "symfony/security-bundle": { - "version": "6.2", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.0", - "ref": "8a5b112826f7d3d5b07027f93786ae11a1c7de48" + "version": "6.4", + "ref": "2ae08430db28c8eb4476605894296c82a642028f" }, "files": [ - "config/packages/security.yaml" + "./config/packages/security.yaml", + "./config/routes/security.yaml" ] }, - "symfony/security-core": { - "version": "6.0.x-dev" - }, - "symfony/security-csrf": { - "version": "6.0.x-dev" - }, - "symfony/security-http": { - "version": "6.0.x-dev" - }, - "symfony/service-contracts": { - "version": "v3.0.1" - }, - "symfony/stopwatch": { - "version": "6.0.x-dev" - }, - "symfony/string": { - "version": "v6.0.8" - }, "symfony/translation": { - "version": "6.0", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "5.3", - "ref": "da64f5a2b6d96f5dc24914517c0350a5f91dee43" + "version": "6.3", + "ref": "64fe617084223633e1dedf9112935d8c95410d3e" }, "files": [ "./config/packages/translation.yaml", "./translations/.gitignore" ] }, - "symfony/translation-contracts": { - "version": "3.1-dev" - }, - "symfony/twig-bridge": { - "version": "6.0.x-dev" - }, "symfony/twig-bundle": { - "version": "6.0", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "5.4", - "ref": "bb2178c57eee79e6be0b297aa96fc0c0def81387" + "version": "6.3", + "ref": "b7772eb20e92f3fb4d4fe756e7505b4ba2ca1a2c" }, "files": [ "./config/packages/twig.yaml", @@ -593,7 +216,7 @@ ] }, "symfony/validator": { - "version": "6.0", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", @@ -604,14 +227,8 @@ "./config/packages/validator.yaml" ] }, - "symfony/var-dumper": { - "version": "v6.0.8" - }, - "symfony/var-exporter": { - "version": "v6.0.8" - }, "symfony/web-profiler-bundle": { - "version": "6.2", + "version": "7.0", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", @@ -619,23 +236,8 @@ "ref": "e42b3f0177df239add25373083a564e5ead4e13a" }, "files": [ - "config/packages/web_profiler.yaml", - "config/routes/web_profiler.yaml" + "./config/packages/web_profiler.yaml", + "./config/routes/web_profiler.yaml" ] - }, - "symfony/yaml": { - "version": "v6.0.3" - }, - "theseer/tokenizer": { - "version": "1.2.1" - }, - "twig/twig": { - "version": "3.x-dev" - }, - "vlucas/phpdotenv": { - "version": "5.4-dev" - }, - "webmozart/assert": { - "version": "1.10-dev" } } diff --git a/tests/Functional.suite.yml b/tests/Functional.suite.yml index 9020570..681bd49 100644 --- a/tests/Functional.suite.yml +++ b/tests/Functional.suite.yml @@ -4,10 +4,8 @@ modules: enabled: - Asserts - Symfony: - app_path: 'src' - environment: 'test' - mailer: 'symfony_mailer' + app_path: 'src' + environment: 'test' - Doctrine2: - depends: Symfony - cleanup: true - - \App\Tests\Helper\Functional + depends: Symfony + cleanup: true diff --git a/tests/Functional/BrowserCest.php b/tests/Functional/BrowserCest.php index 05245b2..08e9343 100644 --- a/tests/Functional/BrowserCest.php +++ b/tests/Functional/BrowserCest.php @@ -5,7 +5,7 @@ namespace App\Tests\Functional; use App\Entity\User; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; final class BrowserCest { diff --git a/tests/Functional/ConsoleCest.php b/tests/Functional/ConsoleCest.php index 695c437..183586e 100644 --- a/tests/Functional/ConsoleCest.php +++ b/tests/Functional/ConsoleCest.php @@ -5,7 +5,7 @@ namespace App\Tests\Functional; use App\Command\ExampleCommand; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; final class ConsoleCest { diff --git a/tests/Functional/DoctrineCest.php b/tests/Functional/DoctrineCest.php index 64f699b..6f66550 100644 --- a/tests/Functional/DoctrineCest.php +++ b/tests/Functional/DoctrineCest.php @@ -7,7 +7,7 @@ use App\Entity\User; use App\Repository\Model\UserRepositoryInterface; use App\Repository\UserRepository; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; final class DoctrineCest { diff --git a/tests/Functional/EventsCest.php b/tests/Functional/EventsCest.php index 2278f83..c7eaf7d 100644 --- a/tests/Functional/EventsCest.php +++ b/tests/Functional/EventsCest.php @@ -5,7 +5,7 @@ namespace App\Tests\Functional; use App\Event\UserRegisteredEvent; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; use PHPUnit\Framework\ExpectationFailedException; use Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector; use Symfony\Component\Console\ConsoleEvents; diff --git a/tests/Functional/FormCest.php b/tests/Functional/FormCest.php index 8f3bfa5..139c0f8 100644 --- a/tests/Functional/FormCest.php +++ b/tests/Functional/FormCest.php @@ -4,7 +4,7 @@ namespace App\Tests\Functional; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; final class FormCest { diff --git a/tests/Functional/IssuesCest.php b/tests/Functional/IssuesCest.php index 6595e8b..c0fa13f 100644 --- a/tests/Functional/IssuesCest.php +++ b/tests/Functional/IssuesCest.php @@ -5,7 +5,7 @@ namespace App\Tests\Functional; use App\Entity\User; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; use Doctrine\DBAL\Connection; final class IssuesCest diff --git a/tests/Functional/MailerCest.php b/tests/Functional/MailerCest.php index 162270d..03ca54f 100644 --- a/tests/Functional/MailerCest.php +++ b/tests/Functional/MailerCest.php @@ -4,7 +4,7 @@ namespace App\Tests\Functional; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; final class MailerCest { diff --git a/tests/Functional/MimeCest.php b/tests/Functional/MimeCest.php index 88cf186..eee29e5 100644 --- a/tests/Functional/MimeCest.php +++ b/tests/Functional/MimeCest.php @@ -5,7 +5,7 @@ namespace App\Tests\Functional; use App\Entity\User; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; use App\Utils\Mailer; final class MimeCest diff --git a/tests/Functional/ParameterCest.php b/tests/Functional/ParameterCest.php index c926dc8..bcb9801 100644 --- a/tests/Functional/ParameterCest.php +++ b/tests/Functional/ParameterCest.php @@ -4,13 +4,13 @@ namespace App\Tests\Functional; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; final class ParameterCest { public function grabParameter(FunctionalTester $I) { - $locale = (string) $I->grabParameter('locale'); - $I->assertSame('es', $locale); + $locale = (string) $I->grabParameter('app.business_name'); + $I->assertSame('Codeception', $locale); } } diff --git a/tests/Functional/RouterCest.php b/tests/Functional/RouterCest.php index 995b432..0ae5bc3 100644 --- a/tests/Functional/RouterCest.php +++ b/tests/Functional/RouterCest.php @@ -4,7 +4,7 @@ namespace App\Tests\Functional; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; final class RouterCest { diff --git a/tests/Functional/SecurityCest.php b/tests/Functional/SecurityCest.php index 348fe2a..4d1ddfe 100644 --- a/tests/Functional/SecurityCest.php +++ b/tests/Functional/SecurityCest.php @@ -5,7 +5,7 @@ namespace App\Tests\Functional; use App\Entity\User; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; final class SecurityCest { diff --git a/tests/Functional/ServicesCest.php b/tests/Functional/ServicesCest.php index 600f1d9..bf10e67 100644 --- a/tests/Functional/ServicesCest.php +++ b/tests/Functional/ServicesCest.php @@ -4,8 +4,8 @@ namespace App\Tests\Functional; -use App\Tests\FunctionalTester; -use Symfony\Component\Security\Core\Security; +use App\Tests\Support\FunctionalTester; +use Symfony\Bundle\SecurityBundle\Security; final class ServicesCest { diff --git a/tests/Functional/SessionCest.php b/tests/Functional/SessionCest.php index f34a734..16b0f09 100644 --- a/tests/Functional/SessionCest.php +++ b/tests/Functional/SessionCest.php @@ -5,7 +5,7 @@ namespace App\Tests\Functional; use App\Entity\User; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; final class SessionCest diff --git a/tests/Functional/TimeCest.php b/tests/Functional/TimeCest.php index e031130..1f3e444 100644 --- a/tests/Functional/TimeCest.php +++ b/tests/Functional/TimeCest.php @@ -4,7 +4,7 @@ namespace App\Tests\Functional; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; final class TimeCest { diff --git a/tests/Functional/TwigCest.php b/tests/Functional/TwigCest.php index 91f4f91..e674da2 100644 --- a/tests/Functional/TwigCest.php +++ b/tests/Functional/TwigCest.php @@ -4,7 +4,7 @@ namespace App\Tests\Functional; -use App\Tests\FunctionalTester; +use App\Tests\Support\FunctionalTester; final class TwigCest { diff --git a/tests/_build/data/.gitignore b/tests/_build/data/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/tests/_build/output/.gitignore b/tests/_build/output/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/tests/_build/output/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/_build/support/FunctionalTester.php b/tests/_build/support/FunctionalTester.php deleted file mode 100644 index ce9fe7a..0000000 --- a/tests/_build/support/FunctionalTester.php +++ /dev/null @@ -1,12 +0,0 @@ -