From e4efc3345bed34aed450dd963f7a93f865ccd7be Mon Sep 17 00:00:00 2001 From: Benn Oshrin Date: Tue, 29 Aug 2023 07:40:28 -0400 Subject: [PATCH] Bump cake to v4.4.16 (and associated updates) --- app/composer.lock | 658 +++--- app/vendor/bin/composer | 121 +- app/vendor/bin/doctrine-dbal | 121 +- app/vendor/bin/jsonlint | 5 +- app/vendor/bin/phinx | 121 +- app/vendor/bin/php-parse | 121 +- app/vendor/bin/phpcbf | 121 +- app/vendor/bin/phpcs | 121 +- app/vendor/bin/phpunit | 124 +- app/vendor/bin/psysh | 121 +- app/vendor/bin/var-dump-server | 121 +- app/vendor/cakephp/bake/LICENSE.txt | 2 +- app/vendor/cakephp/bake/README.md | 2 +- app/vendor/cakephp/bake/composer.json | 6 +- app/vendor/cakephp/bake/docs.Dockerfile | 4 +- .../bake/{phpcs.xml.dist => phpcs.xml} | 6 + .../cakephp/bake/src/CodeGen/ClassBuilder.php | 10 +- .../cakephp/bake/src/CodeGen/CodeParser.php | 10 +- .../cakephp/bake/src/CodeGen/FileBuilder.php | 10 +- .../cakephp/bake/src/CodeGen/ImportHelper.php | 10 +- .../bake/src/CodeGen/ParseException.php | 10 +- .../cakephp/bake/src/CodeGen/ParsedClass.php | 10 +- .../cakephp/bake/src/CodeGen/ParsedFile.php | 10 +- .../cakephp/bake/src/Command/AllCommand.php | 10 +- .../cakephp/bake/src/Command/BakeCommand.php | 10 +- .../bake/src/Command/BehaviorCommand.php | 10 +- .../cakephp/bake/src/Command/CellCommand.php | 10 +- .../bake/src/Command/CommandCommand.php | 10 +- .../bake/src/Command/CommandHelperCommand.php | 10 +- .../bake/src/Command/ComponentCommand.php | 10 +- .../bake/src/Command/ControllerAllCommand.php | 10 +- .../bake/src/Command/ControllerCommand.php | 10 +- .../cakephp/bake/src/Command/EntryCommand.php | 10 +- .../bake/src/Command/FixtureAllCommand.php | 10 +- .../bake/src/Command/FixtureCommand.php | 10 +- .../cakephp/bake/src/Command/FormCommand.php | 10 +- .../bake/src/Command/HelperCommand.php | 10 +- .../bake/src/Command/MailerCommand.php | 10 +- .../bake/src/Command/MiddlewareCommand.php | 10 +- .../bake/src/Command/ModelAllCommand.php | 10 +- .../cakephp/bake/src/Command/ModelCommand.php | 25 +- .../bake/src/Command/PluginCommand.php | 12 +- .../bake/src/Command/ShellHelperCommand.php | 10 +- .../bake/src/Command/SimpleBakeCommand.php | 10 +- .../bake/src/Command/TemplateAllCommand.php | 10 +- .../bake/src/Command/TemplateCommand.php | 10 +- .../cakephp/bake/src/Command/TestCommand.php | 12 +- app/vendor/cakephp/bake/src/Plugin.php | 10 +- .../cakephp/bake/src/Shell/Task/BakeTask.php | 10 +- .../bake/src/Shell/Task/SimpleBakeTask.php | 10 +- .../bake/src/Utility/CommonOptionsTrait.php | 10 +- .../src/Utility/Model/AssociationFilter.php | 10 +- .../cakephp/bake/src/Utility/Process.php | 10 +- .../src/Utility/SubsetSchemaCollection.php | 10 +- .../cakephp/bake/src/Utility/TableScanner.php | 10 +- .../bake/src/Utility/TemplateRenderer.php | 10 +- app/vendor/cakephp/bake/src/View/BakeView.php | 12 +- .../bake/templates/bake/Command/command.twig | 10 +- .../bake/templates/bake/Command/helper.twig | 10 +- .../templates/bake/Controller/component.twig | 10 +- .../templates/bake/Controller/controller.twig | 10 +- .../bake/templates/bake/Form/form.twig | 10 +- .../bake/templates/bake/Mailer/mailer.twig | 10 +- .../templates/bake/Middleware/middleware.twig | 10 +- .../bake/templates/bake/Model/behavior.twig | 10 +- .../bake/templates/bake/Model/entity.twig | 10 +- .../bake/templates/bake/Model/table.twig | 10 +- .../bake/templates/bake/Plugin/README.md.twig | 10 +- .../templates/bake/Plugin/composer.json.twig | 10 +- .../bake/Plugin/phpunit.xml.dist.twig | 10 +- .../src/Controller/AppController.php.twig | 10 +- .../templates/bake/Plugin/src/Plugin.php.twig | 10 +- .../bake/Plugin/tests/bootstrap.php.twig | 10 +- .../bake/Plugin/webroot/.gitkeep.twig | 10 +- .../bake/templates/bake/Shell/helper.twig | 10 +- .../bake/templates/bake/Template/add.twig | 10 +- .../bake/templates/bake/Template/edit.twig | 10 +- .../bake/templates/bake/Template/index.twig | 10 +- .../bake/templates/bake/Template/login.twig | 10 +- .../bake/templates/bake/Template/view.twig | 10 +- .../bake/templates/bake/View/cell.twig | 10 +- .../bake/templates/bake/View/helper.twig | 10 +- .../bake/element/Controller/add.twig | 10 +- .../bake/element/Controller/delete.twig | 10 +- .../bake/element/Controller/edit.twig | 10 +- .../bake/element/Controller/index.twig | 10 +- .../bake/element/Controller/login.twig | 10 +- .../bake/element/Controller/logout.twig | 10 +- .../bake/element/Controller/view.twig | 10 +- .../bake/templates/bake/element/form.twig | 10 +- .../bake/templates/bake/layout/default.twig | 10 +- .../bake/templates/bake/tests/fixture.twig | 10 +- .../bake/templates/bake/tests/test_case.twig | 10 +- .../bake/tests/Fixture/ArticlesFixture.php | 10 +- .../tests/Fixture/ArticlesTagsFixture.php | 10 +- .../bake/tests/Fixture/AuthorsFixture.php | 10 +- .../Fixture/BakeArticlesBakeTagsFixture.php | 10 +- .../tests/Fixture/BakeArticlesFixture.php | 10 +- .../bake/tests/Fixture/BakeCarFixture.php | 10 +- .../tests/Fixture/BakeCommentsFixture.php | 10 +- .../bake/tests/Fixture/BakeTagsFixture.php | 10 +- .../Fixture/BakeTemplateAuthorsFixture.php | 10 +- .../Fixture/BakeTemplateProfilesFixture.php | 10 +- .../Fixture/BakeTemplateRolesFixture.php | 10 +- .../bake/tests/Fixture/BinaryTestsFixture.php | 10 +- .../bake/tests/Fixture/CategoriesFixture.php | 10 +- .../Fixture/CategoriesProductsFixture.php | 10 +- .../tests/Fixture/CategoryThreadsFixture.php | 10 +- .../bake/tests/Fixture/CommentsFixture.php | 10 +- .../bake/tests/Fixture/DatatypesFixture.php | 10 +- .../bake/tests/Fixture/InvitationsFixture.php | 10 +- .../bake/tests/Fixture/OldProductsFixture.php | 10 +- .../bake/tests/Fixture/PostsFixture.php | 10 +- .../tests/Fixture/ProductVersionsFixture.php | 10 +- .../bake/tests/Fixture/ProductsFixture.php | 10 +- .../bake/tests/Fixture/TagsFixture.php | 10 +- .../bake/tests/Fixture/TodoItemsFixture.php | 10 +- .../Fixture/TodoItemsTodoLabelsFixture.php | 10 +- .../bake/tests/Fixture/TodoLabelsFixture.php | 10 +- .../bake/tests/Fixture/TodoTasksFixture.php | 10 +- app/vendor/cakephp/bake/tests/bootstrap.php | 10 +- .../.github/workflows/ci.yml | 4 +- .../Commenting/DocBlockAlignmentSniff.php | 2 +- .../Commenting/FunctionCommentSniff.php | 4 +- .../Sniffs/Commenting/InheritDocSniff.php | 2 +- .../ControlStructuresSniff.php | 2 +- .../ElseIfDeclarationSniff.php | 2 +- .../WhileStructuresSniff.php | 2 +- .../Formatting/BlankLineBeforeReturnSniff.php | 4 +- .../Functions/ClosureDeclarationSniff.php | 2 +- .../ValidFunctionNameSniff.php | 2 +- .../NamingConventions/ValidTraitNameSniff.php | 2 +- .../Sniffs/PHP/DisallowShortOpenTagSniff.php | 2 +- .../Sniffs/WhiteSpace/EmptyLinesSniff.php | 4 +- .../WhiteSpace/FunctionCallSpacingSniff.php | 2 +- .../Sniffs/WhiteSpace/TabAndSpaceSniff.php | 2 +- .../cakephp-codesniffer/CakePHP/ruleset.xml | 3 - .../cakephp/cakephp-codesniffer/composer.json | 2 +- .../cakephp-codesniffer/docs/README.md | 11 +- app/vendor/cakephp/cakephp/VERSION.txt | 2 +- app/vendor/cakephp/cakephp/composer.json | 10 +- .../cakephp/cakephp/src/Cache/composer.json | 2 +- .../src/Collection/CollectionInterface.php | 44 +- .../cakephp/src/Command/PluginLoadCommand.php | 8 + .../Component/SecurityComponent.php | 2 +- .../src/Controller/ControllerFactory.php | 1 + .../cakephp/src/Core/StaticConfigTrait.php | 4 +- .../cakephp/cakephp/src/Core/composer.json | 3 + .../cakephp/cakephp/src/Core/functions.php | 7 +- .../Database/Exception/DatabaseException.php | 4 + .../Expression/WhenThenExpression.php | 2 +- .../src/Database/Log/LoggingStatement.php | 23 +- .../cakephp/cakephp/src/Database/Query.php | 3 +- .../Database/Schema/PostgresSchemaDialect.php | 4 + .../src/Database/Schema/TableSchema.php | 7 - .../src/Database/Type/DateTimeType.php | 12 +- .../Datasource/Paging/NumericPaginator.php | 7 + .../cakephp/src/Error/ExceptionTrap.php | 1 + .../cakephp/cakephp/src/Filesystem/Folder.php | 8 +- .../cakephp/src/Http/Cookie/Cookie.php | 2 +- .../src/Http/Cookie/CookieCollection.php | 2 +- .../cakephp/cakephp/src/Http/Session.php | 28 +- .../cakephp/cakephp/src/Http/composer.json | 4 +- app/vendor/cakephp/cakephp/src/Log/Log.php | 2 +- .../cakephp/cakephp/src/Log/composer.json | 2 +- .../src/Mailer/Transport/SmtpTransport.php | 98 +- .../cakephp/src/ORM/AssociationCollection.php | 7 +- app/vendor/cakephp/cakephp/src/ORM/Table.php | 36 +- .../cakephp/src/Routing/RouteBuilder.php | 6 +- .../cakephp/src/Routing/RouteCollection.php | 12 +- .../src/Shell/Helper/ProgressHelper.php | 17 +- .../src/TestSuite/TestEmailTransport.php | 2 +- .../cakephp/cakephp/src/Utility/Hash.php | 1 - .../cakephp/src/Validation/Validation.php | 2 +- .../cakephp/src/Validation/Validator.php | 20 +- .../src/View/Helper/PaginatorHelper.php | 4 +- .../cakephp/src/View/StringTemplate.php | 7 + .../templates/Error/missing_controller.php | 8 +- app/vendor/cakephp/chronos/LICENSE | 2 +- app/vendor/cakephp/chronos/README.md | 7 +- app/vendor/cakephp/chronos/compare-data.json | 1 + app/vendor/cakephp/chronos/docs.Dockerfile | 4 +- .../chronos/docs/en/2-4-upgrade-guide.rst | 78 + .../cakephp/chronos/docs/en/contents.rst | 3 +- app/vendor/cakephp/chronos/docs/en/index.rst | 18 +- app/vendor/cakephp/chronos/docs/fr/index.rst | 12 +- app/vendor/cakephp/chronos/docs/ja/index.rst | 8 +- app/vendor/cakephp/chronos/docs/pt/index.rst | 8 +- app/vendor/cakephp/chronos/src/Chronos.php | 98 +- .../cakephp/chronos/src/ChronosDate.php | 288 +++ .../cakephp/chronos/src/ChronosInterface.php | 8 +- .../cakephp/chronos/src/ChronosInterval.php | 12 +- app/vendor/cakephp/chronos/src/Date.php | 137 +- .../chronos/src/DifferenceFormatter.php | 8 +- .../src/DifferenceFormatterInterface.php | 8 +- .../cakephp/chronos/src/MutableDate.php | 15 +- .../cakephp/chronos/src/MutableDateTime.php | 9 +- .../chronos/src/Traits/ComparisonTrait.php | 89 +- .../cakephp/chronos/src/Traits/CopyTrait.php | 8 +- .../chronos/src/Traits/DifferenceTrait.php | 61 +- .../chronos/src/Traits/FactoryTrait.php | 64 +- .../chronos/src/Traits/FormattingTrait.php | 8 +- .../chronos/src/Traits/FrozenTimeTrait.php | 39 +- .../chronos/src/Traits/MagicPropertyTrait.php | 8 +- .../chronos/src/Traits/ModifierTrait.php | 145 +- .../src/Traits/RelativeKeywordTrait.php | 8 +- .../chronos/src/Traits/TestingAidTrait.php | 8 +- .../chronos/src/Traits/TimezoneTrait.php | 17 +- app/vendor/cakephp/chronos/src/Translator.php | 8 +- .../cakephp/chronos/src/carbon_compat.php | 8 +- app/vendor/cakephp/debug_kit/LICENSE.txt | 2 +- app/vendor/cakephp/debug_kit/composer.json | 2 +- app/vendor/cakephp/debug_kit/docs.Dockerfile | 4 +- .../src/Middleware/DebugKitMiddleware.php | 2 +- .../debug_kit/src/Panel/CachePanel.php | 12 +- .../cakephp/debug_kit/src/ToolbarService.php | 13 +- .../debug_kit/tests/Fixture/PanelsFixture.php | 8 +- .../tests/Fixture/RequestsFixture.php | 8 +- app/vendor/cakephp/migrations/README.md | 2 +- app/vendor/cakephp/migrations/composer.json | 4 +- app/vendor/cakephp/migrations/docs.Dockerfile | 4 +- .../cakephp/migrations/docs/en/index.rst | 2 +- app/vendor/cakephp/migrations/phpcs.xml | 2 +- .../src/Command/BakeMigrationDiffCommand.php | 2 +- .../migrations/src/TableFinderTrait.php | 4 + .../migrations/src/TestSuite/Migrator.php | 24 +- .../bake/element/add-foreign-keys.twig | 3 +- .../templates/bake/element/create-tables.twig | 22 +- app/vendor/composer/InstalledVersions.php | 16 +- app/vendor/composer/autoload_classmap.php | 2 +- app/vendor/composer/autoload_static.php | 2 +- app/vendor/composer/ca-bundle/res/cacert.pem | 103 +- .../composer/class-map-generator/README.md | 4 +- .../class-map-generator/composer.json | 4 +- .../src/ClassMapGenerator.php | 6 +- .../class-map-generator/src/PhpFileParser.php | 7 +- app/vendor/composer/composer/CHANGELOG.md | 41 + app/vendor/composer/composer/composer.lock | 182 +- .../doc/articles/custom-installers.md | 5 +- .../Composer/Autoload/AutoloadGenerator.php | 31 +- .../src/Composer/Autoload/ClassLoader.php | 96 +- .../Command/CheckPlatformReqsCommand.php | 8 +- .../src/Composer/Command/ConfigCommand.php | 33 +- .../Command/PackageDiscoveryTrait.php | 2 +- .../src/Composer/Command/RequireCommand.php | 7 +- .../Composer/Command/SelfUpdateCommand.php | 5 +- .../src/Composer/Command/ShowCommand.php | 38 +- .../src/Composer/Command/StatusCommand.php | 3 + .../src/Composer/Command/ValidateCommand.php | 3 + .../composer/src/Composer/Composer.php | 4 +- .../src/Composer/Console/Application.php | 3 +- .../Composer/DependencyResolver/Problem.php | 1 + .../Composer/Downloader/FileDownloader.php | 3 +- .../EventDispatcher/EventDispatcher.php | 8 + .../src/Composer/InstalledVersions.php | 17 +- .../Composer/Installer/BinaryInstaller.php | 5 +- .../Installer/InstallationManager.php | 4 +- .../Composer/Installer/InstallerInterface.php | 2 +- .../Composer/Installer/LibraryInstaller.php | 2 + .../Installer/MetapackageInstaller.php | 4 +- .../Composer/Installer/PluginInstaller.php | 2 +- .../Composer/Installer/ProjectInstaller.php | 2 +- .../PHPStan/ConfigReturnTypeExtension.php | 10 +- .../Composer/Package/Archiver/ZipArchiver.php | 2 +- .../Composer/Package/Loader/ArrayLoader.php | 2 +- .../composer/src/Composer/Package/Locker.php | 24 +- .../Package/Version/VersionGuesser.php | 4 +- .../src/Composer/Plugin/PluginManager.php | 17 +- .../Repository/FilesystemRepository.php | 8 +- .../Repository/PlatformRepository.php | 6 +- .../Repository/Vcs/GitBitbucketDriver.php | 3 + .../Composer/Repository/Vcs/GitHubDriver.php | 3 + .../Composer/Repository/Vcs/GitLabDriver.php | 3 + .../src/Composer/SelfUpdate/Versions.php | 4 +- .../composer/src/Composer/Util/AuthHelper.php | 8 + .../composer/src/Composer/Util/GitHub.php | 12 +- .../src/Composer/Util/Http/CurlDownloader.php | 2 +- .../composer/src/Composer/Util/Platform.php | 2 +- app/vendor/composer/installed.json | 736 +++--- app/vendor/composer/installed.php | 416 ++-- app/vendor/doctrine/dbal/composer.json | 13 +- .../doctrine/dbal/src/Cache/ArrayResult.php | 12 +- app/vendor/doctrine/dbal/src/Connection.php | 6 +- .../dbal/src/Driver/AbstractDB2Driver.php | 4 +- .../dbal/src/Driver/AbstractException.php | 2 +- .../dbal/src/Driver/AbstractMySQLDriver.php | 6 +- .../dbal/src/Driver/AbstractOracleDriver.php | 4 +- .../src/Driver/AbstractPostgreSQLDriver.php | 6 +- .../src/Driver/AbstractSQLServerDriver.php | 4 +- .../dbal/src/Driver/AbstractSQLiteDriver.php | 4 +- .../dbal/src/Driver/IBMDB2/Connection.php | 22 +- .../dbal/src/Driver/IBMDB2/Driver.php | 2 +- .../dbal/src/Driver/IBMDB2/Statement.php | 8 +- .../AbstractConnectionMiddleware.php | 12 +- .../Middleware/AbstractDriverMiddleware.php | 8 +- .../Middleware/AbstractResultMiddleware.php | 12 +- .../AbstractStatementMiddleware.php | 6 +- .../dbal/src/Driver/Mysqli/Connection.php | 4 +- .../dbal/src/Driver/Mysqli/Driver.php | 2 +- .../dbal/src/Driver/Mysqli/Result.php | 10 +- .../dbal/src/Driver/Mysqli/Statement.php | 6 +- .../dbal/src/Driver/OCI8/Connection.php | 4 +- .../doctrine/dbal/src/Driver/OCI8/Driver.php | 2 +- .../dbal/src/Driver/OCI8/Statement.php | 6 +- .../dbal/src/Driver/PDO/Connection.php | 6 +- .../dbal/src/Driver/PDO/MySQL/Driver.php | 2 +- .../dbal/src/Driver/PDO/OCI/Driver.php | 2 +- .../dbal/src/Driver/PDO/PgSQL/Driver.php | 2 +- .../dbal/src/Driver/PDO/SQLSrv/Driver.php | 2 +- .../dbal/src/Driver/PDO/SQLSrv/Statement.php | 4 +- .../dbal/src/Driver/PDO/SQLite/Driver.php | 2 +- .../dbal/src/Driver/PDO/Statement.php | 4 +- .../dbal/src/Driver/PgSQL/Connection.php | 4 +- .../doctrine/dbal/src/Driver/PgSQL/Driver.php | 2 +- .../doctrine/dbal/src/Driver/PgSQL/Result.php | 12 +- .../dbal/src/Driver/PgSQL/Statement.php | 12 +- .../dbal/src/Driver/SQLSrv/Connection.php | 2 +- .../dbal/src/Driver/SQLSrv/Driver.php | 2 +- .../dbal/src/Driver/SQLSrv/Statement.php | 6 +- .../dbal/src/Driver/SQLite3/Driver.php | 2 +- .../doctrine/dbal/src/DriverManager.php | 7 +- .../src/Event/Listeners/OracleSessionInit.php | 2 +- .../src/Event/Listeners/SQLSessionInit.php | 2 +- .../src/Event/Listeners/SQLiteSessionInit.php | 2 +- .../src/Id/TableGeneratorSchemaVisitor.php | 12 +- .../doctrine/dbal/src/Logging/DebugStack.php | 4 +- .../doctrine/dbal/src/Logging/LoggerChain.php | 4 +- .../doctrine/dbal/src/Logging/Statement.php | 6 +- .../src/Platforms/AbstractMySQLPlatform.php | 18 +- .../dbal/src/Platforms/AbstractPlatform.php | 4 +- .../dbal/src/Platforms/DB2Platform.php | 24 +- .../src/Platforms/Keywords/DB2Keywords.php | 4 +- .../Platforms/Keywords/MariaDBKeywords.php | 2 +- .../Platforms/Keywords/MySQL57Keywords.php | 4 +- .../Platforms/Keywords/MySQL80Keywords.php | 4 +- .../src/Platforms/Keywords/MySQLKeywords.php | 4 +- .../src/Platforms/Keywords/OracleKeywords.php | 4 +- .../Platforms/Keywords/PostgreSQLKeywords.php | 4 +- .../Keywords/ReservedKeywordsValidator.php | 12 +- .../Platforms/Keywords/SQLServerKeywords.php | 4 +- .../src/Platforms/Keywords/SQLiteKeywords.php | 4 +- .../dbal/src/Platforms/MariaDBPlatform.php | 2 +- .../dbal/src/Platforms/MySQL57Platform.php | 14 +- .../dbal/src/Platforms/MySQL80Platform.php | 2 +- .../dbal/src/Platforms/OraclePlatform.php | 18 +- .../dbal/src/Platforms/PostgreSQLPlatform.php | 59 +- .../dbal/src/Platforms/SQLServerPlatform.php | 24 +- .../dbal/src/Platforms/SqlitePlatform.php | 12 +- .../dbal/src/Portability/Statement.php | 2 +- .../dbal/src/Schema/AbstractSchemaManager.php | 8 +- .../doctrine/dbal/src/Schema/Column.php | 14 +- .../doctrine/dbal/src/Schema/Comparator.php | 2 +- .../dbal/src/Schema/DB2SchemaManager.php | 14 +- .../dbal/src/Schema/ForeignKeyConstraint.php | 2 +- app/vendor/doctrine/dbal/src/Schema/Index.php | 6 +- .../dbal/src/Schema/MySQLSchemaManager.php | 14 +- .../dbal/src/Schema/OracleSchemaManager.php | 20 +- .../src/Schema/PostgreSQLSchemaManager.php | 19 +- .../src/Schema/SQLServerSchemaManager.php | 24 +- .../dbal/src/Schema/SqliteSchemaManager.php | 24 +- app/vendor/doctrine/dbal/src/Schema/Table.php | 4 +- .../doctrine/dbal/src/Schema/TableDiff.php | 4 +- .../dbal/src/Schema/UniqueConstraint.php | 4 +- .../src/Schema/Visitor/AbstractVisitor.php | 2 +- .../Visitor/CreateSchemaSqlCollector.php | 8 +- .../Schema/Visitor/DropSchemaSqlCollector.php | 6 +- .../dbal/src/Schema/Visitor/Graphviz.php | 6 +- .../Schema/Visitor/RemoveNamespacedAssets.php | 8 +- .../Console/Command/ReservedWordsCommand.php | 2 +- .../Tools/Console/Command/RunSqlCommand.php | 2 +- .../doctrine/dbal/src/Tools/DsnParser.php | 4 +- .../doctrine/dbal/src/Types/ArrayType.php | 10 +- .../dbal/src/Types/AsciiStringType.php | 2 +- .../doctrine/dbal/src/Types/BigIntType.php | 8 +- .../doctrine/dbal/src/Types/BinaryType.php | 8 +- .../doctrine/dbal/src/Types/BlobType.php | 8 +- .../doctrine/dbal/src/Types/BooleanType.php | 10 +- .../dbal/src/Types/DateImmutableType.php | 8 +- .../dbal/src/Types/DateIntervalType.php | 10 +- .../dbal/src/Types/DateTimeImmutableType.php | 8 +- .../doctrine/dbal/src/Types/DateTimeType.php | 8 +- .../src/Types/DateTimeTzImmutableType.php | 8 +- .../dbal/src/Types/DateTimeTzType.php | 8 +- .../doctrine/dbal/src/Types/DateType.php | 8 +- .../doctrine/dbal/src/Types/DecimalType.php | 6 +- .../doctrine/dbal/src/Types/FloatType.php | 6 +- .../doctrine/dbal/src/Types/GuidType.php | 6 +- .../doctrine/dbal/src/Types/IntegerType.php | 8 +- .../doctrine/dbal/src/Types/JsonType.php | 10 +- .../doctrine/dbal/src/Types/ObjectType.php | 10 +- .../dbal/src/Types/SimpleArrayType.php | 10 +- .../doctrine/dbal/src/Types/SmallIntType.php | 8 +- .../doctrine/dbal/src/Types/StringType.php | 4 +- .../doctrine/dbal/src/Types/TextType.php | 6 +- .../dbal/src/Types/TimeImmutableType.php | 8 +- .../doctrine/dbal/src/Types/TimeType.php | 8 +- app/vendor/doctrine/dbal/src/Types/Type.php | 3 +- .../src/Types/VarDateTimeImmutableType.php | 8 +- .../dbal/src/Types/VarDateTimeType.php | 2 +- ...ager-get-available-drivers-return-type.php | 18 - ...ager-retrieves-correct-connection-type.php | 19 - app/vendor/doctrine/deprecations/LICENSE | 19 + app/vendor/doctrine/deprecations/README.md | 7 +- .../doctrine/deprecations/composer.json | 20 +- .../lib/Doctrine/Deprecations/Deprecation.php | 104 +- app/vendor/doctrine/deprecations/phpstan.neon | 9 + app/vendor/doctrine/deprecations/psalm.xml | 30 + .../test_fixtures/vendor/doctrine/foo/Bar.php | 24 - .../test_fixtures/vendor/doctrine/foo/Baz.php | 14 - .../laminas/laminas-diactoros/composer.json | 8 +- .../laminas-diactoros/src/HeaderSecurity.php | 2 +- .../FilterUsingXForwardedHeaders.php | 14 +- .../src/ServerRequestFilter/IPRange.php | 10 +- .../laminas/laminas-diactoros/src/Stream.php | 8 +- .../laminas/laminas-diactoros/src/Uri.php | 25 +- .../laminas-diactoros/src/UriFactory.php | 17 +- .../src/functions/marshal_uri_from_sapi.php | 6 +- .../laminas-httphandlerrunner/composer.json | 18 +- .../src/Emitter/EmitterStack.php | 3 - .../deep-copy/.github/workflows/ci.yaml | 101 + app/vendor/myclabs/deep-copy/README.md | 35 +- .../deep-copy/src/DeepCopy/DeepCopy.php | 5 + .../src/DeepCopy/Filter/ChainableFilter.php | 24 + app/vendor/nikic/php-parser/grammar/php5.y | 2 +- app/vendor/nikic/php-parser/grammar/php7.y | 22 +- .../lib/PhpParser/Builder/ClassConst.php | 18 +- .../lib/PhpParser/Builder/Param.php | 48 +- .../lib/PhpParser/BuilderFactory.php | 6 +- .../Internal/PrintableNewAnonClassNode.php | 9 +- .../PhpParser/Node/Expr/ClassConstFetch.php | 10 +- .../php-parser/lib/PhpParser/Node/Name.php | 14 +- .../lib/PhpParser/Node/Stmt/ClassConst.php | 19 +- .../php-parser/lib/PhpParser/Parser/Php5.php | 2 +- .../php-parser/lib/PhpParser/Parser/Php7.php | 2098 +++++++++-------- .../lib/PhpParser/ParserAbstract.php | 21 + .../lib/PhpParser/PrettyPrinter/Standard.php | 27 +- .../lib/PhpParser/PrettyPrinterAbstract.php | 69 +- app/vendor/phpstan/phpdoc-parser/README.md | 99 +- .../phpstan/phpdoc-parser/composer.json | 2 + .../phpdoc-parser/phpstan-baseline.neon | 31 + .../src/Ast/AbstractNodeVisitor.php | 34 + .../phpdoc-parser/src/Ast/Attribute.php | 16 + .../ConstExpr/DoctrineConstExprStringNode.php | 42 + .../QuoteAwareConstExprStringNode.php | 78 + .../phpdoc-parser/src/Ast/NodeTraverser.php | 312 +++ .../phpdoc-parser/src/Ast/NodeVisitor.php | 87 + .../src/Ast/NodeVisitor/CloningVisitor.php | 20 + .../PhpDoc/Doctrine/DoctrineAnnotation.php | 35 + .../Ast/PhpDoc/Doctrine/DoctrineArgument.php | 43 + .../src/Ast/PhpDoc/Doctrine/DoctrineArray.php | 32 + .../Ast/PhpDoc/Doctrine/DoctrineArrayItem.php | 47 + .../PhpDoc/Doctrine/DoctrineTagValueNode.php | 36 + .../src/Ast/PhpDoc/InvalidTagValueNode.php | 3 +- .../src/Ast/PhpDoc/MethodTagValueNode.php | 4 + .../src/Ast/PhpDoc/PhpDocTagNode.php | 5 + .../src/Ast/Type/ArrayShapeNode.php | 15 +- .../src/Ast/Type/ArrayTypeNode.php | 8 + .../src/Ast/Type/CallableTypeNode.php | 9 +- .../Ast/Type/CallableTypeParameterNode.php | 4 +- .../src/Ast/Type/GenericTypeNode.php | 4 + .../src/Ast/Type/IntersectionTypeNode.php | 12 +- .../src/Ast/Type/InvalidTypeNode.php | 38 + .../src/Ast/Type/ObjectShapeItemNode.php | 48 + .../src/Ast/Type/ObjectShapeNode.php | 31 + .../src/Ast/Type/OffsetAccessTypeNode.php | 8 + .../src/Ast/Type/UnionTypeNode.php | 12 +- .../phpstan/phpdoc-parser/src/Lexer/Lexer.php | 76 +- .../src/Parser/ConstExprParser.php | 287 ++- .../src/Parser/ParserException.php | 21 +- .../phpdoc-parser/src/Parser/PhpDocParser.php | 659 +++++- .../src/Parser/StringUnescaper.php | 96 + .../src/Parser/TokenIterator.php | 209 +- .../phpdoc-parser/src/Parser/TypeParser.php | 390 ++- .../phpdoc-parser/src/Printer/DiffElem.php | 44 + .../phpdoc-parser/src/Printer/Differ.php | 196 ++ .../phpdoc-parser/src/Printer/Printer.php | 828 +++++++ .../{ChangeLog.md => ChangeLog-9.2.md} | 26 + .../phpunit/php-code-coverage/composer.json | 9 +- .../php-code-coverage/src/CodeCoverage.php | 31 +- .../php-code-coverage/src/Report/Clover.php | 5 +- .../src/Report/Cobertura.php | 5 +- .../php-code-coverage/src/Report/Crap4j.php | 5 +- .../src/Report/Html/Renderer/Dashboard.php | 2 +- .../src/Report/Html/Renderer/File.php | 40 +- .../Html/Renderer/Template/css/style.css | 28 + .../php-code-coverage/src/Report/PHP.php | 5 +- .../src/Report/Xml/Tests.php | 1 - .../src/StaticAnalysis/CacheWarmer.php | 4 +- .../StaticAnalysis/CachingFileAnalyser.php | 41 +- .../StaticAnalysis/CodeUnitFindingVisitor.php | 55 +- .../ExecutableLinesFindingVisitor.php | 10 +- .../phpunit/php-code-coverage/src/Version.php | 2 +- app/vendor/phpunit/phpunit/ChangeLog-8.5.md | 297 --- app/vendor/phpunit/phpunit/ChangeLog-9.6.md | 56 +- app/vendor/phpunit/phpunit/README.md | 2 +- app/vendor/phpunit/phpunit/SECURITY.md | 28 +- app/vendor/phpunit/phpunit/composer.json | 7 +- app/vendor/phpunit/phpunit/phpunit | 19 +- app/vendor/phpunit/phpunit/phpunit.xsd | 2 +- .../phpunit/phpunit/src/Framework/Assert.php | 208 +- .../src/Framework/Assert/Functions.php | 2 +- .../Constraint/Cardinality/Count.php | 6 +- .../Constraint/Cardinality/IsEmpty.php | 2 +- .../src/Framework/Constraint/Constraint.php | 4 +- .../Framework/Constraint/Equality/IsEqual.php | 12 +- .../Equality/IsEqualCanonicalizing.php | 10 +- .../Equality/IsEqualIgnoringCase.php | 10 +- .../Constraint/Equality/IsEqualWithDelta.php | 10 +- .../Constraint/Exception/Exception.php | 6 +- .../Constraint/Exception/ExceptionCode.php | 2 +- .../Constraint/Exception/ExceptionMessage.php | 4 +- .../ExceptionMessageRegularExpression.php | 4 +- .../Constraint/Filesystem/DirectoryExists.php | 2 +- .../Constraint/Filesystem/FileExists.php | 2 +- .../Constraint/Filesystem/IsReadable.php | 2 +- .../Constraint/Filesystem/IsWritable.php | 2 +- .../src/Framework/Constraint/IsIdentical.php | 4 +- .../src/Framework/Constraint/JsonMatches.php | 4 +- .../Constraint/Object/ClassHasAttribute.php | 6 +- .../Object/ClassHasStaticAttribute.php | 4 +- .../Constraint/Object/ObjectEquals.php | 18 +- .../Constraint/Operator/LogicalNot.php | 6 +- .../Constraint/Operator/LogicalXor.php | 2 +- .../Framework/Constraint/String/IsJson.php | 4 +- .../Constraint/String/RegularExpression.php | 2 +- .../Constraint/String/StringContains.php | 2 +- .../String/StringMatchesFormatDescription.php | 8 +- .../Constraint/String/StringStartsWith.php | 3 +- .../Traversable/TraversableContains.php | 2 +- .../Traversable/TraversableContainsOnly.php | 2 +- .../Constraint/Type/IsInstanceOf.php | 4 +- .../src/Framework/Constraint/Type/IsType.php | 6 +- .../ActualValueIsNotAnObjectException.php | 2 +- ...hodDoesNotAcceptParameterTypeException.php | 4 +- ...dDoesNotDeclareBoolReturnTypeException.php | 4 +- ...NotDeclareExactlyOneParameterException.php | 4 +- ...odDoesNotDeclareParameterTypeException.php | 4 +- .../ComparisonMethodDoesNotExistException.php | 4 +- .../Exception/InvalidArgumentException.php | 4 +- .../Framework/ExecutionOrderDependency.php | 8 +- .../src/Framework/MockObject/Api/Api.php | 4 +- .../src/Framework/MockObject/Api/Method.php | 2 +- .../MockObject/Builder/InvocationMocker.php | 4 +- .../MockObject/Builder/InvocationStubber.php | 16 +- .../CannotUseAddMethodsException.php | 4 +- .../CannotUseOnlyMethodsException.php | 4 +- .../Exception/ClassAlreadyExistsException.php | 4 +- .../Exception/ClassIsFinalException.php | 4 +- .../Exception/ClassIsReadonlyException.php | 4 +- .../Exception/DuplicateMethodException.php | 4 +- .../IncompatibleReturnValueException.php | 4 +- .../Exception/InvalidMethodNameException.php | 4 +- .../MatchBuilderNotFoundException.php | 4 +- .../MatcherAlreadyRegisteredException.php | 4 +- .../MethodCannotBeConfiguredException.php | 4 +- .../ReturnValueNotConfiguredException.php | 4 +- .../SoapExtensionNotAvailableException.php | 2 +- .../Exception/UnknownClassException.php | 4 +- .../Exception/UnknownTraitException.php | 4 +- .../Exception/UnknownTypeException.php | 4 +- .../src/Framework/MockObject/Generator.php | 95 +- .../src/Framework/MockObject/Invocation.php | 14 +- .../MockObject/InvocationHandler.php | 2 +- .../src/Framework/MockObject/Matcher.php | 20 +- .../MockObject/MethodNameConstraint.php | 2 +- .../src/Framework/MockObject/MockBuilder.php | 14 +- .../src/Framework/MockObject/MockClass.php | 2 +- .../src/Framework/MockObject/MockMethod.php | 22 +- .../MockObject/Rule/ConsecutiveParameters.php | 12 +- .../MockObject/Rule/InvokedAtIndex.php | 4 +- .../MockObject/Rule/InvokedAtLeastCount.php | 2 +- .../MockObject/Rule/InvokedAtLeastOnce.php | 2 +- .../MockObject/Rule/InvokedAtMostCount.php | 2 +- .../MockObject/Rule/InvokedCount.php | 6 +- .../Framework/MockObject/Rule/Parameters.php | 8 +- .../MockObject/Stub/ConsecutiveCalls.php | 2 +- .../Framework/MockObject/Stub/Exception.php | 2 +- .../MockObject/Stub/ReturnCallback.php | 2 +- .../MockObject/Stub/ReturnReference.php | 2 +- .../Framework/MockObject/Stub/ReturnStub.php | 2 +- .../phpunit/src/Framework/TestBuilder.php | 32 +- .../phpunit/src/Framework/TestCase.php | 158 +- .../phpunit/src/Framework/TestFailure.php | 2 +- .../phpunit/src/Framework/TestResult.php | 69 +- .../phpunit/src/Framework/TestSuite.php | 62 +- .../src/Framework/TestSuiteIterator.php | 2 +- .../phpunit/src/Runner/BaseTestRunner.php | 6 +- .../src/Runner/DefaultTestResultCache.php | 10 +- .../src/Runner/Extension/ExtensionHandler.php | 14 +- .../src/Runner/Extension/PharLoader.php | 23 +- .../phpunit/src/Runner/Filter/Factory.php | 4 +- .../src/Runner/Filter/GroupFilterIterator.php | 2 +- .../src/Runner/Filter/NameFilterIterator.php | 10 +- .../phpunit/src/Runner/PhptTestCase.php | 22 +- .../src/Runner/StandardTestSuiteLoader.php | 28 +- .../phpunit/src/Runner/TestSuiteSorter.php | 10 +- .../phpunit/phpunit/src/Runner/Version.php | 2 +- .../src/TextUI/CliArguments/Builder.php | 7 +- .../phpunit/phpunit/src/TextUI/Command.php | 97 +- .../src/TextUI/DefaultResultPrinter.php | 64 +- .../TestDirectoryNotFoundException.php | 4 +- .../Exception/TestFileNotFoundException.php | 4 +- .../phpunit/phpunit/src/TextUI/Help.php | 5 +- .../phpunit/phpunit/src/TextUI/TestRunner.php | 84 +- .../phpunit/src/TextUI/TestSuiteMapper.php | 4 +- .../CodeCoverage/CodeCoverage.php | 16 +- .../CodeCoverage/FilterMapper.php | 4 +- .../src/TextUI/XmlConfiguration/Generator.php | 2 +- .../src/TextUI/XmlConfiguration/Loader.php | 160 +- .../Migration/MigrationBuilder.php | 6 +- .../Migrations/IntroduceCoverageElement.php | 2 +- .../Migrations/LogToReportMigration.php | 2 +- .../MoveWhitelistExcludesToCoverage.php | 2 +- ...hp => MoveWhitelistIncludesToCoverage.php} | 8 +- .../Migrations/UpdateSchemaLocationTo93.php | 2 +- .../XmlConfiguration/Migration/Migrator.php | 4 +- .../XmlConfiguration/PHP/PhpHandler.php | 2 +- .../phpunit/src/Util/Annotation/DocBlock.php | 45 +- .../phpunit/src/Util/Annotation/Registry.php | 4 +- app/vendor/phpunit/phpunit/src/Util/Color.php | 2 +- .../phpunit/phpunit/src/Util/ErrorHandler.php | 2 +- .../phpunit/phpunit/src/Util/ExcludeList.php | 4 +- .../phpunit/phpunit/src/Util/FileLoader.php | 2 +- .../phpunit/phpunit/src/Util/Filesystem.php | 2 +- .../phpunit/phpunit/src/Util/Filter.php | 4 +- .../phpunit/phpunit/src/Util/GlobalState.php | 92 +- app/vendor/phpunit/phpunit/src/Util/Json.php | 2 +- .../phpunit/phpunit/src/Util/Log/JUnit.php | 30 +- .../phpunit/phpunit/src/Util/Log/TeamCity.php | 12 +- .../src/Util/PHP/AbstractPhpProcess.php | 36 +- .../src/Util/PHP/DefaultPhpProcess.php | 10 +- .../src/Util/PHP/WindowsPhpProcess.php | 2 +- .../phpunit/phpunit/src/Util/Printer.php | 8 +- .../phpunit/src/Util/RegularExpression.php | 2 +- app/vendor/phpunit/phpunit/src/Util/Test.php | 56 +- .../src/Util/TestDox/CliTestDoxPrinter.php | 3 +- .../src/Util/TestDox/HtmlResultPrinter.php | 53 +- .../src/Util/TestDox/NamePrettifier.php | 6 +- .../src/Util/TestDox/TestDoxPrinter.php | 4 +- .../src/Util/TestDox/XmlResultPrinter.php | 6 +- .../phpunit/src/Util/TextTestListRenderer.php | 4 +- .../src/Util/VersionComparisonOperator.php | 4 +- .../src/Util/XdebugFilterScriptGenerator.php | 6 +- app/vendor/phpunit/phpunit/src/Util/Xml.php | 6 +- .../phpunit/phpunit/src/Util/Xml/Loader.php | 8 +- .../phpunit/src/Util/Xml/SchemaDetector.php | 2 +- .../phpunit/src/Util/Xml/SchemaFinder.php | 4 +- .../phpunit/src/Util/XmlTestListRenderer.php | 4 +- app/vendor/psr/http-client/README.md | 2 +- app/vendor/psr/http-client/composer.json | 4 +- app/vendor/psr/http-factory/.gitignore | 2 - app/vendor/psr/http-factory/.pullapprove.yml | 7 - app/vendor/psr/http-factory/README.md | 12 +- app/vendor/psr/http-factory/composer.json | 4 +- app/vendor/psr/http-message/README.md | 5 +- app/vendor/psr/http-message/composer.json | 4 +- .../psr/http-message/docs/PSR7-Interfaces.md | 130 + .../psr/http-message/docs/PSR7-Usage.md | 159 ++ .../psr/http-message/src/MessageInterface.php | 16 +- .../psr/http-message/src/RequestInterface.php | 10 +- .../http-message/src/ResponseInterface.php | 4 +- .../src/ServerRequestInterface.php | 8 +- .../psr/http-message/src/StreamInterface.php | 12 +- .../src/UploadedFileInterface.php | 4 +- .../psr/http-message/src/UriInterface.php | 17 +- app/vendor/psr/http-server-handler/README.md | 14 +- .../psr/http-server-handler/composer.json | 4 +- .../psr/http-server-middleware/README.md | 12 +- .../psr/http-server-middleware/composer.json | 4 +- app/vendor/psy/psysh/src/CodeCleaner.php | 18 +- .../CodeCleaner/EmptyArrayDimFetchPass.php | 13 +- .../src/CodeCleaner/ImplicitReturnPass.php | 2 +- .../psysh/src/CodeCleaner/StrictTypesPass.php | 8 + .../src/CodeCleaner/ValidClassNamePass.php | 1 + .../psysh/src/Command/ReflectingCommand.php | 52 +- .../psy/psysh/src/Command/TimeitCommand.php | 13 +- app/vendor/psy/psysh/src/ConfigPaths.php | 3 +- app/vendor/psy/psysh/src/Configuration.php | 44 +- .../psysh/src/Exception/ErrorException.php | 2 +- .../psysh/src/Exception/ThrowUpException.php | 2 +- .../src/Exception/TypeErrorException.php | 4 +- .../psy/psysh/src/Formatter/CodeFormatter.php | 2 +- .../src/Formatter/SignatureFormatter.php | 2 +- app/vendor/psy/psysh/src/Output/Theme.php | 27 +- .../psy/psysh/src/Readline/Hoa/Protocol.php | 2 +- .../src/Readline/Hoa/ProtocolNodeLibrary.php | 2 +- app/vendor/psy/psysh/src/Shell.php | 4 +- app/vendor/psy/psysh/src/SystemEnv.php | 34 + .../TabCompletion/Matcher/CommandsMatcher.php | 6 +- .../TabCompletion/Matcher/KeywordsMatcher.php | 2 +- app/vendor/psy/psysh/src/functions.php | 14 + app/vendor/react/promise/CHANGELOG.md | 14 + app/vendor/react/promise/README.md | 5 +- app/vendor/react/promise/composer.json | 2 +- app/vendor/react/promise/src/functions.php | 20 +- app/vendor/sebastian/diff/ChangeLog.md | 8 + ...ientLongestCommonSubsequenceCalculator.php | 7 +- ...ientLongestCommonSubsequenceCalculator.php | 24 +- .../sebastian/global-state/ChangeLog.md | 7 + .../sebastian/global-state/src/Restorer.php | 4 +- app/vendor/seld/jsonlint/CHANGELOG.md | 8 + app/vendor/seld/jsonlint/README.md | 1 + .../jsonlint/src/Seld/JsonLint/JsonParser.php | 9 +- .../seld/jsonlint/src/Seld/JsonLint/Lexer.php | 135 +- app/vendor/slevomat/coding-standard/README.md | 10 + .../Helpers/Annotation.php | 66 + .../Helpers/Annotation/Annotation.php | 72 - .../Helpers/Annotation/AssertAnnotation.php | 87 - .../Helpers/Annotation/ExtendsAnnotation.php | 75 - .../Helpers/Annotation/GenericAnnotation.php | 48 - .../Annotation/ImplementsAnnotation.php | 75 - .../Helpers/Annotation/MethodAnnotation.php | 142 -- .../Helpers/Annotation/MixinAnnotation.php | 81 - .../Annotation/ParameterAnnotation.php | 114 - .../Annotation/ParameterOutAnnotation.php | 102 - .../Helpers/Annotation/PropertyAnnotation.php | 99 - .../Helpers/Annotation/ReturnAnnotation.php | 92 - .../Helpers/Annotation/SelfOutAnnotation.php | 94 - .../Helpers/Annotation/TemplateAnnotation.php | 101 - .../Helpers/Annotation/ThrowsAnnotation.php | 82 - .../Annotation/TypeAliasAnnotation.php | 67 - .../Annotation/TypeImportAnnotation.php | 100 - .../Helpers/Annotation/UseAnnotation.php | 75 - .../Helpers/Annotation/VariableAnnotation.php | 102 - .../AnnotationConstantExpressionHelper.php | 73 - .../Helpers/AnnotationHelper.php | 661 ++---- .../Helpers/AnnotationTypeHelper.php | 478 +--- .../Helpers/ArrayHelper.php | 232 ++ .../Helpers/ArrayKeyValue.php | 172 ++ .../Helpers/AttributeHelper.php | 2 + .../Helpers/CatchHelper.php | 10 +- .../Helpers/ClassHelper.php | 4 +- .../Helpers/ConditionHelper.php | 24 +- .../Helpers/ConstantHelper.php | 2 +- .../Helpers/DocCommentHelper.php | 112 +- .../Helpers/FixerHelper.php | 6 + .../Helpers/FunctionHelper.php | 90 +- .../Helpers/IndentationHelper.php | 14 +- .../Helpers/NamespaceHelper.php | 4 +- .../Helpers/ParsedDocComment.php | 108 + .../Helpers/PhpDocParserHelper.php | 82 + .../Helpers/ReferencedNameHelper.php | 10 +- .../Helpers/ScopeHelper.php | 2 +- .../Helpers/SniffSettingsHelper.php | 4 +- .../Helpers/SuppressHelper.php | 35 +- .../Helpers/TokenHelper.php | 22 +- .../Helpers/TypeHintHelper.php | 60 +- .../Helpers/UseStatementHelper.php | 2 +- .../Helpers/YodaHelper.php | 8 +- .../AlphabeticallySortedByKeysSniff.php | 85 + .../Sniffs/Arrays/ArrayAccessSniff.php | 76 + .../DisallowImplicitArrayCreationSniff.php | 8 +- .../Arrays/DisallowPartiallyKeyedSniff.php | 42 + ...MultiLineArrayEndBracketPlacementSniff.php | 30 +- .../Arrays/SingleLineArrayWhitespaceSniff.php | 36 +- .../Sniffs/Arrays/TrailingArrayCommaSniff.php | 34 +- .../AttributeAndTargetSpacingSniff.php | 7 + .../RequireAttributeAfterDocCommentSniff.php | 2 +- ...actPropertyConstantAndEnumCaseSpacing.php} | 11 +- .../Classes/ClassConstantVisibilitySniff.php | 8 +- .../Sniffs/Classes/ClassStructureSniff.php | 8 +- .../Sniffs/Classes/ConstantSpacingSniff.php | 10 +- ...llowStringExpressionPropertyFetchSniff.php | 84 + .../Sniffs/Classes/EnumCaseSpacingSniff.php | 54 + .../Classes/ForbiddenPublicPropertySniff.php | 2 +- .../Classes/MissingClassGroupsException.php | 2 +- .../Classes/ModernClassNameReferenceSniff.php | 3 +- .../Sniffs/Classes/ParentCallSpacingSniff.php | 7 +- .../Classes/PropertyDeclarationSniff.php | 12 +- .../Sniffs/Classes/PropertySpacingSniff.php | 2 +- ...quireConstructorPropertyPromotionSniff.php | 26 +- .../RequireMultiLineMethodSignatureSniff.php | 44 +- .../Classes/RequireSelfReferenceSniff.php | 118 + .../RequireSingleLineMethodSignatureSniff.php | 18 +- .../Classes/TraitUseDeclarationSniff.php | 3 +- .../Sniffs/Classes/TraitUseSpacingSniff.php | 2 +- .../Sniffs/Commenting/AnnotationNameSniff.php | 299 +++ .../DeprecatedAnnotationDeclarationSniff.php | 9 +- .../DisallowCommentAfterCodeSniff.php | 13 +- ...DisallowOneLinePropertyDocCommentSniff.php | 2 +- .../Commenting/DocCommentSpacingSniff.php | 142 +- .../Commenting/ForbiddenAnnotationsSniff.php | 112 +- .../Commenting/ForbiddenCommentsSniff.php | 4 +- .../InlineDocCommentDeclarationSniff.php | 34 +- .../UselessFunctionDocCommentSniff.php | 4 +- .../Sniffs/Complexity/CognitiveSniff.php | 33 +- .../AbstractControlStructureSpacing.php | 10 +- .../AbstractLineCondition.php | 6 +- .../BlockControlStructureSpacingSniff.php | 6 +- ...wTrailingMultiLineTernaryOperatorSniff.php | 88 + .../ControlStructures/EarlyExitSniff.php | 72 +- .../JumpStatementsSpacingSniff.php | 6 +- .../NewWithParenthesesSniff.php | 6 + .../RequireMultiLineTernaryOperatorSniff.php | 13 +- .../RequireNullCoalesceEqualOperatorSniff.php | 5 +- .../RequireNullCoalesceOperatorSniff.php | 4 +- .../RequireNullSafeObjectOperatorSniff.php | 137 +- .../RequireShortTernaryOperatorSniff.php | 4 +- .../RequireTernaryOperatorSniff.php | 15 +- .../UselessIfConditionWithReturnSniff.php | 10 +- .../UselessTernaryOperatorSniff.php | 3 +- .../Sniffs/Exceptions/DeadCatchSniff.php | 4 +- .../ReferenceThrowableOnlySniff.php | 7 +- .../Files/FilepathNamespaceExtractor.php | 14 +- .../Files/TypeNameMatchesFileNameSniff.php | 20 +- .../Functions/RequireArrowFunctionSniff.php | 8 +- .../AbstractFullyQualifiedGlobalReference.php | 16 +- .../AlphabeticallySortedUsesSniff.php | 36 +- ...llyQualifiedClassNameInAnnotationSniff.php | 218 +- .../FullyQualifiedExceptionsSniff.php | 16 +- .../FullyQualifiedGlobalFunctionsSniff.php | 2 +- .../ReferenceUsedNamesOnlySniff.php | 199 +- .../Sniffs/Namespaces/UnusedUsesSniff.php | 171 +- .../UseOnlyWhitelistedNamespacesSniff.php | 6 +- .../Sniffs/Namespaces/UseSpacingSniff.php | 4 +- ...RequireCombinedAssignmentOperatorSniff.php | 11 +- .../Sniffs/PHP/ForbiddenClassesSniff.php | 11 +- ...ptimizedFunctionsWithoutUnpackingSniff.php | 5 + .../PHP/RequireExplicitAssertionSniff.php | 31 +- .../Strings/DisallowVariableParsingSniff.php | 154 ++ .../Sniffs/TestCase.php | 70 +- .../TypeHints/DeclareStrictTypesSniff.php | 10 +- .../DisallowArrayTypeHintSyntaxSniff.php | 235 +- .../TypeHints/DisallowMixedTypeHintSniff.php | 36 +- .../Sniffs/TypeHints/LongTypeHintsSniff.php | 84 +- .../NullTypeHintOnLastPositionSniff.php | 121 +- .../TypeHints/ParameterTypeHintSniff.php | 88 +- .../TypeHints/PropertyTypeHintSniff.php | 97 +- .../Sniffs/TypeHints/ReturnTypeHintSniff.php | 47 +- .../TypeHints/UnionTypeHintFormatSniff.php | 3 +- .../UselessConstantTypeHintSniff.php | 8 +- .../DisallowVariableVariableSniff.php | 35 + .../Sniffs/Variables/UnusedVariableSniff.php | 6 +- .../Sniffs/Variables/UselessVariableSniff.php | 51 +- .../Whitespaces/DuplicateSpacesSniff.php | 8 +- .../slevomat/coding-standard/composer.json | 20 +- .../slevomat/coding-standard/doc/arrays.md | 20 +- .../coding-standard/doc/attributes.md | 5 +- .../slevomat/coding-standard/doc/classes.md | 34 +- .../coding-standard/doc/commenting.md | 19 +- .../coding-standard/doc/complexity.md | 3 +- .../coding-standard/doc/control-structures.md | 21 +- .../slevomat/coding-standard/doc/files.md | 4 +- .../slevomat/coding-standard/doc/functions.md | 4 +- .../coding-standard/doc/namespaces.md | 14 +- .../slevomat/coding-standard/doc/php.md | 4 +- .../slevomat/coding-standard/doc/strings.md | 11 + .../coding-standard/doc/type-hints.md | 8 +- .../slevomat/coding-standard/doc/variables.md | 4 + .../squizlabs/php_codesniffer/composer.json | 3 +- .../squizlabs/php_codesniffer/src/Config.php | 2 +- .../php_codesniffer/src/Files/File.php | 2 +- .../squizlabs/php_codesniffer/src/Ruleset.php | 7 +- .../squizlabs/php_codesniffer/src/Runner.php | 47 + .../src/Sniffs/AbstractArraySniff.php | 6 +- .../Classes/OpeningBraceSameLineStandard.xml | 8 + .../Docs/Formatting/SpaceAfterNotStandard.xml | 7 +- .../ArbitraryParenthesesSpacingStandard.xml | 7 +- .../FunctionCallArgumentSpacingSniff.php | 1 + .../PHP/DisallowRequestSuperglobalSniff.php | 5 +- .../Generic/Sniffs/PHP/LowerCaseTypeSniff.php | 1 + .../Sniffs/PHP/UpperCaseConstantSniff.php | 2 - .../WhiteSpace/DisallowTabIndentSniff.php | 2 + .../Sniffs/WhiteSpace/ScopeIndentSniff.php | 32 +- .../SpreadOperatorSpacingAfterSniff.php | 5 + .../Tests/Arrays/ArrayIndentUnitTest.inc | 13 + .../Arrays/ArrayIndentUnitTest.inc.fixed | 13 + .../Tests/Arrays/ArrayIndentUnitTest.php | 37 +- .../FunctionCallArgumentSpacingUnitTest.inc | 9 + ...ctionCallArgumentSpacingUnitTest.inc.fixed | 9 + .../FunctionCallArgumentSpacingUnitTest.php | 1 + .../Tests/PHP/LowerCaseTypeUnitTest.inc | 3 + .../Tests/PHP/LowerCaseTypeUnitTest.inc.fixed | 3 + .../Tests/PHP/LowerCaseTypeUnitTest.php | 1 + .../ArbitraryParenthesesSpacingUnitTest.inc | 12 + ...itraryParenthesesSpacingUnitTest.inc.fixed | 12 + .../DisallowTabIndentUnitTest.3.inc | 13 + .../DisallowTabIndentUnitTest.3.inc.fixed | 13 + .../WhiteSpace/DisallowTabIndentUnitTest.php | 20 +- .../WhiteSpace/ScopeIndentUnitTest.1.inc | 7 + .../ScopeIndentUnitTest.1.inc.fixed | 7 + .../WhiteSpace/ScopeIndentUnitTest.2.inc | 7 + .../ScopeIndentUnitTest.2.inc.fixed | 7 + .../Tests/WhiteSpace/ScopeIndentUnitTest.php | 8 +- .../SpreadOperatorSpacingAfterUnitTest.inc | 6 + ...readOperatorSpacingAfterUnitTest.inc.fixed | 6 + .../Functions/FunctionCallSignatureSniff.php | 5 +- .../FunctionCallSignatureUnitTest.inc | 19 + .../FunctionCallSignatureUnitTest.inc.fixed | 19 + .../FunctionCallSignatureUnitTest.php | 3 + .../Classes/AnonClassDeclarationSniff.php | 4 +- .../Classes/ClassInstantiationSniff.php | 1 + .../Classes/ClassInstantiationUnitTest.inc | 3 + .../ClassInstantiationUnitTest.inc.fixed | 3 + .../Classes/ClassInstantiationUnitTest.php | 1 + .../ForLoopDeclarationSniff.php | 2 +- .../Formatting/OperatorBracketSniff.php | 2 + .../PHP/DisallowComparisonAssignmentSniff.php | 13 +- .../Sniffs/Scope/StaticThisUsageSniff.php | 6 +- .../WhiteSpace/OperatorSpacingSniff.php | 13 +- .../FileCommentUnitTest.1.inc.fixed | 2 +- .../Commenting/FileCommentUnitTest.1.js.fixed | 2 +- .../Formatting/OperatorBracketUnitTest.inc | 8 + .../OperatorBracketUnitTest.inc.fixed | 8 + .../DisallowComparisonAssignmentUnitTest.inc | 10 + .../WhiteSpace/OperatorSpacingUnitTest.inc | 6 + .../OperatorSpacingUnitTest.inc.fixed | 6 + .../php_codesniffer/src/Tokenizers/PHP.php | 11 +- .../src/Tokenizers/Tokenizer.php | 2 + .../php_codesniffer/src/Util/Common.php | 2 +- .../php_codesniffer/src/Util/Tokens.php | 1 + .../Autoloader/DetermineLoadedClassTest.php | 11 +- .../Core/File/FindEndOfStatementTest.inc | 4 +- .../Core/File/FindStartOfStatementTest.php | 4 +- .../Core/File/GetMemberPropertiesTest.php | 22 +- .../Core/File/GetMethodParametersTest.php | 112 +- .../Core/File/GetMethodPropertiesTest.php | 1 - .../tests/Core/File/IsReferenceTest.inc | 4 +- .../tests/Core/Tokenizer/AttributesTest.php | 3 +- .../Tokenizer/HeredocNowdocCloserTest.inc | 43 + .../Tokenizer/HeredocNowdocCloserTest.php | 150 ++ .../Core/Tokenizer/HeredocStringTest.inc | 193 ++ .../Core/Tokenizer/HeredocStringTest.php | 153 ++ .../NamedFunctionCallArgumentsTest.inc | 3 + .../NamedFunctionCallArgumentsTest.php | 1 + .../ScopeSettingWithNamespaceOperatorTest.inc | 2 +- .../tests/Core/Tokenizer/ShortArrayTest.inc | 14 + .../tests/Core/Tokenizer/ShortArrayTest.php | 63 +- .../config/Builder/ConfigBuilderGenerator.php | 4 +- app/vendor/symfony/config/CHANGELOG.md | 5 + .../symfony/config/ConfigCacheInterface.php | 2 + .../symfony/config/Definition/ArrayNode.php | 23 + .../symfony/config/Definition/BaseNode.php | 33 +- .../symfony/config/Definition/BooleanNode.php | 3 + .../Builder/ArrayNodeDefinition.php | 7 + .../Builder/BuilderAwareInterface.php | 2 + .../Definition/Builder/EnumNodeDefinition.php | 2 - .../config/Definition/Builder/TreeBuilder.php | 3 + .../Definition/Dumper/XmlReferenceDumper.php | 18 +- .../Definition/Dumper/YamlReferenceDumper.php | 17 +- .../symfony/config/Definition/EnumNode.php | 46 +- .../InvalidConfigurationException.php | 5 + .../symfony/config/Definition/FloatNode.php | 3 + .../symfony/config/Definition/IntegerNode.php | 3 + .../symfony/config/Definition/Processor.php | 6 +- .../Definition/PrototypeNodeInterface.php | 2 + .../config/Definition/PrototypedArrayNode.php | 12 + .../symfony/config/Definition/ScalarNode.php | 3 + .../config/Definition/VariableNode.php | 11 + .../FileLocatorFileNotFoundException.php | 3 + .../config/Exception/LoaderLoadException.php | 3 + app/vendor/symfony/config/FileLocator.php | 3 + app/vendor/symfony/config/LICENSE | 2 +- .../symfony/config/Loader/FileLoader.php | 8 +- app/vendor/symfony/config/Loader/Loader.php | 3 + .../symfony/config/Loader/LoaderInterface.php | 2 + .../symfony/config/Loader/LoaderResolver.php | 3 + .../Resource/ClassExistenceResource.php | 6 +- .../config/Resource/ComposerResource.php | 2 +- .../config/Resource/DirectoryResource.php | 2 +- .../symfony/config/Resource/GlobResource.php | 72 +- .../Resource/ReflectionClassResource.php | 6 +- .../config/ResourceCheckerConfigCache.php | 6 +- app/vendor/symfony/config/Util/XmlUtils.php | 3 + app/vendor/symfony/config/composer.json | 10 +- app/vendor/symfony/console/Application.php | 109 +- app/vendor/symfony/console/CHANGELOG.md | 7 + .../symfony/console/Command/Command.php | 18 +- .../console/Command/CompleteCommand.php | 12 +- .../console/Command/DumpCompletionCommand.php | 31 +- .../symfony/console/Command/HelpCommand.php | 14 +- .../symfony/console/Command/ListCommand.php | 11 +- .../symfony/console/Command/LockableTrait.php | 4 +- .../Command/SignalableCommandInterface.php | 6 +- .../console/Completion/CompletionInput.php | 2 +- .../AddConsoleCommandPass.php | 3 + .../Descriptor/ApplicationDescription.php | 2 +- .../symfony/console/Descriptor/Descriptor.php | 22 +- .../Descriptor/DescriptorInterface.php | 3 + .../console/Descriptor/JsonDescriptor.php | 12 +- .../console/Descriptor/MarkdownDescriptor.php | 38 +- .../Descriptor/ReStructuredTextDescriptor.php | 272 +++ .../console/Descriptor/TextDescriptor.php | 20 +- .../console/Descriptor/XmlDescriptor.php | 14 +- .../console/Event/ConsoleSignalEvent.php | 23 +- .../console/EventListener/ErrorListener.php | 6 + .../console/Formatter/OutputFormatter.php | 9 + .../Formatter/OutputFormatterInterface.php | 4 + .../Formatter/OutputFormatterStyle.php | 18 +- .../OutputFormatterStyleInterface.php | 10 + .../Formatter/OutputFormatterStyleStack.php | 4 + .../console/Helper/DescriptorHelper.php | 4 + app/vendor/symfony/console/Helper/Dumper.php | 14 +- app/vendor/symfony/console/Helper/Helper.php | 14 +- .../console/Helper/HelperInterface.php | 2 + .../symfony/console/Helper/HelperSet.php | 3 + .../console/Helper/InputAwareHelper.php | 3 + .../symfony/console/Helper/ProgressBar.php | 79 +- .../console/Helper/ProgressIndicator.php | 30 +- .../symfony/console/Helper/QuestionHelper.php | 33 +- .../console/Helper/SymfonyQuestionHelper.php | 6 + app/vendor/symfony/console/Helper/Table.php | 18 +- .../symfony/console/Helper/TableCellStyle.php | 4 +- .../symfony/console/Input/ArgvInput.php | 18 +- .../symfony/console/Input/ArrayInput.php | 9 +- app/vendor/symfony/console/Input/Input.php | 29 +- .../symfony/console/Input/InputArgument.php | 10 +- .../console/Input/InputAwareInterface.php | 2 + .../symfony/console/Input/InputDefinition.php | 14 + .../symfony/console/Input/InputInterface.php | 10 + .../symfony/console/Input/InputOption.php | 9 +- .../Input/StreamableInputInterface.php | 2 + app/vendor/symfony/console/LICENSE | 2 +- .../symfony/console/Output/AnsiColorMode.php | 22 +- .../symfony/console/Output/BufferedOutput.php | 3 + .../symfony/console/Output/ConsoleOutput.php | 12 + .../console/Output/ConsoleOutputInterface.php | 3 + .../console/Output/ConsoleSectionOutput.php | 19 +- .../symfony/console/Output/NullOutput.php | 15 + app/vendor/symfony/console/Output/Output.php | 17 + .../console/Output/OutputInterface.php | 11 + .../symfony/console/Output/StreamOutput.php | 3 + .../console/Output/TrimmedBufferOutput.php | 3 + .../symfony/console/Question/Question.php | 12 +- app/vendor/symfony/console/README.md | 16 + .../symfony/console/Resources/completion.bash | 10 + .../symfony/console/Resources/completion.zsh | 2 + .../symfony/console/Style/OutputStyle.php | 21 + .../symfony/console/Style/StyleInterface.php | 28 + .../symfony/console/Style/SymfonyStyle.php | 70 +- app/vendor/symfony/console/Terminal.php | 21 +- .../symfony/console/Tester/TesterTrait.php | 2 +- app/vendor/symfony/console/composer.json | 12 +- .../symfony/deprecation-contracts/LICENSE | 2 +- .../symfony/deprecation-contracts/README.md | 2 +- .../deprecation-contracts/composer.json | 2 +- app/vendor/symfony/filesystem/Filesystem.php | 48 +- app/vendor/symfony/filesystem/LICENSE | 2 +- .../finder/Comparator/NumberComparator.php | 2 +- app/vendor/symfony/finder/Finder.php | 10 +- app/vendor/symfony/finder/Gitignore.php | 4 +- .../ExcludeDirectoryFilterIterator.php | 1 + .../Iterator/RecursiveDirectoryIterator.php | 37 +- .../finder/Iterator/SortableIterator.php | 38 +- .../Iterator/VcsIgnoredFilterIterator.php | 4 +- app/vendor/symfony/finder/LICENSE | 2 +- .../Exception/ProcessFailedException.php | 3 + .../Exception/ProcessTimedOutException.php | 11 +- .../symfony/process/ExecutableFinder.php | 4 + app/vendor/symfony/process/InputStream.php | 10 +- app/vendor/symfony/process/LICENSE | 2 +- .../symfony/process/PhpExecutableFinder.php | 2 +- app/vendor/symfony/process/PhpProcess.php | 3 + .../symfony/process/Pipes/AbstractPipes.php | 6 +- .../symfony/process/Pipes/PipesInterface.php | 2 +- .../symfony/process/Pipes/WindowsPipes.php | 2 +- app/vendor/symfony/process/Process.php | 40 +- app/vendor/symfony/process/README.md | 15 - app/vendor/symfony/service-contracts/LICENSE | 2 +- .../symfony/service-contracts/README.md | 2 +- .../service-contracts/ResetInterface.php | 3 + .../ServiceProviderInterface.php | 2 +- .../ServiceSubscriberTrait.php | 9 +- .../Test/ServiceLocatorTest.php | 81 +- .../Test/ServiceLocatorTestCase.php | 92 + .../symfony/service-contracts/composer.json | 5 +- .../symfony/string/AbstractUnicodeString.php | 16 +- .../string/Inflector/EnglishInflector.php | 15 + app/vendor/symfony/string/LICENSE | 2 +- app/vendor/symfony/string/LazyString.php | 4 +- .../symfony/string/Slugger/AsciiSlugger.php | 7 +- app/vendor/symfony/string/composer.json | 4 +- app/vendor/symfony/var-dumper/CHANGELOG.md | 8 + .../symfony/var-dumper/Caster/AmqpCaster.php | 15 + .../symfony/var-dumper/Caster/Caster.php | 4 +- .../symfony/var-dumper/Caster/ClassStub.php | 7 +- .../symfony/var-dumper/Caster/DOMCaster.php | 45 + .../symfony/var-dumper/Caster/DateCaster.php | 14 +- .../var-dumper/Caster/DoctrineCaster.php | 9 + .../var-dumper/Caster/ExceptionCaster.php | 41 +- .../symfony/var-dumper/Caster/FiberCaster.php | 3 + .../symfony/var-dumper/Caster/IntlCaster.php | 15 + .../symfony/var-dumper/Caster/LinkStub.php | 2 +- .../var-dumper/Caster/MemcachedCaster.php | 3 + .../symfony/var-dumper/Caster/PdoCaster.php | 6 + .../symfony/var-dumper/Caster/PgSqlCaster.php | 9 + .../var-dumper/Caster/ProxyManagerCaster.php | 3 + .../var-dumper/Caster/RdKafkaCaster.php | 36 + .../symfony/var-dumper/Caster/RedisCaster.php | 32 +- .../var-dumper/Caster/ReflectionCaster.php | 53 +- .../var-dumper/Caster/ResourceCaster.php | 17 +- .../symfony/var-dumper/Caster/ScalarStub.php | 27 + .../symfony/var-dumper/Caster/SplCaster.php | 56 +- .../symfony/var-dumper/Caster/StubCaster.php | 23 + .../var-dumper/Caster/SymfonyCaster.php | 29 +- .../var-dumper/Caster/XmlReaderCaster.php | 3 + .../var-dumper/Caster/XmlResourceCaster.php | 3 + .../var-dumper/Cloner/AbstractCloner.php | 12 + app/vendor/symfony/var-dumper/Cloner/Data.php | 29 +- .../var-dumper/Cloner/DumperInterface.php | 8 + app/vendor/symfony/var-dumper/Cloner/Stub.php | 1 + .../symfony/var-dumper/Cloner/VarCloner.php | 2 - .../var-dumper/Command/ServerDumpCommand.php | 2 +- .../var-dumper/Dumper/AbstractDumper.php | 4 + .../symfony/var-dumper/Dumper/CliDumper.php | 63 +- .../ContextProvider/SourceContextProvider.php | 2 +- .../Dumper/ContextualizedDumper.php | 7 +- .../var-dumper/Dumper/DataDumperInterface.php | 3 + .../symfony/var-dumper/Dumper/HtmlDumper.php | 77 +- .../var-dumper/Dumper/ServerDumper.php | 7 +- app/vendor/symfony/var-dumper/LICENSE | 2 +- .../var-dumper/Resources/functions/dump.php | 38 +- .../symfony/var-dumper/Server/Connection.php | 14 +- app/vendor/symfony/var-dumper/VarDumper.php | 20 +- app/vendor/symfony/var-dumper/composer.json | 8 +- app/vendor/twig/markdown-extra/composer.json | 5 - app/vendor/twig/twig/CHANGELOG | 14 + app/vendor/twig/twig/composer.json | 7 +- app/vendor/twig/twig/src/Environment.php | 8 +- app/vendor/twig/twig/src/ExpressionParser.php | 17 +- .../twig/twig/src/Extension/CoreExtension.php | 26 +- app/vendor/twig/twig/src/Lexer.php | 20 +- .../src/Node/Expression/ArrayExpression.php | 64 +- app/vendor/twig/twig/src/Token.php | 6 + app/vendor/twig/twig/src/TwigFilter.php | 4 +- app/vendor/twig/twig/src/TwigFunction.php | 4 +- app/vendor/twig/twig/src/TwigTest.php | 4 +- 1127 files changed, 19408 insertions(+), 10570 deletions(-) mode change 120000 => 100755 app/vendor/bin/composer mode change 120000 => 100755 app/vendor/bin/doctrine-dbal mode change 120000 => 100755 app/vendor/bin/phinx mode change 120000 => 100755 app/vendor/bin/php-parse mode change 120000 => 100755 app/vendor/bin/phpcbf mode change 120000 => 100755 app/vendor/bin/phpcs mode change 120000 => 100755 app/vendor/bin/phpunit mode change 120000 => 100755 app/vendor/bin/psysh mode change 120000 => 100755 app/vendor/bin/var-dump-server rename app/vendor/cakephp/bake/{phpcs.xml.dist => phpcs.xml} (52%) create mode 100644 app/vendor/cakephp/chronos/compare-data.json create mode 100644 app/vendor/cakephp/chronos/docs/en/2-4-upgrade-guide.rst create mode 100644 app/vendor/cakephp/chronos/src/ChronosDate.php delete mode 100644 app/vendor/doctrine/dbal/static-analysis/driver-manager-get-available-drivers-return-type.php delete mode 100644 app/vendor/doctrine/dbal/static-analysis/driver-manager-retrieves-correct-connection-type.php create mode 100644 app/vendor/doctrine/deprecations/LICENSE create mode 100644 app/vendor/doctrine/deprecations/phpstan.neon create mode 100644 app/vendor/doctrine/deprecations/psalm.xml delete mode 100644 app/vendor/doctrine/deprecations/test_fixtures/vendor/doctrine/foo/Bar.php delete mode 100644 app/vendor/doctrine/deprecations/test_fixtures/vendor/doctrine/foo/Baz.php create mode 100644 app/vendor/myclabs/deep-copy/.github/workflows/ci.yaml create mode 100644 app/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php create mode 100644 app/vendor/phpstan/phpdoc-parser/phpstan-baseline.neon create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/AbstractNodeVisitor.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/Attribute.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/DoctrineConstExprStringNode.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/QuoteAwareConstExprStringNode.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/NodeTraverser.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor/CloningVisitor.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArgument.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArray.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/Type/InvalidTypeNode.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeItemNode.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeNode.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Parser/StringUnescaper.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Printer/DiffElem.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Printer/Differ.php create mode 100644 app/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php rename app/vendor/phpunit/php-code-coverage/{ChangeLog.md => ChangeLog-9.2.md} (96%) delete mode 100644 app/vendor/phpunit/phpunit/ChangeLog-8.5.md rename app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/{MoveWhitelistDirectoriesToCoverage.php => MoveWhitelistIncludesToCoverage.php} (83%) delete mode 100644 app/vendor/psr/http-factory/.gitignore delete mode 100644 app/vendor/psr/http-factory/.pullapprove.yml create mode 100644 app/vendor/psr/http-message/docs/PSR7-Interfaces.md create mode 100644 app/vendor/psr/http-message/docs/PSR7-Usage.md create mode 100644 app/vendor/psy/psysh/src/SystemEnv.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/Annotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/AssertAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ExtendsAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/GenericAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ImplementsAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/MethodAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/MixinAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterOutAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/PropertyAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ReturnAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/SelfOutAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TemplateAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ThrowsAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TypeAliasAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TypeImportAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/UseAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/VariableAnnotation.php delete mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationConstantExpressionHelper.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayHelper.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayKeyValue.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParsedDocComment.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PhpDocParserHelper.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/AlphabeticallySortedByKeysSniff.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/ArrayAccessSniff.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowPartiallyKeyedSniff.php rename app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/{AbstractPropertyAndConstantSpacing.php => AbstractPropertyConstantAndEnumCaseSpacing.php} (91%) create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowStringExpressionPropertyFetchSniff.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EnumCaseSpacingSniff.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSelfReferenceSniff.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AnnotationNameSniff.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowTrailingMultiLineTernaryOperatorSniff.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Strings/DisallowVariableParsingSniff.php create mode 100644 app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowVariableVariableSniff.php create mode 100644 app/vendor/slevomat/coding-standard/doc/strings.md create mode 100644 app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.3.inc create mode 100644 app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.3.inc.fixed create mode 100644 app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocNowdocCloserTest.inc create mode 100644 app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocNowdocCloserTest.php create mode 100644 app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.inc create mode 100644 app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.php create mode 100644 app/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php create mode 100644 app/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php create mode 100644 app/vendor/symfony/var-dumper/Caster/ScalarStub.php diff --git a/app/composer.lock b/app/composer.lock index 3ebb0d9ba..387b557d1 100644 --- a/app/composer.lock +++ b/app/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "cakephp/cakephp", - "version": "4.4.11", + "version": "4.4.16", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp.git", - "reference": "7d9b6a639e5c1f52a813696f6b347726a74f9680" + "reference": "f68c3c6f24d65cb869cceaa8975f2ca2e1d0f5b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp/zipball/7d9b6a639e5c1f52a813696f6b347726a74f9680", - "reference": "7d9b6a639e5c1f52a813696f6b347726a74f9680", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/f68c3c6f24d65cb869cceaa8975f2ca2e1d0f5b7", + "reference": "f68c3c6f24d65cb869cceaa8975f2ca2e1d0f5b7", "shasum": "" }, "require": { @@ -37,6 +37,14 @@ "psr/log": "^1.0 || ^2.0", "psr/simple-cache": "^1.0 || ^2.0" }, + "provide": { + "psr/container-implementation": "^1.0 || ^2.0", + "psr/http-client-implementation": "^1.0", + "psr/http-server-handler-implementation": "^1.0", + "psr/http-server-middleware-implementation": "^1.0", + "psr/log-implementation": "^1.0 || ^2.0", + "psr/simple-cache-implementation": "^1.0 || ^2.0" + }, "replace": { "cakephp/cache": "self.version", "cakephp/collection": "self.version", @@ -63,7 +71,7 @@ "suggest": { "ext-curl": "To enable more efficient network calls in Http\\Client.", "ext-openssl": "To use Security::encrypt() or have secure CSRF token generation.", - "lib-ICU": "The intl PHP library, to use Text::transliterate() or Text::slug()", + "lib-ICU": "To use locale-aware features in the I18n and Database packages", "paragonie/csp-builder": "CSP builder, to use the CSP Middleware" }, "type": "library", @@ -108,20 +116,20 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/cakephp" }, - "time": "2023-02-11T01:01:55+00:00" + "time": "2023-08-05T15:33:05+00:00" }, { "name": "cakephp/chronos", - "version": "2.3.2", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/cakephp/chronos.git", - "reference": "a21b7b633f483c4cf525d200219d200f551ee38b" + "reference": "9c7e438cba4eed1796ec19ad3874defa9eb9aeac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/a21b7b633f483c4cf525d200219d200f551ee38b", - "reference": "a21b7b633f483c4cf525d200219d200f551ee38b", + "url": "https://api.github.com/repos/cakephp/chronos/zipball/9c7e438cba4eed1796ec19ad3874defa9eb9aeac", + "reference": "9c7e438cba4eed1796ec19ad3874defa9eb9aeac", "shasum": "" }, "require": { @@ -166,20 +174,20 @@ "issues": "https://github.com/cakephp/chronos/issues", "source": "https://github.com/cakephp/chronos" }, - "time": "2022-11-08T02:17:04+00:00" + "time": "2023-08-06T22:54:27+00:00" }, { "name": "cakephp/migrations", - "version": "3.7.2", + "version": "3.8.2", "source": { "type": "git", "url": "https://github.com/cakephp/migrations.git", - "reference": "97dfc6bdd0ac62f628ce51429a8737e1e5e86684" + "reference": "1c7c060f8d91d62b0716f9b08e3d41bfece5386e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/migrations/zipball/97dfc6bdd0ac62f628ce51429a8737e1e5e86684", - "reference": "97dfc6bdd0ac62f628ce51429a8737e1e5e86684", + "url": "https://api.github.com/repos/cakephp/migrations/zipball/1c7c060f8d91d62b0716f9b08e3d41bfece5386e", + "reference": "1c7c060f8d91d62b0716f9b08e3d41bfece5386e", "shasum": "" }, "require": { @@ -226,7 +234,7 @@ "issues": "https://github.com/cakephp/migrations/issues", "source": "https://github.com/cakephp/migrations" }, - "time": "2023-01-12T15:41:05+00:00" + "time": "2023-06-12T01:40:01+00:00" }, { "name": "cakephp/plugin-installer", @@ -279,16 +287,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.5", + "version": "1.3.6", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd" + "reference": "90d087e988ff194065333d16bc5cf649872d9cdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/74780ccf8c19d6acb8d65c5f39cd72110e132bbd", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/90d087e988ff194065333d16bc5cf649872d9cdb", + "reference": "90d087e988ff194065333d16bc5cf649872d9cdb", "shasum": "" }, "require": { @@ -335,7 +343,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.5" + "source": "https://github.com/composer/ca-bundle/tree/1.3.6" }, "funding": [ { @@ -351,7 +359,7 @@ "type": "tidelift" } ], - "time": "2023-01-11T08:27:00+00:00" + "time": "2023-06-06T12:02:59+00:00" }, { "name": "doctrine/cache", @@ -448,16 +456,16 @@ }, { "name": "doctrine/dbal", - "version": "3.6.0", + "version": "3.6.6", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "85b98cb23c8af471a67abfe14485da696bcabc2e" + "reference": "63646ffd71d1676d2f747f871be31b7e921c7864" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/85b98cb23c8af471a67abfe14485da696bcabc2e", - "reference": "85b98cb23c8af471a67abfe14485da696bcabc2e", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/63646ffd71d1676d2f747f871be31b7e921c7864", + "reference": "63646ffd71d1676d2f747f871be31b7e921c7864", "shasum": "" }, "require": { @@ -470,14 +478,15 @@ "psr/log": "^1|^2|^3" }, "require-dev": { - "doctrine/coding-standard": "11.1.0", + "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", - "jetbrains/phpstorm-stubs": "2022.3", - "phpstan/phpstan": "1.9.14", - "phpstan/phpstan-strict-rules": "^1.4", - "phpunit/phpunit": "9.6.3", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.29", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.9", "psalm/plugin-phpunit": "0.18.4", - "squizlabs/php_codesniffer": "3.7.1", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.7.2", "symfony/cache": "^5.4|^6.0", "symfony/console": "^4.4|^5.4|^6.0", "vimeo/psalm": "4.30.0" @@ -540,7 +549,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.6.0" + "source": "https://github.com/doctrine/dbal/tree/3.6.6" }, "funding": [ { @@ -556,29 +565,33 @@ "type": "tidelift" } ], - "time": "2023-02-07T22:52:03+00:00" + "time": "2023-08-17T05:38:17+00:00" }, { "name": "doctrine/deprecations", - "version": "v1.0.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -597,9 +610,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" }, - "time": "2022-05-02T15:47:09+00:00" + "time": "2023-06-03T09:27:29+00:00" }, { "name": "doctrine/event-manager", @@ -694,22 +707,22 @@ }, { "name": "laminas/laminas-diactoros", - "version": "2.24.0", + "version": "2.25.2", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "6028af6c3b5ced4d063a680d2483cce67578b902" + "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/6028af6c3b5ced4d063a680d2483cce67578b902", - "reference": "6028af6c3b5ced4d063a680d2483cce67578b902", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", + "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", "shasum": "" }, "require": { "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1" }, "conflict": { "zendframework/zend-diactoros": "*" @@ -724,11 +737,11 @@ "ext-gd": "*", "ext-libxml": "*", "http-interop/http-factory-tests": "^0.9.0", - "laminas/laminas-coding-standard": "^2.4.0", + "laminas/laminas-coding-standard": "^2.5", "php-http/psr7-integration-tests": "^1.2", - "phpunit/phpunit": "^9.5.27", + "phpunit/phpunit": "^9.5.28", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.4" + "vimeo/psalm": "^5.6" }, "type": "library", "extra": { @@ -787,34 +800,34 @@ "type": "community_bridge" } ], - "time": "2022-12-20T12:22:40+00:00" + "time": "2023-04-17T15:44:17+00:00" }, { "name": "laminas/laminas-httphandlerrunner", - "version": "2.5.0", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-httphandlerrunner.git", - "reference": "7a47834aaad7852816d2ec4fdbb0492163b039ae" + "reference": "ab1fe48f1c367953d7e8f5cfbaf902672551d524" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/7a47834aaad7852816d2ec4fdbb0492163b039ae", - "reference": "7a47834aaad7852816d2ec4fdbb0492163b039ae", + "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/ab1fe48f1c367953d7e8f5cfbaf902672551d524", + "reference": "ab1fe48f1c367953d7e8f5cfbaf902672551d524", "shasum": "" }, "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", - "psr/http-message": "^1.0", - "psr/http-message-implementation": "^1.0", + "php": "~8.1.0 || ~8.2.0", + "psr/http-message": "^1.0 || ^2.0", + "psr/http-message-implementation": "^1.0 || ^2.0", "psr/http-server-handler": "^1.0" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.4.0", - "laminas/laminas-diactoros": "^2.18", - "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^5.0.0" + "laminas/laminas-coding-standard": "~2.5.0", + "laminas/laminas-diactoros": "^3.0.0", + "phpunit/phpunit": "^10.1.2", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.11" }, "type": "library", "extra": { @@ -854,7 +867,7 @@ "type": "community_bridge" } ], - "time": "2023-01-05T21:54:03+00:00" + "time": "2023-07-25T20:20:46+00:00" }, { "name": "league/container", @@ -1098,21 +1111,21 @@ }, { "name": "psr/http-client", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", "shasum": "" }, "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -1132,7 +1145,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -1144,27 +1157,27 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/master" + "source": "https://github.com/php-fig/http-client/tree/1.0.2" }, - "time": "2020-06-29T06:28:15+00:00" + "time": "2023-04-10T20:12:12+00:00" }, { "name": "psr/http-factory", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "e616d01114759c4c489f93b099585439f795fe35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", "shasum": "" }, "require": { "php": ">=7.0.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -1184,7 +1197,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for PSR-7 HTTP message factories", @@ -1199,31 +1212,31 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" }, - "time": "2019-04-30T12:38:16+00:00" + "time": "2023-04-10T20:10:41+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -1252,27 +1265,27 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:50:52+00:00" }, { "name": "psr/http-server-handler", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" + "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4", + "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4", "shasum": "" }, "require": { "php": ">=7.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -1292,7 +1305,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP server-side request handler", @@ -1308,28 +1321,27 @@ "server" ], "support": { - "issues": "https://github.com/php-fig/http-server-handler/issues", - "source": "https://github.com/php-fig/http-server-handler/tree/master" + "source": "https://github.com/php-fig/http-server-handler/tree/1.0.2" }, - "time": "2018-10-30T16:46:14+00:00" + "time": "2023-04-10T20:06:20+00:00" }, { "name": "psr/http-server-middleware", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5" + "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829", + "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829", "shasum": "" }, "require": { "php": ">=7.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "psr/http-server-handler": "^1.0" }, "type": "library", @@ -1350,7 +1362,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP server-side middleware", @@ -1366,9 +1378,9 @@ ], "support": { "issues": "https://github.com/php-fig/http-server-middleware/issues", - "source": "https://github.com/php-fig/http-server-middleware/tree/master" + "source": "https://github.com/php-fig/http-server-middleware/tree/1.0.2" }, - "time": "2018-10-30T17:12:04+00:00" + "time": "2023-04-11T06:14:47+00:00" }, { "name": "psr/log", @@ -1559,37 +1571,35 @@ }, { "name": "symfony/config", - "version": "v6.2.5", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "f31b3c78a3650157188a240695e688d6a182aa91" + "reference": "b47ca238b03e7b0d7880ffd1cf06e8d637ca1467" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/f31b3c78a3650157188a240695e688d6a182aa91", - "reference": "f31b3c78a3650157188a240695e688d6a182aa91", + "url": "https://api.github.com/repos/symfony/config/zipball/b47ca238b03e7b0d7880ffd1cf06e8d637ca1467", + "reference": "b47ca238b03e7b0d7880ffd1cf06e8d637ca1467", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/filesystem": "^5.4|^6.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<5.4" + "symfony/finder": "<5.4", + "symfony/service-contracts": "<2.5" }, "require-dev": { "symfony/event-dispatcher": "^5.4|^6.0", "symfony/finder": "^5.4|^6.0", "symfony/messenger": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/yaml": "^5.4|^6.0" }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, "type": "library", "autoload": { "psr-4": { @@ -1616,7 +1626,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.2.5" + "source": "https://github.com/symfony/config/tree/v6.3.2" }, "funding": [ { @@ -1632,27 +1642,27 @@ "type": "tidelift" } ], - "time": "2023-01-09T04:38:22+00:00" + "time": "2023-07-19T20:22:16+00:00" }, { "name": "symfony/console", - "version": "v6.2.5", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3e294254f2191762c1d137aed4b94e966965e985" + "reference": "aa5d64ad3f63f2e48964fc81ee45cb318a723898" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3e294254f2191762c1d137aed4b94e966965e985", - "reference": "3e294254f2191762c1d137aed4b94e966965e985", + "url": "https://api.github.com/repos/symfony/console/zipball/aa5d64ad3f63f2e48964fc81ee45cb318a723898", + "reference": "aa5d64ad3f63f2e48964fc81ee45cb318a723898", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/string": "^5.4|^6.0" }, "conflict": { @@ -1674,12 +1684,6 @@ "symfony/process": "^5.4|^6.0", "symfony/var-dumper": "^5.4|^6.0" }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, "type": "library", "autoload": { "psr-4": { @@ -1707,12 +1711,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.5" + "source": "https://github.com/symfony/console/tree/v6.3.2" }, "funding": [ { @@ -1728,20 +1732,20 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2023-07-19T20:17:28+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.0", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "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/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { @@ -1750,7 +1754,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -1779,7 +1783,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.3.0" }, "funding": [ { @@ -1795,20 +1799,20 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/filesystem", - "version": "v6.2.5", + "version": "v6.3.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "e59e8a4006afd7f5654786a83b4fcb8da98f4593" + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e59e8a4006afd7f5654786a83b4fcb8da98f4593", - "reference": "e59e8a4006afd7f5654786a83b4fcb8da98f4593", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", "shasum": "" }, "require": { @@ -1842,7 +1846,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.2.5" + "source": "https://github.com/symfony/filesystem/tree/v6.3.1" }, "funding": [ { @@ -1858,7 +1862,7 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:45:48+00:00" + "time": "2023-06-01T08:30:39+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2192,16 +2196,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.2.0", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75" + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" }, "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/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", "shasum": "" }, "require": { @@ -2211,13 +2215,10 @@ "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -2257,7 +2258,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" }, "funding": [ { @@ -2273,20 +2274,20 @@ "type": "tidelift" } ], - "time": "2022-11-25T10:21:52+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/string", - "version": "v6.2.5", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0" + "reference": "53d1a83225002635bca3482fcbf963001313fb68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0", - "reference": "b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0", + "url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68", + "reference": "53d1a83225002635bca3482fcbf963001313fb68", "shasum": "" }, "require": { @@ -2297,13 +2298,13 @@ "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", + "symfony/translation-contracts": "^2.5|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", @@ -2343,7 +2344,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.5" + "source": "https://github.com/symfony/string/tree/v6.3.2" }, "funding": [ { @@ -2359,7 +2360,7 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2023-07-05T08:41:27+00:00" } ], "packages-dev": [ @@ -2414,16 +2415,16 @@ }, { "name": "cakephp/bake", - "version": "2.8.2", + "version": "2.9.3", "source": { "type": "git", "url": "https://github.com/cakephp/bake.git", - "reference": "ef021497ab517c33ecd97d2184200d8990ffc0ab" + "reference": "a9b02fb6a5f96e8fb9887be55cccea501468907b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/bake/zipball/ef021497ab517c33ecd97d2184200d8990ffc0ab", - "reference": "ef021497ab517c33ecd97d2184200d8990ffc0ab", + "url": "https://api.github.com/repos/cakephp/bake/zipball/a9b02fb6a5f96e8fb9887be55cccea501468907b", + "reference": "a9b02fb6a5f96e8fb9887be55cccea501468907b", "shasum": "" }, "require": { @@ -2467,25 +2468,25 @@ "issues": "https://github.com/cakephp/bake/issues", "source": "https://github.com/cakephp/bake" }, - "time": "2022-10-05T18:45:20+00:00" + "time": "2023-03-18T19:26:16+00:00" }, { "name": "cakephp/cakephp-codesniffer", - "version": "4.6.0", + "version": "4.7.0", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp-codesniffer.git", - "reference": "5a64e6e6434128f6a1549318de86c564737d5cda" + "reference": "24fa2321d54e5251ac2f59dd92dd2066f0b0bdae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/5a64e6e6434128f6a1549318de86c564737d5cda", - "reference": "5a64e6e6434128f6a1549318de86c564737d5cda", + "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/24fa2321d54e5251ac2f59dd92dd2066f0b0bdae", + "reference": "24fa2321d54e5251ac2f59dd92dd2066f0b0bdae", "shasum": "" }, "require": { "php": ">=7.2.0", - "slevomat/coding-standard": "^6.3.6 || ^7.0 || ^8.0", + "slevomat/coding-standard": "^7.0 || ^8.0", "squizlabs/php_codesniffer": "^3.6" }, "require-dev": { @@ -2519,20 +2520,20 @@ "issues": "https://github.com/cakephp/cakephp-codesniffer/issues", "source": "https://github.com/cakephp/cakephp-codesniffer" }, - "time": "2022-07-04T03:29:58+00:00" + "time": "2023-04-10T06:35:04+00:00" }, { "name": "cakephp/debug_kit", - "version": "4.9.3", + "version": "4.9.4", "source": { "type": "git", "url": "https://github.com/cakephp/debug_kit.git", - "reference": "db848e787bf53483069cba2feb449c2e8523f525" + "reference": "663491edec4a6b9111f1cf4733ebd471450df71e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/db848e787bf53483069cba2feb449c2e8523f525", - "reference": "db848e787bf53483069cba2feb449c2e8523f525", + "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/663491edec4a6b9111f1cf4733ebd471450df71e", + "reference": "663491edec4a6b9111f1cf4733ebd471450df71e", "shasum": "" }, "require": { @@ -2580,12 +2581,12 @@ "kit" ], "support": { - "forum": "http://stackoverflow.com/tags/cakephp", + "forum": "https://stackoverflow.com/tags/cakephp", "irc": "irc://irc.freenode.org/cakephp", "issues": "https://github.com/cakephp/debug_kit/issues", "source": "https://github.com/cakephp/debug_kit" }, - "time": "2023-01-25T04:49:08+00:00" + "time": "2023-07-05T16:04:04+00:00" }, { "name": "cakephp/twig-view", @@ -2652,22 +2653,22 @@ }, { "name": "composer/class-map-generator", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513" + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/1e1cb2b791facb2dfe32932a7718cf2571187513", - "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9", + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9", "shasum": "" }, "require": { - "composer/pcre": "^2 || ^3", + "composer/pcre": "^2.1 || ^3.1", "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6" + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" }, "require-dev": { "phpstan/phpstan": "^1.6", @@ -2705,7 +2706,7 @@ ], "support": { "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.0.0" + "source": "https://github.com/composer/class-map-generator/tree/1.1.0" }, "funding": [ { @@ -2721,20 +2722,20 @@ "type": "tidelift" } ], - "time": "2022-06-19T11:31:27+00:00" + "time": "2023-06-30T13:58:57+00:00" }, { "name": "composer/composer", - "version": "2.5.3", + "version": "2.5.8", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "607a4c04006ce1d2b6fdfd5467bae3d7ad9ce5ab" + "reference": "4c516146167d1392c8b9b269bb7c24115d262164" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/607a4c04006ce1d2b6fdfd5467bae3d7ad9ce5ab", - "reference": "607a4c04006ce1d2b6fdfd5467bae3d7ad9ce5ab", + "url": "https://api.github.com/repos/composer/composer/zipball/4c516146167d1392c8b9b269bb7c24115d262164", + "reference": "4c516146167d1392c8b9b269bb7c24115d262164", "shasum": "" }, "require": { @@ -2818,7 +2819,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.5.3" + "source": "https://github.com/composer/composer/tree/2.5.8" }, "funding": [ { @@ -2834,7 +2835,7 @@ "type": "tidelift" } ], - "time": "2023-02-10T12:23:52+00:00" + "time": "2023-06-09T15:13:21+00:00" }, { "name": "composer/metadata-minifier", @@ -3465,7 +3466,7 @@ ], "support": { "issues": "https://github.com/jdorn/sql-formatter/issues", - "source": "https://github.com/jdorn/sql-formatter/tree/master" + "source": "https://github.com/jdorn/sql-formatter/tree/v1.2.17" }, "time": "2014-01-12T16:20:24+00:00" }, @@ -3660,16 +3661,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -3707,7 +3708,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -3715,20 +3716,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.3", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "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/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -3769,9 +3770,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.17.1" }, - "time": "2023-01-16T22:05:37+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "phar-io/manifest", @@ -3886,22 +3887,24 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.15.3", + "version": "1.23.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "61800f71a5526081d1b5633766aa88341f1ade76" + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/61800f71a5526081d1b5633766aa88341f1ade76", - "reference": "61800f71a5526081d1b5633766aa88341f1ade76", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26", + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26", "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", @@ -3925,29 +3928,29 @@ "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.15.3" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1" }, - "time": "2022-12-20T20:56:55+00:00" + "time": "2023-08-03T16:32:59+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.24", + "version": "9.2.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -3962,8 +3965,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { @@ -3996,7 +3999,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27" }, "funding": [ { @@ -4004,7 +4008,7 @@ "type": "github" } ], - "time": "2023-01-26T08:26:55+00:00" + "time": "2023-07-26T13:44:30+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4249,16 +4253,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.3", + "version": "9.6.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555" + "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e7b1615e3e887d6c719121c6d4a44b0ab9645555", - "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a6d351645c3fe5a30f5e86be6577d946af65a328", + "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328", "shasum": "" }, "require": { @@ -4291,8 +4295,8 @@ "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" @@ -4331,7 +4335,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.3" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.10" }, "funding": [ { @@ -4347,20 +4352,20 @@ "type": "tidelift" } ], - "time": "2023-02-04T13:37:15+00:00" + "time": "2023-07-10T04:04:23+00:00" }, { "name": "psy/psysh", - "version": "v0.11.12", + "version": "v0.11.20", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "52cb7c47d403c31c0adc9bf7710fc355f93c20f7" + "reference": "0fa27040553d1d280a67a4393194df5228afea5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/52cb7c47d403c31c0adc9bf7710fc355f93c20f7", - "reference": "52cb7c47d403c31c0adc9bf7710fc355f93c20f7", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/0fa27040553d1d280a67a4393194df5228afea5b", + "reference": "0fa27040553d1d280a67a4393194df5228afea5b", "shasum": "" }, "require": { @@ -4421,29 +4426,29 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.12" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.20" }, - "time": "2023-01-29T21:24:40+00:00" + "time": "2023-07-31T14:32:22+00:00" }, { "name": "react/promise", - "version": "v2.9.0", + "version": "v2.10.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", + "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", "shasum": "" }, "require": { "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { @@ -4487,19 +4492,15 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" + "source": "https://github.com/reactphp/promise/tree/v2.10.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-02-11T10:27:51+00:00" + "time": "2023-05-02T15:15:43+00:00" }, { "name": "sebastian/cli-parser", @@ -4801,16 +4802,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { @@ -4855,7 +4856,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -4863,7 +4864,7 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-07T05:35:17+00:00" }, { "name": "sebastian/environment", @@ -5007,16 +5008,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bde739e7565280bda77be70044ac1047bc007e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", "shasum": "" }, "require": { @@ -5059,7 +5060,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" }, "funding": [ { @@ -5067,7 +5068,7 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-08-02T09:26:13+00:00" }, { "name": "sebastian/lines-of-code", @@ -5467,16 +5468,16 @@ }, { "name": "seld/jsonlint", - "version": "1.9.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "4211420d25eba80712bff236a98960ef68b866b7" + "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7", - "reference": "4211420d25eba80712bff236a98960ef68b866b7", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/594fd6462aad8ecee0b45ca5045acea4776667f1", + "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1", "shasum": "" }, "require": { @@ -5515,7 +5516,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0" + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0" }, "funding": [ { @@ -5527,7 +5528,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T13:37:23+00:00" + "time": "2023-05-11T13:16:46+00:00" }, { "name": "seld/phar-utils", @@ -5640,32 +5641,32 @@ }, { "name": "slevomat/coding-standard", - "version": "8.8.0", + "version": "8.13.4", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "59e25146a4ef0a7b194c5bc55b32dd414345db89" + "reference": "4b2af2fb17773656d02fbfb5d18024ebd19fe322" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/59e25146a4ef0a7b194c5bc55b32dd414345db89", - "reference": "59e25146a4ef0a7b194c5bc55b32dd414345db89", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/4b2af2fb17773656d02fbfb5d18024ebd19fe322", + "reference": "4b2af2fb17773656d02fbfb5d18024ebd19fe322", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": ">=1.15.2 <1.16.0", + "phpstan/phpdoc-parser": "^1.23.0", "squizlabs/php_codesniffer": "^3.7.1" }, "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.9.6", - "phpstan/phpstan-deprecation-rules": "1.1.1", - "phpstan/phpstan-phpunit": "1.0.0|1.3.3", - "phpstan/phpstan-strict-rules": "1.4.4", - "phpunit/phpunit": "7.5.20|8.5.21|9.5.27" + "phpstan/phpstan": "1.10.26", + "phpstan/phpstan-deprecation-rules": "1.1.3", + "phpstan/phpstan-phpunit": "1.3.13", + "phpstan/phpstan-strict-rules": "1.5.1", + "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.2.6" }, "type": "phpcodesniffer-standard", "extra": { @@ -5675,7 +5676,7 @@ }, "autoload": { "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard" + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" } }, "notification-url": "https://packagist.org/downloads/", @@ -5689,7 +5690,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.8.0" + "source": "https://github.com/slevomat/coding-standard/tree/8.13.4" }, "funding": [ { @@ -5701,20 +5702,20 @@ "type": "tidelift" } ], - "time": "2023-01-09T10:46:13+00:00" + "time": "2023-07-25T10:28:55+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -5750,27 +5751,28 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "symfony/finder", - "version": "v6.2.5", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c90dc446976a612e3312a97a6ec0069ab0c2099c" + "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c90dc446976a612e3312a97a6ec0069ab0c2099c", - "reference": "c90dc446976a612e3312a97a6ec0069ab0c2099c", + "url": "https://api.github.com/repos/symfony/finder/zipball/9915db259f67d21eefee768c1abcf1cc61b1fc9e", + "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e", "shasum": "" }, "require": { @@ -5805,7 +5807,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.5" + "source": "https://github.com/symfony/finder/tree/v6.3.3" }, "funding": [ { @@ -5821,7 +5823,7 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:45:48+00:00" + "time": "2023-07-31T08:31:44+00:00" }, { "name": "symfony/polyfill-php73", @@ -6066,16 +6068,16 @@ }, { "name": "symfony/process", - "version": "v6.2.5", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9ead139f63dfa38c4e4a9049cc64a8b2748c83b7" + "reference": "c5ce962db0d9b6e80247ca5eb9af6472bd4d7b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9ead139f63dfa38c4e4a9049cc64a8b2748c83b7", - "reference": "9ead139f63dfa38c4e4a9049cc64a8b2748c83b7", + "url": "https://api.github.com/repos/symfony/process/zipball/c5ce962db0d9b6e80247ca5eb9af6472bd4d7b5d", + "reference": "c5ce962db0d9b6e80247ca5eb9af6472bd4d7b5d", "shasum": "" }, "require": { @@ -6107,7 +6109,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.2.5" + "source": "https://github.com/symfony/process/tree/v6.3.2" }, "funding": [ { @@ -6123,42 +6125,38 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2023-07-12T16:00:22+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.2.5", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "44b7b81749fd20c1bdf4946c041050e22bc8da27" + "reference": "77fb4f2927f6991a9843633925d111147449ee7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/44b7b81749fd20c1bdf4946c041050e22bc8da27", - "reference": "44b7b81749fd20c1bdf4946c041050e22bc8da27", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/77fb4f2927f6991a9843633925d111147449ee7a", + "reference": "77fb4f2927f6991a9843633925d111147449ee7a", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "phpunit/phpunit": "<5.4.3", "symfony/console": "<5.4" }, "require-dev": { "ext-iconv": "*", "symfony/console": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", "symfony/process": "^5.4|^6.0", "symfony/uid": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" - }, "bin": [ "Resources/bin/var-dump-server" ], @@ -6195,7 +6193,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.2.5" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.3" }, "funding": [ { @@ -6211,7 +6209,7 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:45:48+00:00" + "time": "2023-07-31T07:08:24+00:00" }, { "name": "theseer/tokenizer", @@ -6265,16 +6263,16 @@ }, { "name": "twig/markdown-extra", - "version": "v3.5.1", + "version": "v3.7.0", "source": { "type": "git", "url": "https://github.com/twigphp/markdown-extra.git", - "reference": "9474c89fd2787187a3809e5e964dfce2395ae5f0" + "reference": "8f1179e279cea6ef14066a4560b859df58acd5d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/9474c89fd2787187a3809e5e964dfce2395ae5f0", - "reference": "9474c89fd2787187a3809e5e964dfce2395ae5f0", + "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/8f1179e279cea6ef14066a4560b859df58acd5d8", + "reference": "8f1179e279cea6ef14066a4560b859df58acd5d8", "shasum": "" }, "require": { @@ -6289,11 +6287,6 @@ "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } - }, "autoload": { "psr-4": { "Twig\\Extra\\Markdown\\": "" @@ -6322,7 +6315,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/markdown-extra/tree/v3.5.1" + "source": "https://github.com/twigphp/markdown-extra/tree/v3.7.0" }, "funding": [ { @@ -6334,20 +6327,20 @@ "type": "tidelift" } ], - "time": "2023-02-08T07:44:55+00:00" + "time": "2023-02-09T06:45:16+00:00" }, { "name": "twig/twig", - "version": "v3.5.1", + "version": "v3.7.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15" + "reference": "5cf942bbab3df42afa918caeba947f1b690af64b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/a6e0510cc793912b451fd40ab983a1d28f611c15", - "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/5cf942bbab3df42afa918caeba947f1b690af64b", + "reference": "5cf942bbab3df42afa918caeba947f1b690af64b", "shasum": "" }, "require": { @@ -6356,15 +6349,10 @@ "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { - "psr/container": "^1.0", + "psr/container": "^1.0|^2.0", "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } - }, "autoload": { "psr-4": { "Twig\\": "src/" @@ -6398,7 +6386,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.5.1" + "source": "https://github.com/twigphp/Twig/tree/v3.7.0" }, "funding": [ { @@ -6410,7 +6398,7 @@ "type": "tidelift" } ], - "time": "2023-02-08T07:49:20+00:00" + "time": "2023-07-26T07:16:09+00:00" } ], "aliases": [], @@ -6424,5 +6412,5 @@ "php": ">=8.0" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/app/vendor/bin/composer b/app/vendor/bin/composer deleted file mode 120000 index f43551575..000000000 --- a/app/vendor/bin/composer +++ /dev/null @@ -1 +0,0 @@ -../composer/composer/bin/composer \ No newline at end of file diff --git a/app/vendor/bin/composer b/app/vendor/bin/composer new file mode 100755 index 000000000..b8ca913e6 --- /dev/null +++ b/app/vendor/bin/composer @@ -0,0 +1,120 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/composer/composer/bin/composer'); + exit(0); + } +} + +include __DIR__ . '/..'.'/composer/composer/bin/composer'; diff --git a/app/vendor/bin/doctrine-dbal b/app/vendor/bin/doctrine-dbal deleted file mode 120000 index 58a8a89c2..000000000 --- a/app/vendor/bin/doctrine-dbal +++ /dev/null @@ -1 +0,0 @@ -../doctrine/dbal/bin/doctrine-dbal \ No newline at end of file diff --git a/app/vendor/bin/doctrine-dbal b/app/vendor/bin/doctrine-dbal new file mode 100755 index 000000000..e86bf8dcc --- /dev/null +++ b/app/vendor/bin/doctrine-dbal @@ -0,0 +1,120 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/doctrine/dbal/bin/doctrine-dbal'); + exit(0); + } +} + +include __DIR__ . '/..'.'/doctrine/dbal/bin/doctrine-dbal'; diff --git a/app/vendor/bin/jsonlint b/app/vendor/bin/jsonlint index 513f1c973..b8170cf4d 100755 --- a/app/vendor/bin/jsonlint +++ b/app/vendor/bin/jsonlint @@ -108,7 +108,10 @@ if (PHP_VERSION_ID < 80000) { } } - if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { include("phpvfscomposer://" . __DIR__ . '/..'.'/seld/jsonlint/bin/jsonlint'); exit(0); } diff --git a/app/vendor/bin/phinx b/app/vendor/bin/phinx deleted file mode 120000 index 8b2b0f455..000000000 --- a/app/vendor/bin/phinx +++ /dev/null @@ -1 +0,0 @@ -../robmorgan/phinx/bin/phinx \ No newline at end of file diff --git a/app/vendor/bin/phinx b/app/vendor/bin/phinx new file mode 100755 index 000000000..9942549c0 --- /dev/null +++ b/app/vendor/bin/phinx @@ -0,0 +1,120 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/robmorgan/phinx/bin/phinx'); + exit(0); + } +} + +include __DIR__ . '/..'.'/robmorgan/phinx/bin/phinx'; diff --git a/app/vendor/bin/php-parse b/app/vendor/bin/php-parse deleted file mode 120000 index 062d66a3e..000000000 --- a/app/vendor/bin/php-parse +++ /dev/null @@ -1 +0,0 @@ -../nikic/php-parser/bin/php-parse \ No newline at end of file diff --git a/app/vendor/bin/php-parse b/app/vendor/bin/php-parse new file mode 100755 index 000000000..1bd2c838c --- /dev/null +++ b/app/vendor/bin/php-parse @@ -0,0 +1,120 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'); + exit(0); + } +} + +include __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'; diff --git a/app/vendor/bin/phpcbf b/app/vendor/bin/phpcbf deleted file mode 120000 index bdf04fbca..000000000 --- a/app/vendor/bin/phpcbf +++ /dev/null @@ -1 +0,0 @@ -../squizlabs/php_codesniffer/bin/phpcbf \ No newline at end of file diff --git a/app/vendor/bin/phpcbf b/app/vendor/bin/phpcbf new file mode 100755 index 000000000..0b622008f --- /dev/null +++ b/app/vendor/bin/phpcbf @@ -0,0 +1,120 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcbf'); + exit(0); + } +} + +include __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcbf'; diff --git a/app/vendor/bin/phpcs b/app/vendor/bin/phpcs deleted file mode 120000 index 9481d68a4..000000000 --- a/app/vendor/bin/phpcs +++ /dev/null @@ -1 +0,0 @@ -../squizlabs/php_codesniffer/bin/phpcs \ No newline at end of file diff --git a/app/vendor/bin/phpcs b/app/vendor/bin/phpcs new file mode 100755 index 000000000..9eb8455a8 --- /dev/null +++ b/app/vendor/bin/phpcs @@ -0,0 +1,120 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcs'); + exit(0); + } +} + +include __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcs'; diff --git a/app/vendor/bin/phpunit b/app/vendor/bin/phpunit deleted file mode 120000 index 2c4893031..000000000 --- a/app/vendor/bin/phpunit +++ /dev/null @@ -1 +0,0 @@ -../phpunit/phpunit/phpunit \ No newline at end of file diff --git a/app/vendor/bin/phpunit b/app/vendor/bin/phpunit new file mode 100755 index 000000000..e92cddc50 --- /dev/null +++ b/app/vendor/bin/phpunit @@ -0,0 +1,123 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = 'phpvfscomposer://'.$this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + $data = str_replace('__DIR__', var_export(dirname($this->realpath), true), $data); + $data = str_replace('__FILE__', var_export($this->realpath, true), $data); + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/phpunit/phpunit/phpunit'); + exit(0); + } +} + +include __DIR__ . '/..'.'/phpunit/phpunit/phpunit'; diff --git a/app/vendor/bin/psysh b/app/vendor/bin/psysh deleted file mode 120000 index 3c06b1ae9..000000000 --- a/app/vendor/bin/psysh +++ /dev/null @@ -1 +0,0 @@ -../psy/psysh/bin/psysh \ No newline at end of file diff --git a/app/vendor/bin/psysh b/app/vendor/bin/psysh new file mode 100755 index 000000000..ea7f565c1 --- /dev/null +++ b/app/vendor/bin/psysh @@ -0,0 +1,120 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/psy/psysh/bin/psysh'); + exit(0); + } +} + +include __DIR__ . '/..'.'/psy/psysh/bin/psysh'; diff --git a/app/vendor/bin/var-dump-server b/app/vendor/bin/var-dump-server deleted file mode 120000 index 6bd4e93db..000000000 --- a/app/vendor/bin/var-dump-server +++ /dev/null @@ -1 +0,0 @@ -../symfony/var-dumper/Resources/bin/var-dump-server \ No newline at end of file diff --git a/app/vendor/bin/var-dump-server b/app/vendor/bin/var-dump-server new file mode 100755 index 000000000..c52c77272 --- /dev/null +++ b/app/vendor/bin/var-dump-server @@ -0,0 +1,120 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server'); + exit(0); + } +} + +include __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server'; diff --git a/app/vendor/cakephp/bake/LICENSE.txt b/app/vendor/cakephp/bake/LICENSE.txt index 0a0a98c8e..7fd9d1f4b 100644 --- a/app/vendor/cakephp/bake/LICENSE.txt +++ b/app/vendor/cakephp/bake/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License -CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org) +CakePHP(tm) : The Rapid Development PHP Framework (https://cakephp.org) Copyright (c) 2005-present, Cake Software Foundation, Inc. Permission is hereby granted, free of charge, to any person obtaining a diff --git a/app/vendor/cakephp/bake/README.md b/app/vendor/cakephp/bake/README.md index bd99b84b7..3cc152bc7 100644 --- a/app/vendor/cakephp/bake/README.md +++ b/app/vendor/cakephp/bake/README.md @@ -10,7 +10,7 @@ suite of CLI tools, you can quickly and easily generate code for your applicatio ## Installation -You can install this plugin into your CakePHP application using [composer](http://getcomposer.org). +You can install this plugin into your CakePHP application using [composer](https://getcomposer.org). The recommended way to install composer packages is: diff --git a/app/vendor/cakephp/bake/composer.json b/app/vendor/cakephp/bake/composer.json index 58ad76d07..679346281 100644 --- a/app/vendor/cakephp/bake/composer.json +++ b/app/vendor/cakephp/bake/composer.json @@ -50,9 +50,9 @@ "@test", "@cs-check" ], - "cs-check": "phpcs --parallel=16 -p src/ tests/", - "cs-fix": "phpcbf --parallel=16 -p src/ tests/", - "stan": "phpstan analyse src/ && psalm.phar", + "cs-check": "phpcs --parallel=16", + "cs-fix": "phpcbf --parallel=16", + "stan": "phpstan analyse && psalm.phar", "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.7 psalm/phar:~4.27.0 && mv composer.backup composer.json", "test": "phpunit", "test-coverage": "phpunit --coverage-clover=clover.xml" diff --git a/app/vendor/cakephp/bake/docs.Dockerfile b/app/vendor/cakephp/bake/docs.Dockerfile index 1f7afabdc..4f3ca473c 100644 --- a/app/vendor/cakephp/bake/docs.Dockerfile +++ b/app/vendor/cakephp/bake/docs.Dockerfile @@ -1,5 +1,5 @@ # Generate the HTML output. -FROM markstory/cakephp-docs-builder as builder +FROM ghcr.io/cakephp/docs-builder as builder # Copy entire repo in with .git so we can build all versions in one image. COPY docs /data/docs @@ -8,7 +8,7 @@ RUN cd /data/docs-builder \ && make website LANGS="en es fr ja pt ru" SOURCE=/data/docs DEST=/data/website/ # Build a small nginx container with just the static site in it. -FROM markstory/cakephp-docs-builder:runtime as runtime +FROM ghcr.io/cakephp/docs-builder:runtime as runtime # Configure search index script ENV LANGS="en es fr ja pt ru" diff --git a/app/vendor/cakephp/bake/phpcs.xml.dist b/app/vendor/cakephp/bake/phpcs.xml similarity index 52% rename from app/vendor/cakephp/bake/phpcs.xml.dist rename to app/vendor/cakephp/bake/phpcs.xml index ce02df237..f52106709 100644 --- a/app/vendor/cakephp/bake/phpcs.xml.dist +++ b/app/vendor/cakephp/bake/phpcs.xml @@ -1,8 +1,14 @@ + + + src/ + tests/ */comparisons/* + /tests/test_app/tests/ + /tests/test_app/Plugin/TestBake/ diff --git a/app/vendor/cakephp/bake/src/CodeGen/ClassBuilder.php b/app/vendor/cakephp/bake/src/CodeGen/ClassBuilder.php index de9482835..b543127c0 100644 --- a/app/vendor/cakephp/bake/src/CodeGen/ClassBuilder.php +++ b/app/vendor/cakephp/bake/src/CodeGen/ClassBuilder.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.8.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\CodeGen; diff --git a/app/vendor/cakephp/bake/src/CodeGen/CodeParser.php b/app/vendor/cakephp/bake/src/CodeGen/CodeParser.php index 6944c1b1d..2293fb021 100644 --- a/app/vendor/cakephp/bake/src/CodeGen/CodeParser.php +++ b/app/vendor/cakephp/bake/src/CodeGen/CodeParser.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.8.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\CodeGen; diff --git a/app/vendor/cakephp/bake/src/CodeGen/FileBuilder.php b/app/vendor/cakephp/bake/src/CodeGen/FileBuilder.php index d3cffa2ce..74c77a7aa 100644 --- a/app/vendor/cakephp/bake/src/CodeGen/FileBuilder.php +++ b/app/vendor/cakephp/bake/src/CodeGen/FileBuilder.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.8.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\CodeGen; diff --git a/app/vendor/cakephp/bake/src/CodeGen/ImportHelper.php b/app/vendor/cakephp/bake/src/CodeGen/ImportHelper.php index 01b60d349..576b42c7b 100644 --- a/app/vendor/cakephp/bake/src/CodeGen/ImportHelper.php +++ b/app/vendor/cakephp/bake/src/CodeGen/ImportHelper.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.8.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\CodeGen; diff --git a/app/vendor/cakephp/bake/src/CodeGen/ParseException.php b/app/vendor/cakephp/bake/src/CodeGen/ParseException.php index b910faae1..83b374478 100644 --- a/app/vendor/cakephp/bake/src/CodeGen/ParseException.php +++ b/app/vendor/cakephp/bake/src/CodeGen/ParseException.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.8.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\CodeGen; diff --git a/app/vendor/cakephp/bake/src/CodeGen/ParsedClass.php b/app/vendor/cakephp/bake/src/CodeGen/ParsedClass.php index 5814e32a7..b7bda0737 100644 --- a/app/vendor/cakephp/bake/src/CodeGen/ParsedClass.php +++ b/app/vendor/cakephp/bake/src/CodeGen/ParsedClass.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.8.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\CodeGen; diff --git a/app/vendor/cakephp/bake/src/CodeGen/ParsedFile.php b/app/vendor/cakephp/bake/src/CodeGen/ParsedFile.php index 9a096f27e..f00521710 100644 --- a/app/vendor/cakephp/bake/src/CodeGen/ParsedFile.php +++ b/app/vendor/cakephp/bake/src/CodeGen/ParsedFile.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.8.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\CodeGen; diff --git a/app/vendor/cakephp/bake/src/Command/AllCommand.php b/app/vendor/cakephp/bake/src/Command/AllCommand.php index a6a3f6113..785f46534 100644 --- a/app/vendor/cakephp/bake/src/Command/AllCommand.php +++ b/app/vendor/cakephp/bake/src/Command/AllCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/BakeCommand.php b/app/vendor/cakephp/bake/src/Command/BakeCommand.php index 903192c0e..06e84064a 100644 --- a/app/vendor/cakephp/bake/src/Command/BakeCommand.php +++ b/app/vendor/cakephp/bake/src/Command/BakeCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/BehaviorCommand.php b/app/vendor/cakephp/bake/src/Command/BehaviorCommand.php index e5b5e852e..c7af462f9 100644 --- a/app/vendor/cakephp/bake/src/Command/BehaviorCommand.php +++ b/app/vendor/cakephp/bake/src/Command/BehaviorCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/CellCommand.php b/app/vendor/cakephp/bake/src/Command/CellCommand.php index 989a7ddb7..b77be780f 100644 --- a/app/vendor/cakephp/bake/src/Command/CellCommand.php +++ b/app/vendor/cakephp/bake/src/Command/CellCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/CommandCommand.php b/app/vendor/cakephp/bake/src/Command/CommandCommand.php index dfca1a419..ea5cabd8e 100644 --- a/app/vendor/cakephp/bake/src/Command/CommandCommand.php +++ b/app/vendor/cakephp/bake/src/Command/CommandCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 1.7.4 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/CommandHelperCommand.php b/app/vendor/cakephp/bake/src/Command/CommandHelperCommand.php index fba31ed10..84f8d63bd 100644 --- a/app/vendor/cakephp/bake/src/Command/CommandHelperCommand.php +++ b/app/vendor/cakephp/bake/src/Command/CommandHelperCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.6.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/ComponentCommand.php b/app/vendor/cakephp/bake/src/Command/ComponentCommand.php index c98c15fd2..452800fde 100644 --- a/app/vendor/cakephp/bake/src/Command/ComponentCommand.php +++ b/app/vendor/cakephp/bake/src/Command/ComponentCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/ControllerAllCommand.php b/app/vendor/cakephp/bake/src/Command/ControllerAllCommand.php index cea1c95ec..b482fcce6 100644 --- a/app/vendor/cakephp/bake/src/Command/ControllerAllCommand.php +++ b/app/vendor/cakephp/bake/src/Command/ControllerAllCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/ControllerCommand.php b/app/vendor/cakephp/bake/src/Command/ControllerCommand.php index 954fd3a73..2b4047f70 100644 --- a/app/vendor/cakephp/bake/src/Command/ControllerCommand.php +++ b/app/vendor/cakephp/bake/src/Command/ControllerCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/EntryCommand.php b/app/vendor/cakephp/bake/src/Command/EntryCommand.php index ba7b51558..c549880e9 100644 --- a/app/vendor/cakephp/bake/src/Command/EntryCommand.php +++ b/app/vendor/cakephp/bake/src/Command/EntryCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/FixtureAllCommand.php b/app/vendor/cakephp/bake/src/Command/FixtureAllCommand.php index e6268fc70..9dff89cd0 100644 --- a/app/vendor/cakephp/bake/src/Command/FixtureAllCommand.php +++ b/app/vendor/cakephp/bake/src/Command/FixtureAllCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/FixtureCommand.php b/app/vendor/cakephp/bake/src/Command/FixtureCommand.php index 5353e0c52..402b092e8 100644 --- a/app/vendor/cakephp/bake/src/Command/FixtureCommand.php +++ b/app/vendor/cakephp/bake/src/Command/FixtureCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/FormCommand.php b/app/vendor/cakephp/bake/src/Command/FormCommand.php index f84572bad..f36229891 100644 --- a/app/vendor/cakephp/bake/src/Command/FormCommand.php +++ b/app/vendor/cakephp/bake/src/Command/FormCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 1.0.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/HelperCommand.php b/app/vendor/cakephp/bake/src/Command/HelperCommand.php index 2b364726d..82205f5ab 100644 --- a/app/vendor/cakephp/bake/src/Command/HelperCommand.php +++ b/app/vendor/cakephp/bake/src/Command/HelperCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/MailerCommand.php b/app/vendor/cakephp/bake/src/Command/MailerCommand.php index 7ae57c517..b96d7337e 100644 --- a/app/vendor/cakephp/bake/src/Command/MailerCommand.php +++ b/app/vendor/cakephp/bake/src/Command/MailerCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 1.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/MiddlewareCommand.php b/app/vendor/cakephp/bake/src/Command/MiddlewareCommand.php index 97fdee7d6..61b3a0c41 100644 --- a/app/vendor/cakephp/bake/src/Command/MiddlewareCommand.php +++ b/app/vendor/cakephp/bake/src/Command/MiddlewareCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 1.3.6 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/ModelAllCommand.php b/app/vendor/cakephp/bake/src/Command/ModelAllCommand.php index 74180239e..8b2eaf27f 100644 --- a/app/vendor/cakephp/bake/src/Command/ModelAllCommand.php +++ b/app/vendor/cakephp/bake/src/Command/ModelAllCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/ModelCommand.php b/app/vendor/cakephp/bake/src/Command/ModelCommand.php index 0e7c38603..fc9b95ec7 100644 --- a/app/vendor/cakephp/bake/src/Command/ModelCommand.php +++ b/app/vendor/cakephp/bake/src/Command/ModelCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; @@ -233,7 +233,7 @@ public function getAssociations(Table $table, Arguments $args, ConsoleIo $io): a ]; $primary = $table->getPrimaryKey(); - $associations = $this->findBelongsTo($table, $associations); + $associations = $this->findBelongsTo($table, $associations, $args); if (is_array($primary) && count($primary) > 1) { $io->warning( @@ -329,9 +329,10 @@ public function getAssociationInfo(Table $table): array * * @param \Cake\ORM\Table $model Database\Table instance of table being generated. * @param array $associations Array of in progress associations + * @param \Cake\Console\Arguments|null $args CLI arguments * @return array Associations with belongsTo added in. */ - public function findBelongsTo(Table $model, array $associations): array + public function findBelongsTo(Table $model, array $associations, ?Arguments $args = null): array { $schema = $model->getSchema(); foreach ($schema->columns() as $fieldName) { @@ -362,11 +363,13 @@ public function findBelongsTo(Table $model, array $associations): array get_class($associationTable) === Table::class && !in_array(Inflector::tableize($tmpModelName), $tables, true) ) { + $allowAliasRelations = $args && $args->getOption('skip-relation-check'); $found = $this->findTableReferencedBy($schema, $fieldName); - if (!$found) { + if ($found) { + $tmpModelName = Inflector::camelize($found); + } elseif (!$allowAliasRelations) { continue; } - $tmpModelName = Inflector::camelize($found); } $assoc = [ 'alias' => $tmpModelName, @@ -1319,6 +1322,10 @@ public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionPar ])->addOption('no-fixture', [ 'boolean' => true, 'help' => 'Do not generate a test fixture skeleton.', + ])->addOption('skip-relation-check', [ + 'boolean' => true, + 'help' => 'Generate relations for all "example_id" fields' + . ' without checking the database if a table "examples" exists.', ])->setEpilog( 'Omitting all arguments and options will list the table names you can generate models for.' ); diff --git a/app/vendor/cakephp/bake/src/Command/PluginCommand.php b/app/vendor/cakephp/bake/src/Command/PluginCommand.php index aa9f8103e..992ba2ee9 100644 --- a/app/vendor/cakephp/bake/src/Command/PluginCommand.php +++ b/app/vendor/cakephp/bake/src/Command/PluginCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; @@ -383,7 +383,7 @@ public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionPar ])->addOption('theme', [ 'short' => 't', 'help' => 'The theme to use when baking code.', - 'default' => Configure::read('Bake.theme') ?? '', + 'default' => Configure::read('Bake.theme') ?: null, 'choices' => $this->_getBakeThemes(), ]); diff --git a/app/vendor/cakephp/bake/src/Command/ShellHelperCommand.php b/app/vendor/cakephp/bake/src/Command/ShellHelperCommand.php index 19f8d5d3f..55643663d 100644 --- a/app/vendor/cakephp/bake/src/Command/ShellHelperCommand.php +++ b/app/vendor/cakephp/bake/src/Command/ShellHelperCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 1.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/SimpleBakeCommand.php b/app/vendor/cakephp/bake/src/Command/SimpleBakeCommand.php index 8e114c149..c21dcef78 100644 --- a/app/vendor/cakephp/bake/src/Command/SimpleBakeCommand.php +++ b/app/vendor/cakephp/bake/src/Command/SimpleBakeCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/TemplateAllCommand.php b/app/vendor/cakephp/bake/src/Command/TemplateAllCommand.php index 9d2aae179..dd16f13ad 100644 --- a/app/vendor/cakephp/bake/src/Command/TemplateAllCommand.php +++ b/app/vendor/cakephp/bake/src/Command/TemplateAllCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/TemplateCommand.php b/app/vendor/cakephp/bake/src/Command/TemplateCommand.php index 8a4e3de0c..57d9372da 100644 --- a/app/vendor/cakephp/bake/src/Command/TemplateCommand.php +++ b/app/vendor/cakephp/bake/src/Command/TemplateCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; diff --git a/app/vendor/cakephp/bake/src/Command/TestCommand.php b/app/vendor/cakephp/bake/src/Command/TestCommand.php index 7df61a610..9fe9cd91f 100644 --- a/app/vendor/cakephp/bake/src/Command/TestCommand.php +++ b/app/vendor/cakephp/bake/src/Command/TestCommand.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Command; @@ -57,6 +57,7 @@ class TestCommand extends BakeCommand 'Mailer' => 'Mailer', 'Command' => 'Command', 'CommandHelper' => 'Command\Helper', + 'Middleware' => 'Middleware', ]; /** @@ -79,6 +80,7 @@ class TestCommand extends BakeCommand 'Mailer' => 'Mailer', 'Command' => 'Command', 'CommandHelper' => 'Helper', + 'Middleware' => 'Middleware', ]; /** diff --git a/app/vendor/cakephp/bake/src/Plugin.php b/app/vendor/cakephp/bake/src/Plugin.php index f1a96a02f..ec8703b03 100644 --- a/app/vendor/cakephp/bake/src/Plugin.php +++ b/app/vendor/cakephp/bake/src/Plugin.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 1.7.2 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake; diff --git a/app/vendor/cakephp/bake/src/Shell/Task/BakeTask.php b/app/vendor/cakephp/bake/src/Shell/Task/BakeTask.php index b4191cc83..8d2a4b909 100644 --- a/app/vendor/cakephp/bake/src/Shell/Task/BakeTask.php +++ b/app/vendor/cakephp/bake/src/Shell/Task/BakeTask.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Shell\Task; diff --git a/app/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php b/app/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php index a42c94cc5..efadac3cb 100644 --- a/app/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php +++ b/app/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Shell\Task; diff --git a/app/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php b/app/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php index 4d4b080ad..07647b4e6 100644 --- a/app/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php +++ b/app/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 1.4.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Utility; diff --git a/app/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php b/app/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php index 44d395f5b..643d68b62 100644 --- a/app/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php +++ b/app/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Utility\Model; diff --git a/app/vendor/cakephp/bake/src/Utility/Process.php b/app/vendor/cakephp/bake/src/Utility/Process.php index 897ee007c..974e0ea4a 100644 --- a/app/vendor/cakephp/bake/src/Utility/Process.php +++ b/app/vendor/cakephp/bake/src/Utility/Process.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Utility; diff --git a/app/vendor/cakephp/bake/src/Utility/SubsetSchemaCollection.php b/app/vendor/cakephp/bake/src/Utility/SubsetSchemaCollection.php index 790219442..f05c13a10 100644 --- a/app/vendor/cakephp/bake/src/Utility/SubsetSchemaCollection.php +++ b/app/vendor/cakephp/bake/src/Utility/SubsetSchemaCollection.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Utility; diff --git a/app/vendor/cakephp/bake/src/Utility/TableScanner.php b/app/vendor/cakephp/bake/src/Utility/TableScanner.php index a729698d3..2b327c3f6 100644 --- a/app/vendor/cakephp/bake/src/Utility/TableScanner.php +++ b/app/vendor/cakephp/bake/src/Utility/TableScanner.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Utility; diff --git a/app/vendor/cakephp/bake/src/Utility/TemplateRenderer.php b/app/vendor/cakephp/bake/src/Utility/TemplateRenderer.php index 10abc01ef..027934b89 100644 --- a/app/vendor/cakephp/bake/src/Utility/TemplateRenderer.php +++ b/app/vendor/cakephp/bake/src/Utility/TemplateRenderer.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Utility; diff --git a/app/vendor/cakephp/bake/src/View/BakeView.php b/app/vendor/cakephp/bake/src/View/BakeView.php index 2700cb679..3a3b6df78 100644 --- a/app/vendor/cakephp/bake/src/View/BakeView.php +++ b/app/vendor/cakephp/bake/src/View/BakeView.php @@ -2,17 +2,17 @@ declare(strict_types=1); /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 0.1.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\View; @@ -107,7 +107,7 @@ public function render(?string $template = null, $layout = null): string * * @param mixed $subject The object that this event applies to * ($this by default). - * @return \Cake\Event\EventInterface + * @return \Cake\Event\EventInterface */ public function dispatchEvent(string $name, $data = null, $subject = null): EventInterface { diff --git a/app/vendor/cakephp/bake/templates/bake/Command/command.twig b/app/vendor/cakephp/bake/templates/bake/Command/command.twig index 9eeafa29e..ab52d71d6 100644 --- a/app/vendor/cakephp/bake/templates/bake/Command/command.twig +++ b/app/vendor/cakephp/bake/templates/bake/Command/command.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 1.7.4 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Command/helper.twig b/app/vendor/cakephp/bake/templates/bake/Command/helper.twig index a35a96b3a..94781585f 100644 --- a/app/vendor/cakephp/bake/templates/bake/Command/helper.twig +++ b/app/vendor/cakephp/bake/templates/bake/Command/helper.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.6.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Controller/component.twig b/app/vendor/cakephp/bake/templates/bake/Controller/component.twig index 247ed6fb6..8f4b42bbe 100644 --- a/app/vendor/cakephp/bake/templates/bake/Controller/component.twig +++ b/app/vendor/cakephp/bake/templates/bake/Controller/component.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Controller/controller.twig b/app/vendor/cakephp/bake/templates/bake/Controller/controller.twig index c50bb8844..894c2cda9 100644 --- a/app/vendor/cakephp/bake/templates/bake/Controller/controller.twig +++ b/app/vendor/cakephp/bake/templates/bake/Controller/controller.twig @@ -4,17 +4,17 @@ * * Allows templating of Controllers generated from bake. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Form/form.twig b/app/vendor/cakephp/bake/templates/bake/Form/form.twig index 7992b5f46..5f8c64de6 100644 --- a/app/vendor/cakephp/bake/templates/bake/Form/form.twig +++ b/app/vendor/cakephp/bake/templates/bake/Form/form.twig @@ -1,16 +1,16 @@ {# /** -* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) -* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +* CakePHP(tm) : Rapid Development Framework (https://cakephp.org) +* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * -* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -* @link http://cakephp.org CakePHP(tm) Project +* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +* @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 -* @license http://www.opensource.org/licenses/mit-license.php MIT License +* @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Mailer/mailer.twig b/app/vendor/cakephp/bake/templates/bake/Mailer/mailer.twig index e5dc1200a..55c01a532 100644 --- a/app/vendor/cakephp/bake/templates/bake/Mailer/mailer.twig +++ b/app/vendor/cakephp/bake/templates/bake/Mailer/mailer.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Middleware/middleware.twig b/app/vendor/cakephp/bake/templates/bake/Middleware/middleware.twig index d52e7df9d..366f01be2 100644 --- a/app/vendor/cakephp/bake/templates/bake/Middleware/middleware.twig +++ b/app/vendor/cakephp/bake/templates/bake/Middleware/middleware.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Model/behavior.twig b/app/vendor/cakephp/bake/templates/bake/Model/behavior.twig index e60fa2ced..5a40c4a69 100644 --- a/app/vendor/cakephp/bake/templates/bake/Model/behavior.twig +++ b/app/vendor/cakephp/bake/templates/bake/Model/behavior.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Model/entity.twig b/app/vendor/cakephp/bake/templates/bake/Model/entity.twig index 073ae8921..68d599731 100644 --- a/app/vendor/cakephp/bake/templates/bake/Model/entity.twig +++ b/app/vendor/cakephp/bake/templates/bake/Model/entity.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {% set propertyHintMap = DocBlock.buildEntityPropertyHintTypeMap(propertySchema ?: []) %} diff --git a/app/vendor/cakephp/bake/templates/bake/Model/table.twig b/app/vendor/cakephp/bake/templates/bake/Model/table.twig index f64a0c04c..7c213e0dc 100644 --- a/app/vendor/cakephp/bake/templates/bake/Model/table.twig +++ b/app/vendor/cakephp/bake/templates/bake/Model/table.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {% set annotations = DocBlock.buildTableAnnotations(associations, associationInfo, behaviors, entity, namespace) %} diff --git a/app/vendor/cakephp/bake/templates/bake/Plugin/README.md.twig b/app/vendor/cakephp/bake/templates/bake/Plugin/README.md.twig index 0763927b5..70db4b70b 100644 --- a/app/vendor/cakephp/bake/templates/bake/Plugin/README.md.twig +++ b/app/vendor/cakephp/bake/templates/bake/Plugin/README.md.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} # {{ plugin }} plugin for CakePHP diff --git a/app/vendor/cakephp/bake/templates/bake/Plugin/composer.json.twig b/app/vendor/cakephp/bake/templates/bake/Plugin/composer.json.twig index eebe5dc8e..75e0699f3 100644 --- a/app/vendor/cakephp/bake/templates/bake/Plugin/composer.json.twig +++ b/app/vendor/cakephp/bake/templates/bake/Plugin/composer.json.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {% set namespace = namespace|replace({'\\': '\\\\'}) %} diff --git a/app/vendor/cakephp/bake/templates/bake/Plugin/phpunit.xml.dist.twig b/app/vendor/cakephp/bake/templates/bake/Plugin/phpunit.xml.dist.twig index a9f755639..7a6f6e717 100644 --- a/app/vendor/cakephp/bake/templates/bake/Plugin/phpunit.xml.dist.twig +++ b/app/vendor/cakephp/bake/templates/bake/Plugin/phpunit.xml.dist.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} diff --git a/app/vendor/cakephp/bake/templates/bake/Plugin/src/Controller/AppController.php.twig b/app/vendor/cakephp/bake/templates/bake/Plugin/src/Controller/AppController.php.twig index c03c62bb0..398ac38c0 100644 --- a/app/vendor/cakephp/bake/templates/bake/Plugin/src/Controller/AppController.php.twig +++ b/app/vendor/cakephp/bake/templates/bake/Plugin/src/Controller/AppController.php.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Plugin/src/Plugin.php.twig b/app/vendor/cakephp/bake/templates/bake/Plugin/src/Plugin.php.twig index 93d738fd4..a7d1575ac 100644 --- a/app/vendor/cakephp/bake/templates/bake/Plugin/src/Plugin.php.twig +++ b/app/vendor/cakephp/bake/templates/bake/Plugin/src/Plugin.php.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 1.7.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Plugin/tests/bootstrap.php.twig b/app/vendor/cakephp/bake/templates/bake/Plugin/tests/bootstrap.php.twig index bf80eb9a3..7604c2906 100644 --- a/app/vendor/cakephp/bake/templates/bake/Plugin/tests/bootstrap.php.twig +++ b/app/vendor/cakephp/bake/templates/bake/Plugin/tests/bootstrap.php.twig @@ -2,17 +2,17 @@ /** * Tests bootstrap file * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header',{namespace: null}) }} diff --git a/app/vendor/cakephp/bake/templates/bake/Plugin/webroot/.gitkeep.twig b/app/vendor/cakephp/bake/templates/bake/Plugin/webroot/.gitkeep.twig index e48dbb3c0..1e0f7064d 100644 --- a/app/vendor/cakephp/bake/templates/bake/Plugin/webroot/.gitkeep.twig +++ b/app/vendor/cakephp/bake/templates/bake/Plugin/webroot/.gitkeep.twig @@ -1,15 +1,15 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} \ No newline at end of file diff --git a/app/vendor/cakephp/bake/templates/bake/Shell/helper.twig b/app/vendor/cakephp/bake/templates/bake/Shell/helper.twig index d52832442..799299feb 100644 --- a/app/vendor/cakephp/bake/templates/bake/Shell/helper.twig +++ b/app/vendor/cakephp/bake/templates/bake/Shell/helper.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} {{ element('Bake.file_header', { diff --git a/app/vendor/cakephp/bake/templates/bake/Template/add.twig b/app/vendor/cakephp/bake/templates/bake/Template/add.twig index 068f8d44c..c21d7c1d2 100644 --- a/app/vendor/cakephp/bake/templates/bake/Template/add.twig +++ b/app/vendor/cakephp/bake/templates/bake/Template/add.twig @@ -1,16 +1,16 @@ {# /** - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ #} - * @license http://spdx.org/licenses/MIT MIT License + * @license https://spdx.org/licenses/MIT MIT License * @link https://github.com/escapestudios/Symfony2-coding-standard */ class BlankLineBeforeReturnSniff implements Sniff diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Functions/ClosureDeclarationSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Functions/ClosureDeclarationSniff.php index 4b2a86e05..3756a8712 100644 --- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Functions/ClosureDeclarationSniff.php +++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Functions/ClosureDeclarationSniff.php @@ -10,7 +10,7 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @link https://github.com/cakephp/cakephp-codesniffer * @since CakePHP CodeSniffer 0.1.28 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace CakePHP\Sniffs\Functions; diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidFunctionNameSniff.php index 7212f25d0..777a888bc 100644 --- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidFunctionNameSniff.php @@ -10,7 +10,7 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @link https://github.com/cakephp/cakephp-codesniffer * @since CakePHP CodeSniffer 0.1.1 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidTraitNameSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidTraitNameSniff.php index 0736d5b70..f3aae2e36 100644 --- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidTraitNameSniff.php +++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/NamingConventions/ValidTraitNameSniff.php @@ -10,7 +10,7 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @link https://github.com/cakephp/cakephp-codesniffer * @since CakePHP CodeSniffer 0.1.10 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php index f1fbab200..be835fe74 100644 --- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php +++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php @@ -10,7 +10,7 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @link https://github.com/cakephp/cakephp-codesniffer * @since CakePHP CodeSniffer 0.1.14 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace CakePHP\Sniffs\PHP; diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php index e196fd758..7536d233d 100644 --- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php +++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php @@ -10,14 +10,14 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @link https://github.com/cakephp/cakephp-codesniffer * @since CakePHP CodeSniffer 2.4.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ /** * Ensures that not more than one blank line occurs * * @author Mark Scherer - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace CakePHP\Sniffs\WhiteSpace; diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionCallSpacingSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionCallSpacingSniff.php index 1ac02c430..256c6b173 100644 --- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionCallSpacingSniff.php +++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionCallSpacingSniff.php @@ -10,7 +10,7 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @link https://github.com/cakephp/cakephp-codesniffer * @since CakePHP CodeSniffer 0.1.12 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php index 6d977d589..c39c9f251 100644 --- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php +++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php @@ -10,7 +10,7 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @link https://github.com/cakephp/cakephp-codesniffer * @since CakePHP CodeSniffer 0.1.11 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml index 543481aa8..c5dba1351 100644 --- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml +++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml @@ -154,9 +154,6 @@ - - - */config/* */templates/* diff --git a/app/vendor/cakephp/cakephp-codesniffer/composer.json b/app/vendor/cakephp/cakephp-codesniffer/composer.json index bb1e9380f..4e593b5ee 100644 --- a/app/vendor/cakephp/cakephp-codesniffer/composer.json +++ b/app/vendor/cakephp/cakephp-codesniffer/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": ">=7.2.0", - "slevomat/coding-standard": "^6.3.6 || ^7.0 || ^8.0", + "slevomat/coding-standard": "^7.0 || ^8.0", "squizlabs/php_codesniffer": "^3.6" }, "require-dev": { diff --git a/app/vendor/cakephp/cakephp-codesniffer/docs/README.md b/app/vendor/cakephp/cakephp-codesniffer/docs/README.md index e5727fe37..225fe6f50 100644 --- a/app/vendor/cakephp/cakephp-codesniffer/docs/README.md +++ b/app/vendor/cakephp/cakephp-codesniffer/docs/README.md @@ -1,6 +1,6 @@ # CakePHP ruleset -The CakePHP standard contains 136 sniffs +The CakePHP standard contains 135 sniffs CakePHP (19 sniffs) ------------------- @@ -52,10 +52,9 @@ Generic (25 sniffs) - Generic.WhiteSpace.IncrementDecrementSpacing - Generic.WhiteSpace.ScopeIndent -PEAR (2 sniffs) +PEAR (1 sniff) --------------- - PEAR.Functions.ValidDefaultValue -- PEAR.NamingConventions.ValidFunctionName PSR1 (3 sniffs) --------------- @@ -63,11 +62,12 @@ PSR1 (3 sniffs) - PSR1.Files.SideEffects - PSR1.Methods.CamelCapsMethodName -PSR12 (16 sniffs) +PSR12 (17 sniffs) ----------------- - PSR12.Classes.AnonClassDeclaration - PSR12.Classes.ClassInstantiation - PSR12.Classes.ClosingBrace +- PSR12.Classes.OpeningBraceSpace - PSR12.ControlStructures.BooleanOperatorPlacement - PSR12.ControlStructures.ControlStructureSpacing - PSR12.Files.DeclareStatement @@ -129,7 +129,7 @@ SlevomatCodingStandard (32 sniffs) - SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing - SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable -Squiz (29 sniffs) +Squiz (28 sniffs) ----------------- - Squiz.Arrays.ArrayBracketSpacing - Squiz.Classes.ClassFileName @@ -144,7 +144,6 @@ Squiz (29 sniffs) - Squiz.Functions.FunctionDeclarationArgumentSpacing - Squiz.Functions.LowercaseFunctionKeywords - Squiz.Functions.MultiLineFunctionDeclaration -- Squiz.NamingConventions.ValidFunctionName - Squiz.Operators.ValidLogicalOperators - Squiz.PHP.DisallowSizeFunctionsInLoops - Squiz.PHP.Eval diff --git a/app/vendor/cakephp/cakephp/VERSION.txt b/app/vendor/cakephp/cakephp/VERSION.txt index 320e64024..d0e169172 100644 --- a/app/vendor/cakephp/cakephp/VERSION.txt +++ b/app/vendor/cakephp/cakephp/VERSION.txt @@ -16,4 +16,4 @@ // @license https://opensource.org/licenses/mit-license.php MIT License // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -4.4.11 +4.4.16 diff --git a/app/vendor/cakephp/cakephp/composer.json b/app/vendor/cakephp/cakephp/composer.json index 39f7d6672..278f11070 100644 --- a/app/vendor/cakephp/cakephp/composer.json +++ b/app/vendor/cakephp/cakephp/composer.json @@ -64,9 +64,17 @@ "suggest": { "ext-curl": "To enable more efficient network calls in Http\\Client.", "ext-openssl": "To use Security::encrypt() or have secure CSRF token generation.", - "lib-ICU": "The intl PHP library, to use Text::transliterate() or Text::slug()", + "lib-ICU": "To use locale-aware features in the I18n and Database packages", "paragonie/csp-builder": "CSP builder, to use the CSP Middleware" }, + "provide": { + "psr/container-implementation": "^1.0 || ^2.0", + "psr/http-client-implementation": "^1.0", + "psr/http-server-handler-implementation": "^1.0", + "psr/http-server-middleware-implementation": "^1.0", + "psr/log-implementation": "^1.0 || ^2.0", + "psr/simple-cache-implementation": "^1.0 || ^2.0" + }, "config": { "process-timeout": 900, "sort-packages": true, diff --git a/app/vendor/cakephp/cakephp/src/Cache/composer.json b/app/vendor/cakephp/cakephp/src/Cache/composer.json index 96aec1982..7f20c1e9a 100644 --- a/app/vendor/cakephp/cakephp/src/Cache/composer.json +++ b/app/vendor/cakephp/cakephp/src/Cache/composer.json @@ -27,7 +27,7 @@ "psr/simple-cache": "^1.0 || ^2.0" }, "provide": { - "psr/simple-cache-implementation": "^1.0.0" + "psr/simple-cache-implementation": "^1.0 || ^2.0" }, "autoload": { "psr-4": { diff --git a/app/vendor/cakephp/cakephp/src/Collection/CollectionInterface.php b/app/vendor/cakephp/cakephp/src/Collection/CollectionInterface.php index 12cbb1c3c..7e50cfced 100644 --- a/app/vendor/cakephp/cakephp/src/Collection/CollectionInterface.php +++ b/app/vendor/cakephp/cakephp/src/Collection/CollectionInterface.php @@ -250,8 +250,7 @@ public function extract($path): CollectionInterface; * ``` * * @param callable|string $path The column name to use for sorting or callback that returns the value. - * @param int $sort The sort type, one of SORT_STRING - * SORT_NUMERIC or SORT_NATURAL + * @param int $sort The sort type, one of SORT_STRING, SORT_NUMERIC or SORT_NATURAL * @see \Cake\Collection\CollectionInterface::sortBy() * @return mixed The value of the top element in the collection */ @@ -276,8 +275,7 @@ public function max($path, int $sort = \SORT_NUMERIC); * ``` * * @param callable|string $path The column name to use for sorting or callback that returns the value. - * @param int $sort The sort type, one of SORT_STRING - * SORT_NUMERIC or SORT_NATURAL + * @param int $sort The sort type, one of SORT_STRING, SORT_NUMERIC or SORT_NATURAL * @see \Cake\Collection\CollectionInterface::sortBy() * @return mixed The value of the bottom element in the collection */ @@ -306,9 +304,9 @@ public function min($path, int $sort = \SORT_NUMERIC); * The average of an empty set or 0 rows is `null`. Collections with `null` * values are not considered empty. * - * @param callable|string|null $path The property name to sum or a function + * @param callable|string|null $path The property name to compute the average or a function * If no value is passed, an identity function will be used. - * that will return the value of the property to sum. + * that will return the value of the property to compute the average. * @return float|int|null */ public function avg($path = null); @@ -339,18 +337,17 @@ public function avg($path = null); * The median of an empty set or 0 rows is `null`. Collections with `null` * values are not considered empty. * - * @param callable|string|null $path The property name to sum or a function + * @param callable|string|null $path The property name to compute the median or a function * If no value is passed, an identity function will be used. - * that will return the value of the property to sum. + * that will return the value of the property to compute the median. * @return float|int|null */ public function median($path = null); /** * Returns a sorted iterator out of the elements in this collection, - * ranked in ascending order by the results of running each value through a - * callback. $callback can also be a string representing the column or property - * name. + * ranked based on the results of applying a callback function to each value. + * The parameter $path can also be a string representing the column or property name. * * The callback will receive as its first argument each of the elements in $items, * the value returned by the callback will be used as the value for sorting such @@ -378,8 +375,7 @@ public function median($path = null); * * @param callable|string $path The column name to use for sorting or callback that returns the value. * @param int $order The sort order, either SORT_DESC or SORT_ASC - * @param int $sort The sort type, one of SORT_STRING - * SORT_NUMERIC or SORT_NATURAL + * @param int $sort The sort type, one of SORT_STRING, SORT_NUMERIC or SORT_NATURAL * @return self */ public function sortBy($path, int $order = SORT_DESC, int $sort = \SORT_NUMERIC): CollectionInterface; @@ -513,7 +509,7 @@ public function countBy($path): CollectionInterface; * ``` * $items = [ * ['invoice' => ['total' => 100]], - * ['invoice' => ['total' => 200]] + * ['invoice' => ['total' => 200]], * ]; * * $total = (new Collection($items))->sumOf('invoice.total'); @@ -540,7 +536,7 @@ public function sumOf($path = null); public function shuffle(): CollectionInterface; /** - * Returns a new collection with maximum $size random elements + * Returns a new collection with maximum $length random elements * from this collection * * @param int $length the maximum number of elements to randomly @@ -550,7 +546,7 @@ public function shuffle(): CollectionInterface; public function sample(int $length = 10): CollectionInterface; /** - * Returns a new collection with maximum $size elements in the internal + * Returns a new collection with maximum $length elements in the internal * order this collection was created. If a second parameter is passed, it * will determine from what position to start taking elements. * @@ -598,19 +594,19 @@ public function skip(int $length): CollectionInterface; * ``` * $items = [ * ['comment' => ['body' => 'cool', 'user' => ['name' => 'Mark']], - * ['comment' => ['body' => 'very cool', 'user' => ['name' => 'Renan']] + * ['comment' => ['body' => 'very cool', 'user' => ['name' => 'Renan']], * ]; * * $extracted = (new Collection($items))->match(['user.name' => 'Renan']); * * // Result will look like this when converted to array * [ - * ['comment' => ['body' => 'very cool', 'user' => ['name' => 'Renan']] + * ['comment' => ['body' => 'very cool', 'user' => ['name' => 'Renan']]] * ] * ``` * * @param array $conditions a key-value list of conditions where - * the key is a property path as accepted by `Collection::extract, + * the key is a property path as accepted by `Collection::extract`, * and the value the condition against with each element will be matched * @return self */ @@ -705,7 +701,7 @@ public function prependItem($item, $key = null): CollectionInterface; * // Result will look like this when converted to array * [ * 'a' => [1 => 'foo', 3 => 'baz'], - * 'b' => [2 => 'bar'] + * 'b' => [2 => 'bar'], * ]; * ``` * @@ -724,9 +720,9 @@ public function combine($keyPath, $valuePath, $groupPath = null): CollectionInte * based on an id property path and a parent id property path. * * @param callable|string $idPath the column name path to use for determining - * whether an element is parent of another + * whether an element is a parent of another * @param callable|string $parentPath the column name path to use for determining - * whether an element is child of another + * whether an element is a child of another * @param string $nestingKey The key name under which children are nested * @return self */ @@ -835,7 +831,7 @@ public function compile(bool $keepKeys = true): CollectionInterface; /** * Returns a new collection where any operations chained after it are guaranteed - * to be run lazily. That is, elements will be yieleded one at a time. + * to be run lazily. That is, elements will be yielded one at a time. * * A lazy collection can only be iterated once. A second attempt results in an error. * @@ -1162,7 +1158,7 @@ public function countKeys(): int; /** * Create a new collection that is the cartesian product of the current collection * - * In order to create a carteisan product a collection must contain a single dimension + * In order to create a cartesian product a collection must contain a single dimension * of data. * * ### Example diff --git a/app/vendor/cakephp/cakephp/src/Command/PluginLoadCommand.php b/app/vendor/cakephp/cakephp/src/Command/PluginLoadCommand.php index b4122832e..bfd61b91b 100644 --- a/app/vendor/cakephp/cakephp/src/Command/PluginLoadCommand.php +++ b/app/vendor/cakephp/cakephp/src/Command/PluginLoadCommand.php @@ -109,6 +109,14 @@ protected function modifyApplication(string $app, string $plugin): void $this->abort(); } + // Check if plugin is already loaded + $regex = '#->addPlugin\(\'' . $plugin . '\'#mu'; + if (preg_match($regex, $contents, $otherMatches, PREG_OFFSET_CAPTURE)) { + $this->io->info('The specified plugin is already loaded!'); + + return; + } + $append = "$indent \$this->addPlugin('%s');\n"; $insert = str_replace(', []', '', sprintf($append, $plugin)); diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/SecurityComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/SecurityComponent.php index 4043b3f36..1b84ba258 100644 --- a/app/vendor/cakephp/cakephp/src/Controller/Component/SecurityComponent.php +++ b/app/vendor/cakephp/cakephp/src/Controller/Component/SecurityComponent.php @@ -427,7 +427,7 @@ protected function _debugPostTokenNotMatching(Controller $controller, array $has $expectedFields = Hash::get($expectedParts, 1); $dataFields = Hash::get($hashParts, 1); if ($dataFields) { - $dataFields = unserialize($dataFields); + $dataFields = unserialize($dataFields, ['allowed_classes' => false]); } $fieldsMessages = $this->_debugCheckFields( $dataFields, diff --git a/app/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php b/app/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php index 3ebf99fa4..34b8c18a7 100644 --- a/app/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php +++ b/app/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php @@ -350,6 +350,7 @@ protected function missingController(ServerRequest $request) 'plugin' => $request->getParam('plugin'), 'prefix' => $request->getParam('prefix'), '_ext' => $request->getParam('_ext'), + 'class' => $request->getParam('controller'), // Deprecated: Will be removed in 4.5. Use `controller` instead. ]); } } diff --git a/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php b/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php index c11a12c60..2db862427 100644 --- a/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php +++ b/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php @@ -68,7 +68,7 @@ trait StaticConfigTrait * ``` * * @param array|string $key The name of the configuration, or an array of multiple configs. - * @param object|array|null $config An array of name => configuration data for adapter. + * @param mixed $config Configuration value. Generally an array of name => configuration data for adapter. * @throws \BadMethodCallException When trying to modify an existing config. * @throws \LogicException When trying to store an invalid structured config array. * @return void @@ -95,7 +95,7 @@ public static function setConfig($key, $config = null): void $config = ['className' => $config]; } - if (isset($config['url'])) { + if (is_array($config) && isset($config['url'])) { $parsed = static::parseDsn($config['url']); unset($config['url']); $config = $parsed + $config; diff --git a/app/vendor/cakephp/cakephp/src/Core/composer.json b/app/vendor/cakephp/cakephp/src/Core/composer.json index 2a62b03ec..d5d4cf761 100644 --- a/app/vendor/cakephp/cakephp/src/Core/composer.json +++ b/app/vendor/cakephp/cakephp/src/Core/composer.json @@ -25,6 +25,9 @@ "php": ">=7.4.0", "cakephp/utility": "^4.0" }, + "provide": { + "psr/container-implementation": "^1.0 || ^2.0" + }, "suggest": { "cakephp/event": "To use PluginApplicationInterface or plugin applications.", "cakephp/cache": "To use Configure::store() and restore().", diff --git a/app/vendor/cakephp/cakephp/src/Core/functions.php b/app/vendor/cakephp/cakephp/src/Core/functions.php index e74ac1736..f938d8817 100644 --- a/app/vendor/cakephp/cakephp/src/Core/functions.php +++ b/app/vendor/cakephp/cakephp/src/Core/functions.php @@ -289,7 +289,12 @@ function deprecationWarning(string $message, int $stackFrame = 1): void $frame = $trace[$stackFrame]; $frame += ['file' => '[internal]', 'line' => '??']; - $relative = str_replace(DIRECTORY_SEPARATOR, '/', substr($frame['file'], strlen(ROOT) + 1)); + // Assuming we're installed in vendor/cakephp/cakephp/src/Core/functions.php + $root = dirname(__DIR__, 5); + if (defined('ROOT')) { + $root = ROOT; + } + $relative = str_replace(DIRECTORY_SEPARATOR, '/', substr($frame['file'], strlen($root) + 1)); $patterns = (array)Configure::read('Error.ignoredDeprecationPaths'); foreach ($patterns as $pattern) { $pattern = str_replace(DIRECTORY_SEPARATOR, '/', $pattern); diff --git a/app/vendor/cakephp/cakephp/src/Database/Exception/DatabaseException.php b/app/vendor/cakephp/cakephp/src/Database/Exception/DatabaseException.php index 3852808d9..05e4cd0dd 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Exception/DatabaseException.php +++ b/app/vendor/cakephp/cakephp/src/Database/Exception/DatabaseException.php @@ -23,6 +23,10 @@ */ class DatabaseException extends CakeException { + /** + * @inheritDoc + */ + protected $_messageTemplate = '%s'; } // phpcs:disable diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/WhenThenExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/WhenThenExpression.php index e4bbc0878..bf51eaf19 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Expression/WhenThenExpression.php +++ b/app/vendor/cakephp/cakephp/src/Database/Expression/WhenThenExpression.php @@ -134,7 +134,7 @@ public function when($when, $type = null) 'The `$when` argument must be either a non-empty array, a scalar value, an object, ' . 'or an instance of `\%s`, `%s` given.', ExpressionInterface::class, - is_array($when) ? '[]' : getTypeName($when) // @phpstan-ignore-line + is_array($when) ? '[]' : getTypeName($when) )); } diff --git a/app/vendor/cakephp/cakephp/src/Database/Log/LoggingStatement.php b/app/vendor/cakephp/cakephp/src/Database/Log/LoggingStatement.php index 47e529a55..ada3d381d 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Log/LoggingStatement.php +++ b/app/vendor/cakephp/cakephp/src/Database/Log/LoggingStatement.php @@ -16,6 +16,8 @@ */ namespace Cake\Database\Log; +use Cake\Core\Configure; +use Cake\Database\Exception\DatabaseException; use Cake\Database\Statement\StatementDecorator; use Exception; use Psr\Log\LoggerInterface; @@ -75,16 +77,31 @@ public function execute(?array $params = null): bool $result = parent::execute($params); $this->loggedQuery->took = (int)round((microtime(true) - $this->startTime) * 1000, 0); } catch (Exception $e) { + $this->loggedQuery->error = $e; + $this->_log(); + + if (Configure::read('Error.convertStatementToDatabaseException', false) === true) { + $code = $e->getCode(); + if (!is_int($code)) { + $code = null; + } + + throw new DatabaseException([ + 'message' => $e->getMessage(), + 'queryString' => $this->queryString, + ], $code, $e); + } + if (version_compare(PHP_VERSION, '8.2.0', '<')) { deprecationWarning( '4.4.12 - Having queryString set on exceptions is deprecated.' . - 'If you are not using this attribute there is no action to take.' + 'If you are not using this attribute there is no action to take.' . + 'Otherwise, enable Error.convertStatementToDatabaseException.' ); /** @psalm-suppress UndefinedPropertyAssignment */ $e->queryString = $this->queryString; } - $this->loggedQuery->error = $e; - $this->_log(); + throw $e; } diff --git a/app/vendor/cakephp/cakephp/src/Database/Query.php b/app/vendor/cakephp/cakephp/src/Database/Query.php index fc66f6e80..503c3a443 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Query.php +++ b/app/vendor/cakephp/cakephp/src/Database/Query.php @@ -29,6 +29,7 @@ use InvalidArgumentException; use IteratorAggregate; use RuntimeException; +use Throwable; /** * This class represents a Relational database SQL Query. A query can be of @@ -2456,7 +2457,7 @@ function ($errno, $errstr) { ); $sql = $this->sql(); $params = $this->getValueBinder()->bindings(); - } catch (RuntimeException $e) { + } catch (Throwable $e) { $sql = 'SQL could not be generated for this query as it is incomplete.'; $params = []; } finally { diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/PostgresSchemaDialect.php b/app/vendor/cakephp/cakephp/src/Database/Schema/PostgresSchemaDialect.php index 4b2b6e7dd..423727582 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Schema/PostgresSchemaDialect.php +++ b/app/vendor/cakephp/cakephp/src/Database/Schema/PostgresSchemaDialect.php @@ -642,6 +642,10 @@ public function createTableSql(TableSchema $schema, array $columns, array $const $content = array_merge($columns, $constraints); $content = implode(",\n", array_filter($content)); $tableName = $this->_driver->quoteIdentifier($schema->name()); + $dbSchema = $this->_driver->schema(); + if ($dbSchema != 'public') { + $tableName = $this->_driver->quoteIdentifier($dbSchema) . '.' . $tableName; + } $temporary = $schema->isTemporary() ? ' TEMPORARY ' : ' '; $out = []; $out[] = sprintf("CREATE%sTABLE %s (\n%s\n)", $temporary, $tableName, $content); diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchema.php b/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchema.php index 3dac32330..9db5fbb16 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchema.php +++ b/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchema.php @@ -475,13 +475,6 @@ public function addIndex(string $name, $attrs) $this->_table )); } - if (empty($attrs['columns'])) { - throw new DatabaseException(sprintf( - 'Index "%s" in table "%s" must have at least one column.', - $name, - $this->_table - )); - } $attrs['columns'] = (array)$attrs['columns']; foreach ($attrs['columns'] as $field) { if (empty($this->_columns[$field])) { diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/DateTimeType.php b/app/vendor/cakephp/cakephp/src/Database/Type/DateTimeType.php index 655c78f3c..130b49bd2 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Type/DateTimeType.php +++ b/app/vendor/cakephp/cakephp/src/Database/Type/DateTimeType.php @@ -229,10 +229,9 @@ public function toPHP($value, DriverInterface $driver) $class = $this->_className; if (is_int($value)) { $instance = new $class('@' . $value); + } elseif (strpos($value, '0000-00-00') === 0) { + return null; } else { - if (strpos($value, '0000-00-00') === 0) { - return null; - } $instance = new $class($value, $this->dbTimezone); } @@ -282,14 +281,13 @@ public function manyToPHP(array $values, array $fields, DriverInterface $driver) } $value = $values[$field]; - if (strpos($value, '0000-00-00') === 0) { - $values[$field] = null; - continue; - } $class = $this->_className; if (is_int($value)) { $instance = new $class('@' . $value); + } elseif (strpos($value, '0000-00-00') === 0) { + $values[$field] = null; + continue; } else { $instance = new $class($value, $this->dbTimezone); } diff --git a/app/vendor/cakephp/cakephp/src/Datasource/Paging/NumericPaginator.php b/app/vendor/cakephp/cakephp/src/Datasource/Paging/NumericPaginator.php index 66d0665c4..a49c21699 100644 --- a/app/vendor/cakephp/cakephp/src/Datasource/Paging/NumericPaginator.php +++ b/app/vendor/cakephp/cakephp/src/Datasource/Paging/NumericPaginator.php @@ -42,6 +42,13 @@ class NumericPaginator implements PaginatorInterface * - `allowedParameters` - A list of parameters users are allowed to set using request * parameters. Modifying this list will allow users to have more influence * over pagination, be careful with what you permit. + * - `sortableFields` - A list of fields which can be used for sorting. By + * default all table columns can be used for sorting. You can use this option + * to restrict sorting only by particular fields. If you want to allow + * sorting on either associated columns or calculated fields then you will + * have to explicity specify them (along with other fields). Using an empty + * array will disable sorting alltogether. + * - `finder` - The table finder to use. Defaults to `all`. * * @var array */ diff --git a/app/vendor/cakephp/cakephp/src/Error/ExceptionTrap.php b/app/vendor/cakephp/cakephp/src/Error/ExceptionTrap.php index 3ae2f9ab0..f86155762 100644 --- a/app/vendor/cakephp/cakephp/src/Error/ExceptionTrap.php +++ b/app/vendor/cakephp/cakephp/src/Error/ExceptionTrap.php @@ -348,6 +348,7 @@ public function logException(Throwable $exception, ?ServerRequestInterface $requ foreach ($this->getConfig('skipLog') as $class) { if ($exception instanceof $class) { $shouldLog = false; + break; } } } diff --git a/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php b/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php index 00d11a454..70ac122e7 100644 --- a/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php +++ b/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php @@ -776,8 +776,8 @@ public function delete(?string $path = null): bool * * ### Options * - * - `from` The directory to copy from, this will cause a cd() to occur, changing the results of pwd(). - * - `mode` The mode to copy the files/directories with as integer, e.g. 0775. + * - `from` The directory to copy from, this will cause a cd() to occur, changing the results of `pwd()`. + * - `mode` The mode to copy the files/directories with as integer, e.g. `0770`. * - `skip` Files/directories to skip. * - `scheme` Folder::MERGE, Folder::OVERWRITE, Folder::SKIP * - `recursive` Whether to copy recursively or not (default: true - recursive) @@ -877,8 +877,8 @@ public function copy(string $to, array $options = []): bool * * ### Options * - * - `from` The directory to copy from, this will cause a cd() to occur, changing the results of pwd(). - * - `mode` The mode to copy the files/directories with as integer, e.g. 0775. + * - `from` The directory to copy from, this will cause a cd() to occur, changing the results of `pwd()`. + * - `mode` The mode to copy the files/directories with as integer, e.g. `0770`. * - `skip` Files/directories to skip. * - `scheme` Folder::MERGE, Folder::OVERWRITE, Folder::SKIP * - `recursive` Whether to copy recursively or not (default: true - recursive) diff --git a/app/vendor/cakephp/cakephp/src/Http/Cookie/Cookie.php b/app/vendor/cakephp/cakephp/src/Http/Cookie/Cookie.php index f4fea6736..24d2494cd 100644 --- a/app/vendor/cakephp/cakephp/src/Http/Cookie/Cookie.php +++ b/app/vendor/cakephp/cakephp/src/Http/Cookie/Cookie.php @@ -621,7 +621,7 @@ public function withNeverExpire() public function withExpired() { $new = clone $this; - $new->expiresAt = new DateTimeImmutable('1970-01-01 00:00:01'); + $new->expiresAt = new DateTimeImmutable('@1'); return $new; } diff --git a/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieCollection.php b/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieCollection.php index d7c13295f..a028433f3 100644 --- a/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieCollection.php +++ b/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieCollection.php @@ -88,7 +88,7 @@ public static function createFromServerRequest(ServerRequestInterface $request) $data = $request->getCookieParams(); $cookies = []; foreach ($data as $name => $value) { - $cookies[] = new Cookie($name, $value); + $cookies[] = new Cookie((string)$name, $value); } return new static($cookies); diff --git a/app/vendor/cakephp/cakephp/src/Http/Session.php b/app/vendor/cakephp/cakephp/src/Http/Session.php index a9a0687b0..d9a88e35e 100644 --- a/app/vendor/cakephp/cakephp/src/Http/Session.php +++ b/app/vendor/cakephp/cakephp/src/Http/Session.php @@ -17,6 +17,8 @@ namespace Cake\Http; use Cake\Core\App; +use Cake\Core\Exception\CakeException; +use Cake\Error\Debugger; use Cake\Utility\Hash; use InvalidArgumentException; use RuntimeException; @@ -65,6 +67,13 @@ class Session */ protected $_isCLI = false; + /** + * Info about where the headers were sent. + * + * @var array{filename: string, line: int}|null + */ + protected $headerSentInfo = null; + /** * Returns a new instance of a session after building a configuration bundle for it. * This function allows an options array which will be used for configuring the session @@ -342,7 +351,10 @@ public function start(): bool throw new RuntimeException('Session was already started'); } - if (ini_get('session.use_cookies') && headers_sent()) { + $filename = $line = null; + if (ini_get('session.use_cookies') && headers_sent($filename, $line)) { + $this->headerSentInfo = ['filename' => $filename, 'line' => $line]; + return false; } @@ -491,8 +503,18 @@ public function consume(string $name) */ public function write($name, $value = null): void { - if (!$this->started()) { - $this->start(); + $started = $this->started() || $this->start(); + if (!$started) { + $message = 'Could not start the session'; + if ($this->headerSentInfo !== null) { + $message .= sprintf( + ', headers already sent in file `%s` on line `%s`', + Debugger::trimPath($this->headerSentInfo['filename']), + $this->headerSentInfo['line'] + ); + } + + throw new CakeException($message); } if (!is_array($name)) { diff --git a/app/vendor/cakephp/cakephp/src/Http/composer.json b/app/vendor/cakephp/cakephp/src/Http/composer.json index c5d38425d..ee0f86a2c 100644 --- a/app/vendor/cakephp/cakephp/src/Http/composer.json +++ b/app/vendor/cakephp/cakephp/src/Http/composer.json @@ -35,7 +35,9 @@ "laminas/laminas-httphandlerrunner": "^1.0" }, "provide": { - "psr/http-client-implementation": "^1.0" + "psr/http-client-implementation": "^1.0", + "psr/http-server-implementation": "^1.0", + "psr/http-server-middleware-implementation": "^1.0" }, "suggest": { "cakephp/cache": "To use cache session storage", diff --git a/app/vendor/cakephp/cakephp/src/Log/Log.php b/app/vendor/cakephp/cakephp/src/Log/Log.php index aa39561b0..930187820 100644 --- a/app/vendor/cakephp/cakephp/src/Log/Log.php +++ b/app/vendor/cakephp/cakephp/src/Log/Log.php @@ -273,7 +273,7 @@ public static function levels(): array * ``` * * @param array|string $key The name of the logger config, or an array of multiple configs. - * @param array|null $config An array of name => config data for adapter. + * @param array|\Closure|null $config An array of name => config data for adapter. * @return void * @throws \BadMethodCallException When trying to modify an existing config. */ diff --git a/app/vendor/cakephp/cakephp/src/Log/composer.json b/app/vendor/cakephp/cakephp/src/Log/composer.json index 25512558f..78f0d0eee 100644 --- a/app/vendor/cakephp/cakephp/src/Log/composer.json +++ b/app/vendor/cakephp/cakephp/src/Log/composer.json @@ -28,7 +28,7 @@ "psr/log": "^1.0 || ^2.0" }, "provide": { - "psr/log-implementation": "^1.0.0" + "psr/log-implementation": "^1.0 || ^2.0" }, "autoload": { "psr-4": { diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php b/app/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php index 68be51147..0e6409eed 100644 --- a/app/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php +++ b/app/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php @@ -16,6 +16,7 @@ */ namespace Cake\Mailer\Transport; +use Cake\Core\Exception\CakeException; use Cake\Mailer\AbstractTransport; use Cake\Mailer\Message; use Cake\Network\Exception\SocketException; @@ -28,8 +29,15 @@ */ class SmtpTransport extends AbstractTransport { - protected const AUTH_PLAIN = 'PLAIN'; - protected const AUTH_LOGIN = 'LOGIN'; + public const AUTH_PLAIN = 'PLAIN'; + public const AUTH_LOGIN = 'LOGIN'; + public const AUTH_XOAUTH2 = 'XOAUTH2'; + + public const SUPPORTED_AUTH_TYPES = [ + self::AUTH_PLAIN, + self::AUTH_LOGIN, + self::AUTH_XOAUTH2, + ]; /** * Default config for this class @@ -45,6 +53,7 @@ class SmtpTransport extends AbstractTransport 'client' => null, 'tls' => false, 'keepAlive' => false, + 'authType' => null, ]; /** @@ -69,7 +78,7 @@ class SmtpTransport extends AbstractTransport protected $_lastResponse = []; /** - * Detected authentication type. + * Authentication type. * * @var string|null */ @@ -230,7 +239,22 @@ protected function _bufferResponseLines(array $responseLines): void */ protected function _parseAuthType(): void { - $this->authType = null; + $authType = $this->getConfig('authType'); + if ($authType !== null) { + if (!in_array($authType, self::SUPPORTED_AUTH_TYPES)) { + throw new CakeException( + 'Unsupported auth type. Available types are: ' . implode(', ', self::SUPPORTED_AUTH_TYPES) + ); + } + + $this->authType = $authType; + + return; + } + + if (!isset($this->_config['username'], $this->_config['password'])) { + return; + } $auth = ''; foreach ($this->_lastResponse as $line) { @@ -240,17 +264,19 @@ protected function _parseAuthType(): void } } - if (strpos($auth, self::AUTH_PLAIN) !== false) { - $this->authType = self::AUTH_PLAIN; - + if ($auth === '') { return; } - if (strpos($auth, self::AUTH_LOGIN) !== false) { - $this->authType = self::AUTH_LOGIN; + foreach (self::SUPPORTED_AUTH_TYPES as $type) { + if (strpos($auth, $type) !== false) { + $this->authType = $type; - return; + return; + } } + + throw new CakeException('Unsupported auth type: ' . substr($auth, 5)); } /** @@ -322,27 +348,27 @@ protected function _auth(): void $username = $this->_config['username']; $password = $this->_config['password']; - if (empty($this->authType)) { - $replyCode = $this->_authPlain($username, $password); - if ($replyCode === '235') { - return; - } - - $this->_authLogin($username, $password); - return; - } + switch ($this->authType) { + case self::AUTH_PLAIN: + $this->_authPlain($username, $password); + break; - if ($this->authType === self::AUTH_PLAIN) { - $this->_authPlain($username, $password); + case self::AUTH_LOGIN: + $this->_authLogin($username, $password); + break; - return; - } + case self::AUTH_XOAUTH2: + $this->_authXoauth2($username, $password); + break; - if ($this->authType === self::AUTH_LOGIN) { - $this->_authLogin($username, $password); + default: + $replyCode = $this->_authPlain($username, $password); + if ($replyCode === '235') { + break; + } - return; + $this->_authLogin($username, $password); } } @@ -394,6 +420,26 @@ protected function _authLogin(string $username, string $password): void } } + /** + * Authenticate using AUTH XOAUTH2 mechanism. + * + * @param string $username Username. + * @param string $token Token. + * @return void + * @see https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth#smtp-protocol-exchange + * @see https://developers.google.com/gmail/imap/xoauth2-protocol#smtp_protocol_exchange + */ + protected function _authXoauth2(string $username, string $token): void + { + $authString = base64_encode(sprintf( + "user=%s\1auth=Bearer %s\1\1", + $username, + $token + )); + + $this->_smtpSend('AUTH XOAUTH2 ' . $authString, '235'); + } + /** * Prepares the `MAIL FROM` SMTP command. * diff --git a/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php b/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php index 5e7d6ff2c..9e9e9c0d1 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php +++ b/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php @@ -66,6 +66,9 @@ public function __construct(?LocatorInterface $tableLocator = null) * @param string $alias The association alias * @param \Cake\ORM\Association $association The association to add. * @return \Cake\ORM\Association The association object being added. + * @template T of \Cake\ORM\Association + * @psalm-param T $association + * @psalm-return T */ public function add(string $alias, Association $association): Association { @@ -82,7 +85,9 @@ public function add(string $alias, Association $association): Association * @param array $options List of options to configure the association definition. * @return \Cake\ORM\Association * @throws \InvalidArgumentException - * @psalm-param class-string<\Cake\ORM\Association> $className + * @template T of \Cake\ORM\Association + * @psalm-param class-string $className + * @psalm-return T */ public function load(string $className, string $associated, array $options = []): Association { diff --git a/app/vendor/cakephp/cakephp/src/ORM/Table.php b/app/vendor/cakephp/cakephp/src/ORM/Table.php index 0c8250691..1a37af224 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Table.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Table.php @@ -632,9 +632,7 @@ protected function _initializeSchema(TableSchemaInterface $schema): TableSchemaI */ public function hasField(string $field): bool { - $schema = $this->getSchema(); - - return $schema->getColumn($field) !== null; + return $this->getSchema()->getColumn($field) !== null; } /** @@ -1048,10 +1046,7 @@ public function belongsTo(string $associated, array $options = []): BelongsTo { $options += ['sourceTable' => $this]; - /** @var \Cake\ORM\Association\BelongsTo $association */ - $association = $this->_associations->load(BelongsTo::class, $associated, $options); - - return $association; + return $this->_associations->load(BelongsTo::class, $associated, $options); } /** @@ -1094,10 +1089,7 @@ public function hasOne(string $associated, array $options = []): HasOne { $options += ['sourceTable' => $this]; - /** @var \Cake\ORM\Association\HasOne $association */ - $association = $this->_associations->load(HasOne::class, $associated, $options); - - return $association; + return $this->_associations->load(HasOne::class, $associated, $options); } /** @@ -1146,10 +1138,7 @@ public function hasMany(string $associated, array $options = []): HasMany { $options += ['sourceTable' => $this]; - /** @var \Cake\ORM\Association\HasMany $association */ - $association = $this->_associations->load(HasMany::class, $associated, $options); - - return $association; + return $this->_associations->load(HasMany::class, $associated, $options); } /** @@ -1200,10 +1189,7 @@ public function belongsToMany(string $associated, array $options = []): BelongsT { $options += ['sourceTable' => $this]; - /** @var \Cake\ORM\Association\BelongsToMany $association */ - $association = $this->_associations->load(BelongsToMany::class, $associated, $options); - - return $association; + return $this->_associations->load(BelongsToMany::class, $associated, $options); } /** @@ -2782,9 +2768,8 @@ public function newEmptyEntity(): EntityInterface public function newEntity(array $data, array $options = []): EntityInterface { $options['associated'] = $options['associated'] ?? $this->_associations->keys(); - $marshaller = $this->marshaller(); - return $marshaller->one($data, $options); + return $this->marshaller()->one($data, $options); } /** @@ -2822,9 +2807,8 @@ public function newEntity(array $data, array $options = []): EntityInterface public function newEntities(array $data, array $options = []): array { $options['associated'] = $options['associated'] ?? $this->_associations->keys(); - $marshaller = $this->marshaller(); - return $marshaller->many($data, $options); + return $this->marshaller()->many($data, $options); } /** @@ -2881,9 +2865,8 @@ public function newEntities(array $data, array $options = []): array public function patchEntity(EntityInterface $entity, array $data, array $options = []): EntityInterface { $options['associated'] = $options['associated'] ?? $this->_associations->keys(); - $marshaller = $this->marshaller(); - return $marshaller->merge($entity, $data, $options); + return $this->marshaller()->merge($entity, $data, $options); } /** @@ -2920,9 +2903,8 @@ public function patchEntity(EntityInterface $entity, array $data, array $options public function patchEntities(iterable $entities, array $data, array $options = []): array { $options['associated'] = $options['associated'] ?? $this->_associations->keys(); - $marshaller = $this->marshaller(); - return $marshaller->mergeMany($entities, $data, $options); + return $this->marshaller()->mergeMany($entities, $data, $options); } /** diff --git a/app/vendor/cakephp/cakephp/src/Routing/RouteBuilder.php b/app/vendor/cakephp/cakephp/src/Routing/RouteBuilder.php index 80952eee0..25dcfd5eb 100644 --- a/app/vendor/cakephp/cakephp/src/Routing/RouteBuilder.php +++ b/app/vendor/cakephp/cakephp/src/Routing/RouteBuilder.php @@ -985,13 +985,13 @@ public function registerMiddleware(string $name, $middleware) } /** - * Apply a middleware to the current route scope. + * Apply one or many middleware to the current route scope. * - * Requires middleware to be registered via `registerMiddleware()` + * Requires middleware to be registered via `registerMiddleware()`. * * @param string ...$names The names of the middleware to apply to the current scope. * @return $this - * @throws \RuntimeException + * @throws \RuntimeException If it cannot apply one of the given middleware or middleware groups. * @see \Cake\Routing\RouteCollection::addMiddlewareToScope() */ public function applyMiddleware(string ...$names) diff --git a/app/vendor/cakephp/cakephp/src/Routing/RouteCollection.php b/app/vendor/cakephp/cakephp/src/Routing/RouteCollection.php index 5ceadaf14..8f96a5a99 100644 --- a/app/vendor/cakephp/cakephp/src/Routing/RouteCollection.php +++ b/app/vendor/cakephp/cakephp/src/Routing/RouteCollection.php @@ -124,6 +124,12 @@ public function parse(string $url, string $method = ''): array { $decoded = urldecode($url); + $queryParameters = []; + if (strpos($url, '?') !== false) { + [$url, $qs] = explode('?', $url, 2); + parse_str($qs, $queryParameters); + } + // Sort path segments matching longest paths first. krsort($this->_paths); @@ -132,12 +138,6 @@ public function parse(string $url, string $method = ''): array continue; } - $queryParameters = []; - if (strpos($url, '?') !== false) { - [$url, $qs] = explode('?', $url, 2); - parse_str($qs, $queryParameters); - } - foreach ($routes as $route) { $r = $route->parse($url, $method); if ($r === null) { diff --git a/app/vendor/cakephp/cakephp/src/Shell/Helper/ProgressHelper.php b/app/vendor/cakephp/cakephp/src/Shell/Helper/ProgressHelper.php index b91a69c5b..f3eb29ff1 100644 --- a/app/vendor/cakephp/cakephp/src/Shell/Helper/ProgressHelper.php +++ b/app/vendor/cakephp/cakephp/src/Shell/Helper/ProgressHelper.php @@ -35,6 +35,17 @@ */ class ProgressHelper extends Helper { + /** + * Default value for progress bar total value. + * Percent completion is derived from progress/total + */ + protected const DEFAULT_TOTAL = 100; + + /** + * Default value for progress bar width + */ + protected const DEFAULT_WIDTH = 80; + /** * The current progress. * @@ -47,14 +58,14 @@ class ProgressHelper extends Helper * * @var int */ - protected $_total = 0; + protected $_total = self::DEFAULT_TOTAL; /** * The width of the bar. * * @var int */ - protected $_width = 0; + protected $_width = self::DEFAULT_WIDTH; /** * Output a progress bar. @@ -102,7 +113,7 @@ public function output(array $args): void */ public function init(array $args = []) { - $args += ['total' => 100, 'width' => 80]; + $args += ['total' => self::DEFAULT_TOTAL, 'width' => self::DEFAULT_WIDTH]; $this->_progress = 0; $this->_width = $args['width']; $this->_total = $args['total']; diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/TestEmailTransport.php b/app/vendor/cakephp/cakephp/src/TestSuite/TestEmailTransport.php index dee56b7d6..f70f872fa 100644 --- a/app/vendor/cakephp/cakephp/src/TestSuite/TestEmailTransport.php +++ b/app/vendor/cakephp/cakephp/src/TestSuite/TestEmailTransport.php @@ -42,7 +42,7 @@ class TestEmailTransport extends DebugTransport */ public function send(Message $message): array { - static::$messages[] = $message; + static::$messages[] = clone $message; return parent::send($message); } diff --git a/app/vendor/cakephp/cakephp/src/Utility/Hash.php b/app/vendor/cakephp/cakephp/src/Utility/Hash.php index f30cc8271..782f2c5ca 100644 --- a/app/vendor/cakephp/cakephp/src/Utility/Hash.php +++ b/app/vendor/cakephp/cakephp/src/Utility/Hash.php @@ -1119,7 +1119,6 @@ public static function diff(array $data, array $compare): array next($intersection); } - /** @phpstan-ignore-next-line */ return $data + $compare; } diff --git a/app/vendor/cakephp/cakephp/src/Validation/Validation.php b/app/vendor/cakephp/cakephp/src/Validation/Validation.php index c70c3d80e..6ca684f3a 100644 --- a/app/vendor/cakephp/cakephp/src/Validation/Validation.php +++ b/app/vendor/cakephp/cakephp/src/Validation/Validation.php @@ -1614,7 +1614,7 @@ public static function utf8($value, array $options = []): bool } $options += ['extended' => false]; if ($options['extended']) { - return true; + return preg_match('//u', $value) === 1; } return preg_match('/[\x{10000}-\x{10FFFF}]/u', $value) === 0; diff --git a/app/vendor/cakephp/cakephp/src/Validation/Validator.php b/app/vendor/cakephp/cakephp/src/Validation/Validator.php index bbc06bef3..e968a4c96 100644 --- a/app/vendor/cakephp/cakephp/src/Validation/Validator.php +++ b/app/vendor/cakephp/cakephp/src/Validation/Validator.php @@ -231,7 +231,7 @@ public function errors(array $data, bool $newRecord = true): array /** * Validates and returns an array of failed fields and their error messages. * - * @param array $data The data to be checked for errors + * @param array $data The data to be checked for errors * @param bool $newRecord whether the data to be validated is new or to be updated. * @return array Array of failed fields */ @@ -240,6 +240,7 @@ public function validate(array $data, bool $newRecord = true): array $errors = []; foreach ($this->_fields as $name => $field) { + $name = (string)$name; $keyPresent = array_key_exists($name, $data); $providers = $this->_providers; @@ -422,12 +423,12 @@ public function offsetExists($field): bool /** * Returns the rule set for a field * - * @param string $field name of the field to check + * @param string|int $field name of the field to check * @return \Cake\Validation\ValidationSet */ public function offsetGet($field): ValidationSet { - return $this->field($field); + return $this->field((string)$field); } /** @@ -676,7 +677,7 @@ public function remove(string $field, ?string $rule = null) * You can also set mode and message for all passed fields, the individual * setting takes precedence over group settings. * - * @param array|string $field the name of the field or list of fields. + * @param array|string $field the name of the field or list of fields. * @param callable|string|bool $mode Valid values are true, false, 'create', 'update'. * If a callable is passed then the field will be required only when the callback * returns true. @@ -698,7 +699,7 @@ public function requirePresence($field, $mode = true, ?string $message = null) $settings = $this->_convertValidatorToArray($fieldName, $defaults, $setting); $fieldName = current(array_keys($settings)); - $this->field($fieldName)->requirePresence($settings[$fieldName]['mode']); + $this->field((string)$fieldName)->requirePresence($settings[$fieldName]['mode']); if ($settings[$fieldName]['message']) { $this->_presenceMessages[$fieldName] = $settings[$fieldName]['message']; } @@ -1144,12 +1145,15 @@ public function notEmptyDateTime(string $field, ?string $message = null, $when = * * @param string|int $fieldName name of field * @param array $defaults default settings - * @param array|string $settings settings from data + * @param array|string $settings settings from data * @return array * @throws \InvalidArgumentException */ protected function _convertValidatorToArray($fieldName, array $defaults = [], $settings = []): array { + if (is_int($settings)) { + $settings = (string)$settings; + } if (is_string($settings)) { $fieldName = $settings; $settings = []; @@ -1224,7 +1228,7 @@ protected function _convertValidatorToArray($fieldName, array $defaults = [], $s * * @deprecated 3.7.0 Use {@link notEmptyString()}, {@link notEmptyArray()}, {@link notEmptyFile()}, * {@link notEmptyDate()}, {@link notEmptyTime()} or {@link notEmptyDateTime()} instead. - * @param array|string $field the name of the field or list of fields + * @param array|string $field the name of the field or list of fields * @param string|null $message The message to show if the field is not * @param callable|string|bool $when Indicates when the field is not allowed * to be empty. Valid values are true (always), 'create', 'update'. If a @@ -1255,7 +1259,7 @@ public function notEmpty($field, ?string $message = null, $when = false) $whenSetting = $this->invertWhenClause($settings[$fieldName]['when']); - $this->field($fieldName)->allowEmpty($whenSetting); + $this->field((string)$fieldName)->allowEmpty($whenSetting); $this->_allowEmptyFlags[$fieldName] = static::EMPTY_ALL; if ($settings[$fieldName]['message']) { $this->_allowEmptyMessages[$fieldName] = $settings[$fieldName]['message']; diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php index a3033bcc2..058248c99 100644 --- a/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php +++ b/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php @@ -891,11 +891,9 @@ protected function _modulusNumbers(StringTemplate $templater, array $params, arr ]); } - $url = $options['url']; - $url['?']['page'] = $params['page']; $out .= $templater->format('current', [ 'text' => $this->Number->format($params['page']), - 'url' => $this->generateUrl($url, $options['model']), + 'url' => $this->generateUrl(['page' => $params['page']], $options['model'], $options['url']), ]); $start = $params['page'] + 1; diff --git a/app/vendor/cakephp/cakephp/src/View/StringTemplate.php b/app/vendor/cakephp/cakephp/src/View/StringTemplate.php index d5f875bed..9a838950f 100644 --- a/app/vendor/cakephp/cakephp/src/View/StringTemplate.php +++ b/app/vendor/cakephp/cakephp/src/View/StringTemplate.php @@ -179,8 +179,15 @@ protected function _compileTemplates(array $templates = []): void $template = $this->get($name); if ($template === null) { $this->_compiled[$name] = [null, null]; + + continue; } + assert( + is_string($template), + sprintf('Template for `%s` must be of type `string`, but is `%s`', $name, gettype($template)) + ); + $template = str_replace('%', '%%', $template); preg_match_all('#\{\{([\w\.]+)\}\}#', $template, $matches); $this->_compiled[$name] = [ diff --git a/app/vendor/cakephp/cakephp/templates/Error/missing_controller.php b/app/vendor/cakephp/cakephp/templates/Error/missing_controller.php index 02899ced8..9b73c6f89 100644 --- a/app/vendor/cakephp/cakephp/templates/Error/missing_controller.php +++ b/app/vendor/cakephp/cakephp/templates/Error/missing_controller.php @@ -11,7 +11,7 @@ * @link https://cakephp.org CakePHP(tm) Project * @since 0.10.0 * @license https://opensource.org/licenses/mit-license.php MIT License - * @var string $class + * @var string $controller */ use Cake\Core\Configure; use Cake\Core\Plugin; @@ -21,10 +21,10 @@ $namespace = Configure::read('App.namespace'); $prefixNs = $prefixPath = ''; -$incompleteInflection = (strpos($class, '_') !== false || strpos($class, '-')); -$originalClass = $class; +$incompleteInflection = (strpos($controller, '_') !== false || strpos($controller, '-')); +$originalClass = $controller; -$class = Inflector::camelize($class); +$class = Inflector::camelize($controller); if (!empty($prefix)) { $prefix = array_map('Cake\Utility\Inflector::camelize', explode('/', $prefix)); diff --git a/app/vendor/cakephp/chronos/LICENSE b/app/vendor/cakephp/chronos/LICENSE index 97f3ee6d4..e8772ee54 100644 --- a/app/vendor/cakephp/chronos/LICENSE +++ b/app/vendor/cakephp/chronos/LICENSE @@ -1,5 +1,5 @@ Copyright (C) Brian Nesbitt -Copyright (C) Cake Software Foundation, Inc. (http://cakefoundation.org) +Copyright (C) Cake Software Foundation, Inc. (https://cakefoundation.org) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/cakephp/chronos/README.md b/app/vendor/cakephp/chronos/README.md index 0aad3315e..ca6f943dd 100644 --- a/app/vendor/cakephp/chronos/README.md +++ b/app/vendor/cakephp/chronos/README.md @@ -63,7 +63,6 @@ want to migrate, we could use the following to update files: ``` # Replace imports -find ./src -type f -name '*.php' -exec sed -i '' 's/use Carbon\\CarbonInterval/use Cake\\Chronos\\ChronosInterval/g' {} \; find ./src -type f -name '*.php' -exec sed -i '' 's/use Carbon\\CarbonImmutable/use Cake\\Chronos\\Chronos/g' {} \; find ./src -type f -name '*.php' -exec sed -i '' 's/use Carbon\\Carbon/use Cake\\Chronos\\Chronos/g' {} \; @@ -104,7 +103,7 @@ In the case that you need a mutable instance you can get one: $time = new Chronos('2015-10-21 16:29:00'); $mutable = $time->toMutable(); -$date = new Date('2015-10-21'); +$date = new ChronosDate('2015-10-21'); $mutable = $date->toMutable(); ``` @@ -130,9 +129,9 @@ set to the server default timezone. This makes them ideal when working with calendar dates as the time components will always match. ```php -use Cake\Chronos\Date; +use Cake\Chronos\ChronosDate; -$today = new Date(); +$today = new ChronosDate(); echo $today; // Outputs '2015-10-21' diff --git a/app/vendor/cakephp/chronos/compare-data.json b/app/vendor/cakephp/chronos/compare-data.json new file mode 100644 index 000000000..0619f37fa --- /dev/null +++ b/app/vendor/cakephp/chronos/compare-data.json @@ -0,0 +1 @@ +{"2x":{"Cake\\Chronos\\Chronos":["__construct","toMutable","copy","setTestNow","getTestNow","hasTestNow","createInterval","__debugInfo","checkTypes","__wakeup","__set_state","createFromFormat","getLastErrors","format","getTimezone","getOffset","getTimestamp","diff","modify","add","sub","setTimezone","setTime","setDate","setISODate","setTimestamp","createFromMutable","createFromInterface","getWeekendDays","setWeekendDays","eq","equals","ne","notEquals","gt","greaterThan","gte","greaterThanOrEquals","lt","lessThan","lte","lessThanOrEquals","between","closest","farthest","min","max","isWeekday","isWeekend","isYesterday","isToday","isTomorrow","isNextWeek","isLastWeek","isNextMonth","isLastMonth","isNextYear","isLastYear","isFuture","isPast","isLeapYear","isSameDay","isSunday","isMonday","isTuesday","isWednesday","isThursday","isFriday","isSaturday","isThisWeek","isThisMonth","isThisYear","isBirthday","wasWithinLast","isWithinNext","isMutable","diffInYears","diffInMonths","diffInMonthsIgnoreTimezone","diffInWeeks","diffInDays","diffInDaysFiltered","diffInHoursFiltered","diffFiltered","diffInWeekdays","diffInWeekendDays","diffInHours","diffInMinutes","diffInSeconds","secondsSinceMidnight","secondsUntilEndOfDay","fromNow","diffForHumans","diffFormatter","instance","parse","now","today","tomorrow","yesterday","maxValue","minValue","create","createFromDate","createFromTime","createFromArray","createFromTimestamp","createFromTimestampUTC","resetToStringFormat","setToStringFormat","__toString","toDateString","toFormattedDateString","toTimeString","toDateTimeString","toDayDateTimeString","toAtomString","toCookieString","toIso8601String","toRfc822String","toRfc850String","toRfc1036String","toRfc1123String","toRfc2822String","toRfc3339String","toRssString","toW3cString","toUnixString","toQuarter","toWeek","__get","__isset","getWeekStartsAt","setWeekStartsAt","getWeekEndsAt","setWeekEndsAt","setDateTime","setTimeFromTimeString","timestamp","year","month","day","hour","minute","second","microsecond","addYears","addYear","subYears","subYear","addYearsWithOverflow","addYearWithOverflow","subYearsWithOverflow","subYearWithOverflow","addMonths","addMonth","subMonth","subMonths","addMonthsWithOverflow","addMonthWithOverflow","subMonthsWithOverflow","subMonthWithOverflow","addDays","addDay","subDay","subDays","addWeekdays","addWeekday","subWeekdays","subWeekday","addWeeks","addWeek","subWeek","subWeeks","addHours","addHour","subHour","subHours","addMinutes","addMinute","subMinute","subMinutes","addSeconds","addSecond","subSecond","subSeconds","startOfDay","endOfDay","startOfMonth","endOfMonth","startOfYear","endOfYear","startOfDecade","endOfDecade","startOfCentury","endOfCentury","startOfWeek","endOfWeek","next","previous","firstOfMonth","lastOfMonth","nthOfMonth","firstOfQuarter","lastOfQuarter","nthOfQuarter","firstOfYear","lastOfYear","nthOfYear","average","hasRelativeKeywords","timezone","tz"],"Cake\\Chronos\\ChronosDate":["__construct","toMutable","__debugInfo","create","add","sub","modify","setTimestamp","hour","minute","second","microsecond","__wakeup","__set_state","createFromFormat","getLastErrors","format","getTimezone","getOffset","getTimestamp","diff","setTimezone","setTime","setDate","setISODate","createFromMutable","createFromInterface","getWeekendDays","setWeekendDays","eq","equals","ne","notEquals","gt","greaterThan","gte","greaterThanOrEquals","lt","lessThan","lte","lessThanOrEquals","between","closest","farthest","min","max","isWeekday","isWeekend","isYesterday","isToday","isTomorrow","isNextWeek","isLastWeek","isNextMonth","isLastMonth","isNextYear","isLastYear","isFuture","isPast","isLeapYear","isSameDay","isSunday","isMonday","isTuesday","isWednesday","isThursday","isFriday","isSaturday","isThisWeek","isThisMonth","isThisYear","isBirthday","wasWithinLast","isWithinNext","isMutable","copy","diffInYears","diffInMonths","diffInMonthsIgnoreTimezone","diffInWeeks","diffInDays","diffInDaysFiltered","diffInHoursFiltered","diffFiltered","diffInWeekdays","diffInWeekendDays","diffInHours","diffInMinutes","diffInSeconds","secondsSinceMidnight","secondsUntilEndOfDay","fromNow","diffForHumans","diffFormatter","instance","parse","now","today","tomorrow","yesterday","maxValue","minValue","createFromDate","createFromTime","createFromArray","createFromTimestamp","createFromTimestampUTC","resetToStringFormat","setToStringFormat","__toString","toDateString","toFormattedDateString","toTimeString","toDateTimeString","toDayDateTimeString","toAtomString","toCookieString","toIso8601String","toRfc822String","toRfc850String","toRfc1036String","toRfc1123String","toRfc2822String","toRfc3339String","toRssString","toW3cString","toUnixString","toQuarter","toWeek","timezone","tz","hasRelativeKeywords","__get","__isset","getWeekStartsAt","setWeekStartsAt","getWeekEndsAt","setWeekEndsAt","setDateTime","setTimeFromTimeString","timestamp","year","month","day","addYears","addYear","subYears","subYear","addYearsWithOverflow","addYearWithOverflow","subYearsWithOverflow","subYearWithOverflow","addMonths","addMonth","subMonth","subMonths","addMonthsWithOverflow","addMonthWithOverflow","subMonthsWithOverflow","subMonthWithOverflow","addDays","addDay","subDay","subDays","addWeekdays","addWeekday","subWeekdays","subWeekday","addWeeks","addWeek","subWeek","subWeeks","addHours","addHour","subHour","subHours","addMinutes","addMinute","subMinute","subMinutes","addSeconds","addSecond","subSecond","subSeconds","startOfDay","endOfDay","startOfMonth","endOfMonth","startOfYear","endOfYear","startOfDecade","endOfDecade","startOfCentury","endOfCentury","startOfWeek","endOfWeek","next","previous","firstOfMonth","lastOfMonth","nthOfMonth","firstOfQuarter","lastOfQuarter","nthOfQuarter","firstOfYear","lastOfYear","nthOfYear","average","setTestNow","getTestNow","hasTestNow"]},"3x":{"Cake\\Chronos\\Chronos":["__construct","setTestNow","getTestNow","hasTestNow","hasRelativeKeywords","getWeekendDays","setWeekendDays","getWeekStartsAt","setWeekStartsAt","getWeekEndsAt","setWeekEndsAt","diffFormatter","instance","parse","now","today","tomorrow","yesterday","maxValue","minValue","create","createFromDate","createFromTime","createFromFormat","createFromArray","createFromTimestamp","createFromTimestampUTC","createInterval","setDateTime","setDate","setTime","modify","diff","format","getOffset","setTimestamp","getTimestamp","setTimezone","getTimezone","setTimeFromTimeString","timestamp","year","month","day","hour","minute","second","microsecond","addYears","subYears","addYearsWithOverflow","subYearsWithOverflow","addMonths","subMonths","addMonthsWithOverflow","subMonthsWithOverflow","addDays","subDays","addWeekdays","subWeekdays","addWeeks","subWeeks","addHours","subHours","addMinutes","subMinutes","addSeconds","subSeconds","startOfDay","endOfDay","startOfMonth","endOfMonth","startOfYear","endOfYear","startOfDecade","endOfDecade","startOfCentury","endOfCentury","startOfWeek","endOfWeek","next","previous","firstOfMonth","lastOfMonth","nthOfMonth","firstOfQuarter","lastOfQuarter","nthOfQuarter","firstOfYear","lastOfYear","nthOfYear","equals","notEquals","greaterThan","greaterThanOrEquals","lessThan","lessThanOrEquals","between","closest","farthest","min","max","average","isWeekday","isWeekend","isYesterday","isToday","isTomorrow","isNextWeek","isLastWeek","isNextMonth","isLastMonth","isNextYear","isLastYear","isFuture","isPast","isLeapYear","isSameDay","isSunday","isMonday","isTuesday","isWednesday","isThursday","isFriday","isSaturday","isThisWeek","isThisMonth","isThisYear","isBirthday","wasWithinLast","isWithinNext","diffFiltered","diffInYears","diffInMonths","diffInMonthsIgnoreTimezone","diffInWeeks","diffInDays","diffInDaysFiltered","diffInHoursFiltered","diffInWeekdays","diffInWeekendDays","diffInHours","diffInMinutes","diffInSeconds","secondsSinceMidnight","secondsUntilEndOfDay","fromNow","diffForHumans","__get","__isset","__debugInfo","resetToStringFormat","setToStringFormat","__toString","toDateString","toFormattedDateString","toTimeString","toDateTimeString","toDayDateTimeString","toAtomString","toCookieString","toIso8601String","toRfc822String","toRfc850String","toRfc1036String","toRfc1123String","toRfc2822String","toRfc3339String","toRssString","toW3cString","toUnixString","toQuarter","toWeek"],"Cake\\Chronos\\ChronosDate":["__construct","now","today","tomorrow","yesterday","parse","create","createFromFormat","createFromArray","diffFormatter","add","sub","modify","setDate","diff","format","year","month","day","addYears","subYears","addYearsWithOverflow","subYearsWithOverflow","addMonths","subMonths","addMonthsWithOverflow","subMonthsWithOverflow","addDays","subDays","addWeekdays","subWeekdays","addWeeks","subWeeks","startOfMonth","endOfMonth","startOfYear","endOfYear","startOfDecade","endOfDecade","startOfCentury","endOfCentury","startOfWeek","endOfWeek","next","previous","firstOfMonth","lastOfMonth","nthOfMonth","firstOfQuarter","lastOfQuarter","nthOfQuarter","firstOfYear","lastOfYear","nthOfYear","equals","notEquals","greaterThan","greaterThanOrEquals","lessThan","lessThanOrEquals","between","closest","farthest","isWeekday","isWeekend","isYesterday","isToday","isTomorrow","isNextWeek","isLastWeek","isNextMonth","isLastMonth","isNextYear","isLastYear","isFuture","isPast","isLeapYear","isSunday","isMonday","isTuesday","isWednesday","isThursday","isFriday","isSaturday","wasWithinLast","isWithinNext","diffFiltered","diffInYears","diffInMonths","diffInWeeks","diffInDays","diffInDaysFiltered","diffInWeekdays","diffInWeekendDays","diffForHumans","__get","__isset","__debugInfo","resetToStringFormat","setToStringFormat","__toString","toDateString","toFormattedDateString","toTimeString","toDateTimeString","toDayDateTimeString","toAtomString","toCookieString","toIso8601String","toRfc822String","toRfc850String","toRfc1036String","toRfc1123String","toRfc2822String","toRfc3339String","toRssString","toW3cString","toUnixString","toQuarter","toWeek"]}} \ No newline at end of file diff --git a/app/vendor/cakephp/chronos/docs.Dockerfile b/app/vendor/cakephp/chronos/docs.Dockerfile index 032ed39c6..7f6a1263e 100644 --- a/app/vendor/cakephp/chronos/docs.Dockerfile +++ b/app/vendor/cakephp/chronos/docs.Dockerfile @@ -1,5 +1,5 @@ # Generate the HTML output. -FROM markstory/cakephp-docs-builder as builder +FROM ghcr.io/cakephp/docs-builder as builder RUN pip install git+https://github.com/sphinx-contrib/video.git@master @@ -11,7 +11,7 @@ RUN cd /data/docs-builder && \ make website LANGS="$LANGS" SOURCE=/data/docs DEST=/data/website # Build a small nginx container with just the static site in it. -FROM markstory/cakephp-docs-builder:runtime as runtime +FROM ghcr.io/cakephp/docs-builder:runtime as runtime ENV LANGS="en fr ja pt" ENV SEARCH_SOURCE="/usr/share/nginx/html" diff --git a/app/vendor/cakephp/chronos/docs/en/2-4-upgrade-guide.rst b/app/vendor/cakephp/chronos/docs/en/2-4-upgrade-guide.rst new file mode 100644 index 000000000..3dedf799f --- /dev/null +++ b/app/vendor/cakephp/chronos/docs/en/2-4-upgrade-guide.rst @@ -0,0 +1,78 @@ +2.4 Upgrade Guide +################# + +Chronos 2.4 introduces a number of deprecations that will help you prepare your +application for the upcoming Chronos 3.x release. This guide covers the +deprecations introduced in 2.4 and gives a preview of what to expect in 3.0. + +No more mutable objects +======================= + +Chronos was an early adopter of PHP's immutable datetime objects. With PHP +moving away from mutable datetime objects both ``Cake\Chronos\MutableDate`` and +``Cake\Chronos\MutaleDateTime`` are deprecated and will be removed in 3.0.0. + +To upgrade, replace usage of ``MutableDate`` with ``ChronosDate`` and +``MutableDateTime`` with ``Chronos``. When modifying datetimes be sure to +always re-assign the variable with the datetime:: + + // Mutate in place + $datetime->modify('+1 days'); + + // Immutable objects must re-assign + $datetime = $datetime->modify('+1 days'); + +ChronosInterface deprecated +=========================== + +Having a consistent interface between date and datetime objects has proven to be +problematic. It created an illusion of compatibility between mutable and +immutable objects and date and datetime objects. Because the +``ChronosInterface`` didn't and can't really deliver on the goals of interfaces +it is deprecated, and will be removed in 3.0. To update your code replace +references to ``ChronosInterface`` with either a reference to +``Cake\Chronos\Chronos`` for datetime instances or ``Cake\Chronos\ChronosDate`` +for date instances. + +Fewer mutation methods +====================== + +For historical reasons the chronos classes included many redundant methods. For +example ``addYear()`` and ``addYears()``. In 2.4.0, all of the singular methods +e.g. ``addYear()`` are deprecated. Instead use the plural versions of the +methods e.g. ``addYears()``. + +Simpler Date class +================== + +When date abstractions were introduced they shared an interfaces with DateTime +classes. This resulted in many no-op methods on dates. For example calling +``setTime()`` on a date would have no effect. In 2.4, all time related methods +(including timezones) are deprecated on date instances. If your application +needs to use the time component of a date, you should use ``Chronos`` instead. + +Upcoming removals in 3.0 +======================== + +The following changes will arrive in 3.0, and don't have a simple deprecation +path. Unfortunately these changes will result in hard breaks in 3.0. + +Carbon aliases removed +---------------------- + +When Chronos was started Carbon had no active maintainers. We included +compatiblity aliases in Chronos to help users migrate from the unmaintained +Carbon library to Chronos. Presently, Carbon has active maintainers and we no +longer feel the need to provide shims. + +No longer extending DateTime +---------------------------- + +Historically Chronos has extended PHP's ``DateTime`` classes. This has proven to +be problematic especially for date classes. While Chronos will not extend +PHP's ``DateTime`` classes or implements the ``DateTimeInterface``, if a method does +not emit a deprecation in 2.4.0 it will continue to work in 3.0. + +To adapt to this change before upgrading to 3.0 replace references to PHP's +``DateTime`` and ``DateTimeInterface`` and use ``Chronos`` or ``ChronosDate`` +instead. diff --git a/app/vendor/cakephp/chronos/docs/en/contents.rst b/app/vendor/cakephp/chronos/docs/en/contents.rst index 10625a2c6..77906664c 100644 --- a/app/vendor/cakephp/chronos/docs/en/contents.rst +++ b/app/vendor/cakephp/chronos/docs/en/contents.rst @@ -3,5 +3,6 @@ :caption: CakePHP Chronos /index + /2-4-upgrade-guide - API \ No newline at end of file + API diff --git a/app/vendor/cakephp/chronos/docs/en/index.rst b/app/vendor/cakephp/chronos/docs/en/index.rst index dabb9b267..44668765c 100644 --- a/app/vendor/cakephp/chronos/docs/en/index.rst +++ b/app/vendor/cakephp/chronos/docs/en/index.rst @@ -26,11 +26,9 @@ Chronos provides 5 classes that cover mutable and immutable date/time variants and extensions to ``DateInterval``. * ``Cake\Chronos\Chronos`` is an immutable *date and time* object. -* ``Cake\Chronos\Date`` is a immutable *date* object. +* ``Cake\Chronos\ChronosDate`` is a immutable *date* object. * ``Cake\Chronos\MutableDateTime`` is a mutable *date and time* object. * ``Cake\Chronos\MutableDate`` is a mutable *date* object. -* ``Cake\Chronos\ChronosInterval`` is an extension to the ``DateInterval`` - object. Lastly, if you want to typehint against Chronos-provided date/time objects you should use ``Cake\Chronos\ChronosInterface``. All of the date and time objects @@ -97,13 +95,13 @@ Date Objects PHP only provides a single DateTime object. Representing calendar dates can be a bit awkward with this class as it includes timezones, and time components that don't really belong in the concept of a 'day'. Chronos provides a ``Date`` -object that allows you to represent dates. The time and timezone for these -objects is always fixed to ``00:00:00 UTC`` and all formatting/difference -methods operate at the day resolution:: +object that allows you to represent dates. The time for date objects is always +fixed to ``00:00:00``, and the timezone is set to the server local timezone. All +formatting/difference methods operate at the day resolution:: - use Cake\Chronos\Date; + use Cake\Chronos\ChronosDate; - $today = Date::today(); + $today = ChronosDate::today(); // Changes to the time/timezone are ignored. $today->modify('+1 hours'); @@ -117,7 +115,7 @@ time zone to use for current time such as ``now()`` or ``today()``:: use Cake\Chronos\Date: // Takes the current date from Asia/Tokyo time zone - $today = Date::today('Asia/Tokyo'); + $today = ChronosDate::today('Asia/Tokyo'); Modifier Methods ---------------- @@ -302,7 +300,7 @@ process you can include the following:: Chronos::setTestNow(Chronos::now()); MutableDateTime::setTestNow(MutableDateTime::now()); - Date::setTestNow(Date::now()); + ChronosDate::setTestNow(ChronosDate::now()); MutableDate::setTestNow(MutableDate::now()); This will fix the current time of all objects to be the point at which the test diff --git a/app/vendor/cakephp/chronos/docs/fr/index.rst b/app/vendor/cakephp/chronos/docs/fr/index.rst index 325767dcc..b3d76723a 100644 --- a/app/vendor/cakephp/chronos/docs/fr/index.rst +++ b/app/vendor/cakephp/chronos/docs/fr/index.rst @@ -27,11 +27,9 @@ par PHP. Chronos fournit 5 classes qui gèrent les variantes mutables et immutables de date/time et les extensions de ``DateInterval``. * ``Cake\Chronos\Chronos`` est un objet de *date et heure* immutable. -* ``Cake\Chronos\Date`` est un objet de *date* immutable. +* ``Cake\Chronos\ChronosDate`` est un objet de *date* immutable. * ``Cake\Chronos\MutableDateTime`` est un objet de *date et heure* mutable. * ``Cake\Chronos\MutableDate`` est un objet de *date* mutable. -* ``Cake\Chronos\ChronosInterval`` est une extension pour l'objet - ``DateInterval``. Enfin si vous voulez typer selon les objets date/time fournis par Chronos, vous devez utiliser ``Cake\Chronos\ChronosInterface``. Tous les objets date et @@ -105,9 +103,9 @@ de représenter les dates. Les time et timezone pour ces objets sont toujours fixés à ``00:00:00 UTC`` et toutes les méthodes de formatage/différence fonctionnent au niveau du jour:: - use Cake\Chronos\Date; + use Cake\Chronos\ChronosDate; - $today = Date::today(); + $today = ChronosDate::today(); // Les changements selon le time/timezone sont ignorés. $today->modify('+1 hours'); @@ -122,7 +120,7 @@ spécifier le fuseau à utiliser pour l'heure courante telle que ``now()`` ou use Cake\Chronos\Date: // Prend l'heure courante pour le fuseau horaire de Tokyo - $today = Date::today('Asia/Tokyo'); + $today = ChronosDate::today('Asia/Tokyo'); Méthodes de Modification @@ -313,7 +311,7 @@ vous pouvez inclure ce qui suit:: Chronos::setTestNow(Chronos::now()); MutableDateTime::setTestNow(MutableDateTime::now()); - Date::setTestNow(Date::now()); + ChronosDate::setTestNow(ChronosDate::now()); MutableDate::setTestNow(MutableDate::now()); Ceci va fixer le time courant de tous les objets selon le moment où la suite de diff --git a/app/vendor/cakephp/chronos/docs/ja/index.rst b/app/vendor/cakephp/chronos/docs/ja/index.rst index 9e1db71d0..d8a8974bd 100644 --- a/app/vendor/cakephp/chronos/docs/ja/index.rst +++ b/app/vendor/cakephp/chronos/docs/ja/index.rst @@ -26,7 +26,7 @@ Chronos は ``DateInterval`` の拡張機能および、ミュータブル(変 イミュータブル(変更不可)な 日付/時刻 の派生系をカバーする5つのクラスを提供します。 * ``Cake\Chronos\Chronos`` はイミュータブルな *日付と時刻* オブジェクト。 -* ``Cake\Chronos\Date`` はイミュータブルな *日付* オブジェクト。 +* ``Cake\Chronos\ChronosDate`` はイミュータブルな *日付* オブジェクト。 * ``Cake\Chronos\MutableDateTime`` はミュータブルな *日付と時刻* オブジェクト。 * ``Cake\Chronos\MutableDate`` はミュータブルな *日付* オブジェクト。 * ``Cake\Chronos\ChronosInterval`` は ``DateInterval`` の拡張機能。 @@ -100,9 +100,9 @@ Chronos は日時表現のための ``Date`` オブジェクトを提供しま これらのオブジェクトの時間とタイムゾーンは常に ``00:00:00 UTC`` に固定されており、 全ての書式/差分のメソッドは一日単位で動作します。 :: - use Cake\Chronos\Date; + use Cake\Chronos\ChronosDate; - $today = Date::today(); + $today = ChronosDate::today(); // 時間/タイムゾーンの変更は無視されます $today->modify('+1 hours'); @@ -286,7 +286,7 @@ Chronos は、出力した日時オブジェクトを表示するための多く Chronos::setTestNow(Chronos::now()); MutableDateTime::setTestNow(MutableDateTime::now()); - Date::setTestNow(Date::now()); + ChronosDate::setTestNow(ChronosDate::now()); MutableDate::setTestNow(MutableDate::now()); これでテストスイートが開始された時点で全てのオブジェクトの現在時刻を修正します。 diff --git a/app/vendor/cakephp/chronos/docs/pt/index.rst b/app/vendor/cakephp/chronos/docs/pt/index.rst index d4a90af83..643a5e6c5 100644 --- a/app/vendor/cakephp/chronos/docs/pt/index.rst +++ b/app/vendor/cakephp/chronos/docs/pt/index.rst @@ -27,7 +27,7 @@ cobrem variantes de data/hora mutáveis e imutáveis e uma extensão do objeto ``DateInterval``. * ``Cake\Chronos\Chronos`` é um objeto *date & time* imutável. -* ``Cake\Chronos\Date`` é um objeto *date* imutável. +* ``Cake\Chronos\ChronosDate`` é um objeto *date* imutável. * ``Cake\Chronos\MutableDateTime`` é um objeto *date and time* mutável. * ``Cake\Chronos\MutableDate`` é um objeto *date* mutável. * ``Cake\Chronos\ChronosInterval`` é uma extensão do objeto ``DateInterval``. @@ -101,9 +101,9 @@ pode ser um pouco desconfortável por essa classe, uma vez que ela inclui zona desse objeto é sempre fixado em ``00:00:00 UTC`` e todos os métodos de formatação/diferença operam sob a resolução de dia:: - use Cake\Chronos\Date; + use Cake\Chronos\ChronosDate; - $today = Date::today(); + $today = ChronosDate::today(); // Mudanças na hora/timezone são ignoradas $today->modify('+1 hours'); @@ -268,7 +268,7 @@ de testes, você pode incluir o seguinte:: Chronos::setTestNow(Chronos::now()); MutableDateTime::setTestNow(MutableDateTime::now()); - Date::setTestNow(Date::now()); + ChronosDate::setTestNow(ChronosDate::now()); MutableDate::setTestNow(MutableDate::now()); Isso irá corrigir a hora atual de todos os objetos para o momento em que o diff --git a/app/vendor/cakephp/chronos/src/Chronos.php b/app/vendor/cakephp/chronos/src/Chronos.php index f8ddf7384..3bb970f26 100644 --- a/app/vendor/cakephp/chronos/src/Chronos.php +++ b/app/vendor/cakephp/chronos/src/Chronos.php @@ -2,18 +2,19 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos; +use DateInterval; use DateTimeImmutable; use DateTimeZone; @@ -139,6 +140,8 @@ public function __construct($time = 'now', $tz = null) */ public function toMutable(): MutableDateTime { + trigger_error('2.5 Mutable classes will be removed in 3.0', E_USER_DEPRECATED); + return MutableDateTime::instance($this); } @@ -197,6 +200,70 @@ public static function hasTestNow(): bool return static::$testNow !== null; } + /** + * Create a new DateInterval instance from specified values. + * + * @param int|null $years The year to use. + * @param int|null $months The month to use. + * @param int|null $weeks The week to use. + * @param int|null $days The day to use. + * @param int|null $hours The hours to use. + * @param int|null $minutes The minutes to use. + * @param int|null $seconds The seconds to use. + * @param int|null $microseconds The microseconds to use. + * @return \DateInterval + */ + public static function createInterval( + ?int $years = null, + ?int $months = null, + ?int $weeks = null, + ?int $days = null, + ?int $hours = null, + ?int $minutes = null, + ?int $seconds = null, + ?int $microseconds = null + ): DateInterval { + $spec = 'P'; + + if ($years) { + $spec .= $years . 'Y'; + } + if ($months) { + $spec .= $months . 'M'; + } + if ($weeks) { + $spec .= $weeks . 'W'; + } + if ($days) { + $spec .= $days . 'D'; + } + + if ($hours || $minutes || $seconds) { + $spec .= 'T'; + if ($hours) { + $spec .= $hours . 'H'; + } + if ($minutes) { + $spec .= $minutes . 'M'; + } + if ($seconds) { + $spec .= $seconds . 'S'; + } + } + + if ($microseconds && $spec === 'P') { + $spec .= 'T0S'; + } + + $instance = new DateInterval($spec); + + if ($microseconds) { + $instance->f = $microseconds / 1000000; + } + + return $instance; + } + /** * Return properties for debugging. * @@ -212,4 +279,27 @@ public function __debugInfo(): array return $properties; } + + /** + * Deprecation helper to compare types + * + * Future versions of Chronos will not support comparing date/datetimes to each other. + * + * @param object $first The first object. + * @param object|null $second The second object + * @return void + * @internal + */ + public static function checkTypes(object $first, $second): void + { + $firstClass = get_class($first); + $secondClass = $second !== null ? get_class($second) : null; + if ($second !== null && $firstClass !== $secondClass) { + trigger_error( + "2.5 Comparing {$firstClass} and {$secondClass} is deprecated. " . + 'In 3.0 this functionality will be removed.', + E_USER_DEPRECATED + ); + } + } } diff --git a/app/vendor/cakephp/chronos/src/ChronosDate.php b/app/vendor/cakephp/chronos/src/ChronosDate.php new file mode 100644 index 000000000..f22474dc0 --- /dev/null +++ b/app/vendor/cakephp/chronos/src/ChronosDate.php @@ -0,0 +1,288 @@ +stripTime($time, $tz); + parent::__construct($time); + + return; + } + + $testNow = clone $testNow; + if ($tz !== null && $tz !== $testNow->getTimezone()) { + $testNow = $testNow->setTimezone($tz ?? date_default_timezone_get()); + } + if (!empty($time)) { + $testNow = $testNow->modify($time); + } + + $time = $testNow->format('Y-m-d 00:00:00'); + parent::__construct($time); + } + + /** + * Create a new mutable instance from current immutable instance. + * + * @return \Cake\Chronos\MutableDate + */ + public function toMutable(): MutableDate + { + trigger_error('2.5 Mutable classes will be removed in 3.0', E_USER_DEPRECATED); + + return MutableDate::instance($this); + } + + /** + * Return properties for debugging. + * + * @return array + */ + public function __debugInfo(): array + { + $properties = [ + 'hasFixedNow' => static::hasTestNow(), + 'date' => $this->format('Y-m-d'), + ]; + + return $properties; + } + + /** + * Create an instance from a specific date. + * + * @param int $year The year to create an instance with. + * @param int $month The month to create an instance with. + * @param int $day The day to create an instance with. + * @return static + */ + public static function create(int $year, int $month, int $day) + { + $instance = static::createFromFormat( + 'Y-m-d', + sprintf('%s-%s-%s', 0, $month, $day) + ); + + return $instance->addYears($year); + } + + /** + * Add an Interval to a Date + * + * Any changes to the time will cause an exception to be raised. + * + * @param \DateInterval $interval The interval to modify this date by. + * @return static A modified Date instance + */ + #[\ReturnTypeWillChange] + public function add($interval) + { + if ($interval->f > 0 || $interval->s > 0 || $interval->i > 0 || $interval->h > 0) { + trigger_error('2.5 Adding intervals with time components will be removed in 3.0', E_USER_DEPRECATED); + } + + return parent::add($interval)->setTime(0, 0, 0); + } + + /** + * Subtract an Interval from a Date. + * + * Any changes to the time will cause an exception to be raised. + * + * @param \DateInterval $interval The interval to modify this date by. + * @return static A modified Date instance + */ + #[\ReturnTypeWillChange] + public function sub($interval) + { + if ($interval->f > 0 || $interval->s > 0 || $interval->i > 0 || $interval->h > 0) { + trigger_error('2.5 Subtracting intervals with time components will be removed in 3.0', E_USER_DEPRECATED); + } + + return parent::sub($interval)->setTime(0, 0, 0); + } + + /** + * Creates a new instance with date modified according to DateTimeImmutable::modifier(). + * + * Attempting to change a time component will raise an exception + * + * @param string $modifier Date modifier + * @return static + */ + #[\ReturnTypeWillChange] + public function modify($modifier) + { + if (preg_match('/hour|minute|second/', $modifier)) { + trigger_error('2.5 Modifying dates with time values will be removed in 3.0', E_USER_DEPRECATED); + } + + $new = parent::modify($modifier); + if ($new === false) { + throw new InvalidArgumentException('Unable to modify date using: ' . $modifier); + } + + if ($new->format('H:i:s') !== '00:00:00') { + $new = $new->setTime(0, 0, 0); + } + + return $new; + } + + /** + * @inheritDoc + */ + #[\ReturnTypeWillChange] + public function setTimestamp($value) + { + trigger_error('2.5 Setting timestamp values on Date values will be removed in 3.0', E_USER_DEPRECATED); + + return parent::setTimestamp($value); + } + + /** + * @inheritDoc + */ + public function hour(int $value): ChronosInterface + { + trigger_error('2.5 Modifying hours on Date values will be removed in 3.0', E_USER_DEPRECATED); + + return $this->setTime($value, $this->minute, $this->second); + } + + /** + * Set the instance's minute + * + * @param int $value The minute value. + * @return static + */ + public function minute(int $value): ChronosInterface + { + trigger_error('2.5 Modifying minutes on Date values will be removed in 3.0', E_USER_DEPRECATED); + + return $this->setTime($this->hour, $value, $this->second); + } + + /** + * Set the instance's second + * + * @param int $value The seconds value. + * @return static + */ + public function second(int $value): ChronosInterface + { + trigger_error('2.5 Modifying second on Date values will be removed in 3.0', E_USER_DEPRECATED); + + return $this->setTime($this->hour, $this->minute, $value); + } + + /** + * Set the instance's microsecond + * + * @param int $value The microsecond value. + * @return static + */ + public function microsecond(int $value): ChronosInterface + { + trigger_error('2.5 Modifying microsecond on Date values will be removed in 3.0', E_USER_DEPRECATED); + + return $this->setTime($this->hour, $this->minute, $this->second, $value); + } +} + +class_alias('Cake\Chronos\ChronosDate', 'Cake\Chronos\Date'); diff --git a/app/vendor/cakephp/chronos/src/ChronosInterface.php b/app/vendor/cakephp/chronos/src/ChronosInterface.php index f074b4c15..8e8b5d139 100644 --- a/app/vendor/cakephp/chronos/src/ChronosInterface.php +++ b/app/vendor/cakephp/chronos/src/ChronosInterface.php @@ -2,15 +2,15 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos; diff --git a/app/vendor/cakephp/chronos/src/ChronosInterval.php b/app/vendor/cakephp/chronos/src/ChronosInterval.php index 4f4464326..6330fab27 100644 --- a/app/vendor/cakephp/chronos/src/ChronosInterval.php +++ b/app/vendor/cakephp/chronos/src/ChronosInterval.php @@ -2,15 +2,15 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos; @@ -146,6 +146,10 @@ public function __construct( if ($microseconds > 0) { $this->f = $microseconds / 1000000; } + trigger_error( + 'Since 2.4 ChronosInterval is deprecated. Use `Chronos::createInterval() instead.`', + E_USER_DEPRECATED + ); } /** diff --git a/app/vendor/cakephp/chronos/src/Date.php b/app/vendor/cakephp/chronos/src/Date.php index 67b44a24e..68d436ca2 100644 --- a/app/vendor/cakephp/chronos/src/Date.php +++ b/app/vendor/cakephp/chronos/src/Date.php @@ -2,141 +2,14 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Chronos; - -use DateTimeImmutable; -use DateTimeZone; - -/** - * An immutable date object that converts all time components into 00:00:00. - * - * This class is useful when you want to represent a calendar date and ignore times. - * This means that timezone changes take no effect as a calendar date exists in all timezones - * in each respective date. - * - * @property-read int $year - * @property-read int $yearIso - * @property-read int $month - * @property-read int $day - * @property-read int $hour - * @property-read int $minute - * @property-read int $second - * @property-read int $micro - * @property-read int $microsecond - * @property-read int $timestamp seconds since the Unix Epoch - * @property-read \DateTimeZone $timezone the current timezone - * @property-read \DateTimeZone $tz alias of timezone - * @property-read int $dayOfWeek 1 (for Monday) through 7 (for Sunday) - * @property-read int $dayOfYear 0 through 365 - * @property-read int $weekOfMonth 1 through 5 - * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday - * @property-read int $daysInMonth number of days in the given month - * @property-read int $age does a diffInYears() with default parameters - * @property-read int $quarter the quarter of this instance, 1 - 4 - * @property-read int $offset the timezone offset in seconds from UTC - * @property-read int $offsetHours the timezone offset in hours from UTC - * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise - * @property-read bool $local checks if the timezone is local, true if local, false otherwise - * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise - * @property-read string $timezoneName - * @property-read string $tzName - */ -class Date extends DateTimeImmutable implements ChronosInterface -{ - use Traits\ComparisonTrait; - use Traits\DifferenceTrait; - use Traits\FactoryTrait; - use Traits\FormattingTrait; - use Traits\FrozenTimeTrait; - use Traits\MagicPropertyTrait; - use Traits\ModifierTrait; - use Traits\TestingAidTrait; - - /** - * Format to use for __toString method when type juggling occurs. - * - * @var string - */ - protected static $toStringFormat = 'Y-m-d'; - - /** - * Create a new Immutable Date instance. - * - * You can specify the timezone for the $time parameter. This timezone will - * not be used in any future modifications to the Date instance. - * - * The $timezone parameter is ignored if $time is a DateTimeInterface - * instance. - * - * Please see the testing aids section (specifically static::setTestNow()) - * for more on the possibility of this constructor returning a test instance. - * - * Date instances lack time components, however due to limitations in PHP's - * internal Datetime object the time will always be set to 00:00:00, and the - * timezone will always be the server local time. Normalizing the timezone allows for - * subtraction/addition to have deterministic results. - * - * @param \DateTimeInterface|string|int|null $time Fixed or relative time - * @param \DateTimeZone|string|null $tz The timezone in which the date is taken - */ - public function __construct($time = 'now', $tz = null) - { - if ($tz !== null) { - $tz = $tz instanceof DateTimeZone ? $tz : new DateTimeZone($tz); - } - - $testNow = Chronos::getTestNow(); - if ($testNow === null || !static::isRelativeOnly($time)) { - $time = $this->stripTime($time, $tz); - parent::__construct($time); - - return; - } - - $testNow = clone $testNow; - if ($tz !== $testNow->getTimezone()) { - $testNow = $testNow->setTimezone($tz ?? date_default_timezone_get()); - } - if (!empty($time)) { - $testNow = $testNow->modify($time); - } - - $time = $testNow->format('Y-m-d 00:00:00'); - parent::__construct($time); - } - - /** - * Create a new mutable instance from current immutable instance. - * - * @return \Cake\Chronos\MutableDate - */ - public function toMutable(): MutableDate - { - return MutableDate::instance($this); - } - - /** - * Return properties for debugging. - * - * @return array - */ - public function __debugInfo(): array - { - $properties = [ - 'hasFixedNow' => static::hasTestNow(), - 'date' => $this->format('Y-m-d'), - ]; - - return $properties; - } -} +class_exists('Cake\Chronos\ChronosDate'); diff --git a/app/vendor/cakephp/chronos/src/DifferenceFormatter.php b/app/vendor/cakephp/chronos/src/DifferenceFormatter.php index ad10c9582..c627dd9c5 100644 --- a/app/vendor/cakephp/chronos/src/DifferenceFormatter.php +++ b/app/vendor/cakephp/chronos/src/DifferenceFormatter.php @@ -2,15 +2,15 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos; diff --git a/app/vendor/cakephp/chronos/src/DifferenceFormatterInterface.php b/app/vendor/cakephp/chronos/src/DifferenceFormatterInterface.php index e94892604..875a2298e 100644 --- a/app/vendor/cakephp/chronos/src/DifferenceFormatterInterface.php +++ b/app/vendor/cakephp/chronos/src/DifferenceFormatterInterface.php @@ -2,14 +2,14 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos; diff --git a/app/vendor/cakephp/chronos/src/MutableDate.php b/app/vendor/cakephp/chronos/src/MutableDate.php index 7cbac3cb9..c8c5f2793 100644 --- a/app/vendor/cakephp/chronos/src/MutableDate.php +++ b/app/vendor/cakephp/chronos/src/MutableDate.php @@ -2,14 +2,14 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos; @@ -49,6 +49,7 @@ * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise * @property-read string $timezoneName * @property-read string $tzName + * @deprecated 2.4.0 Use immutable \Cake\Chronos\ChronosDate instead */ class MutableDate extends DateTime implements ChronosInterface { @@ -117,11 +118,11 @@ public function __construct($time = 'now', $tz = null) /** * Create a new immutable instance from current mutable instance. * - * @return \Cake\Chronos\Date + * @return \Cake\Chronos\ChronosDate */ - public function toImmutable(): Date + public function toImmutable(): ChronosDate { - return Date::instance($this); + return ChronosDate::instance($this); } /** diff --git a/app/vendor/cakephp/chronos/src/MutableDateTime.php b/app/vendor/cakephp/chronos/src/MutableDateTime.php index a01865734..5ad91e932 100644 --- a/app/vendor/cakephp/chronos/src/MutableDateTime.php +++ b/app/vendor/cakephp/chronos/src/MutableDateTime.php @@ -2,15 +2,15 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos; @@ -50,6 +50,7 @@ * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise * @property-read string $timezoneName * @property-read string $tzName + * @deprecated 2.4.0 Use immutable \Cake\Chronos\Chronos instead */ class MutableDateTime extends DateTime implements ChronosInterface { diff --git a/app/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php b/app/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php index 5f076d540..677663a7c 100644 --- a/app/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php @@ -2,18 +2,20 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; +use Cake\Chronos\Chronos; +use Cake\Chronos\ChronosDate; use Cake\Chronos\ChronosInterface; use DateTime; @@ -38,6 +40,10 @@ trait ComparisonTrait */ public static function getWeekendDays(): array { + if (static::class === ChronosDate::class) { + trigger_error('2.5 getWeekendDays() will be removed in 3.x.', E_USER_DEPRECATED); + } + return static::$weekendDays; } @@ -49,6 +55,10 @@ public static function getWeekendDays(): array */ public static function setWeekendDays(array $days): void { + if (static::class === ChronosDate::class) { + trigger_error('2.5 setWeekendDays() will be removed in 3.x.', E_USER_DEPRECATED); + } + static::$weekendDays = $days; } @@ -57,10 +67,13 @@ public static function setWeekendDays(array $days): void * * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. * @return bool + * @deprecated 2.5 eq() is deprecated. Use equals() instead. */ public function eq(ChronosInterface $dt): bool { - return $this == $dt; + trigger_error('2.5 eq() is deprecated. Use equals() instead.', E_USER_DEPRECATED); + + return $this->equals($dt); } /** @@ -71,7 +84,7 @@ public function eq(ChronosInterface $dt): bool */ public function equals(ChronosInterface $dt) { - return $this->eq($dt); + return $this == $dt; } /** @@ -79,10 +92,13 @@ public function equals(ChronosInterface $dt) * * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. * @return bool + * @deprecated 2.5 ne() is deprecated. Use notEquals() instead. */ public function ne(ChronosInterface $dt): bool { - return !$this->eq($dt); + trigger_error('2.5 ne() is deprecated. Use notEquals() instead.', E_USER_DEPRECATED); + + return $this->notEquals($dt); } /** @@ -93,7 +109,7 @@ public function ne(ChronosInterface $dt): bool */ public function notEquals(ChronosInterface $dt) { - return $this->ne($dt); + return !$this->equals($dt); } /** @@ -101,10 +117,13 @@ public function notEquals(ChronosInterface $dt) * * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. * @return bool + * @deprecated 2.5 gt() is deprecated. Use greaterThan() instead. */ public function gt(ChronosInterface $dt): bool { - return $this > $dt; + trigger_error('2.5 gt() is deprecated. Use greaterThan() instead.', E_USER_DEPRECATED); + + return $this->greaterThan($dt); } /** @@ -115,7 +134,7 @@ public function gt(ChronosInterface $dt): bool */ public function greaterThan(ChronosInterface $dt) { - return $this->gt($dt); + return $this > $dt; } /** @@ -123,10 +142,13 @@ public function greaterThan(ChronosInterface $dt) * * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. * @return bool + * @deprecated 2.5 gte() is deprecated. Use greaterThanOrEquals() instead. */ public function gte(ChronosInterface $dt): bool { - return $this >= $dt; + trigger_error('2.5 gte() is deprecated. Use greaterThanOrEquals() instead.', E_USER_DEPRECATED); + + return $this->greaterThanOrEquals($dt); } /** @@ -137,7 +159,7 @@ public function gte(ChronosInterface $dt): bool */ public function greaterThanOrEquals(ChronosInterface $dt) { - return $this->gte($dt); + return $this >= $dt; } /** @@ -145,10 +167,13 @@ public function greaterThanOrEquals(ChronosInterface $dt) * * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. * @return bool + * @deprecated 2.5 lt() is deprecated. Use lessThan instead. */ public function lt(ChronosInterface $dt): bool { - return $this < $dt; + trigger_error('2.5 lt() is deprecated. Use lessThan() instead.', E_USER_DEPRECATED); + + return $this->lessThan($dt); } /** @@ -159,7 +184,7 @@ public function lt(ChronosInterface $dt): bool */ public function lessThan(ChronosInterface $dt) { - return $this->lt($dt); + return $this < $dt; } /** @@ -167,10 +192,13 @@ public function lessThan(ChronosInterface $dt) * * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with. * @return bool + * @deprecated 2.5 lte() is deprecated. Use lessThanOrEquals() instead. */ public function lte(ChronosInterface $dt): bool { - return $this <= $dt; + trigger_error('2.5 lte() is deprecated. Use lessthanOrEquals() instead.', E_USER_DEPRECATED); + + return $this->lessThanOrEquals($dt); } /** @@ -181,7 +209,7 @@ public function lte(ChronosInterface $dt): bool */ public function lessThanOrEquals(ChronosInterface $dt) { - return $this->lte($dt); + return $this <= $dt; } /** @@ -194,17 +222,18 @@ public function lessThanOrEquals(ChronosInterface $dt) */ public function between(ChronosInterface $dt1, ChronosInterface $dt2, bool $equal = true): bool { - if ($dt1->gt($dt2)) { + if ($dt1->greaterThan($dt2)) { $temp = $dt1; $dt1 = $dt2; $dt2 = $temp; } + Chronos::checkTypes($dt1, $dt2); if ($equal) { - return $this->gte($dt1) && $this->lte($dt2); + return $this->greaterThanOrEquals($dt1) && $this->lessThanOrEquals($dt2); } - return $this->gt($dt1) && $this->lt($dt2); + return $this->greaterThan($dt1) && $this->lessThan($dt2); } /** @@ -241,7 +270,7 @@ public function min(?ChronosInterface $dt = null): ChronosInterface { $dt = $dt ?? static::now($this->tz); - return $this->lt($dt) ? $this : $dt; + return $this->lessThan($dt) ? $this : $dt; } /** @@ -254,7 +283,7 @@ public function max(?ChronosInterface $dt = null): ChronosInterface { $dt = $dt ?? static::now($this->tz); - return $this->gt($dt) ? $this : $dt; + return $this->greaterThan($dt) ? $this : $dt; } /** @@ -314,7 +343,7 @@ public function isTomorrow(): bool */ public function isNextWeek(): bool { - return $this->format('W o') === static::now($this->tz)->addWeek()->format('W o'); + return $this->format('W o') === static::now($this->tz)->addWeeks(1)->format('W o'); } /** @@ -324,7 +353,7 @@ public function isNextWeek(): bool */ public function isLastWeek(): bool { - return $this->format('W o') === static::now($this->tz)->subWeek()->format('W o'); + return $this->format('W o') === static::now($this->tz)->subWeeks(1)->format('W o'); } /** @@ -334,7 +363,7 @@ public function isLastWeek(): bool */ public function isNextMonth(): bool { - return $this->format('m Y') === static::now($this->tz)->addMonth()->format('m Y'); + return $this->format('m Y') === static::now($this->tz)->addMonths(1)->format('m Y'); } /** @@ -344,7 +373,7 @@ public function isNextMonth(): bool */ public function isLastMonth(): bool { - return $this->format('m Y') === static::now($this->tz)->subMonth()->format('m Y'); + return $this->format('m Y') === static::now($this->tz)->subMonths(1)->format('m Y'); } /** @@ -354,7 +383,7 @@ public function isLastMonth(): bool */ public function isNextYear(): bool { - return $this->year === static::now($this->tz)->addYear()->year; + return $this->year === static::now($this->tz)->addYears(1)->year; } /** @@ -364,7 +393,7 @@ public function isNextYear(): bool */ public function isLastYear(): bool { - return $this->year === static::now($this->tz)->subYear()->year; + return $this->year === static::now($this->tz)->subYears(1)->year; } /** @@ -374,7 +403,7 @@ public function isLastYear(): bool */ public function isFuture(): bool { - return $this->gt(static::now($this->tz)); + return $this->greaterThan(static::now($this->tz)); } /** @@ -384,7 +413,7 @@ public function isFuture(): bool */ public function isPast(): bool { - return $this->lt(static::now($this->tz)); + return $this->lessThan(static::now($this->tz)); } /** @@ -560,6 +589,8 @@ public function isWithinNext($timeInterval): bool */ public function isMutable(): bool { + trigger_error('2.5 isMutable will be removed in the future', E_USER_DEPRECATED); + return $this instanceof DateTime; } } diff --git a/app/vendor/cakephp/chronos/src/Traits/CopyTrait.php b/app/vendor/cakephp/chronos/src/Traits/CopyTrait.php index 1bd8ede42..d026ed838 100644 --- a/app/vendor/cakephp/chronos/src/Traits/CopyTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/CopyTrait.php @@ -2,15 +2,15 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; diff --git a/app/vendor/cakephp/chronos/src/Traits/DifferenceTrait.php b/app/vendor/cakephp/chronos/src/Traits/DifferenceTrait.php index 7d4c74e58..0fbf37cea 100644 --- a/app/vendor/cakephp/chronos/src/Traits/DifferenceTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/DifferenceTrait.php @@ -2,20 +2,21 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; +use Cake\Chronos\Chronos; +use Cake\Chronos\ChronosDate; use Cake\Chronos\ChronosInterface; -use Cake\Chronos\ChronosInterval; use Cake\Chronos\DifferenceFormatter; use Cake\Chronos\DifferenceFormatterInterface; use DatePeriod; @@ -49,6 +50,7 @@ trait DifferenceTrait */ public function diffInYears(?ChronosInterface $dt = null, bool $abs = true): int { + Chronos::checkTypes($this, $dt); $diff = $this->diff($dt ?? static::now($this->tz), $abs); return $diff->invert ? -$diff->y : $diff->y; @@ -63,6 +65,7 @@ public function diffInYears(?ChronosInterface $dt = null, bool $abs = true): int */ public function diffInMonths(?ChronosInterface $dt = null, bool $abs = true): int { + Chronos::checkTypes($this, $dt); $diff = $this->diff($dt ?? static::now($this->tz), $abs); $months = $diff->y * ChronosInterface::MONTHS_PER_YEAR + $diff->m; @@ -83,6 +86,9 @@ public function diffInMonths(?ChronosInterface $dt = null, bool $abs = true): in */ public function diffInMonthsIgnoreTimezone(?ChronosInterface $dt = null, bool $abs = true): int { + if (static::class === ChronosDate::class) { + trigger_error('2.5 diffInMonthsIgnoreTimezone() will be removed in 3.x.', E_USER_DEPRECATED); + } $utcTz = new DateTimeZone('UTC'); $source = new static($this->format('Y-m-d H:i:s.u'), $utcTz); @@ -128,7 +134,9 @@ public function diffInDays(?ChronosInterface $dt = null, bool $abs = true): int */ public function diffInDaysFiltered(callable $callback, ?ChronosInterface $dt = null, bool $abs = true): int { - return $this->diffFiltered(ChronosInterval::day(), $callback, $dt, $abs); + $interval = Chronos::createInterval(0, 0, 0, 1); + + return $this->diffFiltered($interval, $callback, $dt, $abs); } /** @@ -141,20 +149,25 @@ public function diffInDaysFiltered(callable $callback, ?ChronosInterface $dt = n */ public function diffInHoursFiltered(callable $callback, ?ChronosInterface $dt = null, bool $abs = true): int { - return $this->diffFiltered(ChronosInterval::hour(), $callback, $dt, $abs); + if (static::class === ChronosDate::class) { + trigger_error('2.5 diffInHoursFiltered() will be removed in 3.x.', E_USER_DEPRECATED); + } + $interval = Chronos::createInterval(0, 0, 0, 0, 1); + + return $this->diffFiltered($interval, $callback, $dt, $abs); } /** * Get the difference by the given interval using a filter callable * - * @param \Cake\Chronos\ChronosInterval $ci An interval to traverse by + * @param \Cake\Chronos\ChronosInterval|\DateInterval $ci An interval to traverse by * @param callable $callback The callback to use for filtering. * @param \Cake\Chronos\ChronosInterface|null $dt The instance to difference from. * @param bool $abs Get the absolute of the difference * @return int */ public function diffFiltered( - ChronosInterval $ci, + $ci, callable $callback, ?ChronosInterface $dt = null, bool $abs = true @@ -162,12 +175,19 @@ public function diffFiltered( $start = $this; $end = $dt ?? static::now($this->tz); $inverse = false; + Chronos::checkTypes($start, $end); if ($end < $start) { $start = $end; $end = $this; $inverse = true; } + // Hack around DatePeriod not including end values. + // When handling dates we need to convert to a DateTime + // and offset by 1 second. + if ($end instanceof ChronosDate) { + $end = (new Chronos($end))->modify('+1 second'); + } $period = new DatePeriod($start, $ci, $end); $vals = array_filter(iterator_to_array($period), function (DateTimeInterface $date) use ($callback) { @@ -216,6 +236,10 @@ public function diffInWeekendDays(?ChronosInterface $dt = null, bool $abs = true */ public function diffInHours(?ChronosInterface $dt = null, bool $abs = true): int { + if (static::class === ChronosDate::class) { + trigger_error('2.5 diffInHours() will be removed in 3.x.', E_USER_DEPRECATED); + } + return (int)( $this->diffInSeconds($dt, $abs) / ChronosInterface::SECONDS_PER_MINUTE @@ -232,6 +256,10 @@ public function diffInHours(?ChronosInterface $dt = null, bool $abs = true): int */ public function diffInMinutes(?ChronosInterface $dt = null, bool $abs = true): int { + if (static::class === ChronosDate::class) { + trigger_error('2.5 diffInMinutes() will be removed in 3.x.', E_USER_DEPRECATED); + } + return (int)($this->diffInSeconds($dt, $abs) / ChronosInterface::SECONDS_PER_MINUTE); } @@ -244,6 +272,10 @@ public function diffInMinutes(?ChronosInterface $dt = null, bool $abs = true): i */ public function diffInSeconds(?ChronosInterface $dt = null, bool $abs = true): int { + if (static::class === ChronosDate::class) { + trigger_error('2.5 diffInSeconds() will be removed in 3.x.', E_USER_DEPRECATED); + } + $dt = $dt ?? static::now($this->tz); $value = $dt->getTimestamp() - $this->getTimestamp(); @@ -257,6 +289,10 @@ public function diffInSeconds(?ChronosInterface $dt = null, bool $abs = true): i */ public function secondsSinceMidnight(): int { + if (static::class === ChronosDate::class) { + trigger_error('2.5 secondsSinceMidnight() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->diffInSeconds($this->copy()->startOfDay()); } @@ -267,6 +303,10 @@ public function secondsSinceMidnight(): int */ public function secondsUntilEndOfDay(): int { + if (static::class === ChronosDate::class) { + trigger_error('2.5 secondsUntilEndOfDay() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->diffInSeconds($this->copy()->endOfDay()); } @@ -278,6 +318,9 @@ public function secondsUntilEndOfDay(): int */ public static function fromNow($datetime) { + if (static::class === ChronosDate::class) { + trigger_error('2.5 fromNow() will be removed in 3.x.', E_USER_DEPRECATED); + } $timeNow = new static(); return $timeNow->diff($datetime); diff --git a/app/vendor/cakephp/chronos/src/Traits/FactoryTrait.php b/app/vendor/cakephp/chronos/src/Traits/FactoryTrait.php index 963624345..e37295d53 100644 --- a/app/vendor/cakephp/chronos/src/Traits/FactoryTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/FactoryTrait.php @@ -2,18 +2,19 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; +use Cake\Chronos\ChronosDate; use Cake\Chronos\ChronosInterface; use DateTimeInterface; use DateTimeZone; @@ -40,6 +41,9 @@ trait FactoryTrait */ public static function instance(DateTimeInterface $dt): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 instance() will be removed in 3.x.', E_USER_DEPRECATED); + } if ($dt instanceof static) { return clone $dt; } @@ -113,7 +117,12 @@ public static function yesterday($tz = null): ChronosInterface */ public static function maxValue(): ChronosInterface { - return static::createFromTimestampUTC(PHP_INT_MAX); + $instance = new static(PHP_INT_MAX); + if (get_class($instance) === ChronosDate::class) { + trigger_error('2.5 Using minValue() to create Date objects will be removed in 3.0', E_USER_DEPRECATED); + } + + return $instance; } /** @@ -125,7 +134,12 @@ public static function minValue(): ChronosInterface { $max = PHP_INT_SIZE === 4 ? PHP_INT_MAX : PHP_INT_MAX / 10; - return static::createFromTimestampUTC(~$max); + $instance = new static(~$max); + if (get_class($instance) === ChronosDate::class) { + trigger_error('2.5 Using minValue() to create Date objects will be removed in 3.0', E_USER_DEPRECATED); + } + + return $instance; } /** @@ -199,6 +213,10 @@ public static function createFromDate( ?int $day = null, $tz = null ): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 createFromDate() will be removed in 3.x.', E_USER_DEPRECATED); + } + return static::create($year, $month, $day, null, null, null, null, $tz); } @@ -219,7 +237,12 @@ public static function createFromTime( ?int $microsecond = null, $tz = null ): ChronosInterface { - return static::create(null, null, null, $hour, $minute, $second, $microsecond, $tz); + $instance = static::create(null, null, null, $hour, $minute, $second, $microsecond, $tz); + if (get_class($instance) === ChronosDate::class) { + trigger_error('2.5 Using createFromTime to create Date objects will be removed in 3.0', E_USER_DEPRECATED); + } + + return $instance; } /** @@ -315,7 +338,15 @@ public static function createFromArray(array $values): ChronosInterface */ public static function createFromTimestamp(int $timestamp, $tz = null): ChronosInterface { - return static::now($tz)->setTimestamp($timestamp); + $instance = static::now($tz)->setTimestamp($timestamp); + if (get_class($instance) === ChronosDate::class) { + trigger_error( + '2.5 Creating Date instances with createFromTimestamp() will be removed in 3.0', + E_USER_DEPRECATED + ); + } + + return $instance; } /** @@ -326,7 +357,13 @@ public static function createFromTimestamp(int $timestamp, $tz = null): ChronosI */ public static function createFromTimestampUTC(int $timestamp): ChronosInterface { - return new static($timestamp); + trigger_error( + '2.5 createFromTimestampUTC() is deprecated. Use createFromTimestamp() instead.', + E_USER_DEPRECATED + ); + $instance = new static($timestamp); + + return $instance; } /** @@ -358,9 +395,16 @@ protected static function safeCreateDateTimeZone($object): DateTimeZone public static function getLastErrors(): array { if (empty(static::$_lastErrors)) { - return parent::getLastErrors(); + return parent::getLastErrors() ?: [ + 'warning_count' => 0, + 'warnings' => [], + 'error_count' => 0, + 'errors' => [], + ]; } + trigger_error('2.5 getLastErrors() is deprecated. Exceptions will be raised in 3.x', E_USER_DEPRECATED); + return static::$_lastErrors; } } diff --git a/app/vendor/cakephp/chronos/src/Traits/FormattingTrait.php b/app/vendor/cakephp/chronos/src/Traits/FormattingTrait.php index 61e3ba393..312eaf083 100644 --- a/app/vendor/cakephp/chronos/src/Traits/FormattingTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/FormattingTrait.php @@ -2,15 +2,15 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; diff --git a/app/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php b/app/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php index fd0a001d5..198ab7b0e 100644 --- a/app/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php @@ -2,17 +2,18 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; +use Cake\Chronos\ChronosDate; use Cake\Chronos\ChronosInterface; use DateTimeImmutable; use DateTimeInterface; @@ -120,6 +121,10 @@ public function sub($interval): ChronosInterface */ public function timezone($value) { + if (static::class === ChronosDate::class) { + trigger_error('2.5 timezone() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this; } @@ -133,6 +138,10 @@ public function timezone($value) */ public function tz($value) { + if (static::class === ChronosDate::class) { + trigger_error('2.5 tz() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this; } @@ -147,6 +156,24 @@ public function tz($value) #[ReturnTypeWillChange] public function setTimezone($value) { + if (static::class === ChronosDate::class) { + $trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 5); + $found = false; + foreach ($trace as $frame) { + $found = in_array( + $frame['class'], + ['PHPUnit\Framework\Assert', 'PHPUnit\Framework\Constraint\IsEqual'], + true + ); + if ($found) { + break; + } + } + if (!$found) { + trigger_error('2.5 setTimezone() will be removed in 3.x.', E_USER_DEPRECATED); + } + } + return $this; } @@ -162,6 +189,10 @@ public function setTimezone($value) #[ReturnTypeWillChange] public function setTimestamp($value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 setTimestamp() will be removed in 3.x.', E_USER_DEPRECATED); + } + return parent::setTimestamp($value)->setTime(0, 0, 0); } diff --git a/app/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php b/app/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php index 7c01449a2..981e5f68a 100644 --- a/app/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php @@ -2,16 +2,16 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. Provides various operator methods for datetime * objects. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; diff --git a/app/vendor/cakephp/chronos/src/Traits/ModifierTrait.php b/app/vendor/cakephp/chronos/src/Traits/ModifierTrait.php index adf177d7e..c2624d3dd 100644 --- a/app/vendor/cakephp/chronos/src/Traits/ModifierTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/ModifierTrait.php @@ -2,18 +2,19 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; +use Cake\Chronos\ChronosDate; use Cake\Chronos\ChronosInterface; use ReturnTypeWillChange; @@ -65,6 +66,10 @@ trait ModifierTrait */ public static function getWeekStartsAt(): int { + if (static::class === ChronosDate::class) { + trigger_error('2.5 getWeekStartsAt() will be removed in 3.x.', E_USER_DEPRECATED); + } + return static::$weekStartsAt; } @@ -76,6 +81,10 @@ public static function getWeekStartsAt(): int */ public static function setWeekStartsAt(int $day): void { + if (static::class === ChronosDate::class) { + trigger_error('2.5 getWeekStartsAt() will be removed in 3.x.', E_USER_DEPRECATED); + } + static::$weekStartsAt = $day; } @@ -86,6 +95,10 @@ public static function setWeekStartsAt(int $day): void */ public static function getWeekEndsAt(): int { + if (static::class === ChronosDate::class) { + trigger_error('2.5 getWeekEndsAt() will be removed in 3.x.', E_USER_DEPRECATED); + } + return static::$weekEndsAt; } @@ -97,6 +110,10 @@ public static function getWeekEndsAt(): int */ public static function setWeekEndsAt(int $day): void { + if (static::class === ChronosDate::class) { + trigger_error('2.5 setWeekEndsAt() will be removed in 3.x.', E_USER_DEPRECATED); + } + static::$weekEndsAt = $day; } @@ -149,6 +166,10 @@ public function setDateTime( int $minute, int $second = 0 ): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 setDateTime() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->setDate($year, $month, $day)->setTime($hour, $minute, $second); } @@ -160,6 +181,9 @@ public function setDateTime( */ public function setTimeFromTimeString(string $time): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 setTimeFromTimeString() will be removed in 3.x.', E_USER_DEPRECATED); + } $time = explode(':', $time); $hour = $time[0]; $minute = $time[1] ?? 0; @@ -176,6 +200,10 @@ public function setTimeFromTimeString(string $time): ChronosInterface */ public function timestamp(int $value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 timestamp() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->setTimestamp($value); } @@ -220,6 +248,10 @@ public function day(int $value): ChronosInterface */ public function hour(int $value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 hour() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->setTime($value, $this->minute, $this->second); } @@ -231,6 +263,10 @@ public function hour(int $value): ChronosInterface */ public function minute(int $value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 minute() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->setTime($this->hour, $value, $this->second); } @@ -242,6 +278,10 @@ public function minute(int $value): ChronosInterface */ public function second(int $value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 second() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->setTime($this->hour, $this->minute, $value); } @@ -253,6 +293,10 @@ public function second(int $value): ChronosInterface */ public function microsecond(int $value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 microsecond() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->setTime($this->hour, $this->minute, $this->second, $value); } @@ -296,6 +340,8 @@ public function addYears(int $value): ChronosInterface */ public function addYear(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - addYear() is deprecated. Use addYears() instead.', E_USER_DEPRECATED); + return $this->addYears($value); } @@ -322,6 +368,8 @@ public function subYears(int $value): ChronosInterface */ public function subYear(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - subYear() is deprecated. Use subYears() instead.', E_USER_DEPRECATED); + return $this->addYears(-$value); } @@ -355,6 +403,8 @@ public function addYearsWithOverflow(int $value): ChronosInterface */ public function addYearWithOverflow(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - addYearWithOverflow() is deprecated.', E_USER_DEPRECATED); + return $this->addYearsWithOverflow($value); } @@ -381,6 +431,8 @@ public function subYearsWithOverflow(int $value): ChronosInterface */ public function subYearWithOverflow(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - addYearWithOverflow() is deprecated.', E_USER_DEPRECATED); + return $this->subYearsWithOverflow($value); } @@ -425,6 +477,8 @@ public function addMonths(int $value): ChronosInterface */ public function addMonth(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - addMonth() is deprecated. Use addMonths() instead.', E_USER_DEPRECATED); + return $this->addMonths($value); } @@ -438,6 +492,8 @@ public function addMonth(int $value = 1): ChronosInterface */ public function subMonth(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - subMonth() is deprecated. Use subMonths() instead.', E_USER_DEPRECATED); + return $this->addMonths(-$value); } @@ -484,6 +540,11 @@ public function addMonthsWithOverflow(int $value): ChronosInterface */ public function addMonthWithOverflow(int $value = 1): ChronosInterface { + trigger_error( + 'Since 2.4 - addMonthWithOverflow() is deprecated. Use addMonthsWithOverflow() instead.', + E_USER_DEPRECATED + ); + return $this->modify($value . ' months'); } @@ -510,6 +571,11 @@ public function subMonthsWithOverflow(int $value): ChronosInterface */ public function subMonthWithOverflow(int $value = 1): ChronosInterface { + trigger_error( + 'Since 2.4 - subMonthWithOverflow() is deprecated. Use subMonthsWithOverflow() instead.', + E_USER_DEPRECATED + ); + return $this->subMonthsWithOverflow($value); } @@ -533,6 +599,8 @@ public function addDays(int $value): ChronosInterface */ public function addDay(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - addDay() is deprecated. Use addDays() instead.', E_USER_DEPRECATED); + return $this->modify("$value days"); } @@ -544,6 +612,8 @@ public function addDay(int $value = 1): ChronosInterface */ public function subDay(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - subDay() is deprecated. Use subDays() instead.', E_USER_DEPRECATED); + return $this->addDays(-$value); } @@ -578,6 +648,8 @@ public function addWeekdays(int $value): ChronosInterface */ public function addWeekday(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - addWeekday() is deprecated. Use addWeekdays() instead.', E_USER_DEPRECATED); + return $this->addWeekdays($value); } @@ -600,6 +672,8 @@ public function subWeekdays(int $value): ChronosInterface */ public function subWeekday(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - subWeekday() is deprecated. Use subWeekdays() instead.', E_USER_DEPRECATED); + return $this->addWeekdays(-$value); } @@ -623,6 +697,8 @@ public function addWeeks(int $value): ChronosInterface */ public function addWeek(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - addWeek() is deprecated. Use addWeeks() instead.', E_USER_DEPRECATED); + return $this->modify("$value week"); } @@ -634,6 +710,8 @@ public function addWeek(int $value = 1): ChronosInterface */ public function subWeek(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - subWeek() is deprecated. Use subWeeks() instead.', E_USER_DEPRECATED); + return $this->addWeeks(-$value); } @@ -668,6 +746,8 @@ public function addHours(int $value): ChronosInterface */ public function addHour(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - addHour() is deprecated. Use addHours() instead.', E_USER_DEPRECATED); + return $this->modify("$value hour"); } @@ -679,6 +759,8 @@ public function addHour(int $value = 1): ChronosInterface */ public function subHour(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - subHour() is deprecated. Use subHours() instead.', E_USER_DEPRECATED); + return $this->addHours(-$value); } @@ -690,6 +772,10 @@ public function subHour(int $value = 1): ChronosInterface */ public function subHours(int $value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 subHours() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->addHours(-$value); } @@ -702,6 +788,10 @@ public function subHours(int $value): ChronosInterface */ public function addMinutes(int $value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 addMinutes() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->modify("$value minute"); } @@ -713,6 +803,8 @@ public function addMinutes(int $value): ChronosInterface */ public function addMinute(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - addMinute() is deprecated. Use addMinutes() instead.', E_USER_DEPRECATED); + return $this->modify("$value minute"); } @@ -724,6 +816,8 @@ public function addMinute(int $value = 1): ChronosInterface */ public function subMinute(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - subMinute() is deprecated. Use subMinutes() instead.', E_USER_DEPRECATED); + return $this->addMinutes(-$value); } @@ -735,6 +829,10 @@ public function subMinute(int $value = 1): ChronosInterface */ public function subMinutes(int $value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 subMinutes() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->addMinutes(-$value); } @@ -747,6 +845,10 @@ public function subMinutes(int $value): ChronosInterface */ public function addSeconds(int $value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 setTimestamp() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->modify("$value second"); } @@ -758,6 +860,8 @@ public function addSeconds(int $value): ChronosInterface */ public function addSecond(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - addSecond() is deprecated. Use addSeconds() instead.', E_USER_DEPRECATED); + return $this->modify("$value second"); } @@ -769,6 +873,8 @@ public function addSecond(int $value = 1): ChronosInterface */ public function subSecond(int $value = 1): ChronosInterface { + trigger_error('Since 2.4 - subSecond() is deprecated. Use subSeconds() instead.', E_USER_DEPRECATED); + return $this->addSeconds(-$value); } @@ -780,6 +886,10 @@ public function subSecond(int $value = 1): ChronosInterface */ public function subSeconds(int $value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 subSeconds() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->addSeconds(-$value); } @@ -790,6 +900,10 @@ public function subSeconds(int $value): ChronosInterface */ public function startOfDay(): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 startOfDay() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->modify('midnight'); } @@ -800,6 +914,10 @@ public function startOfDay(): ChronosInterface */ public function endOfDay(): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 endOfDay() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->modify('23:59:59'); } @@ -810,6 +928,10 @@ public function endOfDay(): ChronosInterface */ public function startOfMonth(): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 startOfMonth() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->modify('first day of this month midnight'); } @@ -820,6 +942,10 @@ public function startOfMonth(): ChronosInterface */ public function endOfMonth(): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 endOfMonth() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->modify('last day of this month, 23:59:59'); } @@ -830,6 +956,10 @@ public function endOfMonth(): ChronosInterface */ public function startOfYear(): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 startOfYear() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->modify('first day of january midnight'); } @@ -840,6 +970,10 @@ public function startOfYear(): ChronosInterface */ public function endOfYear(): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 endOfYear() will be removed in 3.x.', E_USER_DEPRECATED); + } + return $this->modify('last day of december, 23:59:59'); } @@ -1132,6 +1266,9 @@ public function nthOfYear(int $nth, int $dayOfWeek) */ public function average(?ChronosInterface $dt = null): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 average() will be removed in 3.x.', E_USER_DEPRECATED); + } $dt = $dt ?? static::now($this->tz); return $this->addSeconds((int)($this->diffInSeconds($dt, false) / 2)); diff --git a/app/vendor/cakephp/chronos/src/Traits/RelativeKeywordTrait.php b/app/vendor/cakephp/chronos/src/Traits/RelativeKeywordTrait.php index c98e92796..070d6bfc7 100644 --- a/app/vendor/cakephp/chronos/src/Traits/RelativeKeywordTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/RelativeKeywordTrait.php @@ -2,16 +2,16 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. Provides various operator methods for datetime * objects. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; diff --git a/app/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php b/app/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php index ab2fef877..f3cb5eff8 100644 --- a/app/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php @@ -2,16 +2,16 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. Provides various operator methods for datetime * objects. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; diff --git a/app/vendor/cakephp/chronos/src/Traits/TimezoneTrait.php b/app/vendor/cakephp/chronos/src/Traits/TimezoneTrait.php index 2452de7ae..6335c9d0b 100644 --- a/app/vendor/cakephp/chronos/src/Traits/TimezoneTrait.php +++ b/app/vendor/cakephp/chronos/src/Traits/TimezoneTrait.php @@ -2,19 +2,20 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. Provides various operator methods for datetime * objects. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos\Traits; +use Cake\Chronos\ChronosDate; use Cake\Chronos\ChronosInterface; use ReturnTypeWillChange; @@ -31,6 +32,8 @@ trait TimezoneTrait */ public function timezone($value): ChronosInterface { + trigger_error('2.5 timezone() is deprecated. Use setTimezone() instead.', E_USER_DEPRECATED); + return $this->setTimezone($value); } @@ -42,6 +45,8 @@ public function timezone($value): ChronosInterface */ public function tz($value): ChronosInterface { + trigger_error('2.5 tz() is deprecated. Use setTimezone() instead.', E_USER_DEPRECATED); + return $this->setTimezone($value); } @@ -54,6 +59,10 @@ public function tz($value): ChronosInterface #[ReturnTypeWillChange] public function setTimezone($value): ChronosInterface { + if (static::class === ChronosDate::class) { + trigger_error('2.5 setTimezone() will be removed in 3.x.', E_USER_DEPRECATED); + } + return parent::setTimezone(static::safeCreateDateTimeZone($value)); } } diff --git a/app/vendor/cakephp/chronos/src/Translator.php b/app/vendor/cakephp/chronos/src/Translator.php index 382bfd484..2229d4680 100644 --- a/app/vendor/cakephp/chronos/src/Translator.php +++ b/app/vendor/cakephp/chronos/src/Translator.php @@ -2,14 +2,14 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Chronos; diff --git a/app/vendor/cakephp/chronos/src/carbon_compat.php b/app/vendor/cakephp/chronos/src/carbon_compat.php index 0d8eff724..a7c1c80d2 100644 --- a/app/vendor/cakephp/chronos/src/carbon_compat.php +++ b/app/vendor/cakephp/chronos/src/carbon_compat.php @@ -2,15 +2,15 @@ declare(strict_types=1); /** - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @copyright Copyright (c) Brian Nesbitt - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @link https://cakephp.org CakePHP(tm) Project + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ // Check if the interface alias exists and don't redeclare it in case we are in diff --git a/app/vendor/cakephp/debug_kit/LICENSE.txt b/app/vendor/cakephp/debug_kit/LICENSE.txt index 0a0a98c8e..7fd9d1f4b 100644 --- a/app/vendor/cakephp/debug_kit/LICENSE.txt +++ b/app/vendor/cakephp/debug_kit/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License -CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org) +CakePHP(tm) : The Rapid Development PHP Framework (https://cakephp.org) Copyright (c) 2005-present, Cake Software Foundation, Inc. Permission is hereby granted, free of charge, to any person obtaining a diff --git a/app/vendor/cakephp/debug_kit/composer.json b/app/vendor/cakephp/debug_kit/composer.json index 248275f19..2504f45e3 100644 --- a/app/vendor/cakephp/debug_kit/composer.json +++ b/app/vendor/cakephp/debug_kit/composer.json @@ -18,7 +18,7 @@ ], "support": { "issues": "https://github.com/cakephp/debug_kit/issues", - "forum": "http://stackoverflow.com/tags/cakephp", + "forum": "https://stackoverflow.com/tags/cakephp", "irc": "irc://irc.freenode.org/cakephp", "source": "https://github.com/cakephp/debug_kit" }, diff --git a/app/vendor/cakephp/debug_kit/docs.Dockerfile b/app/vendor/cakephp/debug_kit/docs.Dockerfile index cb30b3edf..f5613cace 100644 --- a/app/vendor/cakephp/debug_kit/docs.Dockerfile +++ b/app/vendor/cakephp/debug_kit/docs.Dockerfile @@ -1,5 +1,5 @@ # Generate the HTML output. -FROM markstory/cakephp-docs-builder as builder +FROM ghcr.io/cakephp/docs-builder as builder RUN pip install git+https://github.com/sphinx-contrib/video.git@master @@ -15,7 +15,7 @@ RUN cd /data/docs-builder \ && cp /data/docs/static/* /data/website/html/_static/ # Build a small nginx container with just the static site in it. -FROM markstory/cakephp-docs-builder:runtime as runtime +FROM ghcr.io/cakephp/docs-builder:runtime as runtime # Configure search index script ENV LANGS="en fr ja pt" diff --git a/app/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php b/app/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php index 662d1b769..e6db2ed37 100644 --- a/app/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php +++ b/app/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php @@ -69,6 +69,6 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface return $response; } - return $this->service->injectScripts($row, $response); + return $this->service->injectScripts($row, $request, $response); } } diff --git a/app/vendor/cakephp/debug_kit/src/Panel/CachePanel.php b/app/vendor/cakephp/debug_kit/src/Panel/CachePanel.php index 0265157ed..23a2a1a2b 100644 --- a/app/vendor/cakephp/debug_kit/src/Panel/CachePanel.php +++ b/app/vendor/cakephp/debug_kit/src/Panel/CachePanel.php @@ -55,9 +55,17 @@ public function initialize() if (isset($config['className']) && $config['className'] instanceof DebugEngine) { $instance = $config['className']; } elseif (isset($config['className'])) { - Cache::drop($name); - $instance = new DebugEngine($config, $name, $this->logger); + /** @var \Cake\Cache\CacheEngine $engine */ + $engine = Cache::pool($name); + // Unload from the cache registry so that subsequence calls to + // Cache::pool($name) use the new config with DebugEngine instance set below. + Cache::getRegistry()->unload($name); + + $instance = new DebugEngine($engine, $name, $this->logger); + $instance->init(); $config['className'] = $instance; + + Cache::drop($name); Cache::setConfig($name, $config); } if (isset($instance)) { diff --git a/app/vendor/cakephp/debug_kit/src/ToolbarService.php b/app/vendor/cakephp/debug_kit/src/ToolbarService.php index 8dac83c4b..c08418c4a 100644 --- a/app/vendor/cakephp/debug_kit/src/ToolbarService.php +++ b/app/vendor/cakephp/debug_kit/src/ToolbarService.php @@ -25,6 +25,7 @@ use DebugKit\Panel\PanelRegistry; use PDOException; use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\ServerRequestInterface; /** * Used to create the panels and inject a toolbar into @@ -337,10 +338,11 @@ public function getToolbarUrl() * contains HTML and there is a tag. * * @param \DebugKit\Model\Entity\Request $row The request data to inject. + * @param \Psr\Http\Message\ServerRequestInterface $request The request to augment. * @param \Psr\Http\Message\ResponseInterface $response The response to augment. * @return \Psr\Http\Message\ResponseInterface The modified response */ - public function injectScripts($row, ResponseInterface $response) + public function injectScripts($row, ServerRequestInterface $request, ResponseInterface $response) { $response = $response->withHeader('X-DEBUGKIT-ID', (string)$row->id); if (strpos($response->getHeaderLine('Content-Type'), 'html') === false) { @@ -357,13 +359,18 @@ public function injectScripts($row, ResponseInterface $response) if ($pos === false) { return $response; } + $nonce = $request->getAttribute('cspScriptNonce'); + if ($nonce) { + $nonce = sprintf(' nonce="%s"', $nonce); + } $url = Router::url('/', true); $script = sprintf( - '', + '', $row->id, $url, - Router::url($this->getToolbarUrl()) + Router::url($this->getToolbarUrl()), + $nonce ); $contents = substr($contents, 0, $pos) . $script . substr($contents, $pos); $body->rewind(); diff --git a/app/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php b/app/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php index b5a2c494f..a79c45143 100644 --- a/app/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php +++ b/app/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php @@ -1,14 +1,14 @@ - + src/ tests/ diff --git a/app/vendor/cakephp/migrations/src/Command/BakeMigrationDiffCommand.php b/app/vendor/cakephp/migrations/src/Command/BakeMigrationDiffCommand.php index 58dc44b07..78b4a41f0 100644 --- a/app/vendor/cakephp/migrations/src/Command/BakeMigrationDiffCommand.php +++ b/app/vendor/cakephp/migrations/src/Command/BakeMigrationDiffCommand.php @@ -451,7 +451,7 @@ protected function checkSync() $lastVersion = $this->migratedItems[0]['version']; $lastFile = end($this->migrationsFiles); - return (bool)strpos($lastFile, (string)$lastVersion); + return $lastFile && (bool)strpos($lastFile, (string)$lastVersion); } return false; diff --git a/app/vendor/cakephp/migrations/src/TableFinderTrait.php b/app/vendor/cakephp/migrations/src/TableFinderTrait.php index ca004d1ff..8a481be4d 100644 --- a/app/vendor/cakephp/migrations/src/TableFinderTrait.php +++ b/app/vendor/cakephp/migrations/src/TableFinderTrait.php @@ -156,6 +156,10 @@ protected function fetchTableName($className, $pluginName = null) { $tables = []; $className = str_replace('Table.php', '', $className); + if (!$className) { + return $tables; + } + if ($pluginName !== null) { $className = $pluginName . '.' . $className; } diff --git a/app/vendor/cakephp/migrations/src/TestSuite/Migrator.php b/app/vendor/cakephp/migrations/src/TestSuite/Migrator.php index 2b955a810..d2589e8c0 100644 --- a/app/vendor/cakephp/migrations/src/TestSuite/Migrator.php +++ b/app/vendor/cakephp/migrations/src/TestSuite/Migrator.php @@ -92,13 +92,13 @@ public function runMany( $options[$i] = $migrationSet; $connectionName = $migrationSet['connection']; - if (!in_array($connectionName, $connectionsList)) { - $connectionsList[] = ['name' => $connectionName, 'skip' => $skip]; + if (!isset($connectionsList[$connectionName])) { + $connectionsList[$connectionName] = ['name' => $connectionName, 'skip' => $skip]; } $migrations = new Migrations(); - if (!in_array($connectionName, $connectionsToDrop) && $this->shouldDropTables($migrations, $migrationSet)) { - $connectionsToDrop[] = ['name' => $connectionName, 'skip' => $skip]; + if (!isset($connectionsToDrop[$connectionName]) && $this->shouldDropTables($migrations, $migrationSet)) { + $connectionsToDrop[$connectionName] = ['name' => $connectionName, 'skip' => $skip]; } } @@ -110,9 +110,21 @@ public function runMany( foreach ($options as $migrationSet) { $migrations = new Migrations(); - if (!$migrations->migrate($migrationSet)) { + try { + if (!$migrations->migrate($migrationSet)) { + throw new RuntimeException( + "Unable to migrate fixtures for `{$migrationSet['connection']}`." + ); + } + } catch (\Exception $e) { throw new RuntimeException( - "Unable to migrate fixtures for `{$migrationSet['connection']}`." + 'Could not apply migrations for ' . json_encode($migrationSet) . "\n\n" . + "Migrations failed to apply with message:\n\n" . + $e->getMessage() . "\n\n" . + 'If you are using the `skip` option and running multiple sets of migrations ' . + 'on the same connection try calling `truncate()` before `runMany()` to avoid this.', + 0, + $e ); } } diff --git a/app/vendor/cakephp/migrations/templates/bake/element/add-foreign-keys.twig b/app/vendor/cakephp/migrations/templates/bake/element/add-foreign-keys.twig index ef75c63aa..6df6a12d7 100644 --- a/app/vendor/cakephp/migrations/templates/bake/element/add-foreign-keys.twig +++ b/app/vendor/cakephp/migrations/templates/bake/element/add-foreign-keys.twig @@ -1,6 +1,6 @@ {% set statement = Migration.tableStatement(table, true) %} {% set hasProcessedConstraint = false %} -{% for constraint in constraints %} +{% for constraintName, constraint in constraints[table] %} {% set constraintColumns = constraint['columns']|sort %} {% if constraint['type'] != 'unique' %} {% set hasProcessedConstraint = true %} @@ -29,6 +29,7 @@ [ 'update' => '{{ Migration.formatConstraintAction(constraint['update']) | raw }}', 'delete' => '{{ Migration.formatConstraintAction(constraint['delete']) | raw }}', + 'constraint' => '{{ constraintName }}' ] ) {% endif %} diff --git a/app/vendor/cakephp/migrations/templates/bake/element/create-tables.twig b/app/vendor/cakephp/migrations/templates/bake/element/create-tables.twig index 8f4a2e330..0bac5deb7 100644 --- a/app/vendor/cakephp/migrations/templates/bake/element/create-tables.twig +++ b/app/vendor/cakephp/migrations/templates/bake/element/create-tables.twig @@ -40,21 +40,25 @@ {% for name, constraint in createData.tables[table].constraints %} {% if constraint['columns'] != primaryKeysColumns %} ->addIndex( - [{{ Migration.stringifyList(constraint['columns'], {'indent': 5}) | raw }}]{{ (constraint['type'] == 'unique') ? ',' : '' }} + [{{ Migration.stringifyList(constraint['columns'], {'indent': 5}) | raw }}], +{% set params = {'name': name} %} {% if constraint['type'] == 'unique' %} - ['unique' => true] +{% set params = params|merge({'unique': true}) %} {% endif %} + [{{ Migration.stringifyList(params, {'indent': 5}) | raw }}] ) {% endif %} {% endfor %} {% endif %} -{% for index in createData.tables[table].indexes %} +{% for indexName, index in createData.tables[table].indexes %} {% set indexColumns = index['columns'] | sort %} ->addIndex( - [{{ Migration.stringifyList(index['columns'], {'indent': 5}) | raw }}]{{ (index['type'] == 'fulltext') ? ',' : '' }} -{% if index['type'] == 'fulltext' %} - ['type' => 'fulltext'] -{% endif %} + [{{ Migration.stringifyList(index['columns'], {'indent': 5}) | raw }}], +{% set params = {'name': indexName} %} +{% if index['type'] == 'fulltext' %} +{% set params = params|merge({'fulltext': true}) %} +{% endif %} + [{{ Migration.stringifyList(params, {'indent': 5}) | raw }}] ) {% endfor %} ->create(); @@ -62,8 +66,8 @@ {% if createData.constraints %} {% for table, tableConstraints in createData.constraints %} {{- element('Migrations.add-foreign-keys', { - constraints: tableConstraints, - table: table + constraints: createData.constraints, + table: table, }) -}} {% endfor -%} diff --git a/app/vendor/composer/InstalledVersions.php b/app/vendor/composer/InstalledVersions.php index d50e0c9fc..c6b54af7b 100644 --- a/app/vendor/composer/InstalledVersions.php +++ b/app/vendor/composer/InstalledVersions.php @@ -21,12 +21,14 @@ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final */ class InstalledVersions { /** * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null */ private static $installed; @@ -37,7 +39,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -241,7 +243,7 @@ public static function getInstallPath($packageName) /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -255,7 +257,7 @@ public static function getRootPackage() * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} */ public static function getRawData() { @@ -278,7 +280,7 @@ public static function getRawData() * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -301,7 +303,7 @@ public static function getAllRawData() * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data */ public static function reload($data) { @@ -311,7 +313,7 @@ public static function reload($data) /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { diff --git a/app/vendor/composer/autoload_classmap.php b/app/vendor/composer/autoload_classmap.php index 17572c4b0..9a80294f2 100644 --- a/app/vendor/composer/autoload_classmap.php +++ b/app/vendor/composer/autoload_classmap.php @@ -292,8 +292,8 @@ 'PHPUnit\\TextUI\\XmlConfiguration\\Migrator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromFilterWhitelistToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromRootToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistDirectoriesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistExcludesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistIncludesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\PHPUnit' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Php' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Php.php', 'PHPUnit\\TextUI\\XmlConfiguration\\PhpHandler' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php', diff --git a/app/vendor/composer/autoload_static.php b/app/vendor/composer/autoload_static.php index 3be2be931..b4fa06fab 100644 --- a/app/vendor/composer/autoload_static.php +++ b/app/vendor/composer/autoload_static.php @@ -789,8 +789,8 @@ class ComposerStaticInitb25f76eec921984aa94dcf4015a4846e 'PHPUnit\\TextUI\\XmlConfiguration\\Migrator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromFilterWhitelistToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromRootToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistDirectoriesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistExcludesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistIncludesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\PHPUnit' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Php' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Php.php', 'PHPUnit\\TextUI\\XmlConfiguration\\PhpHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php', diff --git a/app/vendor/composer/ca-bundle/res/cacert.pem b/app/vendor/composer/ca-bundle/res/cacert.pem index 2ae7b6cb2..6b93dc34f 100644 --- a/app/vendor/composer/ca-bundle/res/cacert.pem +++ b/app/vendor/composer/ca-bundle/res/cacert.pem @@ -1,7 +1,7 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Tue Jan 10 04:12:06 2023 GMT +## Certificate data from Mozilla as of: Tue May 30 03:12:04 2023 GMT ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates @@ -14,7 +14,7 @@ ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.29. -## SHA256: 90c470e705b4b5f36f09684dc50e2b79c8b86989a848b62cd1a7bd6460ee65f6 +## SHA256: c47475103fb05bb562bbadff0d1e72346b03236154e1448a6ca191b740f83507 ## @@ -603,26 +603,6 @@ NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= -----END CERTIFICATE----- -Hongkong Post Root CA 1 -======================= ------BEGIN CERTIFICATE----- -MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT -DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx -NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n -IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 -ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr -auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh -qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY -V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV -HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i -h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio -l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei -IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps -T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT -c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== ------END CERTIFICATE----- - SecureSign RootCA11 =================== -----BEGIN CERTIFICATE----- @@ -1261,40 +1241,6 @@ Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= -----END CERTIFICATE----- -E-Tugra Certification Authority -=============================== ------BEGIN CERTIFICATE----- -MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w -DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls -ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN -ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw -NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx -QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl -cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD -DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd -hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5K -CKpbknSFQ9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEoq1+g -ElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3Dk14opz8n8Y4e0ypQ -BaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcHfC425lAcP9tDJMW/hkd5s3kc91r0 -E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsutdEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gz -rt48Ue7LE3wBf4QOXVGUnhMMti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAq -jqFGOjGY5RH8zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn -rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUXU8u3Zg5mTPj5 -dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6Jyr+zE7S6E5UMA8GA1UdEwEB -/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG -MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK -kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO -XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 -VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo -a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc -dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV -KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT -Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 -8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G -C7TbO6Orb1wdtn7os4I07QZcJA== ------END CERTIFICATE----- - T-TeleSec GlobalRoot Class 2 ============================ -----BEGIN CERTIFICATE----- @@ -3370,3 +3316,48 @@ BggqhkjOPQQDAwNoADBlAjAVXUI9/Lbu9zuxNuie9sRGKEkz0FhDKmMpzE2xtHqiuQ04pV1IKv3L snNdo4gIxwwCMQDAqy0Obe0YottT6SXbVQjgUMzfRGEWgqtJsLKB7HOHeLRMsmIbEvoWTSVLY70e N9k= -----END CERTIFICATE----- + +BJCA Global Root CA1 +==================== +-----BEGIN CERTIFICATE----- +MIIFdDCCA1ygAwIBAgIQVW9l47TZkGobCdFsPsBsIDANBgkqhkiG9w0BAQsFADBUMQswCQYDVQQG +EwJDTjEmMCQGA1UECgwdQkVJSklORyBDRVJUSUZJQ0FURSBBVVRIT1JJVFkxHTAbBgNVBAMMFEJK +Q0EgR2xvYmFsIFJvb3QgQ0ExMB4XDTE5MTIxOTAzMTYxN1oXDTQ0MTIxMjAzMTYxN1owVDELMAkG +A1UEBhMCQ04xJjAkBgNVBAoMHUJFSUpJTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZMR0wGwYDVQQD +DBRCSkNBIEdsb2JhbCBSb290IENBMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAPFm +CL3ZxRVhy4QEQaVpN3cdwbB7+sN3SJATcmTRuHyQNZ0YeYjjlwE8R4HyDqKYDZ4/N+AZspDyRhyS +sTphzvq3Rp4Dhtczbu33RYx2N95ulpH3134rhxfVizXuhJFyV9xgw8O558dnJCNPYwpj9mZ9S1Wn +P3hkSWkSl+BMDdMJoDIwOvqfwPKcxRIqLhy1BDPapDgRat7GGPZHOiJBhyL8xIkoVNiMpTAK+BcW +yqw3/XmnkRd4OJmtWO2y3syJfQOcs4ll5+M7sSKGjwZteAf9kRJ/sGsciQ35uMt0WwfCyPQ10WRj +eulumijWML3mG90Vr4TqnMfK9Q7q8l0ph49pczm+LiRvRSGsxdRpJQaDrXpIhRMsDQa4bHlW/KNn +MoH1V6XKV0Jp6VwkYe/iMBhORJhVb3rCk9gZtt58R4oRTklH2yiUAguUSiz5EtBP6DF+bHq/pj+b +OT0CFqMYs2esWz8sgytnOYFcuX6U1WTdno9uruh8W7TXakdI136z1C2OVnZOz2nxbkRs1CTqjSSh +GL+9V/6pmTW12xB3uD1IutbB5/EjPtffhZ0nPNRAvQoMvfXnjSXWgXSHRtQpdaJCbPdzied9v3pK +H9MiyRVVz99vfFXQpIsHETdfg6YmV6YBW37+WGgHqel62bno/1Afq8K0wM7o6v0PvY1NuLxxAgMB +AAGjQjBAMB0GA1UdDgQWBBTF7+3M2I0hxkjk49cULqcWk+WYATAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAUoKsITQfI/Ki2Pm4rzc2IInRNwPWaZ+4 +YRC6ojGYWUfo0Q0lHhVBDOAqVdVXUsv45Mdpox1NcQJeXyFFYEhcCY5JEMEE3KliawLwQ8hOnThJ +dMkycFRtwUf8jrQ2ntScvd0g1lPJGKm1Vrl2i5VnZu69mP6u775u+2D2/VnGKhs/I0qUJDAnyIm8 +60Qkmss9vk/Ves6OF8tiwdneHg56/0OGNFK8YT88X7vZdrRTvJez/opMEi4r89fO4aL/3Xtw+zuh +TaRjAv04l5U/BXCga99igUOLtFkNSoxUnMW7gZ/NfaXvCyUeOiDbHPwfmGcCCtRzRBPbUYQaVQNW +4AB+dAb/OMRyHdOoP2gxXdMJxy6MW2Pg6Nwe0uxhHvLe5e/2mXZgLR6UcnHGCyoyx5JO1UbXHfmp +GQrI+pXObSOYqgs4rZpWDW+N8TEAiMEXnM0ZNjX+VVOg4DwzX5Ze4jLp3zO7Bkqp2IRzznfSxqxx +4VyjHQy7Ct9f4qNx2No3WqB4K/TUfet27fJhcKVlmtOJNBir+3I+17Q9eVzYH6Eze9mCUAyTF6ps +3MKCuwJXNq+YJyo5UOGwifUll35HaBC07HPKs5fRJNz2YqAo07WjuGS3iGJCz51TzZm+ZGiPTx4S +SPfSKcOYKMryMguTjClPPGAyzQWWYezyr/6zcCwupvI= +-----END CERTIFICATE----- + +BJCA Global Root CA2 +==================== +-----BEGIN CERTIFICATE----- +MIICJTCCAaugAwIBAgIQLBcIfWQqwP6FGFkGz7RK6zAKBggqhkjOPQQDAzBUMQswCQYDVQQGEwJD +TjEmMCQGA1UECgwdQkVJSklORyBDRVJUSUZJQ0FURSBBVVRIT1JJVFkxHTAbBgNVBAMMFEJKQ0Eg +R2xvYmFsIFJvb3QgQ0EyMB4XDTE5MTIxOTAzMTgyMVoXDTQ0MTIxMjAzMTgyMVowVDELMAkGA1UE +BhMCQ04xJjAkBgNVBAoMHUJFSUpJTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZMR0wGwYDVQQDDBRC +SkNBIEdsb2JhbCBSb290IENBMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABJ3LgJGNU2e1uVCxA/jl +SR9BIgmwUVJY1is0j8USRhTFiy8shP8sbqjV8QnjAyEUxEM9fMEsxEtqSs3ph+B99iK++kpRuDCK +/eHeGBIK9ke35xe/J4rUQUyWPGCWwf0VHKNCMEAwHQYDVR0OBBYEFNJKsVF/BvDRgh9Obl+rg/xI +1LCRMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2gAMGUCMBq8 +W9f+qdJUDkpd0m2xQNz0Q9XSSpkZElaA94M04TVOSG0ED1cxMDAtsaqdAzjbBgIxAMvMh1PLet8g +UXOQwKhbYdDFUDn9hf7B43j4ptZLvZuHjw/l1lOWqzzIQNph91Oj9w== +-----END CERTIFICATE----- diff --git a/app/vendor/composer/class-map-generator/README.md b/app/vendor/composer/class-map-generator/README.md index 3205ae989..4b5d6a26d 100644 --- a/app/vendor/composer/class-map-generator/README.md +++ b/app/vendor/composer/class-map-generator/README.md @@ -29,7 +29,7 @@ If all you want is to scan a directory and extract a classmap with all classes/interfaces/traits/enums mapped to their paths, you can simply use: -``` +```php use Composer\ClassMapGenerator\ClassMapGenerator; $map = ClassMapGenerator::createMap('path/to/scan'); @@ -41,7 +41,7 @@ foreach ($map as $symbol => $path) { For more advanced usage, you can instantiate a generator object and call scanPaths one or more time then call getClassMap to get a ClassMap object containing the resulting map + eventual warnings. -``` +```php use Composer\ClassMapGenerator\ClassMapGenerator; $generator = new ClassMapGenerator; diff --git a/app/vendor/composer/class-map-generator/composer.json b/app/vendor/composer/class-map-generator/composer.json index 140b483c8..59aa759e7 100644 --- a/app/vendor/composer/class-map-generator/composer.json +++ b/app/vendor/composer/class-map-generator/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6", - "composer/pcre": "^2 || ^3" + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7", + "composer/pcre": "^2.1 || ^3.1" }, "require-dev": { "symfony/phpunit-bridge": "^5", diff --git a/app/vendor/composer/class-map-generator/src/ClassMapGenerator.php b/app/vendor/composer/class-map-generator/src/ClassMapGenerator.php index f347960bf..fd905c3ca 100644 --- a/app/vendor/composer/class-map-generator/src/ClassMapGenerator.php +++ b/app/vendor/composer/class-map-generator/src/ClassMapGenerator.php @@ -174,7 +174,7 @@ public function scanPaths($path, string $excluded = null, string $autoloadType = } $classes = PhpFileParser::findClasses($filePath); - if ('classmap' !== $autoloadType && isset($namespace, $basePath)) { + if ('classmap' !== $autoloadType && isset($namespace)) { $classes = $this->filterByNamespace($classes, $filePath, $namespace, $autoloadType, $basePath); // if no valid class was found in the file then we do not mark it as scanned as it might still be matched by another rule later @@ -291,7 +291,7 @@ private static function normalizePath(string $path) } // extract a prefix being a protocol://, protocol:, protocol://drive: or simply drive: - if (Preg::isMatch('{^( [0-9a-z]{2,}+: (?: // (?: [a-z]: )? )? | [a-z]: )}ix', $path, $match)) { + if (Preg::isMatchStrictGroups('{^( [0-9a-z]{2,}+: (?: // (?: [a-z]: )? )? | [a-z]: )}ix', $path, $match)) { $prefix = $match[1]; $path = substr($path, \strlen($prefix)); } @@ -313,7 +313,7 @@ private static function normalizePath(string $path) } // ensure c: is normalized to C: - $prefix = Preg::replaceCallback('{(^|://)[a-z]:$}i', function (array $m) { return strtoupper($m[0]); }, $prefix); + $prefix = Preg::replaceCallback('{(?:^|://)[a-z]:$}i', function (array $m) { return strtoupper((string) $m[0]); }, $prefix); return $prefix.$absolute.implode('/', $parts); } diff --git a/app/vendor/composer/class-map-generator/src/PhpFileParser.php b/app/vendor/composer/class-map-generator/src/PhpFileParser.php index fa9b4e343..b678aeee0 100644 --- a/app/vendor/composer/class-map-generator/src/PhpFileParser.php +++ b/app/vendor/composer/class-map-generator/src/PhpFileParser.php @@ -52,8 +52,8 @@ public static function findClasses(string $path): array } // return early if there is no chance of matching anything in this file - Preg::matchAll('{\b(?:class|interface|trait'.$extraTypes.')\s}i', $contents, $matches); - if (!$matches) { + Preg::matchAllStrictGroups('{\b(?:class|interface|trait'.$extraTypes.')\s}i', $contents, $matches); + if (0 === \count($matches)) { return array(); } @@ -76,6 +76,7 @@ public static function findClasses(string $path): array $namespace = str_replace(array(' ', "\t", "\r", "\n"), '', (string) $matches['nsname'][$i]) . '\\'; } else { $name = $matches['name'][$i]; + assert(is_string($name)); // skip anon classes extending/implementing if ($name === 'extends' || $name === 'implements') { continue; @@ -83,7 +84,7 @@ public static function findClasses(string $path): array if ($name[0] === ':') { // This is an XHP class, https://github.com/facebook/xhp $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1); - } elseif (strtolower($matches['type'][$i]) === 'enum') { + } elseif (strtolower((string) $matches['type'][$i]) === 'enum') { // something like: // enum Foo: int { HERP = '123'; } // The regex above captures the colon, which isn't part of diff --git a/app/vendor/composer/composer/CHANGELOG.md b/app/vendor/composer/composer/CHANGELOG.md index 0e04f80d5..79ac978a6 100644 --- a/app/vendor/composer/composer/CHANGELOG.md +++ b/app/vendor/composer/composer/CHANGELOG.md @@ -1,3 +1,39 @@ +### [2.5.8] 2023-06-09 + + * Fixed regression in edge cases where root package gets added to a repository already during the install process (#11495) + * Fixed EventDispatcher on windows picking bat files when using "@php binary" (#11490) + * Fixed ICU CDLR version parsing failing the whole process when ICU cannot initialize the resource bundle (#11492) + * Fixed type declarations on ClassLoader (#11500) + +### [2.5.7] 2023-05-24 + + * Fixed regression preventing autoloading the dependencies of metapackages when running --no-dev (#11481) + +### [2.5.6] 2023-05-24 + + * BC Warning: Installers and `InstallationManager::getInstallPath` will now return `null` instead of an empty string for metapackages' paths. This may have adverse effects on plugin code using this expecting always a string but it is unlikely (#11455) + * Fixed metapackages showing their install path as the root package's path instead of empty (#11455) + * Fixed lock file verification on `install` to deal better with `replace`/`provide` (#11475) + * Fixed lock file having a more recent modification time than the vendor dir when `require` guesses the constraint after resolution (#11405) + * Fixed numeric default branches with a `v` prefix being treated as non-numeric ones and receiving an alias like e.g. dev-main would (e51d755a08) + * Fixed binary proxies not being transparent when included by another PHP process and returning a value (#11454) + * Fixed support for plugin classes being marked as `readonly` (#11404) + * Fixed `getmypid` being required as it is not always available (#11401) + * Fixed authentication issue when downloading several files from private Bitbucket in parallel (#11464) + +### [2.5.5] 2023-03-21 + + * Fixed basic auth failures resulting in infinite retry loop (#11320) + * Fixed GitHub rate limit reporting (#11366) + * Fixed InstalledVersions error in Composer 1 compatibility edge case (#11304) + * Fixed issue displaying solver problems with branch names containing `%` signs (#11359) + * Fixed race condition in cache validity detection when running Composer highly concurrently (#11375) + * Fixed various minor config command issues (#11353, #11302) + +### [2.5.4] 2023-02-15 + + * Fixed extra.plugin-optional support in PluginInstaller when doing pre-install checks (#11318) + ### [2.5.3] 2023-02-10 * Added extra.plugin-optional support for allow auto-disabling unknown plugins which are not critical when running non-interactive (#11315) @@ -1695,6 +1731,11 @@ * Initial release +[2.5.8]: https://github.com/composer/composer/compare/2.5.7...2.5.8 +[2.5.7]: https://github.com/composer/composer/compare/2.5.6...2.5.7 +[2.5.6]: https://github.com/composer/composer/compare/2.5.5...2.5.6 +[2.5.5]: https://github.com/composer/composer/compare/2.5.4...2.5.5 +[2.5.4]: https://github.com/composer/composer/compare/2.5.3...2.5.4 [2.5.3]: https://github.com/composer/composer/compare/2.5.2...2.5.3 [2.5.2]: https://github.com/composer/composer/compare/2.5.1...2.5.2 [2.5.1]: https://github.com/composer/composer/compare/2.5.0...2.5.1 diff --git a/app/vendor/composer/composer/composer.lock b/app/vendor/composer/composer/composer.lock index 3d2f9d5e8..14527c2e4 100644 --- a/app/vendor/composer/composer/composer.lock +++ b/app/vendor/composer/composer/composer.lock @@ -692,23 +692,23 @@ }, { "name": "react/promise", - "version": "v2.9.0", + "version": "v2.10.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", + "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", "shasum": "" }, "require": { "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { @@ -752,32 +752,28 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" + "source": "https://github.com/reactphp/promise/tree/v2.10.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-02-11T10:27:51+00:00" + "time": "2023-05-02T15:15:43+00:00" }, { "name": "seld/jsonlint", - "version": "1.9.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "4211420d25eba80712bff236a98960ef68b866b7" + "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7", - "reference": "4211420d25eba80712bff236a98960ef68b866b7", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/594fd6462aad8ecee0b45ca5045acea4776667f1", + "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1", "shasum": "" }, "require": { @@ -816,7 +812,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0" + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0" }, "funding": [ { @@ -828,7 +824,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T13:37:23+00:00" + "time": "2023-05-11T13:16:46+00:00" }, { "name": "seld/phar-utils", @@ -941,16 +937,16 @@ }, { "name": "symfony/console", - "version": "v5.4.19", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "dccb8d251a9017d5994c988b034d3e18aaabf740" + "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/dccb8d251a9017d5994c988b034d3e18aaabf740", - "reference": "dccb8d251a9017d5994c988b034d3e18aaabf740", + "url": "https://api.github.com/repos/symfony/console/zipball/90f21e27d0d88ce38720556dd164d4a1e4c3934c", + "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c", "shasum": "" }, "require": { @@ -1015,12 +1011,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.19" + "source": "https://github.com/symfony/console/tree/v5.4.23" }, "funding": [ { @@ -1036,7 +1032,7 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:32:19+00:00" + "time": "2023-04-24T18:47:29+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1107,16 +1103,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.19", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "648bfaca6a494f3e22378123bcee2894045dc9d8" + "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/648bfaca6a494f3e22378123bcee2894045dc9d8", - "reference": "648bfaca6a494f3e22378123bcee2894045dc9d8", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", "shasum": "" }, "require": { @@ -1151,7 +1147,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.19" + "source": "https://github.com/symfony/filesystem/tree/v5.4.23" }, "funding": [ { @@ -1167,20 +1163,20 @@ "type": "tidelift" } ], - "time": "2023-01-14T19:14:44+00:00" + "time": "2023-03-02T11:38:35+00:00" }, { "name": "symfony/finder", - "version": "v5.4.19", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "6071aebf810ad13fe8200c224f36103abb37cf1f" + "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/6071aebf810ad13fe8200c224f36103abb37cf1f", - "reference": "6071aebf810ad13fe8200c224f36103abb37cf1f", + "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", + "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", "shasum": "" }, "require": { @@ -1214,7 +1210,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.19" + "source": "https://github.com/symfony/finder/tree/v5.4.21" }, "funding": [ { @@ -1230,7 +1226,7 @@ "type": "tidelift" } ], - "time": "2023-01-14T19:14:44+00:00" + "time": "2023-02-16T09:33:00+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1805,16 +1801,16 @@ }, { "name": "symfony/process", - "version": "v5.4.19", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1" + "reference": "4b842fc4b61609e0a155a114082bd94e31e98287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c5ba874c9b636dbccf761e22ce750e88ec3f55e1", - "reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1", + "url": "https://api.github.com/repos/symfony/process/zipball/4b842fc4b61609e0a155a114082bd94e31e98287", + "reference": "4b842fc4b61609e0a155a114082bd94e31e98287", "shasum": "" }, "require": { @@ -1847,7 +1843,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.19" + "source": "https://github.com/symfony/process/tree/v5.4.23" }, "funding": [ { @@ -1863,7 +1859,7 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:32:19+00:00" + "time": "2023-04-18T13:50:24+00:00" }, { "name": "symfony/service-contracts", @@ -1950,16 +1946,16 @@ }, { "name": "symfony/string", - "version": "v5.4.19", + "version": "v5.4.22", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "0a01071610fd861cc160dfb7e2682ceec66064cb" + "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/0a01071610fd861cc160dfb7e2682ceec66064cb", - "reference": "0a01071610fd861cc160dfb7e2682ceec66064cb", + "url": "https://api.github.com/repos/symfony/string/zipball/8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", + "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", "shasum": "" }, "require": { @@ -2016,7 +2012,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.19" + "source": "https://github.com/symfony/string/tree/v5.4.22" }, "funding": [ { @@ -2032,22 +2028,22 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:32:19+00:00" + "time": "2023-03-14T06:11:53+00:00" } ], "packages-dev": [ { "name": "phpstan/phpstan", - "version": "1.9.14", + "version": "1.10.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58" + "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/762c4dac4da6f8756eebb80e528c3a47855da9bd", + "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd", "shasum": "" }, "require": { @@ -2076,8 +2072,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": [ { @@ -2093,25 +2092,25 @@ "type": "tidelift" } ], - "time": "2023-01-19T10:47:09+00:00" + "time": "2023-05-09T15:28:01+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", - "version": "1.1.1", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "2c6792eda026d9c474c14aa018aed312686714db" + "reference": "a22b36b955a2e9a3d39fe533b6c1bb5359f9c319" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/2c6792eda026d9c474c14aa018aed312686714db", - "reference": "2c6792eda026d9c474c14aa018aed312686714db", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/a22b36b955a2e9a3d39fe533b6c1bb5359f9c319", + "reference": "a22b36b955a2e9a3d39fe533b6c1bb5359f9c319", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.3" + "phpstan/phpstan": "^1.10" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", @@ -2139,27 +2138,27 @@ "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "support": { "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.1.1" + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.1.3" }, - "time": "2022-12-13T14:26:20+00:00" + "time": "2023-03-17T07:50:08+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.3", + "version": "1.3.12", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7" + "reference": "c44246879d692d3b2cf2a21d65be4b4715d6ef21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/54a24bd23e9e80ee918cdc24f909d376c2e273f7", - "reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/c44246879d692d3b2cf2a21d65be4b4715d6ef21", + "reference": "c44246879d692d3b2cf2a21d65be4b4715d6ef21", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.3" + "phpstan/phpstan": "^1.10" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -2191,31 +2190,32 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.3" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.12" }, - "time": "2022-12-21T15:25:00+00:00" + "time": "2023-05-23T11:58:47+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "1.4.5", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "361f75b06066f3fdaba87c1f57bdb1ffc28d6f1d" + "reference": "b21c03d4f6f3a446e4311155f4be9d65048218e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/361f75b06066f3fdaba87c1f57bdb1ffc28d6f1d", - "reference": "361f75b06066f3fdaba87c1f57bdb1ffc28d6f1d", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b21c03d4f6f3a446e4311155f4be9d65048218e6", + "reference": "b21c03d4f6f3a446e4311155f4be9d65048218e6", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.7" + "phpstan/phpstan": "^1.10" }, "require-dev": { "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^9.5" }, @@ -2239,28 +2239,28 @@ "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.4.5" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.1" }, - "time": "2023-01-11T14:16:29+00:00" + "time": "2023-03-29T14:47:40+00:00" }, { "name": "phpstan/phpstan-symfony", - "version": "1.2.22", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "cbf5b9ceadab8365ed46db42dcd23db1a4c26c93" + "reference": "7332b90dfc291ac5b4b83fbca2081936faa1e3f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/cbf5b9ceadab8365ed46db42dcd23db1a4c26c93", - "reference": "cbf5b9ceadab8365ed46db42dcd23db1a4c26c93", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/7332b90dfc291ac5b4b83fbca2081936faa1e3f9", + "reference": "7332b90dfc291ac5b4b83fbca2081936faa1e3f9", "shasum": "" }, "require": { "ext-simplexml": "*", "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.4" + "phpstan/phpstan": "^1.9.18" }, "conflict": { "symfony/framework-bundle": "<3.0" @@ -2270,7 +2270,7 @@ "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^8.5.29 || ^9.5", "psr/container": "1.0 || 1.1.1", "symfony/config": "^5.4 || ^6.1", "symfony/console": "^5.4 || ^6.1", @@ -2310,22 +2310,22 @@ "description": "Symfony Framework extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-symfony/issues", - "source": "https://github.com/phpstan/phpstan-symfony/tree/1.2.22" + "source": "https://github.com/phpstan/phpstan-symfony/tree/1.3.2" }, - "time": "2023-02-01T13:26:41+00:00" + "time": "2023-05-16T12:46:15+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v6.2.5", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "d759e5372de414bef53a688c7aa7e240e4fd8aa2" + "reference": "552950db2919421ad917e29e76d1999a2a31a8e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/d759e5372de414bef53a688c7aa7e240e4fd8aa2", - "reference": "d759e5372de414bef53a688c7aa7e240e4fd8aa2", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/552950db2919421ad917e29e76d1999a2a31a8e3", + "reference": "552950db2919421ad917e29e76d1999a2a31a8e3", "shasum": "" }, "require": { @@ -2379,7 +2379,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.2.5" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.2.10" }, "funding": [ { @@ -2395,7 +2395,7 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:38:09+00:00" + "time": "2023-04-18T13:46:08+00:00" } ], "aliases": [], diff --git a/app/vendor/composer/composer/doc/articles/custom-installers.md b/app/vendor/composer/composer/doc/articles/custom-installers.md index 6e2ad8670..28d121297 100644 --- a/app/vendor/composer/composer/doc/articles/custom-installers.md +++ b/app/vendor/composer/composer/doc/articles/custom-installers.md @@ -157,9 +157,8 @@ source for the exact signature): invoked with the update argument. * **uninstall()**, here you can determine the actions that need to be executed when the package needs to be removed. -* **getInstallPath()**, this method should return the location where the - package is to be installed, _relative from the location of composer.json._ - The path _must not end with a slash._ +* **getInstallPath()**, this method should return the absolute path where the + package is to be installed. The path _must not end with a slash._ Example: diff --git a/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php b/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php index a16e6b67b..c7ab9ca1f 100644 --- a/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php +++ b/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php @@ -473,7 +473,7 @@ private function buildExclusionRegex(string $dir, ?array $excluded): ?string /** * @param PackageInterface[] $packages - * @return array + * @return non-empty-array */ public function buildPackageMap(InstallationManager $installationManager, PackageInterface $rootPackage, array $packages) { @@ -485,7 +485,6 @@ public function buildPackageMap(InstallationManager $installationManager, Packag continue; } $this->validatePackage($package); - $packageMap[] = [ $package, $installationManager->getInstallPath($package), @@ -519,7 +518,7 @@ protected function validatePackage(PackageInterface $package) /** * Compiles an ordered list of namespace => path mappings * - * @param array $packageMap array of array(package, installDir-relative-to-composer.json) + * @param non-empty-array $packageMap array of array(package, installDir-relative-to-composer.json or null for metapackages) * @param RootPackageInterface $rootPackage root package instance * @param bool|string[] $filteredDevPackages If an array, the list of packages that must be removed. If bool, whether to filter out require-dev packages * @return array @@ -609,7 +608,7 @@ public function createLoader(array $autoloads, ?string $vendorDir = null) } /** - * @param array $packageMap + * @param array $packageMap * @return ?string */ protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, string $basePath, string $vendorPath, string $vendorPathCode, string $appBaseDirCode) @@ -619,6 +618,11 @@ protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem foreach ($packageMap as $item) { [$package, $installPath] = $item; + // packages that are not installed cannot autoload anything + if (null === $installPath) { + continue; + } + if (null !== $package->getTargetDir() && strlen($package->getTargetDir()) > 0) { $installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir())); } @@ -712,7 +716,7 @@ protected function getPathCode(Filesystem $filesystem, string $basePath, string } /** - * @param array $packageMap + * @param array $packageMap * @param bool|'php-only' $checkPlatform * @param string[] $devPackageNames * @return ?string @@ -1145,7 +1149,7 @@ public static function getInitializer(ClassLoader \$loader) } /** - * @param array $packageMap + * @param array $packageMap * @param string $type one of: 'psr-0'|'psr-4'|'classmap'|'files' * @return array|array>|array */ @@ -1156,6 +1160,11 @@ protected function parseAutoloadsType(array $packageMap, string $type, RootPacka foreach ($packageMap as $item) { [$package, $installPath] = $item; + // packages that are not installed cannot autoload anything + if (null === $installPath) { + continue; + } + $autoload = $package->getAutoload(); if ($this->devMode && $package === $rootPackage) { $autoload = array_merge_recursive($autoload, $package->getDevAutoload()); @@ -1245,10 +1254,8 @@ protected function getFileIdentifier(PackageInterface $package, string $path) /** * Filters out dev-dependencies * - * @param array $packageMap - * @return array - * - * @phpstan-param array $packageMap + * @param array $packageMap + * @return array */ protected function filterPackageMap(array $packageMap, RootPackageInterface $rootPackage) { @@ -1301,8 +1308,8 @@ static function ($item) use ($include): bool { * * Packages of equal weight are sorted alphabetically * - * @param array $packageMap - * @return array + * @param array $packageMap + * @return array */ protected function sortPackageMap(array $packageMap) { diff --git a/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php b/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php index a72151c77..7824d8f7e 100644 --- a/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php +++ b/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php @@ -45,35 +45,34 @@ class ClassLoader /** @var \Closure(string):void */ private static $includeFile; - /** @var ?string */ + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr0 = array(); @@ -81,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array + * @var array */ private $classMap = array(); @@ -90,21 +88,20 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array + * @var array */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { @@ -113,7 +110,7 @@ public function __construct($vendorDir = null) } /** - * @return string[] + * @return array> */ public function getPrefixes() { @@ -125,8 +122,7 @@ public function getPrefixes() } /** - * @return array[] - * @psalm-return array> + * @return array> */ public function getPrefixesPsr4() { @@ -134,8 +130,7 @@ public function getPrefixesPsr4() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirs() { @@ -143,8 +138,7 @@ public function getFallbackDirs() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirsPsr4() { @@ -152,8 +146,7 @@ public function getFallbackDirsPsr4() } /** - * @return string[] Array of classname => path - * @psalm-return array + * @return array Array of classname => path */ public function getClassMap() { @@ -161,8 +154,7 @@ public function getClassMap() } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap + * @param array $classMap Class to filename map * * @return void */ @@ -179,24 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -205,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -226,9 +219,9 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -236,17 +229,18 @@ public function add($prefix, $paths, $prepend = false) */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -256,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -276,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories * * @return void */ @@ -294,8 +288,8 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -481,9 +475,9 @@ public function findFile($class) } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { diff --git a/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php b/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php index 5ac4d6594..e25210075 100644 --- a/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php @@ -69,11 +69,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int } } if (!$input->getOption('no-dev')) { - $requires += $composer->getPackage()->getDevRequires(); - } - - foreach ($requires as $require => $link) { - $requires[$require] = [$link]; + foreach ($composer->getPackage()->getDevRequires() as $require => $link) { + $requires[$require] = [$link]; + } } $installedRepo = new InstalledRepository([$installedRepo, new RootPackageRepository(clone $composer->getPackage())]); diff --git a/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php b/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php index 952baa815..bef163b3d 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php @@ -274,8 +274,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int // show the value if no value is provided if ([] === $input->getArgument('setting-value') && !$input->getOption('unset')) { $properties = self::CONFIGURABLE_PACKAGE_PROPERTIES; + $propertiesDefaults = [ + 'type' => 'library', + 'description' => '', + 'homepage' => '', + 'minimum-stability' => 'stable', + 'prefer-stable' => false, + 'keywords' => [], + 'license' => [], + 'suggest' => [], + 'extra' => [], + ]; $rawData = $this->configFile->read(); $data = $this->config->all(); + $source = $this->config->getSourceOfValue($settingKey); + if (Preg::isMatch('/^repos?(?:itories)?(?:\.(.+))?/', $settingKey, $matches)) { if (!isset($matches[1]) || $matches[1] === '') { $value = $data['repositories'] ?? []; @@ -311,19 +324,33 @@ protected function execute(InputInterface $input, OutputInterface $output): int $value = $data; } elseif (isset($data['config'][$settingKey])) { $value = $this->config->get($settingKey, $input->getOption('absolute') ? 0 : Config::RELATIVE_PATHS); + // ensure we get {} output for properties which are objects + if ($value === []) { + $schema = JsonFile::parseJson((string) file_get_contents(JsonFile::COMPOSER_SCHEMA_PATH)); + if ( + isset($schema['properties']['config']['properties'][$settingKey]['type']) + && in_array('object', (array) $schema['properties']['config']['properties'][$settingKey]['type'], true) + ) { + $value = new \stdClass; + } + } } elseif (isset($rawData[$settingKey]) && in_array($settingKey, $properties, true)) { $value = $rawData[$settingKey]; + $source = $this->configFile->getPath(); + } elseif (isset($propertiesDefaults[$settingKey])) { + $value = $propertiesDefaults[$settingKey]; + $source = 'defaults'; } else { throw new \RuntimeException($settingKey.' is not defined'); } - if (is_array($value)) { + if (is_array($value) || is_object($value) || is_bool($value)) { $value = JsonFile::encode($value, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); } $sourceOfConfigValue = ''; if ($input->getOption('source')) { - $sourceOfConfigValue = ' (' . $this->config->getSourceOfValue($settingKey) . ')'; + $sourceOfConfigValue = ' (' . $source . ')'; } $this->getIO()->write($value . $sourceOfConfigValue, true, IOInterface::QUIET); @@ -413,7 +440,7 @@ static function ($val) { ], 'bin-compat' => [ static function ($val): bool { - return in_array($val, ['auto', 'full', 'symlink']); + return in_array($val, ['auto', 'full', 'proxy', 'symlink']); }, static function ($val) { return $val; diff --git a/app/vendor/composer/composer/src/Composer/Command/PackageDiscoveryTrait.php b/app/vendor/composer/composer/src/Composer/Command/PackageDiscoveryTrait.php index db205a510..1e31abaa3 100644 --- a/app/vendor/composer/composer/src/Composer/Command/PackageDiscoveryTrait.php +++ b/app/vendor/composer/composer/src/Composer/Command/PackageDiscoveryTrait.php @@ -72,7 +72,7 @@ private function getMinimumStability(InputInterface $input): string // @phpstan-ignore-next-line as RequireCommand does not have the option above so this code is reachable there $file = Factory::getComposerFile(); if (is_file($file) && Filesystem::isReadable($file) && is_array($composer = json_decode((string) file_get_contents($file), true))) { - if (!empty($composer['minimum-stability'])) { + if (isset($composer['minimum-stability'])) { return VersionParser::normalizeStability($composer['minimum-stability']); } } diff --git a/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php b/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php index 0ef69066a..90ca115b0 100644 --- a/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php @@ -551,10 +551,15 @@ private function updateRequirementsAfterResolution(array $requirementsToUpdate, if (false === $contents) { throw new \RuntimeException('Unable to read '.$this->json->getPath().' contents to update the lock file hash.'); } - $lock = new JsonFile(Factory::getLockFile($this->json->getPath())); + $lockFile = Factory::getLockFile($this->json->getPath()); + $lockMtime = filemtime($lockFile); + $lock = new JsonFile($lockFile); $lockData = $lock->read(); $lockData['content-hash'] = Locker::getContentHash($contents); $lock->write($lockData); + if (is_int($lockMtime)) { + @touch($lockFile, $lockMtime); + } } } diff --git a/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php b/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php index c9a417669..45db77e52 100644 --- a/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php @@ -369,6 +369,7 @@ protected function fetchKeys(IOInterface $io, Config $config): void $io->write('Open https://composer.github.io/pubkeys.html to find the latest keys'); $validator = static function ($value): string { + $value = (string) $value; if (!Preg::isMatch('{^-----BEGIN PUBLIC KEY-----$}', trim($value))) { throw new \UnexpectedValueException('Invalid input'); } @@ -379,7 +380,7 @@ protected function fetchKeys(IOInterface $io, Config $config): void $devKey = ''; while (!Preg::isMatch('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $devKey, $match)) { $devKey = $io->askAndValidate('Enter Dev / Snapshot Public Key (including lines with -----): ', $validator); - while ($line = $io->ask('')) { + while ($line = $io->ask('', '')) { $devKey .= trim($line)."\n"; if (trim($line) === '-----END PUBLIC KEY-----') { break; @@ -392,7 +393,7 @@ protected function fetchKeys(IOInterface $io, Config $config): void $tagsKey = ''; while (!Preg::isMatch('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $tagsKey, $match)) { $tagsKey = $io->askAndValidate('Enter Tags Public Key (including lines with -----): ', $validator); - while ($line = $io->ask('')) { + while ($line = $io->ask('', '')) { $tagsKey .= trim($line)."\n"; if (trim($line) === '-----END PUBLIC KEY-----') { break; diff --git a/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php b/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php index 5c07b4605..d7bd2c75a 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php @@ -332,7 +332,12 @@ protected function execute(InputInterface $input, OutputInterface $output) } if ($input->getOption('path')) { $io->write($package->getName(), false); - $io->write(' ' . strtok(realpath($composer->getInstallationManager()->getInstallPath($package)), "\r\n")); + $path = $composer->getInstallationManager()->getInstallPath($package); + if (is_string($path)) { + $io->write(' ' . strtok(realpath($path), "\r\n")); + } else { + $io->write(' null'); + } return $exitCode; } @@ -509,7 +514,12 @@ protected function execute(InputInterface $input, OutputInterface $output) $packageViewData['description'] = $package->getDescription(); } if ($writePath) { - $packageViewData['path'] = strtok(realpath($composer->getInstallationManager()->getInstallPath($package)), "\r\n"); + $path = $composer->getInstallationManager()->getInstallPath($package); + if (is_string($path)) { + $packageViewData['path'] = strtok(realpath($path), "\r\n"); + } else { + $packageViewData['path'] = null; + } } $packageIsAbandoned = false; @@ -635,7 +645,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } /** - * @param array $packages + * @param array $packages */ private function printPackages(IOInterface $io, array $packages, string $indent, bool $writeVersion, bool $writeLatest, bool $writeDescription, int $width, int $versionLength, int $nameLength, int $latestLength): void { @@ -669,8 +679,8 @@ private function printPackages(IOInterface $io, array $packages, string $indent, } $io->write(' ' . $description, false); } - if (isset($package['path'])) { - $io->write(' ' . $package['path'], false); + if (array_key_exists('path', $package)) { + $io->write(' '.(is_string($package['path']) ? $package['path'] : 'null'), false); } $io->write(''); if (isset($package['warning'])) { @@ -802,7 +812,12 @@ protected function printMeta(CompletePackageInterface $package, array $versions, $io->write('source : ' . sprintf('[%s] %s %s', $package->getSourceType(), $package->getSourceUrl(), $package->getSourceReference())); $io->write('dist : ' . sprintf('[%s] %s %s', $package->getDistType(), $package->getDistUrl(), $package->getDistReference())); if ($installedRepo->hasPackage($package)) { - $io->write('path : ' . sprintf('%s', realpath($this->requireComposer()->getInstallationManager()->getInstallPath($package)))); + $path = $this->requireComposer()->getInstallationManager()->getInstallPath($package); + if (is_string($path)) { + $io->write('path : ' . realpath($path)); + } else { + $io->write('path : null'); + } } $io->write('names : ' . implode(', ', $package->getNames())); @@ -958,9 +973,14 @@ protected function printPackageInfoAsJson(CompletePackageInterface $package, arr } if ($installedRepo->hasPackage($package)) { - $path = realpath($this->requireComposer()->getInstallationManager()->getInstallPath($package)); - if ($path !== false) { - $json['path'] = $path; + $path = $this->requireComposer()->getInstallationManager()->getInstallPath($package); + if (is_string($path)) { + $path = realpath($path); + if ($path !== false) { + $json['path'] = $path; + } + } else { + $json['path'] = null; } } diff --git a/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php b/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php index 42c20fcef..780f70031 100644 --- a/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php @@ -99,6 +99,9 @@ private function doExecute(InputInterface $input): int foreach ($installedRepo->getCanonicalPackages() as $package) { $downloader = $dm->getDownloaderForPackage($package); $targetDir = $im->getInstallPath($package); + if ($targetDir === null) { + continue; + } if ($downloader instanceof ChangeReportInterface) { if (is_link($targetDir)) { diff --git a/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php b/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php index 92ff158af..a5d1e9c46 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php @@ -112,6 +112,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $localRepo = $composer->getRepositoryManager()->getLocalRepository(); foreach ($localRepo->getPackages() as $package) { $path = $composer->getInstallationManager()->getInstallPath($package); + if (null === $path) { + continue; + } $file = $path . '/composer.json'; if (is_dir($path) && file_exists($file)) { [$errors, $publishErrors, $warnings] = $validator->validate($file, $checkAll, $checkVersion); diff --git a/app/vendor/composer/composer/src/Composer/Composer.php b/app/vendor/composer/composer/src/Composer/Composer.php index 6dd019db4..a6901dced 100644 --- a/app/vendor/composer/composer/src/Composer/Composer.php +++ b/app/vendor/composer/composer/src/Composer/Composer.php @@ -51,9 +51,9 @@ class Composer extends PartialComposer * * @see getVersion() */ - public const VERSION = '2.5.3'; + public const VERSION = '2.5.8'; public const BRANCH_ALIAS_VERSION = ''; - public const RELEASE_DATE = '2023-02-10 13:23:52'; + public const RELEASE_DATE = '2023-06-09 17:13:21'; public const SOURCE_VERSION = ''; /** diff --git a/app/vendor/composer/composer/src/Composer/Console/Application.php b/app/vendor/composer/composer/src/Composer/Console/Application.php index bdd6ef6d3..01a2497b7 100644 --- a/app/vendor/composer/composer/src/Composer/Console/Application.php +++ b/app/vendor/composer/composer/src/Composer/Console/Application.php @@ -339,7 +339,8 @@ function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknow // Check system temp folder for usability as it can cause weird runtime issues otherwise Silencer::call(static function () use ($io): void { - $tempfile = sys_get_temp_dir() . '/temp-' . md5(microtime()); + $pid = function_exists('getmypid') ? getmypid() . '-' : ''; + $tempfile = sys_get_temp_dir() . '/temp-' . $pid . md5(microtime()); if (!(file_put_contents($tempfile, __FILE__) && (file_get_contents($tempfile) === __FILE__) && unlink($tempfile) && !file_exists($tempfile))) { $io->writeError(sprintf('PHP temp directory (%s) does not exist or is not writable to Composer. Set sys_temp_dir in your php.ini', sys_get_temp_dir())); } diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php index 0cb314401..5dfeb18c8 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php @@ -115,6 +115,7 @@ public static function formatDeduplicatedRules(array $rules, string $indent, Rep foreach ($rules as $rule) { $message = $rule->getPrettyString($repositorySet, $request, $pool, $isVerbose, $installedMap, $learnedPool); if (in_array($rule->getReason(), $deduplicatableRuleTypes, true) && Preg::isMatchStrictGroups('{^(?P\S+) (?P\S+) (?Prequires|conflicts)}', $message, $m)) { + $message = str_replace('%', '%%', $message); $template = Preg::replace('{^\S+ \S+ }', '%s%s ', $message); $messages[] = $template; $templates[$template][$m[1]][$parser->normalize($m[2])] = $m[2]; diff --git a/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php index 8d5cbc0f7..300a7e604 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php @@ -132,7 +132,7 @@ public function download(PackageInterface $package, string $path, ?PackageInterf $retries = 3; $distUrls = $package->getDistUrls(); - /** @var non-empty-array $urls */ + /** @var array $urls */ $urls = []; foreach ($distUrls as $index => $url) { $processedUrl = $this->processUrl($package, $url); @@ -146,6 +146,7 @@ public function download(PackageInterface $package, string $path, ?PackageInterf 'cacheKey' => $cacheKeyGenerator($package, $processedUrl), ]; } + assert(count($urls) > 0); $fileName = $this->getFileName($package, $path); $this->filesystem->ensureDirectoryExists($path); diff --git a/app/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php b/app/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php index 95ca80d20..b564cf367 100644 --- a/app/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php +++ b/app/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php @@ -351,6 +351,14 @@ protected function doDispatch(Event $event) if ($matched && !file_exists($match[0])) { $finder = new ExecutableFinder; if ($pathToExec = $finder->find($match[0])) { + if (Platform::isWindows()) { + $execWithoutExt = Preg::replace('{\.(exe|bat|cmd|com)$}i', '', $pathToExec); + // prefer non-extension file if it exists when executing with PHP + if (file_exists($execWithoutExt)) { + $pathToExec = $execWithoutExt; + } + unset($execWithoutExt); + } $pathAndArgs = $pathToExec . substr($pathAndArgs, strlen($match[0])); } } diff --git a/app/vendor/composer/composer/src/Composer/InstalledVersions.php b/app/vendor/composer/composer/src/Composer/InstalledVersions.php index c6b54af7b..51e734a77 100644 --- a/app/vendor/composer/composer/src/Composer/InstalledVersions.php +++ b/app/vendor/composer/composer/src/Composer/InstalledVersions.php @@ -98,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -119,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -328,7 +328,9 @@ private static function getInstalled() if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -340,12 +342,17 @@ private static function getInstalled() // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php index 827c8178c..ba50fe17f 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php @@ -337,8 +337,7 @@ public function url_stat(\$path, \$flags) (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) ) { - include("phpvfscomposer://" . $binPathExported); - exit(0); + return include("phpvfscomposer://" . $binPathExported); } } @@ -360,7 +359,7 @@ public function url_stat(\$path, \$flags) $globalsCode $streamProxyCode -include $binPathExported; +return include $binPathExported; PROXY; } diff --git a/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php b/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php index 0fcd462a1..d171139e9 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php +++ b/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php @@ -549,9 +549,9 @@ public function markAliasUninstalled(InstalledRepositoryInterface $repo, MarkAli /** * Returns the installation path of a package * - * @return string path + * @return string|null absolute path to install to, which does not end with a slash, or null if the package does not have anything installed on disk */ - public function getInstallPath(PackageInterface $package): string + public function getInstallPath(PackageInterface $package): ?string { $installer = $this->getInstaller($package->getType()); diff --git a/app/vendor/composer/composer/src/Composer/Installer/InstallerInterface.php b/app/vendor/composer/composer/src/Composer/Installer/InstallerInterface.php index bfa73e18d..bdf42ec42 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/InstallerInterface.php +++ b/app/vendor/composer/composer/src/Composer/Installer/InstallerInterface.php @@ -112,7 +112,7 @@ public function cleanup(string $type, PackageInterface $package, ?PackageInterfa /** * Returns the absolute installation path of a package. * - * @return string absolute path to install to, which MUST not end with a slash + * @return string|null absolute path to install to, which MUST not end with a slash, or null if the package does not have anything installed on disk */ public function getInstallPath(PackageInterface $package); } diff --git a/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php index 8fa39bf1e..d87c6e3dc 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php @@ -227,6 +227,8 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $ /** * @inheritDoc + * + * @return string */ public function getInstallPath(PackageInterface $package) { diff --git a/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php index 952993e58..f61a537fb 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php @@ -124,9 +124,11 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $ /** * @inheritDoc + * + * @return null */ public function getInstallPath(PackageInterface $package) { - return ''; + return null; } } diff --git a/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php index 68326462e..3a982f13b 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php @@ -50,7 +50,7 @@ public function prepare($type, PackageInterface $package, ?PackageInterface $pre { // fail install process early if it is going to fail due to a plugin not being allowed if (($type === 'install' || $type === 'update') && !$this->getPluginManager()->arePluginsDisabled('local')) { - $this->getPluginManager()->isPluginAllowed($package->getName(), false); + $this->getPluginManager()->isPluginAllowed($package->getName(), false, true === ($package->getExtra()['plugin-optional'] ?? false)); } return parent::prepare($type, $package, $prevPackage); diff --git a/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php index 3ee3aceaf..ccf439bfa 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php @@ -115,7 +115,7 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $ /** * Returns the installation path of a package * - * @return string path + * @return string configured install path */ public function getInstallPath(PackageInterface $package): string { diff --git a/app/vendor/composer/composer/src/Composer/PHPStan/ConfigReturnTypeExtension.php b/app/vendor/composer/composer/src/Composer/PHPStan/ConfigReturnTypeExtension.php index a1e6359bb..46d373509 100644 --- a/app/vendor/composer/composer/src/Composer/PHPStan/ConfigReturnTypeExtension.php +++ b/app/vendor/composer/composer/src/Composer/PHPStan/ConfigReturnTypeExtension.php @@ -39,7 +39,7 @@ final class ConfigReturnTypeExtension implements DynamicMethodReturnTypeExtensio public function __construct() { - $schema = JsonFile::parseJson((string) file_get_contents(__DIR__.'/../../../res/composer-schema.json')); + $schema = JsonFile::parseJson((string) file_get_contents(JsonFile::COMPOSER_SCHEMA_PATH)); /** * @var string $prop */ @@ -69,9 +69,11 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } $keyType = $scope->getType($args[0]->value); - if ($keyType instanceof ConstantStringType) { - if (isset($this->properties[$keyType->getValue()])) { - return $this->properties[$keyType->getValue()]; + if (count($keyType->getConstantStrings()) > 0) { + foreach ($keyType->getConstantStrings() as $constantString) { + if (isset($this->properties[$constantString->getValue()])) { + return $this->properties[$constantString->getValue()]; + } } } diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php index 71f512e5c..f8495e26b 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php @@ -38,7 +38,7 @@ public function archive(string $sources, string $target, string $format, array $ if ($res === true) { $files = new ArchivableFilesFinder($sources, $excludes, $ignoreFilters); foreach ($files as $file) { - /** @var \SplFileInfo $file */ + /** @var \Symfony\Component\Finder\SplFileInfo $file */ $filepath = strtr($file->getPath()."/".$file->getFilename(), '\\', '/'); $localname = $filepath; if (strpos($localname, $sources . '/') === 0) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php b/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php index d33f1bc3f..b3dc113d0 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php +++ b/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php @@ -455,7 +455,7 @@ public function getBranchAlias(array $config): ?string if ( isset($config['default-branch']) && $config['default-branch'] === true - && false === $this->versionParser->parseNumericAliasPrefix($config['version']) + && false === $this->versionParser->parseNumericAliasPrefix(Preg::replace('{^v}', '', $config['version'])) ) { return VersionParser::DEFAULT_BRANCH_ALIAS; } diff --git a/app/vendor/composer/composer/src/Composer/Package/Locker.php b/app/vendor/composer/composer/src/Composer/Package/Locker.php index c58947014..f832e797c 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Locker.php +++ b/app/vendor/composer/composer/src/Composer/Package/Locker.php @@ -18,6 +18,7 @@ use Composer\Repository\InstalledRepository; use Composer\Repository\LockArrayRepository; use Composer\Repository\PlatformRepository; +use Composer\Repository\RootPackageRepository; use Composer\Util\ProcessExecutor; use Composer\Package\Dumper\ArrayDumper; use Composer\Package\Loader\ArrayLoader; @@ -473,7 +474,11 @@ private function getPackageTime(PackageInterface $package): ?string return null; } - $path = realpath($this->installationManager->getInstallPath($package)); + $path = $this->installationManager->getInstallPath($package); + if ($path === null) { + return null; + } + $path = realpath($path); $sourceType = $package->getSourceType(); $datetime = null; @@ -510,9 +515,10 @@ public function getMissingRequirementInfo(RootPackageInterface $package, bool $i if ($includeDev === true) { $sets[] = ['repo' => $this->getLockedRepository(true), 'method' => 'getDevRequires', 'description' => 'Required (in require-dev)']; } + $rootRepo = new RootPackageRepository(clone $package); foreach ($sets as $set) { - $installedRepo = new InstalledRepository([$set['repo']]); + $installedRepo = new InstalledRepository([$set['repo'], $rootRepo]); foreach (call_user_func([$package, $set['method']]) as $link) { if (PlatformRepository::isPlatformPackage($link->getTarget())) { @@ -523,9 +529,21 @@ public function getMissingRequirementInfo(RootPackageInterface $package, bool $i } if ($installedRepo->findPackagesWithReplacersAndProviders($link->getTarget(), $link->getConstraint()) === []) { $results = $installedRepo->findPackagesWithReplacersAndProviders($link->getTarget()); + if ($results !== []) { $provider = reset($results); - $missingRequirementInfo[] = '- ' . $set['description'].' package "' . $link->getTarget() . '" is in the lock file as "'.$provider->getPrettyVersion().'" but that does not satisfy your constraint "'.$link->getPrettyConstraint().'".'; + $description = $provider->getPrettyVersion(); + if ($provider->getName() !== $link->getTarget()) { + foreach (['getReplaces' => 'replaced as %s by %s', 'getProvides' => 'provided as %s by %s'] as $method => $text) { + foreach (call_user_func([$provider, $method]) as $providerLink) { + if ($providerLink->getTarget() === $link->getTarget()) { + $description = sprintf($text, $providerLink->getPrettyConstraint(), $provider->getPrettyName().' '.$provider->getPrettyVersion()); + break 2; + } + } + } + } + $missingRequirementInfo[] = '- ' . $set['description'].' package "' . $link->getTarget() . '" is in the lock file as "'.$description.'" but that does not satisfy your constraint "'.$link->getPrettyConstraint().'".'; } else { $missingRequirementInfo[] = '- ' . $set['description'].' package "' . $link->getTarget() . '" is not present in the lock file.'; } diff --git a/app/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php b/app/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php index d7085c5d5..46116f0b7 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php +++ b/app/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php @@ -76,7 +76,7 @@ public function guessVersion(array $packageConfig, string $path): ?array } $versionData = $this->guessGitVersion($packageConfig, $path); - if (null !== $versionData && null !== $versionData['version']) { + if (null !== $versionData['version']) { return $this->postprocess($versionData); } @@ -86,7 +86,7 @@ public function guessVersion(array $packageConfig, string $path): ?array } $versionData = $this->guessFossilVersion($path); - if (null !== $versionData && null !== $versionData['version']) { + if (null !== $versionData['version']) { return $this->postprocess($versionData); } diff --git a/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php b/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php index 74c33221e..731a5aba0 100644 --- a/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php +++ b/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php @@ -187,7 +187,7 @@ public function registerPackage(PackageInterface $package, bool $failOnMissingCl } } - if (!$this->isPluginAllowed($package->getName(), $isGlobalPlugin, $package->getExtra()['plugin-optional'] ?? false)) { + if (!$this->isPluginAllowed($package->getName(), $isGlobalPlugin, true === ($package->getExtra()['plugin-optional'] ?? false))) { $this->io->writeError('Skipped loading "'.$package->getName() . '" '.($isGlobalPlugin || $this->runningInGlobalDir ? '(installed globally) ' : '').'as it is not in config.allow-plugins', true, IOInterface::DEBUG); return; @@ -236,8 +236,11 @@ public function registerPackage(PackageInterface $package, bool $failOnMissingCl continue; } - $downloadPath = $this->getInstallPath($autoloadPackage, $globalRepo && $globalRepo->hasPackage($autoloadPackage)); - $autoloads[] = [$autoloadPackage, $downloadPath]; + $installPath = $this->getInstallPath($autoloadPackage, $globalRepo && $globalRepo->hasPackage($autoloadPackage)); + if ($installPath === null) { + continue; + } + $autoloads[] = [$autoloadPackage, $installPath]; } $map = $generator->parseAutoloads($autoloads, $rootPackage); @@ -264,7 +267,7 @@ public function registerPackage(PackageInterface $package, bool $failOnMissingCl if ($separatorPos) { $className = substr($class, $separatorPos + 1); } - $code = Preg::replace('{^((?:final\s+)?(?:\s*))class\s+('.preg_quote($className).')}mi', '$1class $2_composer_tmp'.self::$classCounter, $code, 1); + $code = Preg::replace('{^((?:(?:final|readonly)\s+)*(?:\s*))class\s+('.preg_quote($className).')}mi', '$1class $2_composer_tmp'.self::$classCounter, $code, 1); $code = strtr($code, [ '__FILE__' => var_export($path, true), '__DIR__' => var_export(dirname($path), true), @@ -370,7 +373,7 @@ public function addPlugin(PluginInterface $plugin, bool $isGlobalPlugin = false, if ($sourcePackage === null) { trigger_error('Calling PluginManager::addPlugin without $sourcePackage is deprecated, if you are using this please get in touch with us to explain the use case', E_USER_DEPRECATED); - } elseif (!$this->isPluginAllowed($sourcePackage->getName(), $isGlobalPlugin, $sourcePackage->getExtra()['plugin-optional'] ?? false)) { + } elseif (!$this->isPluginAllowed($sourcePackage->getName(), $isGlobalPlugin, true === ($sourcePackage->getExtra()['plugin-optional'] ?? false))) { $this->io->writeError('Skipped loading "'.get_class($plugin).' from '.$sourcePackage->getName() . '" '.($isGlobalPlugin || $this->runningInGlobalDir ? '(installed globally) ' : '').' as it is not in config.allow-plugins', true, IOInterface::DEBUG); return; @@ -524,9 +527,9 @@ private function collectDependencies(InstalledRepository $installedRepo, array $ * * @param bool $global Whether this is a global package * - * @return string Install path + * @return string|null Install path */ - private function getInstallPath(PackageInterface $package, bool $global = false): string + private function getInstallPath(PackageInterface $package, bool $global = false): ?string { if (!$global) { return $this->composer->getInstallationManager()->getInstallPath($package); diff --git a/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php b/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php index 901a5ef16..abe76950d 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php @@ -163,9 +163,13 @@ public function write(bool $devMode, InstallationManager $installationManager) $this->filesystem->filePutContentsIfModified($repoDir.'/installed.php', 'dumpToPhpCode($versions) . ';'."\n"); $installedVersionsClass = file_get_contents(__DIR__.'/../InstalledVersions.php'); - $this->filesystem->filePutContentsIfModified($repoDir.'/InstalledVersions.php', $installedVersionsClass); - \Composer\InstalledVersions::reload($versions); + // this normally should not happen but during upgrades of Composer when it is installed in the project it is a possibility + if ($installedVersionsClass !== false) { + $this->filesystem->filePutContentsIfModified($repoDir.'/InstalledVersions.php', $installedVersionsClass); + + \Composer\InstalledVersions::reload($versions); + } } } diff --git a/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php b/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php index 116f2b2dc..2b98cae94 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php @@ -333,8 +333,10 @@ protected function initialize(): void // Add a separate version for the CLDR library version if ($this->runtime->hasClass('ResourceBundle')) { - $cldrVersion = $this->runtime->invoke(['ResourceBundle', 'create'], ['root', 'ICUDATA', false])->get('Version'); - $this->addLibrary('icu-cldr', $cldrVersion, 'ICU CLDR project version'); + $resourceBundle = $this->runtime->invoke(['ResourceBundle', 'create'], ['root', 'ICUDATA', false]); + if ($resourceBundle !== null) { + $this->addLibrary('icu-cldr', $resourceBundle->get('Version'), 'ICU CLDR project version'); + } } if ($this->runtime->hasClass('IntlChar')) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php index c3b8dd8c4..ff9aecafc 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php @@ -153,6 +153,9 @@ public function getComposerInformation(string $identifier): ?array if ($composer !== null) { // specials for bitbucket + if (isset($composer['support']) && !is_array($composer['support'])) { + $composer['support'] = []; + } if (!isset($composer['support']['source'])) { $label = array_search( $identifier, diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php index 98dbf989a..122b03fa7 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php @@ -174,6 +174,9 @@ public function getComposerInformation(string $identifier): ?array if ($composer !== null) { // specials for github + if (isset($composer['support']) && !is_array($composer['support'])) { + $composer['support'] = []; + } if (!isset($composer['support']['source'])) { $label = array_search($identifier, $this->getTags()) ?: array_search($identifier, $this->getBranches()) ?: $identifier; $composer['support']['source'] = sprintf('https://%s/%s/%s/tree/%s', $this->originUrl, $this->owner, $this->repository, $label); diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php index 77b183e0b..1e13154c5 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php @@ -167,6 +167,9 @@ public function getComposerInformation(string $identifier): ?array if (null !== $composer) { // specials for gitlab (this data is only available if authentication is provided) + if (isset($composer['support']) && !is_array($composer['support'])) { + $composer['support'] = []; + } if (!isset($composer['support']['source']) && isset($this->project['web_url'])) { $label = array_search($identifier, $this->getTags(), true) ?: array_search($identifier, $this->getBranches(), true) ?: $identifier; $composer['support']['source'] = sprintf('%s/-/tree/%s', $this->project['web_url'], $label); diff --git a/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php b/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php index b6145fc48..045fb22a7 100644 --- a/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php +++ b/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php @@ -64,8 +64,8 @@ public function getChannel(): string public function setChannel(string $channel, ?IOInterface $io = null): void { - if (!in_array($channel, self::$channels, true)) { - throw new \InvalidArgumentException('Invalid channel '.$channel.', must be one of: ' . implode(', ', self::$channels)); + if (!in_array($channel, self::CHANNELS, true)) { + throw new \InvalidArgumentException('Invalid channel '.$channel.', must be one of: ' . implode(', ', self::CHANNELS)); } $channelFile = $this->config->get('home').'/update-channel'; diff --git a/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php b/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php index ec3476670..3f0312602 100644 --- a/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php +++ b/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php @@ -28,6 +28,8 @@ class AuthHelper protected $config; /** @var array Map of origins to message displayed */ private $displayedOriginAuthentications = []; + /** @var array Map of URLs and whether they already retried with authentication from Bitbucket */ + private $bitbucketRetry = []; public function __construct(IOInterface $io, Config $config) { @@ -164,6 +166,12 @@ public function promptAuthIfNeeded(string $url, string $origin, int $statusCode, $this->io->setAuthentication($origin, 'x-token-auth', $accessToken); $askForOAuthToken = false; } + } elseif (!isset($this->bitbucketRetry[$url])) { + // when multiple requests fire at the same time, they will all fail and the first one resets the token to be correct above but then the others + // reach the code path and without this fallback they would end up throwing below + // see https://github.com/composer/composer/pull/11464 for more details + $askForOAuthToken = false; + $this->bitbucketRetry[$url] = true; } else { throw new TransportException('Could not authenticate against ' . $origin, 401); } diff --git a/app/vendor/composer/composer/src/Composer/Util/GitHub.php b/app/vendor/composer/composer/src/Composer/Util/GitHub.php index 2ac30e3b8..43a635450 100644 --- a/app/vendor/composer/composer/src/Composer/Util/GitHub.php +++ b/app/vendor/composer/composer/src/Composer/Util/GitHub.php @@ -161,15 +161,15 @@ public function getRateLimit(array $headers): array foreach ($headers as $header) { $header = trim($header); - if (false === strpos($header, 'X-RateLimit-')) { + if (false === stripos($header, 'x-ratelimit-')) { continue; } [$type, $value] = explode(':', $header, 2); - switch ($type) { - case 'X-RateLimit-Limit': + switch (strtolower($type)) { + case 'x-ratelimit-limit': $rateLimit['limit'] = (int) trim($value); break; - case 'X-RateLimit-Reset': + case 'x-ratelimit-reset': $rateLimit['reset'] = date('Y-m-d H:i:s', (int) trim($value)); break; } @@ -206,7 +206,7 @@ public function getSsoUrl(array $headers): ?string public function isRateLimited(array $headers): bool { foreach ($headers as $header) { - if (Preg::isMatch('{^X-RateLimit-Remaining: *0$}i', trim($header))) { + if (Preg::isMatch('{^x-ratelimit-remaining: *0$}i', trim($header))) { return true; } } @@ -224,7 +224,7 @@ public function isRateLimited(array $headers): bool public function requiresSso(array $headers): bool { foreach ($headers as $header) { - if (Preg::isMatch('{^X-GitHub-SSO: required}i', trim($header))) { + if (Preg::isMatch('{^x-github-sso: required}i', trim($header))) { return true; } } diff --git a/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php b/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php index aaba93627..edc668a60 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php @@ -407,7 +407,7 @@ public function tick(): void $result = $this->isAuthenticatedRetryNeeded($job, $response); if ($result['retry']) { - $this->restartJob($job, $job['url'], ['storeAuth' => $result['storeAuth']]); + $this->restartJob($job, $job['url'], ['storeAuth' => $result['storeAuth'], 'retries' => $job['attributes']['retries'] + 1]); continue; } diff --git a/app/vendor/composer/composer/src/Composer/Util/Platform.php b/app/vendor/composer/composer/src/Composer/Util/Platform.php index 2d0c89d88..3c971d105 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Platform.php +++ b/app/vendor/composer/composer/src/Composer/Util/Platform.php @@ -148,7 +148,7 @@ public static function isWindowsSubsystemForLinux(): bool if ( !ini_get('open_basedir') && is_readable('/proc/version') - && false !== stripos(Silencer::call('file_get_contents', '/proc/version'), 'microsoft') + && false !== stripos((string)Silencer::call('file_get_contents', '/proc/version'), 'microsoft') && !file_exists('/.dockerenv') // docker running inside WSL should not be seen as WSL ) { return self::$isWindowsSubsystemForLinux = true; diff --git a/app/vendor/composer/installed.json b/app/vendor/composer/installed.json index 2b5810751..8580ea829 100644 --- a/app/vendor/composer/installed.json +++ b/app/vendor/composer/installed.json @@ -54,17 +54,17 @@ }, { "name": "cakephp/bake", - "version": "2.8.2", - "version_normalized": "2.8.2.0", + "version": "2.9.3", + "version_normalized": "2.9.3.0", "source": { "type": "git", "url": "https://github.com/cakephp/bake.git", - "reference": "ef021497ab517c33ecd97d2184200d8990ffc0ab" + "reference": "a9b02fb6a5f96e8fb9887be55cccea501468907b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/bake/zipball/ef021497ab517c33ecd97d2184200d8990ffc0ab", - "reference": "ef021497ab517c33ecd97d2184200d8990ffc0ab", + "url": "https://api.github.com/repos/cakephp/bake/zipball/a9b02fb6a5f96e8fb9887be55cccea501468907b", + "reference": "a9b02fb6a5f96e8fb9887be55cccea501468907b", "shasum": "" }, "require": { @@ -80,7 +80,7 @@ "cakephp/plugin-installer": "^1.3", "phpunit/phpunit": "^8.5 || ^9.3" }, - "time": "2022-10-05T18:45:20+00:00", + "time": "2023-03-18T19:26:16+00:00", "type": "cakephp-plugin", "installation-source": "dist", "autoload": { @@ -114,17 +114,17 @@ }, { "name": "cakephp/cakephp", - "version": "4.4.11", - "version_normalized": "4.4.11.0", + "version": "4.4.16", + "version_normalized": "4.4.16.0", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp.git", - "reference": "7d9b6a639e5c1f52a813696f6b347726a74f9680" + "reference": "f68c3c6f24d65cb869cceaa8975f2ca2e1d0f5b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp/zipball/7d9b6a639e5c1f52a813696f6b347726a74f9680", - "reference": "7d9b6a639e5c1f52a813696f6b347726a74f9680", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/f68c3c6f24d65cb869cceaa8975f2ca2e1d0f5b7", + "reference": "f68c3c6f24d65cb869cceaa8975f2ca2e1d0f5b7", "shasum": "" }, "require": { @@ -144,6 +144,14 @@ "psr/log": "^1.0 || ^2.0", "psr/simple-cache": "^1.0 || ^2.0" }, + "provide": { + "psr/container-implementation": "^1.0 || ^2.0", + "psr/http-client-implementation": "^1.0", + "psr/http-server-handler-implementation": "^1.0", + "psr/http-server-middleware-implementation": "^1.0", + "psr/log-implementation": "^1.0 || ^2.0", + "psr/simple-cache-implementation": "^1.0 || ^2.0" + }, "replace": { "cakephp/cache": "self.version", "cakephp/collection": "self.version", @@ -170,10 +178,10 @@ "suggest": { "ext-curl": "To enable more efficient network calls in Http\\Client.", "ext-openssl": "To use Security::encrypt() or have secure CSRF token generation.", - "lib-ICU": "The intl PHP library, to use Text::transliterate() or Text::slug()", + "lib-ICU": "To use locale-aware features in the I18n and Database packages", "paragonie/csp-builder": "CSP builder, to use the CSP Middleware" }, - "time": "2023-02-11T01:01:55+00:00", + "time": "2023-08-05T15:33:05+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -221,28 +229,28 @@ }, { "name": "cakephp/cakephp-codesniffer", - "version": "4.6.0", - "version_normalized": "4.6.0.0", + "version": "4.7.0", + "version_normalized": "4.7.0.0", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp-codesniffer.git", - "reference": "5a64e6e6434128f6a1549318de86c564737d5cda" + "reference": "24fa2321d54e5251ac2f59dd92dd2066f0b0bdae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/5a64e6e6434128f6a1549318de86c564737d5cda", - "reference": "5a64e6e6434128f6a1549318de86c564737d5cda", + "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/24fa2321d54e5251ac2f59dd92dd2066f0b0bdae", + "reference": "24fa2321d54e5251ac2f59dd92dd2066f0b0bdae", "shasum": "" }, "require": { "php": ">=7.2.0", - "slevomat/coding-standard": "^6.3.6 || ^7.0 || ^8.0", + "slevomat/coding-standard": "^7.0 || ^8.0", "squizlabs/php_codesniffer": "^3.6" }, "require-dev": { "phpunit/phpunit": "^7.1" }, - "time": "2022-07-04T03:29:58+00:00", + "time": "2023-04-10T06:35:04+00:00", "type": "phpcodesniffer-standard", "installation-source": "dist", "autoload": { @@ -276,17 +284,17 @@ }, { "name": "cakephp/chronos", - "version": "2.3.2", - "version_normalized": "2.3.2.0", + "version": "2.4.0", + "version_normalized": "2.4.0.0", "source": { "type": "git", "url": "https://github.com/cakephp/chronos.git", - "reference": "a21b7b633f483c4cf525d200219d200f551ee38b" + "reference": "9c7e438cba4eed1796ec19ad3874defa9eb9aeac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/a21b7b633f483c4cf525d200219d200f551ee38b", - "reference": "a21b7b633f483c4cf525d200219d200f551ee38b", + "url": "https://api.github.com/repos/cakephp/chronos/zipball/9c7e438cba4eed1796ec19ad3874defa9eb9aeac", + "reference": "9c7e438cba4eed1796ec19ad3874defa9eb9aeac", "shasum": "" }, "require": { @@ -296,7 +304,7 @@ "cakephp/cakephp-codesniffer": "^4.5", "phpunit/phpunit": "^8.0 || ^9.0" }, - "time": "2022-11-08T02:17:04+00:00", + "time": "2023-08-06T22:54:27+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -337,17 +345,17 @@ }, { "name": "cakephp/debug_kit", - "version": "4.9.3", - "version_normalized": "4.9.3.0", + "version": "4.9.4", + "version_normalized": "4.9.4.0", "source": { "type": "git", "url": "https://github.com/cakephp/debug_kit.git", - "reference": "db848e787bf53483069cba2feb449c2e8523f525" + "reference": "663491edec4a6b9111f1cf4733ebd471450df71e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/db848e787bf53483069cba2feb449c2e8523f525", - "reference": "db848e787bf53483069cba2feb449c2e8523f525", + "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/663491edec4a6b9111f1cf4733ebd471450df71e", + "reference": "663491edec4a6b9111f1cf4733ebd471450df71e", "shasum": "" }, "require": { @@ -365,7 +373,7 @@ "suggest": { "ext-pdo_sqlite": "DebugKit needs to store panel data in a database. SQLite is simple and easy to use." }, - "time": "2023-01-25T04:49:08+00:00", + "time": "2023-07-05T16:04:04+00:00", "type": "cakephp-plugin", "installation-source": "dist", "autoload": { @@ -397,7 +405,7 @@ "kit" ], "support": { - "forum": "http://stackoverflow.com/tags/cakephp", + "forum": "https://stackoverflow.com/tags/cakephp", "irc": "irc://irc.freenode.org/cakephp", "issues": "https://github.com/cakephp/debug_kit/issues", "source": "https://github.com/cakephp/debug_kit" @@ -406,17 +414,17 @@ }, { "name": "cakephp/migrations", - "version": "3.7.2", - "version_normalized": "3.7.2.0", + "version": "3.8.2", + "version_normalized": "3.8.2.0", "source": { "type": "git", "url": "https://github.com/cakephp/migrations.git", - "reference": "97dfc6bdd0ac62f628ce51429a8737e1e5e86684" + "reference": "1c7c060f8d91d62b0716f9b08e3d41bfece5386e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/migrations/zipball/97dfc6bdd0ac62f628ce51429a8737e1e5e86684", - "reference": "97dfc6bdd0ac62f628ce51429a8737e1e5e86684", + "url": "https://api.github.com/repos/cakephp/migrations/zipball/1c7c060f8d91d62b0716f9b08e3d41bfece5386e", + "reference": "1c7c060f8d91d62b0716f9b08e3d41bfece5386e", "shasum": "" }, "require": { @@ -435,7 +443,7 @@ "cakephp/bake": "If you want to generate migrations.", "dereuromark/cakephp-ide-helper": "If you want to have IDE suggest/autocomplete when creating migrations." }, - "time": "2023-01-12T15:41:05+00:00", + "time": "2023-06-12T01:40:01+00:00", "type": "cakephp-plugin", "installation-source": "dist", "autoload": { @@ -587,17 +595,17 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.5", - "version_normalized": "1.3.5.0", + "version": "1.3.6", + "version_normalized": "1.3.6.0", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd" + "reference": "90d087e988ff194065333d16bc5cf649872d9cdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/74780ccf8c19d6acb8d65c5f39cd72110e132bbd", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/90d087e988ff194065333d16bc5cf649872d9cdb", + "reference": "90d087e988ff194065333d16bc5cf649872d9cdb", "shasum": "" }, "require": { @@ -611,7 +619,7 @@ "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" }, - "time": "2023-01-11T08:27:00+00:00", + "time": "2023-06-06T12:02:59+00:00", "type": "library", "extra": { "branch-alias": { @@ -646,7 +654,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.5" + "source": "https://github.com/composer/ca-bundle/tree/1.3.6" }, "funding": [ { @@ -666,23 +674,23 @@ }, { "name": "composer/class-map-generator", - "version": "1.0.0", - "version_normalized": "1.0.0.0", + "version": "1.1.0", + "version_normalized": "1.1.0.0", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513" + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/1e1cb2b791facb2dfe32932a7718cf2571187513", - "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9", + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9", "shasum": "" }, "require": { - "composer/pcre": "^2 || ^3", + "composer/pcre": "^2.1 || ^3.1", "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6" + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" }, "require-dev": { "phpstan/phpstan": "^1.6", @@ -692,7 +700,7 @@ "symfony/filesystem": "^5.4 || ^6", "symfony/phpunit-bridge": "^5" }, - "time": "2022-06-19T11:31:27+00:00", + "time": "2023-06-30T13:58:57+00:00", "type": "library", "extra": { "branch-alias": { @@ -722,7 +730,7 @@ ], "support": { "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.0.0" + "source": "https://github.com/composer/class-map-generator/tree/1.1.0" }, "funding": [ { @@ -742,17 +750,17 @@ }, { "name": "composer/composer", - "version": "2.5.3", - "version_normalized": "2.5.3.0", + "version": "2.5.8", + "version_normalized": "2.5.8.0", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "607a4c04006ce1d2b6fdfd5467bae3d7ad9ce5ab" + "reference": "4c516146167d1392c8b9b269bb7c24115d262164" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/607a4c04006ce1d2b6fdfd5467bae3d7ad9ce5ab", - "reference": "607a4c04006ce1d2b6fdfd5467bae3d7ad9ce5ab", + "url": "https://api.github.com/repos/composer/composer/zipball/4c516146167d1392c8b9b269bb7c24115d262164", + "reference": "4c516146167d1392c8b9b269bb7c24115d262164", "shasum": "" }, "require": { @@ -791,7 +799,7 @@ "ext-zip": "Enabling the zip extension allows you to unzip archives", "ext-zlib": "Allow gzip compression of HTTP requests" }, - "time": "2023-02-10T12:23:52+00:00", + "time": "2023-06-09T15:13:21+00:00", "bin": [ "bin/composer" ], @@ -838,7 +846,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.5.3" + "source": "https://github.com/composer/composer/tree/2.5.8" }, "funding": [ { @@ -1417,17 +1425,17 @@ }, { "name": "doctrine/dbal", - "version": "3.6.0", - "version_normalized": "3.6.0.0", + "version": "3.6.6", + "version_normalized": "3.6.6.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "85b98cb23c8af471a67abfe14485da696bcabc2e" + "reference": "63646ffd71d1676d2f747f871be31b7e921c7864" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/85b98cb23c8af471a67abfe14485da696bcabc2e", - "reference": "85b98cb23c8af471a67abfe14485da696bcabc2e", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/63646ffd71d1676d2f747f871be31b7e921c7864", + "reference": "63646ffd71d1676d2f747f871be31b7e921c7864", "shasum": "" }, "require": { @@ -1440,14 +1448,15 @@ "psr/log": "^1|^2|^3" }, "require-dev": { - "doctrine/coding-standard": "11.1.0", + "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", - "jetbrains/phpstorm-stubs": "2022.3", - "phpstan/phpstan": "1.9.14", - "phpstan/phpstan-strict-rules": "^1.4", - "phpunit/phpunit": "9.6.3", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.29", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.9", "psalm/plugin-phpunit": "0.18.4", - "squizlabs/php_codesniffer": "3.7.1", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.7.2", "symfony/cache": "^5.4|^6.0", "symfony/console": "^4.4|^5.4|^6.0", "vimeo/psalm": "4.30.0" @@ -1455,7 +1464,7 @@ "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." }, - "time": "2023-02-07T22:52:03+00:00", + "time": "2023-08-17T05:38:17+00:00", "bin": [ "bin/doctrine-dbal" ], @@ -1512,7 +1521,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.6.0" + "source": "https://github.com/doctrine/dbal/tree/3.6.6" }, "funding": [ { @@ -1532,31 +1541,35 @@ }, { "name": "doctrine/deprecations", - "version": "v1.0.0", - "version_normalized": "1.0.0.0", + "version": "v1.1.1", + "version_normalized": "1.1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" }, - "time": "2022-05-02T15:47:09+00:00", + "time": "2023-06-03T09:27:29+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1572,7 +1585,7 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" }, "install-path": "../doctrine/deprecations" }, @@ -2002,23 +2015,23 @@ }, { "name": "laminas/laminas-diactoros", - "version": "2.24.0", - "version_normalized": "2.24.0.0", + "version": "2.25.2", + "version_normalized": "2.25.2.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "6028af6c3b5ced4d063a680d2483cce67578b902" + "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/6028af6c3b5ced4d063a680d2483cce67578b902", - "reference": "6028af6c3b5ced4d063a680d2483cce67578b902", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", + "reference": "9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e", "shasum": "" }, "require": { "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1" }, "conflict": { "zendframework/zend-diactoros": "*" @@ -2033,13 +2046,13 @@ "ext-gd": "*", "ext-libxml": "*", "http-interop/http-factory-tests": "^0.9.0", - "laminas/laminas-coding-standard": "^2.4.0", + "laminas/laminas-coding-standard": "^2.5", "php-http/psr7-integration-tests": "^1.2", - "phpunit/phpunit": "^9.5.27", + "phpunit/phpunit": "^9.5.28", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.4" + "vimeo/psalm": "^5.6" }, - "time": "2022-12-20T12:22:40+00:00", + "time": "2023-04-17T15:44:17+00:00", "type": "library", "extra": { "laminas": { @@ -2102,33 +2115,33 @@ }, { "name": "laminas/laminas-httphandlerrunner", - "version": "2.5.0", - "version_normalized": "2.5.0.0", + "version": "2.7.0", + "version_normalized": "2.7.0.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-httphandlerrunner.git", - "reference": "7a47834aaad7852816d2ec4fdbb0492163b039ae" + "reference": "ab1fe48f1c367953d7e8f5cfbaf902672551d524" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/7a47834aaad7852816d2ec4fdbb0492163b039ae", - "reference": "7a47834aaad7852816d2ec4fdbb0492163b039ae", + "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/ab1fe48f1c367953d7e8f5cfbaf902672551d524", + "reference": "ab1fe48f1c367953d7e8f5cfbaf902672551d524", "shasum": "" }, "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", - "psr/http-message": "^1.0", - "psr/http-message-implementation": "^1.0", + "php": "~8.1.0 || ~8.2.0", + "psr/http-message": "^1.0 || ^2.0", + "psr/http-message-implementation": "^1.0 || ^2.0", "psr/http-server-handler": "^1.0" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.4.0", - "laminas/laminas-diactoros": "^2.18", - "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^5.0.0" + "laminas/laminas-coding-standard": "~2.5.0", + "laminas/laminas-diactoros": "^3.0.0", + "phpunit/phpunit": "^10.1.2", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.11" }, - "time": "2023-01-05T21:54:03+00:00", + "time": "2023-07-25T20:20:46+00:00", "type": "library", "extra": { "laminas": { @@ -2381,17 +2394,17 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.0", - "version_normalized": "1.11.0.0", + "version": "1.11.1", + "version_normalized": "1.11.1.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -2406,7 +2419,7 @@ "doctrine/common": "^2.13.3 || ^3.2.2", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, - "time": "2022-03-03T13:19:32+00:00", + "time": "2023-03-08T13:26:56+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2431,7 +2444,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -2443,17 +2456,17 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.3", - "version_normalized": "4.15.3.0", + "version": "v4.17.1", + "version_normalized": "4.17.1.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "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/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -2464,7 +2477,7 @@ "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, - "time": "2023-01-16T22:05:37+00:00", + "time": "2023-08-13T19:53:39+00:00", "bin": [ "bin/php-parse" ], @@ -2496,7 +2509,7 @@ ], "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.17.1" }, "install-path": "../nikic/php-parser" }, @@ -2619,23 +2632,25 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.15.3", - "version_normalized": "1.15.3.0", + "version": "1.23.1", + "version_normalized": "1.23.1.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "61800f71a5526081d1b5633766aa88341f1ade76" + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/61800f71a5526081d1b5633766aa88341f1ade76", - "reference": "61800f71a5526081d1b5633766aa88341f1ade76", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26", + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26", "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", @@ -2644,7 +2659,7 @@ "phpunit/phpunit": "^9.5", "symfony/process": "^5.2" }, - "time": "2022-12-20T20:56:55+00:00", + "time": "2023-08-03T16:32:59+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2661,30 +2676,30 @@ "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.15.3" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1" }, "install-path": "../phpstan/phpdoc-parser" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.24", - "version_normalized": "9.2.24.0", + "version": "9.2.27", + "version_normalized": "9.2.27.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -2699,10 +2714,10 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, - "time": "2023-01-26T08:26:55+00:00", + "time": "2023-07-26T13:44:30+00:00", "type": "library", "extra": { "branch-alias": { @@ -2735,7 +2750,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27" }, "funding": [ { @@ -3000,17 +3016,17 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.3", - "version_normalized": "9.6.3.0", + "version": "9.6.10", + "version_normalized": "9.6.10.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555" + "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e7b1615e3e887d6c719121c6d4a44b0ab9645555", - "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a6d351645c3fe5a30f5e86be6577d946af65a328", + "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328", "shasum": "" }, "require": { @@ -3043,10 +3059,10 @@ "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, - "time": "2023-02-04T13:37:15+00:00", + "time": "2023-07-10T04:04:23+00:00", "bin": [ "phpunit" ], @@ -3085,7 +3101,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.3" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.10" }, "funding": [ { @@ -3213,24 +3230,24 @@ }, { "name": "psr/http-client", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", "shasum": "" }, "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2020-06-29T06:28:15+00:00", + "time": "2023-04-10T20:12:12+00:00", "type": "library", "extra": { "branch-alias": { @@ -3250,7 +3267,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -3262,30 +3279,30 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/master" + "source": "https://github.com/php-fig/http-client/tree/1.0.2" }, "install-path": "../psr/http-client" }, { "name": "psr/http-factory", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "e616d01114759c4c489f93b099585439f795fe35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", "shasum": "" }, "require": { "php": ">=7.0.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2019-04-30T12:38:16+00:00", + "time": "2023-04-10T20:10:41+00:00", "type": "library", "extra": { "branch-alias": { @@ -3305,7 +3322,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for PSR-7 HTTP message factories", @@ -3320,33 +3337,33 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" }, "install-path": "../psr/http-factory" }, { "name": "psr/http-message", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.1", + "version_normalized": "1.1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, - "time": "2016-08-06T14:39:51+00:00", + "time": "2023-04-04T09:50:52+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "installation-source": "dist", @@ -3376,30 +3393,30 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, "install-path": "../psr/http-message" }, { "name": "psr/http-server-handler", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" + "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4", + "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4", "shasum": "" }, "require": { "php": ">=7.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2018-10-30T16:46:14+00:00", + "time": "2023-04-10T20:06:20+00:00", "type": "library", "extra": { "branch-alias": { @@ -3419,7 +3436,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP server-side request handler", @@ -3435,32 +3452,31 @@ "server" ], "support": { - "issues": "https://github.com/php-fig/http-server-handler/issues", - "source": "https://github.com/php-fig/http-server-handler/tree/master" + "source": "https://github.com/php-fig/http-server-handler/tree/1.0.2" }, "install-path": "../psr/http-server-handler" }, { "name": "psr/http-server-middleware", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5" + "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829", + "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829", "shasum": "" }, "require": { "php": ">=7.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "psr/http-server-handler": "^1.0" }, - "time": "2018-10-30T17:12:04+00:00", + "time": "2023-04-11T06:14:47+00:00", "type": "library", "extra": { "branch-alias": { @@ -3480,7 +3496,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP server-side middleware", @@ -3496,7 +3512,7 @@ ], "support": { "issues": "https://github.com/php-fig/http-server-middleware/issues", - "source": "https://github.com/php-fig/http-server-middleware/tree/master" + "source": "https://github.com/php-fig/http-server-middleware/tree/1.0.2" }, "install-path": "../psr/http-server-middleware" }, @@ -3609,17 +3625,17 @@ }, { "name": "psy/psysh", - "version": "v0.11.12", - "version_normalized": "0.11.12.0", + "version": "v0.11.20", + "version_normalized": "0.11.20.0", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "52cb7c47d403c31c0adc9bf7710fc355f93c20f7" + "reference": "0fa27040553d1d280a67a4393194df5228afea5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/52cb7c47d403c31c0adc9bf7710fc355f93c20f7", - "reference": "52cb7c47d403c31c0adc9bf7710fc355f93c20f7", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/0fa27040553d1d280a67a4393194df5228afea5b", + "reference": "0fa27040553d1d280a67a4393194df5228afea5b", "shasum": "" }, "require": { @@ -3642,7 +3658,7 @@ "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history." }, - "time": "2023-01-29T21:24:40+00:00", + "time": "2023-07-31T14:32:22+00:00", "bin": [ "bin/psysh" ], @@ -3682,32 +3698,32 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.12" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.20" }, "install-path": "../psy/psysh" }, { "name": "react/promise", - "version": "v2.9.0", - "version_normalized": "2.9.0.0", + "version": "v2.10.0", + "version_normalized": "2.10.0.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", + "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", "shasum": "" }, "require": { "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36" }, - "time": "2022-02-11T10:27:51+00:00", + "time": "2023-05-02T15:15:43+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3751,16 +3767,12 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" + "source": "https://github.com/reactphp/promise/tree/v2.10.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], "install-path": "../react/promise" @@ -4169,17 +4181,17 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", - "version_normalized": "4.0.4.0", + "version": "4.0.5", + "version_normalized": "4.0.5.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { @@ -4189,7 +4201,7 @@ "phpunit/phpunit": "^9.3", "symfony/process": "^4.2 || ^5" }, - "time": "2020-10-26T13:10:38+00:00", + "time": "2023-05-07T05:35:17+00:00", "type": "library", "extra": { "branch-alias": { @@ -4226,7 +4238,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -4384,17 +4396,17 @@ }, { "name": "sebastian/global-state", - "version": "5.0.5", - "version_normalized": "5.0.5.0", + "version": "5.0.6", + "version_normalized": "5.0.6.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bde739e7565280bda77be70044ac1047bc007e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", "shasum": "" }, "require": { @@ -4409,7 +4421,7 @@ "suggest": { "ext-uopz": "*" }, - "time": "2022-02-14T08:28:10+00:00", + "time": "2023-08-02T09:26:13+00:00", "type": "library", "extra": { "branch-alias": { @@ -4439,7 +4451,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" }, "funding": [ { @@ -4868,17 +4880,17 @@ }, { "name": "seld/jsonlint", - "version": "1.9.0", - "version_normalized": "1.9.0.0", + "version": "1.10.0", + "version_normalized": "1.10.0.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "4211420d25eba80712bff236a98960ef68b866b7" + "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7", - "reference": "4211420d25eba80712bff236a98960ef68b866b7", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/594fd6462aad8ecee0b45ca5045acea4776667f1", + "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1", "shasum": "" }, "require": { @@ -4888,7 +4900,7 @@ "phpstan/phpstan": "^1.5", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, - "time": "2022-04-01T13:37:23+00:00", + "time": "2023-05-11T13:16:46+00:00", "bin": [ "bin/jsonlint" ], @@ -4919,7 +4931,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0" + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0" }, "funding": [ { @@ -5050,35 +5062,35 @@ }, { "name": "slevomat/coding-standard", - "version": "8.8.0", - "version_normalized": "8.8.0.0", + "version": "8.13.4", + "version_normalized": "8.13.4.0", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "59e25146a4ef0a7b194c5bc55b32dd414345db89" + "reference": "4b2af2fb17773656d02fbfb5d18024ebd19fe322" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/59e25146a4ef0a7b194c5bc55b32dd414345db89", - "reference": "59e25146a4ef0a7b194c5bc55b32dd414345db89", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/4b2af2fb17773656d02fbfb5d18024ebd19fe322", + "reference": "4b2af2fb17773656d02fbfb5d18024ebd19fe322", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": ">=1.15.2 <1.16.0", + "phpstan/phpdoc-parser": "^1.23.0", "squizlabs/php_codesniffer": "^3.7.1" }, "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.9.6", - "phpstan/phpstan-deprecation-rules": "1.1.1", - "phpstan/phpstan-phpunit": "1.0.0|1.3.3", - "phpstan/phpstan-strict-rules": "1.4.4", - "phpunit/phpunit": "7.5.20|8.5.21|9.5.27" + "phpstan/phpstan": "1.10.26", + "phpstan/phpstan-deprecation-rules": "1.1.3", + "phpstan/phpstan-phpunit": "1.3.13", + "phpstan/phpstan-strict-rules": "1.5.1", + "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.2.6" }, - "time": "2023-01-09T10:46:13+00:00", + "time": "2023-07-25T10:28:55+00:00", "type": "phpcodesniffer-standard", "extra": { "branch-alias": { @@ -5088,7 +5100,7 @@ "installation-source": "dist", "autoload": { "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard" + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" } }, "notification-url": "https://packagist.org/downloads/", @@ -5102,7 +5114,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.8.0" + "source": "https://github.com/slevomat/coding-standard/tree/8.13.4" }, "funding": [ { @@ -5118,17 +5130,17 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", - "version_normalized": "3.7.1.0", + "version": "3.7.2", + "version_normalized": "3.7.2.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -5140,7 +5152,7 @@ "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, - "time": "2022-06-18T07:21:10+00:00", + "time": "2023-02-22T23:07:41+00:00", "bin": [ "bin/phpcs", "bin/phpcbf" @@ -5166,7 +5178,8 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", @@ -5177,39 +5190,37 @@ }, { "name": "symfony/config", - "version": "v6.2.5", - "version_normalized": "6.2.5.0", + "version": "v6.3.2", + "version_normalized": "6.3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "f31b3c78a3650157188a240695e688d6a182aa91" + "reference": "b47ca238b03e7b0d7880ffd1cf06e8d637ca1467" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/f31b3c78a3650157188a240695e688d6a182aa91", - "reference": "f31b3c78a3650157188a240695e688d6a182aa91", + "url": "https://api.github.com/repos/symfony/config/zipball/b47ca238b03e7b0d7880ffd1cf06e8d637ca1467", + "reference": "b47ca238b03e7b0d7880ffd1cf06e8d637ca1467", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/filesystem": "^5.4|^6.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<5.4" + "symfony/finder": "<5.4", + "symfony/service-contracts": "<2.5" }, "require-dev": { "symfony/event-dispatcher": "^5.4|^6.0", "symfony/finder": "^5.4|^6.0", "symfony/messenger": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/yaml": "^5.4|^6.0" }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "time": "2023-01-09T04:38:22+00:00", + "time": "2023-07-19T20:22:16+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5237,7 +5248,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.2.5" + "source": "https://github.com/symfony/config/tree/v6.3.2" }, "funding": [ { @@ -5257,24 +5268,24 @@ }, { "name": "symfony/console", - "version": "v6.2.5", - "version_normalized": "6.2.5.0", + "version": "v6.3.2", + "version_normalized": "6.3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3e294254f2191762c1d137aed4b94e966965e985" + "reference": "aa5d64ad3f63f2e48964fc81ee45cb318a723898" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3e294254f2191762c1d137aed4b94e966965e985", - "reference": "3e294254f2191762c1d137aed4b94e966965e985", + "url": "https://api.github.com/repos/symfony/console/zipball/aa5d64ad3f63f2e48964fc81ee45cb318a723898", + "reference": "aa5d64ad3f63f2e48964fc81ee45cb318a723898", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/string": "^5.4|^6.0" }, "conflict": { @@ -5296,13 +5307,7 @@ "symfony/process": "^5.4|^6.0", "symfony/var-dumper": "^5.4|^6.0" }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "time": "2023-01-01T08:38:09+00:00", + "time": "2023-07-19T20:17:28+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5331,12 +5336,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.5" + "source": "https://github.com/symfony/console/tree/v6.3.2" }, "funding": [ { @@ -5356,27 +5361,27 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.0", - "version_normalized": "3.2.0.0", + "version": "v3.3.0", + "version_normalized": "3.3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "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/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { "php": ">=8.1" }, - "time": "2022-11-25T10:21:52+00:00", + "time": "2023-05-23T14:45:45+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -5406,7 +5411,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.3.0" }, "funding": [ { @@ -5426,17 +5431,17 @@ }, { "name": "symfony/filesystem", - "version": "v6.2.5", - "version_normalized": "6.2.5.0", + "version": "v6.3.1", + "version_normalized": "6.3.1.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "e59e8a4006afd7f5654786a83b4fcb8da98f4593" + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e59e8a4006afd7f5654786a83b4fcb8da98f4593", - "reference": "e59e8a4006afd7f5654786a83b4fcb8da98f4593", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", "shasum": "" }, "require": { @@ -5444,7 +5449,7 @@ "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, - "time": "2023-01-20T17:45:48+00:00", + "time": "2023-06-01T08:30:39+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5472,7 +5477,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.2.5" + "source": "https://github.com/symfony/filesystem/tree/v6.3.1" }, "funding": [ { @@ -5492,17 +5497,17 @@ }, { "name": "symfony/finder", - "version": "v6.2.5", - "version_normalized": "6.2.5.0", + "version": "v6.3.3", + "version_normalized": "6.3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c90dc446976a612e3312a97a6ec0069ab0c2099c" + "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c90dc446976a612e3312a97a6ec0069ab0c2099c", - "reference": "c90dc446976a612e3312a97a6ec0069ab0c2099c", + "url": "https://api.github.com/repos/symfony/finder/zipball/9915db259f67d21eefee768c1abcf1cc61b1fc9e", + "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e", "shasum": "" }, "require": { @@ -5511,7 +5516,7 @@ "require-dev": { "symfony/filesystem": "^6.0" }, - "time": "2023-01-20T17:45:48+00:00", + "time": "2023-07-31T08:31:44+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5539,7 +5544,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.5" + "source": "https://github.com/symfony/finder/tree/v6.3.3" }, "funding": [ { @@ -6151,23 +6156,23 @@ }, { "name": "symfony/process", - "version": "v6.2.5", - "version_normalized": "6.2.5.0", + "version": "v6.3.2", + "version_normalized": "6.3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9ead139f63dfa38c4e4a9049cc64a8b2748c83b7" + "reference": "c5ce962db0d9b6e80247ca5eb9af6472bd4d7b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9ead139f63dfa38c4e4a9049cc64a8b2748c83b7", - "reference": "9ead139f63dfa38c4e4a9049cc64a8b2748c83b7", + "url": "https://api.github.com/repos/symfony/process/zipball/c5ce962db0d9b6e80247ca5eb9af6472bd4d7b5d", + "reference": "c5ce962db0d9b6e80247ca5eb9af6472bd4d7b5d", "shasum": "" }, "require": { "php": ">=8.1" }, - "time": "2023-01-01T08:38:09+00:00", + "time": "2023-07-12T16:00:22+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6195,7 +6200,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.2.5" + "source": "https://github.com/symfony/process/tree/v6.3.2" }, "funding": [ { @@ -6215,17 +6220,17 @@ }, { "name": "symfony/service-contracts", - "version": "v3.2.0", - "version_normalized": "3.2.0.0", + "version": "v3.3.0", + "version_normalized": "3.3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75" + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" }, "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/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", "shasum": "" }, "require": { @@ -6235,14 +6240,11 @@ "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, - "time": "2022-11-25T10:21:52+00:00", + "time": "2023-05-23T14:45:45+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -6283,7 +6285,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" }, "funding": [ { @@ -6303,17 +6305,17 @@ }, { "name": "symfony/string", - "version": "v6.2.5", - "version_normalized": "6.2.5.0", + "version": "v6.3.2", + "version_normalized": "6.3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0" + "reference": "53d1a83225002635bca3482fcbf963001313fb68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0", - "reference": "b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0", + "url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68", + "reference": "53d1a83225002635bca3482fcbf963001313fb68", "shasum": "" }, "require": { @@ -6324,16 +6326,16 @@ "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", + "symfony/translation-contracts": "^2.5|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, - "time": "2023-01-01T08:38:09+00:00", + "time": "2023-07-05T08:41:27+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6372,7 +6374,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.5" + "source": "https://github.com/symfony/string/tree/v6.3.2" }, "funding": [ { @@ -6392,40 +6394,36 @@ }, { "name": "symfony/var-dumper", - "version": "v6.2.5", - "version_normalized": "6.2.5.0", + "version": "v6.3.3", + "version_normalized": "6.3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "44b7b81749fd20c1bdf4946c041050e22bc8da27" + "reference": "77fb4f2927f6991a9843633925d111147449ee7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/44b7b81749fd20c1bdf4946c041050e22bc8da27", - "reference": "44b7b81749fd20c1bdf4946c041050e22bc8da27", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/77fb4f2927f6991a9843633925d111147449ee7a", + "reference": "77fb4f2927f6991a9843633925d111147449ee7a", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "phpunit/phpunit": "<5.4.3", "symfony/console": "<5.4" }, "require-dev": { "ext-iconv": "*", "symfony/console": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", "symfony/process": "^5.4|^6.0", "symfony/uid": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" - }, - "time": "2023-01-20T17:45:48+00:00", + "time": "2023-07-31T07:08:24+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -6463,7 +6461,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.2.5" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.3" }, "funding": [ { @@ -6536,17 +6534,17 @@ }, { "name": "twig/markdown-extra", - "version": "v3.5.1", - "version_normalized": "3.5.1.0", + "version": "v3.7.0", + "version_normalized": "3.7.0.0", "source": { "type": "git", "url": "https://github.com/twigphp/markdown-extra.git", - "reference": "9474c89fd2787187a3809e5e964dfce2395ae5f0" + "reference": "8f1179e279cea6ef14066a4560b859df58acd5d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/9474c89fd2787187a3809e5e964dfce2395ae5f0", - "reference": "9474c89fd2787187a3809e5e964dfce2395ae5f0", + "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/8f1179e279cea6ef14066a4560b859df58acd5d8", + "reference": "8f1179e279cea6ef14066a4560b859df58acd5d8", "shasum": "" }, "require": { @@ -6560,13 +6558,8 @@ "michelf/php-markdown": "^1.8|^2.0", "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, - "time": "2023-02-08T07:44:55+00:00", + "time": "2023-02-09T06:45:16+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -6596,7 +6589,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/markdown-extra/tree/v3.5.1" + "source": "https://github.com/twigphp/markdown-extra/tree/v3.7.0" }, "funding": [ { @@ -6612,17 +6605,17 @@ }, { "name": "twig/twig", - "version": "v3.5.1", - "version_normalized": "3.5.1.0", + "version": "v3.7.0", + "version_normalized": "3.7.0.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15" + "reference": "5cf942bbab3df42afa918caeba947f1b690af64b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/a6e0510cc793912b451fd40ab983a1d28f611c15", - "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/5cf942bbab3df42afa918caeba947f1b690af64b", + "reference": "5cf942bbab3df42afa918caeba947f1b690af64b", "shasum": "" }, "require": { @@ -6631,16 +6624,11 @@ "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { - "psr/container": "^1.0", + "psr/container": "^1.0|^2.0", "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, - "time": "2023-02-08T07:49:20+00:00", + "time": "2023-07-26T07:16:09+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -6675,7 +6663,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.5.1" + "source": "https://github.com/twigphp/Twig/tree/v3.7.0" }, "funding": [ { diff --git a/app/vendor/composer/installed.php b/app/vendor/composer/installed.php index 2a4deab5d..62b582b46 100644 --- a/app/vendor/composer/installed.php +++ b/app/vendor/composer/installed.php @@ -1,418 +1,418 @@ array( + 'name' => 'cakephp/app', 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', + 'reference' => '4750ebccfb6fc99ad3da777bba6f47509014a3d4', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '9aa6e82a4ab97a12f0c4f5c36bce3f62d6771ae3', - 'name' => 'cakephp/app', 'dev' => true, ), 'versions' => array( 'brick/varexporter' => array( 'pretty_version' => '0.3.8', 'version' => '0.3.8.0', + 'reference' => 'b5853edea6204ff8fa10633c3a4cccc4058410ed', 'type' => 'library', 'install_path' => __DIR__ . '/../brick/varexporter', 'aliases' => array(), - 'reference' => 'b5853edea6204ff8fa10633c3a4cccc4058410ed', 'dev_requirement' => true, ), 'cakephp/app' => array( 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', + 'reference' => '4750ebccfb6fc99ad3da777bba6f47509014a3d4', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '9aa6e82a4ab97a12f0c4f5c36bce3f62d6771ae3', 'dev_requirement' => false, ), 'cakephp/bake' => array( - 'pretty_version' => '2.8.2', - 'version' => '2.8.2.0', + 'pretty_version' => '2.9.3', + 'version' => '2.9.3.0', + 'reference' => 'a9b02fb6a5f96e8fb9887be55cccea501468907b', 'type' => 'cakephp-plugin', 'install_path' => __DIR__ . '/../cakephp/bake', 'aliases' => array(), - 'reference' => 'ef021497ab517c33ecd97d2184200d8990ffc0ab', 'dev_requirement' => true, ), 'cakephp/cache' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/cakephp' => array( - 'pretty_version' => '4.4.11', - 'version' => '4.4.11.0', + 'pretty_version' => '4.4.16', + 'version' => '4.4.16.0', + 'reference' => 'f68c3c6f24d65cb869cceaa8975f2ca2e1d0f5b7', 'type' => 'library', 'install_path' => __DIR__ . '/../cakephp/cakephp', 'aliases' => array(), - 'reference' => '7d9b6a639e5c1f52a813696f6b347726a74f9680', 'dev_requirement' => false, ), 'cakephp/cakephp-codesniffer' => array( - 'pretty_version' => '4.6.0', - 'version' => '4.6.0.0', + 'pretty_version' => '4.7.0', + 'version' => '4.7.0.0', + 'reference' => '24fa2321d54e5251ac2f59dd92dd2066f0b0bdae', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../cakephp/cakephp-codesniffer', 'aliases' => array(), - 'reference' => '5a64e6e6434128f6a1549318de86c564737d5cda', 'dev_requirement' => true, ), 'cakephp/chronos' => array( - 'pretty_version' => '2.3.2', - 'version' => '2.3.2.0', + 'pretty_version' => '2.4.0', + 'version' => '2.4.0.0', + 'reference' => '9c7e438cba4eed1796ec19ad3874defa9eb9aeac', 'type' => 'library', 'install_path' => __DIR__ . '/../cakephp/chronos', 'aliases' => array(), - 'reference' => 'a21b7b633f483c4cf525d200219d200f551ee38b', 'dev_requirement' => false, ), 'cakephp/collection' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/console' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/core' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/database' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/datasource' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/debug_kit' => array( - 'pretty_version' => '4.9.3', - 'version' => '4.9.3.0', + 'pretty_version' => '4.9.4', + 'version' => '4.9.4.0', + 'reference' => '663491edec4a6b9111f1cf4733ebd471450df71e', 'type' => 'cakephp-plugin', 'install_path' => __DIR__ . '/../cakephp/debug_kit', 'aliases' => array(), - 'reference' => 'db848e787bf53483069cba2feb449c2e8523f525', 'dev_requirement' => true, ), 'cakephp/event' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/filesystem' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/form' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/http' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/i18n' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/log' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/migrations' => array( - 'pretty_version' => '3.7.2', - 'version' => '3.7.2.0', + 'pretty_version' => '3.8.2', + 'version' => '3.8.2.0', + 'reference' => '1c7c060f8d91d62b0716f9b08e3d41bfece5386e', 'type' => 'cakephp-plugin', 'install_path' => __DIR__ . '/../cakephp/migrations', 'aliases' => array(), - 'reference' => '97dfc6bdd0ac62f628ce51429a8737e1e5e86684', 'dev_requirement' => false, ), 'cakephp/orm' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/plugin-installer' => array( 'pretty_version' => '1.3.1', 'version' => '1.3.1.0', + 'reference' => 'e27027aa2d3d8ab64452c6817629558685a064cb', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../cakephp/plugin-installer', 'aliases' => array(), - 'reference' => 'e27027aa2d3d8ab64452c6817629558685a064cb', 'dev_requirement' => false, ), 'cakephp/twig-view' => array( 'pretty_version' => '1.3.0', 'version' => '1.3.0.0', + 'reference' => '14df50360b809a171d0688020fbdfe513763f89b', 'type' => 'cakephp-plugin', 'install_path' => __DIR__ . '/../cakephp/twig-view', 'aliases' => array(), - 'reference' => '14df50360b809a171d0688020fbdfe513763f89b', 'dev_requirement' => true, ), 'cakephp/utility' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'cakephp/validation' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.4.11', + 0 => '4.4.16', ), ), 'composer/ca-bundle' => array( - 'pretty_version' => '1.3.5', - 'version' => '1.3.5.0', + 'pretty_version' => '1.3.6', + 'version' => '1.3.6.0', + 'reference' => '90d087e988ff194065333d16bc5cf649872d9cdb', 'type' => 'library', 'install_path' => __DIR__ . '/./ca-bundle', 'aliases' => array(), - 'reference' => '74780ccf8c19d6acb8d65c5f39cd72110e132bbd', 'dev_requirement' => false, ), 'composer/class-map-generator' => array( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'reference' => '953cc4ea32e0c31f2185549c7d216d7921f03da9', 'type' => 'library', 'install_path' => __DIR__ . '/./class-map-generator', 'aliases' => array(), - 'reference' => '1e1cb2b791facb2dfe32932a7718cf2571187513', 'dev_requirement' => true, ), 'composer/composer' => array( - 'pretty_version' => '2.5.3', - 'version' => '2.5.3.0', + 'pretty_version' => '2.5.8', + 'version' => '2.5.8.0', + 'reference' => '4c516146167d1392c8b9b269bb7c24115d262164', 'type' => 'library', 'install_path' => __DIR__ . '/./composer', 'aliases' => array(), - 'reference' => '607a4c04006ce1d2b6fdfd5467bae3d7ad9ce5ab', 'dev_requirement' => true, ), 'composer/metadata-minifier' => array( 'pretty_version' => '1.0.0', 'version' => '1.0.0.0', + 'reference' => 'c549d23829536f0d0e984aaabbf02af91f443207', 'type' => 'library', 'install_path' => __DIR__ . '/./metadata-minifier', 'aliases' => array(), - 'reference' => 'c549d23829536f0d0e984aaabbf02af91f443207', 'dev_requirement' => true, ), 'composer/pcre' => array( 'pretty_version' => '3.1.0', 'version' => '3.1.0.0', + 'reference' => '4bff79ddd77851fe3cdd11616ed3f92841ba5bd2', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), - 'reference' => '4bff79ddd77851fe3cdd11616ed3f92841ba5bd2', 'dev_requirement' => true, ), 'composer/semver' => array( 'pretty_version' => '3.3.2', 'version' => '3.3.2.0', + 'reference' => '3953f23262f2bff1919fc82183ad9acb13ff62c9', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), - 'reference' => '3953f23262f2bff1919fc82183ad9acb13ff62c9', 'dev_requirement' => true, ), 'composer/spdx-licenses' => array( 'pretty_version' => '1.5.7', 'version' => '1.5.7.0', + 'reference' => 'c848241796da2abf65837d51dce1fae55a960149', 'type' => 'library', 'install_path' => __DIR__ . '/./spdx-licenses', 'aliases' => array(), - 'reference' => 'c848241796da2abf65837d51dce1fae55a960149', 'dev_requirement' => true, ), 'composer/xdebug-handler' => array( 'pretty_version' => '3.0.3', 'version' => '3.0.3.0', + 'reference' => 'ced299686f41dce890debac69273b47ffe98a40c', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), - 'reference' => 'ced299686f41dce890debac69273b47ffe98a40c', 'dev_requirement' => true, ), 'dealerdirect/phpcodesniffer-composer-installer' => array( 'pretty_version' => 'v1.0.0', 'version' => '1.0.0.0', + 'reference' => '4be43904336affa5c2f70744a348312336afd0da', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../dealerdirect/phpcodesniffer-composer-installer', 'aliases' => array(), - 'reference' => '4be43904336affa5c2f70744a348312336afd0da', 'dev_requirement' => true, ), 'doctrine/cache' => array( 'pretty_version' => '2.2.0', 'version' => '2.2.0.0', + 'reference' => '1ca8f21980e770095a31456042471a57bc4c68fb', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/cache', 'aliases' => array(), - 'reference' => '1ca8f21980e770095a31456042471a57bc4c68fb', 'dev_requirement' => false, ), 'doctrine/dbal' => array( - 'pretty_version' => '3.6.0', - 'version' => '3.6.0.0', + 'pretty_version' => '3.6.6', + 'version' => '3.6.6.0', + 'reference' => '63646ffd71d1676d2f747f871be31b7e921c7864', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/dbal', 'aliases' => array(), - 'reference' => '85b98cb23c8af471a67abfe14485da696bcabc2e', 'dev_requirement' => false, ), 'doctrine/deprecations' => array( - 'pretty_version' => 'v1.0.0', - 'version' => '1.0.0.0', + 'pretty_version' => 'v1.1.1', + 'version' => '1.1.1.0', + 'reference' => '612a3ee5ab0d5dd97b7cf3874a6efe24325efac3', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/deprecations', 'aliases' => array(), - 'reference' => '0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de', 'dev_requirement' => false, ), 'doctrine/event-manager' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', + 'reference' => '750671534e0241a7c50ea5b43f67e23eb5c96f32', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/event-manager', 'aliases' => array(), - 'reference' => '750671534e0241a7c50ea5b43f67e23eb5c96f32', 'dev_requirement' => false, ), 'doctrine/instantiator' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', + 'reference' => 'c6222283fa3f4ac679f8b9ced9a4e23f163e80d0', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/instantiator', 'aliases' => array(), - 'reference' => 'c6222283fa3f4ac679f8b9ced9a4e23f163e80d0', 'dev_requirement' => true, ), 'jasny/twig-extensions' => array( 'pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', + 'reference' => 'a694eb02f6fc14ff8e2fceb8b80882c0c926102b', 'type' => 'library', 'install_path' => __DIR__ . '/../jasny/twig-extensions', 'aliases' => array(), - 'reference' => 'a694eb02f6fc14ff8e2fceb8b80882c0c926102b', 'dev_requirement' => true, ), 'jdorn/sql-formatter' => array( 'pretty_version' => 'v1.2.17', 'version' => '1.2.17.0', + 'reference' => '64990d96e0959dff8e059dfcdc1af130728d92bc', 'type' => 'library', 'install_path' => __DIR__ . '/../jdorn/sql-formatter', 'aliases' => array(), - 'reference' => '64990d96e0959dff8e059dfcdc1af130728d92bc', 'dev_requirement' => true, ), 'josegonzalez/dotenv' => array( 'pretty_version' => '3.2.0', 'version' => '3.2.0.0', + 'reference' => 'f19174d9d7213a6c20e8e5e268aa7dd042d821ca', 'type' => 'library', 'install_path' => __DIR__ . '/../josegonzalez/dotenv', 'aliases' => array(), - 'reference' => 'f19174d9d7213a6c20e8e5e268aa7dd042d821ca', 'dev_requirement' => true, ), 'justinrainbow/json-schema' => array( 'pretty_version' => '5.2.12', 'version' => '5.2.12.0', + 'reference' => 'ad87d5a5ca981228e0e205c2bc7dfb8e24559b60', 'type' => 'library', 'install_path' => __DIR__ . '/../justinrainbow/json-schema', 'aliases' => array(), - 'reference' => 'ad87d5a5ca981228e0e205c2bc7dfb8e24559b60', 'dev_requirement' => true, ), 'laminas/laminas-diactoros' => array( - 'pretty_version' => '2.24.0', - 'version' => '2.24.0.0', + 'pretty_version' => '2.25.2', + 'version' => '2.25.2.0', + 'reference' => '9f3f4bf5b99c9538b6f1dbcc20f6fec357914f9e', 'type' => 'library', 'install_path' => __DIR__ . '/../laminas/laminas-diactoros', 'aliases' => array(), - 'reference' => '6028af6c3b5ced4d063a680d2483cce67578b902', 'dev_requirement' => false, ), 'laminas/laminas-httphandlerrunner' => array( - 'pretty_version' => '2.5.0', - 'version' => '2.5.0.0', + 'pretty_version' => '2.7.0', + 'version' => '2.7.0.0', + 'reference' => 'ab1fe48f1c367953d7e8f5cfbaf902672551d524', 'type' => 'library', 'install_path' => __DIR__ . '/../laminas/laminas-httphandlerrunner', 'aliases' => array(), - 'reference' => '7a47834aaad7852816d2ec4fdbb0492163b039ae', 'dev_requirement' => false, ), 'league/container' => array( 'pretty_version' => '4.2.0', 'version' => '4.2.0.0', + 'reference' => '375d13cb828649599ef5d48a339c4af7a26cd0ab', 'type' => 'library', 'install_path' => __DIR__ . '/../league/container', 'aliases' => array(), - 'reference' => '375d13cb828649599ef5d48a339c4af7a26cd0ab', 'dev_requirement' => false, ), 'm1/env' => array( 'pretty_version' => '2.2.0', 'version' => '2.2.0.0', + 'reference' => '5c296e3e13450a207e12b343f3af1d7ab569f6f3', 'type' => 'library', 'install_path' => __DIR__ . '/../m1/env', 'aliases' => array(), - 'reference' => '5c296e3e13450a207e12b343f3af1d7ab569f6f3', 'dev_requirement' => true, ), 'mobiledetect/mobiledetectlib' => array( 'pretty_version' => '2.8.41', 'version' => '2.8.41.0', + 'reference' => 'fc9cccd4d3706d5a7537b562b59cc18f9e4c0cb1', 'type' => 'library', 'install_path' => __DIR__ . '/../mobiledetect/mobiledetectlib', 'aliases' => array(), - 'reference' => 'fc9cccd4d3706d5a7537b562b59cc18f9e4c0cb1', 'dev_requirement' => false, ), 'myclabs/deep-copy' => array( - 'pretty_version' => '1.11.0', - 'version' => '1.11.0.0', + 'pretty_version' => '1.11.1', + 'version' => '1.11.1.0', + 'reference' => '7284c22080590fb39f2ffa3e9057f10a4ddd0e0c', 'type' => 'library', 'install_path' => __DIR__ . '/../myclabs/deep-copy', 'aliases' => array(), - 'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614', 'dev_requirement' => true, ), 'nikic/php-parser' => array( - 'pretty_version' => 'v4.15.3', - 'version' => '4.15.3.0', + 'pretty_version' => 'v4.17.1', + 'version' => '4.17.1.0', + 'reference' => 'a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), - 'reference' => '570e980a201d8ed0236b0a62ddf2c9cbb2034039', 'dev_requirement' => true, ), 'orno/di' => array( @@ -424,124 +424,131 @@ 'phar-io/manifest' => array( 'pretty_version' => '2.0.3', 'version' => '2.0.3.0', + 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', 'type' => 'library', 'install_path' => __DIR__ . '/../phar-io/manifest', 'aliases' => array(), - 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', 'dev_requirement' => true, ), 'phar-io/version' => array( 'pretty_version' => '3.2.1', 'version' => '3.2.1.0', + 'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74', 'type' => 'library', 'install_path' => __DIR__ . '/../phar-io/version', 'aliases' => array(), - 'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74', 'dev_requirement' => true, ), 'phpstan/phpdoc-parser' => array( - 'pretty_version' => '1.15.3', - 'version' => '1.15.3.0', + 'pretty_version' => '1.23.1', + 'version' => '1.23.1.0', + 'reference' => '846ae76eef31c6d7790fac9bc399ecee45160b26', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), - 'reference' => '61800f71a5526081d1b5633766aa88341f1ade76', 'dev_requirement' => true, ), 'phpunit/php-code-coverage' => array( - 'pretty_version' => '9.2.24', - 'version' => '9.2.24.0', + 'pretty_version' => '9.2.27', + 'version' => '9.2.27.0', + 'reference' => 'b0a88255cb70d52653d80c890bd7f38740ea50d1', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-code-coverage', 'aliases' => array(), - 'reference' => '2cf940ebc6355a9d430462811b5aaa308b174bed', 'dev_requirement' => true, ), 'phpunit/php-file-iterator' => array( 'pretty_version' => '3.0.6', 'version' => '3.0.6.0', + 'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-file-iterator', 'aliases' => array(), - 'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf', 'dev_requirement' => true, ), 'phpunit/php-invoker' => array( 'pretty_version' => '3.1.1', 'version' => '3.1.1.0', + 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-invoker', 'aliases' => array(), - 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', 'dev_requirement' => true, ), 'phpunit/php-text-template' => array( 'pretty_version' => '2.0.4', 'version' => '2.0.4.0', + 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-text-template', 'aliases' => array(), - 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', 'dev_requirement' => true, ), 'phpunit/php-timer' => array( 'pretty_version' => '5.0.3', 'version' => '5.0.3.0', + 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-timer', 'aliases' => array(), - 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', 'dev_requirement' => true, ), 'phpunit/phpunit' => array( - 'pretty_version' => '9.6.3', - 'version' => '9.6.3.0', + 'pretty_version' => '9.6.10', + 'version' => '9.6.10.0', + 'reference' => 'a6d351645c3fe5a30f5e86be6577d946af65a328', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/phpunit', 'aliases' => array(), - 'reference' => 'e7b1615e3e887d6c719121c6d4a44b0ab9645555', 'dev_requirement' => true, ), 'psr/cache' => array( 'pretty_version' => '3.0.0', 'version' => '3.0.0.0', + 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/cache', 'aliases' => array(), - 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'dev_requirement' => false, ), 'psr/container' => array( 'pretty_version' => '2.0.2', 'version' => '2.0.2.0', + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), - 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'dev_requirement' => false, ), 'psr/container-implementation' => array( 'dev_requirement' => false, 'provided' => array( 0 => '^1.0', + 1 => '^1.0 || ^2.0', ), ), 'psr/http-client' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), - 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', 'dev_requirement' => false, ), + 'psr/http-client-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '^1.0', + ), + ), 'psr/http-factory' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), - 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', 'dev_requirement' => false, ), 'psr/http-factory-implementation' => array( @@ -551,12 +558,12 @@ ), ), 'psr/http-message' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.1', + 'version' => '1.1.0.0', + 'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', 'dev_requirement' => false, ), 'psr/http-message-implementation' => array( @@ -566,432 +573,451 @@ ), ), 'psr/http-server-handler' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => '84c4fb66179be4caaf8e97bd239203245302e7d4', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-server-handler', 'aliases' => array(), - 'reference' => 'aff2f80e33b7f026ec96bb42f63242dc50ffcae7', 'dev_requirement' => false, ), + 'psr/http-server-handler-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '^1.0', + ), + ), 'psr/http-server-middleware' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => 'c1481f747daaa6a0782775cd6a8c26a1bf4a3829', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-server-middleware', 'aliases' => array(), - 'reference' => '2296f45510945530b9dceb8bcedb5cb84d40c5f5', 'dev_requirement' => false, ), + 'psr/http-server-middleware-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '^1.0', + ), + ), 'psr/log' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', + 'reference' => 'ef29f6d262798707a9edd554e2b82517ef3a9376', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), - 'reference' => 'ef29f6d262798707a9edd554e2b82517ef3a9376', 'dev_requirement' => false, ), 'psr/log-implementation' => array( 'dev_requirement' => false, 'provided' => array( 0 => '1.0|2.0|3.0', + 1 => '^1.0 || ^2.0', ), ), 'psr/simple-cache' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', + 'reference' => '8707bf3cea6f710bf6ef05491234e3ab06f6432a', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), - 'reference' => '8707bf3cea6f710bf6ef05491234e3ab06f6432a', 'dev_requirement' => false, ), + 'psr/simple-cache-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '^1.0 || ^2.0', + ), + ), 'psy/psysh' => array( - 'pretty_version' => 'v0.11.12', - 'version' => '0.11.12.0', + 'pretty_version' => 'v0.11.20', + 'version' => '0.11.20.0', + 'reference' => '0fa27040553d1d280a67a4393194df5228afea5b', 'type' => 'library', 'install_path' => __DIR__ . '/../psy/psysh', 'aliases' => array(), - 'reference' => '52cb7c47d403c31c0adc9bf7710fc355f93c20f7', 'dev_requirement' => true, ), 'react/promise' => array( - 'pretty_version' => 'v2.9.0', - 'version' => '2.9.0.0', + 'pretty_version' => 'v2.10.0', + 'version' => '2.10.0.0', + 'reference' => 'f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), - 'reference' => '234f8fd1023c9158e2314fa9d7d0e6a83db42910', 'dev_requirement' => true, ), 'robmorgan/phinx' => array( 'pretty_version' => '0.13.4', 'version' => '0.13.4.0', + 'reference' => '18e06e4a2b18947663438afd2f467e17c62e867d', 'type' => 'library', 'install_path' => __DIR__ . '/../robmorgan/phinx', 'aliases' => array(), - 'reference' => '18e06e4a2b18947663438afd2f467e17c62e867d', 'dev_requirement' => false, ), 'sebastian/cli-parser' => array( 'pretty_version' => '1.0.1', 'version' => '1.0.1.0', + 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/cli-parser', 'aliases' => array(), - 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', 'dev_requirement' => true, ), 'sebastian/code-unit' => array( 'pretty_version' => '1.0.8', 'version' => '1.0.8.0', + 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/code-unit', 'aliases' => array(), - 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', 'dev_requirement' => true, ), 'sebastian/code-unit-reverse-lookup' => array( 'pretty_version' => '2.0.3', 'version' => '2.0.3.0', + 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup', 'aliases' => array(), - 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', 'dev_requirement' => true, ), 'sebastian/comparator' => array( 'pretty_version' => '4.0.8', 'version' => '4.0.8.0', + 'reference' => 'fa0f136dd2334583309d32b62544682ee972b51a', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/comparator', 'aliases' => array(), - 'reference' => 'fa0f136dd2334583309d32b62544682ee972b51a', 'dev_requirement' => true, ), 'sebastian/complexity' => array( 'pretty_version' => '2.0.2', 'version' => '2.0.2.0', + 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/complexity', 'aliases' => array(), - 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', 'dev_requirement' => true, ), 'sebastian/diff' => array( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', + 'pretty_version' => '4.0.5', + 'version' => '4.0.5.0', + 'reference' => '74be17022044ebaaecfdf0c5cd504fc9cd5a7131', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), - 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', 'dev_requirement' => true, ), 'sebastian/environment' => array( 'pretty_version' => '5.1.5', 'version' => '5.1.5.0', + 'reference' => '830c43a844f1f8d5b7a1f6d6076b784454d8b7ed', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/environment', 'aliases' => array(), - 'reference' => '830c43a844f1f8d5b7a1f6d6076b784454d8b7ed', 'dev_requirement' => true, ), 'sebastian/exporter' => array( 'pretty_version' => '4.0.5', 'version' => '4.0.5.0', + 'reference' => 'ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/exporter', 'aliases' => array(), - 'reference' => 'ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d', 'dev_requirement' => true, ), 'sebastian/global-state' => array( - 'pretty_version' => '5.0.5', - 'version' => '5.0.5.0', + 'pretty_version' => '5.0.6', + 'version' => '5.0.6.0', + 'reference' => 'bde739e7565280bda77be70044ac1047bc007e34', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/global-state', 'aliases' => array(), - 'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2', 'dev_requirement' => true, ), 'sebastian/lines-of-code' => array( 'pretty_version' => '1.0.3', 'version' => '1.0.3.0', + 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/lines-of-code', 'aliases' => array(), - 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', 'dev_requirement' => true, ), 'sebastian/object-enumerator' => array( 'pretty_version' => '4.0.4', 'version' => '4.0.4.0', + 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/object-enumerator', 'aliases' => array(), - 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', 'dev_requirement' => true, ), 'sebastian/object-reflector' => array( 'pretty_version' => '2.0.4', 'version' => '2.0.4.0', + 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/object-reflector', 'aliases' => array(), - 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', 'dev_requirement' => true, ), 'sebastian/recursion-context' => array( 'pretty_version' => '4.0.5', 'version' => '4.0.5.0', + 'reference' => 'e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/recursion-context', 'aliases' => array(), - 'reference' => 'e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1', 'dev_requirement' => true, ), 'sebastian/resource-operations' => array( 'pretty_version' => '3.0.3', 'version' => '3.0.3.0', + 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/resource-operations', 'aliases' => array(), - 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', 'dev_requirement' => true, ), 'sebastian/type' => array( 'pretty_version' => '3.2.1', 'version' => '3.2.1.0', + 'reference' => '75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/type', 'aliases' => array(), - 'reference' => '75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7', 'dev_requirement' => true, ), 'sebastian/version' => array( 'pretty_version' => '3.0.2', 'version' => '3.0.2.0', + 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/version', 'aliases' => array(), - 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', 'dev_requirement' => true, ), 'seld/jsonlint' => array( - 'pretty_version' => '1.9.0', - 'version' => '1.9.0.0', + 'pretty_version' => '1.10.0', + 'version' => '1.10.0.0', + 'reference' => '594fd6462aad8ecee0b45ca5045acea4776667f1', 'type' => 'library', 'install_path' => __DIR__ . '/../seld/jsonlint', 'aliases' => array(), - 'reference' => '4211420d25eba80712bff236a98960ef68b866b7', 'dev_requirement' => true, ), 'seld/phar-utils' => array( 'pretty_version' => '1.2.1', 'version' => '1.2.1.0', + 'reference' => 'ea2f4014f163c1be4c601b9b7bd6af81ba8d701c', 'type' => 'library', 'install_path' => __DIR__ . '/../seld/phar-utils', 'aliases' => array(), - 'reference' => 'ea2f4014f163c1be4c601b9b7bd6af81ba8d701c', 'dev_requirement' => true, ), 'seld/signal-handler' => array( 'pretty_version' => '2.0.1', 'version' => '2.0.1.0', + 'reference' => 'f69d119511dc0360440cdbdaa71829c149b7be75', 'type' => 'library', 'install_path' => __DIR__ . '/../seld/signal-handler', 'aliases' => array(), - 'reference' => 'f69d119511dc0360440cdbdaa71829c149b7be75', 'dev_requirement' => true, ), 'slevomat/coding-standard' => array( - 'pretty_version' => '8.8.0', - 'version' => '8.8.0.0', + 'pretty_version' => '8.13.4', + 'version' => '8.13.4.0', + 'reference' => '4b2af2fb17773656d02fbfb5d18024ebd19fe322', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../slevomat/coding-standard', 'aliases' => array(), - 'reference' => '59e25146a4ef0a7b194c5bc55b32dd414345db89', 'dev_requirement' => true, ), 'squizlabs/php_codesniffer' => array( - 'pretty_version' => '3.7.1', - 'version' => '3.7.1.0', + 'pretty_version' => '3.7.2', + 'version' => '3.7.2.0', + 'reference' => 'ed8e00df0a83aa96acf703f8c2979ff33341f879', 'type' => 'library', 'install_path' => __DIR__ . '/../squizlabs/php_codesniffer', 'aliases' => array(), - 'reference' => '1359e176e9307e906dc3d890bcc9603ff6d90619', 'dev_requirement' => true, ), 'symfony/config' => array( - 'pretty_version' => 'v6.2.5', - 'version' => '6.2.5.0', + 'pretty_version' => 'v6.3.2', + 'version' => '6.3.2.0', + 'reference' => 'b47ca238b03e7b0d7880ffd1cf06e8d637ca1467', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), - 'reference' => 'f31b3c78a3650157188a240695e688d6a182aa91', 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v6.2.5', - 'version' => '6.2.5.0', + 'pretty_version' => 'v6.3.2', + 'version' => '6.3.2.0', + 'reference' => 'aa5d64ad3f63f2e48964fc81ee45cb318a723898', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), - 'reference' => '3e294254f2191762c1d137aed4b94e966965e985', 'dev_requirement' => false, ), 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.2.0', - 'version' => '3.2.0.0', + 'pretty_version' => 'v3.3.0', + 'version' => '3.3.0.0', + 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), - 'reference' => '1ee04c65529dea5d8744774d474e7cbd2f1206d3', 'dev_requirement' => false, ), 'symfony/filesystem' => array( - 'pretty_version' => 'v6.2.5', - 'version' => '6.2.5.0', + 'pretty_version' => 'v6.3.1', + 'version' => '6.3.1.0', + 'reference' => 'edd36776956f2a6fcf577edb5b05eb0e3bdc52ae', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), - 'reference' => 'e59e8a4006afd7f5654786a83b4fcb8da98f4593', 'dev_requirement' => false, ), 'symfony/finder' => array( - 'pretty_version' => 'v6.2.5', - 'version' => '6.2.5.0', + 'pretty_version' => 'v6.3.3', + 'version' => '6.3.3.0', + 'reference' => '9915db259f67d21eefee768c1abcf1cc61b1fc9e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), - 'reference' => 'c90dc446976a612e3312a97a6ec0069ab0c2099c', 'dev_requirement' => true, ), 'symfony/polyfill-ctype' => array( 'pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', + 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), - 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', 'dev_requirement' => false, ), 'symfony/polyfill-intl-grapheme' => array( 'pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', + 'reference' => '511a08c03c1960e08a883f4cffcacd219b758354', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', 'aliases' => array(), - 'reference' => '511a08c03c1960e08a883f4cffcacd219b758354', 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( 'pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', + 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), - 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( 'pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', + 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), - 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', 'dev_requirement' => false, ), 'symfony/polyfill-php73' => array( 'pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', + 'reference' => '9e8ecb5f92152187c4799efd3c96b78ccab18ff9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php73', 'aliases' => array(), - 'reference' => '9e8ecb5f92152187c4799efd3c96b78ccab18ff9', 'dev_requirement' => true, ), 'symfony/polyfill-php80' => array( 'pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', + 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', 'dev_requirement' => true, ), 'symfony/polyfill-php81' => array( 'pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', + 'reference' => '707403074c8ea6e2edaf8794b0157a0bfa52157a', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php81', 'aliases' => array(), - 'reference' => '707403074c8ea6e2edaf8794b0157a0bfa52157a', 'dev_requirement' => true, ), 'symfony/process' => array( - 'pretty_version' => 'v6.2.5', - 'version' => '6.2.5.0', + 'pretty_version' => 'v6.3.2', + 'version' => '6.3.2.0', + 'reference' => 'c5ce962db0d9b6e80247ca5eb9af6472bd4d7b5d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), - 'reference' => '9ead139f63dfa38c4e4a9049cc64a8b2748c83b7', 'dev_requirement' => true, ), 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.2.0', - 'version' => '3.2.0.0', + 'pretty_version' => 'v3.3.0', + 'version' => '3.3.0.0', + 'reference' => '40da9cc13ec349d9e4966ce18b5fbcd724ab10a4', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), - 'reference' => 'aac98028c69df04ee77eb69b96b86ee51fbf4b75', 'dev_requirement' => false, ), 'symfony/string' => array( - 'pretty_version' => 'v6.2.5', - 'version' => '6.2.5.0', + 'pretty_version' => 'v6.3.2', + 'version' => '6.3.2.0', + 'reference' => '53d1a83225002635bca3482fcbf963001313fb68', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), - 'reference' => 'b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0', 'dev_requirement' => false, ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v6.2.5', - 'version' => '6.2.5.0', + 'pretty_version' => 'v6.3.3', + 'version' => '6.3.3.0', + 'reference' => '77fb4f2927f6991a9843633925d111147449ee7a', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), - 'reference' => '44b7b81749fd20c1bdf4946c041050e22bc8da27', 'dev_requirement' => true, ), 'theseer/tokenizer' => array( 'pretty_version' => '1.2.1', 'version' => '1.2.1.0', + 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', 'type' => 'library', 'install_path' => __DIR__ . '/../theseer/tokenizer', 'aliases' => array(), - 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', 'dev_requirement' => true, ), 'twig/markdown-extra' => array( - 'pretty_version' => 'v3.5.1', - 'version' => '3.5.1.0', + 'pretty_version' => 'v3.7.0', + 'version' => '3.7.0.0', + 'reference' => '8f1179e279cea6ef14066a4560b859df58acd5d8', 'type' => 'library', 'install_path' => __DIR__ . '/../twig/markdown-extra', 'aliases' => array(), - 'reference' => '9474c89fd2787187a3809e5e964dfce2395ae5f0', 'dev_requirement' => true, ), 'twig/twig' => array( - 'pretty_version' => 'v3.5.1', - 'version' => '3.5.1.0', + 'pretty_version' => 'v3.7.0', + 'version' => '3.7.0.0', + 'reference' => '5cf942bbab3df42afa918caeba947f1b690af64b', 'type' => 'library', 'install_path' => __DIR__ . '/../twig/twig', 'aliases' => array(), - 'reference' => 'a6e0510cc793912b451fd40ab983a1d28f611c15', 'dev_requirement' => true, ), ), diff --git a/app/vendor/doctrine/dbal/composer.json b/app/vendor/doctrine/dbal/composer.json index 3495dc17f..c7bc60c27 100644 --- a/app/vendor/doctrine/dbal/composer.json +++ b/app/vendor/doctrine/dbal/composer.json @@ -40,14 +40,15 @@ "psr/log": "^1|^2|^3" }, "require-dev": { - "doctrine/coding-standard": "11.1.0", + "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", - "jetbrains/phpstorm-stubs": "2022.3", - "phpstan/phpstan": "1.9.14", - "phpstan/phpstan-strict-rules": "^1.4", - "phpunit/phpunit": "9.6.3", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.29", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.9", "psalm/plugin-phpunit": "0.18.4", - "squizlabs/php_codesniffer": "3.7.1", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.7.2", "symfony/cache": "^5.4|^6.0", "symfony/console": "^4.4|^5.4|^6.0", "vimeo/psalm": "4.30.0" diff --git a/app/vendor/doctrine/dbal/src/Cache/ArrayResult.php b/app/vendor/doctrine/dbal/src/Cache/ArrayResult.php index 93b93d176..ce1283ba9 100644 --- a/app/vendor/doctrine/dbal/src/Cache/ArrayResult.php +++ b/app/vendor/doctrine/dbal/src/Cache/ArrayResult.php @@ -30,7 +30,7 @@ public function __construct(array $data) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchNumeric() { @@ -44,7 +44,7 @@ public function fetchNumeric() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchAssociative() { @@ -52,7 +52,7 @@ public function fetchAssociative() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchOne() { @@ -66,7 +66,7 @@ public function fetchOne() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchAllNumeric(): array { @@ -74,7 +74,7 @@ public function fetchAllNumeric(): array } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchAllAssociative(): array { @@ -82,7 +82,7 @@ public function fetchAllAssociative(): array } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchFirstColumn(): array { diff --git a/app/vendor/doctrine/dbal/src/Connection.php b/app/vendor/doctrine/dbal/src/Connection.php index a2a0a996c..6ba123607 100644 --- a/app/vendor/doctrine/dbal/src/Connection.php +++ b/app/vendor/doctrine/dbal/src/Connection.php @@ -440,6 +440,10 @@ private function getDatabasePlatformVersion() return $this->params['serverVersion']; } + if (isset($this->params['primary']) && isset($this->params['primary']['serverVersion'])) { + return $this->params['primary']['serverVersion']; + } + // If not connected, we need to connect now to determine the platform version. if ($this->_conn === null) { try { @@ -1051,7 +1055,7 @@ public function prepare(string $sql): Statement } /** - * Executes an, optionally parametrized, SQL query. + * Executes an, optionally parameterized, SQL query. * * If the query is parametrized, a prepared statement is used. * If an SQLLogger is configured, the execution is logged. diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php index 3a08312d6..ab9a64c0d 100644 --- a/app/vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php @@ -19,7 +19,7 @@ abstract class AbstractDB2Driver implements Driver { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDatabasePlatform() { @@ -27,7 +27,7 @@ public function getDatabasePlatform() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@link DB2Platform::createSchemaManager()} instead. */ diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractException.php b/app/vendor/doctrine/dbal/src/Driver/AbstractException.php index d4d20aa34..389f82e70 100644 --- a/app/vendor/doctrine/dbal/src/Driver/AbstractException.php +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractException.php @@ -35,7 +35,7 @@ public function __construct($message, $sqlState = null, $code = 0, ?Throwable $p } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLState() { diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php index 64f239a1a..93c487949 100644 --- a/app/vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php @@ -27,7 +27,7 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver { /** - * {@inheritdoc} + * {@inheritDoc} * * @throws Exception */ @@ -148,7 +148,7 @@ private function getMariaDbMysqlVersionNumber(string $versionString): string } /** - * {@inheritdoc} + * {@inheritDoc} * * @return AbstractMySQLPlatform */ @@ -158,7 +158,7 @@ public function getDatabasePlatform() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@link AbstractMySQLPlatform::createSchemaManager()} instead. * diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php index f1bec9167..b0f92453a 100644 --- a/app/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php @@ -20,7 +20,7 @@ abstract class AbstractOracleDriver implements Driver { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDatabasePlatform() { @@ -28,7 +28,7 @@ public function getDatabasePlatform() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@link OraclePlatform::createSchemaManager()} instead. */ diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php index 69e4baff3..099630d33 100644 --- a/app/vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php @@ -24,7 +24,7 @@ abstract class AbstractPostgreSQLDriver implements VersionAwarePlatformDriver { /** - * {@inheritdoc} + * {@inheritDoc} */ public function createDatabasePlatformForVersion($version) { @@ -55,7 +55,7 @@ public function createDatabasePlatformForVersion($version) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDatabasePlatform() { @@ -63,7 +63,7 @@ public function getDatabasePlatform() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@link PostgreSQLPlatform::createSchemaManager()} instead. */ diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php index c5d79feef..b9a99552e 100644 --- a/app/vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php @@ -20,7 +20,7 @@ abstract class AbstractSQLServerDriver implements Driver { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDatabasePlatform() { @@ -28,7 +28,7 @@ public function getDatabasePlatform() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@link SQLServerPlatform::createSchemaManager()} instead. */ diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractSQLiteDriver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractSQLiteDriver.php index 3c9d2c714..f8808f756 100644 --- a/app/vendor/doctrine/dbal/src/Driver/AbstractSQLiteDriver.php +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractSQLiteDriver.php @@ -19,7 +19,7 @@ abstract class AbstractSQLiteDriver implements Driver { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDatabasePlatform() { @@ -27,7 +27,7 @@ public function getDatabasePlatform() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@link SqlitePlatform::createSchemaManager()} instead. */ diff --git a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php index 6a2aa802e..dfb11c236 100644 --- a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php +++ b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php @@ -23,7 +23,6 @@ use function db2_rollback; use function db2_server_info; use function error_get_last; -use function is_bool; use const DB2_AUTOCOMMIT_OFF; use const DB2_AUTOCOMMIT_ON; @@ -44,7 +43,7 @@ public function __construct($connection) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getServerVersion() { @@ -71,7 +70,7 @@ public function query(string $sql): ResultInterface } /** - * {@inheritdoc} + * {@inheritDoc} */ public function quote($value, $type = ParameterType::STRING) { @@ -96,7 +95,7 @@ public function exec(string $sql): int } /** - * {@inheritdoc} + * {@inheritDoc} */ public function lastInsertId($name = null) { @@ -113,10 +112,7 @@ public function lastInsertId($name = null) public function beginTransaction(): bool { - $result = db2_autocommit($this->connection, DB2_AUTOCOMMIT_OFF); - assert(is_bool($result)); - - return $result; + return db2_autocommit($this->connection, DB2_AUTOCOMMIT_OFF); } public function commit(): bool @@ -125,10 +121,7 @@ public function commit(): bool throw ConnectionError::new($this->connection); } - $result = db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON); - assert(is_bool($result)); - - return $result; + return db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON); } public function rollBack(): bool @@ -137,10 +130,7 @@ public function rollBack(): bool throw ConnectionError::new($this->connection); } - $result = db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON); - assert(is_bool($result)); - - return $result; + return db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON); } /** @return resource */ diff --git a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php index 897d8a244..7650db5f4 100644 --- a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php @@ -12,7 +12,7 @@ final class Driver extends AbstractDB2Driver { /** - * {@inheritdoc} + * {@inheritDoc} * * @return Connection */ diff --git a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php index 4cfb135d0..699e236d7 100644 --- a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php +++ b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php @@ -56,7 +56,7 @@ public function __construct($stmt) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function bindValue($param, $value, $type = ParameterType::STRING): bool { @@ -75,7 +75,7 @@ public function bindValue($param, $value, $type = ParameterType::STRING): bool } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see bindValue()} instead. */ @@ -132,7 +132,7 @@ private function bind($position, &$variable, int $parameterType, int $dataType): } /** - * {@inheritdoc} + * {@inheritDoc} */ public function execute($params = null): ResultInterface { @@ -182,6 +182,8 @@ private function bindLobs(): array } else { $this->bind($param, $value, DB2_PARAM_IN, DB2_CHAR); } + + unset($value); } return $handles; diff --git a/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php b/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php index 6dab1cf13..f2809cd0a 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php +++ b/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php @@ -34,7 +34,7 @@ public function query(string $sql): Result } /** - * {@inheritdoc} + * {@inheritDoc} */ public function quote($value, $type = ParameterType::STRING) { @@ -47,7 +47,7 @@ public function exec(string $sql): int } /** - * {@inheritdoc} + * {@inheritDoc} */ public function lastInsertId($name = null) { @@ -63,7 +63,7 @@ public function lastInsertId($name = null) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function beginTransaction() { @@ -71,7 +71,7 @@ public function beginTransaction() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function commit() { @@ -79,7 +79,7 @@ public function commit() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function rollBack() { @@ -87,7 +87,7 @@ public function rollBack() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getServerVersion() { diff --git a/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php b/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php index 6fb8b5950..1c9d43097 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php +++ b/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php @@ -20,7 +20,7 @@ public function __construct(Driver $wrappedDriver) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function connect( #[SensitiveParameter] @@ -30,7 +30,7 @@ public function connect( } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDatabasePlatform() { @@ -38,7 +38,7 @@ public function getDatabasePlatform() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@link AbstractPlatform::createSchemaManager()} instead. */ @@ -60,7 +60,7 @@ public function getExceptionConverter(): ExceptionConverter } /** - * {@inheritdoc} + * {@inheritDoc} */ public function createDatabasePlatformForVersion($version) { diff --git a/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php b/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php index de90207b0..198d39b0d 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php +++ b/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php @@ -14,7 +14,7 @@ public function __construct(Result $result) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchNumeric() { @@ -22,7 +22,7 @@ public function fetchNumeric() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchAssociative() { @@ -30,7 +30,7 @@ public function fetchAssociative() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchOne() { @@ -38,7 +38,7 @@ public function fetchOne() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchAllNumeric(): array { @@ -46,7 +46,7 @@ public function fetchAllNumeric(): array } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchAllAssociative(): array { @@ -54,7 +54,7 @@ public function fetchAllAssociative(): array } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchFirstColumn(): array { diff --git a/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php b/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php index 70e8df637..6cd2f8f08 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php +++ b/app/vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php @@ -19,7 +19,7 @@ public function __construct(Statement $wrappedStatement) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function bindValue($param, $value, $type = ParameterType::STRING) { @@ -36,7 +36,7 @@ public function bindValue($param, $value, $type = ParameterType::STRING) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see bindValue()} instead. */ @@ -62,7 +62,7 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le } /** - * {@inheritdoc} + * {@inheritDoc} */ public function execute($params = null): Result { diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php index 78112d825..d492684cc 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php @@ -71,7 +71,7 @@ public function query(string $sql): ResultInterface } /** - * {@inheritdoc} + * {@inheritDoc} */ public function quote($value, $type = ParameterType::STRING) { @@ -94,7 +94,7 @@ public function exec(string $sql): int } /** - * {@inheritdoc} + * {@inheritDoc} */ public function lastInsertId($name = null) { diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php index 1c804069d..4f5186875 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php @@ -16,7 +16,7 @@ final class Driver extends AbstractMySQLDriver { /** - * {@inheritdoc} + * {@inheritDoc} * * @return Connection */ diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php index c096e6d76..c7dc65d1d 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php @@ -85,7 +85,7 @@ public function __construct(mysqli_stmt $statement) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchNumeric() { @@ -127,7 +127,7 @@ public function fetchAssociative() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchOne() { @@ -135,7 +135,7 @@ public function fetchOne() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchAllNumeric(): array { @@ -143,7 +143,7 @@ public function fetchAllNumeric(): array } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchAllAssociative(): array { @@ -151,7 +151,7 @@ public function fetchAllAssociative(): array } /** - * {@inheritdoc} + * {@inheritDoc} */ public function fetchFirstColumn(): array { diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php index 7b7c93129..035e487aa 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php @@ -63,7 +63,7 @@ public function __construct(mysqli_stmt $stmt) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see bindValue()} instead. */ @@ -98,7 +98,7 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le } /** - * {@inheritdoc} + * {@inheritDoc} */ public function bindValue($param, $value, $type = ParameterType::STRING): bool { @@ -125,7 +125,7 @@ public function bindValue($param, $value, $type = ParameterType::STRING): bool } /** - * {@inheritdoc} + * {@inheritDoc} */ public function execute($params = null): ResultInterface { diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php index da4f61aeb..72353fa31 100644 --- a/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php @@ -81,7 +81,7 @@ public function query(string $sql): ResultInterface } /** - * {@inheritdoc} + * {@inheritDoc} */ public function quote($value, $type = ParameterType::STRING) { @@ -104,7 +104,7 @@ public function exec(string $sql): int } /** - * {@inheritdoc} + * {@inheritDoc} * * @param string|null $name * diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/Driver.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/Driver.php index 898ecb369..53e563c63 100644 --- a/app/vendor/doctrine/dbal/src/Driver/OCI8/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/Driver.php @@ -17,7 +17,7 @@ final class Driver extends AbstractOracleDriver { /** - * {@inheritdoc} + * {@inheritDoc} * * @return Connection */ diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php index e707f721c..015a14b7b 100644 --- a/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php @@ -52,7 +52,7 @@ public function __construct($connection, $statement, array $parameterMap, Execut } /** - * {@inheritdoc} + * {@inheritDoc} */ public function bindValue($param, $value, $type = ParameterType::STRING): bool { @@ -69,7 +69,7 @@ public function bindValue($param, $value, $type = ParameterType::STRING): bool } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see bindValue()} instead. */ @@ -137,7 +137,7 @@ private function convertParameterType(int $type): int } /** - * {@inheritdoc} + * {@inheritDoc} */ public function execute($params = null): ResultInterface { diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/Connection.php b/app/vendor/doctrine/dbal/src/Driver/PDO/Connection.php index 5eb855a78..a7bd2d74d 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PDO/Connection.php +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/Connection.php @@ -40,7 +40,7 @@ public function exec(string $sql): int } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getServerVersion() { @@ -77,7 +77,7 @@ public function query(string $sql): ResultInterface } /** - * {@inheritdoc} + * {@inheritDoc} */ public function quote($value, $type = ParameterType::STRING) { @@ -85,7 +85,7 @@ public function quote($value, $type = ParameterType::STRING) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function lastInsertId($name = null) { diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php index f0b836a0e..2492698b4 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php @@ -12,7 +12,7 @@ final class Driver extends AbstractMySQLDriver { /** - * {@inheritdoc} + * {@inheritDoc} * * @return Connection */ diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/OCI/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PDO/OCI/Driver.php index e8b9aaa9d..10ada9f0e 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PDO/OCI/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/OCI/Driver.php @@ -12,7 +12,7 @@ final class Driver extends AbstractOracleDriver { /** - * {@inheritdoc} + * {@inheritDoc} * * @return Connection */ diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php index ca7a14d00..1c586d69d 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php @@ -13,7 +13,7 @@ final class Driver extends AbstractPostgreSQLDriver { /** - * {@inheritdoc} + * {@inheritDoc} * * @return Connection */ diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php index 1e9d7f7d5..63eabb71a 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php @@ -16,7 +16,7 @@ final class Driver extends AbstractSQLServerDriver { /** - * {@inheritdoc} + * {@inheritDoc} * * @return Connection */ diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php index edabd410a..10f6ba7fe 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php @@ -23,7 +23,7 @@ public function __construct(PDOStatement $statement) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see bindValue()} instead. * @@ -82,7 +82,7 @@ public function bindParam( } /** - * {@inheritdoc} + * {@inheritDoc} */ public function bindValue($param, $value, $type = ParameterType::STRING): bool { diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php index 92875cb9b..2e97788e6 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php @@ -16,7 +16,7 @@ final class Driver extends AbstractSQLiteDriver { /** - * {@inheritdoc} + * {@inheritDoc} * * @return Connection */ diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/Statement.php b/app/vendor/doctrine/dbal/src/Driver/PDO/Statement.php index 071decbef..df2dac6f8 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PDO/Statement.php +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/Statement.php @@ -24,7 +24,7 @@ public function __construct(PDOStatement $stmt) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function bindValue($param, $value, $type = ParameterType::STRING) { @@ -104,7 +104,7 @@ public function bindParam( } /** - * {@inheritdoc} + * {@inheritDoc} */ public function execute($params = null): ResultInterface { diff --git a/app/vendor/doctrine/dbal/src/Driver/PgSQL/Connection.php b/app/vendor/doctrine/dbal/src/Driver/PgSQL/Connection.php index e316259e3..378e8ed7a 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PgSQL/Connection.php +++ b/app/vendor/doctrine/dbal/src/Driver/PgSQL/Connection.php @@ -93,7 +93,7 @@ public function query(string $sql): Result return new Result($result); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function quote($value, $type = ParameterType::STRING) { if ($type === ParameterType::BINARY || $type === ParameterType::LARGE_OBJECT) { @@ -108,7 +108,7 @@ public function exec(string $sql): int return $this->query($sql)->rowCount(); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function lastInsertId($name = null) { if ($name !== null) { diff --git a/app/vendor/doctrine/dbal/src/Driver/PgSQL/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PgSQL/Driver.php index 298cac7a6..73c97cd81 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PgSQL/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/PgSQL/Driver.php @@ -23,7 +23,7 @@ final class Driver extends AbstractPostgreSQLDriver { - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function connect( #[SensitiveParameter] array $params diff --git a/app/vendor/doctrine/dbal/src/Driver/PgSQL/Result.php b/app/vendor/doctrine/dbal/src/Driver/PgSQL/Result.php index 18494bd05..d7ea1db34 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PgSQL/Result.php +++ b/app/vendor/doctrine/dbal/src/Driver/PgSQL/Result.php @@ -60,7 +60,7 @@ public function __destruct() $this->free(); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function fetchNumeric() { if ($this->result === null) { @@ -75,7 +75,7 @@ public function fetchNumeric() return $this->mapNumericRow($row, $this->fetchNumericColumnTypes()); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function fetchAssociative() { if ($this->result === null) { @@ -90,13 +90,13 @@ public function fetchAssociative() return $this->mapAssociativeRow($row, $this->fetchAssociativeColumnTypes()); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function fetchOne() { return FetchUtils::fetchOne($this); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function fetchAllNumeric(): array { if ($this->result === null) { @@ -117,7 +117,7 @@ public function fetchAllNumeric(): array ); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function fetchAllAssociative(): array { if ($this->result === null) { @@ -138,7 +138,7 @@ public function fetchAllAssociative(): array ); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function fetchFirstColumn(): array { if ($this->result === null) { diff --git a/app/vendor/doctrine/dbal/src/Driver/PgSQL/Statement.php b/app/vendor/doctrine/dbal/src/Driver/PgSQL/Statement.php index 211c4943f..75af66f30 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PgSQL/Statement.php +++ b/app/vendor/doctrine/dbal/src/Driver/PgSQL/Statement.php @@ -25,6 +25,7 @@ use function pg_result_error; use function pg_send_execute; use function sprintf; +use function stream_get_contents; final class Statement implements StatementInterface { @@ -73,7 +74,7 @@ public function __destruct() ); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function bindValue($param, $value, $type = ParameterType::STRING): bool { if (! isset($this->parameterMap[$param])) { @@ -86,7 +87,7 @@ public function bindValue($param, $value, $type = ParameterType::STRING): bool return true; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null): bool { Deprecation::trigger( @@ -123,7 +124,7 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le return true; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ public function execute($params = null): Result { if ($params !== null) { @@ -150,7 +151,10 @@ public function execute($params = null): Result switch ($this->parameterTypes[$parameter]) { case ParameterType::BINARY: case ParameterType::LARGE_OBJECT: - $escapedParameters[] = $value === null ? null : pg_escape_bytea($this->connection, $value); + $escapedParameters[] = $value === null ? null : pg_escape_bytea( + $this->connection, + is_resource($value) ? stream_get_contents($value) : $value, + ); break; default: $escapedParameters[] = $value; diff --git a/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php index ba1c58c17..16e45d110 100644 --- a/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php +++ b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php @@ -36,7 +36,7 @@ public function __construct($connection) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getServerVersion() { diff --git a/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php index 7ff27fad1..fcbdb7734 100644 --- a/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php @@ -16,7 +16,7 @@ final class Driver extends AbstractSQLServerDriver { /** - * {@inheritdoc} + * {@inheritDoc} * * @return Connection */ diff --git a/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php index 1244ba51a..227c33456 100644 --- a/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php +++ b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php @@ -82,7 +82,7 @@ public function __construct($conn, $sql) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function bindValue($param, $value, $type = ParameterType::STRING): bool { @@ -104,7 +104,7 @@ public function bindValue($param, $value, $type = ParameterType::STRING): bool } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see bindValue()} instead. */ @@ -138,7 +138,7 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le } /** - * {@inheritdoc} + * {@inheritDoc} */ public function execute($params = null): ResultInterface { diff --git a/app/vendor/doctrine/dbal/src/Driver/SQLite3/Driver.php b/app/vendor/doctrine/dbal/src/Driver/SQLite3/Driver.php index 922f6bd16..fecc4819d 100644 --- a/app/vendor/doctrine/dbal/src/Driver/SQLite3/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/SQLite3/Driver.php @@ -10,7 +10,7 @@ final class Driver extends AbstractSQLiteDriver { /** - * {@inheritdoc} + * {@inheritDoc} */ public function connect( #[SensitiveParameter] diff --git a/app/vendor/doctrine/dbal/src/DriverManager.php b/app/vendor/doctrine/dbal/src/DriverManager.php index a57d7a222..4a365ee24 100644 --- a/app/vendor/doctrine/dbal/src/DriverManager.php +++ b/app/vendor/doctrine/dbal/src/DriverManager.php @@ -23,6 +23,7 @@ * Factory for creating {@see Connection} instances. * * @psalm-type OverrideParams = array{ + * application_name?: string, * charset?: string, * dbname?: string, * default_dbname?: string, @@ -32,14 +33,16 @@ * host?: string, * password?: string, * path?: string, - * pdo?: \PDO, + * persistent?: bool, * platform?: Platforms\AbstractPlatform, * port?: int, + * serverVersion?: string, * url?: string, * user?: string, * unix_socket?: string, * } * @psalm-type Params = array{ + * application_name?: string, * charset?: string, * dbname?: string, * defaultTableOptions?: array, @@ -54,7 +57,7 @@ * memory?: bool, * password?: string, * path?: string, - * pdo?: \PDO, + * persistent?: bool, * platform?: Platforms\AbstractPlatform, * port?: int, * primary?: OverrideParams, diff --git a/app/vendor/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php b/app/vendor/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php index 6256cdb5b..9598f43cc 100644 --- a/app/vendor/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php +++ b/app/vendor/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php @@ -68,7 +68,7 @@ public function postConnect(ConnectionEventArgs $args) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSubscribedEvents() { diff --git a/app/vendor/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php b/app/vendor/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php index 0f77e9ffc..4ce32d628 100644 --- a/app/vendor/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php +++ b/app/vendor/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php @@ -34,7 +34,7 @@ public function postConnect(ConnectionEventArgs $args) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSubscribedEvents() { diff --git a/app/vendor/doctrine/dbal/src/Event/Listeners/SQLiteSessionInit.php b/app/vendor/doctrine/dbal/src/Event/Listeners/SQLiteSessionInit.php index f2ee05a32..950f05f48 100644 --- a/app/vendor/doctrine/dbal/src/Event/Listeners/SQLiteSessionInit.php +++ b/app/vendor/doctrine/dbal/src/Event/Listeners/SQLiteSessionInit.php @@ -21,7 +21,7 @@ public function postConnect(ConnectionEventArgs $args) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSubscribedEvents() { diff --git a/app/vendor/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php b/app/vendor/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php index 9b4724ddf..75c9fe9cf 100644 --- a/app/vendor/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php +++ b/app/vendor/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php @@ -30,7 +30,7 @@ public function __construct($generatorTableName = 'sequences') } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptSchema(Schema $schema) { @@ -41,35 +41,35 @@ public function acceptSchema(Schema $schema) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptTable(Table $table) { } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptColumn(Table $table, Column $column) { } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) { } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptIndex(Table $table, Index $index) { } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptSequence(Sequence $sequence) { diff --git a/app/vendor/doctrine/dbal/src/Logging/DebugStack.php b/app/vendor/doctrine/dbal/src/Logging/DebugStack.php index e8539e584..1a970d060 100644 --- a/app/vendor/doctrine/dbal/src/Logging/DebugStack.php +++ b/app/vendor/doctrine/dbal/src/Logging/DebugStack.php @@ -43,7 +43,7 @@ public function __construct() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function startQuery($sql, ?array $params = null, ?array $types = null) { @@ -62,7 +62,7 @@ public function startQuery($sql, ?array $params = null, ?array $types = null) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function stopQuery() { diff --git a/app/vendor/doctrine/dbal/src/Logging/LoggerChain.php b/app/vendor/doctrine/dbal/src/Logging/LoggerChain.php index 3c62a1d8e..7a4eaa49a 100644 --- a/app/vendor/doctrine/dbal/src/Logging/LoggerChain.php +++ b/app/vendor/doctrine/dbal/src/Logging/LoggerChain.php @@ -27,7 +27,7 @@ public function __construct(iterable $loggers = []) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function startQuery($sql, ?array $params = null, ?array $types = null) { @@ -37,7 +37,7 @@ public function startQuery($sql, ?array $params = null, ?array $types = null) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function stopQuery() { diff --git a/app/vendor/doctrine/dbal/src/Logging/Statement.php b/app/vendor/doctrine/dbal/src/Logging/Statement.php index 95d603586..039b93b6a 100644 --- a/app/vendor/doctrine/dbal/src/Logging/Statement.php +++ b/app/vendor/doctrine/dbal/src/Logging/Statement.php @@ -36,7 +36,7 @@ public function __construct(StatementInterface $statement, LoggerInterface $logg } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see bindValue()} instead. */ @@ -65,7 +65,7 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le } /** - * {@inheritdoc} + * {@inheritDoc} */ public function bindValue($param, $value, $type = ParameterType::STRING) { @@ -85,7 +85,7 @@ public function bindValue($param, $value, $type = ParameterType::STRING) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function execute($params = null): ResultInterface { diff --git a/app/vendor/doctrine/dbal/src/Platforms/AbstractMySQLPlatform.php b/app/vendor/doctrine/dbal/src/Platforms/AbstractMySQLPlatform.php index cdbdbec78..73badf7f2 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/AbstractMySQLPlatform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/AbstractMySQLPlatform.php @@ -113,7 +113,7 @@ public function getConcatExpression() } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) { @@ -238,7 +238,7 @@ protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed/*, $lengt } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) { @@ -510,7 +510,7 @@ protected function _getCreateTableSQL($name, array $columns, array $options = [] } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ @@ -983,7 +983,7 @@ private function getRemainingForeignKeyConstraintsRequiringRenamedIndexes(TableD } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getPostAlterTableIndexForeignKeySQL(TableDiff $diff) { @@ -1062,7 +1062,7 @@ public function getSmallIntTypeDeclarationSQL(array $column) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getFloatDeclarationSQL(array $column) { @@ -1070,7 +1070,7 @@ public function getFloatDeclarationSQL(array $column) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDecimalTypeDeclarationSQL(array $column) { @@ -1279,7 +1279,7 @@ public function getVarcharMaxLength() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -1368,7 +1368,7 @@ public function getBlobTypeDeclarationSQL(array $column) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function quoteStringLiteral($str) { @@ -1378,7 +1378,7 @@ public function quoteStringLiteral($str) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDefaultTransactionIsolationLevel() { diff --git a/app/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php b/app/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php index 28e0782e8..8e58a66b9 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php @@ -1705,7 +1705,7 @@ public function getDateSubYearsExpression($date, $years) * @param string $operator The arithmetic operator (+ or -). * @param int|numeric-string $interval The interval that shall be calculated into the date. * @param string $unit The unit of the interval that shall be calculated into the date. - * One of the DATE_INTERVAL_UNIT_* constants. + * One of the {@see DateIntervalUnit} constants. * * @return string * @@ -4155,7 +4155,7 @@ public function getDefaultSchemaName() */ public function supportsCreateDropDatabase() { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5513', '%s is deprecated.', diff --git a/app/vendor/doctrine/dbal/src/Platforms/DB2Platform.php b/app/vendor/doctrine/dbal/src/Platforms/DB2Platform.php index c40a03e6d..74840866e 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/DB2Platform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/DB2Platform.php @@ -26,7 +26,7 @@ class DB2Platform extends AbstractPlatform { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -42,7 +42,7 @@ public function getCharMaxLength(): int } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -58,7 +58,7 @@ public function getBinaryMaxLength() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -120,7 +120,7 @@ protected function initializeDoctrineTypeMappings() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function isCommentedDoctrineType(Type $doctrineType) { @@ -159,7 +159,7 @@ protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed/*, $lengt } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) { @@ -244,7 +244,7 @@ protected function _getCommonIntegerTypeDeclarationSQL(array $column) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getBitAndComparisonExpression($value1, $value2) { @@ -252,7 +252,7 @@ public function getBitAndComparisonExpression($value1, $value2) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getBitOrComparisonExpression($value1, $value2) { @@ -260,7 +260,7 @@ public function getBitOrComparisonExpression($value1, $value2) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) { @@ -280,7 +280,7 @@ protected function getDateArithmeticIntervalExpression($date, $operator, $interv } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDateDiffExpression($date1, $date2) { @@ -316,7 +316,7 @@ public function getTimeTypeDeclarationSQL(array $column) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getTruncateTableSQL($tableName, $cascade = false) { @@ -484,7 +484,7 @@ public function supportsCreateDropDatabase() } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ @@ -801,7 +801,7 @@ protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) { diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/DB2Keywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/DB2Keywords.php index ee8cb1d67..d5dbbd734 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/Keywords/DB2Keywords.php +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/DB2Keywords.php @@ -10,7 +10,7 @@ class DB2Keywords extends KeywordList { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -26,7 +26,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getKeywords() { diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/MariaDBKeywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/MariaDBKeywords.php index 06c561254..5417c6caa 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/Keywords/MariaDBKeywords.php +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/MariaDBKeywords.php @@ -19,7 +19,7 @@ public function getName(): string } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getKeywords(): array { diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQL57Keywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQL57Keywords.php index 65dcea500..4588aab84 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQL57Keywords.php +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQL57Keywords.php @@ -12,7 +12,7 @@ class MySQL57Keywords extends MySQLKeywords { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -28,7 +28,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @link http://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-reservedwords-5-7.html */ diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQL80Keywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQL80Keywords.php index 1ed030afa..c62ae9e5b 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQL80Keywords.php +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQL80Keywords.php @@ -12,7 +12,7 @@ class MySQL80Keywords extends MySQL57Keywords { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -28,7 +28,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @link https://dev.mysql.com/doc/refman/8.0/en/keywords.html */ diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQLKeywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQLKeywords.php index 4f7fe998d..f9505e0e1 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQLKeywords.php +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/MySQLKeywords.php @@ -10,7 +10,7 @@ class MySQLKeywords extends KeywordList { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -26,7 +26,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getKeywords() { diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/OracleKeywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/OracleKeywords.php index d49ddd58e..d2d0094c7 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/Keywords/OracleKeywords.php +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/OracleKeywords.php @@ -10,7 +10,7 @@ class OracleKeywords extends KeywordList { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -26,7 +26,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getKeywords() { diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/PostgreSQLKeywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/PostgreSQLKeywords.php index 8714c6db6..1ff4142b2 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/Keywords/PostgreSQLKeywords.php +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/PostgreSQLKeywords.php @@ -10,7 +10,7 @@ class PostgreSQLKeywords extends KeywordList { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -26,7 +26,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getKeywords() { diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/ReservedKeywordsValidator.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/ReservedKeywordsValidator.php index e168e8b1c..b33f3e4b3 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/Keywords/ReservedKeywordsValidator.php +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/ReservedKeywordsValidator.php @@ -79,7 +79,7 @@ private function addViolation($asset, $violatedPlatforms): void } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptColumn(Table $table, Column $column) { @@ -90,35 +90,35 @@ public function acceptColumn(Table $table, Column $column) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) { } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptIndex(Table $table, Index $index) { } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptSchema(Schema $schema) { } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptSequence(Sequence $sequence) { } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptTable(Table $table) { diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLServerKeywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLServerKeywords.php index 48953baa2..76614cf95 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLServerKeywords.php +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLServerKeywords.php @@ -11,7 +11,7 @@ class SQLServerKeywords extends KeywordList { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -27,7 +27,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @link http://msdn.microsoft.com/en-us/library/aa238507%28v=sql.80%29.aspx */ diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLiteKeywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLiteKeywords.php index 65351078e..9a3edeb57 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLiteKeywords.php +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLiteKeywords.php @@ -10,7 +10,7 @@ class SQLiteKeywords extends KeywordList { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -26,7 +26,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getKeywords() { diff --git a/app/vendor/doctrine/dbal/src/Platforms/MariaDBPlatform.php b/app/vendor/doctrine/dbal/src/Platforms/MariaDBPlatform.php index 9e3d3ddb9..1dddeccaf 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/MariaDBPlatform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/MariaDBPlatform.php @@ -24,7 +24,7 @@ public function getDefaultValueDeclarationSQL($column) } /** - * {@inheritdoc} + * {@inheritDoc} * * @link https://mariadb.com/kb/en/library/json-data-type/ */ diff --git a/app/vendor/doctrine/dbal/src/Platforms/MySQL57Platform.php b/app/vendor/doctrine/dbal/src/Platforms/MySQL57Platform.php index ea11ee636..f3899959d 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/MySQL57Platform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/MySQL57Platform.php @@ -17,7 +17,7 @@ class MySQL57Platform extends MySQLPlatform { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -34,7 +34,7 @@ public function hasNativeJsonType() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getJsonTypeDeclarationSQL(array $column) { @@ -47,7 +47,7 @@ public function createSQLParser(): Parser } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getPreAlterTableRenameIndexForeignKeySQL(TableDiff $diff) { @@ -55,7 +55,7 @@ protected function getPreAlterTableRenameIndexForeignKeySQL(TableDiff $diff) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getPostAlterTableRenameIndexForeignKeySQL(TableDiff $diff) { @@ -63,7 +63,7 @@ protected function getPostAlterTableRenameIndexForeignKeySQL(TableDiff $diff) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) { @@ -71,7 +71,7 @@ protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Implement {@see createReservedKeywordsList()} instead. */ @@ -88,7 +88,7 @@ protected function getReservedKeywordsClass() } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function initializeDoctrineTypeMappings() { diff --git a/app/vendor/doctrine/dbal/src/Platforms/MySQL80Platform.php b/app/vendor/doctrine/dbal/src/Platforms/MySQL80Platform.php index dd6599de1..9ea6ee881 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/MySQL80Platform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/MySQL80Platform.php @@ -10,7 +10,7 @@ class MySQL80Platform extends MySQL57Platform { /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Implement {@see createReservedKeywordsList()} instead. */ diff --git a/app/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php b/app/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php index 306173e99..4e1b5b9d1 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php @@ -103,7 +103,7 @@ public function getLocateExpression($str, $substr, $startPos = false) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) { @@ -373,7 +373,7 @@ protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed/*, $lengt } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) { @@ -390,7 +390,7 @@ protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $length } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -798,7 +798,7 @@ public function getDropForeignKeySQL($foreignKey, $table) } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ @@ -818,7 +818,7 @@ public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ @@ -1001,7 +1001,7 @@ public function getAlterTableSQL(TableDiff $diff) } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ @@ -1050,7 +1050,7 @@ public function getColumnDeclarationSQL($name, array $column) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) { @@ -1063,7 +1063,7 @@ protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -1080,7 +1080,7 @@ public function usesSequenceEmulatedIdentityColumns() } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the OraclePlatform class hierarchy. */ diff --git a/app/vendor/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php b/app/vendor/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php index 7c4592651..b01eb860a 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php @@ -10,6 +10,7 @@ use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\PostgreSQLSchemaManager; use Doctrine\DBAL\Schema\Sequence; +use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Types\BinaryType; use Doctrine\DBAL\Types\BlobType; @@ -127,7 +128,7 @@ public function getLocateExpression($str, $substr, $startPos = false) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) { @@ -169,7 +170,7 @@ public function supportsSchemas() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -194,7 +195,7 @@ public function supportsIdentityColumns() } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ @@ -204,7 +205,7 @@ public function supportsPartialIndexes() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -221,7 +222,7 @@ public function usesSequenceEmulatedIdentityColumns() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -728,7 +729,7 @@ private function isUnchangedBinaryColumn(ColumnDiff $columnDiff): bool } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) { @@ -741,7 +742,7 @@ protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ @@ -809,6 +810,36 @@ public function getDropForeignKeySQL($foreignKey, $table) return $this->getDropConstraintSQL($foreignKey, $table); } + /** + * {@inheritDoc} + */ + public function getDropIndexSQL($index, $table = null) + { + if ($index instanceof Index && $index->isPrimary() && $table !== null) { + $constraintName = $index->getName() === 'primary' ? $this->tableName($table) . '_pkey' : $index->getName(); + + return $this->getDropConstraintSQL($constraintName, $table); + } + + if ($index === '"primary"' && $table !== null) { + $constraintName = $this->tableName($table) . '_pkey'; + + return $this->getDropConstraintSQL($constraintName, $table); + } + + return parent::getDropIndexSQL($index, $table); + } + + /** + * @param Table|string|null $table + * + * @return string + */ + private function tableName($table) + { + return $table instanceof Table ? $table->getName() : (string) $table; + } + /** * {@inheritDoc} */ @@ -1092,7 +1123,7 @@ protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) { @@ -1227,7 +1258,7 @@ public function getVarcharMaxLength() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getBinaryMaxLength() { @@ -1241,7 +1272,7 @@ public function getBinaryMaxLength() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -1257,7 +1288,7 @@ public function getBinaryDefaultLength() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -1299,7 +1330,7 @@ public function getBlobTypeDeclarationSQL(array $column) } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ @@ -1313,7 +1344,7 @@ public function getDefaultValueDeclarationSQL($column) } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ @@ -1323,7 +1354,7 @@ public function supportsColumnCollation() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getJsonTypeDeclarationSQL(array $column) { diff --git a/app/vendor/doctrine/dbal/src/Platforms/SQLServerPlatform.php b/app/vendor/doctrine/dbal/src/Platforms/SQLServerPlatform.php index 027f7239c..03a1e8c40 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/SQLServerPlatform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/SQLServerPlatform.php @@ -49,7 +49,7 @@ class SQLServerPlatform extends AbstractPlatform { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getCurrentDateSQL() { @@ -57,7 +57,7 @@ public function getCurrentDateSQL() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getCurrentTimeSQL() { @@ -76,7 +76,7 @@ private function getConvertExpression($dataType, $expression): string } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) { @@ -135,7 +135,7 @@ public function supportsReleaseSavepoints() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function supportsSchemas() { @@ -143,7 +143,7 @@ public function supportsSchemas() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -189,7 +189,7 @@ public function getCreateSequenceSQL(Sequence $sequence): string } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractSchemaManager} class hierarchy. */ @@ -206,7 +206,7 @@ public function getListSequencesSQL($database) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSequenceNextValSQL($sequence) { @@ -857,7 +857,7 @@ protected function getDropColumnCommentSQL($tableName, $columnName) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) { @@ -1315,7 +1315,7 @@ protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed/*, $lengt } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $lengthOmitted = false*/) { @@ -1334,7 +1334,7 @@ protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed/*, $length } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -1575,7 +1575,7 @@ public function rollbackSavePoint($savepoint) } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ @@ -1659,7 +1659,7 @@ public function getBlobTypeDeclarationSQL(array $column) } /** - * {@inheritdoc} + * {@inheritDoc} * * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. */ diff --git a/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php b/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php index 71c29f38a..5035801cf 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php @@ -141,7 +141,7 @@ public function getLocateExpression($str, $substr, $startPos = false) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) { @@ -482,7 +482,7 @@ protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) { @@ -490,7 +490,7 @@ protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -506,7 +506,7 @@ public function getBinaryMaxLength() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ @@ -941,7 +941,7 @@ public function getCreatePrimaryKeySQL(Index $index, $table) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table) { @@ -949,7 +949,7 @@ public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDropForeignKeySQL($foreignKey, $table) { diff --git a/app/vendor/doctrine/dbal/src/Portability/Statement.php b/app/vendor/doctrine/dbal/src/Portability/Statement.php index 9b3e74f58..8fcd79d4a 100644 --- a/app/vendor/doctrine/dbal/src/Portability/Statement.php +++ b/app/vendor/doctrine/dbal/src/Portability/Statement.php @@ -24,7 +24,7 @@ public function __construct(DriverStatement $stmt, Converter $converter) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function execute($params = null): ResultInterface { diff --git a/app/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php index 445c9ff2f..7e1fd93ff 100644 --- a/app/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php +++ b/app/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php @@ -215,7 +215,7 @@ public function listTableColumns($table, $database = null) if ($database === null) { $database = $this->getDatabase(__METHOD__); } else { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/issues/5284', 'Passing $database to AbstractSchemaManager::listTableColumns() is deprecated.', @@ -242,10 +242,10 @@ protected function doListTableColumns($table, $database = null): array if ($database === null) { $database = $this->getDatabase(__METHOD__); } else { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/issues/5284', - 'Passing $database to AbstractSchemaManager::listTableColumns() is deprecated.', + 'Passing $database to AbstractSchemaManager::doListTableColumns() is deprecated.', ); } @@ -442,7 +442,7 @@ protected function doListTables(): array */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', diff --git a/app/vendor/doctrine/dbal/src/Schema/Column.php b/app/vendor/doctrine/dbal/src/Schema/Column.php index 8a5703c0a..03fd686f4 100644 --- a/app/vendor/doctrine/dbal/src/Schema/Column.php +++ b/app/vendor/doctrine/dbal/src/Schema/Column.php @@ -52,7 +52,7 @@ class Column extends AbstractAsset protected $_comment; /** - * @deprecated Use {@link $_platformOptions instead} + * @deprecated Use {@link $_platformOptions} instead * * @var mixed[] */ @@ -353,7 +353,7 @@ public function getComment() } /** - * @deprecated Use {@link setPlatformOption() instead} + * @deprecated Use {@link setPlatformOption()} instead * * @param string $name * @param mixed $value @@ -374,7 +374,7 @@ public function setCustomSchemaOption($name, $value) } /** - * @deprecated Use {@link hasPlatformOption() instead} + * @deprecated Use {@link hasPlatformOption()} instead * * @param string $name * @@ -392,7 +392,7 @@ public function hasCustomSchemaOption($name) } /** - * @deprecated Use {@link getPlatformOption() instead} + * @deprecated Use {@link getPlatformOption()} instead * * @param string $name * @@ -410,7 +410,7 @@ public function getCustomSchemaOption($name) } /** - * @deprecated Use {@link setPlatformOptions() instead} + * @deprecated Use {@link setPlatformOptions()} instead * * @param mixed[] $customSchemaOptions * @@ -430,13 +430,13 @@ public function setCustomSchemaOptions(array $customSchemaOptions) } /** - * @deprecated Use {@link getPlatformOptions() instead} + * @deprecated Use {@link getPlatformOptions()} instead * * @return mixed[] */ public function getCustomSchemaOptions() { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5476', 'Column::getCustomSchemaOptions() is deprecated. Use getPlatformOptions() instead.', diff --git a/app/vendor/doctrine/dbal/src/Schema/Comparator.php b/app/vendor/doctrine/dbal/src/Schema/Comparator.php index 01c0abcdd..28e7f2f73 100644 --- a/app/vendor/doctrine/dbal/src/Schema/Comparator.php +++ b/app/vendor/doctrine/dbal/src/Schema/Comparator.php @@ -702,7 +702,7 @@ public function diffColumn(Column $column1, Column $column2) /** * Finds the difference between the indexes $index1 and $index2. * - * Compares $index1 with $index2 and returns $index2 if there are any + * Compares $index1 with $index2 and returns true if there are any * differences or false in case there are no differences. * * @internal The method should be only used from within the {@see Comparator} class hierarchy. diff --git a/app/vendor/doctrine/dbal/src/Schema/DB2SchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/DB2SchemaManager.php index 0308d69b5..1070a14e2 100644 --- a/app/vendor/doctrine/dbal/src/Schema/DB2SchemaManager.php +++ b/app/vendor/doctrine/dbal/src/Schema/DB2SchemaManager.php @@ -50,7 +50,7 @@ public function listTables() */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', @@ -85,7 +85,7 @@ public function listTableForeignKeys($table, $database = null) } /** - * {@inheritdoc} + * {@inheritDoc} * * @throws Exception */ @@ -170,7 +170,7 @@ protected function _getPortableTableColumnDefinition($tableColumn) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableDefinition($table) { @@ -180,7 +180,7 @@ protected function _getPortableTableDefinition($table) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) { @@ -193,7 +193,7 @@ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableForeignKeyDefinition($tableForeignKey) { @@ -207,7 +207,7 @@ protected function _getPortableTableForeignKeyDefinition($tableForeignKey) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableForeignKeysList($tableForeignKeys) { @@ -255,7 +255,7 @@ protected function _getPortableForeignKeyRuleDef($def) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableViewDefinition($view) { diff --git a/app/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraint.php b/app/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraint.php index 852ad0a31..2f0311cd6 100644 --- a/app/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraint.php +++ b/app/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraint.php @@ -194,7 +194,7 @@ public function getUnquotedForeignColumns() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see getLocalColumns()} instead. * diff --git a/app/vendor/doctrine/dbal/src/Schema/Index.php b/app/vendor/doctrine/dbal/src/Schema/Index.php index 6c2d7cd5a..84fac4146 100644 --- a/app/vendor/doctrine/dbal/src/Schema/Index.php +++ b/app/vendor/doctrine/dbal/src/Schema/Index.php @@ -43,7 +43,7 @@ class Index extends AbstractAsset implements Constraint * @todo $_flags should eventually be refactored into options * @var mixed[] */ - private array $options; + private array $options = []; /** * @param string $name @@ -84,7 +84,7 @@ protected function _addColumn(string $column): void } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getColumns() { @@ -92,7 +92,7 @@ public function getColumns() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getQuotedColumns(AbstractPlatform $platform) { diff --git a/app/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php index f2305098a..2ddc249d8 100644 --- a/app/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php +++ b/app/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php @@ -73,7 +73,7 @@ public function listTables() */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', @@ -108,7 +108,7 @@ public function listTableForeignKeys($table, $database = null) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableViewDefinition($view) { @@ -116,7 +116,7 @@ protected function _getPortableViewDefinition($view) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableDefinition($table) { @@ -124,7 +124,7 @@ protected function _getPortableTableDefinition($table) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) { @@ -154,7 +154,7 @@ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableDatabaseDefinition($database) { @@ -162,7 +162,7 @@ protected function _getPortableDatabaseDefinition($database) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableColumnDefinition($tableColumn) { @@ -330,7 +330,7 @@ private function getMariaDb1027ColumnDefault(MariaDb1027Platform $platform, ?str } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableForeignKeysList($tableForeignKeys) { diff --git a/app/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php index 8b0d8e3cc..073752214 100644 --- a/app/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php +++ b/app/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php @@ -51,7 +51,7 @@ public function listTables() */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', @@ -86,7 +86,7 @@ public function listTableForeignKeys($table, $database = null) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableViewDefinition($view) { @@ -96,7 +96,7 @@ protected function _getPortableViewDefinition($view) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableDefinition($table) { @@ -106,7 +106,7 @@ protected function _getPortableTableDefinition($table) } /** - * {@inheritdoc} + * {@inheritDoc} * * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html */ @@ -137,7 +137,7 @@ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableColumnDefinition($tableColumn) { @@ -236,7 +236,7 @@ protected function _getPortableTableColumnDefinition($tableColumn) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableForeignKeysList($tableForeignKeys) { @@ -282,7 +282,7 @@ protected function _getPortableTableForeignKeyDefinition($tableForeignKey): Fore } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableSequenceDefinition($sequence) { @@ -296,7 +296,7 @@ protected function _getPortableSequenceDefinition($sequence) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableDatabaseDefinition($database) { @@ -306,7 +306,7 @@ protected function _getPortableDatabaseDefinition($database) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function createDatabase($database) { @@ -344,7 +344,7 @@ public function dropAutoincrement($table) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function dropTable($name) { diff --git a/app/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php index 7583c4d02..183ef5e6a 100644 --- a/app/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php +++ b/app/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php @@ -63,7 +63,7 @@ public function listTables() */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', @@ -218,7 +218,7 @@ public function determineExistingSchemaSearchPaths() } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableForeignKeyDefinition($tableForeignKey) { @@ -264,7 +264,7 @@ protected function _getPortableTableForeignKeyDefinition($tableForeignKey) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableViewDefinition($view) { @@ -272,7 +272,7 @@ protected function _getPortableViewDefinition($view) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableDefinition($table) { @@ -286,7 +286,7 @@ protected function _getPortableTableDefinition($table) } /** - * {@inheritdoc} + * {@inheritDoc} * * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html */ @@ -325,7 +325,7 @@ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableDatabaseDefinition($database) { @@ -333,7 +333,7 @@ protected function _getPortableDatabaseDefinition($database) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see listSchemaNames()} instead. */ @@ -350,7 +350,7 @@ protected function getPortableNamespaceDefinition(array $namespace) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableSequenceDefinition($sequence) { @@ -364,7 +364,7 @@ protected function _getPortableSequenceDefinition($sequence) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableColumnDefinition($tableColumn) { @@ -651,6 +651,7 @@ protected function selectTableColumns(string $databaseName, ?string $tableName = LEFT JOIN pg_depend d ON d.objid = c.oid AND d.deptype = 'e' + AND d.classid = (SELECT oid FROM pg_class WHERE relname = 'pg_class') SQL; $conditions = array_merge([ diff --git a/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php index 657e3651a..64538e689 100644 --- a/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php +++ b/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php @@ -55,7 +55,7 @@ public function listTables() */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', @@ -104,7 +104,7 @@ public function listSchemaNames(): array } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableSequenceDefinition($sequence) { @@ -112,7 +112,7 @@ protected function _getPortableSequenceDefinition($sequence) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableColumnDefinition($tableColumn) { @@ -209,7 +209,7 @@ private function parseDefaultExpression(string $value): ?string } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableForeignKeysList($tableForeignKeys) { @@ -239,7 +239,7 @@ protected function _getPortableTableForeignKeysList($tableForeignKeys) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) { @@ -253,7 +253,7 @@ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableForeignKeyDefinition($tableForeignKey) { @@ -267,7 +267,7 @@ protected function _getPortableTableForeignKeyDefinition($tableForeignKey) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableDefinition($table) { @@ -279,7 +279,7 @@ protected function _getPortableTableDefinition($table) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableDatabaseDefinition($database) { @@ -287,7 +287,7 @@ protected function _getPortableDatabaseDefinition($database) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see listSchemaNames()} instead. */ @@ -304,7 +304,7 @@ protected function getPortableNamespaceDefinition(array $namespace) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableViewDefinition($view) { @@ -313,7 +313,7 @@ protected function _getPortableViewDefinition($view) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function alterTable(TableDiff $tableDiff) { @@ -403,7 +403,7 @@ protected function selectTableNames(string $databaseName): Result ORDER BY name SQL; - return $this->_conn->executeQuery($sql, [$databaseName]); + return $this->_conn->executeQuery($sql); } protected function selectTableColumns(string $databaseName, ?string $tableName = null): Result diff --git a/app/vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php index c240ce212..a8f3e92a5 100644 --- a/app/vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php +++ b/app/vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php @@ -107,7 +107,7 @@ protected function fetchForeignKeyColumnsByTable(string $databaseName): array } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Delete the database file using the filesystem. */ @@ -127,7 +127,7 @@ public function dropDatabase($database) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated The engine will create the database file automatically. */ @@ -151,7 +151,7 @@ public function createDatabase($database) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function createForeignKey(ForeignKeyConstraint $foreignKey, $table) { @@ -163,7 +163,7 @@ public function createForeignKey(ForeignKeyConstraint $foreignKey, $table) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated Use {@see dropForeignKey()} and {@see createForeignKey()} instead. */ @@ -184,7 +184,7 @@ public function dropAndCreateForeignKey(ForeignKeyConstraint $foreignKey, $table } /** - * {@inheritdoc} + * {@inheritDoc} */ public function dropForeignKey($foreignKey, $table) { @@ -196,7 +196,7 @@ public function dropForeignKey($foreignKey, $table) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function listTableForeignKeys($table, $database = null) { @@ -213,7 +213,7 @@ public function listTableForeignKeys($table, $database = null) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableDefinition($table) { @@ -221,7 +221,7 @@ protected function _getPortableTableDefinition($table) } /** - * {@inheritdoc} + * {@inheritDoc} * * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html */ @@ -285,7 +285,7 @@ static function (array $a, array $b): int { } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableColumnList($table, $database, $tableColumns) { @@ -352,7 +352,7 @@ protected function _getPortableTableColumnList($table, $database, $tableColumns) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableColumnDefinition($tableColumn) { @@ -431,7 +431,7 @@ protected function _getPortableTableColumnDefinition($tableColumn) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableViewDefinition($view) { @@ -439,7 +439,7 @@ protected function _getPortableViewDefinition($view) } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function _getPortableTableForeignKeysList($tableForeignKeys) { diff --git a/app/vendor/doctrine/dbal/src/Schema/Table.php b/app/vendor/doctrine/dbal/src/Schema/Table.php index 7fbd6091a..ce4cc3260 100644 --- a/app/vendor/doctrine/dbal/src/Schema/Table.php +++ b/app/vendor/doctrine/dbal/src/Schema/Table.php @@ -724,7 +724,7 @@ public function getColumns() */ public function getForeignKeyColumns() { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5731', '%s is deprecated. Use getForeignKey() and ForeignKeyConstraint::getLocalColumns() instead.', @@ -813,7 +813,7 @@ public function getPrimaryKey() */ public function getPrimaryKeyColumns() { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5731', '%s is deprecated. Use getPrimaryKey() and Index::getColumns() instead.', diff --git a/app/vendor/doctrine/dbal/src/Schema/TableDiff.php b/app/vendor/doctrine/dbal/src/Schema/TableDiff.php index 58128d75b..9aaf9e770 100644 --- a/app/vendor/doctrine/dbal/src/Schema/TableDiff.php +++ b/app/vendor/doctrine/dbal/src/Schema/TableDiff.php @@ -180,11 +180,11 @@ public function __construct( $this->changedForeignKeys = $changedForeignKeys; $this->removedForeignKeys = $removedForeignKeys; - if ($fromTable !== null) { + if ($fromTable === null) { Deprecation::trigger( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5678', - 'Not passing the $fromColumn to %s is deprecated.', + 'Not passing the $fromTable to %s is deprecated.', __METHOD__, ); } diff --git a/app/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php b/app/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php index 85502e714..f353f303a 100644 --- a/app/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php +++ b/app/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php @@ -57,7 +57,7 @@ public function __construct(string $name, array $columns, array $flags = [], arr } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getColumns() { @@ -65,7 +65,7 @@ public function getColumns() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getQuotedColumns(AbstractPlatform $platform) { diff --git a/app/vendor/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php b/app/vendor/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php index 3d2ad27c0..f8f3b5825 100644 --- a/app/vendor/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php +++ b/app/vendor/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php @@ -21,7 +21,7 @@ public function acceptSchema(Schema $schema) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptNamespace($namespaceName) { diff --git a/app/vendor/doctrine/dbal/src/Schema/Visitor/CreateSchemaSqlCollector.php b/app/vendor/doctrine/dbal/src/Schema/Visitor/CreateSchemaSqlCollector.php index e7908c3ee..bab0ff982 100644 --- a/app/vendor/doctrine/dbal/src/Schema/Visitor/CreateSchemaSqlCollector.php +++ b/app/vendor/doctrine/dbal/src/Schema/Visitor/CreateSchemaSqlCollector.php @@ -39,7 +39,7 @@ public function __construct(AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptNamespace($namespaceName) { @@ -51,7 +51,7 @@ public function acceptNamespace($namespaceName) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptTable(Table $table) { @@ -59,7 +59,7 @@ public function acceptTable(Table $table) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) { @@ -71,7 +71,7 @@ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkCons } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptSequence(Sequence $sequence) { diff --git a/app/vendor/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php b/app/vendor/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php index 0c5730258..ddec6b4ae 100644 --- a/app/vendor/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php +++ b/app/vendor/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php @@ -38,7 +38,7 @@ public function __construct(AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptTable(Table $table) { @@ -46,7 +46,7 @@ public function acceptTable(Table $table) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) { @@ -58,7 +58,7 @@ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkCons } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptSequence(Sequence $sequence) { diff --git a/app/vendor/doctrine/dbal/src/Schema/Visitor/Graphviz.php b/app/vendor/doctrine/dbal/src/Schema/Visitor/Graphviz.php index e3c61411e..5eff0d945 100644 --- a/app/vendor/doctrine/dbal/src/Schema/Visitor/Graphviz.php +++ b/app/vendor/doctrine/dbal/src/Schema/Visitor/Graphviz.php @@ -21,7 +21,7 @@ class Graphviz extends AbstractVisitor private string $output = ''; /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) { @@ -37,7 +37,7 @@ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkCons } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptSchema(Schema $schema) { @@ -50,7 +50,7 @@ public function acceptSchema(Schema $schema) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptTable(Table $table) { diff --git a/app/vendor/doctrine/dbal/src/Schema/Visitor/RemoveNamespacedAssets.php b/app/vendor/doctrine/dbal/src/Schema/Visitor/RemoveNamespacedAssets.php index c67bf99e8..5ed349bfd 100644 --- a/app/vendor/doctrine/dbal/src/Schema/Visitor/RemoveNamespacedAssets.php +++ b/app/vendor/doctrine/dbal/src/Schema/Visitor/RemoveNamespacedAssets.php @@ -36,7 +36,7 @@ public function __construct() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptSchema(Schema $schema) { @@ -44,7 +44,7 @@ public function acceptSchema(Schema $schema) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptTable(Table $table) { @@ -60,7 +60,7 @@ public function acceptTable(Table $table) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptSequence(Sequence $sequence) { @@ -76,7 +76,7 @@ public function acceptSequence(Sequence $sequence) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) { diff --git a/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php b/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php index 4748d717b..1d10d4f0c 100644 --- a/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php +++ b/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php @@ -137,7 +137,7 @@ protected function configure() } /** - * {@inheritdoc} + * {@inheritDoc} * * @return int * diff --git a/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php b/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php index 5f4f7a92f..874b4193f 100644 --- a/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php +++ b/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php @@ -56,7 +56,7 @@ protected function configure() } /** - * {@inheritdoc} + * {@inheritDoc} * * @return int * diff --git a/app/vendor/doctrine/dbal/src/Tools/DsnParser.php b/app/vendor/doctrine/dbal/src/Tools/DsnParser.php index f048f585e..854f55ecb 100644 --- a/app/vendor/doctrine/dbal/src/Tools/DsnParser.php +++ b/app/vendor/doctrine/dbal/src/Tools/DsnParser.php @@ -38,8 +38,8 @@ public function parse( #[SensitiveParameter] string $dsn ): array { - // (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid - $url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localhost/', $dsn); + // (pdo-)?sqlite3?:///... => (pdo-)?sqlite3?://localhost/... or else the URL will be invalid + $url = preg_replace('#^((?:pdo-)?sqlite3?):///#', '$1://localhost/', $dsn); assert($url !== null); $url = parse_url($url); diff --git a/app/vendor/doctrine/dbal/src/Types/ArrayType.php b/app/vendor/doctrine/dbal/src/Types/ArrayType.php index fb202406f..c2aa2f4de 100644 --- a/app/vendor/doctrine/dbal/src/Types/ArrayType.php +++ b/app/vendor/doctrine/dbal/src/Types/ArrayType.php @@ -23,7 +23,7 @@ class ArrayType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -31,7 +31,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function convertToDatabaseValue($value, AbstractPlatform $platform) { @@ -40,7 +40,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { @@ -66,7 +66,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -74,7 +74,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/AsciiStringType.php b/app/vendor/doctrine/dbal/src/Types/AsciiStringType.php index ab1e0e061..4ea92d974 100644 --- a/app/vendor/doctrine/dbal/src/Types/AsciiStringType.php +++ b/app/vendor/doctrine/dbal/src/Types/AsciiStringType.php @@ -10,7 +10,7 @@ final class AsciiStringType extends StringType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform): string { diff --git a/app/vendor/doctrine/dbal/src/Types/BigIntType.php b/app/vendor/doctrine/dbal/src/Types/BigIntType.php index 795883b3a..8d57a1121 100644 --- a/app/vendor/doctrine/dbal/src/Types/BigIntType.php +++ b/app/vendor/doctrine/dbal/src/Types/BigIntType.php @@ -11,7 +11,7 @@ class BigIntType extends Type implements PhpIntegerMappingType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -19,7 +19,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -27,7 +27,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getBindingType() { @@ -35,7 +35,7 @@ public function getBindingType() } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * diff --git a/app/vendor/doctrine/dbal/src/Types/BinaryType.php b/app/vendor/doctrine/dbal/src/Types/BinaryType.php index e030f1660..acbbd87ad 100644 --- a/app/vendor/doctrine/dbal/src/Types/BinaryType.php +++ b/app/vendor/doctrine/dbal/src/Types/BinaryType.php @@ -18,7 +18,7 @@ class BinaryType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -26,7 +26,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { @@ -50,7 +50,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -58,7 +58,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getBindingType() { diff --git a/app/vendor/doctrine/dbal/src/Types/BlobType.php b/app/vendor/doctrine/dbal/src/Types/BlobType.php index b71e7255e..cfaabec90 100644 --- a/app/vendor/doctrine/dbal/src/Types/BlobType.php +++ b/app/vendor/doctrine/dbal/src/Types/BlobType.php @@ -18,7 +18,7 @@ class BlobType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -26,7 +26,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { @@ -50,7 +50,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -58,7 +58,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getBindingType() { diff --git a/app/vendor/doctrine/dbal/src/Types/BooleanType.php b/app/vendor/doctrine/dbal/src/Types/BooleanType.php index 440ca72bd..7dc7f3a9d 100644 --- a/app/vendor/doctrine/dbal/src/Types/BooleanType.php +++ b/app/vendor/doctrine/dbal/src/Types/BooleanType.php @@ -13,7 +13,7 @@ class BooleanType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -21,7 +21,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function convertToDatabaseValue($value, AbstractPlatform $platform) { @@ -29,7 +29,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -43,7 +43,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -51,7 +51,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getBindingType() { diff --git a/app/vendor/doctrine/dbal/src/Types/DateImmutableType.php b/app/vendor/doctrine/dbal/src/Types/DateImmutableType.php index 86f054470..da96b69d5 100644 --- a/app/vendor/doctrine/dbal/src/Types/DateImmutableType.php +++ b/app/vendor/doctrine/dbal/src/Types/DateImmutableType.php @@ -12,7 +12,7 @@ class DateImmutableType extends DateType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -20,7 +20,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -46,7 +46,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -74,7 +74,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/DateIntervalType.php b/app/vendor/doctrine/dbal/src/Types/DateIntervalType.php index ac4885d97..32b32c8d4 100644 --- a/app/vendor/doctrine/dbal/src/Types/DateIntervalType.php +++ b/app/vendor/doctrine/dbal/src/Types/DateIntervalType.php @@ -17,7 +17,7 @@ class DateIntervalType extends Type public const FORMAT = '%RP%YY%MM%DDT%HH%IM%SS'; /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -25,7 +25,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -35,7 +35,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -57,7 +57,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -92,7 +92,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php b/app/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php index cb1a17f29..8da25be52 100644 --- a/app/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php +++ b/app/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php @@ -14,7 +14,7 @@ class DateTimeImmutableType extends DateTimeType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -22,7 +22,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -48,7 +48,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -80,7 +80,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/DateTimeType.php b/app/vendor/doctrine/dbal/src/Types/DateTimeType.php index 4a75dfd7e..f1e5fb5e1 100644 --- a/app/vendor/doctrine/dbal/src/Types/DateTimeType.php +++ b/app/vendor/doctrine/dbal/src/Types/DateTimeType.php @@ -14,7 +14,7 @@ class DateTimeType extends Type implements PhpDateTimeMappingType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -22,7 +22,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -30,7 +30,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -52,7 +52,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * diff --git a/app/vendor/doctrine/dbal/src/Types/DateTimeTzImmutableType.php b/app/vendor/doctrine/dbal/src/Types/DateTimeTzImmutableType.php index aab826aa4..f3a4b884d 100644 --- a/app/vendor/doctrine/dbal/src/Types/DateTimeTzImmutableType.php +++ b/app/vendor/doctrine/dbal/src/Types/DateTimeTzImmutableType.php @@ -12,7 +12,7 @@ class DateTimeTzImmutableType extends DateTimeTzType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -20,7 +20,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @psalm-param T $value * @@ -46,7 +46,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -74,7 +74,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/DateTimeTzType.php b/app/vendor/doctrine/dbal/src/Types/DateTimeTzType.php index c3f3fc9cb..c105093bd 100644 --- a/app/vendor/doctrine/dbal/src/Types/DateTimeTzType.php +++ b/app/vendor/doctrine/dbal/src/Types/DateTimeTzType.php @@ -25,7 +25,7 @@ class DateTimeTzType extends Type implements PhpDateTimeMappingType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -33,7 +33,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -41,7 +41,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -67,7 +67,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * diff --git a/app/vendor/doctrine/dbal/src/Types/DateType.php b/app/vendor/doctrine/dbal/src/Types/DateType.php index 7ce9656a7..3ba850058 100644 --- a/app/vendor/doctrine/dbal/src/Types/DateType.php +++ b/app/vendor/doctrine/dbal/src/Types/DateType.php @@ -12,7 +12,7 @@ class DateType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -20,7 +20,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -28,7 +28,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @psalm-param T $value * @@ -50,7 +50,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * diff --git a/app/vendor/doctrine/dbal/src/Types/DecimalType.php b/app/vendor/doctrine/dbal/src/Types/DecimalType.php index 144e97a04..308134b08 100644 --- a/app/vendor/doctrine/dbal/src/Types/DecimalType.php +++ b/app/vendor/doctrine/dbal/src/Types/DecimalType.php @@ -16,7 +16,7 @@ class DecimalType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -24,7 +24,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -32,7 +32,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { diff --git a/app/vendor/doctrine/dbal/src/Types/FloatType.php b/app/vendor/doctrine/dbal/src/Types/FloatType.php index d8cb33557..e01b77413 100644 --- a/app/vendor/doctrine/dbal/src/Types/FloatType.php +++ b/app/vendor/doctrine/dbal/src/Types/FloatType.php @@ -7,7 +7,7 @@ class FloatType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -15,7 +15,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -23,7 +23,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * diff --git a/app/vendor/doctrine/dbal/src/Types/GuidType.php b/app/vendor/doctrine/dbal/src/Types/GuidType.php index 6ce903e2b..3c8b7f4f8 100644 --- a/app/vendor/doctrine/dbal/src/Types/GuidType.php +++ b/app/vendor/doctrine/dbal/src/Types/GuidType.php @@ -11,7 +11,7 @@ class GuidType extends StringType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -19,7 +19,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -27,7 +27,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/IntegerType.php b/app/vendor/doctrine/dbal/src/Types/IntegerType.php index 57ba7087e..7c2d7110d 100644 --- a/app/vendor/doctrine/dbal/src/Types/IntegerType.php +++ b/app/vendor/doctrine/dbal/src/Types/IntegerType.php @@ -11,7 +11,7 @@ class IntegerType extends Type implements PhpIntegerMappingType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -19,7 +19,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -27,7 +27,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -41,7 +41,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getBindingType() { diff --git a/app/vendor/doctrine/dbal/src/Types/JsonType.php b/app/vendor/doctrine/dbal/src/Types/JsonType.php index 797f5bc3d..27f872c88 100644 --- a/app/vendor/doctrine/dbal/src/Types/JsonType.php +++ b/app/vendor/doctrine/dbal/src/Types/JsonType.php @@ -20,7 +20,7 @@ class JsonType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -28,7 +28,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -50,7 +50,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { @@ -70,7 +70,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -78,7 +78,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/ObjectType.php b/app/vendor/doctrine/dbal/src/Types/ObjectType.php index 1c497a3ff..497e9c407 100644 --- a/app/vendor/doctrine/dbal/src/Types/ObjectType.php +++ b/app/vendor/doctrine/dbal/src/Types/ObjectType.php @@ -20,7 +20,7 @@ class ObjectType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -28,7 +28,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param mixed $value * @@ -40,7 +40,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { @@ -62,7 +62,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -70,7 +70,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/SimpleArrayType.php b/app/vendor/doctrine/dbal/src/Types/SimpleArrayType.php index 0961ae398..ee97b9b9f 100644 --- a/app/vendor/doctrine/dbal/src/Types/SimpleArrayType.php +++ b/app/vendor/doctrine/dbal/src/Types/SimpleArrayType.php @@ -20,7 +20,7 @@ class SimpleArrayType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -28,7 +28,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param mixed $value * @@ -44,7 +44,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param mixed $value * @@ -62,7 +62,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -70,7 +70,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/SmallIntType.php b/app/vendor/doctrine/dbal/src/Types/SmallIntType.php index e38f4ca72..2c8567a11 100644 --- a/app/vendor/doctrine/dbal/src/Types/SmallIntType.php +++ b/app/vendor/doctrine/dbal/src/Types/SmallIntType.php @@ -11,7 +11,7 @@ class SmallIntType extends Type implements PhpIntegerMappingType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -19,7 +19,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -27,7 +27,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -41,7 +41,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getBindingType() { diff --git a/app/vendor/doctrine/dbal/src/Types/StringType.php b/app/vendor/doctrine/dbal/src/Types/StringType.php index e409c2a8f..1992e8fa4 100644 --- a/app/vendor/doctrine/dbal/src/Types/StringType.php +++ b/app/vendor/doctrine/dbal/src/Types/StringType.php @@ -10,7 +10,7 @@ class StringType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -18,7 +18,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { diff --git a/app/vendor/doctrine/dbal/src/Types/TextType.php b/app/vendor/doctrine/dbal/src/Types/TextType.php index b1e640b69..d060bb2da 100644 --- a/app/vendor/doctrine/dbal/src/Types/TextType.php +++ b/app/vendor/doctrine/dbal/src/Types/TextType.php @@ -13,7 +13,7 @@ class TextType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -21,7 +21,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { @@ -29,7 +29,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { diff --git a/app/vendor/doctrine/dbal/src/Types/TimeImmutableType.php b/app/vendor/doctrine/dbal/src/Types/TimeImmutableType.php index a3f0040b4..117abeed2 100644 --- a/app/vendor/doctrine/dbal/src/Types/TimeImmutableType.php +++ b/app/vendor/doctrine/dbal/src/Types/TimeImmutableType.php @@ -12,7 +12,7 @@ class TimeImmutableType extends TimeType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -20,7 +20,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -46,7 +46,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -74,7 +74,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/TimeType.php b/app/vendor/doctrine/dbal/src/Types/TimeType.php index 0123d4ba8..faab69bf0 100644 --- a/app/vendor/doctrine/dbal/src/Types/TimeType.php +++ b/app/vendor/doctrine/dbal/src/Types/TimeType.php @@ -12,7 +12,7 @@ class TimeType extends Type { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -20,7 +20,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getSQLDeclaration(array $column, AbstractPlatform $platform) { @@ -28,7 +28,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -50,7 +50,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * diff --git a/app/vendor/doctrine/dbal/src/Types/Type.php b/app/vendor/doctrine/dbal/src/Types/Type.php index 536cf36f2..2b49248ec 100644 --- a/app/vendor/doctrine/dbal/src/Types/Type.php +++ b/app/vendor/doctrine/dbal/src/Types/Type.php @@ -100,7 +100,8 @@ abstract public function getSQLDeclaration(array $column, AbstractPlatform $plat /** * Gets the name of this type. * - * @deprecated this method will be removed in Doctrine DBAL 4.0. + * @deprecated this method will be removed in Doctrine DBAL 4.0, + * use {@see TypeRegistry::lookupName()} instead. * * @return string */ diff --git a/app/vendor/doctrine/dbal/src/Types/VarDateTimeImmutableType.php b/app/vendor/doctrine/dbal/src/Types/VarDateTimeImmutableType.php index 9ac690514..94cc0ad4c 100644 --- a/app/vendor/doctrine/dbal/src/Types/VarDateTimeImmutableType.php +++ b/app/vendor/doctrine/dbal/src/Types/VarDateTimeImmutableType.php @@ -14,7 +14,7 @@ class VarDateTimeImmutableType extends VarDateTimeType { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getName() { @@ -22,7 +22,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -48,7 +48,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * @@ -72,7 +72,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } /** - * {@inheritdoc} + * {@inheritDoc} * * @deprecated */ diff --git a/app/vendor/doctrine/dbal/src/Types/VarDateTimeType.php b/app/vendor/doctrine/dbal/src/Types/VarDateTimeType.php index 58c1208af..252f97893 100644 --- a/app/vendor/doctrine/dbal/src/Types/VarDateTimeType.php +++ b/app/vendor/doctrine/dbal/src/Types/VarDateTimeType.php @@ -18,7 +18,7 @@ class VarDateTimeType extends DateTimeType { /** - * {@inheritdoc} + * {@inheritDoc} * * @param T $value * diff --git a/app/vendor/doctrine/dbal/static-analysis/driver-manager-get-available-drivers-return-type.php b/app/vendor/doctrine/dbal/static-analysis/driver-manager-get-available-drivers-return-type.php deleted file mode 100644 index e8beff908..000000000 --- a/app/vendor/doctrine/dbal/static-analysis/driver-manager-get-available-drivers-return-type.php +++ /dev/null @@ -1,18 +0,0 @@ - $driver]); diff --git a/app/vendor/doctrine/dbal/static-analysis/driver-manager-retrieves-correct-connection-type.php b/app/vendor/doctrine/dbal/static-analysis/driver-manager-retrieves-correct-connection-type.php deleted file mode 100644 index 566db2474..000000000 --- a/app/vendor/doctrine/dbal/static-analysis/driver-manager-retrieves-correct-connection-type.php +++ /dev/null @@ -1,19 +0,0 @@ - MyConnection::class, - ]); -} diff --git a/app/vendor/doctrine/deprecations/LICENSE b/app/vendor/doctrine/deprecations/LICENSE new file mode 100644 index 000000000..156905cdd --- /dev/null +++ b/app/vendor/doctrine/deprecations/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-2021 Doctrine Project + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/app/vendor/doctrine/deprecations/README.md b/app/vendor/doctrine/deprecations/README.md index 22f0cced3..93caf83f8 100644 --- a/app/vendor/doctrine/deprecations/README.md +++ b/app/vendor/doctrine/deprecations/README.md @@ -19,13 +19,16 @@ Enable Doctrine deprecations to be sent to a PSR3 logger: ``` Enable Doctrine deprecations to be sent as `@trigger_error($message, E_USER_DEPRECATED)` -messages. +messages by setting the `DOCTRINE_DEPRECATIONS` environment variable to `trigger`. +Alternatively, call: ```php \Doctrine\Deprecations\Deprecation::enableWithTriggerError(); ``` -If you only want to enable deprecation tracking, without logging or calling `trigger_error` then call: +If you only want to enable deprecation tracking, without logging or calling `trigger_error` +then set the `DOCTRINE_DEPRECATIONS` environment variable to `track`. +Alternatively, call: ```php \Doctrine\Deprecations\Deprecation::enableTrackingDeprecations(); diff --git a/app/vendor/doctrine/deprecations/composer.json b/app/vendor/doctrine/deprecations/composer.json index c79e38cdc..f8319f9a2 100644 --- a/app/vendor/doctrine/deprecations/composer.json +++ b/app/vendor/doctrine/deprecations/composer.json @@ -1,22 +1,28 @@ { "name": "doctrine/deprecations", - "type": "library", "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/", "license": "MIT", + "type": "library", + "homepage": "https://www.doctrine-project.org/", "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3", - "doctrine/coding-standard": "^9" + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" }, "autoload": { - "psr-4": {"Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"} + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } }, "autoload-dev": { "psr-4": { diff --git a/app/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php b/app/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php index 1029372fa..07cb43b6c 100644 --- a/app/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php +++ b/app/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php @@ -8,6 +8,7 @@ use function array_key_exists; use function array_reduce; +use function assert; use function debug_backtrace; use function sprintf; use function strpos; @@ -46,8 +47,8 @@ class Deprecation private const TYPE_TRIGGER_ERROR = 2; private const TYPE_PSR_LOGGER = 4; - /** @var int */ - private static $type = self::TYPE_NONE; + /** @var int-mask-of|null */ + private static $type; /** @var LoggerInterface|null */ private static $logger; @@ -56,6 +57,9 @@ class Deprecation private static $ignoredPackages = []; /** @var array */ + private static $triggeredDeprecations = []; + + /** @var array */ private static $ignoredLinks = []; /** @var bool */ @@ -68,21 +72,27 @@ class Deprecation * deprecation. It is additionally used to de-duplicate the trigger of the * same deprecation during a request. * - * @param mixed $args + * @param float|int|string $args */ public static function trigger(string $package, string $link, string $message, ...$args): void { - if (self::$type === self::TYPE_NONE) { + $type = self::$type ?? self::getTypeFromEnv(); + + if ($type === self::TYPE_NONE) { + return; + } + + if (isset(self::$ignoredLinks[$link])) { return; } - if (array_key_exists($link, self::$ignoredLinks)) { - self::$ignoredLinks[$link]++; + if (array_key_exists($link, self::$triggeredDeprecations)) { + self::$triggeredDeprecations[$link]++; } else { - self::$ignoredLinks[$link] = 1; + self::$triggeredDeprecations[$link] = 1; } - if (self::$deduplication === true && self::$ignoredLinks[$link] > 1) { + if (self::$deduplication === true && self::$triggeredDeprecations[$link] > 1) { return; } @@ -114,18 +124,20 @@ public static function trigger(string $package, string $link, string $message, . * deprecation tracking is enabled even during deduplication, because it * needs to call {@link debug_backtrace()} * - * @param mixed $args + * @param float|int|string $args */ public static function triggerIfCalledFromOutside(string $package, string $link, string $message, ...$args): void { - if (self::$type === self::TYPE_NONE) { + $type = self::$type ?? self::getTypeFromEnv(); + + if ($type === self::TYPE_NONE) { return; } $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); // first check that the caller is not from a tests folder, in which case we always let deprecations pass - if (strpos($backtrace[1]['file'], DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR) === false) { + if (isset($backtrace[1]['file'], $backtrace[0]['file']) && strpos($backtrace[1]['file'], DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR) === false) { $path = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR; if (strpos($backtrace[0]['file'], $path) === false) { @@ -137,13 +149,17 @@ public static function triggerIfCalledFromOutside(string $package, string $link, } } - if (array_key_exists($link, self::$ignoredLinks)) { - self::$ignoredLinks[$link]++; + if (isset(self::$ignoredLinks[$link])) { + return; + } + + if (array_key_exists($link, self::$triggeredDeprecations)) { + self::$triggeredDeprecations[$link]++; } else { - self::$ignoredLinks[$link] = 1; + self::$triggeredDeprecations[$link] = 1; } - if (self::$deduplication === true && self::$ignoredLinks[$link] > 1) { + if (self::$deduplication === true && self::$triggeredDeprecations[$link] > 1) { return; } @@ -157,31 +173,35 @@ public static function triggerIfCalledFromOutside(string $package, string $link, } /** - * @param array $backtrace + * @param list $backtrace */ private static function delegateTriggerToBackend(string $message, array $backtrace, string $link, string $package): void { - if ((self::$type & self::TYPE_PSR_LOGGER) > 0) { + $type = self::$type ?? self::getTypeFromEnv(); + + if (($type & self::TYPE_PSR_LOGGER) > 0) { $context = [ - 'file' => $backtrace[0]['file'], - 'line' => $backtrace[0]['line'], + 'file' => $backtrace[0]['file'] ?? null, + 'line' => $backtrace[0]['line'] ?? null, 'package' => $package, 'link' => $link, ]; + assert(self::$logger !== null); + self::$logger->notice($message, $context); } - if (! ((self::$type & self::TYPE_TRIGGER_ERROR) > 0)) { + if (! (($type & self::TYPE_TRIGGER_ERROR) > 0)) { return; } $message .= sprintf( ' (%s:%d called by %s:%d, %s, package %s)', - self::basename($backtrace[0]['file']), - $backtrace[0]['line'], - self::basename($backtrace[1]['file']), - $backtrace[1]['line'], + self::basename($backtrace[0]['file'] ?? 'native code'), + $backtrace[0]['line'] ?? 0, + self::basename($backtrace[1]['file'] ?? 'native code'), + $backtrace[1]['line'] ?? 0, $link, $package ); @@ -205,16 +225,19 @@ private static function basename(string $filename): string public static function enableTrackingDeprecations(): void { + self::$type = self::$type ?? 0; self::$type |= self::TYPE_TRACK_DEPRECATIONS; } public static function enableWithTriggerError(): void { + self::$type = self::$type ?? 0; self::$type |= self::TYPE_TRIGGER_ERROR; } public static function enableWithPsrLogger(LoggerInterface $logger): void { + self::$type = self::$type ?? 0; self::$type |= self::TYPE_PSR_LOGGER; self::$logger = $logger; } @@ -229,9 +252,10 @@ public static function disable(): void self::$type = self::TYPE_NONE; self::$logger = null; self::$deduplication = true; + self::$ignoredLinks = []; - foreach (self::$ignoredLinks as $link => $count) { - self::$ignoredLinks[$link] = 0; + foreach (self::$triggeredDeprecations as $link => $count) { + self::$triggeredDeprecations[$link] = 0; } } @@ -243,13 +267,13 @@ public static function ignorePackage(string $packageName): void public static function ignoreDeprecations(string ...$links): void { foreach ($links as $link) { - self::$ignoredLinks[$link] = 0; + self::$ignoredLinks[$link] = true; } } public static function getUniqueTriggeredDeprecationsCount(): int { - return array_reduce(self::$ignoredLinks, static function (int $carry, int $count) { + return array_reduce(self::$triggeredDeprecations, static function (int $carry, int $count) { return $carry + $count; }, 0); } @@ -261,6 +285,28 @@ public static function getUniqueTriggeredDeprecationsCount(): int */ public static function getTriggeredDeprecations(): array { - return self::$ignoredLinks; + return self::$triggeredDeprecations; + } + + /** + * @return int-mask-of + */ + private static function getTypeFromEnv(): int + { + switch ($_SERVER['DOCTRINE_DEPRECATIONS'] ?? $_ENV['DOCTRINE_DEPRECATIONS'] ?? null) { + case 'trigger': + self::$type = self::TYPE_TRIGGER_ERROR; + break; + + case 'track': + self::$type = self::TYPE_TRACK_DEPRECATIONS; + break; + + default: + self::$type = self::TYPE_NONE; + break; + } + + return self::$type; } } diff --git a/app/vendor/doctrine/deprecations/phpstan.neon b/app/vendor/doctrine/deprecations/phpstan.neon new file mode 100644 index 000000000..4ee286b8a --- /dev/null +++ b/app/vendor/doctrine/deprecations/phpstan.neon @@ -0,0 +1,9 @@ +parameters: + level: 6 + paths: + - lib + - tests + +includes: + - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-phpunit/rules.neon diff --git a/app/vendor/doctrine/deprecations/psalm.xml b/app/vendor/doctrine/deprecations/psalm.xml new file mode 100644 index 000000000..ad76e32e3 --- /dev/null +++ b/app/vendor/doctrine/deprecations/psalm.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/vendor/doctrine/deprecations/test_fixtures/vendor/doctrine/foo/Bar.php b/app/vendor/doctrine/deprecations/test_fixtures/vendor/doctrine/foo/Bar.php deleted file mode 100644 index 2a84f1ac5..000000000 --- a/app/vendor/doctrine/deprecations/test_fixtures/vendor/doctrine/foo/Bar.php +++ /dev/null @@ -1,24 +0,0 @@ -oldFunc(); - } -} diff --git a/app/vendor/doctrine/deprecations/test_fixtures/vendor/doctrine/foo/Baz.php b/app/vendor/doctrine/deprecations/test_fixtures/vendor/doctrine/foo/Baz.php deleted file mode 100644 index 62b2bb103..000000000 --- a/app/vendor/doctrine/deprecations/test_fixtures/vendor/doctrine/foo/Baz.php +++ /dev/null @@ -1,14 +0,0 @@ -oldFunc(); - } -} diff --git a/app/vendor/laminas/laminas-diactoros/composer.json b/app/vendor/laminas/laminas-diactoros/composer.json index 372101110..c141b3843 100644 --- a/app/vendor/laminas/laminas-diactoros/composer.json +++ b/app/vendor/laminas/laminas-diactoros/composer.json @@ -36,7 +36,7 @@ "require": { "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1" }, "require-dev": { "ext-curl": "*", @@ -44,11 +44,11 @@ "ext-gd": "*", "ext-libxml": "*", "http-interop/http-factory-tests": "^0.9.0", - "laminas/laminas-coding-standard": "^2.4.0", + "laminas/laminas-coding-standard": "^2.5", "php-http/psr7-integration-tests": "^1.2", - "phpunit/phpunit": "^9.5.27", + "phpunit/phpunit": "^9.5.28", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.4" + "vimeo/psalm": "^5.6" }, "provide": { "psr/http-factory-implementation": "1.0", diff --git a/app/vendor/laminas/laminas-diactoros/src/HeaderSecurity.php b/app/vendor/laminas/laminas-diactoros/src/HeaderSecurity.php index 08a5e3c3e..d12486aeb 100644 --- a/app/vendor/laminas/laminas-diactoros/src/HeaderSecurity.php +++ b/app/vendor/laminas/laminas-diactoros/src/HeaderSecurity.php @@ -154,7 +154,7 @@ public static function assertValidName(mixed $name): void is_object($name) ? $name::class : gettype($name) )); } - if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $name)) { + if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $name)) { throw new Exception\InvalidArgumentException(sprintf( '"%s" is not valid header name', $name diff --git a/app/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/FilterUsingXForwardedHeaders.php b/app/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/FilterUsingXForwardedHeaders.php index 2327646d5..1ddcb5339 100644 --- a/app/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/FilterUsingXForwardedHeaders.php +++ b/app/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/FilterUsingXForwardedHeaders.php @@ -6,8 +6,11 @@ use Laminas\Diactoros\Exception\InvalidForwardedHeaderNameException; use Laminas\Diactoros\Exception\InvalidProxyAddressException; +use Laminas\Diactoros\UriFactory; use Psr\Http\Message\ServerRequestInterface; +use function assert; +use function count; use function explode; use function filter_var; use function in_array; @@ -76,7 +79,12 @@ public function __invoke(ServerRequestInterface $request): ServerRequestInterfac switch ($headerName) { case self::HEADER_HOST: - $uri = $uri->withHost($header); + [$host, $port] = UriFactory::marshalHostAndPortFromHeader($header); + $uri = $uri + ->withHost($host); + if ($port !== null) { + $uri = $uri->withPort($port); + } break; case self::HEADER_PORT: $uri = $uri->withPort((int) $header); @@ -224,7 +232,9 @@ private static function validateProxyCIDR(mixed $cidr): bool $address = $cidr; $mask = null; if (str_contains($cidr, '/')) { - [$address, $mask] = explode('/', $cidr, 2); + $parts = explode('/', $cidr, 2); + assert(count($parts) >= 2); + [$address, $mask] = $parts; $mask = (int) $mask; } diff --git a/app/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/IPRange.php b/app/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/IPRange.php index cdf16d0bc..fbdb65ee8 100644 --- a/app/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/IPRange.php +++ b/app/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/IPRange.php @@ -4,6 +4,8 @@ namespace Laminas\Diactoros\ServerRequestFilter; +use function assert; +use function count; use function explode; use function inet_pton; use function intval; @@ -43,7 +45,9 @@ public static function matchesIPv4(string $ip, string $cidr): bool $subnet = $cidr; if (str_contains($cidr, '/')) { - [$subnet, $mask] = explode('/', $cidr, 2); + $parts = explode('/', $cidr, 2); + assert(count($parts) >= 2); + [$subnet, $mask] = $parts; $mask = (int) $mask; } @@ -73,7 +77,9 @@ public static function matchesIPv6(string $ip, string $cidr): bool $subnet = $cidr; if (str_contains($cidr, '/')) { - [$subnet, $mask] = explode('/', $cidr, 2); + $parts = explode('/', $cidr, 2); + assert(count($parts) >= 2); + [$subnet, $mask] = $parts; $mask = (int) $mask; } diff --git a/app/vendor/laminas/laminas-diactoros/src/Stream.php b/app/vendor/laminas/laminas-diactoros/src/Stream.php index e3ef4717f..96c0982eb 100644 --- a/app/vendor/laminas/laminas-diactoros/src/Stream.php +++ b/app/vendor/laminas/laminas-diactoros/src/Stream.php @@ -44,11 +44,11 @@ class Stream implements StreamInterface, Stringable /** @var resource|null */ protected $resource; - /** @var string|resource */ + /** @var string|object|resource|null */ protected $stream; /** - * @param string|resource $stream + * @param string|object|resource $stream * @param string $mode Mode with which to open stream * @throws Exception\InvalidArgumentException */ @@ -103,7 +103,7 @@ public function detach() /** * Attach a new stream/resource to the instance. * - * @param string|resource $resource + * @param string|object|resource $resource * @throws Exception\InvalidArgumentException For stream identifier that cannot be cast to a resource. * @throws Exception\InvalidArgumentException For non-resource stream. */ @@ -313,7 +313,7 @@ public function getMetadata($key = null) /** * Set the internal stream resource. * - * @param string|resource $stream String stream target or stream resource. + * @param string|object|resource $stream String stream target or stream resource. * @param string $mode Resource mode for stream target. * @throws Exception\InvalidArgumentException For invalid streams or resources. */ diff --git a/app/vendor/laminas/laminas-diactoros/src/Uri.php b/app/vendor/laminas/laminas-diactoros/src/Uri.php index 95c7af936..59f776eee 100644 --- a/app/vendor/laminas/laminas-diactoros/src/Uri.php +++ b/app/vendor/laminas/laminas-diactoros/src/Uri.php @@ -38,6 +38,8 @@ * might change state are implemented such that they retain the internal * state of the current instance and return a new instance that contains the * changed state. + * + * @psalm-immutable */ class Uri implements UriInterface, Stringable { @@ -67,8 +69,7 @@ class Uri implements UriInterface, Stringable private string $host = ''; - /** @var int|null */ - private $port; + private ?int $port = null; private string $path = ''; @@ -110,6 +111,7 @@ public function __toString(): string return $this->uriString; } + /** @psalm-suppress ImpureMethodCall, InaccessibleProperty */ $this->uriString = static::createUriString( $this->scheme, $this->getAuthority(), @@ -442,6 +444,9 @@ public function withFragment($fragment): UriInterface /** * Parse a URI into its parts, and set the properties + * + * @psalm-suppress InaccessibleProperty Method is only called in {@see Uri::__construct} and thus immutability is + * still given. */ private function parseUri(string $uri): void { @@ -552,8 +557,12 @@ private function filterUserInfoPart(string $part): string { $part = $this->filterInvalidUtf8($part); - // Note the addition of `%` to initial charset; this allows `|` portion - // to match and thus prevent double-encoding. + /** + * @psalm-suppress ImpureFunctionCall Even tho the callback targets this immutable class, + * psalm reports an issue here. + * Note the addition of `%` to initial charset; this allows `|` portion + * to match and thus prevent double-encoding. + */ return preg_replace_callback( '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/u', [$this, 'urlEncodeChar'], @@ -568,6 +577,10 @@ private function filterPath(string $path): string { $path = $this->filterInvalidUtf8($path); + /** + * @psalm-suppress ImpureFunctionCall Even tho the callback targets this immutable class, + * psalm reports an issue here. + */ return preg_replace_callback( '/(?:[^' . self::CHAR_UNRESERVED . ')(:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/u', [$this, 'urlEncodeChar'], @@ -656,6 +669,10 @@ private function filterQueryOrFragment(string $value): string { $value = $this->filterInvalidUtf8($value); + /** + * @psalm-suppress ImpureFunctionCall Even tho the callback targets this immutable class, + * psalm reports an issue here. + */ return preg_replace_callback( '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/u', [$this, 'urlEncodeChar'], diff --git a/app/vendor/laminas/laminas-diactoros/src/UriFactory.php b/app/vendor/laminas/laminas-diactoros/src/UriFactory.php index d0ce13af9..31f5a1de8 100644 --- a/app/vendor/laminas/laminas-diactoros/src/UriFactory.php +++ b/app/vendor/laminas/laminas-diactoros/src/UriFactory.php @@ -9,10 +9,11 @@ use function array_change_key_case; use function array_key_exists; +use function assert; +use function count; use function explode; use function gettype; use function implode; -use function is_array; use function is_bool; use function is_scalar; use function is_string; @@ -76,7 +77,9 @@ public static function createFromSapi(array $server, array $headers): Uri $fragment = ''; if (str_contains($path, '#')) { - [$path, $fragment] = explode('#', $path, 2); + $parts = explode('#', $path, 2); + assert(count($parts) >= 2); + [$path, $fragment] = $parts; } return $uri @@ -228,16 +231,14 @@ private static function marshalHttpsValue(mixed $https): bool } /** - * @param string|list $host + * @internal + * * @return array{string, int|null} Array of two items, host and port, in that order (can be * passed to a list() operation). + * @psalm-mutation-free */ - private static function marshalHostAndPortFromHeader($host): array + public static function marshalHostAndPortFromHeader(string $host): array { - if (is_array($host)) { - $host = implode(', ', $host); - } - $port = null; // works for regname, IPv4 & IPv6 diff --git a/app/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php b/app/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php index 124cdff4a..186d6d9af 100644 --- a/app/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php +++ b/app/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php @@ -6,6 +6,8 @@ use function array_change_key_case; use function array_key_exists; +use function assert; +use function count; use function explode; use function gettype; use function implode; @@ -219,7 +221,9 @@ function marshalUriFromSapi(array $server, array $headers): Uri // URI fragment $fragment = ''; if (str_contains($path, '#')) { - [$path, $fragment] = explode('#', $path, 2); + $parts = explode('#', $path, 2); + assert(count($parts) >= 2); + [$path, $fragment] = $parts; } return $uri diff --git a/app/vendor/laminas/laminas-httphandlerrunner/composer.json b/app/vendor/laminas/laminas-httphandlerrunner/composer.json index 701c89a5c..580182e78 100644 --- a/app/vendor/laminas/laminas-httphandlerrunner/composer.json +++ b/app/vendor/laminas/laminas-httphandlerrunner/composer.json @@ -21,7 +21,7 @@ "config": { "sort-packages": true, "platform": { - "php": "8.0.99" + "php": "8.1.99" }, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true @@ -33,17 +33,17 @@ } }, "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", - "psr/http-message": "^1.0", - "psr/http-message-implementation": "^1.0", + "php": "~8.1.0 || ~8.2.0", + "psr/http-message": "^1.0 || ^2.0", + "psr/http-message-implementation": "^1.0 || ^2.0", "psr/http-server-handler": "^1.0" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.4.0", - "laminas/laminas-diactoros": "^2.18", - "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^5.0.0" + "laminas/laminas-coding-standard": "~2.5.0", + "laminas/laminas-diactoros": "^3.0.0", + "phpunit/phpunit": "^10.1.2", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.11" }, "autoload": { "psr-4": { diff --git a/app/vendor/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php b/app/vendor/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php index 984ee1474..aaea4ef2a 100644 --- a/app/vendor/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php +++ b/app/vendor/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php @@ -53,7 +53,6 @@ public function emit(ResponseInterface $response): bool #[ReturnTypeWillChange] public function offsetSet($index, $emitter) { - /** @psalm-suppress RedundantConditionGivenDocblockType */ $this->validateEmitter($emitter); parent::offsetSet($index, $emitter); } @@ -68,7 +67,6 @@ public function offsetSet($index, $emitter) #[ReturnTypeWillChange] public function push($emitter) { - /** @psalm-suppress RedundantConditionGivenDocblockType */ $this->validateEmitter($emitter); parent::push($emitter); } @@ -83,7 +81,6 @@ public function push($emitter) #[ReturnTypeWillChange] public function unshift($emitter) { - /** @psalm-suppress RedundantConditionGivenDocblockType */ $this->validateEmitter($emitter); parent::unshift($emitter); } diff --git a/app/vendor/myclabs/deep-copy/.github/workflows/ci.yaml b/app/vendor/myclabs/deep-copy/.github/workflows/ci.yaml new file mode 100644 index 000000000..eac2812e3 --- /dev/null +++ b/app/vendor/myclabs/deep-copy/.github/workflows/ci.yaml @@ -0,0 +1,101 @@ +name: "Continuous Integration" + +on: + - pull_request + - push + +env: + COMPOSER_ROOT_VERSION: 1.99 + +jobs: + composer-json-lint: + name: "Lint composer.json" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "8.1" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + tools: composer-normalize + + - name: "Get composer cache directory" + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: "Cache dependencies" + uses: actions/cache@v2 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- + + - name: "Install dependencies" + run: "composer update --no-interaction --no-progress" + + - name: "Validate composer.json" + run: "composer validate --strict" + + - name: "Normalize composer.json" + run: "composer-normalize --dry-run" + + tests: + name: "Tests" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.1" + - "7.2" + - "7.3" + - "7.4" + - "8.0" + - "8.1" + dependencies: + - "lowest" + - "highest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + ini-values: zend.assertions=1 + + - name: "Get composer cache directory" + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: "Cache dependencies" + uses: actions/cache@v2 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --no-interaction --no-progress --prefer-lowest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress" + + - name: "Run tests" + timeout-minutes: 3 + run: "vendor/bin/phpunit" diff --git a/app/vendor/myclabs/deep-copy/README.md b/app/vendor/myclabs/deep-copy/README.md index 503e93dff..94aaa06d6 100644 --- a/app/vendor/myclabs/deep-copy/README.md +++ b/app/vendor/myclabs/deep-copy/README.md @@ -186,6 +186,9 @@ $matcher = new TypeMatcher('Doctrine\Common\Collections\Collection'); - `DeepCopy\Filter` applies a transformation to the object attribute matched by `DeepCopy\Matcher` - `DeepCopy\TypeFilter` applies a transformation to any element matched by `DeepCopy\TypeMatcher` +By design, matching a filter will stop the chain of filters (i.e. the next ones will not be applied). +Using the ([`ChainableFilter`](#chainablefilter-filter)) won't stop the chain of filters. + #### `SetNullFilter` (filter) @@ -226,6 +229,34 @@ $copy = $copier->copy($object); ``` +#### `ChainableFilter` (filter) + +If you use cloning on proxy classes, you might want to apply two filters for: +1. loading the data +2. applying a transformation + +You can use the `ChainableFilter` as a decorator of the proxy loader filter, which won't stop the chain of filters (i.e. +the next ones may be applied). + + +```php +use DeepCopy\DeepCopy; +use DeepCopy\Filter\ChainableFilter; +use DeepCopy\Filter\Doctrine\DoctrineProxyFilter; +use DeepCopy\Filter\SetNullFilter; +use DeepCopy\Matcher\Doctrine\DoctrineProxyMatcher; +use DeepCopy\Matcher\PropertyNameMatcher; + +$copier = new DeepCopy(); +$copier->addFilter(new ChainableFilter(new DoctrineProxyFilter()), new DoctrineProxyMatcher()); +$copier->addFilter(new SetNullFilter(), new PropertyNameMatcher('id')); + +$copy = $copier->copy($object); + +echo $copy->id; // null +``` + + #### `DoctrineCollectionFilter` (filter) If you use Doctrine and want to copy an entity, you will need to use the `DoctrineCollectionFilter`: @@ -268,6 +299,8 @@ Doctrine proxy class (...\\\_\_CG\_\_\Proxy). You can use the `DoctrineProxyFilter` to load the actual entity behind the Doctrine proxy class. **Make sure, though, to put this as one of your very first filters in the filter chain so that the entity is loaded before other filters are applied!** +We recommend to decorate the `DoctrineProxyFilter` with the `ChainableFilter` to allow applying other filters to the +cloned lazy loaded entities. ```php use DeepCopy\DeepCopy; @@ -275,7 +308,7 @@ use DeepCopy\Filter\Doctrine\DoctrineProxyFilter; use DeepCopy\Matcher\Doctrine\DoctrineProxyMatcher; $copier = new DeepCopy(); -$copier->addFilter(new DoctrineProxyFilter(), new DoctrineProxyMatcher()); +$copier->addFilter(new ChainableFilter(new DoctrineProxyFilter()), new DoctrineProxyMatcher()); $copy = $copier->copy($object); diff --git a/app/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php b/app/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php index 5e68c64e4..6e766d80e 100644 --- a/app/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php +++ b/app/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php @@ -7,6 +7,7 @@ use DateTimeInterface; use DateTimeZone; use DeepCopy\Exception\CloneException; +use DeepCopy\Filter\ChainableFilter; use DeepCopy\Filter\Filter; use DeepCopy\Matcher\Matcher; use DeepCopy\Reflection\ReflectionHelper; @@ -239,6 +240,10 @@ function ($object) { } ); + if ($filter instanceof ChainableFilter) { + continue; + } + // If a filter matches, we stop processing this property return; } diff --git a/app/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php b/app/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php new file mode 100644 index 000000000..4e3f7bbc4 --- /dev/null +++ b/app/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php @@ -0,0 +1,24 @@ +filter = $filter; + } + + public function apply($object, $property, $objectCopier) + { + $this->filter->apply($object, $property, $objectCopier); + } +} diff --git a/app/vendor/nikic/php-parser/grammar/php5.y b/app/vendor/nikic/php-parser/grammar/php5.y index 2920deadd..77e4fb7ed 100644 --- a/app/vendor/nikic/php-parser/grammar/php5.y +++ b/app/vendor/nikic/php-parser/grammar/php5.y @@ -1008,7 +1008,7 @@ array_pair: | expr { $$ = Expr\ArrayItem[$1, null, false]; } | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } - | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } + | T_ELLIPSIS expr { $$ = new Expr\ArrayItem($2, null, false, attributes(), true); } ; encaps_list: diff --git a/app/vendor/nikic/php-parser/grammar/php7.y b/app/vendor/nikic/php-parser/grammar/php7.y index 1f9b4bdd2..1ef60bfe0 100644 --- a/app/vendor/nikic/php-parser/grammar/php7.y +++ b/app/vendor/nikic/php-parser/grammar/php7.y @@ -221,7 +221,10 @@ non_empty_class_const_list: ; class_const: - identifier_maybe_reserved '=' expr { $$ = Node\Const_[$1, $3]; } + T_STRING '=' expr + { $$ = Node\Const_[new Node\Identifier($1, stackAttributes(#1)), $3]; } + | semi_reserved '=' expr + { $$ = Node\Const_[new Node\Identifier($1, stackAttributes(#1)), $3]; } ; inner_statement_list_ex: @@ -518,7 +521,8 @@ new_elseif_list: ; new_elseif: - T_ELSEIF '(' expr ')' ':' inner_statement_list { $$ = Stmt\ElseIf_[$3, $6]; } + T_ELSEIF '(' expr ')' ':' inner_statement_list + { $$ = Stmt\ElseIf_[$3, $6]; $this->fixupAlternativeElse($$); } ; else_single: @@ -528,7 +532,8 @@ else_single: new_else_single: /* empty */ { $$ = null; } - | T_ELSE ':' inner_statement_list { $$ = Stmt\Else_[$3]; } + | T_ELSE ':' inner_statement_list + { $$ = Stmt\Else_[$3]; $this->fixupAlternativeElse($$); } ; foreach_variable: @@ -720,6 +725,9 @@ class_statement: | optional_attributes method_modifiers T_CONST class_const_list semi { $$ = new Stmt\ClassConst($4, $2, attributes(), $1); $this->checkClassConst($$, #2); } + | optional_attributes method_modifiers T_CONST type_expr class_const_list semi + { $$ = new Stmt\ClassConst($5, $2, attributes(), $1, $4); + $this->checkClassConst($$, #2); } | optional_attributes method_modifiers T_FUNCTION optional_ref identifier_maybe_reserved '(' parameter_list ')' optional_return_type method_body { $$ = Stmt\ClassMethod[$5, ['type' => $2, 'byRef' => $4, 'params' => $7, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; @@ -941,8 +949,8 @@ expr: ; anonymous_class: - optional_attributes T_CLASS ctor_arguments extends_from implements_list '{' class_statement_list '}' - { $$ = array(Stmt\Class_[null, ['type' => 0, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]], $3); + optional_attributes class_entry_type ctor_arguments extends_from implements_list '{' class_statement_list '}' + { $$ = array(Stmt\Class_[null, ['type' => $2, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]], $3); $this->checkClass($$[0], -1); } ; @@ -1038,6 +1046,8 @@ constant: class_constant: class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved { $$ = Expr\ClassConstFetch[$1, $3]; } + | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '{' expr '}' + { $$ = Expr\ClassConstFetch[$1, $4]; } /* We interpret an isolated FOO:: as an unfinished class constant fetch. It could also be an unfinished static property fetch or unfinished scoped call. */ | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM error @@ -1192,7 +1202,7 @@ array_pair: | expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } | expr T_DOUBLE_ARROW list_expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } + | T_ELLIPSIS expr { $$ = new Expr\ArrayItem($2, null, false, attributes(), true); } | /* empty */ { $$ = null; } ; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php index f616c6270..a7fe129b0 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php @@ -19,6 +19,8 @@ class ClassConst implements PhpParser\Builder /** @var Node\AttributeGroup[] */ protected $attributeGroups = []; + /** @var Identifier|Node\Name|Node\ComplexType */ + protected $type; /** * Creates a class constant builder @@ -116,6 +118,19 @@ public function addAttribute($attribute) { return $this; } + /** + * Sets the constant type. + * + * @param string|Node\Name|Identifier|Node\ComplexType $type + * + * @return $this + */ + public function setType($type) { + $this->type = BuilderHelpers::normalizeType($type); + + return $this; + } + /** * Returns the built class node. * @@ -126,7 +141,8 @@ public function getNode(): PhpParser\Node { $this->constants, $this->flags, $this->attributes, - $this->attributeGroups + $this->attributeGroups, + $this->type ); } } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php index de9aae7e5..69f353326 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php @@ -19,6 +19,8 @@ class Param implements PhpParser\Builder protected $variadic = false; + protected $flags = 0; + /** @var Node\AttributeGroup[] */ protected $attributeGroups = []; @@ -95,6 +97,50 @@ public function makeVariadic() { return $this; } + /** + * Makes the (promoted) parameter public. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePublic() { + $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_PUBLIC); + + return $this; + } + + /** + * Makes the (promoted) parameter protected. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeProtected() { + $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_PROTECTED); + + return $this; + } + + /** + * Makes the (promoted) parameter private. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePrivate() { + $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_PRIVATE); + + return $this; + } + + /** + * Makes the (promoted) parameter readonly. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeReadonly() { + $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_READONLY); + + return $this; + } + /** * Adds an attribute group. * @@ -116,7 +162,7 @@ public function addAttribute($attribute) { public function getNode() : Node { return new Node\Param( new Node\Expr\Variable($this->name), - $this->default, $this->type, $this->byRef, $this->variadic, [], 0, $this->attributeGroups + $this->default, $this->type, $this->byRef, $this->variadic, [], $this->flags, $this->attributeGroups ); } } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php b/app/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php index fef2579b3..af010e028 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php @@ -349,15 +349,15 @@ public function propertyFetch(Expr $var, $name) : Expr\PropertyFetch { /** * Creates a class constant fetch node. * - * @param string|Name|Expr $class Class name - * @param string|Identifier $name Constant name + * @param string|Name|Expr $class Class name + * @param string|Identifier|Expr $name Constant name * * @return Expr\ClassConstFetch */ public function classConstFetch($class, $name): Expr\ClassConstFetch { return new Expr\ClassConstFetch( BuilderHelpers::normalizeNameOrExpr($class), - BuilderHelpers::normalizeIdentifier($name) + BuilderHelpers::normalizeIdentifierOrExpr($name) ); } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php b/app/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php index 3eeac04a4..676322701 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php @@ -19,6 +19,8 @@ class PrintableNewAnonClassNode extends Expr { /** @var Node\AttributeGroup[] PHP attribute groups */ public $attrGroups; + /** @var int Modifiers */ + public $flags; /** @var Node\Arg[] Arguments */ public $args; /** @var null|Node\Name Name of extended class */ @@ -29,11 +31,12 @@ class PrintableNewAnonClassNode extends Expr public $stmts; public function __construct( - array $attrGroups, array $args, Node\Name $extends = null, array $implements, + array $attrGroups, int $flags, array $args, Node\Name $extends = null, array $implements, array $stmts, array $attributes ) { parent::__construct($attributes); $this->attrGroups = $attrGroups; + $this->flags = $flags; $this->args = $args; $this->extends = $extends; $this->implements = $implements; @@ -46,7 +49,7 @@ public static function fromNewNode(Expr\New_ $newNode) { // We don't assert that $class->name is null here, to allow consumers to assign unique names // to anonymous classes for their own purposes. We simplify ignore the name here. return new self( - $class->attrGroups, $newNode->args, $class->extends, $class->implements, + $class->attrGroups, $class->flags, $newNode->args, $class->extends, $class->implements, $class->stmts, $newNode->getAttributes() ); } @@ -56,6 +59,6 @@ public function getType() : string { } public function getSubNodeNames() : array { - return ['attrGroups', 'args', 'extends', 'implements', 'stmts']; + return ['attrGroups', 'flags', 'args', 'extends', 'implements', 'stmts']; } } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php index faf832f93..0c45ffb4b 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php @@ -10,15 +10,15 @@ class ClassConstFetch extends Expr { /** @var Name|Expr Class name */ public $class; - /** @var Identifier|Error Constant name */ + /** @var Identifier|Expr|Error Constant name */ public $name; /** * Constructs a class const fetch node. * - * @param Name|Expr $class Class name - * @param string|Identifier|Error $name Constant name - * @param array $attributes Additional attributes + * @param Name|Expr $class Class name + * @param string|Identifier|Expr|Error $name Constant name + * @param array $attributes Additional attributes */ public function __construct($class, $name, array $attributes = []) { $this->attributes = $attributes; @@ -29,7 +29,7 @@ public function __construct($class, $name, array $attributes = []) { public function getSubNodeNames() : array { return ['class', 'name']; } - + public function getType() : string { return 'Expr_ClassConstFetch'; } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php index 17bd1c0f7..f0a564ff0 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php @@ -6,7 +6,10 @@ class Name extends NodeAbstract { - /** @var string[] Parts of the name */ + /** + * @var string[] Parts of the name + * @deprecated Use getParts() instead + */ public $parts; private static $specialClassNames = [ @@ -30,6 +33,15 @@ public function getSubNodeNames() : array { return ['parts']; } + /** + * Get parts of name (split by the namespace separator). + * + * @return string[] Parts of name + */ + public function getParts(): array { + return $this->parts; + } + /** * Gets the first part of the name, i.e. everything before the first namespace separator. * diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php index 1fc7f3362..8abaad6de 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php @@ -10,31 +10,36 @@ class ClassConst extends Node\Stmt public $flags; /** @var Node\Const_[] Constant declarations */ public $consts; - /** @var Node\AttributeGroup[] */ + /** @var Node\AttributeGroup[] PHP attribute groups */ public $attrGroups; + /** @var Node\Identifier|Node\Name|Node\ComplexType|null Type declaration */ + public $type; /** * Constructs a class const list node. * - * @param Node\Const_[] $consts Constant declarations - * @param int $flags Modifiers - * @param array $attributes Additional attributes - * @param Node\AttributeGroup[] $attrGroups PHP attribute groups + * @param Node\Const_[] $consts Constant declarations + * @param int $flags Modifiers + * @param array $attributes Additional attributes + * @param Node\AttributeGroup[] $attrGroups PHP attribute groups + * @param null|string|Node\Identifier|Node\Name|Node\ComplexType $type Type declaration */ public function __construct( array $consts, int $flags = 0, array $attributes = [], - array $attrGroups = [] + array $attrGroups = [], + $type = null ) { $this->attributes = $attributes; $this->flags = $flags; $this->consts = $consts; $this->attrGroups = $attrGroups; + $this->type = \is_string($type) ? new Node\Identifier($type) : $type; } public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'consts']; + return ['attrGroups', 'flags', 'type', 'consts']; } /** diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php index 351db9ed0..a43067108 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php @@ -2627,7 +2627,7 @@ protected function initReduceCallbacks() { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 552 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true); }, 553 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php index 48deff23b..fc895cb04 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php @@ -18,16 +18,16 @@ class Php7 extends \PhpParser\ParserAbstract { protected $tokenToSymbolMapSize = 396; - protected $actionTableSize = 1223; - protected $gotoTableSize = 626; + protected $actionTableSize = 1241; + protected $gotoTableSize = 629; protected $invalidSymbol = 168; protected $errorSymbol = 1; protected $defaultAction = -32766; protected $unexpectedTokenRule = 32767; - protected $YY2TBLSTATE = 429; - protected $numNonLeafStates = 726; + protected $YY2TBLSTATE = 434; + protected $numNonLeafStates = 736; protected $symbolToName = array( "EOF", @@ -244,262 +244,266 @@ class Php7 extends \PhpParser\ParserAbstract ); protected $action = array( - 132, 133, 134, 575, 135, 136, 0, 738, 739, 740, - 137, 37, 850, 825, 851, 476,-32766,-32766,-32766,-32767, - -32767,-32767,-32767, 101, 102, 103, 104, 105, 1097, 1098, - 1099, 1096, 1095, 1094, 1100, 732, 731,-32766, 1289,-32766, + 133, 134, 135, 579, 136, 137, 0, 748, 749, 750, + 138, 38, 327,-32766,-32766,-32766,-32766,-32766,-32766,-32767, + -32767,-32767,-32767, 102, 103, 104, 105, 106, 1109, 1110, + 1111, 1108, 1107, 1106, 1112, 742, 741,-32766, 1232,-32766, -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, - -32767, 1022, 377, 376, 2, 741,-32766,-32766,-32766,-32766, - -32766, 822, 417,-32766,-32766,-32766,-32766,-32766,-32766, 267, - 138, 399, 745, 746, 747, 748, 287,-32766, 423,-32766, - -32766,-32766,-32766,-32766,-32766, 749, 750, 751, 752, 753, - 754, 755, 756, 757, 758, 759, 779, 576, 780, 781, - 782, 783, 771, 772, 340, 341, 774, 775, 760, 761, - 762, 764, 765, 766, 351, 806, 807, 808, 809, 810, - 577, 767, 768, 578, 579, 800, 791, 789, 790, 803, - 786, 787, -327, 423, 580, 581, 785, 582, 583, 584, - 585, 586, 587, 605, -590, 477, -86, 814, 788, 588, - 589, -590, 139,-32766,-32766,-32766, 132, 133, 134, 575, - 135, 136, 1046, 738, 739, 740, 137, 37, 323, 1013, - 823, 824, 1334, 1324,-32766, 1335,-32766,-32766,-32766,-32766, - -32766,-32766,-32766, 1097, 1098, 1099, 1096, 1095, 1094, 1100, - -587, 732, 731,-32766,-32766,-32766, 12, -587, 81,-32766, - -32766,-32766, 945, 946, 322, 927, 34, 947, 1224, 1223, - 1225, 741, -86, 942,-32766, 1075,-32766,-32766,-32766,-32766, - -32766, 239,-32766,-32766,-32766, 267, 138, 399, 745, 746, - 747, 748, 461, 462, 423, 35, 247, 103, 104, 105, - 128, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 779, 576, 780, 781, 782, 783, 771, 772, - 340, 341, 774, 775, 760, 761, 762, 764, 765, 766, - 351, 806, 807, 808, 809, 810, 577, 767, 768, 578, - 579, 800, 791, 789, 790, 803, 786, 787, -327, 144, - 580, 581, 785, 582, 583, 584, 585, 586, 587, 1222, - 82, 83, 84, -590, 788, 588, 589, -590, 148, 763, - 733, 734, 735, 736, 737, 1309, 738, 739, 740, 776, - 777, 36, 1308, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 288, 271, -587, - -193, 375, 376, -587, 976,-32766, 1021, 453, 454, 455, - 109, 417, 945, 946, 741, 712, 819, 947,-32766,-32766, - -32766, -271, 1073, 941, 1224, 1223, 1225, 288, 742, 743, - 744, 745, 746, 747, 748, -192, -365, 812, -365,-32766, - 599,-32766,-32766, 549, 749, 750, 751, 752, 753, 754, - 755, 756, 757, 758, 759, 779, 802, 780, 781, 782, - 783, 771, 772, 773, 801, 774, 775, 760, 761, 762, - 764, 765, 766, 805, 806, 807, 808, 809, 810, 811, - 767, 768, 769, 770, 800, 791, 789, 790, 803, 786, - 787, 251, 820, 778, 784, 785, 792, 793, 795, 794, - 796, 797, 732, 731, 1261, 1022, 1019, 788, 799, 798, - 49, 50, 51, 507, 52, 53, 1009, 1008, 1007, 1010, - 54, 55, -111, 56, 816, 1045, 14, -111, 1022, -111, - 287, 1305, 977, 306, 302, 1022, 238, -111, -111, -111, - -111, -111, -111, -111, -111, 106, 107, 108, 1089, 271, - -32766,-32766,-32766, 280, 284, 126, -193, 929, 57, 58, - 287, 109, 1019, -541, 59, 308, 60, 244, 245, 61, - 62, 63, 64, 65, 66, 67, 68, 1229, 27, 269, - 69, 439, 508, -341, 1022, 929, 1255, 1256, 509, 907, - 823, -192, 150, 907, 1253, 41, 24, 510, 352, 511, - 818, 512, 386, 513, 11, 699, 514, 515, 648, 25, - 814, 43, 44, 440, 372, 371, 907, 45, 516, 702, - 1220, 667, 668, 363, 334, -540, 357, -541, -541, 320, - 1215, 1249, 518, 519, 520, -581, 1074, 335, 724, -581, - 1019,-32766, -541, 336, 521, 522, 703, 1243, 1244, 1245, - 1246, 1240, 1241, 294, -541, 850, -547, 851, 823, 1247, - 1242, 365, 1022, 1224, 1223, 1225, 295, -153, -153, -153, - 369, 70, 897, 318, 319, 322, 897, 384, 149, 402, - 373, 374, -153, 435, -153, 436, -153, 280, -153, -540, - -540, 141, 1220, 378, 379, 639, 640, 322, 370, 897, - 907, 437, 438, 829, -540, -88, 151, 732, 731, 945, - 946, 153, 823,-32766, 517, -51, -540, 154, -546, 883, - 941, -111, -111, -111, 31, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 155, 74, - 27, 157, 32, 322, -85, 123, 124, 909, 129, 697, - 130, 909, 823, 697, -153, 143, 1253, 158,-32766, -544, - 1229, -542, 159, 160, 1222, 161, -79, 1134, 1136, -75, - 285,-32766,-32766,-32766, 909,-32766, 697,-32766, -539,-32766, - -301, -73,-32766, 897, -72, -71, 1220,-32766,-32766,-32766, - -16, 140, 1215,-32766,-32766, 732, 731, 322, -70,-32766, - 414, -69, -4, 907, -68, -67, 521, 522,-32766, 1243, - 1244, 1245, 1246, 1240, 1241, -66, -47, -18, 147, 270, - 281, 1247, 1242, -544, -544, -542, -542, 732, 731, 713, - 716, 906,-32766, 72, 146, 907, 319, 322, 1222, -297, - -542, 823, -539, -539, 276,-32766,-32766,-32766, 277,-32766, - -544,-32766, -542,-32766, 282, 283,-32766, -539, 909, 328, - 697,-32766,-32766,-32766,-32766, 704, 286,-32766,-32766, -539, - 1222, 923, 289,-32766, 414, 1220, 290,-32766,-32766,-32766, - 271,-32766,-32766,-32766, 47,-32766, 897, -111,-32766, 677, - 109, 814, 145,-32766,-32766,-32766,-32766, 823, 131,-32766, - -32766, 1336,-32766, 654, 670,-32766, 414, 1104, 370, 637, - 430, 551, 73, 13,-32766, 293, 555, 295, 897, 945, - 946, 649, 74, 434, 517, 458, 322, 487, 690, 842, - 941, -111, -111, -111, 301, 1022, 561, 655, 671, 1260, - 300,-32766, -539,-32766, 907, 603, 303, 1222, 296, 297, - 39, 1262, 9, 40,-32766,-32766,-32766, 0,-32766, 907, - -32766, 909,-32766, 697, -4,-32766, 0, 1229, 907, 0, - -32766,-32766,-32766,-32766, 307, 125,-32766,-32766, 0, 1222, - 907, 0,-32766, 414, 0, 0,-32766,-32766,-32766, 707, - -32766,-32766,-32766, 962,-32766, 697, -505,-32766, 714, -495, - 7, 482,-32766,-32766,-32766,-32766, -539, -539,-32766,-32766, - 16, 1222, 567, 367,-32766, 414, 925, 295,-32766,-32766, - -32766, -539,-32766,-32766,-32766, 822,-32766, 897, 721,-32766, - 722, -575, 888, -539,-32766,-32766,-32766, 986, 963, 970, - -32766,-32766, 897, -249, -249, -249,-32766, 414, 823, 370, - 960, 897, 971, 886, 958,-32766, 1078, 1081, 718, 1082, - 945, 946, 1079, 897, 1080, 517, 1086, 33, 1250, 834, - 883, 941, -111, -111, -111, 27, 1275, 1293, 1327, -248, - -248, -248, 1220, 642, 884, 370, 317, 823, 366, 698, - 701, 1253, 1331, 705, -111, 706, 945, 946, 708, 709, - 710, 517, 909,-32766, 697, -249, 883, 941, -111, -111, - -111, 711, 715, 700, -509, 1333, 845, 909, 48, 697, - -573, 1220, 844, 853, 295, 935, 909, 1215, 697, 74, - 978, 852, 1332, 322, 934, 932, 933, 936, 909, 1206, - 697, -248, 522, 916, 1243, 1244, 1245, 1246, 1240, 1241, - 926, 914, 968, 969, 1330, 1287, 1247, 1242, 1276, 1294, - -32766, 1300, 1303, 1191, -547, -546, 1222, -545, 72, -489, - 1, 319, 322,-32766,-32766,-32766, 28,-32766, 29,-32766, - 38,-32766, 298, 299,-32766, 42, 46, 71, 75,-32766, - -32766,-32766, 76, 77, 78,-32766,-32766, 368, 79, 80, - 142,-32766, 414, 152, 156, 243, 324, 352, 353, 127, - -32766, -274, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 364, 431, 0, -272, -271, 18, 19, 20, 21, - 23, 401, 478, 479, 486, 489, 490, 491, 492, 496, - 497, 498, 505, 684, 1233, 1174, 1251, 1048, 1047, 1028, - 0, 1210, 1024, -276, -103, 17, 22, 26, 292, 400, - 596, 600, 628, 689, 1178, 1228, 1175, 1306, 0, 0, - 1254, 0, 322 + -32767, 2, 107, 108, 109, 751, 274, 381, 380,-32766, + -32766,-32766,-32766, 104, 105, 106, 1024, 422, 110, 265, + 139, 403, 755, 756, 757, 758, 466, 467, 428, 938, + 291,-32766, 287,-32766,-32766, 759, 760, 761, 762, 763, + 764, 765, 766, 767, 768, 769, 789, 580, 790, 791, + 792, 793, 781, 782, 344, 345, 784, 785, 770, 771, + 772, 774, 775, 776, 355, 816, 817, 818, 819, 820, + 581, 777, 778, 582, 583, 810, 801, 799, 800, 813, + 796, 797, 687, -545, 584, 585, 795, 586, 587, 588, + 589, 590, 591, -328, -593, -367, 1234, -367, 798, 592, + 593, -593, 140,-32766,-32766,-32766, 133, 134, 135, 579, + 136, 137, 1057, 748, 749, 750, 138, 38, 688, 1020, + 1019, 1018, 1021, 390,-32766, 7,-32766,-32766,-32766,-32766, + -32766,-32766,-32766,-32766,-32766,-32766, 379, 380, 1033, 689, + 690, 742, 741,-32766,-32766,-32766, 422, -545, -545, -590, + -32766,-32766,-32766, 1032,-32766, 127, -590, 1236, 1235, 1237, + 1318, 751, -545, 290,-32766, 283,-32766,-32766,-32766,-32766, + -32766, 1236, 1235, 1237, -545, 265, 139, 403, 755, 756, + 757, 758, 16, 481, 428, 458, 459, 460, 298, 722, + 35, 759, 760, 761, 762, 763, 764, 765, 766, 767, + 768, 769, 789, 580, 790, 791, 792, 793, 781, 782, + 344, 345, 784, 785, 770, 771, 772, 774, 775, 776, + 355, 816, 817, 818, 819, 820, 581, 777, 778, 582, + 583, 810, 801, 799, 800, 813, 796, 797, 129, 824, + 584, 585, 795, 586, 587, 588, 589, 590, 591, -328, + 83, 84, 85, -593, 798, 592, 593, -593, 149, 773, + 743, 744, 745, 746, 747, 824, 748, 749, 750, 786, + 787, 37, 145, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 291, 274, 835, + 254, 1109, 1110, 1111, 1108, 1107, 1106, 1112, -590, 860, + 110, 861, -590, 482, 751,-32766,-32766,-32766,-32766,-32766, + 142, 603, 1085, 742, 741, 1262, 326, 987, 752, 753, + 754, 755, 756, 757, 758, 309,-32766, 822,-32766,-32766, + -32766,-32766, 242, 553, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 789, 812, 790, 791, 792, + 793, 781, 782, 783, 811, 784, 785, 770, 771, 772, + 774, 775, 776, 815, 816, 817, 818, 819, 820, 821, + 777, 778, 779, 780, 810, 801, 799, 800, 813, 796, + 797, 311, 940, 788, 794, 795, 802, 803, 805, 804, + 806, 807, 323, 609, 1274, 1033, 833, 798, 809, 808, + 50, 51, 52, 512, 53, 54, 860, 241, 861, 918, + 55, 56, -111, 57,-32766,-32766,-32766, -111, 826, -111, + 290, 1302, 1347, 356, 305, 1348, 339, -111, -111, -111, + -111, -111, -111, -111, -111,-32766, -194,-32766,-32766,-32766, + -193, 956, 957, 829, -86, 988, 958, 834, 58, 59, + 340, 428, 952, -544, 60, 832, 61, 247, 248, 62, + 63, 64, 65, 66, 67, 68, 69, 1241, 28, 267, + 70, 444, 513, -342,-32766, 141, 1268, 1269, 514, 918, + 833, 326, -272, 918, 1266, 42, 25, 515, 940, 516, + 14, 517, 908, 518, 828, 369, 519, 520, 373, 709, + 1033, 44, 45, 445, 376, 375, 388, 46, 521, 712, + -86, 440, 1101, 367, 338, -543, 441, -544, -544, 830, + 1227, 442, 523, 524, 525, 290, 1236, 1235, 1237, 361, + 1030, 443, -544, 1087, 526, 527, 839, 1255, 1256, 1257, + 1258, 1252, 1253, 297, -544, 151, -550, -584, 833, 1259, + 1254, -584, 1033, 1236, 1235, 1237, 298, -154, -154, -154, + 152, 71, 908, 321, 322, 326, 908, 920, 1030, 707, + 833, 154, -154, 1337, -154, 155, -154, 283, -154, -543, + -543, 82, 1232, 1086, 1322, 734, 156, 326, 374, 158, + 1033, 1321, -194, -79, -543, -88, -193, 742, 741, 956, + 957, 653, 26,-32766, 522, -51, -543, 33, -549, 894, + 952, -111, -111, -111, 32, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, -59, 75, + 28, 672, 673, 326, -58, 36, 250, 920, 124, 707, + 125, 920, 833, 707, -154, 130, 1266, 131,-32766, -547, + 144, -542, 150, 406, 1234, 377, 378, 1146, 1148, 382, + 383,-32766,-32766,-32766, -85,-32766, 1056,-32766, -542,-32766, + 644, 645,-32766, 159, 160, 161, 1232,-32766,-32766,-32766, + 162, -79, 1227,-32766,-32766, 742, 741, 163, -302,-32766, + 419, -75, -4, 918, -73, 287, 526, 527,-32766, 1255, + 1256, 1257, 1258, 1252, 1253, -72, -71, -70, -69, -68, + -67, 1259, 1254, -547, -547, -542, -542, 742, 741, -66, + -47, -18,-32766, 73, 148, 918, 322, 326, 1234, 273, + -542, 284, -542, -542, 723,-32766,-32766,-32766, 726,-32766, + -547,-32766, -542,-32766, 917, 147,-32766, -542, 288, 289, + -298,-32766,-32766,-32766,-32766, 713, 279,-32766,-32766, -542, + 1234, 280, 285,-32766, 419, 48, 286,-32766,-32766,-32766, + 332,-32766,-32766,-32766, 292,-32766, 908, 293,-32766, 934, + 274, 1030, 918,-32766,-32766,-32766, 110, 682, 132,-32766, + -32766, 833, 146,-32766, 559,-32766, 419, 659, 374, 824, + 435, 1349, 74, 1033,-32766, 296, 654, 1116, 908, 956, + 957, 306, 714, 698, 522, 555, 303, 13, 310, 852, + 952, -111, -111, -111, 700, 463, 492, 953, 283, 299, + 300,-32766, 49, 675, 918, 304, 660, 1234, 676, 936, + 1273,-32766, 10, 1263,-32766,-32766,-32766, 642,-32766, 918, + -32766, 920,-32766, 707, -4,-32766, 126, 34, 918, 565, + -32766,-32766,-32766,-32766, 0, 908,-32766,-32766, 0, 1234, + 918, 0,-32766, 419, 0, 0,-32766,-32766,-32766, 717, + -32766,-32766,-32766, 920,-32766, 707, 1033,-32766, 724, 1275, + 0, 487,-32766,-32766,-32766,-32766, 301, 302,-32766,-32766, + -507, 1234, 571, -497,-32766, 419, 607, 8,-32766,-32766, + -32766, 372,-32766,-32766,-32766, 17,-32766, 908, 371,-32766, + 832, 298, 320, 128,-32766,-32766,-32766, 40, 370, 41, + -32766,-32766, 908, -250, -250, -250,-32766, 419, 731, 374, + 973, 908, 707, 732, 899,-32766, 997, 974, 728, 981, + 956, 957, 971, 908, 982, 522, 897, 969, 1090, 1093, + 894, 952, -111, -111, -111, 28, 1094, 1091, 1092, -249, + -249, -249, 1241, 1098, 708, 374, 844, 833, 1288, 1306, + 1340, 1266, 647, 1267, 711, 715, 956, 957, 716, 1241, + 718, 522, 920, 719, 707, -250, 894, 952, -111, -111, + -111, 720, -16, 721, 725, 710, -511, 920, 895, 707, + -578, 1232, 1344, 1346, 855, 854, 920, 1227, 707, -577, + 863, 946, 989, 862, 1345, 945, 943, 944, 920, 947, + 707, -249, 527, 1218, 1255, 1256, 1257, 1258, 1252, 1253, + 927, 937, 925, 979, 980, 631, 1259, 1254, 1343, 1300, + -32766, 1289, 1307, 833, 1316, -275, 1234, -576, 73, -550, + -549, 322, 326,-32766,-32766,-32766, -548,-32766, -491,-32766, + 833,-32766, 1, 29,-32766, 30, 39, 43, 47,-32766, + -32766,-32766, 72, 76, 77,-32766,-32766, 1232, -111, -111, + 78,-32766, 419, -111, 79, 80, 81, 143, 153, -111, + -32766, 157, 246, 328, 1232, -111, -111, 356,-32766, 357, + -111, 358, 359, 360, 361, 362, -111, 363, 364, 365, + 366, 368, 436, 0, -273,-32766, -272, 19, 20, 298, + 21, 22, 24, 405, 75, 1203, 483, 484, 326, 491, + 0, 494, 495, 496, 497, 501, 298, 502, 503, 510, + 693, 75, 0, 1245, 1186, 326, 1264, 1059, 1058, 1039, + 1222, 1035, -277, -103, 18, 23, 27, 295, 404, 600, + 604, 633, 699, 1190, 1240, 1187, 1319, 0, 0, 0, + 326 ); protected $actionCheck = array( 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, - 12, 13, 106, 1, 108, 31, 9, 10, 11, 44, + 12, 13, 70, 9, 10, 11, 9, 10, 11, 44, 45, 46, 47, 48, 49, 50, 51, 52, 116, 117, - 118, 119, 120, 121, 122, 37, 38, 30, 1, 32, + 118, 119, 120, 121, 122, 37, 38, 30, 116, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 138, 106, 107, 8, 57, 9, 10, 11, 9, - 10, 155, 116, 9, 10, 11, 9, 10, 11, 71, - 72, 73, 74, 75, 76, 77, 163, 30, 80, 32, - 33, 34, 35, 36, 30, 87, 88, 89, 90, 91, + 43, 8, 53, 54, 55, 57, 57, 106, 107, 137, + 9, 10, 11, 50, 51, 52, 1, 116, 69, 71, + 72, 73, 74, 75, 76, 77, 134, 135, 80, 1, + 30, 30, 30, 32, 33, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 8, 80, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 51, 1, 161, 31, 80, 150, 151, + 132, 133, 80, 70, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 8, 1, 106, 80, 108, 150, 151, 152, 8, 154, 9, 10, 11, 2, 3, 4, 5, - 6, 7, 164, 9, 10, 11, 12, 13, 70, 1, - 82, 159, 80, 85, 30, 83, 32, 33, 34, 35, - 36, 37, 38, 116, 117, 118, 119, 120, 121, 122, - 1, 37, 38, 9, 10, 11, 8, 8, 161, 9, - 10, 11, 117, 118, 167, 1, 8, 122, 155, 156, - 157, 57, 97, 128, 30, 162, 32, 33, 34, 35, - 30, 14, 32, 33, 34, 71, 72, 73, 74, 75, - 76, 77, 134, 135, 80, 147, 148, 50, 51, 52, + 6, 7, 164, 9, 10, 11, 12, 13, 116, 119, + 120, 121, 122, 106, 30, 108, 32, 33, 34, 35, + 36, 37, 38, 9, 10, 11, 106, 107, 138, 137, + 138, 37, 38, 9, 10, 11, 116, 134, 135, 1, + 9, 10, 11, 137, 30, 14, 8, 155, 156, 157, + 1, 57, 149, 163, 30, 163, 32, 33, 34, 35, + 36, 155, 156, 157, 161, 71, 72, 73, 74, 75, + 76, 77, 8, 31, 80, 129, 130, 131, 158, 161, 8, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 164, 8, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 80, + 126, 127, 128, 129, 130, 131, 132, 133, 8, 80, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 164, 9, 10, 11, 160, 150, 151, 152, 164, 154, 2, - 3, 4, 5, 6, 7, 1, 9, 10, 11, 12, + 3, 4, 5, 6, 7, 80, 9, 10, 11, 12, 13, 30, 8, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 30, 57, 160, - 8, 106, 107, 164, 31, 9, 137, 129, 130, 131, - 69, 116, 117, 118, 57, 161, 80, 122, 9, 10, - 11, 164, 1, 128, 155, 156, 157, 30, 71, 72, - 73, 74, 75, 76, 77, 8, 106, 80, 108, 30, - 1, 32, 33, 85, 87, 88, 89, 90, 91, 92, + 49, 50, 51, 52, 53, 54, 55, 30, 57, 1, + 8, 116, 117, 118, 119, 120, 121, 122, 160, 106, + 69, 108, 164, 161, 57, 9, 10, 11, 9, 10, + 161, 1, 1, 37, 38, 1, 167, 31, 71, 72, + 73, 74, 75, 76, 77, 8, 30, 80, 32, 33, + 34, 35, 14, 85, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 8, 156, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 37, 38, 146, 138, 116, 150, 151, 152, - 2, 3, 4, 5, 6, 7, 119, 120, 121, 122, - 12, 13, 101, 15, 80, 1, 101, 106, 138, 108, - 163, 1, 159, 8, 113, 138, 97, 116, 117, 118, - 119, 120, 121, 122, 123, 53, 54, 55, 123, 57, - 9, 10, 11, 163, 30, 14, 164, 122, 50, 51, - 163, 69, 116, 70, 56, 8, 58, 59, 60, 61, + 133, 8, 122, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 8, 51, 146, 138, 82, 150, 151, 152, + 2, 3, 4, 5, 6, 7, 106, 97, 108, 1, + 12, 13, 101, 15, 9, 10, 11, 106, 80, 108, + 163, 1, 80, 163, 113, 83, 8, 116, 117, 118, + 119, 120, 121, 122, 123, 30, 8, 32, 33, 34, + 8, 117, 118, 80, 31, 159, 122, 159, 50, 51, + 8, 80, 128, 70, 56, 155, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 1, 70, 71, - 72, 73, 74, 162, 138, 122, 78, 79, 80, 1, - 82, 164, 14, 1, 86, 87, 88, 89, 163, 91, - 156, 93, 106, 95, 108, 161, 98, 99, 75, 76, - 80, 103, 104, 105, 106, 107, 1, 109, 110, 31, - 116, 75, 76, 115, 116, 70, 163, 134, 135, 8, - 122, 1, 124, 125, 126, 160, 159, 8, 161, 164, - 116, 137, 149, 8, 136, 137, 31, 139, 140, 141, - 142, 143, 144, 145, 161, 106, 163, 108, 82, 151, - 152, 8, 138, 155, 156, 157, 158, 75, 76, 77, - 8, 163, 84, 165, 166, 167, 84, 8, 101, 102, - 106, 107, 90, 8, 92, 8, 94, 163, 96, 134, - 135, 161, 116, 106, 107, 111, 112, 167, 106, 84, - 1, 8, 8, 8, 149, 31, 14, 37, 38, 117, - 118, 14, 82, 137, 122, 31, 161, 14, 163, 127, + 72, 73, 74, 162, 9, 161, 78, 79, 80, 1, + 82, 167, 164, 1, 86, 87, 88, 89, 122, 91, + 101, 93, 84, 95, 156, 8, 98, 99, 8, 161, + 138, 103, 104, 105, 106, 107, 8, 109, 110, 31, + 97, 8, 123, 115, 116, 70, 8, 134, 135, 156, + 122, 8, 124, 125, 126, 163, 155, 156, 157, 163, + 116, 8, 149, 162, 136, 137, 8, 139, 140, 141, + 142, 143, 144, 145, 161, 14, 163, 160, 82, 151, + 152, 164, 138, 155, 156, 157, 158, 75, 76, 77, + 14, 163, 84, 165, 166, 167, 84, 159, 116, 161, + 82, 14, 90, 85, 92, 14, 94, 163, 96, 134, + 135, 161, 116, 159, 1, 161, 14, 167, 106, 14, + 138, 8, 164, 16, 149, 31, 164, 37, 38, 117, + 118, 75, 76, 137, 122, 31, 161, 14, 163, 127, 128, 129, 130, 131, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 14, 163, - 70, 14, 14, 167, 31, 16, 16, 159, 16, 161, + 22, 23, 24, 25, 26, 27, 28, 29, 16, 163, + 70, 75, 76, 167, 16, 147, 148, 159, 16, 161, 16, 159, 82, 161, 162, 16, 86, 16, 74, 70, - 1, 70, 16, 16, 80, 16, 31, 59, 60, 31, - 37, 87, 88, 89, 159, 91, 161, 93, 70, 95, - 35, 31, 98, 84, 31, 31, 116, 103, 104, 105, - 31, 161, 122, 109, 110, 37, 38, 167, 31, 115, - 116, 31, 0, 1, 31, 31, 136, 137, 124, 139, + 16, 70, 101, 102, 80, 106, 107, 59, 60, 106, + 107, 87, 88, 89, 31, 91, 1, 93, 70, 95, + 111, 112, 98, 16, 16, 16, 116, 103, 104, 105, + 16, 31, 122, 109, 110, 37, 38, 16, 35, 115, + 116, 31, 0, 1, 31, 30, 136, 137, 124, 139, 140, 141, 142, 143, 144, 31, 31, 31, 31, 31, 31, 151, 152, 134, 135, 134, 135, 37, 38, 31, - 31, 31, 74, 163, 31, 1, 166, 167, 80, 35, - 149, 82, 134, 135, 35, 87, 88, 89, 35, 91, - 161, 93, 161, 95, 35, 35, 98, 149, 159, 35, - 161, 103, 104, 105, 74, 31, 37, 109, 110, 161, - 80, 38, 37, 115, 116, 116, 37, 87, 88, 89, - 57, 91, 124, 93, 70, 95, 84, 128, 98, 77, - 69, 80, 70, 103, 104, 105, 137, 82, 31, 109, - 110, 83, 85, 96, 94, 115, 116, 82, 106, 113, - 108, 85, 154, 97, 124, 113, 89, 158, 84, 117, - 118, 90, 163, 128, 122, 97, 167, 97, 92, 127, - 128, 129, 130, 131, 133, 138, 153, 100, 100, 146, - 132, 74, 70, 137, 1, 153, 114, 80, 134, 135, - 159, 146, 150, 159, 87, 88, 89, -1, 91, 1, - 93, 159, 95, 161, 162, 98, -1, 1, 1, -1, - 103, 104, 105, 74, 132, 161, 109, 110, -1, 80, + 31, 31, 74, 163, 31, 1, 166, 167, 80, 31, + 149, 31, 134, 135, 31, 87, 88, 89, 31, 91, + 161, 93, 161, 95, 31, 31, 98, 149, 37, 37, + 35, 103, 104, 105, 74, 31, 35, 109, 110, 161, + 80, 35, 35, 115, 116, 70, 35, 87, 88, 89, + 35, 91, 124, 93, 37, 95, 84, 37, 98, 38, + 57, 116, 1, 103, 104, 105, 69, 77, 31, 109, + 110, 82, 70, 85, 89, 115, 116, 96, 106, 80, + 108, 83, 154, 138, 124, 113, 90, 82, 84, 117, + 118, 114, 31, 80, 122, 85, 132, 97, 132, 127, + 128, 129, 130, 131, 92, 97, 97, 128, 163, 134, + 135, 74, 70, 94, 1, 133, 100, 80, 100, 154, + 146, 137, 150, 160, 87, 88, 89, 113, 91, 1, + 93, 159, 95, 161, 162, 98, 161, 161, 1, 153, + 103, 104, 105, 74, -1, 84, 109, 110, -1, 80, 1, -1, 115, 116, -1, -1, 87, 88, 89, 31, - 91, 124, 93, 159, 95, 161, 149, 98, 31, 149, - 149, 102, 103, 104, 105, 74, 134, 135, 109, 110, - 149, 80, 81, 149, 115, 116, 154, 158, 87, 88, - 89, 149, 91, 124, 93, 155, 95, 84, 159, 98, - 159, 163, 159, 161, 103, 104, 105, 159, 159, 159, - 109, 110, 84, 100, 101, 102, 115, 116, 82, 106, - 159, 84, 159, 159, 159, 124, 159, 159, 162, 159, - 117, 118, 159, 84, 159, 122, 159, 161, 160, 160, - 127, 128, 129, 130, 131, 70, 160, 160, 160, 100, - 101, 102, 116, 160, 162, 106, 161, 82, 161, 161, - 161, 86, 162, 161, 128, 161, 117, 118, 161, 161, - 161, 122, 159, 137, 161, 162, 127, 128, 129, 130, - 131, 161, 161, 161, 165, 162, 162, 159, 70, 161, - 163, 116, 162, 162, 158, 162, 159, 122, 161, 163, - 162, 162, 162, 167, 162, 162, 162, 162, 159, 162, + 91, 124, 93, 159, 95, 161, 138, 98, 31, 146, + -1, 102, 103, 104, 105, 74, 134, 135, 109, 110, + 149, 80, 81, 149, 115, 116, 153, 149, 87, 88, + 89, 149, 91, 124, 93, 149, 95, 84, 149, 98, + 155, 158, 161, 161, 103, 104, 105, 159, 161, 159, + 109, 110, 84, 100, 101, 102, 115, 116, 159, 106, + 159, 84, 161, 159, 159, 124, 159, 159, 162, 159, + 117, 118, 159, 84, 159, 122, 159, 159, 159, 159, + 127, 128, 129, 130, 131, 70, 159, 159, 159, 100, + 101, 102, 1, 159, 161, 106, 160, 82, 160, 160, + 160, 86, 160, 166, 161, 161, 117, 118, 161, 1, + 161, 122, 159, 161, 161, 162, 127, 128, 129, 130, + 131, 161, 31, 161, 161, 161, 165, 159, 162, 161, + 163, 116, 162, 162, 162, 162, 159, 122, 161, 163, + 162, 162, 162, 162, 162, 162, 162, 162, 159, 162, 161, 162, 137, 162, 139, 140, 141, 142, 143, 144, 162, 162, 162, 162, 162, 162, 151, 152, 162, 162, - 74, 162, 162, 165, 163, 163, 80, 163, 163, 163, + 74, 162, 162, 82, 162, 164, 80, 163, 163, 163, 163, 166, 167, 87, 88, 89, 163, 91, 163, 93, - 163, 95, 134, 135, 98, 163, 163, 163, 163, 103, - 104, 105, 163, 163, 163, 109, 110, 149, 163, 163, - 163, 115, 116, 163, 163, 163, 163, 163, 163, 161, - 124, 164, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, -1, 164, 164, 164, 164, 164, 164, + 82, 95, 163, 163, 98, 163, 163, 163, 163, 103, + 104, 105, 163, 163, 163, 109, 110, 116, 117, 118, + 163, 115, 116, 122, 163, 163, 163, 163, 163, 128, + 124, 163, 163, 163, 116, 117, 118, 163, 137, 163, + 122, 163, 163, 163, 163, 163, 128, 163, 163, 163, + 163, 163, 163, -1, 164, 137, 164, 164, 164, 158, + 164, 164, 164, 164, 163, 165, 164, 164, 167, 164, + -1, 164, 164, 164, 164, 164, 158, 164, 164, 164, + 164, 163, -1, 164, 164, 167, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - -1, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, -1, -1, - 166, -1, 167 + 164, 164, 164, 164, 164, 164, 164, -1, -1, -1, + 167 ); protected $actionBase = array( - 0, -2, 154, 542, 752, 893, 929, 580, 53, 394, - 855, 307, 307, 67, 307, 307, 307, 565, 908, 908, - 917, 908, 538, 784, 649, 649, 649, 708, 708, 708, - 708, 740, 740, 849, 849, 881, 817, 634, 1036, 1036, + 0, -2, 154, 542, 752, 893, 929, 52, 374, 431, + 398, 869, 793, 235, 307, 307, 793, 307, 784, 908, + 908, 917, 908, 538, 841, 468, 468, 468, 708, 708, + 708, 708, 740, 740, 849, 849, 881, 817, 634, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, @@ -512,65 +516,67 @@ class Php7 extends \PhpParser\ParserAbstract 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, - 1036, 1036, 12, 323, 389, 678, 1044, 1050, 1046, 1051, - 1042, 1041, 1045, 1047, 1052, 942, 943, 753, 946, 947, - 949, 950, 1048, 873, 1043, 1049, 291, 291, 291, 291, + 1036, 1036, 1036, 1036, 348, 346, 370, 653, 1063, 1069, + 1065, 1070, 1061, 1060, 1064, 1066, 1071, 946, 947, 774, + 949, 950, 943, 952, 1067, 882, 1062, 1068, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 346, 491, 50, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 54, 54, 54, 620, 620, - 359, 190, 184, 955, 955, 955, 955, 955, 955, 955, - 955, 955, 955, 658, 47, 144, 144, 7, 7, 7, - 7, 7, 371, -25, -25, -25, -25, 709, 347, 916, - 474, 526, 375, 280, 317, 245, 340, 340, 187, 187, - 396, 396, -87, -87, 396, 396, 396, 747, 747, 747, - 747, 443, 505, -94, 308, 454, 480, 480, 480, 480, - 454, 454, 454, 454, 755, 1054, 454, 454, 454, 641, - 822, 822, 998, 442, 442, 442, 822, 499, 776, 88, - 499, 88, 37, 92, 756, 85, -54, 425, 756, 639, - 764, 189, 143, 820, 524, 820, 1040, 385, 767, 413, - 735, 688, 857, 902, 1053, 787, 940, 788, 941, 228, - 98, 685, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, - 1039, 1039, 1039, 1055, 415, 1040, 286, 1055, 1055, 1055, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 534, 286, 483, 496, 286, 774, 415, 12, 800, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 736, - -16, 12, 323, 204, 204, 427, 168, 204, 204, 204, - 204, 12, 12, 12, 524, 773, 733, 537, 742, 377, - 773, 773, 773, 115, 124, 207, 342, 695, 754, 446, - 761, 761, 775, 957, 957, 761, 765, 761, 775, 973, - 761, 761, 957, 957, 809, 232, 625, 579, 612, 627, - 957, 475, 761, 761, 761, 761, 792, 643, 761, 433, - 281, 761, 761, 792, 758, 739, 46, 751, 957, 957, - 957, 792, 603, 751, 751, 751, 819, 821, 746, 738, - 571, 507, 645, 198, 783, 738, 738, 761, 619, 746, - 738, 746, 738, 812, 738, 738, 738, 746, 738, 765, - 585, 738, 691, 644, 188, 738, 6, 974, 975, 624, - 979, 967, 980, 1009, 981, 985, 878, 956, 992, 972, - 986, 965, 963, 750, 679, 680, 801, 797, 954, 771, - 771, 771, 951, 771, 771, 771, 771, 771, 771, 771, - 771, 679, 858, 814, 745, 777, 995, 682, 684, 743, - 872, 899, 948, 994, 1030, 987, 741, 689, 1016, 999, - 846, 875, 1000, 1001, 1017, 1031, 1032, 880, 772, 903, - 904, 859, 1003, 879, 771, 974, 985, 663, 972, 986, - 965, 963, 734, 724, 720, 723, 717, 704, 700, 703, - 737, 1033, 907, 818, 866, 1002, 952, 679, 867, 1012, - 856, 1018, 1019, 877, 778, 768, 868, 910, 1004, 1005, - 1006, 882, 1034, 884, 744, 1013, 997, 1020, 780, 911, - 1021, 1022, 1023, 1024, 887, 913, 888, 889, 823, 781, - 1010, 757, 918, 528, 769, 770, 789, 1008, 642, 993, - 900, 919, 920, 1025, 1026, 1027, 922, 923, 990, 828, - 1014, 760, 1015, 1011, 829, 830, 647, 785, 1035, 759, - 763, 779, 653, 674, 924, 925, 927, 991, 748, 762, - 841, 843, 1037, 683, 1038, 931, 677, 844, 696, 938, - 1029, 697, 699, 786, 901, 811, 782, 766, 1007, 749, - 845, 939, 847, 848, 850, 1028, 853, 0, 0, 0, + 291, 291, 291, 291, 291, 525, 191, 359, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 174, 174, + 174, 620, 620, 51, 465, 356, 955, 955, 955, 955, + 955, 955, 955, 955, 955, 955, 658, 184, 144, 144, + 7, 7, 7, 7, 7, 1031, 371, 1048, -25, -25, + -25, -25, 50, 725, 526, 449, 39, 317, 80, 474, + 474, 13, 13, 512, 512, 422, 422, 512, 512, 512, + 808, 808, 808, 808, 443, 505, 360, 308, -78, 209, + 209, 209, 209, -78, -78, -78, -78, 803, 877, -78, + -78, -78, 63, 641, 641, 822, -1, -1, -1, 641, + 253, 790, 548, 253, 384, 548, 480, 402, 764, 759, + -49, 447, 764, 639, 755, 198, 143, 825, 609, 825, + 1059, 320, 768, 426, 749, 720, 874, 904, 1072, 796, + 941, 798, 942, 106, -58, 710, 1058, 1058, 1058, 1058, + 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1073, 336, 1059, + 423, 1073, 1073, 1073, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 619, 423, 586, 616, 423, 795, + 336, 348, 814, 348, 348, 348, 348, 348, 348, 348, + 348, 348, 348, 750, 202, 348, 346, 78, 78, 484, + 65, 78, 78, 78, 78, 348, 348, 348, 348, 609, + 783, 766, 613, 813, 492, 783, 783, 783, 473, 135, + 378, 488, 713, 775, 67, 779, 779, 785, 969, 969, + 779, 769, 779, 785, 975, 779, 779, 969, 969, 823, + 280, 563, 478, 550, 568, 969, 377, 779, 779, 779, + 779, 746, 573, 779, 342, 314, 779, 779, 746, 744, + 760, 43, 762, 969, 969, 969, 746, 547, 762, 762, + 762, 839, 844, 794, 758, 444, 433, 588, 232, 801, + 758, 758, 779, 558, 794, 758, 794, 758, 745, 758, + 758, 758, 794, 758, 769, 502, 758, 717, 583, 224, + 758, 6, 979, 980, 624, 981, 973, 987, 1019, 991, + 992, 873, 965, 999, 974, 993, 972, 970, 773, 682, + 684, 818, 811, 963, 777, 777, 777, 956, 777, 777, + 777, 777, 777, 777, 777, 777, 682, 743, 829, 765, + 1006, 689, 691, 754, 906, 901, 1030, 1004, 1049, 994, + 828, 694, 1028, 1008, 846, 821, 1009, 1010, 1029, 1050, + 1052, 910, 782, 911, 912, 876, 1012, 883, 777, 979, + 992, 693, 974, 993, 972, 970, 748, 739, 737, 738, + 736, 735, 723, 734, 753, 1053, 954, 907, 878, 1011, + 957, 682, 879, 1023, 756, 1032, 1033, 827, 788, 778, + 880, 913, 1014, 1015, 1016, 884, 1054, 887, 830, 1024, + 951, 1035, 789, 918, 1037, 1038, 1039, 1040, 889, 919, + 892, 916, 900, 845, 776, 1020, 761, 920, 591, 787, + 791, 800, 1018, 606, 1000, 902, 921, 922, 1041, 1043, + 1044, 923, 924, 995, 847, 1026, 799, 1027, 1022, 848, + 850, 617, 797, 1055, 781, 786, 772, 621, 632, 925, + 927, 931, 998, 763, 770, 853, 855, 1056, 771, 1057, + 938, 635, 857, 718, 939, 1046, 719, 724, 637, 678, + 672, 731, 792, 903, 826, 757, 780, 1017, 724, 767, + 858, 940, 859, 860, 867, 1045, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 458, 458, 458, - 458, 458, 458, 307, 307, 307, 307, 0, 0, 307, - 0, 0, 0, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 307, 307, 307, 307, 307, 307, 307, + 0, 0, 307, 0, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, @@ -584,182 +590,182 @@ class Php7 extends \PhpParser\ParserAbstract 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 0, 0, 0, 0, 0, 0, 0, 0, + 291, 291, 291, 291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 219, 219, 291, 291, 291, 219, - 219, 219, 219, 219, 219, 219, 219, 219, 219, 0, - 291, 291, 291, 291, 291, 291, 291, 291, 809, 442, - 442, 442, 442, 219, 219, 219, 219, 219, -88, -88, - 219, 809, 219, 219, 442, 442, 219, 219, 219, 219, - 219, 219, 219, 219, 219, 219, 219, 0, 0, 286, - 88, 219, 765, 765, 765, 765, 219, 219, 219, 219, - 88, 88, 219, 219, 219, 0, 0, 0, 0, 0, - 0, 0, 0, 286, 88, 0, 286, 0, 765, 765, - 219, 0, 809, 314, 219, 0, 0, 0, 0, 286, - 765, 286, 415, 761, 88, 761, 415, 415, 204, 12, - 314, 527, 527, 527, 527, 0, 0, 524, 809, 809, - 809, 809, 809, 809, 809, 809, 809, 809, 809, 765, - 0, 809, 0, 765, 765, 765, 0, 0, 0, 0, + 291, 291, 291, 291, 291, 291, 291, 66, 66, 291, + 291, 291, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 0, 291, 291, 291, 291, 291, 291, 291, + 291, 66, 823, 66, -1, -1, -1, -1, 66, 66, + 66, -88, -88, 66, 384, 66, 66, -1, -1, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 0, 0, 423, 548, 66, 769, 769, 769, 769, 66, + 66, 66, 66, 548, 548, 66, 66, 66, 0, 0, + 0, 0, 0, 0, 0, 0, 423, 548, 0, 423, + 0, 0, 769, 769, 66, 384, 823, 643, 66, 0, + 0, 0, 0, 423, 769, 423, 336, 779, 548, 779, + 336, 336, 78, 348, 643, 611, 611, 611, 611, 0, + 0, 609, 823, 823, 823, 823, 823, 823, 823, 823, + 823, 823, 823, 769, 0, 823, 0, 769, 769, 769, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 765, 0, 0, 957, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 973, 0, 0, 0, 0, - 0, 0, 765, 0, 0, 0, 0, 0, 0, 0, - 0, 771, 778, 0, 778, 0, 771, 771, 771, 0, - 0, 0, 0, 785, 683 + 0, 0, 0, 0, 0, 769, 0, 0, 969, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 975, + 0, 0, 0, 0, 0, 0, 769, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 777, 788, 0, 788, + 0, 777, 777, 777, 0, 0, 0, 0, 797, 771 ); protected $actionDefault = array( 3,32767, 103,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 101,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 593, 593, 593, - 593,32767,32767, 253, 103,32767,32767, 467, 385, 385, - 385,32767,32767, 537, 537, 537, 537, 537, 537,32767, - 32767,32767,32767,32767,32767, 467,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 101,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 596, 596, + 596, 596,32767,32767, 254, 103,32767,32767, 469, 387, + 387, 387,32767,32767, 540, 540, 540, 540, 540, 540, + 32767,32767,32767,32767,32767,32767, 469,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 101,32767, - 32767,32767, 37, 7, 8, 10, 11, 50, 17, 323, - 32767,32767,32767,32767, 103,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 101, + 32767,32767,32767, 37, 7, 8, 10, 11, 50, 17, + 324,32767,32767,32767,32767, 103,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 586,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 589,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 471, 450, 451, 453, - 454, 384, 538, 592, 326, 589, 383, 146, 338, 328, - 241, 329, 257, 472, 258, 473, 476, 477, 214, 286, - 380, 150, 414, 468, 416, 466, 470, 415, 390, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 388, 389, 469, 447, 446, 445,32767,32767, - 412, 413, 417,32767,32767,32767,32767,32767,32767,32767, - 32767, 103,32767, 387, 420, 418, 419, 436, 437, 434, - 435, 438,32767, 439, 440, 441, 442,32767, 315,32767, - 32767,32767, 364, 362, 315, 112,32767,32767, 427, 428, + 32767,32767,32767,32767,32767,32767,32767,32767, 473, 452, + 453, 455, 456, 386, 541, 595, 327, 592, 385, 146, + 339, 329, 242, 330, 258, 474, 259, 475, 478, 479, + 215, 287, 382, 150, 151, 416, 470, 418, 468, 472, + 417, 392, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 390, 391, 471, 449, 448, + 447,32767,32767, 414, 415, 419,32767,32767,32767,32767, + 32767,32767,32767,32767, 103,32767, 389, 422, 420, 421, + 438, 439, 436, 437, 440,32767,32767,32767, 441, 442, + 443, 444, 316,32767,32767, 366, 364, 316, 112,32767, + 32767, 429, 430,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 534, 446,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 103, + 32767, 101, 536, 411, 413, 503, 424, 425, 423, 393, + 32767, 510,32767, 103,32767, 512,32767,32767,32767,32767, + 32767,32767,32767, 535,32767, 542, 542,32767, 496, 101, + 195,32767,32767,32767, 195, 195,32767,32767,32767,32767, + 32767,32767,32767,32767, 603, 496, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111,32767, 195, 111, + 32767,32767,32767, 101, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 190,32767, 268, 270, 103, 557, + 195,32767, 515,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 508,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 496, + 434, 139,32767, 139, 542, 426, 427, 428, 498, 542, + 542, 542, 312, 289,32767,32767,32767,32767, 513, 513, + 101, 101, 101, 101, 508,32767,32767,32767,32767, 112, + 100, 100, 100, 100, 100, 104, 102,32767,32767,32767, + 32767, 223, 100,32767, 102, 102,32767,32767, 223, 225, + 212, 102, 227,32767, 561, 562, 223, 102, 227, 227, + 227, 247, 247, 485, 318, 102, 100, 102, 102, 197, + 318, 318,32767, 102, 485, 318, 485, 318, 199, 318, + 318, 318, 485, 318,32767, 102, 318, 214, 100, 100, + 318,32767,32767,32767, 498,32767,32767,32767,32767,32767, + 32767,32767, 222,32767,32767,32767,32767,32767,32767,32767, + 529,32767, 546, 559, 432, 433, 435, 544, 457, 458, + 459, 460, 461, 462, 463, 465, 591,32767, 502,32767, + 32767,32767, 338, 601,32767, 601,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767, 531, 444,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 103,32767, 101, 533, - 409, 411, 501, 422, 423, 421, 391,32767, 508,32767, - 103, 510,32767,32767,32767,32767,32767,32767,32767, 532, - 32767, 539, 539,32767, 494, 101, 194,32767,32767,32767, - 194, 194,32767,32767,32767,32767,32767,32767,32767,32767, - 600, 494, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111,32767, 194, 111,32767,32767,32767, 101, - 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, - 189,32767, 267, 269, 103, 554, 194,32767, 513,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 506, + 32767, 602,32767, 542,32767,32767,32767,32767, 431, 9, + 76, 491, 43, 44, 52, 58, 519, 520, 521, 522, + 516, 517, 523, 518,32767,32767, 524, 567,32767,32767, + 543, 594,32767,32767,32767,32767,32767,32767, 139,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 494, 432, 139,32767, 139, 539, - 424, 425, 426, 496, 539, 539, 539, 311, 288,32767, - 32767,32767,32767, 511, 511, 101, 101, 101, 101, 506, - 32767,32767,32767,32767, 112, 100, 100, 100, 100, 100, - 104, 102,32767,32767,32767,32767, 222, 100,32767, 102, - 102,32767,32767, 222, 224, 211, 102, 226,32767, 558, - 559, 222, 102, 226, 226, 226, 246, 246, 483, 317, - 102, 100, 102, 102, 196, 317, 317,32767, 102, 483, - 317, 483, 317, 198, 317, 317, 317, 483, 317,32767, - 102, 317, 213, 100, 100, 317,32767,32767,32767, 496, - 32767,32767,32767,32767,32767,32767,32767, 221,32767,32767, - 32767,32767,32767,32767,32767, 526,32767, 543, 556, 430, - 431, 433, 541, 455, 456, 457, 458, 459, 460, 461, - 463, 588,32767, 500,32767,32767,32767,32767, 337, 598, - 32767, 598,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 599,32767, 539, - 32767,32767,32767,32767, 429, 9, 76, 489, 43, 44, - 52, 58, 517, 518, 519, 520, 514, 515, 521, 516, - 32767,32767, 522, 564,32767,32767, 540, 591,32767,32767, - 32767,32767,32767,32767, 139,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 526,32767, 137,32767, + 529,32767, 137,32767,32767,32767,32767,32767,32767,32767, + 32767, 525,32767,32767,32767, 542,32767,32767,32767,32767, + 314, 311,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 542,32767, + 32767,32767,32767,32767, 291,32767, 308,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 539,32767,32767,32767,32767, 313, 310,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 539,32767,32767,32767,32767,32767, 290, - 32767, 307,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 285,32767, - 32767, 379,32767,32767,32767,32767, 358,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 152, 152, 3, - 3, 340, 152, 152, 152, 340, 340, 152, 340, 340, - 340, 152, 152, 152, 152, 152, 152, 279, 184, 261, - 264, 246, 246, 152, 350, 152 + 32767,32767,32767, 286,32767,32767, 381, 498, 294, 296, + 297,32767,32767,32767,32767, 360,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 153, 153, 3, + 3, 341, 153, 153, 153, 341, 341, 153, 341, 341, + 341, 153, 153, 153, 153, 153, 153, 280, 185, 262, + 265, 247, 247, 153, 352, 153 ); protected $goto = array( - 194, 194, 685, 425, 653, 346, 614, 650, 419, 310, - 311, 331, 569, 316, 424, 332, 426, 630, 1200, 930, - 693, 1051, 1201, 1204, 931, 1205, 165, 165, 165, 165, - 218, 195, 191, 191, 175, 177, 213, 191, 191, 191, - 191, 191, 192, 192, 192, 192, 192, 192, 186, 187, - 188, 189, 190, 215, 213, 216, 529, 530, 415, 531, - 533, 534, 535, 536, 537, 538, 539, 540, 1120, 166, - 167, 168, 193, 169, 170, 171, 164, 172, 173, 174, - 176, 212, 214, 217, 235, 240, 241, 242, 254, 255, - 256, 257, 258, 259, 260, 261, 263, 264, 265, 266, - 278, 279, 313, 314, 315, 420, 421, 422, 574, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 178, 234, 179, 196, 197, 198, - 236, 186, 187, 188, 189, 190, 215, 1120, 199, 180, - 181, 182, 200, 196, 183, 237, 201, 199, 163, 202, - 203, 184, 204, 205, 206, 185, 207, 208, 209, 210, - 211, 275, 275, 275, 275, 843, 593, 646, 647, 560, - 664, 665, 666, 720, 629, 631, 840, 418, 651, 604, - 841, 350, 675, 679, 996, 683, 691, 992, 616, 616, - 817, 350, 350, 1252, 1252, 1252, 1252, 1252, 1252, 1252, - 1252, 1252, 1252, 1092, 1093, 350, 350, 874, 350, 848, - 1337, 896, 891, 892, 905, 849, 893, 846, 894, 895, - 847, 548, 900, 899, 901, 350, 391, 394, 554, 594, - 598, 1270, 1270, 1072, 1068, 1069, 1270, 1270, 1270, 1270, - 1270, 1270, 1270, 1270, 1270, 1270, 1268, 1268, 815, 347, - 348, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, - 1268, 1221, 1020, 1221, 1020, 1221, 836, 5, 1020, 6, - 1020, 1020, 1281, 961, 1020, 1020, 1020, 1020, 1020, 1020, - 1020, 1020, 1020, 1020, 1020, 349, 349, 349, 349, 1221, - 460, 460, 566, 678, 1221, 1221, 1221, 1221, 344, 460, - 1221, 1221, 1221, 1302, 1302, 1302, 1302, 602, 617, 620, - 621, 622, 623, 643, 644, 645, 695, 836, 912, 553, - 546, 1310, 913, 548, 532, 532, 821, 856, 982, 532, - 532, 532, 532, 532, 532, 532, 532, 532, 532, 543, - 473, 543, 868, 543, 928, 855, 928, 389, 475, 337, - 546, 553, 562, 563, 339, 572, 595, 609, 610, 1320, - 1320, 249, 249, 1026, 1025, 15, 821, 450, 821, 494, - 565, 495, 955, 955, 955, 955, 1320, 501, 450, 949, - 956, 839, 652, 1321, 1321, 1169, 1214, 246, 246, 246, - 246, 248, 250, 1323, 985, 959, 959, 957, 959, 719, - 1321, 545, 994, 989, 470, 1295, 1296, 953, 405, 692, - 917, 1108, 432, 541, 541, 541, 541, 612, 597, 452, - 444, 1029, 1030, 1001, 658, 444, 1292, 444, 1292, 674, - 1292, 860, 833, 656, 980, 836, 861, 547, 557, 854, - 321, 305, 547, 333, 557, 1297, 1298, 392, 456, 570, - 607, 1211, 944, 398, 858, 1304, 1304, 1304, 1304, 463, - 573, 464, 465, 608, 1004, 866, 403, 404, 1328, 1329, - 1057, 662, 1212, 663, 471, 407, 408, 409, 723, 676, - 870, 1288, 410, 624, 626, 627, 342, 427, 1216, 869, - 857, 1056, 1060, 427, 864, 1061, 1103, 966, 0, 0, - 964, 1027, 1027, 0, 0, 0, 657, 1038, 1034, 1035, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 0, 1059, 444, 954, 0, 1290, 1290, 1059, 592, - 1085, 0, 696, 682, 682, 0, 502, 688, 1083, 0, - 0, 0, 1217, 1218, 272, 428, 1101, 873, 0, 544, - 831, 544, 0, 0, 0, 673, 938, 0, 0, 1015, - 1031, 1032, 0, 0, 0, 0, 0, 0, 1219, 1278, - 1279, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 196, 196, 1031, 703, 694, 430, 658, 1062, 1334, 1334, + 424, 313, 314, 335, 573, 319, 429, 336, 431, 635, + 651, 652, 850, 669, 670, 671, 1334, 167, 167, 167, + 167, 221, 197, 193, 193, 177, 179, 216, 193, 193, + 193, 193, 193, 194, 194, 194, 194, 194, 194, 188, + 189, 190, 191, 192, 218, 216, 219, 534, 535, 420, + 536, 538, 539, 540, 541, 542, 543, 544, 545, 1132, + 168, 169, 170, 195, 171, 172, 173, 166, 174, 175, + 176, 178, 215, 217, 220, 238, 243, 244, 245, 257, + 258, 259, 260, 261, 262, 263, 264, 268, 269, 270, + 271, 281, 282, 316, 317, 318, 425, 426, 427, 578, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 180, 237, 181, 198, 199, + 200, 239, 188, 189, 190, 191, 192, 218, 1132, 201, + 182, 183, 184, 202, 198, 185, 240, 203, 201, 165, + 204, 205, 186, 206, 207, 208, 187, 209, 210, 211, + 212, 213, 214, 853, 851, 278, 278, 278, 278, 418, + 620, 620, 350, 570, 597, 1265, 1265, 1265, 1265, 1265, + 1265, 1265, 1265, 1265, 1265, 1283, 1283, 831, 618, 655, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 353, 353, 353, 353, 866, 557, 550, 858, 825, 907, + 902, 903, 916, 859, 904, 856, 905, 906, 857, 878, + 457, 910, 865, 884, 546, 546, 546, 546, 831, 601, + 831, 1084, 1079, 1080, 1081, 341, 550, 557, 566, 567, + 343, 576, 599, 613, 614, 407, 408, 972, 465, 465, + 667, 15, 668, 1323, 411, 412, 413, 465, 681, 348, + 1233, 414, 1233, 478, 569, 346, 439, 1031, 1031, 1233, + 993, 480, 1031, 393, 1031, 1031, 1104, 1105, 1031, 1031, + 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1315, + 1315, 1315, 1315, 1233, 657, 1333, 1333, 1055, 1233, 1233, + 1233, 1233, 1037, 1036, 1233, 1233, 1233, 1034, 1034, 1181, + 354, 678, 949, 1333, 437, 1026, 1042, 1043, 337, 691, + 354, 354, 827, 923, 691, 1040, 1041, 924, 691, 663, + 1336, 939, 871, 939, 354, 354, 1281, 1281, 354, 679, + 1350, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 552, 537, 537, 911, 354, 912, 537, 537, 537, + 537, 537, 537, 537, 537, 537, 537, 548, 564, 548, + 574, 611, 730, 634, 636, 849, 548, 656, 475, 1308, + 1309, 680, 684, 1007, 692, 701, 1003, 252, 252, 996, + 970, 970, 968, 970, 729, 843, 549, 1005, 1000, 423, + 455, 608, 1294, 846, 955, 966, 966, 966, 966, 325, + 308, 455, 960, 967, 249, 249, 249, 249, 251, 253, + 402, 351, 352, 683, 868, 551, 561, 449, 449, 449, + 551, 1305, 561, 1305, 612, 396, 461, 1010, 1010, 1224, + 1305, 395, 398, 558, 598, 602, 1015, 468, 577, 469, + 470, 1310, 1311, 876, 552, 846, 1341, 1342, 964, 409, + 702, 733, 324, 275, 324, 1317, 1317, 1317, 1317, 606, + 621, 624, 625, 626, 627, 648, 649, 650, 705, 1068, + 596, 1097, 874, 706, 476, 1228, 507, 697, 880, 1095, + 1115, 432, 1301, 628, 630, 632, 432, 879, 867, 1067, + 1071, 5, 1072, 6, 1038, 1038, 977, 0, 975, 662, + 1049, 1045, 1046, 0, 0, 0, 0, 1226, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 928, + 1120, 449, 965, 1070, 0, 0, 616, 1303, 1303, 1070, + 1229, 1230, 1012, 499, 0, 500, 0, 0, 841, 0, + 870, 506, 661, 991, 1113, 883, 1212, 941, 864, 0, + 1213, 1216, 942, 1217, 0, 0, 1231, 1291, 1292, 0, + 1223, 0, 0, 0, 846, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 252, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 999, 999 + 0, 0, 0, 0, 0, 0, 0, 255, 255 ); protected $gotoCheck = array( - 42, 42, 72, 65, 65, 96, 55, 55, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 78, 78, - 9, 126, 78, 78, 78, 78, 42, 42, 42, 42, + 42, 42, 72, 9, 72, 65, 65, 126, 181, 181, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 85, 85, 26, 85, 85, 85, 181, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, @@ -773,97 +779,97 @@ class Php7 extends \PhpParser\ParserAbstract 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 23, 23, 23, 23, 15, 129, 85, 85, 48, - 85, 85, 85, 48, 48, 48, 26, 13, 48, 13, - 27, 14, 48, 48, 48, 48, 48, 48, 107, 107, - 7, 14, 14, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 143, 143, 14, 14, 45, 14, 15, - 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 14, 64, 15, 64, 14, 58, 58, 58, 58, - 58, 168, 168, 15, 15, 15, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 169, 169, 6, 96, - 96, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 72, 72, 72, 72, 72, 22, 46, 72, 46, - 72, 72, 14, 49, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 24, 24, 24, 24, 72, - 148, 148, 170, 14, 72, 72, 72, 72, 177, 148, - 72, 72, 72, 9, 9, 9, 9, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 22, 72, 75, - 75, 179, 72, 14, 171, 171, 12, 35, 102, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 19, - 83, 19, 35, 19, 9, 35, 9, 61, 83, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 180, - 180, 5, 5, 117, 117, 75, 12, 19, 12, 154, - 103, 154, 19, 19, 19, 19, 180, 154, 19, 19, - 19, 25, 63, 181, 181, 150, 14, 5, 5, 5, - 5, 5, 5, 180, 25, 25, 25, 25, 25, 25, - 181, 25, 25, 25, 174, 174, 174, 92, 92, 92, - 17, 17, 112, 106, 106, 106, 106, 17, 106, 82, - 23, 118, 118, 17, 119, 23, 129, 23, 129, 115, - 129, 17, 18, 17, 17, 22, 39, 9, 9, 17, - 167, 167, 9, 29, 9, 176, 176, 9, 9, 2, - 2, 17, 91, 28, 37, 129, 129, 129, 129, 9, - 9, 9, 9, 79, 109, 9, 81, 81, 9, 9, - 128, 81, 159, 81, 156, 81, 81, 81, 98, 81, - 41, 129, 81, 84, 84, 84, 81, 116, 20, 16, - 16, 16, 16, 116, 9, 131, 146, 95, -1, -1, - 16, 116, 116, -1, -1, -1, 116, 116, 116, 116, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, -1, 129, 23, 16, -1, 129, 129, 129, 8, - 8, -1, 8, 8, 8, -1, 8, 8, 8, -1, - -1, -1, 20, 20, 24, 88, 16, 16, -1, 24, - 20, 24, -1, -1, -1, 88, 88, -1, -1, 88, - 88, 88, -1, -1, -1, -1, -1, -1, 20, 20, - 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 42, 42, 42, 15, 27, 23, 23, 23, 23, 43, + 107, 107, 96, 170, 129, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 168, 168, 12, 55, 55, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 24, 24, 24, 24, 35, 75, 75, 15, 6, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 35, + 82, 15, 35, 45, 106, 106, 106, 106, 12, 106, + 12, 15, 15, 15, 15, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 81, 81, 49, 148, 148, + 81, 75, 81, 179, 81, 81, 81, 148, 81, 177, + 72, 81, 72, 83, 103, 81, 82, 72, 72, 72, + 102, 83, 72, 61, 72, 72, 143, 143, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 9, + 9, 9, 9, 72, 63, 180, 180, 113, 72, 72, + 72, 72, 117, 117, 72, 72, 72, 88, 88, 150, + 14, 88, 88, 180, 112, 88, 88, 88, 29, 7, + 14, 14, 7, 72, 7, 118, 118, 72, 7, 119, + 180, 9, 39, 9, 14, 14, 169, 169, 14, 115, + 14, 169, 169, 169, 169, 169, 169, 169, 169, 169, + 169, 14, 171, 171, 64, 14, 64, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 19, 48, 19, + 2, 2, 48, 48, 48, 25, 19, 48, 174, 174, + 174, 48, 48, 48, 48, 48, 48, 5, 5, 25, + 25, 25, 25, 25, 25, 18, 25, 25, 25, 13, + 19, 13, 14, 22, 91, 19, 19, 19, 19, 167, + 167, 19, 19, 19, 5, 5, 5, 5, 5, 5, + 28, 96, 96, 14, 37, 9, 9, 23, 23, 23, + 9, 129, 9, 129, 79, 9, 9, 106, 106, 159, + 129, 58, 58, 58, 58, 58, 109, 9, 9, 9, + 9, 176, 176, 9, 14, 22, 9, 9, 92, 92, + 92, 98, 24, 24, 24, 129, 129, 129, 129, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 128, + 8, 8, 9, 8, 156, 20, 8, 8, 41, 8, + 146, 116, 129, 84, 84, 84, 116, 16, 16, 16, + 16, 46, 131, 46, 116, 116, 95, -1, 16, 116, + 116, 116, 116, -1, -1, -1, -1, 14, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 17, + 17, 23, 16, 129, -1, -1, 17, 129, 129, 129, + 20, 20, 17, 154, -1, 154, -1, -1, 20, -1, + 17, 154, 17, 17, 16, 16, 78, 78, 17, -1, + 78, 78, 78, 78, -1, -1, 20, 20, 20, -1, + 17, -1, -1, -1, 22, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 106, 106 + -1, -1, -1, -1, -1, -1, -1, 5, 5 ); protected $gotoBase = array( - 0, 0, -250, 0, 0, 360, 235, 181, 522, 7, - 0, 0, 33, -156, -113, -178, 43, -49, 126, 72, - 100, 0, -9, 158, 282, 377, 172, 176, 120, 150, - 0, 0, 0, 0, 0, -39, 0, 119, 0, 116, - 0, 45, -1, 0, 0, 195, -456, 0, -529, 250, - 0, 0, 0, 0, 0, -33, 0, 0, 182, 0, - 0, 306, 0, 143, 203, -235, 0, 0, 0, 0, - 0, 0, -6, 0, 0, -21, 0, 0, -385, 124, - -46, -19, 144, -123, 10, -538, 0, 0, 275, 0, - 0, 127, 106, 0, 0, 60, -472, 0, 76, 0, - 0, 0, 294, 328, 0, 0, 386, -50, 0, 99, - 0, 0, 138, 0, 0, 149, 219, 87, 139, 137, - 0, 0, 0, 0, 0, 0, 19, 0, 101, 159, - 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -69, 0, 0, 58, 0, 257, 0, - 114, 0, 0, 0, -120, 0, 40, 0, 0, 108, - 0, 0, 0, 0, 0, 0, 0, 122, -7, 8, - 264, 86, 0, 0, 107, 0, 78, 269, 0, 291, - 55, 79, 0, 0 + 0, 0, -339, 0, 0, 386, 195, 312, 472, -10, + 0, 0, -109, 62, 13, -184, 46, 65, 86, 102, + 93, 0, 125, 162, 197, 371, 18, 160, 83, 22, + 0, 0, 0, 0, 0, -166, 0, 85, 0, 9, + 0, 48, -1, 157, 0, 207, -232, 0, -340, 223, + 0, 0, 0, 0, 0, 148, 0, 0, 396, 0, + 0, 231, 0, 52, 334, -236, 0, 0, 0, 0, + 0, 0, -5, 0, 0, -139, 0, 0, 149, 91, + 112, -245, -58, -205, 15, -695, 0, 0, 28, 0, + 0, 75, 154, 0, 0, 64, -310, 0, 55, 0, + 0, 0, 235, 221, 0, 0, 196, -71, 0, 77, + 0, 0, 37, 24, 0, 56, 219, 23, 40, 39, + 0, 0, 0, 0, 0, 0, 5, 0, 106, 166, + 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 47, 0, 214, 0, + 35, 0, 0, 0, 49, 0, 45, 0, 0, 71, + 0, 0, 0, 0, 0, 0, 0, 88, -56, 95, + 144, 111, 0, 0, 78, 0, 80, 229, 0, 222, + -12, -299, 0, 0 ); protected $gotoDefault = array( - -32768, 506, 727, 4, 728, 921, 804, 813, 590, 523, - 694, 343, 618, 416, 1286, 898, 1107, 571, 832, 1230, - 1238, 451, 835, 326, 717, 880, 881, 882, 395, 381, - 387, 393, 641, 619, 488, 867, 447, 859, 480, 862, - 446, 871, 162, 413, 504, 875, 3, 877, 550, 908, - 382, 885, 383, 669, 887, 556, 889, 890, 390, 396, - 397, 1112, 564, 615, 902, 253, 558, 903, 380, 904, - 911, 385, 388, 680, 459, 499, 493, 406, 1087, 559, - 601, 638, 441, 467, 613, 625, 611, 474, 1023, 411, - 325, 943, 951, 481, 457, 965, 345, 973, 725, 1119, - 632, 483, 981, 633, 988, 991, 524, 525, 472, 1003, - 268, 1006, 484, 1044, 659, 1017, 1018, 660, 634, 1040, - 635, 661, 636, 1042, 466, 591, 1050, 448, 1058, 1274, - 449, 1062, 262, 1065, 274, 412, 429, 1070, 1071, 8, - 1077, 686, 687, 10, 273, 503, 1102, 681, 445, 1118, - 433, 1188, 1190, 552, 485, 1208, 1207, 672, 500, 1213, - 442, 1277, 443, 526, 468, 312, 527, 304, 329, 309, - 542, 291, 330, 528, 469, 1283, 1291, 327, 30, 1311, - 1322, 338, 568, 606 + -32768, 511, 737, 4, 738, 932, 814, 823, 594, 528, + 704, 347, 622, 421, 1299, 909, 1119, 575, 842, 1242, + 1250, 456, 845, 330, 727, 891, 892, 893, 399, 385, + 391, 397, 646, 623, 493, 877, 452, 869, 485, 872, + 451, 881, 164, 417, 509, 885, 3, 888, 554, 919, + 386, 896, 387, 674, 898, 560, 900, 901, 394, 400, + 401, 1124, 568, 619, 913, 256, 562, 914, 384, 915, + 922, 389, 392, 685, 464, 504, 498, 410, 1099, 563, + 605, 643, 446, 472, 617, 629, 615, 479, 433, 415, + 329, 954, 962, 486, 462, 976, 349, 984, 735, 1131, + 637, 488, 992, 638, 999, 1002, 529, 530, 477, 1014, + 272, 1017, 489, 12, 664, 1028, 1029, 665, 639, 1051, + 640, 666, 641, 1053, 471, 595, 1061, 453, 1069, 1287, + 454, 1073, 266, 1076, 277, 416, 434, 1082, 1083, 9, + 1089, 695, 696, 11, 276, 508, 1114, 686, 450, 1130, + 438, 1200, 1202, 556, 490, 1220, 1219, 677, 505, 1225, + 447, 1290, 448, 531, 473, 315, 532, 307, 333, 312, + 547, 294, 334, 533, 474, 1296, 1304, 331, 31, 1324, + 1335, 342, 572, 610 ); protected $ruleToNonTerminal = array( @@ -882,30 +888,30 @@ class Php7 extends \PhpParser\ParserAbstract 4, 4, 4, 4, 29, 29, 30, 30, 32, 34, 34, 28, 36, 36, 33, 38, 38, 35, 35, 37, 37, 39, 39, 31, 40, 40, 41, 43, 44, 44, - 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, + 45, 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 25, 25, 68, 68, 71, 71, 70, 69, - 69, 62, 74, 74, 75, 75, 76, 76, 77, 77, - 78, 78, 79, 79, 26, 26, 27, 27, 27, 27, - 27, 87, 87, 89, 89, 82, 82, 90, 90, 91, - 91, 91, 83, 83, 86, 86, 84, 84, 92, 93, - 93, 56, 56, 64, 64, 67, 67, 67, 66, 94, - 94, 95, 57, 57, 57, 57, 96, 96, 97, 97, - 98, 98, 99, 100, 100, 101, 101, 102, 102, 54, - 54, 50, 50, 104, 52, 52, 105, 51, 51, 53, - 53, 63, 63, 63, 63, 80, 80, 108, 108, 110, - 110, 111, 111, 111, 111, 109, 109, 109, 113, 113, - 113, 113, 88, 88, 116, 116, 116, 117, 117, 114, - 114, 118, 118, 120, 120, 121, 121, 115, 122, 122, - 119, 123, 123, 123, 123, 112, 112, 81, 81, 81, - 20, 20, 20, 125, 124, 124, 126, 126, 126, 126, - 59, 127, 127, 128, 60, 130, 130, 131, 131, 132, - 132, 85, 133, 133, 133, 133, 133, 133, 138, 138, - 139, 139, 140, 140, 140, 140, 140, 141, 142, 142, - 137, 137, 134, 134, 136, 136, 144, 144, 143, 143, - 143, 143, 143, 143, 143, 135, 145, 145, 147, 146, - 146, 61, 103, 148, 148, 55, 55, 42, 42, 42, + 49, 49, 49, 25, 25, 68, 68, 71, 71, 70, + 69, 69, 62, 74, 74, 75, 75, 76, 76, 77, + 77, 78, 78, 79, 79, 26, 26, 27, 27, 27, + 27, 27, 87, 87, 89, 89, 82, 82, 90, 90, + 91, 91, 91, 83, 83, 86, 86, 84, 84, 92, + 93, 93, 56, 56, 64, 64, 67, 67, 67, 66, + 94, 94, 95, 57, 57, 57, 57, 96, 96, 97, + 97, 98, 98, 99, 100, 100, 101, 101, 102, 102, + 54, 54, 50, 50, 104, 52, 52, 105, 51, 51, + 53, 53, 63, 63, 63, 63, 80, 80, 108, 108, + 110, 110, 111, 111, 111, 111, 109, 109, 109, 113, + 113, 113, 113, 88, 88, 116, 116, 116, 117, 117, + 114, 114, 118, 118, 120, 120, 121, 121, 115, 122, + 122, 119, 123, 123, 123, 123, 112, 112, 81, 81, + 81, 20, 20, 20, 125, 124, 124, 126, 126, 126, + 126, 59, 127, 127, 128, 60, 130, 130, 131, 131, + 132, 132, 85, 133, 133, 133, 133, 133, 133, 133, + 138, 138, 139, 139, 140, 140, 140, 140, 140, 141, + 142, 142, 137, 137, 134, 134, 136, 136, 144, 144, + 143, 143, 143, 143, 143, 143, 143, 135, 145, 145, + 147, 146, 146, 61, 103, 148, 148, 55, 55, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, @@ -915,20 +921,20 @@ class Php7 extends \PhpParser\ParserAbstract 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 155, 149, 149, 154, 154, 157, 158, 158, 159, 160, - 161, 161, 161, 161, 19, 19, 72, 72, 72, 72, - 150, 150, 150, 150, 163, 163, 151, 151, 153, 153, - 153, 156, 156, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 169, 169, 107, 171, 171, 171, 171, 152, - 152, 152, 152, 152, 152, 152, 152, 58, 58, 166, - 166, 166, 166, 172, 172, 162, 162, 162, 173, 173, - 173, 173, 173, 173, 73, 73, 65, 65, 65, 65, - 129, 129, 129, 129, 176, 175, 165, 165, 165, 165, - 165, 165, 165, 164, 164, 164, 174, 174, 174, 174, - 106, 170, 178, 178, 177, 177, 179, 179, 179, 179, - 179, 179, 179, 179, 167, 167, 167, 167, 181, 182, - 180, 180, 180, 180, 180, 180, 180, 180, 183, 183, - 183, 183 + 42, 42, 155, 149, 149, 154, 154, 157, 158, 158, + 159, 160, 161, 161, 161, 161, 19, 19, 72, 72, + 72, 72, 150, 150, 150, 150, 163, 163, 151, 151, + 153, 153, 153, 156, 156, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 169, 169, 169, 107, 171, 171, + 171, 171, 152, 152, 152, 152, 152, 152, 152, 152, + 58, 58, 166, 166, 166, 166, 172, 172, 162, 162, + 162, 173, 173, 173, 173, 173, 173, 73, 73, 65, + 65, 65, 65, 129, 129, 129, 129, 176, 175, 165, + 165, 165, 165, 165, 165, 165, 164, 164, 164, 174, + 174, 174, 174, 106, 170, 178, 178, 177, 177, 179, + 179, 179, 179, 179, 179, 179, 179, 167, 167, 167, + 167, 181, 182, 180, 180, 180, 180, 180, 180, 180, + 180, 183, 183, 183, 183 ); protected $ruleToLength = array( @@ -947,53 +953,53 @@ class Php7 extends \PhpParser\ParserAbstract 3, 4, 2, 3, 1, 1, 7, 6, 2, 3, 1, 2, 3, 1, 2, 3, 1, 1, 3, 1, 3, 1, 2, 2, 3, 1, 3, 2, 3, 1, - 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, - 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, - 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, - 2, 1, 1, 1, 0, 2, 1, 3, 8, 0, - 4, 2, 1, 3, 0, 1, 0, 1, 0, 1, - 3, 1, 1, 1, 8, 9, 7, 8, 7, 6, - 8, 0, 2, 0, 2, 1, 2, 1, 2, 1, - 1, 1, 0, 2, 0, 2, 0, 2, 2, 1, - 3, 1, 4, 1, 4, 1, 1, 4, 2, 1, - 3, 3, 3, 4, 4, 5, 0, 2, 4, 3, - 1, 1, 7, 0, 2, 1, 3, 3, 4, 1, - 4, 0, 2, 5, 0, 2, 6, 0, 2, 0, - 3, 1, 2, 1, 1, 2, 0, 1, 3, 0, - 2, 1, 1, 1, 1, 6, 8, 6, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, - 3, 1, 3, 3, 3, 3, 3, 1, 3, 3, - 1, 1, 2, 1, 1, 0, 1, 0, 2, 2, - 2, 4, 3, 1, 1, 3, 1, 2, 2, 3, - 2, 3, 1, 1, 2, 3, 1, 1, 3, 2, - 0, 1, 5, 5, 10, 3, 5, 1, 1, 3, - 0, 2, 4, 5, 4, 4, 4, 3, 1, 1, - 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, - 3, 2, 2, 3, 1, 0, 1, 1, 3, 3, - 3, 4, 1, 1, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, - 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 2, 0, 1, 1, 1, 1, 1, 3, + 7, 10, 5, 7, 9, 5, 3, 3, 3, 3, + 3, 3, 1, 2, 5, 7, 9, 6, 5, 6, + 3, 2, 1, 1, 1, 0, 2, 1, 3, 8, + 0, 4, 2, 1, 3, 0, 1, 0, 1, 0, + 1, 3, 1, 1, 1, 8, 9, 7, 8, 7, + 6, 8, 0, 2, 0, 2, 1, 2, 1, 2, + 1, 1, 1, 0, 2, 0, 2, 0, 2, 2, + 1, 3, 1, 4, 1, 4, 1, 1, 4, 2, + 1, 3, 3, 3, 4, 4, 5, 0, 2, 4, + 3, 1, 1, 7, 0, 2, 1, 3, 3, 4, + 1, 4, 0, 2, 5, 0, 2, 6, 0, 2, + 0, 3, 1, 2, 1, 1, 2, 0, 1, 3, + 0, 2, 1, 1, 1, 1, 6, 8, 6, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 3, 1, 3, 3, 3, 3, 3, 1, 3, + 3, 1, 1, 2, 1, 1, 0, 1, 0, 2, + 2, 2, 4, 3, 1, 1, 3, 1, 2, 2, + 3, 2, 3, 1, 1, 2, 3, 1, 1, 3, + 2, 0, 1, 5, 5, 6, 10, 3, 5, 1, + 1, 3, 0, 2, 4, 5, 4, 4, 4, 3, + 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, + 1, 1, 3, 2, 2, 3, 1, 0, 1, 1, + 3, 3, 3, 4, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 5, 4, 3, 4, 4, - 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 1, 3, 2, 1, 2, 4, - 2, 2, 8, 9, 8, 9, 9, 10, 9, 10, - 8, 3, 2, 0, 4, 2, 1, 3, 2, 1, - 2, 2, 2, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 1, 1, 0, 3, 0, 1, - 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 3, 3, 4, 1, 1, 3, 1, - 1, 1, 1, 1, 3, 2, 3, 0, 1, 1, - 3, 1, 1, 1, 1, 1, 3, 1, 1, 4, - 4, 1, 4, 4, 0, 1, 1, 1, 3, 3, - 1, 4, 2, 2, 1, 3, 1, 4, 4, 3, - 3, 3, 3, 1, 3, 1, 1, 3, 1, 1, - 4, 1, 1, 1, 3, 1, 1, 2, 1, 3, - 4, 3, 2, 0, 2, 2, 1, 2, 1, 1, - 1, 4, 3, 3, 3, 3, 6, 3, 1, 1, - 2, 1 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 5, 4, 3, + 4, 4, 2, 2, 4, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 3, 2, 1, + 2, 4, 2, 2, 8, 9, 8, 9, 9, 10, + 9, 10, 8, 3, 2, 0, 4, 2, 1, 3, + 2, 1, 2, 2, 2, 4, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 1, 1, 0, 3, + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 5, 3, 3, 4, 1, + 1, 3, 1, 1, 1, 1, 1, 3, 2, 3, + 0, 1, 1, 3, 1, 1, 1, 1, 1, 3, + 1, 1, 4, 4, 1, 4, 4, 0, 1, 1, + 1, 3, 3, 1, 4, 2, 2, 1, 3, 1, + 4, 4, 3, 3, 3, 3, 1, 3, 1, 1, + 3, 1, 1, 4, 1, 1, 1, 3, 1, 1, + 2, 1, 3, 4, 3, 2, 0, 2, 2, 1, + 2, 1, 1, 1, 4, 3, 3, 3, 3, 6, + 3, 1, 1, 2, 1 ); protected function initReduceCallbacks() { @@ -1456,20 +1462,20 @@ protected function initReduceCallbacks() { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 150 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributeStack[$stackPos-(3-1)]), $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 151 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; + $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributeStack[$stackPos-(3-1)]), $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 152 => function ($stackPos) { - $this->semValue = array(); + if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; }, 153 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array(); }, 154 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; + if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 155 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -1478,9 +1484,12 @@ protected function initReduceCallbacks() { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 157 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 158 => function ($stackPos) { + throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 159 => function ($stackPos) { if ($this->semStack[$stackPos-(3-2)]) { $this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); }; @@ -1490,46 +1499,46 @@ protected function initReduceCallbacks() { } }, - 159 => function ($stackPos) { + 160 => function ($stackPos) { $this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => is_array($this->semStack[$stackPos-(7-5)]) ? $this->semStack[$stackPos-(7-5)] : array($this->semStack[$stackPos-(7-5)]), 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 160 => function ($stackPos) { + 161 => function ($stackPos) { $this->semValue = new Stmt\If_($this->semStack[$stackPos-(10-3)], ['stmts' => $this->semStack[$stackPos-(10-6)], 'elseifs' => $this->semStack[$stackPos-(10-7)], 'else' => $this->semStack[$stackPos-(10-8)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, - 161 => function ($stackPos) { + 162 => function ($stackPos) { $this->semValue = new Stmt\While_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 162 => function ($stackPos) { + 163 => function ($stackPos) { $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(7-5)], is_array($this->semStack[$stackPos-(7-2)]) ? $this->semStack[$stackPos-(7-2)] : array($this->semStack[$stackPos-(7-2)]), $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 163 => function ($stackPos) { + 164 => function ($stackPos) { $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 164 => function ($stackPos) { + 165 => function ($stackPos) { $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 165 => function ($stackPos) { + 166 => function ($stackPos) { $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 166 => function ($stackPos) { + 167 => function ($stackPos) { $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 167 => function ($stackPos) { + 168 => function ($stackPos) { $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 168 => function ($stackPos) { + 169 => function ($stackPos) { $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 169 => function ($stackPos) { + 170 => function ($stackPos) { $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 170 => function ($stackPos) { + 171 => function ($stackPos) { $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 171 => function ($stackPos) { + 172 => function ($stackPos) { $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 172 => function ($stackPos) { + 173 => function ($stackPos) { $e = $this->semStack[$stackPos-(2-1)]; if ($e instanceof Expr\Throw_) { @@ -1541,1128 +1550,1126 @@ protected function initReduceCallbacks() { } }, - 173 => function ($stackPos) { + 174 => function ($stackPos) { $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 174 => function ($stackPos) { + 175 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 175 => function ($stackPos) { + 176 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 176 => function ($stackPos) { + 177 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(6-3)], new Expr\Error($this->startAttributeStack[$stackPos-(6-4)] + $this->endAttributeStack[$stackPos-(6-4)]), ['stmts' => $this->semStack[$stackPos-(6-6)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 177 => function ($stackPos) { + 178 => function ($stackPos) { $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 178 => function ($stackPos) { + 179 => function ($stackPos) { $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkTryCatch($this->semValue); }, - 179 => function ($stackPos) { + 180 => function ($stackPos) { $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 180 => function ($stackPos) { + 181 => function ($stackPos) { $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 181 => function ($stackPos) { + 182 => function ($stackPos) { $this->semValue = array(); /* means: no statement */ }, - 182 => function ($stackPos) { + 183 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 183 => function ($stackPos) { + 184 => function ($stackPos) { $startAttributes = $this->startAttributeStack[$stackPos-(1-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; if ($this->semValue === null) $this->semValue = array(); /* means: no statement */ }, - 184 => function ($stackPos) { + 185 => function ($stackPos) { $this->semValue = array(); }, - 185 => function ($stackPos) { + 186 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 186 => function ($stackPos) { + 187 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 187 => function ($stackPos) { + 188 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 188 => function ($stackPos) { + 189 => function ($stackPos) { $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 189 => function ($stackPos) { + 190 => function ($stackPos) { $this->semValue = null; }, - 190 => function ($stackPos) { + 191 => function ($stackPos) { $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 191 => function ($stackPos) { + 192 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 192 => function ($stackPos) { + 193 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 193 => function ($stackPos) { + 194 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 194 => function ($stackPos) { + 195 => function ($stackPos) { $this->semValue = false; }, - 195 => function ($stackPos) { + 196 => function ($stackPos) { $this->semValue = true; }, - 196 => function ($stackPos) { + 197 => function ($stackPos) { $this->semValue = false; }, - 197 => function ($stackPos) { + 198 => function ($stackPos) { $this->semValue = true; }, - 198 => function ($stackPos) { + 199 => function ($stackPos) { $this->semValue = false; }, - 199 => function ($stackPos) { + 200 => function ($stackPos) { $this->semValue = true; }, - 200 => function ($stackPos) { + 201 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 201 => function ($stackPos) { + 202 => function ($stackPos) { $this->semValue = []; }, - 202 => function ($stackPos) { + 203 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 203 => function ($stackPos) { + 204 => function ($stackPos) { $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 204 => function ($stackPos) { + 205 => function ($stackPos) { $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 205 => function ($stackPos) { + 206 => function ($stackPos) { $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 206 => function ($stackPos) { + 207 => function ($stackPos) { $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); $this->checkClass($this->semValue, $stackPos-(7-2)); }, - 207 => function ($stackPos) { + 208 => function ($stackPos) { $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); $this->checkClass($this->semValue, $stackPos-(8-3)); }, - 208 => function ($stackPos) { + 209 => function ($stackPos) { $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); $this->checkInterface($this->semValue, $stackPos-(7-3)); }, - 209 => function ($stackPos) { + 210 => function ($stackPos) { $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 210 => function ($stackPos) { + 211 => function ($stackPos) { $this->semValue = new Stmt\Enum_($this->semStack[$stackPos-(8-3)], ['scalarType' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); $this->checkEnum($this->semValue, $stackPos-(8-3)); }, - 211 => function ($stackPos) { - $this->semValue = null; - }, 212 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = null; }, 213 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 214 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = null; }, 215 => function ($stackPos) { - $this->semValue = 0; + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 216 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = 0; }, 217 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 218 => function ($stackPos) { - $this->checkClassModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 219 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; + $this->checkClassModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; }, 220 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; + $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; }, 221 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; + $this->semValue = Stmt\Class_::MODIFIER_FINAL; }, 222 => function ($stackPos) { - $this->semValue = null; + $this->semValue = Stmt\Class_::MODIFIER_READONLY; }, 223 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = null; }, 224 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 225 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = array(); }, 226 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 227 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = array(); }, 228 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 229 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 230 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 231 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 232 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 233 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 234 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 235 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 236 => function ($stackPos) { - $this->semValue = null; + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 237 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = null; }, 238 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 239 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 240 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 241 => function ($stackPos) { - $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 242 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 243 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 244 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = $this->semStack[$stackPos-(4-3)]; }, 245 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 246 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos-(5-3)]; }, 247 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = array(); }, 248 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 249 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 250 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 251 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos]; }, 252 => function ($stackPos) { - $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos]; }, 253 => function ($stackPos) { - $this->semValue = []; + $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, 254 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = []; }, 255 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 256 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 257 => function ($stackPos) { - $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 258 => function ($stackPos) { - $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 259 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 260 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 261 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 262 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = array(); }, 263 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], is_array($this->semStack[$stackPos-(5-5)]) ? $this->semStack[$stackPos-(5-5)] : array($this->semStack[$stackPos-(5-5)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 264 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], is_array($this->semStack[$stackPos-(5-5)]) ? $this->semStack[$stackPos-(5-5)] : array($this->semStack[$stackPos-(5-5)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, 265 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = array(); }, 266 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 267 => function ($stackPos) { - $this->semValue = null; + $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->fixupAlternativeElse($this->semValue); }, 268 => function ($stackPos) { - $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = null; }, 269 => function ($stackPos) { - $this->semValue = null; + $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 270 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = null; }, 271 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->fixupAlternativeElse($this->semValue); }, 272 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); + $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, 273 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + $this->semValue = array($this->semStack[$stackPos-(2-2)], true); }, 274 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, 275 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, 276 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 277 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = array(); }, 278 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 279 => function ($stackPos) { - $this->semValue = 0; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 280 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + $this->semValue = 0; }, 281 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; + $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; }, 282 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; + $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; }, 283 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; + $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; }, 284 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; + $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; }, 285 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); - $this->checkParam($this->semValue); + $this->semValue = Stmt\Class_::MODIFIER_READONLY; }, 286 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes, $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); + $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); $this->checkParam($this->semValue); }, 287 => function ($stackPos) { - $this->semValue = new Node\Param(new Expr\Error($this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); + $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes, $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); + $this->checkParam($this->semValue); }, 288 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Node\Param(new Expr\Error($this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); }, 289 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 290 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 291 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 292 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 293 => function ($stackPos) { - $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 294 => function ($stackPos) { - $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 295 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); }, 296 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 297 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 298 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 299 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 300 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, 301 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 302 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 303 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 304 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, 305 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 306 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, 307 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 308 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 309 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, 310 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 311 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 312 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 313 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 314 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 315 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 316 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = null; }, 317 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 318 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = null; }, 319 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 320 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = null; }, 321 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = array(); }, 322 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-2)]); + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 323 => function ($stackPos) { - $this->semValue = new Node\VariadicPlaceholder($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = array($this->semStack[$stackPos-(3-2)]); }, 324 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Node\VariadicPlaceholder($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 325 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 326 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 327 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 328 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 329 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->semStack[$stackPos-(3-1)]); + $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 330 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->semStack[$stackPos-(3-1)]); }, 331 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 332 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 333 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 334 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 335 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 336 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 337 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 338 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 339 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } + $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 340 => function ($stackPos) { - $this->semValue = array(); + if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } }, 341 => function ($stackPos) { + $this->semValue = array(); + }, + 342 => function ($stackPos) { $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 342 => function ($stackPos) { + 343 => function ($stackPos) { $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); $this->checkProperty($this->semValue, $stackPos-(5-2)); }, - 343 => function ($stackPos) { + 344 => function ($stackPos) { $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-1)]); $this->checkClassConst($this->semValue, $stackPos-(5-2)); }, - 344 => function ($stackPos) { - $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - $this->checkClassMethod($this->semValue, $stackPos-(10-2)); - }, 345 => function ($stackPos) { - $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-2)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-4)]); + $this->checkClassConst($this->semValue, $stackPos-(6-2)); }, 346 => function ($stackPos) { - $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); + $this->checkClassMethod($this->semValue, $stackPos-(10-2)); }, 347 => function ($stackPos) { - $this->semValue = null; /* will be skipped */ + $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 348 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, 349 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = null; /* will be skipped */ }, 350 => function ($stackPos) { $this->semValue = array(); }, 351 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 352 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = array(); }, 353 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 354 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 355 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, 356 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 357 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 358 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 359 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, 360 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 361 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); }, 362 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = null; }, 363 => function ($stackPos) { - $this->semValue = 0; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 364 => function ($stackPos) { - $this->semValue = 0; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 365 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = 0; }, 366 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = 0; }, 367 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 368 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 369 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; + $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; }, 370 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; + $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; }, 371 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_STATIC; + $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; }, 372 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; + $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; }, 373 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; + $this->semValue = Stmt\Class_::MODIFIER_STATIC; }, 374 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; + $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; }, 375 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = Stmt\Class_::MODIFIER_FINAL; }, 376 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = Stmt\Class_::MODIFIER_READONLY; }, 377 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 378 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 379 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 380 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 381 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 382 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 383 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 384 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 385 => function ($stackPos) { - $this->semValue = array(); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 386 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 387 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array(); }, 388 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 389 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 390 => function ($stackPos) { $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 391 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 392 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 393 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 394 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 395 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 396 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 397 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 398 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 399 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 400 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 401 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 402 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 403 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 404 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 405 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 406 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 407 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 408 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 409 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 410 => function ($stackPos) { - $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 411 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 412 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 413 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 414 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 415 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 416 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 417 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 418 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 419 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 420 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 421 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 422 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 423 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 424 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 425 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 426 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 427 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 428 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 429 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 430 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 431 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 432 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 433 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 434 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 435 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 436 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 437 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 438 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 439 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 440 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 441 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 442 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 443 => function ($stackPos) { - $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 444 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 445 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 446 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 447 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, 448 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 449 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 450 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 451 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 452 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 453 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 454 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 455 => function ($stackPos) { - $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 456 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 457 => function ($stackPos) { + $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 458 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); }, - 457 => function ($stackPos) { + 459 => function ($stackPos) { $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 458 => function ($stackPos) { + 460 => function ($stackPos) { $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 459 => function ($stackPos) { + 461 => function ($stackPos) { $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 460 => function ($stackPos) { + 462 => function ($stackPos) { $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 461 => function ($stackPos) { + 463 => function ($stackPos) { $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 462 => function ($stackPos) { + 464 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); }, - 463 => function ($stackPos) { - $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 464 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, 465 => function ($stackPos) { - $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 466 => function ($stackPos) { - $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 467 => function ($stackPos) { - $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 468 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 469 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 470 => function ($stackPos) { - $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 471 => function ($stackPos) { - $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 472 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); + $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 473 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 474 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, 475 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, 476 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, 477 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); + $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, 478 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, 479 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, 480 => function ($stackPos) { - $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes), $this->semStack[$stackPos-(8-3)]); - $this->checkClass($this->semValue[0], -1); + $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, 481 => function ($stackPos) { - $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, 482 => function ($stackPos) { - list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = array(new Stmt\Class_(null, ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes), $this->semStack[$stackPos-(8-3)]); + $this->checkClass($this->semValue[0], -1); }, 483 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 484 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; + list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 485 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = array(); }, 486 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(4-3)]; }, 487 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 488 => function ($stackPos) { - $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 489 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 490 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 491 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 492 => function ($stackPos) { $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 493 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 494 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 495 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 496 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 497 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 498 => function ($stackPos) { - $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 499 => function ($stackPos) { - $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 500 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 501 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 502 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 503 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 504 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 505 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; }, 506 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 507 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 508 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = null; }, 509 => function ($stackPos) { - $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 510 => function ($stackPos) { - foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array(); }, 511 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); }, 512 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 513 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = array(); }, 514 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 515 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 516 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 517 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 518 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 519 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 520 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 521 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 522 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 523 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2; + $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 524 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 525 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, 526 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2; }, 527 => function ($stackPos) { - $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT; + $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); }, 528 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs); + $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG; + $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); }, 529 => function ($stackPos) { - $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 530 => function ($stackPos) { - $this->semValue = Scalar\DNumber::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 531 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; + foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs); }, 532 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 533 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = Scalar\DNumber::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 534 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 535 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 536 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 537 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); }, 538 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true); }, 539 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); }, 540 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = null; }, 541 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -2671,7 +2678,7 @@ protected function initReduceCallbacks() { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 543 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 544 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -2680,7 +2687,7 @@ protected function initReduceCallbacks() { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 546 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 547 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -2689,85 +2696,85 @@ protected function initReduceCallbacks() { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 549 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 550 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 551 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 552 => function ($stackPos) { - $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 553 => function ($stackPos) { - $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 554 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 555 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 556 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 557 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = null; }, 558 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 559 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 560 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 561 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 562 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 563 => function ($stackPos) { - $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 564 => function ($stackPos) { - $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 565 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 566 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2; }, 567 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; }, 568 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 569 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 570 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 571 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 572 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 573 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 574 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 575 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 576 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -2779,102 +2786,111 @@ protected function initReduceCallbacks() { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 579 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 580 => function ($stackPos) { - $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 581 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 582 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; }, 583 => function ($stackPos) { - /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ + $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 584 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue); }, 585 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos]; }, 586 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ }, 587 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 588 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 589 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 590 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 591 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 592 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 593 => function ($stackPos) { - $this->semValue = null; + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 594 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 595 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true); }, 596 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = null; }, 597 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 598 => function ($stackPos) { - $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 599 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 600 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); }, 601 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 602 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 603 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 604 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 605 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 606 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 607 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 608 => function ($stackPos) { - $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 609 => function ($stackPos) { - $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, 610 => function ($stackPos) { - $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 611 => function ($stackPos) { + $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 612 => function ($stackPos) { + $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 613 => function ($stackPos) { + $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 614 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, ]; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php b/app/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php index 301d3c6a8..9f9d00c76 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php @@ -16,9 +16,12 @@ use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassConst; use PhpParser\Node\Stmt\ClassMethod; +use PhpParser\Node\Stmt\Else_; +use PhpParser\Node\Stmt\ElseIf_; use PhpParser\Node\Stmt\Enum_; use PhpParser\Node\Stmt\Interface_; use PhpParser\Node\Stmt\Namespace_; +use PhpParser\Node\Stmt\Nop; use PhpParser\Node\Stmt\Property; use PhpParser\Node\Stmt\TryCatch; use PhpParser\Node\Stmt\UseUse; @@ -876,6 +879,24 @@ protected function createCommentNopAttributes(array $comments) { return $attributes; } + /** @param ElseIf_|Else_ $node */ + protected function fixupAlternativeElse($node) { + // Make sure a trailing nop statement carrying comments is part of the node. + $numStmts = \count($node->stmts); + if ($numStmts !== 0 && $node->stmts[$numStmts - 1] instanceof Nop) { + $nopAttrs = $node->stmts[$numStmts - 1]->getAttributes(); + if (isset($nopAttrs['endLine'])) { + $node->setAttribute('endLine', $nopAttrs['endLine']); + } + if (isset($nopAttrs['endFilePos'])) { + $node->setAttribute('endFilePos', $nopAttrs['endFilePos']); + } + if (isset($nopAttrs['endTokenPos'])) { + $node->setAttribute('endTokenPos', $nopAttrs['endTokenPos']); + } + } + } + protected function checkClassModifier($a, $b, $modifierPos) { try { Class_::verifyClassModifier($a, $b); diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php b/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php index c256e8978..7c32e5a3c 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php @@ -529,7 +529,7 @@ protected function pExpr_NullsafeMethodCall(Expr\NullsafeMethodCall $node) { } protected function pExpr_StaticCall(Expr\StaticCall $node) { - return $this->pDereferenceLhs($node->class) . '::' + return $this->pStaticDereferenceLhs($node->class) . '::' . ($node->name instanceof Expr ? ($node->name instanceof Expr\Variable ? $this->p($node->name) @@ -606,7 +606,7 @@ protected function pExpr_ConstFetch(Expr\ConstFetch $node) { } protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node) { - return $this->pDereferenceLhs($node->class) . '::' . $this->p($node->name); + return $this->pStaticDereferenceLhs($node->class) . '::' . $this->pObjectProperty($node->name); } protected function pExpr_PropertyFetch(Expr\PropertyFetch $node) { @@ -618,7 +618,7 @@ protected function pExpr_NullsafePropertyFetch(Expr\NullsafePropertyFetch $node) } protected function pExpr_StaticPropertyFetch(Expr\StaticPropertyFetch $node) { - return $this->pDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name); + return $this->pStaticDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name); } protected function pExpr_ShellExec(Expr\ShellExec $node) { @@ -814,7 +814,9 @@ protected function pStmt_ClassMethod(Stmt\ClassMethod $node) { protected function pStmt_ClassConst(Stmt\ClassConst $node) { return $this->pAttrGroups($node->attrGroups) . $this->pModifiers($node->flags) - . 'const ' . $this->pCommaSeparated($node->consts) . ';'; + . 'const ' + . (null !== $node->type ? $this->p($node->type) . ' ' : '') + . $this->pCommaSeparated($node->consts) . ';'; } protected function pStmt_Function(Stmt\Function_ $node) { @@ -1067,6 +1069,14 @@ protected function pDereferenceLhs(Node $node) { } } + protected function pStaticDereferenceLhs(Node $node) { + if (!$this->staticDereferenceLhsRequiresParens($node)) { + return $this->p($node); + } else { + return '(' . $this->p($node) . ')'; + } + } + protected function pCallLhs(Node $node) { if (!$this->callLhsRequiresParens($node)) { return $this->p($node); @@ -1075,9 +1085,12 @@ protected function pCallLhs(Node $node) { } } - protected function pNewVariable(Node $node) { - // TODO: This is not fully accurate. - return $this->pDereferenceLhs($node); + protected function pNewVariable(Node $node): string { + if (!$this->newOperandRequiresParens($node)) { + return $this->p($node); + } else { + return '(' . $this->p($node) . ')'; + } } /** diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php b/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php index 6ed936fed..770d50092 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php @@ -21,6 +21,8 @@ abstract class PrettyPrinterAbstract const FIXUP_BRACED_NAME = 4; // Name operand that may require bracing const FIXUP_VAR_BRACED_NAME = 5; // Name operand that may require ${} bracing const FIXUP_ENCAPSED = 6; // Encapsed string part + const FIXUP_NEW = 7; // New/instanceof operand + const FIXUP_STATIC_DEREF_LHS = 8; // LHS of static dereferencing operation protected $precedenceMap = [ // [precedence, associativity] @@ -977,6 +979,19 @@ protected function pFixup(int $fixup, Node $subNode, $parentClass, int $subStart return '(' . $this->p($subNode) . ')'; } break; + case self::FIXUP_STATIC_DEREF_LHS: + if ($this->staticDereferenceLhsRequiresParens($subNode) + && !$this->origTokens->haveParens($subStartPos, $subEndPos) + ) { + return '(' . $this->p($subNode) . ')'; + } + break; + case self::FIXUP_NEW: + if ($this->newOperandRequiresParens($subNode) + && !$this->origTokens->haveParens($subStartPos, $subEndPos)) { + return '(' . $this->p($subNode) . ')'; + } + break; case self::FIXUP_BRACED_NAME: case self::FIXUP_VAR_BRACED_NAME: if ($subNode instanceof Expr @@ -1047,13 +1062,26 @@ protected function callLhsRequiresParens(Node $node) : bool { } /** - * Determines whether the LHS of a dereferencing operation must be wrapped in parenthesis. + * Determines whether the LHS of an array/object operation must be wrapped in parentheses. * * @param Node $node LHS of dereferencing operation * * @return bool Whether parentheses are required */ protected function dereferenceLhsRequiresParens(Node $node) : bool { + // A constant can occur on the LHS of an array/object deref, but not a static deref. + return $this->staticDereferenceLhsRequiresParens($node) + && !$node instanceof Expr\ConstFetch; + } + + /** + * Determines whether the LHS of a static operation must be wrapped in parentheses. + * + * @param Node $node LHS of dereferencing operation + * + * @return bool Whether parentheses are required + */ + protected function staticDereferenceLhsRequiresParens(Node $node): bool { return !($node instanceof Expr\Variable || $node instanceof Node\Name || $node instanceof Expr\ArrayDimFetch @@ -1066,10 +1094,31 @@ protected function dereferenceLhsRequiresParens(Node $node) : bool { || $node instanceof Expr\StaticCall || $node instanceof Expr\Array_ || $node instanceof Scalar\String_ - || $node instanceof Expr\ConstFetch || $node instanceof Expr\ClassConstFetch); } + /** + * Determines whether an expression used in "new" or "instanceof" requires parentheses. + * + * @param Node $node New or instanceof operand + * + * @return bool Whether parentheses are required + */ + protected function newOperandRequiresParens(Node $node): bool { + if ($node instanceof Node\Name || $node instanceof Expr\Variable) { + return false; + } + if ($node instanceof Expr\ArrayDimFetch || $node instanceof Expr\PropertyFetch || + $node instanceof Expr\NullsafePropertyFetch + ) { + return $this->newOperandRequiresParens($node->var); + } + if ($node instanceof Expr\StaticPropertyFetch) { + return $this->newOperandRequiresParens($node->class); + } + return true; + } + /** * Print modifiers, including trailing whitespace. * @@ -1171,7 +1220,7 @@ protected function initializeFixupMap() { Expr\PostDec::class => ['var' => self::FIXUP_PREC_LEFT], Expr\Instanceof_::class => [ 'expr' => self::FIXUP_PREC_LEFT, - 'class' => self::FIXUP_PREC_RIGHT, // TODO: FIXUP_NEW_VARIABLE + 'class' => self::FIXUP_NEW, ], Expr\Ternary::class => [ 'cond' => self::FIXUP_PREC_LEFT, @@ -1179,10 +1228,13 @@ protected function initializeFixupMap() { ], Expr\FuncCall::class => ['name' => self::FIXUP_CALL_LHS], - Expr\StaticCall::class => ['class' => self::FIXUP_DEREF_LHS], + Expr\StaticCall::class => ['class' => self::FIXUP_STATIC_DEREF_LHS], Expr\ArrayDimFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\ClassConstFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\New_::class => ['class' => self::FIXUP_DEREF_LHS], // TODO: FIXUP_NEW_VARIABLE + Expr\ClassConstFetch::class => [ + 'class' => self::FIXUP_STATIC_DEREF_LHS, + 'name' => self::FIXUP_BRACED_NAME, + ], + Expr\New_::class => ['class' => self::FIXUP_NEW], Expr\MethodCall::class => [ 'var' => self::FIXUP_DEREF_LHS, 'name' => self::FIXUP_BRACED_NAME, @@ -1192,7 +1244,7 @@ protected function initializeFixupMap() { 'name' => self::FIXUP_BRACED_NAME, ], Expr\StaticPropertyFetch::class => [ - 'class' => self::FIXUP_DEREF_LHS, + 'class' => self::FIXUP_STATIC_DEREF_LHS, 'name' => self::FIXUP_VAR_BRACED_NAME, ], Expr\PropertyFetch::class => [ @@ -1278,6 +1330,7 @@ protected function initializeRemovalMap() { 'Param->default' => $stripEquals, 'Stmt_Break->num' => $stripBoth, 'Stmt_Catch->var' => $stripLeft, + 'Stmt_ClassConst->type' => $stripRight, 'Stmt_ClassMethod->returnType' => $stripColon, 'Stmt_Class->extends' => ['left' => \T_EXTENDS], 'Stmt_Enum->scalarType' => $stripColon, @@ -1319,6 +1372,7 @@ protected function initializeInsertionMap() { 'Stmt_Break->num' => [\T_BREAK, false, ' ', null], 'Stmt_Catch->var' => [null, false, ' ', null], 'Stmt_ClassMethod->returnType' => [')', false, ' : ', null], + 'Stmt_ClassConst->type' => [\T_CONST, false, ' ', null], 'Stmt_Class->extends' => [null, false, ' extends ', null], 'Stmt_Enum->scalarType' => [null, false, ' : ', null], 'Stmt_EnumCase->expr' => [null, false, ' = ', null], @@ -1508,6 +1562,7 @@ protected function initializeModifierChangeMap() { 'Stmt_ClassMethod->flags' => \T_FUNCTION, 'Stmt_Class->flags' => \T_CLASS, 'Stmt_Property->flags' => \T_VARIABLE, + 'Expr_PrintableNewAnonClass->flags' => \T_CLASS, 'Param->flags' => \T_VARIABLE, //'Stmt_TraitUseAdaptation_Alias->newModifier' => 0, // TODO ]; diff --git a/app/vendor/phpstan/phpdoc-parser/README.md b/app/vendor/phpstan/phpdoc-parser/README.md index 080e25ee8..3b321b228 100644 --- a/app/vendor/phpstan/phpdoc-parser/README.md +++ b/app/vendor/phpstan/phpdoc-parser/README.md @@ -1,4 +1,4 @@ -

PHPDoc-Parser for PHPStan

+

PHPDoc Parser for PHPStan

Build Status @@ -7,11 +7,102 @@ PHPStan Enabled

-* [PHPStan](https://phpstan.org) +This library `phpstan/phpdoc-parser` represents PHPDocs with an AST (Abstract Syntax Tree). It supports parsing and modifying PHPDocs. ------- +For the complete list of supported PHPDoc features check out PHPStan documentation. PHPStan is the main (but not the only) user of this library. -Next generation phpDoc parser with support for intersection types and generics. +* [PHPDoc Basics](https://phpstan.org/writing-php-code/phpdocs-basics) (list of PHPDoc tags) +* [PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types) (list of PHPDoc types) +* [phpdoc-parser API Reference](https://phpstan.github.io/phpdoc-parser/namespace-PHPStan.PhpDocParser.html) with all the AST node types etc. + +This parser also supports parsing [Doctrine Annotations](https://github.com/doctrine/annotations). The AST nodes live in the [PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine namespace](https://phpstan.github.io/phpdoc-parser/namespace-PHPStan.PhpDocParser.Ast.PhpDoc.Doctrine.html). The support needs to be turned on by setting `bool $parseDoctrineAnnotations` to `true` in `Lexer` and `PhpDocParser` class constructors. + +## Installation + +``` +composer require phpstan/phpdoc-parser +``` + +## Basic usage + +```php +tokenize('/** @param Lorem $a */')); +$phpDocNode = $phpDocParser->parse($tokens); // PhpDocNode +$paramTags = $phpDocNode->getParamTagValues(); // ParamTagValueNode[] +echo $paramTags[0]->parameterName; // '$a' +echo $paramTags[0]->type; // IdentifierTypeNode - 'Lorem' +``` + +### Format-preserving printer + +This component can be used to modify the AST +and print it again as close as possible to the original. + +It's heavily inspired by format-preserving printer component in [nikic/PHP-Parser](https://github.com/nikic/PHP-Parser). + +```php + true, 'indexes' => true]; + +$lexer = new Lexer(); +$constExprParser = new ConstExprParser(true, true, $usedAttributes); +$typeParser = new TypeParser($constExprParser, true, $usedAttributes); +$phpDocParser = new PhpDocParser($typeParser, $constExprParser, true, true, $usedAttributes); + +$tokens = new TokenIterator($lexer->tokenize('/** @param Lorem $a */')); +$phpDocNode = $phpDocParser->parse($tokens); // PhpDocNode + +$cloningTraverser = new NodeTraverser([new CloningVisitor()]); + +/** @var PhpDocNode $newPhpDocNode */ +[$newPhpDocNode] = $cloningTraverser->traverse([$phpDocNode]); + +// change something in $newPhpDocNode +$newPhpDocNode->getParamTagValues()[0]->type = new IdentifierTypeNode('Ipsum'); + +// print changed PHPDoc +$printer = new Printer(); +$newPhpDoc = $printer->printFormatPreserving($newPhpDocNode, $phpDocNode, $tokens); +echo $newPhpDoc; // '/** @param Ipsum $a */' +``` ## Code of Conduct diff --git a/app/vendor/phpstan/phpdoc-parser/composer.json b/app/vendor/phpstan/phpdoc-parser/composer.json index 3b902ae27..f1c648e51 100644 --- a/app/vendor/phpstan/phpdoc-parser/composer.json +++ b/app/vendor/phpstan/phpdoc-parser/composer.json @@ -6,6 +6,8 @@ "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", diff --git a/app/vendor/phpstan/phpdoc-parser/phpstan-baseline.neon b/app/vendor/phpstan/phpdoc-parser/phpstan-baseline.neon new file mode 100644 index 000000000..04100fcdd --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/phpstan-baseline.neon @@ -0,0 +1,31 @@ +parameters: + ignoreErrors: + - + message: "#^Method PHPStan\\\\PhpDocParser\\\\Ast\\\\ConstExpr\\\\QuoteAwareConstExprStringNode\\:\\:escapeDoubleQuotedString\\(\\) should return string but returns string\\|null\\.$#" + count: 1 + path: src/Ast/ConstExpr/QuoteAwareConstExprStringNode.php + + - + message: "#^Cannot use array destructuring on array\\\\|int\\|string\\>\\|null\\.$#" + count: 1 + path: src/Ast/NodeTraverser.php + + - + message: "#^Strict comparison using \\=\\=\\= between 2 and 2 will always evaluate to true\\.$#" + count: 2 + path: src/Ast/NodeTraverser.php + + - + message: "#^Variable property access on PHPStan\\\\PhpDocParser\\\\Ast\\\\Node\\.$#" + count: 1 + path: src/Ast/NodeTraverser.php + + - + message: "#^Method PHPStan\\\\PhpDocParser\\\\Parser\\\\StringUnescaper\\:\\:parseEscapeSequences\\(\\) should return string but returns string\\|null\\.$#" + count: 1 + path: src/Parser/StringUnescaper.php + + - + message: "#^Variable property access on PHPStan\\\\PhpDocParser\\\\Ast\\\\Node\\.$#" + count: 2 + path: src/Printer/Printer.php diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/AbstractNodeVisitor.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/AbstractNodeVisitor.php new file mode 100644 index 000000000..2b9c10ec2 --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/AbstractNodeVisitor.php @@ -0,0 +1,34 @@ +value = $value; + } + + public function __toString(): string + { + return self::escape($this->value); + } + + public static function unescape(string $value): string + { + // from https://github.com/doctrine/annotations/blob/a9ec7af212302a75d1f92fa65d3abfbd16245a2a/lib/Doctrine/Common/Annotations/DocLexer.php#L103-L107 + return str_replace('""', '"', substr($value, 1, strlen($value) - 2)); + } + + private static function escape(string $value): string + { + // from https://github.com/phpstan/phpdoc-parser/issues/205#issuecomment-1662323656 + return sprintf('"%s"', str_replace('"', '""', $value)); + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/QuoteAwareConstExprStringNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/QuoteAwareConstExprStringNode.php new file mode 100644 index 000000000..f2792b1bf --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/QuoteAwareConstExprStringNode.php @@ -0,0 +1,78 @@ +quoteType = $quoteType; + } + + + public function __toString(): string + { + if ($this->quoteType === self::SINGLE_QUOTED) { + // from https://github.com/nikic/PHP-Parser/blob/0ffddce52d816f72d0efc4d9b02e276d3309ef01/lib/PhpParser/PrettyPrinter/Standard.php#L1007 + return sprintf("'%s'", addcslashes($this->value, '\'\\')); + } + + // from https://github.com/nikic/PHP-Parser/blob/0ffddce52d816f72d0efc4d9b02e276d3309ef01/lib/PhpParser/PrettyPrinter/Standard.php#L1010-L1040 + return sprintf('"%s"', $this->escapeDoubleQuotedString()); + } + + private function escapeDoubleQuotedString(): string + { + $quote = '"'; + $escaped = addcslashes($this->value, "\n\r\t\f\v$" . $quote . '\\'); + + // Escape control characters and non-UTF-8 characters. + // Regex based on https://stackoverflow.com/a/11709412/385378. + $regex = '/( + [\x00-\x08\x0E-\x1F] # Control characters + | [\xC0-\xC1] # Invalid UTF-8 Bytes + | [\xF5-\xFF] # Invalid UTF-8 Bytes + | \xE0(?=[\x80-\x9F]) # Overlong encoding of prior code point + | \xF0(?=[\x80-\x8F]) # Overlong encoding of prior code point + | [\xC2-\xDF](?![\x80-\xBF]) # Invalid UTF-8 Sequence Start + | [\xE0-\xEF](?![\x80-\xBF]{2}) # Invalid UTF-8 Sequence Start + | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start + | (?<=[\x00-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle + | (? Visitors */ + private $visitors = []; + + /** @var bool Whether traversal should be stopped */ + private $stopTraversal; + + /** + * @param list $visitors + */ + public function __construct(array $visitors) + { + $this->visitors = $visitors; + } + + /** + * Traverses an array of nodes using the registered visitors. + * + * @param Node[] $nodes Array of nodes + * + * @return Node[] Traversed array of nodes + */ + public function traverse(array $nodes): array + { + $this->stopTraversal = false; + + foreach ($this->visitors as $visitor) { + $return = $visitor->beforeTraverse($nodes); + if ($return === null) { + continue; + } + + $nodes = $return; + } + + $nodes = $this->traverseArray($nodes); + + foreach ($this->visitors as $visitor) { + $return = $visitor->afterTraverse($nodes); + if ($return === null) { + continue; + } + + $nodes = $return; + } + + return $nodes; + } + + /** + * Recursively traverse a node. + * + * @param Node $node Node to traverse. + * + * @return Node Result of traversal (may be original node or new one) + */ + private function traverseNode(Node $node): Node + { + $subNodeNames = array_keys(get_object_vars($node)); + foreach ($subNodeNames as $name) { + $subNode =& $node->$name; + + if (is_array($subNode)) { + $subNode = $this->traverseArray($subNode); + if ($this->stopTraversal) { + break; + } + } elseif ($subNode instanceof Node) { + $traverseChildren = true; + $breakVisitorIndex = null; + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->enterNode($subNode); + if ($return === null) { + continue; + } + + if ($return instanceof Node) { + $this->ensureReplacementReasonable($subNode, $return); + $subNode = $return; + } elseif ($return === self::DONT_TRAVERSE_CHILDREN) { + $traverseChildren = false; + } elseif ($return === self::DONT_TRAVERSE_CURRENT_AND_CHILDREN) { + $traverseChildren = false; + $breakVisitorIndex = $visitorIndex; + break; + } elseif ($return === self::STOP_TRAVERSAL) { + $this->stopTraversal = true; + break 2; + } else { + throw new LogicException( + 'enterNode() returned invalid value of type ' . gettype($return) + ); + } + } + + if ($traverseChildren) { + $subNode = $this->traverseNode($subNode); + if ($this->stopTraversal) { + break; + } + } + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->leaveNode($subNode); + + if ($return !== null) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($subNode, $return); + $subNode = $return; + } elseif ($return === self::STOP_TRAVERSAL) { + $this->stopTraversal = true; + break 2; + } elseif (is_array($return)) { + throw new LogicException( + 'leaveNode() may only return an array ' . + 'if the parent structure is an array' + ); + } else { + throw new LogicException( + 'leaveNode() returned invalid value of type ' . gettype($return) + ); + } + } + + if ($breakVisitorIndex === $visitorIndex) { + break; + } + } + } + } + + return $node; + } + + /** + * Recursively traverse array (usually of nodes). + * + * @param mixed[] $nodes Array to traverse + * + * @return mixed[] Result of traversal (may be original array or changed one) + */ + private function traverseArray(array $nodes): array + { + $doNodes = []; + + foreach ($nodes as $i => &$node) { + if ($node instanceof Node) { + $traverseChildren = true; + $breakVisitorIndex = null; + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->enterNode($node); + if ($return === null) { + continue; + } + + if ($return instanceof Node) { + $this->ensureReplacementReasonable($node, $return); + $node = $return; + } elseif (is_array($return)) { + $doNodes[] = [$i, $return]; + continue 2; + } elseif ($return === self::REMOVE_NODE) { + $doNodes[] = [$i, []]; + continue 2; + } elseif ($return === self::DONT_TRAVERSE_CHILDREN) { + $traverseChildren = false; + } elseif ($return === self::DONT_TRAVERSE_CURRENT_AND_CHILDREN) { + $traverseChildren = false; + $breakVisitorIndex = $visitorIndex; + break; + } elseif ($return === self::STOP_TRAVERSAL) { + $this->stopTraversal = true; + break 2; + } else { + throw new LogicException( + 'enterNode() returned invalid value of type ' . gettype($return) + ); + } + } + + if ($traverseChildren) { + $node = $this->traverseNode($node); + if ($this->stopTraversal) { + break; + } + } + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->leaveNode($node); + + if ($return !== null) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($node, $return); + $node = $return; + } elseif (is_array($return)) { + $doNodes[] = [$i, $return]; + break; + } elseif ($return === self::REMOVE_NODE) { + $doNodes[] = [$i, []]; + break; + } elseif ($return === self::STOP_TRAVERSAL) { + $this->stopTraversal = true; + break 2; + } else { + throw new LogicException( + 'leaveNode() returned invalid value of type ' . gettype($return) + ); + } + } + + if ($breakVisitorIndex === $visitorIndex) { + break; + } + } + } elseif (is_array($node)) { + throw new LogicException('Invalid node structure: Contains nested arrays'); + } + } + + if (count($doNodes) > 0) { + while ([$i, $replace] = array_pop($doNodes)) { + array_splice($nodes, $i, 1, $replace); + } + } + + return $nodes; + } + + private function ensureReplacementReasonable(Node $old, Node $new): void + { + if ($old instanceof TypeNode && !$new instanceof TypeNode) { + throw new LogicException(sprintf('Trying to replace TypeNode with %s', get_class($new))); + } + + if ($old instanceof ConstExprNode && !$new instanceof ConstExprNode) { + throw new LogicException(sprintf('Trying to replace ConstExprNode with %s', get_class($new))); + } + + if ($old instanceof PhpDocChildNode && !$new instanceof PhpDocChildNode) { + throw new LogicException(sprintf('Trying to replace PhpDocChildNode with %s', get_class($new))); + } + + if ($old instanceof PhpDocTagValueNode && !$new instanceof PhpDocTagValueNode) { + throw new LogicException(sprintf('Trying to replace PhpDocTagValueNode with %s', get_class($new))); + } + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor.php new file mode 100644 index 000000000..bf7d784e4 --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor.php @@ -0,0 +1,87 @@ + $node stays as-is + * * array (of Nodes) + * => The return value is merged into the parent array (at the position of the $node) + * * NodeTraverser::REMOVE_NODE + * => $node is removed from the parent array + * * NodeTraverser::DONT_TRAVERSE_CHILDREN + * => Children of $node are not traversed. $node stays as-is + * * NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN + * => Further visitors for the current node are skipped, and its children are not + * traversed. $node stays as-is. + * * NodeTraverser::STOP_TRAVERSAL + * => Traversal is aborted. $node stays as-is + * * otherwise + * => $node is set to the return value + * + * @param Node $node Node + * + * @return Node|Node[]|NodeTraverser::*|null Replacement node (or special return value) + */ + public function enterNode(Node $node); + + /** + * Called when leaving a node. + * + * Return value semantics: + * * null + * => $node stays as-is + * * NodeTraverser::REMOVE_NODE + * => $node is removed from the parent array + * * NodeTraverser::STOP_TRAVERSAL + * => Traversal is aborted. $node stays as-is + * * array (of Nodes) + * => The return value is merged into the parent array (at the position of the $node) + * * otherwise + * => $node is set to the return value + * + * @param Node $node Node + * + * @return Node|Node[]|NodeTraverser::REMOVE_NODE|NodeTraverser::STOP_TRAVERSAL|null Replacement node (or special return value) + */ + public function leaveNode(Node $node); + + /** + * Called once after traversal. + * + * Return value semantics: + * * null: $nodes stays as-is + * * otherwise: $nodes is set to the return value + * + * @param Node[] $nodes Array of nodes + * + * @return Node[]|null Array of nodes + */ + public function afterTraverse(array $nodes): ?array; + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor/CloningVisitor.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor/CloningVisitor.php new file mode 100644 index 000000000..7200f3af4 --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor/CloningVisitor.php @@ -0,0 +1,20 @@ +setAttribute(Attribute::ORIGINAL_NODE, $originalNode); + + return $node; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php new file mode 100644 index 000000000..3a93f5aab --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php @@ -0,0 +1,35 @@ + */ + public $arguments; + + /** + * @param list $arguments + */ + public function __construct(string $name, array $arguments) + { + $this->name = $name; + $this->arguments = $arguments; + } + + public function __toString(): string + { + $arguments = implode(', ', $this->arguments); + return $this->name . '(' . $arguments . ')'; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArgument.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArgument.php new file mode 100644 index 000000000..f30812cff --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArgument.php @@ -0,0 +1,43 @@ +key = $key; + $this->value = $value; + } + + + public function __toString(): string + { + if ($this->key === null) { + return (string) $this->value; + } + + return $this->key . '=' . $this->value; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArray.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArray.php new file mode 100644 index 000000000..e740567d2 --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArray.php @@ -0,0 +1,32 @@ + */ + public $items; + + /** + * @param list $items + */ + public function __construct(array $items) + { + $this->items = $items; + } + + public function __toString(): string + { + $items = implode(', ', $this->items); + + return '{' . $items . '}'; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php new file mode 100644 index 000000000..d2dbf2b67 --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php @@ -0,0 +1,47 @@ +key = $key; + $this->value = $value; + } + + + public function __toString(): string + { + if ($this->key === null) { + return (string) $this->value; + } + + return $this->key . '=' . $this->value; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php new file mode 100644 index 000000000..84f7b18b4 --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php @@ -0,0 +1,36 @@ +annotation = $annotation; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->annotation} {$this->description}"); + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php index 17bf04f27..ca7b4f20a 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php @@ -31,10 +31,11 @@ public function __construct(string $value, ParserException $exception) $exception->getCurrentOffset(), $exception->getExpectedTokenType(), $exception->getExpectedTokenValue(), + $exception->getCurrentTokenLine(), ]; } - public function __get(string $name) + public function __get(string $name): ?ParserException { if ($name !== 'exception') { trigger_error(sprintf('Undefined property: %s::$%s', self::class, $name), E_USER_WARNING); diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php index 075cec04e..211510bee 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php @@ -30,6 +30,10 @@ class MethodTagValueNode implements PhpDocTagValueNode /** @var string (may be empty) */ public $description; + /** + * @param MethodTagValueParameterNode[] $parameters + * @param TemplateTagValueNode[] $templateTypes + */ public function __construct(bool $isStatic, ?TypeNode $returnType, string $methodName, array $parameters, string $description, array $templateTypes = []) { $this->isStatic = $isStatic; diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php index 856cc3f1d..d20746fcf 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php @@ -3,6 +3,7 @@ namespace PHPStan\PhpDocParser\Ast\PhpDoc; use PHPStan\PhpDocParser\Ast\NodeAttributes; +use PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine\DoctrineTagValueNode; use function trim; class PhpDocTagNode implements PhpDocChildNode @@ -25,6 +26,10 @@ public function __construct(string $name, PhpDocTagValueNode $value) public function __toString(): string { + if ($this->value instanceof DoctrineTagValueNode) { + return (string) $this->value; + } + return trim("{$this->name} {$this->value}"); } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php index 3778436dc..806783f98 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php @@ -8,6 +8,9 @@ class ArrayShapeNode implements TypeNode { + public const KIND_ARRAY = 'array'; + public const KIND_LIST = 'list'; + use NodeAttributes; /** @var ArrayShapeItemNode[] */ @@ -16,10 +19,18 @@ class ArrayShapeNode implements TypeNode /** @var bool */ public $sealed; - public function __construct(array $items, bool $sealed = true) + /** @var self::KIND_* */ + public $kind; + + /** + * @param ArrayShapeItemNode[] $items + * @param self::KIND_* $kind + */ + public function __construct(array $items, bool $sealed = true, string $kind = self::KIND_ARRAY) { $this->items = $items; $this->sealed = $sealed; + $this->kind = $kind; } @@ -31,7 +42,7 @@ public function __toString(): string $items[] = '...'; } - return 'array{' . implode(', ', $items) . '}'; + return $this->kind . '{' . implode(', ', $items) . '}'; } } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php index 90cb9f085..d2031032f 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php @@ -20,6 +20,14 @@ public function __construct(TypeNode $type) public function __toString(): string { + if ( + $this->type instanceof CallableTypeNode + || $this->type instanceof ConstTypeNode + || $this->type instanceof NullableTypeNode + ) { + return '(' . $this->type . ')[]'; + } + return $this->type . '[]'; } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php index 83ade94c2..e57e5f823 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php @@ -19,6 +19,9 @@ class CallableTypeNode implements TypeNode /** @var TypeNode */ public $returnType; + /** + * @param CallableTypeParameterNode[] $parameters + */ public function __construct(IdentifierTypeNode $identifier, array $parameters, TypeNode $returnType) { $this->identifier = $identifier; @@ -29,8 +32,12 @@ public function __construct(IdentifierTypeNode $identifier, array $parameters, T public function __toString(): string { + $returnType = $this->returnType; + if ($returnType instanceof self) { + $returnType = "({$returnType})"; + } $parameters = implode(', ', $this->parameters); - return "{$this->identifier}({$parameters}): {$this->returnType}"; + return "{$this->identifier}({$parameters}): {$returnType}"; } } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php index 7ab2d7e33..c78d4c7b9 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php @@ -41,8 +41,8 @@ public function __toString(): string $type = "{$this->type} "; $isReference = $this->isReference ? '&' : ''; $isVariadic = $this->isVariadic ? '...' : ''; - $default = $this->isOptional ? ' = default' : ''; - return trim("{$type}{$isReference}{$isVariadic}{$this->parameterName}") . $default; + $isOptional = $this->isOptional ? '=' : ''; + return trim("{$type}{$isReference}{$isVariadic}{$this->parameterName}") . $isOptional; } } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php index 179de55aa..44e1d16df 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php @@ -25,6 +25,10 @@ class GenericTypeNode implements TypeNode /** @var (self::VARIANCE_*)[] */ public $variances; + /** + * @param TypeNode[] $genericTypes + * @param (self::VARIANCE_*)[] $variances + */ public function __construct(IdentifierTypeNode $type, array $genericTypes, array $variances = []) { $this->type = $type; diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php index 7f9aff33c..fd761cf78 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php @@ -3,6 +3,7 @@ namespace PHPStan\PhpDocParser\Ast\Type; use PHPStan\PhpDocParser\Ast\NodeAttributes; +use function array_map; use function implode; class IntersectionTypeNode implements TypeNode @@ -13,6 +14,9 @@ class IntersectionTypeNode implements TypeNode /** @var TypeNode[] */ public $types; + /** + * @param TypeNode[] $types + */ public function __construct(array $types) { $this->types = $types; @@ -21,7 +25,13 @@ public function __construct(array $types) public function __toString(): string { - return '(' . implode(' & ', $this->types) . ')'; + return '(' . implode(' & ', array_map(static function (TypeNode $type): string { + if ($type instanceof NullableTypeNode) { + return '(' . $type . ')'; + } + + return (string) $type; + }, $this->types)) . ')'; } } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/InvalidTypeNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/InvalidTypeNode.php new file mode 100644 index 000000000..1ec47cf6c --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/InvalidTypeNode.php @@ -0,0 +1,38 @@ +exceptionArgs = [ + $exception->getCurrentTokenValue(), + $exception->getCurrentTokenType(), + $exception->getCurrentOffset(), + $exception->getExpectedTokenType(), + $exception->getExpectedTokenValue(), + $exception->getCurrentTokenLine(), + ]; + } + + public function getException(): ParserException + { + return new ParserException(...$this->exceptionArgs); + } + + public function __toString(): string + { + return '*Invalid type*'; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeItemNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeItemNode.php new file mode 100644 index 000000000..2f0124066 --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeItemNode.php @@ -0,0 +1,48 @@ +keyName = $keyName; + $this->optional = $optional; + $this->valueType = $valueType; + } + + + public function __toString(): string + { + if ($this->keyName !== null) { + return sprintf( + '%s%s: %s', + (string) $this->keyName, + $this->optional ? '?' : '', + (string) $this->valueType + ); + } + + return (string) $this->valueType; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeNode.php new file mode 100644 index 000000000..f418bc30b --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeNode.php @@ -0,0 +1,31 @@ +items = $items; + } + + public function __toString(): string + { + $items = $this->items; + + return 'object{' . implode(', ', $items) . '}'; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/OffsetAccessTypeNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/OffsetAccessTypeNode.php index 1d5b04efe..39e83dfec 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/OffsetAccessTypeNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/OffsetAccessTypeNode.php @@ -23,6 +23,14 @@ public function __construct(TypeNode $type, TypeNode $offset) public function __toString(): string { + if ( + $this->type instanceof CallableTypeNode + || $this->type instanceof ConstTypeNode + || $this->type instanceof NullableTypeNode + ) { + return '(' . $this->type . ')[' . $this->offset . ']'; + } + return $this->type . '[' . $this->offset . ']'; } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/UnionTypeNode.php b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/UnionTypeNode.php index 08acf56c6..c552dab5f 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/UnionTypeNode.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Ast/Type/UnionTypeNode.php @@ -3,6 +3,7 @@ namespace PHPStan\PhpDocParser\Ast\Type; use PHPStan\PhpDocParser\Ast\NodeAttributes; +use function array_map; use function implode; class UnionTypeNode implements TypeNode @@ -13,6 +14,9 @@ class UnionTypeNode implements TypeNode /** @var TypeNode[] */ public $types; + /** + * @param TypeNode[] $types + */ public function __construct(array $types) { $this->types = $types; @@ -21,7 +25,13 @@ public function __construct(array $types) public function __toString(): string { - return '(' . implode(' | ', $this->types) . ')'; + return '(' . implode(' | ', array_map(static function (TypeNode $type): string { + if ($type instanceof NullableTypeNode) { + return '(' . $type . ')'; + } + + return (string) $type; + }, $this->types)) . ')'; } } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php b/app/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php index 1b98839db..32539faf6 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php @@ -30,23 +30,25 @@ class Lexer public const TOKEN_OPEN_PHPDOC = 15; public const TOKEN_CLOSE_PHPDOC = 16; public const TOKEN_PHPDOC_TAG = 17; - public const TOKEN_FLOAT = 18; - public const TOKEN_INTEGER = 19; - public const TOKEN_SINGLE_QUOTED_STRING = 20; - public const TOKEN_DOUBLE_QUOTED_STRING = 21; - public const TOKEN_IDENTIFIER = 22; - public const TOKEN_THIS_VARIABLE = 23; - public const TOKEN_VARIABLE = 24; - public const TOKEN_HORIZONTAL_WS = 25; - public const TOKEN_PHPDOC_EOL = 26; - public const TOKEN_OTHER = 27; - public const TOKEN_END = 28; - public const TOKEN_COLON = 29; - public const TOKEN_WILDCARD = 30; - public const TOKEN_OPEN_CURLY_BRACKET = 31; - public const TOKEN_CLOSE_CURLY_BRACKET = 32; - public const TOKEN_NEGATED = 33; - public const TOKEN_ARROW = 34; + public const TOKEN_DOCTRINE_TAG = 18; + public const TOKEN_FLOAT = 19; + public const TOKEN_INTEGER = 20; + public const TOKEN_SINGLE_QUOTED_STRING = 21; + public const TOKEN_DOUBLE_QUOTED_STRING = 22; + public const TOKEN_DOCTRINE_ANNOTATION_STRING = 23; + public const TOKEN_IDENTIFIER = 24; + public const TOKEN_THIS_VARIABLE = 25; + public const TOKEN_VARIABLE = 26; + public const TOKEN_HORIZONTAL_WS = 27; + public const TOKEN_PHPDOC_EOL = 28; + public const TOKEN_OTHER = 29; + public const TOKEN_END = 30; + public const TOKEN_COLON = 31; + public const TOKEN_WILDCARD = 32; + public const TOKEN_OPEN_CURLY_BRACKET = 33; + public const TOKEN_CLOSE_CURLY_BRACKET = 34; + public const TOKEN_NEGATED = 35; + public const TOKEN_ARROW = 36; public const TOKEN_LABELS = [ self::TOKEN_REFERENCE => '\'&\'', @@ -72,11 +74,13 @@ class Lexer self::TOKEN_OPEN_PHPDOC => '\'/**\'', self::TOKEN_CLOSE_PHPDOC => '\'*/\'', self::TOKEN_PHPDOC_TAG => 'TOKEN_PHPDOC_TAG', + self::TOKEN_DOCTRINE_TAG => 'TOKEN_DOCTRINE_TAG', self::TOKEN_PHPDOC_EOL => 'TOKEN_PHPDOC_EOL', self::TOKEN_FLOAT => 'TOKEN_FLOAT', self::TOKEN_INTEGER => 'TOKEN_INTEGER', self::TOKEN_SINGLE_QUOTED_STRING => 'TOKEN_SINGLE_QUOTED_STRING', self::TOKEN_DOUBLE_QUOTED_STRING => 'TOKEN_DOUBLE_QUOTED_STRING', + self::TOKEN_DOCTRINE_ANNOTATION_STRING => 'TOKEN_DOCTRINE_ANNOTATION_STRING', self::TOKEN_IDENTIFIER => 'type', self::TOKEN_THIS_VARIABLE => '\'$this\'', self::TOKEN_VARIABLE => 'variable', @@ -88,10 +92,22 @@ class Lexer public const VALUE_OFFSET = 0; public const TYPE_OFFSET = 1; + public const LINE_OFFSET = 2; + + /** @var bool */ + private $parseDoctrineAnnotations; /** @var string|null */ private $regexp; + public function __construct(bool $parseDoctrineAnnotations = false) + { + $this->parseDoctrineAnnotations = $parseDoctrineAnnotations; + } + + /** + * @return list + */ public function tokenize(string $s): array { if ($this->regexp === null) { @@ -101,11 +117,18 @@ public function tokenize(string $s): array preg_match_all($this->regexp, $s, $matches, PREG_SET_ORDER); $tokens = []; + $line = 1; foreach ($matches as $match) { - $tokens[] = [$match[0], (int) $match['MARK']]; + $type = (int) $match['MARK']; + $tokens[] = [$match[0], $type, $line]; + if ($type !== self::TOKEN_PHPDOC_EOL) { + continue; + } + + $line++; } - $tokens[] = ['', self::TOKEN_END]; + $tokens[] = ['', self::TOKEN_END, $line]; return $tokens; } @@ -149,17 +172,22 @@ private function generateRegexp(): string self::TOKEN_PHPDOC_TAG => '@(?:[a-z][a-z0-9-\\\\]+:)?[a-z][a-z0-9-\\\\]*+', self::TOKEN_PHPDOC_EOL => '\\r?+\\n[\\x09\\x20]*+(?:\\*(?!/)\\x20?+)?', - self::TOKEN_FLOAT => '(?:-?[0-9]++\\.[0-9]*+(?:e-?[0-9]++)?)|(?:-?[0-9]*+\\.[0-9]++(?:e-?[0-9]++)?)|(?:-?[0-9]++e-?[0-9]++)', - self::TOKEN_INTEGER => '-?(?:(?:0b[0-1]++)|(?:0o[0-7]++)|(?:0x[0-9a-f]++)|(?:[0-9]++))', + self::TOKEN_FLOAT => '[+\-]?(?:(?:[0-9]++(_[0-9]++)*\\.[0-9]*+(_[0-9]++)*(?:e[+\-]?[0-9]++(_[0-9]++)*)?)|(?:[0-9]*+(_[0-9]++)*\\.[0-9]++(_[0-9]++)*(?:e[+\-]?[0-9]++(_[0-9]++)*)?)|(?:[0-9]++(_[0-9]++)*e[+\-]?[0-9]++(_[0-9]++)*))', + self::TOKEN_INTEGER => '[+\-]?(?:(?:0b[0-1]++(_[0-1]++)*)|(?:0o[0-7]++(_[0-7]++)*)|(?:0x[0-9a-f]++(_[0-9a-f]++)*)|(?:[0-9]++(_[0-9]++)*))', self::TOKEN_SINGLE_QUOTED_STRING => '\'(?:\\\\[^\\r\\n]|[^\'\\r\\n\\\\])*+\'', self::TOKEN_DOUBLE_QUOTED_STRING => '"(?:\\\\[^\\r\\n]|[^"\\r\\n\\\\])*+"', self::TOKEN_WILDCARD => '\\*', - - // anything but TOKEN_CLOSE_PHPDOC or TOKEN_HORIZONTAL_WS or TOKEN_EOL - self::TOKEN_OTHER => '(?:(?!\\*/)[^\\s])++', ]; + if ($this->parseDoctrineAnnotations) { + $patterns[self::TOKEN_DOCTRINE_TAG] = '@[a-z_\\\\][a-z0-9_\:\\\\]*[a-z_][a-z0-9_]*'; + $patterns[self::TOKEN_DOCTRINE_ANNOTATION_STRING] = '"(?:""|[^"])*+"'; + } + + // anything but TOKEN_CLOSE_PHPDOC or TOKEN_HORIZONTAL_WS or TOKEN_EOL + $patterns[self::TOKEN_OTHER] = '(?:(?!\\*/)[^\\s])++'; + foreach ($patterns as $type => &$pattern) { $pattern = '(?:' . $pattern . ')(*MARK:' . $type . ')'; } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php b/app/vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php index d78763032..f6a7306e8 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php @@ -4,10 +4,6 @@ use PHPStan\PhpDocParser\Ast; use PHPStan\PhpDocParser\Lexer\Lexer; -use function chr; -use function hexdec; -use function octdec; -use function preg_replace_callback; use function str_replace; use function strtolower; use function substr; @@ -15,49 +11,148 @@ class ConstExprParser { - private const REPLACEMENTS = [ - '\\' => '\\', - 'n' => "\n", - 'r' => "\r", - 't' => "\t", - 'f' => "\f", - 'v' => "\v", - 'e' => "\x1B", - ]; - /** @var bool */ private $unescapeStrings; - public function __construct(bool $unescapeStrings = false) + /** @var bool */ + private $quoteAwareConstExprString; + + /** @var bool */ + private $useLinesAttributes; + + /** @var bool */ + private $useIndexAttributes; + + /** @var bool */ + private $parseDoctrineStrings; + + /** + * @param array{lines?: bool, indexes?: bool} $usedAttributes + */ + public function __construct( + bool $unescapeStrings = false, + bool $quoteAwareConstExprString = false, + array $usedAttributes = [] + ) { $this->unescapeStrings = $unescapeStrings; + $this->quoteAwareConstExprString = $quoteAwareConstExprString; + $this->useLinesAttributes = $usedAttributes['lines'] ?? false; + $this->useIndexAttributes = $usedAttributes['indexes'] ?? false; + $this->parseDoctrineStrings = false; + } + + /** + * @internal + */ + public function toDoctrine(): self + { + $self = new self( + $this->unescapeStrings, + $this->quoteAwareConstExprString, + [ + 'lines' => $this->useLinesAttributes, + 'indexes' => $this->useIndexAttributes, + ] + ); + $self->parseDoctrineStrings = true; + return $self; } public function parse(TokenIterator $tokens, bool $trimStrings = false): Ast\ConstExpr\ConstExprNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); if ($tokens->isCurrentTokenType(Lexer::TOKEN_FLOAT)) { $value = $tokens->currentTokenValue(); $tokens->next(); - return new Ast\ConstExpr\ConstExprFloatNode($value); + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprFloatNode(str_replace('_', '', $value)), + $startLine, + $startIndex + ); } if ($tokens->isCurrentTokenType(Lexer::TOKEN_INTEGER)) { $value = $tokens->currentTokenValue(); $tokens->next(); - return new Ast\ConstExpr\ConstExprIntegerNode($value); + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprIntegerNode(str_replace('_', '', $value)), + $startLine, + $startIndex + ); + } + + if ($this->parseDoctrineStrings && $tokens->isCurrentTokenType(Lexer::TOKEN_DOCTRINE_ANNOTATION_STRING)) { + $value = $tokens->currentTokenValue(); + $tokens->next(); + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\DoctrineConstExprStringNode(Ast\ConstExpr\DoctrineConstExprStringNode::unescape($value)), + $startLine, + $startIndex + ); } if ($tokens->isCurrentTokenType(Lexer::TOKEN_SINGLE_QUOTED_STRING, Lexer::TOKEN_DOUBLE_QUOTED_STRING)) { + if ($this->parseDoctrineStrings) { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_SINGLE_QUOTED_STRING)) { + throw new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_DOUBLE_QUOTED_STRING, + null, + $tokens->currentTokenLine() + ); + } + + $value = $tokens->currentTokenValue(); + $tokens->next(); + + return $this->enrichWithAttributes( + $tokens, + $this->parseDoctrineString($value, $tokens), + $startLine, + $startIndex + ); + } $value = $tokens->currentTokenValue(); + $type = $tokens->currentTokenType(); if ($trimStrings) { if ($this->unescapeStrings) { - $value = self::unescapeString($value); + $value = StringUnescaper::unescapeString($value); } else { $value = substr($value, 1, -1); } } $tokens->next(); - return new Ast\ConstExpr\ConstExprStringNode($value); + + if ($this->quoteAwareConstExprString) { + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\QuoteAwareConstExprStringNode( + $value, + $type === Lexer::TOKEN_SINGLE_QUOTED_STRING + ? Ast\ConstExpr\QuoteAwareConstExprStringNode::SINGLE_QUOTED + : Ast\ConstExpr\QuoteAwareConstExprStringNode::DOUBLE_QUOTED + ), + $startLine, + $startIndex + ); + } + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprStringNode($value), + $startLine, + $startIndex + ); } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_IDENTIFIER)) { $identifier = $tokens->currentTokenValue(); @@ -65,14 +160,29 @@ public function parse(TokenIterator $tokens, bool $trimStrings = false): Ast\Con switch (strtolower($identifier)) { case 'true': - return new Ast\ConstExpr\ConstExprTrueNode(); + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprTrueNode(), + $startLine, + $startIndex + ); case 'false': - return new Ast\ConstExpr\ConstExprFalseNode(); + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprFalseNode(), + $startLine, + $startIndex + ); case 'null': - return new Ast\ConstExpr\ConstExprNullNode(); + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprNullNode(), + $startLine, + $startIndex + ); case 'array': $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES); - return $this->parseArray($tokens, Lexer::TOKEN_CLOSE_PARENTHESES); + return $this->parseArray($tokens, Lexer::TOKEN_CLOSE_PARENTHESES, $startIndex); } if ($tokens->tryConsumeTokenType(Lexer::TOKEN_DOUBLE_COLON)) { @@ -106,29 +216,43 @@ public function parse(TokenIterator $tokens, bool $trimStrings = false): Ast\Con break; } - return new Ast\ConstExpr\ConstFetchNode($identifier, $classConstantName); + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstFetchNode($identifier, $classConstantName), + $startLine, + $startIndex + ); } - return new Ast\ConstExpr\ConstFetchNode('', $identifier); + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstFetchNode('', $identifier), + $startLine, + $startIndex + ); } elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { - return $this->parseArray($tokens, Lexer::TOKEN_CLOSE_SQUARE_BRACKET); + return $this->parseArray($tokens, Lexer::TOKEN_CLOSE_SQUARE_BRACKET, $startIndex); } throw new ParserException( $tokens->currentTokenValue(), $tokens->currentTokenType(), $tokens->currentTokenOffset(), - Lexer::TOKEN_IDENTIFIER + Lexer::TOKEN_IDENTIFIER, + null, + $tokens->currentTokenLine() ); } - private function parseArray(TokenIterator $tokens, int $endToken): Ast\ConstExpr\ConstExprArrayNode + private function parseArray(TokenIterator $tokens, int $endToken, int $startIndex): Ast\ConstExpr\ConstExprArrayNode { $items = []; + $startLine = $tokens->currentTokenLine(); + if (!$tokens->tryConsumeTokenType($endToken)) { do { $items[] = $this->parseArrayItem($tokens); @@ -136,12 +260,37 @@ private function parseArray(TokenIterator $tokens, int $endToken): Ast\ConstExpr $tokens->consumeTokenType($endToken); } - return new Ast\ConstExpr\ConstExprArrayNode($items); + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprArrayNode($items), + $startLine, + $startIndex + ); + } + + + /** + * This method is supposed to be called with TokenIterator after reading TOKEN_DOUBLE_QUOTED_STRING and shifting + * to the next token. + */ + public function parseDoctrineString(string $text, TokenIterator $tokens): Ast\ConstExpr\DoctrineConstExprStringNode + { + // Because of how Lexer works, a valid Doctrine string + // can consist of a sequence of TOKEN_DOUBLE_QUOTED_STRING and TOKEN_DOCTRINE_ANNOTATION_STRING + while ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING, Lexer::TOKEN_DOCTRINE_ANNOTATION_STRING)) { + $text .= $tokens->currentTokenValue(); + $tokens->next(); + } + + return new Ast\ConstExpr\DoctrineConstExprStringNode(Ast\ConstExpr\DoctrineConstExprStringNode::unescape($text)); } private function parseArrayItem(TokenIterator $tokens): Ast\ConstExpr\ConstExprArrayItemNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $expr = $this->parse($tokens); if ($tokens->tryConsumeTokenType(Lexer::TOKEN_DOUBLE_ARROW)) { @@ -153,78 +302,32 @@ private function parseArrayItem(TokenIterator $tokens): Ast\ConstExpr\ConstExprA $value = $expr; } - return new Ast\ConstExpr\ConstExprArrayItemNode($key, $value); - } - - private static function unescapeString(string $string): string - { - $quote = $string[0]; - - if ($quote === '\'') { - return str_replace( - ['\\\\', '\\\''], - ['\\', '\''], - substr($string, 1, -1) - ); - } - - return self::parseEscapeSequences(substr($string, 1, -1), '"'); - } - - /** - * Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L90-L130 - */ - private static function parseEscapeSequences(string $str, string $quote): string - { - $str = str_replace('\\' . $quote, $quote, $str); - - return preg_replace_callback( - '~\\\\([\\\\nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u\{([0-9a-fA-F]+)\})~', - static function ($matches) { - $str = $matches[1]; - - if (isset(self::REPLACEMENTS[$str])) { - return self::REPLACEMENTS[$str]; - } - if ($str[0] === 'x' || $str[0] === 'X') { - return chr(hexdec(substr($str, 1))); - } - if ($str[0] === 'u') { - return self::codePointToUtf8(hexdec($matches[2])); - } - - return chr(octdec($str)); - }, - $str + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprArrayItemNode($key, $value), + $startLine, + $startIndex ); } /** - * Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L132-L154 + * @template T of Ast\ConstExpr\ConstExprNode + * @param T $node + * @return T */ - private static function codePointToUtf8(int $num): string + private function enrichWithAttributes(TokenIterator $tokens, Ast\ConstExpr\ConstExprNode $node, int $startLine, int $startIndex): Ast\ConstExpr\ConstExprNode { - if ($num <= 0x7F) { - return chr($num); - } - if ($num <= 0x7FF) { - return chr(($num >> 6) + 0xC0) - . chr(($num & 0x3F) + 0x80); + if ($this->useLinesAttributes) { + $node->setAttribute(Ast\Attribute::START_LINE, $startLine); + $node->setAttribute(Ast\Attribute::END_LINE, $tokens->currentTokenLine()); } - if ($num <= 0xFFFF) { - return chr(($num >> 12) + 0xE0) - . chr((($num >> 6) & 0x3F) + 0x80) - . chr(($num & 0x3F) + 0x80); - } - if ($num <= 0x1FFFFF) { - return chr(($num >> 18) + 0xF0) - . chr((($num >> 12) & 0x3F) + 0x80) - . chr((($num >> 6) & 0x3F) + 0x80) - . chr(($num & 0x3F) + 0x80); + + if ($this->useIndexAttributes) { + $node->setAttribute(Ast\Attribute::START_INDEX, $startIndex); + $node->setAttribute(Ast\Attribute::END_INDEX, $tokens->endIndexOfLastRelevantToken()); } - // Invalid UTF-8 codepoint escape sequence: Codepoint too large - return "\xef\xbf\xbd"; + return $node; } } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php b/app/vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php index badcdcbb9..6ab5cc076 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php @@ -7,6 +7,7 @@ use function assert; use function json_encode; use function sprintf; +use const JSON_INVALID_UTF8_SUBSTITUTE; use const JSON_UNESCAPED_SLASHES; use const JSON_UNESCAPED_UNICODE; @@ -28,12 +29,16 @@ class ParserException extends Exception /** @var string|null */ private $expectedTokenValue; + /** @var int|null */ + private $currentTokenLine; + public function __construct( string $currentTokenValue, int $currentTokenType, int $currentOffset, int $expectedTokenType, - ?string $expectedTokenValue = null + ?string $expectedTokenValue = null, + ?int $currentTokenLine = null ) { $this->currentTokenValue = $currentTokenValue; @@ -41,13 +46,15 @@ public function __construct( $this->currentOffset = $currentOffset; $this->expectedTokenType = $expectedTokenType; $this->expectedTokenValue = $expectedTokenValue; + $this->currentTokenLine = $currentTokenLine; parent::__construct(sprintf( - 'Unexpected token %s, expected %s%s at offset %d', + 'Unexpected token %s, expected %s%s at offset %d%s', $this->formatValue($currentTokenValue), Lexer::TOKEN_LABELS[$expectedTokenType], $expectedTokenValue !== null ? sprintf(' (%s)', $this->formatValue($expectedTokenValue)) : '', - $currentOffset + $currentOffset, + $currentTokenLine === null ? '' : sprintf(' on line %d', $currentTokenLine) )); } @@ -82,9 +89,15 @@ public function getExpectedTokenValue(): ?string } + public function getCurrentTokenLine(): ?int + { + return $this->currentTokenLine; + } + + private function formatValue(string $value): string { - $json = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + $json = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_SUBSTITUTE); assert($json !== false); return $json; diff --git a/app/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php b/app/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php index d9942b3d1..ff5f18f64 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php @@ -2,15 +2,25 @@ namespace PHPStan\PhpDocParser\Parser; +use LogicException; use PHPStan\PhpDocParser\Ast; +use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprIntegerNode; +use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprStringNode; +use PHPStan\PhpDocParser\Ast\ConstExpr\ConstFetchNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Lexer\Lexer; use PHPStan\ShouldNotHappenException; use function array_key_exists; use function array_values; use function count; +use function rtrim; +use function str_replace; use function trim; +/** + * @phpstan-import-type ValueType from Doctrine\DoctrineArgument as DoctrineValueType + */ class PhpDocParser { @@ -25,14 +35,49 @@ class PhpDocParser /** @var ConstExprParser */ private $constantExprParser; + /** @var ConstExprParser */ + private $doctrineConstantExprParser; + /** @var bool */ private $requireWhitespaceBeforeDescription; - public function __construct(TypeParser $typeParser, ConstExprParser $constantExprParser, bool $requireWhitespaceBeforeDescription = false) + /** @var bool */ + private $preserveTypeAliasesWithInvalidTypes; + + /** @var bool */ + private $parseDoctrineAnnotations; + + /** @var bool */ + private $useLinesAttributes; + + /** @var bool */ + private $useIndexAttributes; + + /** @var bool */ + private $textBetweenTagsBelongsToDescription; + + /** + * @param array{lines?: bool, indexes?: bool} $usedAttributes + */ + public function __construct( + TypeParser $typeParser, + ConstExprParser $constantExprParser, + bool $requireWhitespaceBeforeDescription = false, + bool $preserveTypeAliasesWithInvalidTypes = false, + array $usedAttributes = [], + bool $parseDoctrineAnnotations = false, + bool $textBetweenTagsBelongsToDescription = false + ) { $this->typeParser = $typeParser; $this->constantExprParser = $constantExprParser; + $this->doctrineConstantExprParser = $constantExprParser->toDoctrine(); $this->requireWhitespaceBeforeDescription = $requireWhitespaceBeforeDescription; + $this->preserveTypeAliasesWithInvalidTypes = $preserveTypeAliasesWithInvalidTypes; + $this->parseDoctrineAnnotations = $parseDoctrineAnnotations; + $this->useLinesAttributes = $usedAttributes['lines'] ?? false; + $this->useIndexAttributes = $usedAttributes['indexes'] ?? false; + $this->textBetweenTagsBelongsToDescription = $textBetweenTagsBelongsToDescription; } @@ -43,10 +88,44 @@ public function parse(TokenIterator $tokens): Ast\PhpDoc\PhpDocNode $children = []; - if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { - $children[] = $this->parseChild($tokens); - while ($tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL) && !$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + if ($this->parseDoctrineAnnotations) { + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + $lastChild = $this->parseChild($tokens); + $children[] = $lastChild; + while (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + if ( + $lastChild instanceof Ast\PhpDoc\PhpDocTagNode + && ( + $lastChild->value instanceof Doctrine\DoctrineTagValueNode + || $lastChild->value instanceof Ast\PhpDoc\GenericTagValueNode + ) + ) { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + break; + } + $lastChild = $this->parseChild($tokens); + $children[] = $lastChild; + continue; + } + + if (!$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + break; + } + if ($tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + break; + } + + $lastChild = $this->parseChild($tokens); + $children[] = $lastChild; + } + } + } else { + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { $children[] = $this->parseChild($tokens); + while ($tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL) && !$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + $children[] = $this->parseChild($tokens); + } } } @@ -54,30 +133,90 @@ public function parse(TokenIterator $tokens): Ast\PhpDoc\PhpDocNode $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PHPDOC); } catch (ParserException $e) { $name = ''; + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); if (count($children) > 0) { $lastChild = $children[count($children) - 1]; if ($lastChild instanceof Ast\PhpDoc\PhpDocTagNode) { $name = $lastChild->name; + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); } } + + $tag = new Ast\PhpDoc\PhpDocTagNode( + $name, + $this->enrichWithAttributes( + $tokens, + new Ast\PhpDoc\InvalidTagValueNode($e->getMessage(), $e), + $startLine, + $startIndex + ) + ); + $tokens->forwardToTheEnd(); - return new Ast\PhpDoc\PhpDocNode([ - new Ast\PhpDoc\PhpDocTagNode($name, new Ast\PhpDoc\InvalidTagValueNode($e->getMessage(), $e)), - ]); + + return $this->enrichWithAttributes($tokens, new Ast\PhpDoc\PhpDocNode([$this->enrichWithAttributes($tokens, $tag, $startLine, $startIndex)]), 1, 0); } - return new Ast\PhpDoc\PhpDocNode(array_values($children)); + return $this->enrichWithAttributes($tokens, new Ast\PhpDoc\PhpDocNode(array_values($children)), 1, 0); } + /** @phpstan-impure */ private function parseChild(TokenIterator $tokens): Ast\PhpDoc\PhpDocChildNode { if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG)) { - return $this->parseTag($tokens); + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + return $this->enrichWithAttributes($tokens, $this->parseTag($tokens), $startLine, $startIndex); + } + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_DOCTRINE_TAG)) { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $tag = $tokens->currentTokenValue(); + $tokens->next(); + $tagStartLine = $tokens->currentTokenLine(); + $tagStartIndex = $tokens->currentTokenIndex(); + + return $this->enrichWithAttributes($tokens, new Ast\PhpDoc\PhpDocTagNode( + $tag, + $this->enrichWithAttributes( + $tokens, + $this->parseDoctrineTagValue($tokens, $tag), + $tagStartLine, + $tagStartIndex + ) + ), $startLine, $startIndex); } - return $this->parseText($tokens); + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $text = $this->parseText($tokens); + + return $this->enrichWithAttributes($tokens, $text, $startLine, $startIndex); + } + + /** + * @template T of Ast\Node + * @param T $tag + * @return T + */ + private function enrichWithAttributes(TokenIterator $tokens, Ast\Node $tag, int $startLine, int $startIndex): Ast\Node + { + if ($this->useLinesAttributes) { + $tag->setAttribute(Ast\Attribute::START_LINE, $startLine); + $tag->setAttribute(Ast\Attribute::END_LINE, $tokens->currentTokenLine()); + } + + if ($this->useIndexAttributes) { + $tag->setAttribute(Ast\Attribute::START_INDEX, $startIndex); + $tag->setAttribute(Ast\Attribute::END_INDEX, $tokens->endIndexOfLastRelevantToken()); + } + + return $tag; } @@ -85,29 +224,144 @@ private function parseText(TokenIterator $tokens): Ast\PhpDoc\PhpDocTextNode { $text = ''; - while (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { - $text .= $tokens->getSkippedHorizontalWhiteSpaceIfAny() . $tokens->joinUntil(Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END); + $endTokens = [Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END]; + if ($this->textBetweenTagsBelongsToDescription) { + $endTokens = [Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END]; + } + + $savepoint = false; + // if the next token is EOL, everything below is skipped and empty string is returned + while ($this->textBetweenTagsBelongsToDescription || !$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + $tmpText = $tokens->getSkippedHorizontalWhiteSpaceIfAny() . $tokens->joinUntil(Lexer::TOKEN_PHPDOC_EOL, ...$endTokens); + $text .= $tmpText; + + // stop if we're not at EOL - meaning it's the end of PHPDoc if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { break; } + if ($this->textBetweenTagsBelongsToDescription) { + if (!$savepoint) { + $tokens->pushSavePoint(); + $savepoint = true; + } elseif ($tmpText !== '') { + $tokens->dropSavePoint(); + $tokens->pushSavePoint(); + } + } + $tokens->pushSavePoint(); $tokens->next(); - if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG, Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END)) { + // if we're at EOL, check what's next + // if next is a PHPDoc tag, EOL, or end of PHPDoc, stop + if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG, Lexer::TOKEN_DOCTRINE_TAG, ...$endTokens)) { $tokens->rollback(); break; } + // otherwise if the next is text, continue building the description string + $tokens->dropSavePoint(); - $text .= "\n"; + $text .= $tokens->getDetectedNewline() ?? "\n"; + } + + if ($savepoint) { + $tokens->rollback(); + $text = rtrim($text, $tokens->getDetectedNewline() ?? "\n"); } return new Ast\PhpDoc\PhpDocTextNode(trim($text, " \t")); } + private function parseOptionalDescriptionAfterDoctrineTag(TokenIterator $tokens): string + { + $text = ''; + + $endTokens = [Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END]; + if ($this->textBetweenTagsBelongsToDescription) { + $endTokens = [Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END]; + } + + $savepoint = false; + + // if the next token is EOL, everything below is skipped and empty string is returned + while ($this->textBetweenTagsBelongsToDescription || !$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + $tmpText = $tokens->getSkippedHorizontalWhiteSpaceIfAny() . $tokens->joinUntil(Lexer::TOKEN_PHPDOC_TAG, Lexer::TOKEN_DOCTRINE_TAG, Lexer::TOKEN_PHPDOC_EOL, ...$endTokens); + $text .= $tmpText; + + // stop if we're not at EOL - meaning it's the end of PHPDoc + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + if (!$tokens->isPrecededByHorizontalWhitespace()) { + return trim($text . $this->parseText($tokens)->text, " \t"); + } + if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG)) { + $tokens->pushSavePoint(); + $child = $this->parseChild($tokens); + if ($child instanceof Ast\PhpDoc\PhpDocTagNode) { + if ( + $child->value instanceof Ast\PhpDoc\GenericTagValueNode + || $child->value instanceof Doctrine\DoctrineTagValueNode + ) { + $tokens->rollback(); + break; + } + if ($child->value instanceof Ast\PhpDoc\InvalidTagValueNode) { + $tokens->rollback(); + $tokens->pushSavePoint(); + $tokens->next(); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { + $tokens->rollback(); + break; + } + $tokens->rollback(); + return trim($text . $this->parseText($tokens)->text, " \t"); + } + } + + $tokens->rollback(); + return trim($text . $this->parseText($tokens)->text, " \t"); + } + break; + } + + if ($this->textBetweenTagsBelongsToDescription) { + if (!$savepoint) { + $tokens->pushSavePoint(); + $savepoint = true; + } elseif ($tmpText !== '') { + $tokens->dropSavePoint(); + $tokens->pushSavePoint(); + } + } + + $tokens->pushSavePoint(); + $tokens->next(); + + // if we're at EOL, check what's next + // if next is a PHPDoc tag, EOL, or end of PHPDoc, stop + if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG, Lexer::TOKEN_DOCTRINE_TAG, ...$endTokens)) { + $tokens->rollback(); + break; + } + + // otherwise if the next is text, continue building the description string + + $tokens->dropSavePoint(); + $text .= $tokens->getDetectedNewline() ?? "\n"; + } + + if ($savepoint) { + $tokens->rollback(); + $text = rtrim($text, $tokens->getDetectedNewline() ?? "\n"); + } + + return trim($text, " \t"); + } + + public function parseTag(TokenIterator $tokens): Ast\PhpDoc\PhpDocTagNode { $tag = $tokens->currentTokenValue(); @@ -120,6 +374,9 @@ public function parseTag(TokenIterator $tokens): Ast\PhpDoc\PhpDocTagNode public function parseTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\PhpDocTagValueNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + try { $tokens->pushSavePoint(); @@ -236,7 +493,17 @@ public function parseTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\Ph break; default: + if ($this->parseDoctrineAnnotations) { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { + $tagValue = $this->parseDoctrineTagValue($tokens, $tag); + } else { + $tagValue = new Ast\PhpDoc\GenericTagValueNode($this->parseOptionalDescriptionAfterDoctrineTag($tokens)); + } + break; + } + $tagValue = new Ast\PhpDoc\GenericTagValueNode($this->parseOptionalDescription($tokens)); + break; } @@ -247,7 +514,299 @@ public function parseTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\Ph $tagValue = new Ast\PhpDoc\InvalidTagValueNode($this->parseOptionalDescription($tokens), $e); } - return $tagValue; + return $this->enrichWithAttributes($tokens, $tagValue, $startLine, $startIndex); + } + + + private function parseDoctrineTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\PhpDocTagValueNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + return new Doctrine\DoctrineTagValueNode( + $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineAnnotation($tag, $this->parseDoctrineArguments($tokens, false)), + $startLine, + $startIndex + ), + $this->parseOptionalDescriptionAfterDoctrineTag($tokens) + ); + } + + + /** + * @return list + */ + private function parseDoctrineArguments(TokenIterator $tokens, bool $deep): array + { + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { + return []; + } + + if (!$deep) { + $tokens->addEndOfLineToSkippedTokens(); + } + + $arguments = []; + + try { + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES); + + do { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PARENTHESES)) { + break; + } + $arguments[] = $this->parseDoctrineArgument($tokens); + } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)); + } finally { + if (!$deep) { + $tokens->removeEndOfLineFromSkippedTokens(); + } + } + + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); + + return $arguments; + } + + + private function parseDoctrineArgument(TokenIterator $tokens): Doctrine\DoctrineArgument + { + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_IDENTIFIER)) { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArgument(null, $this->parseDoctrineArgumentValue($tokens)), + $startLine, + $startIndex + ); + } + + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + try { + $tokens->pushSavePoint(); + $currentValue = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + + $key = $this->enrichWithAttributes( + $tokens, + new IdentifierTypeNode($currentValue), + $startLine, + $startIndex + ); + $tokens->consumeTokenType(Lexer::TOKEN_EQUAL); + + $value = $this->parseDoctrineArgumentValue($tokens); + + $tokens->dropSavePoint(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArgument($key, $value), + $startLine, + $startIndex + ); + } catch (ParserException $e) { + $tokens->rollback(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArgument(null, $this->parseDoctrineArgumentValue($tokens)), + $startLine, + $startIndex + ); + } + } + + + /** + * @return DoctrineValueType + */ + private function parseDoctrineArgumentValue(TokenIterator $tokens) + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG, Lexer::TOKEN_DOCTRINE_TAG)) { + $name = $tokens->currentTokenValue(); + $tokens->next(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineAnnotation($name, $this->parseDoctrineArguments($tokens, true)), + $startLine, + $startIndex + ); + } + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET)) { + $items = []; + do { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET)) { + break; + } + $items[] = $this->parseDoctrineArrayItem($tokens); + } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)); + + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArray($items), + $startLine, + $startIndex + ); + } + + $currentTokenValue = $tokens->currentTokenValue(); + $tokens->pushSavePoint(); // because of ConstFetchNode + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_IDENTIFIER)) { + $identifier = $this->enrichWithAttributes( + $tokens, + new Ast\Type\IdentifierTypeNode($currentTokenValue), + $startLine, + $startIndex + ); + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_COLON)) { + $tokens->dropSavePoint(); + return $identifier; + } + + $tokens->rollback(); // because of ConstFetchNode + } else { + $tokens->dropSavePoint(); // because of ConstFetchNode + } + + $exception = new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_IDENTIFIER, + null, + $tokens->currentTokenLine() + ); + + try { + $constExpr = $this->doctrineConstantExprParser->parse($tokens, true); + if ($constExpr instanceof Ast\ConstExpr\ConstExprArrayNode) { + throw $exception; + } + + return $constExpr; + } catch (LogicException $e) { + throw $exception; + } + } + + + private function parseDoctrineArrayItem(TokenIterator $tokens): Doctrine\DoctrineArrayItem + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + try { + $tokens->pushSavePoint(); + + $key = $this->parseDoctrineArrayKey($tokens); + if (!$tokens->tryConsumeTokenType(Lexer::TOKEN_EQUAL)) { + if (!$tokens->tryConsumeTokenType(Lexer::TOKEN_COLON)) { + $tokens->consumeTokenType(Lexer::TOKEN_EQUAL); // will throw exception + } + } + + $value = $this->parseDoctrineArgumentValue($tokens); + + $tokens->dropSavePoint(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArrayItem($key, $value), + $startLine, + $startIndex + ); + } catch (ParserException $e) { + $tokens->rollback(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArrayItem(null, $this->parseDoctrineArgumentValue($tokens)), + $startLine, + $startIndex + ); + } + } + + + /** + * @return ConstExprIntegerNode|ConstExprStringNode|IdentifierTypeNode|ConstFetchNode + */ + private function parseDoctrineArrayKey(TokenIterator $tokens) + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_INTEGER)) { + $key = new Ast\ConstExpr\ConstExprIntegerNode(str_replace('_', '', $tokens->currentTokenValue())); + $tokens->next(); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_DOCTRINE_ANNOTATION_STRING)) { + $key = new Ast\ConstExpr\DoctrineConstExprStringNode(Ast\ConstExpr\DoctrineConstExprStringNode::unescape($tokens->currentTokenValue())); + + $tokens->next(); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING)) { + $value = $tokens->currentTokenValue(); + $tokens->next(); + $key = $this->doctrineConstantExprParser->parseDoctrineString($value, $tokens); + + } else { + $currentTokenValue = $tokens->currentTokenValue(); + $tokens->pushSavePoint(); // because of ConstFetchNode + if (!$tokens->tryConsumeTokenType(Lexer::TOKEN_IDENTIFIER)) { + $tokens->dropSavePoint(); + throw new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_IDENTIFIER, + null, + $tokens->currentTokenLine() + ); + } + + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_COLON)) { + $tokens->dropSavePoint(); + + return $this->enrichWithAttributes( + $tokens, + new IdentifierTypeNode($currentTokenValue), + $startLine, + $startIndex + ); + } + + $tokens->rollback(); + $constExpr = $this->doctrineConstantExprParser->parse($tokens, true); + if (!$constExpr instanceof Ast\ConstExpr\ConstFetchNode) { + throw new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_IDENTIFIER, + null, + $tokens->currentTokenLine() + ); + } + + return $constExpr; + } + + return $this->enrichWithAttributes($tokens, $key, $startLine, $startIndex); } @@ -257,9 +816,7 @@ public function parseTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\Ph private function parseParamTagValue(TokenIterator $tokens): Ast\PhpDoc\PhpDocTagValueNode { if ( - $tokens->isCurrentTokenType(Lexer::TOKEN_REFERENCE) - || $tokens->isCurrentTokenType(Lexer::TOKEN_VARIADIC) - || $tokens->isCurrentTokenType(Lexer::TOKEN_VARIABLE) + $tokens->isCurrentTokenType(Lexer::TOKEN_REFERENCE, Lexer::TOKEN_VARIADIC, Lexer::TOKEN_VARIABLE) ) { $type = null; } else { @@ -329,6 +886,8 @@ private function parsePropertyTagValue(TokenIterator $tokens): Ast\PhpDoc\Proper private function parseMethodTagValue(TokenIterator $tokens): Ast\PhpDoc\MethodTagValueNode { $isStatic = $tokens->tryConsumeTokenValue('static'); + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); $returnTypeOrMethodName = $this->typeParser->parse($tokens); if ($tokens->isCurrentTokenType(Lexer::TOKEN_IDENTIFIER)) { @@ -337,7 +896,9 @@ private function parseMethodTagValue(TokenIterator $tokens): Ast\PhpDoc\MethodTa $tokens->next(); } elseif ($returnTypeOrMethodName instanceof Ast\Type\IdentifierTypeNode) { - $returnType = $isStatic ? new Ast\Type\IdentifierTypeNode('static') : null; + $returnType = $isStatic + ? $this->typeParser->enrichWithAttributes($tokens, new Ast\Type\IdentifierTypeNode('static'), $startLine, $startIndex) + : null; $methodName = $returnTypeOrMethodName->name; $isStatic = false; @@ -347,9 +908,12 @@ private function parseMethodTagValue(TokenIterator $tokens): Ast\PhpDoc\MethodTa } $templateTypes = []; + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET)) { do { - $templateTypes[] = $this->parseTemplateTagValue($tokens, false); + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $templateTypes[] = $this->enrichWithAttributes($tokens, $this->parseTemplateTagValue($tokens, false), $startLine, $startIndex); } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)); $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET); } @@ -370,6 +934,9 @@ private function parseMethodTagValue(TokenIterator $tokens): Ast\PhpDoc\MethodTa private function parseMethodTagValueParameter(TokenIterator $tokens): Ast\PhpDoc\MethodTagValueParameterNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + switch ($tokens->currentTokenType()) { case Lexer::TOKEN_IDENTIFIER: case Lexer::TOKEN_OPEN_PARENTHESES: @@ -394,7 +961,12 @@ private function parseMethodTagValueParameter(TokenIterator $tokens): Ast\PhpDoc $defaultValue = null; } - return new Ast\PhpDoc\MethodTagValueParameterNode($parameterType, $isReference, $isVariadic, $parameterName, $defaultValue); + return $this->enrichWithAttributes( + $tokens, + new Ast\PhpDoc\MethodTagValueParameterNode($parameterType, $isReference, $isVariadic, $parameterName, $defaultValue), + $startLine, + $startIndex + ); } private function parseTemplateTagValue(TokenIterator $tokens, bool $parseDescription): Ast\PhpDoc\TemplateTagValueNode @@ -426,10 +998,15 @@ private function parseTemplateTagValue(TokenIterator $tokens, bool $parseDescrip private function parseExtendsTagValue(string $tagName, TokenIterator $tokens): Ast\PhpDoc\PhpDocTagValueNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); $baseType = new IdentifierTypeNode($tokens->currentTokenValue()); $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); - $type = $this->typeParser->parseGeneric($tokens, $baseType); + $type = $this->typeParser->parseGeneric( + $tokens, + $this->typeParser->enrichWithAttributes($tokens, $baseType, $startLine, $startIndex) + ); $description = $this->parseOptionalDescription($tokens); @@ -453,6 +1030,34 @@ private function parseTypeAliasTagValue(TokenIterator $tokens): Ast\PhpDoc\TypeA // support psalm-type syntax $tokens->tryConsumeTokenType(Lexer::TOKEN_EQUAL); + if ($this->preserveTypeAliasesWithInvalidTypes) { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + try { + $type = $this->typeParser->parse($tokens); + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + throw new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_PHPDOC_EOL, + null, + $tokens->currentTokenLine() + ); + } + } + + return new Ast\PhpDoc\TypeAliasTagValueNode($alias, $type); + } catch (ParserException $e) { + $this->parseOptionalDescription($tokens); + return new Ast\PhpDoc\TypeAliasTagValueNode( + $alias, + $this->enrichWithAttributes($tokens, new Ast\Type\InvalidTypeNode($e), $startLine, $startIndex) + ); + } + } + $type = $this->typeParser->parse($tokens); return new Ast\PhpDoc\TypeAliasTagValueNode($alias, $type); @@ -465,8 +1070,16 @@ private function parseTypeAliasImportTagValue(TokenIterator $tokens): Ast\PhpDoc $tokens->consumeTokenValue(Lexer::TOKEN_IDENTIFIER, 'from'); + $identifierStartLine = $tokens->currentTokenLine(); + $identifierStartIndex = $tokens->currentTokenIndex(); $importedFrom = $tokens->currentTokenValue(); $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + $importedFromType = $this->enrichWithAttributes( + $tokens, + new IdentifierTypeNode($importedFrom), + $identifierStartLine, + $identifierStartIndex + ); $importedAs = null; if ($tokens->tryConsumeTokenValue('as')) { @@ -474,7 +1087,7 @@ private function parseTypeAliasImportTagValue(TokenIterator $tokens): Ast\PhpDoc $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); } - return new Ast\PhpDoc\TypeAliasImportTagValueNode($importedAlias, new IdentifierTypeNode($importedFrom), $importedAs); + return new Ast\PhpDoc\TypeAliasImportTagValueNode($importedAlias, $importedFromType, $importedAs); } /** diff --git a/app/vendor/phpstan/phpdoc-parser/src/Parser/StringUnescaper.php b/app/vendor/phpstan/phpdoc-parser/src/Parser/StringUnescaper.php new file mode 100644 index 000000000..705240551 --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Parser/StringUnescaper.php @@ -0,0 +1,96 @@ + '\\', + 'n' => "\n", + 'r' => "\r", + 't' => "\t", + 'f' => "\f", + 'v' => "\v", + 'e' => "\x1B", + ]; + + public static function unescapeString(string $string): string + { + $quote = $string[0]; + + if ($quote === '\'') { + return str_replace( + ['\\\\', '\\\''], + ['\\', '\''], + substr($string, 1, -1) + ); + } + + return self::parseEscapeSequences(substr($string, 1, -1), '"'); + } + + /** + * Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L90-L130 + */ + private static function parseEscapeSequences(string $str, string $quote): string + { + $str = str_replace('\\' . $quote, $quote, $str); + + return preg_replace_callback( + '~\\\\([\\\\nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u\{([0-9a-fA-F]+)\})~', + static function ($matches) { + $str = $matches[1]; + + if (isset(self::REPLACEMENTS[$str])) { + return self::REPLACEMENTS[$str]; + } + if ($str[0] === 'x' || $str[0] === 'X') { + return chr((int) hexdec(substr($str, 1))); + } + if ($str[0] === 'u') { + return self::codePointToUtf8((int) hexdec($matches[2])); + } + + return chr((int) octdec($str)); + }, + $str + ); + } + + /** + * Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L132-L154 + */ + private static function codePointToUtf8(int $num): string + { + if ($num <= 0x7F) { + return chr($num); + } + if ($num <= 0x7FF) { + return chr(($num >> 6) + 0xC0) + . chr(($num & 0x3F) + 0x80); + } + if ($num <= 0xFFFF) { + return chr(($num >> 12) + 0xE0) + . chr((($num >> 6) & 0x3F) + 0x80) + . chr(($num & 0x3F) + 0x80); + } + if ($num <= 0x1FFFFF) { + return chr(($num >> 18) + 0xF0) + . chr((($num >> 12) & 0x3F) + 0x80) + . chr((($num >> 6) & 0x3F) + 0x80) + . chr(($num & 0x3F) + 0x80); + } + + // Invalid UTF-8 codepoint escape sequence: Codepoint too large + return "\xef\xbf\xbd"; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php b/app/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php index 569a9321a..9be7593d3 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php @@ -2,17 +2,19 @@ namespace PHPStan\PhpDocParser\Parser; +use LogicException; use PHPStan\PhpDocParser\Lexer\Lexer; use function array_pop; use function assert; use function count; use function in_array; use function strlen; +use function substr; class TokenIterator { - /** @var mixed[][] */ + /** @var list */ private $tokens; /** @var int */ @@ -21,16 +23,51 @@ class TokenIterator /** @var int[] */ private $savePoints = []; + /** @var list */ + private $skippedTokenTypes = [Lexer::TOKEN_HORIZONTAL_WS]; + + /** @var string|null */ + private $newline = null; + + /** + * @param list $tokens + */ public function __construct(array $tokens, int $index = 0) { $this->tokens = $tokens; $this->index = $index; - if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== Lexer::TOKEN_HORIZONTAL_WS) { - return; + $this->skipIrrelevantTokens(); + } + + + /** + * @return list + */ + public function getTokens(): array + { + return $this->tokens; + } + + + public function getContentBetween(int $startPos, int $endPos): string + { + if ($startPos < 0 || $endPos > count($this->tokens)) { + throw new LogicException(); } - $this->index++; + $content = ''; + for ($i = $startPos; $i < $endPos; $i++) { + $content .= $this->tokens[$i][Lexer::VALUE_OFFSET]; + } + + return $content; + } + + + public function getTokenCount(): int + { + return count($this->tokens); } @@ -57,6 +94,33 @@ public function currentTokenOffset(): int } + public function currentTokenLine(): int + { + return $this->tokens[$this->index][Lexer::LINE_OFFSET]; + } + + + public function currentTokenIndex(): int + { + return $this->index; + } + + + public function endIndexOfLastRelevantToken(): int + { + $endIndex = $this->currentTokenIndex(); + $endIndex--; + while (in_array($this->tokens[$endIndex][Lexer::TYPE_OFFSET], $this->skippedTokenTypes, true)) { + if (!isset($this->tokens[$endIndex - 1])) { + break; + } + $endIndex--; + } + + return $endIndex; + } + + public function isCurrentTokenValue(string $tokenValue): bool { return $this->tokens[$this->index][Lexer::VALUE_OFFSET] === $tokenValue; @@ -84,13 +148,14 @@ public function consumeTokenType(int $tokenType): void $this->throwError($tokenType); } - $this->index++; - - if (($this->tokens[$this->index][Lexer::TYPE_OFFSET] ?? -1) !== Lexer::TOKEN_HORIZONTAL_WS) { - return; + if ($tokenType === Lexer::TOKEN_PHPDOC_EOL) { + if ($this->newline === null) { + $this->detectNewline(); + } } $this->index++; + $this->skipIrrelevantTokens(); } @@ -104,12 +169,7 @@ public function consumeTokenValue(int $tokenType, string $tokenValue): void } $this->index++; - - if (($this->tokens[$this->index][Lexer::TYPE_OFFSET] ?? -1) !== Lexer::TOKEN_HORIZONTAL_WS) { - return; - } - - $this->index++; + $this->skipIrrelevantTokens(); } @@ -121,10 +181,7 @@ public function tryConsumeTokenValue(string $tokenValue): bool } $this->index++; - - if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) { - $this->index++; - } + $this->skipIrrelevantTokens(); return true; } @@ -137,16 +194,30 @@ public function tryConsumeTokenType(int $tokenType): bool return false; } - $this->index++; - - if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) { - $this->index++; + if ($tokenType === Lexer::TOKEN_PHPDOC_EOL) { + if ($this->newline === null) { + $this->detectNewline(); + } } + $this->index++; + $this->skipIrrelevantTokens(); + return true; } + private function detectNewline(): void + { + $value = $this->currentTokenValue(); + if (substr($value, 0, 2) === "\r\n") { + $this->newline = "\r\n"; + } elseif (substr($value, 0, 1) === "\n") { + $this->newline = "\n"; + } + } + + public function getSkippedHorizontalWhiteSpaceIfAny(): string { if ($this->index > 0 && $this->tokens[$this->index - 1][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) { @@ -171,12 +242,34 @@ public function joinUntil(int ...$tokenType): string public function next(): void { $this->index++; + $this->skipIrrelevantTokens(); + } - if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== Lexer::TOKEN_HORIZONTAL_WS) { + + private function skipIrrelevantTokens(): void + { + if (!isset($this->tokens[$this->index])) { return; } - $this->index++; + while (in_array($this->tokens[$this->index][Lexer::TYPE_OFFSET], $this->skippedTokenTypes, true)) { + if (!isset($this->tokens[$this->index + 1])) { + break; + } + $this->index++; + } + } + + + public function addEndOfLineToSkippedTokens(): void + { + $this->skippedTokenTypes = [Lexer::TOKEN_HORIZONTAL_WS, Lexer::TOKEN_PHPDOC_EOL]; + } + + + public function removeEndOfLineFromSkippedTokens(): void + { + $this->skippedTokenTypes = [Lexer::TOKEN_HORIZONTAL_WS]; } /** @phpstan-impure */ @@ -217,8 +310,74 @@ private function throwError(int $expectedTokenType, ?string $expectedTokenValue $this->currentTokenType(), $this->currentTokenOffset(), $expectedTokenType, - $expectedTokenValue + $expectedTokenValue, + $this->currentTokenLine() ); } + /** + * Check whether the position is directly preceded by a certain token type. + * + * During this check TOKEN_HORIZONTAL_WS and TOKEN_PHPDOC_EOL are skipped + */ + public function hasTokenImmediatelyBefore(int $pos, int $expectedTokenType): bool + { + $tokens = $this->tokens; + $pos--; + for (; $pos >= 0; $pos--) { + $token = $tokens[$pos]; + $type = $token[Lexer::TYPE_OFFSET]; + if ($type === $expectedTokenType) { + return true; + } + if (!in_array($type, [ + Lexer::TOKEN_HORIZONTAL_WS, + Lexer::TOKEN_PHPDOC_EOL, + ], true)) { + break; + } + } + return false; + } + + /** + * Check whether the position is directly followed by a certain token type. + * + * During this check TOKEN_HORIZONTAL_WS and TOKEN_PHPDOC_EOL are skipped + */ + public function hasTokenImmediatelyAfter(int $pos, int $expectedTokenType): bool + { + $tokens = $this->tokens; + $pos++; + for ($c = count($tokens); $pos < $c; $pos++) { + $token = $tokens[$pos]; + $type = $token[Lexer::TYPE_OFFSET]; + if ($type === $expectedTokenType) { + return true; + } + if (!in_array($type, [ + Lexer::TOKEN_HORIZONTAL_WS, + Lexer::TOKEN_PHPDOC_EOL, + ], true)) { + break; + } + } + + return false; + } + + public function getDetectedNewline(): ?string + { + return $this->newline; + } + + /** + * Whether the given position is immediately surrounded by parenthesis. + */ + public function hasParentheses(int $startPos, int $endPos): bool + { + return $this->hasTokenImmediatelyBefore($startPos, Lexer::TOKEN_OPEN_PARENTHESES) + && $this->hasTokenImmediatelyAfter($endPos, Lexer::TOKEN_CLOSE_PARENTHESES); + } + } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php b/app/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php index f45aafdcd..645f544b2 100644 --- a/app/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php +++ b/app/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php @@ -5,6 +5,8 @@ use LogicException; use PHPStan\PhpDocParser\Ast; use PHPStan\PhpDocParser\Lexer\Lexer; +use function in_array; +use function str_replace; use function strpos; use function trim; @@ -14,14 +16,35 @@ class TypeParser /** @var ConstExprParser|null */ private $constExprParser; - public function __construct(?ConstExprParser $constExprParser = null) + /** @var bool */ + private $quoteAwareConstExprString; + + /** @var bool */ + private $useLinesAttributes; + + /** @var bool */ + private $useIndexAttributes; + + /** + * @param array{lines?: bool, indexes?: bool} $usedAttributes + */ + public function __construct( + ?ConstExprParser $constExprParser = null, + bool $quoteAwareConstExprString = false, + array $usedAttributes = [] + ) { $this->constExprParser = $constExprParser; + $this->quoteAwareConstExprString = $quoteAwareConstExprString; + $this->useLinesAttributes = $usedAttributes['lines'] ?? false; + $this->useIndexAttributes = $usedAttributes['indexes'] ?? false; } /** @phpstan-impure */ public function parse(TokenIterator $tokens): Ast\Type\TypeNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); if ($tokens->isCurrentTokenType(Lexer::TOKEN_NULLABLE)) { $type = $this->parseNullable($tokens); @@ -36,12 +59,36 @@ public function parse(TokenIterator $tokens): Ast\Type\TypeNode } } + return $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); + } + + /** + * @internal + * @template T of Ast\Node + * @param T $type + * @return T + */ + public function enrichWithAttributes(TokenIterator $tokens, Ast\Node $type, int $startLine, int $startIndex): Ast\Node + { + if ($this->useLinesAttributes) { + $type->setAttribute(Ast\Attribute::START_LINE, $startLine); + $type->setAttribute(Ast\Attribute::END_LINE, $tokens->currentTokenLine()); + } + + if ($this->useIndexAttributes) { + $type->setAttribute(Ast\Attribute::START_INDEX, $startIndex); + $type->setAttribute(Ast\Attribute::END_INDEX, $tokens->endIndexOfLastRelevantToken()); + } + return $type; } /** @phpstan-impure */ private function subParse(TokenIterator $tokens): Ast\Type\TypeNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_NULLABLE)) { $type = $this->parseNullable($tokens); @@ -65,13 +112,16 @@ private function subParse(TokenIterator $tokens): Ast\Type\TypeNode } } - return $type; + return $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); } /** @phpstan-impure */ private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); $type = $this->subParse($tokens); @@ -80,26 +130,26 @@ private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { - return $this->tryParseArrayOrOffsetAccess($tokens, $type); + $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); } - return $type; + return $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); } if ($tokens->tryConsumeTokenType(Lexer::TOKEN_THIS_VARIABLE)) { - $type = new Ast\Type\ThisTypeNode(); + $type = $this->enrichWithAttributes($tokens, new Ast\Type\ThisTypeNode(), $startLine, $startIndex); if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { - return $this->tryParseArrayOrOffsetAccess($tokens, $type); + $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); } - return $type; + return $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); } $currentTokenValue = $tokens->currentTokenValue(); $tokens->pushSavePoint(); // because of ConstFetchNode if ($tokens->tryConsumeTokenType(Lexer::TOKEN_IDENTIFIER)) { - $type = new Ast\Type\IdentifierTypeNode($currentTokenValue); + $type = $this->enrichWithAttributes($tokens, new Ast\Type\IdentifierTypeNode($currentTokenValue), $startLine, $startIndex); if (!$tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_COLON)) { $tokens->dropSavePoint(); // because of ConstFetchNode @@ -123,15 +173,22 @@ private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); - } elseif ($type->name === 'array' && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { - $type = $this->parseArrayShape($tokens, $type); + } elseif (in_array($type->name, ['array', 'list', 'object'], true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { + if ($type->name === 'object') { + $type = $this->parseObjectShape($tokens); + } else { + $type = $this->parseArrayShape($tokens, $type, $type->name); + } if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { - $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); + $type = $this->tryParseArrayOrOffsetAccess( + $tokens, + $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex) + ); } } - return $type; + return $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); } else { $tokens->rollback(); // because of ConstFetchNode } @@ -143,7 +200,9 @@ private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode $tokens->currentTokenValue(), $tokens->currentTokenType(), $tokens->currentTokenOffset(), - Lexer::TOKEN_IDENTIFIER + Lexer::TOKEN_IDENTIFIER, + null, + $tokens->currentTokenLine() ); if ($this->constExprParser === null) { @@ -156,7 +215,7 @@ private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode throw $exception; } - return new Ast\Type\ConstTypeNode($constExpr); + return $this->enrichWithAttributes($tokens, new Ast\Type\ConstTypeNode($constExpr), $startLine, $startIndex); } catch (LogicException $e) { throw $exception; } @@ -335,7 +394,14 @@ public function parseGeneric(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); if ($tokens->tryConsumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET)) { // trailing comma case - return new Ast\Type\GenericTypeNode($baseType, $genericTypes, $variances); + $type = new Ast\Type\GenericTypeNode($baseType, $genericTypes, $variances); + $startLine = $baseType->getAttribute(Ast\Attribute::START_LINE); + $startIndex = $baseType->getAttribute(Ast\Attribute::START_INDEX); + if ($startLine !== null && $startIndex !== null) { + $type = $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); + } + + return $type; } [$genericTypes[], $variances[]] = $this->parseGenericTypeArgument($tokens); $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); @@ -344,7 +410,14 @@ public function parseGeneric(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET); - return new Ast\Type\GenericTypeNode($baseType, $genericTypes, $variances); + $type = new Ast\Type\GenericTypeNode($baseType, $genericTypes, $variances); + $startLine = $baseType->getAttribute(Ast\Attribute::START_LINE); + $startIndex = $baseType->getAttribute(Ast\Attribute::START_INDEX); + if ($startLine !== null && $startIndex !== null) { + $type = $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); + } + + return $type; } @@ -354,9 +427,11 @@ public function parseGeneric(TokenIterator $tokens, Ast\Type\IdentifierTypeNode */ public function parseGenericTypeArgument(TokenIterator $tokens): array { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); if ($tokens->tryConsumeTokenType(Lexer::TOKEN_WILDCARD)) { return [ - new Ast\Type\IdentifierTypeNode('mixed'), + $this->enrichWithAttributes($tokens, new Ast\Type\IdentifierTypeNode('mixed'), $startLine, $startIndex), Ast\Type\GenericTypeNode::VARIANCE_BIVARIANT, ]; } @@ -396,7 +471,10 @@ private function parseCallable(TokenIterator $tokens, Ast\Type\IdentifierTypeNod $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); $tokens->consumeTokenType(Lexer::TOKEN_COLON); - $returnType = $this->parseCallableReturnType($tokens); + + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $returnType = $this->enrichWithAttributes($tokens, $this->parseCallableReturnType($tokens), $startLine, $startIndex); return new Ast\Type\CallableTypeNode($identifier, $parameters, $returnType); } @@ -405,6 +483,8 @@ private function parseCallable(TokenIterator $tokens, Ast\Type\IdentifierTypeNod /** @phpstan-impure */ private function parseCallableParameter(TokenIterator $tokens): Ast\Type\CallableTypeParameterNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); $type = $this->parse($tokens); $isReference = $tokens->tryConsumeTokenType(Lexer::TOKEN_REFERENCE); $isVariadic = $tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC); @@ -418,37 +498,141 @@ private function parseCallableParameter(TokenIterator $tokens): Ast\Type\Callabl } $isOptional = $tokens->tryConsumeTokenType(Lexer::TOKEN_EQUAL); - return new Ast\Type\CallableTypeParameterNode($type, $isReference, $isVariadic, $parameterName, $isOptional); + return $this->enrichWithAttributes( + $tokens, + new Ast\Type\CallableTypeParameterNode($type, $isReference, $isVariadic, $parameterName, $isOptional), + $startLine, + $startIndex + ); } /** @phpstan-impure */ private function parseCallableReturnType(TokenIterator $tokens): Ast\Type\TypeNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); if ($tokens->isCurrentTokenType(Lexer::TOKEN_NULLABLE)) { - $type = $this->parseNullable($tokens); + return $this->parseNullable($tokens); } elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { $type = $this->parse($tokens); $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); + } - } else { - $type = new Ast\Type\IdentifierTypeNode($tokens->currentTokenValue()); - $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + return $type; + } elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_THIS_VARIABLE)) { + $type = new Ast\Type\ThisTypeNode(); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + )); + } - if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET)) { - $type = $this->parseGeneric($tokens, $type); + return $type; + } else { + $currentTokenValue = $tokens->currentTokenValue(); + $tokens->pushSavePoint(); // because of ConstFetchNode + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_IDENTIFIER)) { + $type = new Ast\Type\IdentifierTypeNode($currentTokenValue); + + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_COLON)) { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET)) { + $type = $this->parseGeneric( + $tokens, + $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + ) + ); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + )); + } + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + )); + + } elseif (in_array($type->name, ['array', 'list', 'object'], true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { + if ($type->name === 'object') { + $type = $this->parseObjectShape($tokens); + } else { + $type = $this->parseArrayShape($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + ), $type->name); + } + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + )); + } + } - } elseif ($type->name === 'array' && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { - $type = $this->parseArrayShape($tokens, $type); + return $type; + } else { + $tokens->rollback(); // because of ConstFetchNode + } + } else { + $tokens->dropSavePoint(); // because of ConstFetchNode } } - if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { - $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); + $exception = new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_IDENTIFIER, + null, + $tokens->currentTokenLine() + ); + + if ($this->constExprParser === null) { + throw $exception; } - return $type; + try { + $constExpr = $this->constExprParser->parse($tokens, true); + if ($constExpr instanceof Ast\ConstExpr\ConstExprArrayNode) { + throw $exception; + } + + $type = new Ast\Type\ConstTypeNode($constExpr); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + )); + } + + return $type; + } catch (LogicException $e) { + throw $exception; + } } @@ -472,6 +656,8 @@ private function tryParseCallable(TokenIterator $tokens, Ast\Type\IdentifierType /** @phpstan-impure */ private function tryParseArrayOrOffsetAccess(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\TypeNode { + $startLine = $type->getAttribute(Ast\Attribute::START_LINE); + $startIndex = $type->getAttribute(Ast\Attribute::START_INDEX); try { while ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { $tokens->pushSavePoint(); @@ -484,10 +670,28 @@ private function tryParseArrayOrOffsetAccess(TokenIterator $tokens, Ast\Type\Typ $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_SQUARE_BRACKET); $tokens->dropSavePoint(); $type = new Ast\Type\OffsetAccessTypeNode($type, $offset); + + if ($startLine !== null && $startIndex !== null) { + $type = $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + ); + } } else { $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_SQUARE_BRACKET); $tokens->dropSavePoint(); $type = new Ast\Type\ArrayTypeNode($type); + + if ($startLine !== null && $startIndex !== null) { + $type = $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + ); + } } } @@ -499,8 +703,11 @@ private function tryParseArrayOrOffsetAccess(TokenIterator $tokens, Ast\Type\Typ } - /** @phpstan-impure */ - private function parseArrayShape(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\ArrayShapeNode + /** + * @phpstan-impure + * @param Ast\Type\ArrayShapeNode::KIND_* $kind + */ + private function parseArrayShape(TokenIterator $tokens, Ast\Type\TypeNode $type, string $kind): Ast\Type\ArrayShapeNode { $tokens->consumeTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET); @@ -511,7 +718,7 @@ private function parseArrayShape(TokenIterator $tokens, Ast\Type\TypeNode $type) $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); if ($tokens->tryConsumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET)) { - return new Ast\Type\ArrayShapeNode($items); + return new Ast\Type\ArrayShapeNode($items, true, $kind); } if ($tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC)) { @@ -528,13 +735,15 @@ private function parseArrayShape(TokenIterator $tokens, Ast\Type\TypeNode $type) $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET); - return new Ast\Type\ArrayShapeNode($items, $sealed); + return new Ast\Type\ArrayShapeNode($items, $sealed, $kind); } /** @phpstan-impure */ private function parseArrayShapeItem(TokenIterator $tokens): Ast\Type\ArrayShapeItemNode { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); try { $tokens->pushSavePoint(); $key = $this->parseArrayShapeKey($tokens); @@ -543,12 +752,22 @@ private function parseArrayShapeItem(TokenIterator $tokens): Ast\Type\ArrayShape $value = $this->parse($tokens); $tokens->dropSavePoint(); - return new Ast\Type\ArrayShapeItemNode($key, $optional, $value); + return $this->enrichWithAttributes( + $tokens, + new Ast\Type\ArrayShapeItemNode($key, $optional, $value), + $startLine, + $startIndex + ); } catch (ParserException $e) { $tokens->rollback(); $value = $this->parse($tokens); - return new Ast\Type\ArrayShapeItemNode(null, false, $value); + return $this->enrichWithAttributes( + $tokens, + new Ast\Type\ArrayShapeItemNode(null, false, $value), + $startLine, + $startIndex + ); } } @@ -558,16 +777,107 @@ private function parseArrayShapeItem(TokenIterator $tokens): Ast\Type\ArrayShape */ private function parseArrayShapeKey(TokenIterator $tokens) { + $startIndex = $tokens->currentTokenIndex(); + $startLine = $tokens->currentTokenLine(); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_INTEGER)) { - $key = new Ast\ConstExpr\ConstExprIntegerNode($tokens->currentTokenValue()); + $key = new Ast\ConstExpr\ConstExprIntegerNode(str_replace('_', '', $tokens->currentTokenValue())); $tokens->next(); } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_SINGLE_QUOTED_STRING)) { - $key = new Ast\ConstExpr\ConstExprStringNode(trim($tokens->currentTokenValue(), "'")); + if ($this->quoteAwareConstExprString) { + $key = new Ast\ConstExpr\QuoteAwareConstExprStringNode(StringUnescaper::unescapeString($tokens->currentTokenValue()), Ast\ConstExpr\QuoteAwareConstExprStringNode::SINGLE_QUOTED); + } else { + $key = new Ast\ConstExpr\ConstExprStringNode(trim($tokens->currentTokenValue(), "'")); + } $tokens->next(); } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING)) { - $key = new Ast\ConstExpr\ConstExprStringNode(trim($tokens->currentTokenValue(), '"')); + if ($this->quoteAwareConstExprString) { + $key = new Ast\ConstExpr\QuoteAwareConstExprStringNode(StringUnescaper::unescapeString($tokens->currentTokenValue()), Ast\ConstExpr\QuoteAwareConstExprStringNode::DOUBLE_QUOTED); + } else { + $key = new Ast\ConstExpr\ConstExprStringNode(trim($tokens->currentTokenValue(), '"')); + } + + $tokens->next(); + + } else { + $key = new Ast\Type\IdentifierTypeNode($tokens->currentTokenValue()); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + } + + return $this->enrichWithAttributes( + $tokens, + $key, + $startLine, + $startIndex + ); + } + + /** + * @phpstan-impure + */ + private function parseObjectShape(TokenIterator $tokens): Ast\Type\ObjectShapeNode + { + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET); + + $items = []; + + do { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET)) { + return new Ast\Type\ObjectShapeNode($items); + } + + $items[] = $this->parseObjectShapeItem($tokens); + + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)); + + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET); + + return new Ast\Type\ObjectShapeNode($items); + } + + /** @phpstan-impure */ + private function parseObjectShapeItem(TokenIterator $tokens): Ast\Type\ObjectShapeItemNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + $key = $this->parseObjectShapeKey($tokens); + $optional = $tokens->tryConsumeTokenType(Lexer::TOKEN_NULLABLE); + $tokens->consumeTokenType(Lexer::TOKEN_COLON); + $value = $this->parse($tokens); + + return $this->enrichWithAttributes($tokens, new Ast\Type\ObjectShapeItemNode($key, $optional, $value), $startLine, $startIndex); + } + + /** + * @phpstan-impure + * @return Ast\ConstExpr\ConstExprStringNode|Ast\Type\IdentifierTypeNode + */ + private function parseObjectShapeKey(TokenIterator $tokens) + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_SINGLE_QUOTED_STRING)) { + if ($this->quoteAwareConstExprString) { + $key = new Ast\ConstExpr\QuoteAwareConstExprStringNode(StringUnescaper::unescapeString($tokens->currentTokenValue()), Ast\ConstExpr\QuoteAwareConstExprStringNode::SINGLE_QUOTED); + } else { + $key = new Ast\ConstExpr\ConstExprStringNode(trim($tokens->currentTokenValue(), "'")); + } + $tokens->next(); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING)) { + if ($this->quoteAwareConstExprString) { + $key = new Ast\ConstExpr\QuoteAwareConstExprStringNode(StringUnescaper::unescapeString($tokens->currentTokenValue()), Ast\ConstExpr\QuoteAwareConstExprStringNode::DOUBLE_QUOTED); + } else { + $key = new Ast\ConstExpr\ConstExprStringNode(trim($tokens->currentTokenValue(), '"')); + } $tokens->next(); } else { @@ -575,7 +885,7 @@ private function parseArrayShapeKey(TokenIterator $tokens) $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); } - return $key; + return $this->enrichWithAttributes($tokens, $key, $startLine, $startIndex); } } diff --git a/app/vendor/phpstan/phpdoc-parser/src/Printer/DiffElem.php b/app/vendor/phpstan/phpdoc-parser/src/Printer/DiffElem.php new file mode 100644 index 000000000..2684dfc7e --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Printer/DiffElem.php @@ -0,0 +1,44 @@ +type = $type; + $this->old = $old; + $this->new = $new; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Printer/Differ.php b/app/vendor/phpstan/phpdoc-parser/src/Printer/Differ.php new file mode 100644 index 000000000..ab10be59b --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Printer/Differ.php @@ -0,0 +1,196 @@ +isEqual = $isEqual; + } + + /** + * Calculate diff (edit script) from $old to $new. + * + * @param T[] $old Original array + * @param T[] $new New array + * + * @return DiffElem[] Diff (edit script) + */ + public function diff(array $old, array $new): array + { + [$trace, $x, $y] = $this->calculateTrace($old, $new); + return $this->extractDiff($trace, $x, $y, $old, $new); + } + + /** + * Calculate diff, including "replace" operations. + * + * If a sequence of remove operations is followed by the same number of add operations, these + * will be coalesced into replace operations. + * + * @param T[] $old Original array + * @param T[] $new New array + * + * @return DiffElem[] Diff (edit script), including replace operations + */ + public function diffWithReplacements(array $old, array $new): array + { + return $this->coalesceReplacements($this->diff($old, $new)); + } + + /** + * @param T[] $old + * @param T[] $new + * @return array{array>, int, int} + */ + private function calculateTrace(array $old, array $new): array + { + $n = count($old); + $m = count($new); + $max = $n + $m; + $v = [1 => 0]; + $trace = []; + for ($d = 0; $d <= $max; $d++) { + $trace[] = $v; + for ($k = -$d; $k <= $d; $k += 2) { + if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) { + $x = $v[$k + 1]; + } else { + $x = $v[$k - 1] + 1; + } + + $y = $x - $k; + while ($x < $n && $y < $m && ($this->isEqual)($old[$x], $new[$y])) { + $x++; + $y++; + } + + $v[$k] = $x; + if ($x >= $n && $y >= $m) { + return [$trace, $x, $y]; + } + } + } + throw new Exception('Should not happen'); + } + + /** + * @param array> $trace + * @param T[] $old + * @param T[] $new + * @return DiffElem[] + */ + private function extractDiff(array $trace, int $x, int $y, array $old, array $new): array + { + $result = []; + for ($d = count($trace) - 1; $d >= 0; $d--) { + $v = $trace[$d]; + $k = $x - $y; + + if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) { + $prevK = $k + 1; + } else { + $prevK = $k - 1; + } + + $prevX = $v[$prevK]; + $prevY = $prevX - $prevK; + + while ($x > $prevX && $y > $prevY) { + $result[] = new DiffElem(DiffElem::TYPE_KEEP, $old[$x - 1], $new[$y - 1]); + $x--; + $y--; + } + + if ($d === 0) { + break; + } + + while ($x > $prevX) { + $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $old[$x - 1], null); + $x--; + } + + while ($y > $prevY) { + $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $new[$y - 1]); + $y--; + } + } + return array_reverse($result); + } + + /** + * Coalesce equal-length sequences of remove+add into a replace operation. + * + * @param DiffElem[] $diff + * @return DiffElem[] + */ + private function coalesceReplacements(array $diff): array + { + $newDiff = []; + $c = count($diff); + for ($i = 0; $i < $c; $i++) { + $diffType = $diff[$i]->type; + if ($diffType !== DiffElem::TYPE_REMOVE) { + $newDiff[] = $diff[$i]; + continue; + } + + $j = $i; + while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) { + $j++; + } + + $k = $j; + while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) { + $k++; + } + + if ($j - $i === $k - $j) { + $len = $j - $i; + for ($n = 0; $n < $len; $n++) { + $newDiff[] = new DiffElem( + DiffElem::TYPE_REPLACE, + $diff[$i + $n]->old, + $diff[$j + $n]->new + ); + } + } else { + for (; $i < $k; $i++) { + $newDiff[] = $diff[$i]; + } + } + $i = $k - 1; + } + return $newDiff; + } + +} diff --git a/app/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php b/app/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php new file mode 100644 index 000000000..d7feaf91d --- /dev/null +++ b/app/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php @@ -0,0 +1,828 @@ + */ + private $differ; + + /** + * Map From "{$class}->{$subNode}" to string that should be inserted + * between elements of this list subnode + * + * @var array + */ + private $listInsertionMap = [ + PhpDocNode::class . '->children' => "\n * ", + UnionTypeNode::class . '->types' => '|', + IntersectionTypeNode::class . '->types' => '&', + ArrayShapeNode::class . '->items' => ', ', + ObjectShapeNode::class . '->items' => ', ', + CallableTypeNode::class . '->parameters' => ', ', + GenericTypeNode::class . '->genericTypes' => ', ', + ConstExprArrayNode::class . '->items' => ', ', + MethodTagValueNode::class . '->parameters' => ', ', + DoctrineArray::class . '->items' => ', ', + DoctrineAnnotation::class . '->arguments' => ', ', + ]; + + /** + * [$find, $extraLeft, $extraRight] + * + * @var array + */ + private $emptyListInsertionMap = [ + CallableTypeNode::class . '->parameters' => ['(', '', ''], + ArrayShapeNode::class . '->items' => ['{', '', ''], + ObjectShapeNode::class . '->items' => ['{', '', ''], + DoctrineArray::class . '->items' => ['{', '', ''], + DoctrineAnnotation::class . '->arguments' => ['(', '', ''], + ]; + + /** @var array>> */ + private $parenthesesMap = [ + CallableTypeNode::class . '->returnType' => [ + CallableTypeNode::class, + UnionTypeNode::class, + IntersectionTypeNode::class, + ], + ArrayTypeNode::class . '->type' => [ + CallableTypeNode::class, + UnionTypeNode::class, + IntersectionTypeNode::class, + ConstTypeNode::class, + NullableTypeNode::class, + ], + OffsetAccessTypeNode::class . '->type' => [ + CallableTypeNode::class, + UnionTypeNode::class, + IntersectionTypeNode::class, + ConstTypeNode::class, + NullableTypeNode::class, + ], + ]; + + /** @var array>> */ + private $parenthesesListMap = [ + IntersectionTypeNode::class . '->types' => [ + IntersectionTypeNode::class, + UnionTypeNode::class, + NullableTypeNode::class, + ], + UnionTypeNode::class . '->types' => [ + IntersectionTypeNode::class, + UnionTypeNode::class, + NullableTypeNode::class, + ], + ]; + + public function printFormatPreserving(PhpDocNode $node, PhpDocNode $originalNode, TokenIterator $originalTokens): string + { + $this->differ = new Differ(static function ($a, $b) { + if ($a instanceof Node && $b instanceof Node) { + return $a === $b->getAttribute(Attribute::ORIGINAL_NODE); + } + + return false; + }); + + $tokenIndex = 0; + $result = $this->printArrayFormatPreserving( + $node->children, + $originalNode->children, + $originalTokens, + $tokenIndex, + PhpDocNode::class, + 'children' + ); + if ($result !== null) { + return $result . $originalTokens->getContentBetween($tokenIndex, $originalTokens->getTokenCount()); + } + + return $this->print($node); + } + + public function print(Node $node): string + { + if ($node instanceof PhpDocNode) { + return "/**\n *" . implode("\n *", array_map( + function (PhpDocChildNode $child): string { + $s = $this->print($child); + return $s === '' ? '' : ' ' . $s; + }, + $node->children + )) . "\n */"; + } + if ($node instanceof PhpDocTextNode) { + return $node->text; + } + if ($node instanceof PhpDocTagNode) { + if ($node->value instanceof DoctrineTagValueNode) { + return $this->print($node->value); + } + + return trim(sprintf('%s %s', $node->name, $this->print($node->value))); + } + if ($node instanceof PhpDocTagValueNode) { + return $this->printTagValue($node); + } + if ($node instanceof TypeNode) { + return $this->printType($node); + } + if ($node instanceof ConstExprNode) { + return $this->printConstExpr($node); + } + if ($node instanceof MethodTagValueParameterNode) { + $type = $node->type !== null ? $this->print($node->type) . ' ' : ''; + $isReference = $node->isReference ? '&' : ''; + $isVariadic = $node->isVariadic ? '...' : ''; + $default = $node->defaultValue !== null ? ' = ' . $this->print($node->defaultValue) : ''; + return "{$type}{$isReference}{$isVariadic}{$node->parameterName}{$default}"; + } + if ($node instanceof CallableTypeParameterNode) { + $type = $this->print($node->type) . ' '; + $isReference = $node->isReference ? '&' : ''; + $isVariadic = $node->isVariadic ? '...' : ''; + $isOptional = $node->isOptional ? '=' : ''; + return trim("{$type}{$isReference}{$isVariadic}{$node->parameterName}") . $isOptional; + } + if ($node instanceof DoctrineAnnotation) { + return (string) $node; + } + if ($node instanceof DoctrineArgument) { + return (string) $node; + } + if ($node instanceof DoctrineArray) { + return (string) $node; + } + if ($node instanceof DoctrineArrayItem) { + return (string) $node; + } + + throw new LogicException(sprintf('Unknown node type %s', get_class($node))); + } + + private function printTagValue(PhpDocTagValueNode $node): string + { + // only nodes that contain another node are handled here + // the rest falls back on (string) $node + + if ($node instanceof AssertTagMethodValueNode) { + $isNegated = $node->isNegated ? '!' : ''; + $isEquality = $node->isEquality ? '=' : ''; + $type = $this->printType($node->type); + return trim("{$isNegated}{$isEquality}{$type} {$node->parameter}->{$node->method}() {$node->description}"); + } + if ($node instanceof AssertTagPropertyValueNode) { + $isNegated = $node->isNegated ? '!' : ''; + $isEquality = $node->isEquality ? '=' : ''; + $type = $this->printType($node->type); + return trim("{$isNegated}{$isEquality}{$type} {$node->parameter}->{$node->property} {$node->description}"); + } + if ($node instanceof AssertTagValueNode) { + $isNegated = $node->isNegated ? '!' : ''; + $isEquality = $node->isEquality ? '=' : ''; + $type = $this->printType($node->type); + return trim("{$isNegated}{$isEquality}{$type} {$node->parameter} {$node->description}"); + } + if ($node instanceof ExtendsTagValueNode || $node instanceof ImplementsTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof MethodTagValueNode) { + $static = $node->isStatic ? 'static ' : ''; + $returnType = $node->returnType !== null ? $this->printType($node->returnType) . ' ' : ''; + $parameters = implode(', ', array_map(function (MethodTagValueParameterNode $parameter): string { + return $this->print($parameter); + }, $node->parameters)); + $description = $node->description !== '' ? " {$node->description}" : ''; + $templateTypes = count($node->templateTypes) > 0 ? '<' . implode(', ', array_map(function (TemplateTagValueNode $templateTag): string { + return $this->print($templateTag); + }, $node->templateTypes)) . '>' : ''; + return "{$static}{$returnType}{$node->methodName}{$templateTypes}({$parameters}){$description}"; + } + if ($node instanceof MixinTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof ParamOutTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->parameterName} {$node->description}"); + } + if ($node instanceof ParamTagValueNode) { + $reference = $node->isReference ? '&' : ''; + $variadic = $node->isVariadic ? '...' : ''; + $type = $this->printType($node->type); + return trim("{$type} {$reference}{$variadic}{$node->parameterName} {$node->description}"); + } + if ($node instanceof PropertyTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->propertyName} {$node->description}"); + } + if ($node instanceof ReturnTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof SelfOutTagValueNode) { + $type = $this->printType($node->type); + return trim($type . ' ' . $node->description); + } + if ($node instanceof TemplateTagValueNode) { + $bound = $node->bound !== null ? ' of ' . $this->printType($node->bound) : ''; + $default = $node->default !== null ? ' = ' . $this->printType($node->default) : ''; + return trim("{$node->name}{$bound}{$default} {$node->description}"); + } + if ($node instanceof ThrowsTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof TypeAliasImportTagValueNode) { + return trim( + "{$node->importedAlias} from " . $this->printType($node->importedFrom) + . ($node->importedAs !== null ? " as {$node->importedAs}" : '') + ); + } + if ($node instanceof TypeAliasTagValueNode) { + $type = $this->printType($node->type); + return trim("{$node->alias} {$type}"); + } + if ($node instanceof UsesTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof VarTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} " . trim("{$node->variableName} {$node->description}")); + } + + return (string) $node; + } + + private function printType(TypeNode $node): string + { + if ($node instanceof ArrayShapeNode) { + $items = array_map(function (ArrayShapeItemNode $item): string { + return $this->printType($item); + }, $node->items); + + if (! $node->sealed) { + $items[] = '...'; + } + + return $node->kind . '{' . implode(', ', $items) . '}'; + } + if ($node instanceof ArrayShapeItemNode) { + if ($node->keyName !== null) { + return sprintf( + '%s%s: %s', + $this->print($node->keyName), + $node->optional ? '?' : '', + $this->printType($node->valueType) + ); + } + + return $this->printType($node->valueType); + } + if ($node instanceof ArrayTypeNode) { + return $this->printOffsetAccessType($node->type) . '[]'; + } + if ($node instanceof CallableTypeNode) { + if ($node->returnType instanceof CallableTypeNode || $node->returnType instanceof UnionTypeNode || $node->returnType instanceof IntersectionTypeNode) { + $returnType = $this->wrapInParentheses($node->returnType); + } else { + $returnType = $this->printType($node->returnType); + } + $parameters = implode(', ', array_map(function (CallableTypeParameterNode $parameterNode): string { + return $this->print($parameterNode); + }, $node->parameters)); + return "{$node->identifier}({$parameters}): {$returnType}"; + } + if ($node instanceof ConditionalTypeForParameterNode) { + return sprintf( + '(%s %s %s ? %s : %s)', + $node->parameterName, + $node->negated ? 'is not' : 'is', + $this->printType($node->targetType), + $this->printType($node->if), + $this->printType($node->else) + ); + } + if ($node instanceof ConditionalTypeNode) { + return sprintf( + '(%s %s %s ? %s : %s)', + $this->printType($node->subjectType), + $node->negated ? 'is not' : 'is', + $this->printType($node->targetType), + $this->printType($node->if), + $this->printType($node->else) + ); + } + if ($node instanceof ConstTypeNode) { + return $this->printConstExpr($node->constExpr); + } + if ($node instanceof GenericTypeNode) { + $genericTypes = []; + + foreach ($node->genericTypes as $index => $type) { + $variance = $node->variances[$index] ?? GenericTypeNode::VARIANCE_INVARIANT; + if ($variance === GenericTypeNode::VARIANCE_INVARIANT) { + $genericTypes[] = $this->printType($type); + } elseif ($variance === GenericTypeNode::VARIANCE_BIVARIANT) { + $genericTypes[] = '*'; + } else { + $genericTypes[] = sprintf('%s %s', $variance, $this->print($type)); + } + } + + return $node->type . '<' . implode(', ', $genericTypes) . '>'; + } + if ($node instanceof IdentifierTypeNode) { + return $node->name; + } + if ($node instanceof IntersectionTypeNode || $node instanceof UnionTypeNode) { + $items = []; + foreach ($node->types as $type) { + if ( + $type instanceof IntersectionTypeNode + || $type instanceof UnionTypeNode + || $type instanceof NullableTypeNode + ) { + $items[] = $this->wrapInParentheses($type); + continue; + } + + $items[] = $this->printType($type); + } + + return implode($node instanceof IntersectionTypeNode ? '&' : '|', $items); + } + if ($node instanceof InvalidTypeNode) { + return (string) $node; + } + if ($node instanceof NullableTypeNode) { + if ($node->type instanceof IntersectionTypeNode || $node->type instanceof UnionTypeNode) { + return '?(' . $this->printType($node->type) . ')'; + } + + return '?' . $this->printType($node->type); + } + if ($node instanceof ObjectShapeNode) { + $items = array_map(function (ObjectShapeItemNode $item): string { + return $this->printType($item); + }, $node->items); + + return 'object{' . implode(', ', $items) . '}'; + } + if ($node instanceof ObjectShapeItemNode) { + if ($node->keyName !== null) { + return sprintf( + '%s%s: %s', + $this->print($node->keyName), + $node->optional ? '?' : '', + $this->printType($node->valueType) + ); + } + + return $this->printType($node->valueType); + } + if ($node instanceof OffsetAccessTypeNode) { + return $this->printOffsetAccessType($node->type) . '[' . $this->printType($node->offset) . ']'; + } + if ($node instanceof ThisTypeNode) { + return (string) $node; + } + + throw new LogicException(sprintf('Unknown node type %s', get_class($node))); + } + + private function wrapInParentheses(TypeNode $node): string + { + return '(' . $this->printType($node) . ')'; + } + + private function printOffsetAccessType(TypeNode $type): string + { + if ( + $type instanceof CallableTypeNode + || $type instanceof UnionTypeNode + || $type instanceof IntersectionTypeNode + || $type instanceof ConstTypeNode + || $type instanceof NullableTypeNode + ) { + return $this->wrapInParentheses($type); + } + + return $this->printType($type); + } + + private function printConstExpr(ConstExprNode $node): string + { + // this is fine - ConstExprNode classes do not contain nodes that need smart printer logic + return (string) $node; + } + + /** + * @param Node[] $nodes + * @param Node[] $originalNodes + */ + private function printArrayFormatPreserving(array $nodes, array $originalNodes, TokenIterator $originalTokens, int &$tokenIndex, string $parentNodeClass, string $subNodeName): ?string + { + $diff = $this->differ->diffWithReplacements($originalNodes, $nodes); + $mapKey = $parentNodeClass . '->' . $subNodeName; + $insertStr = $this->listInsertionMap[$mapKey] ?? null; + $result = ''; + $beforeFirstKeepOrReplace = true; + $delayedAdd = []; + + $insertNewline = false; + [$isMultiline, $beforeAsteriskIndent, $afterAsteriskIndent] = $this->isMultiline($tokenIndex, $originalNodes, $originalTokens); + + if ($insertStr === "\n * ") { + $insertStr = sprintf('%s%s*%s', $originalTokens->getDetectedNewline() ?? "\n", $beforeAsteriskIndent, $afterAsteriskIndent); + } + + foreach ($diff as $i => $diffElem) { + $diffType = $diffElem->type; + $newNode = $diffElem->new; + $originalNode = $diffElem->old; + if ($diffType === DiffElem::TYPE_KEEP || $diffType === DiffElem::TYPE_REPLACE) { + $beforeFirstKeepOrReplace = false; + if (!$newNode instanceof Node || !$originalNode instanceof Node) { + return null; + } + $itemStartPos = $originalNode->getAttribute(Attribute::START_INDEX); + $itemEndPos = $originalNode->getAttribute(Attribute::END_INDEX); + if ($itemStartPos < 0 || $itemEndPos < 0 || $itemStartPos < $tokenIndex) { + throw new LogicException(); + } + + $result .= $originalTokens->getContentBetween($tokenIndex, $itemStartPos); + + if (count($delayedAdd) > 0) { + foreach ($delayedAdd as $delayedAddNode) { + $parenthesesNeeded = isset($this->parenthesesListMap[$mapKey]) + && in_array(get_class($delayedAddNode), $this->parenthesesListMap[$mapKey], true); + if ($parenthesesNeeded) { + $result .= '('; + } + $result .= $this->printNodeFormatPreserving($delayedAddNode, $originalTokens); + if ($parenthesesNeeded) { + $result .= ')'; + } + + if ($insertNewline) { + $result .= $insertStr . sprintf('%s%s*%s', $originalTokens->getDetectedNewline() ?? "\n", $beforeAsteriskIndent, $afterAsteriskIndent); + } else { + $result .= $insertStr; + } + } + + $delayedAdd = []; + } + + $parenthesesNeeded = isset($this->parenthesesListMap[$mapKey]) + && in_array(get_class($newNode), $this->parenthesesListMap[$mapKey], true) + && !in_array(get_class($originalNode), $this->parenthesesListMap[$mapKey], true); + $addParentheses = $parenthesesNeeded && !$originalTokens->hasParentheses($itemStartPos, $itemEndPos); + if ($addParentheses) { + $result .= '('; + } + + $result .= $this->printNodeFormatPreserving($newNode, $originalTokens); + if ($addParentheses) { + $result .= ')'; + } + $tokenIndex = $itemEndPos + 1; + + } elseif ($diffType === DiffElem::TYPE_ADD) { + if ($insertStr === null) { + return null; + } + if (!$newNode instanceof Node) { + return null; + } + + if ($insertStr === ', ' && $isMultiline) { + $insertStr = ','; + $insertNewline = true; + } + + if ($beforeFirstKeepOrReplace) { + // Will be inserted at the next "replace" or "keep" element + $delayedAdd[] = $newNode; + continue; + } + + $itemEndPos = $tokenIndex - 1; + if ($insertNewline) { + $result .= $insertStr . sprintf('%s%s*%s', $originalTokens->getDetectedNewline() ?? "\n", $beforeAsteriskIndent, $afterAsteriskIndent); + } else { + $result .= $insertStr; + } + + $parenthesesNeeded = isset($this->parenthesesListMap[$mapKey]) + && in_array(get_class($newNode), $this->parenthesesListMap[$mapKey], true); + if ($parenthesesNeeded) { + $result .= '('; + } + + $result .= $this->printNodeFormatPreserving($newNode, $originalTokens); + if ($parenthesesNeeded) { + $result .= ')'; + } + + $tokenIndex = $itemEndPos + 1; + + } elseif ($diffType === DiffElem::TYPE_REMOVE) { + if (!$originalNode instanceof Node) { + return null; + } + + $itemStartPos = $originalNode->getAttribute(Attribute::START_INDEX); + $itemEndPos = $originalNode->getAttribute(Attribute::END_INDEX); + if ($itemStartPos < 0 || $itemEndPos < 0) { + throw new LogicException(); + } + + if ($i === 0) { + // If we're removing from the start, keep the tokens before the node and drop those after it, + // instead of the other way around. + $originalTokensArray = $originalTokens->getTokens(); + for ($j = $tokenIndex; $j < $itemStartPos; $j++) { + if ($originalTokensArray[$j][Lexer::TYPE_OFFSET] === Lexer::TOKEN_PHPDOC_EOL) { + break; + } + $result .= $originalTokensArray[$j][Lexer::VALUE_OFFSET]; + } + } + + $tokenIndex = $itemEndPos + 1; + } + } + + if (count($delayedAdd) > 0) { + if (!isset($this->emptyListInsertionMap[$mapKey])) { + return null; + } + + [$findToken, $extraLeft, $extraRight] = $this->emptyListInsertionMap[$mapKey]; + if ($findToken !== null) { + $originalTokensArray = $originalTokens->getTokens(); + for (; $tokenIndex < count($originalTokensArray); $tokenIndex++) { + $result .= $originalTokensArray[$tokenIndex][Lexer::VALUE_OFFSET]; + if ($originalTokensArray[$tokenIndex][Lexer::VALUE_OFFSET] !== $findToken) { + continue; + } + + $tokenIndex++; + break; + } + } + $first = true; + $result .= $extraLeft; + foreach ($delayedAdd as $delayedAddNode) { + if (!$first) { + $result .= $insertStr; + if ($insertNewline) { + $result .= sprintf('%s%s*%s', $originalTokens->getDetectedNewline() ?? "\n", $beforeAsteriskIndent, $afterAsteriskIndent); + } + } + + $result .= $this->printNodeFormatPreserving($delayedAddNode, $originalTokens); + $first = false; + } + $result .= $extraRight; + } + + return $result; + } + + /** + * @param Node[] $nodes + * @return array{bool, string, string} + */ + private function isMultiline(int $initialIndex, array $nodes, TokenIterator $originalTokens): array + { + $isMultiline = count($nodes) > 1; + $pos = $initialIndex; + $allText = ''; + /** @var Node|null $node */ + foreach ($nodes as $node) { + if (!$node instanceof Node) { + continue; + } + + $endPos = $node->getAttribute(Attribute::END_INDEX) + 1; + $text = $originalTokens->getContentBetween($pos, $endPos); + $allText .= $text; + if (strpos($text, "\n") === false) { + // We require that a newline is present between *every* item. If the formatting + // is inconsistent, with only some items having newlines, we don't consider it + // as multiline + $isMultiline = false; + } + $pos = $endPos; + } + + $c = preg_match_all('~\n(?[\\x09\\x20]*)\*(?\\x20*)~', $allText, $matches, PREG_SET_ORDER); + if ($c === 0) { + return [$isMultiline, '', '']; + } + + $before = ''; + $after = ''; + foreach ($matches as $match) { + if (strlen($match['before']) > strlen($before)) { + $before = $match['before']; + } + if (strlen($match['after']) <= strlen($after)) { + continue; + } + + $after = $match['after']; + } + + return [$isMultiline, $before, $after]; + } + + private function printNodeFormatPreserving(Node $node, TokenIterator $originalTokens): string + { + /** @var Node|null $originalNode */ + $originalNode = $node->getAttribute(Attribute::ORIGINAL_NODE); + if ($originalNode === null) { + return $this->print($node); + } + + $class = get_class($node); + if ($class !== get_class($originalNode)) { + throw new LogicException(); + } + + $startPos = $originalNode->getAttribute(Attribute::START_INDEX); + $endPos = $originalNode->getAttribute(Attribute::END_INDEX); + if ($startPos < 0 || $endPos < 0) { + throw new LogicException(); + } + + $result = ''; + $pos = $startPos; + $subNodeNames = array_keys(get_object_vars($node)); + foreach ($subNodeNames as $subNodeName) { + $subNode = $node->$subNodeName; + $origSubNode = $originalNode->$subNodeName; + + if ( + (!$subNode instanceof Node && $subNode !== null) + || (!$origSubNode instanceof Node && $origSubNode !== null) + ) { + if ($subNode === $origSubNode) { + // Unchanged, can reuse old code + continue; + } + + if (is_array($subNode) && is_array($origSubNode)) { + // Array subnode changed, we might be able to reconstruct it + $listResult = $this->printArrayFormatPreserving( + $subNode, + $origSubNode, + $originalTokens, + $pos, + $class, + $subNodeName + ); + + if ($listResult === null) { + return $this->print($node); + } + + $result .= $listResult; + continue; + } + + return $this->print($node); + } + + if ($origSubNode === null) { + if ($subNode === null) { + // Both null, nothing to do + continue; + } + + return $this->print($node); + } + + $subStartPos = $origSubNode->getAttribute(Attribute::START_INDEX); + $subEndPos = $origSubNode->getAttribute(Attribute::END_INDEX); + if ($subStartPos < 0 || $subEndPos < 0) { + throw new LogicException(); + } + + if ($subNode === null) { + return $this->print($node); + } + + $result .= $originalTokens->getContentBetween($pos, $subStartPos); + $mapKey = get_class($node) . '->' . $subNodeName; + $parenthesesNeeded = isset($this->parenthesesMap[$mapKey]) + && in_array(get_class($subNode), $this->parenthesesMap[$mapKey], true); + + if ($subNode->getAttribute(Attribute::ORIGINAL_NODE) !== null) { + $parenthesesNeeded = $parenthesesNeeded + && !in_array(get_class($subNode->getAttribute(Attribute::ORIGINAL_NODE)), $this->parenthesesMap[$mapKey], true); + } + + $addParentheses = $parenthesesNeeded && !$originalTokens->hasParentheses($subStartPos, $subEndPos); + if ($addParentheses) { + $result .= '('; + } + + $result .= $this->printNodeFormatPreserving($subNode, $originalTokens); + if ($addParentheses) { + $result .= ')'; + } + + $pos = $subEndPos + 1; + } + + return $result . $originalTokens->getContentBetween($pos, $endPos + 1); + } + +} diff --git a/app/vendor/phpunit/php-code-coverage/ChangeLog.md b/app/vendor/phpunit/php-code-coverage/ChangeLog-9.2.md similarity index 96% rename from app/vendor/phpunit/php-code-coverage/ChangeLog.md rename to app/vendor/phpunit/php-code-coverage/ChangeLog-9.2.md index cdf28e0a4..880be3be8 100644 --- a/app/vendor/phpunit/php-code-coverage/ChangeLog.md +++ b/app/vendor/phpunit/php-code-coverage/ChangeLog-9.2.md @@ -2,6 +2,29 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [9.2.27] - 2023-07-26 + +### Changed + +* The result of `CodeCoverage::getReport()` is now cached + +### Fixed + +* Static analysis cache keys do not include configuration settings that affect source code parsing +* The Clover, Cobertura, Crap4j, and PHP report writers no longer create a `php:` directory when they should write to `php://stdout`, for instance + +## [9.2.26] - 2023-03-06 + +### Changed + +* Improved the legend on the file pages of the HTML code coverage report + +## [9.2.25] - 2023-02-25 + +### Fixed + +* [#981](https://github.com/sebastianbergmann/php-code-coverage/issues/981): `CodeUnitFindingVisitor` does not support DNF types + ## [9.2.24] - 2023-01-26 ### Changed @@ -464,6 +487,9 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 7.1 +[9.2.27]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.26...9.2.27 +[9.2.26]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.25...9.2.26 +[9.2.25]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.24...9.2.25 [9.2.24]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.23...9.2.24 [9.2.23]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.22...9.2.23 [9.2.22]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.21...9.2.22 diff --git a/app/vendor/phpunit/php-code-coverage/composer.json b/app/vendor/phpunit/php-code-coverage/composer.json index b09bd6479..0f18174cd 100644 --- a/app/vendor/phpunit/php-code-coverage/composer.json +++ b/app/vendor/phpunit/php-code-coverage/composer.json @@ -17,7 +17,8 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues" + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy" }, "config": { "platform": { @@ -32,7 +33,7 @@ "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", "sebastian/code-unit-reverse-lookup": "^2.0.2", @@ -46,8 +47,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "autoload": { "classmap": [ diff --git a/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php b/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php index c35f27c8c..bdf9c64c3 100644 --- a/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php +++ b/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php @@ -114,6 +114,11 @@ final class CodeCoverage */ private $cacheDirectory; + /** + * @var ?Directory + */ + private $cachedReport; + public function __construct(Driver $driver, Filter $filter) { $this->driver = $driver; @@ -127,7 +132,11 @@ public function __construct(Driver $driver, Filter $filter) */ public function getReport(): Directory { - return (new Builder($this->analyser()))->build($this); + if ($this->cachedReport === null) { + $this->cachedReport = (new Builder($this->analyser()))->build($this); + } + + return $this->cachedReport; } /** @@ -135,9 +144,10 @@ public function getReport(): Directory */ public function clear(): void { - $this->currentId = null; - $this->data = new ProcessedCodeCoverageData; - $this->tests = []; + $this->currentId = null; + $this->data = new ProcessedCodeCoverageData; + $this->tests = []; + $this->cachedReport = null; } /** @@ -202,6 +212,8 @@ public function start($id, bool $clear = false): void $this->currentId = $id; $this->driver->start(); + + $this->cachedReport = null; } /** @@ -220,7 +232,8 @@ public function stop(bool $append = true, $linesToBeCovered = [], array $linesTo $data = $this->driver->stop(); $this->append($data, null, $append, $linesToBeCovered, $linesToBeUsed); - $this->currentId = null; + $this->currentId = null; + $this->cachedReport = null; return $data; } @@ -245,6 +258,8 @@ public function append(RawCodeCoverageData $rawData, $id = null, bool $append = throw new TestIdMissingException; } + $this->cachedReport = null; + $this->applyFilter($rawData); $this->applyExecutableLinesFilter($rawData); @@ -312,6 +327,8 @@ public function merge(self $that): void $this->data->merge($that->data); $this->tests = array_merge($this->tests, $that->getTests()); + + $this->cachedReport = null; } public function enableCheckForUnintentionallyCoveredCode(): void @@ -673,7 +690,9 @@ private function analyser(): FileAnalyser if ($this->cachesStaticAnalysis()) { $this->analyser = new CachingFileAnalyser( $this->cacheDirectory, - $this->analyser + $this->analyser, + $this->useAnnotationsForIgnoringCode, + $this->ignoreDeprecatedCode ); } diff --git a/app/vendor/phpunit/php-code-coverage/src/Report/Clover.php b/app/vendor/phpunit/php-code-coverage/src/Report/Clover.php index 75c731bbe..d80ab4dee 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Report/Clover.php +++ b/app/vendor/phpunit/php-code-coverage/src/Report/Clover.php @@ -16,6 +16,7 @@ use function ksort; use function max; use function range; +use function strpos; use function time; use DOMDocument; use SebastianBergmann\CodeCoverage\CodeCoverage; @@ -243,7 +244,9 @@ public function process(CodeCoverage $coverage, ?string $target = null, ?string $buffer = $xmlDocument->saveXML(); if ($target !== null) { - Filesystem::createDirectory(dirname($target)); + if (!strpos($target, '://') !== false) { + Filesystem::createDirectory(dirname($target)); + } if (@file_put_contents($target, $buffer) === false) { throw new WriteOperationFailedException($target); diff --git a/app/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php b/app/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php index 0d1dde760..ead31b466 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php +++ b/app/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php @@ -16,6 +16,7 @@ use function preg_match; use function range; use function str_replace; +use function strpos; use function time; use DOMImplementation; use SebastianBergmann\CodeCoverage\CodeCoverage; @@ -294,7 +295,9 @@ public function process(CodeCoverage $coverage, ?string $target = null): string $buffer = $document->saveXML(); if ($target !== null) { - Filesystem::createDirectory(dirname($target)); + if (!strpos($target, '://') !== false) { + Filesystem::createDirectory(dirname($target)); + } if (@file_put_contents($target, $buffer) === false) { throw new WriteOperationFailedException($target); diff --git a/app/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php b/app/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php index 91f8ed59d..2d91567a0 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php +++ b/app/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php @@ -15,6 +15,7 @@ use function htmlspecialchars; use function is_string; use function round; +use function strpos; use DOMDocument; use SebastianBergmann\CodeCoverage\CodeCoverage; use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; @@ -124,7 +125,9 @@ public function process(CodeCoverage $coverage, ?string $target = null, ?string $buffer = $document->saveXML(); if ($target !== null) { - Filesystem::createDirectory(dirname($target)); + if (!strpos($target, '://') !== false) { + Filesystem::createDirectory(dirname($target)); + } if (@file_put_contents($target, $buffer) === false) { throw new WriteOperationFailedException($target); diff --git a/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php b/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php index 6672a6ea1..b44870b53 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php +++ b/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php @@ -117,7 +117,7 @@ private function complexity(array $classes, string $baseLink): array private function coverageDistribution(array $classes): array { $result = [ - 'class' => [ + 'class' => [ '0%' => 0, '0-10%' => 0, '10-20%' => 0, diff --git a/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php b/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php index 69fd8b1da..b59dc89d3 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php +++ b/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php @@ -134,7 +134,7 @@ public function render(FileNode $node, string $file): void [ 'items' => $this->renderItems($node), 'lines' => $this->renderSourceWithLineCoverage($node), - 'legend' => '

ExecutedNot ExecutedDead Code

', + 'legend' => '

Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable

', 'structure' => '', ] ); @@ -284,19 +284,19 @@ private function renderTraitOrClassItems(array $items, Template $template, Templ $buffer .= $this->renderItemTemplate( $template, [ - 'name' => $this->abbreviateClassName($name), - 'numClasses' => $numClasses, - 'numTestedClasses' => $numTestedClasses, - 'numMethods' => $numMethods, - 'numTestedMethods' => $numTestedMethods, - 'linesExecutedPercent' => Percentage::fromFractionAndTotal( + 'name' => $this->abbreviateClassName($name), + 'numClasses' => $numClasses, + 'numTestedClasses' => $numTestedClasses, + 'numMethods' => $numMethods, + 'numTestedMethods' => $numTestedMethods, + 'linesExecutedPercent' => Percentage::fromFractionAndTotal( $item['executedLines'], $item['executableLines'], )->asFloat(), - 'linesExecutedPercentAsString' => $linesExecutedPercentAsString, - 'numExecutedLines' => $item['executedLines'], - 'numExecutableLines' => $item['executableLines'], - 'branchesExecutedPercent' => Percentage::fromFractionAndTotal( + 'linesExecutedPercentAsString' => $linesExecutedPercentAsString, + 'numExecutedLines' => $item['executedLines'], + 'numExecutableLines' => $item['executableLines'], + 'branchesExecutedPercent' => Percentage::fromFractionAndTotal( $item['executedBranches'], $item['executableBranches'], )->asFloat(), @@ -307,14 +307,14 @@ private function renderTraitOrClassItems(array $items, Template $template, Templ $item['executedPaths'], $item['executablePaths'] )->asFloat(), - 'pathsExecutedPercentAsString' => $pathsExecutedPercentAsString, - 'numExecutedPaths' => $item['executedPaths'], - 'numExecutablePaths' => $item['executablePaths'], - 'testedMethodsPercent' => $testedMethodsPercentage->asFloat(), - 'testedMethodsPercentAsString' => $testedMethodsPercentage->asString(), - 'testedClassesPercent' => $testedClassesPercentage->asFloat(), - 'testedClassesPercentAsString' => $testedClassesPercentage->asString(), - 'crap' => $item['crap'], + 'pathsExecutedPercentAsString' => $pathsExecutedPercentAsString, + 'numExecutedPaths' => $item['executedPaths'], + 'numExecutablePaths' => $item['executablePaths'], + 'testedMethodsPercent' => $testedMethodsPercentage->asFloat(), + 'testedMethodsPercentAsString' => $testedMethodsPercentage->asString(), + 'testedClassesPercent' => $testedClassesPercentage->asFloat(), + 'testedClassesPercentAsString' => $testedClassesPercentage->asString(), + 'crap' => $item['crap'], ] ); @@ -384,7 +384,7 @@ private function renderFunctionOrMethodItem(Template $template, array $item, str return $this->renderItemTemplate( $template, [ - 'name' => sprintf( + 'name' => sprintf( '%s%s', $indent, $item['startLine'], diff --git a/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css b/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css index 5dc62ccf3..526cac0de 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css +++ b/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css @@ -128,3 +128,31 @@ table + .structure-heading { border-top: 1px solid lightgrey; padding-top: 0.5em; } + +.legend { + font-weight: bold; + margin-right: 2px; + padding-left: 10px; + padding-right: 10px; + text-align: center; +} + +.covered-by-small-tests { + background-color: #99cb84; +} + +.covered-by-medium-tests { + background-color: #c3e3b5; +} + +.covered-by-large-tests { + background-color: #dff0d8; +} + +.not-covered { + background-color: #f2dede; +} + +.not-coverable { + background-color: #fcf8e3; +} diff --git a/app/vendor/phpunit/php-code-coverage/src/Report/PHP.php b/app/vendor/phpunit/php-code-coverage/src/Report/PHP.php index ccb104ce5..2058fb39a 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Report/PHP.php +++ b/app/vendor/phpunit/php-code-coverage/src/Report/PHP.php @@ -12,6 +12,7 @@ use function dirname; use function file_put_contents; use function serialize; +use function strpos; use SebastianBergmann\CodeCoverage\CodeCoverage; use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; use SebastianBergmann\CodeCoverage\Util\Filesystem; @@ -24,7 +25,9 @@ public function process(CodeCoverage $coverage, ?string $target = null): string return \unserialize(<<<'END_OF_COVERAGE_SERIALIZATION'" . PHP_EOL . serialize($coverage) . PHP_EOL . 'END_OF_COVERAGE_SERIALIZATION' . PHP_EOL . ');'; if ($target !== null) { - Filesystem::createDirectory(dirname($target)); + if (!strpos($target, '://') !== false) { + Filesystem::createDirectory(dirname($target)); + } if (@file_put_contents($target, $buffer) === false) { throw new WriteOperationFailedException($target); diff --git a/app/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php b/app/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php index c2e56268c..c6da4145b 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php +++ b/app/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php @@ -17,7 +17,6 @@ final class Tests { private $contextNode; - private $codeMap = [ -1 => 'UNKNOWN', // PHPUnit_Runner_BaseTestRunner::STATUS_UNKNOWN 0 => 'PASSED', // PHPUnit_Runner_BaseTestRunner::STATUS_PASSED diff --git a/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php b/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php index 00a6d8df1..6f8a04494 100644 --- a/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php +++ b/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php @@ -20,7 +20,9 @@ public function warmCache(string $cacheDirectory, bool $useAnnotationsForIgnorin new ParsingFileAnalyser( $useAnnotationsForIgnoringCode, $ignoreDeprecatedCode - ) + ), + $useAnnotationsForIgnoringCode, + $ignoreDeprecatedCode, ); foreach ($filter->files() as $file) { diff --git a/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php b/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php index f53da078a..63e6e22ba 100644 --- a/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php +++ b/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php @@ -29,27 +29,39 @@ final class CachingFileAnalyser implements FileAnalyser */ private static $cacheVersion; + /** + * @var string + */ + private $directory; + /** * @var FileAnalyser */ private $analyser; /** - * @var array + * @var bool */ - private $cache = []; + private $useAnnotationsForIgnoringCode; /** - * @var string + * @var bool */ - private $directory; + private $ignoreDeprecatedCode; + + /** + * @var array + */ + private $cache = []; - public function __construct(string $directory, FileAnalyser $analyser) + public function __construct(string $directory, FileAnalyser $analyser, bool $useAnnotationsForIgnoringCode, bool $ignoreDeprecatedCode) { Filesystem::createDirectory($directory); - $this->analyser = $analyser; - $this->directory = $directory; + $this->analyser = $analyser; + $this->directory = $directory; + $this->useAnnotationsForIgnoringCode = $useAnnotationsForIgnoringCode; + $this->ignoreDeprecatedCode = $ignoreDeprecatedCode; } public function classesIn(string $filename): array @@ -161,7 +173,20 @@ private function write(string $filename, $data): void private function cacheFile(string $filename): string { - return $this->directory . DIRECTORY_SEPARATOR . md5($filename . "\0" . file_get_contents($filename) . "\0" . self::cacheVersion()); + $cacheKey = md5( + implode( + "\0", + [ + $filename, + file_get_contents($filename), + self::cacheVersion(), + $this->useAnnotationsForIgnoringCode, + $this->ignoreDeprecatedCode, + ] + ) + ); + + return $this->directory . DIRECTORY_SEPARATOR . $cacheKey; } private static function cacheVersion(): string diff --git a/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php b/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php index 8a2003fa8..cb85cd61e 100644 --- a/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php +++ b/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php @@ -26,6 +26,7 @@ use PhpParser\Node\Stmt\Interface_; use PhpParser\Node\Stmt\Trait_; use PhpParser\Node\UnionType; +use PhpParser\NodeAbstract; use PhpParser\NodeTraverser; use PhpParser\NodeVisitorAbstract; use SebastianBergmann\Complexity\CyclomaticComplexityCalculatingVisitor; @@ -180,8 +181,12 @@ private function type(Node $type): string return '?' . $type->type; } - if ($type instanceof UnionType || $type instanceof IntersectionType) { - return $this->unionOrIntersectionAsString($type); + if ($type instanceof UnionType) { + return $this->unionTypeAsString($type); + } + + if ($type instanceof IntersectionType) { + return $this->intersectionTypeAsString($type); } return $type->toString(); @@ -298,29 +303,43 @@ private function namespace(string $namespacedName, string $name): string return trim(rtrim($namespacedName, $name), '\\'); } - /** - * @psalm-param UnionType|IntersectionType $type - */ - private function unionOrIntersectionAsString(ComplexType $type): string + private function unionTypeAsString(UnionType $node): string { - if ($type instanceof UnionType) { - $separator = '|'; - } else { - $separator = '&'; + $types = []; + + foreach ($node->types as $type) { + if ($type instanceof IntersectionType) { + $types[] = '(' . $this->intersectionTypeAsString($type) . ')'; + + continue; + } + + $types[] = $this->typeAsString($type); } + return implode('|', $types); + } + + private function intersectionTypeAsString(IntersectionType $node): string + { $types = []; - foreach ($type->types as $_type) { - if ($_type instanceof Name) { - $types[] = $_type->toCodeString(); - } else { - assert($_type instanceof Identifier); + foreach ($node->types as $type) { + $types[] = $this->typeAsString($type); + } - $types[] = $_type->toString(); - } + return implode('&', $types); + } + + /** + * @psalm-param Identifier|Name $node $node + */ + private function typeAsString(NodeAbstract $node): string + { + if ($node instanceof Name) { + return $node->toCodeString(); } - return implode($separator, $types); + return $node->toString(); } } diff --git a/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php b/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php index 506f27524..eadff1cf0 100644 --- a/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php +++ b/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php @@ -88,12 +88,20 @@ public function enterNode(Node $node): void return; } + if ($node instanceof Node\Stmt\Interface_) { + foreach (range($node->getStartLine(), $node->getEndLine()) as $line) { + $this->unsets[$line] = true; + } + + return; + } + if ($node instanceof Node\Stmt\Declare_ || $node instanceof Node\Stmt\DeclareDeclare || $node instanceof Node\Stmt\Else_ || $node instanceof Node\Stmt\EnumCase || $node instanceof Node\Stmt\Finally_ || - $node instanceof Node\Stmt\Interface_ || + $node instanceof Node\Stmt\GroupUse || $node instanceof Node\Stmt\Label || $node instanceof Node\Stmt\Namespace_ || $node instanceof Node\Stmt\Nop || diff --git a/app/vendor/phpunit/php-code-coverage/src/Version.php b/app/vendor/phpunit/php-code-coverage/src/Version.php index 8d45b6c6d..3084a2c62 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Version.php +++ b/app/vendor/phpunit/php-code-coverage/src/Version.php @@ -22,7 +22,7 @@ final class Version public static function id(): string { if (self::$version === null) { - self::$version = (new VersionId('9.2.24', dirname(__DIR__)))->getVersion(); + self::$version = (new VersionId('9.2.27', dirname(__DIR__)))->getVersion(); } return self::$version; diff --git a/app/vendor/phpunit/phpunit/ChangeLog-8.5.md b/app/vendor/phpunit/phpunit/ChangeLog-8.5.md deleted file mode 100644 index 6485b8e53..000000000 --- a/app/vendor/phpunit/phpunit/ChangeLog-8.5.md +++ /dev/null @@ -1,297 +0,0 @@ -# Changes in PHPUnit 8.5 - -All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [8.5.32] - 2023-01-26 - -### Fixed - -* [#5120](https://github.com/sebastianbergmann/phpunit/issues/5120): Test Runner incorrectly treats `--testsuite` and `--list-tests` as not combinable options - -## [8.5.31] - 2022-10-28 - -### Fixed - -* [#5076](https://github.com/sebastianbergmann/phpunit/issues/5076): Test Runner does not warn about conflicting options - -## [8.5.30] - 2022-09-25 - -### Changed - -* The configuration generator now asks for a cache directory - -### Fixed - -* [#4913](https://github.com/sebastianbergmann/phpunit/issues/4913): Failed `assert()` should show a backtrace -* [#4966](https://github.com/sebastianbergmann/phpunit/issues/4966): `TestCase::assertSame()` (and related exact comparisons) must compare `float` exactly - -## [8.5.29] - 2022-08-22 - -### Changed - -* [#5033](https://github.com/sebastianbergmann/phpunit/issues/5033): Do not depend on phpspec/prophecy - -## [8.5.28] - 2022-07-29 - -### Fixed - -* [#5015](https://github.com/sebastianbergmann/phpunit/pull/5015): Ukraine banner unreadable on black background -* [#5016](https://github.com/sebastianbergmann/phpunit/issues/5016): PHPUnit 8.5.27 does not work on PHP 7.2.0-7.2.18 and PHP 7.3.0-7.3.5 - -## [8.5.27] - 2022-06-19 - -### Fixed - -* [#4950](https://github.com/sebastianbergmann/phpunit/issues/4950): False error on `atMost()` invocation rule without call -* [#4962](https://github.com/sebastianbergmann/phpunit/issues/4962): Ukraine banner unreadable on white background - -## [8.5.26] - 2022-04-01 - -### Fixed - -* [#4938](https://github.com/sebastianbergmann/phpunit/issues/4938): Test Double code generator does not handle `void` return type declaration on `__clone()` methods - -## [8.5.25] - 2022-03-16 - -### Fixed - -* [#4934](https://github.com/sebastianbergmann/phpunit/issues/4934): Code Coverage does not work with PHPUnit 8.5.24 PHAR on PHP 7 - -## [8.5.24] - 2022-03-05 - #StandWithUkraine - -### Changed - -* [#4874](https://github.com/sebastianbergmann/phpunit/pull/4874): `PHP_FLOAT_EPSILON` is now used instead of hardcoded `0.0000000001` in `PHPUnit\Framework\Constraint\IsIdentical` - -### Fixed - -* When the HTML code coverage report's configured low upper bound is larger than the high lower bound then the default values are used instead - -## [8.5.23] - 2022-01-21 - -### Fixed - -* [#4799](https://github.com/sebastianbergmann/phpunit/pull/4799): Memory leaks in `PHPUnit\Framework\TestSuite` class -* [#4857](https://github.com/sebastianbergmann/phpunit/pull/4857): Result of `debug_backtrace()` is not used correctly - -## [8.5.22] - 2021-12-25 - -### Changed - -* [#4812](https://github.com/sebastianbergmann/phpunit/issues/4812): Do not enforce time limits when a debugging session through DBGp is active -* [#4835](https://github.com/sebastianbergmann/phpunit/issues/4835): Support for `$GLOBALS['_composer_autoload_path']` introduced in Composer 2.2 - -### Fixed - -* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics -* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored - -## [8.5.21] - 2021-09-25 - -### Changed - -* PHPUnit no longer converts PHP deprecations to exceptions by default (configure `convertDeprecationsToExceptions="true"` to enable this) -* The PHPUnit XML configuration file generator now configures `convertDeprecationsToExceptions="true"` - -### Fixed - -* [#4772](https://github.com/sebastianbergmann/phpunit/pull/4772): TestDox HTML report not displayed correctly when browser has custom colour settings - -## [8.5.20] - 2021-08-31 - -### Fixed - -* [#4751](https://github.com/sebastianbergmann/phpunit/issues/4751): Configuration validation fails when using brackets in glob pattern - -## [8.5.19] - 2021-07-31 - -### Fixed - -* [#4740](https://github.com/sebastianbergmann/phpunit/issues/4740): `phpunit.phar` does not work with PHP 8.1 - -## [8.5.18] - 2021-07-19 - -### Fixed - -* [#4720](https://github.com/sebastianbergmann/phpunit/issues/4720): PHPUnit does not verify its own PHP extension requirements - -## [8.5.17] - 2021-06-23 - -### Changed - -* PHPUnit now errors out on startup when `PHP_VERSION` contains a value that is not compatible with `version_compare()`, for instance `X.Y.Z-(to be removed in future macOS)` - -## [8.5.16] - 2021-06-05 - -### Changed - -* The test result cache (the storage for which is implemented in `PHPUnit\Runner\DefaultTestResultCache`) no longer uses PHP's `serialize()` and `unserialize()` functions for persistence. It now uses a versioned JSON format instead that is independent of PHP implementation details (see [#3581](https://github.com/sebastianbergmann/phpunit/issues/3581) and [#4662](https://github.com/sebastianbergmann/phpunit/pull/4662) for examples why this is a problem). When PHPUnit tries to load the test result cache from a file that does not exist, or from a file that does not contain data in JSON format, or from a file that contains data in a JSON format version other than the one used by the currently running PHPUnit version, then this is considered to be a "cache miss". An empty `DefaultTestResultCache` object is created in this case. This should also prevent PHPUnit from crashing when trying to load a test result cache file created by a different version of PHPUnit (see [#4580](https://github.com/sebastianbergmann/phpunit/issues/4580) for example). - -### Fixed - -* [#4663](https://github.com/sebastianbergmann/phpunit/issues/4663): `TestCase::expectError()` works on PHP 7.3, but not on PHP >= 7.4 -* [#4678](https://github.com/sebastianbergmann/phpunit/pull/4678): Stubbed methods with `iterable` return types should return empty array by default -* [#4692](https://github.com/sebastianbergmann/phpunit/issues/4692): Annotations in single-line doc-comments are not handled correctly -* [#4694](https://github.com/sebastianbergmann/phpunit/issues/4694): `TestCase::getMockFromWsdl()` does not work with PHP 8.1-dev - -## [8.5.15] - 2021-03-17 - -### Fixed - -* [#4591](https://github.com/sebastianbergmann/phpunit/issues/4591): TeamCity logger logs warnings as test failures - -## [8.5.14] - 2021-01-17 - -### Fixed - -* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly -* [#4572](https://github.com/sebastianbergmann/phpunit/issues/4572): Schema validation does not work with `%xx` sequences in path to `phpunit.xsd` -* [#4575](https://github.com/sebastianbergmann/phpunit/issues/4575): PHPUnit 8.5 incompatibility with PHP 8.1 - -## [8.5.13] - 2020-12-01 - -### Fixed - -* Running tests in isolated processes did not work with PHP 8 on Windows - -## [8.5.12] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` to allow the installation of PHPUnit 8.5 on PHP 8. Please note that the code coverage functionality is not available for PHPUnit 8.5 on PHP 8. - -### Fixed - -* [#4529](https://github.com/sebastianbergmann/phpunit/issues/4529): Debug mode of Xdebug 2 is not disabled for PHPT tests - -## [8.5.11] - 2020-11-27 - -### Changed - -* Bumped required version of `phpunit/php-code-coverage` - -## [8.5.10] - 2020-11-27 - -### Added - -* Support for Xdebug 3 - -### Fixed - -* [#4516](https://github.com/sebastianbergmann/phpunit/issues/4516): `phpunit/phpunit-selenium` does not work with PHPUnit 8.5.9 - -## [8.5.9] - 2020-11-10 - -### Fixed - -* [#3965](https://github.com/sebastianbergmann/phpunit/issues/3965): Process Isolation throws exceptions when PHPDBG is used -* [#4470](https://github.com/sebastianbergmann/phpunit/pull/4470): Infinite recursion when `--static-backup --strict-global-state` is used - -## [8.5.8] - 2020-06-22 - -### Fixed - -* [#4312](https://github.com/sebastianbergmann/phpunit/issues/4312): Fix for [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299) breaks backward compatibility - -## [8.5.7] - 2020-06-21 - -### Fixed - -* [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299): "No tests executed" does not always result in exit code `1` -* [#4306](https://github.com/sebastianbergmann/phpunit/issues/4306): Exceptions during code coverage driver initialization are not handled correctly - -## [8.5.6] - 2020-06-15 - -### Fixed - -* [#4211](https://github.com/sebastianbergmann/phpunit/issues/4211): `phpdbg_*()` functions are scoped to `PHPUnit\phpdbg_*()` - -## [8.5.5] - 2020-05-22 - -### Fixed - -* [#4033](https://github.com/sebastianbergmann/phpunit/issues/4033): Unexpected behaviour when `$GLOBALS` is deleted - -## [8.5.4] - 2020-04-23 - -### Changed - -* Changed how `PHPUnit\TextUI\Command` passes warnings to `PHPUnit\TextUI\TestRunner` - -## [8.5.3] - 2020-03-31 - -### Fixed - -* [#4017](https://github.com/sebastianbergmann/phpunit/issues/4017): Do not suggest refactoring to something that is also deprecated -* [#4133](https://github.com/sebastianbergmann/phpunit/issues/4133): `expectExceptionMessageRegExp()` has been removed in PHPUnit 9 without a deprecation warning being given in PHPUnit 8 -* [#4139](https://github.com/sebastianbergmann/phpunit/issues/4139): Cannot double interfaces that declare a constructor with PHP 8 -* [#4144](https://github.com/sebastianbergmann/phpunit/issues/4144): Empty objects are converted to empty arrays in JSON comparison failure diff - -## [8.5.2] - 2020-01-08 - -### Removed - -* `eval-stdin.php` has been removed, it was not used anymore since PHPUnit 7.2.7 - -## [8.5.1] - 2019-12-25 - -### Changed - -* `eval-stdin.php` can now only be executed with `cli` and `phpdbg` - -### Fixed - -* [#3983](https://github.com/sebastianbergmann/phpunit/issues/3983): Deprecation warning given too eagerly - -## [8.5.0] - 2019-12-06 - -### Added - -* [#3911](https://github.com/sebastianbergmann/phpunit/issues/3911): Support combined use of `addMethods()` and `onlyMethods()` -* [#3949](https://github.com/sebastianbergmann/phpunit/issues/3949): Introduce specialized assertions `assertFileEqualsCanonicalizing()`, `assertFileEqualsIgnoringCase()`, `assertStringEqualsFileCanonicalizing()`, `assertStringEqualsFileIgnoringCase()`, `assertFileNotEqualsCanonicalizing()`, `assertFileNotEqualsIgnoringCase()`, `assertStringNotEqualsFileCanonicalizing()`, and `assertStringNotEqualsFileIgnoringCase()` as alternative to using `assertFileEquals()` etc. with optional parameters - -### Changed - -* [#3860](https://github.com/sebastianbergmann/phpunit/pull/3860): Deprecate invoking PHPUnit commandline test runner with just a class name -* [#3950](https://github.com/sebastianbergmann/phpunit/issues/3950): Deprecate optional parameters of `assertFileEquals()` etc. -* [#3955](https://github.com/sebastianbergmann/phpunit/issues/3955): Deprecate support for doubling multiple interfaces - -### Fixed - -* [#3953](https://github.com/sebastianbergmann/phpunit/issues/3953): Code Coverage for test executed in isolation does not work when the PHAR is used -* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable` -* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside - -[8.5.32]: https://github.com/sebastianbergmann/phpunit/compare/8.5.31...8.5.32 -[8.5.31]: https://github.com/sebastianbergmann/phpunit/compare/8.5.30...8.5.31 -[8.5.30]: https://github.com/sebastianbergmann/phpunit/compare/8.5.29...8.5.30 -[8.5.29]: https://github.com/sebastianbergmann/phpunit/compare/8.5.28...8.5.29 -[8.5.28]: https://github.com/sebastianbergmann/phpunit/compare/8.5.27...8.5.28 -[8.5.27]: https://github.com/sebastianbergmann/phpunit/compare/8.5.26...8.5.27 -[8.5.26]: https://github.com/sebastianbergmann/phpunit/compare/8.5.25...8.5.26 -[8.5.25]: https://github.com/sebastianbergmann/phpunit/compare/8.5.24...8.5.25 -[8.5.24]: https://github.com/sebastianbergmann/phpunit/compare/8.5.23...8.5.24 -[8.5.23]: https://github.com/sebastianbergmann/phpunit/compare/8.5.22...8.5.23 -[8.5.22]: https://github.com/sebastianbergmann/phpunit/compare/8.5.21...8.5.22 -[8.5.21]: https://github.com/sebastianbergmann/phpunit/compare/8.5.20...8.5.21 -[8.5.20]: https://github.com/sebastianbergmann/phpunit/compare/8.5.19...8.5.20 -[8.5.19]: https://github.com/sebastianbergmann/phpunit/compare/8.5.18...8.5.19 -[8.5.18]: https://github.com/sebastianbergmann/phpunit/compare/8.5.17...8.5.18 -[8.5.17]: https://github.com/sebastianbergmann/phpunit/compare/8.5.16...8.5.17 -[8.5.16]: https://github.com/sebastianbergmann/phpunit/compare/8.5.15...8.5.16 -[8.5.15]: https://github.com/sebastianbergmann/phpunit/compare/8.5.14...8.5.15 -[8.5.14]: https://github.com/sebastianbergmann/phpunit/compare/8.5.13...8.5.14 -[8.5.13]: https://github.com/sebastianbergmann/phpunit/compare/8.5.12...8.5.13 -[8.5.12]: https://github.com/sebastianbergmann/phpunit/compare/8.5.11...8.5.12 -[8.5.11]: https://github.com/sebastianbergmann/phpunit/compare/8.5.10...8.5.11 -[8.5.10]: https://github.com/sebastianbergmann/phpunit/compare/8.5.9...8.5.10 -[8.5.9]: https://github.com/sebastianbergmann/phpunit/compare/8.5.8...8.5.9 -[8.5.8]: https://github.com/sebastianbergmann/phpunit/compare/8.5.7...8.5.8 -[8.5.7]: https://github.com/sebastianbergmann/phpunit/compare/8.5.6...8.5.7 -[8.5.6]: https://github.com/sebastianbergmann/phpunit/compare/8.5.5...8.5.6 -[8.5.5]: https://github.com/sebastianbergmann/phpunit/compare/8.5.4...8.5.5 -[8.5.4]: https://github.com/sebastianbergmann/phpunit/compare/8.5.3...8.5.4 -[8.5.3]: https://github.com/sebastianbergmann/phpunit/compare/8.5.2...8.5.3 -[8.5.2]: https://github.com/sebastianbergmann/phpunit/compare/8.5.1...8.5.2 -[8.5.1]: https://github.com/sebastianbergmann/phpunit/compare/8.5.0...8.5.1 -[8.5.0]: https://github.com/sebastianbergmann/phpunit/compare/8.4.3...8.5.0 diff --git a/app/vendor/phpunit/phpunit/ChangeLog-9.6.md b/app/vendor/phpunit/phpunit/ChangeLog-9.6.md index 2491e3034..8e2313b3f 100644 --- a/app/vendor/phpunit/phpunit/ChangeLog-9.6.md +++ b/app/vendor/phpunit/phpunit/ChangeLog-9.6.md @@ -2,6 +2,53 @@ All notable changes of the PHPUnit 9.6 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [9.6.10] - 2023-07-10 + +### Changed + +* [#5419](https://github.com/sebastianbergmann/phpunit/pull/5419): Allow empty `` element in XML configuration + +## [9.6.9] - 2023-06-11 + +### Fixed + +* [#5405](https://github.com/sebastianbergmann/phpunit/issues/5405): XML configuration migration does not migrate `whitelist/file` elements +* Always use `X.Y.Z` version number (and not just `X.Y`) of PHPUnit's version when checking whether a PHAR-distributed extension is compatible + +## [9.6.8] - 2023-05-11 + +### Fixed + +* [#5345](https://github.com/sebastianbergmann/phpunit/issues/5345): No stack trace shown for previous exceptions during bootstrap + +## [9.6.7] - 2023-04-14 + +### Fixed + +* Tests that have `@doesNotPerformAssertions` do not contribute to code coverage + +## [9.6.6] - 2023-03-27 + +### Fixed + +* [#5270](https://github.com/sebastianbergmann/phpunit/issues/5270): `GlobalState::getIniSettingsAsString()` generates code that triggers warnings + +## [9.6.5] - 2023-03-09 + +### Changed + +* Backported the HTML and CSS improvements made to the `--testdox-html` from PHPUnit 10 + +### Fixed + +* [#5205](https://github.com/sebastianbergmann/phpunit/issues/5205): Wrong default value for optional parameter of `PHPUnit\Util\Test::parseTestMethodAnnotations()` causes `ReflectionException` + +## [9.6.4] - 2023-02-27 + +### Fixed + +* [#5186](https://github.com/sebastianbergmann/phpunit/issues/5186): SBOM does not validate + ## [9.6.3] - 2023-02-04 ### Fixed @@ -19,7 +66,7 @@ All notable changes of the PHPUnit 9.6 release series are documented in this fil ### Fixed * [#5073](https://github.com/sebastianbergmann/phpunit/issues/5073): `--no-extensions` CLI option only prevents extension PHARs from being loaded -* [#5160](https://github.com/sebastianbergmann/phpunit/issues/5160): PHPUnit 9.6 misses deprecations for assertions and constraints removed in PHPUnit 10 +* [#5160](https://github.com/sebastianbergmann/phpunit/issues/5160): Deprecate `assertClassHasAttribute()`, `assertClassNotHasAttribute()`, `assertClassHasStaticAttribute()`, `assertClassNotHasStaticAttribute()`, `assertObjectHasAttribute()`, `assertObjectNotHasAttribute()`, `classHasAttribute()`, `classHasStaticAttribute()`, and `objectHasAttribute()` ## [9.6.0] - 2023-02-03 @@ -30,6 +77,13 @@ All notable changes of the PHPUnit 9.6 release series are documented in this fil * [#5064](https://github.com/sebastianbergmann/phpunit/issues/5064): Deprecate `PHPUnit\Framework\TestCase::getMockClass()` * [#5132](https://github.com/sebastianbergmann/phpunit/issues/5132): Deprecate `Test` suffix for abstract test case classes +[9.6.10]: https://github.com/sebastianbergmann/phpunit/compare/9.6.9...9.6.10 +[9.6.9]: https://github.com/sebastianbergmann/phpunit/compare/9.6.8...9.6.9 +[9.6.8]: https://github.com/sebastianbergmann/phpunit/compare/9.6.7...9.6.8 +[9.6.7]: https://github.com/sebastianbergmann/phpunit/compare/9.6.6...9.6.7 +[9.6.6]: https://github.com/sebastianbergmann/phpunit/compare/9.6.5...9.6.6 +[9.6.5]: https://github.com/sebastianbergmann/phpunit/compare/9.6.4...9.6.5 +[9.6.4]: https://github.com/sebastianbergmann/phpunit/compare/9.6.3...9.6.4 [9.6.3]: https://github.com/sebastianbergmann/phpunit/compare/9.6.2...9.6.3 [9.6.2]: https://github.com/sebastianbergmann/phpunit/compare/9.6.1...9.6.2 [9.6.1]: https://github.com/sebastianbergmann/phpunit/compare/9.6.0...9.6.1 diff --git a/app/vendor/phpunit/phpunit/README.md b/app/vendor/phpunit/phpunit/README.md index ffc8bf323..c561c5942 100644 --- a/app/vendor/phpunit/phpunit/README.md +++ b/app/vendor/phpunit/phpunit/README.md @@ -25,7 +25,7 @@ Alternatively, you may use [Composer](https://getcomposer.org/) to download and ## Contribute -Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/.github/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects. +Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/main/.github/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects. ## List of Contributors diff --git a/app/vendor/phpunit/phpunit/SECURITY.md b/app/vendor/phpunit/phpunit/SECURITY.md index dcc153859..965e5ed2d 100644 --- a/app/vendor/phpunit/phpunit/SECURITY.md +++ b/app/vendor/phpunit/phpunit/SECURITY.md @@ -1,11 +1,33 @@ # Security Policy -PHPUnit is a framework for writing as well as a commandline tool for running tests. Writing and running tests is a development-time activity. There is no reason why PHPUnit should be installed on a webserver. +If you believe you have found a security vulnerability in PHPUnit, please report it to us through coordinated disclosure. + +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** + +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +PHPUnit is a framework for writing as well as a command-line tool for running tests. Writing and running tests is a development-time activity. There is no reason why PHPUnit should be installed on a webserver and/or in a production environment. **If you upload PHPUnit to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** Please note that if you upload PHPUnit to a webserver "bad things" may happen. [You have been warned.](https://thephp.cc/articles/phpunit-a-security-risk) -## Security Contact Information +PHPUnit is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using PHPUnit in an HTTP or web context or with untrusted input data is performed. PHPUnit might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If PHPUnit is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. diff --git a/app/vendor/phpunit/phpunit/composer.json b/app/vendor/phpunit/phpunit/composer.json index 38117ea1e..28411d9b9 100644 --- a/app/vendor/phpunit/phpunit/composer.json +++ b/app/vendor/phpunit/phpunit/composer.json @@ -17,7 +17,8 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues" + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy" }, "prefer-stable": true, "require": { @@ -57,8 +58,8 @@ "sort-packages": true }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" diff --git a/app/vendor/phpunit/phpunit/phpunit b/app/vendor/phpunit/phpunit/phpunit index c80295668..b9f5cf29d 100755 --- a/app/vendor/phpunit/phpunit/phpunit +++ b/app/vendor/phpunit/phpunit/phpunit @@ -38,22 +38,31 @@ if (version_compare('7.3.0', PHP_VERSION, '>')) { die(1); } -foreach (['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'] as $extension) { - if (extension_loaded($extension)) { - continue; +$requiredExtensions = ['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter']; + +$unavailableExtensions = array_filter( + $requiredExtensions, + static function ($extension) { + return !extension_loaded($extension); } +); +if ([] !== $unavailableExtensions) { fwrite( STDERR, sprintf( - 'PHPUnit requires the "%s" extension.' . PHP_EOL, - $extension + 'PHPUnit requires the "%s" extensions, but the "%s" %s not available.' . PHP_EOL, + implode('", "', $requiredExtensions), + implode('", "', $unavailableExtensions), + count($unavailableExtensions) === 1 ? 'extension is' : 'extensions are' ) ); die(1); } +unset($requiredExtensions, $unavailableExtensions); + if (!ini_get('date.timezone')) { ini_set('date.timezone', 'UTC'); } diff --git a/app/vendor/phpunit/phpunit/phpunit.xsd b/app/vendor/phpunit/phpunit/phpunit.xsd index 7fa2f6b67..619434ef8 100644 --- a/app/vendor/phpunit/phpunit/phpunit.xsd +++ b/app/vendor/phpunit/phpunit/phpunit.xsd @@ -57,7 +57,7 @@ - + diff --git a/app/vendor/phpunit/phpunit/src/Framework/Assert.php b/app/vendor/phpunit/phpunit/src/Framework/Assert.php index 156220a51..c86a79a5d 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Assert.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Assert.php @@ -111,14 +111,14 @@ public static function assertArrayHasKey($key, $array, string $message = ''): vo if (!(is_int($key) || is_string($key))) { throw InvalidArgumentException::create( 1, - 'integer or string' + 'integer or string', ); } if (!(is_array($array) || $array instanceof ArrayAccess)) { throw InvalidArgumentException::create( 2, - 'array or ArrayAccess' + 'array or ArrayAccess', ); } @@ -142,19 +142,19 @@ public static function assertArrayNotHasKey($key, $array, string $message = ''): if (!(is_int($key) || is_string($key))) { throw InvalidArgumentException::create( 1, - 'integer or string' + 'integer or string', ); } if (!(is_array($array) || $array instanceof ArrayAccess)) { throw InvalidArgumentException::create( 2, - 'array or ArrayAccess' + 'array or ArrayAccess', ); } $constraint = new LogicalNot( - new ArrayHasKey($key) + new ArrayHasKey($key), ); static::assertThat($array, $constraint, $message); @@ -191,7 +191,7 @@ public static function assertContainsEquals($needle, iterable $haystack, string public static function assertNotContains($needle, iterable $haystack, string $message = ''): void { $constraint = new LogicalNot( - new TraversableContainsIdentical($needle) + new TraversableContainsIdentical($needle), ); static::assertThat($haystack, $constraint, $message); @@ -220,9 +220,9 @@ public static function assertContainsOnly(string $type, iterable $haystack, ?boo $haystack, new TraversableContainsOnly( $type, - $isNativeType + $isNativeType, ), - $message + $message, ); } @@ -238,9 +238,9 @@ public static function assertContainsOnlyInstancesOf(string $className, iterable $haystack, new TraversableContainsOnly( $className, - false + false, ), - $message + $message, ); } @@ -261,10 +261,10 @@ public static function assertNotContainsOnly(string $type, iterable $haystack, ? new LogicalNot( new TraversableContainsOnly( $type, - $isNativeType - ) + $isNativeType, + ), ), - $message + $message, ); } @@ -290,7 +290,7 @@ public static function assertCount(int $expectedCount, $haystack, string $messag static::assertThat( $haystack, new Count($expectedCount), - $message + $message, ); } @@ -314,7 +314,7 @@ public static function assertNotCount(int $expectedCount, $haystack, string $mes } $constraint = new LogicalNot( - new Count($expectedCount) + new Count($expectedCount), ); static::assertThat($haystack, $constraint, $message); @@ -369,7 +369,7 @@ public static function assertEqualsWithDelta($expected, $actual, float $delta, s { $constraint = new IsEqualWithDelta( $expected, - $delta + $delta, ); static::assertThat($actual, $constraint, $message); @@ -384,7 +384,7 @@ public static function assertEqualsWithDelta($expected, $actual, float $delta, s public static function assertNotEquals($expected, $actual, string $message = ''): void { $constraint = new LogicalNot( - new IsEqual($expected) + new IsEqual($expected), ); static::assertThat($actual, $constraint, $message); @@ -399,7 +399,7 @@ public static function assertNotEquals($expected, $actual, string $message = '') public static function assertNotEqualsCanonicalizing($expected, $actual, string $message = ''): void { $constraint = new LogicalNot( - new IsEqualCanonicalizing($expected) + new IsEqualCanonicalizing($expected), ); static::assertThat($actual, $constraint, $message); @@ -414,7 +414,7 @@ public static function assertNotEqualsCanonicalizing($expected, $actual, string public static function assertNotEqualsIgnoringCase($expected, $actual, string $message = ''): void { $constraint = new LogicalNot( - new IsEqualIgnoringCase($expected) + new IsEqualIgnoringCase($expected), ); static::assertThat($actual, $constraint, $message); @@ -431,8 +431,8 @@ public static function assertNotEqualsWithDelta($expected, $actual, float $delta $constraint = new LogicalNot( new IsEqualWithDelta( $expected, - $delta - ) + $delta, + ), ); static::assertThat($actual, $constraint, $message); @@ -446,7 +446,7 @@ public static function assertObjectEquals(object $expected, object $actual, stri static::assertThat( $actual, static::objectEquals($expected, $method), - $message + $message, ); } @@ -506,7 +506,7 @@ public static function assertGreaterThanOrEqual($expected, $actual, string $mess static::assertThat( $actual, static::greaterThanOrEqual($expected), - $message + $message, ); } @@ -562,7 +562,7 @@ public static function assertFileEqualsCanonicalizing(string $expected, string $ static::assertFileExists($actual, $message); $constraint = new IsEqualCanonicalizing( - file_get_contents($expected) + file_get_contents($expected), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -598,7 +598,7 @@ public static function assertFileNotEquals(string $expected, string $actual, str static::assertFileExists($actual, $message); $constraint = new LogicalNot( - new IsEqual(file_get_contents($expected)) + new IsEqual(file_get_contents($expected)), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -617,7 +617,7 @@ public static function assertFileNotEqualsCanonicalizing(string $expected, strin static::assertFileExists($actual, $message); $constraint = new LogicalNot( - new IsEqualCanonicalizing(file_get_contents($expected)) + new IsEqualCanonicalizing(file_get_contents($expected)), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -636,7 +636,7 @@ public static function assertFileNotEqualsIgnoringCase(string $expected, string static::assertFileExists($actual, $message); $constraint = new LogicalNot( - new IsEqualIgnoringCase(file_get_contents($expected)) + new IsEqualIgnoringCase(file_get_contents($expected)), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -702,7 +702,7 @@ public static function assertStringNotEqualsFile(string $expectedFile, string $a static::assertFileExists($expectedFile, $message); $constraint = new LogicalNot( - new IsEqual(file_get_contents($expectedFile)) + new IsEqual(file_get_contents($expectedFile)), ); static::assertThat($actualString, $constraint, $message); @@ -720,7 +720,7 @@ public static function assertStringNotEqualsFileCanonicalizing(string $expectedF static::assertFileExists($expectedFile, $message); $constraint = new LogicalNot( - new IsEqualCanonicalizing(file_get_contents($expectedFile)) + new IsEqualCanonicalizing(file_get_contents($expectedFile)), ); static::assertThat($actualString, $constraint, $message); @@ -738,7 +738,7 @@ public static function assertStringNotEqualsFileIgnoringCase(string $expectedFil static::assertFileExists($expectedFile, $message); $constraint = new LogicalNot( - new IsEqualIgnoringCase(file_get_contents($expectedFile)) + new IsEqualIgnoringCase(file_get_contents($expectedFile)), ); static::assertThat($actualString, $constraint, $message); @@ -1227,9 +1227,9 @@ public static function assertClassNotHasAttribute(string $attributeName, string static::assertThat( $className, new LogicalNot( - new ClassHasAttribute($attributeName) + new ClassHasAttribute($attributeName), ), - $message + $message, ); } @@ -1257,7 +1257,7 @@ public static function assertClassHasStaticAttribute(string $attributeName, stri static::assertThat( $className, new ClassHasStaticAttribute($attributeName), - $message + $message, ); } @@ -1285,9 +1285,9 @@ public static function assertClassNotHasStaticAttribute(string $attributeName, s static::assertThat( $className, new LogicalNot( - new ClassHasStaticAttribute($attributeName) + new ClassHasStaticAttribute($attributeName), ), - $message + $message, ); } @@ -1304,7 +1304,7 @@ public static function assertClassNotHasStaticAttribute(string $attributeName, s */ public static function assertObjectHasAttribute(string $attributeName, $object, string $message = ''): void { - self::createWarning('assertObjectHasAttribute() is deprecated and will be removed in PHPUnit 10.'); + self::createWarning('assertObjectHasAttribute() is deprecated and will be removed in PHPUnit 10. Refactor your test to use assertObjectHasProperty() (PHPUnit 10.1.0+) instead.'); if (!self::isValidObjectAttributeName($attributeName)) { throw InvalidArgumentException::create(1, 'valid attribute name'); @@ -1317,7 +1317,7 @@ public static function assertObjectHasAttribute(string $attributeName, $object, static::assertThat( $object, new ObjectHasAttribute($attributeName), - $message + $message, ); } @@ -1334,7 +1334,7 @@ public static function assertObjectHasAttribute(string $attributeName, $object, */ public static function assertObjectNotHasAttribute(string $attributeName, $object, string $message = ''): void { - self::createWarning('assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit 10.'); + self::createWarning('assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit 10. Refactor your test to use assertObjectNotHasProperty() (PHPUnit 10.1.0+) instead.'); if (!self::isValidObjectAttributeName($attributeName)) { throw InvalidArgumentException::create(1, 'valid attribute name'); @@ -1347,9 +1347,9 @@ public static function assertObjectNotHasAttribute(string $attributeName, $objec static::assertThat( $object, new LogicalNot( - new ObjectHasAttribute($attributeName) + new ObjectHasAttribute($attributeName), ), - $message + $message, ); } @@ -1372,7 +1372,7 @@ public static function assertSame($expected, $actual, string $message = ''): voi static::assertThat( $actual, new IsIdentical($expected), - $message + $message, ); } @@ -1393,9 +1393,9 @@ public static function assertNotSame($expected, $actual, string $message = ''): static::assertThat( $actual, new LogicalNot( - new IsIdentical($expected) + new IsIdentical($expected), ), - $message + $message, ); } @@ -1421,7 +1421,7 @@ public static function assertInstanceOf(string $expected, $actual, string $messa static::assertThat( $actual, new IsInstanceOf($expected), - $message + $message, ); } @@ -1447,9 +1447,9 @@ public static function assertNotInstanceOf(string $expected, $actual, string $me static::assertThat( $actual, new LogicalNot( - new IsInstanceOf($expected) + new IsInstanceOf($expected), ), - $message + $message, ); } @@ -1466,7 +1466,7 @@ public static function assertIsArray($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_ARRAY), - $message + $message, ); } @@ -1483,7 +1483,7 @@ public static function assertIsBool($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_BOOL), - $message + $message, ); } @@ -1500,7 +1500,7 @@ public static function assertIsFloat($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_FLOAT), - $message + $message, ); } @@ -1517,7 +1517,7 @@ public static function assertIsInt($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_INT), - $message + $message, ); } @@ -1534,7 +1534,7 @@ public static function assertIsNumeric($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_NUMERIC), - $message + $message, ); } @@ -1551,7 +1551,7 @@ public static function assertIsObject($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_OBJECT), - $message + $message, ); } @@ -1568,7 +1568,7 @@ public static function assertIsResource($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_RESOURCE), - $message + $message, ); } @@ -1585,7 +1585,7 @@ public static function assertIsClosedResource($actual, string $message = ''): vo static::assertThat( $actual, new IsType(IsType::TYPE_CLOSED_RESOURCE), - $message + $message, ); } @@ -1602,7 +1602,7 @@ public static function assertIsString($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_STRING), - $message + $message, ); } @@ -1619,7 +1619,7 @@ public static function assertIsScalar($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_SCALAR), - $message + $message, ); } @@ -1636,7 +1636,7 @@ public static function assertIsCallable($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_CALLABLE), - $message + $message, ); } @@ -1653,7 +1653,7 @@ public static function assertIsIterable($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_ITERABLE), - $message + $message, ); } @@ -1670,7 +1670,7 @@ public static function assertIsNotArray($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_ARRAY)), - $message + $message, ); } @@ -1687,7 +1687,7 @@ public static function assertIsNotBool($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_BOOL)), - $message + $message, ); } @@ -1704,7 +1704,7 @@ public static function assertIsNotFloat($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_FLOAT)), - $message + $message, ); } @@ -1721,7 +1721,7 @@ public static function assertIsNotInt($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_INT)), - $message + $message, ); } @@ -1738,7 +1738,7 @@ public static function assertIsNotNumeric($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_NUMERIC)), - $message + $message, ); } @@ -1755,7 +1755,7 @@ public static function assertIsNotObject($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_OBJECT)), - $message + $message, ); } @@ -1772,7 +1772,7 @@ public static function assertIsNotResource($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_RESOURCE)), - $message + $message, ); } @@ -1789,7 +1789,7 @@ public static function assertIsNotClosedResource($actual, string $message = ''): static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_CLOSED_RESOURCE)), - $message + $message, ); } @@ -1806,7 +1806,7 @@ public static function assertIsNotString($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_STRING)), - $message + $message, ); } @@ -1823,7 +1823,7 @@ public static function assertIsNotScalar($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_SCALAR)), - $message + $message, ); } @@ -1840,7 +1840,7 @@ public static function assertIsNotCallable($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_CALLABLE)), - $message + $message, ); } @@ -1857,7 +1857,7 @@ public static function assertIsNotIterable($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_ITERABLE)), - $message + $message, ); } @@ -1900,9 +1900,9 @@ public static function assertDoesNotMatchRegularExpression(string $pattern, stri static::assertThat( $string, new LogicalNot( - new RegularExpression($pattern) + new RegularExpression($pattern), ), - $message + $message, ); } @@ -1923,9 +1923,9 @@ public static function assertNotRegExp(string $pattern, string $string, string $ static::assertThat( $string, new LogicalNot( - new RegularExpression($pattern) + new RegularExpression($pattern), ), - $message + $message, ); } @@ -1961,7 +1961,7 @@ public static function assertSameSize($expected, $actual, string $message = ''): static::assertThat( $actual, new SameSize($expected), - $message + $message, ); } @@ -1997,9 +1997,9 @@ public static function assertNotSameSize($expected, $actual, string $message = ' static::assertThat( $actual, new LogicalNot( - new SameSize($expected) + new SameSize($expected), ), - $message + $message, ); } @@ -2025,9 +2025,9 @@ public static function assertStringNotMatchesFormat(string $format, string $stri static::assertThat( $string, new LogicalNot( - new StringMatchesFormatDescription($format) + new StringMatchesFormatDescription($format), ), - $message + $message, ); } @@ -2044,9 +2044,9 @@ public static function assertStringMatchesFormatFile(string $formatFile, string static::assertThat( $string, new StringMatchesFormatDescription( - file_get_contents($formatFile) + file_get_contents($formatFile), ), - $message + $message, ); } @@ -2064,10 +2064,10 @@ public static function assertStringNotMatchesFormatFile(string $formatFile, stri $string, new LogicalNot( new StringMatchesFormatDescription( - file_get_contents($formatFile) - ) + file_get_contents($formatFile), + ), ), - $message + $message, ); } @@ -2096,9 +2096,9 @@ public static function assertStringStartsNotWith($prefix, $string, string $messa static::assertThat( $string, new LogicalNot( - new StringStartsWith($prefix) + new StringStartsWith($prefix), ), - $message + $message, ); } @@ -2168,9 +2168,9 @@ public static function assertStringEndsNotWith(string $suffix, string $string, s static::assertThat( $string, new LogicalNot( - new StringEndsWith($suffix) + new StringEndsWith($suffix), ), - $message + $message, ); } @@ -2335,7 +2335,7 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME static::assertSame( $expectedElement->tagName, $actualElement->tagName, - $message + $message, ); if ($checkAttributes) { @@ -2346,8 +2346,8 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME '%s%sNumber of attributes on node "%s" does not match', $message, !empty($message) ? "\n" : '', - $expectedElement->tagName - ) + $expectedElement->tagName, + ), ); for ($i = 0; $i < $expectedElement->attributes->length; $i++) { @@ -2363,8 +2363,8 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME $message, !empty($message) ? "\n" : '', $expectedAttribute->name, - $expectedElement->tagName - ) + $expectedElement->tagName, + ), ); } } @@ -2380,8 +2380,8 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME '%s%sNumber of child nodes of "%s" differs', $message, !empty($message) ? "\n" : '', - $expectedElement->tagName - ) + $expectedElement->tagName, + ), ); for ($i = 0; $i < $expectedElement->childNodes->length; $i++) { @@ -2389,7 +2389,7 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME $expectedElement->childNodes->item($i), $actualElement->childNodes->item($i), $checkAttributes, - $message + $message, ); } } @@ -2449,9 +2449,9 @@ public static function assertJsonStringNotEqualsJsonString($expectedJson, $actua static::assertThat( $actualJson, new LogicalNot( - new JsonMatches($expectedJson) + new JsonMatches($expectedJson), ), - $message + $message, ); } @@ -2489,9 +2489,9 @@ public static function assertJsonStringNotEqualsJsonFile(string $expectedFile, s static::assertThat( $actualJson, new LogicalNot( - new JsonMatches($expectedJson) + new JsonMatches($expectedJson), ), - $message + $message, ); } @@ -2513,7 +2513,7 @@ public static function assertJsonFileEqualsJsonFile(string $expectedFile, string static::assertJson($actualJson, $message); $constraintExpected = new JsonMatches( - $expectedJson + $expectedJson, ); $constraintActual = new JsonMatches($actualJson); @@ -2540,7 +2540,7 @@ public static function assertJsonFileNotEqualsJsonFile(string $expectedFile, str static::assertJson($actualJson, $message); $constraintExpected = new JsonMatches( - $expectedJson + $expectedJson, ); $constraintActual = new JsonMatches($actualJson); @@ -2721,7 +2721,7 @@ public static function greaterThanOrEqual($value): LogicalOr { return static::logicalOr( new IsEqual($value), - new GreaterThan($value) + new GreaterThan($value), ); } @@ -2779,7 +2779,7 @@ public static function lessThanOrEqual($value): LogicalOr { return static::logicalOr( new IsEqual($value), - new LessThan($value) + new LessThan($value), ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php b/app/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php index 5b8c50ed9..632d5c6fa 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php @@ -2927,7 +2927,7 @@ function never(): InvokedCountMatcher function atLeast(int $requiredInvocations): InvokedAtLeastCountMatcher { return new InvokedAtLeastCountMatcher( - $requiredInvocations + $requiredInvocations, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php index 8e27fbfd4..ff04a6981 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php @@ -40,7 +40,7 @@ public function toString(): string { return sprintf( 'count matches %d', - $this->expectedCount + $this->expectedCount, ); } @@ -76,7 +76,7 @@ protected function getCountOf($other): ?int throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } } @@ -136,7 +136,7 @@ protected function failureDescription($other): string return sprintf( 'actual size %d matches expected size %d', (int) $this->getCountOf($other), - $this->expectedCount + $this->expectedCount, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php index e6371d536..ee01e93da 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php @@ -64,7 +64,7 @@ protected function failureDescription($other): string '%s %s %s', strpos($type, 'a') === 0 || strpos($type, 'o') === 0 ? 'an' : 'a', $type, - $this->toString() + $this->toString(), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php index 5f772b4d1..260985aae 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php @@ -106,7 +106,7 @@ protected function fail($other, $description, ComparisonFailure $comparisonFailu { $failureDescription = sprintf( 'Failed asserting that %s.', - $this->failureDescription($other) + $this->failureDescription($other), ); $additionalFailureDescription = $this->additionalFailureDescription($other); @@ -121,7 +121,7 @@ protected function fail($other, $description, ComparisonFailure $comparisonFailu throw new ExpectationFailedException( $failureDescription, - $comparisonFailure + $comparisonFailure, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php index 6a61ebfba..5896efa4e 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php @@ -78,7 +78,7 @@ public function evaluate($other, string $description = '', bool $returnResult = try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( @@ -86,7 +86,7 @@ public function evaluate($other, string $description = '', bool $returnResult = $other, $this->delta, $this->canonicalize, - $this->ignoreCase + $this->ignoreCase, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -95,7 +95,7 @@ public function evaluate($other, string $description = '', bool $returnResult = throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -118,21 +118,21 @@ public function toString(): string return sprintf( "is equal to '%s'", - $this->value + $this->value, ); } if ($this->delta != 0) { $delta = sprintf( ' with delta <%F>', - $this->delta + $this->delta, ); } return sprintf( 'is equal to %s%s', $this->exporter()->export($this->value), - $delta + $delta, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php index 57bb91ca1..b87dadad9 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php @@ -58,7 +58,7 @@ public function evaluate($other, string $description = '', bool $returnResult = try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( @@ -66,7 +66,7 @@ public function evaluate($other, string $description = '', bool $returnResult = $other, 0.0, true, - false + false, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -75,7 +75,7 @@ public function evaluate($other, string $description = '', bool $returnResult = throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -96,13 +96,13 @@ public function toString(): string return sprintf( "is equal to '%s'", - $this->value + $this->value, ); } return sprintf( 'is equal to %s', - $this->exporter()->export($this->value) + $this->exporter()->export($this->value), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php index d657e96a2..3642da213 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php @@ -58,7 +58,7 @@ public function evaluate($other, string $description = '', bool $returnResult = try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( @@ -66,7 +66,7 @@ public function evaluate($other, string $description = '', bool $returnResult = $other, 0.0, false, - true + true, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -75,7 +75,7 @@ public function evaluate($other, string $description = '', bool $returnResult = throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -96,13 +96,13 @@ public function toString(): string return sprintf( "is equal to '%s'", - $this->value + $this->value, ); } return sprintf( 'is equal to %s', - $this->exporter()->export($this->value) + $this->exporter()->export($this->value), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php index 0370b5118..f7d8aced9 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php @@ -62,13 +62,13 @@ public function evaluate($other, string $description = '', bool $returnResult = try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( $this->value, $other, - $this->delta + $this->delta, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -77,7 +77,7 @@ public function evaluate($other, string $description = '', bool $returnResult = throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -92,9 +92,9 @@ public function evaluate($other, string $description = '', bool $returnResult = public function toString(): string { return sprintf( - 'is equal to %s with delta <%F>>', + 'is equal to %s with delta <%F>', $this->exporter()->export($this->value), - $this->delta + $this->delta, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php index 860c0030f..bbaab4af5 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php @@ -36,7 +36,7 @@ public function toString(): string { return sprintf( 'exception of type "%s"', - $this->className + $this->className, ); } @@ -73,13 +73,13 @@ protected function failureDescription($other): string 'exception of type "%s" matches expected exception "%s"%s', get_class($other), $this->className, - $message + $message, ); } return sprintf( 'exception of type "%s" is thrown', - $this->className + $this->className, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php index b8054a949..a6fad4c75 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php @@ -61,7 +61,7 @@ protected function failureDescription($other): string return sprintf( '%s is equal to expected exception code %s', $this->exporter()->export($other->getCode()), - $this->exporter()->export($this->expectedCode) + $this->exporter()->export($this->expectedCode), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php index 030beff98..5139e7200 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php @@ -65,14 +65,14 @@ protected function failureDescription($other): string if ($this->expectedMessage === '') { return sprintf( "exception message is empty but is '%s'", - $other->getMessage() + $other->getMessage(), ); } return sprintf( "exception message '%s' contains '%s'", $other->getMessage(), - $this->expectedMessage + $this->expectedMessage, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php index fd0db1c8f..bc7377091 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php @@ -48,7 +48,7 @@ protected function matches($other): bool if ($match === false) { throw new \PHPUnit\Framework\Exception( - "Invalid expected exception message regex given: '{$this->expectedMessageRegExp}'" + "Invalid expected exception message regex given: '{$this->expectedMessageRegExp}'", ); } @@ -68,7 +68,7 @@ protected function failureDescription($other): string return sprintf( "exception message '%s' matches '%s'", $other->getMessage(), - $this->expectedMessageRegExp + $this->expectedMessageRegExp, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php index ef4b2baf0..24268c7d3 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php @@ -48,7 +48,7 @@ protected function failureDescription($other): string { return sprintf( 'directory "%s" exists', - $other + $other, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php index 41b3136e9..6cae95024 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php @@ -48,7 +48,7 @@ protected function failureDescription($other): string { return sprintf( 'file "%s" exists', - $other + $other, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php index e33d7e045..124369386 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php @@ -48,7 +48,7 @@ protected function failureDescription($other): string { return sprintf( '"%s" is readable', - $other + $other, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php index 93981224a..8da020764 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php @@ -48,7 +48,7 @@ protected function failureDescription($other): string { return sprintf( '"%s" is writable', - $other + $other, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php index fde43d9e5..f36d44e74 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php @@ -62,7 +62,7 @@ public function evaluate($other, string $description = '', bool $returnResult = $this->value, $other, sprintf("'%s'", $this->value), - sprintf("'%s'", $other) + sprintf("'%s'", $other), ); } @@ -72,7 +72,7 @@ public function evaluate($other, string $description = '', bool $returnResult = $this->value, $other, $this->exporter()->export($this->value), - $this->exporter()->export($other) + $this->exporter()->export($other), ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php index 23a4de7e9..af791a111 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php @@ -37,7 +37,7 @@ public function toString(): string { return sprintf( 'matches JSON string "%s"', - $this->value + $this->value, ); } @@ -100,7 +100,7 @@ protected function fail($other, $description, ComparisonFailure $comparisonFailu Json::prettify($recodedValue), Json::prettify($recodedOther), false, - 'Failed asserting that two json values are equal.' + 'Failed asserting that two json values are equal.', ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php index a873ceaee..40e1d614e 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php @@ -40,7 +40,7 @@ public function toString(): string { return sprintf( 'has attribute "%s"', - $this->attributeName + $this->attributeName, ); } @@ -59,7 +59,7 @@ protected function matches($other): bool throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -79,7 +79,7 @@ protected function failureDescription($other): string '%sclass "%s" %s', is_object($other) ? 'object of ' : '', is_object($other) ? get_class($other) : $other, - $this->toString() + $this->toString(), ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php index 538cbf08b..bd5eefe49 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php @@ -28,7 +28,7 @@ public function toString(): string { return sprintf( 'has static attribute "%s"', - $this->attributeName() + $this->attributeName(), ); } @@ -51,7 +51,7 @@ protected function matches($other): bool throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php index 30f3a330c..b837b4cd1 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php @@ -65,7 +65,7 @@ protected function matches($other): bool if (!$object->hasMethod($this->method)) { throw new ComparisonMethodDoesNotExistException( get_class($other), - $this->method + $this->method, ); } @@ -75,7 +75,7 @@ protected function matches($other): bool if (!$method->hasReturnType()) { throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( get_class($other), - $this->method + $this->method, ); } @@ -84,28 +84,28 @@ protected function matches($other): bool if (!$returnType instanceof ReflectionNamedType) { throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( get_class($other), - $this->method + $this->method, ); } if ($returnType->allowsNull()) { throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( get_class($other), - $this->method + $this->method, ); } if ($returnType->getName() !== 'bool') { throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( get_class($other), - $this->method + $this->method, ); } if ($method->getNumberOfParameters() !== 1 || $method->getNumberOfRequiredParameters() !== 1) { throw new ComparisonMethodDoesNotDeclareExactlyOneParameterException( get_class($other), - $this->method + $this->method, ); } @@ -114,7 +114,7 @@ protected function matches($other): bool if (!$parameter->hasType()) { throw new ComparisonMethodDoesNotDeclareParameterTypeException( get_class($other), - $this->method + $this->method, ); } @@ -123,7 +123,7 @@ protected function matches($other): bool if (!$type instanceof ReflectionNamedType) { throw new ComparisonMethodDoesNotDeclareParameterTypeException( get_class($other), - $this->method + $this->method, ); } @@ -137,7 +137,7 @@ protected function matches($other): bool throw new ComparisonMethodDoesNotAcceptParameterTypeException( get_class($other), $this->method, - get_class($this->expected) + get_class($this->expected), ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php index 7560ce2a1..327f85bfe 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php @@ -63,15 +63,15 @@ public static function negate(string $string): string preg_replace( $positives, $negatives, - $nonInput + $nonInput, ), - $string + $string, ); } else { $negatedString = preg_replace( $positives, $negatives, - $string + $string, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php index fbdb479bc..ee1b1c293 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php @@ -57,7 +57,7 @@ static function (bool $matches, Constraint $constraint) use ($other): bool { return $matches xor $constraint->evaluate($other, '', true); }, - $initial->evaluate($other, '', true) + $initial->evaluate($other, '', true), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php index 97b294617..f90704f0a 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php @@ -65,13 +65,13 @@ protected function failureDescription($other): string json_decode($other); $error = (string) JsonMatchesErrorMessageProvider::determineJsonError( - (string) json_last_error() + (string) json_last_error(), ); return sprintf( '%s is valid JSON (%s)', $this->exporter()->shortenedExport($other), - $error + $error, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php index 8e609e795..9ccfb9bd5 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php @@ -34,7 +34,7 @@ public function toString(): string { return sprintf( 'matches PCRE pattern "%s"', - $this->pattern + $this->pattern, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php index 6279f37ba..5aa2c8e5a 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php @@ -48,7 +48,7 @@ public function toString(): string return sprintf( 'contains "%s"', - $string + $string, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php index c4f7324ec..9c01ecb9c 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php @@ -33,8 +33,8 @@ public function __construct(string $string) { parent::__construct( $this->createPatternFromFormat( - $this->convertNewlines($string) - ) + $this->convertNewlines($string), + ), ); $this->string = $string; @@ -49,7 +49,7 @@ public function __construct(string $string) protected function matches($other): bool { return parent::matches( - $this->convertNewlines($other) + $this->convertNewlines($other), ); } @@ -96,7 +96,7 @@ private function createPatternFromFormat(string $string): string '%x' => '[0-9a-fA-F]+', '%f' => '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', '%c' => '.', - ] + ], ); return '/^' . $string . '$/s'; diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php index 089545c12..8683e2722 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php @@ -9,7 +9,6 @@ */ namespace PHPUnit\Framework\Constraint; -use function strlen; use function strpos; use PHPUnit\Framework\InvalidArgumentException; @@ -25,7 +24,7 @@ final class StringStartsWith extends Constraint public function __construct(string $prefix) { - if (strlen($prefix) === 0) { + if ($prefix === '') { throw InvalidArgumentException::create(1, 'non-empty string'); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php index 39660a985..d0f61f46a 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php @@ -52,7 +52,7 @@ protected function failureDescription($other): string return sprintf( '%s %s', is_array($other) ? 'an array' : 'a traversable', - $this->toString() + $this->toString(), ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php index cf4a46b42..e5c688902 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php @@ -36,7 +36,7 @@ public function __construct(string $type, bool $isNativeType = true) $this->constraint = new IsType($type); } else { $this->constraint = new IsInstanceOf( - $type + $type, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php index f0fa02b99..ef26813f9 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php @@ -36,7 +36,7 @@ public function toString(): string return sprintf( 'is instance of %s "%s"', $this->getType(), - $this->className + $this->className, ); } @@ -67,7 +67,7 @@ protected function failureDescription($other): string '%s is an instance of %s "%s"', $this->exporter()->shortenedExport($other), $this->getType(), - $this->className + $this->className, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php index 5bc691d74..6edcc2b95 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php @@ -130,8 +130,8 @@ public function __construct(string $type) sprintf( 'Type specified for PHPUnit\Framework\Constraint\IsType <%s> ' . 'is not a valid type.', - $type - ) + $type, + ), ); } @@ -145,7 +145,7 @@ public function toString(): string { return sprintf( 'is of type "%s"', - $this->type + $this->type, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php b/app/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php index adae28294..4364788cf 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php @@ -21,7 +21,7 @@ public function __construct() parent::__construct( 'Actual value is not an object', 0, - null + null, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php b/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php index ebd68f34c..0c2c1afe6 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php @@ -24,10 +24,10 @@ public function __construct(string $className, string $methodName, string $type) '%s is not an accepted argument type for comparison method %s::%s().', $type, $className, - $methodName + $methodName, ), 0, - null + null, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php b/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php index 20189cde4..4eb9a2fde 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php @@ -23,10 +23,10 @@ public function __construct(string $className, string $methodName) sprintf( 'Comparison method %s::%s() does not declare bool return type.', $className, - $methodName + $methodName, ), 0, - null + null, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php b/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php index bd09d87cc..e8cd9787b 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php @@ -23,10 +23,10 @@ public function __construct(string $className, string $methodName) sprintf( 'Comparison method %s::%s() does not declare exactly one parameter.', $className, - $methodName + $methodName, ), 0, - null + null, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php b/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php index 9bbb112ea..68616ba18 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php @@ -23,10 +23,10 @@ public function __construct(string $className, string $methodName) sprintf( 'Parameter of comparison method %s::%s() does not have a declared type.', $className, - $methodName + $methodName, ), 0, - null + null, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php b/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php index ad0e2d088..0f1adcbcc 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php @@ -23,10 +23,10 @@ public function __construct(string $className, string $methodName) sprintf( 'Comparison method %s::%s() does not exist.', $className, - $methodName + $methodName, ), 0, - null + null, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php b/app/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php index 77f580799..888e9300b 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php @@ -34,8 +34,8 @@ public static function create(int $argument, string $type): self $argument, $function, in_array(lcfirst($type)[0], ['a', 'e', 'i', 'o', 'u'], true) ? 'an' : 'a', - $type - ) + $type, + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php b/app/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php index 09c343c16..89ecc5e2e 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php +++ b/app/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php @@ -77,8 +77,8 @@ public static function filterInvalid(array $dependencies): array static function (self $d) { return $d->isValid(); - } - ) + }, + ), ); } @@ -95,7 +95,7 @@ static function ($dependency) { return $dependency->getTarget(); }, - $existing + $existing, ); foreach ($additional as $dependency) { @@ -132,7 +132,7 @@ static function ($dependency) { return $dependency->getTarget(); }, - $right + $right, ); foreach ($left as $dependency) { diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php index e2f0a2802..56e6b69bb 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php @@ -42,7 +42,7 @@ public static function __phpunit_initConfigurableMethods(ConfigurableMethod ...$ { if (isset(static::$__phpunit_configurableMethods)) { throw new ConfigurableMethodsAlreadyInitializedException( - 'Configurable methods is already initialized and can not be reinitialized' + 'Configurable methods is already initialized and can not be reinitialized', ); } @@ -67,7 +67,7 @@ public function __phpunit_getInvocationHandler(): InvocationHandler if ($this->__phpunit_invocationMocker === null) { $this->__phpunit_invocationMocker = new InvocationHandler( static::$__phpunit_configurableMethods, - $this->__phpunit_returnValueGeneration + $this->__phpunit_returnValueGeneration, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php index f6df7533c..f8be3808c 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php @@ -24,7 +24,7 @@ public function method() return call_user_func_array( [$expects, 'method'], - func_get_args() + func_get_args(), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php index bc3c9236f..626c33a7b 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php @@ -241,7 +241,7 @@ static function (ConfigurableMethod $configurable) { return strtolower($configurable->getName()); }, - $this->configurableMethods + $this->configurableMethods, ); if (is_string($constraint) && !in_array(strtolower($constraint), $configurableMethodNames, true)) { @@ -300,7 +300,7 @@ private function ensureTypeOfReturnValues(array $values): void if (!$configuredMethod->mayReturn($value)) { throw new IncompatibleReturnValueException( $configuredMethod, - $value + $value, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php index f32ff0e7c..1756cfc0a 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php @@ -20,46 +20,46 @@ interface InvocationStubber public function will(Stub $stub): Identity; /** @return self */ - public function willReturn($value, ...$nextValues)/*: self */; + public function willReturn($value, ...$nextValues)/* : self */; /** * @param mixed $reference * * @return self */ - public function willReturnReference(&$reference)/*: self */; + public function willReturnReference(&$reference)/* : self */; /** * @param array> $valueMap * * @return self */ - public function willReturnMap(array $valueMap)/*: self */; + public function willReturnMap(array $valueMap)/* : self */; /** * @param int $argumentIndex * * @return self */ - public function willReturnArgument($argumentIndex)/*: self */; + public function willReturnArgument($argumentIndex)/* : self */; /** * @param callable $callback * * @return self */ - public function willReturnCallback($callback)/*: self */; + public function willReturnCallback($callback)/* : self */; /** @return self */ - public function willReturnSelf()/*: self */; + public function willReturnSelf()/* : self */; /** * @param mixed $values * * @return self */ - public function willReturnOnConsecutiveCalls(...$values)/*: self */; + public function willReturnOnConsecutiveCalls(...$values)/* : self */; /** @return self */ - public function willThrowException(Throwable $exception)/*: self */; + public function willThrowException(Throwable $exception)/* : self */; } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php index 0698870bc..848746b52 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php @@ -22,8 +22,8 @@ public function __construct(string $type, string $methodName) sprintf( 'Trying to configure method "%s" with addMethods(), but it exists in class "%s". Use onlyMethods() for methods that exist in the class', $methodName, - $type - ) + $type, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php index 35a29b731..0efcd02a3 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php @@ -22,8 +22,8 @@ public function __construct(string $type, string $methodName) sprintf( 'Trying to configure method "%s" with onlyMethods(), but it does not exist in class "%s". Use addMethods() for methods that do not exist in the class', $methodName, - $type - ) + $type, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php index 0ba9a187d..8c9c0a523 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php @@ -21,8 +21,8 @@ public function __construct(string $className) parent::__construct( sprintf( 'Class "%s" already exists', - $className - ) + $className, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php index e648f0263..2bce2d882 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php @@ -21,8 +21,8 @@ public function __construct(string $className) parent::__construct( sprintf( 'Class "%s" is declared "final" and cannot be doubled', - $className - ) + $className, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php index aa1a74510..f73570e1d 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php @@ -21,8 +21,8 @@ public function __construct(string $className) parent::__construct( sprintf( 'Class "%s" is declared "readonly" and cannot be doubled', - $className - ) + $className, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php index 1216b45d3..f96a04ac9 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php @@ -28,8 +28,8 @@ public function __construct(array $methods) sprintf( 'Cannot double using a method list that contains duplicates: "%s" (duplicate: "%s")', implode(', ', $methods), - implode(', ', array_unique(array_diff_assoc($methods, array_unique($methods)))) - ) + implode(', ', array_unique(array_diff_assoc($methods, array_unique($methods)))), + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php index eec792132..1ca8e9c94 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php @@ -29,8 +29,8 @@ public function __construct(ConfigurableMethod $method, $value) 'Method %s may not return value of type %s, its declared return type is "%s"', $method->getName(), is_object($value) ? get_class($value) : gettype($value), - $method->getReturnTypeDeclaration() - ) + $method->getReturnTypeDeclaration(), + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php index d2444cf12..0ab74cbb6 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php @@ -21,8 +21,8 @@ public function __construct(string $method) parent::__construct( sprintf( 'Cannot double method with invalid name "%s"', - $method - ) + $method, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php index c05b2bce6..f2e1a31e8 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php @@ -21,8 +21,8 @@ public function __construct(string $id) parent::__construct( sprintf( 'No builder found for match builder identification <%s>', - $id - ) + $id, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php index efcc13ed9..0972ffaf8 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php @@ -21,8 +21,8 @@ public function __construct(string $id) parent::__construct( sprintf( 'Matcher with id <%s> is already registered', - $id - ) + $id, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php index 707290439..2f0bb5a65 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php @@ -21,8 +21,8 @@ public function __construct(string $method) parent::__construct( sprintf( 'Trying to configure method "%s" which cannot be configured because it does not exist, has not been specified, is final, or is static', - $method - ) + $method, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php index 2c16c1dcc..2bc4e8829 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php @@ -22,8 +22,8 @@ public function __construct(Invocation $invocation) sprintf( 'Return value inference disabled and no expectation set up for %s::%s()', $invocation->getClassName(), - $invocation->getMethodName() - ) + $invocation->getMethodName(), + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php index 98837c954..6ec5057ab 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php @@ -17,7 +17,7 @@ final class SoapExtensionNotAvailableException extends \PHPUnit\Framework\Except public function __construct() { parent::__construct( - 'The SOAP extension is required to generate a test double from WSDL' + 'The SOAP extension is required to generate a test double from WSDL', ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php index e124f9b18..b08dead05 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php @@ -21,8 +21,8 @@ public function __construct(string $className) parent::__construct( sprintf( 'Class "%s" does not exist', - $className - ) + $className, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php index 90fc8d848..c689dae92 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php @@ -21,8 +21,8 @@ public function __construct(string $traitName) parent::__construct( sprintf( 'Trait "%s" does not exist', - $traitName - ) + $traitName, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php index b1a70edd6..c50b69116 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php @@ -21,8 +21,8 @@ public function __construct(string $type) parent::__construct( sprintf( 'Class or interface "%s" does not exist', - $type - ) + $type, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php index 17e3312c5..d61725b15 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php @@ -72,7 +72,6 @@ public function __clone(): void } } EOT; - private const MOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT' namespace PHPUnit\Framework\MockObject; @@ -84,7 +83,6 @@ public function __clone() } } EOT; - private const UNMOCKED_CLONE_METHOD_WITH_VOID_RETURN_TYPE_TRAIT = <<<'EOT' namespace PHPUnit\Framework\MockObject; @@ -98,7 +96,6 @@ public function __clone(): void } } EOT; - private const UNMOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT' namespace PHPUnit\Framework\MockObject; @@ -189,7 +186,7 @@ public function getMock(string $type, $methods = [], array $arguments = [], stri throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -210,7 +207,7 @@ public function getMock(string $type, $methods = [], array $arguments = [], stri $callOriginalClone, $callAutoload, $cloneArguments, - $callOriginalMethods + $callOriginalMethods, ); return $this->getObject( @@ -221,7 +218,7 @@ public function getMock(string $type, $methods = [], array $arguments = [], stri $arguments, $callOriginalMethods, $proxyTarget, - $returnValueGeneration + $returnValueGeneration, ); } @@ -268,7 +265,7 @@ public function getMockForInterfaces(array $interfaces, bool $callAutoload = tru $intersectionName = sprintf( 'Intersection_%s_%s', implode('_', $unqualifiedNames), - substr(md5((string) mt_rand()), 0, 8) + substr(md5((string) mt_rand()), 0, 8), ); } while (interface_exists($intersectionName, false)); @@ -278,7 +275,7 @@ public function getMockForInterfaces(array $interfaces, bool $callAutoload = tru [ 'intersection' => $intersectionName, 'interfaces' => implode(', ', $interfaces), - ] + ], ); eval($template->render()); @@ -321,7 +318,7 @@ interface_exists($originalClassName, $callAutoload)) { throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -346,7 +343,7 @@ interface_exists($originalClassName, $callAutoload)) { $callOriginalConstructor, $callOriginalClone, $callAutoload, - $cloneArguments + $cloneArguments, ); } @@ -382,7 +379,7 @@ public function getMockForTrait(string $traitName, array $arguments = [], string $className = $this->generateClassName( $traitName, '', - 'Trait_' + 'Trait_', ); $classTemplate = $this->getTemplate('trait_class.tpl'); @@ -392,7 +389,7 @@ public function getMockForTrait(string $traitName, array $arguments = [], string 'prologue' => 'abstract ', 'class_name' => $className['className'], 'trait_name' => $traitName, - ] + ], ); $mockTrait = new MockTrait($classTemplate->render(), $className['className']); @@ -419,7 +416,7 @@ public function getObjectForTrait(string $traitName, string $traitClassName = '' $className = $this->generateClassName( $traitName, $traitClassName, - 'Trait_' + 'Trait_', ); $classTemplate = $this->getTemplate('trait_class.tpl'); @@ -429,18 +426,18 @@ public function getObjectForTrait(string $traitName, string $traitClassName = '' 'prologue' => '', 'class_name' => $className['className'], 'trait_name' => $traitName, - ] + ], ); return $this->getObject( new MockTrait( $classTemplate->render(), - $className['className'] + $className['className'], ), '', $callOriginalConstructor, $callAutoload, - $arguments + $arguments, ); } @@ -460,7 +457,7 @@ public function generate(string $type, array $methods = null, string $mockClassN $callOriginalClone, $callAutoload, $cloneArguments, - $callOriginalMethods + $callOriginalMethods, ); } @@ -469,7 +466,7 @@ public function generate(string $type, array $methods = null, string $mockClassN serialize($methods) . serialize($callOriginalClone) . serialize($cloneArguments) . - serialize($callOriginalMethods) + serialize($callOriginalMethods), ); if (!isset(self::$cache[$key])) { @@ -480,7 +477,7 @@ public function generate(string $type, array $methods = null, string $mockClassN $callOriginalClone, $callAutoload, $cloneArguments, - $callOriginalMethods + $callOriginalMethods, ); } @@ -507,7 +504,7 @@ public function generateClassFromWsdl(string $wsdlFile, string $className, array throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -526,7 +523,7 @@ public function generateClassFromWsdl(string $wsdlFile, string $className, array if (empty($methods) || in_array($name, $methods, true)) { $args = explode( ',', - str_replace(')', '', substr($method, $nameEnd + 1)) + str_replace(')', '', substr($method, $nameEnd + 1)), ); foreach (range(0, count($args) - 1) as $i) { @@ -543,7 +540,7 @@ public function generateClassFromWsdl(string $wsdlFile, string $className, array [ 'method_name' => $name, 'arguments' => implode(', ', $args), - ] + ], ); $methodsBuffer .= $methodTemplate->render(); @@ -574,7 +571,7 @@ public function generateClassFromWsdl(string $wsdlFile, string $className, array 'wsdl' => $wsdlFile, 'options' => $optionsBuffer, 'methods' => $methodsBuffer, - ] + ], ); return $classTemplate->render(); @@ -594,7 +591,7 @@ public function getClassMethods(string $className): array throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -624,7 +621,7 @@ public function mockClassMethods(string $className, bool $callOriginalMethods, b throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -654,7 +651,7 @@ public function mockInterfaceMethods(string $interfaceName, bool $cloneArguments throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -684,7 +681,7 @@ private function userDefinedInterfaceMethods(string $interfaceName): array throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -721,7 +718,7 @@ private function getObject(MockType $mockClass, $type = '', bool $callOriginalCo throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -748,7 +745,7 @@ private function getObject(MockType $mockClass, $type = '', bool $callOriginalCo throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -787,7 +784,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc $_mockClassName = $this->generateClassName( $type, $mockClassName, - 'Mock_' + 'Mock_', ); if (class_exists($_mockClassName['fullClassName'], $callAutoload)) { @@ -816,7 +813,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -842,7 +839,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -858,7 +855,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -869,14 +866,14 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc } $mockMethods->addMethods( - MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments) + MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments), ); } $_mockClassName = $this->generateClassName( $actualClassName, $_mockClassName['className'], - 'Mock_' + 'Mock_', ); } @@ -887,7 +884,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc $additionalInterfaces[] = Iterator::class; $mockMethods->addMethods( - ...$this->mockClassMethods(Iterator::class, $callOriginalMethods, $cloneArguments) + ...$this->mockClassMethods(Iterator::class, $callOriginalMethods, $cloneArguments), ); } @@ -899,7 +896,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -918,13 +915,13 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc if ($isClass && $explicitMethods === []) { $mockMethods->addMethods( - ...$this->mockClassMethods($_mockClassName['fullClassName'], $callOriginalMethods, $cloneArguments) + ...$this->mockClassMethods($_mockClassName['fullClassName'], $callOriginalMethods, $cloneArguments), ); } if ($isInterface && ($explicitMethods === [] || $explicitMethods === null)) { $mockMethods->addMethods( - ...$this->mockInterfaceMethods($_mockClassName['fullClassName'], $cloneArguments) + ...$this->mockInterfaceMethods($_mockClassName['fullClassName'], $cloneArguments), ); } @@ -938,14 +935,14 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd if ($this->canMockMethod($method)) { $mockMethods->addMethods( - MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments) + MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments), ); } } else { @@ -953,8 +950,8 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc MockMethod::fromName( $_mockClassName['fullClassName'], $methodName, - $cloneArguments - ) + $cloneArguments, + ), ); } } @@ -991,19 +988,19 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc 'class_declaration' => $this->generateMockClassDeclaration( $_mockClassName, $isInterface, - $additionalInterfaces + $additionalInterfaces, ), 'clone' => $cloneTrait, 'mock_class_name' => $_mockClassName['className'], 'mocked_methods' => $mockedMethods, 'method' => $method, - ] + ], ); return new MockClass( $classTemplate->render(), $_mockClassName['className'], - $configurable + $configurable, ); } @@ -1050,7 +1047,7 @@ private function generateMockClassDeclaration(array $mockClassName, bool $isInte $buffer .= sprintf( '%s implements %s', $mockClassName['className'], - $interfaces + $interfaces, ); if (!in_array($mockClassName['originalClassName'], $additionalInterfaces, true)) { @@ -1068,7 +1065,7 @@ private function generateMockClassDeclaration(array $mockClassName, bool $isInte $mockClassName['className'], !empty($mockClassName['namespaceName']) ? $mockClassName['namespaceName'] . '\\' : '', $mockClassName['originalClassName'], - $interfaces + $interfaces, ); } @@ -1099,7 +1096,7 @@ private function getTemplate(string $template): Template throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php index 418d6a077..ed8c4e92d 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php @@ -183,7 +183,7 @@ public function generateReturnValue() throw new RuntimeException( $t->getMessage(), (int) $t->getCode(), - $t + $t, ); } } @@ -221,7 +221,7 @@ public function generateReturnValue() throw new RuntimeException( $t->getMessage(), (int) $t->getCode(), - $t + $t, ); } } @@ -256,8 +256,8 @@ public function generateReturnValue() 'Return value for %s::%s() cannot be generated%s, please configure a return value for this method', $this->className, $this->methodName, - $reason - ) + $reason, + ), ); } @@ -273,10 +273,10 @@ public function toString(): string ', ', array_map( [$exporter, 'shortenedExport'], - $this->parameters - ) + $this->parameters, + ), ), - $this->returnType ? sprintf(': %s', $this->returnType) : '' + $this->returnType ? sprintf(': %s', $this->returnType) : '', ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php index b9d62610a..f8ee16e0c 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php @@ -102,7 +102,7 @@ public function expects(InvocationOrder $rule): InvocationMocker return new InvocationMocker( $this, $matcher, - ...$this->configurableMethods + ...$this->configurableMethods, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php index 7c81a0ea0..a8ebe14fa 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php @@ -117,8 +117,8 @@ public function invoked(Invocation $invocation) if ($this->afterMatchBuilderId !== null) { $matcher = $invocation->getObject() - ->__phpunit_getInvocationHandler() - ->lookupMatcher($this->afterMatchBuilderId); + ->__phpunit_getInvocationHandler() + ->lookupMatcher($this->afterMatchBuilderId); if (!$matcher) { throw new MatchBuilderNotFoundException($this->afterMatchBuilderId); @@ -143,9 +143,9 @@ public function invoked(Invocation $invocation) "Expectation failed for %s when %s\n%s", $this->methodNameRule->toString(), $this->invocationRule->toString(), - $e->getMessage() + $e->getMessage(), ), - $e->getComparisonFailure() + $e->getComparisonFailure(), ); } @@ -167,8 +167,8 @@ public function matches(Invocation $invocation): bool { if ($this->afterMatchBuilderId !== null) { $matcher = $invocation->getObject() - ->__phpunit_getInvocationHandler() - ->lookupMatcher($this->afterMatchBuilderId); + ->__phpunit_getInvocationHandler() + ->lookupMatcher($this->afterMatchBuilderId); if (!$matcher) { throw new MatchBuilderNotFoundException($this->afterMatchBuilderId); @@ -199,9 +199,9 @@ public function matches(Invocation $invocation): bool "Expectation failed for %s when %s\n%s", $this->methodNameRule->toString(), $this->invocationRule->toString(), - $e->getMessage() + $e->getMessage(), ), - $e->getComparisonFailure() + $e->getComparisonFailure(), ); } @@ -239,8 +239,8 @@ public function verify(): void "Expectation failed for %s when %s.\n%s", $this->methodNameRule->toString(), $this->invocationRule->toString(), - TestFailure::exceptionToString($e) - ) + TestFailure::exceptionToString($e), + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php index 3082ab384..e5c955d3d 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php @@ -33,7 +33,7 @@ public function toString(): string { return sprintf( 'is "%s"', - $this->methodName + $this->methodName, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php index 4007a9f13..69ec25026 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php @@ -138,7 +138,7 @@ public function getMock(): MockObject $this->callOriginalMethods, $this->proxyTarget, $this->allowMockingUnknownTypes, - $this->returnValueGeneration + $this->returnValueGeneration, ); $this->testCase->registerMockObject($object); @@ -165,7 +165,7 @@ public function getMockForAbstractClass(): MockObject $this->originalClone, $this->autoload, $this->methods, - $this->cloneArguments + $this->cloneArguments, ); $this->testCase->registerMockObject($object); @@ -192,7 +192,7 @@ public function getMockForTrait(): MockObject $this->originalClone, $this->autoload, $this->methods, - $this->cloneArguments + $this->cloneArguments, ); $this->testCase->registerMockObject($object); @@ -243,7 +243,7 @@ public function onlyMethods(array $methods): self throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -285,7 +285,7 @@ public function addMethods(array $methods): self throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -313,8 +313,8 @@ public function setMethodsExcept(array $methods = []): self return $this->setMethods( array_diff( $this->generator->getClassMethods($this->type), - $methods - ) + $methods, + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php index 253d78460..8f5c276d5 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php @@ -55,7 +55,7 @@ public function generate(): string $this->mockName, '__phpunit_initConfigurableMethods', ], - ...$this->configurableMethods + ...$this->configurableMethods, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php index 2cf149ad6..88462dfe0 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php @@ -140,7 +140,7 @@ public static function fromReflection(ReflectionMethod $method, bool $callOrigin $reference, $callOriginalMethod, $method->isStatic(), - $deprecation + $deprecation, ); } @@ -157,7 +157,7 @@ public static function fromName(string $fullClassName, string $methodName, bool '', false, false, - null + null, ); } @@ -191,12 +191,12 @@ public function generateCode(): string } elseif ($this->returnType->isNever() || $this->returnType->isVoid()) { $templateFile = sprintf( '%s_method_never_or_void.tpl', - $this->callOriginalMethod ? 'proxied' : 'mocked' + $this->callOriginalMethod ? 'proxied' : 'mocked', ); } else { $templateFile = sprintf( '%s_method.tpl', - $this->callOriginalMethod ? 'proxied' : 'mocked' + $this->callOriginalMethod ? 'proxied' : 'mocked', ); } @@ -209,7 +209,7 @@ public function generateCode(): string $deprecationTemplate->setVar( [ 'deprecation' => var_export($deprecation, true), - ] + ], ); $deprecation = $deprecationTemplate->render(); @@ -230,7 +230,7 @@ public function generateCode(): string 'reference' => $this->reference, 'clone_arguments' => $this->cloneArguments ? 'true' : 'false', 'deprecation' => $deprecation, - ] + ], ); return $template->render(); @@ -255,7 +255,7 @@ private function getTemplate(string $template): Template throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } } @@ -361,18 +361,18 @@ private static function exportDefaultValue(ReflectionParameter $parameter): stri substr( substr( $parameterAsString, - strpos($parameterAsString, ' ') + strlen(' ') + strpos($parameterAsString, ' ') + strlen(' '), ), 0, - -2 - ) + -2, + ), )[1]; // @codeCoverageIgnoreStart } catch (\ReflectionException $e) { throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php index 2188ea0ff..703c14342 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php @@ -47,8 +47,8 @@ public function __construct(array $parameterGroups) sprintf( 'Parameter group #%d must be an array or Traversable, got %s', $index, - gettype($parameters) - ) + gettype($parameters), + ), ); } @@ -111,8 +111,8 @@ private function verifyInvocation(BaseInvocation $invocation, $callIndex): void throw new ExpectationFailedException( sprintf( 'Parameter count for invocation %s is too low.', - $invocation->toString() - ) + $invocation->toString(), + ), ); } @@ -124,8 +124,8 @@ private function verifyInvocation(BaseInvocation $invocation, $callIndex): void 'value.', $i, $callIndex, - $invocation->toString() - ) + $invocation->toString(), + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php index 9b51f4ef7..d56618cbc 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php @@ -64,8 +64,8 @@ public function verify(): void throw new ExpectationFailedException( sprintf( 'The expected invocation at index %s was never reached.', - $this->sequenceIndex - ) + $this->sequenceIndex, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php index a84aa6559..afc880e1f 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php @@ -48,7 +48,7 @@ public function verify(): void if ($count < $this->requiredInvocations) { throw new ExpectationFailedException( 'Expected invocation at least ' . $this->requiredInvocations . - ' times but it occurred ' . $count . ' time(s).' + ' times but it occurred ' . $count . ' time(s).', ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php index d0ad1f801..645ed309a 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php @@ -34,7 +34,7 @@ public function verify(): void if ($count < 1) { throw new ExpectationFailedException( - 'Expected invocation at least once but it never occurred.' + 'Expected invocation at least once but it never occurred.', ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php index c3b815aa4..df81a6131 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php @@ -48,7 +48,7 @@ public function verify(): void if ($count > $this->allowedInvocations) { throw new ExpectationFailedException( 'Expected invocation at most ' . $this->allowedInvocations . - ' times but it occurred ' . $count . ' time(s).' + ' times but it occurred ' . $count . ' time(s).', ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php index 188326c91..a962118eb 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php @@ -62,8 +62,8 @@ public function verify(): void 'Method was expected to be called %d times, ' . 'actually called %d times.', $this->expectedCount, - $count - ) + $count, + ), ); } } @@ -92,7 +92,7 @@ protected function invokedDo(BaseInvocation $invocation): void default: $message .= sprintf( 'was not expected to be called more than %d times.', - $this->expectedCount + $this->expectedCount, ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php index 3f1cc53ae..cb71b271c 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php @@ -47,7 +47,7 @@ public function __construct(array $parameters) foreach ($parameters as $parameter) { if (!($parameter instanceof Constraint)) { $parameter = new IsEqual( - $parameter + $parameter, ); } @@ -127,7 +127,7 @@ private function doVerify(): bool } throw new ExpectationFailedException( - sprintf($message, $this->invocation->toString()) + sprintf($message, $this->invocation->toString()), ); } @@ -138,8 +138,8 @@ private function doVerify(): bool 'Parameter %s for invocation %s does not match expected ' . 'value.', $i, - $this->invocation->toString() - ) + $this->invocation->toString(), + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php index 0dcf386b3..8b01656f6 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php @@ -51,7 +51,7 @@ public function toString(): string return sprintf( 'return user-specified value %s', - $exporter->export($this->value) + $exporter->export($this->value), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php index 5d64c96a5..aa9074eb6 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php @@ -40,7 +40,7 @@ public function toString(): string return sprintf( 'raise user-specified exception %s', - $exporter->export($this->exception) + $exporter->export($this->exception), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php index e02181e90..0f24aafc5 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php @@ -49,7 +49,7 @@ public function toString(): string 'passed arguments', $class, $type, - $this->callback[1] + $this->callback[1], ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php index 0d288cebe..ea2bb735a 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php @@ -39,7 +39,7 @@ public function toString(): string return sprintf( 'return user-specified reference %s', - $exporter->export($this->reference) + $exporter->export($this->reference), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php index fbcd0a07a..4ecbc3b92 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php @@ -39,7 +39,7 @@ public function toString(): string return sprintf( 'return user-specified value %s', - $exporter->export($this->value) + $exporter->export($this->value), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/TestBuilder.php b/app/vendor/phpunit/phpunit/src/Framework/TestBuilder.php index 5dd91e219..77404df08 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/TestBuilder.php +++ b/app/vendor/phpunit/phpunit/src/Framework/TestBuilder.php @@ -31,28 +31,28 @@ public function build(ReflectionClass $theClass, string $methodName): Test if (!$theClass->isInstantiable()) { return new ErrorTestCase( - sprintf('Cannot instantiate class "%s".', $className) + sprintf('Cannot instantiate class "%s".', $className), ); } $backupSettings = TestUtil::getBackupSettings( $className, - $methodName + $methodName, ); $preserveGlobalState = TestUtil::getPreserveGlobalStateSettings( $className, - $methodName + $methodName, ); $runTestInSeparateProcess = TestUtil::getProcessIsolationSettings( $className, - $methodName + $methodName, ); $runClassInSeparateProcess = TestUtil::getClassProcessIsolationSettings( $className, - $methodName + $methodName, ); $constructor = $theClass->getConstructor(); @@ -71,14 +71,14 @@ public function build(ReflectionClass $theClass, string $methodName): Test try { $data = TestUtil::getProvidedData( $className, - $methodName + $methodName, ); } catch (IncompleteTestError $e) { $message = sprintf( "Test for %s::%s marked incomplete by data provider\n%s", $className, $methodName, - $this->throwableToString($e) + $this->throwableToString($e), ); $data = new IncompleteTestCase($className, $methodName, $message); @@ -87,7 +87,7 @@ public function build(ReflectionClass $theClass, string $methodName): Test "Test for %s::%s skipped by data provider\n%s", $className, $methodName, - $this->throwableToString($e) + $this->throwableToString($e), ); $data = new SkippedTestCase($className, $methodName, $message); @@ -96,7 +96,7 @@ public function build(ReflectionClass $theClass, string $methodName): Test "The data provider specified for %s::%s is invalid.\n%s", $className, $methodName, - $this->throwableToString($t) + $this->throwableToString($t), ); $data = new ErrorTestCase($message); @@ -111,7 +111,7 @@ public function build(ReflectionClass $theClass, string $methodName): Test $runTestInSeparateProcess, $preserveGlobalState, $runClassInSeparateProcess, - $backupSettings + $backupSettings, ); } else { $test = $this->buildTestWithoutData($className); @@ -125,7 +125,7 @@ public function build(ReflectionClass $theClass, string $methodName): Test $runTestInSeparateProcess, $preserveGlobalState, $runClassInSeparateProcess, - $backupSettings + $backupSettings, ); } @@ -149,7 +149,7 @@ private function buildDataProviderTestSuite( array $backupSettings ): DataProviderTestSuite { $dataProviderTestSuite = new DataProviderTestSuite( - $className . '::' . $methodName + $className . '::' . $methodName, ); $groups = TestUtil::getGroups($className, $methodName); @@ -169,7 +169,7 @@ private function buildDataProviderTestSuite( $runTestInSeparateProcess, $preserveGlobalState, $runClassInSeparateProcess, - $backupSettings + $backupSettings, ); $dataProviderTestSuite->addTest($_test, $groups); @@ -208,7 +208,7 @@ private function configureTestCase( if ($backupSettings['backupStaticAttributes'] !== null) { $test->setBackupStaticAttributes( - $backupSettings['backupStaticAttributes'] + $backupSettings['backupStaticAttributes'], ); } } @@ -225,7 +225,7 @@ private function throwableToString(Throwable $t): string return sprintf( "%s\n%s", $message, - Filter::getFilteredStacktrace($t) + Filter::getFilteredStacktrace($t), ); } @@ -233,7 +233,7 @@ private function throwableToString(Throwable $t): string "%s: %s\n%s", get_class($t), $message, - Filter::getFilteredStacktrace($t) + Filter::getFilteredStacktrace($t), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/TestCase.php b/app/vendor/phpunit/phpunit/src/Framework/TestCase.php index 2d83fe018..6cfbcac8d 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/TestCase.php +++ b/app/vendor/phpunit/phpunit/src/Framework/TestCase.php @@ -374,7 +374,7 @@ public static function never(): InvokedCountMatcher public static function atLeast(int $requiredInvocations): InvokedAtLeastCountMatcher { return new InvokedAtLeastCountMatcher( - $requiredInvocations + $requiredInvocations, ); } @@ -429,7 +429,7 @@ public static function at(int $index): InvokedAtIndexMatcher if (isset($frame['object']) && $frame['object'] instanceof self) { $frame['object']->addWarning( - 'The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.' + 'The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.', ); break; @@ -555,7 +555,7 @@ public function toString(): string throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -563,7 +563,7 @@ public function toString(): string $buffer = sprintf( '%s::%s', $class->name, - $this->getName(false) + $this->getName(false), ); return $buffer . $this->getDataSetAsString(); @@ -837,18 +837,18 @@ public function run(TestResult $result = null): TestResult throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd if ($runEntireClass) { $template = new Template( - __DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl' + __DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl', ); } else { $template = new Template( - __DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl' + __DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl', ); } @@ -1043,7 +1043,7 @@ public function getSize(): int { return TestUtil::getSize( static::class, - $this->getName(false) + $this->getName(false), ); } @@ -1222,8 +1222,8 @@ public function runBare(): void throw new Warning( implode( "\n", - array_unique($this->warnings) - ) + array_unique($this->warnings), + ), ); } @@ -1596,7 +1596,7 @@ protected function runTest() { if (trim($this->name) === '') { throw new Exception( - 'PHPUnit\Framework\TestCase::$name must be a non-blank string.' + 'PHPUnit\Framework\TestCase::$name must be a non-blank string.', ); } @@ -1617,15 +1617,15 @@ protected function runTest() $exception, LogicalOr::fromConstraints( new ExceptionConstraint(Error::class), - new ExceptionConstraint(\Error::class) - ) + new ExceptionConstraint(\Error::class), + ), ); } else { $this->assertThat( $exception, new ExceptionConstraint( - $this->expectedException - ) + $this->expectedException, + ), ); } } @@ -1634,8 +1634,8 @@ protected function runTest() $this->assertThat( $exception, new ExceptionMessage( - $this->expectedExceptionMessage - ) + $this->expectedExceptionMessage, + ), ); } @@ -1643,8 +1643,8 @@ protected function runTest() $this->assertThat( $exception, new ExceptionMessageRegularExpression( - $this->expectedExceptionMessageRegExp - ) + $this->expectedExceptionMessageRegExp, + ), ); } @@ -1652,8 +1652,8 @@ protected function runTest() $this->assertThat( $exception, new ExceptionCode( - $this->expectedExceptionCode - ) + $this->expectedExceptionCode, + ), ); } @@ -1664,8 +1664,8 @@ protected function runTest() $this->assertThat( null, new ExceptionConstraint( - $this->expectedException - ) + $this->expectedException, + ), ); } elseif ($this->expectedExceptionMessage !== null) { $this->numAssertions++; @@ -1673,8 +1673,8 @@ protected function runTest() throw new AssertionFailedError( sprintf( 'Failed asserting that exception with message "%s" is thrown', - $this->expectedExceptionMessage - ) + $this->expectedExceptionMessage, + ), ); } elseif ($this->expectedExceptionMessageRegExp !== null) { $this->numAssertions++; @@ -1682,8 +1682,8 @@ protected function runTest() throw new AssertionFailedError( sprintf( 'Failed asserting that exception with message matching "%s" is thrown', - $this->expectedExceptionMessageRegExp - ) + $this->expectedExceptionMessageRegExp, + ), ); } elseif ($this->expectedExceptionCode !== null) { $this->numAssertions++; @@ -1691,8 +1691,8 @@ protected function runTest() throw new AssertionFailedError( sprintf( 'Failed asserting that exception with code "%s" is thrown', - $this->expectedExceptionCode - ) + $this->expectedExceptionCode, + ), ); } @@ -1717,8 +1717,8 @@ protected function iniSet(string $varName, string $newValue): void sprintf( 'INI setting "%s" could not be set to "%s".', $varName, - $newValue - ) + $newValue, + ), ); } } @@ -1753,7 +1753,7 @@ protected function setLocale(...$args): void throw new Exception( 'The locale functionality is not implemented on your platform, ' . 'the specified locale does not exist or the category name is ' . - 'invalid.' + 'invalid.', ); } } @@ -1826,7 +1826,7 @@ protected function createPartialMock(string $originalClassName, array $methods): throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -1836,7 +1836,7 @@ protected function createPartialMock(string $originalClassName, array $methods): static function (string $method) use ($reflector) { return !$reflector->hasMethod($method); - } + }, ); if ($mockedMethodsThatDontExist) { @@ -1844,18 +1844,18 @@ static function (string $method) use ($reflector) sprintf( 'createPartialMock() called with method(s) %s that do not exist in %s. This will not be allowed in future versions of PHPUnit.', implode(', ', $mockedMethodsThatDontExist), - $originalClassName - ) + $originalClassName, + ), ); } return $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->setMethods(empty($methods) ? null : $methods) - ->getMock(); + ->disableOriginalConstructor() + ->disableOriginalClone() + ->disableArgumentCloning() + ->disallowMockingUnknownTypes() + ->setMethods(empty($methods) ? null : $methods) + ->getMock(); } /** @@ -1870,9 +1870,9 @@ static function (string $method) use ($reflector) protected function createTestProxy(string $originalClassName, array $constructorArguments = []): MockObject { return $this->getMockBuilder($originalClassName) - ->setConstructorArgs($constructorArguments) - ->enableProxyingToOriginalMethods() - ->getMock(); + ->setConstructorArgs($constructorArguments) + ->enableProxyingToOriginalMethods() + ->getMock(); } /** @@ -1902,7 +1902,7 @@ protected function getMockClass(string $originalClassName, $methods = [], array $callOriginalConstructor, $callOriginalClone, $callAutoload, - $cloneArguments + $cloneArguments, ); return get_class($mock); @@ -1931,7 +1931,7 @@ protected function getMockForAbstractClass(string $originalClassName, array $arg $callOriginalClone, $callAutoload, $mockedMethods, - $cloneArguments + $cloneArguments, ); $this->registerMockObject($mockObject); @@ -1963,7 +1963,7 @@ protected function getMockFromWsdl(string $wsdlFile, string $originalClassName = $wsdlFile, $originalClassName, $methods, - $options + $options, ) ); } @@ -1975,7 +1975,7 @@ protected function getMockFromWsdl(string $wsdlFile, string $originalClassName = $mockClassName, $callOriginalConstructor, false, - false + false, ); $this->registerMockObject($mockObject); @@ -2002,7 +2002,7 @@ protected function getMockForTrait(string $traitName, array $arguments = [], str $callOriginalClone, $callAutoload, $mockedMethods, - $cloneArguments + $cloneArguments, ); $this->registerMockObject($mockObject); @@ -2024,7 +2024,7 @@ protected function getObjectForTrait(string $traitName, array $arguments = [], s $traitClassName, $callAutoload, $callOriginalConstructor, - $arguments + $arguments, ); } @@ -2088,7 +2088,7 @@ private function verifyMockObjects(): void } $mockObject->__phpunit_verify( - $this->shouldInvocationMockerBeReset($mockObject) + $this->shouldInvocationMockerBeReset($mockObject), ); } @@ -2121,7 +2121,7 @@ private function checkRequirements(): void $missingRequirements = TestUtil::getMissingRequirements( static::class, - $this->name + $this->name, ); if (!empty($missingRequirements)) { @@ -2187,9 +2187,9 @@ private function handleDependencies(): bool $this->result->addError( $this, new SkippedTestError( - 'This test depends on a test that is larger than itself.' + 'This test depends on a test that is larger than itself.', ), - 0 + 0, ); return false; @@ -2222,9 +2222,9 @@ private function markSkippedForNotSpecifyingDependency(): void $this->result->addError( $this, new SkippedTestError( - 'This method has an invalid @depends annotation.' + 'This method has an invalid @depends annotation.', ), - 0 + 0, ); $this->result->endTest($this, 0); @@ -2241,10 +2241,10 @@ private function markSkippedForMissingDependency(ExecutionOrderDependency $depen new SkippedTestError( sprintf( 'This test depends on "%s" to pass.', - $dependency->getTarget() - ) + $dependency->getTarget(), + ), ), - 0 + 0, ); $this->result->endTest($this, 0); @@ -2261,10 +2261,10 @@ private function markWarningForUncallableDependency(ExecutionOrderDependency $de new Warning( sprintf( 'This test depends on "%s" which does not exist.', - $dependency->getTarget() - ) + $dependency->getTarget(), + ), ), - 0 + 0, ); $this->result->endTest($this, 0); @@ -2301,7 +2301,7 @@ private function stopOutputBuffering(): void } throw new RiskyTestError( - 'Test code or tested code did not (only) close its own output buffers' + 'Test code or tested code did not (only) close its own output buffers', ); } @@ -2341,7 +2341,7 @@ private function restoreGlobalState(): void try { $this->compareGlobalStateSnapshots( $this->snapshot, - $this->createGlobalStateSnapshot($this->backupGlobals === true) + $this->createGlobalStateSnapshot($this->backupGlobals === true), ); } catch (RiskyTestError $rte) { // Intentionally left empty @@ -2419,7 +2419,7 @@ private function createGlobalStateSnapshot(bool $backupGlobals): Snapshot false, false, false, - false + false, ); } @@ -2435,13 +2435,13 @@ private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after): $this->compareGlobalStateSnapshotPart( $before->globalVariables(), $after->globalVariables(), - "--- Global variables before the test\n+++ Global variables after the test\n" + "--- Global variables before the test\n+++ Global variables after the test\n", ); $this->compareGlobalStateSnapshotPart( $before->superGlobalVariables(), $after->superGlobalVariables(), - "--- Super-global variables before the test\n+++ Super-global variables after the test\n" + "--- Super-global variables before the test\n+++ Super-global variables after the test\n", ); } @@ -2449,7 +2449,7 @@ private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after): $this->compareGlobalStateSnapshotPart( $before->staticAttributes(), $after->staticAttributes(), - "--- Static attributes before the test\n+++ Static attributes after the test\n" + "--- Static attributes before the test\n+++ Static attributes after the test\n", ); } } @@ -2465,11 +2465,11 @@ private function compareGlobalStateSnapshotPart(array $before, array $after, str $diff = $differ->diff( $exporter->export($before), - $exporter->export($after) + $exporter->export($after), ); throw new RiskyTestError( - $diff + $diff, ); } } @@ -2527,7 +2527,7 @@ private function registerMockObjectsFromTestArguments(array $testArguments, arra $this->registerMockObjectsFromTestArguments( $testArgument, - $visited + $visited, ); } } @@ -2538,7 +2538,7 @@ private function setDoesNotPerformAssertionsFromAnnotation(): void { $annotations = TestUtil::parseTestMethodAnnotations( static::class, - $this->name + $this->name, ); if (isset($annotations['method']['doesNotPerformAssertions'])) { @@ -2598,7 +2598,7 @@ private function checkExceptionExpectations(Throwable $throwable): bool throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -2660,10 +2660,10 @@ private function isCallableTestMethod(string $dependency): bool private function createMockObject(string $originalClassName): MockObject { return $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->getMock(); + ->disableOriginalConstructor() + ->disableOriginalClone() + ->disableArgumentCloning() + ->disallowMockingUnknownTypes() + ->getMock(); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/TestFailure.php b/app/vendor/phpunit/phpunit/src/Framework/TestFailure.php index 0764bc789..f49dfc355 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/TestFailure.php +++ b/app/vendor/phpunit/phpunit/src/Framework/TestFailure.php @@ -95,7 +95,7 @@ public function toString(): string return sprintf( '%s: %s', $this->testName, - $this->thrownException->getMessage() + $this->thrownException->getMessage(), ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/TestResult.php b/app/vendor/phpunit/phpunit/src/Framework/TestResult.php index 4fde29fac..2c487255f 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/TestResult.php +++ b/app/vendor/phpunit/phpunit/src/Framework/TestResult.php @@ -460,7 +460,7 @@ public function endTest(Test $test, float $time): void 'result' => $test->getResult(), 'size' => TestUtil::getSize( $class, - $test->getName(false) + $test->getName(false), ), ]; @@ -646,7 +646,7 @@ public function run(Test $test): void if ($test instanceof TestCase) { $test->setRegisterMockObjectsFromTestArgumentsRecursively( - $this->registerMockObjectsFromTestArgumentsRecursively + $this->registerMockObjectsFromTestArgumentsRecursively, ); $isAnyCoverageRequired = TestUtil::requiresCodeCoverageDataCollection($test); @@ -667,7 +667,7 @@ public function run(Test $test): void $this->convertDeprecationsToExceptions, $this->convertErrorsToExceptions, $this->convertNoticesToExceptions, - $this->convertWarningsToExceptions + $this->convertWarningsToExceptions, ); $errorHandler->register(); @@ -731,9 +731,9 @@ function_exists('xdebug_start_function_monitor'); $this->addFailure( $test, new RiskyTestError( - $e->getMessage() + $e->getMessage(), ), - $_timeout + $_timeout, ); $risky = true; @@ -758,10 +758,10 @@ function_exists('xdebug_start_function_monitor'); '%s in %s:%s', $e->getMessage(), $frame['file'] ?? $e->getFile(), - $frame['line'] ?? $e->getLine() + $frame['line'] ?? $e->getLine(), ), 0, - $e + $e, ); } catch (Warning $e) { $warning = true; @@ -794,16 +794,17 @@ function_exists('xdebug_start_function_monitor'); '%s() used in %s:%s', $function['function'], $function['filename'], - $function['lineno'] - ) + $function['lineno'], + ), ), - $time + $time, ); } } } if ($this->beStrictAboutTestsThatDoNotTestAnything && + !$test->doesNotPerformAssertions() && $test->getNumAssertions() === 0) { $risky = true; } @@ -811,7 +812,7 @@ function_exists('xdebug_start_function_monitor'); if ($this->forceCoversAnnotation && !$error && !$failure && !$warning && !$incomplete && !$skipped && !$risky) { $annotations = TestUtil::parseTestMethodAnnotations( get_class($test), - $test->getName(false) + $test->getName(false), ); if (!isset($annotations['class']['covers']) && @@ -821,9 +822,9 @@ function_exists('xdebug_start_function_monitor'); $this->addFailure( $test, new MissingCoversAnnotationException( - 'This test does not have a @covers annotation but is expected to have one' + 'This test does not have a @covers annotation but is expected to have one', ), - $time + $time, ); $risky = true; @@ -839,20 +840,20 @@ function_exists('xdebug_start_function_monitor'); try { $linesToBeCovered = TestUtil::getLinesToBeCovered( get_class($test), - $test->getName(false) + $test->getName(false), ); $linesToBeUsed = TestUtil::getLinesToBeUsed( get_class($test), - $test->getName(false) + $test->getName(false), ); } catch (InvalidCoversTargetException $cce) { $this->addWarning( $test, new Warning( - $cce->getMessage() + $cce->getMessage(), ), - $time + $time, ); } } @@ -861,12 +862,12 @@ function_exists('xdebug_start_function_monitor'); $this->codeCoverage->stop( $append, $linesToBeCovered, - $linesToBeUsed + $linesToBeUsed, ); } catch (UnintentionallyCoveredCodeException $cce) { $unintentionallyCoveredCodeError = new UnintentionallyCoveredCodeError( 'This test executed code that is not listed as code to be covered or used:' . - PHP_EOL . $cce->getMessage() + PHP_EOL . $cce->getMessage(), ); } catch (OriginalCodeCoverageException $cce) { $error = true; @@ -891,7 +892,7 @@ function_exists('xdebug_start_function_monitor'); $this->addFailure( $test, $unintentionallyCoveredCodeError, - $time + $time, ); } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && !$test->doesNotPerformAssertions() && @@ -903,7 +904,7 @@ function_exists('xdebug_start_function_monitor'); throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -918,7 +919,7 @@ function_exists('xdebug_start_function_monitor'); throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -930,10 +931,10 @@ function_exists('xdebug_start_function_monitor'); sprintf( "This test did not perform any assertions\n\n%s:%d", $reflected->getFileName(), - $reflected->getStartLine() - ) + $reflected->getStartLine(), + ), ), - $time + $time, ); } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && $test->doesNotPerformAssertions() && @@ -943,10 +944,10 @@ function_exists('xdebug_start_function_monitor'); new RiskyTestError( sprintf( 'This test is annotated with "@doesNotPerformAssertions" but performed %d assertions', - $test->getNumAssertions() - ) + $test->getNumAssertions(), + ), ), - $time + $time, ); } elseif ($this->beStrictAboutOutputDuringTests && $test->hasOutput()) { $this->addFailure( @@ -954,24 +955,24 @@ function_exists('xdebug_start_function_monitor'); new OutputError( sprintf( 'This test printed output: %s', - $test->getActualOutput() - ) + $test->getActualOutput(), + ), ), - $time + $time, ); } elseif ($this->beStrictAboutTodoAnnotatedTests && $test instanceof TestCase) { $annotations = TestUtil::parseTestMethodAnnotations( get_class($test), - $test->getName(false) + $test->getName(false), ); if (isset($annotations['method']['todo'])) { $this->addFailure( $test, new RiskyTestError( - 'Test method is annotated with @todo' + 'Test method is annotated with @todo', ), - $time + $time, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php b/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php index e7cef62ee..f537eb930 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php +++ b/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php @@ -166,7 +166,7 @@ public function __construct($theClass = '', string $name = '') if (!is_string($theClass) && !$theClass instanceof ReflectionClass) { throw InvalidArgumentException::create( 1, - 'ReflectionClass object or string' + 'ReflectionClass object or string', ); } @@ -184,7 +184,7 @@ public function __construct($theClass = '', string $name = '') throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -215,9 +215,9 @@ public function __construct($theClass = '', string $name = '') new WarningTestCase( sprintf( 'Class "%s" has no public constructor.', - $theClass->getName() - ) - ) + $theClass->getName(), + ), + ), ); return; @@ -236,9 +236,9 @@ public function __construct($theClass = '', string $name = '') new WarningTestCase( sprintf( 'No tests found in class "%s".', - $theClass->getName() - ) - ) + $theClass->getName(), + ), + ), ); } @@ -267,7 +267,7 @@ public function addTest(Test $test, $groups = []): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -310,7 +310,7 @@ public function addTestSuite($testClass): void if (!(is_object($testClass) || (is_string($testClass) && class_exists($testClass)))) { throw InvalidArgumentException::create( 1, - 'class name or object' + 'class name or object', ); } @@ -322,7 +322,7 @@ public function addTestSuite($testClass): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -336,21 +336,21 @@ public function addTestSuite($testClass): void if (!$testClass->isAbstract() && $testClass->hasMethod(BaseTestRunner::SUITE_METHODNAME)) { try { $method = $testClass->getMethod( - BaseTestRunner::SUITE_METHODNAME + BaseTestRunner::SUITE_METHODNAME, ); // @codeCoverageIgnoreStart } catch (ReflectionException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd if ($method->isStatic()) { $this->addTest( - $method->invoke(null, $testClass->getName()) + $method->invoke(null, $testClass->getName()), ); $suiteMethod = true; @@ -425,7 +425,7 @@ public function addTestFile(string $filename): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -447,7 +447,7 @@ public function addTestFile(string $filename): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -460,8 +460,8 @@ public function addTestFile(string $filename): void $this->addWarning( sprintf( 'Abstract test case classes with "Test" suffix are deprecated (%s)', - $class->getName() - ) + $class->getName(), + ), ); } @@ -469,14 +469,14 @@ public function addTestFile(string $filename): void if ($class->hasMethod(BaseTestRunner::SUITE_METHODNAME)) { try { $method = $class->getMethod( - BaseTestRunner::SUITE_METHODNAME + BaseTestRunner::SUITE_METHODNAME, ); // @codeCoverageIgnoreStart } catch (ReflectionException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -493,7 +493,7 @@ public function addTestFile(string $filename): void $expectedClassName = substr( $expectedClassName, 0, - $pos + $pos, ); } @@ -503,8 +503,8 @@ public function addTestFile(string $filename): void "Test case class not matching filename is deprecated\n in %s\n Class name was '%s', expected '%s'", $filename, $class->getShortName(), - $expectedClassName - ) + $expectedClassName, + ), ); } @@ -517,8 +517,8 @@ public function addTestFile(string $filename): void $this->addWarning( sprintf( "Multiple test case classes per file is deprecated\n in %s", - $filename - ) + $filename, + ), ); } @@ -573,7 +573,7 @@ static function ($key): string { return (string) $key; }, - array_keys($this->groups) + array_keys($this->groups), ); } @@ -628,7 +628,7 @@ public function run(TestResult $result = null): TestResult call_user_func([$this->name, $beforeClassMethod]); } } - } catch (SkippedTestSuiteError|SkippedTestError $error) { + } catch (SkippedTestError|SkippedTestSuiteError $error) { foreach ($this->tests() as $test) { $result->startTest($test); $result->addFailure($test, $error, 0); @@ -656,7 +656,7 @@ public function run(TestResult $result = null): TestResult $result->addFailure( $test, new SkippedTestError('Test skipped because of an error in hook method'), - 0 + 0, ); } @@ -857,7 +857,7 @@ public function requires(): array } $this->requiredTests = ExecutionOrderDependency::mergeUnique( ExecutionOrderDependency::filterInvalid($this->requiredTests), - $test->requires() + $test->requires(), ); } @@ -891,13 +891,13 @@ protected function addTestMethod(ReflectionClass $class, ReflectionMethod $metho if ($test instanceof TestCase || $test instanceof DataProviderTestSuite) { $test->setDependencies( - TestUtil::getDependencies($class->getName(), $methodName) + TestUtil::getDependencies($class->getName(), $methodName), ); } $this->addTest( $test, - TestUtil::getGroups($class->getName(), $methodName) + TestUtil::getGroups($class->getName(), $methodName), ); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php b/app/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php index 76b12fcfb..27c9d8b4c 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php +++ b/app/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php @@ -67,7 +67,7 @@ public function getChildren(): self { if (!$this->hasChildren()) { throw new NoChildTestSuiteException( - 'The current item is not a TestSuite instance and therefore does not have any children.' + 'The current item is not a TestSuite instance and therefore does not have any children.', ); } diff --git a/app/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php b/app/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php index 75a70ca5f..bbef329fc 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php +++ b/app/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php @@ -91,7 +91,7 @@ public function getTest(string $suiteClassFile, $suffixes = ''): ?TestSuite /** @var string[] $files */ $files = (new FileIteratorFacade)->getFilesAsArray( $suiteClassFile, - $suffixes + $suffixes, ); $suite = new TestSuite($suiteClassFile); @@ -109,7 +109,7 @@ public function getTest(string $suiteClassFile, $suffixes = ''): ?TestSuite try { $testClass = $this->loadSuiteClass( - $suiteClassFile + $suiteClassFile, ); } catch (\PHPUnit\Exception $e) { $this->runFailed($e->getMessage()); @@ -122,7 +122,7 @@ public function getTest(string $suiteClassFile, $suffixes = ''): ?TestSuite if (!$suiteMethod->isStatic()) { $this->runFailed( - 'suite() method must be static.' + 'suite() method must be static.', ); return null; diff --git a/app/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php b/app/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php index cc22b2508..f9d8a90d1 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php +++ b/app/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php @@ -107,7 +107,7 @@ public function load(): void $data = json_decode( file_get_contents($this->cacheFilename), - true + true, ); if ($data === null) { @@ -138,8 +138,8 @@ public function persist(): void throw new Exception( sprintf( 'Cannot create directory "%s" for result cache file', - $this->cacheFilename - ) + $this->cacheFilename, + ), ); } @@ -150,9 +150,9 @@ public function persist(): void 'version' => self::VERSION, 'defects' => $this->defects, 'times' => $this->times, - ] + ], ), - LOCK_EX + LOCK_EX, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php b/app/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php index 88f7ccad0..c57e70e72 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php +++ b/app/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php @@ -35,8 +35,8 @@ public function registerExtension(Extension $extensionConfiguration, TestRunner throw new Exception( sprintf( 'Class "%s" does not implement a PHPUnit\Runner\Hook interface', - $extensionConfiguration->className() - ) + $extensionConfiguration->className(), + ), ); } @@ -56,8 +56,8 @@ public function createTestListenerInstance(Extension $listenerConfiguration): Te throw new Exception( sprintf( 'Class "%s" does not implement the PHPUnit\Framework\TestListener interface', - $listenerConfiguration->className() - ) + $listenerConfiguration->className(), + ), ); } @@ -77,7 +77,7 @@ private function createInstance(Extension $extensionConfiguration): object throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -110,8 +110,8 @@ private function ensureClassExists(Extension $extensionConfiguration): void throw new Exception( sprintf( 'Class "%s" does not exist', - $extensionConfiguration->className() - ) + $extensionConfiguration->className(), + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php b/app/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php index e76e12ceb..c65b19482 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php +++ b/app/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php @@ -9,7 +9,11 @@ */ namespace PHPUnit\Runner\Extension; +use function count; +use function explode; +use function implode; use function is_file; +use function strpos; use PharIo\Manifest\ApplicationName; use PharIo\Manifest\Exception as ManifestException; use PharIo\Manifest\ManifestLoader; @@ -39,7 +43,7 @@ public function loadPharExtensionsInDirectory(string $directory): array try { $applicationName = new ApplicationName('phpunit/phpunit'); - $version = new PharIoVersion(Version::series()); + $version = new PharIoVersion($this->phpunitVersion()); $manifest = ManifestLoader::fromFile('phar://' . $file . '/manifest.xml'); if (!$manifest->isExtensionFor($applicationName)) { @@ -74,4 +78,21 @@ public function loadPharExtensionsInDirectory(string $directory): array 'notLoadedExtensions' => $notLoadedExtensions, ]; } + + private function phpunitVersion(): string + { + $version = Version::id(); + + if (strpos($version, '-') === false) { + return $version; + } + + $parts = explode('.', explode('-', $version)[0]); + + if (count($parts) === 2) { + $parts[] = 0; + } + + return implode('.', $parts); + } } diff --git a/app/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php b/app/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php index 3f79da541..b7d83b9f8 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php +++ b/app/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php @@ -39,8 +39,8 @@ public function addFilter(ReflectionClass $filter, $args): void throw new Exception( sprintf( 'Class "%s" does not extend RecursiveFilterIterator', - $filter->name - ) + $filter->name, + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php b/app/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php index 42ca77a38..b203c1960 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php +++ b/app/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php @@ -35,7 +35,7 @@ public function __construct(RecursiveIterator $iterator, array $groups, TestSuit if (in_array((string) $group, $groups, true)) { $testHashes = array_map( 'spl_object_hash', - $tests + $tests, ); $this->groupTests = array_merge($this->groupTests, $testHashes); diff --git a/app/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php b/app/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php index 7057e1c47..45c62f056 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php +++ b/app/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php @@ -96,7 +96,7 @@ private function setFilter(string $filter): void if (isset($matches[3]) && $matches[2] < $matches[3]) { $filter = sprintf( '%s.*with data set #(\d+)$', - $matches[1] + $matches[1], ); $this->filterMin = (int) $matches[2]; @@ -105,7 +105,7 @@ private function setFilter(string $filter): void $filter = sprintf( '%s.*with data set #%s$', $matches[1], - $matches[2] + $matches[2], ); } } // Handles: @@ -115,7 +115,7 @@ private function setFilter(string $filter): void $filter = sprintf( '%s.*with data set "%s"$', $matches[1], - $matches[2] + $matches[2], ); } @@ -126,8 +126,8 @@ private function setFilter(string $filter): void str_replace( '/', '\\/', - $filter - ) + $filter, + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php b/app/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php index 6590102d7..988b0ece4 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php +++ b/app/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php @@ -91,8 +91,8 @@ public function __construct(string $filename, AbstractPhpProcess $phpUtil = null throw new Exception( sprintf( 'File "%s" does not exist.', - $filename - ) + $filename, + ), ); } @@ -223,7 +223,7 @@ public function run(TestResult $result = null): TestResult $trace[0]['file'], $trace[0]['line'], $trace, - $comparisonFailure ? $diff : '' + $comparisonFailure ? $diff : '', ); } @@ -408,7 +408,7 @@ private function runSkip(array &$sections, TestResult $result, array $settings): $result->addFailure( $this, new SyntheticSkippedError($message, 0, $trace[0]['file'], $trace[0]['line'], $trace), - 0 + 0, ); $result->endTest($this, 0); @@ -489,7 +489,7 @@ private function parse(): array foreach ($unsupportedSections as $section) { if (isset($sections[$section])) { throw new Exception( - "PHPUnit does not support PHPT {$section} sections" + "PHPUnit does not support PHPT {$section} sections", ); } } @@ -520,8 +520,8 @@ private function parseExternal(array &$sections): void sprintf( 'Could not load --%s-- %s for PHPT file', $section . '_EXTERNAL', - $testDirectory . $externalFilename - ) + $testDirectory . $externalFilename, + ), ); } @@ -579,7 +579,7 @@ private function render(string $code): string "'" . dirname($this->filename) . "'", "'" . $this->filename . "'", ], - $code + $code, ); } @@ -599,7 +599,7 @@ private function renderForCoverage(string &$job, bool $pathCoverage, ?string $co $files = $this->getCoverageFiles(); $template = new Template( - __DIR__ . '/../Util/PHP/Template/PhptTestCase.tpl' + __DIR__ . '/../Util/PHP/Template/PhptTestCase.tpl', ); $composerAutoload = '\'\''; @@ -619,7 +619,7 @@ private function renderForCoverage(string &$job, bool $pathCoverage, ?string $co if (!empty($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { $globals = '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = ' . var_export( $GLOBALS['__PHPUNIT_BOOTSTRAP'], - true + true, ) . ";\n"; } @@ -638,7 +638,7 @@ private function renderForCoverage(string &$job, bool $pathCoverage, ?string $co 'coverageFile' => $files['coverage'], 'driverMethod' => $pathCoverage ? 'forLineAndPathCoverage' : 'forLineCoverage', 'codeCoverageCacheDirectory' => $codeCoverageCacheDirectory, - ] + ], ); file_put_contents($files['job'], $job); diff --git a/app/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php b/app/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php index 0ed8330ed..f957e81ac 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php +++ b/app/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php @@ -43,7 +43,7 @@ public function load(string $suiteClassFile): ReflectionClass FileLoader::checkAndLoad($suiteClassFile); $loadedClasses = array_values( - array_diff(get_declared_classes(), $loadedClasses) + array_diff(get_declared_classes(), $loadedClasses), ); if (empty($loadedClasses)) { @@ -51,8 +51,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Class %s could not be found in %s', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } } @@ -76,8 +76,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Class %s could not be found in %s', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } @@ -88,7 +88,7 @@ public function load(string $suiteClassFile): ReflectionClass throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -99,8 +99,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Class %s declared in %s is abstract', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } @@ -116,8 +116,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Method %s::suite() declared in %s is abstract', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } @@ -126,8 +126,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Method %s::suite() declared in %s is not public', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } @@ -136,8 +136,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Method %s::suite() declared in %s is not static', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php b/app/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php index 64ad845cf..9ec82b600 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php +++ b/app/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php @@ -123,7 +123,7 @@ public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDepend if (!in_array($order, $allowedOrders, true)) { throw new Exception( - '$order must be one of TestSuiteSorter::ORDER_[DEFAULT|REVERSED|RANDOMIZED|DURATION|SIZE]' + '$order must be one of TestSuiteSorter::ORDER_[DEFAULT|REVERSED|RANDOMIZED|DURATION|SIZE]', ); } @@ -134,7 +134,7 @@ public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDepend if (!in_array($orderDefects, $allowedOrderDefects, true)) { throw new Exception( - '$orderDefects must be one of TestSuiteSorter::ORDER_DEFAULT, TestSuiteSorter::ORDER_DEFECTS_FIRST' + '$orderDefects must be one of TestSuiteSorter::ORDER_DEFAULT, TestSuiteSorter::ORDER_DEFECTS_FIRST', ); } @@ -240,7 +240,7 @@ private function sortDefectsFirst(array $tests): array function ($left, $right) { return $this->cmpDefectPriorityAndTime($left, $right); - } + }, ); return $tests; @@ -256,7 +256,7 @@ private function sortByDuration(array $tests): array function ($left, $right) { return $this->cmpDuration($left, $right); - } + }, ); return $tests; @@ -272,7 +272,7 @@ private function sortBySize(array $tests): array function ($left, $right) { return $this->cmpSize($left, $right); - } + }, ); return $tests; diff --git a/app/vendor/phpunit/phpunit/src/Runner/Version.php b/app/vendor/phpunit/phpunit/src/Runner/Version.php index 70de30249..5c253c9b4 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/Version.php +++ b/app/vendor/phpunit/phpunit/src/Runner/Version.php @@ -41,7 +41,7 @@ public static function id(): string } if (self::$version === '') { - self::$version = (new VersionId('9.6.3', dirname(__DIR__, 2)))->getVersion(); + self::$version = (new VersionId('9.6.10', dirname(__DIR__, 2)))->getVersion(); } return self::$version; diff --git a/app/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php b/app/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php index 9030b1dbe..51f0a5131 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php @@ -121,7 +121,6 @@ final class Builder 'whitelist=', 'dump-xdebug-filter=', ]; - private const SHORT_OPTIONS = 'd:c:hv'; public function fromParameters(array $parameters, array $additionalLongOptions): Configuration @@ -130,13 +129,13 @@ public function fromParameters(array $parameters, array $additionalLongOptions): $options = (new CliParser)->parse( $parameters, self::SHORT_OPTIONS, - array_merge(self::LONG_OPTIONS, $additionalLongOptions) + array_merge(self::LONG_OPTIONS, $additionalLongOptions), ); } catch (CliParserException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -881,7 +880,7 @@ public function fromParameters(array $parameters, array $additionalLongOptions): $verbose, $version, $coverageFilter, - $xdebugFilterFile + $xdebugFilterFile, ); } } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/Command.php b/app/vendor/phpunit/phpunit/src/TextUI/Command.php index 48243caa8..31f71795f 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/Command.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/Command.php @@ -99,7 +99,7 @@ public static function main(bool $exit = true): int throw new RuntimeException( $t->getMessage(), (int) $t->getCode(), - $t + $t, ); } } @@ -118,7 +118,7 @@ public function run(array $argv, bool $exit = true): int } else { $suite = $runner->getTest( $this->arguments['test'], - $this->arguments['testSuffixes'] + $this->arguments['testSuffixes'], ); } @@ -256,8 +256,8 @@ protected function handleArguments(array $argv): void $this->exitWithErrorMessage( sprintf( 'unrecognized --order-by option: %s', - $arguments->unrecognizedOrderBy() - ) + $arguments->unrecognizedOrderBy(), + ), ); } @@ -270,7 +270,7 @@ protected function handleArguments(array $argv): void if ($arguments->hasIncludePath()) { ini_set( 'include_path', - $arguments->includePath() . PATH_SEPARATOR . ini_get('include_path') + $arguments->includePath() . PATH_SEPARATOR . ini_get('include_path'), ); } @@ -290,8 +290,8 @@ protected function handleArguments(array $argv): void $this->exitWithErrorMessage( sprintf( 'Cannot open file "%s".', - $arguments->argument() - ) + $arguments->argument(), + ), ); } } @@ -367,7 +367,7 @@ protected function handleArguments(array $argv): void $this->arguments['printer'] = $this->handlePrinter( $phpunitConfiguration->printerClass(), - $file + $file, ); } @@ -376,7 +376,7 @@ protected function handleArguments(array $argv): void $this->arguments['loader'] = $this->handleLoader( $phpunitConfiguration->testSuiteLoaderClass(), - $file + $file, ); } @@ -388,7 +388,7 @@ protected function handleArguments(array $argv): void try { $this->arguments['test'] = (new TestSuiteMapper)->map( $this->arguments['configurationObject']->testSuite(), - $this->arguments['testsuite'] ?? '' + $this->arguments['testsuite'] ?? '', ); } catch (Exception $e) { $this->printVersionString(); @@ -429,7 +429,7 @@ protected function handleLoader(string $loaderClass, string $loaderFile = ''): ? if (!class_exists($loaderClass, false)) { if ($loaderFile == '') { $loaderFile = Filesystem::classNameToFilename( - $loaderClass + $loaderClass, ); } @@ -453,7 +453,7 @@ protected function handleLoader(string $loaderClass, string $loaderFile = ''): ? throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -474,8 +474,8 @@ protected function handleLoader(string $loaderClass, string $loaderFile = ''): ? $this->exitWithErrorMessage( sprintf( 'Could not use "%s" as loader.', - $loaderClass - ) + $loaderClass, + ), ); return null; @@ -491,7 +491,7 @@ protected function handlePrinter(string $printerClass, string $printerFile = '') if (!class_exists($printerClass, false)) { if ($printerFile === '') { $printerFile = Filesystem::classNameToFilename( - $printerClass + $printerClass, ); } @@ -511,8 +511,8 @@ protected function handlePrinter(string $printerClass, string $printerFile = '') $this->exitWithErrorMessage( sprintf( 'Could not use "%s" as printer: class does not exist', - $printerClass - ) + $printerClass, + ), ); } @@ -523,7 +523,7 @@ protected function handlePrinter(string $printerClass, string $printerFile = '') throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); // @codeCoverageIgnoreEnd } @@ -533,8 +533,8 @@ protected function handlePrinter(string $printerClass, string $printerFile = '') sprintf( 'Could not use "%s" as printer: class does not implement %s', $printerClass, - ResultPrinter::class - ) + ResultPrinter::class, + ), ); } @@ -542,8 +542,8 @@ protected function handlePrinter(string $printerClass, string $printerFile = '') $this->exitWithErrorMessage( sprintf( 'Could not use "%s" as printer: class cannot be instantiated', - $printerClass - ) + $printerClass, + ), ); } @@ -568,16 +568,29 @@ protected function handleBootstrap(string $filename): void $this->exitWithErrorMessage($t->getMessage()); } - $this->exitWithErrorMessage( - sprintf( - 'Error in bootstrap script: %s:%s%s%s%s', + $message = sprintf( + 'Error in bootstrap script: %s:%s%s%s%s', + get_class($t), + PHP_EOL, + $t->getMessage(), + PHP_EOL, + $t->getTraceAsString(), + ); + + while ($t = $t->getPrevious()) { + $message .= sprintf( + '%s%sPrevious error: %s:%s%s%s%s', + PHP_EOL, + PHP_EOL, get_class($t), PHP_EOL, $t->getMessage(), PHP_EOL, - $t->getTraceAsString() - ) - ); + $t->getTraceAsString(), + ); + } + + $this->exitWithErrorMessage($message); } } @@ -592,7 +605,7 @@ protected function handleVersionCheck(): void printf( 'You are not using the latest version of PHPUnit.' . PHP_EOL . 'The latest version is PHPUnit %s.' . PHP_EOL, - $latestVersion + $latestVersion, ); } else { print 'You are using the latest version of PHPUnit.' . PHP_EOL; @@ -648,7 +661,7 @@ private function handleListGroups(TestSuite $suite, bool $exit): int 'groups', 'excludeGroups', 'testsuite', - ] + ], ); print 'Available test group(s):' . PHP_EOL; @@ -663,7 +676,7 @@ private function handleListGroups(TestSuite $suite, bool $exit): int printf( ' - %s' . PHP_EOL, - $group + $group, ); } @@ -689,7 +702,7 @@ private function handleListSuites(bool $exit): int 'groups', 'excludeGroups', 'testsuite', - ] + ], ); print 'Available test suite(s):' . PHP_EOL; @@ -697,7 +710,7 @@ private function handleListSuites(bool $exit): int foreach ($this->arguments['configurationObject']->testSuite() as $testSuite) { printf( ' - %s' . PHP_EOL, - $testSuite->name() + $testSuite->name(), ); } @@ -721,7 +734,7 @@ private function handleListTests(TestSuite $suite, bool $exit): int 'filter', 'groups', 'excludeGroups', - ] + ], ); $renderer = new TextTestListRenderer; @@ -748,7 +761,7 @@ private function handleListTestsXml(TestSuite $suite, string $target, bool $exit 'filter', 'groups', 'excludeGroups', - ] + ], ); $renderer = new XmlTestListRenderer; @@ -757,7 +770,7 @@ private function handleListTestsXml(TestSuite $suite, string $target, bool $exit printf( 'Wrote list of tests that would have been run to %s' . PHP_EOL, - $target + $target, ); if ($exit) { @@ -813,8 +826,8 @@ private function generateConfiguration(): void $bootstrapScript, $testsDirectory, $src, - $cacheDirectory - ) + $cacheDirectory, + ), ); print PHP_EOL . 'Generated phpunit.xml in ' . getcwd() . '.' . PHP_EOL; @@ -840,7 +853,7 @@ private function migrateConfiguration(string $filename): void try { file_put_contents( $filename, - (new Migrator)->migrate($filename) + (new Migrator)->migrate($filename), ); print 'Migrated configuration: ' . $filename . PHP_EOL; @@ -893,7 +906,7 @@ private function handleWarmCoverageCache(XmlConfiguration\Configuration $configu if ($configuration->codeCoverage()->hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()) { (new FilterMapper)->map( $filter, - $configuration->codeCoverage() + $configuration->codeCoverage(), ); } elseif (isset($this->arguments['coverageFilter'])) { if (!is_array($this->arguments['coverageFilter'])) { @@ -920,7 +933,7 @@ private function handleWarmCoverageCache(XmlConfiguration\Configuration $configu $cacheDirectory, !$configuration->codeCoverage()->disableCodeCoverageIgnore(), $configuration->codeCoverage()->ignoreDeprecatedCodeUnits(), - $filter + $filter, ); print 'done [' . $timer->stop()->asString() . ']' . PHP_EOL; @@ -958,7 +971,7 @@ private function warnAboutConflictingOptions(string $key, array $keys): void 'The %s and %s options cannot be combined, %s is ignored' . PHP_EOL, $this->mapKeyToOptionForWarning($_key), $this->mapKeyToOptionForWarning($key), - $this->mapKeyToOptionForWarning($_key) + $this->mapKeyToOptionForWarning($_key), ); $warningPrinted = true; diff --git a/app/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php b/app/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php index 99f0fa9d6..09de8588a 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php @@ -47,23 +47,15 @@ */ class DefaultResultPrinter extends Printer implements ResultPrinter { - public const EVENT_TEST_START = 0; - - public const EVENT_TEST_END = 1; - + public const EVENT_TEST_START = 0; + public const EVENT_TEST_END = 1; public const EVENT_TESTSUITE_START = 2; - - public const EVENT_TESTSUITE_END = 3; - - public const COLOR_NEVER = 'never'; - - public const COLOR_AUTO = 'auto'; - - public const COLOR_ALWAYS = 'always'; - - public const COLOR_DEFAULT = self::COLOR_NEVER; - - private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS]; + public const EVENT_TESTSUITE_END = 3; + public const COLOR_NEVER = 'never'; + public const COLOR_AUTO = 'auto'; + public const COLOR_ALWAYS = 'always'; + public const COLOR_DEFAULT = self::COLOR_NEVER; + private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS]; /** * @var int @@ -150,7 +142,7 @@ public function __construct($out = null, bool $verbose = false, string $colors = if (!in_array($colors, self::AVAILABLE_COLORS, true)) { throw InvalidArgumentException::create( 3, - vsprintf('value from "%s", "%s" or "%s"', self::AVAILABLE_COLORS) + vsprintf('value from "%s", "%s" or "%s"', self::AVAILABLE_COLORS), ); } @@ -279,8 +271,8 @@ public function startTest(Test $test): void $this->write( sprintf( "Test '%s' started\n", - \PHPUnit\Util\Test::describeAsString($test) - ) + \PHPUnit\Util\Test::describeAsString($test), + ), ); } } @@ -294,8 +286,8 @@ public function endTest(Test $test, float $time): void $this->write( sprintf( "Test '%s' ended\n", - \PHPUnit\Util\Test::describeAsString($test) - ) + \PHPUnit\Util\Test::describeAsString($test), + ), ); } @@ -334,8 +326,8 @@ protected function printDefects(array $defects, string $type): void ($count == 1) ? 'was' : 'were', $count, $type, - ($count == 1) ? '' : 's' - ) + ($count == 1) ? '' : 's', + ), ); $i = 1; @@ -363,8 +355,8 @@ protected function printDefectHeader(TestFailure $defect, int $count): void sprintf( "\n%d) %s\n", $count, - $defect->getTestName() - ) + $defect->getTestName(), + ), ); } @@ -421,7 +413,7 @@ protected function printFooter(TestResult $result): void if (count($result) === 0) { $this->writeWithColor( 'fg-black, bg-yellow', - 'No tests executed!' + 'No tests executed!', ); return; @@ -435,8 +427,8 @@ protected function printFooter(TestResult $result): void count($result), (count($result) === 1) ? '' : 's', $this->numAssertions, - ($this->numAssertions === 1) ? '' : 's' - ) + ($this->numAssertions === 1) ? '' : 's', + ), ); return; @@ -451,7 +443,7 @@ protected function printFooter(TestResult $result): void $this->writeWithColor( $color, - 'OK, but incomplete, skipped, or risky tests!' + 'OK, but incomplete, skipped, or risky tests!', ); } else { $this->write("\n"); @@ -461,21 +453,21 @@ protected function printFooter(TestResult $result): void $this->writeWithColor( $color, - 'ERRORS!' + 'ERRORS!', ); } elseif ($result->failureCount()) { $color = 'fg-white, bg-red'; $this->writeWithColor( $color, - 'FAILURES!' + 'FAILURES!', ); } elseif ($result->warningCount()) { $color = 'fg-black, bg-yellow'; $this->writeWithColor( $color, - 'WARNINGS!' + 'WARNINGS!', ); } } @@ -512,8 +504,8 @@ protected function writeProgress(string $progress): void $this->numTestsWidth . 'd (%3s%%)', $this->numTestsRun, $this->numTests, - floor(($this->numTestsRun / $this->numTests) * 100) - ) + floor(($this->numTestsRun / $this->numTests) * 100), + ), ); if ($this->column == $this->maxColumn) { @@ -582,9 +574,9 @@ private function writeCountString(int $count, string $name, string $color, bool '%s%s: %d', !$first ? ', ' : '', $name, - $count + $count, ), - false + false, ); $first = false; diff --git a/app/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php b/app/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php index 770ad8742..af387beae 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php @@ -22,8 +22,8 @@ public function __construct(string $path) parent::__construct( sprintf( 'Test directory "%s" not found', - $path - ) + $path, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php b/app/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php index 7ffd2c78c..3b534f7e7 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php @@ -22,8 +22,8 @@ public function __construct(string $path) parent::__construct( sprintf( 'Test file "%s" not found', - $path - ) + $path, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/Help.php b/app/vendor/phpunit/phpunit/src/TextUI/Help.php index 084f2a218..7df19ba54 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/Help.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/Help.php @@ -27,8 +27,7 @@ final class Help { private const LEFT_MARGIN = ' '; - - private const HELP_TEXT = [ + private const HELP_TEXT = [ 'Usage' => [ ['text' => 'phpunit [options] UnitTest.php'], ['text' => 'phpunit [options] '], @@ -247,7 +246,7 @@ static function ($matches) { return Color::colorize('fg-cyan', $matches[0]); }, - $arg + $arg, ); $desc = explode(PHP_EOL, wordwrap($option['desc'], $this->maxDescLength, PHP_EOL)); diff --git a/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php b/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php index c1362f3a5..4f9d280c9 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php @@ -88,10 +88,8 @@ */ final class TestRunner extends BaseTestRunner { - public const SUCCESS_EXIT = 0; - - public const FAILURE_EXIT = 1; - + public const SUCCESS_EXIT = 0; + public const FAILURE_EXIT = 1; public const EXCEPTION_EXIT = 2; /** @@ -309,7 +307,7 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -343,8 +341,8 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ new HtmlResultPrinter( $arguments['testdoxHTMLFile'], $arguments['testdoxGroups'], - $arguments['testdoxExcludeGroups'] - ) + $arguments['testdoxExcludeGroups'], + ), ); } @@ -353,22 +351,22 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ new TextResultPrinter( $arguments['testdoxTextFile'], $arguments['testdoxGroups'], - $arguments['testdoxExcludeGroups'] - ) + $arguments['testdoxExcludeGroups'], + ), ); } if (isset($arguments['testdoxXMLFile'])) { $result->addListener( new XmlResultPrinter( - $arguments['testdoxXMLFile'] - ) + $arguments['testdoxXMLFile'], + ), ); } if (isset($arguments['teamcityLogfile'])) { $result->addListener( - new TeamCity($arguments['teamcityLogfile']) + new TeamCity($arguments['teamcityLogfile']), ); } @@ -376,8 +374,8 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $result->addListener( new JUnit( $arguments['junitLogfile'], - $arguments['reportUselessTests'] - ) + $arguments['reportUselessTests'], + ), ); } @@ -434,7 +432,7 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ (new FilterMapper)->map( $this->codeCoverageFilter, - $codeCoverageConfiguration + $codeCoverageConfiguration, ); } } @@ -451,7 +449,7 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $codeCoverage = new CodeCoverage( $codeCoverageDriver, - $this->codeCoverageFilter + $this->codeCoverageFilter, ); if (isset($codeCoverageConfiguration) && $codeCoverageConfiguration->hasCacheDirectory()) { @@ -534,21 +532,21 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $this->writeMessage( 'Configuration', - $arguments['configurationObject']->filename() + $arguments['configurationObject']->filename(), ); } foreach ($arguments['loadedExtensions'] as $extension) { $this->writeMessage( 'Extension', - $extension + $extension, ); } foreach ($arguments['notLoadedExtensions'] as $extension) { $this->writeMessage( 'Extension', - $extension + $extension, ); } } @@ -556,7 +554,7 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ if ($arguments['executionOrder'] === TestSuiteSorter::ORDER_RANDOMIZED) { $this->writeMessage( 'Random Seed', - (string) $arguments['randomOrderSeed'] + (string) $arguments['randomOrderSeed'], ); } @@ -588,7 +586,7 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $this->writeMessage('Suggestion', 'Migrate your XML configuration using "--migrate-configuration"!'); } else { $this->write( - "\n Warning - The configuration file did not pass validation!\n The following problems have been detected:\n" + "\n Warning - The configuration file did not pass validation!\n The following problems have been detected:\n", ); $this->write($arguments['configurationObject']->validationErrors()); @@ -716,8 +714,8 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $arguments['reportHighLowerBound'], sprintf( ' and PHPUnit %s', - Version::id() - ) + Version::id(), + ), ); $writer->process($codeCoverage, $arguments['coverageHtml']); @@ -758,11 +756,11 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $arguments['reportLowUpperBound'], $arguments['reportHighLowerBound'], $arguments['coverageTextShowUncoveredFiles'], - $arguments['coverageTextShowOnlySummary'] + $arguments['coverageTextShowOnlySummary'], ); $outputStream->write( - $processor->process($codeCoverage, $colors) + $processor->process($codeCoverage, $colors), ); } @@ -1025,7 +1023,7 @@ private function handleConfiguration(array &$arguments): void foreach ($arguments['unavailableExtensions'] as $extension) { $arguments['warnings'][] = sprintf( 'Extension "%s" is not available', - $extension + $extension, ); } @@ -1035,7 +1033,7 @@ private function handleConfiguration(array &$arguments): void if ($loggingConfiguration->hasText()) { $arguments['listeners'][] = new DefaultResultPrinter( $loggingConfiguration->text()->target()->path(), - true + true, ); } @@ -1149,14 +1147,14 @@ private function processSuiteFilters(TestSuite $suite, array $arguments): void if (!empty($arguments['excludeGroups'])) { $filterFactory->addFilter( new ReflectionClass(ExcludeGroupFilterIterator::class), - $arguments['excludeGroups'] + $arguments['excludeGroups'], ); } if (!empty($arguments['groups'])) { $filterFactory->addFilter( new ReflectionClass(IncludeGroupFilterIterator::class), - $arguments['groups'] + $arguments['groups'], ); } @@ -1168,8 +1166,8 @@ static function (string $name): string { return '__phpunit_covers_' . $name; }, - $arguments['testsCovering'] - ) + $arguments['testsCovering'], + ), ); } @@ -1181,15 +1179,15 @@ static function (string $name): string { return '__phpunit_uses_' . $name; }, - $arguments['testsUsing'] - ) + $arguments['testsUsing'], + ), ); } if ($arguments['filter']) { $filterFactory->addFilter( new ReflectionClass(NameFilterIterator::class), - $arguments['filter'] + $arguments['filter'], ); } @@ -1206,8 +1204,8 @@ private function writeMessage(string $type, string $message): void sprintf( "%-15s%s\n", $type . ':', - $message - ) + $message, + ), ); $this->messagePrinted = true; @@ -1221,7 +1219,7 @@ private function createPrinter(string $class, array $arguments): ResultPrinter $arguments['colors'], $arguments['debug'], $arguments['columns'], - $arguments['reverseList'] + $arguments['reverseList'], ); assert($object instanceof ResultPrinter); @@ -1234,8 +1232,8 @@ private function codeCoverageGenerationStart(string $format): void $this->write( sprintf( "\nGenerating code coverage report in %s format ... ", - $format - ) + $format, + ), ); $this->timer->start(); @@ -1246,8 +1244,8 @@ private function codeCoverageGenerationSucceeded(): void $this->write( sprintf( "done [%s]\n", - $this->timer->stop()->asString() - ) + $this->timer->stop()->asString(), + ), ); } @@ -1257,8 +1255,8 @@ private function codeCoverageGenerationFailed(\Exception $e): void sprintf( "failed [%s]\n%s\n", $this->timer->stop()->asString(), - $e->getMessage() - ) + $e->getMessage(), + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php b/app/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php index 170e6602b..a0ea593ae 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php @@ -60,7 +60,7 @@ public function map(TestSuiteCollection $configuration, string $filter): TestSui $directory->path(), $directory->suffix(), $directory->prefix(), - $exclude + $exclude, ); if (!empty($files)) { @@ -96,7 +96,7 @@ public function map(TestSuiteCollection $configuration, string $filter): TestSui throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php index 80abfac7d..191113c6e 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php @@ -150,7 +150,7 @@ public function cacheDirectory(): Directory { if (!$this->hasCacheDirectory()) { throw new Exception( - 'No cache directory has been configured' + 'No cache directory has been configured', ); } @@ -222,7 +222,7 @@ public function clover(): Clover { if (!$this->hasClover()) { throw new Exception( - 'Code Coverage report "Clover XML" has not been configured' + 'Code Coverage report "Clover XML" has not been configured', ); } @@ -244,7 +244,7 @@ public function cobertura(): Cobertura { if (!$this->hasCobertura()) { throw new Exception( - 'Code Coverage report "Cobertura XML" has not been configured' + 'Code Coverage report "Cobertura XML" has not been configured', ); } @@ -266,7 +266,7 @@ public function crap4j(): Crap4j { if (!$this->hasCrap4j()) { throw new Exception( - 'Code Coverage report "Crap4J" has not been configured' + 'Code Coverage report "Crap4J" has not been configured', ); } @@ -288,7 +288,7 @@ public function html(): Html { if (!$this->hasHtml()) { throw new Exception( - 'Code Coverage report "HTML" has not been configured' + 'Code Coverage report "HTML" has not been configured', ); } @@ -310,7 +310,7 @@ public function php(): Php { if (!$this->hasPhp()) { throw new Exception( - 'Code Coverage report "PHP" has not been configured' + 'Code Coverage report "PHP" has not been configured', ); } @@ -332,7 +332,7 @@ public function text(): Text { if (!$this->hasText()) { throw new Exception( - 'Code Coverage report "Text" has not been configured' + 'Code Coverage report "Text" has not been configured', ); } @@ -354,7 +354,7 @@ public function xml(): Xml { if (!$this->hasXml()) { throw new Exception( - 'Code Coverage report "XML" has not been configured' + 'Code Coverage report "XML" has not been configured', ); } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php index 102c96ebc..82be60323 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php @@ -22,7 +22,7 @@ public function map(Filter $filter, CodeCoverage $configuration): void $filter->includeDirectory( $directory->path(), $directory->suffix(), - $directory->prefix() + $directory->prefix(), ); } @@ -34,7 +34,7 @@ public function map(Filter $filter, CodeCoverage $configuration): void $filter->excludeDirectory( $directory->path(), $directory->suffix(), - $directory->prefix() + $directory->prefix(), ); } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php index cc77b1a3c..9f6a812a4 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php @@ -67,7 +67,7 @@ public function generateDefaultConfiguration(string $phpunitVersion, string $boo $srcDirectory, $cacheDirectory, ], - self::TEMPLATE + self::TEMPLATE, ); } } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php index c1877317d..adf7dce08 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php @@ -73,7 +73,7 @@ public function load(string $filename): Configuration throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -85,7 +85,7 @@ public function load(string $filename): Configuration throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -100,7 +100,7 @@ public function load(string $filename): Configuration $this->logging($filename, $xpath), $this->php($filename, $xpath), $this->phpunit($filename, $document), - $this->testSuite($filename, $xpath) + $this->testSuite($filename, $xpath), ); } @@ -118,9 +118,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -132,9 +132,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -146,9 +146,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -160,9 +160,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -174,9 +174,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -188,9 +188,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -200,7 +200,7 @@ public function logging(string $filename, DOMXPath $xpath): Logging $teamCity, $testDoxHtml, $testDoxText, - $testDoxXml + $testDoxXml, ); } @@ -228,42 +228,42 @@ public function legacyLogging(string $filename, DOMXPath $xpath): Logging switch ($type) { case 'plain': $text = new Text( - new File($target) + new File($target), ); break; case 'junit': $junit = new Junit( - new File($target) + new File($target), ); break; case 'teamcity': $teamCity = new TeamCity( - new File($target) + new File($target), ); break; case 'testdox-html': $testDoxHtml = new TestDoxHtml( - new File($target) + new File($target), ); break; case 'testdox-text': $testDoxText = new TestDoxText( - new File($target) + new File($target), ); break; case 'testdox-xml': $testDoxXml = new TestDoxXml( - new File($target) + new File($target), ); break; @@ -276,7 +276,7 @@ public function legacyLogging(string $filename, DOMXPath $xpath): Logging $teamCity, $testDoxHtml, $testDoxText, - $testDoxXml + $testDoxXml, ); } @@ -304,7 +304,7 @@ private function getElementConfigurationParameters(string $filename, DOMElement $file = $this->toAbsolutePath( $filename, (string) $element->getAttribute('file'), - true + true, ); } @@ -402,38 +402,38 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do if ($cacheDirectory !== null) { $cacheDirectory = new Directory( - $this->toAbsolutePath($filename, $cacheDirectory) + $this->toAbsolutePath($filename, $cacheDirectory), ); } $pathCoverage = $this->getBooleanAttribute( $element, 'pathCoverage', - false + false, ); $includeUncoveredFiles = $this->getBooleanAttribute( $element, 'includeUncoveredFiles', - true + true, ); $processUncoveredFiles = $this->getBooleanAttribute( $element, 'processUncoveredFiles', - false + false, ); $ignoreDeprecatedCodeUnits = $this->getBooleanAttribute( $element, 'ignoreDeprecatedCodeUnits', - false + false, ); $disableCodeCoverageIgnore = $this->getBooleanAttribute( $element, 'disableCodeCoverageIgnore', - false + false, ); } @@ -445,9 +445,9 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -459,9 +459,9 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -473,10 +473,10 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), ), - $this->getIntegerAttribute($element, 'threshold', 30) + $this->getIntegerAttribute($element, 'threshold', 30), ); } @@ -488,11 +488,11 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new Directory( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputDirectory') - ) + (string) $this->getStringAttribute($element, 'outputDirectory'), + ), ), $this->getIntegerAttribute($element, 'lowUpperBound', 50), - $this->getIntegerAttribute($element, 'highLowerBound', 90) + $this->getIntegerAttribute($element, 'highLowerBound', 90), ); } @@ -504,9 +504,9 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -518,11 +518,11 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), ), $this->getBooleanAttribute($element, 'showUncoveredFiles', false), - $this->getBooleanAttribute($element, 'showOnlySummary', false) + $this->getBooleanAttribute($element, 'showOnlySummary', false), ); } @@ -534,9 +534,9 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new Directory( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputDirectory') - ) - ) + (string) $this->getStringAttribute($element, 'outputDirectory'), + ), + ), ); } @@ -557,7 +557,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do $html, $php, $text, - $xml + $xml, ); } @@ -569,13 +569,13 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume $ignoreDeprecatedCodeUnits = $this->getBooleanAttribute( $document->documentElement, 'ignoreDeprecatedCodeUnitsFromCodeCoverage', - false + false, ); $disableCodeCoverageIgnore = $this->getBooleanAttribute( $document->documentElement, 'disableCodeCoverageIgnore', - false + false, ); $includeUncoveredFiles = true; @@ -587,14 +587,14 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume if ($element->hasAttribute('addUncoveredFilesFromWhitelist')) { $includeUncoveredFiles = (bool) $this->getBoolean( (string) $element->getAttribute('addUncoveredFilesFromWhitelist'), - true + true, ); } if ($element->hasAttribute('processUncoveredFilesFromWhitelist')) { $processUncoveredFiles = (bool) $this->getBoolean( (string) $element->getAttribute('processUncoveredFilesFromWhitelist'), - false + false, ); } } @@ -622,14 +622,14 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume switch ($type) { case 'coverage-clover': $clover = new Clover( - new File($target) + new File($target), ); break; case 'coverage-cobertura': $cobertura = new Cobertura( - new File($target) + new File($target), ); break; @@ -637,7 +637,7 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume case 'coverage-crap4j': $crap4j = new Crap4j( new File($target), - $this->getIntegerAttribute($log, 'threshold', 30) + $this->getIntegerAttribute($log, 'threshold', 30), ); break; @@ -646,14 +646,14 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume $html = new CodeCoverageHtml( new Directory($target), $this->getIntegerAttribute($log, 'lowUpperBound', 50), - $this->getIntegerAttribute($log, 'highLowerBound', 90) + $this->getIntegerAttribute($log, 'highLowerBound', 90), ); break; case 'coverage-php': $php = new CodeCoveragePhp( - new File($target) + new File($target), ); break; @@ -662,14 +662,14 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume $text = new CodeCoverageText( new File($target), $this->getBooleanAttribute($log, 'showUncoveredFiles', false), - $this->getBooleanAttribute($log, 'showOnlySummary', false) + $this->getBooleanAttribute($log, 'showOnlySummary', false), ); break; case 'coverage-xml': $xml = new CodeCoverageXml( - new Directory($target) + new Directory($target), ); break; @@ -693,7 +693,7 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume $html, $php, $text, - $xml + $xml, ); } @@ -737,7 +737,7 @@ private function readFilterDirectories(string $filename, DOMXPath $xpath, string $this->toAbsolutePath($filename, $directoryPath), $directoryNode->hasAttribute('prefix') ? (string) $directoryNode->getAttribute('prefix') : '', $directoryNode->hasAttribute('suffix') ? (string) $directoryNode->getAttribute('suffix') : '.php', - $directoryNode->hasAttribute('group') ? (string) $directoryNode->getAttribute('group') : 'DEFAULT' + $directoryNode->hasAttribute('group') ? (string) $directoryNode->getAttribute('group') : 'DEFAULT', ); } @@ -784,7 +784,7 @@ private function parseGroupConfiguration(DOMXPath $xpath, string $root): Groups return new Groups( GroupCollection::fromArray($include), - GroupCollection::fromArray($exclude) + GroupCollection::fromArray($exclude), ); } @@ -809,7 +809,7 @@ private function getBooleanAttribute(DOMElement $element, string $attribute, boo return (bool) $this->getBoolean( (string) $element->getAttribute($attribute), - false + false, ); } @@ -821,7 +821,7 @@ private function getIntegerAttribute(DOMElement $element, string $attribute, int return $this->getInteger( (string) $element->getAttribute($attribute), - $default + $default, ); } @@ -862,7 +862,7 @@ private function php(string $filename, DOMXPath $xpath): Php $iniSettings[] = new IniSetting( (string) $ini->getAttribute('name'), - (string) $ini->getAttribute('value') + (string) $ini->getAttribute('value'), ); } @@ -875,7 +875,7 @@ private function php(string $filename, DOMXPath $xpath): Php $constants[] = new Constant( (string) $const->getAttribute('name'), - $this->getBoolean($value, $value) + $this->getBoolean($value, $value), ); } @@ -1077,7 +1077,7 @@ private function phpunit(string $filename, DOMDocument $document): PHPUnit $this->getBooleanAttribute($document->documentElement, 'backupGlobals', false), $this->getBooleanAttribute($document->documentElement, 'backupStaticAttributes', false), $this->getBooleanAttribute($document->documentElement, 'registerMockObjectsFromTestArgumentsRecursively', false), - $conflictBetweenPrinterClassAndTestdox + $conflictBetweenPrinterClassAndTestdox, ); } @@ -1171,7 +1171,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti $prefix, $suffix, $phpVersion, - $phpVersionOperator + $phpVersionOperator, ); } @@ -1201,7 +1201,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti $files[] = new TestFile( $this->toAbsolutePath($filename, $file), $phpVersion, - $phpVersionOperator + $phpVersionOperator, ); } @@ -1209,7 +1209,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti (string) $element->getAttribute('name'), TestDirectoryCollection::fromArray($directories), TestFileCollection::fromArray($files), - FileCollection::fromArray($exclude) + FileCollection::fromArray($exclude), ); } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php index abef49f10..2bb663814 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php @@ -28,7 +28,7 @@ final class MigrationBuilder IntroduceCoverageElement::class, MoveAttributesFromRootToCoverage::class, MoveAttributesFromFilterWhitelistToCoverage::class, - MoveWhitelistDirectoriesToCoverage::class, + MoveWhitelistIncludesToCoverage::class, MoveWhitelistExcludesToCoverage::class, RemoveEmptyFilter::class, CoverageCloverToReport::class, @@ -51,8 +51,8 @@ public function build(string $fromVersion): array throw new MigrationBuilderException( sprintf( 'Migration from schema version %s is not supported', - $fromVersion - ) + $fromVersion, + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php index 867a84417..de52857ee 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php @@ -22,7 +22,7 @@ public function migrate(DOMDocument $document): void $document->documentElement->insertBefore( $coverage, - $document->documentElement->firstChild + $document->documentElement->firstChild, ); } } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php index e987308b7..c07de0ec7 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php @@ -67,7 +67,7 @@ abstract protected function toReportFormat(DOMElement $logNode): DOMElement; private function findLogNode(DOMDocument $document): ?DOMElement { $logNode = (new DOMXPath($document))->query( - sprintf('//logging/log[@type="%s"]', $this->forType()) + sprintf('//logging/log[@type="%s"]', $this->forType()), )->item(0); if (!$logNode instanceof DOMElement) { diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php index c55315fa0..17d5f4db0 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php @@ -47,7 +47,7 @@ public function migrate(DOMDocument $document): void if ($targetExclude === null) { $targetExclude = $coverage->appendChild( - $document->createElement('exclude') + $document->createElement('exclude'), ); } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php similarity index 83% rename from app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php rename to app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php index 14e6cec83..c75a6d84f 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php @@ -16,7 +16,7 @@ /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ -final class MoveWhitelistDirectoriesToCoverage implements Migration +final class MoveWhitelistIncludesToCoverage implements Migration { /** * @throws MigrationException @@ -39,7 +39,11 @@ public function migrate(DOMDocument $document): void $coverage->appendChild($include); foreach (SnapshotNodeList::fromNodeList($whitelist->childNodes) as $child) { - if (!$child instanceof DOMElement || $child->nodeName !== 'directory') { + if (!$child instanceof DOMElement) { + continue; + } + + if (!($child->nodeName === 'directory' || $child->nodeName === 'file')) { continue; } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php index 2e86ab6e9..ddcfcf071 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php @@ -21,7 +21,7 @@ public function migrate(DOMDocument $document): void $document->documentElement->setAttributeNS( 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation', - 'https://schema.phpunit.de/9.3/phpunit.xsd' + 'https://schema.phpunit.de/9.3/phpunit.xsd', ); } } diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php index d173e7af2..57bc9f2eb 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php @@ -34,7 +34,7 @@ public function migrate(string $filename): string sprintf( '"%s" is not a valid PHPUnit XML configuration file that can be migrated', $filename, - ) + ), ); } @@ -42,7 +42,7 @@ public function migrate(string $filename): string $filename, false, true, - true + true, ); foreach ((new MigrationBuilder)->build($origin->version()) as $migration) { diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php index 5fb0c72b2..f5969945b 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php @@ -52,7 +52,7 @@ private function handleIncludePaths(DirectoryCollection $includePaths): void 'include_path', implode(PATH_SEPARATOR, $includePathsAsStrings) . PATH_SEPARATOR . - ini_get('include_path') + ini_get('include_path'), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php b/app/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php index 648f9edc6..764bbbfb4 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php +++ b/app/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php @@ -67,17 +67,12 @@ final class DocBlock */ public const REGEX_DATA_PROVIDER = '/@dataProvider\s+([a-zA-Z0-9._:-\\\\x7f-\xff]+)/'; - private const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; - + private const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; private const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[\d\t \-.|~^]+)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_SETTING = '/@requires\s+(?Psetting)\s+(?P([^ ]+?))\s*(?P[\w\.-]+[\w\.]?)?[ \t]*\r?$/m'; - - private const REGEX_REQUIRES = '/@requires\s+(?Pfunction|extension)\s+(?P([^\s<>=!]+))\s*(?P[<>=!]{0,2})\s*(?P[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'; - - private const REGEX_TEST_WITH = '/@testWith\s+/'; + private const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; + private const REGEX_REQUIRES_SETTING = '/@requires\s+(?Psetting)\s+(?P([^ ]+?))\s*(?P[\w\.-]+[\w\.]?)?[ \t]*\r?$/m'; + private const REGEX_REQUIRES = '/@requires\s+(?Pfunction|extension)\s+(?P([^\s<>=!]+))\s*(?P[<>=!]{0,2})\s*(?P[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'; + private const REGEX_TEST_WITH = '/@testWith\s+/'; /** @var string */ private $docComment; @@ -133,7 +128,7 @@ public static function ofClass(ReflectionClass $class): self $class->getEndLine(), $class->getFileName(), $className, - $className + $className, ); } @@ -150,7 +145,7 @@ public static function ofMethod(ReflectionMethod $method, string $classNameInHie $method->getEndLine(), $method->getFileName(), $method->getName(), - $classNameInHierarchy + $classNameInHierarchy, ); } @@ -268,7 +263,7 @@ public function requirements(): array array_filter([ 'setting' => $recordedSettings, 'extension_versions' => $extensionVersions, - ]) + ]), ); } @@ -295,8 +290,8 @@ public function getProvidedData(): ?array throw new InvalidDataSetException( sprintf( 'Data set %s is invalid.', - is_int($key) ? '#' . $key : '"' . $key . '"' - ) + is_int($key) ? '#' . $key : '"' . $key . '"', + ), ); } } @@ -404,14 +399,14 @@ private function getDataFromDataProviderAnnotation(string $docComment): ?array $dataProviderClass = new ReflectionClass($dataProviderClassName); $dataProviderMethod = $dataProviderClass->getMethod( - $dataProviderMethodName + $dataProviderMethodName, ); // @codeCoverageIgnoreStart } catch (ReflectionException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); // @codeCoverageIgnoreEnd } @@ -440,8 +435,8 @@ private function getDataFromDataProviderAnnotation(string $docComment): ?array sprintf( 'The key "%s" has already been defined in the data provider "%s".', $key, - $match - ) + $match, + ), ); } else { $data[$key] = $value; @@ -483,7 +478,7 @@ private function getDataFromTestWithAnnotation(string $docComment): ?array if (json_last_error() !== JSON_ERROR_NONE) { throw new Exception( - 'The data set for the @testWith annotation cannot be parsed: ' . json_last_error_msg() + 'The data set for the @testWith annotation cannot be parsed: ' . json_last_error_msg(), ); } @@ -499,9 +494,9 @@ private function getDataFromTestWithAnnotation(string $docComment): ?array private function cleanUpMultiLineAnnotation(string $docComment): string { - //removing initial ' * ' for docComment + // removing initial ' * ' for docComment $docComment = str_replace("\r\n", "\n", $docComment); - $docComment = preg_replace('/' . '\n' . '\s*' . '\*' . '\s?' . '/', "\n", $docComment); + $docComment = preg_replace('/\n\s*\*\s?/', "\n", $docComment); $docComment = (string) substr($docComment, 0, -1); return rtrim($docComment, "\n"); @@ -538,14 +533,14 @@ static function (ReflectionClass $trait): array { return self::parseDocBlock((string) $trait->getDocComment()); }, - array_values($reflector->getTraits()) - ) + array_values($reflector->getTraits()), + ), ); } return array_merge( $annotations, - self::parseDocBlock((string) $reflector->getDocComment()) + self::parseDocBlock((string) $reflector->getDocComment()), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php b/app/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php index 8ee6c8395..a34cb9ade 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php +++ b/app/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php @@ -59,7 +59,7 @@ public function forClassName(string $class): DocBlock throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -85,7 +85,7 @@ public function forMethod(string $classInHierarchy, string $method): DocBlock throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/app/vendor/phpunit/phpunit/src/Util/Color.php b/app/vendor/phpunit/phpunit/src/Util/Color.php index b96eb4747..ee0f412df 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Color.php +++ b/app/vendor/phpunit/phpunit/src/Util/Color.php @@ -120,7 +120,7 @@ static function ($matches) { return self::dim($matches[0]); }, - $path[$last] + $path[$last], ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/ErrorHandler.php b/app/vendor/phpunit/phpunit/src/Util/ErrorHandler.php index f8566347e..3bdf9bf1d 100644 --- a/app/vendor/phpunit/phpunit/src/Util/ErrorHandler.php +++ b/app/vendor/phpunit/phpunit/src/Util/ErrorHandler.php @@ -64,7 +64,7 @@ static function ($errorNumber, $errorString) } return false; - } + }, ); $result = $callable(); diff --git a/app/vendor/phpunit/phpunit/src/Util/ExcludeList.php b/app/vendor/phpunit/phpunit/src/Util/ExcludeList.php index 778eb3091..a00bfff08 100644 --- a/app/vendor/phpunit/phpunit/src/Util/ExcludeList.php +++ b/app/vendor/phpunit/phpunit/src/Util/ExcludeList.php @@ -161,8 +161,8 @@ public static function addDirectory(string $directory): void throw new Exception( sprintf( '"%s" is not a directory', - $directory - ) + $directory, + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/FileLoader.php b/app/vendor/phpunit/phpunit/src/Util/FileLoader.php index 8abdc91cf..e0a665061 100644 --- a/app/vendor/phpunit/phpunit/src/Util/FileLoader.php +++ b/app/vendor/phpunit/phpunit/src/Util/FileLoader.php @@ -42,7 +42,7 @@ public static function checkAndLoad(string $filename): string $includePathFilename === $localFile || !self::isReadable($includePathFilename)) { throw new Exception( - sprintf('Cannot open file "%s".' . "\n", $filename) + sprintf('Cannot open file "%s".' . "\n", $filename), ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/Filesystem.php b/app/vendor/phpunit/phpunit/src/Util/Filesystem.php index 35b2690b1..886829d2d 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Filesystem.php +++ b/app/vendor/phpunit/phpunit/src/Util/Filesystem.php @@ -30,7 +30,7 @@ public static function classNameToFilename(string $className): string return str_replace( ['_', '\\'], DIRECTORY_SEPARATOR, - $className + $className, ) . '.php'; } diff --git a/app/vendor/phpunit/phpunit/src/Util/Filter.php b/app/vendor/phpunit/phpunit/src/Util/Filter.php index 42563937d..94b7e77d9 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Filter.php +++ b/app/vendor/phpunit/phpunit/src/Util/Filter.php @@ -53,7 +53,7 @@ public static function getFilteredStacktrace(Throwable $t): string if (!self::frameExists($eTrace, $eFile, $eLine)) { array_unshift( $eTrace, - ['file' => $eFile, 'line' => $eLine] + ['file' => $eFile, 'line' => $eLine], ); } @@ -65,7 +65,7 @@ public static function getFilteredStacktrace(Throwable $t): string $filteredStacktrace .= sprintf( "%s:%s\n", $frame['file'], - $frame['line'] ?? '?' + $frame['line'] ?? '?', ); } } diff --git a/app/vendor/phpunit/phpunit/src/Util/GlobalState.php b/app/vendor/phpunit/phpunit/src/Util/GlobalState.php index cc5c22286..18b5a6466 100644 --- a/app/vendor/phpunit/phpunit/src/Util/GlobalState.php +++ b/app/vendor/phpunit/phpunit/src/Util/GlobalState.php @@ -9,6 +9,8 @@ */ namespace PHPUnit\Util; +use const PHP_MAJOR_VERSION; +use const PHP_MINOR_VERSION; use function array_keys; use function array_reverse; use function array_shift; @@ -47,6 +49,79 @@ final class GlobalState '_REQUEST', ]; + /** + * @psalm-var array> + */ + private const DEPRECATED_INI_SETTINGS = [ + '7.3' => [ + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.func_overload' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'string.strip_tags' => true, + ], + + '7.4' => [ + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.func_overload' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'pdo_odbc.db2_instance_name' => true, + 'string.strip_tags' => true, + ], + + '8.0' => [ + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + ], + + '8.1' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + + '8.2' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + + '8.3' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + ]; + /** * @throws Exception */ @@ -106,10 +181,14 @@ public static function getIniSettingsAsString(): string $result = ''; foreach (ini_get_all(null, false) as $key => $value) { + if (self::isIniSettingDeprecated($key)) { + continue; + } + $result .= sprintf( '@ini_set(%s, %s);' . "\n", self::exportVariable($key), - self::exportVariable((string) $value) + self::exportVariable((string) $value), ); } @@ -127,7 +206,7 @@ public static function getConstantsAsString(): string 'if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", $name, $name, - self::exportVariable($value) + self::exportVariable($value), ); } } @@ -150,7 +229,7 @@ public static function getGlobalsAsString(): string '$GLOBALS[\'%s\'][\'%s\'] = %s;' . "\n", $superGlobalArray, $key, - self::exportVariable($GLOBALS[$superGlobalArray][$key]) + self::exportVariable($GLOBALS[$superGlobalArray][$key]), ); } } @@ -164,7 +243,7 @@ public static function getGlobalsAsString(): string $result .= sprintf( '$GLOBALS[\'%s\'] = %s;' . "\n", $key, - self::exportVariable($GLOBALS[$key]) + self::exportVariable($GLOBALS[$key]), ); } } @@ -200,4 +279,9 @@ private static function arrayOnlyContainsScalars(array $array): bool return $result; } + + private static function isIniSettingDeprecated(string $iniSetting): bool + { + return isset(self::DEPRECATED_INI_SETTINGS[PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION][$iniSetting]); + } } diff --git a/app/vendor/phpunit/phpunit/src/Util/Json.php b/app/vendor/phpunit/phpunit/src/Util/Json.php index 752c1fd60..e200071b1 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Json.php +++ b/app/vendor/phpunit/phpunit/src/Util/Json.php @@ -37,7 +37,7 @@ public static function prettify(string $json): string if (json_last_error()) { throw new Exception( - 'Cannot prettify invalid json' + 'Cannot prettify invalid json', ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/Log/JUnit.php b/app/vendor/phpunit/phpunit/src/Util/Log/JUnit.php index 3ceb5e845..c7ba4fc56 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Log/JUnit.php +++ b/app/vendor/phpunit/phpunit/src/Util/Log/JUnit.php @@ -226,37 +226,37 @@ public function endTestSuite(TestSuite $suite): void { $this->testSuites[$this->testSuiteLevel]->setAttribute( 'tests', - (string) $this->testSuiteTests[$this->testSuiteLevel] + (string) $this->testSuiteTests[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'assertions', - (string) $this->testSuiteAssertions[$this->testSuiteLevel] + (string) $this->testSuiteAssertions[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'errors', - (string) $this->testSuiteErrors[$this->testSuiteLevel] + (string) $this->testSuiteErrors[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'warnings', - (string) $this->testSuiteWarnings[$this->testSuiteLevel] + (string) $this->testSuiteWarnings[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'failures', - (string) $this->testSuiteFailures[$this->testSuiteLevel] + (string) $this->testSuiteFailures[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'skipped', - (string) $this->testSuiteSkipped[$this->testSuiteLevel] + (string) $this->testSuiteSkipped[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'time', - sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]) + sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]), ); if ($this->testSuiteLevel > 1) { @@ -293,7 +293,7 @@ public function startTest(Test $test): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -308,7 +308,7 @@ public function startTest(Test $test): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -337,16 +337,16 @@ public function endTest(Test $test, float $time): void $this->currentTestCase->setAttribute( 'assertions', - (string) $numAssertions + (string) $numAssertions, ); $this->currentTestCase->setAttribute( 'time', - sprintf('%F', $time) + sprintf('%F', $time), ); $this->testSuites[$this->testSuiteLevel]->appendChild( - $this->currentTestCase + $this->currentTestCase, ); $this->testSuiteTests[$this->testSuiteLevel]++; @@ -361,7 +361,7 @@ public function endTest(Test $test, float $time): void if (!empty($testOutput)) { $systemOut = $this->document->createElement( 'system-out', - Xml::prepareString($testOutput) + Xml::prepareString($testOutput), ); $this->currentTestCase->appendChild($systemOut); @@ -392,12 +392,12 @@ private function doAddFault(Test $test, Throwable $t, string $type): void $buffer .= trim( TestFailure::exceptionToString($t) . "\n" . - Filter::getFilteredStacktrace($t) + Filter::getFilteredStacktrace($t), ); $fault = $this->document->createElement( $type, - Xml::prepareString($buffer) + Xml::prepareString($buffer), ); if ($t instanceof ExceptionWrapper) { diff --git a/app/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php b/app/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php index 0efe3438a..30375bd3c 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php +++ b/app/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php @@ -77,7 +77,7 @@ public function addError(Test $test, Throwable $t, float $time): void 'message' => self::getMessage($t), 'details' => self::getDetails($t), 'duration' => self::toMilliseconds($time), - ] + ], ); } @@ -169,7 +169,7 @@ public function printIgnoredTest(string $testName, Throwable $t, float $time): v 'message' => self::getMessage($t), 'details' => self::getDetails($t), 'duration' => self::toMilliseconds($time), - ] + ], ); } @@ -189,7 +189,7 @@ public function startTestSuite(TestSuite $suite): void $this->printEvent( 'testCount', - ['count' => count($suite)] + ['count' => count($suite)], ); } @@ -271,7 +271,7 @@ public function endTest(Test $test, float $time): void [ 'name' => $test->getName(), 'duration' => self::toMilliseconds($time), - ] + ], ); } @@ -351,7 +351,7 @@ private static function escapeValue(string $text): string return str_replace( ['|', "'", "\n", "\r", ']', '['], ['||', "|'", '|n', '|r', '|]', '|['], - $text + $text, ); } @@ -367,7 +367,7 @@ private static function getFileName($className): string throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/app/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php b/app/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php index 8706ae1a1..5b34055af 100644 --- a/app/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php +++ b/app/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php @@ -184,7 +184,7 @@ public function runTestJob(string $job, Test $test, TestResult $result): void $test, $result, $_result['stdout'], - $_result['stderr'] + $_result['stderr'], ); } @@ -199,15 +199,15 @@ public function getCommand(array $settings, string $file = null): string $settings = array_merge( $settings, $this->runtime->getCurrentSettings( - array_keys(ini_get_all('pcov')) - ) + array_keys(ini_get_all('pcov')), + ), ); } elseif ($this->runtime->hasXdebug()) { $settings = array_merge( $settings, $this->runtime->getCurrentSettings( - array_keys(ini_get_all('xdebug')) - ) + array_keys(ini_get_all('xdebug')), + ), ); } @@ -268,7 +268,7 @@ private function processChildResult(Test $test, TestResult $result, string $stdo $result->addError( $test, new Exception(trim($stderr)), - $time + $time, ); } else { set_error_handler( @@ -278,7 +278,7 @@ private function processChildResult(Test $test, TestResult $result, string $stdo static function ($errno, $errstr, $errfile, $errline): void { throw new ErrorException($errstr, $errno, $errno, $errfile, $errline); - } + }, ); try { @@ -293,7 +293,7 @@ static function ($errno, $errstr, $errfile, $errline): void $result->addFailure( $test, new AssertionFailedError('Test was run in child process and ended unexpectedly'), - $time + $time, ); } } catch (ErrorException $e) { @@ -303,7 +303,7 @@ static function ($errno, $errstr, $errfile, $errline): void $result->addError( $test, new Exception(trim($stdout), 0, $e), - $time + $time, ); } @@ -322,7 +322,7 @@ static function ($errno, $errstr, $errfile, $errline): void if ($result->getCollectCodeCoverageInformation()) { $result->getCodeCoverage()->merge( - $childResult->getCodeCoverage() + $childResult->getCodeCoverage(), ); } @@ -338,37 +338,37 @@ static function ($errno, $errstr, $errfile, $errline): void $result->addError( $test, $this->getException($notImplemented[0]), - $time + $time, ); } elseif (!empty($risky)) { $result->addError( $test, $this->getException($risky[0]), - $time + $time, ); } elseif (!empty($skipped)) { $result->addError( $test, $this->getException($skipped[0]), - $time + $time, ); } elseif (!empty($errors)) { $result->addError( $test, $this->getException($errors[0]), - $time + $time, ); } elseif (!empty($warnings)) { $result->addWarning( $test, $this->getException($warnings[0]), - $time + $time, ); } elseif (!empty($failures)) { $result->addFailure( $test, $this->getException($failures[0]), - $time + $time, ); } } @@ -402,12 +402,12 @@ private function getException(TestFailure $error): Exception sprintf( '%s: %s', $exceptionArray['_PHP_Incomplete_Class_Name'], - $exceptionArray['message'] + $exceptionArray['message'], ), $exceptionArray['code'], $exceptionArray['file'], $exceptionArray['line'], - $exceptionArray['trace'] + $exceptionArray['trace'], ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php b/app/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php index c4dc11146..64974f1df 100644 --- a/app/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php +++ b/app/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php @@ -49,7 +49,7 @@ public function runJob(string $job, array $settings = []): array if (!($this->tempFile = tempnam(sys_get_temp_dir(), 'PHPUnit')) || file_put_contents($this->tempFile, $job) === false) { throw new Exception( - 'Unable to write temporary file' + 'Unable to write temporary file', ); } @@ -101,12 +101,12 @@ protected function runProcess(string $job, array $settings): array $pipeSpec, $pipes, null, - $env + $env, ); if (!is_resource($process)) { throw new Exception( - 'Unable to spawn worker process' + 'Unable to spawn worker process', ); } @@ -138,8 +138,8 @@ protected function runProcess(string $job, array $settings): array throw new Exception( sprintf( 'Job execution aborted after %d seconds', - $this->timeout - ) + $this->timeout, + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php b/app/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php index 9ef925556..2480bc8c1 100644 --- a/app/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php +++ b/app/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php @@ -36,7 +36,7 @@ protected function getHandles(): array { if (false === $stdout_handle = tmpfile()) { throw new Exception( - 'A temporary file could not be created; verify that your TEMP environment variable is writable' + 'A temporary file could not be created; verify that your TEMP environment variable is writable', ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/Printer.php b/app/vendor/phpunit/phpunit/src/Util/Printer.php index 77b5745ad..311d49433 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Printer.php +++ b/app/vendor/phpunit/phpunit/src/Util/Printer.php @@ -67,8 +67,8 @@ public function __construct($out = null) throw new Exception( sprintf( '"%s" does not match "socket://hostname:port" format', - $out - ) + $out, + ), ); } @@ -81,8 +81,8 @@ public function __construct($out = null) throw new Exception( sprintf( 'Directory "%s" was not created', - dirname($out) - ) + dirname($out), + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/RegularExpression.php b/app/vendor/phpunit/phpunit/src/Util/RegularExpression.php index db1dae922..1e97d6c2f 100644 --- a/app/vendor/phpunit/phpunit/src/Util/RegularExpression.php +++ b/app/vendor/phpunit/phpunit/src/Util/RegularExpression.php @@ -25,7 +25,7 @@ public static function safeMatch(string $pattern, string $subject) static function () use ($pattern, $subject) { return preg_match($pattern, $subject); - } + }, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Util/Test.php b/app/vendor/phpunit/phpunit/src/Util/Test.php index f089f6d43..12c6bf16a 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Test.php +++ b/app/vendor/phpunit/phpunit/src/Util/Test.php @@ -119,7 +119,7 @@ public static function getLinesToBeCovered(string $className, string $methodName { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); if (!self::shouldCoversAnnotationBeUsed($annotations)) { @@ -145,7 +145,7 @@ public static function requiresCodeCoverageDataCollection(TestCase $test): bool { $annotations = self::parseTestMethodAnnotations( get_class($test), - $test->getName(false) + $test->getName(false), ); // If there is no @covers annotation but a @coversNothing annotation on @@ -182,7 +182,7 @@ public static function getRequirements(string $className, string $methodName): a { return self::mergeArraysRecursively( Registry::getInstance()->forClassName($className)->requirements(), - Registry::getInstance()->forMethod($className, $methodName)->requirements() + Registry::getInstance()->forMethod($className, $methodName)->requirements(), ); } @@ -213,7 +213,7 @@ public static function getMissingRequirements(string $className, string $methodN if (!$required['PHP_constraint']['constraint']->complies($version)) { $missing[] = sprintf( 'PHP version does not match the required constraint %s.', - $required['PHP_constraint']['constraint']->asString() + $required['PHP_constraint']['constraint']->asString(), ); $hint = 'PHP_constraint'; @@ -235,7 +235,7 @@ public static function getMissingRequirements(string $className, string $methodN if (!$required['PHPUnit_constraint']['constraint']->complies($phpunitVersion)) { $missing[] = sprintf( 'PHPUnit version does not match the required constraint %s.', - $required['PHPUnit_constraint']['constraint']->asString() + $required['PHPUnit_constraint']['constraint']->asString(), ); $hint = $hint ?? 'PHPUnit_constraint'; @@ -331,7 +331,7 @@ public static function getProvidedData(string $className, string $methodName): ? /** * @psalm-param class-string $className */ - public static function parseTestMethodAnnotations(string $className, ?string $methodName = ''): array + public static function parseTestMethodAnnotations(string $className, ?string $methodName = null): array { $registry = Registry::getInstance(); @@ -367,12 +367,12 @@ public static function getBackupSettings(string $className, string $methodName): 'backupGlobals' => self::getBooleanAnnotationSetting( $className, $methodName, - 'backupGlobals' + 'backupGlobals', ), 'backupStaticAttributes' => self::getBooleanAnnotationSetting( $className, $methodName, - 'backupStaticAttributes' + 'backupStaticAttributes', ), ]; } @@ -386,7 +386,7 @@ public static function getDependencies(string $className, string $methodName): a { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); $dependsAnnotations = $annotations['class']['depends'] ?? []; @@ -394,7 +394,7 @@ public static function getDependencies(string $className, string $methodName): a if (isset($annotations['method']['depends'])) { $dependsAnnotations = array_merge( $dependsAnnotations, - $annotations['method']['depends'] + $annotations['method']['depends'], ); } @@ -413,7 +413,7 @@ public static function getGroups(string $className, ?string $methodName = ''): a { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); $groups = []; @@ -492,7 +492,7 @@ public static function getProcessIsolationSettings(string $className, string $me { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); return isset($annotations['class']['runTestsInSeparateProcesses']) || isset($annotations['method']['runInSeparateProcess']); @@ -503,7 +503,7 @@ public static function getClassProcessIsolationSettings(string $className, strin { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); return isset($annotations['class']['runClassInSeparateProcess']); @@ -515,7 +515,7 @@ public static function getPreserveGlobalStateSettings(string $className, string return self::getBooleanAnnotationSetting( $className, $methodName, - 'preserveGlobalState' + 'preserveGlobalState', ); } @@ -537,7 +537,7 @@ public static function getHookMethods(string $className): array if ($docBlock->isHookToBeExecutedBeforeClass()) { array_unshift( self::$hookMethods[$className]['beforeClass'], - $method->getName() + $method->getName(), ); } @@ -549,14 +549,14 @@ public static function getHookMethods(string $className): array if ($docBlock->isToBeExecutedBeforeTest()) { array_unshift( self::$hookMethods[$className]['before'], - $method->getName() + $method->getName(), ); } if ($docBlock->isToBeExecutedAsPreCondition()) { array_unshift( self::$hookMethods[$className]['preCondition'], - $method->getName() + $method->getName(), ); } @@ -589,9 +589,9 @@ public static function isTestMethod(ReflectionMethod $method): bool 'test', Registry::getInstance()->forMethod( $method->getDeclaringClass()->getName(), - $method->getName() + $method->getName(), ) - ->symbolAnnotations() + ->symbolAnnotations(), ); } @@ -604,7 +604,7 @@ private static function getLinesToBeCoveredOrUsed(string $className, string $met { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); $classShortcut = null; @@ -615,8 +615,8 @@ private static function getLinesToBeCoveredOrUsed(string $className, string $met sprintf( 'More than one @%sClass annotation in class or interface "%s".', $mode, - $className - ) + $className, + ), ); } @@ -645,8 +645,8 @@ private static function getLinesToBeCoveredOrUsed(string $className, string $met throw new InvalidCoversTargetException( sprintf( 'Trying to @cover interface "%s".', - $element - ) + $element, + ), ); } @@ -657,10 +657,10 @@ private static function getLinesToBeCoveredOrUsed(string $className, string $met sprintf( '"@%s %s" is invalid', $mode, - $element + $element, ), $e->getCode(), - $e + $e, ); } } @@ -685,7 +685,7 @@ private static function getBooleanAnnotationSetting(string $className, ?string $ { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); if (isset($annotations['method'][$settingName])) { @@ -720,7 +720,7 @@ private static function sanitizeVersionNumber(string $version) return preg_replace( '/^(\d+\.\d+(?:.\d+)?).*$/', '$1', - $version + $version, ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php b/app/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php index def16c398..031c7ed63 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php +++ b/app/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php @@ -66,7 +66,6 @@ class CliTestDoxPrinter extends TestDoxPrinter " \e[36m◑\e[0m running tests", " \e[36m◒\e[0m running tests", ]; - private const STATUS_STYLES = [ BaseTestRunner::STATUS_PASSED => [ 'symbol' => '✔', @@ -206,7 +205,7 @@ protected function writeTestResult(array $prevResult, array $result): void ' %s %s%s' . PHP_EOL, $this->colorizeTextBox($style['color'], $style['symbol']), $testName, - $this->verbose ? ' ' . $this->formatRuntime($result['time'], $style['color']) : '' + $this->verbose ? ' ' . $this->formatRuntime($result['time'], $style['color']) : '', ); $this->write($line); diff --git a/app/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php b/app/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php index 013d1de81..d08bfad49 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php +++ b/app/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php @@ -29,26 +29,47 @@ final class HtmlResultPrinter extends ResultPrinter @@ -60,7 +81,7 @@ final class HtmlResultPrinter extends ResultPrinter */ private const CLASS_HEADER = <<<'EOT' -

%s

+

%s

    EOT; @@ -101,9 +122,8 @@ protected function startClass(string $name): void $this->write( sprintf( self::CLASS_HEADER, - $name, - $this->currentTestClassPrettified - ) + $this->currentTestClassPrettified, + ), ); } @@ -114,11 +134,10 @@ protected function onTest(string $name, bool $success = true): void { $this->write( sprintf( - "
  • %s %s
  • \n", - $success ? '#555753' : '#ef2929', - $success ? '✓' : '❌', - $name - ) + "
  • %s
  • \n", + $success ? 'success' : 'defect', + $name, + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php b/app/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php index 742071498..ee0a41b1c 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php +++ b/app/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php @@ -124,7 +124,7 @@ public function prettifyTestCase(TestCase $test): string { $annotations = Test::parseTestMethodAnnotations( get_class($test), - $test->getName(false) + $test->getName(false), ); $annotationWithPlaceholders = false; @@ -243,7 +243,7 @@ private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test) throw new UtilException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -263,7 +263,7 @@ private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test) throw new UtilException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/app/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php b/app/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php index bd64785c9..5a418998d 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php +++ b/app/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php @@ -381,8 +381,8 @@ static function (string $text) use ($prefix) { return ' ' . $prefix . ($text ? ' ' . $text : ''); }, - preg_split('/\r\n|\r|\n/', $message) - ) + preg_split('/\r\n|\r|\n/', $message), + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php b/app/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php index 265fe41f3..544c83e73 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php +++ b/app/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php @@ -164,7 +164,7 @@ public function endTest(Test $test, float $time): void static function ($group) { return !($group === 'small' || $group === 'medium' || $group === 'large' || strpos($group, '__phpunit_') === 0); - } + }, ); $testNode = $this->document->createElement('test'); @@ -188,7 +188,7 @@ static function ($group) $annotations = TestUtil::parseTestMethodAnnotations( get_class($test), - $test->getName(false) + $test->getName(false), ); foreach (['class', 'method'] as $type) { @@ -240,7 +240,7 @@ static function ($group) throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/app/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php b/app/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php index 67168a67f..beb0e4b07 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php +++ b/app/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php @@ -35,7 +35,7 @@ public function render(TestSuite $suite): string $name = sprintf( '%s::%s', get_class($test), - str_replace(' with data set ', '', $test->getName()) + str_replace(' with data set ', '', $test->getName()), ); } elseif ($test instanceof PhptTestCase) { $name = $test->getName(); @@ -45,7 +45,7 @@ public function render(TestSuite $suite): string $buffer .= sprintf( ' - %s' . PHP_EOL, - $name + $name, ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php b/app/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php index 77e674707..57ca7c320 100644 --- a/app/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php +++ b/app/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php @@ -50,8 +50,8 @@ private function ensureOperatorIsValid(string $operator): void throw new Exception( sprintf( '"%s" is not a valid version_compare() operator', - $operator - ) + $operator, + ), ); } } diff --git a/app/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php b/app/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php index 8b10d4152..d6366eaaa 100644 --- a/app/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php +++ b/app/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php @@ -32,10 +32,10 @@ static function ($item) { return sprintf( " '%s'", - $item + $item, ); }, - $this->getItems($filter) + $this->getItems($filter), ); $files = implode(",\n", $files); @@ -67,7 +67,7 @@ private function getItems(FilterConfiguration $filter): array if (is_string($path)) { $files[] = sprintf( addslashes('%s' . DIRECTORY_SEPARATOR), - $path + $path, ); } } diff --git a/app/vendor/phpunit/phpunit/src/Util/Xml.php b/app/vendor/phpunit/phpunit/src/Util/Xml.php index 54d721562..efdd56eff 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Xml.php +++ b/app/vendor/phpunit/phpunit/src/Util/Xml.php @@ -68,8 +68,8 @@ public static function prepareString(string $string): string '', htmlspecialchars( self::convertToUtf8($string), - ENT_QUOTES - ) + ENT_QUOTES, + ), ); } @@ -127,7 +127,7 @@ public static function xmlToVariable(DOMElement $element) throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/app/vendor/phpunit/phpunit/src/Util/Xml/Loader.php b/app/vendor/phpunit/phpunit/src/Util/Xml/Loader.php index 8d43d3278..2ba5ace34 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Xml/Loader.php +++ b/app/vendor/phpunit/phpunit/src/Util/Xml/Loader.php @@ -38,8 +38,8 @@ public function loadFile(string $filename, bool $isHtml = false, bool $xinclude throw new Exception( sprintf( 'Could not read "%s".', - $filename - ) + $filename, + ), ); } @@ -100,8 +100,8 @@ public function load(string $actual, bool $isHtml = false, string $filename = '' sprintf( 'Could not load "%s".%s', $filename, - $message !== '' ? "\n" . $message : '' - ) + $message !== '' ? "\n" . $message : '', + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php b/app/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php index 5864695b4..46f2b947a 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php +++ b/app/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php @@ -23,7 +23,7 @@ public function detect(string $filename): SchemaDetectionResult $filename, false, true, - true + true, ); foreach (['9.2', '8.5'] as $candidate) { diff --git a/app/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php b/app/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php index 1e7b73c59..af17dfe94 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php +++ b/app/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php @@ -34,8 +34,8 @@ public function find(string $version): string throw new Exception( sprintf( 'Schema for PHPUnit %s is not available', - $version - ) + $version, + ), ); } diff --git a/app/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php b/app/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php index b16ef0b70..7a63b10d4 100644 --- a/app/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php +++ b/app/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php @@ -60,8 +60,8 @@ public function render(TestSuite $suite): string str_replace( ' with data set ', '', - $test->getDataSetAsString(false) - ) + $test->getDataSetAsString(false), + ), ); } diff --git a/app/vendor/psr/http-client/README.md b/app/vendor/psr/http-client/README.md index 6876b8403..84af5c55d 100644 --- a/app/vendor/psr/http-client/README.md +++ b/app/vendor/psr/http-client/README.md @@ -7,6 +7,6 @@ Note that this is not a HTTP Client implementation of its own. It is merely abst The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. -[psr-url]: http://www.php-fig.org/psr/psr-18 +[psr-url]: https://www.php-fig.org/psr/psr-18 [package-url]: https://packagist.org/packages/psr/http-client [implementation-url]: https://packagist.org/providers/psr/http-client-implementation diff --git a/app/vendor/psr/http-client/composer.json b/app/vendor/psr/http-client/composer.json index c195f8ff1..e4cab2f3e 100644 --- a/app/vendor/psr/http-client/composer.json +++ b/app/vendor/psr/http-client/composer.json @@ -7,12 +7,12 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "autoload": { "psr-4": { diff --git a/app/vendor/psr/http-factory/.gitignore b/app/vendor/psr/http-factory/.gitignore deleted file mode 100644 index d8a7996ab..000000000 --- a/app/vendor/psr/http-factory/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -composer.lock -vendor/ diff --git a/app/vendor/psr/http-factory/.pullapprove.yml b/app/vendor/psr/http-factory/.pullapprove.yml deleted file mode 100644 index 8cf081942..000000000 --- a/app/vendor/psr/http-factory/.pullapprove.yml +++ /dev/null @@ -1,7 +0,0 @@ -extends: default -reviewers: - - - name: contributors - required: 1 - teams: - - http-factory-contributors diff --git a/app/vendor/psr/http-factory/README.md b/app/vendor/psr/http-factory/README.md index 41d362a62..bf8913b57 100644 --- a/app/vendor/psr/http-factory/README.md +++ b/app/vendor/psr/http-factory/README.md @@ -1,10 +1,12 @@ HTTP Factories ============== -This repository holds all interfaces related to [PSR-17 (HTTP Message Factories)][psr-17]. -Please refer to the specification for a description. +This repository holds all interfaces related to [PSR-17 (HTTP Factories)][psr-url]. -You can find implementations of the specification by looking for packages providing the -[psr/http-factory-implementation](https://packagist.org/providers/psr/http-factory-implementation) virtual package. +Note that this is not a HTTP Factory implementation of its own. It is merely interfaces that describe the components of a HTTP Factory. -[psr-17]: https://www.php-fig.org/psr/psr-17/ +The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. + +[psr-url]: https://www.php-fig.org/psr/psr-17/ +[package-url]: https://packagist.org/packages/psr/http-factory +[implementation-url]: https://packagist.org/providers/psr/http-factory-implementation diff --git a/app/vendor/psr/http-factory/composer.json b/app/vendor/psr/http-factory/composer.json index af62b290f..d1bbddeea 100644 --- a/app/vendor/psr/http-factory/composer.json +++ b/app/vendor/psr/http-factory/composer.json @@ -15,12 +15,12 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { "php": ">=7.0.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "autoload": { "psr-4": { diff --git a/app/vendor/psr/http-message/README.md b/app/vendor/psr/http-message/README.md index 28185338f..2668be6c3 100644 --- a/app/vendor/psr/http-message/README.md +++ b/app/vendor/psr/http-message/README.md @@ -10,4 +10,7 @@ interface that describes a HTTP message. See the specification for more details. Usage ----- -We'll certainly need some stuff in here. \ No newline at end of file +Before reading the usage guide we recommend reading the PSR-7 interfaces method list: + +* [`PSR-7 Interfaces Method List`](docs/PSR7-Interfaces.md) +* [`PSR-7 Usage Guide`](docs/PSR7-Usage.md) \ No newline at end of file diff --git a/app/vendor/psr/http-message/composer.json b/app/vendor/psr/http-message/composer.json index b0d2937a0..56e8c0a6d 100644 --- a/app/vendor/psr/http-message/composer.json +++ b/app/vendor/psr/http-message/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "autoload": { "psr-4": { @@ -20,7 +20,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } } } diff --git a/app/vendor/psr/http-message/docs/PSR7-Interfaces.md b/app/vendor/psr/http-message/docs/PSR7-Interfaces.md new file mode 100644 index 000000000..3a7e7dda6 --- /dev/null +++ b/app/vendor/psr/http-message/docs/PSR7-Interfaces.md @@ -0,0 +1,130 @@ +# Interfaces + +The purpose of this list is to help in finding the methods when working with PSR-7. This can be considered as a cheatsheet for PSR-7 interfaces. + +The interfaces defined in PSR-7 are the following: + +| Class Name | Description | +|---|---| +| [Psr\Http\Message\MessageInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagemessageinterface) | Representation of a HTTP message | +| [Psr\Http\Message\RequestInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagerequestinterface) | Representation of an outgoing, client-side request. | +| [Psr\Http\Message\ServerRequestInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageserverrequestinterface) | Representation of an incoming, server-side HTTP request. | +| [Psr\Http\Message\ResponseInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageresponseinterface) | Representation of an outgoing, server-side response. | +| [Psr\Http\Message\StreamInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagestreaminterface) | Describes a data stream | +| [Psr\Http\Message\UriInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageuriinterface) | Value object representing a URI. | +| [Psr\Http\Message\UploadedFileInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageuploadedfileinterface) | Value object representing a file uploaded through an HTTP request. | + +## `Psr\Http\Message\MessageInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getProtocolVersion()` | Retrieve HTTP protocol version | 1.0 or 1.1 | +| `withProtocolVersion($version)` | Returns new message instance with given HTTP protocol version | | +| `getHeaders()` | Retrieve all HTTP Headers | [Request Header List](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields), [Response Header List](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields) | +| `hasHeader($name)` | Checks if HTTP Header with given name exists | | +| `getHeader($name)` | Retrieves a array with the values for a single header | | +| `getHeaderLine($name)` | Retrieves a comma-separated string of the values for a single header | | +| `withHeader($name, $value)` | Returns new message instance with given HTTP Header | if the header existed in the original instance, replaces the header value from the original message with the value provided when creating the new instance. | +| `withAddedHeader($name, $value)` | Returns new message instance with appended value to given header | If header already exists value will be appended, if not a new header will be created | +| `withoutHeader($name)` | Removes HTTP Header with given name| | +| `getBody()` | Retrieves the HTTP Message Body | Returns object implementing `StreamInterface`| +| `withBody(StreamInterface $body)` | Returns new message instance with given HTTP Message Body | | + + +## `Psr\Http\Message\RequestInterface` Methods + +Same methods as `Psr\Http\Message\MessageInterface` + the following methods: + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getRequestTarget()` | Retrieves the message's request target | origin-form, absolute-form, authority-form, asterisk-form ([RFC7230](https://www.rfc-editor.org/rfc/rfc7230.txt)) | +| `withRequestTarget($requestTarget)` | Return a new message instance with the specific request-target | | +| `getMethod()` | Retrieves the HTTP method of the request. | GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE (defined in [RFC7231](https://tools.ietf.org/html/rfc7231)), PATCH (defined in [RFC5789](https://tools.ietf.org/html/rfc5789)) | +| `withMethod($method)` | Returns a new message instance with the provided HTTP method | | +| `getUri()` | Retrieves the URI instance | | +| `withUri(UriInterface $uri, $preserveHost = false)` | Returns a new message instance with the provided URI | | + + +## `Psr\Http\Message\ServerRequestInterface` Methods + +Same methods as `Psr\Http\Message\RequestInterface` + the following methods: + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getServerParams() ` | Retrieve server parameters | Typically derived from `$_SERVER` | +| `getCookieParams()` | Retrieves cookies sent by the client to the server. | Typically derived from `$_COOKIES` | +| `withCookieParams(array $cookies)` | Returns a new request instance with the specified cookies | | +| `withQueryParams(array $query)` | Returns a new request instance with the specified query string arguments | | +| `getUploadedFiles()` | Retrieve normalized file upload data | | +| `withUploadedFiles(array $uploadedFiles)` | Returns a new request instance with the specified uploaded files | | +| `getParsedBody()` | Retrieve any parameters provided in the request body | | +| `withParsedBody($data)` | Returns a new request instance with the specified body parameters | | +| `getAttributes()` | Retrieve attributes derived from the request | | +| `getAttribute($name, $default = null)` | Retrieve a single derived request attribute | | +| `withAttribute($name, $value)` | Returns a new request instance with the specified derived request attribute | | +| `withoutAttribute($name)` | Returns a new request instance that without the specified derived request attribute | | + +## `Psr\Http\Message\ResponseInterface` Methods: + +Same methods as `Psr\Http\Message\MessageInterface` + the following methods: + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getStatusCode()` | Gets the response status code. | | +| `withStatus($code, $reasonPhrase = '')` | Returns a new response instance with the specified status code and, optionally, reason phrase. | | +| `getReasonPhrase()` | Gets the response reason phrase associated with the status code. | | + +## `Psr\Http\Message\StreamInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `__toString()` | Reads all data from the stream into a string, from the beginning to end. | | +| `close()` | Closes the stream and any underlying resources. | | +| `detach()` | Separates any underlying resources from the stream. | | +| `getSize()` | Get the size of the stream if known. | | +| `eof()` | Returns true if the stream is at the end of the stream.| | +| `isSeekable()` | Returns whether or not the stream is seekable. | | +| `seek($offset, $whence = SEEK_SET)` | Seek to a position in the stream. | | +| `rewind()` | Seek to the beginning of the stream. | | +| `isWritable()` | Returns whether or not the stream is writable. | | +| `write($string)` | Write data to the stream. | | +| `isReadable()` | Returns whether or not the stream is readable. | | +| `read($length)` | Read data from the stream. | | +| `getContents()` | Returns the remaining contents in a string | | +| `getMetadata($key = null)()` | Get stream metadata as an associative array or retrieve a specific key. | | + +## `Psr\Http\Message\UriInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getScheme()` | Retrieve the scheme component of the URI. | | +| `getAuthority()` | Retrieve the authority component of the URI. | | +| `getUserInfo()` | Retrieve the user information component of the URI. | | +| `getHost()` | Retrieve the host component of the URI. | | +| `getPort()` | Retrieve the port component of the URI. | | +| `getPath()` | Retrieve the path component of the URI. | | +| `getQuery()` | Retrieve the query string of the URI. | | +| `getFragment()` | Retrieve the fragment component of the URI. | | +| `withScheme($scheme)` | Return an instance with the specified scheme. | | +| `withUserInfo($user, $password = null)` | Return an instance with the specified user information. | | +| `withHost($host)` | Return an instance with the specified host. | | +| `withPort($port)` | Return an instance with the specified port. | | +| `withPath($path)` | Return an instance with the specified path. | | +| `withQuery($query)` | Return an instance with the specified query string. | | +| `withFragment($fragment)` | Return an instance with the specified URI fragment. | | +| `__toString()` | Return the string representation as a URI reference. | | + +## `Psr\Http\Message\UploadedFileInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getStream()` | Retrieve a stream representing the uploaded file. | | +| `moveTo($targetPath)` | Move the uploaded file to a new location. | | +| `getSize()` | Retrieve the file size. | | +| `getError()` | Retrieve the error associated with the uploaded file. | | +| `getClientFilename()` | Retrieve the filename sent by the client. | | +| `getClientMediaType()` | Retrieve the media type sent by the client. | | + +> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. +> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. + diff --git a/app/vendor/psr/http-message/docs/PSR7-Usage.md b/app/vendor/psr/http-message/docs/PSR7-Usage.md new file mode 100644 index 000000000..b6d048a34 --- /dev/null +++ b/app/vendor/psr/http-message/docs/PSR7-Usage.md @@ -0,0 +1,159 @@ +### PSR-7 Usage + +All PSR-7 applications comply with these interfaces +They were created to establish a standard between middleware implementations. + +> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. +> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. + + +The following examples will illustrate how basic operations are done in PSR-7. + +##### Examples + + +For this examples to work (at least) a PSR-7 implementation package is required. (eg: zendframework/zend-diactoros, guzzlehttp/psr7, slim/slim, etc) +All PSR-7 implementations should have the same behaviour. + +The following will be assumed: +`$request` is an object of `Psr\Http\Message\RequestInterface` and + +`$response` is an object implementing `Psr\Http\Message\RequestInterface` + + +### Working with HTTP Headers + +#### Adding headers to response: + +```php +$response->withHeader('My-Custom-Header', 'My Custom Message'); +``` + +#### Appending values to headers + +```php +$response->withAddedHeader('My-Custom-Header', 'The second message'); +``` + +#### Checking if header exists: + +```php +$request->hasHeader('My-Custom-Header'); // will return false +$response->hasHeader('My-Custom-Header'); // will return true +``` + +> Note: My-Custom-Header was only added in the Response + +#### Getting comma-separated values from a header (also applies to request) + +```php +// getting value from request headers +$request->getHeaderLine('Content-Type'); // will return: "text/html; charset=UTF-8" +// getting value from response headers +$response->getHeaderLine('My-Custom-Header'); // will return: "My Custom Message; The second message" +``` + +#### Getting array of value from a header (also applies to request) +```php +// getting value from request headers +$request->getHeader('Content-Type'); // will return: ["text/html", "charset=UTF-8"] +// getting value from response headers +$response->getHeader('My-Custom-Header'); // will return: ["My Custom Message", "The second message"] +``` + +#### Removing headers from HTTP Messages +```php +// removing a header from Request, removing deprecated "Content-MD5" header +$request->withoutHeader('Content-MD5'); + +// removing a header from Response +// effect: the browser won't know the size of the stream +// the browser will download the stream till it ends +$response->withoutHeader('Content-Length'); +``` + +### Working with HTTP Message Body + +When working with the PSR-7 there are two methods of implementation: +#### 1. Getting the body separately + +> This method makes the body handling easier to understand and is useful when repeatedly calling body methods. (You only call `getBody()` once). Using this method mistakes like `$response->write()` are also prevented. + +```php +$body = $response->getBody(); +// operations on body, eg. read, write, seek +// ... +// replacing the old body +$response->withBody($body); +// this last statement is optional as we working with objects +// in this case the "new" body is same with the "old" one +// the $body variable has the same value as the one in $request, only the reference is passed +``` + +#### 2. Working directly on response + +> This method is useful when only performing few operations as the `$request->getBody()` statement fragment is required + +```php +$response->getBody()->write('hello'); +``` + +### Getting the body contents + +The following snippet gets the contents of a stream contents. +> Note: Streams must be rewinded, if content was written into streams, it will be ignored when calling `getContents()` because the stream pointer is set to the last character, which is `\0` - meaning end of stream. +```php +$body = $response->getBody(); +$body->rewind(); // or $body->seek(0); +$bodyText = $body->getContents(); +``` +> Note: If `$body->seek(1)` is called before `$body->getContents()`, the first character will be ommited as the starting pointer is set to `1`, not `0`. This is why using `$body->rewind()` is recommended. + +### Append to body + +```php +$response->getBody()->write('Hello'); // writing directly +$body = $request->getBody(); // which is a `StreamInterface` +$body->write('xxxxx'); +``` + +### Prepend to body +Prepending is different when it comes to streams. The content must be copied before writing the content to be prepended. +The following example will explain the behaviour of streams. + +```php +// assuming our response is initially empty +$body = $repsonse->getBody(); +// writing the string "abcd" +$body->write('abcd'); + +// seeking to start of stream +$body->seek(0); +// writing 'ef' +$body->write('ef'); // at this point the stream contains "efcd" +``` + +#### Prepending by rewriting separately + +```php +// assuming our response body stream only contains: "abcd" +$body = $response->getBody(); +$body->rewind(); +$contents = $body->getContents(); // abcd +// seeking the stream to beginning +$body->rewind(); +$body->write('ef'); // stream contains "efcd" +$body->write($contents); // stream contains "efabcd" +``` + +> Note: `getContents()` seeks the stream while reading it, therefore if the second `rewind()` method call was not present the stream would have resulted in `abcdefabcd` because the `write()` method appends to stream if not preceeded by `rewind()` or `seek(0)`. + +#### Prepending by using contents as a string +```php +$body = $response->getBody(); +$body->rewind(); +$contents = $body->getContents(); // efabcd +$contents = 'ef'.$contents; +$body->rewind(); +$body->write($contents); +``` diff --git a/app/vendor/psr/http-message/src/MessageInterface.php b/app/vendor/psr/http-message/src/MessageInterface.php index dd46e5ec8..8cdb4ed63 100644 --- a/app/vendor/psr/http-message/src/MessageInterface.php +++ b/app/vendor/psr/http-message/src/MessageInterface.php @@ -1,5 +1,7 @@ =7.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "autoload": { "psr-4": { diff --git a/app/vendor/psr/http-server-middleware/README.md b/app/vendor/psr/http-server-middleware/README.md index 8359bd05c..7b0a9550e 100644 --- a/app/vendor/psr/http-server-middleware/README.md +++ b/app/vendor/psr/http-server-middleware/README.md @@ -1,6 +1,12 @@ HTTP Server Middleware -====================== +============== -Provides the `MiddlewareInterface` of [PSR-15][psr-15]. +This repository holds the `MiddlewareInterface` related to [PSR-15 (HTTP Server Request Handlers)][psr-url]. -[psr-15]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-15-request-handlers.md +Note that this is not a Middleware implementation of its own. It is merely the interface that describe a Middleware. + +The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. + +[psr-url]: https://www.php-fig.org/psr/psr-15/ +[package-url]: https://packagist.org/packages/psr/http-server-middleware +[implementation-url]: https://packagist.org/providers/psr/http-server-middleware-implementation diff --git a/app/vendor/psr/http-server-middleware/composer.json b/app/vendor/psr/http-server-middleware/composer.json index 1595513c3..151167148 100644 --- a/app/vendor/psr/http-server-middleware/composer.json +++ b/app/vendor/psr/http-server-middleware/composer.json @@ -15,12 +15,12 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { "php": ">=7.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "psr/http-server-handler": "^1.0" }, "autoload": { diff --git a/app/vendor/psy/psysh/src/CodeCleaner.php b/app/vendor/psy/psysh/src/CodeCleaner.php index d5f2720c3..8429847f6 100644 --- a/app/vendor/psy/psysh/src/CodeCleaner.php +++ b/app/vendor/psy/psysh/src/CodeCleaner.php @@ -50,6 +50,8 @@ class CodeCleaner { private $yolo = false; + private $strictTypes = false; + private $parser; private $printer; private $traverser; @@ -58,14 +60,16 @@ class CodeCleaner /** * CodeCleaner constructor. * - * @param Parser|null $parser A PhpParser Parser instance. One will be created if not explicitly supplied - * @param Printer|null $printer A PhpParser Printer instance. One will be created if not explicitly supplied - * @param NodeTraverser|null $traverser A PhpParser NodeTraverser instance. One will be created if not explicitly supplied - * @param bool $yolo run without input validation + * @param Parser|null $parser A PhpParser Parser instance. One will be created if not explicitly supplied + * @param Printer|null $printer A PhpParser Printer instance. One will be created if not explicitly supplied + * @param NodeTraverser|null $traverser A PhpParser NodeTraverser instance. One will be created if not explicitly supplied + * @param bool $yolo run without input validation + * @param bool $strictTypes enforce strict types by default */ - public function __construct(Parser $parser = null, Printer $printer = null, NodeTraverser $traverser = null, bool $yolo = false) + public function __construct(Parser $parser = null, Printer $printer = null, NodeTraverser $traverser = null, bool $yolo = false, bool $strictTypes = false) { $this->yolo = $yolo; + $this->strictTypes = $strictTypes; if ($parser === null) { $parserFactory = new ParserFactory(); @@ -134,7 +138,7 @@ private function getDefaultPasses(): array new MagicConstantsPass(), $namespacePass, // must run after the implicit return pass new RequirePass(), - new StrictTypesPass(), + new StrictTypesPass($this->strictTypes), // Namespace-aware validation (which depends on aforementioned shenanigans) new ValidClassNamePass(), @@ -168,7 +172,7 @@ private function getYoloPasses(): array new MagicConstantsPass(), $namespacePass, // must run after the implicit return pass new RequirePass(), - new StrictTypesPass(), + new StrictTypesPass($this->strictTypes), ]; } diff --git a/app/vendor/psy/psysh/src/CodeCleaner/EmptyArrayDimFetchPass.php b/app/vendor/psy/psysh/src/CodeCleaner/EmptyArrayDimFetchPass.php index d4dd6777c..d1c821023 100644 --- a/app/vendor/psy/psysh/src/CodeCleaner/EmptyArrayDimFetchPass.php +++ b/app/vendor/psy/psysh/src/CodeCleaner/EmptyArrayDimFetchPass.php @@ -14,6 +14,8 @@ use PhpParser\Node; use PhpParser\Node\Expr\ArrayDimFetch; use PhpParser\Node\Expr\Assign; +use PhpParser\Node\Expr\AssignRef; +use PhpParser\Node\Stmt\Foreach_; use Psy\Exception\FatalErrorException; /** @@ -34,7 +36,7 @@ public function beforeTraverse(array $nodes) } /** - * @throws FatalErrorException if the user used empty empty array dim fetch outside of assignment + * @throws FatalErrorException if the user used empty array dim fetch outside of assignment * * @param Node $node * @@ -44,6 +46,15 @@ public function enterNode(Node $node) { if ($node instanceof Assign && $node->var instanceof ArrayDimFetch) { $this->theseOnesAreFine[] = $node->var; + } elseif ($node instanceof AssignRef && $node->expr instanceof ArrayDimFetch) { + $this->theseOnesAreFine[] = $node->expr; + } elseif ($node instanceof Foreach_ && $node->valueVar instanceof ArrayDimFetch) { + $this->theseOnesAreFine[] = $node->valueVar; + } elseif ($node instanceof ArrayDimFetch && $node->var instanceof ArrayDimFetch) { + // $a[]['b'] = 'c' + if (\in_array($node, $this->theseOnesAreFine)) { + $this->theseOnesAreFine[] = $node->var; + } } if ($node instanceof ArrayDimFetch && $node->dim === null) { diff --git a/app/vendor/psy/psysh/src/CodeCleaner/ImplicitReturnPass.php b/app/vendor/psy/psysh/src/CodeCleaner/ImplicitReturnPass.php index 04481db99..d794bbe78 100644 --- a/app/vendor/psy/psysh/src/CodeCleaner/ImplicitReturnPass.php +++ b/app/vendor/psy/psysh/src/CodeCleaner/ImplicitReturnPass.php @@ -80,7 +80,7 @@ private function addImplicitReturn(array $nodes): array 'startLine' => $last->getLine(), 'endLine' => $last->getLine(), ]); - // @codeCoverageIgnoreEnd + // @codeCoverageIgnoreEnd } elseif ($last instanceof Expression && !($last->expr instanceof Exit_)) { // For PHP Parser 4.x $nodes[\count($nodes) - 1] = new Return_($last->expr, [ diff --git a/app/vendor/psy/psysh/src/CodeCleaner/StrictTypesPass.php b/app/vendor/psy/psysh/src/CodeCleaner/StrictTypesPass.php index 13c35b66d..7fa0ed8e8 100644 --- a/app/vendor/psy/psysh/src/CodeCleaner/StrictTypesPass.php +++ b/app/vendor/psy/psysh/src/CodeCleaner/StrictTypesPass.php @@ -34,6 +34,14 @@ class StrictTypesPass extends CodeCleanerPass private $strictTypes = false; + /** + * @param bool $strictTypes enforce strict types by default + */ + public function __construct(bool $strictTypes = false) + { + $this->strictTypes = $strictTypes; + } + /** * If this is a standalone strict types declaration, remember it for later. * diff --git a/app/vendor/psy/psysh/src/CodeCleaner/ValidClassNamePass.php b/app/vendor/psy/psysh/src/CodeCleaner/ValidClassNamePass.php index d068ff50f..aa9f29d18 100644 --- a/app/vendor/psy/psysh/src/CodeCleaner/ValidClassNamePass.php +++ b/app/vendor/psy/psysh/src/CodeCleaner/ValidClassNamePass.php @@ -265,6 +265,7 @@ protected function ensureInterfacesExist(array $interfaces, Stmt $stmt) * Get a symbol type key for storing in the scope name cache. * * @deprecated No longer used. Scope type should be passed into ensureCanDefine directly. + * * @codeCoverageIgnore * * @throws FatalErrorException diff --git a/app/vendor/psy/psysh/src/Command/ReflectingCommand.php b/app/vendor/psy/psysh/src/Command/ReflectingCommand.php index b85b2c401..0f2c54353 100644 --- a/app/vendor/psy/psysh/src/Command/ReflectingCommand.php +++ b/app/vendor/psy/psysh/src/Command/ReflectingCommand.php @@ -11,14 +11,18 @@ namespace Psy\Command; +use PhpParser\NodeTraverser; +use PhpParser\PrettyPrinter\Standard as Printer; use Psy\CodeCleaner\NoReturnValue; use Psy\Context; use Psy\ContextAware; use Psy\Exception\ErrorException; use Psy\Exception\RuntimeException; use Psy\Exception\UnexpectedTargetException; +use Psy\ParserFactory; use Psy\Reflection\ReflectionClassConstant; use Psy\Reflection\ReflectionConstant_; +use Psy\Sudo\SudoVisitor; use Psy\Util\Mirror; /** @@ -38,6 +42,26 @@ abstract class ReflectingCommand extends Command implements ContextAware */ protected $context; + private $parser; + private $traverser; + private $printer; + + /** + * {@inheritdoc} + */ + public function __construct($name = null) + { + $parserFactory = new ParserFactory(); + $this->parser = $parserFactory->createParser(); + + $this->traverser = new NodeTraverser(); + $this->traverser->addVisitor(new SudoVisitor()); + + $this->printer = new Printer(); + + parent::__construct($name); + } + /** * ContextAware interface. * @@ -170,7 +194,10 @@ protected function getTargetAndReflector(string $valueName): array protected function resolveCode(string $code) { try { - $value = $this->getApplication()->execute($code, true); + // Add an implicit `sudo` to target resolution. + $nodes = $this->traverser->traverse($this->parse($code)); + $sudoCode = $this->printer->prettyPrint($nodes); + $value = $this->getApplication()->execute($sudoCode, true); } catch (\Throwable $e) { // Swallow all exceptions? } @@ -182,6 +209,29 @@ protected function resolveCode(string $code) return $value; } + /** + * Lex and parse a string of code into statements. + * + * @param string $code + * + * @return array Statements + */ + private function parse($code) + { + $code = 'parser->parse($code); + } catch (\PhpParser\Error $e) { + if (\strpos($e->getMessage(), 'unexpected EOF') === false) { + throw $e; + } + + // If we got an unexpected EOF, let's try it again with a semicolon. + return $this->parser->parse($code.';'); + } + } + /** * Resolve code to an object in the current scope. * diff --git a/app/vendor/psy/psysh/src/Command/TimeitCommand.php b/app/vendor/psy/psysh/src/Command/TimeitCommand.php index 82b9e0e72..c39649b0a 100644 --- a/app/vendor/psy/psysh/src/Command/TimeitCommand.php +++ b/app/vendor/psy/psysh/src/Command/TimeitCommand.php @@ -28,6 +28,8 @@ class TimeitCommand extends Command const RESULT_MSG = 'Command took %.6f seconds to complete.'; const AVG_RESULT_MSG = 'Command took %.6f seconds on average (%.6f median; %.6f total) to complete.'; + // All times stored as nanoseconds! + private static $useHrtime; private static $start = null; private static $times = []; @@ -40,6 +42,9 @@ class TimeitCommand extends Command */ public function __construct($name = null) { + // @todo Remove microtime use after we drop support for PHP < 7.3 + self::$useHrtime = \function_exists('hrtime'); + $parserFactory = new ParserFactory(); $this->parser = $parserFactory->createParser(); @@ -100,13 +105,13 @@ protected function execute(InputInterface $input, OutputInterface $output) self::$times = []; if ($num === 1) { - $output->writeln(\sprintf(self::RESULT_MSG, $times[0])); + $output->writeln(\sprintf(self::RESULT_MSG, $times[0] / 1e+9)); } else { $total = \array_sum($times); \rsort($times); $median = $times[\round($num / 2)]; - $output->writeln(\sprintf(self::AVG_RESULT_MSG, $total / $num, $median, $total)); + $output->writeln(\sprintf(self::AVG_RESULT_MSG, ($total / $num) / 1e+9, $median / 1e+9, $total / 1e+9)); } return 0; @@ -121,7 +126,7 @@ protected function execute(InputInterface $input, OutputInterface $output) */ public static function markStart() { - self::$start = \microtime(true); + self::$start = self::$useHrtime ? \hrtime(true) : (\microtime(true) * 1e+6); } /** @@ -140,7 +145,7 @@ public static function markStart() */ public static function markEnd($ret = null) { - self::$times[] = \microtime(true) - self::$start; + self::$times[] = (self::$useHrtime ? \hrtime(true) : (\microtime(true) * 1e+6)) - self::$start; self::$start = null; return $ret; diff --git a/app/vendor/psy/psysh/src/ConfigPaths.php b/app/vendor/psy/psysh/src/ConfigPaths.php index 67fab9865..8eb0e1cb1 100644 --- a/app/vendor/psy/psysh/src/ConfigPaths.php +++ b/app/vendor/psy/psysh/src/ConfigPaths.php @@ -34,7 +34,8 @@ class ConfigPaths public function __construct(array $overrides = [], EnvInterface $env = null) { $this->overrideDirs($overrides); - $this->env = $env ?: new SuperglobalsEnv(); + + $this->env = $env ?: (\PHP_SAPI === 'cli-server' ? new SystemEnv() : new SuperglobalsEnv()); } /** diff --git a/app/vendor/psy/psysh/src/Configuration.php b/app/vendor/psy/psysh/src/Configuration.php index ddb35ea65..0be66ea09 100644 --- a/app/vendor/psy/psysh/src/Configuration.php +++ b/app/vendor/psy/psysh/src/Configuration.php @@ -67,6 +67,7 @@ class Configuration 'requireSemicolons', 'runtimeDir', 'startupMessage', + 'strictTypes', 'theme', 'updateCheck', 'useBracketedPaste', @@ -99,6 +100,7 @@ class Configuration private $pipedOutput; private $rawOutput = false; private $requireSemicolons = false; + private $strictTypes = false; private $useUnicode; private $useTabCompletion; private $newMatchers = []; @@ -127,6 +129,7 @@ class Configuration private $presenter; private $autoCompleter; private $checker; + /** @deprecated */ private $prompt; private $configPaths; @@ -146,6 +149,8 @@ public function __construct(array $config = []) $this->configFile = $config['configFile']; } elseif (isset($_SERVER['PSYSH_CONFIG']) && $_SERVER['PSYSH_CONFIG']) { $this->configFile = $_SERVER['PSYSH_CONFIG']; + } elseif (\PHP_SAPI === 'cli-server' && ($configFile = \getenv('PSYSH_CONFIG'))) { + $this->configFile = $configFile; } // legacy baseDir option @@ -959,6 +964,22 @@ public function requireSemicolons(): bool return $this->requireSemicolons; } + /** + * Enable or disable strict types enforcement. + */ + public function setStrictTypes($strictTypes) + { + $this->strictTypes = (bool) $strictTypes; + } + + /** + * Check whether to enforce strict types. + */ + public function strictTypes(): bool + { + return $this->strictTypes; + } + /** * Enable or disable Unicode in PsySH specific output. * @@ -1035,7 +1056,7 @@ public function setCodeCleaner(CodeCleaner $cleaner) public function getCodeCleaner(): CodeCleaner { if (!isset($this->cleaner)) { - $this->cleaner = new CodeCleaner(null, null, null, $this->yolo()); + $this->cleaner = new CodeCleaner(null, null, null, $this->yolo(), $this->strictTypes()); } return $this->cleaner; @@ -1628,11 +1649,19 @@ public function getStartupMessage() /** * Set the prompt. * - * @param string $prompt + * @deprecated The `prompt` configuration has been replaced by Themes and support will + * eventually be removed. In the meantime, prompt is applied first by the Theme, then overridden + * by any explicitly defined prompt. + * + * Note that providing a prompt but not a theme config will implicitly use the `classic` theme. */ public function setPrompt(string $prompt) { $this->prompt = $prompt; + + if (isset($this->theme)) { + $this->theme->setPrompt($prompt); + } } /** @@ -1676,6 +1705,10 @@ public function setTheme($theme) $this->theme = $theme; + if (isset($this->prompt)) { + $this->theme->setPrompt($this->prompt); + } + if (isset($this->output)) { $this->output->setTheme($theme); $this->applyFormatterStyles(); @@ -1688,7 +1721,12 @@ public function setTheme($theme) public function theme(): Theme { if (!isset($this->theme)) { - $this->theme = new Theme(); + // If a prompt is explicitly set, and a theme is not, base it on the `classic` theme. + $this->theme = $this->prompt ? new Theme('classic') : new Theme(); + } + + if (isset($this->prompt)) { + $this->theme->setPrompt($this->prompt); } return $this->theme; diff --git a/app/vendor/psy/psysh/src/Exception/ErrorException.php b/app/vendor/psy/psysh/src/Exception/ErrorException.php index 54abcfd70..13e24fe9e 100644 --- a/app/vendor/psy/psysh/src/Exception/ErrorException.php +++ b/app/vendor/psy/psysh/src/Exception/ErrorException.php @@ -101,7 +101,7 @@ public static function throwException($errno, $errstr, $errfile, $errline) /** * Create an ErrorException from an Error. * - * @deprecated psySH no longer wraps Errors + * @deprecated PsySH no longer wraps Errors * * @param \Error $e */ diff --git a/app/vendor/psy/psysh/src/Exception/ThrowUpException.php b/app/vendor/psy/psysh/src/Exception/ThrowUpException.php index a01c39d25..6e2da0899 100644 --- a/app/vendor/psy/psysh/src/Exception/ThrowUpException.php +++ b/app/vendor/psy/psysh/src/Exception/ThrowUpException.php @@ -36,7 +36,7 @@ public function getRawMessage(): string /** * Create a ThrowUpException from a Throwable. * - * @deprecated psySH no longer wraps Throwables + * @deprecated PsySH no longer wraps Throwables * * @param \Throwable $throwable */ diff --git a/app/vendor/psy/psysh/src/Exception/TypeErrorException.php b/app/vendor/psy/psysh/src/Exception/TypeErrorException.php index d7151ead7..cbf00eaa6 100644 --- a/app/vendor/psy/psysh/src/Exception/TypeErrorException.php +++ b/app/vendor/psy/psysh/src/Exception/TypeErrorException.php @@ -21,7 +21,7 @@ class TypeErrorException extends \Exception implements Exception /** * Constructor! * - * @deprecated psySH no longer wraps TypeErrors + * @deprecated PsySH no longer wraps TypeErrors * * @param string $message (default: "") * @param int $code (default: 0) @@ -45,7 +45,7 @@ public function getRawMessage(): string /** * Create a TypeErrorException from a TypeError. * - * @deprecated psySH no longer wraps TypeErrors + * @deprecated PsySH no longer wraps TypeErrors * * @param \TypeError $e */ diff --git a/app/vendor/psy/psysh/src/Formatter/CodeFormatter.php b/app/vendor/psy/psysh/src/Formatter/CodeFormatter.php index 43bb7fc08..d795cf1ea 100644 --- a/app/vendor/psy/psysh/src/Formatter/CodeFormatter.php +++ b/app/vendor/psy/psysh/src/Formatter/CodeFormatter.php @@ -32,7 +32,7 @@ class CodeFormatter implements ReflectorFormatter const HIGHLIGHT_CONST = 'const'; const HIGHLIGHT_NUMBER = 'number'; const HIGHLIGHT_STRING = 'string'; - const HIGHLIGHT_COMMENT = 'comment'; + const HIGHLIGHT_COMMENT = 'code_comment'; const HIGHLIGHT_INLINE_HTML = 'inline_html'; private static $tokenMap = [ diff --git a/app/vendor/psy/psysh/src/Formatter/SignatureFormatter.php b/app/vendor/psy/psysh/src/Formatter/SignatureFormatter.php index 3c9c2625d..799d669d1 100644 --- a/app/vendor/psy/psysh/src/Formatter/SignatureFormatter.php +++ b/app/vendor/psy/psysh/src/Formatter/SignatureFormatter.php @@ -38,8 +38,8 @@ public static function format(\Reflector $reflector): string case $reflector instanceof ReflectionLanguageConstruct: return self::formatFunction($reflector); - // this case also covers \ReflectionObject: case $reflector instanceof \ReflectionClass: + // this case also covers \ReflectionObject return self::formatClass($reflector); case $reflector instanceof ReflectionClassConstant: diff --git a/app/vendor/psy/psysh/src/Output/Theme.php b/app/vendor/psy/psysh/src/Output/Theme.php index 98a73e912..01023f2ec 100644 --- a/app/vendor/psy/psysh/src/Output/Theme.php +++ b/app/vendor/psy/psysh/src/Output/Theme.php @@ -57,21 +57,22 @@ class Theme 'default' => [null], // Types - 'number' => ['magenta'], - 'integer' => ['magenta'], - 'float' => ['yellow'], - 'string' => ['green'], - 'bool' => ['cyan'], - 'keyword' => ['yellow'], - 'comment' => ['blue'], - 'object' => ['blue'], - 'resource' => ['yellow'], + 'number' => ['magenta'], + 'integer' => ['magenta'], + 'float' => ['yellow'], + 'string' => ['green'], + 'bool' => ['cyan'], + 'keyword' => ['yellow'], + 'comment' => ['blue'], + 'code_comment' => ['gray'], + 'object' => ['blue'], + 'resource' => ['yellow'], // Code-specific formatting 'inline_html' => ['cyan'], ]; - const ERROR_STYLES = ['info', 'warning', 'error', 'whisper']; + const ERROR_STYLES = ['info', 'warning', 'error', 'whisper', 'class']; private $compact = false; @@ -95,7 +96,7 @@ public function __construct($config = 'modern') $config = static::MODERN_THEME; break; - case 'compact': + case 'compact': $config = static::COMPACT_THEME; break; @@ -139,10 +140,6 @@ public function __construct($config = 'modern') case 'grayFallback': $this->setGrayFallback($value); break; - - case 'compact': - $this->setCompact($value); - break; } } diff --git a/app/vendor/psy/psysh/src/Readline/Hoa/Protocol.php b/app/vendor/psy/psysh/src/Readline/Hoa/Protocol.php index 51d064e02..922ddcbfb 100644 --- a/app/vendor/psy/psysh/src/Readline/Hoa/Protocol.php +++ b/app/vendor/psy/psysh/src/Readline/Hoa/Protocol.php @@ -87,7 +87,7 @@ public static function getInstance(): self protected function initialize() { $root = \dirname(__DIR__, 3); - $argv0 = \realpath($_SERVER['argv'][0]); + $argv0 = isset($_SERVER['argv'][0]) ? \realpath($_SERVER['argv'][0]) : false; $cwd = 'cli' === \PHP_SAPI diff --git a/app/vendor/psy/psysh/src/Readline/Hoa/ProtocolNodeLibrary.php b/app/vendor/psy/psysh/src/Readline/Hoa/ProtocolNodeLibrary.php index dfb0cb206..0719374c0 100644 --- a/app/vendor/psy/psysh/src/Readline/Hoa/ProtocolNodeLibrary.php +++ b/app/vendor/psy/psysh/src/Readline/Hoa/ProtocolNodeLibrary.php @@ -47,7 +47,7 @@ class ProtocolNodeLibrary extends ProtocolNode public function reach(string $queue = null) { $withComposer = \class_exists('Composer\Autoload\ClassLoader', false) || - ('cli' === \PHP_SAPI && \file_exists(__DIR__.DS.'..'.DS.'..'.DS.'..'.DS.'..'.DS.'autoload.php')); + ('cli' === \PHP_SAPI && \file_exists(__DIR__.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'autoload.php')); if ($withComposer) { return parent::reach($queue); diff --git a/app/vendor/psy/psysh/src/Shell.php b/app/vendor/psy/psysh/src/Shell.php index 98379cfd6..58d8fef36 100644 --- a/app/vendor/psy/psysh/src/Shell.php +++ b/app/vendor/psy/psysh/src/Shell.php @@ -49,7 +49,7 @@ */ class Shell extends Application { - const VERSION = 'v0.11.12'; + const VERSION = 'v0.11.20'; /** @deprecated */ const PROMPT = '>>> '; @@ -626,7 +626,7 @@ public function onExecute(string $code): string $output = $output->getErrorOutput(); } - $output->writeln(\sprintf('', OutputFormatter::escape($code)), ConsoleOutput::VERBOSITY_DEBUG); + $output->writeln(\sprintf('%s', OutputFormatter::escape($code)), ConsoleOutput::VERBOSITY_DEBUG); return $code; } diff --git a/app/vendor/psy/psysh/src/SystemEnv.php b/app/vendor/psy/psysh/src/SystemEnv.php new file mode 100644 index 000000000..fe2a8edcf --- /dev/null +++ b/app/vendor/psy/psysh/src/SystemEnv.php @@ -0,0 +1,34 @@ +isCommand($command[1]) && - $this->matchCommand($command[1]) && - empty($tokens): + !$this->isCommand($command[1]) && + $this->matchCommand($command[1]) && + empty($tokens): return true; } diff --git a/app/vendor/psy/psysh/src/TabCompletion/Matcher/KeywordsMatcher.php b/app/vendor/psy/psysh/src/TabCompletion/Matcher/KeywordsMatcher.php index 6333269de..9f2bdef7d 100644 --- a/app/vendor/psy/psysh/src/TabCompletion/Matcher/KeywordsMatcher.php +++ b/app/vendor/psy/psysh/src/TabCompletion/Matcher/KeywordsMatcher.php @@ -73,7 +73,7 @@ public function hasMatched(array $tokens): bool case self::hasToken([self::T_OPEN_TAG, self::T_VARIABLE], $token): // case is_string($token) && $token === '$': case self::hasToken([self::T_OPEN_TAG, self::T_VARIABLE], $prevToken) && - self::tokenIs($token, self::T_STRING): + self::tokenIs($token, self::T_STRING): case self::isOperator($token): return true; } diff --git a/app/vendor/psy/psysh/src/functions.php b/app/vendor/psy/psysh/src/functions.php index 7445bf81c..c3a78e9f9 100644 --- a/app/vendor/psy/psysh/src/functions.php +++ b/app/vendor/psy/psysh/src/functions.php @@ -155,6 +155,9 @@ function info(Configuration $config = null) $config = $lastConfig ?: new Configuration(); $configEnv = (isset($_SERVER['PSYSH_CONFIG']) && $_SERVER['PSYSH_CONFIG']) ? $_SERVER['PSYSH_CONFIG'] : false; + if ($configEnv === false && \PHP_SAPI === 'cli-server') { + $configEnv = \getenv('PSYSH_CONFIG'); + } $shellInfo = [ 'PsySH version' => Shell::VERSION, @@ -165,6 +168,7 @@ function info(Configuration $config = null) 'OS' => \PHP_OS, 'default includes' => $config->getDefaultIncludes(), 'require semicolons' => $config->requireSemicolons(), + 'strict types' => $config->strictTypes(), 'error logging level' => $config->errorLoggingLevel(), 'config file' => [ 'default config file' => $prettyPath($config->getConfigFile()), @@ -228,6 +232,16 @@ function info(Configuration $config = null) 'output pager' => $config->getPager(), ]; + $theme = $config->theme(); + // TODO: show styles (but only if they're different than default?) + $output['theme'] = [ + 'compact' => $theme->compact(), + 'prompt' => $theme->prompt(), + 'bufferPrompt' => $theme->bufferPrompt(), + 'replayPrompt' => $theme->replayPrompt(), + 'returnValue' => $theme->returnValue(), + ]; + $pcntl = [ 'pcntl available' => ProcessForker::isPcntlSupported(), 'posix available' => ProcessForker::isPosixSupported(), diff --git a/app/vendor/react/promise/CHANGELOG.md b/app/vendor/react/promise/CHANGELOG.md index 7f785eb5c..7825b3397 100644 --- a/app/vendor/react/promise/CHANGELOG.md +++ b/app/vendor/react/promise/CHANGELOG.md @@ -1,6 +1,20 @@ CHANGELOG for 2.x ================= +## 2.10.0 (2023-05-02) + +* Feature: Support Disjunctive Normal Form Types (DNF types) for PHP 8.2+. + (#237 by @nhedger) + + Feature: Add full support for PHP 8.2. + (#233 by @WyriHaximus and #241 by @clue) + +* Improve examples in documentation. + (#226 by @nhedger) + +* Improve test suite and project setup and report failed assertions. + (#215 and #217 by @SimonFrings and #241 by @clue) + * 2.9.0 (2022-02-11) * Feature: Support union types and address deprecation of `ReflectionType::getClass()` (PHP 8+). diff --git a/app/vendor/react/promise/README.md b/app/vendor/react/promise/README.md index d904a1d8f..9449b920d 100644 --- a/app/vendor/react/promise/README.md +++ b/app/vendor/react/promise/README.md @@ -4,7 +4,8 @@ Promise A lightweight implementation of [CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP. -[![CI status](https://github.com/reactphp/promise/workflows/CI/badge.svg?branch=2.x)](https://github.com/reactphp/promise/actions) +[![CI status](https://github.com/reactphp/promise/actions/workflows/ci.yml/badge.svg?branch=2.x)](https://github.com/reactphp/promise/actions) +[![installs on Packagist](https://img.shields.io/packagist/dt/react/promise?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/promise) Table of Contents ----------------- @@ -849,7 +850,7 @@ This project follows [SemVer](https://semver.org/). This will install the latest supported version: ```bash -$ composer require react/promise:^2.9 +composer require react/promise:^2.10 ``` See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. diff --git a/app/vendor/react/promise/composer.json b/app/vendor/react/promise/composer.json index f933f1537..2a48ed1da 100644 --- a/app/vendor/react/promise/composer.json +++ b/app/vendor/react/promise/composer.json @@ -28,7 +28,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36" }, "autoload": { "psr-4": { diff --git a/app/vendor/react/promise/src/functions.php b/app/vendor/react/promise/src/functions.php index 429f0e733..2177dc235 100644 --- a/app/vendor/react/promise/src/functions.php +++ b/app/vendor/react/promise/src/functions.php @@ -354,7 +354,7 @@ function _checkTypehint(callable $callback, $object) // Extract the type of the argument and handle different possibilities $type = $expectedException->getType(); - + $isTypeUnion = true; $types = []; @@ -379,14 +379,18 @@ function _checkTypehint(callable $callback, $object) } foreach ($types as $type) { - if (!$type instanceof \ReflectionNamedType) { - throw new \LogicException('This implementation does not support groups of intersection or union types'); - } - - // A named-type can be either a class-name or a built-in type like string, int, array, etc. - $matches = ($type->isBuiltin() && \gettype($object) === $type->getName()) - || (new \ReflectionClass($type->getName()))->isInstance($object); + if ($type instanceof \ReflectionIntersectionType) { + foreach ($type->getTypes() as $typeToMatch) { + if (!($matches = ($typeToMatch->isBuiltin() && \gettype($object) === $typeToMatch->getName()) + || (new \ReflectionClass($typeToMatch->getName()))->isInstance($object))) { + break; + } + } + } else { + $matches = ($type->isBuiltin() && \gettype($object) === $type->getName()) + || (new \ReflectionClass($type->getName()))->isInstance($object); + } // If we look for a single match (union), we can return early on match // If we look for a full match (intersection), we can return early on mismatch diff --git a/app/vendor/sebastian/diff/ChangeLog.md b/app/vendor/sebastian/diff/ChangeLog.md index 9bdcc5b6d..a6ccfad71 100644 --- a/app/vendor/sebastian/diff/ChangeLog.md +++ b/app/vendor/sebastian/diff/ChangeLog.md @@ -2,6 +2,13 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [4.0.5] - 2023-05-07 + +### Changed + +* [#118](https://github.com/sebastianbergmann/diff/pull/118): Improve performance of `MemoryEfficientLongestCommonSubsequenceCalculator` +* [#119](https://github.com/sebastianbergmann/diff/pull/119): Improve performance of `TimeEfficientLongestCommonSubsequenceCalculator` + ## [4.0.4] - 2020-10-26 ### Fixed @@ -76,6 +83,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 5.6 +[4.0.5]: https://github.com/sebastianbergmann/diff/compare/4.0.4...4.0.5 [4.0.4]: https://github.com/sebastianbergmann/diff/compare/4.0.3...4.0.4 [4.0.3]: https://github.com/sebastianbergmann/diff/compare/4.0.2...4.0.3 [4.0.2]: https://github.com/sebastianbergmann/diff/compare/4.0.1...4.0.2 diff --git a/app/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php b/app/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php index 0b626eaff..489113b6b 100644 --- a/app/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php +++ b/app/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php @@ -78,7 +78,12 @@ private function length(array $from, array $to): array if ($from[$i] === $to[$j]) { $current[$j + 1] = $prev[$j] + 1; } else { - $current[$j + 1] = max($current[$j], $prev[$j + 1]); + // don't use max() to avoid function call overhead + if ($current[$j] > $prev[$j + 1]) { + $current[$j + 1] = $current[$j]; + } else { + $current[$j + 1] = $prev[$j + 1]; + } } } } diff --git a/app/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php b/app/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php index fd19cac76..4e8d951d4 100644 --- a/app/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php +++ b/app/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php @@ -37,12 +37,24 @@ public function calculate(array $from, array $to): array for ($i = 1; $i <= $fromLength; ++$i) { for ($j = 1; $j <= $toLength; ++$j) { - $o = ($j * $width) + $i; - $matrix[$o] = max( - $matrix[$o - 1], - $matrix[$o - $width], - $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0 - ); + $o = ($j * $width) + $i; + + // don't use max() to avoid function call overhead + $firstOrLast = $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0; + + if ($matrix[$o - 1] > $matrix[$o - $width]) { + if ($firstOrLast > $matrix[$o - 1]) { + $matrix[$o] = $firstOrLast; + } else { + $matrix[$o] = $matrix[$o - 1]; + } + } else { + if ($firstOrLast > $matrix[$o - $width]) { + $matrix[$o] = $firstOrLast; + } else { + $matrix[$o] = $matrix[$o - $width]; + } + } } } diff --git a/app/vendor/sebastian/global-state/ChangeLog.md b/app/vendor/sebastian/global-state/ChangeLog.md index a27a5cf16..477266644 100644 --- a/app/vendor/sebastian/global-state/ChangeLog.md +++ b/app/vendor/sebastian/global-state/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes in `sebastian/global-state` are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [5.0.6] - 2023-08-02 + +### Changed + +* Changed usage of `ReflectionProperty::setValue()` to be compatible with PHP 8.3 + ## [5.0.5] - 2022-02-14 ### Fixed @@ -66,6 +72,7 @@ All notable changes in `sebastian/global-state` are documented in this file usin * This component is no longer supported on PHP 7.0 and PHP 7.1 +[5.0.6]: https://github.com/sebastianbergmann/global-state/compare/5.0.5...5.0.6 [5.0.5]: https://github.com/sebastianbergmann/global-state/compare/5.0.4...5.0.5 [5.0.4]: https://github.com/sebastianbergmann/global-state/compare/5.0.3...5.0.4 [5.0.3]: https://github.com/sebastianbergmann/global-state/compare/5.0.2...5.0.3 diff --git a/app/vendor/sebastian/global-state/src/Restorer.php b/app/vendor/sebastian/global-state/src/Restorer.php index 1633fcc11..ab145ce23 100644 --- a/app/vendor/sebastian/global-state/src/Restorer.php +++ b/app/vendor/sebastian/global-state/src/Restorer.php @@ -85,7 +85,7 @@ public function restoreStaticAttributes(Snapshot $snapshot): void foreach ($staticAttributes as $name => $value) { $reflector = new ReflectionProperty($className, $name); $reflector->setAccessible(true); - $reflector->setValue($value); + $reflector->setValue(null, $value); } } @@ -109,7 +109,7 @@ public function restoreStaticAttributes(Snapshot $snapshot): void } $attribute->setAccessible(true); - $attribute->setValue($defaults[$name]); + $attribute->setValue(null, $defaults[$name]); } } } diff --git a/app/vendor/seld/jsonlint/CHANGELOG.md b/app/vendor/seld/jsonlint/CHANGELOG.md index e3550bafc..b1413473a 100644 --- a/app/vendor/seld/jsonlint/CHANGELOG.md +++ b/app/vendor/seld/jsonlint/CHANGELOG.md @@ -1,5 +1,13 @@ You can find newer changelog entries in [GitHub releases](https://github.com/Seldaek/jsonlint/releases) +### 1.10.0 (2023-05-11) + + * Added ALLOW_COMMENTS flag to parse while allowing (and ignoring) inline `//` and multiline `/* */` comments in the JSON document (#81) + +### 1.9.0 (2022-04-01) + + * Internal cleanups and type fixes + ### 1.8.1 (2020-08-13) * Added type annotations diff --git a/app/vendor/seld/jsonlint/README.md b/app/vendor/seld/jsonlint/README.md index c6597637e..a26450b0c 100644 --- a/app/vendor/seld/jsonlint/README.md +++ b/app/vendor/seld/jsonlint/README.md @@ -34,6 +34,7 @@ You can also pass additional flags to `JsonParser::lint/parse` that tweak the fu - `JsonParser::DETECT_KEY_CONFLICTS` throws an exception on duplicate keys. - `JsonParser::ALLOW_DUPLICATE_KEYS` collects duplicate keys. e.g. if you have two `foo` keys they will end up as `foo` and `foo.2`. - `JsonParser::PARSE_TO_ASSOC` parses to associative arrays instead of stdClass objects. +- `JsonParser::ALLOW_COMMENTS` parses while allowing (and ignoring) inline `//` and multiline `/* */` comments in the JSON document. Example: diff --git a/app/vendor/seld/jsonlint/src/Seld/JsonLint/JsonParser.php b/app/vendor/seld/jsonlint/src/Seld/JsonLint/JsonParser.php index beee143ff..420c0fda3 100644 --- a/app/vendor/seld/jsonlint/src/Seld/JsonLint/JsonParser.php +++ b/app/vendor/seld/jsonlint/src/Seld/JsonLint/JsonParser.php @@ -30,13 +30,14 @@ class JsonParser const DETECT_KEY_CONFLICTS = 1; const ALLOW_DUPLICATE_KEYS = 2; const PARSE_TO_ASSOC = 4; + const ALLOW_COMMENTS = 8; /** @var Lexer */ private $lexer; /** * @var int - * @psalm-var int-mask-of + * @phpstan-var int-mask-of */ private $flags; /** @var list */ @@ -177,6 +178,8 @@ class JsonParser * @param string $input JSON string * @param int $flags Bitmask of parse/lint options (see constants of this class) * @return null|ParsingException null if no error is found, a ParsingException containing all details otherwise + * + * @phpstan-param int-mask-of $flags */ public function lint($input, $flags = 0) { @@ -193,6 +196,8 @@ public function lint($input, $flags = 0) * @param int $flags Bitmask of parse/lint options (see constants of this class) * @return mixed * @throws ParsingException + * + * @phpstan-param int-mask-of $flags */ public function parse($input, $flags = 0) { @@ -210,7 +215,7 @@ public function parse($input, $flags = 0) /** @var int<0,3> */ $recovering = 0; - $this->lexer = new Lexer(); + $this->lexer = new Lexer($flags); $this->lexer->setInput($input); $yyloc = $this->lexer->yylloc; diff --git a/app/vendor/seld/jsonlint/src/Seld/JsonLint/Lexer.php b/app/vendor/seld/jsonlint/src/Seld/JsonLint/Lexer.php index bb5cd5f85..fbaf4c735 100644 --- a/app/vendor/seld/jsonlint/src/Seld/JsonLint/Lexer.php +++ b/app/vendor/seld/jsonlint/src/Seld/JsonLint/Lexer.php @@ -24,26 +24,38 @@ class Lexer const T_INVALID = -1; const T_SKIP_WHITESPACE = 0; const T_ERROR = 2; + /** @internal */ + const T_BREAK_LINE = 3; + /** @internal */ + const T_COMMENT = 30; + /** @internal */ + const T_OPEN_COMMENT = 31; + /** @internal */ + const T_CLOSE_COMMENT = 32; /** - * @phpstan-var array, string> + * @phpstan-var array, string> * @const */ private $rules = array( - 0 => '/\G\s+/', - 1 => '/\G-?([0-9]|[1-9][0-9]+)(\.[0-9]+)?([eE][+-]?[0-9]+)?\b/', - 2 => '{\G"(?>\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^\0-\x1f\\\\"]++)*+"}', - 3 => '/\G\{/', - 4 => '/\G\}/', - 5 => '/\G\[/', - 6 => '/\G\]/', - 7 => '/\G,/', - 8 => '/\G:/', - 9 => '/\Gtrue\b/', - 10 => '/\Gfalse\b/', - 11 => '/\Gnull\b/', - 12 => '/\G$/', - 13 => '/\G./', + 0 => '/\G\s*\n\r?/', + 1 => '/\G\s+/', + 2 => '/\G-?([0-9]|[1-9][0-9]+)(\.[0-9]+)?([eE][+-]?[0-9]+)?\b/', + 3 => '{\G"(?>\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^\0-\x1f\\\\"]++)*+"}', + 4 => '/\G\{/', + 5 => '/\G\}/', + 6 => '/\G\[/', + 7 => '/\G\]/', + 8 => '/\G,/', + 9 => '/\G:/', + 10 => '/\Gtrue\b/', + 11 => '/\Gfalse\b/', + 12 => '/\Gnull\b/', + 13 => '/\G$/', + 14 => '/\G\/\//', + 15 => '/\G\/\*/', + 16 => '/\G\*\//', + 17 => '/\G./', ); /** @var string */ @@ -54,6 +66,8 @@ class Lexer private $done; /** @var 0|positive-int */ private $offset; + /** @var int */ + private $flags; /** @var string */ public $match; @@ -67,15 +81,41 @@ class Lexer public $yylloc; /** - * @return 1|4|6|8|10|11|14|17|18|21|22|23|24|-1 + * @param int $flags + */ + public function __construct($flags = 0) + { + $this->flags = $flags; + } + + /** + * @return 0|1|4|6|8|10|11|14|17|18|21|22|23|24|30|-1 */ public function lex() { - do { + while (true) { $symbol = $this->next(); - } while ($symbol === self::T_SKIP_WHITESPACE); - - return $symbol; + switch ($symbol) { + case self::T_SKIP_WHITESPACE: + case self::T_BREAK_LINE: + break; + case self::T_COMMENT: + case self::T_OPEN_COMMENT: + if (!($this->flags & JsonParser::ALLOW_COMMENTS)) { + $this->parseError('Lexical error on line ' . ($this->yylineno+1) . ". Comments are not allowed.\n" . $this->showPosition()); + } + $this->skipUntil($symbol === self::T_COMMENT ? self::T_BREAK_LINE : self::T_CLOSE_COMMENT); + if ($this->done) { + // last symbol '/\G$/' before EOF + return 14; + } + break; + case self::T_CLOSE_COMMENT: + $this->parseError('Lexical error on line ' . ($this->yylineno+1) . ". Unexpected token.\n" . $this->showPosition()); + default: + return $symbol; + } + } } /** @@ -160,7 +200,19 @@ protected function parseError($str) } /** - * @return 0|1|4|6|8|10|11|14|17|18|21|22|23|24|-1 + * @param int $token + * @return void + */ + private function skipUntil($token) + { + $symbol = $this->next(); + while ($symbol !== $token && false === $this->done) { + $symbol = $this->next(); + } + } + + /** + * @return 0|1|3|4|6|8|10|11|14|17|18|21|22|23|24|30|31|32|-1 */ private function next() { @@ -181,7 +233,7 @@ private function next() $this->match = ''; } - $rulesLen = 14; // count($this->rules) + $rulesLen = count($this->rules); for ($i=0; $i < $rulesLen; $i++) { if (preg_match($this->rules[$i], $this->input, $match, 0, $this->offset)) { @@ -215,40 +267,47 @@ private function next() /** * @param int $rule - * @return 0|4|6|8|10|11|14|17|18|21|22|23|24|-1 + * @return 0|3|4|6|8|10|11|14|17|18|21|22|23|24|30|31|32|-1 */ private function performAction($rule) { switch ($rule) { - case 0:/* skip whitespace */ + case 0:/* skip break line */ + return self::T_BREAK_LINE; + case 1:/* skip whitespace */ return self::T_SKIP_WHITESPACE; - case 1: - return 6; case 2: + return 6; + case 3: $this->yytext = substr($this->yytext, 1, $this->yyleng-2); - return 4; - case 3: - return 17; case 4: - return 18; + return 17; case 5: - return 23; + return 18; case 6: - return 24; + return 23; case 7: - return 22; + return 24; case 8: - return 21; + return 22; case 9: - return 10; + return 21; case 10: - return 11; + return 10; case 11: - return 8; + return 11; case 12: - return 14; + return 8; case 13: + return 14; + case 14: + return self::T_COMMENT; + case 15: + return self::T_OPEN_COMMENT; + case 16: + return self::T_CLOSE_COMMENT; + case 17: return self::T_INVALID; default: throw new \LogicException('Unsupported rule '.$rule); diff --git a/app/vendor/slevomat/coding-standard/README.md b/app/vendor/slevomat/coding-standard/README.md index a225b26c5..b44b78e73 100644 --- a/app/vendor/slevomat/coding-standard/README.md +++ b/app/vendor/slevomat/coding-standard/README.md @@ -29,8 +29,11 @@ Slevomat Coding Standard for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_ 🚧 = [Sniff check can be suppressed locally](#suppressing-sniffs-locally) + - [SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys](doc/arrays.md#slevomatcodingstandardarrayalphabeticallysortedbykeys) 🔧 - [SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation](doc/arrays.md#slevomatcodingstandardarraysdisallowimplicitarraycreation) + - [SlevomatCodingStandard.Arrays.DisallowPartiallyKeyed](doc/arrays.md#slevomatcodingstandardarraysdisallowpartiallykeyed) 🚧 - [SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement](doc/arrays.md#slevomatcodingstandardarraysmultilinearrayendbracketplacement-) 🔧 + - [SlevomatCodingStandard.Arrays.ArrayAccessSniff.php](doc/arrays.md#slevomatcodingstandardarraysarrayaccess-) 🔧 - [SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace](doc/arrays.md#slevomatcodingstandardarrayssinglelinearraywhitespace-) 🔧 - [SlevomatCodingStandard.Arrays.TrailingArrayComma](doc/arrays.md#slevomatcodingstandardarraystrailingarraycomma-) 🔧 - [SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing](doc/attributes.md#slevomatcodingstandardattributesattributeandtargetspacing-) 🔧 @@ -48,7 +51,9 @@ Slevomat Coding Standard for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_ - [SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants](doc/classes.md#slevomatcodingstandardclassesdisallowlatestaticbindingforconstants-) 🔧 - [SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition](doc/classes.md#slevomatcodingstandardclassesdisallowmulticonstantdefinition-) 🔧 - [SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition](doc/classes.md#slevomatcodingstandardclassesdisallowmultipropertydefinition-) 🔧 + - [SlevomatCodingStandard.Classes.DisallowStringExpressionPropertyFetch](doc/classes.md#slevomatcodingstandardclassesdisallowstringexpressionpropertyfetch-) 🔧 - [SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces](doc/classes.md#slevomatcodingstandardclassesemptylinesaroundclassbraces-) 🔧 + - [SlevomatCodingStandard.Classes.EnumCaseSpacing](doc/classes.md#slevomatcodingstandardclassesenumcasespacing-) 🔧 - [SlevomatCodingStandard.Classes.ForbiddenPublicProperty](doc/classes.md#slevomatcodingstandardclassesforbiddenpublicproperty) - [SlevomatCodingStandard.Classes.MethodSpacing](doc/classes.md#slevomatcodingstandardclassesmethodspacing-) 🔧 - [SlevomatCodingStandard.Classes.ModernClassNameReference](doc/classes.md#slevomatcodingstandardclassesmodernclassnamereference-) 🔧 @@ -58,6 +63,7 @@ Slevomat Coding Standard for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_ - [SlevomatCodingStandard.Classes.RequireAbstractOrFinal](doc/classes.md#slevomatcodingstandardclassesrequireabstractorfinal-) 🔧 - [SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion](doc/classes.md#slevomatcodingstandardclassesrequireconstructorpropertypromotion-) 🔧 - [SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature](doc/classes.md#slevomatcodingstandardclassesrequiremultilinemethodsignature-) 🔧 + - [SlevomatCodingStandard.Classes.RequireSelfReference](doc/classes.md#slevomatcodingstandardclassesrequireselfreference-) 🔧 - [SlevomatCodingStandard.Classes.RequireSingleLineMethodSignature](doc/classes.md#slevomatcodingstandardclassesrequiresinglelinemethodsignature-) 🔧 - [SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming](doc/classes.md#slevomatcodingstandardclassessuperfluousabstractclassnaming) - [SlevomatCodingStandard.Classes.SuperfluousErrorNaming](doc/classes.md#slevomatcodingstandardclassessuperfluouserrornaming) @@ -67,6 +73,7 @@ Slevomat Coding Standard for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_ - [SlevomatCodingStandard.Classes.TraitUseDeclaration](doc/classes.md#slevomatcodingstandardclassestraitusedeclaration-) 🔧 - [SlevomatCodingStandard.Classes.TraitUseSpacing](doc/classes.md#slevomatcodingstandardclassestraitusespacing-) 🔧 - [SlevomatCodingStandard.Classes.UselessLateStaticBinding](doc/classes.md#slevomatcodingstandardclassesuselesslatestaticbinding-) 🔧 + - [SlevomatCodingStandard.Commenting.AnnotationName](doc/commenting.md#slevomatcodingstandardcommentingannotationname-) - [SlevomatCodingStandard.Commenting.DeprecatedAnnotationDeclaration](doc/commenting.md#slevomatcodingstandardcommentingdeprecatedannotationdeclaration) - [SlevomatCodingStandard.Commenting.DisallowCommentAfterCode](doc/commenting.md#slevomatcodingstandardcommentingdisallowcommentaftercode-) 🔧 - [SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment](doc/commenting.md#slevomatcodingstandardcommentingdisallowonelinepropertydoccomment-) 🔧 @@ -86,6 +93,7 @@ Slevomat Coding Standard for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_ - [SlevomatCodingStandard.ControlStructures.DisallowEmpty](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallowempty) - [SlevomatCodingStandard.ControlStructures.DisallowNullSafeObjectOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallownullsafeobjectoperator) - [SlevomatCodingStandard.ControlStructures.DisallowShortTernaryOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallowshortternaryoperator-) 🔧 + - [SlevomatCodingStandard.ControlStructures.DisallowTrailingMultiLineTernaryOperatorSniff](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallowtrailingmultilineternaryoperator-) 🔧 - [SlevomatCodingStandard.ControlStructures.DisallowYodaComparison](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallowyodacomparison-) 🔧 - [SlevomatCodingStandard.ControlStructures.EarlyExit](doc/control-structures.md#slevomatcodingstandardcontrolstructuresearlyexit-) 🔧 - [SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing](doc/control-structures.md#slevomatcodingstandardcontrolstructuresjumpstatementsspacing-) 🔧 @@ -165,6 +173,7 @@ Slevomat Coding Standard for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_ - [SlevomatCodingStandard.PHP.TypeCast](doc/php.md#slevomatcodingstandardphptypecast-) 🔧 - [SlevomatCodingStandard.PHP.UselessParentheses](doc/php.md#slevomatcodingstandardphpuselessparentheses-) 🔧 - [SlevomatCodingStandard.PHP.UselessSemicolon](doc/php.md#slevomatcodingstandardphpuselesssemicolon-) 🔧 + - [SlevomatCodingStandard.Strings.DisallowVariableParsing](doc/strings.md#slevomatcodingstandardstringsdisallowvariableparsing) - [SlevomatCodingStandard.TypeHints.DeclareStrictTypes](doc/type-hints.md#slevomatcodingstandardtypehintsdeclarestricttypes-) 🔧 - [SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax](doc/type-hints.md#slevomatcodingstandardtypehintsdisallowarraytypehintsyntax-) 🔧 - [SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint](doc/type-hints.md#slevomatcodingstandardtypehintsdisallowmixedtypehint) @@ -178,6 +187,7 @@ Slevomat Coding Standard for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_ - [SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing](doc/type-hints.md#slevomatcodingstandardtypehintsreturntypehintspacing-) 🔧 - [SlevomatCodingStandard.TypeHints.UnionTypeHintFormat](doc/type-hints.md#slevomatcodingstandardtypehintsuniontypehintformat-) 🔧 - [SlevomatCodingStandard.TypeHints.UselessConstantTypeHint](doc/type-hints.md#slevomatcodingstandardtypehintsuselessconstanttypehint-) 🔧 + - [SlevomatCodingStandard.Variables.DisallowVariableVariable](doc/variables.md#slevomatcodingstandardvariablesdisallowvariablevariable) - [SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable](doc/variables.md#slevomatcodingstandardvariablesdisallowsuperglobalvariable) - [SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable](doc/variables.md#slevomatcodingstandardvariablesduplicateassignmenttovariable) - [SlevomatCodingStandard.Variables.UnusedVariable](doc/variables.md#slevomatcodingstandardvariablesunusedvariable) diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation.php new file mode 100644 index 000000000..d5b6343c0 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation.php @@ -0,0 +1,66 @@ +node = $node; + $this->startPointer = $startPointer; + $this->endPointer = $endPointer; + } + + public function getNode(): PhpDocTagNode + { + return $this->node; + } + + public function getName(): string + { + return $this->node->name; + } + + /** + * @return T + */ + public function getValue(): PhpDocTagValueNode + { + /** @phpstan-ignore-next-line */ + return $this->node->value; + } + + public function getStartPointer(): int + { + return $this->startPointer; + } + + public function getEndPointer(): int + { + return $this->endPointer; + } + + public function isInvalid(): bool + { + return $this->node->value instanceof InvalidTagValueNode; + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/Annotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/Annotation.php deleted file mode 100644 index 5c0b831c9..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/Annotation.php +++ /dev/null @@ -1,72 +0,0 @@ -name = $name; - $this->startPointer = $startPointer; - $this->endPointer = $endPointer; - $this->content = $content; - } - - public function getName(): string - { - return $this->name; - } - - public function getStartPointer(): int - { - return $this->startPointer; - } - - public function getEndPointer(): int - { - return $this->endPointer; - } - - public function getContent(): ?string - { - return $this->content; - } - - protected function fixDescription(string $description): string - { - return substr($this->getContent(), -strlen($description)); - } - - protected function errorWhenInvalid(): void - { - if ($this->isInvalid()) { - throw new LogicException(sprintf('Invalid %s annotation.', $this->name)); - } - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/AssertAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/AssertAnnotation.php deleted file mode 100644 index 0fd0ab7db..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/AssertAnnotation.php +++ /dev/null @@ -1,87 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - /** - * @return AssertTagMethodValueNode|AssertTagPropertyValueNode|AssertTagValueNode|null - */ - public function getContentNode() - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - public function getType(): TypeNode - { - $this->errorWhenInvalid(); - - return $this->contentNode->type; - } - - public function export(): string - { - $exported = sprintf('%s %s %s', $this->name, AnnotationTypeHelper::export($this->getType()), $this->contentNode->parameter); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ExtendsAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ExtendsAnnotation.php deleted file mode 100644 index e396c38e5..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ExtendsAnnotation.php +++ /dev/null @@ -1,75 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): ExtendsTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - public function getType(): GenericTypeNode - { - $this->errorWhenInvalid(); - - return $this->contentNode->type; - } - - public function export(): string - { - $exported = sprintf('%s %s', $this->name, AnnotationTypeHelper::export($this->getType())); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/GenericAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/GenericAnnotation.php deleted file mode 100644 index 7c370542b..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/GenericAnnotation.php +++ /dev/null @@ -1,48 +0,0 @@ -parameters = $parameters; - } - - public function getParameters(): ?string - { - return $this->parameters; - } - - public function isInvalid(): bool - { - return false; - } - - public function export(): string - { - $exported = $this->name; - - if ($this->parameters !== null) { - $exported .= sprintf('(%s)', $this->parameters); - } - - if ($this->content !== null) { - $exported .= sprintf(' %s', $this->content); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ImplementsAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ImplementsAnnotation.php deleted file mode 100644 index b568e28e1..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ImplementsAnnotation.php +++ /dev/null @@ -1,75 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): ImplementsTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - public function getType(): GenericTypeNode - { - $this->errorWhenInvalid(); - - return $this->contentNode->type; - } - - public function export(): string - { - $exported = sprintf('%s %s', $this->name, AnnotationTypeHelper::export($this->getType())); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/MethodAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/MethodAnnotation.php deleted file mode 100644 index bae5ac462..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/MethodAnnotation.php +++ /dev/null @@ -1,142 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): MethodTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - public function getMethodName(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->methodName !== '' ? $this->contentNode->methodName : null; - } - - /** - * @return GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|IdentifierTypeNode|ThisTypeNode - */ - public function getMethodReturnType(): ?TypeNode - { - $this->errorWhenInvalid(); - - /** @var GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|IdentifierTypeNode|ThisTypeNode $type */ - $type = $this->contentNode->returnType; - return $type; - } - - /** - * @return TemplateTagValueNode[] - */ - public function getMethodTemplateTypes(): array - { - $this->errorWhenInvalid(); - - return $this->contentNode->templateTypes; - } - - /** - * @return MethodTagValueParameterNode[] - */ - public function getMethodParameters(): array - { - $this->errorWhenInvalid(); - - return $this->contentNode->parameters; - } - - public function export(): string - { - $static = $this->contentNode->isStatic ? 'static ' : ''; - $returnType = $this->getMethodReturnType() !== null - ? sprintf('%s ', AnnotationTypeHelper::export($this->getMethodReturnType())) - : ''; - - $templateTypes = $this->contentNode->templateTypes !== [] ? '<' . implode(', ', $this->contentNode->templateTypes) . '>' : ''; - - $parameters = []; - foreach ($this->getMethodParameters() as $parameter) { - $type = $parameter->type !== null ? AnnotationTypeHelper::export($parameter->type) . ' ' : ''; - $isReference = $parameter->isReference ? '&' : ''; - $isVariadic = $parameter->isVariadic ? '...' : ''; - $default = $parameter->defaultValue !== null ? sprintf(' = %s', $parameter->defaultValue) : ''; - - $parameters[] = sprintf('%s%s%s%s%s', $type, $isReference, $isVariadic, $parameter->parameterName, $default); - } - - $exported = sprintf( - '%s %s%s%s%s(%s)', - $this->name, - $static, - $returnType, - $this->getMethodName(), - $templateTypes, - implode(', ', $parameters) - ); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/MixinAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/MixinAnnotation.php deleted file mode 100644 index 7f72c3dfd..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/MixinAnnotation.php +++ /dev/null @@ -1,81 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): MixinTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - /** - * @return GenericTypeNode|IdentifierTypeNode - */ - public function getType(): TypeNode - { - $this->errorWhenInvalid(); - - /** @var GenericTypeNode|IdentifierTypeNode $type */ - $type = $this->contentNode->type; - return $type; - } - - public function export(): string - { - $exported = sprintf('%s %s', $this->name, AnnotationTypeHelper::export($this->getType())); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterAnnotation.php deleted file mode 100644 index 422493c80..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterAnnotation.php +++ /dev/null @@ -1,114 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - /** - * @return ParamTagValueNode|TypelessParamTagValueNode|null - */ - public function getContentNode() - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - public function getParameterName(): string - { - $this->errorWhenInvalid(); - - return $this->contentNode->parameterName; - } - - /** - * @return GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode|null - */ - public function getType(): ?TypeNode - { - $this->errorWhenInvalid(); - - if ($this->contentNode instanceof TypelessParamTagValueNode) { - return null; - } - - /** @var GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode $type */ - $type = $this->contentNode->type; - return $type; - } - - public function export(): string - { - $exported = sprintf( - '%s %s %s%s', - $this->name, - AnnotationTypeHelper::export($this->getType()), - $this->contentNode->isVariadic ? '...' : '', - $this->getParameterName() - ); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterOutAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterOutAnnotation.php deleted file mode 100644 index 8343be6f6..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ParameterOutAnnotation.php +++ /dev/null @@ -1,102 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): ?ParamOutTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - public function getParameterName(): string - { - $this->errorWhenInvalid(); - - return $this->contentNode->parameterName; - } - - /** - * @return GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode - */ - public function getType(): TypeNode - { - $this->errorWhenInvalid(); - - /** @var GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode $type */ - $type = $this->contentNode->type; - return $type; - } - - public function export(): string - { - $exported = sprintf( - '%s %s %s', - $this->name, - AnnotationTypeHelper::export($this->getType()), - $this->getParameterName() - ); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/PropertyAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/PropertyAnnotation.php deleted file mode 100644 index 144838f2d..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/PropertyAnnotation.php +++ /dev/null @@ -1,99 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): PropertyTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - public function getPropertyName(): string - { - $this->errorWhenInvalid(); - - return $this->contentNode->propertyName; - } - - /** - * @return GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode - */ - public function getType(): TypeNode - { - $this->errorWhenInvalid(); - - /** @var GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode $type */ - $type = $this->contentNode->type; - return $type; - } - - public function export(): string - { - $exported = sprintf('%s %s %s', $this->name, AnnotationTypeHelper::export($this->getType()), $this->getPropertyName()); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ReturnAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ReturnAnnotation.php deleted file mode 100644 index 4f0f55cd0..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ReturnAnnotation.php +++ /dev/null @@ -1,92 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): ReturnTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - /** - * @return GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode|ConditionalTypeNode|ConditionalTypeForParameterNode - */ - public function getType(): TypeNode - { - $this->errorWhenInvalid(); - - /** @var GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode|ConditionalTypeForParameterNode $type */ - $type = $this->contentNode->type; - return $type; - } - - public function export(): string - { - $exported = sprintf('%s %s', $this->name, AnnotationTypeHelper::export($this->getType())); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/SelfOutAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/SelfOutAnnotation.php deleted file mode 100644 index e1a080473..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/SelfOutAnnotation.php +++ /dev/null @@ -1,94 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): ?SelfOutTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - /** - * @return GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode - */ - public function getType(): TypeNode - { - $this->errorWhenInvalid(); - - /** @var GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode $type */ - $type = $this->contentNode->type; - return $type; - } - - public function export(): string - { - $exported = sprintf( - '%s %s', - $this->name, - AnnotationTypeHelper::export($this->getType()) - ); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TemplateAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TemplateAnnotation.php deleted file mode 100644 index fd880c3c0..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TemplateAnnotation.php +++ /dev/null @@ -1,101 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): TemplateTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - public function getTemplateName(): string - { - $this->errorWhenInvalid(); - - return $this->contentNode->name; - } - - public function getBound(): ?TypeNode - { - $this->errorWhenInvalid(); - - return $this->contentNode->bound; - } - - public function getDefault(): ?TypeNode - { - $this->errorWhenInvalid(); - - return $this->contentNode->default; - } - - public function export(): string - { - $exported = sprintf('%s %s', $this->name, $this->contentNode->name); - - if ($this->contentNode->bound !== null) { - $exported .= sprintf(' of %s', AnnotationTypeHelper::export($this->contentNode->bound)); - } - - if ($this->contentNode->default !== null) { - $exported .= sprintf(' = %s', AnnotationTypeHelper::export($this->contentNode->default)); - } - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ThrowsAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ThrowsAnnotation.php deleted file mode 100644 index 5a4f962ee..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/ThrowsAnnotation.php +++ /dev/null @@ -1,82 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): ThrowsTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - /** - * @return UnionTypeNode|IdentifierTypeNode - */ - public function getType(): TypeNode - { - $this->errorWhenInvalid(); - - /** @var UnionTypeNode|IdentifierTypeNode $type */ - $type = $this->contentNode->type; - return $type; - } - - public function export(): string - { - $exported = sprintf('%s %s', $this->name, AnnotationTypeHelper::export($this->getType())); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TypeAliasAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TypeAliasAnnotation.php deleted file mode 100644 index 65e98bfd3..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TypeAliasAnnotation.php +++ /dev/null @@ -1,67 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): TypeAliasTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function getAlias(): string - { - $this->errorWhenInvalid(); - - return $this->contentNode->alias; - } - - public function getType(): TypeNode - { - $this->errorWhenInvalid(); - - return $this->contentNode->type; - } - - public function export(): string - { - return sprintf('%s %s %s', $this->name, $this->contentNode->alias, AnnotationTypeHelper::export($this->contentNode->type)); - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TypeImportAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TypeImportAnnotation.php deleted file mode 100644 index afc3670d2..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TypeImportAnnotation.php +++ /dev/null @@ -1,100 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): TypeAliasImportTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function getAlias(): string - { - return $this->getImportedAs() ?? $this->getImportedAlias(); - } - - public function getImportedAlias(): string - { - $this->errorWhenInvalid(); - - return $this->contentNode->importedAlias; - } - - /** - * @return IdentifierTypeNode - */ - public function getImportedFrom(): TypeNode - { - $this->errorWhenInvalid(); - - return $this->contentNode->importedFrom; - } - - public function getImportedAs(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->importedAs; - } - - public function export(): string - { - $exported = sprintf( - '%s %s from %s', - $this->name, - $this->contentNode->importedAlias, - AnnotationTypeHelper::export($this->contentNode->importedFrom) - ); - - if ($this->contentNode->importedAs !== null) { - $exported .= sprintf(' as %s', $this->contentNode->importedAs); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/UseAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/UseAnnotation.php deleted file mode 100644 index 69f987bd8..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/UseAnnotation.php +++ /dev/null @@ -1,75 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): UsesTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - public function getType(): GenericTypeNode - { - $this->errorWhenInvalid(); - - return $this->contentNode->type; - } - - public function export(): string - { - $exported = sprintf('%s %s', $this->name, AnnotationTypeHelper::export($this->getType())); - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/VariableAnnotation.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/VariableAnnotation.php deleted file mode 100644 index 39e52d325..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/VariableAnnotation.php +++ /dev/null @@ -1,102 +0,0 @@ -contentNode = $contentNode; - } - - public function isInvalid(): bool - { - return $this->contentNode === null; - } - - public function getContentNode(): VarTagValueNode - { - $this->errorWhenInvalid(); - - return $this->contentNode; - } - - public function hasDescription(): bool - { - return $this->getDescription() !== null; - } - - public function getDescription(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->description !== '' ? $this->contentNode->description : null; - } - - public function getVariableName(): ?string - { - $this->errorWhenInvalid(); - - return $this->contentNode->variableName !== '' ? $this->contentNode->variableName : null; - } - - /** - * @return GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode - */ - public function getType(): TypeNode - { - $this->errorWhenInvalid(); - - /** @var GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode $type */ - $type = $this->contentNode->type; - return $type; - } - - public function export(): string - { - $exported = sprintf('%s %s', $this->name, AnnotationTypeHelper::export($this->getType())); - - $variableName = $this->getVariableName(); - if ($variableName !== null) { - $exported .= sprintf(' %s', $variableName); - } - - $description = $this->getDescription(); - if ($description !== null) { - $exported .= sprintf(' %s', $this->fixDescription($description)); - } - - return $exported; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationConstantExpressionHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationConstantExpressionHelper.php deleted file mode 100644 index 00acfd399..000000000 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationConstantExpressionHelper.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ - public static function getConstantFetchNodes(ConstExprNode $contantExpressionNode): array - { - if ($contantExpressionNode instanceof ConstExprArrayNode) { - $constantFetchNodes = []; - foreach ($contantExpressionNode->items as $itemConstantExpressionNode) { - $constantFetchNodes = array_merge($constantFetchNodes, self::getConstantFetchNodes($itemConstantExpressionNode)); - } - return $constantFetchNodes; - } - - if ($contantExpressionNode instanceof ConstExprArrayItemNode) { - $constantFetchNodes = self::getConstantFetchNodes($contantExpressionNode->value); - if ($contantExpressionNode->key !== null) { - $constantFetchNodes = array_merge($constantFetchNodes, self::getConstantFetchNodes($contantExpressionNode->key)); - } - return $constantFetchNodes; - } - - if ($contantExpressionNode instanceof ConstFetchNode) { - return [$contantExpressionNode]; - } - - return []; - } - - public static function change(ConstExprNode $masterNode, ConstExprNode $nodeToChange, ConstExprNode $changedNode): ConstExprNode - { - if ($masterNode === $nodeToChange) { - return $changedNode; - } - - if ($masterNode instanceof ConstExprArrayNode) { - $items = []; - foreach ($masterNode->items as $itemNode) { - /** @var ConstExprArrayItemNode $changedItemNode */ - $changedItemNode = self::change($itemNode, $nodeToChange, $changedNode); - - $items[] = $changedItemNode; - } - - return new ConstExprArrayNode($items); - } - - if ($masterNode instanceof ConstExprArrayItemNode) { - $key = $masterNode->key !== null ? self::change($masterNode->key, $nodeToChange, $changedNode) : null; - $value = self::change($masterNode->value, $nodeToChange, $changedNode); - - return new ConstExprArrayItemNode($key, $value); - } - - return clone $masterNode; - } - -} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php index 6f5aa982a..f6081af13 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php @@ -3,12 +3,18 @@ namespace SlevomatCodingStandard\Helpers; use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; -use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprNode; -use PHPStan\PhpDocParser\Ast\ConstExpr\ConstFetchNode; -use PHPStan\PhpDocParser\Ast\PhpDoc\InvalidTagValueNode; -use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode; -use PHPStan\PhpDocParser\Ast\PhpDoc\TemplateTagValueNode; +use PHPStan\PhpDocParser\Ast\AbstractNodeVisitor; +use PHPStan\PhpDocParser\Ast\Attribute; +use PHPStan\PhpDocParser\Ast\Node; +use PHPStan\PhpDocParser\Ast\NodeTraverser; +use PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine\DoctrineArgument; +use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode; +use PHPStan\PhpDocParser\Ast\Type\ArrayShapeItemNode; use PHPStan\PhpDocParser\Ast\Type\CallableTypeNode; use PHPStan\PhpDocParser\Ast\Type\ConditionalTypeForParameterNode; use PHPStan\PhpDocParser\Ast\Type\ConditionalTypeNode; @@ -16,48 +22,12 @@ use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\IntersectionTypeNode; -use PHPStan\PhpDocParser\Ast\Type\ThisTypeNode; -use PHPStan\PhpDocParser\Ast\Type\TypeNode; +use PHPStan\PhpDocParser\Ast\Type\ObjectShapeItemNode; +use PHPStan\PhpDocParser\Ast\Type\ObjectShapeNode; use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode; -use PHPStan\PhpDocParser\Lexer\Lexer; -use PHPStan\PhpDocParser\Parser\ConstExprParser; -use PHPStan\PhpDocParser\Parser\PhpDocParser; -use PHPStan\PhpDocParser\Parser\TokenIterator; -use PHPStan\PhpDocParser\Parser\TypeParser; -use SlevomatCodingStandard\Helpers\Annotation\Annotation; -use SlevomatCodingStandard\Helpers\Annotation\AssertAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ExtendsAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\GenericAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ImplementsAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\MethodAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\MixinAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ParameterAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ParameterOutAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\PropertyAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ReturnAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\SelfOutAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\TemplateAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ThrowsAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\TypeAliasAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\TypeImportAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\UseAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\VariableAnnotation; -use function array_key_exists; -use function array_merge; -use function get_class; use function in_array; -use function max; -use function preg_match; -use function preg_match_all; -use function preg_replace; use function sprintf; use function strtolower; -use function trim; -use const T_DOC_COMMENT_CLOSE_TAG; -use const T_DOC_COMMENT_STAR; -use const T_DOC_COMMENT_STRING; -use const T_DOC_COMMENT_TAG; -use const T_DOC_COMMENT_WHITESPACE; /** * @internal @@ -65,338 +35,155 @@ class AnnotationHelper { - public const PREFIXES = ['psalm', 'phpstan']; - - private const MAPPING = [ - '@param' => ParameterAnnotation::class, - '@psalm-param' => ParameterAnnotation::class, - '@phpstan-param' => ParameterAnnotation::class, - '@return' => ReturnAnnotation::class, - '@psalm-return' => ReturnAnnotation::class, - '@phpstan-return' => ReturnAnnotation::class, - '@var' => VariableAnnotation::class, - '@psalm-var' => VariableAnnotation::class, - '@phpstan-var' => VariableAnnotation::class, - '@throws' => ThrowsAnnotation::class, - '@phpstan-throws' => ThrowsAnnotation::class, - '@property' => PropertyAnnotation::class, - '@psalm-property' => PropertyAnnotation::class, - '@phpstan-property' => PropertyAnnotation::class, - '@property-read' => PropertyAnnotation::class, - '@psalm-property-read' => PropertyAnnotation::class, - '@phpstan-property-read' => PropertyAnnotation::class, - '@property-write' => PropertyAnnotation::class, - '@psalm-property-write' => PropertyAnnotation::class, - '@phpstan-property-write' => PropertyAnnotation::class, - '@method' => MethodAnnotation::class, - '@psalm-method' => MethodAnnotation::class, - '@phpstan-method' => MethodAnnotation::class, - '@template' => TemplateAnnotation::class, - '@psalm-template' => TemplateAnnotation::class, - '@phpstan-template' => TemplateAnnotation::class, - '@template-covariant' => TemplateAnnotation::class, - '@psalm-template-covariant' => TemplateAnnotation::class, - '@phpstan-template-covariant' => TemplateAnnotation::class, - '@extends' => ExtendsAnnotation::class, - '@template-extends' => ExtendsAnnotation::class, - '@phpstan-extends' => ExtendsAnnotation::class, - '@implements' => ImplementsAnnotation::class, - '@template-implements' => ImplementsAnnotation::class, - '@phpstan-implements' => ImplementsAnnotation::class, - '@use' => UseAnnotation::class, - '@template-use' => UseAnnotation::class, - '@phpstan-use' => UseAnnotation::class, - '@psalm-type' => TypeAliasAnnotation::class, - '@phpstan-type' => TypeAliasAnnotation::class, - '@psalm-import-type' => TypeImportAnnotation::class, - '@phpstan-import-type' => TypeImportAnnotation::class, - '@mixin' => MixinAnnotation::class, - '@phpstan-assert' => AssertAnnotation::class, - '@phpstan-assert-if-true' => AssertAnnotation::class, - '@phpstan-assert-if-false' => AssertAnnotation::class, - '@psalm-assert' => AssertAnnotation::class, - '@psalm-assert-if-true' => AssertAnnotation::class, - '@psalm-assert-if-false' => AssertAnnotation::class, - '@param-out' => ParameterOutAnnotation::class, - '@psalm-param-out' => ParameterOutAnnotation::class, - '@phpstan-param-out' => ParameterOutAnnotation::class, - '@psalm-self-out' => SelfOutAnnotation::class, - '@phpstan-self-out' => SelfOutAnnotation::class, - '@psalm-this-out' => SelfOutAnnotation::class, - '@phpstan-this-out' => SelfOutAnnotation::class, - ]; + public const STATIC_ANALYSIS_PREFIXES = ['psalm', 'phpstan']; /** - * @internal - * @param VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation|TypeAliasAnnotation|TypeImportAnnotation|AssertAnnotation|ParameterOutAnnotation|SelfOutAnnotation $annotation - * @return TypeNode[] + * @return list */ - public static function getAnnotationTypes(Annotation $annotation): array + public static function getAnnotations(File $phpcsFile, int $pointer, ?string $name = null): array { - $annotationTypes = []; - - if ($annotation instanceof MethodAnnotation) { - if ($annotation->getMethodReturnType() !== null) { - $annotationTypes[] = $annotation->getMethodReturnType(); - } - foreach ($annotation->getMethodTemplateTypes() as $methodTemplateType) { - if ($methodTemplateType->bound !== null) { - $annotationTypes[] = $methodTemplateType->bound; - } - if ($methodTemplateType->default !== null) { - $annotationTypes[] = $methodTemplateType->default; - } - } - foreach ($annotation->getMethodParameters() as $methodParameterAnnotation) { - if ($methodParameterAnnotation->type === null) { - continue; - } - - $annotationTypes[] = $methodParameterAnnotation->type; - } - } elseif ($annotation instanceof TemplateAnnotation) { - if ($annotation->getBound() !== null) { - $annotationTypes[] = $annotation->getBound(); - } - if ($annotation->getDefault() !== null) { - $annotationTypes[] = $annotation->getDefault(); - } - } elseif ($annotation instanceof TypeImportAnnotation) { - $annotationTypes[] = $annotation->getImportedFrom(); - } elseif ($annotation->getType() !== null) { - $annotationTypes[] = $annotation->getType(); + $docCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $pointer); + if ($docCommentOpenPointer === null) { + return []; } - return $annotationTypes; - } - - /** - * @internal - * @param VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation|AssertAnnotation|ParameterOutAnnotation|SelfOutAnnotation $annotation - * @return ConstExprNode[] - */ - public static function getAnnotationConstantExpressions(Annotation $annotation): array - { - $constantExpressions = []; + return SniffLocalCache::getAndSetIfNotCached( + $phpcsFile, + sprintf('annotations-%d-%s', $docCommentOpenPointer, $name ?? 'all'), + static function () use ($phpcsFile, $docCommentOpenPointer, $name): array { + $annotations = []; - if ($annotation instanceof MethodAnnotation) { - foreach ($annotation->getMethodParameters() as $methodParameterAnnotation) { - if ($methodParameterAnnotation->defaultValue === null) { - continue; + if ($name !== null) { + foreach (self::getAnnotations($phpcsFile, $docCommentOpenPointer) as $annotation) { + if ($annotation->getName() === $name) { + $annotations[] = $annotation; + } + } + } else { + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + if ($parsedDocComment !== null) { + foreach ($parsedDocComment->getNode()->getTags() as $node) { + $annotationStartPointer = $parsedDocComment->getNodeStartPointer($phpcsFile, $node); + $annotations[] = new Annotation( + $node, + $annotationStartPointer, + $parsedDocComment->getNodeEndPointer($phpcsFile, $node, $annotationStartPointer) + ); + } + } } - $constantExpressions[] = $methodParameterAnnotation->defaultValue; - } - } - - foreach (self::getAnnotationTypes($annotation) as $annotationType) { - foreach (AnnotationTypeHelper::getConstantTypeNodes($annotationType) as $constTypeNode) { - $constantExpressions[] = $constTypeNode->constExpr; + return $annotations; } - } - - return $constantExpressions; - } - - /** - * @internal - * @param VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation|AssertAnnotation|ParameterOutAnnotation|SelfOutAnnotation $annotation - */ - public static function fixAnnotationType(File $phpcsFile, Annotation $annotation, TypeNode $typeNode, TypeNode $fixedTypeNode): string - { - $fixedAnnotation = self::fixAnnotation($annotation, $typeNode, $fixedTypeNode); - - return self::fix($phpcsFile, $annotation, $fixedAnnotation); + ); } /** - * @internal - * @param VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation|AssertAnnotation|ParameterOutAnnotation|SelfOutAnnotation $annotation + * @param class-string $type + * @return list */ - public static function fixAnnotationConstantFetchNode( - File $phpcsFile, - Annotation $annotation, - ConstFetchNode $node, - ConstFetchNode $fixedNode - ): string + public static function getAnnotationNodesByType(Node $node, string $type): array { - if ($annotation instanceof MethodAnnotation) { - $fixedContentNode = clone $annotation->getContentNode(); - - foreach ($fixedContentNode->parameters as $parameterNo => $parameterNode) { - if ($parameterNode->defaultValue === null) { - continue; - } - - $fixedContentNode->parameters[$parameterNo] = clone $parameterNode; - $fixedContentNode->parameters[$parameterNo]->defaultValue = AnnotationConstantExpressionHelper::change( - $parameterNode->defaultValue, - $node, - $fixedNode - ); - } - - $fixedAnnotation = new MethodAnnotation( - $annotation->getName(), - $annotation->getStartPointer(), - $annotation->getEndPointer(), - $annotation->getContent(), - $fixedContentNode - ); - } else { - $fixedAnnotation = $annotation; - - foreach (self::getAnnotationTypes($annotation) as $annotationType) { - foreach (AnnotationTypeHelper::getConstantTypeNodes($annotationType) as $constTypeNode) { - foreach (AnnotationConstantExpressionHelper::getConstantFetchNodes($constTypeNode->constExpr) as $constFetchNode) { - if ($constFetchNode !== $node) { - continue; + static $visitor; + static $traverser; + + if ($visitor === null) { + $visitor = new class extends AbstractNodeVisitor { + + /** @var class-string */ + private $type; + + /** @var list */ + private $nodes = []; + + /** @var list */ + private $nodesToIgnore = []; + + /** + * @return Node|list|NodeTraverser::*|null + */ + public function enterNode(Node $node) + { + if ($this->type === IdentifierTypeNode::class) { + if ($node instanceof ArrayShapeItemNode || $node instanceof ObjectShapeItemNode) { + $this->nodesToIgnore[] = $node->keyName; + } elseif ($node instanceof DoctrineArgument) { + $this->nodesToIgnore[] = $node->key; } - - $fixedConstTypeNode = new ConstTypeNode( - AnnotationConstantExpressionHelper::change($constTypeNode->constExpr, $node, $fixedNode) - ); - $fixedAnnotation = self::fixAnnotation($annotation, $constTypeNode, $fixedConstTypeNode); - break 3; } - } - } - } - - return self::fix($phpcsFile, $annotation, $fixedAnnotation); - } - - /** - * @return (VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation|AssertAnnotation|GenericAnnotation|ParameterOutAnnotation|SelfOutAnnotation)[] - */ - public static function getAnnotationsByName(File $phpcsFile, int $pointer, string $annotationName): array - { - $annotations = self::getAnnotations($phpcsFile, $pointer); - - return $annotations[$annotationName] ?? []; - } - - /** - * @return (VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation|AssertAnnotation|GenericAnnotation|ParameterOutAnnotation|SelfOutAnnotation)[][] - */ - public static function getAnnotations(File $phpcsFile, int $pointer): array - { - return SniffLocalCache::getAndSetIfNotCached( - $phpcsFile, - sprintf('annotations-%d', $pointer), - static function () use ($phpcsFile, $pointer): array { - $annotations = []; - - $docCommentOpenToken = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $pointer); - if ($docCommentOpenToken === null) { - return $annotations; - } - $annotationNameCodes = array_merge([T_DOC_COMMENT_TAG], Tokens::$phpcsCommentTokens); - - $tokens = $phpcsFile->getTokens(); - $i = $docCommentOpenToken + 1; - while ($i < $tokens[$docCommentOpenToken]['comment_closer']) { - if (!in_array($tokens[$i]['code'], $annotationNameCodes, true)) { - $i++; - continue; + if ($node instanceof $this->type && !in_array($node, $this->nodesToIgnore, true)) { + $this->nodes[] = $node; } - $annotationStartPointer = $i; - $annotationEndPointer = $i; - - // Fix for wrong PHPCS parsing - $parenthesesLevel = max((int) preg_match_all('~[({]~', $tokens[$i]['content']) - (int) preg_match_all( - '~[)}]~', - $tokens[$i]['content'] - ), 0); + return null; + } - $annotationCode = $tokens[$i]['content']; + /** + * @param class-string $type + */ + public function setType(string $type): void + { + $this->type = $type; + } - for ($j = $i + 1; $j <= $tokens[$docCommentOpenToken]['comment_closer']; $j++) { - if ($tokens[$j]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - $i = $j; - break; - } + public function clean(): void + { + $this->nodes = []; + $this->nodesToIgnore = []; + } - if (in_array($tokens[$j]['code'], $annotationNameCodes, true) && $parenthesesLevel === 0) { - $i = $j; - break; - } + /** + * @return list + */ + public function getNodes(): array + { + return $this->nodes; + } - if ($tokens[$j]['code'] === T_DOC_COMMENT_STAR) { - continue; - } + }; + } - if (in_array($tokens[$j]['code'], array_merge([T_DOC_COMMENT_STRING], $annotationNameCodes), true)) { - $annotationEndPointer = $j; - } elseif ($tokens[$j]['code'] === T_DOC_COMMENT_WHITESPACE) { - if (array_key_exists($j - 1, $tokens) && $tokens[$j - 1]['code'] === T_DOC_COMMENT_STAR) { - continue; - } - if (array_key_exists($j + 1, $tokens) && $tokens[$j + 1]['code'] === T_DOC_COMMENT_STAR) { - continue; - } - } + if ($traverser === null) { + $traverser = new NodeTraverser([$visitor]); + } - $parenthesesLevel += (int) preg_match_all('~[({]~', $tokens[$j]['content']) - (int) preg_match_all( - '~[)}]~', - $tokens[$j]['content'] - ); - if ($parenthesesLevel < 0) { - $parenthesesLevel = 0; - } + $visitor->setType($type); + $visitor->clean(); - $annotationCode .= $tokens[$j]['content']; - } + $traverser->traverse([$node]); - $annotationName = $tokens[$annotationStartPointer]['content']; - $annotationParameters = null; - $annotationContent = null; - if (preg_match('~^(@[-a-zA-Z\\\\:]+)(?:\((.*)\))?(?:\\s+(.+))?(,|$)~s', trim($annotationCode), $matches) !== 0) { - $annotationName = $matches[1]; - $annotationParameters = trim($matches[2]); - if ($annotationParameters === '') { - $annotationParameters = null; - } - $annotationContent = trim($matches[3]); - if ($annotationContent === '') { - $annotationContent = null; - } - } - - if (array_key_exists($annotationName, self::MAPPING)) { - $className = self::MAPPING[$annotationName]; - - $parsedContent = null; - if ($annotationContent !== null) { - $parsedContent = self::parseAnnotationContent($annotationName, $annotationContent); - if ($parsedContent instanceof InvalidTagValueNode) { - $parsedContent = null; - } - } + return $visitor->getNodes(); + } - $annotation = new $className($annotationName, $annotationStartPointer, $annotationEndPointer, $annotationContent, $parsedContent); - } else { - $annotation = new GenericAnnotation( - $annotationName, - $annotationStartPointer, - $annotationEndPointer, - $annotationParameters, - $annotationContent - ); - } + public static function fixAnnotation( + ParsedDocComment $parsedDocComment, + Annotation $annotation, + Node $nodeToFix, + Node $fixedNode + ): string + { + $originalNode = $annotation->getNode(); - $annotations[$annotationName][] = $annotation; - } + /** @var PhpDocNode $newPhpDocNode */ + $newPhpDocNode = PhpDocParserHelper::cloneNode($parsedDocComment->getNode()); - return $annotations; + foreach ($newPhpDocNode->getTags() as $node) { + if ($node->getAttribute(Attribute::ORIGINAL_NODE) === $originalNode) { + self::changeAnnotationNode($node, $nodeToFix, $fixedNode); + break; } + } + + return PhpDocParserHelper::getPrinter()->printFormatPreserving( + $newPhpDocNode, + $parsedDocComment->getNode(), + $parsedDocComment->getTokens() ); } /** - * @param ReturnAnnotation|ParameterAnnotation|VariableAnnotation $annotation * @param array $traversableTypeHints */ public static function isAnnotationUseless( @@ -414,15 +201,18 @@ public static function isAnnotationUseless( return false; } - if ($typeHint === null || $annotation->getContent() === null) { + if ($typeHint === null) { return false; } - if ($annotation->hasDescription()) { + /** @var ParamTagValueNode|TypelessParamTagValueNode|ReturnTagValueNode|VarTagValueNode $annotationValue */ + $annotationValue = $annotation->getValue(); + + if ($annotationValue->description !== '') { return false; } - if ($annotation->getType() === null) { + if ($annotationValue instanceof TypelessParamTagValueNode) { return true; } @@ -433,28 +223,30 @@ public static function isAnnotationUseless( return false; } - if (AnnotationTypeHelper::containsStaticOrThisType($annotation->getType())) { + $annotationType = $annotationValue->type; + + if (AnnotationTypeHelper::containsStaticOrThisType($annotationType)) { return false; } if ( - AnnotationTypeHelper::containsJustTwoTypes($annotation->getType()) + AnnotationTypeHelper::containsJustTwoTypes($annotationType) || ( $enableUnionTypeHint && ( - $annotation->getType() instanceof UnionTypeNode + $annotationType instanceof UnionTypeNode || ( - $annotation->getType() instanceof IdentifierTypeNode - && TypeHintHelper::isUnofficialUnionTypeHint($annotation->getType()->name) + $annotationType instanceof IdentifierTypeNode + && TypeHintHelper::isUnofficialUnionTypeHint($annotationType->name) ) ) ) || ( $enableIntersectionTypeHint - && $annotation->getType() instanceof IntersectionTypeNode + && $annotationType instanceof IntersectionTypeNode ) ) { - $annotationTypeHint = AnnotationTypeHelper::export($annotation->getType()); + $annotationTypeHint = AnnotationTypeHelper::print($annotationType); return TypeHintHelper::typeHintEqualsAnnotation( $phpcsFile, $functionPointer, @@ -463,32 +255,33 @@ public static function isAnnotationUseless( ); } - if ($annotation->getType() instanceof ConstTypeNode) { + if ($annotationType instanceof ObjectShapeNode) { return false; } - if ($annotation->getType() instanceof GenericTypeNode) { + if ($annotationType instanceof ConstTypeNode) { return false; } - if ($annotation->getType() instanceof CallableTypeNode) { + if ($annotationType instanceof GenericTypeNode) { return false; } - if ($annotation->getType() instanceof ConditionalTypeNode) { + if ($annotationType instanceof CallableTypeNode) { return false; } - if ($annotation->getType() instanceof ConditionalTypeForParameterNode) { + if ($annotationType instanceof ConditionalTypeNode) { return false; } - /** @var GenericTypeNode|IdentifierTypeNode|ThisTypeNode $annotationTypeNode */ - $annotationTypeNode = $annotation->getType(); + if ($annotationType instanceof ConditionalTypeForParameterNode) { + return false; + } - if ($annotationTypeNode instanceof IdentifierTypeNode) { + if ($annotationType instanceof IdentifierTypeNode) { if (in_array( - strtolower($annotationTypeNode->name), + strtolower($annotationType->name), ['true', 'false', 'null'], true )) { @@ -496,15 +289,15 @@ public static function isAnnotationUseless( } if (in_array( - strtolower($annotationTypeNode->name), - ['class-string', 'trait-string', 'callable-string', 'numeric-string', 'non-empty-string', 'literal-string', 'positive-int', 'negative-int'], + strtolower($annotationType->name), + ['class-string', 'trait-string', 'callable-string', 'numeric-string', 'non-empty-string', 'non-falsy-string', 'literal-string', 'positive-int', 'negative-int'], true )) { return false; } } - $annotationTypeHint = AnnotationTypeHelper::getTypeHintFromOneType($annotationTypeNode); + $annotationTypeHint = AnnotationTypeHelper::getTypeHintFromOneType($annotationType); return TypeHintHelper::typeHintEqualsAnnotation( $phpcsFile, $functionPointer, @@ -513,131 +306,55 @@ public static function isAnnotationUseless( ); } - /** - * @param VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation|TypeAliasAnnotation|TypeImportAnnotation|AssertAnnotation|ParameterOutAnnotation|SelfOutAnnotation $annotation - */ - private static function fixAnnotation(Annotation $annotation, TypeNode $typeNode, TypeNode $fixedTypeNode): Annotation + private static function changeAnnotationNode(PhpDocTagNode $tagNode, Node $nodeToChange, Node $changedNode): PhpDocTagNode { - if ($annotation instanceof MethodAnnotation) { - $fixedContentNode = clone $annotation->getContentNode(); + static $visitor; + static $traverser; - if ($fixedContentNode->returnType !== null) { - $fixedContentNode->returnType = AnnotationTypeHelper::change($fixedContentNode->returnType, $typeNode, $fixedTypeNode); - } - foreach ($fixedContentNode->templateTypes as $templateTypeNo => $templateTypeNode) { - $fixedContentNode->templateTypes[$templateTypeNo] = self::fixTemplateTagValueNode( - $templateTypeNode, - $typeNode, - $fixedTypeNode - ); - } - foreach ($fixedContentNode->parameters as $parameterNo => $parameterNode) { - if ($parameterNode->type === null) { - continue; - } + if ($visitor === null) { + $visitor = new class extends AbstractNodeVisitor { - $fixedContentNode->parameters[$parameterNo] = clone $parameterNode; - $fixedContentNode->parameters[$parameterNo]->type = AnnotationTypeHelper::change( - $parameterNode->type, - $typeNode, - $fixedTypeNode - ); - } - } elseif ($annotation instanceof TemplateAnnotation) { - $fixedContentNode = self::fixTemplateTagValueNode($annotation->getContentNode(), $typeNode, $fixedTypeNode); - } elseif ($annotation instanceof TypeImportAnnotation) { - $fixedContentNode = clone $annotation->getContentNode(); - /** @var IdentifierTypeNode $fixedType */ - $fixedType = AnnotationTypeHelper::change($annotation->getImportedFrom(), $typeNode, $fixedTypeNode); - $fixedContentNode->importedFrom = $fixedType; - } elseif ( - $annotation instanceof ExtendsAnnotation - || $annotation instanceof ImplementsAnnotation - || $annotation instanceof UseAnnotation - ) { - $fixedContentNode = clone $annotation->getContentNode(); - /** @var GenericTypeNode $fixedType */ - $fixedType = AnnotationTypeHelper::change($annotation->getType(), $typeNode, $fixedTypeNode); - $fixedContentNode->type = $fixedType; - } else { - $fixedContentNode = clone $annotation->getContentNode(); - $fixedContentNode->type = AnnotationTypeHelper::change($annotation->getType(), $typeNode, $fixedTypeNode); - } + /** @var Node */ + private $nodeToChange; - $annotationClassName = get_class($annotation); + /** @var Node */ + private $changedNode; - return new $annotationClassName( - $annotation->getName(), - $annotation->getStartPointer(), - $annotation->getEndPointer(), - $annotation->getContent(), - $fixedContentNode - ); - } + /** + * @return Node|list|NodeTraverser::*|null + */ + public function enterNode(Node $node) + { + if ($node->getAttribute(Attribute::ORIGINAL_NODE) === $this->nodeToChange) { + return $this->changedNode; + } - private static function fixTemplateTagValueNode( - TemplateTagValueNode $node, - TypeNode $typeNode, - TypeNode $fixedTypeNode - ): TemplateTagValueNode - { - $fixedNode = clone $node; + return null; + } - if ($fixedNode->bound !== null) { - $fixedNode->bound = AnnotationTypeHelper::change($node->bound, $typeNode, $fixedTypeNode); - } - if ($fixedNode->default !== null) { - $fixedNode->default = AnnotationTypeHelper::change($node->default, $typeNode, $fixedTypeNode); - } + public function setNodeToChange(Node $nodeToChange): void + { + $this->nodeToChange = $nodeToChange; + } - return $fixedNode; - } + public function setChangedNode(Node $changedNode): void + { + $this->changedNode = $changedNode; + } - private static function fix(File $phpcsFile, Annotation $annotation, Annotation $fixedAnnotation): string - { - $spaceAfterContent = ''; - if (preg_match( - '~(\\s+)$~', - TokenHelper::getContent($phpcsFile, $annotation->getStartPointer(), $annotation->getEndPointer()), - $matches - ) > 0) { - $spaceAfterContent = $matches[1]; + }; } - $fixedAnnotationContent = $fixedAnnotation->export() . $spaceAfterContent; - - return preg_replace('~(\r\n|\n|\r)~', '\1 * ', $fixedAnnotationContent); - } - - private static function parseAnnotationContent(string $annotationName, string $annotationContent): PhpDocTagValueNode - { - $annotationContentWithoutNewLines = preg_replace('~[\r\n]~', ' ', $annotationContent); - - $tokens = new TokenIterator(self::getPhpDocLexer()->tokenize($annotationContentWithoutNewLines)); - return self::getPhpDocParser()->parseTagValue($tokens, $annotationName); - } - - private static function getPhpDocLexer(): Lexer - { - static $phpDocLexer; - - if ($phpDocLexer === null) { - $phpDocLexer = new Lexer(); + if ($traverser === null) { + $traverser = new NodeTraverser([$visitor]); } - return $phpDocLexer; - } - - private static function getPhpDocParser(): PhpDocParser - { - static $phpDocParser; + $visitor->setNodeToChange($nodeToChange); + $visitor->setChangedNode($changedNode); - if ($phpDocParser === null) { - $constantExpressionParser = new ConstExprParser(); - $phpDocParser = new PhpDocParser(new TypeParser($constantExpressionParser), $constantExpressionParser); - } + [$changedTagNode] = $traverser->traverse([$tagNode]); - return $phpDocParser; + return $changedTagNode; } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php index 14e3fdbcc..058c5b33e 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php @@ -6,11 +6,9 @@ use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprFloatNode; use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprIntegerNode; use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprStringNode; -use PHPStan\PhpDocParser\Ast\Type\ArrayShapeItemNode; use PHPStan\PhpDocParser\Ast\Type\ArrayShapeNode; use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode; use PHPStan\PhpDocParser\Ast\Type\CallableTypeNode; -use PHPStan\PhpDocParser\Ast\Type\CallableTypeParameterNode; use PHPStan\PhpDocParser\Ast\Type\ConditionalTypeForParameterNode; use PHPStan\PhpDocParser\Ast\Type\ConditionalTypeNode; use PHPStan\PhpDocParser\Ast\Type\ConstTypeNode; @@ -18,17 +16,13 @@ use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\IntersectionTypeNode; use PHPStan\PhpDocParser\Ast\Type\NullableTypeNode; -use PHPStan\PhpDocParser\Ast\Type\OffsetAccessTypeNode; +use PHPStan\PhpDocParser\Ast\Type\ObjectShapeNode; use PHPStan\PhpDocParser\Ast\Type\ThisTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode; -use function array_merge; use function count; use function in_array; -use function preg_replace; -use function sprintf; use function strtolower; -use function substr; /** * @internal @@ -36,454 +30,9 @@ class AnnotationTypeHelper { - /** - * @return IdentifierTypeNode[]|ThisTypeNode[] - */ - public static function getIdentifierTypeNodes(TypeNode $typeNode): array - { - if ($typeNode instanceof ArrayTypeNode) { - return self::getIdentifierTypeNodes($typeNode->type); - } - - if ($typeNode instanceof ArrayShapeNode) { - $identifierTypeNodes = []; - foreach ($typeNode->items as $arrayShapeItemNode) { - $identifierTypeNodes = array_merge($identifierTypeNodes, self::getIdentifierTypeNodes($arrayShapeItemNode->valueType)); - } - return $identifierTypeNodes; - } - - if ( - $typeNode instanceof UnionTypeNode - || $typeNode instanceof IntersectionTypeNode - ) { - $identifierTypeNodes = []; - foreach ($typeNode->types as $innerTypeNode) { - $identifierTypeNodes = array_merge($identifierTypeNodes, self::getIdentifierTypeNodes($innerTypeNode)); - } - return $identifierTypeNodes; - } - - if ($typeNode instanceof GenericTypeNode) { - $identifierTypeNodes = self::getIdentifierTypeNodes($typeNode->type); - foreach ($typeNode->genericTypes as $innerTypeNode) { - $identifierTypeNodes = array_merge($identifierTypeNodes, self::getIdentifierTypeNodes($innerTypeNode)); - } - return $identifierTypeNodes; - } - - if ($typeNode instanceof NullableTypeNode) { - return self::getIdentifierTypeNodes($typeNode->type); - } - - if ($typeNode instanceof CallableTypeNode) { - $identifierTypeNodes = array_merge([$typeNode->identifier], self::getIdentifierTypeNodes($typeNode->returnType)); - foreach ($typeNode->parameters as $callableParameterNode) { - $identifierTypeNodes = array_merge($identifierTypeNodes, self::getIdentifierTypeNodes($callableParameterNode->type)); - } - return $identifierTypeNodes; - } - - if ($typeNode instanceof ConstTypeNode) { - return []; - } - - if ($typeNode instanceof ConditionalTypeNode) { - return array_merge( - self::getIdentifierTypeNodes($typeNode->subjectType), - self::getIdentifierTypeNodes($typeNode->targetType), - self::getIdentifierTypeNodes($typeNode->if), - self::getIdentifierTypeNodes($typeNode->else) - ); - } - - if ($typeNode instanceof ConditionalTypeForParameterNode) { - return array_merge( - self::getIdentifierTypeNodes($typeNode->targetType), - self::getIdentifierTypeNodes($typeNode->if), - self::getIdentifierTypeNodes($typeNode->else) - ); - } - - if ($typeNode instanceof OffsetAccessTypeNode) { - return array_merge( - self::getIdentifierTypeNodes($typeNode->type), - self::getIdentifierTypeNodes($typeNode->offset) - ); - } - - /** @var IdentifierTypeNode|ThisTypeNode $typeNode */ - $typeNode = $typeNode; - return [$typeNode]; - } - - /** - * @return ConstTypeNode[] - */ - public static function getConstantTypeNodes(TypeNode $typeNode): array - { - if ($typeNode instanceof ArrayTypeNode) { - return self::getConstantTypeNodes($typeNode->type); - } - - if ($typeNode instanceof ArrayShapeNode) { - $constTypeNodes = []; - foreach ($typeNode->items as $arrayShapeItemNode) { - $constTypeNodes = array_merge($constTypeNodes, self::getConstantTypeNodes($arrayShapeItemNode->valueType)); - } - return $constTypeNodes; - } - - if ( - $typeNode instanceof UnionTypeNode - || $typeNode instanceof IntersectionTypeNode - ) { - $constTypeNodes = []; - foreach ($typeNode->types as $innerTypeNode) { - $constTypeNodes = array_merge($constTypeNodes, self::getConstantTypeNodes($innerTypeNode)); - } - return $constTypeNodes; - } - - if ($typeNode instanceof GenericTypeNode) { - $constTypeNodes = []; - foreach ($typeNode->genericTypes as $innerTypeNode) { - $constTypeNodes = array_merge($constTypeNodes, self::getConstantTypeNodes($innerTypeNode)); - } - return $constTypeNodes; - } - - if ($typeNode instanceof NullableTypeNode) { - return self::getConstantTypeNodes($typeNode->type); - } - - if ($typeNode instanceof CallableTypeNode) { - $constTypeNodes = self::getConstantTypeNodes($typeNode->returnType); - foreach ($typeNode->parameters as $callableParameterNode) { - $constTypeNodes = array_merge($constTypeNodes, self::getConstantTypeNodes($callableParameterNode->type)); - } - return $constTypeNodes; - } - - if ($typeNode instanceof ConditionalTypeNode) { - return array_merge( - self::getConstantTypeNodes($typeNode->subjectType), - self::getConstantTypeNodes($typeNode->targetType), - self::getConstantTypeNodes($typeNode->if), - self::getConstantTypeNodes($typeNode->else) - ); - } - - if ($typeNode instanceof ConditionalTypeForParameterNode) { - return array_merge( - self::getConstantTypeNodes($typeNode->targetType), - self::getConstantTypeNodes($typeNode->if), - self::getConstantTypeNodes($typeNode->else) - ); - } - - if ($typeNode instanceof OffsetAccessTypeNode) { - return array_merge( - self::getConstantTypeNodes($typeNode->type), - self::getConstantTypeNodes($typeNode->offset) - ); - } - - if (!$typeNode instanceof ConstTypeNode) { - return []; - } - - return [$typeNode]; - } - - /** - * @return UnionTypeNode[] - */ - public static function getUnionTypeNodes(TypeNode $typeNode): array - { - if ($typeNode instanceof UnionTypeNode) { - return [$typeNode]; - } - - if ($typeNode instanceof NullableTypeNode) { - return self::getUnionTypeNodes($typeNode->type); - } - - if ($typeNode instanceof ArrayTypeNode) { - return self::getUnionTypeNodes($typeNode->type); - } - - if ($typeNode instanceof ArrayShapeNode) { - $unionTypeNodes = []; - foreach ($typeNode->items as $arrayShapeItemNode) { - $unionTypeNodes = array_merge($unionTypeNodes, self::getUnionTypeNodes($arrayShapeItemNode->valueType)); - } - return $unionTypeNodes; - } - - if ($typeNode instanceof IntersectionTypeNode) { - $unionTypeNodes = []; - foreach ($typeNode->types as $innerTypeNode) { - $unionTypeNodes = array_merge($unionTypeNodes, self::getUnionTypeNodes($innerTypeNode)); - } - return $unionTypeNodes; - } - - if ($typeNode instanceof GenericTypeNode) { - $unionTypeNodes = []; - foreach ($typeNode->genericTypes as $innerTypeNode) { - $unionTypeNodes = array_merge($unionTypeNodes, self::getUnionTypeNodes($innerTypeNode)); - } - return $unionTypeNodes; - } - - if ($typeNode instanceof CallableTypeNode) { - $unionTypeNodes = self::getUnionTypeNodes($typeNode->returnType); - foreach ($typeNode->parameters as $callableParameterNode) { - $unionTypeNodes = array_merge($unionTypeNodes, self::getUnionTypeNodes($callableParameterNode->type)); - } - return $unionTypeNodes; - } - - if ($typeNode instanceof ConditionalTypeNode) { - return array_merge( - self::getUnionTypeNodes($typeNode->subjectType), - self::getUnionTypeNodes($typeNode->targetType), - self::getUnionTypeNodes($typeNode->if), - self::getUnionTypeNodes($typeNode->else) - ); - } - - if ($typeNode instanceof ConditionalTypeForParameterNode) { - return array_merge( - self::getUnionTypeNodes($typeNode->targetType), - self::getUnionTypeNodes($typeNode->if), - self::getUnionTypeNodes($typeNode->else) - ); - } - - if ($typeNode instanceof OffsetAccessTypeNode) { - return array_merge( - self::getUnionTypeNodes($typeNode->type), - self::getUnionTypeNodes($typeNode->offset) - ); - } - - return []; - } - - /** - * @return ArrayTypeNode[] - */ - public static function getArrayTypeNodes(TypeNode $typeNode): array - { - if ($typeNode instanceof ArrayTypeNode) { - return array_merge([$typeNode], self::getArrayTypeNodes($typeNode->type)); - } - - if ($typeNode instanceof ArrayShapeNode) { - $arrayTypeNodes = []; - foreach ($typeNode->items as $arrayShapeItemNode) { - $arrayTypeNodes = array_merge($arrayTypeNodes, self::getArrayTypeNodes($arrayShapeItemNode->valueType)); - } - return $arrayTypeNodes; - } - - if ($typeNode instanceof NullableTypeNode) { - return self::getArrayTypeNodes($typeNode->type); - } - - if ( - $typeNode instanceof UnionTypeNode - || $typeNode instanceof IntersectionTypeNode - ) { - $arrayTypeNodes = []; - foreach ($typeNode->types as $innerTypeNode) { - $arrayTypeNodes = array_merge($arrayTypeNodes, self::getArrayTypeNodes($innerTypeNode)); - } - return $arrayTypeNodes; - } - - if ($typeNode instanceof GenericTypeNode) { - $arrayTypeNodes = []; - foreach ($typeNode->genericTypes as $innerTypeNode) { - $arrayTypeNodes = array_merge($arrayTypeNodes, self::getArrayTypeNodes($innerTypeNode)); - } - return $arrayTypeNodes; - } - - if ($typeNode instanceof CallableTypeNode) { - $arrayTypeNodes = self::getArrayTypeNodes($typeNode->returnType); - foreach ($typeNode->parameters as $callableParameterNode) { - $arrayTypeNodes = array_merge($arrayTypeNodes, self::getArrayTypeNodes($callableParameterNode->type)); - } - return $arrayTypeNodes; - } - - if ($typeNode instanceof ConditionalTypeNode) { - return array_merge( - self::getArrayTypeNodes($typeNode->subjectType), - self::getArrayTypeNodes($typeNode->targetType), - self::getArrayTypeNodes($typeNode->if), - self::getArrayTypeNodes($typeNode->else) - ); - } - - if ($typeNode instanceof ConditionalTypeForParameterNode) { - return array_merge( - self::getArrayTypeNodes($typeNode->targetType), - self::getArrayTypeNodes($typeNode->if), - self::getArrayTypeNodes($typeNode->else) - ); - } - - if ($typeNode instanceof OffsetAccessTypeNode) { - return array_merge( - self::getArrayTypeNodes($typeNode->type), - self::getArrayTypeNodes($typeNode->offset) - ); - } - - return []; - } - - /** - * @param IdentifierTypeNode|ThisTypeNode $typeNode - */ - public static function getTypeHintFromNode(TypeNode $typeNode): string - { - return $typeNode instanceof ThisTypeNode - ? (string) $typeNode - : $typeNode->name; - } - - public static function export(TypeNode $typeNode): string - { - $exportedTypeNode = (string) preg_replace(['~\\s*([&|])\\s*~'], '\\1', (string) $typeNode); - - if ( - $typeNode instanceof UnionTypeNode - || $typeNode instanceof IntersectionTypeNode - ) { - $exportedTypeNode = substr($exportedTypeNode, 1, -1); - } - - if ($typeNode instanceof ArrayTypeNode && $typeNode->type instanceof CallableTypeNode) { - $exportedTypeNode = sprintf('(%s)[]', substr($exportedTypeNode, 0, -2)); - } - - return $exportedTypeNode; - } - - public static function change(TypeNode $masterTypeNode, TypeNode $typeNodeToChange, TypeNode $changedTypeNode): TypeNode + public static function print(TypeNode $typeNode): string { - if ($masterTypeNode === $typeNodeToChange) { - return $changedTypeNode; - } - - if ($masterTypeNode instanceof UnionTypeNode) { - $types = []; - foreach ($masterTypeNode->types as $typeNone) { - $types[] = self::change($typeNone, $typeNodeToChange, $changedTypeNode); - } - - return new UnionTypeNode($types); - } - - if ($masterTypeNode instanceof IntersectionTypeNode) { - $types = []; - foreach ($masterTypeNode->types as $typeNone) { - $types[] = self::change($typeNone, $typeNodeToChange, $changedTypeNode); - } - - return new IntersectionTypeNode($types); - } - - if ($masterTypeNode instanceof GenericTypeNode) { - $genericTypes = []; - foreach ($masterTypeNode->genericTypes as $genericTypeNode) { - $genericTypes[] = self::change($genericTypeNode, $typeNodeToChange, $changedTypeNode); - } - - /** @var IdentifierTypeNode $identificatorTypeNode */ - $identificatorTypeNode = self::change($masterTypeNode->type, $typeNodeToChange, $changedTypeNode); - return new GenericTypeNode($identificatorTypeNode, $genericTypes, $masterTypeNode->variances); - } - - if ($masterTypeNode instanceof ArrayTypeNode) { - return new ArrayTypeNode(self::change($masterTypeNode->type, $typeNodeToChange, $changedTypeNode)); - } - - if ($masterTypeNode instanceof ArrayShapeNode) { - $arrayShapeItemNodes = []; - foreach ($masterTypeNode->items as $arrayShapeItemNode) { - $arrayShapeItemNodes[] = self::change($arrayShapeItemNode, $typeNodeToChange, $changedTypeNode); - } - - return new ArrayShapeNode($arrayShapeItemNodes, $masterTypeNode->sealed); - } - - if ($masterTypeNode instanceof ArrayShapeItemNode) { - return new ArrayShapeItemNode( - $masterTypeNode->keyName, - $masterTypeNode->optional, - self::change($masterTypeNode->valueType, $typeNodeToChange, $changedTypeNode) - ); - } - - if ($masterTypeNode instanceof NullableTypeNode) { - return new NullableTypeNode(self::change($masterTypeNode->type, $typeNodeToChange, $changedTypeNode)); - } - - if ($masterTypeNode instanceof CallableTypeNode) { - $callableParameters = []; - foreach ($masterTypeNode->parameters as $parameterTypeNode) { - $callableParameters[] = new CallableTypeParameterNode( - self::change($parameterTypeNode->type, $typeNodeToChange, $changedTypeNode), - $parameterTypeNode->isReference, - $parameterTypeNode->isVariadic, - $parameterTypeNode->parameterName, - $parameterTypeNode->isOptional - ); - } - - /** @var IdentifierTypeNode $identificatorTypeNode */ - $identificatorTypeNode = self::change($masterTypeNode->identifier, $typeNodeToChange, $changedTypeNode); - return new CallableTypeNode( - $identificatorTypeNode, - $callableParameters, - self::change($masterTypeNode->returnType, $typeNodeToChange, $changedTypeNode) - ); - } - - if ($masterTypeNode instanceof ConditionalTypeNode) { - return new ConditionalTypeNode( - self::change($masterTypeNode->subjectType, $typeNodeToChange, $changedTypeNode), - self::change($masterTypeNode->targetType, $typeNodeToChange, $changedTypeNode), - self::change($masterTypeNode->if, $typeNodeToChange, $changedTypeNode), - self::change($masterTypeNode->else, $typeNodeToChange, $changedTypeNode), - $masterTypeNode->negated - ); - } - - if ($masterTypeNode instanceof ConditionalTypeForParameterNode) { - return new ConditionalTypeForParameterNode( - $masterTypeNode->parameterName, - self::change($masterTypeNode->targetType, $typeNodeToChange, $changedTypeNode), - self::change($masterTypeNode->if, $typeNodeToChange, $changedTypeNode), - self::change($masterTypeNode->else, $typeNodeToChange, $changedTypeNode), - $masterTypeNode->negated - ); - } - - if ($masterTypeNode instanceof OffsetAccessTypeNode) { - return new OffsetAccessTypeNode( - self::change($masterTypeNode->type, $typeNodeToChange, $changedTypeNode), - self::change($masterTypeNode->offset, $typeNodeToChange, $changedTypeNode) - ); - } - - return clone $masterTypeNode; + return PhpDocParserHelper::getPrinter()->print($typeNode); } public static function containsStaticOrThisType(TypeNode $typeNode): bool @@ -528,6 +77,10 @@ public static function containsOneType(TypeNode $typeNode): bool return true; } + if ($typeNode instanceof ObjectShapeNode) { + return true; + } + if ($typeNode instanceof ArrayShapeNode) { return true; } @@ -578,6 +131,10 @@ public static function containsTraversableType(TypeNode $typeNode, File $phpcsFi return true; } + if ($typeNode instanceof ObjectShapeNode) { + return false; + } + if ($typeNode instanceof ArrayShapeNode) { return true; } @@ -721,9 +278,6 @@ public static function containsItemsSpecificationForTraversable( return false; } - /** - * @param CallableTypeNode|GenericTypeNode|IdentifierTypeNode|ThisTypeNode|ArrayTypeNode|ArrayShapeNode|ConstTypeNode $typeNode - */ public static function getTypeHintFromOneType( TypeNode $typeNode, bool $enableUnionTypeHint = false, @@ -733,7 +287,7 @@ public static function getTypeHintFromOneType( if ($typeNode instanceof GenericTypeNode) { $genericName = $typeNode->type->name; - if (strtolower($genericName) === 'non-empty-array') { + if (in_array(strtolower($genericName), ['non-empty-array', 'list', 'non-empty-list'], true)) { return 'array'; } @@ -755,7 +309,7 @@ public static function getTypeHintFromOneType( if (in_array( strtolower($typeNode->name), - ['class-string', 'trait-string', 'callable-string', 'numeric-string', 'non-empty-string', 'literal-string'], + ['class-string', 'trait-string', 'callable-string', 'numeric-string', 'non-empty-string', 'non-falsy-string', 'literal-string'], true )) { return 'string'; @@ -776,6 +330,10 @@ public static function getTypeHintFromOneType( return 'array'; } + if ($typeNode instanceof ObjectShapeNode) { + return 'object'; + } + if ($typeNode instanceof ConstTypeNode) { if ($typeNode->constExpr instanceof ConstExprIntegerNode) { return 'int'; @@ -796,7 +354,7 @@ public static function getTypeHintFromOneType( /** * @param UnionTypeNode|IntersectionTypeNode $typeNode * @param array $traversableTypeHints - * @return string[] + * @return list */ public static function getTraversableTypeHintsFromType( TypeNode $typeNode, diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayHelper.php new file mode 100644 index 000000000..8bf354b48 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayHelper.php @@ -0,0 +1,232 @@ + + */ + public static function parse(File $phpcsFile, int $arrayPointer): array + { + $tokens = $phpcsFile->getTokens(); + + $arrayToken = $tokens[$arrayPointer]; + [$arrayOpenerPointer, $arrayCloserPointer] = self::openClosePointers($arrayToken); + + $keyValues = []; + + $firstPointerOnNextLine = TokenHelper::findFirstTokenOnNextLine($phpcsFile, $arrayOpenerPointer + 1); + $firstEffectivePointer = TokenHelper::findNextEffective($phpcsFile, $arrayOpenerPointer + 1); + + $arrayKeyValueStartPointer = $firstPointerOnNextLine !== null && $firstPointerOnNextLine < $firstEffectivePointer + ? $firstPointerOnNextLine + : $firstEffectivePointer; + $arrayKeyValueEndPointer = $arrayKeyValueStartPointer; + + $indentation = $tokens[$arrayOpenerPointer]['line'] < $tokens[$firstEffectivePointer]['line'] + ? IndentationHelper::getIndentation($phpcsFile, $firstEffectivePointer) + : ''; + + for ($i = $arrayKeyValueStartPointer; $i < $arrayCloserPointer; $i++) { + $token = $tokens[$i]; + + if (in_array($token['code'], TokenHelper::$arrayTokenCodes, true)) { + $i = self::openClosePointers($token)[1]; + continue; + } + + if (array_key_exists('scope_closer', $token) && $token['scope_closer'] > $i) { + $i = $token['scope_closer'] - 1; + continue; + } + + if (array_key_exists('parenthesis_closer', $token) && $token['parenthesis_closer'] > $i) { + $i = $token['parenthesis_closer'] - 1; + continue; + } + + $nextEffectivePointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + + if ($nextEffectivePointer === $arrayCloserPointer) { + $arrayKeyValueEndPointer = self::getValueEndPointer($phpcsFile, $i, $arrayCloserPointer, $indentation); + break; + } + + if ($token['code'] !== T_COMMA || !ScopeHelper::isInSameScope($phpcsFile, $arrayOpenerPointer, $i)) { + $arrayKeyValueEndPointer = $i; + continue; + } + + $arrayKeyValueEndPointer = self::getValueEndPointer($phpcsFile, $i, $arrayCloserPointer, $indentation); + + $keyValues[] = new ArrayKeyValue($phpcsFile, $arrayKeyValueStartPointer, $arrayKeyValueEndPointer); + + $arrayKeyValueStartPointer = $arrayKeyValueEndPointer + 1; + $i = $arrayKeyValueEndPointer; + } + + $keyValues[] = new ArrayKeyValue($phpcsFile, $arrayKeyValueStartPointer, $arrayKeyValueEndPointer); + + return $keyValues; + } + + /** + * @param list $keyValues + */ + public static function getIndentation(array $keyValues): ?string + { + $indents = []; + foreach ($keyValues as $keyValue) { + $indent = $keyValue->getIndent() ?? 'null'; + $indents[$indent] = isset($indents[$indent]) + ? $indents[$indent] + 1 + : 1; + } + arsort($indents); + $indent = key($indents); + return $indent !== 'null' + ? (string) $indent + : null; + } + + /** + * @param list $keyValues + */ + public static function isKeyed(array $keyValues): bool + { + foreach ($keyValues as $keyValue) { + if ($keyValue->getKey() !== null) { + return true; + } + } + return false; + } + + /** + * @param list $keyValues + */ + public static function isKeyedAll(array $keyValues): bool + { + foreach ($keyValues as $keyValue) { + if (!$keyValue->isUnpacking() && $keyValue->getKey() === null) { + return false; + } + } + return true; + } + + /** + * Test if non-empty array with opening & closing brackets on separate lines + */ + public static function isMultiLine(File $phpcsFile, int $pointer): bool + { + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$pointer]; + [$pointerOpener, $pointerCloser] = self::openClosePointers($token); + $tokenOpener = $tokens[$pointerOpener]; + $tokenCloser = $tokens[$pointerCloser]; + + return $tokenOpener['line'] !== $tokenCloser['line']; + } + + /** + * Test if effective tokens between open & closing tokens + */ + public static function isNotEmpty(File $phpcsFile, int $pointer): bool + { + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$pointer]; + [$pointerOpener, $pointerCloser] = self::openClosePointers($token); + + /** @var int $pointerPreviousToClose */ + $pointerPreviousToClose = TokenHelper::findPreviousEffective($phpcsFile, $pointerCloser - 1); + + return $pointerPreviousToClose !== $pointerOpener; + } + + /** + * @param list $keyValues + */ + public static function isSortedByKey(array $keyValues): bool + { + $previousKey = ''; + foreach ($keyValues as $keyValue) { + if ($keyValue->isUnpacking()) { + continue; + } + + if (strnatcasecmp($previousKey, $keyValue->getKey()) === 1) { + return false; + } + + $previousKey = $keyValue->getKey(); + } + + return true; + } + + /** + * @param array|int|string> $token + * @return array{0: int, 1: int} + */ + public static function openClosePointers(array $token): array + { + $isShortArray = $token['code'] === T_OPEN_SHORT_ARRAY; + $pointerOpener = $isShortArray + ? $token['bracket_opener'] + : $token['parenthesis_opener']; + $pointerCloser = $isShortArray + ? $token['bracket_closer'] + : $token['parenthesis_closer']; + return [(int) $pointerOpener, (int) $pointerCloser]; + } + + private static function getValueEndPointer(File $phpcsFile, int $endPointer, int $arrayCloserPointer, string $indentation): int + { + $tokens = $phpcsFile->getTokens(); + + $nextEffectivePointer = TokenHelper::findNextEffective($phpcsFile, $endPointer + 1, $arrayCloserPointer + 1); + + if ($tokens[$nextEffectivePointer]['line'] === $tokens[$endPointer]['line']) { + return $nextEffectivePointer - 1; + } + + for ($i = $endPointer + 1; $i < $nextEffectivePointer; $i++) { + if ($tokens[$i]['line'] === $tokens[$endPointer]['line']) { + $endPointer = $i; + continue; + } + + $nextNonWhitespacePointer = TokenHelper::findNextNonWhitespace($phpcsFile, $i); + + if (!in_array($tokens[$nextNonWhitespacePointer]['code'], TokenHelper::$inlineCommentTokenCodes, true)) { + break; + } + + if ($indentation === IndentationHelper::getIndentation($phpcsFile, $nextNonWhitespacePointer)) { + $endPointer = $i - 1; + break; + } + + $i = TokenHelper::findLastTokenOnLine($phpcsFile, $i); + $endPointer = $i; + } + + return $endPointer; + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayKeyValue.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayKeyValue.php new file mode 100644 index 000000000..3588426df --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayKeyValue.php @@ -0,0 +1,172 @@ +pointerStart = $pointerStart; + $this->pointerEnd = $pointerEnd; + $this->addValues($phpcsFile); + } + + public function getContent(File $phpcsFile, bool $normalize = false, ?string $indent = null): string + { + if ($normalize === false) { + return TokenHelper::getContent($phpcsFile, $this->pointerStart, $this->pointerEnd); + } + $content = ''; + $addCommaPtr = $this->pointerComma === null + ? TokenHelper::findPreviousEffective($phpcsFile, $this->pointerEnd) + : null; + $tokens = $phpcsFile->getTokens(); + for ($pointer = $this->pointerStart; $pointer <= $this->pointerEnd; $pointer++) { + $token = $tokens[$pointer]; + $content .= $token['content']; + if ($pointer === $addCommaPtr) { + $content .= ','; + } + } + + // Trim, but keep leading empty lines + $content = ltrim($content, " \t"); + $content = rtrim($content); + + if ($indent !== null && strpos($content, $phpcsFile->eolChar) !== 0) { + $content = $indent . $content; + } + + return $content; + } + + public function getIndent(): ?string + { + return $this->indent; + } + + public function getKey(): ?string + { + return $this->key; + } + + public function getPointerArrow(): ?int + { + return $this->pointerArrow; + } + + public function getPointerComma(): ?int + { + return $this->pointerComma; + } + + public function getPointerEnd(): int + { + return $this->pointerEnd; + } + + public function getPointerStart(): int + { + return $this->pointerStart; + } + + public function isUnpacking(): bool + { + return $this->unpacking; + } + + private function addValues(File $phpcsFile): void + { + $key = ''; + $tokens = $phpcsFile->getTokens(); + $firstNonWhitespace = null; + + for ($i = $this->pointerStart; $i <= $this->pointerEnd; $i++) { + $token = $tokens[$i]; + + if (in_array($token['code'], TokenHelper::$arrayTokenCodes, true)) { + $i = ArrayHelper::openClosePointers($token)[1]; + continue; + } + + if ($token['code'] === T_DOUBLE_ARROW) { + $this->pointerArrow = $i; + continue; + } + + if ($token['code'] === T_COMMA) { + $this->pointerComma = $i; + continue; + + } + + if ($token['code'] === T_ELLIPSIS) { + $this->unpacking = true; + continue; + } + + if ($this->pointerArrow !== null) { + continue; + } + + if ($firstNonWhitespace === null && $token['code'] !== T_WHITESPACE) { + $firstNonWhitespace = $i; + } + + if (in_array($token['code'], TokenHelper::$inlineCommentTokenCodes, true) === false) { + $key .= $token['content']; + } + } + $haveIndent = $firstNonWhitespace !== null && TokenHelper::findFirstNonWhitespaceOnLine( + $phpcsFile, + $firstNonWhitespace + ) === $firstNonWhitespace; + $this->indent = $haveIndent + ? TokenHelper::getContent( + $phpcsFile, + TokenHelper::findFirstTokenOnLine($phpcsFile, $firstNonWhitespace), + $firstNonWhitespace - 1 + ) + : null; + $this->key = $this->pointerArrow !== null + ? trim($key) + : null; + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AttributeHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AttributeHelper.php index c0ebb46c8..c5ce72ee4 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AttributeHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AttributeHelper.php @@ -5,6 +5,7 @@ use InvalidArgumentException; use PHP_CodeSniffer\Files\File; use function sprintf; +use const T_ANON_CLASS; use const T_ATTRIBUTE; use const T_CLASS; use const T_CLOSURE; @@ -26,6 +27,7 @@ class AttributeHelper { private const ATTRIBUTE_TARGETS = [ + T_ANON_CLASS, T_CLASS, T_CLOSURE, T_CONST, diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CatchHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CatchHelper.php index 3aa6bb4c0..b188b40d0 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CatchHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CatchHelper.php @@ -37,9 +37,9 @@ public static function getTryEndPointer(File $phpcsFile, int $catchPointer): int /** * @param array|int|string> $catchToken - * @return string[] + * @return list */ - public static function findCatchedTypesInCatch(File $phpcsFile, array $catchToken): array + public static function findCaughtTypesInCatch(File $phpcsFile, array $catchToken): array { /** @var int $catchParenthesisOpenerPointer */ $catchParenthesisOpenerPointer = $catchToken['parenthesis_opener']; @@ -50,7 +50,7 @@ public static function findCatchedTypesInCatch(File $phpcsFile, array $catchToke $nameEndPointer = $catchParenthesisOpenerPointer; $tokens = $phpcsFile->getTokens(); - $catchedTypes = []; + $caughtTypes = []; do { $nameStartPointer = TokenHelper::findNext( $phpcsFile, @@ -70,14 +70,14 @@ public static function findCatchedTypesInCatch(File $phpcsFile, array $catchToke $pointerAfterNameEndPointer = TokenHelper::findNextExcluding($phpcsFile, $nameTokenCodes, $nameStartPointer + 1); $nameEndPointer = $pointerAfterNameEndPointer === null ? $nameStartPointer : $pointerAfterNameEndPointer - 1; - $catchedTypes[] = NamespaceHelper::resolveClassName( + $caughtTypes[] = NamespaceHelper::resolveClassName( $phpcsFile, TokenHelper::getContent($phpcsFile, $nameStartPointer, $nameEndPointer), $catchParenthesisOpenerPointer ); } while (true); - return $catchedTypes; + return $caughtTypes; } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php index 59caaa5a8..14d706623 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php @@ -82,7 +82,7 @@ public static function getAllNames(File $phpcsFile): array } /** - * @return int[] + * @return list */ public static function getTraitUsePointers(File $phpcsFile, int $classPointer): array { @@ -107,7 +107,7 @@ public static function getTraitUsePointers(File $phpcsFile, int $classPointer): } /** - * @return array + * @return list */ private static function getAllClassPointers(File $phpcsFile): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConditionHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConditionHelper.php index 8fcc0d7d1..865e8250b 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConditionHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConditionHelper.php @@ -115,17 +115,21 @@ public static function getNegativeCondition( return sprintf( '%s%s%s', - $conditionBoundaryStartPointer !== $conditionStartPointer ? TokenHelper::getContent( - $phpcsFile, - $conditionBoundaryStartPointer, - $conditionStartPointer - 1 - ) : '', + $conditionBoundaryStartPointer !== $conditionStartPointer + ? TokenHelper::getContent( + $phpcsFile, + $conditionBoundaryStartPointer, + $conditionStartPointer - 1 + ) + : '', self::getNegativeConditionPart($phpcsFile, $conditionStartPointer, $conditionEndPointer, $nested), - $conditionBoundaryEndPointer !== $conditionEndPointer ? TokenHelper::getContent( - $phpcsFile, - $conditionEndPointer + 1, - $conditionBoundaryEndPointer - ) : '' + $conditionBoundaryEndPointer !== $conditionEndPointer + ? TokenHelper::getContent( + $phpcsFile, + $conditionEndPointer + 1, + $conditionBoundaryEndPointer + ) + : '' ); } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConstantHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConstantHelper.php index dda06b73a..99978a093 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConstantHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConstantHelper.php @@ -36,7 +36,7 @@ public static function getFullyQualifiedName(File $phpcsFile, int $constantPoint } /** - * @return string[] + * @return list */ public static function getAllNames(File $phpcsFile): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/DocCommentHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/DocCommentHelper.php index 376806a84..ffed9954d 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/DocCommentHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/DocCommentHelper.php @@ -3,11 +3,17 @@ namespace SlevomatCodingStandard\Helpers; use PHP_CodeSniffer\Files\File; +use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTextNode; +use PHPStan\PhpDocParser\Parser\ParserException; +use PHPStan\PhpDocParser\Parser\TokenIterator; use function array_merge; use function count; use function in_array; use function preg_match; +use function sprintf; use function stripos; +use function strtolower; use function trim; use const T_ABSTRACT; use const T_ATTRIBUTE; @@ -57,14 +63,14 @@ public static function getDocComment(File $phpcsFile, int $pointer): ?string return trim( TokenHelper::getContent( $phpcsFile, - $docCommentOpenToken + 1, - $phpcsFile->getTokens()[$docCommentOpenToken]['comment_closer'] - 1 + $docCommentOpenToken, + $phpcsFile->getTokens()[$docCommentOpenToken]['comment_closer'] ) ); } /** - * @return Comment[]|null + * @return list|null */ public static function getDocCommentDescription(File $phpcsFile, int $pointer): ?array { @@ -97,7 +103,7 @@ public static function getDocCommentDescription(File $phpcsFile, int $pointer): $tokens[$docCommentOpenPointer]['comment_closer'] + 1 ); - /** @var Comment[] $comments */ + /** @var list $comments */ $comments = []; for ($i = $descriptionStartPointer; $i < $tokenAfterDescriptionPointer; $i++) { if ($tokens[$i]['code'] !== T_DOC_COMMENT_STRING) { @@ -112,12 +118,29 @@ public static function getDocCommentDescription(File $phpcsFile, int $pointer): public static function hasInheritdocAnnotation(File $phpcsFile, int $pointer): bool { - $docComment = self::getDocComment($phpcsFile, $pointer); - if ($docComment === null) { + $docCommentOpenPointer = self::findDocCommentOpenPointer($phpcsFile, $pointer); + + if ($docCommentOpenPointer === null) { + return false; + } + + $parsedDocComment = self::parseDocComment($phpcsFile, $docCommentOpenPointer); + + if ($parsedDocComment === null) { return false; } - return stripos($docComment, '@inheritdoc') !== false; + foreach ($parsedDocComment->getNode()->children as $child) { + if ($child instanceof PhpDocTextNode && stripos($child->text, '{@inheritdoc}') !== false) { + return true; + } + + if ($child instanceof PhpDocTagNode && strtolower($child->name) === '@inheritdoc') { + return true; + } + } + + return false; } public static function hasDocCommentDescription(File $phpcsFile, int $pointer): bool @@ -127,22 +150,28 @@ public static function hasDocCommentDescription(File $phpcsFile, int $pointer): public static function findDocCommentOpenPointer(File $phpcsFile, int $pointer): ?int { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$pointer]['code'] === T_DOC_COMMENT_OPEN_TAG) { - return $pointer; - } - - $found = TokenHelper::findPrevious( + return SniffLocalCache::getAndSetIfNotCached( $phpcsFile, - [T_DOC_COMMENT_CLOSE_TAG, T_SEMICOLON, T_CLOSE_CURLY_BRACKET, T_OPEN_CURLY_BRACKET], - $pointer - 1 + sprintf('doc-comment-open-pointer-%d', $pointer), + static function () use ($phpcsFile, $pointer): ?int { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$pointer]['code'] === T_DOC_COMMENT_OPEN_TAG) { + return $pointer; + } + + $found = TokenHelper::findPrevious( + $phpcsFile, + [T_DOC_COMMENT_CLOSE_TAG, T_SEMICOLON, T_CLOSE_CURLY_BRACKET, T_OPEN_CURLY_BRACKET], + $pointer - 1 + ); + if ($found !== null && $tokens[$found]['code'] === T_DOC_COMMENT_CLOSE_TAG) { + return $tokens[$found]['comment_opener']; + } + + return null; + } ); - if ($found !== null && $tokens[$found]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - return $tokens[$found]['comment_opener']; - } - - return null; } public static function findDocCommentOwnerPointer(File $phpcsFile, int $docCommentOpenPointer): ?int @@ -202,8 +231,45 @@ public static function isInline(File $phpcsFile, int $docCommentOpenPointer): bo return false; } - $docCommentContent = self::getDocComment($phpcsFile, $docCommentOpenPointer); - return preg_match('~^@(?:(?:phpstan|psalm)-)?var~i', $docCommentContent) === 1; + $parsedDocComment = self::parseDocComment($phpcsFile, $docCommentOpenPointer); + + if ($parsedDocComment === null) { + return false; + } + + foreach ($parsedDocComment->getNode()->getTags() as $annotation) { + if (preg_match('~^@(?:(?:phpstan|psalm)-)?var~i', $annotation->name) === 1) { + return true; + } + } + + return false; + } + + public static function parseDocComment(File $phpcsFile, int $docCommentOpenPointer): ?ParsedDocComment + { + return SniffLocalCache::getAndSetIfNotCached( + $phpcsFile, + sprintf('parsed-doc-comment-%d', $docCommentOpenPointer), + static function () use ($phpcsFile, $docCommentOpenPointer): ?ParsedDocComment { + $docComment = self::getDocComment($phpcsFile, $docCommentOpenPointer); + + $docCommentTokens = new TokenIterator(PhpDocParserHelper::getLexer()->tokenize($docComment)); + + try { + $parsedDocComment = PhpDocParserHelper::getParser()->parse($docCommentTokens); + + return new ParsedDocComment( + $docCommentOpenPointer, + $phpcsFile->getTokens()[$docCommentOpenPointer]['comment_closer'], + $parsedDocComment, + $docCommentTokens + ); + } catch (ParserException $e) { + return null; + } + } + ); } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FixerHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FixerHelper.php index a4639ced3..d994bc6ca 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FixerHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FixerHelper.php @@ -12,6 +12,12 @@ class FixerHelper { + public static function change(File $phpcsFile, int $startPointer, int $endPointer, string $content): void + { + self::removeBetweenIncluding($phpcsFile, $startPointer, $endPointer); + $phpcsFile->fixer->replaceToken($startPointer, $content); + } + public static function removeBetween(File $phpcsFile, int $startPointer, int $endPointer): void { self::removeBetweenIncluding($phpcsFile, $startPointer + 1, $endPointer - 1); diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FunctionHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FunctionHelper.php index 114af8fbf..633e80b1c 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FunctionHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FunctionHelper.php @@ -5,15 +5,15 @@ use Generator; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Util\Tokens; -use SlevomatCodingStandard\Helpers\Annotation\ParameterAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ReturnAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\VariableAnnotation; +use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode; use function array_filter; use function array_map; use function array_merge; use function array_pop; use function array_reverse; -use function count; use function in_array; use function iterator_to_array; use function preg_match; @@ -52,32 +52,41 @@ class FunctionHelper public const SPECIAL_FUNCTIONS = [ 'array_key_exists', 'array_slice', + 'assert', 'boolval', 'call_user_func', 'call_user_func_array', 'chr', + 'constant', 'count', - 'doubleval', + 'define', 'defined', + 'dirname', + 'doubleval', + 'extension_loaded', 'floatval', 'func_get_args', 'func_num_args', + 'function_exists', 'get_called_class', 'get_class', 'gettype', 'in_array', + 'ini_get', 'intval', 'is_array', 'is_bool', + 'is_callable', 'is_double', 'is_float', - 'is_long', 'is_int', 'is_integer', + 'is_long', 'is_null', 'is_object', 'is_real', 'is_resource', + 'is_scalar', 'is_string', 'ord', 'sizeof', @@ -169,7 +178,7 @@ public static function findClassPointer(File $phpcsFile, int $functionPointer): } /** - * @return string[] + * @return list */ public static function getParametersNames(File $phpcsFile, int $functionPointer): array { @@ -188,7 +197,7 @@ public static function getParametersNames(File $phpcsFile, int $functionPointer) } /** - * @return (TypeHint|null)[] + * @return array */ public static function getParametersTypeHints(File $phpcsFile, int $functionPointer): array { @@ -315,17 +324,15 @@ public static function hasReturnTypeHint(File $phpcsFile, int $functionPointer): } /** - * @return ParameterAnnotation[] + * @return list|Annotation> */ public static function getParametersAnnotations(File $phpcsFile, int $functionPointer): array { - /** @var ParameterAnnotation[] $parametersAnnotations */ - $parametersAnnotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $functionPointer, '@param'); - return $parametersAnnotations; + return AnnotationHelper::getAnnotations($phpcsFile, $functionPointer, '@param'); } /** - * @return array + * @return array|Annotation|Annotation> */ public static function getValidParametersAnnotations(File $phpcsFile, int $functionPointer): array { @@ -339,8 +346,7 @@ public static function getValidParametersAnnotations(File $phpcsFile, int $funct continue; } - /** @var VariableAnnotation[] $varAnnotations */ - $varAnnotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $i, '@var'); + $varAnnotations = AnnotationHelper::getAnnotations($phpcsFile, $i, '@var'); if ($varAnnotations === []) { continue; } @@ -350,37 +356,33 @@ public static function getValidParametersAnnotations(File $phpcsFile, int $funct } foreach (self::getParametersAnnotations($phpcsFile, $functionPointer) as $parameterAnnotation) { - if ($parameterAnnotation->getContent() === null) { - continue; - } - if ($parameterAnnotation->isInvalid()) { continue; } - $parametersAnnotations[$parameterAnnotation->getParameterName()] = $parameterAnnotation; + $parametersAnnotations[$parameterAnnotation->getValue()->parameterName] = $parameterAnnotation; } return $parametersAnnotations; } /** - * @return array + * @return array|Annotation> */ public static function getValidPrefixedParametersAnnotations(File $phpcsFile, int $functionPointer): array { $tokens = $phpcsFile->getTokens(); $parametersAnnotations = []; - foreach (AnnotationHelper::PREFIXES as $prefix) { + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefix) { if (self::getName($phpcsFile, $functionPointer) === '__construct') { for ($i = $tokens[$functionPointer]['parenthesis_opener'] + 1; $i < $tokens[$functionPointer]['parenthesis_closer']; $i++) { if ($tokens[$i]['code'] !== T_VARIABLE) { continue; } - /** @var VariableAnnotation[] $varAnnotations */ - $varAnnotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $i, sprintf('@%s-var', $prefix)); + /** @var list> $varAnnotations */ + $varAnnotations = AnnotationHelper::getAnnotations($phpcsFile, $i, sprintf('@%s-var', $prefix)); if ($varAnnotations === []) { continue; } @@ -389,30 +391,29 @@ public static function getValidPrefixedParametersAnnotations(File $phpcsFile, in } } - /** @var ParameterAnnotation[] $annotations */ - $annotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $functionPointer, sprintf('@%s-param', $prefix)); + /** @var list> $annotations */ + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $functionPointer, sprintf('@%s-param', $prefix)); foreach ($annotations as $parameterAnnotation) { - if ($parameterAnnotation->getContent() === null) { - continue; - } - if ($parameterAnnotation->isInvalid()) { continue; } - $parametersAnnotations[$parameterAnnotation->getParameterName()] = $parameterAnnotation; + $parametersAnnotations[$parameterAnnotation->getValue()->parameterName] = $parameterAnnotation; } } return $parametersAnnotations; } - public static function findReturnAnnotation(File $phpcsFile, int $functionPointer): ?ReturnAnnotation + /** + * @return Annotation|null + */ + public static function findReturnAnnotation(File $phpcsFile, int $functionPointer): ?Annotation { - /** @var ReturnAnnotation[] $returnAnnotations */ - $returnAnnotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $functionPointer, '@return'); + /** @var list> $returnAnnotations */ + $returnAnnotations = AnnotationHelper::getAnnotations($phpcsFile, $functionPointer, '@return'); - if (count($returnAnnotations) === 0) { + if ($returnAnnotations === []) { return null; } @@ -420,19 +421,24 @@ public static function findReturnAnnotation(File $phpcsFile, int $functionPointe } /** - * @return ReturnAnnotation[] + * @return list */ public static function getValidPrefixedReturnAnnotations(File $phpcsFile, int $functionPointer): array { $returnAnnotations = []; - foreach (AnnotationHelper::PREFIXES as $prefix) { - /** @var ReturnAnnotation[] $annotations */ - $annotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $functionPointer, sprintf('@%s-return', $prefix)); + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $functionPointer); + + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefix) { + $prefixedAnnotationName = sprintf('@%s-return', $prefix); + foreach ($annotations as $annotation) { - if (!$annotation->isInvalid()) { + if ($annotation->isInvalid()) { + continue; + } + + if ($annotation->getName() === $prefixedAnnotationName) { $returnAnnotations[] = $annotation; - break; } } } @@ -441,7 +447,7 @@ public static function getValidPrefixedReturnAnnotations(File $phpcsFile, int $f } /** - * @return string[] + * @return list */ public static function getAllFunctionNames(File $phpcsFile): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IndentationHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IndentationHelper.php index e739deae8..e6daae0d1 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IndentationHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IndentationHelper.php @@ -33,22 +33,22 @@ public static function getIndentation(File $phpcsFile, int $pointer): string return TokenHelper::getContent($phpcsFile, $firstPointerOnLine, $pointer - 1); } - public static function addIndentation(string $identation, int $level = 1): string + public static function addIndentation(string $indentation, int $level = 1): string { - $whitespace = self::getOneIndentationLevel($identation); + $whitespace = self::getOneIndentationLevel($indentation); - return $identation . str_repeat($whitespace, $level); + return $indentation . str_repeat($whitespace, $level); } - public static function getOneIndentationLevel(string $identation): string + public static function getOneIndentationLevel(string $indentation): string { - return $identation === '' + return $indentation === '' ? self::TAB_INDENT - : ($identation[0] === self::TAB_INDENT ? self::TAB_INDENT : self::SPACES_INDENT); + : ($indentation[0] === self::TAB_INDENT ? self::TAB_INDENT : self::SPACES_INDENT); } /** - * @param int[] $codePointers + * @param list $codePointers */ public static function fixIndentation(File $phpcsFile, array $codePointers, string $defaultIndentation): string { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/NamespaceHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/NamespaceHelper.php index 4e10842e5..6f97597f6 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/NamespaceHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/NamespaceHelper.php @@ -31,7 +31,7 @@ class NamespaceHelper public const NAMESPACE_SEPARATOR = '\\'; /** - * @return int[] + * @return list */ public static function getAllNamespacesPointers(File $phpcsFile): array { @@ -69,7 +69,7 @@ public static function hasNamespace(string $typeName): bool } /** - * @return string[] + * @return list */ public static function getNameParts(string $name): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParsedDocComment.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParsedDocComment.php new file mode 100644 index 000000000..2c4fa0113 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParsedDocComment.php @@ -0,0 +1,108 @@ +openPointer = $openPointer; + $this->closePointer = $closePointer; + $this->node = $node; + $this->tokens = $tokens; + } + + public function getOpenPointer(): int + { + return $this->openPointer; + } + + public function getClosePointer(): int + { + return $this->closePointer; + } + + public function getNode(): PhpDocNode + { + return $this->node; + } + + public function getTokens(): TokenIterator + { + return $this->tokens; + } + + public function getNodeStartPointer(File $phpcsFile, Node $node): int + { + $tokens = $phpcsFile->getTokens(); + + $tagStartLine = $tokens[$this->openPointer]['line'] + $node->getAttribute('startLine') - 1; + + $searchPointer = $this->openPointer + 1; + for ($i = $this->openPointer + 1; $i < $this->closePointer; $i++) { + if ($tagStartLine === $tokens[$i]['line']) { + $searchPointer = $i; + break; + } + } + + return TokenHelper::findNext($phpcsFile, array_merge(TokenHelper::$annotationTokenCodes, [T_DOC_COMMENT_STRING]), $searchPointer); + } + + public function getNodeEndPointer(File $phpcsFile, Node $node, int $nodeStartPointer): int + { + $tokens = $phpcsFile->getTokens(); + + $content = trim($this->tokens->getContentBetween( + $node->getAttribute(Attribute::START_INDEX), + $node->getAttribute(Attribute::END_INDEX) + 1 + )); + $length = strlen($content); + + $searchPointer = $nodeStartPointer; + + $content = ''; + for ($i = $nodeStartPointer; $i < count($tokens); $i++) { + $content .= $tokens[$i]['content']; + + if (strlen($content) >= $length) { + $searchPointer = $i; + break; + } + } + + return TokenHelper::findPrevious( + $phpcsFile, + array_merge(TokenHelper::$annotationTokenCodes, [T_DOC_COMMENT_STRING]), + $searchPointer + ); + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PhpDocParserHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PhpDocParserHelper.php new file mode 100644 index 000000000..6cc06d61a --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PhpDocParserHelper.php @@ -0,0 +1,82 @@ + true, 'indexes' => true]; + + $constantExpressionParser = new ConstExprParser(true, true, $usedAttributes); + $parser = new PhpDocParser( + new TypeParser($constantExpressionParser, true, $usedAttributes), + $constantExpressionParser, + true, + true, + $usedAttributes, + true, + true + ); + } + + return $parser; + } + + public static function getPrinter(): Printer + { + static $printer; + + if ($printer === null) { + $printer = new Printer(); + } + + return $printer; + } + + /** + * @template T of Node + * @param T $node + * @return T + */ + public static function cloneNode(Node $node): Node + { + static $cloningTraverser; + + if ($cloningTraverser === null) { + $cloningTraverser = new NodeTraverser([new CloningVisitor()]); + } + + [$cloneNode] = $cloningTraverser->traverse([$node]); + + return $cloneNode; + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedNameHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedNameHelper.php index ca620f637..1a91a6e06 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedNameHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedNameHelper.php @@ -59,7 +59,7 @@ class ReferencedNameHelper { /** - * @return ReferencedName[] + * @return list */ public static function getAllReferencedNames(File $phpcsFile, int $openTagPointer): array { @@ -71,7 +71,7 @@ public static function getAllReferencedNames(File $phpcsFile, int $openTagPointe } /** - * @return ReferencedName[] + * @return list */ public static function getAllReferencedNamesInAttributes(File $phpcsFile, int $openTagPointer): array { @@ -123,7 +123,7 @@ public static function getReferencedNameEndPointer(File $phpcsFile, int $startPo } /** - * @return ReferencedName[] + * @return list */ private static function createAllReferencedNames(File $phpcsFile, int $openTagPointer): array { @@ -396,7 +396,7 @@ private static function isReferencedName(File $phpcsFile, int $startPointer): bo } /** - * @return ReferencedName[] + * @return list */ private static function createAllReferencedNamesInAttributes(File $phpcsFile, int $openTagPointer): array { @@ -473,7 +473,7 @@ private static function isNeedParsedContent($code): bool } /** - * @return string[] + * @return list */ private static function getReferencedNamesFromString(string $content): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ScopeHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ScopeHelper.php index 3eb72b5d9..68c65b73d 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ScopeHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ScopeHelper.php @@ -51,7 +51,7 @@ public static function getRootPointer(File $phpcsFile, int $pointer): int } /** - * @return int[] + * @return list */ public static function getAllRootPointers(File $phpcsFile): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffSettingsHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffSettingsHelper.php index d71a9a24f..ade9c26ce 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffSettingsHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffSettingsHelper.php @@ -34,8 +34,8 @@ public static function normalizeNullableInteger($settings): ?int } /** - * @param string[] $settings - * @return string[] + * @param list $settings + * @return list */ public static function normalizeArray(array $settings): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SuppressHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SuppressHelper.php index 7dba7f723..96b1d2c04 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SuppressHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SuppressHelper.php @@ -3,12 +3,14 @@ namespace SlevomatCodingStandard\Helpers; use PHP_CodeSniffer\Files\File; -use SlevomatCodingStandard\Helpers\Annotation\Annotation; +use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode; use function array_reduce; use function assert; +use function explode; use function sprintf; use function strpos; use const T_DOC_COMMENT_CLOSE_TAG; +use const T_DOC_COMMENT_OPEN_TAG; use const T_DOC_COMMENT_STAR; /** @@ -21,15 +23,21 @@ class SuppressHelper public static function isSniffSuppressed(File $phpcsFile, int $pointer, string $suppressName): bool { + /** @var list> $annotations */ + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $pointer, self::ANNOTATION); + return array_reduce( - AnnotationHelper::getAnnotationsByName($phpcsFile, $pointer, self::ANNOTATION), + $annotations, static function (bool $carry, Annotation $annotation) use ($suppressName): bool { + $annotationSuppressName = explode(' ', $annotation->getValue()->value)[0]; + if ( - $annotation->getContent() === $suppressName - || strpos($suppressName, sprintf('%s.', $annotation->getContent())) === 0 + $suppressName === $annotationSuppressName + || strpos($suppressName, sprintf('%s.', $annotationSuppressName)) === 0 ) { $carry = true; } + return $carry; }, false @@ -39,8 +47,9 @@ static function (bool $carry, Annotation $annotation) use ($suppressName): bool public static function removeSuppressAnnotation(File $phpcsFile, int $pointer, string $suppressName): void { $suppressAnnotation = null; - foreach (AnnotationHelper::getAnnotationsByName($phpcsFile, $pointer, self::ANNOTATION) as $annotation) { - if ($annotation->getContent() === $suppressName) { + /** @var Annotation $annotation */ + foreach (AnnotationHelper::getAnnotations($phpcsFile, $pointer, self::ANNOTATION) as $annotation) { + if ($annotation->getValue()->value === $suppressName) { $suppressAnnotation = $annotation; break; } @@ -48,14 +57,24 @@ public static function removeSuppressAnnotation(File $phpcsFile, int $pointer, s assert($suppressAnnotation !== null); - /** @var int $changeStart */ - $changeStart = TokenHelper::findPrevious($phpcsFile, T_DOC_COMMENT_STAR, $suppressAnnotation->getStartPointer() - 1); + $tokens = $phpcsFile->getTokens(); + + /** @var int $pointerBefore */ + $pointerBefore = TokenHelper::findPrevious( + $phpcsFile, + [T_DOC_COMMENT_OPEN_TAG, T_DOC_COMMENT_STAR], + $suppressAnnotation->getStartPointer() - 1 + ); + + $changeStart = $tokens[$pointerBefore]['code'] === T_DOC_COMMENT_STAR ? $pointerBefore : $suppressAnnotation->getStartPointer(); + /** @var int $changeEnd */ $changeEnd = TokenHelper::findNext( $phpcsFile, [T_DOC_COMMENT_CLOSE_TAG, T_DOC_COMMENT_STAR], $suppressAnnotation->getEndPointer() + 1 ) - 1; + $phpcsFile->fixer->beginChangeset(); FixerHelper::removeBetweenIncluding($phpcsFile, $changeStart, $changeEnd); $phpcsFile->fixer->endChangeset(); diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenHelper.php index d412d495e..fc4119d94 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenHelper.php @@ -6,6 +6,7 @@ use function array_key_exists; use function array_merge; use function count; +use const T_ARRAY; use const T_ARRAY_HINT; use const T_BREAK; use const T_CALLABLE; @@ -31,6 +32,7 @@ use const T_NAME_RELATIVE; use const T_NS_SEPARATOR; use const T_NULL; +use const T_OPEN_SHORT_ARRAY; use const T_PARENT; use const T_PHPCS_DISABLE; use const T_PHPCS_ENABLE; @@ -59,6 +61,12 @@ class TokenHelper { + /** @var array */ + public static $arrayTokenCodes = [ + T_ARRAY, + T_OPEN_SHORT_ARRAY, + ]; + /** @var array */ public static $typeKeywordTokenCodes = [ T_CLASS, @@ -85,6 +93,16 @@ class TokenHelper T_PHPCS_SET, ]; + /** @var array */ + public static $annotationTokenCodes = [ + T_DOC_COMMENT_TAG, + T_PHPCS_DISABLE, + T_PHPCS_ENABLE, + T_PHPCS_IGNORE, + T_PHPCS_IGNORE_FILE, + T_PHPCS_SET, + ]; + /** @var array */ public static $inlineCommentTokenCodes = [ T_COMMENT, @@ -133,7 +151,7 @@ public static function findNext(File $phpcsFile, $types, int $startPointer, ?int /** * @param int|string|array $types - * @return int[] + * @return list */ public static function findNextAll(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): array { @@ -446,7 +464,6 @@ public static function getLastTokenPointer(File $phpcsFile): int } /** - * @internal * @return array */ public static function getNameTokenCodes(): array @@ -455,7 +472,6 @@ public static function getNameTokenCodes(): array } /** - * @internal * @return array */ public static function getOnlyNameTokenCodes(): array diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHintHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHintHelper.php index 739a24b4f..abde19b64 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHintHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHintHelper.php @@ -3,9 +3,9 @@ namespace SlevomatCodingStandard\Helpers; use PHP_CodeSniffer\Files\File; -use SlevomatCodingStandard\Helpers\Annotation\TemplateAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\TypeAliasAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\TypeImportAnnotation; +use PHPStan\PhpDocParser\Ast\PhpDoc\TemplateTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\TypeAliasImportTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\TypeAliasTagValueNode; use function array_key_exists; use function array_map; use function array_merge; @@ -93,7 +93,7 @@ public static function isNeverTypeHint(string $typeHint): bool } /** - * @return string[] + * @return list */ public static function convertUnofficialUnionTypeHintToOfficialTypeHints(string $typeHint): array { @@ -127,7 +127,7 @@ public static function getFullyQualifiedTypeHint(File $phpcsFile, int $pointer, } /** - * @return string[] + * @return list */ public static function getSimpleTypeHints(): array { @@ -155,7 +155,7 @@ public static function getSimpleTypeHints(): array } /** - * @return string[] + * @return list */ public static function getSimpleIterableTypeHints(): array { @@ -185,6 +185,7 @@ public static function isSimpleUnofficialTypeHints(string $typeHint): bool 'callable-string', 'numeric-string', 'non-empty-string', + 'non-falsy-string', 'literal-string', 'array-key', 'list', @@ -200,7 +201,7 @@ public static function isSimpleUnofficialTypeHints(string $typeHint): bool } /** - * @param string[] $traversableTypeHints + * @param list $traversableTypeHints */ public static function isTraversableType(string $type, array $traversableTypeHints): bool { @@ -214,9 +215,9 @@ public static function typeHintEqualsAnnotation( string $typeHintInAnnotation ): bool { - /** @var string[] $typeHintParts */ + /** @var list $typeHintParts */ $typeHintParts = preg_split('~([&|])~', self::normalize($typeHint), -1, PREG_SPLIT_DELIM_CAPTURE); - /** @var string[] $typeHintInAnnotationParts */ + /** @var list $typeHintInAnnotationParts */ $typeHintInAnnotationParts = preg_split('~([&|])~', self::normalize($typeHintInAnnotation), -1, PREG_SPLIT_DELIM_CAPTURE); if (count($typeHintParts) !== count($typeHintInAnnotationParts)) { @@ -262,26 +263,23 @@ private static function isTemplate(File $phpcsFile, int $docCommentOpenPointer, if ($templateAnnotationNames === null) { foreach (['template', 'template-covariant'] as $annotationName) { $templateAnnotationNames[] = sprintf('@%s', $annotationName); - foreach (AnnotationHelper::PREFIXES as $prefixAnnotationName) { + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefixAnnotationName) { $templateAnnotationNames[] = sprintf('@%s-%s', $prefixAnnotationName, $annotationName); } } } $containsTypeHintInTemplateAnnotation = static function (int $docCommentOpenPointer) use ($phpcsFile, $templateAnnotationNames, $typeHint): bool { - $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); foreach ($templateAnnotationNames as $templateAnnotationName) { - if (!array_key_exists($templateAnnotationName, $annotations)) { - continue; - } + /** @var list> $annotations */ + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer, $templateAnnotationName); - /** @var TemplateAnnotation $templateAnnotation */ - foreach ($annotations[$templateAnnotationName] as $templateAnnotation) { + foreach ($annotations as $templateAnnotation) { if ($templateAnnotation->isInvalid()) { continue; } - if ($templateAnnotation->getTemplateName() === $typeHint) { + if ($templateAnnotation->getValue()->name === $typeHint) { return true; } } @@ -322,7 +320,7 @@ private static function isAlias(File $phpcsFile, int $docCommentOpenPointer, str static $aliasAnnotationNames = null; if ($aliasAnnotationNames === null) { foreach (['type', 'import-type'] as $annotationName) { - foreach (AnnotationHelper::PREFIXES as $prefixAnnotationName) { + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefixAnnotationName) { $aliasAnnotationNames[] = sprintf('@%s-%s', $prefixAnnotationName, $annotationName); } } @@ -339,19 +337,25 @@ private static function isAlias(File $phpcsFile, int $docCommentOpenPointer, str return false; } - $annotations = AnnotationHelper::getAnnotations($phpcsFile, $classDocCommentOpenPointer); foreach ($aliasAnnotationNames as $aliasAnnotationName) { - if (!array_key_exists($aliasAnnotationName, $annotations)) { - continue; - } + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $classDocCommentOpenPointer, $aliasAnnotationName); + + foreach ($annotations as $aliasAnnotation) { + $aliasAnnotationValue = $aliasAnnotation->getValue(); - /** @var TypeAliasAnnotation|TypeImportAnnotation $aliasAnnotation */ - foreach ($annotations[$aliasAnnotationName] as $aliasAnnotation) { - if ($aliasAnnotation->isInvalid()) { + if ($aliasAnnotationValue instanceof TypeAliasTagValueNode && $aliasAnnotationValue->alias === $typeHint) { + return true; + } + + if (!($aliasAnnotationValue instanceof TypeAliasImportTagValueNode)) { continue; } - if ($aliasAnnotation->getAlias() === $typeHint) { + if ($aliasAnnotationValue->importedAs === $typeHint) { + return true; + } + + if ($aliasAnnotationValue->importedAlias === $typeHint) { return true; } } @@ -370,7 +374,7 @@ private static function normalize(string $typeHint): string return 'never'; } - /** @var string[] $parts */ + /** @var list $parts */ $parts = preg_split('~([&|])~', $typeHint, -1, PREG_SPLIT_DELIM_CAPTURE); $hints = []; @@ -401,7 +405,7 @@ private static function normalize(string $typeHint): string if (count($convertedHints) > 1) { $convertedHints = array_map(static function (string $part): string { - return TypeHintHelper::isVoidTypeHint($part) ? 'null' : $part; + return self::isVoidTypeHint($part) ? 'null' : $part; }, $convertedHints); } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php index e0ca6a50d..bc6fdd1fd 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php @@ -174,7 +174,7 @@ public static function getUseStatementPointer(File $phpcsFile, int $pointer): ?i /** * Searches for all use statements in a file, skips bodies of classes and traits. * - * @return int[] + * @return list */ private static function getUseStatementPointers(File $phpcsFile, int $openTagPointer): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php index 30104c83a..9b0c3ad97 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php @@ -283,13 +283,13 @@ private static function replace(File $phpcsFile, array $oldTokens, array $newTok /** @var int $lastOldPointer */ $lastOldPointer = key($oldTokens); - FixerHelper::removeBetweenIncluding($phpcsFile, $firstOldPointer, $lastOldPointer); - - $phpcsFile->fixer->addContent($firstOldPointer, implode('', array_map(static function (array $token): string { + $content = implode('', array_map(static function (array $token): string { /** @var string $content */ $content = $token['content']; return $content; - }, $newTokens))); + }, $newTokens)); + + FixerHelper::change($phpcsFile, $firstOldPointer, $lastOldPointer, $content); } /** diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/AlphabeticallySortedByKeysSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/AlphabeticallySortedByKeysSniff.php new file mode 100644 index 000000000..27f47b01a --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/AlphabeticallySortedByKeysSniff.php @@ -0,0 +1,85 @@ + + */ + public function register(): array + { + return TokenHelper::$arrayTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPointer + */ + public function process(File $phpcsFile, $stackPointer): void + { + if (ArrayHelper::isMultiLine($phpcsFile, $stackPointer) === false) { + return; + } + + // "Parse" the array... get info for each key/value pair + $keyValues = ArrayHelper::parse($phpcsFile, $stackPointer); + + if (ArrayHelper::isKeyedAll($keyValues) === false) { + return; + } + + if (ArrayHelper::isSortedByKey($keyValues)) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Keyed multi-line arrays must be sorted alphabetically.', + $stackPointer, + self::CODE_INCORRECT_KEY_ORDER + ); + if ($fix) { + $this->fix($phpcsFile, $keyValues); + } + } + + /** + * @param list $keyValues + */ + private function fix(File $phpcsFile, array $keyValues): void + { + $pointerStart = $keyValues[0]->getPointerStart(); + $pointerEnd = $keyValues[count($keyValues) - 1]->getPointerEnd(); + + // determine indent to use + $indent = ArrayHelper::getIndentation($keyValues); + + usort($keyValues, static function ($a1, $a2) { + return strnatcasecmp((string) $a1->getKey(), (string) $a2->getKey()); + }); + + $content = implode('', array_map(static function (ArrayKeyValue $keyValue) use ($phpcsFile, $indent) { + return $keyValue->getContent($phpcsFile, true, $indent) . $phpcsFile->eolChar; + }, $keyValues)); + + $phpcsFile->fixer->beginChangeset(); + FixerHelper::change($phpcsFile, $pointerStart, $pointerEnd, $content); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/ArrayAccessSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/ArrayAccessSniff.php new file mode 100644 index 000000000..e5d9ffaaa --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/ArrayAccessSniff.php @@ -0,0 +1,76 @@ + + */ + public function register(): array + { + return [T_OPEN_SQUARE_BRACKET]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPointer + */ + public function process(File $phpcsFile, $stackPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $previousToken = TokenHelper::findPreviousNonWhitespace($phpcsFile, $stackPointer - 1); + + if ( + $previousToken === null + || $previousToken === $stackPointer - 1) { + return; + } + + if ($tokens[$previousToken]['code'] === T_VARIABLE) { + $this->addError( + $phpcsFile, + $stackPointer, + 'There should be no space between array variable and array access operator.', + self::CODE_NO_SPACE_BEFORE_BRACKETS + ); + } + + if ($tokens[$previousToken]['code'] !== T_CLOSE_SQUARE_BRACKET) { + return; + } + + $this->addError( + $phpcsFile, + $stackPointer, + 'There should be no space between array access operators.', + self::CODE_NO_SPACE_BETWEEN_BRACKETS + ); + } + + private function addError(File $phpcsFile, int $stackPointer, string $error, string $code): void + { + $fix = $phpcsFile->addFixableError($error, $stackPointer, $code); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($stackPointer - 1, ''); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowImplicitArrayCreationSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowImplicitArrayCreationSniff.php index 16246248a..e9f3cf643 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowImplicitArrayCreationSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowImplicitArrayCreationSniff.php @@ -49,8 +49,8 @@ public function process(File $phpcsFile, $bracketOpenerPointer): void { $tokens = $phpcsFile->getTokens(); - $assigmentPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$bracketOpenerPointer]['bracket_closer'] + 1); - if ($tokens[$assigmentPointer]['code'] !== T_EQUAL) { + $assignmentPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$bracketOpenerPointer]['bracket_closer'] + 1); + if ($tokens[$assignmentPointer]['code'] !== T_EQUAL) { return; } @@ -182,8 +182,8 @@ private function hasExplicitCreation(File $phpcsFile, int $scopeOpenerPointer, i continue; } - $assigmentPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); - if ($tokens[$assigmentPointer]['code'] === T_EQUAL) { + $assignmentPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + if ($tokens[$assignmentPointer]['code'] === T_EQUAL) { return true; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowPartiallyKeyedSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowPartiallyKeyedSniff.php new file mode 100644 index 000000000..28af0d876 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowPartiallyKeyedSniff.php @@ -0,0 +1,42 @@ + + */ + public function register(): array + { + return TokenHelper::$arrayTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPointer + */ + public function process(File $phpcsFile, $stackPointer): void + { + $keyValues = ArrayHelper::parse($phpcsFile, $stackPointer); + + if (!ArrayHelper::isKeyed($keyValues)) { + return; + } + + if (ArrayHelper::isKeyedAll($keyValues)) { + return; + } + + $phpcsFile->addError('Partially keyed array disallowed.', $stackPointer, self::CODE_DISALLOWED_PARTIALLY_KEYED); + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/MultiLineArrayEndBracketPlacementSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/MultiLineArrayEndBracketPlacementSniff.php index 0fb06bb13..46980e91a 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/MultiLineArrayEndBracketPlacementSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/MultiLineArrayEndBracketPlacementSniff.php @@ -4,8 +4,9 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use SlevomatCodingStandard\Helpers\ArrayHelper; use SlevomatCodingStandard\Helpers\TokenHelper; -use const T_OPEN_SHORT_ARRAY; +use function in_array; class MultiLineArrayEndBracketPlacementSniff implements Sniff { @@ -17,42 +18,43 @@ class MultiLineArrayEndBracketPlacementSniff implements Sniff */ public function register(): array { - return [T_OPEN_SHORT_ARRAY]; + return TokenHelper::$arrayTokenCodes; } /** * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @param int $arrayStart + * @param int $stackPointer */ - public function process(File $phpcsFile, $arrayStart): void + public function process(File $phpcsFile, $stackPointer): void { $tokens = $phpcsFile->getTokens(); - $arrayEnd = $tokens[$arrayStart]['bracket_closer']; - - if ($tokens[$arrayStart]['line'] === $tokens[$arrayEnd]['line']) { + if (ArrayHelper::isMultiLine($phpcsFile, $stackPointer) === false) { return; } - $nextArrayStart = TokenHelper::findNextEffective($phpcsFile, $arrayStart + 1, $arrayEnd); - if ($nextArrayStart === null || $tokens[$nextArrayStart]['code'] !== T_OPEN_SHORT_ARRAY) { + [$arrayOpenerPointer, $arrayCloserPointer] = ArrayHelper::openClosePointers($tokens[$stackPointer]); + + $nextEffective = TokenHelper::findNextEffective($phpcsFile, $arrayOpenerPointer + 1, $arrayCloserPointer); + if ($nextEffective === null || in_array($tokens[$nextEffective]['code'], TokenHelper::$arrayTokenCodes, true) === false) { return; } - $nextArrayEnd = $tokens[$nextArrayStart]['bracket_closer']; - $arraysStartAtSameLine = $tokens[$arrayStart]['line'] === $tokens[$nextArrayStart]['line']; - $arraysEndAtSameLine = $tokens[$arrayEnd]['line'] === $tokens[$nextArrayEnd]['line']; + [$nextPointerOpener, $nextPointerCloser] = ArrayHelper::openClosePointers($tokens[$nextEffective]); + + $arraysStartAtSameLine = $tokens[$arrayOpenerPointer]['line'] === $tokens[$nextPointerOpener]['line']; + $arraysEndAtSameLine = $tokens[$arrayCloserPointer]['line'] === $tokens[$nextPointerCloser]['line']; if (!$arraysStartAtSameLine || $arraysEndAtSameLine) { return; } $error = "Expected nested array to end at the same line as it's parent. Either put the nested array's end at the same line as the parent's end, or put the nested array start on it's own line."; - $fix = $phpcsFile->addFixableError($error, $arrayStart, self::CODE_ARRAY_END_WRONG_PLACEMENT); + $fix = $phpcsFile->addFixableError($error, $arrayOpenerPointer, self::CODE_ARRAY_END_WRONG_PLACEMENT); if (!$fix) { return; } - $phpcsFile->fixer->addContent($arrayStart, $phpcsFile->eolChar); + $phpcsFile->fixer->addContent($arrayOpenerPointer, $phpcsFile->eolChar); } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/SingleLineArrayWhitespaceSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/SingleLineArrayWhitespaceSniff.php index 599db73c6..98ce9ea62 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/SingleLineArrayWhitespaceSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/SingleLineArrayWhitespaceSniff.php @@ -4,13 +4,14 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use SlevomatCodingStandard\Helpers\ArrayHelper; use SlevomatCodingStandard\Helpers\SniffSettingsHelper; use SlevomatCodingStandard\Helpers\TokenHelper; +use function in_array; use function sprintf; use function str_repeat; use const T_COMMA; use const T_OPEN_PARENTHESIS; -use const T_OPEN_SHORT_ARRAY; use const T_WHITESPACE; class SingleLineArrayWhitespaceSniff implements Sniff @@ -33,7 +34,7 @@ class SingleLineArrayWhitespaceSniff implements Sniff */ public function register(): array { - return [T_OPEN_SHORT_ARRAY]; + return TokenHelper::$arrayTokenCodes; } /** @@ -46,30 +47,29 @@ public function process(File $phpcsFile, $stackPointer): int $tokens = $phpcsFile->getTokens(); - $arrayStart = $stackPointer; - $arrayEnd = $tokens[$stackPointer]['bracket_closer']; + [$arrayOpenerPointer, $arrayCloserPointer] = ArrayHelper::openClosePointers($tokens[$stackPointer]); // Check only single-line arrays. - if ($tokens[$arrayStart]['line'] !== $tokens[$arrayEnd]['line']) { - return $arrayEnd; + if ($tokens[$arrayOpenerPointer]['line'] !== $tokens[$arrayCloserPointer]['line']) { + return $arrayCloserPointer; } - $content = TokenHelper::findNextNonWhitespace($phpcsFile, $arrayStart + 1, $arrayEnd + 1); - if ($content === $arrayEnd) { + $pointerContent = TokenHelper::findNextNonWhitespace($phpcsFile, $arrayOpenerPointer + 1, $arrayCloserPointer + 1); + if ($pointerContent === $arrayCloserPointer) { // Empty array, but if the brackets aren't together, there's a problem. if ($this->enableEmptyArrayCheck) { - $this->checkWhitespaceInEmptyArray($phpcsFile, $arrayStart, $arrayEnd); + $this->checkWhitespaceInEmptyArray($phpcsFile, $arrayOpenerPointer, $arrayCloserPointer); } // We can return here because there is nothing else to check. // All code below can assume that the array is not empty. - return $arrayEnd + 1; + return $arrayCloserPointer + 1; } - $this->checkWhitespaceAfterOpeningBracket($phpcsFile, $arrayStart); - $this->checkWhitespaceBeforeClosingBracket($phpcsFile, $arrayEnd); + $this->checkWhitespaceAfterOpeningBracket($phpcsFile, $arrayOpenerPointer); + $this->checkWhitespaceBeforeClosingBracket($phpcsFile, $arrayCloserPointer); - for ($i = $arrayStart + 1; $i < $arrayEnd; $i++) { + for ($i = $arrayOpenerPointer + 1; $i < $arrayCloserPointer; $i++) { // Skip bracketed statements, like function calls. if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { $i = $tokens[$i]['parenthesis_closer']; @@ -78,8 +78,8 @@ public function process(File $phpcsFile, $stackPointer): int } // Skip nested arrays as they will be processed separately - if ($tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) { - $i = $tokens[$i]['bracket_closer']; + if (in_array($tokens[$i]['code'], TokenHelper::$arrayTokenCodes, true)) { + $i = ArrayHelper::openClosePointers($tokens[$i])[1]; continue; } @@ -89,16 +89,16 @@ public function process(File $phpcsFile, $stackPointer): int } // Before checking this comma, make sure we are not at the end of the array. - $next = TokenHelper::findNextNonWhitespace($phpcsFile, $i + 1, $arrayEnd); + $next = TokenHelper::findNextNonWhitespace($phpcsFile, $i + 1, $arrayCloserPointer); if ($next === null) { - return $arrayStart + 1; + return $arrayOpenerPointer + 1; } $this->checkWhitespaceBeforeComma($phpcsFile, $i); $this->checkWhitespaceAfterComma($phpcsFile, $i); } - return $arrayStart + 1; + return $arrayOpenerPointer + 1; } private function checkWhitespaceInEmptyArray(File $phpcsFile, int $arrayStart, int $arrayEnd): void diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/TrailingArrayCommaSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/TrailingArrayCommaSniff.php index e9d1721e7..3ced79010 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/TrailingArrayCommaSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/TrailingArrayCommaSniff.php @@ -4,13 +4,13 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use SlevomatCodingStandard\Helpers\ArrayHelper; use SlevomatCodingStandard\Helpers\SniffSettingsHelper; use SlevomatCodingStandard\Helpers\TokenHelper; use function in_array; use const T_COMMA; use const T_END_HEREDOC; use const T_END_NOWDOC; -use const T_OPEN_SHORT_ARRAY; class TrailingArrayCommaSniff implements Sniff { @@ -25,9 +25,7 @@ class TrailingArrayCommaSniff implements Sniff */ public function register(): array { - return [ - T_OPEN_SHORT_ARRAY, - ]; + return TokenHelper::$arrayTokenCodes; } /** @@ -39,35 +37,35 @@ public function process(File $phpcsFile, $stackPointer): void $this->enableAfterHeredoc = SniffSettingsHelper::isEnabledByPhpVersion($this->enableAfterHeredoc, 70300); $tokens = $phpcsFile->getTokens(); - $arrayToken = $tokens[$stackPointer]; - $closeParenthesisPointer = $arrayToken['bracket_closer']; - $openParenthesisToken = $tokens[$arrayToken['bracket_opener']]; - $closeParenthesisToken = $tokens[$closeParenthesisPointer]; - if ($openParenthesisToken['line'] === $closeParenthesisToken['line']) { + + [$arrayOpenerPointer, $arrayCloserPointer] = ArrayHelper::openClosePointers($tokens[$stackPointer]); + + if ($tokens[$arrayOpenerPointer]['line'] === $tokens[$arrayCloserPointer]['line']) { return; } - /** @var int $previousToCloseParenthesisPointer */ - $previousToCloseParenthesisPointer = TokenHelper::findPreviousEffective($phpcsFile, $closeParenthesisPointer - 1); - $previousToCloseParenthesisToken = $tokens[$previousToCloseParenthesisPointer]; + /** @var int $pointerPreviousToClose */ + $pointerPreviousToClose = TokenHelper::findPreviousEffective($phpcsFile, $arrayCloserPointer - 1); + $tokenPreviousToClose = $tokens[$pointerPreviousToClose]; + if ( - $previousToCloseParenthesisPointer === $arrayToken['bracket_opener'] - || $previousToCloseParenthesisToken['code'] === T_COMMA - || $closeParenthesisToken['line'] === $previousToCloseParenthesisToken['line'] + $pointerPreviousToClose === $arrayOpenerPointer + || $tokenPreviousToClose['code'] === T_COMMA + || $tokens[$arrayCloserPointer]['line'] === $tokenPreviousToClose['line'] ) { return; } if ( !$this->enableAfterHeredoc - && in_array($previousToCloseParenthesisToken['code'], [T_END_HEREDOC, T_END_NOWDOC], true) + && in_array($tokenPreviousToClose['code'], [T_END_HEREDOC, T_END_NOWDOC], true) ) { return; } $fix = $phpcsFile->addFixableError( 'Multi-line arrays must have a trailing comma after the last element.', - $previousToCloseParenthesisPointer, + $pointerPreviousToClose, self::CODE_MISSING_TRAILING_COMMA ); if (!$fix) { @@ -75,7 +73,7 @@ public function process(File $phpcsFile, $stackPointer): void } $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($previousToCloseParenthesisPointer, ','); + $phpcsFile->fixer->addContent($pointerPreviousToClose, ','); $phpcsFile->fixer->endChangeset(); } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributeAndTargetSpacingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributeAndTargetSpacingSniff.php index 3443db635..143391bd6 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributeAndTargetSpacingSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributeAndTargetSpacingSniff.php @@ -22,6 +22,9 @@ class AttributeAndTargetSpacingSniff implements Sniff /** @var int */ public $linesCount = 0; + /** @var bool */ + public $allowOnSameLine = false; + /** * @return array */ @@ -58,6 +61,10 @@ public function process(File $phpcsFile, $attributeOpenerPointer): void $areOnSameLine = $tokens[$pointerAfter]['line'] === $tokens[$attributeCloserPointer]['line']; if ($areOnSameLine) { + if ($this->allowOnSameLine) { + return; + } + $errorMessage = $this->linesCount === 1 ? 'Expected 1 blank line between attribute and its target, both are on same line.' : sprintf('Expected %1$d blank lines between attribute and its target, both are on same line.', $this->linesCount); diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/RequireAttributeAfterDocCommentSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/RequireAttributeAfterDocCommentSniff.php index e78063dd3..9729e99a9 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/RequireAttributeAfterDocCommentSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/RequireAttributeAfterDocCommentSniff.php @@ -65,7 +65,7 @@ public function process(File $phpcsFile, $attributeOpenerPointer): void $attributeStartPointer = TokenHelper::findFirstTokenOnLine($phpcsFile, $firstAttributeOpenerPointer); $fix = $phpcsFile->addFixableError( - 'Attribute should be placed before documentation comment.', + 'Attribute should be placed after documentation comment.', $attributeOpenerPointer, self::CODE_ATTRIBUTE_BEFORE_DOC_COMMENT ); diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyAndConstantSpacing.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyConstantAndEnumCaseSpacing.php similarity index 91% rename from app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyAndConstantSpacing.php rename to app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyConstantAndEnumCaseSpacing.php index cdacd0c50..eeb2f68c3 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyAndConstantSpacing.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyConstantAndEnumCaseSpacing.php @@ -15,6 +15,7 @@ use const T_COMMENT; use const T_CONST; use const T_DOC_COMMENT_OPEN_TAG; +use const T_ENUM_CASE; use const T_FUNCTION; use const T_PRIVATE; use const T_PROTECTED; @@ -29,7 +30,7 @@ /** * @internal */ -abstract class AbstractPropertyAndConstantSpacing implements Sniff +abstract class AbstractPropertyConstantAndEnumCaseSpacing implements Sniff { /** @var int */ @@ -69,7 +70,11 @@ public function process(File $phpcsFile, $pointer): int $firstOnLinePointer = TokenHelper::findFirstTokenOnNextLine($phpcsFile, $semicolonPointer); assert($firstOnLinePointer !== null); - $nextFunctionPointer = TokenHelper::findNext($phpcsFile, [T_FUNCTION, T_CONST, T_VARIABLE, T_USE], $firstOnLinePointer + 1); + $nextFunctionPointer = TokenHelper::findNext( + $phpcsFile, + [T_FUNCTION, T_ENUM_CASE, T_CONST, T_VARIABLE, T_USE], + $firstOnLinePointer + 1 + ); if ( $nextFunctionPointer === null || $tokens[$nextFunctionPointer]['code'] === T_FUNCTION @@ -78,7 +83,7 @@ public function process(File $phpcsFile, $pointer): int return $nextFunctionPointer ?? $firstOnLinePointer; } - $types = [T_COMMENT, T_DOC_COMMENT_OPEN_TAG, T_ATTRIBUTE, T_CONST, T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_READONLY, T_STATIC, T_USE]; + $types = [T_COMMENT, T_DOC_COMMENT_OPEN_TAG, T_ATTRIBUTE, T_ENUM_CASE, T_CONST, T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_READONLY, T_STATIC, T_USE]; $nextPointer = TokenHelper::findNext($phpcsFile, $types, $firstOnLinePointer + 1, $tokens[$classPointer]['scope_closer']); if (!$this->isNextMemberValid($phpcsFile, $nextPointer)) { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassConstantVisibilitySniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassConstantVisibilitySniff.php index 07d1553e1..0f375d9f7 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassConstantVisibilitySniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassConstantVisibilitySniff.php @@ -4,22 +4,18 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; use SlevomatCodingStandard\Helpers\ClassHelper; use SlevomatCodingStandard\Helpers\TokenHelper; use function array_keys; use function count; use function in_array; use function sprintf; -use const T_ANON_CLASS; -use const T_CLASS; use const T_CONST; -use const T_ENUM; use const T_FINAL; -use const T_INTERFACE; use const T_PRIVATE; use const T_PROTECTED; use const T_PUBLIC; -use const T_TRAIT; class ClassConstantVisibilitySniff implements Sniff { @@ -53,7 +49,7 @@ public function process(File $phpcsFile, $constantPointer): void /** @var int $classPointer */ $classPointer = array_keys($tokens[$constantPointer]['conditions'])[count($tokens[$constantPointer]['conditions']) - 1]; - if (!in_array($tokens[$classPointer]['code'], [T_CLASS, T_INTERFACE, T_ANON_CLASS, T_ENUM, T_TRAIT], true)) { + if (!in_array($tokens[$classPointer]['code'], Tokens::$ooScopeTokens, true)) { return; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassStructureSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassStructureSniff.php index a2537d261..e01288ba7 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassStructureSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassStructureSniff.php @@ -180,7 +180,7 @@ class ClassStructureSniff implements Sniff '__debuginfo' => self::GROUP_MAGIC_METHODS, ]; - /** @var string[] */ + /** @var list */ public $groups = []; /** @var array|null */ @@ -448,7 +448,7 @@ private function isStaticConstructor(File $phpcsFile, int $pointer): bool return false; } - return in_array($returnAnnotation->getContent(), ['static', 'self', $parentClassName], true); + return in_array((string) $returnAnnotation->getValue()->type, ['static', 'self', $parentClassName], true); } private function getParentClassName(File $phpcsFile, int $pointer): string @@ -518,6 +518,8 @@ private function findGroupEndPointer(File $phpcsFile, int $memberPointer): int if ($tokens[$memberPointer]['code'] === T_FUNCTION && !FunctionHelper::isAbstract($phpcsFile, $memberPointer)) { $endPointer = $tokens[$memberPointer]['scope_closer']; + } elseif ($tokens[$memberPointer]['code'] === T_USE && array_key_exists('scope_closer', $tokens[$memberPointer])) { + $endPointer = $tokens[$memberPointer]['scope_closer']; } else { $endPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $memberPointer + 1); assert($endPointer !== null); @@ -586,7 +588,7 @@ private function getNormalizedGroups(): array $normalizedGroupsWithShortcuts = []; $order = 1; foreach (SniffSettingsHelper::normalizeArray($this->groups) as $groupsString) { - /** @var string[] $groups */ + /** @var list $groups */ $groups = preg_split('~\\s*,\\s*~', strtolower($groupsString)); foreach ($groups as $groupOrShortcut) { $groupOrShortcut = preg_replace('~\\s+~', ' ', $groupOrShortcut); diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ConstantSpacingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ConstantSpacingSniff.php index 46d999132..d4038e26a 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ConstantSpacingSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ConstantSpacingSniff.php @@ -3,22 +3,18 @@ namespace SlevomatCodingStandard\Sniffs\Classes; use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; use SlevomatCodingStandard\Helpers\TokenHelper; use function array_keys; use function count; use function in_array; use function sprintf; -use const T_ANON_CLASS; -use const T_CLASS; use const T_CONST; -use const T_ENUM; use const T_FUNCTION; -use const T_INTERFACE; -use const T_TRAIT; use const T_USE; use const T_VARIABLE; -class ConstantSpacingSniff extends AbstractPropertyAndConstantSpacing +class ConstantSpacingSniff extends AbstractPropertyConstantAndEnumCaseSpacing { public const CODE_INCORRECT_COUNT_OF_BLANK_LINES_AFTER_CONSTANT = 'IncorrectCountOfBlankLinesAfterConstant'; @@ -45,7 +41,7 @@ public function process(File $phpcsFile, $constantPointer): int /** @var int $classPointer */ $classPointer = array_keys($tokens[$constantPointer]['conditions'])[count($tokens[$constantPointer]['conditions']) - 1]; - if (!in_array($tokens[$classPointer]['code'], [T_CLASS, T_INTERFACE, T_ANON_CLASS, T_ENUM, T_TRAIT], true)) { + if (!in_array($tokens[$classPointer]['code'], Tokens::$ooScopeTokens, true)) { return $constantPointer; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowStringExpressionPropertyFetchSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowStringExpressionPropertyFetchSniff.php new file mode 100644 index 000000000..d34e68400 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowStringExpressionPropertyFetchSniff.php @@ -0,0 +1,84 @@ + + */ + public function register(): array + { + return [T_OBJECT_OPERATOR]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $objectOperatorPointer + */ + public function process(File $phpcsFile, $objectOperatorPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $curlyBracketOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $objectOperatorPointer + 1); + + if ($tokens[$curlyBracketOpenerPointer]['code'] !== T_OPEN_CURLY_BRACKET) { + return; + } + + $curlyBracketCloserPointer = $tokens[$curlyBracketOpenerPointer]['bracket_closer']; + + if (TokenHelper::findNextExcluding( + $phpcsFile, + T_CONSTANT_ENCAPSED_STRING, + $curlyBracketOpenerPointer + 1, + $curlyBracketCloserPointer + ) !== null) { + return; + } + + $pointerAfterCurlyBracketCloser = TokenHelper::findNextEffective($phpcsFile, $curlyBracketCloserPointer + 1); + + if ($tokens[$pointerAfterCurlyBracketCloser]['code'] === T_OPEN_PARENTHESIS) { + return; + } + + if (preg_match( + '~^(["\'])([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\1$~', + $tokens[$curlyBracketOpenerPointer + 1]['content'], + $matches + ) !== 1) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'String expression property fetch is disallowed, use identifier property fetch.', + $curlyBracketOpenerPointer, + self::CODE_DISALLOWED_STRING_EXPRESSION_PROPERTY_FETCH + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $curlyBracketOpenerPointer, $curlyBracketCloserPointer, $matches[2]); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EnumCaseSpacingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EnumCaseSpacingSniff.php new file mode 100644 index 000000000..286d6ec27 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EnumCaseSpacingSniff.php @@ -0,0 +1,54 @@ + + */ + public function register(): array + { + return [T_ENUM_CASE]; + } + + protected function isNextMemberValid(File $phpcsFile, int $pointer): bool + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$pointer]['code'] === T_ENUM_CASE) { + return true; + } + + $nextPointer = TokenHelper::findNext($phpcsFile, [T_FUNCTION, T_CONST, T_VARIABLE, T_USE, T_ENUM_CASE], $pointer + 1); + + return $tokens[$nextPointer]['code'] === T_ENUM_CASE; + } + + protected function addError(File $phpcsFile, int $pointer, int $minExpectedLines, int $maxExpectedLines, int $found): bool + { + if ($minExpectedLines === $maxExpectedLines) { + $errorMessage = $minExpectedLines === 1 + ? 'Expected 1 blank line after enum case, found %3$d.' + : 'Expected %2$d blank lines after enum case, found %3$d.'; + } else { + $errorMessage = 'Expected %1$d to %2$d blank lines after enum case, found %3$d.'; + } + $error = sprintf($errorMessage, $minExpectedLines, $maxExpectedLines, $found); + + return $phpcsFile->addFixableError($error, $pointer, self::CODE_INCORRECT_COUNT_OF_BLANK_LINES_AFTER_ENUM_CASE); + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ForbiddenPublicPropertySniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ForbiddenPublicPropertySniff.php index ce53dec7e..58636062b 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ForbiddenPublicPropertySniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ForbiddenPublicPropertySniff.php @@ -65,7 +65,7 @@ private function isSniffClass(File $file, int $position): bool /** * @phpcsSuppress SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint - * @return mixed[] + * @return array{code: int|string} */ private function getPropertyScopeModifier(File $file, int $position): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MissingClassGroupsException.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MissingClassGroupsException.php index e8153d050..2faddecc9 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MissingClassGroupsException.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MissingClassGroupsException.php @@ -9,7 +9,7 @@ class MissingClassGroupsException extends Exception { - /** @param string[] $groups */ + /** @param list $groups */ public function __construct(array $groups) { parent::__construct( diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ModernClassNameReferenceSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ModernClassNameReferenceSniff.php index 62fda5259..e58a453db 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ModernClassNameReferenceSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ModernClassNameReferenceSniff.php @@ -169,9 +169,8 @@ private function checkFunctionCall(File $phpcsFile, int $functionPointer): void if ($tokens[$functionPointer - 1]['code'] === T_NS_SEPARATOR) { $phpcsFile->fixer->replaceToken($functionPointer - 1, ''); } - $phpcsFile->fixer->replaceToken($functionPointer, $fixedContent); - FixerHelper::removeBetweenIncluding($phpcsFile, $functionPointer + 1, $tokens[$openParenthesisPointer]['parenthesis_closer']); + FixerHelper::change($phpcsFile, $functionPointer, $tokens[$openParenthesisPointer]['parenthesis_closer'], $fixedContent); $phpcsFile->fixer->endChangeset(); } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ParentCallSpacingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ParentCallSpacingSniff.php index 03141982d..2755349bc 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ParentCallSpacingSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ParentCallSpacingSniff.php @@ -15,6 +15,7 @@ use const T_COLON; use const T_INLINE_ELSE; use const T_INLINE_THEN; +use const T_MATCH_ARROW; use const T_OPEN_SHORT_ARRAY; use const T_RETURN; use const T_STRING_CONCAT; @@ -62,7 +63,7 @@ public function process(File $phpcsFile, $parentPointer): void Tokens::$assignmentTokens, Tokens::$equalityTokens, Tokens::$booleanOperators, - [T_RETURN, T_YIELD, T_YIELD_FROM, T_COLON, T_STRING_CONCAT, T_INLINE_THEN, T_INLINE_ELSE, T_COALESCE] + [T_RETURN, T_YIELD, T_YIELD_FROM, T_COLON, T_STRING_CONCAT, T_INLINE_THEN, T_INLINE_ELSE, T_COALESCE, T_MATCH_ARROW] ); if (in_array($tokens[$previousPointer]['code'], $tokensToIgnore, true)) { return; @@ -77,7 +78,7 @@ public function process(File $phpcsFile, $parentPointer): void } /** - * @return string[] + * @return list */ protected function getSupportedKeywords(): array { @@ -85,7 +86,7 @@ protected function getSupportedKeywords(): array } /** - * @return string[] + * @return list */ protected function getKeywordsToCheck(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertyDeclarationSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertyDeclarationSniff.php index b1f347be7..48dd3ccbf 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertyDeclarationSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertyDeclarationSniff.php @@ -53,7 +53,7 @@ class PropertyDeclarationSniff implements Sniff public const CODE_MULTIPLE_SPACES_BETWEEN_MODIFIERS = 'MultipleSpacesBetweenModifiers'; - /** @var string[]|null */ + /** @var list|null */ public $modifiersOrder = []; /** @var bool */ @@ -193,9 +193,7 @@ private function checkModifiersOrder(File $phpcsFile, int $propertyPointer, int $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($firstModifierPointer, $expectedModifiersFormatted); - - FixerHelper::removeBetweenIncluding($phpcsFile, $firstModifierPointer + 1, $lastModifierPointer); + FixerHelper::change($phpcsFile, $firstModifierPointer, $lastModifierPointer, $expectedModifiersFormatted); $phpcsFile->fixer->endChangeset(); } @@ -253,9 +251,7 @@ private function checkSpacesBetweenModifiers( $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($firstModifierPointer, $expectedModifiersFormatted); - - FixerHelper::removeBetweenIncluding($phpcsFile, $firstModifierPointer + 1, $lastModifierPointer); + FixerHelper::change($phpcsFile, $firstModifierPointer, $lastModifierPointer, $expectedModifiersFormatted); $phpcsFile->fixer->endChangeset(); } @@ -386,7 +382,7 @@ private function getNormalizedModifiersOrder(): array foreach ($modifiersGroups as $modifiersGroupNo => $modifiersGroup) { $this->normalizedModifiersOrder[$modifiersGroupNo] = []; - /** @var string[] $modifiers */ + /** @var list $modifiers */ $modifiers = preg_split('~\\s*,\\s*~', strtolower($modifiersGroup)); foreach ($modifiers as $modifier) { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertySpacingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertySpacingSniff.php index c76782407..e7adf9697 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertySpacingSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertySpacingSniff.php @@ -19,7 +19,7 @@ use const T_VAR; use const T_VARIABLE; -class PropertySpacingSniff extends AbstractPropertyAndConstantSpacing +class PropertySpacingSniff extends AbstractPropertyConstantAndEnumCaseSpacing { public const CODE_INCORRECT_COUNT_OF_BLANK_LINES_AFTER_PROPERTY = 'IncorrectCountOfBlankLinesAfterProperty'; diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php index f079acd31..d1736c8aa 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php @@ -5,7 +5,7 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; use PHP_CodeSniffer\Util\Tokens; -use SlevomatCodingStandard\Helpers\Annotation\VariableAnnotation; +use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode; use SlevomatCodingStandard\Helpers\AnnotationHelper; use SlevomatCodingStandard\Helpers\DocCommentHelper; use SlevomatCodingStandard\Helpers\FixerHelper; @@ -158,7 +158,7 @@ public function process(File $phpcsFile, $functionPointer): void continue; } - if ($this->isParameterModifiedBeforeAssigment($phpcsFile, $functionPointer, $parameterName, $assignmentPointer)) { + if ($this->isParameterModifiedBeforeAssignment($phpcsFile, $functionPointer, $parameterName, $assignmentPointer)) { continue; } @@ -280,7 +280,7 @@ private function getAssignment(File $phpcsFile, int $constructorPointer, string } /** - * @return int[] + * @return list */ private function getParameterPointers(File $phpcsFile, int $functionPointer): array { @@ -294,7 +294,7 @@ private function getParameterPointers(File $phpcsFile, int $functionPointer): ar } /** - * @return int[] + * @return list */ private function getPropertyPointers(File $phpcsFile, int $classPointer): array { @@ -319,16 +319,14 @@ private function isPropertyDocCommentUseful(File $phpcsFile, int $propertyPointe return true; } - foreach (AnnotationHelper::getAnnotations($phpcsFile, $propertyPointer) as $annotationType => $annotations) { - if ($annotationType !== '@var') { + foreach (AnnotationHelper::getAnnotations($phpcsFile, $propertyPointer) as $annotation) { + $annotationValue = $annotation->getValue(); + if (!$annotationValue instanceof VarTagValueNode) { return true; } - /** @var VariableAnnotation $annotation */ - foreach ($annotations as $annotation) { - if ($annotation->hasDescription()) { - return true; - } + if ($annotationValue->description !== '') { + return true; } } @@ -361,16 +359,16 @@ private function areTypeHintEqual(?TypeHint $parameterTypeHint, ?TypeHint $prope return $parameterTypeHint->getTypeHint() === $propertyTypeHint->getTypeHint(); } - private function isParameterModifiedBeforeAssigment( + private function isParameterModifiedBeforeAssignment( File $phpcsFile, int $functionPointer, string $parameterName, - int $assigmentPointer + int $assignmentPointer ): bool { $tokens = $phpcsFile->getTokens(); - for ($i = $assigmentPointer - 1; $i > $tokens[$functionPointer]['scope_opener']; $i--) { + for ($i = $assignmentPointer - 1; $i > $tokens[$functionPointer]['scope_opener']; $i--) { if ($tokens[$i]['code'] !== T_VARIABLE) { continue; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireMultiLineMethodSignatureSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireMultiLineMethodSignatureSniff.php index c3a6bbcc1..abac22a86 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireMultiLineMethodSignatureSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireMultiLineMethodSignatureSniff.php @@ -9,6 +9,7 @@ use SlevomatCodingStandard\Helpers\IndentationHelper; use SlevomatCodingStandard\Helpers\SniffSettingsHelper; use SlevomatCodingStandard\Helpers\TokenHelper; +use UnexpectedValueException; use function count; use function preg_match; use function sprintf; @@ -19,20 +20,24 @@ class RequireMultiLineMethodSignatureSniff extends AbstractMethodSignature { public const CODE_REQUIRED_MULTI_LINE_SIGNATURE = 'RequiredMultiLineSignature'; + private const DEFAULT_MIN_LINE_LENGTH = 121; - /** @var int */ - public $minLineLength = 121; + /** @var int|null */ + public $minLineLength = null; - /** @var string[] */ + /** @var int|null */ + public $minParametersCount = null; + + /** @var list */ public $includedMethodPatterns = []; - /** @var string[]|null */ + /** @var list|null */ public $includedMethodNormalizedPatterns; - /** @var string[] */ + /** @var list */ public $excludedMethodPatterns = []; - /** @var string[]|null */ + /** @var list|null */ public $excludedMethodNormalizedPatterns; /** @@ -41,7 +46,17 @@ class RequireMultiLineMethodSignatureSniff extends AbstractMethodSignature */ public function process(File $phpcsFile, $methodPointer): void { - $this->minLineLength = SniffSettingsHelper::normalizeInteger($this->minLineLength); + $this->minLineLength = SniffSettingsHelper::normalizeNullableInteger($this->minLineLength); + $this->minParametersCount = SniffSettingsHelper::normalizeNullableInteger($this->minParametersCount); + + if ($this->minLineLength !== null && $this->minParametersCount !== null) { + throw new UnexpectedValueException('Either minLineLength or minParametersCount can be set.'); + } + + // Maintain backward compatibility if no configuration provided + if ($this->minLineLength === null && $this->minParametersCount === null) { + $this->minLineLength = self::DEFAULT_MIN_LINE_LENGTH; + } if (!FunctionHelper::isMethod($phpcsFile, $methodPointer)) { return; @@ -56,7 +71,8 @@ public function process(File $phpcsFile, $methodPointer): void } $parameters = $phpcsFile->getMethodParameters($methodPointer); - if (count($parameters) === 0) { + $parametersCount = count($parameters); + if ($parametersCount === 0) { return; } @@ -78,7 +94,11 @@ public function process(File $phpcsFile, $methodPointer): void return; } - if ($this->minLineLength !== 0 && strlen($signatureWithoutTabIndentation) < $this->minLineLength) { + if ($this->minLineLength !== null && $this->minLineLength !== 0 && strlen($signatureWithoutTabIndentation) < $this->minLineLength) { + return; + } + + if ($this->minParametersCount !== null && $parametersCount < $this->minParametersCount) { return; } @@ -114,7 +134,7 @@ public function process(File $phpcsFile, $methodPointer): void } /** - * @param string[] $normalizedPatterns + * @param list $normalizedPatterns */ private function isMethodNameInPatterns(string $methodName, array $normalizedPatterns): bool { @@ -132,7 +152,7 @@ private function isMethodNameInPatterns(string $methodName, array $normalizedPat } /** - * @return string[] + * @return list */ private function getIncludedMethodNormalizedPatterns(): array { @@ -143,7 +163,7 @@ private function getIncludedMethodNormalizedPatterns(): array } /** - * @return string[] + * @return list */ private function getExcludedMethodNormalizedPatterns(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSelfReferenceSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSelfReferenceSniff.php new file mode 100644 index 000000000..50c7b3332 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSelfReferenceSniff.php @@ -0,0 +1,118 @@ + + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $referencedNames = array_merge( + ReferencedNameHelper::getAllReferencedNames($phpcsFile, $openTagPointer), + ReferencedNameHelper::getAllReferencedNamesInAttributes($phpcsFile, $openTagPointer) + ); + + foreach ($referencedNames as $referencedName) { + if (!$referencedName->isClass()) { + continue; + } + + $anonymousClassPointer = TokenHelper::findPrevious($phpcsFile, T_ANON_CLASS, $referencedName->getStartPointer() - 1); + + if ( + $anonymousClassPointer !== null + && $tokens[$anonymousClassPointer]['scope_closer'] > $referencedName->getEndPointer() + ) { + continue; + } + + $classPointer = ClassHelper::getClassPointer($phpcsFile, $referencedName->getStartPointer()); + if ($classPointer === null) { + continue; + } + + $className = ClassHelper::getFullyQualifiedName($phpcsFile, $classPointer); + + $resolvedName = NamespaceHelper::resolveClassName( + $phpcsFile, + $referencedName->getNameAsReferencedInFile(), + $referencedName->getStartPointer() + ); + + if ($className !== $resolvedName) { + continue; + } + + $fix = $phpcsFile->addFixableError( + '"self" for local reference is required.', + $referencedName->getStartPointer(), + self::CODE_REQUIRED_SELF_REFERENCE + ); + if (!$fix) { + continue; + } + + $inAttribute = $tokens[$referencedName->getStartPointer()]['code'] === T_ATTRIBUTE; + + $phpcsFile->fixer->beginChangeset(); + + if ($inAttribute) { + $attributeContent = TokenHelper::getContent( + $phpcsFile, + $referencedName->getStartPointer(), + $referencedName->getEndPointer() + ); + $fixedAttributeContent = preg_replace( + '~(?<=\W)' . preg_quote($referencedName->getNameAsReferencedInFile(), '~') . '(?=\W)~', + 'self', + $attributeContent + ); + $phpcsFile->fixer->replaceToken($referencedName->getStartPointer(), $fixedAttributeContent); + + } else { + $phpcsFile->fixer->replaceToken($referencedName->getStartPointer(), 'self'); + } + + FixerHelper::removeBetweenIncluding($phpcsFile, $referencedName->getStartPointer() + 1, $referencedName->getEndPointer()); + + $phpcsFile->fixer->endChangeset(); + } + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSingleLineMethodSignatureSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSingleLineMethodSignatureSniff.php index 30f40c530..4a2342ead 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSingleLineMethodSignatureSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSingleLineMethodSignatureSniff.php @@ -20,16 +20,16 @@ class RequireSingleLineMethodSignatureSniff extends AbstractMethodSignature /** @var int */ public $maxLineLength = 120; - /** @var string[] */ + /** @var list */ public $includedMethodPatterns = []; - /** @var string[]|null */ + /** @var list|null */ public $includedMethodNormalizedPatterns; - /** @var string[] */ + /** @var list */ public $excludedMethodPatterns = []; - /** @var string[]|null */ + /** @var list|null */ public $excludedMethodNormalizedPatterns; /** @@ -82,15 +82,13 @@ public function process(File $phpcsFile, $methodPointer): void $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($signatureStartPointer, $signature); - - FixerHelper::removeBetweenIncluding($phpcsFile, $signatureStartPointer + 1, $signatureEndPointer); + FixerHelper::change($phpcsFile, $signatureStartPointer, $signatureEndPointer, $signature); $phpcsFile->fixer->endChangeset(); } /** - * @param string[] $normalizedPatterns + * @param list $normalizedPatterns */ private function isMethodNameInPatterns(string $methodName, array $normalizedPatterns): bool { @@ -108,7 +106,7 @@ private function isMethodNameInPatterns(string $methodName, array $normalizedPat } /** - * @return string[] + * @return list */ private function getIncludedMethodNormalizedPatterns(): array { @@ -119,7 +117,7 @@ private function getIncludedMethodNormalizedPatterns(): array } /** - * @return string[] + * @return list */ private function getExcludedMethodNormalizedPatterns(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseDeclarationSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseDeclarationSniff.php index c454a9330..0ed15b4e1 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseDeclarationSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseDeclarationSniff.php @@ -91,9 +91,8 @@ private function checkDeclaration(File $phpcsFile, int $usePointer): void $otherCommaPointers = TokenHelper::findNextAll($phpcsFile, T_COMMA, $usePointer + 1, $endPointer); foreach ($otherCommaPointers as $otherCommaPointer) { $pointerAfterComma = TokenHelper::findNextEffective($phpcsFile, $otherCommaPointer + 1); - $phpcsFile->fixer->replaceToken($otherCommaPointer, ';' . $phpcsFile->eolChar . $indentation . 'use '); - FixerHelper::removeBetween($phpcsFile, $otherCommaPointer, $pointerAfterComma); + FixerHelper::change($phpcsFile, $otherCommaPointer, $pointerAfterComma - 1, ';' . $phpcsFile->eolChar . $indentation . 'use '); } $phpcsFile->fixer->endChangeset(); diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseSpacingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseSpacingSniff.php index 5380d9a8e..0a4f4ef71 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseSpacingSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseSpacingSniff.php @@ -212,7 +212,7 @@ private function checkLinesAfterLastUse(File $phpcsFile, int $lastUsePointer): v } /** - * @param int[] $usePointers + * @param list $usePointers */ private function checkLinesBetweenUses(File $phpcsFile, array $usePointers): void { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AnnotationNameSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AnnotationNameSniff.php new file mode 100644 index 000000000..26c223418 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AnnotationNameSniff.php @@ -0,0 +1,299 @@ +|null */ + public $annotations; + + /** @var array|null */ + private $normalizedAnnotations; + + /** + * @return array + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + $correctAnnotationNames = $this->getNormalizedAnnotationNames(); + + foreach ($annotations as $annotation) { + $lowerCasedAnnotationName = strtolower($annotation->getName()); + + if (!array_key_exists($lowerCasedAnnotationName, $correctAnnotationNames)) { + continue; + } + + $correctAnnotationName = $correctAnnotationNames[$lowerCasedAnnotationName]; + + if ($correctAnnotationName === $annotation->getName()) { + continue; + } + + $annotationNameWithoutAtSign = ltrim($annotation->getName(), '@'); + $fullyQualifiedAnnotationName = NamespaceHelper::resolveClassName( + $phpcsFile, + $annotationNameWithoutAtSign, + $annotation->getStartPointer() + ); + + if (NamespaceHelper::normalizeToCanonicalName($fullyQualifiedAnnotationName) !== $annotationNameWithoutAtSign) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Annotation name is incorrect. Expected %s, found %s.', $correctAnnotationName, $annotation->getName()), + $annotation->getStartPointer(), + self::CODE_ANNOTATION_NAME_INCORRECT + ); + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($annotation->getStartPointer(), $correctAnnotationName); + + $phpcsFile->fixer->endChangeset(); + } + + $tokens = $phpcsFile->getTokens(); + + $docCommentContent = TokenHelper::getContent($phpcsFile, $docCommentOpenPointer, $tokens[$docCommentOpenPointer]['comment_closer']); + + if (preg_match_all( + '~\{(' . implode('|', $correctAnnotationNames) . ')\}~i', + $docCommentContent, + $matches, + PREG_OFFSET_CAPTURE + ) === 0) { + return; + } + + foreach ($matches[1] as $match) { + $correctAnnotationName = $correctAnnotationNames[strtolower($match[0])]; + + if ($correctAnnotationName === $match[0]) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Annotation name is incorrect. Expected %s, found %s.', $correctAnnotationName, $match[0]), + $docCommentOpenPointer, + self::CODE_ANNOTATION_NAME_INCORRECT + ); + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + $fixedDocCommentContent = substr($docCommentContent, 0, $match[1]) . $correctAnnotationName . substr( + $docCommentContent, + $match[1] + strlen($match[0]) + ); + + FixerHelper::change( + $phpcsFile, + $docCommentOpenPointer, + $tokens[$docCommentOpenPointer]['comment_closer'], + $fixedDocCommentContent + ); + + $phpcsFile->fixer->endChangeset(); + } + } + + /** + * @return array + */ + private function getNormalizedAnnotationNames(): array + { + if ($this->normalizedAnnotations !== null) { + return $this->normalizedAnnotations; + } + + if ($this->annotations !== null) { + $annotationNames = array_map(static function (string $annotationName): string { + return ltrim($annotationName, '@'); + }, SniffSettingsHelper::normalizeArray($this->annotations)); + } else { + $annotationNames = array_merge(self::STANDARD_ANNOTATIONS, self::PHPUNIT_ANNOTATIONS, self::STATIC_ANALYSIS_ANNOTATIONS); + + foreach (self::STATIC_ANALYSIS_ANNOTATIONS as $annotationName) { + if (strpos($annotationName, 'psalm') === 0) { + continue; + } + + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefix) { + $annotationNames[] = sprintf('%s-%s', $prefix, $annotationName); + } + } + } + + $annotationNames = array_map(static function (string $annotationName): string { + return '@' . $annotationName; + }, array_unique($annotationNames)); + + $this->normalizedAnnotations = array_combine(array_map(static function (string $annotationName): string { + return strtolower($annotationName); + }, $annotationNames), $annotationNames); + + return $this->normalizedAnnotations; + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DeprecatedAnnotationDeclarationSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DeprecatedAnnotationDeclarationSniff.php index c2e3335f7..633403d2b 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DeprecatedAnnotationDeclarationSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DeprecatedAnnotationDeclarationSniff.php @@ -4,7 +4,8 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; -use SlevomatCodingStandard\Helpers\Annotation\GenericAnnotation; +use PHPStan\PhpDocParser\Ast\PhpDoc\DeprecatedTagValueNode; +use SlevomatCodingStandard\Helpers\Annotation; use SlevomatCodingStandard\Helpers\AnnotationHelper; use function count; use const T_DOC_COMMENT_OPEN_TAG; @@ -26,15 +27,15 @@ public function register(): array */ public function process(File $phpcsFile, $docCommentStartPointer): void { - /** @var GenericAnnotation[] $annotations */ - $annotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $docCommentStartPointer, '@deprecated'); + /** @var list> $annotations */ + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentStartPointer, '@deprecated'); if (count($annotations) === 0) { return; } foreach ($annotations as $annotation) { - if ($annotation->getContent() !== null) { + if ($annotation->getValue()->description !== '') { continue; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowCommentAfterCodeSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowCommentAfterCodeSniff.php index 9d910b5a6..b7ae8c53f 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowCommentAfterCodeSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowCommentAfterCodeSniff.php @@ -42,13 +42,24 @@ public function register(): array */ public function process(File $phpcsFile, $commentPointer): void { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$commentPointer]['column'] === 1) { + return; + } + $firstNonWhitespacePointerOnLine = TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $commentPointer); if ($firstNonWhitespacePointerOnLine === $commentPointer) { return; } - $tokens = $phpcsFile->getTokens(); + if ( + $tokens[$firstNonWhitespacePointerOnLine]['code'] === T_DOC_COMMENT_OPEN_TAG + && $tokens[$firstNonWhitespacePointerOnLine]['comment_closer'] > $commentPointer + ) { + return; + } $commentEndPointer = CommentHelper::getCommentEndPointer($phpcsFile, $commentPointer); $nextNonWhitespacePointer = TokenHelper::findNextNonWhitespace($phpcsFile, $commentEndPointer + 1); diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowOneLinePropertyDocCommentSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowOneLinePropertyDocCommentSniff.php index 43c431022..bbb4e8102 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowOneLinePropertyDocCommentSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowOneLinePropertyDocCommentSniff.php @@ -18,7 +18,7 @@ class DisallowOneLinePropertyDocCommentSniff implements Sniff public const CODE_ONE_LINE_PROPERTY_COMMENT = 'OneLinePropertyComment'; /** - * @return int[] + * @return list */ public function register(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DocCommentSpacingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DocCommentSpacingSniff.php index 2b6c657d7..f2ac58b73 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DocCommentSpacingSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DocCommentSpacingSniff.php @@ -4,7 +4,7 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; -use SlevomatCodingStandard\Helpers\Annotation\Annotation; +use SlevomatCodingStandard\Helpers\Annotation; use SlevomatCodingStandard\Helpers\AnnotationHelper; use SlevomatCodingStandard\Helpers\DocCommentHelper; use SlevomatCodingStandard\Helpers\FixerHelper; @@ -17,7 +17,6 @@ use function array_key_exists; use function array_keys; use function array_map; -use function array_merge; use function array_values; use function asort; use function count; @@ -32,11 +31,9 @@ use function substr; use function substr_count; use function trim; -use function uasort; use function usort; use const T_DOC_COMMENT_OPEN_TAG; use const T_DOC_COMMENT_STAR; -use const T_DOC_COMMENT_STRING; use const T_DOC_COMMENT_WHITESPACE; class DocCommentSpacingSniff implements Sniff @@ -66,10 +63,10 @@ class DocCommentSpacingSniff implements Sniff /** @var int */ public $linesCountAfterLastContent = 0; - /** @var string[] */ + /** @var list */ public $annotationsGroups = []; - /** @var string[][]|null */ + /** @var array>|null */ private $normalizedAnnotationsGroups = null; /** @@ -104,45 +101,40 @@ public function process(File $phpcsFile, $docCommentOpenerPointer): void $tokens = $phpcsFile->getTokens(); - $firstContentStartPointer = TokenHelper::findNextExcluding( + if (TokenHelper::findNextExcluding( $phpcsFile, [T_DOC_COMMENT_WHITESPACE, T_DOC_COMMENT_STAR], $docCommentOpenerPointer + 1, $tokens[$docCommentOpenerPointer]['comment_closer'] - ); - - if ($firstContentStartPointer === null) { + ) === null) { return; } - $firstContentEndPointer = $firstContentStartPointer; - $actualPointer = $firstContentStartPointer; - do { - /** @var int $actualPointer */ - $actualPointer = TokenHelper::findNextExcluding( - $phpcsFile, - [T_DOC_COMMENT_STAR, T_DOC_COMMENT_WHITESPACE], - $actualPointer + 1, - $tokens[$docCommentOpenerPointer]['comment_closer'] + 1 - ); + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenerPointer); - if ($tokens[$actualPointer]['code'] !== T_DOC_COMMENT_STRING) { - break; - } + if ($parsedDocComment === null) { + return; + } - $firstContentEndPointer = $actualPointer; - } while (true); + $firstContentStartPointer = $parsedDocComment->getNodeStartPointer($phpcsFile, $parsedDocComment->getNode()->children[0]); + $firstContentEndPointer = $parsedDocComment->getNodeEndPointer( + $phpcsFile, + $parsedDocComment->getNode()->children[0], + $firstContentStartPointer + ); - $annotations = array_merge([], ...array_values(AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenerPointer))); - uasort($annotations, static function (Annotation $a, Annotation $b): int { - return $a->getStartPointer() <=> $b->getEndPointer(); + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenerPointer); + usort($annotations, static function (Annotation $a, Annotation $b): int { + return $a->getStartPointer() <=> $b->getStartPointer(); }); - $annotations = array_values($annotations); $annotationsCount = count($annotations); - $firstAnnotation = $annotationsCount > 0 ? $annotations[0] : null; + $firstAnnotationPointer = $annotationsCount > 0 ? $annotations[0]->getStartPointer() : null; - $lastContentEndPointer = $annotationsCount > 0 ? $annotations[$annotationsCount - 1]->getEndPointer() : $firstContentEndPointer; + /** @var int $lastContentEndPointer */ + $lastContentEndPointer = $annotationsCount > 0 + ? $annotations[$annotationsCount - 1]->getEndPointer() + : $firstContentEndPointer; $this->checkLinesBeforeFirstContent($phpcsFile, $docCommentOpenerPointer, $firstContentStartPointer); $this->checkLinesBetweenDescriptionAndFirstAnnotation( @@ -150,7 +142,7 @@ public function process(File $phpcsFile, $docCommentOpenerPointer): void $docCommentOpenerPointer, $firstContentStartPointer, $firstContentEndPointer, - $firstAnnotation + $firstAnnotationPointer ); if (count($annotations) > 1) { @@ -200,9 +192,7 @@ private function checkLinesBeforeFirstContent(File $phpcsFile, int $docCommentOp $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($docCommentOpenerPointer, '/**' . $phpcsFile->eolChar); - - FixerHelper::removeBetween($phpcsFile, $docCommentOpenerPointer, $firstContentStartPointer); + FixerHelper::change($phpcsFile, $docCommentOpenerPointer, $firstContentStartPointer - 1, '/**' . $phpcsFile->eolChar); for ($i = 1; $i <= $this->linesCountBeforeFirstContent; $i++) { $phpcsFile->fixer->addContent($docCommentOpenerPointer, sprintf('%s *%s', $indentation, $phpcsFile->eolChar)); @@ -218,14 +208,14 @@ private function checkLinesBetweenDescriptionAndFirstAnnotation( int $docCommentOpenerPointer, int $firstContentStartPointer, int $firstContentEndPointer, - ?Annotation $firstAnnotation + ?int $firstAnnotationPointer ): void { - if ($firstAnnotation === null) { + if ($firstAnnotationPointer === null) { return; } - if ($firstContentStartPointer === $firstAnnotation->getStartPointer()) { + if ($firstContentStartPointer === $firstAnnotationPointer) { return; } @@ -237,7 +227,7 @@ private function checkLinesBetweenDescriptionAndFirstAnnotation( $whitespaceBetweenDescriptionAndFirstAnnotation .= TokenHelper::getContent( $phpcsFile, $firstContentEndPointer + 1, - $firstAnnotation->getStartPointer() - 1 + $firstAnnotationPointer - 1 ); $linesCountBetweenDescriptionAndAnnotations = max( @@ -255,7 +245,7 @@ private function checkLinesBetweenDescriptionAndFirstAnnotation( $this->linesCountBetweenDescriptionAndAnnotations === 1 ? '' : 's', $linesCountBetweenDescriptionAndAnnotations ), - $firstAnnotation->getStartPointer(), + $firstAnnotationPointer, self::CODE_INCORRECT_LINES_COUNT_BETWEEN_DESCRIPTION_AND_ANNOTATIONS ); @@ -269,24 +259,22 @@ private function checkLinesBetweenDescriptionAndFirstAnnotation( $phpcsFile->fixer->addNewline($firstContentEndPointer); - FixerHelper::removeBetween($phpcsFile, $firstContentEndPointer, $firstAnnotation->getStartPointer()); + FixerHelper::removeBetween($phpcsFile, $firstContentEndPointer, $firstAnnotationPointer); for ($i = 1; $i <= $this->linesCountBetweenDescriptionAndAnnotations; $i++) { $phpcsFile->fixer->addContent($firstContentEndPointer, sprintf('%s *%s', $indentation, $phpcsFile->eolChar)); } - $phpcsFile->fixer->addContentBefore($firstAnnotation->getStartPointer(), $indentation . ' * '); + $phpcsFile->fixer->addContentBefore($firstAnnotationPointer, $indentation . ' * '); $phpcsFile->fixer->endChangeset(); } /** - * @param Annotation[] $annotations + * @param list $annotations */ private function checkLinesBetweenDifferentAnnotationsTypes(File $phpcsFile, int $docCommentOpenerPointer, array $annotations): void { - $tokens = $phpcsFile->getTokens(); - $indentation = IndentationHelper::getIndentation($phpcsFile, $docCommentOpenerPointer); $previousAnnotation = null; @@ -301,16 +289,13 @@ private function checkLinesBetweenDifferentAnnotationsTypes(File $phpcsFile, int continue; } - preg_match('~(\\s+)$~', $tokens[$previousAnnotation->getEndPointer()]['content'], $matches); - - $linesCountAfterPreviousAnnotation = $matches[1] ?? ''; - $linesCountAfterPreviousAnnotation .= TokenHelper::getContent( + $whitespaceAfterPreviousAnnotation = TokenHelper::getContent( $phpcsFile, $previousAnnotation->getEndPointer() + 1, $annotation->getStartPointer() - 1 ); - $linesCountAfterPreviousAnnotation = max(substr_count($linesCountAfterPreviousAnnotation, $phpcsFile->eolChar) - 1, 0); + $linesCountAfterPreviousAnnotation = max(substr_count($whitespaceAfterPreviousAnnotation, $phpcsFile->eolChar) - 1, 0); if ($linesCountAfterPreviousAnnotation === $this->linesCountBetweenDifferentAnnotationsTypes) { $previousAnnotation = $annotation; @@ -335,10 +320,10 @@ private function checkLinesBetweenDifferentAnnotationsTypes(File $phpcsFile, int $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($previousAnnotation->getEndPointer()); - FixerHelper::removeBetween($phpcsFile, $previousAnnotation->getEndPointer(), $annotation->getStartPointer()); + $phpcsFile->fixer->addNewline($previousAnnotation->getEndPointer()); + for ($i = 1; $i <= $this->linesCountBetweenDifferentAnnotationsTypes; $i++) { $phpcsFile->fixer->addContent($previousAnnotation->getEndPointer(), sprintf('%s *%s', $indentation, $phpcsFile->eolChar)); } @@ -346,11 +331,13 @@ private function checkLinesBetweenDifferentAnnotationsTypes(File $phpcsFile, int $phpcsFile->fixer->addContentBefore($annotation->getStartPointer(), $indentation . ' * '); $phpcsFile->fixer->endChangeset(); + + $previousAnnotation = $annotation; } } /** - * @param Annotation[] $annotations + * @param list $annotations */ private function checkAnnotationsGroups(File $phpcsFile, int $docCommentOpenerPointer, array $annotations): void { @@ -383,7 +370,7 @@ private function checkAnnotationsGroups(File $phpcsFile, int $docCommentOpenerPo } /** - * @param Annotation[][] $annotationsGroups + * @param list> $annotationsGroups */ private function checkLinesBetweenAnnotationsGroups(File $phpcsFile, int $docCommentOpenerPointer, array $annotationsGroups): void { @@ -396,7 +383,6 @@ private function checkLinesBetweenAnnotationsGroups(File $phpcsFile, int $docCom continue; } - /** @var Annotation $lastAnnotationInPreviousGroup */ $lastAnnotationInPreviousGroup = $previousAnnotationsGroup[count($previousAnnotationsGroup) - 1]; $firstAnnotationInActualGroup = $annotationsGroup[0]; @@ -451,8 +437,8 @@ private function checkLinesBetweenAnnotationsGroups(File $phpcsFile, int $docCom } /** - * @param Annotation[][] $annotationsGroups - * @param Annotation[] $annotations + * @param list> $annotationsGroups + * @param list $annotations */ private function checkAnnotationsGroupsOrder( File $phpcsFile, @@ -461,11 +447,11 @@ private function checkAnnotationsGroupsOrder( array $annotations ): void { - $equals = static function (array $firstAnnotationsGroup, array $secondAnnotationsGroup): bool { - $getAnnotationsPointers = static function (Annotation $annotation): int { - return $annotation->getStartPointer(); - }; + $getAnnotationsPointers = static function (Annotation $annotation): int { + return $annotation->getStartPointer(); + }; + $equals = static function (array $firstAnnotationsGroup, array $secondAnnotationsGroup) use ($getAnnotationsPointers): bool { $firstAnnotationsPointers = array_map($getAnnotationsPointers, $firstAnnotationsGroup); $secondAnnotationsPointers = array_map($getAnnotationsPointers, $secondAnnotationsGroup); @@ -525,16 +511,16 @@ private function checkAnnotationsGroupsOrder( if (!$incorrectAnnotationsGroupsExist) { foreach ($undefinedAnnotationsGroups as $undefinedAnnotationsGroupPosition) { - $annotationsGroupsPositions[$undefinedAnnotationsGroupPosition] = (count($annotationsGroupsPositions) > 0 ? max( - $annotationsGroupsPositions - ) : 0) + 1; + $annotationsGroupsPositions[$undefinedAnnotationsGroupPosition] = (count($annotationsGroupsPositions) > 0 + ? max($annotationsGroupsPositions) + : 0) + 1; } ksort($annotationsGroupsPositions); $positionsMappedToGroups = array_keys($annotationsGroupsPositions); $tmp = array_values($annotationsGroupsPositions); asort($tmp); - /** @var int[] $normalizedAnnotationsGroupsPositions */ + /** @var list $normalizedAnnotationsGroupsPositions */ $normalizedAnnotationsGroupsPositions = array_combine(array_keys($positionsMappedToGroups), array_keys($tmp)); foreach ($normalizedAnnotationsGroupsPositions as $normalizedAnnotationsGroupPosition => $sortedAnnotationsGroupPosition) { @@ -630,22 +616,24 @@ private function checkAnnotationsGroupsOrder( } $phpcsFile->fixer->beginChangeset(); - if ($endOfLineBeforeFirstAnnotation === null) { - $phpcsFile->fixer->replaceToken($docCommentOpenerPointer, '/**' . $phpcsFile->eolChar . $fixedAnnotations); - - FixerHelper::removeBetweenIncluding($phpcsFile, $docCommentOpenerPointer + 1, $docCommentContentEndPointer); + if ($endOfLineBeforeFirstAnnotation === null) { + FixerHelper::change( + $phpcsFile, + $docCommentOpenerPointer, + $docCommentContentEndPointer, + '/**' . $phpcsFile->eolChar . $fixedAnnotations + ); } else { - $phpcsFile->fixer->replaceToken($endOfLineBeforeFirstAnnotation + 1, $fixedAnnotations); - - FixerHelper::removeBetweenIncluding($phpcsFile, $endOfLineBeforeFirstAnnotation + 2, $docCommentContentEndPointer); + FixerHelper::change($phpcsFile, $endOfLineBeforeFirstAnnotation + 1, $docCommentContentEndPointer, $fixedAnnotations); } + $phpcsFile->fixer->endChangeset(); } /** - * @param Annotation[] $annotations - * @return Annotation[][] + * @param list $annotations + * @return list> */ private function sortAnnotationsToGroups(array $annotations): array { @@ -762,10 +750,10 @@ private function checkLinesAfterLastContent( $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($lastContentEndPointer); - FixerHelper::removeBetween($phpcsFile, $lastContentEndPointer, $docCommentCloserPointer); + $phpcsFile->fixer->addNewline($lastContentEndPointer); + for ($i = 1; $i <= $this->linesCountAfterLastContent; $i++) { $phpcsFile->fixer->addContent($lastContentEndPointer, sprintf('%s *%s', $indentation, $phpcsFile->eolChar)); } @@ -776,7 +764,7 @@ private function checkLinesAfterLastContent( } /** - * @return string[][] + * @return array> */ private function getAnnotationsGroups(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenAnnotationsSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenAnnotationsSniff.php index de8c24d5b..bbce185bc 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenAnnotationsSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenAnnotationsSniff.php @@ -22,10 +22,10 @@ class ForbiddenAnnotationsSniff implements Sniff public const CODE_ANNOTATION_FORBIDDEN = 'AnnotationForbidden'; - /** @var string[] */ + /** @var list */ public $forbiddenAnnotations = []; - /** @var string[]|null */ + /** @var list|null */ private $normalizedForbiddenAnnotations; /** @@ -48,80 +48,78 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); - foreach ($annotations as $annotationName => $annotationsByName) { - if (!in_array($annotationName, $this->getNormalizedForbiddenAnnotations(), true)) { + foreach ($annotations as $annotation) { + if (!in_array($annotation->getName(), $this->getNormalizedForbiddenAnnotations(), true)) { continue; } - foreach ($annotationsByName as $annotation) { - $fix = $phpcsFile->addFixableError( - sprintf('Use of annotation %s is forbidden.', $annotationName), - $annotation->getStartPointer(), - self::CODE_ANNOTATION_FORBIDDEN - ); - if (!$fix) { - continue; - } + $fix = $phpcsFile->addFixableError( + sprintf('Use of annotation %s is forbidden.', $annotation->getName()), + $annotation->getStartPointer(), + self::CODE_ANNOTATION_FORBIDDEN + ); + if (!$fix) { + continue; + } - $starPointer = TokenHelper::findPrevious( - $phpcsFile, - T_DOC_COMMENT_STAR, - $annotation->getStartPointer() - 1, - $docCommentOpenPointer - ); - $annotationStartPointer = $starPointer ?? $docCommentOpenPointer + 1; + $starPointer = TokenHelper::findPrevious( + $phpcsFile, + T_DOC_COMMENT_STAR, + $annotation->getStartPointer() - 1, + $docCommentOpenPointer + ); + $annotationStartPointer = $starPointer ?? $annotation->getStartPointer(); + + /** @var int $nextPointer */ + $nextPointer = TokenHelper::findNext( + $phpcsFile, + [T_DOC_COMMENT_TAG, T_DOC_COMMENT_CLOSE_TAG], + $annotation->getEndPointer() + 1 + ); + if ($tokens[$nextPointer]['code'] === T_DOC_COMMENT_TAG) { + $nextPointer = TokenHelper::findPrevious($phpcsFile, T_DOC_COMMENT_STAR, $nextPointer - 1); + } + $annotationEndPointer = $nextPointer - 1; - /** @var int $nextPointer */ - $nextPointer = TokenHelper::findNext( + if ($tokens[$nextPointer]['code'] === T_DOC_COMMENT_CLOSE_TAG && $starPointer !== null) { + $pointerBeforeWhitespace = TokenHelper::findPreviousExcluding( $phpcsFile, - [T_DOC_COMMENT_TAG, T_DOC_COMMENT_CLOSE_TAG], - $annotation->getEndPointer() + 1 + [T_DOC_COMMENT_WHITESPACE, T_DOC_COMMENT_STAR], + $annotationStartPointer - 1 ); - if ($tokens[$nextPointer]['code'] === T_DOC_COMMENT_TAG) { - $nextPointer = TokenHelper::findPrevious($phpcsFile, T_DOC_COMMENT_STAR, $nextPointer - 1); - } - $annotationEndPointer = $nextPointer - 1; - - if ($tokens[$nextPointer]['code'] === T_DOC_COMMENT_CLOSE_TAG && $starPointer !== null) { - $pointerBeforeWhitespace = TokenHelper::findPreviousExcluding( - $phpcsFile, - [T_DOC_COMMENT_WHITESPACE, T_DOC_COMMENT_STAR], - $annotationStartPointer - 1 - ); - /** @var int $annotationStartPointer */ - $annotationStartPointer = TokenHelper::findNext($phpcsFile, T_DOC_COMMENT_STAR, $pointerBeforeWhitespace + 1); - } - - $phpcsFile->fixer->beginChangeset(); + /** @var int $annotationStartPointer */ + $annotationStartPointer = TokenHelper::findNext($phpcsFile, T_DOC_COMMENT_STAR, $pointerBeforeWhitespace + 1); + } - FixerHelper::removeBetweenIncluding($phpcsFile, $annotationStartPointer, $annotationEndPointer); + $phpcsFile->fixer->beginChangeset(); - $docCommentUseful = false; - $docCommentClosePointer = $tokens[$docCommentOpenPointer]['comment_closer']; - for ($i = $docCommentOpenPointer + 1; $i < $docCommentClosePointer; $i++) { - $tokenContent = trim($phpcsFile->fixer->getTokenContent($i)); - if ($tokenContent === '' || $tokenContent === '*') { - continue; - } + FixerHelper::removeBetweenIncluding($phpcsFile, $annotationStartPointer, $annotationEndPointer); - $docCommentUseful = true; - break; + $docCommentUseful = false; + $docCommentClosePointer = $tokens[$docCommentOpenPointer]['comment_closer']; + for ($i = $docCommentOpenPointer + 1; $i < $docCommentClosePointer; $i++) { + $tokenContent = trim($phpcsFile->fixer->getTokenContent($i)); + if ($tokenContent === '' || $tokenContent === '*') { + continue; } - if (!$docCommentUseful) { - /** @var int $nextPointerAfterDocComment */ - $nextPointerAfterDocComment = TokenHelper::findNextEffective($phpcsFile, $docCommentClosePointer + 1); + $docCommentUseful = true; + break; + } - FixerHelper::removeBetweenIncluding($phpcsFile, $docCommentOpenPointer, $nextPointerAfterDocComment - 1); - } + if (!$docCommentUseful) { + /** @var int $nextPointerAfterDocComment */ + $nextPointerAfterDocComment = TokenHelper::findNextEffective($phpcsFile, $docCommentClosePointer + 1); - $phpcsFile->fixer->endChangeset(); + FixerHelper::removeBetweenIncluding($phpcsFile, $docCommentOpenPointer, $nextPointerAfterDocComment - 1); } + + $phpcsFile->fixer->endChangeset(); } } /** - * @return string[] + * @return list */ private function getNormalizedForbiddenAnnotations(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenCommentsSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenCommentsSniff.php index c27206ebd..f89881ab3 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenCommentsSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenCommentsSniff.php @@ -20,7 +20,7 @@ class ForbiddenCommentsSniff implements Sniff public const CODE_COMMENT_FORBIDDEN = 'CommentForbidden'; - /** @var string[] */ + /** @var list */ public $forbiddenCommentPatterns = []; /** @@ -85,7 +85,7 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void $docCommentContent = ''; for ($i = $docCommentOpenPointer + 1; $i < $tokens[$docCommentOpenPointer]['comment_closer']; $i++) { - /** @var string|(string|int)[] $token */ + /** @var string|array<(string|int)> $token */ $token = $phpcsFile->fixer->getTokenContent($i); $docCommentContent .= is_array($token) ? $token['content'] : $token; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/InlineDocCommentDeclarationSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/InlineDocCommentDeclarationSniff.php index 24209ace7..ebdd43e64 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/InlineDocCommentDeclarationSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/InlineDocCommentDeclarationSniff.php @@ -4,7 +4,8 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; -use SlevomatCodingStandard\Helpers\Annotation\VariableAnnotation; +use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode; +use SlevomatCodingStandard\Helpers\Annotation; use SlevomatCodingStandard\Helpers\AnnotationHelper; use SlevomatCodingStandard\Helpers\FixerHelper; use SlevomatCodingStandard\Helpers\PropertyHelper; @@ -111,8 +112,8 @@ public function process(File $phpcsFile, $commentOpenPointer): void return; } - /** @var list $annotations */ - $annotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $commentOpenPointer, '@var'); + /** @var list> $annotations */ + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $commentOpenPointer, '@var'); if ($annotations === []) { return; @@ -153,23 +154,24 @@ private function checkCommentType(File $phpcsFile, int $commentOpenPointer): voi } /** - * @param list $annotations + * @param list> $annotations */ private function checkFormat(File $phpcsFile, array $annotations): void { foreach ($annotations as $annotation) { - if (!$annotation->isInvalid() && $annotation->getVariableName() !== null) { + if (!$annotation->isInvalid() && $annotation->getValue()->variableName !== '') { continue; } - $annotationContent = $annotation->getContent(); + $variableName = '$variableName'; + + $annotationContent = (string) $annotation->getValue(); - $variableName = '$variable'; $type = null; if ( - $annotationContent !== null - && preg_match('~(\$\w+)(?:\s+(.+))?$~i', $annotation->getContent(), $matches) === 1 + $annotationContent !== '' + && preg_match('~(\$\w+)(?:\s+(.+))?$~i', $annotationContent, $matches) === 1 ) { $variableName = $matches[1]; $type = $matches[2] ?? null; @@ -182,7 +184,7 @@ private function checkFormat(File $phpcsFile, array $annotations): void $phpcsFile->addError( sprintf( 'Invalid inline documentation comment format "@var %1$s", expected "@var type %2$s Optional description".', - $annotation->getContent(), + $annotationContent, $variableName ), $annotation->getStartPointer(), @@ -195,7 +197,7 @@ private function checkFormat(File $phpcsFile, array $annotations): void $fix = $phpcsFile->addFixableError( sprintf( 'Invalid inline documentation comment format "@var %1$s", expected "@var %2$s %3$s".', - $annotation->getContent(), + $annotationContent, $type, $variableName ), @@ -225,7 +227,7 @@ private function checkFormat(File $phpcsFile, array $annotations): void } /** - * @param list $annotations + * @param list> $annotations */ private function checkVariable(File $phpcsFile, array $annotations, int $docCommentOpenerPointer, int $docCommentCloserPointer): void { @@ -240,8 +242,8 @@ private function checkVariable(File $phpcsFile, array $annotations, int $docComm continue; } - $variableName = $variableAnnotation->getVariableName(); - if ($variableName === null) { + $variableName = $variableAnnotation->getValue()->variableName; + if ($variableName === '') { continue; } @@ -304,8 +306,8 @@ private function checkVariable(File $phpcsFile, array $annotations, int $docComm continue; } - $variableName = $variableAnnotation->getVariableName(); - if ($variableName === null) { + $variableName = $variableAnnotation->getValue()->variableName; + if ($variableName === '') { continue; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessFunctionDocCommentSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessFunctionDocCommentSniff.php index f93be54e7..502b058ec 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessFunctionDocCommentSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessFunctionDocCommentSniff.php @@ -22,7 +22,7 @@ class UselessFunctionDocCommentSniff implements Sniff public const CODE_USELESS_DOC_COMMENT = 'UselessDocComment'; - /** @var string[] */ + /** @var list */ public $traversableTypeHints = []; /** @var array|null */ @@ -91,7 +91,7 @@ public function process(File $phpcsFile, $functionPointer): void } } - foreach (AnnotationHelper::getAnnotations($phpcsFile, $functionPointer) as [$annotation]) { + foreach (AnnotationHelper::getAnnotations($phpcsFile, $functionPointer) as $annotation) { if (!in_array($annotation->getName(), ['@param', '@return'], true)) { return; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Complexity/CognitiveSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Complexity/CognitiveSniff.php index 630c36dd0..a42830ad3 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Complexity/CognitiveSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Complexity/CognitiveSniff.php @@ -101,8 +101,17 @@ class CognitiveSniff implements Sniff T_BREAK => T_BREAK, ]; - /** @var int */ - public $maxComplexity = 5; + /** + * @deprecated + * @var ?int maximum allowed complexity + */ + public $maxComplexity = null; + + /** @var int complexity which will raise warning */ + public $warningThreshold = 6; + + /** @var int complexity which will raise error */ + public $errorThreshold = 6; /** @var int */ private $cognitiveComplexity = 0; @@ -136,24 +145,34 @@ public function process(File $phpcsFile, $stackPtr): void return; } + if ($this->maxComplexity !== null) { + // maxComplexity is deprecated... if set use it + $this->warningThreshold = $this->maxComplexity + 1; + $this->errorThreshold = $this->maxComplexity + 1; + } + $cognitiveComplexity = $this->computeForFunctionFromTokensAndPosition($stackPtr); - if ($cognitiveComplexity <= $this->maxComplexity) { + if ($cognitiveComplexity < $this->warningThreshold) { return; } $name = $phpcsFile->getDeclarationName($stackPtr); - $phpcsFile->addError( + $errorParameters = [ 'Cognitive complexity for "%s" is %d but has to be less than or equal to %d.', $stackPtr, self::CODE_COMPLEXITY, [ $name, $cognitiveComplexity, - $this->maxComplexity, - ] - ); + $this->warningThreshold - 1, + ], + ]; + + $cognitiveComplexity >= $this->errorThreshold + ? $phpcsFile->addError(...$errorParameters) + : $phpcsFile->addWarning(...$errorParameters); } public function computeForFunctionFromTokensAndPosition(int $position): int diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractControlStructureSpacing.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractControlStructureSpacing.php index 3b6934e38..2c1bb8077 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractControlStructureSpacing.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractControlStructureSpacing.php @@ -81,16 +81,16 @@ abstract class AbstractControlStructureSpacing implements Sniff protected const KEYWORD_YIELD = 'yield'; protected const KEYWORD_YIELD_FROM = 'yield_from'; - /** @var (string|int)[]|null */ + /** @var array<(string|int)>|null */ private $tokensToCheck; /** - * @return string[] + * @return list */ abstract protected function getSupportedKeywords(): array; /** - * @return string[] + * @return list */ abstract protected function getKeywordsToCheck(): array; @@ -217,7 +217,9 @@ protected function checkLinesBefore(File $phpcsFile, int $controlStructurePointe $phpcsFile->fixer->replaceToken($pointerBefore, ' */ public $checkedControlStructures = [ self::IF_CONTROL_STRUCTURE, self::WHILE_CONTROL_STRUCTURE, @@ -89,9 +89,9 @@ protected function isPartOfDo(File $phpcsFile, int $whilePointer): bool $tokens = $phpcsFile->getTokens(); $parenthesisCloserPointer = $tokens[$whilePointer]['parenthesis_closer']; - $pointerAfterParentesisCloser = TokenHelper::findNextEffective($phpcsFile, $parenthesisCloserPointer + 1); + $pointerAfterParenthesisCloser = TokenHelper::findNextEffective($phpcsFile, $parenthesisCloserPointer + 1); - return $tokens[$pointerAfterParentesisCloser]['code'] !== T_OPEN_CURLY_BRACKET; + return $tokens[$pointerAfterParenthesisCloser]['code'] !== T_OPEN_CURLY_BRACKET; } protected function getLineStart(File $phpcsFile, int $pointer): string diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/BlockControlStructureSpacingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/BlockControlStructureSpacingSniff.php index 457ba62b2..ab7821ab1 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/BlockControlStructureSpacingSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/BlockControlStructureSpacingSniff.php @@ -25,7 +25,7 @@ class BlockControlStructureSpacingSniff extends AbstractControlStructureSpacing /** @var int */ public $linesCountAfterLast = 0; - /** @var string[] */ + /** @var list */ public $controlStructures = []; /** @@ -47,7 +47,7 @@ public function process(File $phpcsFile, $controlStructurePointer): void } /** - * @return string[] + * @return list */ protected function getSupportedKeywords(): array { @@ -65,7 +65,7 @@ protected function getSupportedKeywords(): array } /** - * @return string[] + * @return list */ protected function getKeywordsToCheck(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowTrailingMultiLineTernaryOperatorSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowTrailingMultiLineTernaryOperatorSniff.php new file mode 100644 index 000000000..f37763053 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowTrailingMultiLineTernaryOperatorSniff.php @@ -0,0 +1,88 @@ + + */ + public function register(): array + { + return [ + T_INLINE_THEN, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $inlineThenPointer + */ + public function process(File $phpcsFile, $inlineThenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $inlineThenPointer + 1); + if ($tokens[$nextPointer]['code'] === T_INLINE_ELSE) { + return; + } + + if ($tokens[$inlineThenPointer]['line'] === $tokens[$nextPointer]['line']) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Ternary operator should be reformatted as leading the line.', + $inlineThenPointer, + self::CODE_TRAILING_MULTI_LINE_TERNARY_OPERATOR_USED + ); + + if (!$fix) { + return; + } + + $inlineElsePointer = TernaryOperatorHelper::getElsePointer($phpcsFile, $inlineThenPointer); + + $pointerBeforeInlineThen = TokenHelper::findPreviousEffective($phpcsFile, $inlineThenPointer - 1); + $pointerAfterInlineThen = TokenHelper::findNextExcluding($phpcsFile, [T_WHITESPACE], $inlineThenPointer + 1); + $pointerBeforeInlineElse = TokenHelper::findPreviousEffective($phpcsFile, $inlineElsePointer - 1); + $pointerAfterInlineElse = TokenHelper::findNextExcluding($phpcsFile, [T_WHITESPACE], $inlineElsePointer + 1); + + $indentation = IndentationHelper::addIndentation( + IndentationHelper::getIndentation( + $phpcsFile, + TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $inlineThenPointer) + ) + ); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeInlineThen, $inlineThenPointer); + FixerHelper::removeBetween($phpcsFile, $inlineThenPointer, $pointerAfterInlineThen); + + $phpcsFile->fixer->addContentBefore($inlineThenPointer, $phpcsFile->eolChar . $indentation); + $phpcsFile->fixer->addContentBefore($pointerAfterInlineThen, ' '); + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeInlineElse, $inlineElsePointer); + FixerHelper::removeBetween($phpcsFile, $inlineElsePointer, $pointerAfterInlineElse); + + $phpcsFile->fixer->addContentBefore($inlineElsePointer, $phpcsFile->eolChar . $indentation); + $phpcsFile->fixer->addContentBefore($pointerAfterInlineElse, ' '); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/EarlyExitSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/EarlyExitSniff.php index b0dbf4ecc..fd33700a3 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/EarlyExitSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/EarlyExitSniff.php @@ -156,34 +156,17 @@ private function processElse(File $phpcsFile, int $elsePointer): void IndentationHelper::getIndentation($phpcsFile, $ifPointer) ); + $ifContent = sprintf('if %s {%s}%s%s', $negativeIfCondition, $elseCode, $phpcsFile->eolChar, $afterIfCode); + $phpcsFile->fixer->beginChangeset(); - FixerHelper::removeBetweenIncluding($phpcsFile, $ifPointer, $tokens[$elsePointer]['scope_closer']); - - $phpcsFile->fixer->addContent( - $ifPointer, - sprintf( - 'if %s {%s}%s%s', - $negativeIfCondition, - $elseCode, - $phpcsFile->eolChar, - $afterIfCode - ) - ); + FixerHelper::change($phpcsFile, $ifPointer, $tokens[$elsePointer]['scope_closer'], $ifContent); $phpcsFile->fixer->endChangeset(); return; } - $pointerAfterElseCondition = TokenHelper::findNextEffective($phpcsFile, $tokens[$elsePointer]['scope_closer'] + 1); - if ( - $pointerAfterElseCondition !== null - && $tokens[$pointerAfterElseCondition]['code'] !== T_CLOSE_CURLY_BRACKET - ) { - return; - } - $fix = $phpcsFile->addFixableError('Remove useless "else" to reduce code nesting.', $elsePointer, self::CODE_USELESS_ELSE); if (!$fix) { @@ -199,19 +182,13 @@ private function processElse(File $phpcsFile, int $elsePointer): void $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken( - $tokens[$previousConditionPointer]['scope_closer'] + 1, - sprintf( - '%s%s', - $phpcsFile->eolChar, - $afterIfCode - ) - ); + $previousConditionContent = sprintf('%s%s', $phpcsFile->eolChar, $afterIfCode); - FixerHelper::removeBetweenIncluding( + FixerHelper::change( $phpcsFile, - $tokens[$previousConditionPointer]['scope_closer'] + 2, - $tokens[$elsePointer]['scope_closer'] + $tokens[$previousConditionPointer]['scope_closer'] + 1, + $tokens[$elsePointer]['scope_closer'], + $previousConditionContent ); $phpcsFile->fixer->endChangeset(); @@ -365,24 +342,21 @@ private function processIf(File $phpcsFile, int $ifPointer): void ); $afterIfCode = IndentationHelper::fixIndentation($phpcsFile, $ifCodePointers, $ifIndentation); - $phpcsFile->fixer->beginChangeset(); - - $phpcsFile->fixer->replaceToken( - $ifPointer, - sprintf( - 'if %s {%s%s%s;%s%s}%s%s', - $negativeIfCondition, - $phpcsFile->eolChar, - $earlyExitCodeIndentation, - $earlyExitCode, - $phpcsFile->eolChar, - $ifIndentation, - $phpcsFile->eolChar, - $afterIfCode - ) + $ifContent = sprintf( + 'if %s {%s%s%s;%s%s}%s%s', + $negativeIfCondition, + $phpcsFile->eolChar, + $earlyExitCodeIndentation, + $earlyExitCode, + $phpcsFile->eolChar, + $ifIndentation, + $phpcsFile->eolChar, + $afterIfCode ); - FixerHelper::removeBetweenIncluding($phpcsFile, $ifPointer + 1, $tokens[$ifPointer]['scope_closer']); + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $ifPointer, $tokens[$ifPointer]['scope_closer'], $ifContent); $phpcsFile->fixer->endChangeset(); } @@ -394,7 +368,7 @@ private function getScopeCode(File $phpcsFile, int $scopePointer): string } /** - * @return int[] + * @return list */ private function getScopeCodePointers(File $phpcsFile, int $scopePointer): array { @@ -448,7 +422,7 @@ private function isEarlyExitInScope(File $phpcsFile, int $startPointer, int $end } /** - * @return int[] + * @return list */ private function getAllConditionsPointers(File $phpcsFile, int $conditionPointer): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/JumpStatementsSpacingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/JumpStatementsSpacingSniff.php index 8417c2795..334fbbcee 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/JumpStatementsSpacingSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/JumpStatementsSpacingSniff.php @@ -49,7 +49,7 @@ class JumpStatementsSpacingSniff extends AbstractControlStructureSpacing /** @var bool */ public $allowSingleLineYieldStacking = true; - /** @var string[] */ + /** @var list */ public $jumpStatements = []; /** @@ -80,7 +80,7 @@ public function process(File $phpcsFile, $jumpStatementPointer): void } /** - * @return string[] + * @return list */ protected function getSupportedKeywords(): array { @@ -96,7 +96,7 @@ protected function getSupportedKeywords(): array } /** - * @return string[] + * @return list */ protected function getKeywordsToCheck(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithParenthesesSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithParenthesesSniff.php index 8da3f2c4d..1d0b66782 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithParenthesesSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithParenthesesSniff.php @@ -4,8 +4,10 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use SlevomatCodingStandard\Helpers\AttributeHelper; use SlevomatCodingStandard\Helpers\TokenHelper; use const T_ANON_CLASS; +use const T_ATTRIBUTE; use const T_CLOSE_PARENTHESIS; use const T_CLOSE_SHORT_ARRAY; use const T_CLOSE_SQUARE_BRACKET; @@ -43,6 +45,10 @@ public function process(File $phpcsFile, $newPointer): void /** @var int $nextPointer */ $nextPointer = TokenHelper::findNextEffective($phpcsFile, $newPointer + 1); + if ($tokens[$nextPointer]['code'] === T_ATTRIBUTE) { + $nextPointer = AttributeHelper::getAttributeTarget($phpcsFile, $nextPointer); + } + if ($tokens[$nextPointer]['code'] === T_ANON_CLASS) { return; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineTernaryOperatorSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineTernaryOperatorSniff.php index 41aed34da..09ae72377 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineTernaryOperatorSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineTernaryOperatorSniff.php @@ -5,6 +5,7 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; use SlevomatCodingStandard\Helpers\FixerHelper; +use SlevomatCodingStandard\Helpers\IndentationHelper; use SlevomatCodingStandard\Helpers\SniffSettingsHelper; use SlevomatCodingStandard\Helpers\TernaryOperatorHelper; use SlevomatCodingStandard\Helpers\TokenHelper; @@ -24,9 +25,6 @@ class RequireMultiLineTernaryOperatorSniff implements Sniff public const CODE_MULTI_LINE_TERNARY_OPERATOR_NOT_USED = 'MultiLineTernaryOperatorNotUsed'; - private const TAB_INDENT = "\t"; - private const SPACES_INDENT = ' '; - /** @var int */ public $lineLengthLimit = 0; @@ -167,11 +165,14 @@ private function getIndentation(File $phpcsFile, int $endOfLinePointer): string $actualIndentation = TokenHelper::getContent($phpcsFile, $endOfLinePointer + 1, $pointerAfterWhitespace - 1); if (strlen($actualIndentation) !== 0) { - return $actualIndentation . (substr($actualIndentation, -1) === self::TAB_INDENT ? self::TAB_INDENT : self::SPACES_INDENT); + return $actualIndentation . (substr( + $actualIndentation, + -1 + ) === IndentationHelper::TAB_INDENT ? IndentationHelper::TAB_INDENT : IndentationHelper::SPACES_INDENT); } - $tabPointer = TokenHelper::findPreviousContent($phpcsFile, T_WHITESPACE, self::TAB_INDENT, $endOfLinePointer - 1); - return $tabPointer !== null ? self::TAB_INDENT : self::SPACES_INDENT; + $tabPointer = TokenHelper::findPreviousContent($phpcsFile, T_WHITESPACE, IndentationHelper::TAB_INDENT, $endOfLinePointer - 1); + return $tabPointer !== null ? IndentationHelper::TAB_INDENT : IndentationHelper::SPACES_INDENT; } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceEqualOperatorSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceEqualOperatorSniff.php index f63dc69be..03823e00f 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceEqualOperatorSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceEqualOperatorSniff.php @@ -90,8 +90,9 @@ public function process(File $phpcsFile, $equalPointer): void } $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($equalPointer, '??='); - FixerHelper::removeBetweenIncluding($phpcsFile, $equalPointer + 1, $nullCoalescePointer); + + FixerHelper::change($phpcsFile, $equalPointer, $nullCoalescePointer, '??='); + $phpcsFile->fixer->endChangeset(); } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceOperatorSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceOperatorSniff.php index 4abd7eb30..333ac6ab0 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceOperatorSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceOperatorSniff.php @@ -105,9 +105,7 @@ public function checkIsset(File $phpcsFile, int $issetPointer): void $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($startPointer, sprintf('%s ??', $variableContent)); - - FixerHelper::removeBetweenIncluding($phpcsFile, $startPointer + 1, $inlineElsePointer); + FixerHelper::change($phpcsFile, $startPointer, $inlineElsePointer, sprintf('%s ??', $variableContent)); $phpcsFile->fixer->endChangeset(); } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullSafeObjectOperatorSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullSafeObjectOperatorSniff.php index ace95ba4f..25738c47d 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullSafeObjectOperatorSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullSafeObjectOperatorSniff.php @@ -69,36 +69,23 @@ public function process(File $phpcsFile, $identicalPointer): int $tokens = $phpcsFile->getTokens(); - $pointerBeforeIdentical = TokenHelper::findPreviousEffective($phpcsFile, $identicalPointer - 1); - $pointerAfterIdentical = TokenHelper::findNextEffective($phpcsFile, $identicalPointer + 1); + [$pointerBeforeIdentical, $pointerAfterIdentical] = $this->getIndenticalData($phpcsFile, $identicalPointer); if ($tokens[$pointerBeforeIdentical]['code'] !== T_NULL && $tokens[$pointerAfterIdentical]['code'] !== T_NULL) { return $identicalPointer + 1; } - $isYoda = $tokens[$pointerBeforeIdentical]['code'] === T_NULL; - - if ($isYoda) { - $identificatorStartPointer = $pointerAfterIdentical; - $identificatorEndPointer = $this->findIdentificatorEnd($phpcsFile, $identificatorStartPointer); - - if ($identificatorEndPointer === null) { - return $pointerAfterIdentical + 1; - } - - $conditionStartPointer = $pointerBeforeIdentical; - - } else { - $identificatorEndPointer = $pointerBeforeIdentical; - $identificatorStartPointer = $this->findIdentificatorStart($phpcsFile, $identificatorEndPointer); - - if ($identificatorStartPointer === null) { - return $identificatorEndPointer + 1; - } + [$identificatorStartPointer, $identificatorEndPointer, $conditionStartPointer] = $this->getConditionData( + $phpcsFile, + $pointerBeforeIdentical, + $pointerAfterIdentical + ); - $conditionStartPointer = $identificatorStartPointer; + if ($identificatorStartPointer === null || $identificatorEndPointer === null) { + return $identicalPointer + 1; } + $isYoda = $tokens[$pointerBeforeIdentical]['code'] === T_NULL; $identificator = IdentificatorHelper::getContent($phpcsFile, $identificatorStartPointer, $identificatorEndPointer); $pointerAfterCondition = TokenHelper::findNextEffective( @@ -159,6 +146,40 @@ private function checkTernaryOperator( } while (true); + $pointerBeforeCondition = TokenHelper::findPreviousEffective($phpcsFile, $conditionStartPointer - 1); + if (in_array($tokens[$pointerBeforeCondition]['code'], [T_BOOLEAN_AND, T_BOOLEAN_OR], true)) { + $previousIdenticalPointer = TokenHelper::findPreviousLocal( + $phpcsFile, + [T_IS_IDENTICAL, T_IS_NOT_IDENTICAL], + $pointerBeforeCondition + ); + + if ($previousIdenticalPointer !== null) { + [$pointerBeforePreviousIdentical, $pointerAfterPreviousIdentical] = $this->getIndenticalData( + $phpcsFile, + $previousIdenticalPointer + ); + + [$previousIdentificatorStartPointer, $previousIdentificatorEndPointer] = $this->getConditionData( + $phpcsFile, + $pointerBeforePreviousIdentical, + $pointerAfterPreviousIdentical + ); + + if ($previousIdentificatorStartPointer !== null && $previousIdentificatorEndPointer !== null) { + $previousIdentificator = IdentificatorHelper::getContent( + $phpcsFile, + $previousIdentificatorStartPointer, + $previousIdentificatorEndPointer + ); + + if (!self::areIdentificatorsCompatible($previousIdentificator, $identificator)) { + return; + } + } + } + } + $defaultInElse = $tokens[$identicalPointer]['code'] === T_IS_NOT_IDENTICAL; $inlineElsePointer = TernaryOperatorHelper::getElsePointer($phpcsFile, $inlineThenPointer); $inlineElseEndPointer = TernaryOperatorHelper::getEndPointer($phpcsFile, $inlineThenPointer, $inlineElsePointer); @@ -242,15 +263,14 @@ private function checkTernaryOperator( return; } - $phpcsFile->fixer->beginChangeset(); - - $phpcsFile->fixer->replaceToken($conditionStartPointer, sprintf('%s?%s', $identificator, $identificatorDifference)); - + $conditionContent = sprintf('%s?%s', $identificator, $identificatorDifference); if (strtolower($defaultContent) !== 'null') { - $phpcsFile->fixer->addContent($conditionStartPointer, sprintf(' ?? %s', $defaultContent)); + $conditionContent .= sprintf(' ?? %s', $defaultContent); } - FixerHelper::removeBetweenIncluding($phpcsFile, $conditionStartPointer + 1, $conditionEndPointer); + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $conditionStartPointer, $conditionEndPointer, $conditionContent); $phpcsFile->fixer->endChangeset(); } @@ -274,7 +294,7 @@ private function checkNextCondition( $nextIdentificator = IdentificatorHelper::getContent($phpcsFile, $nextIdentificatorStartPointer, $nextIdentificatorEndPointer); if (!$this->areIdentificatorsCompatible($identificator, $nextIdentificator)) { - return $nextConditionBooleanPointer; + return $nextIdentificatorEndPointer; } $pointerAfterNexIdentificator = TokenHelper::findNextEffective($phpcsFile, $nextIdentificatorEndPointer + 1); @@ -285,16 +305,16 @@ private function checkNextCondition( $tokens[$pointerAfterNexIdentificator]['code'] !== $tokens[$identicalPointer]['code'] && !in_array($tokens[$pointerAfterNexIdentificator]['code'], [T_INLINE_THEN, T_SEMICOLON], true) ) { - return $nextConditionBooleanPointer; + return $pointerAfterNexIdentificator; } if (!in_array($tokens[$pointerAfterNexIdentificator]['code'], [T_IS_IDENTICAL, T_IS_NOT_IDENTICAL], true)) { - return $nextConditionBooleanPointer; + return $pointerAfterNexIdentificator; } $pointerAfterIdentical = TokenHelper::findNextEffective($phpcsFile, $pointerAfterNexIdentificator + 1); if ($tokens[$pointerAfterIdentical]['code'] !== T_NULL) { - return $nextConditionBooleanPointer; + return $pointerAfterNexIdentificator; } $identificatorDifference = $this->getIdentificatorDifference( @@ -307,16 +327,19 @@ private function checkNextCondition( $fix = $phpcsFile->addFixableError('Operator ?-> is required.', $identicalPointer, self::CODE_REQUIRED_NULL_SAFE_OBJECT_OPERATOR); if (!$fix) { - return $nextConditionBooleanPointer; + return $pointerAfterNexIdentificator; } $isConditionOfTernaryOperator = TernaryOperatorHelper::isConditionOfTernaryOperator($phpcsFile, $identicalPointer); $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($conditionStartPointer, sprintf('%s?%s', $identificator, $identificatorDifference)); - - FixerHelper::removeBetweenIncluding($phpcsFile, $conditionStartPointer + 1, $nextIdentificatorEndPointer); + FixerHelper::change( + $phpcsFile, + $conditionStartPointer, + $nextIdentificatorEndPointer, + sprintf('%s?%s', $identificator, $identificatorDifference) + ); $phpcsFile->fixer->endChangeset(); @@ -324,7 +347,7 @@ private function checkNextCondition( return TokenHelper::findNext($phpcsFile, T_INLINE_THEN, $identicalPointer + 1); } - return $nextConditionBooleanPointer; + return $pointerAfterNexIdentificator; } /** @@ -404,9 +427,9 @@ private function findIdentificatorEnd(File $phpcsFile, int $identificatorStartPo private function areIdentificatorsCompatible(string $first, string $second): bool { - /** @var string[] $firstParts */ + /** @var list $firstParts */ $firstParts = preg_split(self::OPERATOR_REGEXP, $first, -1, PREG_SPLIT_DELIM_CAPTURE); - /** @var string[] $secondParts */ + /** @var list $secondParts */ $secondParts = preg_split(self::OPERATOR_REGEXP, $second, -1, PREG_SPLIT_DELIM_CAPTURE); $minPartsCount = min(count($firstParts), count($secondParts)); @@ -451,4 +474,40 @@ private function getIdentificatorDifference( return TokenHelper::getContent($phpcsFile, $differencePointer, $nextIdentificatorEndPointer); } + /** + * @return array{0: int, 1: int} + */ + private function getIndenticalData(File $phpcsFile, int $identicalPointer): array + { + /** @var int $pointerBeforeIdentical */ + $pointerBeforeIdentical = TokenHelper::findPreviousEffective($phpcsFile, $identicalPointer - 1); + /** @var int $pointerAfterIdentical */ + $pointerAfterIdentical = TokenHelper::findNextEffective($phpcsFile, $identicalPointer + 1); + + return [$pointerBeforeIdentical, $pointerAfterIdentical]; + } + + /** + * @return array{0: int|null, 1: int|null, 2: int|null} + */ + private function getConditionData(File $phpcsFile, int $pointerBeforeIdentical, int $pointerAfterIdentical): array + { + $tokens = $phpcsFile->getTokens(); + + $isYoda = $tokens[$pointerBeforeIdentical]['code'] === T_NULL; + + if ($isYoda) { + $identificatorStartPointer = $pointerAfterIdentical; + $identificatorEndPointer = $this->findIdentificatorEnd($phpcsFile, $identificatorStartPointer); + $conditionStartPointer = $pointerBeforeIdentical; + + } else { + $identificatorEndPointer = $pointerBeforeIdentical; + $identificatorStartPointer = $this->findIdentificatorStart($phpcsFile, $identificatorEndPointer); + $conditionStartPointer = $identificatorStartPointer; + } + + return [$identificatorStartPointer, $identificatorEndPointer, $conditionStartPointer]; + } + } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireShortTernaryOperatorSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireShortTernaryOperatorSniff.php index 51655e1f3..6cfe2f9e8 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireShortTernaryOperatorSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireShortTernaryOperatorSniff.php @@ -75,9 +75,7 @@ public function process(File $phpcsFile, $inlineThenPointer): void if ($tokens[$conditionStartPointer]['code'] === T_BOOLEAN_NOT) { $phpcsFile->fixer->replaceToken($conditionStartPointer, ''); - FixerHelper::removeBetweenIncluding($phpcsFile, $inlineThenPointer + 1, $inlineElseEndPointer); - - $phpcsFile->fixer->addContent($inlineThenPointer, sprintf(': %s', $thenContent)); + FixerHelper::change($phpcsFile, $inlineThenPointer, $inlineElseEndPointer, sprintf('?: %s', $thenContent)); } else { FixerHelper::removeBetween($phpcsFile, $inlineThenPointer, $inlineElsePointer); diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php index 7fdc9d126..f1dc541bb 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php @@ -124,9 +124,7 @@ private function checkIfWithReturns(File $phpcsFile, int $ifPointer, int $elsePo FixerHelper::removeBetween($phpcsFile, $tokens[$ifPointer]['parenthesis_closer'], $pointerAfterReturnInIf); - $phpcsFile->fixer->replaceToken($semicolonAfterReturnInIf, ' : '); - - FixerHelper::removeBetween($phpcsFile, $semicolonAfterReturnInIf, $pointerAfterReturnInElse); + FixerHelper::change($phpcsFile, $semicolonAfterReturnInIf, $pointerAfterReturnInElse - 1, ' : '); FixerHelper::removeBetweenIncluding($phpcsFile, $semicolonAfterReturnInElse + 1, $tokens[$elsePointer]['scope_closer']); @@ -204,17 +202,12 @@ private function checkIfWithAssignments( $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($ifPointer, sprintf('%s = ', $identificatorInIf)); - - FixerHelper::removeBetweenIncluding($phpcsFile, $ifPointer + 1, $tokens[$ifPointer]['parenthesis_opener']); - - $phpcsFile->fixer->replaceToken($tokens[$ifPointer]['parenthesis_closer'], ' ? '); + FixerHelper::change($phpcsFile, $ifPointer, $tokens[$ifPointer]['parenthesis_opener'], sprintf('%s = ', $identificatorInIf)); - FixerHelper::removeBetween($phpcsFile, $tokens[$ifPointer]['parenthesis_closer'], $pointerAfterAssignmentInIf); + FixerHelper::change($phpcsFile, $tokens[$ifPointer]['parenthesis_closer'], $pointerAfterAssignmentInIf - 1, ' ? '); - $phpcsFile->fixer->replaceToken($semicolonAfterAssignmentInIf, ' : '); + FixerHelper::change($phpcsFile, $semicolonAfterAssignmentInIf, $pointerAfterAssignmentInElse - 1, ' : '); - FixerHelper::removeBetween($phpcsFile, $semicolonAfterAssignmentInIf, $pointerAfterAssignmentInElse); FixerHelper::removeBetweenIncluding($phpcsFile, $semicolonAfterAssignmentInElse + 1, $tokens[$elsePointer]['scope_closer']); $phpcsFile->fixer->endChangeset(); diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessIfConditionWithReturnSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessIfConditionWithReturnSniff.php index a241fe05c..37a10b163 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessIfConditionWithReturnSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessIfConditionWithReturnSniff.php @@ -103,8 +103,9 @@ public function process(File $phpcsFile, $ifPointer): void } $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($ifPointer, sprintf('return %s;', $newCondition())); - FixerHelper::removeBetweenIncluding($phpcsFile, $ifPointer + 1, $tokens[$elsePointer]['scope_closer']); + + FixerHelper::change($phpcsFile, $ifPointer, $tokens[$elsePointer]['scope_closer'], sprintf('return %s;', $newCondition())); + $phpcsFile->fixer->endChangeset(); } else { $returnPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$ifPointer]['scope_closer'] + 1); @@ -134,8 +135,9 @@ public function process(File $phpcsFile, $ifPointer): void } $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($ifPointer, sprintf('return %s;', $newCondition())); - FixerHelper::removeBetweenIncluding($phpcsFile, $ifPointer + 1, $semicolonPointer); + + FixerHelper::change($phpcsFile, $ifPointer, $semicolonPointer, sprintf('return %s;', $newCondition())); + $phpcsFile->fixer->endChangeset(); } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessTernaryOperatorSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessTernaryOperatorSniff.php index 4f4131733..55f51134a 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessTernaryOperatorSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessTernaryOperatorSniff.php @@ -94,8 +94,7 @@ public function process(File $phpcsFile, $inlineThenPointer): void if ($tokens[$pointerAfterInlineThen]['code'] === T_FALSE) { $negativeCondition = ConditionHelper::getNegativeCondition($phpcsFile, $conditionStartPointer, $conditionEndPointer); - $phpcsFile->fixer->replaceToken($conditionStartPointer, $negativeCondition); - FixerHelper::removeBetweenIncluding($phpcsFile, $conditionStartPointer + 1, $conditionEndPointer); + FixerHelper::change($phpcsFile, $conditionStartPointer, $conditionEndPointer, $negativeCondition); } FixerHelper::removeBetween($phpcsFile, $conditionEndPointer, $pointerAfterTernaryOperator); diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DeadCatchSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DeadCatchSniff.php index 89ad4c240..8a3c29208 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DeadCatchSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DeadCatchSniff.php @@ -33,9 +33,9 @@ public function process(File $phpcsFile, $catchPointer): void $tokens = $phpcsFile->getTokens(); $catchToken = $tokens[$catchPointer]; - $catchedTypes = CatchHelper::findCatchedTypesInCatch($phpcsFile, $catchToken); + $caughtTypes = CatchHelper::findCaughtTypesInCatch($phpcsFile, $catchToken); - if (!in_array('\\Throwable', $catchedTypes, true)) { + if (!in_array('\\Throwable', $caughtTypes, true)) { return; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/ReferenceThrowableOnlySniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/ReferenceThrowableOnlySniff.php index 949374212..3769e0ae5 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/ReferenceThrowableOnlySniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/ReferenceThrowableOnlySniff.php @@ -108,9 +108,8 @@ public function process(File $phpcsFile, $openTagPointer): void $phpcsFile->fixer->beginChangeset(); - FixerHelper::removeBetweenIncluding($phpcsFile, $referencedName->getStartPointer(), $referencedName->getEndPointer()); + FixerHelper::change($phpcsFile, $referencedName->getStartPointer(), $referencedName->getEndPointer(), '\Throwable'); - $phpcsFile->fixer->addContent($referencedName->getStartPointer(), '\Throwable'); $phpcsFile->fixer->endChangeset(); } } @@ -126,8 +125,8 @@ private function searchForThrowableInNextCatches(File $phpcsFile, int $catchPoin break; } - $catchedTypes = CatchHelper::findCatchedTypesInCatch($phpcsFile, $nextCatchToken); - if (in_array('\\Throwable', $catchedTypes, true)) { + $caughtTypes = CatchHelper::findCaughtTypesInCatch($phpcsFile, $nextCatchToken); + if (in_array('\\Throwable', $caughtTypes, true)) { return true; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FilepathNamespaceExtractor.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FilepathNamespaceExtractor.php index 0c205859f..768bb9a1a 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FilepathNamespaceExtractor.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FilepathNamespaceExtractor.php @@ -22,19 +22,19 @@ class FilepathNamespaceExtractor { - /** @var string[] */ + /** @var array */ private $rootNamespaces; - /** @var bool[] dir(string) => true(bool) */ + /** @var array dir(string) => true(bool) */ private $skipDirs; - /** @var string[] */ + /** @var list */ private $extensions; /** - * @param string[] $rootNamespaces directory(string) => namespace - * @param string[] $skipDirs - * @param string[] $extensions index(integer) => extension + * @param array $rootNamespaces directory(string) => namespace + * @param list $skipDirs + * @param list $extensions index(integer) => extension */ public function __construct(array $rootNamespaces, array $skipDirs, array $extensions) { @@ -52,7 +52,7 @@ public function getTypeNameFromProjectPath(string $path): ?string return null; } - /** @var string[] $pathParts */ + /** @var list $pathParts */ $pathParts = preg_split('~[/\\\]~', $path); $rootNamespace = null; while (count($pathParts) > 0) { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/TypeNameMatchesFileNameSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/TypeNameMatchesFileNameSniff.php index 90a1c8cd9..25b369f1c 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/TypeNameMatchesFileNameSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/TypeNameMatchesFileNameSniff.php @@ -30,25 +30,25 @@ class TypeNameMatchesFileNameSniff implements Sniff /** @var array */ public $rootNamespaces = []; - /** @var string[] */ + /** @var list */ public $skipDirs = []; - /** @var string[] */ + /** @var list */ public $ignoredNamespaces = []; - /** @var string[] */ + /** @var list */ public $extensions = ['php']; /** @var array|null */ private $normalizedRootNamespaces; - /** @var string[]|null */ + /** @var list|null */ private $normalizedSkipDirs; - /** @var string[]|null */ + /** @var list|null */ private $normalizedIgnoredNamespaces; - /** @var string[]|null */ + /** @var list|null */ private $normalizedExtensions; /** @var FilepathNamespaceExtractor */ @@ -107,7 +107,7 @@ public function process(File $phpcsFile, $typePointer): void } /** - * @return string[] path(string) => namespace + * @return array path(string) => namespace */ private function getRootNamespaces(): array { @@ -137,7 +137,7 @@ private function getRootNamespaces(): array } /** - * @return string[] + * @return list */ private function getSkipDirs(): array { @@ -149,7 +149,7 @@ private function getSkipDirs(): array } /** - * @return string[] + * @return list */ private function getIgnoredNamespaces(): array { @@ -161,7 +161,7 @@ private function getIgnoredNamespaces(): array } /** - * @return string[] + * @return list */ private function getExtensions(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireArrowFunctionSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireArrowFunctionSniff.php index 76eed7ea6..06e07873e 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireArrowFunctionSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireArrowFunctionSniff.php @@ -102,10 +102,10 @@ public function process(File $phpcsFile, $closurePointer): void $tokens[$closurePointer]['scope_opener'] - 1 ); - $nonWhitespacePointerAfterUseParanthesisCloser = null; + $nonWhitespacePointerAfterUseParenthesisCloser = null; if ($usePointer !== null) { $useParenthesiCloserPointer = TokenHelper::findNext($phpcsFile, T_CLOSE_PARENTHESIS, $usePointer + 1); - $nonWhitespacePointerAfterUseParanthesisCloser = TokenHelper::findNextExcluding( + $nonWhitespacePointerAfterUseParenthesisCloser = TokenHelper::findNextExcluding( $phpcsFile, T_WHITESPACE, $useParenthesiCloserPointer + 1 @@ -115,11 +115,11 @@ public function process(File $phpcsFile, $closurePointer): void $phpcsFile->fixer->beginChangeset(); $phpcsFile->fixer->replaceToken($closurePointer, 'fn'); - if ($nonWhitespacePointerAfterUseParanthesisCloser !== null) { + if ($nonWhitespacePointerAfterUseParenthesisCloser !== null) { FixerHelper::removeBetween( $phpcsFile, $tokens[$closurePointer]['parenthesis_closer'], - $nonWhitespacePointerAfterUseParanthesisCloser + $nonWhitespacePointerAfterUseParenthesisCloser ); } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AbstractFullyQualifiedGlobalReference.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AbstractFullyQualifiedGlobalReference.php index 186f915e5..2f1e8de19 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AbstractFullyQualifiedGlobalReference.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AbstractFullyQualifiedGlobalReference.php @@ -26,16 +26,16 @@ abstract class AbstractFullyQualifiedGlobalReference implements Sniff public const CODE_NON_FULLY_QUALIFIED = 'NonFullyQualified'; - /** @var string[] */ + /** @var list */ public $exclude = []; - /** @var string[] */ + /** @var list */ public $include = []; - /** @var string[]|null */ + /** @var list|null */ private $normalizedExclude; - /** @var string[]|null */ + /** @var list|null */ private $normalizedInclude; abstract protected function getNotFullyQualifiedMessage(): string; @@ -126,7 +126,7 @@ public function process(File $phpcsFile, $openTagPointer): void } /** - * @return string[] + * @return list */ protected function getNormalizedInclude(): array { @@ -137,7 +137,7 @@ protected function getNormalizedInclude(): array } /** - * @return string[] + * @return list */ private function getNormalizedExclude(): array { @@ -148,8 +148,8 @@ private function getNormalizedExclude(): array } /** - * @param string[] $names - * @return string[] + * @param list $names + * @return list */ private function normalizeNames(array $names): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AlphabeticallySortedUsesSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AlphabeticallySortedUsesSniff.php index a84400922..2c79cf9d2 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AlphabeticallySortedUsesSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AlphabeticallySortedUsesSniff.php @@ -4,6 +4,7 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; use SlevomatCodingStandard\Helpers\CommentHelper; use SlevomatCodingStandard\Helpers\FixerHelper; use SlevomatCodingStandard\Helpers\NamespaceHelper; @@ -24,6 +25,7 @@ use function strcasecmp; use function strcmp; use function uasort; +use const T_COMMA; use const T_OPEN_TAG; use const T_SEMICOLON; @@ -67,14 +69,34 @@ public function process(File $phpcsFile, $openTagPointer): void } else { $order = $this->compareUseStatements($useStatement, $lastUse); if ($order < 0) { - $fix = $phpcsFile->addFixableError( + // The use statements are not ordered correctly. Go through all statements and if any are multi-part then + // we report the problem but cannot fix it, because this would lose the secondary parts of the statement. + $fixable = true; + $tokens = $phpcsFile->getTokens(); + foreach ($useStatements as $statement) { + $nextBreaker = TokenHelper::findNext($phpcsFile, [T_SEMICOLON, T_COMMA], $statement->getPointer()); + + if ($tokens[$nextBreaker]['code'] === T_COMMA) { + $fixable = false; + break; + } + } + + $errorParameters = [ sprintf( 'Use statements should be sorted alphabetically. The first wrong one is %s.', $useStatement->getFullyQualifiedTypeName() ), $useStatement->getPointer(), - self::CODE_INCORRECT_ORDER - ); + self::CODE_INCORRECT_ORDER, + ]; + + if (!$fixable) { + $phpcsFile->addError(...$errorParameters); + return; + } + + $fix = $phpcsFile->addFixableError(...$errorParameters); if ($fix) { $this->fixAlphabeticalOrder($phpcsFile, $useStatements); } @@ -89,7 +111,7 @@ public function process(File $phpcsFile, $openTagPointer): void } /** - * @param UseStatement[] $useStatements + * @param array $useStatements */ private function fixAlphabeticalOrder(File $phpcsFile, array $useStatements): void { @@ -107,7 +129,7 @@ private function fixAlphabeticalOrder(File $phpcsFile, array $useStatements): vo foreach ($useStatements as $useStatement) { $pointerBeforeUseStatement = TokenHelper::findPreviousNonWhitespace($phpcsFile, $useStatement->getPointer() - 1); - if (!in_array($tokens[$pointerBeforeUseStatement]['code'], TokenHelper::$inlineCommentTokenCodes, true)) { + if (!in_array($tokens[$pointerBeforeUseStatement]['code'], Tokens::$commentTokens, true)) { continue; } @@ -116,7 +138,9 @@ private function fixAlphabeticalOrder(File $phpcsFile, array $useStatements): vo continue; } - $commentStartPointer = CommentHelper::getMultilineCommentStartPointer($phpcsFile, $pointerBeforeUseStatement); + $commentStartPointer = in_array($tokens[$pointerBeforeUseStatement]['code'], TokenHelper::$inlineCommentTokenCodes, true) + ? CommentHelper::getMultilineCommentStartPointer($phpcsFile, $pointerBeforeUseStatement) + : $tokens[$pointerBeforeUseStatement]['comment_opener']; $commentsBefore[$useStatement->getPointer()] = TokenHelper::getContent( $phpcsFile, diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedClassNameInAnnotationSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedClassNameInAnnotationSniff.php index 475608e9e..8f259c97f 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedClassNameInAnnotationSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedClassNameInAnnotationSniff.php @@ -6,12 +6,11 @@ use PHP_CodeSniffer\Sniffs\Sniff; use PHPStan\PhpDocParser\Ast\ConstExpr\ConstFetchNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; -use SlevomatCodingStandard\Helpers\Annotation\GenericAnnotation; -use SlevomatCodingStandard\Helpers\AnnotationConstantExpressionHelper; use SlevomatCodingStandard\Helpers\AnnotationHelper; -use SlevomatCodingStandard\Helpers\AnnotationTypeHelper; +use SlevomatCodingStandard\Helpers\DocCommentHelper; use SlevomatCodingStandard\Helpers\FixerHelper; use SlevomatCodingStandard\Helpers\NamespaceHelper; +use SlevomatCodingStandard\Helpers\PhpDocParserHelper; use SlevomatCodingStandard\Helpers\ReferencedName; use SlevomatCodingStandard\Helpers\TypeHelper; use SlevomatCodingStandard\Helpers\TypeHintHelper; @@ -42,124 +41,119 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void { $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); - foreach ($annotations as $annotationName => $annotationsByName) { - foreach ($annotationsByName as $annotation) { - if ($annotation instanceof GenericAnnotation) { + foreach ($annotations as $annotation) { + /** @var list $identifierTypeNodes */ + $identifierTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), IdentifierTypeNode::class); + + foreach ($identifierTypeNodes as $typeHintNode) { + $typeHint = $typeHintNode->name; + + $lowercasedTypeHint = strtolower($typeHint); + if ( + TypeHintHelper::isSimpleTypeHint($lowercasedTypeHint) + || TypeHintHelper::isSimpleUnofficialTypeHints($lowercasedTypeHint) + || !TypeHelper::isTypeName($typeHint) + || TypeHintHelper::isTypeDefinedInAnnotation($phpcsFile, $docCommentOpenPointer, $typeHint) + ) { + continue; + } + + $fullyQualifiedTypeHint = TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $docCommentOpenPointer, $typeHint); + if ($fullyQualifiedTypeHint === $typeHint) { + continue; + } + + $fix = $phpcsFile->addFixableError(sprintf( + 'Class name %s in %s should be referenced via a fully qualified name.', + $fullyQualifiedTypeHint, + $annotation->getName() + ), $annotation->getStartPointer(), self::CODE_NON_FULLY_QUALIFIED_CLASS_NAME); + + if (!$fix) { + continue; + } + + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + $fixedDocComment = AnnotationHelper::fixAnnotation( + $parsedDocComment, + $annotation, + $typeHintNode, + new IdentifierTypeNode($fullyQualifiedTypeHint) + ); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change( + $phpcsFile, + $parsedDocComment->getOpenPointer(), + $parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + $phpcsFile->fixer->endChangeset(); + } + + /** @var list $constantFetchNodes */ + $constantFetchNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), ConstFetchNode::class); + + foreach ($constantFetchNodes as $constantFetchNode) { + $isClassConstant = $constantFetchNode->className !== ''; + + $typeHint = $isClassConstant + ? $constantFetchNode->className + : $constantFetchNode->name; + + if ($typeHint === 'self') { continue; } - if ($annotation->isInvalid()) { + $fullyQualifiedTypeHint = $isClassConstant + ? NamespaceHelper::resolveClassName($phpcsFile, $typeHint, $docCommentOpenPointer) + : NamespaceHelper::resolveName($phpcsFile, $typeHint, ReferencedName::TYPE_CONSTANT, $docCommentOpenPointer); + + if ($fullyQualifiedTypeHint === $typeHint) { continue; } - foreach (AnnotationHelper::getAnnotationTypes($annotation) as $annotationType) { - foreach (AnnotationTypeHelper::getIdentifierTypeNodes($annotationType) as $typeHintNode) { - $typeHint = AnnotationTypeHelper::getTypeHintFromNode($typeHintNode); - - $lowercasedTypeHint = strtolower($typeHint); - if ( - TypeHintHelper::isSimpleTypeHint($lowercasedTypeHint) - || TypeHintHelper::isSimpleUnofficialTypeHints($lowercasedTypeHint) - || !TypeHelper::isTypeName($typeHint) - || TypeHintHelper::isTypeDefinedInAnnotation($phpcsFile, $docCommentOpenPointer, $typeHint) - ) { - continue; - } - - $fullyQualifiedTypeHint = TypeHintHelper::getFullyQualifiedTypeHint( - $phpcsFile, - $annotation->getStartPointer(), - $typeHint - ); - if ($fullyQualifiedTypeHint === $typeHint) { - continue; - } - $fix = $phpcsFile->addFixableError(sprintf( - 'Class name %s in %s should be referenced via a fully qualified name.', - $fullyQualifiedTypeHint, - $annotationName - ), $annotation->getStartPointer(), self::CODE_NON_FULLY_QUALIFIED_CLASS_NAME); - - if (!$fix) { - continue; - } - - $fixedAnnotationContent = AnnotationHelper::fixAnnotationType( - $phpcsFile, - $annotation, - $typeHintNode, - new IdentifierTypeNode($fullyQualifiedTypeHint) - ); - - $phpcsFile->fixer->beginChangeset(); - - $phpcsFile->fixer->replaceToken($annotation->getStartPointer(), $fixedAnnotationContent); - - FixerHelper::removeBetweenIncluding($phpcsFile, $annotation->getStartPointer() + 1, $annotation->getEndPointer()); - - $phpcsFile->fixer->endChangeset(); - } + $fix = $phpcsFile->addFixableError(sprintf( + '%s name %s in %s should be referenced via a fully qualified name.', + $isClassConstant ? 'Class' : 'Constant', + $fullyQualifiedTypeHint, + $annotation->getName() + ), $annotation->getStartPointer(), self::CODE_NON_FULLY_QUALIFIED_CLASS_NAME); + + if (!$fix) { + continue; } - foreach (AnnotationHelper::getAnnotationConstantExpressions($annotation) as $constantExpression) { - foreach (AnnotationConstantExpressionHelper::getConstantFetchNodes($constantExpression) as $constantFetchNode) { - $isClassConstant = $constantFetchNode->className !== ''; - - $typeHint = $isClassConstant - ? $constantFetchNode->className - : $constantFetchNode->name; - - if ($typeHint === 'self') { - continue; - } - - $fullyQualifiedTypeHint = $isClassConstant - ? NamespaceHelper::resolveClassName( - $phpcsFile, - $typeHint, - $annotation->getStartPointer() - ) : NamespaceHelper::resolveName( - $phpcsFile, - $typeHint, - ReferencedName::TYPE_CONSTANT, - $annotation->getStartPointer() - ); - - if ($fullyQualifiedTypeHint === $typeHint) { - continue; - } - - $fix = $phpcsFile->addFixableError(sprintf( - '%s name %s in %s should be referenced via a fully qualified name.', - $isClassConstant ? 'Class' : 'Constant', - $fullyQualifiedTypeHint, - $annotationName - ), $annotation->getStartPointer(), self::CODE_NON_FULLY_QUALIFIED_CLASS_NAME); - - if (!$fix) { - continue; - } - - $fixedConstantFetchNode = $isClassConstant - ? new ConstFetchNode($fullyQualifiedTypeHint, $constantFetchNode->name) - : new ConstFetchNode('', $fullyQualifiedTypeHint); - - $fixedAnnotationContent = AnnotationHelper::fixAnnotationConstantFetchNode( - $phpcsFile, - $annotation, - $constantFetchNode, - $fixedConstantFetchNode - ); - - $phpcsFile->fixer->beginChangeset(); - - $phpcsFile->fixer->replaceToken($annotation->getStartPointer(), $fixedAnnotationContent); - - FixerHelper::removeBetweenIncluding($phpcsFile, $annotation->getStartPointer() + 1, $annotation->getEndPointer()); - - $phpcsFile->fixer->endChangeset(); - } + $fixedConstantFetchNode = PhpDocParserHelper::cloneNode($constantFetchNode); + if ($isClassConstant) { + $fixedConstantFetchNode->className = $fullyQualifiedTypeHint; + } else { + $fixedConstantFetchNode->name = $fullyQualifiedTypeHint; } + + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + $fixedDocComment = AnnotationHelper::fixAnnotation( + $parsedDocComment, + $annotation, + $constantFetchNode, + $fixedConstantFetchNode + ); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change( + $phpcsFile, + $parsedDocComment->getOpenPointer(), + $parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + $phpcsFile->fixer->endChangeset(); + } } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedExceptionsSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedExceptionsSniff.php index a6ea3bca2..8d410cbd8 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedExceptionsSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedExceptionsSniff.php @@ -23,16 +23,16 @@ class FullyQualifiedExceptionsSniff implements Sniff public const CODE_NON_FULLY_QUALIFIED_EXCEPTION = 'NonFullyQualifiedException'; - /** @var string[] */ + /** @var list */ public $specialExceptionNames = []; - /** @var string[] */ + /** @var list */ public $ignoredNames = []; - /** @var string[]|null */ + /** @var list|null */ private $normalizedSpecialExceptionNames; - /** @var string[]|null */ + /** @var list|null */ private $normalizedIgnoredNames; /** @@ -129,16 +129,14 @@ public function process(File $phpcsFile, $openTagPointer): void $phpcsFile->fixer->beginChangeset(); - FixerHelper::removeBetweenIncluding($phpcsFile, $referencedName->getStartPointer(), $referencedName->getEndPointer()); - - $phpcsFile->fixer->addContent($referencedName->getStartPointer(), $fullyQualifiedName); + FixerHelper::change($phpcsFile, $referencedName->getStartPointer(), $referencedName->getEndPointer(), $fullyQualifiedName); $phpcsFile->fixer->endChangeset(); } } /** - * @return string[] + * @return list */ private function getSpecialExceptionNames(): array { @@ -150,7 +148,7 @@ private function getSpecialExceptionNames(): array } /** - * @return string[] + * @return list */ private function getIgnoredNames(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php index fae0ded7b..30741a3b9 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php @@ -14,7 +14,7 @@ class FullyQualifiedGlobalFunctionsSniff public $includeSpecialFunctions = false; /** - * @return string[] + * @return list */ protected function getNormalizedInclude(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php index d48b3bf00..c349fbf34 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php @@ -7,13 +7,11 @@ use PHP_CodeSniffer\Util\Tokens; use PHPStan\PhpDocParser\Ast\ConstExpr\ConstFetchNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; -use SlevomatCodingStandard\Helpers\Annotation\GenericAnnotation; -use SlevomatCodingStandard\Helpers\AnnotationConstantExpressionHelper; use SlevomatCodingStandard\Helpers\AnnotationHelper; -use SlevomatCodingStandard\Helpers\AnnotationTypeHelper; use SlevomatCodingStandard\Helpers\ClassHelper; use SlevomatCodingStandard\Helpers\CommentHelper; use SlevomatCodingStandard\Helpers\ConstantHelper; +use SlevomatCodingStandard\Helpers\DocCommentHelper; use SlevomatCodingStandard\Helpers\FixerHelper; use SlevomatCodingStandard\Helpers\FunctionHelper; use SlevomatCodingStandard\Helpers\NamespaceHelper; @@ -40,6 +38,7 @@ use function preg_quote; use function preg_replace; use function sprintf; +use function strpos; use function strtolower; use function substr; use const T_DECLARE; @@ -87,10 +86,10 @@ class ReferenceUsedNamesOnlySniff implements Sniff /** @var bool */ public $allowFallbackGlobalConstants = true; - /** @var string[] */ + /** @var list */ public $specialExceptionNames = []; - /** @var string[] */ + /** @var list */ public $ignoredNames = []; /** @var bool */ @@ -99,7 +98,7 @@ class ReferenceUsedNamesOnlySniff implements Sniff /** * If empty, all namespaces are required to be used * - * @var string[] + * @var list */ public $namespacesRequiredToUse = []; @@ -112,13 +111,13 @@ class ReferenceUsedNamesOnlySniff implements Sniff /** @var bool */ public $allowFullyQualifiedNameForCollidingConstants = false; - /** @var string[]|null */ + /** @var list|null */ private $normalizedSpecialExceptionNames; - /** @var string[]|null */ + /** @var list|null */ private $normalizedIgnoredNames; - /** @var string[]|null */ + /** @var list|null */ private $normalizedNamespacesRequiredToUse; /** @@ -187,7 +186,18 @@ public function process(File $phpcsFile, $openTagPointer): void $collidingUseStatementUniqueId = UseStatement::getUniqueId($reference->type, $unqualifiedName); - $isFullyQualified = NamespaceHelper::isFullyQualifiedName($name); + $isPartialUse = false; + foreach ($useStatements as $useStatement) { + $useStatementName = $useStatement->getAlias() ?? $useStatement->getNameAsReferencedInFile(); + if (strpos($name, $useStatementName . '\\') === 0) { + $isPartialUse = true; + break; + } + } + + $isFullyQualified = NamespaceHelper::isFullyQualifiedName($name) + || ($namespacePointers === [] && NamespaceHelper::hasNamespace($name) && !$isPartialUse); + $isGlobalFallback = !$isFullyQualified && !NamespaceHelper::hasNamespace($name) && $namespacePointers !== [] @@ -294,28 +304,34 @@ public function process(File $phpcsFile, $openTagPointer): void $phpcsFile->fixer->beginChangeset(); if ($reference->source === self::SOURCE_ANNOTATION) { - $fixedAnnotationContent = AnnotationHelper::fixAnnotationType( - $phpcsFile, + $fixedDocComment = AnnotationHelper::fixAnnotation( + $reference->parsedDocComment, $reference->annotation, $reference->nameNode, new IdentifierTypeNode(substr($reference->name, 1)) ); - $phpcsFile->fixer->replaceToken($startPointer, $fixedAnnotationContent); - - FixerHelper::removeBetweenIncluding($phpcsFile, $startPointer + 1, $reference->endPointer); + FixerHelper::change( + $phpcsFile, + $reference->parsedDocComment->getOpenPointer(), + $reference->parsedDocComment->getClosePointer(), + $fixedDocComment + ); } elseif ($reference->source === self::SOURCE_ANNOTATION_CONSTANT_FETCH) { - $fixedAnnotationContent = AnnotationHelper::fixAnnotationConstantFetchNode( - $phpcsFile, + $fixedDocComment = AnnotationHelper::fixAnnotation( + $reference->parsedDocComment, $reference->annotation, $reference->constantFetchNode, new ConstFetchNode(substr($reference->name, 1), $reference->constantFetchNode->name) ); - $phpcsFile->fixer->replaceToken($startPointer, $fixedAnnotationContent); - - FixerHelper::removeBetweenIncluding($phpcsFile, $startPointer + 1, $reference->endPointer); + FixerHelper::change( + $phpcsFile, + $reference->parsedDocComment->getOpenPointer(), + $reference->parsedDocComment->getClosePointer(), + $fixedDocComment + ); } else { $phpcsFile->fixer->replaceToken($startPointer, substr($tokens[$startPointer]['content'], 1)); } @@ -490,21 +506,35 @@ static function (bool $carry, string $use) use ($canonicalName): bool { } if ($reference->source === self::SOURCE_ANNOTATION) { - $fixedAnnotationContent = AnnotationHelper::fixAnnotationType( - $phpcsFile, + $fixedDocComment = AnnotationHelper::fixAnnotation( + $reference->parsedDocComment, $reference->annotation, $reference->nameNode, new IdentifierTypeNode($nameToReference) ); - $phpcsFile->fixer->replaceToken($startPointer, $fixedAnnotationContent); - } elseif ($reference->source === self::SOURCE_ANNOTATION_CONSTANT_FETCH) { - $fixedAnnotationContent = AnnotationHelper::fixAnnotationConstantFetchNode( + + FixerHelper::change( $phpcsFile, + $reference->parsedDocComment->getOpenPointer(), + $reference->parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + } elseif ($reference->source === self::SOURCE_ANNOTATION_CONSTANT_FETCH) { + $fixedDocComment = AnnotationHelper::fixAnnotation( + $reference->parsedDocComment, $reference->annotation, $reference->constantFetchNode, new ConstFetchNode($nameToReference, $reference->constantFetchNode->name) ); - $phpcsFile->fixer->replaceToken($startPointer, $fixedAnnotationContent); + + FixerHelper::change( + $phpcsFile, + $reference->parsedDocComment->getOpenPointer(), + $reference->parsedDocComment->getClosePointer(), + $fixedDocComment + ); + } elseif ($reference->source === self::SOURCE_ATTRIBUTE) { $attributeContent = TokenHelper::getContent($phpcsFile, $startPointer, $reference->endPointer); $fixedAttributeContent = preg_replace( @@ -512,19 +542,17 @@ static function (bool $carry, string $use) use ($canonicalName): bool { $nameToReference, $attributeContent ); - $phpcsFile->fixer->replaceToken($startPointer, $fixedAttributeContent); + FixerHelper::change($phpcsFile, $startPointer, $reference->endPointer, $fixedAttributeContent); } else { - $phpcsFile->fixer->replaceToken($startPointer, $nameToReference); + FixerHelper::change($phpcsFile, $startPointer, $reference->endPointer, $nameToReference); } - - FixerHelper::removeBetweenIncluding($phpcsFile, $startPointer + 1, $reference->endPointer); } $phpcsFile->fixer->endChangeset(); } /** - * @return string[] + * @return list */ private function getSpecialExceptionNames(): array { @@ -536,7 +564,7 @@ private function getSpecialExceptionNames(): array } /** - * @return string[] + * @return list */ private function getIgnoredNames(): array { @@ -548,7 +576,7 @@ private function getIgnoredNames(): array } /** - * @return string[] + * @return list */ private function getNamespacesRequiredToUse(): array { @@ -560,7 +588,7 @@ private function getNamespacesRequiredToUse(): array } /** - * @param UseStatement[] $useStatements + * @param array $useStatements */ private function getUseStatementPlacePointer(File $phpcsFile, int $openTagPointer, array $useStatements): int { @@ -633,7 +661,7 @@ private function isRequiredToBeUsed(string $name): bool } /** - * @return stdClass[] + * @return list */ private function getReferences(File $phpcsFile, int $openTagPointer): array { @@ -679,64 +707,61 @@ private function getReferences(File $phpcsFile, int $openTagPointer): array break; } - $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); - foreach ($annotations as $annotationsByName) { - foreach ($annotationsByName as $annotation) { - if ($annotation instanceof GenericAnnotation) { - continue; - } + if ($parsedDocComment !== null) { + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); - if ($annotation->isInvalid()) { - continue; - } + foreach ($annotations as $annotation) { + /** @var list $identifierTypeNodes */ + $identifierTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), IdentifierTypeNode::class); - foreach (AnnotationHelper::getAnnotationTypes($annotation) as $annotationType) { - foreach (AnnotationTypeHelper::getIdentifierTypeNodes($annotationType) as $typeHintNode) { - $typeHint = AnnotationTypeHelper::getTypeHintFromNode($typeHintNode); - - $lowercasedTypeHint = strtolower($typeHint); - if ( - TypeHintHelper::isSimpleTypeHint($lowercasedTypeHint) - || TypeHintHelper::isSimpleUnofficialTypeHints($lowercasedTypeHint) - || !TypeHelper::isTypeName($typeHint) - ) { - continue; - } - - $reference = new stdClass(); - $reference->source = self::SOURCE_ANNOTATION; - $reference->annotation = $annotation; - $reference->nameNode = $typeHintNode; - $reference->name = $typeHint; - $reference->type = ReferencedName::TYPE_CLASS; - $reference->startPointer = $annotation->getStartPointer(); - $reference->endPointer = $annotation->getEndPointer(); - $reference->isClass = true; - $reference->isConstant = false; - $reference->isFunction = false; - - $references[] = $reference; + foreach ($identifierTypeNodes as $typeHintNode) { + $typeHint = $typeHintNode->name; + + $lowercasedTypeHint = strtolower($typeHint); + if ( + TypeHintHelper::isSimpleTypeHint($lowercasedTypeHint) + || TypeHintHelper::isSimpleUnofficialTypeHints($lowercasedTypeHint) + || !TypeHelper::isTypeName($typeHint) + ) { + continue; } + + $reference = new stdClass(); + $reference->source = self::SOURCE_ANNOTATION; + $reference->parsedDocComment = $parsedDocComment; + $reference->annotation = $annotation; + $reference->nameNode = $typeHintNode; + $reference->name = $typeHint; + $reference->type = ReferencedName::TYPE_CLASS; + $reference->startPointer = $annotation->getStartPointer(); + $reference->endPointer = null; + $reference->isClass = true; + $reference->isConstant = false; + $reference->isFunction = false; + + $references[] = $reference; } - foreach (AnnotationHelper::getAnnotationConstantExpressions($annotation) as $constantExpression) { - foreach (AnnotationConstantExpressionHelper::getConstantFetchNodes($constantExpression) as $constantFetchNode) { - - $reference = new stdClass(); - $reference->source = self::SOURCE_ANNOTATION_CONSTANT_FETCH; - $reference->annotation = $annotation; - $reference->constantFetchNode = $constantFetchNode; - $reference->name = $constantFetchNode->className; - $reference->type = ReferencedName::TYPE_CLASS; - $reference->startPointer = $annotation->getStartPointer(); - $reference->endPointer = $annotation->getEndPointer(); - $reference->isClass = true; - $reference->isConstant = false; - $reference->isFunction = false; - - $references[] = $reference; - } + /** @var list $constantFetchNodes */ + $constantFetchNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), ConstFetchNode::class); + + foreach ($constantFetchNodes as $constantFetchNode) { + $reference = new stdClass(); + $reference->source = self::SOURCE_ANNOTATION_CONSTANT_FETCH; + $reference->parsedDocComment = $parsedDocComment; + $reference->annotation = $annotation; + $reference->constantFetchNode = $constantFetchNode; + $reference->name = $constantFetchNode->className; + $reference->type = ReferencedName::TYPE_CLASS; + $reference->startPointer = $annotation->getStartPointer(); + $reference->endPointer = null; + $reference->isClass = true; + $reference->isConstant = false; + $reference->isFunction = false; + + $references[] = $reference; } } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UnusedUsesSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UnusedUsesSniff.php index ee9aa0527..9dfb68f40 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UnusedUsesSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UnusedUsesSniff.php @@ -5,17 +5,10 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; use PHPStan\PhpDocParser\Ast\ConstExpr\ConstFetchNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine\DoctrineAnnotation; +use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; -use SlevomatCodingStandard\Helpers\Annotation\GenericAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\MethodAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ParameterAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\PropertyAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ReturnAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ThrowsAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\VariableAnnotation; -use SlevomatCodingStandard\Helpers\AnnotationConstantExpressionHelper; use SlevomatCodingStandard\Helpers\AnnotationHelper; -use SlevomatCodingStandard\Helpers\AnnotationTypeHelper; use SlevomatCodingStandard\Helpers\FixerHelper; use SlevomatCodingStandard\Helpers\NamespaceHelper; use SlevomatCodingStandard\Helpers\ReferencedName; @@ -27,6 +20,7 @@ use SlevomatCodingStandard\Helpers\UseStatement; use SlevomatCodingStandard\Helpers\UseStatementHelper; use function array_diff_key; +use function array_filter; use function array_key_exists; use function array_map; use function array_merge; @@ -35,7 +29,6 @@ use function in_array; use function preg_match; use function preg_quote; -use function preg_split; use function sprintf; use const T_DOC_COMMENT_OPEN_TAG; use const T_NAMESPACE; @@ -50,16 +43,16 @@ class UnusedUsesSniff implements Sniff /** @var bool */ public $searchAnnotations = false; - /** @var string[] */ + /** @var list */ public $ignoredAnnotationNames = []; - /** @var string[] */ + /** @var list */ public $ignoredAnnotations = []; - /** @var string[]|null */ + /** @var list|null */ private $normalizedIgnoredAnnotationNames; - /** @var string[]|null */ + /** @var list|null */ private $normalizedIgnoredAnnotations; /** @@ -128,7 +121,7 @@ public function process(File $phpcsFile, $openTagPointer): void $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); - if (count($annotations) === 0) { + if ($annotations === []) { $searchAnnotationsPointer = $tokens[$docCommentOpenPointer]['comment_closer'] + 1; continue; } @@ -152,109 +145,69 @@ public function process(File $phpcsFile, $openTagPointer): void $nameAsReferencedInFile = $useStatement->getNameAsReferencedInFile(); $uniqueId = UseStatement::getUniqueId($useStatement->getType(), $nameAsReferencedInFile); - /** @var string $annotationName */ - foreach ($annotations as $annotationName => $annotationsByName) { - if (in_array($annotationName, $this->getIgnoredAnnotations(), true)) { + foreach ($annotations as $annotation) { + if (in_array($annotation->getName(), $this->getIgnoredAnnotations(), true)) { continue; } - if ( - !in_array($annotationName, $this->getIgnoredAnnotationNames(), true) - && preg_match( - '~^@(' . preg_quote($nameAsReferencedInFile, '~') . ')(?=[^-a-z\\d]|$)~i', - $annotationName, - $matches - ) !== 0 - ) { - $allUsedNames[$pointerBeforeUseStatements][$uniqueId] = true; + if ($annotation->isInvalid()) { + continue; } - foreach ($annotationsByName as $annotation) { - if (!$annotation instanceof GenericAnnotation) { - continue; - } - - if ($annotation->getParameters() === null) { - continue; - } + $contentsToCheck = []; + + if ($annotation->getValue() instanceof GenericTagValueNode) { + $contentsToCheck[] = $annotation->getName(); + $contentsToCheck[] = $annotation->getValue()->value; + } else { + /** @var list $identifierTypeNodes */ + $identifierTypeNodes = AnnotationHelper::getAnnotationNodesByType( + $annotation->getNode(), + IdentifierTypeNode::class + ); + /** @var list $doctrineAnnotations */ + $doctrineAnnotations = AnnotationHelper::getAnnotationNodesByType( + $annotation->getNode(), + DoctrineAnnotation::class + ); + /** @var list $constFetchNodes */ + $constFetchNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), ConstFetchNode::class); + + $contentsToCheck = array_filter(array_merge( + $contentsToCheck, + array_map(static function (IdentifierTypeNode $identifierTypeNode): ?string { + if ( + TypeHintHelper::isSimpleTypeHint($identifierTypeNode->name) + || TypeHintHelper::isSimpleUnofficialTypeHints($identifierTypeNode->name) + || !TypeHelper::isTypeName($identifierTypeNode->name) + ) { + return null; + } - if ( - preg_match( - '~(?<=^|[^a-z\\\\])(' . preg_quote($nameAsReferencedInFile, '~') . ')(\\\\\\w+)*(?=::)~i', - $annotation->getParameters(), - $matches - ) === 0 - && preg_match( - '~(?<=@)(' . preg_quote($nameAsReferencedInFile, '~') . ')(?=[^\\w])~i', - $annotation->getParameters(), - $matches - ) === 0 - ) { - continue; - } + return $identifierTypeNode->name; + }, $identifierTypeNodes), + array_map(function (DoctrineAnnotation $doctrineAnnotation): ?string { + if (in_array($doctrineAnnotation->name, $this->getIgnoredAnnotationNames(), true)) { + return null; + } - $allUsedNames[$pointerBeforeUseStatements][$uniqueId] = true; + return $doctrineAnnotation->name; + }, $doctrineAnnotations), + array_map(static function (ConstFetchNode $constFetchNode): string { + return $constFetchNode->className; + }, $constFetchNodes) + )); } - /** @var VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|GenericAnnotation $annotation */ - foreach ($annotationsByName as $annotation) { - if ($annotation->getContent() === null) { + foreach ($contentsToCheck as $contentToCheck) { + if (preg_match( + '~(?<=^|[^a-z\\\\])(' . preg_quote($nameAsReferencedInFile, '~') . ')(?=\\s|::|\\\\|\||\[|$)~im', + $contentToCheck + ) === 0) { continue; } - if ($annotation->isInvalid()) { - continue; - } - - $content = $annotation->getContent(); - - $contentsToCheck = []; - if (!$annotation instanceof GenericAnnotation) { - foreach (AnnotationHelper::getAnnotationTypes($annotation) as $annotationType) { - foreach (AnnotationTypeHelper::getIdentifierTypeNodes($annotationType) as $typeNode) { - if (!$typeNode instanceof IdentifierTypeNode) { - continue; - } - - if ( - TypeHintHelper::isSimpleTypeHint($typeNode->name) - || TypeHintHelper::isSimpleUnofficialTypeHints($typeNode->name) - || !TypeHelper::isTypeName($typeNode->name) - ) { - continue; - } - - $contentsToCheck[] = $typeNode->name; - } - } - foreach (AnnotationHelper::getAnnotationConstantExpressions($annotation) as $annotationConstantExpression) { - $contentsToCheck = array_merge( - $contentsToCheck, - array_map(static function (ConstFetchNode $constFetchNode): string { - return $constFetchNode->className; - }, AnnotationConstantExpressionHelper::getConstantFetchNodes($annotationConstantExpression)) - ); - } - } elseif ($annotationName === '@see') { - $parts = preg_split('~(\\s+|::)~', $content); - if ($parts !== false) { - $contentsToCheck[] = $parts[0]; - } - } else { - $contentsToCheck[] = $content; - } - - foreach ($contentsToCheck as $contentToCheck) { - if (preg_match( - '~(?<=^|\|)(' . preg_quote($nameAsReferencedInFile, '~') . ')(?=\\s|\\\\|\||\[|$)~i', - $contentToCheck, - $matches - ) === 0) { - continue; - } - - $allUsedNames[$pointerBeforeUseStatements][$uniqueId] = true; - } + $allUsedNames[$pointerBeforeUseStatements][$uniqueId] = true; } } } @@ -293,7 +246,7 @@ public function process(File $phpcsFile, $openTagPointer): void } /** - * @return string[] + * @return list */ private function getIgnoredAnnotationNames(): array { @@ -313,7 +266,7 @@ private function getIgnoredAnnotationNames(): array } /** - * @return string[] + * @return list */ private function getIgnoredAnnotations(): array { @@ -325,7 +278,7 @@ private function getIgnoredAnnotations(): array } /** - * @param int[] $pointersBeforeUseStatements + * @param list $pointersBeforeUseStatements */ private function firstPointerBefore(int $pointer, array $pointersBeforeUseStatements, int $startPointer): int { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseOnlyWhitelistedNamespacesSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseOnlyWhitelistedNamespacesSniff.php index 09b067474..f8f7508d6 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseOnlyWhitelistedNamespacesSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseOnlyWhitelistedNamespacesSniff.php @@ -18,10 +18,10 @@ class UseOnlyWhitelistedNamespacesSniff implements Sniff /** @var bool */ public $allowUseFromRootNamespace = false; - /** @var string[] */ + /** @var list */ public $namespacesRequiredToUse = []; - /** @var string[]|null */ + /** @var list|null */ private $normalizedNamespacesRequiredToUse; /** @@ -67,7 +67,7 @@ public function process(File $phpcsFile, $usePointer): void } /** - * @return string[] + * @return list */ private function getNamespacesRequiredToUse(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseSpacingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseSpacingSniff.php index 3c48b2964..ca0808a47 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseSpacingSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseSpacingSniff.php @@ -193,7 +193,7 @@ private function checkLinesAfterLastUse(File $phpcsFile, UseStatement $lastUse): } /** - * @param UseStatement[] $useStatements + * @param list $useStatements */ private function checkLinesBetweenSameTypesOfUse(File $phpcsFile, array $useStatements): void { @@ -265,7 +265,7 @@ private function checkLinesBetweenSameTypesOfUse(File $phpcsFile, array $useStat } /** - * @param UseStatement[] $useStatements + * @param list $useStatements */ private function checkLinesBetweenDifferentTypesOfUse(File $phpcsFile, array $useStatements): void { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireCombinedAssignmentOperatorSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireCombinedAssignmentOperatorSniff.php index 05f08124d..7a3406b34 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireCombinedAssignmentOperatorSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireCombinedAssignmentOperatorSniff.php @@ -36,7 +36,7 @@ class RequireCombinedAssignmentOperatorSniff implements Sniff { - public const CODE_REQUIRED_COMBINED_ASSIGMENT_OPERATOR = 'RequiredCombinedAssigmentOperator'; + public const CODE_REQUIRED_COMBINED_ASSIGNMENT_OPERATOR = 'RequiredCombinedAssignmentOperator'; /** * @return array @@ -128,20 +128,21 @@ public function process(File $phpcsFile, $equalPointer): void ); if (!$isFixable) { - $phpcsFile->addError($errorMessage, $equalPointer, self::CODE_REQUIRED_COMBINED_ASSIGMENT_OPERATOR); + $phpcsFile->addError($errorMessage, $equalPointer, self::CODE_REQUIRED_COMBINED_ASSIGNMENT_OPERATOR); return; } - $fix = $phpcsFile->addFixableError($errorMessage, $equalPointer, self::CODE_REQUIRED_COMBINED_ASSIGMENT_OPERATOR); + $fix = $phpcsFile->addFixableError($errorMessage, $equalPointer, self::CODE_REQUIRED_COMBINED_ASSIGNMENT_OPERATOR); if (!$fix) { return; } $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($equalPointer, $operators[$tokens[$operatorPointer]['code']]); - FixerHelper::removeBetweenIncluding($phpcsFile, $equalPointer + 1, $operatorPointer); + + FixerHelper::change($phpcsFile, $equalPointer, $operatorPointer, $operators[$tokens[$operatorPointer]['code']]); + $phpcsFile->fixer->endChangeset(); } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ForbiddenClassesSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ForbiddenClassesSniff.php index 382845313..165840ed7 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ForbiddenClassesSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ForbiddenClassesSniff.php @@ -49,7 +49,7 @@ class ForbiddenClassesSniff implements Sniff /** @var array */ public $forbiddenTraits = []; - /** @var array */ + /** @var list */ private static $keywordReferences = ['self', 'parent', 'static']; /** @@ -138,7 +138,7 @@ public function process(File $phpcsFile, $tokenPointer): void } /** - * @param array{fullyQualifiedName: string, startPointer: int|null, endPointer: int|null}[] $references + * @param list $references * @param array $forbiddenNames */ private function checkReferences( @@ -199,8 +199,9 @@ private function checkReferences( } $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($reference['startPointer'], $alternative); - FixerHelper::removeBetweenIncluding($phpcsFile, $reference['startPointer'] + 1, $reference['endPointer']); + + FixerHelper::change($phpcsFile, $reference['startPointer'], $reference['endPointer'], $alternative); + $phpcsFile->fixer->endChangeset(); } } @@ -215,7 +216,7 @@ private function isTraitsConflictResolutionToken(array $token): bool } /** - * @return array{fullyQualifiedName: string, startPointer: int|null, endPointer: int|null}[] + * @return list */ private function getAllReferences(File $phpcsFile, int $startPointer, int $endPointer): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/OptimizedFunctionsWithoutUnpackingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/OptimizedFunctionsWithoutUnpackingSniff.php index c821fe40d..cc304bbbe 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/OptimizedFunctionsWithoutUnpackingSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/OptimizedFunctionsWithoutUnpackingSniff.php @@ -99,6 +99,11 @@ public function process(File $phpcsFile, $pointer): void return; } + if (TokenHelper::findNextEffective($phpcsFile, $nextTokenAfterSeparatorPointer + 1) === $closeBracketPointer) { + // First class callables + return; + } + $phpcsFile->addError( sprintf('Function %s is specialized by PHP and should not use argument unpacking.', $invokedName), $nextTokenAfterSeparatorPointer, diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireExplicitAssertionSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireExplicitAssertionSniff.php index 82ec7f8f1..49466b11d 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireExplicitAssertionSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireExplicitAssertionSniff.php @@ -5,6 +5,7 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprIntegerNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode; use PHPStan\PhpDocParser\Ast\Type\ConstTypeNode; use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; @@ -12,7 +13,7 @@ use PHPStan\PhpDocParser\Ast\Type\ThisTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode; -use SlevomatCodingStandard\Helpers\Annotation\VariableAnnotation; +use SlevomatCodingStandard\Helpers\Annotation; use SlevomatCodingStandard\Helpers\AnnotationHelper; use SlevomatCodingStandard\Helpers\FixerHelper; use SlevomatCodingStandard\Helpers\IndentationHelper; @@ -86,22 +87,24 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void $codePointer = $firstPointerOnPreviousLine; } - $variableAnnotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $docCommentOpenPointer, '@var'); + /** @var list> $variableAnnotations */ + $variableAnnotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer, '@var'); if (count($variableAnnotations) === 0) { return; } - /** @var VariableAnnotation $variableAnnotation */ foreach (array_reverse($variableAnnotations) as $variableAnnotation) { if ($variableAnnotation->isInvalid()) { continue; } - if ($variableAnnotation->getVariableName() === null) { + $variableName = $variableAnnotation->getValue()->variableName; + + if ($variableName === '') { continue; } - $variableAnnotationType = $variableAnnotation->getType(); + $variableAnnotationType = $variableAnnotation->getValue()->type; if ( $variableAnnotationType instanceof UnionTypeNode @@ -119,7 +122,7 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void /** @var IdentifierTypeNode|ThisTypeNode|UnionTypeNode|GenericTypeNode $variableAnnotationType */ $variableAnnotationType = $variableAnnotationType; - $assertion = $this->createAssert($variableAnnotation->getVariableName(), $variableAnnotationType); + $assertion = $this->createAssert($variableName, $variableAnnotationType); if ($assertion === null) { continue; @@ -131,7 +134,7 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void continue; } - if ($variableAnnotation->getVariableName() !== $tokens[$codePointer]['content']) { + if ($variableName !== $tokens[$codePointer]['content']) { continue; } @@ -144,7 +147,7 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void $variablePointerInList = TokenHelper::findNextContent( $phpcsFile, T_VARIABLE, - $variableAnnotation->getVariableName(), + $variableName, $listParenthesisOpener + 1, $tokens[$listParenthesisOpener]['parenthesis_closer'] ); @@ -164,7 +167,7 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void $variablePointerInList = TokenHelper::findNextContent( $phpcsFile, T_VARIABLE, - $variableAnnotation->getVariableName(), + $variableName, $codePointer + 1, $tokens[$codePointer]['bracket_closer'] ); @@ -184,7 +187,7 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void $variablePointerInWhile = TokenHelper::findNextContent( $phpcsFile, T_VARIABLE, - $variableAnnotation->getVariableName(), + $variableName, $tokens[$codePointer]['parenthesis_opener'] + 1, $tokens[$codePointer]['parenthesis_closer'] ); @@ -206,7 +209,7 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void $variablePointerInForeach = TokenHelper::findNextContent( $phpcsFile, T_VARIABLE, - $variableAnnotation->getVariableName(), + $variableName, $asPointer + 1, $tokens[$codePointer]['parenthesis_closer'] ); @@ -364,7 +367,7 @@ private function createAssert(string $variableName, TypeNode $typeNode): ?string /** * @param IdentifierTypeNode|ThisTypeNode|GenericTypeNode $typeNode - * @return string[] + * @return list */ private function createConditions(string $variableName, TypeNode $typeNode): array { @@ -442,12 +445,14 @@ private function createConditions(string $variableName, TypeNode $typeNode): arr if ( $this->enableAdvancedStringTypes - && in_array($typeNode->name, ['non-empty-string', 'callable-string', 'numeric-string'], true) + && in_array($typeNode->name, ['non-empty-string', 'non-falsy-string', 'callable-string', 'numeric-string'], true) ) { $conditions = [sprintf('\is_string(%s)', $variableName)]; if ($typeNode->name === 'non-empty-string') { $conditions[] = sprintf("%s !== ''", $variableName); + } elseif ($typeNode->name === 'non-falsy-string') { + $conditions[] = sprintf('(bool) %s === true', $variableName); } elseif ($typeNode->name === 'callable-string') { $conditions[] = sprintf('\is_callable(%s)', $variableName); } else { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Strings/DisallowVariableParsingSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Strings/DisallowVariableParsingSniff.php new file mode 100644 index 000000000..45a8c4048 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Strings/DisallowVariableParsingSniff.php @@ -0,0 +1,154 @@ + + */ + public function register(): array + { + return [ + T_DOUBLE_QUOTED_STRING, + T_HEREDOC, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stringPointer + */ + public function process(File $phpcsFile, $stringPointer): void + { + if (!$this->disallowDollarCurlySyntax && !$this->disallowCurlyDollarSyntax && !$this->disallowSimpleSyntax) { + throw new UnexpectedValueException('No option is set.'); + } + + $tokens = $phpcsFile->getTokens(); + $tokenContent = $tokens[$stringPointer]['content']; + + if (strpos($tokenContent, '$') === false) { + return; + } + + $stringTokens = $tokens[$stringPointer]['code'] === T_HEREDOC + ? token_get_all('disallowDollarCurlySyntax && $this->getTokenContent($stringToken) === '${') { + $usedVariable = $stringToken[1]; + + for ($j = $i + 1; $j < count($stringTokens); $j++) { + $usedVariable .= $this->getTokenContent($stringTokens[$j]); + + if ($this->getTokenContent($stringTokens[$j]) === '}') { + $phpcsFile->addError( + sprintf( + 'Using variable syntax "${...}" inside string is disallowed as syntax "${...}" is deprecated as of PHP 8.2, found "%s".', + $usedVariable + ), + $stringPointer, + self::CODE_DISALLOWED_DOLLAR_CURLY_SYNTAX + ); + + break; + } + } + } elseif ($stringToken[0] === T_VARIABLE) { + if ($this->disallowCurlyDollarSyntax && $this->getTokenContent($stringTokens[$i - 1]) === '{') { + $usedVariable = $stringToken[1]; + + for ($j = $i + 1; $j < count($stringTokens); $j++) { + $stringTokenContent = $this->getTokenContent($stringTokens[$j]); + if ($stringTokenContent === '}') { + break; + } + + $usedVariable .= $stringTokenContent; + } + + $phpcsFile->addError( + sprintf( + 'Using variable syntax "{$...}" inside string is disallowed, found "{%s}".', + $usedVariable + ), + $stringPointer, + self::CODE_DISALLOWED_CURLY_DOLLAR_SYNTAX + ); + } elseif ($this->disallowSimpleSyntax) { + $error = true; + + for ($j = $i - 1; $j >= 0; $j--) { + $stringTokenContent = $this->getTokenContent($stringTokens[$j]); + + if (in_array($stringTokenContent, ['{', '${'], true)) { + $error = false; + break; + } + + if ($stringTokenContent === '}') { + break; + } + } + + if ($error) { + $phpcsFile->addError( + sprintf( + 'Using variable syntax "$..." inside string is disallowed, found "%s".', + $this->getTokenContent($stringToken) + ), + $stringPointer, + self::CODE_DISALLOWED_SIMPLE_SYNTAX + ); + } + } + } + } + } + + /** + * @param array{0: int, 1: string}|string $token + */ + private function getTokenContent($token): string + { + return is_array($token) ? $token[1] : $token; + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TestCase.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TestCase.php index dea3d24ad..74d440f94 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TestCase.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TestCase.php @@ -7,6 +7,7 @@ use PHP_CodeSniffer\Files\LocalFile; use PHP_CodeSniffer\Runner; use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Common; use ReflectionClass; use function array_map; use function array_merge; @@ -29,9 +30,9 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { /** - * @param (string|int|bool|array)[] $sniffProperties - * @param string[] $codesToCheck - * @param string[] $cliArgs + * @param array> $sniffProperties + * @param list $codesToCheck + * @param list $cliArgs */ protected static function checkFile(string $filePath, array $sniffProperties = [], array $codesToCheck = [], array $cliArgs = []): File { @@ -46,7 +47,7 @@ protected static function checkFile(string $filePath, array $sniffProperties = [ $codeSniffer->ruleset->ruleset[self::getSniffName()]['properties'] = $sniffProperties; } - $sniffClassName = self::getSniffClassName(); + $sniffClassName = static::getSniffClassName(); /** @var Sniff $sniff */ $sniff = new $sniffClassName(); @@ -76,6 +77,12 @@ protected static function assertNoSniffErrorInFile(File $phpcsFile): void self::assertEmpty($errors, sprintf('No errors expected, but %d errors found.', count($errors))); } + protected static function assertNoSniffWarningInFile(File $phpcsFile): void + { + $warnings = $phpcsFile->getWarnings(); + self::assertEmpty($warnings, sprintf('No warnings expected, but %d warnings found.', count($warnings))); + } + protected static function assertSniffError(File $phpcsFile, int $line, string $code, ?string $message = null): void { $errors = $phpcsFile->getErrors(); @@ -101,6 +108,31 @@ protected static function assertSniffError(File $phpcsFile, int $line, string $c ); } + protected static function assertSniffWarning(File $phpcsFile, int $line, string $code, ?string $message = null): void + { + $errors = $phpcsFile->getWarnings(); + self::assertTrue(isset($errors[$line]), sprintf('Expected warning on line %s, but none found.', $line)); + + $sniffCode = sprintf('%s.%s', self::getSniffName(), $code); + + self::assertTrue( + self::hasError($errors[$line], $sniffCode, $message), + sprintf( + 'Expected warning %s%s, but none found on line %d.%sWarnings found on line %d:%s%s%s', + $sniffCode, + $message !== null + ? sprintf(' with message "%s"', $message) + : '', + $line, + PHP_EOL . PHP_EOL, + $line, + PHP_EOL, + self::getFormattedErrors($errors[$line]), + PHP_EOL + ) + ); + } + protected static function assertNoSniffError(File $phpcsFile, int $line): void { $errors = $phpcsFile->getErrors(); @@ -123,27 +155,10 @@ protected static function assertAllFixedInFile(File $phpcsFile): void self::assertStringEqualsFile(preg_replace('~(\\.php)$~', '.fixed\\1', $phpcsFile->getFilename()), $phpcsFile->fixer->getContents()); } - private static function getSniffName(): string - { - return preg_replace( - [ - '~\\\~', - '~\.Sniffs~', - '~Sniff$~', - ], - [ - '.', - '', - '', - ], - self::getSniffClassName() - ); - } - /** * @return class-string */ - private static function getSniffClassName(): string + protected static function getSniffClassName(): string { /** @var class-string $sniffClassName */ $sniffClassName = substr(static::class, 0, -strlen('Test')); @@ -151,17 +166,22 @@ private static function getSniffClassName(): string return $sniffClassName; } + protected static function getSniffName(): string + { + return Common::getSniffCode(static::getSniffClassName()); + } + private static function getSniffClassReflection(): ReflectionClass { static $reflections = []; - $className = self::getSniffClassName(); + $className = static::getSniffClassName(); return $reflections[$className] ?? $reflections[$className] = new ReflectionClass($className); } /** - * @param (string|int)[][][] $errorsOnLine + * @param list> $errorsOnLine */ private static function hasError(array $errorsOnLine, string $sniffCode, ?string $message): bool { @@ -191,7 +211,7 @@ private static function hasError(array $errorsOnLine, string $sniffCode, ?string } /** - * @param (string|int|bool)[][][] $errors + * @param list> $errors */ private static function getFormattedErrors(array $errors): string { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php index bd32cbab0..998798182 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php @@ -145,8 +145,9 @@ public function process(File $phpcsFile, $openTagPointer): void ); if ($fix) { $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($strictTypesPointer, $format); - FixerHelper::removeBetweenIncluding($phpcsFile, $strictTypesPointer + 1, $numberPointer); + + FixerHelper::change($phpcsFile, $strictTypesPointer, $numberPointer, $format); + $phpcsFile->fixer->endChangeset(); } } @@ -171,8 +172,9 @@ public function process(File $phpcsFile, $openTagPointer): void ); if ($fix) { $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($openTagPointer, 'fixer->endChangeset(); } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowArrayTypeHintSyntaxSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowArrayTypeHintSyntaxSniff.php index 1bd69d76b..bc8bc6262 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowArrayTypeHintSyntaxSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowArrayTypeHintSyntaxSniff.php @@ -4,17 +4,20 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use PHPStan\PhpDocParser\Ast\AbstractNodeVisitor; +use PHPStan\PhpDocParser\Ast\Node; +use PHPStan\PhpDocParser\Ast\NodeTraverser; +use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode; use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode; use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode; -use SlevomatCodingStandard\Helpers\Annotation\Annotation; -use SlevomatCodingStandard\Helpers\Annotation\GenericAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ParameterAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\ReturnAnnotation; use SlevomatCodingStandard\Helpers\AnnotationHelper; use SlevomatCodingStandard\Helpers\AnnotationTypeHelper; +use SlevomatCodingStandard\Helpers\DocCommentHelper; use SlevomatCodingStandard\Helpers\FixerHelper; use SlevomatCodingStandard\Helpers\FunctionHelper; use SlevomatCodingStandard\Helpers\NamespaceHelper; @@ -35,7 +38,7 @@ class DisallowArrayTypeHintSyntaxSniff implements Sniff public const CODE_DISALLOWED_ARRAY_TYPE_HINT_SYNTAX = 'DisallowedArrayTypeHintSyntax'; - /** @var string[] */ + /** @var list */ public $traversableTypeHints = []; /** @var array|null */ @@ -59,109 +62,144 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void { $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); - foreach ($annotations as $annotationByName) { - foreach ($annotationByName as $annotation) { - if ($annotation instanceof GenericAnnotation) { - continue; - } + foreach ($annotations as $annotation) { + $arrayTypeNodes = $this->getArrayTypeNodes($annotation->getValue()); - if ($annotation->isInvalid()) { + foreach ($arrayTypeNodes as $arrayTypeNode) { + $fix = $phpcsFile->addFixableError( + sprintf( + 'Usage of array type hint syntax in "%s" is disallowed, use generic type hint syntax instead.', + AnnotationTypeHelper::print($arrayTypeNode) + ), + $annotation->getStartPointer(), + self::CODE_DISALLOWED_ARRAY_TYPE_HINT_SYNTAX + ); + + if (!$fix) { continue; } - foreach (AnnotationHelper::getAnnotationTypes($annotation) as $annotationType) { - $unionTypeNodes = AnnotationTypeHelper::getUnionTypeNodes($annotationType); - foreach ($this->getArrayTypeNodes($annotationType) as $arrayTypeNode) { - $fix = $phpcsFile->addFixableError( - sprintf( - 'Usage of array type hint syntax in "%s" is disallowed, use generic type hint syntax instead.', - AnnotationTypeHelper::export($arrayTypeNode) - ), - $annotation->getStartPointer(), - self::CODE_DISALLOWED_ARRAY_TYPE_HINT_SYNTAX - ); + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); - if (!$fix) { - continue; - } + /** @var list $unionTypeNodes */ + $unionTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), UnionTypeNode::class); - $unionTypeNode = $this->findUnionTypeThatContainsArrayType($arrayTypeNode, $unionTypeNodes); - - if ($unionTypeNode !== null) { - $genericIdentifier = $this->findGenericIdentifier($phpcsFile, $unionTypeNode, $annotation); - if ($genericIdentifier !== null) { - $genericTypeNode = new GenericTypeNode( - new IdentifierTypeNode($genericIdentifier), - [$this->fixArrayNode($arrayTypeNode->type)] - ); - $fixedAnnotationContent = AnnotationHelper::fixAnnotationType( - $phpcsFile, - $annotation, - $unionTypeNode, - $genericTypeNode - ); - } else { - $genericTypeNode = new GenericTypeNode( - new IdentifierTypeNode('array'), - [$this->fixArrayNode($arrayTypeNode->type)] - ); - $fixedAnnotationContent = AnnotationHelper::fixAnnotationType( - $phpcsFile, - $annotation, - $arrayTypeNode, - $genericTypeNode - ); - } - } else { - $genericIdentifier = $this->findGenericIdentifier($phpcsFile, $arrayTypeNode, $annotation) ?? 'array'; - - $genericTypeNode = new GenericTypeNode( - new IdentifierTypeNode($genericIdentifier), - [$this->fixArrayNode($arrayTypeNode->type)] - ); - $fixedAnnotationContent = AnnotationHelper::fixAnnotationType( - $phpcsFile, - $annotation, - $arrayTypeNode, - $genericTypeNode - ); - } + $unionTypeNode = $this->findUnionTypeThatContainsArrayType($arrayTypeNode, $unionTypeNodes); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($annotation->getStartPointer(), $fixedAnnotationContent); - FixerHelper::removeBetweenIncluding($phpcsFile, $annotation->getStartPointer() + 1, $annotation->getEndPointer()); - $phpcsFile->fixer->endChangeset(); + if ($unionTypeNode !== null) { + $genericIdentifier = $this->findGenericIdentifier( + $phpcsFile, + $docCommentOpenPointer, + $unionTypeNode, + $annotation->getValue() + ); + if ($genericIdentifier !== null) { + $genericTypeNode = new GenericTypeNode( + new IdentifierTypeNode($genericIdentifier), + [$this->fixArrayNode($arrayTypeNode->type)] + ); + $fixedDocComment = AnnotationHelper::fixAnnotation( + $parsedDocComment, + $annotation, + $unionTypeNode, + $genericTypeNode + ); + } else { + $genericTypeNode = new GenericTypeNode( + new IdentifierTypeNode('array'), + [$this->fixArrayNode($arrayTypeNode->type)] + ); + $fixedDocComment = AnnotationHelper::fixAnnotation( + $parsedDocComment, + $annotation, + $arrayTypeNode, + $genericTypeNode + ); } + } else { + $genericIdentifier = $this->findGenericIdentifier( + $phpcsFile, + $docCommentOpenPointer, + $arrayTypeNode, + $annotation->getValue() + ) ?? 'array'; + + $genericTypeNode = new GenericTypeNode( + new IdentifierTypeNode($genericIdentifier), + [$this->fixArrayNode($arrayTypeNode->type)] + ); + $fixedDocComment = AnnotationHelper::fixAnnotation($parsedDocComment, $annotation, $arrayTypeNode, $genericTypeNode); } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change( + $phpcsFile, + $parsedDocComment->getOpenPointer(), + $parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + $phpcsFile->fixer->endChangeset(); } } } /** - * @return ArrayTypeNode[] + * @return list */ - public function getArrayTypeNodes(TypeNode $typeNode): array + public function getArrayTypeNodes(Node $node): array { - $arrayTypeNodes = AnnotationTypeHelper::getArrayTypeNodes($typeNode); + static $visitor; + static $traverser; - $arrayTypeNodesToIgnore = []; - foreach ($arrayTypeNodes as $arrayTypeNode) { - if (!($arrayTypeNode->type instanceof ArrayTypeNode)) { - continue; - } + if ($visitor === null) { + $visitor = new class extends AbstractNodeVisitor { - $arrayTypeNodesToIgnore[] = $arrayTypeNode->type; - } + /** @var list */ + private $nodes = []; - foreach ($arrayTypeNodes as $no => $arrayTypeNode) { - if (!in_array($arrayTypeNode, $arrayTypeNodesToIgnore, true)) { - continue; - } + /** + * @return Node|list|NodeTraverser::*|null + */ + public function enterNode(Node $node) + { + if ($node instanceof ArrayTypeNode) { + $this->nodes[] = $node; + + if ($node->type instanceof ArrayTypeNode) { + return NodeTraverser::DONT_TRAVERSE_CHILDREN; + } + } + + return null; + } + + public function cleanNodes(): void + { + $this->nodes = []; + } + + /** + * @return list + */ + public function getNodes(): array + { + return $this->nodes; + } - unset($arrayTypeNodes[$no]); + }; } - return $arrayTypeNodes; + if ($traverser === null) { + $traverser = new NodeTraverser([$visitor]); + } + + $visitor->cleanNodes(); + + $traverser->traverse([$node]); + + return $visitor->getNodes(); } private function fixArrayNode(TypeNode $node): TypeNode @@ -174,7 +212,7 @@ private function fixArrayNode(TypeNode $node): TypeNode } /** - * @param UnionTypeNode[] $unionTypeNodes + * @param list $unionTypeNodes */ private function findUnionTypeThatContainsArrayType(ArrayTypeNode $arrayTypeNode, array $unionTypeNodes): ?UnionTypeNode { @@ -187,26 +225,31 @@ private function findUnionTypeThatContainsArrayType(ArrayTypeNode $arrayTypeNode return null; } - private function findGenericIdentifier(File $phpcsFile, TypeNode $typeNode, Annotation $annotation): ?string + private function findGenericIdentifier( + File $phpcsFile, + int $docCommentOpenPointer, + TypeNode $typeNode, + PhpDocTagValueNode $annotationValue + ): ?string { if (!$typeNode instanceof UnionTypeNode) { - if (!$annotation instanceof ParameterAnnotation && !$annotation instanceof ReturnAnnotation) { + if (!$annotationValue instanceof ParamTagValueNode && !$annotationValue instanceof ReturnTagValueNode) { return null; } - $functionPointer = TokenHelper::findNext($phpcsFile, TokenHelper::$functionTokenCodes, $annotation->getStartPointer() + 1); + $functionPointer = TokenHelper::findNext($phpcsFile, TokenHelper::$functionTokenCodes, $docCommentOpenPointer + 1); if ($functionPointer === null || $phpcsFile->getTokens()[$functionPointer]['code'] !== T_FUNCTION) { return null; } - if ($annotation instanceof ParameterAnnotation) { + if ($annotationValue instanceof ParamTagValueNode) { $parameterTypeHints = FunctionHelper::getParametersTypeHints($phpcsFile, $functionPointer); return array_key_exists( - $annotation->getParameterName(), + $annotationValue->parameterName, $parameterTypeHints - ) && $parameterTypeHints[$annotation->getParameterName()] !== null - ? $parameterTypeHints[$annotation->getParameterName()]->getTypeHint() + ) && $parameterTypeHints[$annotationValue->parameterName] !== null + ? $parameterTypeHints[$annotationValue->parameterName]->getTypeHint() : null; } @@ -222,7 +265,7 @@ private function findGenericIdentifier(File $phpcsFile, TypeNode $typeNode, Anno $typeNode->types[0] instanceof ArrayTypeNode && $typeNode->types[1] instanceof IdentifierTypeNode && $this->isTraversableType( - TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $annotation->getStartPointer(), $typeNode->types[1]->name) + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $docCommentOpenPointer, $typeNode->types[1]->name) ) ) { return $typeNode->types[1]->name; @@ -232,7 +275,7 @@ private function findGenericIdentifier(File $phpcsFile, TypeNode $typeNode, Anno $typeNode->types[1] instanceof ArrayTypeNode && $typeNode->types[0] instanceof IdentifierTypeNode && $this->isTraversableType( - TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $annotation->getStartPointer(), $typeNode->types[0]->name) + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $docCommentOpenPointer, $typeNode->types[0]->name) ) ) { return $typeNode->types[0]->name; diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowMixedTypeHintSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowMixedTypeHintSniff.php index 73c27e8b8..2c29985ed 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowMixedTypeHintSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowMixedTypeHintSniff.php @@ -4,9 +4,8 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; -use SlevomatCodingStandard\Helpers\Annotation\GenericAnnotation; +use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use SlevomatCodingStandard\Helpers\AnnotationHelper; -use SlevomatCodingStandard\Helpers\AnnotationTypeHelper; use SlevomatCodingStandard\Helpers\SuppressHelper; use function sprintf; use function strtolower; @@ -45,31 +44,22 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); - foreach ($annotations as $annotationByName) { - foreach ($annotationByName as $annotation) { - if ($annotation instanceof GenericAnnotation) { - continue; - } + foreach ($annotations as $annotation) { + /** @var list $identifierTypeNodes */ + $identifierTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), IdentifierTypeNode::class); + + foreach ($identifierTypeNodes as $typeHintNode) { + $typeHint = $typeHintNode->name; - if ($annotation->isInvalid()) { + if (strtolower($typeHint) !== 'mixed') { continue; } - foreach (AnnotationHelper::getAnnotationTypes($annotation) as $annotationType) { - foreach (AnnotationTypeHelper::getIdentifierTypeNodes($annotationType) as $typeHintNode) { - $typeHint = AnnotationTypeHelper::getTypeHintFromNode($typeHintNode); - - if (strtolower($typeHint) !== 'mixed') { - continue; - } - - $phpcsFile->addError( - 'Usage of "mixed" type hint is disallowed.', - $annotation->getStartPointer(), - self::CODE_DISALLOWED_MIXED_TYPE_HINT - ); - } - } + $phpcsFile->addError( + 'Usage of "mixed" type hint is disallowed.', + $annotation->getStartPointer(), + self::CODE_DISALLOWED_MIXED_TYPE_HINT + ); } } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/LongTypeHintsSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/LongTypeHintsSniff.php index b8cb362f8..8bc9c2f2a 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/LongTypeHintsSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/LongTypeHintsSniff.php @@ -5,9 +5,8 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; -use SlevomatCodingStandard\Helpers\Annotation\GenericAnnotation; use SlevomatCodingStandard\Helpers\AnnotationHelper; -use SlevomatCodingStandard\Helpers\AnnotationTypeHelper; +use SlevomatCodingStandard\Helpers\DocCommentHelper; use SlevomatCodingStandard\Helpers\FixerHelper; use function sprintf; use function strtolower; @@ -36,59 +35,56 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void { $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); - foreach ($annotations as $annotationName => $annotationByName) { - foreach ($annotationByName as $annotation) { - if ($annotation instanceof GenericAnnotation) { - continue; - } + foreach ($annotations as $annotation) { + /** @var list $identifierTypeNodes */ + $identifierTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), IdentifierTypeNode::class); - if ($annotation->isInvalid()) { - continue; - } + foreach ($identifierTypeNodes as $typeHintNode) { + $typeHint = $typeHintNode->name; - foreach (AnnotationHelper::getAnnotationTypes($annotation) as $annotationType) { - foreach (AnnotationTypeHelper::getIdentifierTypeNodes($annotationType) as $typeHintNode) { - $typeHint = AnnotationTypeHelper::getTypeHintFromNode($typeHintNode); + $lowercasedTypeHint = strtolower($typeHint); - $lowercasedTypeHint = strtolower($typeHint); + $shortTypeHint = null; + if ($lowercasedTypeHint === 'integer') { + $shortTypeHint = 'int'; + } elseif ($lowercasedTypeHint === 'boolean') { + $shortTypeHint = 'bool'; + } - $shortTypeHint = null; - if ($lowercasedTypeHint === 'integer') { - $shortTypeHint = 'int'; - } elseif ($lowercasedTypeHint === 'boolean') { - $shortTypeHint = 'bool'; - } + if ($shortTypeHint === null) { + continue; + } - if ($shortTypeHint === null) { - continue; - } + $fix = $phpcsFile->addFixableError(sprintf( + 'Expected "%s" but found "%s" in %s annotation.', + $shortTypeHint, + $typeHint, + $annotation->getName() + ), $annotation->getStartPointer(), self::CODE_USED_LONG_TYPE_HINT); - $fix = $phpcsFile->addFixableError(sprintf( - 'Expected "%s" but found "%s" in %s annotation.', - $shortTypeHint, - $typeHint, - $annotationName - ), $annotation->getStartPointer(), self::CODE_USED_LONG_TYPE_HINT); + if (!$fix) { + continue; + } - if (!$fix) { - continue; - } + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); - $fixedAnnotationContent = AnnotationHelper::fixAnnotationType( - $phpcsFile, - $annotation, - $typeHintNode, - new IdentifierTypeNode($shortTypeHint) - ); + $fixedDocComment = AnnotationHelper::fixAnnotation( + $parsedDocComment, + $annotation, + $typeHintNode, + new IdentifierTypeNode($shortTypeHint) + ); - $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($annotation->getStartPointer(), $fixedAnnotationContent); - FixerHelper::removeBetweenIncluding($phpcsFile, $annotation->getStartPointer() + 1, $annotation->getEndPointer()); + FixerHelper::change( + $phpcsFile, + $parsedDocComment->getOpenPointer(), + $parsedDocComment->getClosePointer(), + $fixedDocComment + ); - $phpcsFile->fixer->endChangeset(); - } - } + $phpcsFile->fixer->endChangeset(); } } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullTypeHintOnLastPositionSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullTypeHintOnLastPositionSniff.php index 5733ec886..eb7a3a439 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullTypeHintOnLastPositionSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullTypeHintOnLastPositionSniff.php @@ -6,10 +6,11 @@ use PHP_CodeSniffer\Sniffs\Sniff; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode; -use SlevomatCodingStandard\Helpers\Annotation\GenericAnnotation; use SlevomatCodingStandard\Helpers\AnnotationHelper; use SlevomatCodingStandard\Helpers\AnnotationTypeHelper; +use SlevomatCodingStandard\Helpers\DocCommentHelper; use SlevomatCodingStandard\Helpers\FixerHelper; +use SlevomatCodingStandard\Helpers\PhpDocParserHelper; use function count; use function sprintf; use function strtolower; @@ -38,77 +39,69 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void { $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); - foreach ($annotations as $annotationByName) { - foreach ($annotationByName as $annotation) { - if ($annotation instanceof GenericAnnotation) { + foreach ($annotations as $annotation) { + /** @var list $unionTypeNodes */ + $unionTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), UnionTypeNode::class); + + foreach ($unionTypeNodes as $unionTypeNode) { + $nullTypeNode = null; + $nullPosition = 0; + $position = 0; + foreach ($unionTypeNode->types as $typeNode) { + if ($typeNode instanceof IdentifierTypeNode && strtolower($typeNode->name) === 'null') { + $nullTypeNode = $typeNode; + $nullPosition = $position; + break; + } + + $position++; + } + + if ($nullTypeNode === null) { continue; } - if ($annotation->isInvalid()) { + if ($nullPosition === count($unionTypeNode->types) - 1) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Null type hint should be on last position in "%s".', AnnotationTypeHelper::print($unionTypeNode)), + $annotation->getStartPointer(), + self::CODE_NULL_TYPE_HINT_NOT_ON_LAST_POSITION + ); + + if (!$fix) { continue; } - foreach (AnnotationHelper::getAnnotationTypes($annotation) as $annotationType) { - foreach (AnnotationTypeHelper::getUnionTypeNodes($annotationType) as $unionTypeNode) { - $nullTypeNode = null; - $nullPosition = 0; - $position = 0; - foreach ($unionTypeNode->types as $typeNode) { - if ($typeNode instanceof IdentifierTypeNode && strtolower($typeNode->name) === 'null') { - $nullTypeNode = $typeNode; - $nullPosition = $position; - break; - } - - $position++; - } - - if ($nullTypeNode === null) { - continue; - } - - if ($nullPosition === count($unionTypeNode->types) - 1) { - continue; - } - - $fix = $phpcsFile->addFixableError( - sprintf('Null type hint should be on last position in "%s".', AnnotationTypeHelper::export($unionTypeNode)), - $annotation->getStartPointer(), - self::CODE_NULL_TYPE_HINT_NOT_ON_LAST_POSITION - ); - - if (!$fix) { - continue; - } - - $phpcsFile->fixer->beginChangeset(); - - FixerHelper::removeBetweenIncluding($phpcsFile, $annotation->getStartPointer(), $annotation->getEndPointer()); - - $fixedTypeNodes = []; - foreach ($unionTypeNode->types as $typeNode) { - if ($typeNode === $nullTypeNode) { - continue; - } - - $fixedTypeNodes[] = $typeNode; - } - $fixedTypeNodes[] = $nullTypeNode; - $fixedUnionTypeNode = new UnionTypeNode($fixedTypeNodes); - - $fixedAnnotationContent = AnnotationHelper::fixAnnotationType( - $phpcsFile, - $annotation, - $unionTypeNode, - $fixedUnionTypeNode - ); - - $phpcsFile->fixer->replaceToken($annotation->getStartPointer(), $fixedAnnotationContent); - FixerHelper::removeBetweenIncluding($phpcsFile, $annotation->getStartPointer() + 1, $annotation->getEndPointer()); - - $phpcsFile->fixer->endChangeset(); + $fixedTypeNodes = []; + foreach ($unionTypeNode->types as $typeNode) { + if ($typeNode === $nullTypeNode) { + continue; } + + $fixedTypeNodes[] = $typeNode; } + $fixedTypeNodes[] = $nullTypeNode; + + $fixedUnionTypeNode = PhpDocParserHelper::cloneNode($unionTypeNode); + $fixedUnionTypeNode->types = $fixedTypeNodes; + + $phpcsFile->fixer->beginChangeset(); + + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + $fixedDocComment = AnnotationHelper::fixAnnotation($parsedDocComment, $annotation, $unionTypeNode, $fixedUnionTypeNode); + + FixerHelper::change( + $phpcsFile, + $parsedDocComment->getOpenPointer(), + $parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + $phpcsFile->fixer->endChangeset(); } } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSniff.php index 2ab911ae2..fa71a58fb 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSniff.php @@ -4,6 +4,10 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; +use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode; use PHPStan\PhpDocParser\Ast\Type\ArrayShapeNode; use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode; use PHPStan\PhpDocParser\Ast\Type\CallableTypeNode; @@ -12,10 +16,10 @@ use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\IntersectionTypeNode; use PHPStan\PhpDocParser\Ast\Type\NullableTypeNode; +use PHPStan\PhpDocParser\Ast\Type\ObjectShapeNode; use PHPStan\PhpDocParser\Ast\Type\ThisTypeNode; use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode; -use SlevomatCodingStandard\Helpers\Annotation\ParameterAnnotation; -use SlevomatCodingStandard\Helpers\Annotation\VariableAnnotation; +use SlevomatCodingStandard\Helpers\Annotation; use SlevomatCodingStandard\Helpers\AnnotationHelper; use SlevomatCodingStandard\Helpers\AnnotationTypeHelper; use SlevomatCodingStandard\Helpers\DocCommentHelper; @@ -41,11 +45,13 @@ use function sprintf; use function strtolower; use const T_BITWISE_AND; +use const T_COMMA; use const T_DOC_COMMENT_CLOSE_TAG; use const T_DOC_COMMENT_OPEN_TAG; use const T_DOC_COMMENT_STAR; use const T_ELLIPSIS; use const T_FUNCTION; +use const T_OPEN_PARENTHESIS; use const T_VARIABLE; class ParameterTypeHintSniff implements Sniff @@ -78,7 +84,7 @@ class ParameterTypeHintSniff implements Sniff /** @var bool|null */ public $enableStandaloneNullTrueFalseTypeHints = null; - /** @var string[] */ + /** @var list */ public $traversableTypeHints = []; /** @var array|null */ @@ -133,9 +139,9 @@ public function process(File $phpcsFile, $functionPointer): void } /** - * @param (TypeHint|null)[] $parametersTypeHints - * @param array $parametersAnnotations - * @param array $prefixedParametersAnnotations + * @param array $parametersTypeHints + * @param array|Annotation|Annotation> $parametersAnnotations + * @param array|Annotation> $prefixedParametersAnnotations */ private function checkTypeHints( File $phpcsFile, @@ -159,8 +165,34 @@ private function checkTypeHints( }) ); + $tokens = $phpcsFile->getTokens(); + + $isConstructor = FunctionHelper::isMethod($phpcsFile, $functionPointer) + && strtolower(FunctionHelper::getName($phpcsFile, $functionPointer)) === '__construct'; + foreach ($parametersWithoutTypeHint as $parameterName) { - if (!array_key_exists($parameterName, $parametersAnnotations) || $parametersAnnotations[$parameterName]->getType() === null) { + $isPropertyPromotion = false; + + if ($isConstructor) { + $parameterPointer = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $parameterName, + $tokens[$functionPointer]['parenthesis_opener'], + $tokens[$functionPointer]['parenthesis_closer'] + ); + + $pointerBeforeParameter = TokenHelper::findPrevious($phpcsFile, [T_COMMA, T_OPEN_PARENTHESIS], $parameterPointer - 1); + + $visibilityPointer = TokenHelper::findNextEffective($phpcsFile, $pointerBeforeParameter + 1); + + $isPropertyPromotion = in_array($tokens[$visibilityPointer]['code'], Tokens::$scopeModifiers, true); + } + + if ( + !array_key_exists($parameterName, $parametersAnnotations) + || $parametersAnnotations[$parameterName]->getValue() instanceof TypelessParamTagValueNode + ) { if (array_key_exists($parameterName, $prefixedParametersAnnotations)) { continue; } @@ -184,7 +216,7 @@ private function checkTypeHints( continue; } - $parameterTypeNode = $parametersAnnotations[$parameterName]->getType(); + $parameterTypeNode = $parametersAnnotations[$parameterName]->getValue()->type; if ( $parameterTypeNode instanceof IdentifierTypeNode @@ -206,7 +238,7 @@ private function checkTypeHints( $nullableParameterTypeHint = false; if (AnnotationTypeHelper::containsOneType($parameterTypeNode)) { - /** @var ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode|ConstTypeNode $parameterTypeNode */ + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode|ConstTypeNode $parameterTypeNode */ $parameterTypeNode = $parameterTypeNode; $typeHints[] = AnnotationTypeHelper::getTypeHintFromOneType( $parameterTypeNode, @@ -224,7 +256,7 @@ private function checkTypeHints( continue 2; } - /** @var ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode|ConstTypeNode $typeNode */ + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode|ConstTypeNode $typeNode */ $typeNode = $typeNode; $typeHint = AnnotationTypeHelper::getTypeHintFromOneType($typeNode, $canTryUnionTypeHint); @@ -307,6 +339,10 @@ private function checkTypeHints( continue; } + if ($isPropertyPromotion && $typeHint === 'callable') { + continue 2; + } + if (!TypeHintHelper::isValidTypeHint( $typeHint, $this->enableObjectTypeHint, @@ -339,7 +375,7 @@ private function checkTypeHints( FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), $parameterName, - AnnotationTypeHelper::export($parameterTypeNode) + AnnotationTypeHelper::print($parameterTypeNode) ), $functionPointer, self::CODE_MISSING_NATIVE_TYPE_HINT @@ -413,9 +449,9 @@ private function checkTypeHints( } /** - * @param (TypeHint|null)[] $parametersTypeHints - * @param array $parametersAnnotations - * @param array $prefixedParametersAnnotations + * @param array $parametersTypeHints + * @param array|Annotation|Annotation> $parametersAnnotations + * @param array|Annotation> $prefixedParametersAnnotations */ private function checkTraversableTypeHintSpecification( File $phpcsFile, @@ -445,9 +481,9 @@ private function checkTraversableTypeHintSpecification( $hasTraversableTypeHint = true; } elseif ( array_key_exists($parameterName, $parametersAnnotations) - && $parametersAnnotations[$parameterName]->getType() !== null + && !$parametersAnnotations[$parameterName]->getValue() instanceof TypelessParamTagValueNode && AnnotationTypeHelper::containsTraversableType( - $parametersAnnotations[$parameterName]->getType(), + $parametersAnnotations[$parameterName]->getValue()->type, $phpcsFile, $functionPointer, $this->getTraversableTypeHints() @@ -479,11 +515,12 @@ private function checkTraversableTypeHintSpecification( continue; } - $parameterTypeNode = $parametersAnnotations[$parameterName]->getType(); - if ($parameterTypeNode === null) { + if ($parametersAnnotations[$parameterName]->getValue() instanceof TypelessParamTagValueNode) { continue; } + $parameterTypeNode = $parametersAnnotations[$parameterName]->getValue()->type; + if ( ( !$hasTraversableTypeHint @@ -528,8 +565,8 @@ private function checkTraversableTypeHintSpecification( } /** - * @param (TypeHint|null)[] $parametersTypeHints - * @param array $parametersAnnotations + * @param array $parametersTypeHints + * @param array $parametersAnnotations */ private function checkUselessAnnotations( File $phpcsFile, @@ -548,7 +585,8 @@ private function checkUselessAnnotations( } $parameterAnnotation = $parametersAnnotations[$parameterName]; - if ($parameterAnnotation->getType() === null) { + + if ($parameterAnnotation->getValue() instanceof TypelessParamTagValueNode) { continue; } @@ -585,7 +623,7 @@ private function checkUselessAnnotations( continue; } - $docCommentOpenPointer = $parameterAnnotation instanceof VariableAnnotation + $docCommentOpenPointer = $parameterAnnotation->getValue() instanceof VarTagValueNode ? TokenHelper::findPrevious($phpcsFile, T_DOC_COMMENT_OPEN_TAG, $parameterAnnotation->getStartPointer() - 1) : DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $functionPointer); @@ -596,12 +634,12 @@ private function checkUselessAnnotations( $docCommentOpenPointer ); - $changeStart = $starPointer ?? $docCommentOpenPointer + 1; + $changeStart = $starPointer ?? $parameterAnnotation->getStartPointer(); /** @var int $changeEnd */ $changeEnd = TokenHelper::findNext( $phpcsFile, [T_DOC_COMMENT_CLOSE_TAG, T_DOC_COMMENT_STAR], - $parameterAnnotation->getEndPointer() + 1 + $parameterAnnotation->getEndPointer() ) - 1; $phpcsFile->fixer->beginChangeset(); @@ -633,7 +671,7 @@ private function getSniffName(string $sniffName): string } /** - * @return array + * @return list */ private function getTraversableTypeHints(): array { diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/PropertyTypeHintSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/PropertyTypeHintSniff.php index 575db5ad6..82a100fdd 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/PropertyTypeHintSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/PropertyTypeHintSniff.php @@ -4,6 +4,8 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode; use PHPStan\PhpDocParser\Ast\Type\ArrayShapeNode; use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode; use PHPStan\PhpDocParser\Ast\Type\CallableTypeNode; @@ -11,9 +13,10 @@ use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\IntersectionTypeNode; use PHPStan\PhpDocParser\Ast\Type\NullableTypeNode; +use PHPStan\PhpDocParser\Ast\Type\ObjectShapeNode; use PHPStan\PhpDocParser\Ast\Type\ThisTypeNode; use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode; -use SlevomatCodingStandard\Helpers\Annotation\VariableAnnotation; +use SlevomatCodingStandard\Helpers\Annotation; use SlevomatCodingStandard\Helpers\AnnotationHelper; use SlevomatCodingStandard\Helpers\AnnotationTypeHelper; use SlevomatCodingStandard\Helpers\DocCommentHelper; @@ -30,6 +33,7 @@ use function array_unique; use function array_values; use function count; +use function current; use function implode; use function in_array; use function sprintf; @@ -79,7 +83,7 @@ class PropertyTypeHintSniff implements Sniff /** @var bool|null */ public $enableStandaloneNullTrueFalseTypeHints = null; - /** @var string[] */ + /** @var list */ public $traversableTypeHints = []; /** @var array|null */ @@ -146,16 +150,22 @@ public function process(File $phpcsFile, $pointer): void return; } - if (DocCommentHelper::hasInheritdocAnnotation($phpcsFile, $propertyPointer)) { - return; - } + $docCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $propertyPointer); + if ($docCommentOpenPointer !== null) { + if (DocCommentHelper::hasInheritdocAnnotation($phpcsFile, $docCommentOpenPointer)) { + return; + } - /** @var VariableAnnotation[] $varAnnotations */ - $varAnnotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $propertyPointer, '@var'); - $prefixedPropertyAnnotations = $this->getValidPrefixedAnnotations($phpcsFile, $propertyPointer); + $varAnnotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer, '@var'); + $prefixedPropertyAnnotations = $this->getValidPrefixedAnnotations($phpcsFile, $docCommentOpenPointer); + + $propertyAnnotation = count($varAnnotations) > 0 ? current($varAnnotations) : null; + } else { + $propertyAnnotation = null; + $prefixedPropertyAnnotations = []; + } $propertyTypeHint = PropertyHelper::findTypeHint($phpcsFile, $propertyPointer); - $propertyAnnotation = count($varAnnotations) > 0 ? $varAnnotations[0] : null; $this->checkTypeHint($phpcsFile, $propertyPointer, $propertyTypeHint, $propertyAnnotation, $prefixedPropertyAnnotations); $this->checkTraversableTypeHintSpecification( @@ -169,13 +179,14 @@ public function process(File $phpcsFile, $pointer): void } /** - * @param VariableAnnotation[] $prefixedPropertyAnnotations + * @param Annotation|null $propertyAnnotation + * @param list> $prefixedPropertyAnnotations */ private function checkTypeHint( File $phpcsFile, int $propertyPointer, ?TypeHint $propertyTypeHint, - ?VariableAnnotation $propertyAnnotation, + ?Annotation $propertyAnnotation, array $prefixedPropertyAnnotations ): void { @@ -217,7 +228,7 @@ private function checkTypeHint( return; } - $typeNode = $propertyAnnotation->getType(); + $typeNode = $propertyAnnotation->getValue()->type; $originalTypeNode = $typeNode; if ($typeNode instanceof NullableTypeNode) { $typeNode = $typeNode->type; @@ -230,7 +241,7 @@ private function checkTypeHint( $nullableTypeHint = false; if (AnnotationTypeHelper::containsOneType($typeNode)) { - /** @var ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $typeNode */ + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $typeNode */ $typeNode = $typeNode; $typeHints[] = AnnotationTypeHelper::getTypeHintFromOneType($typeNode, false, $this->enableStandaloneNullTrueFalseTypeHints); @@ -242,7 +253,7 @@ private function checkTypeHint( return; } - /** @var ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $innerTypeNode */ + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $innerTypeNode */ $innerTypeNode = $innerTypeNode; $typeHint = AnnotationTypeHelper::getTypeHintFromOneType($innerTypeNode, $canTryUnionTypeHint); @@ -364,7 +375,7 @@ private function checkTypeHint( sprintf( 'Property %s does not have native type hint for its value but it should be possible to add it based on @var annotation "%s".', PropertyHelper::getFullyQualifiedName($phpcsFile, $propertyPointer), - AnnotationTypeHelper::export($typeNode) + AnnotationTypeHelper::print($typeNode) ), $propertyPointer, self::CODE_MISSING_NATIVE_TYPE_HINT @@ -415,13 +426,14 @@ private function checkTypeHint( } /** - * @param VariableAnnotation[] $prefixedPropertyAnnotations + * @param Annotation|null $propertyAnnotation + * @param list> $prefixedPropertyAnnotations */ private function checkTraversableTypeHintSpecification( File $phpcsFile, int $propertyPointer, ?TypeHint $propertyTypeHint, - ?VariableAnnotation $propertyAnnotation, + ?Annotation $propertyAnnotation, array $prefixedPropertyAnnotations ): void { @@ -453,7 +465,7 @@ private function checkTraversableTypeHintSpecification( return; } - $typeNode = $propertyAnnotation->getType(); + $typeNode = $propertyAnnotation->getValue()->type; if ( !$hasTraversableTypeHint @@ -491,7 +503,7 @@ private function checkUselessAnnotation( File $phpcsFile, int $propertyPointer, ?TypeHint $propertyTypeHint, - ?VariableAnnotation $propertyAnnotation + ?Annotation $propertyAnnotation ): void { if ($propertyAnnotation === null) { @@ -533,7 +545,6 @@ private function checkUselessAnnotation( } if ($this->isDocCommentUseless($phpcsFile, $propertyPointer)) { - /** @var int $docCommentOpenPointer */ $docCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $propertyPointer); $docCommentClosePointer = $phpcsFile->getTokens()[$docCommentOpenPointer]['comment_closer']; @@ -550,6 +561,7 @@ private function checkUselessAnnotation( /** @var int $changeStart */ $changeStart = TokenHelper::findPrevious($phpcsFile, T_DOC_COMMENT_STAR, $propertyAnnotation->getStartPointer() - 1); + /** @var int $changeEnd */ $changeEnd = TokenHelper::findNext( $phpcsFile, @@ -568,10 +580,13 @@ private function isDocCommentUseless(File $phpcsFile, int $propertyPointer): boo return false; } - $annotations = AnnotationHelper::getAnnotations($phpcsFile, $propertyPointer); - unset($annotations['@var']); + foreach (AnnotationHelper::getAnnotations($phpcsFile, $propertyPointer) as $annotation) { + if ($annotation->getName() !== '@var') { + return false; + } + } - return count($annotations) === 0; + return true; } private function reportUselessSuppress(File $phpcsFile, int $pointer, bool $isSuppressed, string $suppressName): void @@ -597,7 +612,7 @@ private function getSniffName(string $sniffName): string } /** - * @return array + * @return list */ private function getTraversableTypeHints(): array { @@ -611,16 +626,19 @@ private function getTraversableTypeHints(): array return $this->normalizedTraversableTypeHints; } - private function hasAnnotation(?VariableAnnotation $propertyAnnotation): bool + private function hasAnnotation(?Annotation $propertyAnnotation): bool { - return $propertyAnnotation !== null && $propertyAnnotation->getContent() !== null && !$propertyAnnotation->isInvalid(); + return $propertyAnnotation !== null && $propertyAnnotation->getValue() instanceof VarTagValueNode; } + /** + * @param Annotation|null $propertyAnnotation + */ private function hasTraversableTypeHint( File $phpcsFile, int $propertyPointer, ?TypeHint $propertyTypeHint, - ?VariableAnnotation $propertyAnnotation + ?Annotation $propertyAnnotation ): bool { if ( @@ -640,7 +658,7 @@ private function hasTraversableTypeHint( return $this->hasAnnotation($propertyAnnotation) && AnnotationTypeHelper::containsTraversableType( - $propertyAnnotation->getType(), + $propertyAnnotation->getValue()->type, $phpcsFile, $propertyPointer, $this->getTraversableTypeHints() @@ -648,24 +666,27 @@ private function hasTraversableTypeHint( } /** - * @return VariableAnnotation[] + * @return list> */ - private function getValidPrefixedAnnotations(File $phpcsFile, int $propertyPointer): array + private function getValidPrefixedAnnotations(File $phpcsFile, int $docCommentOpenPointer): array { - $returnAnnotations = []; + $varAnnotations = []; - foreach (AnnotationHelper::PREFIXES as $prefix) { - /** @var VariableAnnotation[] $annotations */ - $annotations = AnnotationHelper::getAnnotationsByName($phpcsFile, $propertyPointer, sprintf('@%s-var', $prefix)); + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefix) { foreach ($annotations as $annotation) { - if (!$annotation->isInvalid()) { - $returnAnnotations[] = $annotation; - break; + if ($annotation->isInvalid()) { + continue; + } + + if ($annotation->getName() === sprintf('@%s-var', $prefix)) { + $varAnnotations[] = $annotation; } } } - return $returnAnnotations; + return $varAnnotations; } } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSniff.php index db5db9a8f..594dc77f7 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSniff.php @@ -4,20 +4,19 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; +use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode; use PHPStan\PhpDocParser\Ast\Type\ArrayShapeNode; use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode; use PHPStan\PhpDocParser\Ast\Type\CallableTypeNode; -use PHPStan\PhpDocParser\Ast\Type\ConditionalTypeForParameterNode; -use PHPStan\PhpDocParser\Ast\Type\ConditionalTypeNode; -use PHPStan\PhpDocParser\Ast\Type\ConstTypeNode; use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\IntersectionTypeNode; use PHPStan\PhpDocParser\Ast\Type\NullableTypeNode; +use PHPStan\PhpDocParser\Ast\Type\ObjectShapeNode; use PHPStan\PhpDocParser\Ast\Type\ThisTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode; -use SlevomatCodingStandard\Helpers\Annotation\ReturnAnnotation; +use SlevomatCodingStandard\Helpers\Annotation; use SlevomatCodingStandard\Helpers\AnnotationHelper; use SlevomatCodingStandard\Helpers\AnnotationTypeHelper; use SlevomatCodingStandard\Helpers\DocCommentHelper; @@ -83,7 +82,7 @@ class ReturnTypeHintSniff implements Sniff /** @var bool|null */ public $enableStandaloneNullTrueFalseTypeHints = null; - /** @var string[] */ + /** @var list */ public $traversableTypeHints = []; /** @var array|null */ @@ -147,13 +146,13 @@ public function process(File $phpcsFile, $pointer): void } /** - * @param ReturnAnnotation[] $prefixedReturnAnnotations + * @param list $prefixedReturnAnnotations */ private function checkFunctionTypeHint( File $phpcsFile, int $functionPointer, ?TypeHint $returnTypeHint, - ?ReturnAnnotation $returnAnnotation, + ?Annotation $returnAnnotation, array $prefixedReturnAnnotations ): void { @@ -178,7 +177,7 @@ private function checkFunctionTypeHint( '%s %s() has return type hint "void" but it should be possible to add "never" based on @return annotation "%s".', FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), - AnnotationTypeHelper::export($returnTypeNode) + AnnotationTypeHelper::print($returnTypeNode) ), $functionPointer, self::CODE_LESS_SPECIFIC_NATIVE_TYPE_HINT @@ -252,7 +251,7 @@ private function checkFunctionTypeHint( '%s %s() does not have native return type hint for its return value but it should be possible to add it based on @return annotation "%s".', FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), - AnnotationTypeHelper::export($returnTypeNode) + AnnotationTypeHelper::print($returnTypeNode) ); $fix = $phpcsFile->addFixableError($message, $functionPointer, self::getSniffName(self::CODE_MISSING_NATIVE_TYPE_HINT)); @@ -279,7 +278,7 @@ private function checkFunctionTypeHint( '%s %s() does not have native return type hint for its return value but it should be possible to add it based on @return annotation "%s".', FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), - AnnotationTypeHelper::export($returnTypeNode) + AnnotationTypeHelper::print($returnTypeNode) ); $phpcsFile->addError($message, $functionPointer, self::getSniffName(self::CODE_MISSING_NATIVE_TYPE_HINT)); @@ -298,7 +297,7 @@ private function checkFunctionTypeHint( } if (AnnotationTypeHelper::containsOneType($returnTypeNode)) { - /** @var ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $returnTypeNode */ + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $returnTypeNode */ $returnTypeNode = $returnTypeNode; $typeHints[] = AnnotationTypeHelper::getTypeHintFromOneType( $returnTypeNode, @@ -314,7 +313,7 @@ private function checkFunctionTypeHint( return; } - /** @var ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $typeNode */ + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $typeNode */ $typeNode = $typeNode; $typeHint = AnnotationTypeHelper::getTypeHintFromOneType($typeNode, $canTryUnionTypeHint); @@ -434,7 +433,7 @@ private function checkFunctionTypeHint( '%s %s() does not have native return type hint for its return value but it should be possible to add it based on @return annotation "%s".', FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), - AnnotationTypeHelper::export($returnTypeNode) + AnnotationTypeHelper::print($returnTypeNode) ), $functionPointer, self::CODE_MISSING_NATIVE_TYPE_HINT @@ -467,13 +466,13 @@ private function checkFunctionTypeHint( } /** - * @param ReturnAnnotation[] $prefixedReturnAnnotations + * @param list $prefixedReturnAnnotations */ private function checkFunctionTraversableTypeHintSpecification( File $phpcsFile, int $functionPointer, ?TypeHint $returnTypeHint, - ?ReturnAnnotation $returnAnnotation, + ?Annotation $returnAnnotation, array $prefixedReturnAnnotations ): void { @@ -535,7 +534,7 @@ private function checkFunctionTraversableTypeHintSpecification( return; } - /** @var ReturnAnnotation $returnAnnotation */ + /** @var Annotation $returnAnnotation */ $returnAnnotation = $returnAnnotation; $phpcsFile->addError( @@ -553,7 +552,7 @@ private function checkFunctionUselessAnnotation( File $phpcsFile, int $functionPointer, ?TypeHint $returnTypeHint, - ?ReturnAnnotation $returnAnnotation + ?Annotation $returnAnnotation ): void { if ($returnAnnotation === null) { @@ -603,7 +602,7 @@ private function checkFunctionUselessAnnotation( $docCommentOpenPointer ); - $changeStart = $starPointer ?? $docCommentOpenPointer + 1; + $changeStart = $starPointer ?? $returnAnnotation->getStartPointer(); /** @var int $changeEnd */ $changeEnd = TokenHelper::findNext( @@ -646,12 +645,12 @@ private function checkClosureTypeHint(File $phpcsFile, int $closurePointer): voi } /** - * @return GenericTypeNode|CallableTypeNode|IntersectionTypeNode|UnionTypeNode|ArrayTypeNode|ArrayShapeNode|IdentifierTypeNode|ThisTypeNode|NullableTypeNode|ConstTypeNode|ConditionalTypeNode|ConditionalTypeForParameterNode|null + * @param Annotation|null $returnAnnotation */ - private function getReturnTypeNode(?ReturnAnnotation $returnAnnotation): ?TypeNode + private function getReturnTypeNode(?Annotation $returnAnnotation): ?TypeNode { if ($this->hasReturnAnnotation($returnAnnotation)) { - return $returnAnnotation->getType(); + return $returnAnnotation->getValue()->type; } return null; @@ -661,7 +660,7 @@ private function hasTraversableTypeHint( File $phpcsFile, int $functionPointer, ?TypeHint $returnTypeHint, - ?ReturnAnnotation $returnAnnotation + ?Annotation $returnAnnotation ): bool { if ( @@ -688,9 +687,9 @@ private function hasTraversableTypeHint( ); } - private function hasReturnAnnotation(?ReturnAnnotation $returnAnnotation): bool + private function hasReturnAnnotation(?Annotation $returnAnnotation): bool { - return $returnAnnotation !== null && $returnAnnotation->getContent() !== null && !$returnAnnotation->isInvalid(); + return $returnAnnotation !== null && !$returnAnnotation->isInvalid(); } private function reportUselessSuppress(File $phpcsFile, int $pointer, bool $isSuppressed, string $suppressName): void diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UnionTypeHintFormatSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UnionTypeHintFormatSniff.php index d9b78fcab..2e189487b 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UnionTypeHintFormatSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UnionTypeHintFormatSniff.php @@ -240,8 +240,7 @@ private function fixTypeHint(File $phpcsFile, TypeHint $typeHint, string $fixedT { $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($typeHint->getStartPointer(), $fixedTypeHint); - FixerHelper::removeBetweenIncluding($phpcsFile, $typeHint->getStartPointer() + 1, $typeHint->getEndPointer()); + FixerHelper::change($phpcsFile, $typeHint->getStartPointer(), $typeHint->getEndPointer(), $fixedTypeHint); $phpcsFile->fixer->endChangeset(); } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UselessConstantTypeHintSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UselessConstantTypeHintSniff.php index 266f6b626..b061adc60 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UselessConstantTypeHintSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UselessConstantTypeHintSniff.php @@ -8,7 +8,6 @@ use SlevomatCodingStandard\Helpers\DocCommentHelper; use SlevomatCodingStandard\Helpers\FixerHelper; use SlevomatCodingStandard\Helpers\TokenHelper; -use function array_key_exists; use function count; use const T_CONST; use const T_DOC_COMMENT_WHITESPACE; @@ -42,10 +41,9 @@ public function process(File $phpcsFile, $constantPointer): void return; } - $annotations = AnnotationHelper::getAnnotations($phpcsFile, $constantPointer); + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $constantPointer, '@var'); - $uselessAnnotation = array_key_exists('@var', $annotations); - if (!$uselessAnnotation) { + if ($annotations === []) { return; } @@ -57,7 +55,7 @@ public function process(File $phpcsFile, $constantPointer): void $fixerStart = TokenHelper::findLastTokenOnPreviousLine($phpcsFile, $docCommentOpenPointer); $fixerEnd = $tokens[$docCommentOpenPointer]['comment_closer']; } else { - $annotation = $annotations['@var'][0]; + $annotation = $annotations[0]; $fix = $phpcsFile->addFixableError( 'Useless @var annotation.', diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowVariableVariableSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowVariableVariableSniff.php new file mode 100644 index 000000000..ecd92b524 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowVariableVariableSniff.php @@ -0,0 +1,35 @@ + + */ + public function register(): array + { + return [ + T_DOLLAR, + T_DOLLAR_OPEN_CURLY_BRACES, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $phpcsFile->addError('Use of variable variable is disallowed.', $pointer, self::CODE_DISALLOWED_VARIABLE_VARIABLE); + } + +} diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UnusedVariableSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UnusedVariableSniff.php index da46fa67b..568d116f0 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UnusedVariableSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UnusedVariableSniff.php @@ -617,12 +617,12 @@ private function isReference(File $phpcsFile, int $scopeOwnerPointer, int $varia continue; } - $assigmentPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); - if ($tokens[$assigmentPointer]['code'] !== T_EQUAL) { + $assignmentPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + if ($tokens[$assignmentPointer]['code'] !== T_EQUAL) { continue; } - $referencePointer = TokenHelper::findNextEffective($phpcsFile, $assigmentPointer + 1); + $referencePointer = TokenHelper::findNextEffective($phpcsFile, $assignmentPointer + 1); if ($tokens[$referencePointer]['code'] === T_BITWISE_AND) { return true; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UselessVariableSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UselessVariableSniff.php index 70bee8bbf..38cce8371 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UselessVariableSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UselessVariableSniff.php @@ -31,6 +31,7 @@ use const T_MOD_EQUAL; use const T_MUL_EQUAL; use const T_OPEN_CURLY_BRACKET; +use const T_OPEN_PARENTHESIS; use const T_OR_EQUAL; use const T_PLUS_EQUAL; use const T_POW_EQUAL; @@ -39,6 +40,7 @@ use const T_SL_EQUAL; use const T_SR_EQUAL; use const T_STATIC; +use const T_STRING; use const T_SWITCH; use const T_VARIABLE; use const T_WHILE; @@ -101,7 +103,7 @@ public function process(File $phpcsFile, $returnPointer): void return; } - if (!$this->isAssigmentToVariable($phpcsFile, $previousVariablePointer)) { + if (!$this->isAssignmentToVariable($phpcsFile, $previousVariablePointer)) { return; } @@ -109,11 +111,15 @@ public function process(File $phpcsFile, $returnPointer): void return; } + if ($this->isAssignedInFunctionCall($phpcsFile, $previousVariablePointer)) { + return; + } + if ($this->hasVariableVarAnnotation($phpcsFile, $previousVariablePointer)) { return; } - if ($this->hasAnotherAssigmentBefore($phpcsFile, $previousVariablePointer, $variableName)) { + if ($this->hasAnotherAssignmentBefore($phpcsFile, $previousVariablePointer, $variableName)) { return; } @@ -143,10 +149,10 @@ public function process(File $phpcsFile, $returnPointer): void return; } - /** @var int $assigmentPointer */ - $assigmentPointer = TokenHelper::findNextEffective($phpcsFile, $previousVariablePointer + 1); + /** @var int $assignmentPointer */ + $assignmentPointer = TokenHelper::findNextEffective($phpcsFile, $previousVariablePointer + 1); - $assigmentFixerMapping = [ + $assignmentFixerMapping = [ T_PLUS_EQUAL => '+', T_MINUS_EQUAL => '-', T_MUL_EQUAL => '*', @@ -165,12 +171,11 @@ public function process(File $phpcsFile, $returnPointer): void $phpcsFile->fixer->beginChangeset(); - if ($tokens[$assigmentPointer]['code'] === T_EQUAL) { - FixerHelper::removeBetweenIncluding($phpcsFile, $previousVariablePointer, $assigmentPointer - 1); - $phpcsFile->fixer->replaceToken($assigmentPointer, 'return'); + if ($tokens[$assignmentPointer]['code'] === T_EQUAL) { + FixerHelper::change($phpcsFile, $previousVariablePointer, $assignmentPointer, 'return'); } else { $phpcsFile->fixer->addContentBefore($previousVariablePointer, 'return '); - $phpcsFile->fixer->replaceToken($assigmentPointer, $assigmentFixerMapping[$tokens[$assigmentPointer]['code']]); + $phpcsFile->fixer->replaceToken($assignmentPointer, $assignmentFixerMapping[$tokens[$assignmentPointer]['code']]); } FixerHelper::removeBetweenIncluding($phpcsFile, $previousVariableSemicolonPointer + 1, $returnSemicolonPointer); @@ -233,10 +238,28 @@ private function isAssignedInControlStructure(File $phpcsFile, int $pointer): bo return $tokens[$controlStructure]['parenthesis_opener'] < $pointer && $pointer < $tokens[$controlStructure]['parenthesis_closer']; } - private function isAssigmentToVariable(File $phpcsFile, int $pointer): bool + private function isAssignedInFunctionCall(File $phpcsFile, int $pointer): bool + { + $possibleFunctionNamePointer = TokenHelper::findPrevious($phpcsFile, T_STRING, $pointer - 1); + + if ($possibleFunctionNamePointer === null) { + return false; + } + + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $possibleFunctionNamePointer + 1); + if ($tokens[$parenthesisOpenerPointer]['code'] !== T_OPEN_PARENTHESIS) { + return false; + } + + return $parenthesisOpenerPointer < $pointer && $pointer < $tokens[$parenthesisOpenerPointer]['parenthesis_closer']; + } + + private function isAssignmentToVariable(File $phpcsFile, int $pointer): bool { - $assigmentPointer = TokenHelper::findNextEffective($phpcsFile, $pointer + 1); - return in_array($phpcsFile->getTokens()[$assigmentPointer]['code'], [ + $assignmentPointer = TokenHelper::findNextEffective($phpcsFile, $pointer + 1); + return in_array($phpcsFile->getTokens()[$assignmentPointer]['code'], [ T_EQUAL, T_PLUS_EQUAL, T_MINUS_EQUAL, @@ -329,14 +352,14 @@ private function hasVariableVarAnnotation(File $phpcsFile, int $variablePointer) ) !== 0; } - private function hasAnotherAssigmentBefore(File $phpcsFile, int $variablePointer, string $variableName): bool + private function hasAnotherAssignmentBefore(File $phpcsFile, int $variablePointer, string $variableName): bool { $previousVariablePointer = $this->findPreviousVariablePointer($phpcsFile, $variablePointer, $variableName); if ($previousVariablePointer === null) { return false; } - if (!$this->isAssigmentToVariable($phpcsFile, $previousVariablePointer)) { + if (!$this->isAssignmentToVariable($phpcsFile, $previousVariablePointer)) { return false; } diff --git a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Whitespaces/DuplicateSpacesSniff.php b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Whitespaces/DuplicateSpacesSniff.php index b8bd175e7..8dbecc506 100644 --- a/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Whitespaces/DuplicateSpacesSniff.php +++ b/app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Whitespaces/DuplicateSpacesSniff.php @@ -141,14 +141,14 @@ public function process(File $phpcsFile, $whitespacePointer): void $fix = false; foreach ($matches[0] as [$match, $offset]) { $firstPointerOnLine = TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $whitespacePointer - 1); - $indendation = IndentationHelper::getIndentation($phpcsFile, $firstPointerOnLine); - $indendationWithoutTabs = str_replace( + $indentation = IndentationHelper::getIndentation($phpcsFile, $firstPointerOnLine); + $indentationWithoutTabs = str_replace( IndentationHelper::TAB_INDENT, $tabWidth === 0 ? IndentationHelper::SPACES_INDENT : str_repeat(' ', $tabWidth), - $indendation + $indentation ); - $position = $tokens[$whitespacePointer]['column'] + $offset - strlen($indendation) + strlen($indendationWithoutTabs); + $position = $tokens[$whitespacePointer]['column'] + $offset - strlen($indentation) + strlen($indentationWithoutTabs); $fixable = $phpcsFile->addFixableError( sprintf('Duplicate spaces at position %d.', $position), diff --git a/app/vendor/slevomat/coding-standard/composer.json b/app/vendor/slevomat/coding-standard/composer.json index 697b94bd2..ec0c19339 100644 --- a/app/vendor/slevomat/coding-standard/composer.json +++ b/app/vendor/slevomat/coding-standard/composer.json @@ -9,7 +9,7 @@ "config": { "bin-dir": "bin", "platform": { - "php": "8.0.0" + "php": "8.1.0" }, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true @@ -18,27 +18,27 @@ "require": { "php": "^7.2 || ^8.0", "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", - "phpstan/phpdoc-parser": ">=1.15.2 <1.16.0", + "phpstan/phpdoc-parser": "^1.23.0", "squizlabs/php_codesniffer": "^3.7.1" }, "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.9.6", - "phpstan/phpstan-deprecation-rules": "1.1.1", - "phpstan/phpstan-phpunit": "1.0.0|1.3.3", - "phpstan/phpstan-strict-rules": "1.4.4", - "phpunit/phpunit": "7.5.20|8.5.21|9.5.27" + "phpstan/phpstan": "1.10.26", + "phpstan/phpstan-deprecation-rules": "1.1.3", + "phpstan/phpstan-phpunit": "1.3.13", + "phpstan/phpstan-strict-rules": "1.5.1", + "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.2.6" }, "autoload": { "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard" + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" } }, "autoload-dev": { "psr-4": { - "SlevomatCodingStandard\\PHPStan\\": "build/PHPStan", - "SlevomatCodingStandard\\": "tests" + "SlevomatCodingStandard\\PHPStan\\": "build/PHPStan/", + "SlevomatCodingStandard\\": "tests/" } }, "extra": { diff --git a/app/vendor/slevomat/coding-standard/doc/arrays.md b/app/vendor/slevomat/coding-standard/doc/arrays.md index 61472429d..3b4f10f8e 100644 --- a/app/vendor/slevomat/coding-standard/doc/arrays.md +++ b/app/vendor/slevomat/coding-standard/doc/arrays.md @@ -1,9 +1,25 @@ ## Arrays +#### SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys 🔧 + +Arrays should be defined with keys in alphabetical order. +It defines where new entries should be inserted. +It reduces merge conflicts and duplicate entries. + +This sniff enforces natural sorting of array definitions by key in multi-line arrays. + +#### SlevomatCodingStandard.Arrays.ArrayAccess 🔧 + +Disallow whitespace between array access operator and the variable, or between array access operators. + #### SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation Disallows implicit array creation. +#### SlevomatCodingStandard.Arrays.DisallowPartiallyKeyed 🚧 + +Array must have keys specified for either all or none of the values. + #### SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement 🔧 Enforces reasonable end bracket placement for multi-line arrays. @@ -21,10 +37,8 @@ Sniff provides the following settings: Commas after last element in an array make adding a new element easier and result in a cleaner versioning diff. -This sniff enforces trailing commas in multi-line arrays and requires short array syntax `[]`. +This sniff enforces trailing commas in multi-line arrays. Sniff provides the following settings: * `enableAfterHeredoc`: enables/disables trailing commas after HEREDOC/NOWDOC, default based on PHP version. - - diff --git a/app/vendor/slevomat/coding-standard/doc/attributes.md b/app/vendor/slevomat/coding-standard/doc/attributes.md index c86a4079f..ef2e70fac 100644 --- a/app/vendor/slevomat/coding-standard/doc/attributes.md +++ b/app/vendor/slevomat/coding-standard/doc/attributes.md @@ -2,15 +2,16 @@ #### SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing 🔧 -Checks lines count between attribute and its target (or target's documentation comment). +Sniff checks lines count between attribute and its target (or target's documentation comment). Sniff provides the following settings: +* `allowOnSameLine`: allow attribute and its target to be placed on the same line (default value is false) * `linesCount`: lines count between attribute and its target #### SlevomatCodingStandard.Attributes.AttributesOrder 🔧 -Requires order of attributes. When more attributes are in one `#[]`, eg. `#[One, Two]`, the first attribute name is used to resolve the order. +Requires order of attributes. When more attributes are in one `#[]`, e.g. `#[One, Two]`, the first attribute name is used to resolve the order. Sniff provides the following settings: diff --git a/app/vendor/slevomat/coding-standard/doc/classes.md b/app/vendor/slevomat/coding-standard/doc/classes.md index e9c97103f..5bbed250b 100644 --- a/app/vendor/slevomat/coding-standard/doc/classes.md +++ b/app/vendor/slevomat/coding-standard/doc/classes.md @@ -32,7 +32,7 @@ public const BAR = 2; // correct #### SlevomatCodingStandard.Classes.ClassMemberSpacing 🔧 -Checks lines count between different class members, eg. between last property and first method. +Sniff checks lines count between different class members, e.g. between last property and first method. Sniff provides the following settings: @@ -69,7 +69,7 @@ constants, properties, static properties, methods, all public methods, all prote - + @@ -113,6 +113,14 @@ Disallows multi constant definition. Disallows multi property definition. +#### SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition 🔧 + +Disallows multi property definition. + +#### SlevomatCodingStandard.Classes.DisallowStringExpressionPropertyFetch 🔧 + +Disallows string expression property fetch `$object->{'foo'}` when the property name is compatible with identifier access. + #### SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces 🔧 Enforces one configurable number of lines after opening class/interface/trait brace and one empty line before the closing brace. @@ -122,6 +130,17 @@ Sniff provides the following settings: * `linesCountAfterOpeningBrace`: allows to configure the number of lines after opening brace. * `linesCountBeforeClosingBrace`: allows to configure the number of lines before closing brace. +#### SlevomatCodingStandard.Classes.EnumCaseSpacing 🔧 + +Checks that there is a certain number of blank lines between enum cases. + +Sniff provides the following settings: + +* `minLinesCountBeforeWithComment`: minimum number of lines before enum case with a documentation comment or attribute +* `maxLinesCountBeforeWithComment`: maximum number of lines before enum case with a documentation comment or attribute +* `minLinesCountBeforeWithoutComment`: minimum number of lines before enum case without a documentation comment or attribute +* `maxLinesCountBeforeWithoutComment`: maximum number of lines before enum case without a documentation comment or attribute + #### SlevomatCodingStandard.Classes.ForbiddenPublicProperty Disallows using public properties. @@ -197,23 +216,28 @@ This sniff provides the following setting: #### SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature 🔧 -Enforces method signature to be splitted to more lines so each parameter is on its own line. +Enforces method signature to be split to more lines so each parameter is on its own line. Sniff provides the following settings: -* `minLineLength`: specifies min line length to enforce signature to be splitted. Use 0 value to enforce for all methods, regardless of length. +* `minLineLength`: specifies min line length to enforce signature to be split. Use 0 value to enforce for all methods, regardless of length. +* `minParametersCount`: specifies min parameters count to enforce signature to be split. * `includedMethodPatterns`: allows to configure which methods are included in sniff detection. This is an array of regular expressions (PCRE) with delimiters. You should not use this with `excludedMethodPatterns`, as it will not work properly. * `excludedMethodPatterns`: allows to configure which methods are excluded from sniff detection. This is an array of regular expressions (PCRE) with delimiters. You should not use this with `includedMethodPatterns`, as it will not work properly. +#### SlevomatCodingStandard.Classes.RequireSelfReference 🔧 + +Requires `self` for local reference. + #### SlevomatCodingStandard.Classes.RequireSingleLineMethodSignature 🔧 Enforces method signature to be on a single line. Sniff provides the following settings: -* `maxLineLength`: specifies max allowed line length. If signature would fit on it, it's enforced. Use 0 value to enforce for all methods, regardless of length. +* `maxLineLength`: specifies max allowed line length. If signature fit on it, it's enforced. Use 0 value to enforce for all methods, regardless of length. * `includedMethodPatterns`: allows to configure which methods are included in sniff detection. This is an array of regular expressions (PCRE) with delimiters. You should not use this with `excludedMethodPatterns`, as it will not work properly. diff --git a/app/vendor/slevomat/coding-standard/doc/commenting.md b/app/vendor/slevomat/coding-standard/doc/commenting.md index 9a33b094d..0c4862765 100644 --- a/app/vendor/slevomat/coding-standard/doc/commenting.md +++ b/app/vendor/slevomat/coding-standard/doc/commenting.md @@ -1,12 +1,21 @@ ## Commenting +#### SlevomatCodingStandard.Commenting.AnnotationName 🔧 + +Reports incorrect annotation name. It reports standard annotation names used by phpDocumentor, PHPUnit, PHPStan and Psalm by default. +Unknown annotation names are ignored. + +Sniff provides the following settings: + +* `annotations`: allows to configure which annotations are checked and how. + #### SlevomatCodingStandard.Commenting.DeprecatedAnnotationDeclaration Reports `@deprecated` annotations without description. #### SlevomatCodingStandard.Commenting.DisallowCommentAfterCode 🔧 -Disallows comments after code at the same line. +Sniff disallows comments after code at the same line. #### SlevomatCodingStandard.Commenting.ForbiddenAnnotations 🔧 @@ -87,11 +96,11 @@ Requires property comments with single-line content to be written as one-liners. #### SlevomatCodingStandard.Commenting.RequireOneLineDocComment 🔧 -Requires comments with single-line content to be written as one-liners. +Sniff requires comments with single-line content to be written as one-liners. #### SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment 🔧 -Requires comments with single-line content to be written as multi-liners. +Sniff requires comments with single-line content to be written as multi-liners. #### SlevomatCodingStandard.Commenting.UselessFunctionDocComment 🔧 @@ -100,10 +109,10 @@ Requires comments with single-line content to be written as multi-liners. Sniff provides the following settings: -* `traversableTypeHints`: enforces which typehints must have specified contained type. E. g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. +* `traversableTypeHints`: enforces which typehints must have specified contained type. E.g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. This sniff can cause an error if you're overriding or implementing a parent method which does not have typehints. In such cases add `@phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint` annotation to the method to have this sniff skip it. #### SlevomatCodingStandard.Commenting.UselessInheritDocComment 🔧 -Reports documentation comments containing only `{@inheritDoc}` annotation because inheritance is automatic and it's not needed to use a special annotation for it. +Reports documentation comments containing only `{@inheritDoc}` annotation because inheritance is automatic, and it's not needed to use a special annotation for it. diff --git a/app/vendor/slevomat/coding-standard/doc/complexity.md b/app/vendor/slevomat/coding-standard/doc/complexity.md index 961d04171..f77bfcfca 100644 --- a/app/vendor/slevomat/coding-standard/doc/complexity.md +++ b/app/vendor/slevomat/coding-standard/doc/complexity.md @@ -6,4 +6,5 @@ Enforces maximum [cognitive complexity](https://www.sonarsource.com/docs/Cogniti Sniff provides the following setting: -* `maxComplexity`: defaults to 5 +* `warningThreshold`: defaults to 6 +* `errorThreshold` : defaults to 6 diff --git a/app/vendor/slevomat/coding-standard/doc/control-structures.md b/app/vendor/slevomat/coding-standard/doc/control-structures.md index ebeb74871..760aaa586 100644 --- a/app/vendor/slevomat/coding-standard/doc/control-structures.md +++ b/app/vendor/slevomat/coding-standard/doc/control-structures.md @@ -1,6 +1,5 @@ ## Control structures - #### SlevomatCodingStandard.ControlStructures.AssignmentInCondition Disallows assignments in `if`, `elseif` and `do-while` loop conditions: @@ -111,6 +110,22 @@ Sniff provides the following settings: * `fixable`: the sniff is fixable by default, however in strict code it makes sense to forbid this weakly typed form of ternary altogether, you can disable fixability with this option. +#### SlevomatCodingStandard.ControlStructures.DisallowTrailingMultiLineTernaryOperator 🔧 + +Ternary operator has to be reformatted when the operator is not leading the line. + +```php +# wrong +$t = $someCondition ? + $thenThis : + $otherwiseThis; + +# correct +$t = $someCondition + ? $thenThis + : $otherwiseThis; +``` + #### SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing 🔧 Enforces configurable number of lines around jump statements (continue, return, ...). @@ -154,12 +169,12 @@ Reports `new` with useless parentheses. #### SlevomatCodingStandard.ControlStructures.RequireMultiLineCondition 🔧 -Enforces conditions of `if`, `elseif`, `while` and `do-while` with one or more boolean operators to be splitted to more lines +Enforces conditions of `if`, `elseif`, `while` and `do-while` with one or more boolean operators to be split to more lines so each condition part is on its own line. Sniff provides the following settings: -* `minLineLength`: specifies minimum line length to enforce condition to be splitted. Use 0 value to enforce for all conditions, regardless of length. +* `minLineLength`: specifies minimum line length to enforce condition to be split. Use 0 value to enforce for all conditions, regardless of length. * `booleanOperatorOnPreviousLine`: boolean operator is placed at the end of previous line when fixing. * `alwaysSplitAllConditionParts`: require all condition parts to be on its own line - it reports error even if condition is already multi-line but there are some condition parts on the same line. diff --git a/app/vendor/slevomat/coding-standard/doc/files.md b/app/vendor/slevomat/coding-standard/doc/files.md index 09441cc4f..096c65bc0 100644 --- a/app/vendor/slevomat/coding-standard/doc/files.md +++ b/app/vendor/slevomat/coding-standard/doc/files.md @@ -15,8 +15,8 @@ Enforces maximum length of a single line of code. Sniff provides the following settings: * `lineLengthLimit`: actual limit of the line length -* `ignoreComments`: whether or not to ignore line length of comments -* `ignoreImports`: whether or not to ignore line length of import (use) statements +* `ignoreComments`: whether to ignore line length of comments +* `ignoreImports`: whether to ignore line length of import (use) statements #### SlevomatCodingStandard.Files.TypeNameMatchesFileName diff --git a/app/vendor/slevomat/coding-standard/doc/functions.md b/app/vendor/slevomat/coding-standard/doc/functions.md index 601148104..5ea350d67 100644 --- a/app/vendor/slevomat/coding-standard/doc/functions.md +++ b/app/vendor/slevomat/coding-standard/doc/functions.md @@ -38,11 +38,11 @@ Sniff provides the following settings: #### SlevomatCodingStandard.Functions.RequireMultiLineCall 🔧 -Enforces function call to be splitted to more lines so each parameter is on its own line. +Enforces function call to be split to more lines so each parameter is on its own line. Sniff provides the following settings: -* `minLineLength`: specifies min line length to enforce call to be splitted. Use 0 value to enforce for all calls, regardless of length. +* `minLineLength`: specifies min line length to enforce call to be split. Use 0 value to enforce for all calls, regardless of length. #### SlevomatCodingStandard.Functions.RequireSingleLineCall 🔧 diff --git a/app/vendor/slevomat/coding-standard/doc/namespaces.md b/app/vendor/slevomat/coding-standard/doc/namespaces.md index 2a113dae8..6490b000f 100644 --- a/app/vendor/slevomat/coding-standard/doc/namespaces.md +++ b/app/vendor/slevomat/coding-standard/doc/namespaces.md @@ -2,7 +2,7 @@ #### SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses 🔧 -Checks whether uses at the top of a file are alphabetically sorted. Follows natural sorting and takes edge cases with special symbols into consideration. The following code snippet is an example of correctly sorted uses: +Sniff checks whether `use` declarations at the top of a file are alphabetically sorted. Follows natural sorting and takes edge cases with special symbols into consideration. The following code snippet is an example of correctly sorted uses: ```php use LogableTrait; @@ -124,11 +124,11 @@ Sniff provides the following settings: * `allowFullyQualifiedGlobalConstants`: allows using fully qualified constants from global space (i.e. `\PHP_VERSION`). * `allowFallbackGlobalFunctions`: allows using global functions via fallback name without `use` (i.e. `phpversion()`). * `allowFallbackGlobalConstants`: allows using global constants via fallback name without `use` (i.e. `PHP_VERSION`). -* `allowPartialUses`: allows using and referencing whole namespaces: +* `allowPartialUses`: allows using and referencing whole namespaces. #### SlevomatCodingStandard.Namespaces.UseFromSameNamespace 🔧 -Prohibits uses from the same namespace: +Sniff prohibits uses from the same namespace: ```php namespace Foo; @@ -156,11 +156,11 @@ Sniff provides the following settings: #### SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces -Disallows uses of other than configured namespaces. +Sniff disallows uses of other than configured namespaces. Sniff provides the following settings: -* `namespacesRequiredToUse`: namespaces in this array are the only ones allowed to be used. E. g. root project namespace. +* `namespacesRequiredToUse`: namespaces in this array are the only ones allowed to be used. E.g. root project namespace. * `allowUseFromRootNamespace`: also allow using top-level namespace: ```php @@ -178,5 +178,5 @@ Looks for unused imports from other namespaces. Sniff provides the following settings: * `searchAnnotations` (defaults to `false`): enables searching for class names in annotations. -* `ignoredAnnotationNames`: case sensitive list of annotation names that the sniff should ignore (only the name is ignored, annotation content is still searched). Useful for name collisions like `@testCase` annotation and `TestCase` class. -* `ignoredAnnotations`: case sensitive list of annotation names that the sniff ignore completely (both name and content are ignored). Useful for name collisions like `@group Cache` annotation and `Cache` class. +* `ignoredAnnotationNames`: case-sensitive list of annotation names that the sniff should ignore (only the name is ignored, annotation content is still searched). Useful for name collisions like `@testCase` annotation and `TestCase` class. +* `ignoredAnnotations`: case-sensitive list of annotation names that the sniff ignore completely (both name and content are ignored). Useful for name collisions like `@group Cache` annotation and `Cache` class. diff --git a/app/vendor/slevomat/coding-standard/doc/php.md b/app/vendor/slevomat/coding-standard/doc/php.md index 842bbf97d..e174028cd 100644 --- a/app/vendor/slevomat/coding-standard/doc/php.md +++ b/app/vendor/slevomat/coding-standard/doc/php.md @@ -6,7 +6,7 @@ Disallows direct call of `__invoke()`. #### SlevomatCodingStandard.PHP.DisallowReference -Disallows references. +Sniff disallows usage of references. #### SlevomatCodingStandard.PHP.ForbiddenClasses 🔧 @@ -73,7 +73,7 @@ Looks for useless parentheses. Sniff provides the following settings: -* `ignoreComplexTernaryConditions` (defaults to `false`): ignores complex ternary conditions - condition must contain `&&`, `||` etc or end of line. +* `ignoreComplexTernaryConditions` (defaults to `false`): ignores complex ternary conditions - condition must contain `&&`, `||` etc. or end of line. #### SlevomatCodingStandard.PHP.UselessSemicolon 🔧 diff --git a/app/vendor/slevomat/coding-standard/doc/strings.md b/app/vendor/slevomat/coding-standard/doc/strings.md new file mode 100644 index 000000000..17fcc7cc4 --- /dev/null +++ b/app/vendor/slevomat/coding-standard/doc/strings.md @@ -0,0 +1,11 @@ +## Strings + +#### SlevomatCodingStandard.Strings.DisallowVariableParsing + +Disallows variable parsing inside strings. + +Sniff provides the following settings: + +* `disallowDollarCurlySyntax`: disallows usage of `${...}`, enabled by default. +* `disallowCurlyDollarSyntax`: disallows usage of `{$...}`, disabled by default. +* `disallowSimpleSyntax`: disallows usage of `$...`, disabled by default. diff --git a/app/vendor/slevomat/coding-standard/doc/type-hints.md b/app/vendor/slevomat/coding-standard/doc/type-hints.md index 425319f55..f52e2b1d3 100644 --- a/app/vendor/slevomat/coding-standard/doc/type-hints.md +++ b/app/vendor/slevomat/coding-standard/doc/type-hints.md @@ -13,7 +13,7 @@ Sniff provides the following settings: #### SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax 🔧 -Disallows usage of array type hint syntax (eg. `int[]`, `bool[][]`) in phpDocs in favour of generic type hint syntax (eg. `array`, `array>`). +Disallows usage of array type hint syntax (e.g. `int[]`, `bool[][]`) in phpDocs in favour of generic type hint syntax (eg. `array`, `array>`). Sniff provides the following settings: @@ -57,7 +57,7 @@ Sniff provides the following settings: * `enableUnionTypeHint`: enforces to transform `@param string|int` into native `string|int` typehint. It's on by default if you're on PHP 8.0+ * `enableIntersectionTypeHint`: enforces to transform `@param Foo&Bar` into native `Foo&Bar` typehint. It's on by default if you're on PHP 8.1+ * `enableStandaloneNullTrueFalseTypeHints`: enforces to transform `@param true`, `@param false` or `@param null` into native typehints. It's on by default if you're on PHP 8.2+ -* `traversableTypeHints`: enforces which typehints must have specified contained type. E. g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. +* `traversableTypeHints`: enforces which typehints must have specified contained type. E.g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. This sniff can cause an error if you're overriding or implementing a parent method which does not have typehints. In such cases add `@phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint` annotation to the method to have this sniff skip it. @@ -79,7 +79,7 @@ Sniff provides the following settings: * `enableUnionTypeHint`: enforces to transform `@var string|int` into native `string|int` typehint. It's on by default if you're on PHP 8.0+. It can be enabled only when `enableNativeTypeHint` is enabled too. * `enableIntersectionTypeHint`: enforces to transform `@var Foo&Bar` into native `Foo&Bar` typehint. It's on by default if you're on PHP 8.1+. It can be enabled only when `enableNativeTypeHint` is enabled too. * `enableStandaloneNullTrueFalseTypeHints`: enforces to transform `@var true`, `@var false` or `@var null` into native typehints. It's on by default if you're on PHP 8.2+. It can be enabled only when `enableNativeTypeHint` is enabled too. -* `traversableTypeHints`: enforces which typehints must have specified contained type. E. g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. +* `traversableTypeHints`: enforces which typehints must have specified contained type. E.g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. This sniff can cause an error if you're overriding parent property which does not have typehints. In such cases add `@phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint` annotation to the property to have this sniff skip it. @@ -98,7 +98,7 @@ Sniff provides the following settings: * `enableIntersectionTypeHint`: enforces to transform `@return Foo&Bar` into native `Foo&Bar` typehint. It's on by default if you're on PHP 8.1+. * `enableNeverTypeHint`: enforces to transform `@return never` into native `never` typehint. It's on by default if you're on PHP 8.1+. * `enableStandaloneNullTrueFalseTypeHints`: enforces to transform `@return true`, `@return false` or `@return null` into native typehints. It's on by default if you're on PHP 8.2+. -* `traversableTypeHints`: enforces which typehints must have specified contained type. E. g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. +* `traversableTypeHints`: enforces which typehints must have specified contained type. E.g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. This sniff can cause an error if you're overriding or implementing a parent method which does not have typehints. In such cases add `@phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint` annotation to the method to have this sniff skip it. diff --git a/app/vendor/slevomat/coding-standard/doc/variables.md b/app/vendor/slevomat/coding-standard/doc/variables.md index 8ce5e1d67..c1f6c292e 100644 --- a/app/vendor/slevomat/coding-standard/doc/variables.md +++ b/app/vendor/slevomat/coding-standard/doc/variables.md @@ -4,6 +4,10 @@ Disallows use of super global variables. +#### SlevomatCodingStandard.Variables.DisallowVariableVariable + +Disallows use of variable variables. + #### SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable Looks for duplicate assignments to a variable. diff --git a/app/vendor/squizlabs/php_codesniffer/composer.json b/app/vendor/squizlabs/php_codesniffer/composer.json index 7605a5df9..37f41a0b8 100644 --- a/app/vendor/squizlabs/php_codesniffer/composer.json +++ b/app/vendor/squizlabs/php_codesniffer/composer.json @@ -4,7 +4,8 @@ "type": "library", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "license": "BSD-3-Clause", diff --git a/app/vendor/squizlabs/php_codesniffer/src/Config.php b/app/vendor/squizlabs/php_codesniffer/src/Config.php index 915ad0030..bfca9e1d1 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Config.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Config.php @@ -80,7 +80,7 @@ class Config * * @var string */ - const VERSION = '3.7.1'; + const VERSION = '3.7.2'; /** * Package stability; either stable, beta or alpha. diff --git a/app/vendor/squizlabs/php_codesniffer/src/Files/File.php b/app/vendor/squizlabs/php_codesniffer/src/Files/File.php index a15af762f..ad1ca0b23 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Files/File.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Files/File.php @@ -1798,7 +1798,7 @@ public function getMemberProperties($stackPtr) || $this->tokens[$ptr]['code'] === T_ENUM) ) { // T_VARIABLEs in interfaces/enums can actually be method arguments - // but they wont be seen as being inside the method because there + // but they won't be seen as being inside the method because there // are no scope openers and closers for abstract methods. If it is in // parentheses, we can be pretty sure it is a method argument. if (isset($this->tokens[$stackPtr]['nested_parenthesis']) === false diff --git a/app/vendor/squizlabs/php_codesniffer/src/Ruleset.php b/app/vendor/squizlabs/php_codesniffer/src/Ruleset.php index 7e659706c..f90e7b6d2 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Ruleset.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Ruleset.php @@ -249,7 +249,12 @@ public function explain() // one last time and clear the output buffer. $sniffs[] = ''; - echo PHP_EOL."The $this->name standard contains $sniffCount sniffs".PHP_EOL; + $summaryLine = PHP_EOL."The $this->name standard contains 1 sniff".PHP_EOL; + if ($sniffCount !== 1) { + $summaryLine = str_replace('1 sniff', "$sniffCount sniffs", $summaryLine); + } + + echo $summaryLine; ob_start(); diff --git a/app/vendor/squizlabs/php_codesniffer/src/Runner.php b/app/vendor/squizlabs/php_codesniffer/src/Runner.php index fa68ff51b..e0cbca716 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Runner.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Runner.php @@ -53,6 +53,8 @@ class Runner */ public function runPHPCS() { + $this->registerOutOfMemoryShutdownMessage('phpcs'); + try { Util\Timing::startTiming(); Runner::checkRequirements(); @@ -153,6 +155,8 @@ public function runPHPCS() */ public function runPHPCBF() { + $this->registerOutOfMemoryShutdownMessage('phpcbf'); + if (defined('PHP_CODESNIFFER_CBF') === false) { define('PHP_CODESNIFFER_CBF', true); } @@ -721,6 +725,11 @@ private function processChildProcs($childProcs) continue; } + $childProcessStatus = pcntl_wexitstatus($status); + if ($childProcessStatus !== 0) { + $success = false; + } + $out = $childProcs[$pid]; unset($childProcs[$pid]); if (file_exists($out) === false) { @@ -886,4 +895,42 @@ public function printProgress(File $file, $numFiles, $numProcessed) }//end printProgress() + /** + * Registers a PHP shutdown function to provide a more informative out of memory error. + * + * @param string $command The command which was used to initiate the PHPCS run. + * + * @return void + */ + private function registerOutOfMemoryShutdownMessage($command) + { + // Allocate all needed memory beforehand as much as possible. + $errorMsg = PHP_EOL.'The PHP_CodeSniffer "%1$s" command ran out of memory.'.PHP_EOL; + $errorMsg .= 'Either raise the "memory_limit" of PHP in the php.ini file or raise the memory limit at runtime'.PHP_EOL; + $errorMsg .= 'using `%1$s -d memory_limit=512M` (replace 512M with the desired memory limit).'.PHP_EOL; + $errorMsg = sprintf($errorMsg, $command); + $memoryError = 'Allowed memory size of'; + $errorArray = [ + 'type' => 42, + 'message' => 'Some random dummy string to take up memory and take up some more memory and some more', + 'file' => 'Another random string, which would be a filename this time. Should be relatively long to allow for deeply nested files', + 'line' => 31427, + ]; + + register_shutdown_function( + static function () use ( + $errorMsg, + $memoryError, + $errorArray + ) { + $errorArray = error_get_last(); + if (is_array($errorArray) === true && strpos($errorArray['message'], $memoryError) !== false) { + echo $errorMsg; + } + } + ); + + }//end registerOutOfMemoryShutdownMessage() + + }//end class diff --git a/app/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php b/app/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php index 141b9a133..efe9969d8 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php @@ -104,9 +104,9 @@ public function process(File $phpcsFile, $stackPtr) /** * Find next separator in array - either: comma or double arrow. * - * @param File $phpcsFile The current file being checked. - * @param int $ptr The position of current token. - * @param int $arrayEnd The token that ends the array definition. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @param int $ptr The position of current token. + * @param int $arrayEnd The token that ends the array definition. * * @return int */ diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/OpeningBraceSameLineStandard.xml b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/OpeningBraceSameLineStandard.xml index 6226a3fff..6fa08be7a 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/OpeningBraceSameLineStandard.xml +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/OpeningBraceSameLineStandard.xml @@ -15,6 +15,14 @@ class Foo { { +} + ]]> + + + + + { } ]]> diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterNotStandard.xml b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterNotStandard.xml index dd3e77311..aea863695 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterNotStandard.xml +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterNotStandard.xml @@ -10,13 +10,10 @@ if (! $someVar || ! $x instanceOf stdClass) {}; ]]> - + $someVar || !$x instanceOf stdClass) {}; - ]]> - - - $someVar || ! $x instanceOf stdClass) {}; ]]> diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml index 30e0def93..338c83893 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml @@ -10,13 +10,10 @@ $a = (null !== $extra); ]]> - + - - - true, T_DOC_COMMENT_STRING => true, T_COMMENT => true, + T_END_HEREDOC => true, + T_END_NOWDOC => true, ]; for ($i = 0; $i < $phpcsFile->numTokens; $i++) { diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php index 92d2ed8b8..7fd604849 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php @@ -142,12 +142,13 @@ public function process(File $phpcsFile, $stackPtr) } } - $lastOpenTag = $stackPtr; - $lastCloseTag = null; - $openScopes = []; - $adjustments = []; - $setIndents = []; - $disableExactEnd = 0; + $lastOpenTag = $stackPtr; + $lastCloseTag = null; + $openScopes = []; + $adjustments = []; + $setIndents = []; + $disableExactStack = []; + $disableExactEnd = 0; $tokens = $phpcsFile->getTokens(); $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); @@ -232,6 +233,7 @@ public function process(File $phpcsFile, $stackPtr) if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS && isset($tokens[$i]['parenthesis_closer']) === true ) { + $disableExactStack[$tokens[$i]['parenthesis_closer']] = $tokens[$i]['parenthesis_closer']; $disableExactEnd = max($disableExactEnd, $tokens[$i]['parenthesis_closer']); if ($this->debug === true) { $line = $tokens[$i]['line']; @@ -616,11 +618,11 @@ public function process(File $phpcsFile, $stackPtr) // Scope closers reset the required indent to the same level as the opening condition. if (($checkToken !== null - && isset($openScopes[$checkToken]) === true + && (isset($openScopes[$checkToken]) === true || (isset($tokens[$checkToken]['scope_condition']) === true && isset($tokens[$checkToken]['scope_closer']) === true && $tokens[$checkToken]['scope_closer'] === $checkToken - && $tokens[$checkToken]['line'] !== $tokens[$tokens[$checkToken]['scope_opener']]['line'])) + && $tokens[$checkToken]['line'] !== $tokens[$tokens[$checkToken]['scope_opener']]['line']))) || ($checkToken === null && isset($openScopes[$i]) === true) ) { @@ -802,9 +804,17 @@ public function process(File $phpcsFile, $stackPtr) && isset($tokens[$checkToken]['scope_opener']) === true ) { $exact = true; + if ($disableExactEnd > $checkToken) { - if ($tokens[$checkToken]['conditions'] === $tokens[$disableExactEnd]['conditions']) { - $exact = false; + foreach ($disableExactStack as $disableExactStackEnd) { + if ($disableExactStackEnd < $checkToken) { + continue; + } + + if ($tokens[$checkToken]['conditions'] === $tokens[$disableExactStackEnd]['conditions']) { + $exact = false; + break; + } } } @@ -1035,6 +1045,7 @@ public function process(File $phpcsFile, $stackPtr) // Don't check indents exactly between arrays as they tend to have custom rules. if ($tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) { + $disableExactStack[$tokens[$i]['bracket_closer']] = $tokens[$i]['bracket_closer']; $disableExactEnd = max($disableExactEnd, $tokens[$i]['bracket_closer']); if ($this->debug === true) { $line = $tokens[$i]['line']; @@ -1056,7 +1067,6 @@ public function process(File $phpcsFile, $stackPtr) ) { if ($this->debug === true) { $line = $tokens[$i]['line']; - $type = $tokens[$disableExactEnd]['type']; echo "Here/nowdoc found on line $line".PHP_EOL; } diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php index 3146717e8..070bbcd1f 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php @@ -62,6 +62,11 @@ public function process(File $phpcsFile, $stackPtr) return; } + if ($tokens[$nextNonEmpty]['code'] === T_CLOSE_PARENTHESIS) { + // Ignore PHP 8.1 first class callable syntax. + return; + } + if ($this->ignoreNewlines === true && $tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line'] ) { diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc index af56fd497..075fc34c5 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc @@ -98,3 +98,16 @@ $array = [ match ($test) { 1 => 'a', 2 => 'b' } => 'dynamic keys, woho!', ]; + +// Ensure that PHP 8.0 named parameters don't affect the sniff. +$array = [ + functionCall( + name: $value + ), +]; + +$array = [ + functionCall( + name: $value + ), +]; diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed index 495145956..505de5f78 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed @@ -99,3 +99,16 @@ $array = [ match ($test) { 1 => 'a', 2 => 'b' } => 'dynamic keys, woho!', ]; + +// Ensure that PHP 8.0 named parameters don't affect the sniff. +$array = [ + functionCall( + name: $value + ), +]; + +$array = [ + functionCall( + name: $value + ), +]; diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php index 0b99f2d68..4861041f6 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php @@ -26,24 +26,25 @@ class ArrayIndentUnitTest extends AbstractSniffUnitTest public function getErrorList() { return [ - 14 => 1, - 15 => 1, - 17 => 1, - 30 => 1, - 31 => 1, - 33 => 1, - 41 => 1, - 62 => 1, - 63 => 1, - 69 => 1, - 77 => 1, - 78 => 1, - 79 => 1, - 85 => 1, - 86 => 1, - 87 => 1, - 88 => 1, - 98 => 1, + 14 => 1, + 15 => 1, + 17 => 1, + 30 => 1, + 31 => 1, + 33 => 1, + 41 => 1, + 62 => 1, + 63 => 1, + 69 => 1, + 77 => 1, + 78 => 1, + 79 => 1, + 85 => 1, + 86 => 1, + 87 => 1, + 88 => 1, + 98 => 1, + 110 => 1, ]; }//end getErrorList() diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc index c46517df0..7c86a89f0 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc @@ -153,3 +153,12 @@ $foobar = functionCallAnonClassParam( $result = myFunction(param1: $arg1, param2: $arg2); $result = myFunction(param1: $arg1 , param2:$arg2); $result = myFunction(param1: $arg1, param2:$arg2, param3: $arg3,param4:$arg4, param5:$arg5); + +class Testing extends Bar +{ + public static function baz($foo, $bar) + { + $a = new parent($foo, $bar); + $a = new parent($foo ,$bar); + } +} diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed index 1b51933eb..8c9800725 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed @@ -153,3 +153,12 @@ $foobar = functionCallAnonClassParam( $result = myFunction(param1: $arg1, param2: $arg2); $result = myFunction(param1: $arg1, param2:$arg2); $result = myFunction(param1: $arg1, param2:$arg2, param3: $arg3, param4:$arg4, param5:$arg5); + +class Testing extends Bar +{ + public static function baz($foo, $bar) + { + $a = new parent($foo, $bar); + $a = new parent($foo, $bar); + } +} diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php index 9f83fc9b7..789b60b37 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php @@ -54,6 +54,7 @@ public function getErrorList() 134 => 1, 154 => 2, 155 => 1, + 162 => 2, ]; }//end getErrorList() diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc index ac2a1f9e9..011adcd53 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc @@ -89,3 +89,6 @@ function (): NeVeR { function intersectionParamTypes (\Package\ClassName&\Package\Other_Class $var) {} function intersectionReturnTypes ($var): \Package\ClassName&\Package\Other_Class {} + +$arrow = fn (int $a, string $b, bool $c, array $d, Foo\Bar $e) : int => $a * $b; +$arrow = fn (Int $a, String $b, BOOL $c, Array $d, Foo\Bar $e) : Float => $a * $b; diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed index e3cc993b3..d866101b6 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed @@ -89,3 +89,6 @@ function (): never { function intersectionParamTypes (\Package\ClassName&\Package\Other_Class $var) {} function intersectionReturnTypes ($var): \Package\ClassName&\Package\Other_Class {} + +$arrow = fn (int $a, string $b, bool $c, array $d, Foo\Bar $e) : int => $a * $b; +$arrow = fn (int $a, string $b, bool $c, array $d, Foo\Bar $e) : float => $a * $b; diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php index d95872a7d..fa05aba6a 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php @@ -66,6 +66,7 @@ public function getErrorList() 78 => 3, 82 => 2, 85 => 1, + 94 => 5, ]; }//end getErrorList() diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc index bad3998f9..2399a387e 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc @@ -163,3 +163,15 @@ $a = ( if (true) {} ( 1+2) === 3 ? $a = 1 : $a = 2; class A {} ( 1+2) === 3 ? $a = 1 : $a = 2; function foo() {} ( 1+2) === 3 ? $a = 1 : $a = 2; + +// Issue #3618. +class NonArbitraryParenthesesWithKeywords { + public static function baz( $foo, $bar ) { + $a = new self(); + $b = new parent(); + $c = new static(); + + // self/static are already tested above, round line 45. + $d = new parent( $foo,$bar ); + } +} diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc.fixed index 08fcd6244..9162728e1 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.inc.fixed @@ -151,3 +151,15 @@ $a = ( if (true) {} (1+2) === 3 ? $a = 1 : $a = 2; class A {} (1+2) === 3 ? $a = 1 : $a = 2; function foo() {} (1+2) === 3 ? $a = 1 : $a = 2; + +// Issue #3618. +class NonArbitraryParenthesesWithKeywords { + public static function baz( $foo, $bar ) { + $a = new self(); + $b = new parent(); + $c = new static(); + + // self/static are already tested above, round line 45. + $d = new parent( $foo,$bar ); + } +} diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.3.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.3.inc new file mode 100644 index 000000000..68b18938d --- /dev/null +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.3.inc @@ -0,0 +1,13 @@ + 1, 93 => 1, ]; - break; + case 'DisallowTabIndentUnitTest.2.inc': return [ 6 => 1, @@ -96,23 +96,33 @@ public function getErrorList($testFile='') 13 => 1, 19 => 1, ]; - break; + + case 'DisallowTabIndentUnitTest.3.inc': + if (\PHP_VERSION_ID >= 70300) { + return [ + 7 => 1, + 13 => 1, + ]; + } + + // PHP 7.2 or lower: PHP version which doesn't support flexible heredocs/nowdocs yet. + return []; + case 'DisallowTabIndentUnitTest.js': return [ 3 => 1, 5 => 1, 6 => 1, ]; - break; + case 'DisallowTabIndentUnitTest.css': return [ 1 => 1, 2 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc index caeb503aa..4061aff56 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc @@ -1572,6 +1572,13 @@ switch ($foo) { return 'default'; } +foo(function ($foo) { + return [ + match ($foo) { + } + ]; +}); + /* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ ?> diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed index 6fd9e5fd3..7b5efea36 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed @@ -1572,6 +1572,13 @@ switch ($foo) { return 'default'; } +foo(function ($foo) { + return [ + match ($foo) { + } + ]; +}); + /* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ ?> diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc index b8bf72ad5..e7253141d 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc @@ -1572,6 +1572,13 @@ switch ($foo) { return 'default'; } +foo(function ($foo) { + return [ + match ($foo) { + } + ]; +}); + /* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ ?> diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed index 83324391d..57caa2917 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed @@ -1572,6 +1572,13 @@ switch ($foo) { return 'default'; } +foo(function ($foo) { + return [ + match ($foo) { + } + ]; +}); + /* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ ?> diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php index 700fc5b81..6b0a71028 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php @@ -187,10 +187,10 @@ public function getErrorList($testFile='ScopeIndentUnitTest.inc') 1527 => 1, 1529 => 1, 1530 => 1, - 1583 => 1, - 1584 => 1, - 1585 => 1, - 1586 => 1, + 1590 => 1, + 1591 => 1, + 1592 => 1, + 1593 => 1, ]; }//end getErrorList() diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc index edce4dcc6..fb5c18142 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc @@ -67,7 +67,13 @@ function bar( & ... $spread ) { ); } +// Ignore PHP 8.1 first class callable declarations. +$map = array_map(strtolower(...), $map); + // phpcs:set Generic.WhiteSpace.SpreadOperatorSpacingAfter spacing 0 +// Ignore PHP 8.1 first class callable declarations. +$map = array_map(strtolower( ... ), $map); + // Intentional parse error. This has to be the last test in the file. function bar( ... diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc.fixed index efec7ac15..9388acfc6 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc.fixed @@ -62,7 +62,13 @@ function bar( & ... $spread ) { ); } +// Ignore PHP 8.1 first class callable declarations. +$map = array_map(strtolower(...), $map); + // phpcs:set Generic.WhiteSpace.SpreadOperatorSpacingAfter spacing 0 +// Ignore PHP 8.1 first class callable declarations. +$map = array_map(strtolower( ... ), $map); + // Intentional parse error. This has to be the last test in the file. function bar( ... diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php index 3a339abe4..b5e8695c1 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php @@ -390,11 +390,14 @@ public function processMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $ $padding = str_repeat(' ', $functionIndent); if ($foundFunctionIndent === 0) { $phpcsFile->fixer->addContentBefore($first, $padding); + } else if ($tokens[$first]['code'] === T_INLINE_HTML) { + $newContent = $padding.ltrim($tokens[$first]['content']); + $phpcsFile->fixer->replaceToken($first, $newContent); } else { $phpcsFile->fixer->replaceToken(($first - 1), $padding); } } - } + }//end if $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) { diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc index ed3d2c43e..612748fed 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc @@ -548,3 +548,22 @@ array_fill_keys( ), value: true, ); // phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true + +?> +
    +

    +
    +
    +

    +
    + +content +

    diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed index 8d02e7467..00226de56 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed @@ -563,3 +563,22 @@ array_fill_keys( value: true, ); // phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true + +?> +
    +

    +
    +
    +

    +
    + +content +

    diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php index 1dd59188f..4984de2bf 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php @@ -131,6 +131,9 @@ public function getErrorList($testFile='FunctionCallSignatureUnitTest.inc') 546 => 1, 547 => 1, 548 => 1, + 559 => 1, + 567 => 1, + 568 => 1, ]; }//end getErrorList() diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php index 7a33bd947..db67fb942 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php @@ -21,14 +21,14 @@ class AnonClassDeclarationSniff extends ClassDeclarationSniff /** * The PSR2 MultiLineFunctionDeclarations sniff. * - * @var MultiLineFunctionDeclarationSniff + * @var \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff */ private $multiLineSniff = null; /** * The Generic FunctionCallArgumentSpacing sniff. * - * @var FunctionCallArgumentSpacingSniff + * @var \PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff */ private $functionCallSniff = null; diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php index e4ebd576a..2298da39f 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php @@ -48,6 +48,7 @@ public function process(File $phpcsFile, $stackPtr) T_NS_SEPARATOR => T_NS_SEPARATOR, T_SELF => T_SELF, T_STATIC => T_STATIC, + T_PARENT => T_PARENT, T_VARIABLE => T_VARIABLE, T_DOLLAR => T_DOLLAR, T_OBJECT_OPERATOR => T_OBJECT_OPERATOR, diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc index d933ee273..9fd154807 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc @@ -42,3 +42,6 @@ $class = new ${$obj?->classname}; $anonWithAttribute = new #[SomeAttribute('summary')] class { public const SOME_STUFF = 'foo'; }; + +$foo = new parent(); +$foo = new parent; diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed index 02e3544fa..aa9d0c720 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed @@ -42,3 +42,6 @@ $class = new ${$obj?->classname}(); $anonWithAttribute = new #[SomeAttribute('summary')] class { public const SOME_STUFF = 'foo'; }; + +$foo = new parent(); +$foo = new parent(); diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php index 3fb1ab992..0a16af8fc 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php @@ -43,6 +43,7 @@ public function getErrorList() 34 => 1, 37 => 1, 38 => 1, + 47 => 1, ]; }//end getErrorList() diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php index 6803f9abb..370eab189 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php @@ -222,7 +222,7 @@ public function process(File $phpcsFile, $stackPtr) $semicolon = $openingBracket; $targetNestinglevel = 0; if (isset($tokens[$openingBracket]['conditions']) === true) { - $targetNestinglevel += count($tokens[$openingBracket]['conditions']); + $targetNestinglevel = count($tokens[$openingBracket]['conditions']); } do { diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php index 60b113d3a..8becb74a4 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php @@ -109,6 +109,7 @@ public function process(File $phpcsFile, $stackPtr) T_OPEN_SHORT_ARRAY => true, T_CASE => true, T_EXIT => true, + T_MATCH_ARROW => true, ]; if (isset($invalidTokens[$tokens[$previousToken]['code']]) === true) { @@ -141,6 +142,7 @@ public function process(File $phpcsFile, $stackPtr) T_THIS, T_SELF, T_STATIC, + T_PARENT, T_OBJECT_OPERATOR, T_NULLSAFE_OBJECT_OPERATOR, T_DOUBLE_COLON, diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php index 7c7e2246f..9eb212423 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php @@ -52,17 +52,18 @@ public function process(File $phpcsFile, $stackPtr) } } - // Ignore values in array definitions. - $array = $phpcsFile->findNext( - T_ARRAY, + // Ignore values in array definitions or match structures. + $nextNonEmpty = $phpcsFile->findNext( + Tokens::$emptyTokens, ($stackPtr + 1), null, - false, - null, true ); - if ($array !== false) { + if ($nextNonEmpty !== false + && ($tokens[$nextNonEmpty]['code'] === T_ARRAY + || $tokens[$nextNonEmpty]['code'] === T_MATCH) + ) { return; } diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php index 79cb9f3f4..f3b5495d9 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php @@ -76,9 +76,9 @@ public function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) /** * Check for $this variable usage between $next and $end tokens. * - * @param File $phpcsFile The current file being scanned. - * @param int $next The position of the next token to check. - * @param int $end The position of the last token to check. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. + * @param int $next The position of the next token to check. + * @param int $end The position of the last token to check. * * @return void */ diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php index 2627d10d9..f1e2fce69 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php @@ -77,12 +77,13 @@ public function register() // Returning/printing a negative value; eg. (return -1). $this->nonOperandTokens += [ - T_RETURN => T_RETURN, - T_ECHO => T_ECHO, - T_EXIT => T_EXIT, - T_PRINT => T_PRINT, - T_YIELD => T_YIELD, - T_FN_ARROW => T_FN_ARROW, + T_RETURN => T_RETURN, + T_ECHO => T_ECHO, + T_EXIT => T_EXIT, + T_PRINT => T_PRINT, + T_YIELD => T_YIELD, + T_FN_ARROW => T_FN_ARROW, + T_MATCH_ARROW => T_MATCH_ARROW, ]; // Trying to use a negative value; eg. myFunction($var, -2). diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed index e42e037c7..3bcd94538 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed @@ -25,7 +25,7 @@ * @author * @copyright 1997 Squiz Pty Ltd (ABN 77 084 670 600) * @copyright 1994-1997 Squiz Pty Ltd (ABN 77 084 670 600) -* @copyright 2022 Squiz Pty Ltd (ABN 77 084 670 600) +* @copyright 2023 Squiz Pty Ltd (ABN 77 084 670 600) * @license http://www.php.net/license/3_0.txt * @summary An unknown summary tag * diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed index 90046c710..56a392d98 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed @@ -25,7 +25,7 @@ * @author * @copyright 1997 Squiz Pty Ltd (ABN 77 084 670 600) * @copyright 1994-1997 Squiz Pty Ltd (ABN 77 084 670 600) -* @copyright 2022 Squiz Pty Ltd (ABN 77 084 670 600) +* @copyright 2023 Squiz Pty Ltd (ABN 77 084 670 600) * @license http://www.php.net/license/3_0.txt * @summary An unknown summary tag * diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc index 2a480bb92..8e6289638 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc @@ -193,3 +193,11 @@ $expr = match (true) { if ($pos === count(value: $this->tokens) - 1) { $file = '...'.substr(string: $file, offset: $padding * -1 + 3); } + +match ($a) { + 'a' => -1, + 'b', 'c', 'd' => -2, + default => -3, +}; + +$cntPages = ceil(count($items) / parent::ON_PAGE); diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed index 669b16b2b..9fa0216cb 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed @@ -193,3 +193,11 @@ $expr = match (true) { if ($pos === (count(value: $this->tokens) - 1)) { $file = '...'.substr(string: $file, offset: ($padding * -1 + 3)); } + +match ($a) { + 'a' => -1, + 'b', 'c', 'd' => -2, + default => -3, +}; + +$cntPages = ceil(count($items) / parent::ON_PAGE); diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc index 022aca739..a07047b19 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc @@ -71,3 +71,13 @@ $callback = function ($value) { return false; } }; + +function issue3616() { + $food = 'cake'; + + $returnValue = match (true) { + $food === 'apple' => 'This food is an apple', + $food === 'bar' => 'This food is a bar', + $food === 'cake' => 'This food is a cake', + }; +} diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc index f89cf08d5..06462acc3 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc @@ -477,5 +477,11 @@ $a = 'a '.-$b; $a = 'a '.- MY_CONSTANT; $a = 'a '.- $b; +match ($a) { + 'a' => -1, + 'b', 'c', 'd' => -2, + default => -3, +}; + /* Intentional parse error. This has to be the last test in the file. */ $a = 10 + diff --git a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed index 138616e75..8b92a4875 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed +++ b/app/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed @@ -471,5 +471,11 @@ $a = 'a '.-$b; $a = 'a '.- MY_CONSTANT; $a = 'a '.- $b; +match ($a) { + 'a' => -1, + 'b', 'c', 'd' => -2, + default => -3, +}; + /* Intentional parse error. This has to be the last test in the file. */ $a = 10 + diff --git a/app/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php b/app/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php index 63fbcc48a..3fc67b0c8 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php @@ -1223,7 +1223,7 @@ protected function tokenize($string) /* Tokenize the parameter labels for PHP 8.0 named parameters as a special T_PARAM_NAME - token and ensure that the colon after it is always T_COLON. + token and ensures that the colon after it is always T_COLON. */ if ($tokenIsArray === true @@ -2688,13 +2688,18 @@ protected function processAdditional() } if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - if (isset($allowed[$this->tokens[$x]['code']]) === false) { + // Allow for control structures without braces. + if (($this->tokens[$x]['code'] === T_CLOSE_PARENTHESIS + && isset($this->tokens[$x]['parenthesis_owner']) === true + && isset(Util\Tokens::$scopeOpeners[$this->tokens[$this->tokens[$x]['parenthesis_owner']]['code']]) === true) + || isset($allowed[$this->tokens[$x]['code']]) === false + ) { $isShortArray = true; } break; } - } + }//end for if ($isShortArray === true) { $this->tokens[$i]['code'] = T_OPEN_SHORT_ARRAY; diff --git a/app/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php b/app/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php index c79323ccd..0e00bf7f2 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php @@ -194,6 +194,8 @@ private function createPositionMap() T_DOUBLE_QUOTED_STRING => true, T_HEREDOC => true, T_NOWDOC => true, + T_END_HEREDOC => true, + T_END_NOWDOC => true, T_INLINE_HTML => true, ]; diff --git a/app/vendor/squizlabs/php_codesniffer/src/Util/Common.php b/app/vendor/squizlabs/php_codesniffer/src/Util/Common.php index caf4db772..ce7967cc3 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Util/Common.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Util/Common.php @@ -372,7 +372,7 @@ public static function isCamelCaps( for ($i = 1; $i < $length; $i++) { $ascii = ord($string[$i]); if ($ascii >= 48 && $ascii <= 57) { - // The character is a number, so it cant be a capital. + // The character is a number, so it can't be a capital. $isCaps = false; } else { if (strtoupper($string[$i]) === $string[$i]) { diff --git a/app/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php b/app/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php index 1208e4f05..bb1fb2ca9 100644 --- a/app/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php +++ b/app/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php @@ -628,6 +628,7 @@ final class Tokens T_UNSET => T_UNSET, T_EMPTY => T_EMPTY, T_SELF => T_SELF, + T_PARENT => T_PARENT, T_STATIC => T_STATIC, ]; diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php b/app/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php index 65542b670..c0f38fa6f 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php @@ -1,6 +1,6 @@ * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) @@ -9,6 +9,7 @@ namespace PHP_CodeSniffer\Tests\Core\Autoloader; +use PHP_CodeSniffer\Autoload; use PHPUnit\Framework\TestCase; class DetermineLoadedClassTest extends TestCase @@ -51,7 +52,7 @@ public function testOrdered() 'traits' => [], ]; - $className = \PHP_CodeSniffer\Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); + $className = Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); $this->assertEquals('PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', $className); }//end testOrdered() @@ -81,7 +82,7 @@ public function testUnordered() 'traits' => [], ]; - $className = \PHP_CodeSniffer\Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); + $className = Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); $this->assertEquals('PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', $className); $classesAfterLoad = [ @@ -95,7 +96,7 @@ public function testUnordered() 'traits' => [], ]; - $className = \PHP_CodeSniffer\Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); + $className = Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); $this->assertEquals('PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', $className); $classesAfterLoad = [ @@ -109,7 +110,7 @@ public function testUnordered() 'traits' => [], ]; - $className = \PHP_CodeSniffer\Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); + $className = Autoload::determineLoadedClass($classesBeforeLoad, $classesAfterLoad); $this->assertEquals('PHP_CodeSniffer\Tests\Core\Autoloader\Sub\C', $className); }//end testUnordered() diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc index 6dfd0a280..835167989 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc @@ -39,6 +39,8 @@ $a = [ /* testStaticArrowFunction */ static fn ($a) => $a; +return 0; + /* testArrowFunctionReturnValue */ fn(): array => [a($a, $b)]; @@ -101,5 +103,3 @@ $result = match ($key) { 2 => 'one', }, }; - -return 0; diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php index 464021f6f..ff859eca1 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php @@ -469,7 +469,7 @@ public function testNestedMatch() /** - * Test nested match expressions. + * Test PHP open tag. * * @return void */ @@ -485,7 +485,7 @@ public function testOpenTag() /** - * Test nested match expressions. + * Test PHP short open echo tag. * * @return void */ diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php index 69dfde1e7..934d8e289 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php @@ -210,6 +210,17 @@ public function dataGetMemberProperties() 'nullable_type' => false, ], ], + [ + '/* testNoPrefix */', + [ + 'scope' => 'public', + 'scope_specified' => false, + 'is_static' => false, + 'is_readonly' => false, + 'type' => '', + 'nullable_type' => false, + ], + ], [ '/* testPublicStaticWithDocblock */', [ @@ -287,17 +298,6 @@ public function dataGetMemberProperties() 'nullable_type' => true, ], ], - [ - '/* testNoPrefix */', - [ - 'scope' => 'public', - 'scope_specified' => false, - 'is_static' => false, - 'is_readonly' => false, - 'type' => '', - 'nullable_type' => false, - ], - ], [ '/* testGroupProtectedStatic 1 */', [ diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php index f70d64f2d..ba4d75448 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php @@ -62,173 +62,173 @@ public function testArrayHint() /** - * Verify type hint parsing. + * Verify variable. * * @return void */ - public function testTypeHint() + public function testVariable() { $expected = []; $expected[0] = [ - 'name' => '$var1', - 'content' => 'foo $var1', - 'has_attributes' => false, - 'pass_by_reference' => false, - 'variable_length' => false, - 'type_hint' => 'foo', - 'nullable_type' => false, - ]; - - $expected[1] = [ - 'name' => '$var2', - 'content' => 'bar $var2', + 'name' => '$var', + 'content' => '$var', 'has_attributes' => false, 'pass_by_reference' => false, 'variable_length' => false, - 'type_hint' => 'bar', + 'type_hint' => '', 'nullable_type' => false, ]; $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - }//end testTypeHint() + }//end testVariable() /** - * Verify self type hint parsing. + * Verify default value parsing with a single function param. * * @return void */ - public function testSelfTypeHint() + public function testSingleDefaultValue() { $expected = []; $expected[0] = [ - 'name' => '$var', - 'content' => 'self $var', + 'name' => '$var1', + 'content' => '$var1=self::CONSTANT', 'has_attributes' => false, + 'default' => 'self::CONSTANT', 'pass_by_reference' => false, 'variable_length' => false, - 'type_hint' => 'self', + 'type_hint' => '', 'nullable_type' => false, ]; $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - }//end testSelfTypeHint() + }//end testSingleDefaultValue() /** - * Verify nullable type hint parsing. + * Verify default value parsing. * * @return void */ - public function testNullableTypeHint() + public function testDefaultValues() { $expected = []; $expected[0] = [ 'name' => '$var1', - 'content' => '?int $var1', + 'content' => '$var1=1', 'has_attributes' => false, + 'default' => '1', 'pass_by_reference' => false, 'variable_length' => false, - 'type_hint' => '?int', - 'nullable_type' => true, + 'type_hint' => '', + 'nullable_type' => false, ]; - $expected[1] = [ 'name' => '$var2', - 'content' => '?\bar $var2', + 'content' => "\$var2='value'", 'has_attributes' => false, + 'default' => "'value'", 'pass_by_reference' => false, 'variable_length' => false, - 'type_hint' => '?\bar', - 'nullable_type' => true, + 'type_hint' => '', + 'nullable_type' => false, ]; $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - }//end testNullableTypeHint() + }//end testDefaultValues() /** - * Verify variable. + * Verify type hint parsing. * * @return void */ - public function testVariable() + public function testTypeHint() { $expected = []; $expected[0] = [ - 'name' => '$var', - 'content' => '$var', + 'name' => '$var1', + 'content' => 'foo $var1', 'has_attributes' => false, 'pass_by_reference' => false, 'variable_length' => false, - 'type_hint' => '', + 'type_hint' => 'foo', + 'nullable_type' => false, + ]; + + $expected[1] = [ + 'name' => '$var2', + 'content' => 'bar $var2', + 'has_attributes' => false, + 'pass_by_reference' => false, + 'variable_length' => false, + 'type_hint' => 'bar', 'nullable_type' => false, ]; $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - }//end testVariable() + }//end testTypeHint() /** - * Verify default value parsing with a single function param. + * Verify self type hint parsing. * * @return void */ - public function testSingleDefaultValue() + public function testSelfTypeHint() { $expected = []; $expected[0] = [ - 'name' => '$var1', - 'content' => '$var1=self::CONSTANT', + 'name' => '$var', + 'content' => 'self $var', 'has_attributes' => false, - 'default' => 'self::CONSTANT', 'pass_by_reference' => false, 'variable_length' => false, - 'type_hint' => '', + 'type_hint' => 'self', 'nullable_type' => false, ]; $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - }//end testSingleDefaultValue() + }//end testSelfTypeHint() /** - * Verify default value parsing. + * Verify nullable type hint parsing. * * @return void */ - public function testDefaultValues() + public function testNullableTypeHint() { $expected = []; $expected[0] = [ 'name' => '$var1', - 'content' => '$var1=1', + 'content' => '?int $var1', 'has_attributes' => false, - 'default' => '1', 'pass_by_reference' => false, 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, + 'type_hint' => '?int', + 'nullable_type' => true, ]; + $expected[1] = [ 'name' => '$var2', - 'content' => "\$var2='value'", + 'content' => '?\bar $var2', 'has_attributes' => false, - 'default' => "'value'", 'pass_by_reference' => false, 'variable_length' => false, - 'type_hint' => '', - 'nullable_type' => false, + 'type_hint' => '?\bar', + 'nullable_type' => true, ]; $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected); - }//end testDefaultValues() + }//end testNullableTypeHint() /** diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php index 2f552bfec..66f4eea3e 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php @@ -774,7 +774,6 @@ public function testPHP81NullableNeverType() }//end testPHP81NullableNeverType() - /** /** * Verify recognition of PHP8.1 intersection type declaration. * diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.inc b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.inc index cd40ed3ba..f71e2639d 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.inc @@ -12,7 +12,7 @@ $a = [ $something & $somethingElse ]; $a = [ $first, $something & self::$somethingElse ]; /* testBitwiseAndD */ -$a = array $first, $something & $somethingElse ); +$a = array( $first, $something & $somethingElse ); /* testBitwiseAndE */ $a = [ 'a' => $first, 'b' => $something & $somethingElse ]; @@ -51,7 +51,7 @@ function myFunction(array &$one) {} $closure = function (\MyClass &$one) {}; /* testFunctionPassByReferenceG */ -$closure = function myFunc($param, &...$moreParams) {}; +$closure = function ($param, &...$moreParams) {}; /* testForeachValueByReference */ foreach( $array as $key => &$value ) {} diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php index b10a1efb9..8ac826f2f 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AttributesTest.php @@ -10,7 +10,6 @@ namespace PHP_CodeSniffer\Tests\Core\Tokenizer; use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; -use PHP_CodeSniffer\Util\Tokens; class AttributesTest extends AbstractMethodUnitTest { @@ -289,7 +288,7 @@ public function testAttributeAndLineComment() /** - * Test that attribute followed by a line comment is parsed correctly. + * Test that attributes on function declaration parameters are parsed correctly. * * @param string $testMarker The comment which prefaces the target token in the test file. * @param int $position The token position (starting from T_FUNCTION) of T_ATTRIBUTE token. diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocNowdocCloserTest.inc b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocNowdocCloserTest.inc new file mode 100644 index 000000000..a800980b8 --- /dev/null +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocNowdocCloserTest.inc @@ -0,0 +1,43 @@ + + * @copyright 2020 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizer; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Files\DummyFile; +use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; + +/** + * Heredoc/nowdoc closer token test. + * + * @requires PHP 7.3 + */ +class HeredocNowdocCloserTest extends AbstractMethodUnitTest +{ + + + /** + * Initialize & tokenize \PHP_CodeSniffer\Files\File with code from the test case file. + * + * {@internal This is a near duplicate of the original method. Only difference is that + * tab replacement is enabled for this test.} + * + * @return void + */ + public static function setUpBeforeClass() + { + $config = new Config(); + $config->standards = ['PSR1']; + $config->tabWidth = 4; + + $ruleset = new Ruleset($config); + + // Default to a file with the same name as the test class. Extension is property based. + $relativeCN = str_replace(__NAMESPACE__, '', get_called_class()); + $relativePath = str_replace('\\', DIRECTORY_SEPARATOR, $relativeCN); + $pathToTestFile = realpath(__DIR__).$relativePath.'.'.static::$fileExtension; + + // Make sure the file gets parsed correctly based on the file type. + $contents = 'phpcs_input_file: '.$pathToTestFile.PHP_EOL; + $contents .= file_get_contents($pathToTestFile); + + self::$phpcsFile = new DummyFile($contents, $ruleset, $config); + self::$phpcsFile->process(); + + }//end setUpBeforeClass() + + + /** + * Verify that leading (indent) whitespace in a heredoc/nowdoc closer token get the tab replacement treatment. + * + * @param string $testMarker The comment prefacing the target token. + * @param array $expected Expectations for the token array. + * + * @dataProvider dataHeredocNowdocCloserTabReplacement + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap + * + * @return void + */ + public function testHeredocNowdocCloserTabReplacement($testMarker, $expected) + { + $tokens = self::$phpcsFile->getTokens(); + + $closer = $this->getTargetToken($testMarker, [T_END_HEREDOC, T_END_NOWDOC]); + + foreach ($expected as $key => $value) { + if ($key === 'orig_content' && $value === null) { + $this->assertArrayNotHasKey($key, $tokens[$closer], "Unexpected 'orig_content' key found in the token array."); + continue; + } + + $this->assertArrayHasKey($key, $tokens[$closer], "Key $key not found in the token array."); + $this->assertSame($value, $tokens[$closer][$key], "Value for key $key does not match expectation."); + } + + }//end testHeredocNowdocCloserTabReplacement() + + + /** + * Data provider. + * + * @see testHeredocNowdocCloserTabReplacement() + * + * @return array + */ + public function dataHeredocNowdocCloserTabReplacement() + { + return [ + [ + 'testMarker' => '/* testHeredocCloserNoIndent */', + 'expected' => [ + 'length' => 3, + 'content' => 'EOD', + 'orig_content' => null, + ], + ], + [ + 'testMarker' => '/* testNowdocCloserNoIndent */', + 'expected' => [ + 'length' => 3, + 'content' => 'EOD', + 'orig_content' => null, + ], + ], + [ + 'testMarker' => '/* testHeredocCloserSpaceIndent */', + 'expected' => [ + 'length' => 7, + 'content' => ' END', + 'orig_content' => null, + ], + ], + [ + 'testMarker' => '/* testNowdocCloserSpaceIndent */', + 'expected' => [ + 'length' => 8, + 'content' => ' END', + 'orig_content' => null, + ], + ], + [ + 'testMarker' => '/* testHeredocCloserTabIndent */', + 'expected' => [ + 'length' => 8, + 'content' => ' END', + 'orig_content' => ' END', + ], + ], + [ + 'testMarker' => '/* testNowdocCloserTabIndent */', + 'expected' => [ + 'length' => 7, + 'content' => ' END', + 'orig_content' => ' END', + ], + ], + ]; + + }//end dataHeredocNowdocCloserTabReplacement() + + +}//end class diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.inc b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.inc new file mode 100644 index 000000000..ae43e24a5 --- /dev/null +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.inc @@ -0,0 +1,193 @@ +bar +EOD; + +/* testProperty2 */ +$heredoc = <<<"EOD" +{$foo->bar} +EOD; + +/* testMethod1 */ +$heredoc = <<bar()} +EOD; + +/* testClosure1 */ +$heredoc = <<<"EOD" +{$foo()} +EOD; + +/* testChain1 */ +$heredoc = <<baz()()} +EOD; + +/* testVariableVar1 */ +$heredoc = <<<"EOD" +${$bar} +EOD; + +/* testVariableVar2 */ +$heredoc = <<bar} +EOD; + +/* testNested1 */ +$heredoc = <<{$baz}} +EOD; + +/* testNested4 */ +$heredoc = <<<"EOD" +${foo->{${'a'}}} +EOD; + +/* testNested5 */ +$heredoc = <<{"${'a'}"}} +EOD; + +/* testSimple1Wrapped */ +$heredoc = <<bar Something +EOD; + +/* testProperty2Wrapped */ +$heredoc = <<<"EOD" +Do {$foo->bar} Something +EOD; + +/* testMethod1Wrapped */ +$heredoc = <<bar()} Something +EOD; + +/* testClosure1Wrapped */ +$heredoc = <<<"EOD" +Do {$foo()} Something +EOD; + +/* testChain1Wrapped */ +$heredoc = <<baz()()} Something +EOD; + +/* testVariableVar1Wrapped */ +$heredoc = <<<"EOD" +Do ${$bar} Something +EOD; + +/* testVariableVar2Wrapped */ +$heredoc = <<bar} Something +EOD; + +/* testNested1Wrapped */ +$heredoc = <<{$baz}} Something +EOD; + +/* testNested4Wrapped */ +$heredoc = <<<"EOD" +Do ${foo->{${'a'}}} Something +EOD; + +/* testNested5Wrapped */ +$heredoc = <<{"${'a'}"}} Something +EOD; diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.php b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.php new file mode 100644 index 000000000..2c808be90 --- /dev/null +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/HeredocStringTest.php @@ -0,0 +1,153 @@ + + * @copyright 2022 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizer; + +use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; + +class HeredocStringTest extends AbstractMethodUnitTest +{ + + + /** + * Test that heredoc strings contain the complete interpolated string. + * + * @param string $testMarker The comment which prefaces the target token in the test file. + * @param string $expectedContent The expected content of the heredoc string. + * + * @dataProvider dataHeredocString + * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize + * + * @return void + */ + public function testHeredocString($testMarker, $expectedContent) + { + $tokens = self::$phpcsFile->getTokens(); + + $target = $this->getTargetToken($testMarker, T_HEREDOC); + $this->assertSame($expectedContent."\n", $tokens[$target]['content']); + + }//end testHeredocString() + + + /** + * Test that heredoc strings contain the complete interpolated string when combined with other texts. + * + * @param string $testMarker The comment which prefaces the target token in the test file. + * @param string $expectedContent The expected content of the heredoc string. + * + * @dataProvider dataHeredocString + * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize + * + * @return void + */ + public function testHeredocStringWrapped($testMarker, $expectedContent) + { + $tokens = self::$phpcsFile->getTokens(); + + $testMarker = substr($testMarker, 0, -3).'Wrapped */'; + $target = $this->getTargetToken($testMarker, T_HEREDOC); + $this->assertSame('Do '.$expectedContent." Something\n", $tokens[$target]['content']); + + }//end testHeredocStringWrapped() + + + /** + * Data provider. + * + * @see testHeredocString() + * + * @return array + */ + public function dataHeredocString() + { + return [ + [ + 'testMarker' => '/* testSimple1 */', + 'expectedContent' => '$foo', + ], + [ + 'testMarker' => '/* testSimple2 */', + 'expectedContent' => '{$foo}', + ], + [ + 'testMarker' => '/* testSimple3 */', + 'expectedContent' => '${foo}', + ], + [ + 'testMarker' => '/* testDIM1 */', + 'expectedContent' => '$foo[bar]', + ], + [ + 'testMarker' => '/* testDIM2 */', + 'expectedContent' => '{$foo[\'bar\']}', + ], + [ + 'testMarker' => '/* testDIM3 */', + 'expectedContent' => '${foo[\'bar\']}', + ], + [ + 'testMarker' => '/* testProperty1 */', + 'expectedContent' => '$foo->bar', + ], + [ + 'testMarker' => '/* testProperty2 */', + 'expectedContent' => '{$foo->bar}', + ], + [ + 'testMarker' => '/* testMethod1 */', + 'expectedContent' => '{$foo->bar()}', + ], + [ + 'testMarker' => '/* testClosure1 */', + 'expectedContent' => '{$foo()}', + ], + [ + 'testMarker' => '/* testChain1 */', + 'expectedContent' => '{$foo[\'bar\']->baz()()}', + ], + [ + 'testMarker' => '/* testVariableVar1 */', + 'expectedContent' => '${$bar}', + ], + [ + 'testMarker' => '/* testVariableVar2 */', + 'expectedContent' => '${(foo)}', + ], + [ + 'testMarker' => '/* testVariableVar3 */', + 'expectedContent' => '${foo->bar}', + ], + [ + 'testMarker' => '/* testNested1 */', + 'expectedContent' => '${foo["${bar}"]}', + ], + [ + 'testMarker' => '/* testNested2 */', + 'expectedContent' => '${foo["${bar[\'baz\']}"]}', + ], + [ + 'testMarker' => '/* testNested3 */', + 'expectedContent' => '${foo->{$baz}}', + ], + [ + 'testMarker' => '/* testNested4 */', + 'expectedContent' => '${foo->{${\'a\'}}}', + ], + [ + 'testMarker' => '/* testNested5 */', + 'expectedContent' => '${foo->{"${\'a\'}"}}', + ], + ]; + + }//end dataHeredocString() + + +}//end class diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.inc b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.inc index 4497f5c38..b9c0df24d 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.inc @@ -208,6 +208,9 @@ foobar(elseif: $value, /* testReservedKeywordElseif2 */ elseif: $value); /* testReservedKeywordEmpty1 */ foobar(empty: $value, /* testReservedKeywordEmpty2 */ empty: $value); +/* testReservedKeywordEnum1 */ +foobar(enum: $value, /* testReservedKeywordEnum2 */ enum: $value); + /* testReservedKeywordEnddeclare1 */ foobar(enddeclare: $value, /* testReservedKeywordEnddeclare2 */ enddeclare: $value); diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php index 0a878c1d3..cc57637c6 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/NamedFunctionCallArgumentsTest.php @@ -776,6 +776,7 @@ public function dataReservedKeywordsAsName() 'endif', 'endswitch', 'endwhile', + 'enum', 'eval', 'exit', 'extends', diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.inc b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.inc index e2d61bb66..38e5a47d5 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ScopeSettingWithNamespaceOperatorTest.inc @@ -13,7 +13,7 @@ interface FooBar extends namespace\BarFoo {} function foo() : namespace\Baz {} /* testClosureReturnType */ -$closure = function () : namespace\Baz {} +$closure = function () : namespace\Baz {}; /* testArrowFunctionReturnType */ $fn = fn() : namespace\Baz => new namespace\Baz; diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.inc b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.inc index 54065f213..60b23a51c 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.inc +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.inc @@ -92,6 +92,20 @@ echo [1, 2, 3][0]; /* testArrayWithinFunctionCall */ $var = functionCall([$x, $y]); +if ( true ) { + /* testShortListDeclarationAfterBracedControlStructure */ + [ $a ] = [ 'hi' ]; +} + +if ( true ) + /* testShortListDeclarationAfterNonBracedControlStructure */ + [ $a ] = [ 'hi' ]; + +if ( true ) : + /* testShortListDeclarationAfterAlternativeControlStructure */ + [ $a ] = [ 'hi' ]; +endif; + /* testLiveCoding */ // Intentional parse error. This has to be the last test in the file. $array = [ diff --git a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php index 0484d4fcb..1d97894f5 100644 --- a/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php +++ b/app/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/ShortArrayTest.php @@ -52,29 +52,29 @@ public function testSquareBrackets($testMarker) public function dataSquareBrackets() { return [ - ['/* testArrayAccess1 */'], - ['/* testArrayAccess2 */'], - ['/* testArrayAssignment */'], - ['/* testFunctionCallDereferencing */'], - ['/* testMethodCallDereferencing */'], - ['/* testStaticMethodCallDereferencing */'], - ['/* testPropertyDereferencing */'], - ['/* testPropertyDereferencingWithInaccessibleName */'], - ['/* testStaticPropertyDereferencing */'], - ['/* testStringDereferencing */'], - ['/* testStringDereferencingDoubleQuoted */'], - ['/* testConstantDereferencing */'], - ['/* testClassConstantDereferencing */'], - ['/* testMagicConstantDereferencing */'], - ['/* testArrayAccessCurlyBraces */'], - ['/* testArrayLiteralDereferencing */'], - ['/* testShortArrayLiteralDereferencing */'], - ['/* testClassMemberDereferencingOnInstantiation1 */'], - ['/* testClassMemberDereferencingOnInstantiation2 */'], - ['/* testClassMemberDereferencingOnClone */'], - ['/* testNullsafeMethodCallDereferencing */'], - ['/* testInterpolatedStringDereferencing */'], - ['/* testLiveCoding */'], + 'array access 1' => ['/* testArrayAccess1 */'], + 'array access 2' => ['/* testArrayAccess2 */'], + 'array assignment' => ['/* testArrayAssignment */'], + 'function call dereferencing' => ['/* testFunctionCallDereferencing */'], + 'method call dereferencing' => ['/* testMethodCallDereferencing */'], + 'static method call dereferencing' => ['/* testStaticMethodCallDereferencing */'], + 'property dereferencing' => ['/* testPropertyDereferencing */'], + 'property dereferencing with inaccessable name' => ['/* testPropertyDereferencingWithInaccessibleName */'], + 'static property dereferencing' => ['/* testStaticPropertyDereferencing */'], + 'string dereferencing single quotes' => ['/* testStringDereferencing */'], + 'string dereferencing double quotes' => ['/* testStringDereferencingDoubleQuoted */'], + 'global constant dereferencing' => ['/* testConstantDereferencing */'], + 'class constant dereferencing' => ['/* testClassConstantDereferencing */'], + 'magic constant dereferencing' => ['/* testMagicConstantDereferencing */'], + 'array access with curly braces' => ['/* testArrayAccessCurlyBraces */'], + 'array literal dereferencing' => ['/* testArrayLiteralDereferencing */'], + 'short array literal dereferencing' => ['/* testShortArrayLiteralDereferencing */'], + 'class member dereferencing on instantiation 1' => ['/* testClassMemberDereferencingOnInstantiation1 */'], + 'class member dereferencing on instantiation 2' => ['/* testClassMemberDereferencingOnInstantiation2 */'], + 'class member dereferencing on clone' => ['/* testClassMemberDereferencingOnClone */'], + 'nullsafe method call dereferencing' => ['/* testNullsafeMethodCallDereferencing */'], + 'interpolated string dereferencing' => ['/* testInterpolatedStringDereferencing */'], + 'live coding' => ['/* testLiveCoding */'], ]; }//end dataSquareBrackets() @@ -117,13 +117,16 @@ public function testShortArrays($testMarker) public function dataShortArrays() { return [ - ['/* testShortArrayDeclarationEmpty */'], - ['/* testShortArrayDeclarationWithOneValue */'], - ['/* testShortArrayDeclarationWithMultipleValues */'], - ['/* testShortArrayDeclarationWithDereferencing */'], - ['/* testShortListDeclaration */'], - ['/* testNestedListDeclaration */'], - ['/* testArrayWithinFunctionCall */'], + 'short array empty' => ['/* testShortArrayDeclarationEmpty */'], + 'short array with value' => ['/* testShortArrayDeclarationWithOneValue */'], + 'short array with values' => ['/* testShortArrayDeclarationWithMultipleValues */'], + 'short array with dereferencing' => ['/* testShortArrayDeclarationWithDereferencing */'], + 'short list' => ['/* testShortListDeclaration */'], + 'short list nested' => ['/* testNestedListDeclaration */'], + 'short array within function call' => ['/* testArrayWithinFunctionCall */'], + 'short list after braced control structure' => ['/* testShortListDeclarationAfterBracedControlStructure */'], + 'short list after non-braced control structure' => ['/* testShortListDeclarationAfterNonBracedControlStructure */'], + 'short list after alternative control structure' => ['/* testShortListDeclarationAfterAlternativeControlStructure */'], ]; }//end dataShortArrays() diff --git a/app/vendor/symfony/config/Builder/ConfigBuilderGenerator.php b/app/vendor/symfony/config/Builder/ConfigBuilderGenerator.php index 8dc7f4cb5..2f00a99be 100644 --- a/app/vendor/symfony/config/Builder/ConfigBuilderGenerator.php +++ b/app/vendor/symfony/config/Builder/ConfigBuilderGenerator.php @@ -426,9 +426,7 @@ private function getComment(BaseNode $node): string } if ($node instanceof EnumNode) { - $comment .= sprintf(' * @param ParamConfigurator|%s $value', implode('|', array_map(function ($a) { - return var_export($a, true); - }, $node->getValues())))."\n"; + $comment .= sprintf(' * @param ParamConfigurator|%s $value', implode('|', array_unique(array_map(fn ($a) => !$a instanceof \UnitEnum ? var_export($a, true) : '\\'.ltrim(var_export($a, true), '\\'), $node->getValues()))))."\n"; } else { $parameterTypes = $this->getParameterTypes($node); $comment .= ' * @param ParamConfigurator|'.implode('|', $parameterTypes).' $value'."\n"; diff --git a/app/vendor/symfony/config/CHANGELOG.md b/app/vendor/symfony/config/CHANGELOG.md index 0fac3a8a5..094d5abba 100644 --- a/app/vendor/symfony/config/CHANGELOG.md +++ b/app/vendor/symfony/config/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +6.3 +--- + + * Allow enum values in `EnumNode` + 6.2 --- diff --git a/app/vendor/symfony/config/ConfigCacheInterface.php b/app/vendor/symfony/config/ConfigCacheInterface.php index e1763fc5c..be7f0986c 100644 --- a/app/vendor/symfony/config/ConfigCacheInterface.php +++ b/app/vendor/symfony/config/ConfigCacheInterface.php @@ -39,6 +39,8 @@ public function isFresh(): bool; * @param string $content The content to write into the cache * @param ResourceInterface[]|null $metadata An array of ResourceInterface instances * + * @return void + * * @throws \RuntimeException When the cache file cannot be written */ public function write(string $content, array $metadata = null); diff --git a/app/vendor/symfony/config/Definition/ArrayNode.php b/app/vendor/symfony/config/Definition/ArrayNode.php index 97500c90a..1448220cd 100644 --- a/app/vendor/symfony/config/Definition/ArrayNode.php +++ b/app/vendor/symfony/config/Definition/ArrayNode.php @@ -32,6 +32,9 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface protected $removeExtraKeys = true; protected $normalizeKeys = true; + /** + * @return void + */ public function setNormalizeKeys(bool $normalizeKeys) { $this->normalizeKeys = $normalizeKeys; @@ -77,6 +80,8 @@ public function getChildren(): array * Sets the xml remappings that should be performed. * * @param array $remappings An array of the form [[string, string]] + * + * @return void */ public function setXmlRemappings(array $remappings) { @@ -96,6 +101,8 @@ public function getXmlRemappings(): array /** * Sets whether to add default values for this array if it has not been * defined in any of the configuration files. + * + * @return void */ public function setAddIfNotSet(bool $boolean) { @@ -104,6 +111,8 @@ public function setAddIfNotSet(bool $boolean) /** * Sets whether false is allowed as value indicating that the array should be unset. + * + * @return void */ public function setAllowFalse(bool $allow) { @@ -112,6 +121,8 @@ public function setAllowFalse(bool $allow) /** * Sets whether new keys can be defined in subsequent configurations. + * + * @return void */ public function setAllowNewKeys(bool $allow) { @@ -120,6 +131,8 @@ public function setAllowNewKeys(bool $allow) /** * Sets if deep merging should occur. + * + * @return void */ public function setPerformDeepMerging(bool $boolean) { @@ -131,6 +144,8 @@ public function setPerformDeepMerging(bool $boolean) * * @param bool $boolean To allow extra keys * @param bool $remove To remove extra keys + * + * @return void */ public function setIgnoreExtraKeys(bool $boolean, bool $remove = true) { @@ -146,6 +161,9 @@ public function shouldIgnoreExtraKeys(): bool return $this->ignoreExtraKeys; } + /** + * @return void + */ public function setName(string $name) { $this->name = $name; @@ -175,6 +193,8 @@ public function getDefaultValue(): mixed /** * Adds a child node. * + * @return void + * * @throws \InvalidArgumentException when the child node has no name * @throws \InvalidArgumentException when the child node's name is not unique */ @@ -238,6 +258,9 @@ protected function finalizeValue(mixed $value): mixed return $value; } + /** + * @return void + */ protected function validateType(mixed $value) { if (!\is_array($value) && (!$this->allowFalse || false !== $value)) { diff --git a/app/vendor/symfony/config/Definition/BaseNode.php b/app/vendor/symfony/config/Definition/BaseNode.php index 814376091..85f0f7eeb 100644 --- a/app/vendor/symfony/config/Definition/BaseNode.php +++ b/app/vendor/symfony/config/Definition/BaseNode.php @@ -98,6 +98,9 @@ public static function resetPlaceholders(): void self::$placeholders = []; } + /** + * @return void + */ public function setAttribute(string $key, mixed $value) { $this->attributes[$key] = $value; @@ -118,11 +121,17 @@ public function getAttributes(): array return $this->attributes; } + /** + * @return void + */ public function setAttributes(array $attributes) { $this->attributes = $attributes; } + /** + * @return void + */ public function removeAttribute(string $key) { unset($this->attributes[$key]); @@ -130,6 +139,8 @@ public function removeAttribute(string $key) /** * Sets an info message. + * + * @return void */ public function setInfo(string $info) { @@ -146,6 +157,8 @@ public function getInfo(): ?string /** * Sets the example configuration for this node. + * + * @return void */ public function setExample(string|array $example) { @@ -162,6 +175,8 @@ public function getExample(): string|array|null /** * Adds an equivalent value. + * + * @return void */ public function addEquivalentValue(mixed $originalValue, mixed $equivalentValue) { @@ -170,6 +185,8 @@ public function addEquivalentValue(mixed $originalValue, mixed $equivalentValue) /** * Set this node as required. + * + * @return void */ public function setRequired(bool $boolean) { @@ -179,12 +196,14 @@ public function setRequired(bool $boolean) /** * Sets this node as deprecated. * + * You can use %node% and %path% placeholders in your message to display, + * respectively, the node name and its complete path. + * * @param string $package The name of the composer package that is triggering the deprecation * @param string $version The version of the package that introduced the deprecation * @param string $message the deprecation message to use * - * You can use %node% and %path% placeholders in your message to display, - * respectively, the node name and its complete path + * @return void */ public function setDeprecated(string $package, string $version, string $message = 'The child node "%node%" at path "%path%" is deprecated.') { @@ -197,6 +216,8 @@ public function setDeprecated(string $package, string $version, string $message /** * Sets if this node can be overridden. + * + * @return void */ public function setAllowOverwrite(bool $allow) { @@ -207,6 +228,8 @@ public function setAllowOverwrite(bool $allow) * Sets the closures used for normalization. * * @param \Closure[] $closures An array of Closures used for normalization + * + * @return void */ public function setNormalizationClosures(array $closures) { @@ -217,6 +240,8 @@ public function setNormalizationClosures(array $closures) * Sets the list of types supported by normalization. * * see ExprBuilder::TYPE_* constants. + * + * @return void */ public function setNormalizedTypes(array $types) { @@ -237,6 +262,8 @@ public function getNormalizedTypes(): array * Sets the closures used for final validation. * * @param \Closure[] $closures An array of Closures used for final validation + * + * @return void */ public function setFinalValidationClosures(array $closures) { @@ -415,6 +442,8 @@ final public function finalize(mixed $value): mixed /** * Validates the type of a Node. * + * @return void + * * @throws InvalidTypeException when the value is invalid */ abstract protected function validateType(mixed $value); diff --git a/app/vendor/symfony/config/Definition/BooleanNode.php b/app/vendor/symfony/config/Definition/BooleanNode.php index 812881d6d..7ec903cd6 100644 --- a/app/vendor/symfony/config/Definition/BooleanNode.php +++ b/app/vendor/symfony/config/Definition/BooleanNode.php @@ -20,6 +20,9 @@ */ class BooleanNode extends ScalarNode { + /** + * @return void + */ protected function validateType(mixed $value) { if (!\is_bool($value)) { diff --git a/app/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php b/app/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php index 34f00085c..0110f0502 100644 --- a/app/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php +++ b/app/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php @@ -45,6 +45,9 @@ public function __construct(?string $name, NodeParentInterface $parent = null) $this->trueEquivalent = []; } + /** + * @return void + */ public function setBuilder(NodeBuilder $builder) { $this->nodeBuilder = $builder; @@ -422,6 +425,8 @@ protected function createNode(): NodeInterface /** * Validate the configuration of a concrete node. * + * @return void + * * @throws InvalidDefinitionException */ protected function validateConcreteNode(ArrayNode $node) @@ -452,6 +457,8 @@ protected function validateConcreteNode(ArrayNode $node) /** * Validate the configuration of a prototype node. * + * @return void + * * @throws InvalidDefinitionException */ protected function validatePrototypeNode(PrototypedArrayNode $node) diff --git a/app/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php b/app/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php index f30b8736c..bb40307e1 100644 --- a/app/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php +++ b/app/vendor/symfony/config/Definition/Builder/BuilderAwareInterface.php @@ -20,6 +20,8 @@ interface BuilderAwareInterface { /** * Sets a custom children builder. + * + * @return void */ public function setBuilder(NodeBuilder $builder); } diff --git a/app/vendor/symfony/config/Definition/Builder/EnumNodeDefinition.php b/app/vendor/symfony/config/Definition/Builder/EnumNodeDefinition.php index 6df62d30a..99f318123 100644 --- a/app/vendor/symfony/config/Definition/Builder/EnumNodeDefinition.php +++ b/app/vendor/symfony/config/Definition/Builder/EnumNodeDefinition.php @@ -27,8 +27,6 @@ class EnumNodeDefinition extends ScalarNodeDefinition */ public function values(array $values): static { - $values = array_unique($values); - if (!$values) { throw new \InvalidArgumentException('->values() must be called with at least one value.'); } diff --git a/app/vendor/symfony/config/Definition/Builder/TreeBuilder.php b/app/vendor/symfony/config/Definition/Builder/TreeBuilder.php index e469e6904..4f868f703 100644 --- a/app/vendor/symfony/config/Definition/Builder/TreeBuilder.php +++ b/app/vendor/symfony/config/Definition/Builder/TreeBuilder.php @@ -51,6 +51,9 @@ public function buildTree(): NodeInterface return $this->tree = $this->root->getNode(true); } + /** + * @return void + */ public function setPathSeparator(string $separator) { // unset last built as changing path separator changes all nodes diff --git a/app/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php b/app/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php index 6520d2fac..34f93ce07 100644 --- a/app/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php +++ b/app/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php @@ -31,11 +31,17 @@ class XmlReferenceDumper { private ?string $reference = null; + /** + * @return string + */ public function dump(ConfigurationInterface $configuration, string $namespace = null) { return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree(), $namespace); } + /** + * @return string + */ public function dumpNode(NodeInterface $node, string $namespace = null) { $this->reference = ''; @@ -46,16 +52,14 @@ public function dumpNode(NodeInterface $node, string $namespace = null) return $ref; } - private function writeNode(NodeInterface $node, int $depth = 0, bool $root = false, string $namespace = null) + private function writeNode(NodeInterface $node, int $depth = 0, bool $root = false, string $namespace = null): void { $rootName = ($root ? 'config' : $node->getName()); $rootNamespace = ($namespace ?: ($root ? 'http://example.org/schema/dic/'.$node->getName() : null)); // xml remapping if ($node->getParent()) { - $remapping = array_filter($node->getParent()->getXmlRemappings(), function (array $mapping) use ($rootName) { - return $rootName === $mapping[1]; - }); + $remapping = array_filter($node->getParent()->getXmlRemappings(), fn (array $mapping) => $rootName === $mapping[1]); if (\count($remapping)) { [$singular] = current($remapping); @@ -109,7 +113,7 @@ private function writeNode(NodeInterface $node, int $depth = 0, bool $root = fal FloatNode::class, IntegerNode::class => 'numeric value', BooleanNode::class => 'true|false', - EnumNode::class => implode('|', array_map('json_encode', $prototype->getValues())), + EnumNode::class => $prototype->getPermissibleValues('|'), default => 'value', }; } @@ -151,7 +155,7 @@ private function writeNode(NodeInterface $node, int $depth = 0, bool $root = fal } if ($child instanceof EnumNode) { - $comments[] = 'One of '.implode('; ', array_map('json_encode', $child->getValues())); + $comments[] = 'One of '.$child->getPermissibleValues('; '); } if (\count($comments)) { @@ -249,7 +253,7 @@ private function writeNode(NodeInterface $node, int $depth = 0, bool $root = fal /** * Outputs a single config reference line. */ - private function writeLine(string $text, int $indent = 0) + private function writeLine(string $text, int $indent = 0): void { $indent = \strlen($text) + $indent; $format = '%'.$indent.'s'; diff --git a/app/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php b/app/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php index 606c3edaa..97a391ada 100644 --- a/app/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php +++ b/app/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php @@ -30,11 +30,17 @@ class YamlReferenceDumper { private ?string $reference = null; + /** + * @return string + */ public function dump(ConfigurationInterface $configuration) { return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree()); } + /** + * @return string + */ public function dumpAtPath(ConfigurationInterface $configuration, string $path) { $rootNode = $node = $configuration->getConfigTreeBuilder()->buildTree(); @@ -61,6 +67,9 @@ public function dumpAtPath(ConfigurationInterface $configuration, string $path) return $this->dumpNode($node); } + /** + * @return string + */ public function dumpNode(NodeInterface $node) { $this->reference = ''; @@ -71,7 +80,7 @@ public function dumpNode(NodeInterface $node) return $ref; } - private function writeNode(NodeInterface $node, NodeInterface $parentNode = null, int $depth = 0, bool $prototypedArray = false) + private function writeNode(NodeInterface $node, NodeInterface $parentNode = null, int $depth = 0, bool $prototypedArray = false): void { $comments = []; $default = ''; @@ -98,7 +107,7 @@ private function writeNode(NodeInterface $node, NodeInterface $parentNode = null } } } elseif ($node instanceof EnumNode) { - $comments[] = 'One of '.implode('; ', array_map('json_encode', $node->getValues())); + $comments[] = 'One of '.$node->getPermissibleValues('; '); $default = $node->hasDefaultValue() ? Inline::dump($node->getDefaultValue()) : '~'; } elseif (VariableNode::class === $node::class && \is_array($example)) { // If there is an array example, we are sure we dont need to print a default value @@ -183,7 +192,7 @@ private function writeNode(NodeInterface $node, NodeInterface $parentNode = null /** * Outputs a single config reference line. */ - private function writeLine(string $text, int $indent = 0) + private function writeLine(string $text, int $indent = 0): void { $indent = \strlen($text) + $indent; $format = '%'.$indent.'s'; @@ -191,7 +200,7 @@ private function writeLine(string $text, int $indent = 0) $this->reference .= sprintf($format, $text)."\n"; } - private function writeArray(array $array, int $depth) + private function writeArray(array $array, int $depth): void { $isIndexed = array_is_list($array); diff --git a/app/vendor/symfony/config/Definition/EnumNode.php b/app/vendor/symfony/config/Definition/EnumNode.php index 76d8d12ac..4edeae904 100644 --- a/app/vendor/symfony/config/Definition/EnumNode.php +++ b/app/vendor/symfony/config/Definition/EnumNode.php @@ -24,26 +24,68 @@ class EnumNode extends ScalarNode public function __construct(?string $name, NodeInterface $parent = null, array $values = [], string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR) { - $values = array_unique($values); if (!$values) { throw new \InvalidArgumentException('$values must contain at least one element.'); } + foreach ($values as $value) { + if (null === $value || \is_scalar($value)) { + continue; + } + + if (!$value instanceof \UnitEnum) { + throw new \InvalidArgumentException(sprintf('"%s" only supports scalar, enum, or null values, "%s" given.', __CLASS__, get_debug_type($value))); + } + + if ($value::class !== ($enumClass ??= $value::class)) { + throw new \InvalidArgumentException(sprintf('"%s" only supports one type of enum, "%s" and "%s" passed.', __CLASS__, $enumClass, $value::class)); + } + } + parent::__construct($name, $parent, $pathSeparator); $this->values = $values; } + /** + * @return array + */ public function getValues() { return $this->values; } + /** + * @internal + */ + public function getPermissibleValues(string $separator): string + { + return implode($separator, array_unique(array_map(static function (mixed $value): string { + if (!$value instanceof \UnitEnum) { + return json_encode($value); + } + + return ltrim(var_export($value, true), '\\'); + }, $this->values))); + } + + /** + * @return void + */ + protected function validateType(mixed $value) + { + if ($value instanceof \UnitEnum) { + return; + } + + parent::validateType($value); + } + protected function finalizeValue(mixed $value): mixed { $value = parent::finalizeValue($value); if (!\in_array($value, $this->values, true)) { - $ex = new InvalidConfigurationException(sprintf('The value %s is not allowed for path "%s". Permissible values: %s', json_encode($value), $this->getPath(), implode(', ', array_map('json_encode', $this->values)))); + $ex = new InvalidConfigurationException(sprintf('The value %s is not allowed for path "%s". Permissible values: %s', json_encode($value), $this->getPath(), $this->getPermissibleValues(', '))); $ex->setPath($this->getPath()); throw $ex; diff --git a/app/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php b/app/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php index 4ecf35157..794447bf8 100644 --- a/app/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php +++ b/app/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php @@ -22,6 +22,9 @@ class InvalidConfigurationException extends Exception private ?string $path = null; private bool $containsHints = false; + /** + * @return void + */ public function setPath(string $path) { $this->path = $path; @@ -34,6 +37,8 @@ public function getPath(): ?string /** * Adds extra information that is suffixed to the original exception message. + * + * @return void */ public function addHint(string $hint) { diff --git a/app/vendor/symfony/config/Definition/FloatNode.php b/app/vendor/symfony/config/Definition/FloatNode.php index e9123e8b0..ce4193e09 100644 --- a/app/vendor/symfony/config/Definition/FloatNode.php +++ b/app/vendor/symfony/config/Definition/FloatNode.php @@ -20,6 +20,9 @@ */ class FloatNode extends NumericNode { + /** + * @return void + */ protected function validateType(mixed $value) { // Integers are also accepted, we just cast them diff --git a/app/vendor/symfony/config/Definition/IntegerNode.php b/app/vendor/symfony/config/Definition/IntegerNode.php index cc9132c74..4a3e3253c 100644 --- a/app/vendor/symfony/config/Definition/IntegerNode.php +++ b/app/vendor/symfony/config/Definition/IntegerNode.php @@ -20,6 +20,9 @@ */ class IntegerNode extends NumericNode { + /** + * @return void + */ protected function validateType(mixed $value) { if (!\is_int($value)) { diff --git a/app/vendor/symfony/config/Definition/Processor.php b/app/vendor/symfony/config/Definition/Processor.php index 2435a56c5..dc3d4c69b 100644 --- a/app/vendor/symfony/config/Definition/Processor.php +++ b/app/vendor/symfony/config/Definition/Processor.php @@ -63,9 +63,9 @@ public function processConfiguration(ConfigurationInterface $configuration, arra * * extensions: ['twig.extension.foo', 'twig.extension.bar'] * - * @param array $config A config array - * @param string $key The key to normalize - * @param string $plural The plural form of the key if it is irregular + * @param array $config A config array + * @param string $key The key to normalize + * @param string|null $plural The plural form of the key if it is irregular */ public static function normalizeConfig(array $config, string $key, string $plural = null): array { diff --git a/app/vendor/symfony/config/Definition/PrototypeNodeInterface.php b/app/vendor/symfony/config/Definition/PrototypeNodeInterface.php index b160aa94a..9dce7444b 100644 --- a/app/vendor/symfony/config/Definition/PrototypeNodeInterface.php +++ b/app/vendor/symfony/config/Definition/PrototypeNodeInterface.php @@ -20,6 +20,8 @@ interface PrototypeNodeInterface extends NodeInterface { /** * Sets the name of the node. + * + * @return void */ public function setName(string $name); } diff --git a/app/vendor/symfony/config/Definition/PrototypedArrayNode.php b/app/vendor/symfony/config/Definition/PrototypedArrayNode.php index d3ca83bdb..c105ac1f3 100644 --- a/app/vendor/symfony/config/Definition/PrototypedArrayNode.php +++ b/app/vendor/symfony/config/Definition/PrototypedArrayNode.php @@ -37,6 +37,8 @@ class PrototypedArrayNode extends ArrayNode /** * Sets the minimum number of elements that a prototype based node must * contain. By default this is zero, meaning no elements. + * + * @return void */ public function setMinNumberOfElements(int $number) { @@ -66,6 +68,8 @@ public function setMinNumberOfElements(int $number) * * @param string $attribute The name of the attribute which value is to be used as a key * @param bool $remove Whether or not to remove the key + * + * @return void */ public function setKeyAttribute(string $attribute, bool $remove = true) { @@ -83,6 +87,8 @@ public function getKeyAttribute(): ?string /** * Sets the default value of this node. + * + * @return void */ public function setDefaultValue(array $value) { @@ -98,6 +104,8 @@ public function hasDefaultValue(): bool * Adds default children when none are set. * * @param int|string|array|null $children The number of children|The child name|The children names to be added + * + * @return void */ public function setAddChildrenIfNoneSet(int|string|array|null $children = ['defaults']) { @@ -129,6 +137,8 @@ public function getDefaultValue(): mixed /** * Sets the node prototype. + * + * @return void */ public function setPrototype(PrototypeNodeInterface $node) { @@ -146,6 +156,8 @@ public function getPrototype(): PrototypeNodeInterface /** * Disable adding concrete children for prototyped nodes. * + * @return never + * * @throws Exception */ public function addChild(NodeInterface $node) diff --git a/app/vendor/symfony/config/Definition/ScalarNode.php b/app/vendor/symfony/config/Definition/ScalarNode.php index 766436dd2..e11fa1ee1 100644 --- a/app/vendor/symfony/config/Definition/ScalarNode.php +++ b/app/vendor/symfony/config/Definition/ScalarNode.php @@ -27,6 +27,9 @@ */ class ScalarNode extends VariableNode { + /** + * @return void + */ protected function validateType(mixed $value) { if (!\is_scalar($value) && null !== $value) { diff --git a/app/vendor/symfony/config/Definition/VariableNode.php b/app/vendor/symfony/config/Definition/VariableNode.php index c636f12c4..6bdc65b4e 100644 --- a/app/vendor/symfony/config/Definition/VariableNode.php +++ b/app/vendor/symfony/config/Definition/VariableNode.php @@ -27,6 +27,9 @@ class VariableNode extends BaseNode implements PrototypeNodeInterface protected $defaultValue; protected $allowEmptyValue = true; + /** + * @return void + */ public function setDefaultValue(mixed $value) { $this->defaultValueSet = true; @@ -49,17 +52,25 @@ public function getDefaultValue(): mixed * Sets if this node is allowed to have an empty value. * * @param bool $boolean True if this entity will accept empty values + * + * @return void */ public function setAllowEmptyValue(bool $boolean) { $this->allowEmptyValue = $boolean; } + /** + * @return void + */ public function setName(string $name) { $this->name = $name; } + /** + * @return void + */ protected function validateType(mixed $value) { } diff --git a/app/vendor/symfony/config/Exception/FileLocatorFileNotFoundException.php b/app/vendor/symfony/config/Exception/FileLocatorFileNotFoundException.php index 92700c1ab..c5173ae58 100644 --- a/app/vendor/symfony/config/Exception/FileLocatorFileNotFoundException.php +++ b/app/vendor/symfony/config/Exception/FileLocatorFileNotFoundException.php @@ -27,6 +27,9 @@ public function __construct(string $message = '', int $code = 0, \Throwable $pre $this->paths = $paths; } + /** + * @return array + */ public function getPaths() { return $this->paths; diff --git a/app/vendor/symfony/config/Exception/LoaderLoadException.php b/app/vendor/symfony/config/Exception/LoaderLoadException.php index 5f9bfbc07..57afd6a8d 100644 --- a/app/vendor/symfony/config/Exception/LoaderLoadException.php +++ b/app/vendor/symfony/config/Exception/LoaderLoadException.php @@ -76,6 +76,9 @@ public function __construct(mixed $resource, string $sourceResource = null, int parent::__construct($message, $code, $previous); } + /** + * @return string + */ protected function varToString(mixed $var) { if (\is_object($var)) { diff --git a/app/vendor/symfony/config/FileLocator.php b/app/vendor/symfony/config/FileLocator.php index ab18232db..e147d9b1a 100644 --- a/app/vendor/symfony/config/FileLocator.php +++ b/app/vendor/symfony/config/FileLocator.php @@ -30,6 +30,9 @@ public function __construct(string|array $paths = []) $this->paths = (array) $paths; } + /** + * @return string|array + */ public function locate(string $name, string $currentPath = null, bool $first = true) { if ('' === $name) { diff --git a/app/vendor/symfony/config/LICENSE b/app/vendor/symfony/config/LICENSE index 008370457..0138f8f07 100644 --- a/app/vendor/symfony/config/LICENSE +++ b/app/vendor/symfony/config/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/symfony/config/Loader/FileLoader.php b/app/vendor/symfony/config/Loader/FileLoader.php index 30034e55a..8cfaa23ba 100644 --- a/app/vendor/symfony/config/Loader/FileLoader.php +++ b/app/vendor/symfony/config/Loader/FileLoader.php @@ -39,6 +39,8 @@ public function __construct(FileLocatorInterface $locator, string $env = null) /** * Sets the current directory. + * + * @return void */ public function setCurrentDir(string $dir) { @@ -62,6 +64,8 @@ public function getLocator(): FileLocatorInterface * @param string|null $sourceResource The original resource importing the new resource * @param string|string[]|null $exclude Glob patterns to exclude from the import * + * @return mixed + * * @throws LoaderLoadException * @throws FileLoaderImportCircularReferenceException * @throws FileLocatorFileNotFoundException @@ -97,7 +101,7 @@ public function import(mixed $resource, string $type = null, bool $ignoreErrors /** * @internal */ - protected function glob(string $pattern, bool $recursive, array|GlobResource &$resource = null, bool $ignoreErrors = false, bool $forExclusion = false, array $excluded = []) + protected function glob(string $pattern, bool $recursive, array|GlobResource &$resource = null, bool $ignoreErrors = false, bool $forExclusion = false, array $excluded = []): iterable { if (\strlen($pattern) === $i = strcspn($pattern, '*?{[')) { $prefix = $pattern; @@ -129,7 +133,7 @@ protected function glob(string $pattern, bool $recursive, array|GlobResource &$r yield from $resource; } - private function doImport(mixed $resource, string $type = null, bool $ignoreErrors = false, string $sourceResource = null) + private function doImport(mixed $resource, string $type = null, bool $ignoreErrors = false, string $sourceResource = null): mixed { try { $loader = $this->resolve($resource, $type); diff --git a/app/vendor/symfony/config/Loader/Loader.php b/app/vendor/symfony/config/Loader/Loader.php index 2ab50b021..36e85ad34 100644 --- a/app/vendor/symfony/config/Loader/Loader.php +++ b/app/vendor/symfony/config/Loader/Loader.php @@ -33,6 +33,9 @@ public function getResolver(): LoaderResolverInterface return $this->resolver; } + /** + * @return void + */ public function setResolver(LoaderResolverInterface $resolver) { $this->resolver = $resolver; diff --git a/app/vendor/symfony/config/Loader/LoaderInterface.php b/app/vendor/symfony/config/Loader/LoaderInterface.php index b94a4378f..4e0746d4d 100644 --- a/app/vendor/symfony/config/Loader/LoaderInterface.php +++ b/app/vendor/symfony/config/Loader/LoaderInterface.php @@ -45,6 +45,8 @@ public function getResolver(); /** * Sets the loader resolver. + * + * @return void */ public function setResolver(LoaderResolverInterface $resolver); } diff --git a/app/vendor/symfony/config/Loader/LoaderResolver.php b/app/vendor/symfony/config/Loader/LoaderResolver.php index fa00730dc..670e32012 100644 --- a/app/vendor/symfony/config/Loader/LoaderResolver.php +++ b/app/vendor/symfony/config/Loader/LoaderResolver.php @@ -47,6 +47,9 @@ public function resolve(mixed $resource, string $type = null): LoaderInterface|f return false; } + /** + * @return void + */ public function addLoader(LoaderInterface $loader) { $this->loaders[] = $loader; diff --git a/app/vendor/symfony/config/Resource/ClassExistenceResource.php b/app/vendor/symfony/config/Resource/ClassExistenceResource.php index b701816f9..2f262bac8 100644 --- a/app/vendor/symfony/config/Resource/ClassExistenceResource.php +++ b/app/vendor/symfony/config/Resource/ClassExistenceResource.php @@ -32,7 +32,7 @@ class ClassExistenceResource implements SelfCheckingResourceInterface /** * @param string $resource The fully-qualified class name - * @param bool|null $exists Boolean when the existency check has already been done + * @param bool|null $exists Boolean when the existence check has already been done */ public function __construct(string $resource, bool $exists = null) { @@ -139,7 +139,7 @@ public function __wakeup() * * @internal */ - public static function throwOnRequiredClass(string $class, \Exception $previous = null) + public static function throwOnRequiredClass(string $class, \Exception $previous = null): void { // If the passed class is the resource being checked, we shouldn't throw. if (null === $previous && self::$autoloadedClass === $class) { @@ -160,7 +160,7 @@ public static function throwOnRequiredClass(string $class, \Exception $previous $message = sprintf('Class "%s" not found.', $class); - if (self::$autoloadedClass !== $class) { + if ($class !== (self::$autoloadedClass ?? $class)) { $message = substr_replace($message, sprintf(' while loading "%s"', self::$autoloadedClass), -1, 0); } diff --git a/app/vendor/symfony/config/Resource/ComposerResource.php b/app/vendor/symfony/config/Resource/ComposerResource.php index e9b78b4fd..834812253 100644 --- a/app/vendor/symfony/config/Resource/ComposerResource.php +++ b/app/vendor/symfony/config/Resource/ComposerResource.php @@ -47,7 +47,7 @@ public function isFresh(int $timestamp): bool return array_values(self::$runtimeVendors) === array_values($this->vendors); } - private static function refresh() + private static function refresh(): void { self::$runtimeVendors = []; diff --git a/app/vendor/symfony/config/Resource/DirectoryResource.php b/app/vendor/symfony/config/Resource/DirectoryResource.php index b95ae2c19..7560cd3b3 100644 --- a/app/vendor/symfony/config/Resource/DirectoryResource.php +++ b/app/vendor/symfony/config/Resource/DirectoryResource.php @@ -43,7 +43,7 @@ public function __construct(string $resource, string $pattern = null) public function __toString(): string { - return md5(serialize([$this->resource, $this->pattern])); + return hash('xxh128', serialize([$this->resource, $this->pattern])); } public function getResource(): string diff --git a/app/vendor/symfony/config/Resource/GlobResource.php b/app/vendor/symfony/config/Resource/GlobResource.php index 7acfcd663..2aedc84b3 100644 --- a/app/vendor/symfony/config/Resource/GlobResource.php +++ b/app/vendor/symfony/config/Resource/GlobResource.php @@ -97,28 +97,48 @@ public function __wakeup(): void public function getIterator(): \Traversable { - if (!file_exists($this->prefix) || (!$this->recursive && '' === $this->pattern)) { + if ((!$this->recursive && '' === $this->pattern) || !file_exists($this->prefix)) { return; } - $prefix = str_replace('\\', '/', $this->prefix); + + if (is_file($prefix = str_replace('\\', '/', $this->prefix))) { + $prefix = \dirname($prefix); + $pattern = basename($prefix).$this->pattern; + } else { + $pattern = $this->pattern; + } + + if (class_exists(Finder::class)) { + $regex = Glob::toRegex($pattern); + if ($this->recursive) { + $regex = substr_replace($regex, '(/|$)', -2, 1); + } + } else { + $regex = null; + } + + $prefixLen = \strlen($prefix); $paths = null; - if ('' === $this->pattern && is_file($prefix)) { - $paths = [$this->prefix]; - } elseif (!str_starts_with($this->prefix, 'phar://') && !str_contains($this->pattern, '/**/')) { - if ($this->globBrace || !str_contains($this->pattern, '{')) { - $paths = glob($this->prefix.$this->pattern, \GLOB_NOSORT | $this->globBrace); + if ('' === $this->pattern && is_file($this->prefix)) { + $paths = [$this->prefix => null]; + } elseif (!str_starts_with($this->prefix, 'phar://') && (null !== $regex || !str_contains($this->pattern, '/**/'))) { + if (!str_contains($this->pattern, '/**/') && ($this->globBrace || !str_contains($this->pattern, '{'))) { + $paths = array_fill_keys(glob($this->prefix.$this->pattern, \GLOB_NOSORT | $this->globBrace), null); } elseif (!str_contains($this->pattern, '\\') || !preg_match('/\\\\[,{}]/', $this->pattern)) { + $paths = []; foreach ($this->expandGlob($this->pattern) as $p) { - $paths[] = glob($this->prefix.$p, \GLOB_NOSORT); + if (false !== $i = strpos($p, '/**/')) { + $p = substr_replace($p, '/*', $i); + } + $paths += array_fill_keys(glob($this->prefix.$p, \GLOB_NOSORT), false !== $i ? $regex : null); } - $paths = array_merge(...$paths); } } if (null !== $paths) { - natsort($paths); - foreach ($paths as $path) { + uksort($paths, 'strnatcmp'); + foreach ($paths as $path => $regex) { if ($this->excludedPrefixes) { $normalizedPath = str_replace('\\', '/', $path); do { @@ -128,25 +148,25 @@ public function getIterator(): \Traversable } while ($prefix !== $dirPath && $dirPath !== $normalizedPath = \dirname($dirPath)); } - if (is_file($path)) { + if ((null === $regex || preg_match($regex, substr(str_replace('\\', '/', $path), $prefixLen))) && is_file($path)) { yield $path => new \SplFileInfo($path); } if (!is_dir($path)) { continue; } - if ($this->forExclusion) { + if ($this->forExclusion && (null === $regex || preg_match($regex, substr(str_replace('\\', '/', $path), $prefixLen)))) { yield $path => new \SplFileInfo($path); continue; } - if (!$this->recursive || isset($this->excludedPrefixes[str_replace('\\', '/', $path)])) { + if (!($this->recursive || null !== $regex) || isset($this->excludedPrefixes[str_replace('\\', '/', $path)])) { continue; } $files = iterator_to_array(new \RecursiveIteratorIterator( new \RecursiveCallbackFilterIterator( new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), - function (\SplFileInfo $file, $path) { - return !isset($this->excludedPrefixes[str_replace('\\', '/', $path)]) && '.' !== $file->getBasename()[0]; - } + fn (\SplFileInfo $file, $path) => !isset($this->excludedPrefixes[$path = str_replace('\\', '/', $path)]) + && (null === $regex || preg_match($regex, substr($path, $prefixLen)) || $file->isDir()) + && '.' !== $file->getBasename()[0] ), \RecursiveIteratorIterator::LEAVES_ONLY )); @@ -163,23 +183,9 @@ function (\SplFileInfo $file, $path) { } if (!class_exists(Finder::class)) { - throw new \LogicException(sprintf('Extended glob pattern "%s" cannot be used as the Finder component is not installed.', $this->pattern)); - } - - if (is_file($prefix = $this->prefix)) { - $prefix = \dirname($prefix); - $pattern = basename($prefix).$this->pattern; - } else { - $pattern = $this->pattern; - } - - $regex = Glob::toRegex($pattern); - if ($this->recursive) { - $regex = substr_replace($regex, '(/|$)', -2, 1); + throw new \LogicException('Extended glob patterns cannot be used as the Finder component is not installed. Try running "composer require symfony/finder".'); } - $prefixLen = \strlen($prefix); - yield from (new Finder()) ->followLinks() ->filter(function (\SplFileInfo $info) use ($regex, $prefixLen, $prefix) { @@ -202,7 +208,7 @@ function (\SplFileInfo $file, $path) { private function computeHash(): string { - $hash = hash_init('md5'); + $hash = hash_init('xxh128'); foreach ($this->getIterator() as $path => $info) { hash_update($hash, $path."\n"); diff --git a/app/vendor/symfony/config/Resource/ReflectionClassResource.php b/app/vendor/symfony/config/Resource/ReflectionClassResource.php index 279ff203c..dbd47e66d 100644 --- a/app/vendor/symfony/config/Resource/ReflectionClassResource.php +++ b/app/vendor/symfony/config/Resource/ReflectionClassResource.php @@ -73,7 +73,7 @@ public function __sleep(): array return ['files', 'className', 'hash']; } - private function loadFiles(\ReflectionClass $class) + private function loadFiles(\ReflectionClass $class): void { foreach ($class->getInterfaces() as $v) { $this->loadFiles($v); @@ -105,7 +105,7 @@ private function computeHash(): string // the class does not exist anymore return false; } - $hash = hash_init('md5'); + $hash = hash_init('xxh128'); foreach ($this->generateSignature($this->classReflector) as $info) { hash_update($hash, $info); @@ -154,8 +154,6 @@ private function generateSignature(\ReflectionClass $class): iterable } } - $defined = \Closure::bind(static function ($c) { return \defined($c); }, null, $class->name); - foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) { foreach ($m->getAttributes() as $a) { $attributes[] = [$a->getName(), (string) $a]; diff --git a/app/vendor/symfony/config/ResourceCheckerConfigCache.php b/app/vendor/symfony/config/ResourceCheckerConfigCache.php index 3a3e6c52b..a8478a8cc 100644 --- a/app/vendor/symfony/config/ResourceCheckerConfigCache.php +++ b/app/vendor/symfony/config/ResourceCheckerConfigCache.php @@ -105,6 +105,8 @@ public function isFresh(): bool * @param string $content The content to write in the cache * @param ResourceInterface[] $metadata An array of metadata * + * @return void + * * @throws \RuntimeException When cache file can't be written */ public function write(string $content, array $metadata = null) @@ -141,7 +143,7 @@ private function getMetaFile(): string return $this->file.'.meta'; } - private function safelyUnserialize(string $file) + private function safelyUnserialize(string $file): mixed { $meta = false; $content = file_get_contents($file); @@ -172,7 +174,7 @@ private function safelyUnserialize(string $file) /** * @internal */ - public static function handleUnserializeCallback(string $class) + public static function handleUnserializeCallback(string $class): void { trigger_error('Class not found: '.$class); } diff --git a/app/vendor/symfony/config/Util/XmlUtils.php b/app/vendor/symfony/config/Util/XmlUtils.php index a1b1d29e6..cc024da46 100644 --- a/app/vendor/symfony/config/Util/XmlUtils.php +++ b/app/vendor/symfony/config/Util/XmlUtils.php @@ -238,6 +238,9 @@ public static function phpize(string|\Stringable $value): mixed } } + /** + * @return array + */ protected static function getXmlErrors(bool $internalErrors) { $errors = []; diff --git a/app/vendor/symfony/config/composer.json b/app/vendor/symfony/config/composer.json index 85d842a53..a4b72c36a 100644 --- a/app/vendor/symfony/config/composer.json +++ b/app/vendor/symfony/config/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/filesystem": "^5.4|^6.0", "symfony/polyfill-ctype": "~1.8" }, @@ -25,14 +25,12 @@ "symfony/event-dispatcher": "^5.4|^6.0", "symfony/finder": "^5.4|^6.0", "symfony/messenger": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/yaml": "^5.4|^6.0" }, "conflict": { - "symfony/finder": "<5.4" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" + "symfony/finder": "<5.4", + "symfony/service-contracts": "<2.5" }, "autoload": { "psr-4": { "Symfony\\Component\\Config\\": "" }, diff --git a/app/vendor/symfony/console/Application.php b/app/vendor/symfony/console/Application.php index d4ec1be09..b7aaa6a29 100644 --- a/app/vendor/symfony/console/Application.php +++ b/app/vendor/symfony/console/Application.php @@ -87,7 +87,7 @@ class Application implements ResetInterface private string $defaultCommand; private bool $singleCommand = false; private bool $initialized = false; - private SignalRegistry $signalRegistry; + private ?SignalRegistry $signalRegistry = null; private array $signalsToDispatchEvent = []; public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') @@ -105,11 +105,14 @@ public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN /** * @final */ - public function setDispatcher(EventDispatcherInterface $dispatcher) + public function setDispatcher(EventDispatcherInterface $dispatcher): void { $this->dispatcher = $dispatcher; } + /** + * @return void + */ public function setCommandLoader(CommandLoaderInterface $commandLoader) { $this->commandLoader = $commandLoader; @@ -118,12 +121,15 @@ public function setCommandLoader(CommandLoaderInterface $commandLoader) public function getSignalRegistry(): SignalRegistry { if (!$this->signalRegistry) { - throw new RuntimeException('Signals are not supported. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); + throw new RuntimeException('Signals are not supported. Make sure that the "pcntl" extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); } return $this->signalRegistry; } + /** + * @return void + */ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) { $this->signalsToDispatchEvent = $signalsToDispatchEvent; @@ -317,10 +323,16 @@ public function doRun(InputInterface $input, OutputInterface $output) return $exitCode; } + /** + * @return void + */ public function reset() { } + /** + * @return void + */ public function setHelperSet(HelperSet $helperSet) { $this->helperSet = $helperSet; @@ -334,6 +346,9 @@ public function getHelperSet(): HelperSet return $this->helperSet ??= $this->getDefaultHelperSet(); } + /** + * @return void + */ public function setDefinition(InputDefinition $definition) { $this->definition = $definition; @@ -404,6 +419,8 @@ public function areExceptionsCaught(): bool /** * Sets whether to catch exceptions or not during commands execution. + * + * @return void */ public function setCatchExceptions(bool $boolean) { @@ -420,6 +437,8 @@ public function isAutoExitEnabled(): bool /** * Sets whether to automatically exit after a command execution or not. + * + * @return void */ public function setAutoExit(bool $boolean) { @@ -436,7 +455,9 @@ public function getName(): string /** * Sets the application name. - **/ + * + * @return void + */ public function setName(string $name) { $this->name = $name; @@ -452,6 +473,8 @@ public function getVersion(): string /** * Sets the application version. + * + * @return void */ public function setVersion(string $version) { @@ -490,6 +513,8 @@ public function register(string $name): Command * If a Command is not enabled it will not be added. * * @param Command[] $commands An array of commands + * + * @return void */ public function addCommands(array $commands) { @@ -687,9 +712,7 @@ public function find(string $name) if ($alternatives = $this->findAlternatives($name, $allCommands)) { // remove hidden commands - $alternatives = array_filter($alternatives, function ($name) { - return !$this->get($name)->isHidden(); - }); + $alternatives = array_filter($alternatives, fn ($name) => !$this->get($name)->isHidden()); if (1 == \count($alternatives)) { $message .= "\n\nDid you mean this?\n "; @@ -840,9 +863,7 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo } if (str_contains($message, "@anonymous\0")) { - $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $message); + $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $message); } $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX; @@ -903,6 +924,8 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo /** * Configures the input and output instances based on the user arguments and options. + * + * @return void */ protected function configureIO(InputInterface $input, OutputInterface $output) { @@ -977,44 +1000,62 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI } } - if ($this->signalsToDispatchEvent) { - $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; - - if ($commandSignals || null !== $this->dispatcher) { - if (!$this->signalRegistry) { - throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } + $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; + if ($commandSignals || $this->dispatcher && $this->signalsToDispatchEvent) { + if (!$this->signalRegistry) { + throw new RuntimeException('Unable to subscribe to signal events. Make sure that the "pcntl" extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); + } - if (Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); + if (Terminal::hasSttyAvailable()) { + $sttyMode = shell_exec('stty -g'); - foreach ([\SIGINT, \SIGTERM] as $signal) { - $this->signalRegistry->register($signal, static function () use ($sttyMode) { - shell_exec('stty '.$sttyMode); - }); - } + foreach ([\SIGINT, \SIGTERM] as $signal) { + $this->signalRegistry->register($signal, static fn () => shell_exec('stty '.$sttyMode)); } } - if (null !== $this->dispatcher) { + if ($this->dispatcher) { + // We register application signals, so that we can dispatch the event foreach ($this->signalsToDispatchEvent as $signal) { $event = new ConsoleSignalEvent($command, $input, $output, $signal); - $this->signalRegistry->register($signal, function ($signal, $hasNext) use ($event) { + $this->signalRegistry->register($signal, function ($signal) use ($event, $command, $commandSignals) { $this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL); - - // No more handlers, we try to simulate PHP default behavior - if (!$hasNext) { - if (!\in_array($signal, [\SIGUSR1, \SIGUSR2], true)) { - exit(0); + $exitCode = $event->getExitCode(); + + // If the command is signalable, we call the handleSignal() method + if (\in_array($signal, $commandSignals, true)) { + $exitCode = $command->handleSignal($signal, $exitCode); + // BC layer for Symfony <= 5 + if (null === $exitCode) { + trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', get_debug_type($command)); + $exitCode = 0; } } + + if (false !== $exitCode) { + exit($exitCode); + } }); } + + // then we register command signals, but not if already handled after the dispatcher + $commandSignals = array_diff($commandSignals, $this->signalsToDispatchEvent); } foreach ($commandSignals as $signal) { - $this->signalRegistry->register($signal, [$command, 'handleSignal']); + $this->signalRegistry->register($signal, function (int $signal) use ($command): void { + $exitCode = $command->handleSignal($signal); + // BC layer for Symfony <= 5 + if (null === $exitCode) { + trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', get_debug_type($command)); + $exitCode = 0; + } + + if (false !== $exitCode) { + exit($exitCode); + } + }); } } @@ -1170,7 +1211,7 @@ private function findAlternatives(string $name, iterable $collection): array } } - $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); + $alternatives = array_filter($alternatives, fn ($lev) => $lev < 2 * $threshold); ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE); return array_keys($alternatives); @@ -1261,7 +1302,7 @@ private function extractAllNamespaces(string $name): array return $namespaces; } - private function init() + private function init(): void { if ($this->initialized) { return; diff --git a/app/vendor/symfony/console/CHANGELOG.md b/app/vendor/symfony/console/CHANGELOG.md index 61c36b0e0..3428a57de 100644 --- a/app/vendor/symfony/console/CHANGELOG.md +++ b/app/vendor/symfony/console/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========= +6.3 +--- + + * Add support for choosing exit code while handling signal, or to not exit at all + * Add `ProgressBar::setPlaceholderFormatter` to set a placeholder attached to a instance, instead of being global. + * Add `ReStructuredTextDescriptor` + 6.2 --- diff --git a/app/vendor/symfony/console/Command/Command.php b/app/vendor/symfony/console/Command/Command.php index 1e3c1a5a2..704b112d1 100644 --- a/app/vendor/symfony/console/Command/Command.php +++ b/app/vendor/symfony/console/Command/Command.php @@ -141,12 +141,17 @@ public function __construct(string $name = null) * Ignores validation errors. * * This is mainly useful for the help command. + * + * @return void */ public function ignoreValidationErrors() { $this->ignoreValidationErrors = true; } + /** + * @return void + */ public function setApplication(Application $application = null) { if (1 > \func_num_args()) { @@ -162,6 +167,9 @@ public function setApplication(Application $application = null) $this->fullDefinition = null; } + /** + * @return void + */ public function setHelperSet(HelperSet $helperSet) { $this->helperSet = $helperSet; @@ -198,6 +206,8 @@ public function isEnabled() /** * Configures the current command. + * + * @return void */ protected function configure() { @@ -228,6 +238,8 @@ protected function execute(InputInterface $input, OutputInterface $output) * This method is executed before the InputDefinition is validated. * This means that this is the only place where the command can * interactively ask for values of missing required arguments. + * + * @return void */ protected function interact(InputInterface $input, OutputInterface $output) { @@ -242,6 +254,8 @@ protected function interact(InputInterface $input, OutputInterface $output) * * @see InputInterface::bind() * @see InputInterface::validate() + * + * @return void */ protected function initialize(InputInterface $input, OutputInterface $output) { @@ -378,7 +392,7 @@ public function setCode(callable $code): static * * @internal */ - public function mergeApplicationDefinition(bool $mergeArgs = true) + public function mergeApplicationDefinition(bool $mergeArgs = true): void { if (null === $this->application) { return; @@ -702,7 +716,7 @@ public function getHelper(string $name): mixed * * @throws InvalidArgumentException When the name is invalid */ - private function validateName(string $name) + private function validateName(string $name): void { if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); diff --git a/app/vendor/symfony/console/Command/CompleteCommand.php b/app/vendor/symfony/console/Command/CompleteCommand.php index e65b334ce..058578d8b 100644 --- a/app/vendor/symfony/console/Command/CompleteCommand.php +++ b/app/vendor/symfony/console/Command/CompleteCommand.php @@ -74,7 +74,7 @@ protected function configure(): void ; } - protected function initialize(InputInterface $input, OutputInterface $output) + protected function initialize(InputInterface $input, OutputInterface $output): void { $this->isDebug = filter_var(getenv('SYMFONY_COMPLETION_DEBUG'), \FILTER_VALIDATE_BOOL); } @@ -134,12 +134,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int $completionInput->bind($command->getDefinition()); if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) { - $this->log(' Completing option names for the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' command.'); + $this->log(' Completing option names for the '.($command instanceof LazyCommand ? $command->getCommand() : $command)::class.' command.'); $suggestions->suggestOptions($command->getDefinition()->getOptions()); } else { $this->log([ - ' Completing using the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' class.', + ' Completing using the '.($command instanceof LazyCommand ? $command->getCommand() : $command)::class.' class.', ' Completing '.$completionInput->getCompletionType().' for '.$completionInput->getCompletionName().'', ]); if (null !== $compval = $completionInput->getCompletionValue()) { @@ -155,7 +155,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->log('Suggestions:'); if ($options = $suggestions->getOptionSuggestions()) { - $this->log(' --'.implode(' --', array_map(function ($o) { return $o->getName(); }, $options))); + $this->log(' --'.implode(' --', array_map(fn ($o) => $o->getName(), $options))); } elseif ($values = $suggestions->getValueSuggestions()) { $this->log(' '.implode(' ', $values)); } else { @@ -173,10 +173,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int throw $e; } - return self::FAILURE; + return 2; } - return self::SUCCESS; + return 0; } private function createCompletionInput(InputInterface $input): CompletionInput diff --git a/app/vendor/symfony/console/Command/DumpCompletionCommand.php b/app/vendor/symfony/console/Command/DumpCompletionCommand.php index 1ad1c0e7b..51b613a14 100644 --- a/app/vendor/symfony/console/Command/DumpCompletionCommand.php +++ b/app/vendor/symfony/console/Command/DumpCompletionCommand.php @@ -39,7 +39,7 @@ final class DumpCompletionCommand extends Command private array $supportedShells; - protected function configure() + protected function configure(): void { $fullCommand = $_SERVER['PHP_SELF']; $commandName = basename($fullCommand); @@ -48,14 +48,16 @@ protected function configure() $shell = $this->guessShell(); [$rcFile, $completionFile] = match ($shell) { 'fish' => ['~/.config/fish/config.fish', "/etc/fish/completions/$commandName.fish"], - 'zsh' => ['~/.zshrc', '$fpath[1]/'.$commandName], + 'zsh' => ['~/.zshrc', '$fpath[1]/_'.$commandName], default => ['~/.bashrc', "/etc/bash_completion.d/$commandName"], }; + $supportedShells = implode(', ', $this->getSupportedShells()); + $this ->setHelp(<<%command.name% command dumps the shell completion script required -to use shell autocompletion (currently, bash and fish completion is supported). +to use shell autocompletion (currently, {$supportedShells} completion are supported). Static installation ------------------- @@ -94,7 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($input->getOption('debug')) { $this->tailDebugLog($commandName, $output); - return self::SUCCESS; + return 0; } $shell = $input->getArgument('shell') ?? self::guessShell(); @@ -111,12 +113,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln(sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); } - return self::INVALID; + return 2; } $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, CompleteCommand::COMPLETION_API_VERSION], file_get_contents($completionFile))); - return self::SUCCESS; + return 0; } private static function guessShell(): string @@ -141,8 +143,19 @@ private function tailDebugLog(string $commandName, OutputInterface $output): voi */ private function getSupportedShells(): array { - return $this->supportedShells ??= array_map(function ($f) { - return pathinfo($f, \PATHINFO_EXTENSION); - }, glob(__DIR__.'/../Resources/completion.*')); + if (isset($this->supportedShells)) { + return $this->supportedShells; + } + + $shells = []; + + foreach (new \DirectoryIterator(__DIR__.'/../Resources/') as $file) { + if (str_starts_with($file->getBasename(), 'completion.') && $file->isFile()) { + $shells[] = $file->getExtension(); + } + } + sort($shells); + + return $this->supportedShells = $shells; } } diff --git a/app/vendor/symfony/console/Command/HelpCommand.php b/app/vendor/symfony/console/Command/HelpCommand.php index d4134e170..e6447b050 100644 --- a/app/vendor/symfony/console/Command/HelpCommand.php +++ b/app/vendor/symfony/console/Command/HelpCommand.php @@ -27,6 +27,9 @@ class HelpCommand extends Command { private Command $command; + /** + * @return void + */ protected function configure() { $this->ignoreValidationErrors(); @@ -34,12 +37,8 @@ protected function configure() $this ->setName('help') ->setDefinition([ - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help', function () { - return array_keys((new ApplicationDescription($this->getApplication()))->getCommands()); - }), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', function () { - return (new DescriptorHelper())->getFormats(); - }), + new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help', fn () => array_keys((new ApplicationDescription($this->getApplication()))->getCommands())), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', fn () => (new DescriptorHelper())->getFormats()), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), ]) ->setDescription('Display help for a command') @@ -58,6 +57,9 @@ protected function configure() ; } + /** + * @return void + */ public function setCommand(Command $command) { $this->command = $command; diff --git a/app/vendor/symfony/console/Command/ListCommand.php b/app/vendor/symfony/console/Command/ListCommand.php index cab88b439..5850c3d7b 100644 --- a/app/vendor/symfony/console/Command/ListCommand.php +++ b/app/vendor/symfony/console/Command/ListCommand.php @@ -25,18 +25,17 @@ */ class ListCommand extends Command { + /** + * @return void + */ protected function configure() { $this ->setName('list') ->setDefinition([ - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name', null, function () { - return array_keys((new ApplicationDescription($this->getApplication()))->getNamespaces()); - }), + new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name', null, fn () => array_keys((new ApplicationDescription($this->getApplication()))->getNamespaces())), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', function () { - return (new DescriptorHelper())->getFormats(); - }), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', fn () => (new DescriptorHelper())->getFormats()), new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments'), ]) ->setDescription('List commands') diff --git a/app/vendor/symfony/console/Command/LockableTrait.php b/app/vendor/symfony/console/Command/LockableTrait.php index 67923a9e8..c1006a65c 100644 --- a/app/vendor/symfony/console/Command/LockableTrait.php +++ b/app/vendor/symfony/console/Command/LockableTrait.php @@ -32,7 +32,7 @@ trait LockableTrait private function lock(string $name = null, bool $blocking = false): bool { if (!class_exists(SemaphoreStore::class)) { - throw new LogicException('To enable the locking feature you must install the symfony/lock component.'); + throw new LogicException('To enable the locking feature you must install the symfony/lock component. Try running "composer require symfony/lock".'); } if (null !== $this->lock) { @@ -58,7 +58,7 @@ private function lock(string $name = null, bool $blocking = false): bool /** * Releases the command lock if there is one. */ - private function release() + private function release(): void { if ($this->lock) { $this->lock->release(); diff --git a/app/vendor/symfony/console/Command/SignalableCommandInterface.php b/app/vendor/symfony/console/Command/SignalableCommandInterface.php index d439728b6..4d0876003 100644 --- a/app/vendor/symfony/console/Command/SignalableCommandInterface.php +++ b/app/vendor/symfony/console/Command/SignalableCommandInterface.php @@ -25,6 +25,10 @@ public function getSubscribedSignals(): array; /** * The method will be called when the application is signaled. + * + * @param int|false $previousExitCode + + * @return int|false The exit code to return or false to continue the normal execution */ - public function handleSignal(int $signal): void; + public function handleSignal(int $signal, /* int|false $previousExitCode = 0 */); } diff --git a/app/vendor/symfony/console/Completion/CompletionInput.php b/app/vendor/symfony/console/Completion/CompletionInput.php index 3ef8db5d1..800b7235a 100644 --- a/app/vendor/symfony/console/Completion/CompletionInput.php +++ b/app/vendor/symfony/console/Completion/CompletionInput.php @@ -34,7 +34,7 @@ final class CompletionInput extends ArgvInput private $tokens; private $currentIndex; private $completionType; - private $completionName = null; + private $completionName; private $completionValue = ''; /** diff --git a/app/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/app/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php index 62c80c3b0..27705ddb6 100644 --- a/app/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ b/app/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php @@ -29,6 +29,9 @@ */ class AddConsoleCommandPass implements CompilerPassInterface { + /** + * @return void + */ public function process(ContainerBuilder $container) { $commandServices = $container->findTaggedServiceIds('console.command', true); diff --git a/app/vendor/symfony/console/Descriptor/ApplicationDescription.php b/app/vendor/symfony/console/Descriptor/ApplicationDescription.php index 2158339ec..f8ed18045 100644 --- a/app/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ b/app/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -79,7 +79,7 @@ public function getCommand(string $name): Command return $this->commands[$name] ?? $this->aliases[$name]; } - private function inspectApplication() + private function inspectApplication(): void { $this->commands = []; $this->namespaces = []; diff --git a/app/vendor/symfony/console/Descriptor/Descriptor.php b/app/vendor/symfony/console/Descriptor/Descriptor.php index 1476f5755..7b2509c60 100644 --- a/app/vendor/symfony/console/Descriptor/Descriptor.php +++ b/app/vendor/symfony/console/Descriptor/Descriptor.php @@ -26,12 +26,9 @@ */ abstract class Descriptor implements DescriptorInterface { - /** - * @var OutputInterface - */ - protected $output; + protected OutputInterface $output; - public function describe(OutputInterface $output, object $object, array $options = []) + public function describe(OutputInterface $output, object $object, array $options = []): void { $this->output = $output; @@ -45,10 +42,7 @@ public function describe(OutputInterface $output, object $object, array $options }; } - /** - * Writes content to output. - */ - protected function write(string $content, bool $decorated = false) + protected function write(string $content, bool $decorated = false): void { $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW); } @@ -56,25 +50,25 @@ protected function write(string $content, bool $decorated = false) /** * Describes an InputArgument instance. */ - abstract protected function describeInputArgument(InputArgument $argument, array $options = []); + abstract protected function describeInputArgument(InputArgument $argument, array $options = []): void; /** * Describes an InputOption instance. */ - abstract protected function describeInputOption(InputOption $option, array $options = []); + abstract protected function describeInputOption(InputOption $option, array $options = []): void; /** * Describes an InputDefinition instance. */ - abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []); + abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []): void; /** * Describes a Command instance. */ - abstract protected function describeCommand(Command $command, array $options = []); + abstract protected function describeCommand(Command $command, array $options = []): void; /** * Describes an Application instance. */ - abstract protected function describeApplication(Application $application, array $options = []); + abstract protected function describeApplication(Application $application, array $options = []): void; } diff --git a/app/vendor/symfony/console/Descriptor/DescriptorInterface.php b/app/vendor/symfony/console/Descriptor/DescriptorInterface.php index ebea30367..ab468a256 100644 --- a/app/vendor/symfony/console/Descriptor/DescriptorInterface.php +++ b/app/vendor/symfony/console/Descriptor/DescriptorInterface.php @@ -20,5 +20,8 @@ */ interface DescriptorInterface { + /** + * @return void + */ public function describe(OutputInterface $output, object $object, array $options = []); } diff --git a/app/vendor/symfony/console/Descriptor/JsonDescriptor.php b/app/vendor/symfony/console/Descriptor/JsonDescriptor.php index 6f79a17a9..956303709 100644 --- a/app/vendor/symfony/console/Descriptor/JsonDescriptor.php +++ b/app/vendor/symfony/console/Descriptor/JsonDescriptor.php @@ -26,12 +26,12 @@ */ class JsonDescriptor extends Descriptor { - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { $this->writeData($this->getInputArgumentData($argument), $options); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { $this->writeData($this->getInputOptionData($option), $options); if ($option->isNegatable()) { @@ -39,17 +39,17 @@ protected function describeInputOption(InputOption $option, array $options = []) } } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { $this->writeData($this->getInputDefinitionData($definition), $options); } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { $this->writeData($this->getCommandData($command, $options['short'] ?? false), $options); } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $describedNamespace = $options['namespace'] ?? null; $description = new ApplicationDescription($application, $describedNamespace, true); @@ -81,7 +81,7 @@ protected function describeApplication(Application $application, array $options /** * Writes data as json. */ - private function writeData(array $data, array $options) + private function writeData(array $data, array $options): void { $flags = $options['json_encoding'] ?? 0; diff --git a/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php index fbd9c5346..b3f16ee90 100644 --- a/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ b/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php @@ -28,7 +28,7 @@ */ class MarkdownDescriptor extends Descriptor { - public function describe(OutputInterface $output, object $object, array $options = []) + public function describe(OutputInterface $output, object $object, array $options = []): void { $decorated = $output->isDecorated(); $output->setDecorated(false); @@ -38,12 +38,12 @@ public function describe(OutputInterface $output, object $object, array $options $output->setDecorated($decorated); } - protected function write(string $content, bool $decorated = true) + protected function write(string $content, bool $decorated = true): void { parent::write($content, $decorated); } - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { $this->write( '#### `'.($argument->getName() ?: '')."`\n\n" @@ -54,7 +54,7 @@ protected function describeInputArgument(InputArgument $argument, array $options ); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { $name = '--'.$option->getName(); if ($option->isNegatable()) { @@ -75,15 +75,13 @@ protected function describeInputOption(InputOption $option, array $options = []) ); } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { if ($showArguments = \count($definition->getArguments()) > 0) { $this->write('### Arguments'); foreach ($definition->getArguments() as $argument) { $this->write("\n\n"); - if (null !== $describeInputArgument = $this->describeInputArgument($argument)) { - $this->write($describeInputArgument); - } + $this->describeInputArgument($argument); } } @@ -95,14 +93,12 @@ protected function describeInputDefinition(InputDefinition $definition, array $o $this->write('### Options'); foreach ($definition->getOptions() as $option) { $this->write("\n\n"); - if (null !== $describeInputOption = $this->describeInputOption($option)) { - $this->write($describeInputOption); - } + $this->describeInputOption($option); } } } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { if ($options['short'] ?? false) { $this->write( @@ -110,9 +106,7 @@ protected function describeCommand(Command $command, array $options = []) .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" .($command->getDescription() ? $command->getDescription()."\n\n" : '') .'### Usage'."\n\n" - .array_reduce($command->getAliases(), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) + .array_reduce($command->getAliases(), fn ($carry, $usage) => $carry.'* `'.$usage.'`'."\n") ); return; @@ -125,9 +119,7 @@ protected function describeCommand(Command $command, array $options = []) .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" .($command->getDescription() ? $command->getDescription()."\n\n" : '') .'### Usage'."\n\n" - .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) + .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), fn ($carry, $usage) => $carry.'* `'.$usage.'`'."\n") ); if ($help = $command->getProcessedHelp()) { @@ -142,7 +134,7 @@ protected function describeCommand(Command $command, array $options = []) } } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $describedNamespace = $options['namespace'] ?? null; $description = new ApplicationDescription($application, $describedNamespace); @@ -157,16 +149,12 @@ protected function describeApplication(Application $application, array $options } $this->write("\n\n"); - $this->write(implode("\n", array_map(function ($commandName) use ($description) { - return sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())); - }, $namespace['commands']))); + $this->write(implode("\n", array_map(fn ($commandName) => sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())), $namespace['commands']))); } foreach ($description->getCommands() as $command) { $this->write("\n\n"); - if (null !== $describeCommand = $this->describeCommand($command, $options)) { - $this->write($describeCommand); - } + $this->describeCommand($command, $options); } } diff --git a/app/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php b/app/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php new file mode 100644 index 000000000..d4423fd34 --- /dev/null +++ b/app/vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php @@ -0,0 +1,272 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\String\UnicodeString; + +class ReStructuredTextDescriptor extends Descriptor +{ + //

    + private string $partChar = '='; + //

    + private string $chapterChar = '-'; + //

    + private string $sectionChar = '~'; + //

    + private string $subsectionChar = '.'; + //

    + private string $subsubsectionChar = '^'; + //
    + private string $paragraphsChar = '"'; + + private array $visibleNamespaces = []; + + public function describe(OutputInterface $output, object $object, array $options = []): void + { + $decorated = $output->isDecorated(); + $output->setDecorated(false); + + parent::describe($output, $object, $options); + + $output->setDecorated($decorated); + } + + /** + * Override parent method to set $decorated = true. + */ + protected function write(string $content, bool $decorated = true): void + { + parent::write($content, $decorated); + } + + protected function describeInputArgument(InputArgument $argument, array $options = []): void + { + $this->write( + $argument->getName() ?: ''."\n".str_repeat($this->paragraphsChar, Helper::width($argument->getName()))."\n\n" + .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '') + .'- **Is required**: '.($argument->isRequired() ? 'yes' : 'no')."\n" + .'- **Is array**: '.($argument->isArray() ? 'yes' : 'no')."\n" + .'- **Default**: ``'.str_replace("\n", '', var_export($argument->getDefault(), true)).'``' + ); + } + + protected function describeInputOption(InputOption $option, array $options = []): void + { + $name = '\-\-'.$option->getName(); + if ($option->isNegatable()) { + $name .= '|\-\-no-'.$option->getName(); + } + if ($option->getShortcut()) { + $name .= '|-'.str_replace('|', '|-', $option->getShortcut()); + } + + $optionDescription = $option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n\n", $option->getDescription())."\n\n" : ''; + $optionDescription = (new UnicodeString($optionDescription))->ascii(); + $this->write( + $name."\n".str_repeat($this->paragraphsChar, Helper::width($name))."\n\n" + .$optionDescription + .'- **Accept value**: '.($option->acceptValue() ? 'yes' : 'no')."\n" + .'- **Is value required**: '.($option->isValueRequired() ? 'yes' : 'no')."\n" + .'- **Is multiple**: '.($option->isArray() ? 'yes' : 'no')."\n" + .'- **Is negatable**: '.($option->isNegatable() ? 'yes' : 'no')."\n" + .'- **Default**: ``'.str_replace("\n", '', var_export($option->getDefault(), true)).'``'."\n" + ); + } + + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void + { + if ($showArguments = ((bool) $definition->getArguments())) { + $this->write("Arguments\n".str_repeat($this->subsubsectionChar, 9))."\n\n"; + foreach ($definition->getArguments() as $argument) { + $this->write("\n\n"); + $this->describeInputArgument($argument); + } + } + + if ($nonDefaultOptions = $this->getNonDefaultOptions($definition)) { + if ($showArguments) { + $this->write("\n\n"); + } + + $this->write("Options\n".str_repeat($this->subsubsectionChar, 7)."\n\n"); + foreach ($nonDefaultOptions as $option) { + $this->describeInputOption($option); + $this->write("\n"); + } + } + } + + protected function describeCommand(Command $command, array $options = []): void + { + if ($options['short'] ?? false) { + $this->write( + '``'.$command->getName()."``\n" + .str_repeat($this->subsectionChar, Helper::width($command->getName()))."\n\n" + .($command->getDescription() ? $command->getDescription()."\n\n" : '') + ."Usage\n".str_repeat($this->paragraphsChar, 5)."\n\n" + .array_reduce($command->getAliases(), static fn ($carry, $usage) => $carry.'- ``'.$usage.'``'."\n") + ); + + return; + } + + $command->mergeApplicationDefinition(false); + + foreach ($command->getAliases() as $alias) { + $this->write('.. _'.$alias.":\n\n"); + } + $this->write( + $command->getName()."\n" + .str_repeat($this->subsectionChar, Helper::width($command->getName()))."\n\n" + .($command->getDescription() ? $command->getDescription()."\n\n" : '') + ."Usage\n".str_repeat($this->subsubsectionChar, 5)."\n\n" + .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), static fn ($carry, $usage) => $carry.'- ``'.$usage.'``'."\n") + ); + + if ($help = $command->getProcessedHelp()) { + $this->write("\n"); + $this->write($help); + } + + $definition = $command->getDefinition(); + if ($definition->getOptions() || $definition->getArguments()) { + $this->write("\n\n"); + $this->describeInputDefinition($definition); + } + } + + protected function describeApplication(Application $application, array $options = []): void + { + $description = new ApplicationDescription($application, $options['namespace'] ?? null); + $title = $this->getApplicationTitle($application); + + $this->write($title."\n".str_repeat($this->partChar, Helper::width($title))); + $this->createTableOfContents($description, $application); + $this->describeCommands($application, $options); + } + + private function getApplicationTitle(Application $application): string + { + if ('UNKNOWN' === $application->getName()) { + return 'Console Tool'; + } + if ('UNKNOWN' !== $application->getVersion()) { + return sprintf('%s %s', $application->getName(), $application->getVersion()); + } + + return $application->getName(); + } + + private function describeCommands($application, array $options): void + { + $title = 'Commands'; + $this->write("\n\n$title\n".str_repeat($this->chapterChar, Helper::width($title))."\n\n"); + foreach ($this->visibleNamespaces as $namespace) { + if ('_global' === $namespace) { + $commands = $application->all(''); + $this->write('Global'."\n".str_repeat($this->sectionChar, Helper::width('Global'))."\n\n"); + } else { + $commands = $application->all($namespace); + $this->write($namespace."\n".str_repeat($this->sectionChar, Helper::width($namespace))."\n\n"); + } + + foreach ($this->removeAliasesAndHiddenCommands($commands) as $command) { + $this->describeCommand($command, $options); + $this->write("\n\n"); + } + } + } + + private function createTableOfContents(ApplicationDescription $description, Application $application): void + { + $this->setVisibleNamespaces($description); + $chapterTitle = 'Table of Contents'; + $this->write("\n\n$chapterTitle\n".str_repeat($this->chapterChar, Helper::width($chapterTitle))."\n\n"); + foreach ($this->visibleNamespaces as $namespace) { + if ('_global' === $namespace) { + $commands = $application->all(''); + } else { + $commands = $application->all($namespace); + $this->write("\n\n"); + $this->write($namespace."\n".str_repeat($this->sectionChar, Helper::width($namespace))."\n\n"); + } + $commands = $this->removeAliasesAndHiddenCommands($commands); + + $this->write("\n\n"); + $this->write(implode("\n", array_map(static fn ($commandName) => sprintf('- `%s`_', $commandName), array_keys($commands)))); + } + } + + private function getNonDefaultOptions(InputDefinition $definition): array + { + $globalOptions = [ + 'help', + 'quiet', + 'verbose', + 'version', + 'ansi', + 'no-interaction', + ]; + $nonDefaultOptions = []; + foreach ($definition->getOptions() as $option) { + // Skip global options. + if (!\in_array($option->getName(), $globalOptions)) { + $nonDefaultOptions[] = $option; + } + } + + return $nonDefaultOptions; + } + + private function setVisibleNamespaces(ApplicationDescription $description): void + { + $commands = $description->getCommands(); + foreach ($description->getNamespaces() as $namespace) { + try { + $namespaceCommands = $namespace['commands']; + foreach ($namespaceCommands as $key => $commandName) { + if (!\array_key_exists($commandName, $commands)) { + // If the array key does not exist, then this is an alias. + unset($namespaceCommands[$key]); + } elseif ($commands[$commandName]->isHidden()) { + unset($namespaceCommands[$key]); + } + } + if (!$namespaceCommands) { + // If the namespace contained only aliases or hidden commands, skip the namespace. + continue; + } + } catch (\Exception) { + } + $this->visibleNamespaces[] = $namespace['id']; + } + } + + private function removeAliasesAndHiddenCommands(array $commands): array + { + foreach ($commands as $key => $command) { + if ($command->isHidden() || \in_array($key, $command->getAliases(), true)) { + unset($commands[$key]); + } + } + unset($commands['completion']); + + return $commands; + } +} diff --git a/app/vendor/symfony/console/Descriptor/TextDescriptor.php b/app/vendor/symfony/console/Descriptor/TextDescriptor.php index 48a0b42af..d04d10238 100644 --- a/app/vendor/symfony/console/Descriptor/TextDescriptor.php +++ b/app/vendor/symfony/console/Descriptor/TextDescriptor.php @@ -28,7 +28,7 @@ */ class TextDescriptor extends Descriptor { - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) { $default = sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); @@ -48,7 +48,7 @@ protected function describeInputArgument(InputArgument $argument, array $options ), $options); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) { $default = sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); @@ -83,7 +83,7 @@ protected function describeInputOption(InputOption $option, array $options = []) ), $options); } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); foreach ($definition->getArguments() as $argument) { @@ -122,7 +122,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o } } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { $command->mergeApplicationDefinition(false); @@ -157,7 +157,7 @@ protected function describeCommand(Command $command, array $options = []) } } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $describedNamespace = $options['namespace'] ?? null; $description = new ApplicationDescription($application, $describedNamespace); @@ -193,9 +193,7 @@ protected function describeApplication(Application $application, array $options } // calculate max. width based on available commands per namespace - $width = $this->getColumnWidth(array_merge(...array_values(array_map(function ($namespace) use ($commands) { - return array_intersect($namespace['commands'], array_keys($commands)); - }, array_values($namespaces))))); + $width = $this->getColumnWidth(array_merge(...array_values(array_map(fn ($namespace) => array_intersect($namespace['commands'], array_keys($commands)), array_values($namespaces))))); if ($describedNamespace) { $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); @@ -204,9 +202,7 @@ protected function describeApplication(Application $application, array $options } foreach ($namespaces as $namespace) { - $namespace['commands'] = array_filter($namespace['commands'], function ($name) use ($commands) { - return isset($commands[$name]); - }); + $namespace['commands'] = array_filter($namespace['commands'], fn ($name) => isset($commands[$name])); if (!$namespace['commands']) { continue; @@ -230,7 +226,7 @@ protected function describeApplication(Application $application, array $options } } - private function writeText(string $content, array $options = []) + private function writeText(string $content, array $options = []): void { $this->write( isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, diff --git a/app/vendor/symfony/console/Descriptor/XmlDescriptor.php b/app/vendor/symfony/console/Descriptor/XmlDescriptor.php index f4643a9ac..72580fd98 100644 --- a/app/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ b/app/vendor/symfony/console/Descriptor/XmlDescriptor.php @@ -120,27 +120,27 @@ public function getApplicationDocument(Application $application, string $namespa return $dom; } - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { $this->writeDocument($this->getInputArgumentDocument($argument)); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { $this->writeDocument($this->getInputOptionDocument($option)); } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { $this->writeDocument($this->getInputDefinitionDocument($definition)); } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { $this->writeDocument($this->getCommandDocument($command, $options['short'] ?? false)); } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null, $options['short'] ?? false)); } @@ -148,7 +148,7 @@ protected function describeApplication(Application $application, array $options /** * Appends document children to parent node. */ - private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) + private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent): void { foreach ($importedParent->childNodes as $childNode) { $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true)); @@ -158,7 +158,7 @@ private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) /** * Writes DOM document. */ - private function writeDocument(\DOMDocument $dom) + private function writeDocument(\DOMDocument $dom): void { $dom->formatOutput = true; $this->write($dom->saveXML()); diff --git a/app/vendor/symfony/console/Event/ConsoleSignalEvent.php b/app/vendor/symfony/console/Event/ConsoleSignalEvent.php index 766af691a..95af1f915 100644 --- a/app/vendor/symfony/console/Event/ConsoleSignalEvent.php +++ b/app/vendor/symfony/console/Event/ConsoleSignalEvent.php @@ -21,15 +21,36 @@ final class ConsoleSignalEvent extends ConsoleEvent { private int $handlingSignal; + private int|false $exitCode; - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal) + public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal, int|false $exitCode = 0) { parent::__construct($command, $input, $output); $this->handlingSignal = $handlingSignal; + $this->exitCode = $exitCode; } public function getHandlingSignal(): int { return $this->handlingSignal; } + + public function setExitCode(int $exitCode): void + { + if ($exitCode < 0 || $exitCode > 255) { + throw new \InvalidArgumentException('Exit code must be between 0 and 255.'); + } + + $this->exitCode = $exitCode; + } + + public function abortExit(): void + { + $this->exitCode = false; + } + + public function getExitCode(): int|false + { + return $this->exitCode; + } } diff --git a/app/vendor/symfony/console/EventListener/ErrorListener.php b/app/vendor/symfony/console/EventListener/ErrorListener.php index 773a13a1c..9925a5f74 100644 --- a/app/vendor/symfony/console/EventListener/ErrorListener.php +++ b/app/vendor/symfony/console/EventListener/ErrorListener.php @@ -31,6 +31,9 @@ public function __construct(LoggerInterface $logger = null) $this->logger = $logger; } + /** + * @return void + */ public function onConsoleError(ConsoleErrorEvent $event) { if (null === $this->logger) { @@ -48,6 +51,9 @@ public function onConsoleError(ConsoleErrorEvent $event) $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); } + /** + * @return void + */ public function onConsoleTerminate(ConsoleTerminateEvent $event) { if (null === $this->logger) { diff --git a/app/vendor/symfony/console/Formatter/OutputFormatter.php b/app/vendor/symfony/console/Formatter/OutputFormatter.php index 38e75c317..9cb631048 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatter.php @@ -81,6 +81,9 @@ public function __construct(bool $decorated = false, array $styles = []) $this->styleStack = new OutputFormatterStyleStack(); } + /** + * @return void + */ public function setDecorated(bool $decorated) { $this->decorated = $decorated; @@ -91,6 +94,9 @@ public function isDecorated(): bool return $this->decorated; } + /** + * @return void + */ public function setStyle(string $name, OutputFormatterStyleInterface $style) { $this->styles[strtolower($name)] = $style; @@ -115,6 +121,9 @@ public function format(?string $message): ?string return $this->formatAndWrap($message, 0); } + /** + * @return string + */ public function formatAndWrap(?string $message, int $width) { if (null === $message) { diff --git a/app/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/app/vendor/symfony/console/Formatter/OutputFormatterInterface.php index b94e51ded..433cd4197 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatterInterface.php @@ -20,6 +20,8 @@ interface OutputFormatterInterface { /** * Sets the decorated flag. + * + * @return void */ public function setDecorated(bool $decorated); @@ -30,6 +32,8 @@ public function isDecorated(): bool; /** * Sets a new style. + * + * @return void */ public function setStyle(string $name, OutputFormatterStyleInterface $style); diff --git a/app/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/app/vendor/symfony/console/Formatter/OutputFormatterStyle.php index 1659986ef..346a474c6 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -38,6 +38,9 @@ public function __construct(string $foreground = null, string $background = null $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); } + /** + * @return void + */ public function setForeground(string $color = null) { if (1 > \func_num_args()) { @@ -46,6 +49,9 @@ public function setForeground(string $color = null) $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); } + /** + * @return void + */ public function setBackground(string $color = null) { if (1 > \func_num_args()) { @@ -59,12 +65,18 @@ public function setHref(string $url): void $this->href = $url; } + /** + * @return void + */ public function setOption(string $option) { $this->options[] = $option; $this->color = new Color($this->foreground, $this->background, $this->options); } + /** + * @return void + */ public function unsetOption(string $option) { $pos = array_search($option, $this->options); @@ -75,6 +87,9 @@ public function unsetOption(string $option) $this->color = new Color($this->foreground, $this->background, $this->options); } + /** + * @return void + */ public function setOptions(array $options) { $this->color = new Color($this->foreground, $this->background, $this->options = $options); @@ -83,7 +98,8 @@ public function setOptions(array $options) public function apply(string $text): string { $this->handlesHrefGracefully ??= 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100) + && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']); if (null !== $this->href && $this->handlesHrefGracefully) { $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; diff --git a/app/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/app/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php index 7ed67d9a1..3b15098cb 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php @@ -20,26 +20,36 @@ interface OutputFormatterStyleInterface { /** * Sets style foreground color. + * + * @return void */ public function setForeground(?string $color); /** * Sets style background color. + * + * @return void */ public function setBackground(?string $color); /** * Sets some specific style option. + * + * @return void */ public function setOption(string $option); /** * Unsets some specific style option. + * + * @return void */ public function unsetOption(string $option); /** * Sets multiple style options at once. + * + * @return void */ public function setOptions(array $options); diff --git a/app/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/app/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php index 2c5cdf9b8..f98c2eff7 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @@ -34,6 +34,8 @@ public function __construct(OutputFormatterStyleInterface $emptyStyle = null) /** * Resets stack (ie. empty internal arrays). + * + * @return void */ public function reset() { @@ -42,6 +44,8 @@ public function reset() /** * Pushes a style in the stack. + * + * @return void */ public function push(OutputFormatterStyleInterface $style) { diff --git a/app/vendor/symfony/console/Helper/DescriptorHelper.php b/app/vendor/symfony/console/Helper/DescriptorHelper.php index 3015ff08d..eb32bce8f 100644 --- a/app/vendor/symfony/console/Helper/DescriptorHelper.php +++ b/app/vendor/symfony/console/Helper/DescriptorHelper.php @@ -14,6 +14,7 @@ use Symfony\Component\Console\Descriptor\DescriptorInterface; use Symfony\Component\Console\Descriptor\JsonDescriptor; use Symfony\Component\Console\Descriptor\MarkdownDescriptor; +use Symfony\Component\Console\Descriptor\ReStructuredTextDescriptor; use Symfony\Component\Console\Descriptor\TextDescriptor; use Symfony\Component\Console\Descriptor\XmlDescriptor; use Symfony\Component\Console\Exception\InvalidArgumentException; @@ -38,6 +39,7 @@ public function __construct() ->register('xml', new XmlDescriptor()) ->register('json', new JsonDescriptor()) ->register('md', new MarkdownDescriptor()) + ->register('rst', new ReStructuredTextDescriptor()) ; } @@ -48,6 +50,8 @@ public function __construct() * * format: string, the output format name * * raw_text: boolean, sets output type as raw * + * @return void + * * @throws InvalidArgumentException when the given format is not supported */ public function describe(OutputInterface $output, ?object $object, array $options = []) diff --git a/app/vendor/symfony/console/Helper/Dumper.php b/app/vendor/symfony/console/Helper/Dumper.php index ac7571cea..8c6a94d51 100644 --- a/app/vendor/symfony/console/Helper/Dumper.php +++ b/app/vendor/symfony/console/Helper/Dumper.php @@ -40,14 +40,12 @@ public function __construct(OutputInterface $output, CliDumper $dumper = null, C return rtrim($dumper->dump(($this->cloner ??= new VarCloner())->cloneVar($var)->withRefHandles(false), true)); }; } else { - $this->handler = function ($var): string { - return match (true) { - null === $var => 'null', - true === $var => 'true', - false === $var => 'false', - \is_string($var) => '"'.$var.'"', - default => rtrim(print_r($var, true)), - }; + $this->handler = fn ($var): string => match (true) { + null === $var => 'null', + true === $var => 'true', + false === $var => 'false', + \is_string($var) => '"'.$var.'"', + default => rtrim(print_r($var, true)), }; } } diff --git a/app/vendor/symfony/console/Helper/Helper.php b/app/vendor/symfony/console/Helper/Helper.php index 920196e0f..3631b30f6 100644 --- a/app/vendor/symfony/console/Helper/Helper.php +++ b/app/vendor/symfony/console/Helper/Helper.php @@ -21,8 +21,11 @@ */ abstract class Helper implements HelperInterface { - protected $helperSet = null; + protected $helperSet; + /** + * @return void + */ public function setHelperSet(HelperSet $helperSet = null) { if (1 > \func_num_args()) { @@ -88,6 +91,9 @@ public static function substr(?string $string, int $from, int $length = null): s return mb_substr($string, $from, $length, $encoding); } + /** + * @return string + */ public static function formatTime(int|float $secs) { static $timeFormats = [ @@ -117,6 +123,9 @@ public static function formatTime(int|float $secs) } } + /** + * @return string + */ public static function formatMemory(int $memory) { if ($memory >= 1024 * 1024 * 1024) { @@ -134,6 +143,9 @@ public static function formatMemory(int $memory) return sprintf('%d B', $memory); } + /** + * @return string + */ public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) { $isDecorated = $formatter->isDecorated(); diff --git a/app/vendor/symfony/console/Helper/HelperInterface.php b/app/vendor/symfony/console/Helper/HelperInterface.php index 2762cdf05..ab626c938 100644 --- a/app/vendor/symfony/console/Helper/HelperInterface.php +++ b/app/vendor/symfony/console/Helper/HelperInterface.php @@ -20,6 +20,8 @@ interface HelperInterface { /** * Sets the helper set associated with this helper. + * + * @return void */ public function setHelperSet(?HelperSet $helperSet); diff --git a/app/vendor/symfony/console/Helper/HelperSet.php b/app/vendor/symfony/console/Helper/HelperSet.php index cefe62be3..dc5d499ca 100644 --- a/app/vendor/symfony/console/Helper/HelperSet.php +++ b/app/vendor/symfony/console/Helper/HelperSet.php @@ -35,6 +35,9 @@ public function __construct(array $helpers = []) } } + /** + * @return void + */ public function set(HelperInterface $helper, string $alias = null) { $this->helpers[$helper->getName()] = $helper; diff --git a/app/vendor/symfony/console/Helper/InputAwareHelper.php b/app/vendor/symfony/console/Helper/InputAwareHelper.php index ba81e3771..6f8225973 100644 --- a/app/vendor/symfony/console/Helper/InputAwareHelper.php +++ b/app/vendor/symfony/console/Helper/InputAwareHelper.php @@ -23,6 +23,9 @@ abstract class InputAwareHelper extends Helper implements InputAwareInterface { protected $input; + /** + * @return void + */ public function setInput(InputInterface $input) { $this->input = $input; diff --git a/app/vendor/symfony/console/Helper/ProgressBar.php b/app/vendor/symfony/console/Helper/ProgressBar.php index 0d1126097..19faea47c 100644 --- a/app/vendor/symfony/console/Helper/ProgressBar.php +++ b/app/vendor/symfony/console/Helper/ProgressBar.php @@ -59,6 +59,7 @@ final class ProgressBar private Terminal $terminal; private ?string $previousMessage = null; private Cursor $cursor; + private array $placeholders = []; private static array $formatters; private static array $formats; @@ -94,12 +95,12 @@ public function __construct(OutputInterface $output, int $max = 0, float $minSec } /** - * Sets a placeholder formatter for a given name. + * Sets a placeholder formatter for a given name, globally for all instances of ProgressBar. * * This method also allow you to override an existing placeholder. * - * @param string $name The placeholder name (including the delimiter char like %) - * @param callable $callable A PHP callable + * @param string $name The placeholder name (including the delimiter char like %) + * @param callable(ProgressBar):string $callable A PHP callable */ public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void { @@ -120,6 +121,26 @@ public static function getPlaceholderFormatterDefinition(string $name): ?callabl return self::$formatters[$name] ?? null; } + /** + * Sets a placeholder formatter for a given name, for this instance only. + * + * @param callable(ProgressBar):string $callable A PHP callable + */ + public function setPlaceholderFormatter(string $name, callable $callable): void + { + $this->placeholders[$name] = $callable; + } + + /** + * Gets the placeholder formatter for a given name. + * + * @param string $name The placeholder name (including the delimiter char like %) + */ + public function getPlaceholderFormatter(string $name): ?callable + { + return $this->placeholders[$name] ?? $this::getPlaceholderFormatterDefinition($name); + } + /** * Sets a format for a given name. * @@ -157,12 +178,12 @@ public static function getFormatDefinition(string $name): ?string * @param string $message The text to associate with the placeholder * @param string $name The name of the placeholder */ - public function setMessage(string $message, string $name = 'message') + public function setMessage(string $message, string $name = 'message'): void { $this->messages[$name] = $message; } - public function getMessage(string $name = 'message') + public function getMessage(string $name = 'message'): string { return $this->messages[$name]; } @@ -215,7 +236,7 @@ public function getRemaining(): float return round((time() - $this->startTime) / ($this->step - $this->startingStep) * ($this->max - $this->step)); } - public function setBarWidth(int $size) + public function setBarWidth(int $size): void { $this->barWidth = max(1, $size); } @@ -225,7 +246,7 @@ public function getBarWidth(): int return $this->barWidth; } - public function setBarCharacter(string $char) + public function setBarCharacter(string $char): void { $this->barChar = $char; } @@ -235,7 +256,7 @@ public function getBarCharacter(): string return $this->barChar ?? ($this->max ? '=' : $this->emptyBarChar); } - public function setEmptyBarCharacter(string $char) + public function setEmptyBarCharacter(string $char): void { $this->emptyBarChar = $char; } @@ -245,7 +266,7 @@ public function getEmptyBarCharacter(): string return $this->emptyBarChar; } - public function setProgressCharacter(string $char) + public function setProgressCharacter(string $char): void { $this->progressChar = $char; } @@ -255,7 +276,7 @@ public function getProgressCharacter(): string return $this->progressChar; } - public function setFormat(string $format) + public function setFormat(string $format): void { $this->format = null; $this->internalFormat = $format; @@ -266,7 +287,7 @@ public function setFormat(string $format) * * @param int|null $freq The frequency in steps */ - public function setRedrawFrequency(?int $freq) + public function setRedrawFrequency(?int $freq): void { $this->redrawFreq = null !== $freq ? max(1, $freq) : null; } @@ -325,7 +346,7 @@ public function start(int $max = null, int $startAt = 0): void * * @param int $step Number of steps to advance */ - public function advance(int $step = 1) + public function advance(int $step = 1): void { $this->setProgress($this->step + $step); } @@ -333,12 +354,12 @@ public function advance(int $step = 1) /** * Sets whether to overwrite the progressbar, false for new line. */ - public function setOverwrite(bool $overwrite) + public function setOverwrite(bool $overwrite): void { $this->overwrite = $overwrite; } - public function setProgress(int $step) + public function setProgress(int $step): void { if ($this->max && $step > $this->max) { $this->max = $step; @@ -371,7 +392,7 @@ public function setProgress(int $step) } } - public function setMaxSteps(int $max) + public function setMaxSteps(int $max): void { $this->format = null; $this->max = max(0, $max); @@ -431,7 +452,7 @@ public function clear(): void $this->overwrite(''); } - private function setRealFormat(string $format) + private function setRealFormat(string $format): void { // try to use the _nomax variant if available if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { @@ -513,9 +534,7 @@ private static function initPlaceholderFormatters(): array return $display; }, - 'elapsed' => function (self $bar) { - return Helper::formatTime(time() - $bar->getStartTime()); - }, + 'elapsed' => fn (self $bar) => Helper::formatTime(time() - $bar->getStartTime()), 'remaining' => function (self $bar) { if (!$bar->getMaxSteps()) { throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); @@ -530,18 +549,10 @@ private static function initPlaceholderFormatters(): array return Helper::formatTime($bar->getEstimated()); }, - 'memory' => function (self $bar) { - return Helper::formatMemory(memory_get_usage(true)); - }, - 'current' => function (self $bar) { - return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT); - }, - 'max' => function (self $bar) { - return $bar->getMaxSteps(); - }, - 'percent' => function (self $bar) { - return floor($bar->getProgressPercent() * 100); - }, + 'memory' => fn (self $bar) => Helper::formatMemory(memory_get_usage(true)), + 'current' => fn (self $bar) => str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT), + 'max' => fn (self $bar) => $bar->getMaxSteps(), + 'percent' => fn (self $bar) => floor($bar->getProgressPercent() * 100), ]; } @@ -568,7 +579,7 @@ private function buildLine(): string $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; $callback = function ($matches) { - if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { + if ($formatter = $this->getPlaceholderFormatter($matches[1])) { $text = $formatter($this, $this->output); } elseif (isset($this->messages[$matches[1]])) { $text = $this->messages[$matches[1]]; @@ -585,9 +596,7 @@ private function buildLine(): string $line = preg_replace_callback($regex, $callback, $this->format); // gets string length for each sub line with multiline format - $linesLength = array_map(function ($subLine) { - return Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))); - }, explode("\n", $line)); + $linesLength = array_map(fn ($subLine) => Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))), explode("\n", $line)); $linesWidth = max($linesLength); diff --git a/app/vendor/symfony/console/Helper/ProgressIndicator.php b/app/vendor/symfony/console/Helper/ProgressIndicator.php index 172036465..84dbef950 100644 --- a/app/vendor/symfony/console/Helper/ProgressIndicator.php +++ b/app/vendor/symfony/console/Helper/ProgressIndicator.php @@ -70,6 +70,8 @@ public function __construct(OutputInterface $output, string $format = null, int /** * Sets the current indicator message. + * + * @return void */ public function setMessage(?string $message) { @@ -80,6 +82,8 @@ public function setMessage(?string $message) /** * Starts the indicator output. + * + * @return void */ public function start(string $message) { @@ -98,6 +102,8 @@ public function start(string $message) /** * Advances the indicator. + * + * @return void */ public function advance() { @@ -124,7 +130,7 @@ public function advance() /** * Finish the indicator with message. * - * @param $message + * @return void */ public function finish(string $message) { @@ -150,6 +156,8 @@ public static function getFormatDefinition(string $name): ?string * Sets a placeholder formatter for a given name. * * This method also allow you to override an existing placeholder. + * + * @return void */ public static function setPlaceholderFormatterDefinition(string $name, callable $callable) { @@ -168,7 +176,7 @@ public static function getPlaceholderFormatterDefinition(string $name): ?callabl return self::$formatters[$name] ?? null; } - private function display() + private function display(): void { if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { return; @@ -197,7 +205,7 @@ private function determineBestFormat(): string /** * Overwrites a previous message to the output. */ - private function overwrite(string $message) + private function overwrite(string $message): void { if ($this->output->isDecorated()) { $this->output->write("\x0D\x1B[2K"); @@ -218,18 +226,10 @@ private function getCurrentTimeInMilliseconds(): float private static function initPlaceholderFormatters(): array { return [ - 'indicator' => function (self $indicator) { - return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; - }, - 'message' => function (self $indicator) { - return $indicator->message; - }, - 'elapsed' => function (self $indicator) { - return Helper::formatTime(time() - $indicator->startTime); - }, - 'memory' => function () { - return Helper::formatMemory(memory_get_usage(true)); - }, + 'indicator' => fn (self $indicator) => $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)], + 'message' => fn (self $indicator) => $indicator->message, + 'elapsed' => fn (self $indicator) => Helper::formatTime(time() - $indicator->startTime), + 'memory' => fn () => Helper::formatMemory(memory_get_usage(true)), ]; } } diff --git a/app/vendor/symfony/console/Helper/QuestionHelper.php b/app/vendor/symfony/console/Helper/QuestionHelper.php index c345b4af7..f32813c6c 100644 --- a/app/vendor/symfony/console/Helper/QuestionHelper.php +++ b/app/vendor/symfony/console/Helper/QuestionHelper.php @@ -68,9 +68,7 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu return $this->doAsk($output, $question); } - $interviewer = function () use ($output, $question) { - return $this->doAsk($output, $question); - }; + $interviewer = fn () => $this->doAsk($output, $question); return $this->validateAttempts($interviewer, $output, $question); } catch (MissingInputException $exception) { @@ -91,6 +89,8 @@ public function getName(): string /** * Prevents usage of stty. + * + * @return void */ public static function disableStty() { @@ -123,7 +123,18 @@ private function doAsk(OutputInterface $output, Question $question): mixed } if (false === $ret) { + $isBlocked = stream_get_meta_data($inputStream)['blocked'] ?? true; + + if (!$isBlocked) { + stream_set_blocking($inputStream, true); + } + $ret = $this->readInput($inputStream, $question); + + if (!$isBlocked) { + stream_set_blocking($inputStream, false); + } + if (false === $ret) { throw new MissingInputException('Aborted.'); } @@ -159,7 +170,7 @@ private function getDefaultAnswer(Question $question): mixed } if ($validator = $question->getValidator()) { - return \call_user_func($question->getValidator(), $default); + return \call_user_func($validator, $default); } elseif ($question instanceof ChoiceQuestion) { $choices = $question->getChoices(); @@ -179,6 +190,8 @@ private function getDefaultAnswer(Question $question): mixed /** * Outputs the question prompt. + * + * @return void */ protected function writePrompt(OutputInterface $output, Question $question) { @@ -215,6 +228,8 @@ protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string /** * Outputs an error message. + * + * @return void */ protected function writeError(OutputInterface $output, \Exception $error) { @@ -314,9 +329,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu $matches = array_filter( $autocomplete($ret), - function ($match) use ($ret) { - return '' === $ret || str_starts_with($match, $ret); - } + fn ($match) => '' === $ret || str_starts_with($match, $ret) ); $numMatches = \count($matches); $ofs = -1; @@ -496,13 +509,11 @@ private function isInteractiveInput($inputStream): bool return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r')); } - if (!\function_exists('exec')) { + if (!\function_exists('shell_exec')) { return self::$stdinIsInteractive = true; } - exec('stty 2> /dev/null', $output, $status); - - return self::$stdinIsInteractive = 1 !== $status; + return self::$stdinIsInteractive = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); } /** diff --git a/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php index 109045d04..8ebc84376 100644 --- a/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php +++ b/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php @@ -25,6 +25,9 @@ */ class SymfonyQuestionHelper extends QuestionHelper { + /** + * @return void + */ protected function writePrompt(OutputInterface $output, Question $question) { $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); @@ -80,6 +83,9 @@ protected function writePrompt(OutputInterface $output, Question $question) $output->write($prompt); } + /** + * @return void + */ protected function writeError(OutputInterface $output, \Exception $error) { if ($output instanceof SymfonyStyle) { diff --git a/app/vendor/symfony/console/Helper/Table.php b/app/vendor/symfony/console/Helper/Table.php index 893b3192e..cf714873f 100644 --- a/app/vendor/symfony/console/Helper/Table.php +++ b/app/vendor/symfony/console/Helper/Table.php @@ -66,6 +66,8 @@ public function __construct(OutputInterface $output) /** * Sets a style definition. + * + * @return void */ public static function setStyleDefinition(string $name, TableStyle $style) { @@ -310,6 +312,8 @@ public function setVertical(bool $vertical = true): static * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | * +---------------+-----------------------+------------------+ + * + * @return void */ public function render() { @@ -450,7 +454,7 @@ public function render() * * +-----+-----------+-------+ */ - private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null) + private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null): void { if (!$count = $this->numberOfColumns) { return; @@ -515,7 +519,7 @@ private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string * * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | */ - private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null) + private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null): void { $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); $columns = $this->getRowColumns($row); @@ -588,7 +592,7 @@ private function renderCell(array $row, int $column, string $cellFormat): string /** * Calculate number of columns for this table. */ - private function calculateNumberOfColumns(array $rows) + private function calculateNumberOfColumns(array $rows): void { $columns = [0]; foreach ($rows as $row) { @@ -727,7 +731,7 @@ private function fillNextRows(array $rows, int $line): array /** * fill cells for a row that contains colspan > 1. */ - private function fillCells(iterable $row) + private function fillCells(iterable $row): iterable { $newRow = []; @@ -789,7 +793,7 @@ private function getRowColumns(array $row): array /** * Calculates columns widths. */ - private function calculateColumnsWidth(iterable $groups) + private function calculateColumnsWidth(iterable $groups): void { for ($column = 0; $column < $this->numberOfColumns; ++$column) { $lengths = []; @@ -804,7 +808,7 @@ private function calculateColumnsWidth(iterable $groups) $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); $textLength = Helper::width($textContent); if ($textLength > 0) { - $contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan())); + $contentColumns = mb_str_split($textContent, ceil($textLength / $cell->getColspan())); foreach ($contentColumns as $position => $content) { $row[$i + $position] = $content; } @@ -843,7 +847,7 @@ private function getCellWidth(array $row, int $column): int /** * Called after rendering to cleanup cache data. */ - private function cleanup() + private function cleanup(): void { $this->effectiveColumnWidths = []; unset($this->numberOfColumns); diff --git a/app/vendor/symfony/console/Helper/TableCellStyle.php b/app/vendor/symfony/console/Helper/TableCellStyle.php index 65ae9e728..9419dcb40 100644 --- a/app/vendor/symfony/console/Helper/TableCellStyle.php +++ b/app/vendor/symfony/console/Helper/TableCellStyle.php @@ -67,9 +67,7 @@ public function getTagOptions(): array { return array_filter( $this->getOptions(), - function ($key) { - return \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]); - }, + fn ($key) => \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]), \ARRAY_FILTER_USE_KEY ); } diff --git a/app/vendor/symfony/console/Input/ArgvInput.php b/app/vendor/symfony/console/Input/ArgvInput.php index c0c28bb58..59f9217ec 100644 --- a/app/vendor/symfony/console/Input/ArgvInput.php +++ b/app/vendor/symfony/console/Input/ArgvInput.php @@ -55,11 +55,17 @@ public function __construct(array $argv = null, InputDefinition $definition = nu parent::__construct($definition); } + /** + * @return void + */ protected function setTokens(array $tokens) { $this->tokens = $tokens; } + /** + * @return void + */ protected function parse() { $parseOptions = true; @@ -89,7 +95,7 @@ protected function parseToken(string $token, bool $parseOptions): bool /** * Parses a short option. */ - private function parseShortOption(string $token) + private function parseShortOption(string $token): void { $name = substr($token, 1); @@ -110,7 +116,7 @@ private function parseShortOption(string $token) * * @throws RuntimeException When option given doesn't exist */ - private function parseShortOptionSet(string $name) + private function parseShortOptionSet(string $name): void { $len = \strlen($name); for ($i = 0; $i < $len; ++$i) { @@ -133,7 +139,7 @@ private function parseShortOptionSet(string $name) /** * Parses a long option. */ - private function parseLongOption(string $token) + private function parseLongOption(string $token): void { $name = substr($token, 2); @@ -152,7 +158,7 @@ private function parseLongOption(string $token) * * @throws RuntimeException When too many arguments are given */ - private function parseArgument(string $token) + private function parseArgument(string $token): void { $c = \count($this->arguments); @@ -196,7 +202,7 @@ private function parseArgument(string $token) * * @throws RuntimeException When option given doesn't exist */ - private function addShortOption(string $shortcut, mixed $value) + private function addShortOption(string $shortcut, mixed $value): void { if (!$this->definition->hasShortcut($shortcut)) { throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); @@ -210,7 +216,7 @@ private function addShortOption(string $shortcut, mixed $value) * * @throws RuntimeException When option given doesn't exist */ - private function addLongOption(string $name, mixed $value) + private function addLongOption(string $name, mixed $value): void { if (!$this->definition->hasOption($name)) { if (!$this->definition->hasNegation($name)) { diff --git a/app/vendor/symfony/console/Input/ArrayInput.php b/app/vendor/symfony/console/Input/ArrayInput.php index 02fb4e8ee..355de61dd 100644 --- a/app/vendor/symfony/console/Input/ArrayInput.php +++ b/app/vendor/symfony/console/Input/ArrayInput.php @@ -113,6 +113,9 @@ public function __toString(): string return implode(' ', $params); } + /** + * @return void + */ protected function parse() { foreach ($this->parameters as $key => $value) { @@ -134,7 +137,7 @@ protected function parse() * * @throws InvalidOptionException When option given doesn't exist */ - private function addShortOption(string $shortcut, mixed $value) + private function addShortOption(string $shortcut, mixed $value): void { if (!$this->definition->hasShortcut($shortcut)) { throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); @@ -149,7 +152,7 @@ private function addShortOption(string $shortcut, mixed $value) * @throws InvalidOptionException When option given doesn't exist * @throws InvalidOptionException When a required value is missing */ - private function addLongOption(string $name, mixed $value) + private function addLongOption(string $name, mixed $value): void { if (!$this->definition->hasOption($name)) { if (!$this->definition->hasNegation($name)) { @@ -182,7 +185,7 @@ private function addLongOption(string $name, mixed $value) * * @throws InvalidArgumentException When argument given doesn't exist */ - private function addArgument(string|int $name, mixed $value) + private function addArgument(string|int $name, mixed $value): void { if (!$this->definition->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); diff --git a/app/vendor/symfony/console/Input/Input.php b/app/vendor/symfony/console/Input/Input.php index 7b90713c8..0f5617cd1 100644 --- a/app/vendor/symfony/console/Input/Input.php +++ b/app/vendor/symfony/console/Input/Input.php @@ -43,6 +43,9 @@ public function __construct(InputDefinition $definition = null) } } + /** + * @return void + */ public function bind(InputDefinition $definition) { $this->arguments = []; @@ -54,17 +57,20 @@ public function bind(InputDefinition $definition) /** * Processes command line arguments. + * + * @return void */ abstract protected function parse(); + /** + * @return void + */ public function validate() { $definition = $this->definition; $givenArguments = $this->arguments; - $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { - return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); - }); + $missingArguments = array_filter(array_keys($definition->getArguments()), fn ($argument) => !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired()); if (\count($missingArguments) > 0) { throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); @@ -76,6 +82,9 @@ public function isInteractive(): bool return $this->interactive; } + /** + * @return void + */ public function setInteractive(bool $interactive) { $this->interactive = $interactive; @@ -95,6 +104,9 @@ public function getArgument(string $name): mixed return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault(); } + /** + * @return void + */ public function setArgument(string $name, mixed $value) { if (!$this->definition->hasArgument($name)) { @@ -131,6 +143,9 @@ public function getOption(string $name): mixed return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); } + /** + * @return void + */ public function setOption(string $name, mixed $value) { if ($this->definition->hasNegation($name)) { @@ -157,11 +172,19 @@ public function escapeToken(string $token): string return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); } + /** + * @param resource $stream + * + * @return void + */ public function setStream($stream) { $this->stream = $stream; } + /** + * @return resource + */ public function getStream() { return $this->stream; diff --git a/app/vendor/symfony/console/Input/InputArgument.php b/app/vendor/symfony/console/Input/InputArgument.php index f0867193e..5cb151488 100644 --- a/app/vendor/symfony/console/Input/InputArgument.php +++ b/app/vendor/symfony/console/Input/InputArgument.php @@ -36,10 +36,10 @@ class InputArgument private string $description; /** - * @param string $name The argument name - * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL - * @param string $description A description text - * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) + * @param string $name The argument name + * @param int|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY + * @param string $description A description text + * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @throws InvalidArgumentException When argument mode is not valid @@ -91,6 +91,8 @@ public function isArray(): bool /** * Sets the default value. * + * @return void + * * @throws LogicException When incorrect default value is given */ public function setDefault(string|bool|int|float|array $default = null) diff --git a/app/vendor/symfony/console/Input/InputAwareInterface.php b/app/vendor/symfony/console/Input/InputAwareInterface.php index 5a288de5d..0ad27b455 100644 --- a/app/vendor/symfony/console/Input/InputAwareInterface.php +++ b/app/vendor/symfony/console/Input/InputAwareInterface.php @@ -21,6 +21,8 @@ interface InputAwareInterface { /** * Sets the Console Input. + * + * @return void */ public function setInput(InputInterface $input); } diff --git a/app/vendor/symfony/console/Input/InputDefinition.php b/app/vendor/symfony/console/Input/InputDefinition.php index f4b14a1c8..b7162d770 100644 --- a/app/vendor/symfony/console/Input/InputDefinition.php +++ b/app/vendor/symfony/console/Input/InputDefinition.php @@ -46,6 +46,8 @@ public function __construct(array $definition = []) /** * Sets the definition of the input. + * + * @return void */ public function setDefinition(array $definition) { @@ -67,6 +69,8 @@ public function setDefinition(array $definition) * Sets the InputArgument objects. * * @param InputArgument[] $arguments An array of InputArgument objects + * + * @return void */ public function setArguments(array $arguments = []) { @@ -81,6 +85,8 @@ public function setArguments(array $arguments = []) * Adds an array of InputArgument objects. * * @param InputArgument[] $arguments An array of InputArgument objects + * + * @return void */ public function addArguments(?array $arguments = []) { @@ -92,6 +98,8 @@ public function addArguments(?array $arguments = []) } /** + * @return void + * * @throws LogicException When incorrect argument is given */ public function addArgument(InputArgument $argument) @@ -190,6 +198,8 @@ public function getArgumentDefaults(): array * Sets the InputOption objects. * * @param InputOption[] $options An array of InputOption objects + * + * @return void */ public function setOptions(array $options = []) { @@ -203,6 +213,8 @@ public function setOptions(array $options = []) * Adds an array of InputOption objects. * * @param InputOption[] $options An array of InputOption objects + * + * @return void */ public function addOptions(array $options = []) { @@ -212,6 +224,8 @@ public function addOptions(array $options = []) } /** + * @return void + * * @throws LogicException When option given already exist */ public function addOption(InputOption $option) diff --git a/app/vendor/symfony/console/Input/InputInterface.php b/app/vendor/symfony/console/Input/InputInterface.php index 3af991a76..aaed5fd01 100644 --- a/app/vendor/symfony/console/Input/InputInterface.php +++ b/app/vendor/symfony/console/Input/InputInterface.php @@ -61,6 +61,8 @@ public function getParameterOption(string|array $values, string|bool|int|float|a /** * Binds the current Input instance with the given arguments and options. * + * @return void + * * @throws RuntimeException */ public function bind(InputDefinition $definition); @@ -68,6 +70,8 @@ public function bind(InputDefinition $definition); /** * Validates the input. * + * @return void + * * @throws RuntimeException When not enough arguments are given */ public function validate(); @@ -91,6 +95,8 @@ public function getArgument(string $name); /** * Sets an argument value by name. * + * @return void + * * @throws InvalidArgumentException When argument given doesn't exist */ public function setArgument(string $name, mixed $value); @@ -119,6 +125,8 @@ public function getOption(string $name); /** * Sets an option value by name. * + * @return void + * * @throws InvalidArgumentException When option given doesn't exist */ public function setOption(string $name, mixed $value); @@ -135,6 +143,8 @@ public function isInteractive(): bool; /** * Sets the input interactivity. + * + * @return void */ public function setInteractive(bool $interactive); } diff --git a/app/vendor/symfony/console/Input/InputOption.php b/app/vendor/symfony/console/Input/InputOption.php index 452c9f7fd..fdf88dcc2 100644 --- a/app/vendor/symfony/console/Input/InputOption.php +++ b/app/vendor/symfony/console/Input/InputOption.php @@ -58,9 +58,9 @@ class InputOption private string $description; /** - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the VALUE_* constants - * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) + * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param int|null $mode The option mode: One of the VALUE_* constants + * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @throws InvalidArgumentException If option mode is invalid or incompatible @@ -178,6 +178,9 @@ public function isNegatable(): bool return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); } + /** + * @return void + */ public function setDefault(string|bool|int|float|array $default = null) { if (1 > \func_num_args()) { diff --git a/app/vendor/symfony/console/Input/StreamableInputInterface.php b/app/vendor/symfony/console/Input/StreamableInputInterface.php index d7e462f24..4b95fcb11 100644 --- a/app/vendor/symfony/console/Input/StreamableInputInterface.php +++ b/app/vendor/symfony/console/Input/StreamableInputInterface.php @@ -25,6 +25,8 @@ interface StreamableInputInterface extends InputInterface * This is mainly useful for testing purpose. * * @param resource $stream The input stream + * + * @return void */ public function setStream($stream); diff --git a/app/vendor/symfony/console/LICENSE b/app/vendor/symfony/console/LICENSE index 008370457..0138f8f07 100644 --- a/app/vendor/symfony/console/LICENSE +++ b/app/vendor/symfony/console/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/symfony/console/Output/AnsiColorMode.php b/app/vendor/symfony/console/Output/AnsiColorMode.php index c6cc5c12f..5f9f744fe 100644 --- a/app/vendor/symfony/console/Output/AnsiColorMode.php +++ b/app/vendor/symfony/console/Output/AnsiColorMode.php @@ -26,7 +26,7 @@ enum AnsiColorMode case Ansi4; /* - * 8-bit Ansi colors (240 differents colors + 16 duplicate color codes, ensuring backward compatibility). + * 8-bit Ansi colors (240 different colors + 16 duplicate color codes, ensuring backward compatibility). * Output syntax is: "ESC[38;5;${foreGroundColorcode};48;5;${backGroundColorcode}m" * Should be compatible with most terminals. */ @@ -78,25 +78,7 @@ private function convertFromRGB(int $r, int $g, int $b): int private function degradeHexColorToAnsi4(int $r, int $g, int $b): int { - if (0 === round($this->getSaturation($r, $g, $b) / 50)) { - return 0; - } - - return (int) ((round($b / 255) << 2) | (round($g / 255) << 1) | round($r / 255)); - } - - private function getSaturation(int $r, int $g, int $b): int - { - $r = $r / 255; - $g = $g / 255; - $b = $b / 255; - $v = max($r, $g, $b); - - if (0 === $diff = $v - min($r, $g, $b)) { - return 0; - } - - return (int) ((int) $diff * 100 / $v); + return round($b / 255) << 2 | (round($g / 255) << 1) | round($r / 255); } /** diff --git a/app/vendor/symfony/console/Output/BufferedOutput.php b/app/vendor/symfony/console/Output/BufferedOutput.php index 94d4e414a..ef5099bfd 100644 --- a/app/vendor/symfony/console/Output/BufferedOutput.php +++ b/app/vendor/symfony/console/Output/BufferedOutput.php @@ -29,6 +29,9 @@ public function fetch(): string return $content; } + /** + * @return void + */ protected function doWrite(string $message, bool $newline) { $this->buffer .= $message; diff --git a/app/vendor/symfony/console/Output/ConsoleOutput.php b/app/vendor/symfony/console/Output/ConsoleOutput.php index e3aa92c7f..c1eb7cd14 100644 --- a/app/vendor/symfony/console/Output/ConsoleOutput.php +++ b/app/vendor/symfony/console/Output/ConsoleOutput.php @@ -64,18 +64,27 @@ public function section(): ConsoleSectionOutput return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); } + /** + * @return void + */ public function setDecorated(bool $decorated) { parent::setDecorated($decorated); $this->stderr->setDecorated($decorated); } + /** + * @return void + */ public function setFormatter(OutputFormatterInterface $formatter) { parent::setFormatter($formatter); $this->stderr->setFormatter($formatter); } + /** + * @return void + */ public function setVerbosity(int $level) { parent::setVerbosity($level); @@ -87,6 +96,9 @@ public function getErrorOutput(): OutputInterface return $this->stderr; } + /** + * @return void + */ public function setErrorOutput(OutputInterface $error) { $this->stderr = $error; diff --git a/app/vendor/symfony/console/Output/ConsoleOutputInterface.php b/app/vendor/symfony/console/Output/ConsoleOutputInterface.php index 6b4babc6d..9c0049c8f 100644 --- a/app/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ b/app/vendor/symfony/console/Output/ConsoleOutputInterface.php @@ -24,6 +24,9 @@ interface ConsoleOutputInterface extends OutputInterface */ public function getErrorOutput(): OutputInterface; + /** + * @return void + */ public function setErrorOutput(OutputInterface $error); public function section(): ConsoleSectionOutput; diff --git a/app/vendor/symfony/console/Output/ConsoleSectionOutput.php b/app/vendor/symfony/console/Output/ConsoleSectionOutput.php index 7978a922c..3f3f1434b 100644 --- a/app/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ b/app/vendor/symfony/console/Output/ConsoleSectionOutput.php @@ -60,6 +60,8 @@ public function setMaxHeight(int $maxHeight): void * Clears previous output for this section. * * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared + * + * @return void */ public function clear(int $lines = null) { @@ -81,6 +83,8 @@ public function clear(int $lines = null) /** * Overwrites the previous output with a new message. + * + * @return void */ public function overwrite(string|iterable $message) { @@ -115,7 +119,8 @@ public function addContent(string $input, bool $newline = true): int // re-add the line break (that has been removed in the above `explode()` for // - every line that is not the last line // - if $newline is required, also add it to the last line - if ($i < $count || $newline) { + // - if it's not new line, but input ending with `\PHP_EOL` + if ($i < $count || $newline || str_ends_with($input, \PHP_EOL)) { $lineContent .= \PHP_EOL; } @@ -149,6 +154,18 @@ public function addContent(string $input, bool $newline = true): int return $linesAdded; } + /** + * @internal + */ + public function addNewLineOfInputSubmit(): void + { + $this->content[] = \PHP_EOL; + ++$this->lines; + } + + /** + * @return void + */ protected function doWrite(string $message, bool $newline) { if (!$this->isDecorated()) { diff --git a/app/vendor/symfony/console/Output/NullOutput.php b/app/vendor/symfony/console/Output/NullOutput.php index 4884cbad9..f3aa15b1d 100644 --- a/app/vendor/symfony/console/Output/NullOutput.php +++ b/app/vendor/symfony/console/Output/NullOutput.php @@ -26,6 +26,9 @@ class NullOutput implements OutputInterface { private NullOutputFormatter $formatter; + /** + * @return void + */ public function setFormatter(OutputFormatterInterface $formatter) { // do nothing @@ -37,6 +40,9 @@ public function getFormatter(): OutputFormatterInterface return $this->formatter ??= new NullOutputFormatter(); } + /** + * @return void + */ public function setDecorated(bool $decorated) { // do nothing @@ -47,6 +53,9 @@ public function isDecorated(): bool return false; } + /** + * @return void + */ public function setVerbosity(int $level) { // do nothing @@ -77,11 +86,17 @@ public function isDebug(): bool return false; } + /** + * @return void + */ public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) { // do nothing } + /** + * @return void + */ public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) { // do nothing diff --git a/app/vendor/symfony/console/Output/Output.php b/app/vendor/symfony/console/Output/Output.php index 4cb71acba..3a06311a8 100644 --- a/app/vendor/symfony/console/Output/Output.php +++ b/app/vendor/symfony/console/Output/Output.php @@ -44,6 +44,9 @@ public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $deco $this->formatter->setDecorated($decorated); } + /** + * @return void + */ public function setFormatter(OutputFormatterInterface $formatter) { $this->formatter = $formatter; @@ -54,6 +57,9 @@ public function getFormatter(): OutputFormatterInterface return $this->formatter; } + /** + * @return void + */ public function setDecorated(bool $decorated) { $this->formatter->setDecorated($decorated); @@ -64,6 +70,9 @@ public function isDecorated(): bool return $this->formatter->isDecorated(); } + /** + * @return void + */ public function setVerbosity(int $level) { $this->verbosity = $level; @@ -94,11 +103,17 @@ public function isDebug(): bool return self::VERBOSITY_DEBUG <= $this->verbosity; } + /** + * @return void + */ public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) { $this->write($messages, true, $options); } + /** + * @return void + */ public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { @@ -133,6 +148,8 @@ public function write(string|iterable $messages, bool $newline = false, int $opt /** * Writes a message to the output. + * + * @return void */ abstract protected function doWrite(string $message, bool $newline); } diff --git a/app/vendor/symfony/console/Output/OutputInterface.php b/app/vendor/symfony/console/Output/OutputInterface.php index bc927c51e..fb1557720 100644 --- a/app/vendor/symfony/console/Output/OutputInterface.php +++ b/app/vendor/symfony/console/Output/OutputInterface.php @@ -36,6 +36,8 @@ interface OutputInterface * @param bool $newline Whether to add a newline * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + * + * @return void */ public function write(string|iterable $messages, bool $newline = false, int $options = 0); @@ -44,11 +46,15 @@ public function write(string|iterable $messages, bool $newline = false, int $opt * * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + * + * @return void */ public function writeln(string|iterable $messages, int $options = 0); /** * Sets the verbosity of the output. + * + * @return void */ public function setVerbosity(int $level); @@ -79,6 +85,8 @@ public function isDebug(): bool; /** * Sets the decorated flag. + * + * @return void */ public function setDecorated(bool $decorated); @@ -87,6 +95,9 @@ public function setDecorated(bool $decorated); */ public function isDecorated(): bool; + /** + * @return void + */ public function setFormatter(OutputFormatterInterface $formatter); /** diff --git a/app/vendor/symfony/console/Output/StreamOutput.php b/app/vendor/symfony/console/Output/StreamOutput.php index 9ec524e4d..155066ea0 100644 --- a/app/vendor/symfony/console/Output/StreamOutput.php +++ b/app/vendor/symfony/console/Output/StreamOutput.php @@ -62,6 +62,9 @@ public function getStream() return $this->stream; } + /** + * @return void + */ protected function doWrite(string $message, bool $newline) { if ($newline) { diff --git a/app/vendor/symfony/console/Output/TrimmedBufferOutput.php b/app/vendor/symfony/console/Output/TrimmedBufferOutput.php index 1ca5a13e8..b00445ece 100644 --- a/app/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ b/app/vendor/symfony/console/Output/TrimmedBufferOutput.php @@ -45,6 +45,9 @@ public function fetch(): string return $content; } + /** + * @return void + */ protected function doWrite(string $message, bool $newline) { $this->buffer .= $message; diff --git a/app/vendor/symfony/console/Question/Question.php b/app/vendor/symfony/console/Question/Question.php index b06db9459..26896bb53 100644 --- a/app/vendor/symfony/console/Question/Question.php +++ b/app/vendor/symfony/console/Question/Question.php @@ -146,12 +146,11 @@ public function setAutocompleterValues(?iterable $values): static if (\is_array($values)) { $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); - $callback = static function () use ($values) { - return $values; - }; + $callback = static fn () => $values; } elseif ($values instanceof \Traversable) { - $valueCache = null; - $callback = static function () use ($values, &$valueCache) { + $callback = static function () use ($values) { + static $valueCache; + return $valueCache ??= iterator_to_array($values, false); }; } else { @@ -267,6 +266,9 @@ public function getNormalizer(): ?callable return $this->normalizer; } + /** + * @return bool + */ protected function isAssoc(array $array) { return (bool) \count(array_filter(array_keys($array), 'is_string')); diff --git a/app/vendor/symfony/console/README.md b/app/vendor/symfony/console/README.md index c89b4a1a2..bfd488109 100644 --- a/app/vendor/symfony/console/README.md +++ b/app/vendor/symfony/console/README.md @@ -4,6 +4,18 @@ Console Component The Console component eases the creation of beautiful and testable command line interfaces. +Sponsor +------- + +The Console component for Symfony 6.3 is [backed][1] by [Les-Tilleuls.coop][2]. + +Les-Tilleuls.coop is a team of 70+ Symfony experts who can help you design, develop and +fix your projects. They provide a wide range of professional services including development, +consulting, coaching, training and audits. They also are highly skilled in JS, Go and DevOps. +They are a worker cooperative! + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -18,3 +30,7 @@ Credits `Resources/bin/hiddeninput.exe` is a third party binary provided within this component. Find sources and license at https://github.com/Seldaek/hidden-input. + +[1]: https://symfony.com/backers +[2]: https://les-tilleuls.coop +[3]: https://symfony.com/sponsor diff --git a/app/vendor/symfony/console/Resources/completion.bash b/app/vendor/symfony/console/Resources/completion.bash index ad69eab0f..0d76eacc3 100644 --- a/app/vendor/symfony/console/Resources/completion.bash +++ b/app/vendor/symfony/console/Resources/completion.bash @@ -6,6 +6,16 @@ # https://symfony.com/doc/current/contributing/code/license.html _sf_{{ COMMAND_NAME }}() { + + # Use the default completion for shell redirect operators. + for w in '>' '>>' '&>' '<'; do + if [[ $w = "${COMP_WORDS[COMP_CWORD-1]}" ]]; then + compopt -o filenames + COMPREPLY=($(compgen -f -- "${COMP_WORDS[COMP_CWORD]}")) + return 0 + fi + done + # Use newline as only separator to allow space in completion values IFS=$'\n' local sf_cmd="${COMP_WORDS[0]}" diff --git a/app/vendor/symfony/console/Resources/completion.zsh b/app/vendor/symfony/console/Resources/completion.zsh index 97a9e88cd..ff76fe5fa 100644 --- a/app/vendor/symfony/console/Resources/completion.zsh +++ b/app/vendor/symfony/console/Resources/completion.zsh @@ -1,3 +1,5 @@ +#compdef {{ COMMAND_NAME }} + # This file is part of the Symfony package. # # (c) Fabien Potencier diff --git a/app/vendor/symfony/console/Style/OutputStyle.php b/app/vendor/symfony/console/Style/OutputStyle.php index b694bb53a..ddfa8decc 100644 --- a/app/vendor/symfony/console/Style/OutputStyle.php +++ b/app/vendor/symfony/console/Style/OutputStyle.php @@ -30,6 +30,9 @@ public function __construct(OutputInterface $output) $this->output = $output; } + /** + * @return void + */ public function newLine(int $count = 1) { $this->output->write(str_repeat(\PHP_EOL, $count)); @@ -40,16 +43,25 @@ public function createProgressBar(int $max = 0): ProgressBar return new ProgressBar($this->output, $max); } + /** + * @return void + */ public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) { $this->output->write($messages, $newline, $type); } + /** + * @return void + */ public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) { $this->output->writeln($messages, $type); } + /** + * @return void + */ public function setVerbosity(int $level) { $this->output->setVerbosity($level); @@ -60,6 +72,9 @@ public function getVerbosity(): int return $this->output->getVerbosity(); } + /** + * @return void + */ public function setDecorated(bool $decorated) { $this->output->setDecorated($decorated); @@ -70,6 +85,9 @@ public function isDecorated(): bool return $this->output->isDecorated(); } + /** + * @return void + */ public function setFormatter(OutputFormatterInterface $formatter) { $this->output->setFormatter($formatter); @@ -100,6 +118,9 @@ public function isDebug(): bool return $this->output->isDebug(); } + /** + * @return OutputInterface + */ protected function getErrorOutput() { if (!$this->output instanceof ConsoleOutputInterface) { diff --git a/app/vendor/symfony/console/Style/StyleInterface.php b/app/vendor/symfony/console/Style/StyleInterface.php index 0bb123394..e25a65bd2 100644 --- a/app/vendor/symfony/console/Style/StyleInterface.php +++ b/app/vendor/symfony/console/Style/StyleInterface.php @@ -20,51 +20,71 @@ interface StyleInterface { /** * Formats a command title. + * + * @return void */ public function title(string $message); /** * Formats a section title. + * + * @return void */ public function section(string $message); /** * Formats a list. + * + * @return void */ public function listing(array $elements); /** * Formats informational text. + * + * @return void */ public function text(string|array $message); /** * Formats a success result bar. + * + * @return void */ public function success(string|array $message); /** * Formats an error result bar. + * + * @return void */ public function error(string|array $message); /** * Formats an warning result bar. + * + * @return void */ public function warning(string|array $message); /** * Formats a note admonition. + * + * @return void */ public function note(string|array $message); /** * Formats a caution admonition. + * + * @return void */ public function caution(string|array $message); /** * Formats a table. + * + * @return void */ public function table(array $headers, array $rows); @@ -90,21 +110,29 @@ public function choice(string $question, array $choices, mixed $default = null): /** * Add newline(s). + * + * @return void */ public function newLine(int $count = 1); /** * Starts the progress output. + * + * @return void */ public function progressStart(int $max = 0); /** * Advances the progress output X steps. + * + * @return void */ public function progressAdvance(int $step = 1); /** * Finishes the progress output. + * + * @return void */ public function progressFinish(); } diff --git a/app/vendor/symfony/console/Style/SymfonyStyle.php b/app/vendor/symfony/console/Style/SymfonyStyle.php index 997f86279..cecce6c01 100644 --- a/app/vendor/symfony/console/Style/SymfonyStyle.php +++ b/app/vendor/symfony/console/Style/SymfonyStyle.php @@ -23,6 +23,7 @@ use Symfony\Component\Console\Helper\TableSeparator; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\ConsoleSectionOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\TrimmedBufferOutput; use Symfony\Component\Console\Question\ChoiceQuestion; @@ -59,6 +60,8 @@ public function __construct(InputInterface $input, OutputInterface $output) /** * Formats a message as a block of text. + * + * @return void */ public function block(string|array $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) { @@ -69,6 +72,9 @@ public function block(string|array $messages, string $type = null, string $style $this->newLine(); } + /** + * @return void + */ public function title(string $message) { $this->autoPrependBlock(); @@ -79,6 +85,9 @@ public function title(string $message) $this->newLine(); } + /** + * @return void + */ public function section(string $message) { $this->autoPrependBlock(); @@ -89,17 +98,21 @@ public function section(string $message) $this->newLine(); } + /** + * @return void + */ public function listing(array $elements) { $this->autoPrependText(); - $elements = array_map(function ($element) { - return sprintf(' * %s', $element); - }, $elements); + $elements = array_map(fn ($element) => sprintf(' * %s', $element), $elements); $this->writeln($elements); $this->newLine(); } + /** + * @return void + */ public function text(string|array $message) { $this->autoPrependText(); @@ -112,27 +125,41 @@ public function text(string|array $message) /** * Formats a command comment. + * + * @return void */ public function comment(string|array $message) { $this->block($message, null, null, ' // ', false, false); } + /** + * @return void + */ public function success(string|array $message) { $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); } + /** + * @return void + */ public function error(string|array $message) { $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); } + /** + * @return void + */ public function warning(string|array $message) { $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); } + /** + * @return void + */ public function note(string|array $message) { $this->block($message, 'NOTE', 'fg=yellow', ' ! '); @@ -140,17 +167,25 @@ public function note(string|array $message) /** * Formats an info message. + * + * @return void */ public function info(string|array $message) { $this->block($message, 'INFO', 'fg=green', ' ', true); } + /** + * @return void + */ public function caution(string|array $message) { $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); } + /** + * @return void + */ public function table(array $headers, array $rows) { $this->createTable() @@ -164,6 +199,8 @@ public function table(array $headers, array $rows) /** * Formats a horizontal table. + * + * @return void */ public function horizontalTable(array $headers, array $rows) { @@ -184,6 +221,8 @@ public function horizontalTable(array $headers, array $rows) * * 'A title' * * ['key' => 'value'] * * new TableSeparator() + * + * @return void */ public function definitionList(string|array|TableSeparator ...$list) { @@ -246,17 +285,26 @@ public function choice(string $question, array $choices, mixed $default = null, return $this->askQuestion($questionChoice); } + /** + * @return void + */ public function progressStart(int $max = 0) { $this->progressBar = $this->createProgressBar($max); $this->progressBar->start(); } + /** + * @return void + */ public function progressAdvance(int $step = 1) { $this->getProgressBar()->advance($step); } + /** + * @return void + */ public function progressFinish() { $this->getProgressBar()->finish(); @@ -298,6 +346,11 @@ public function askQuestion(Question $question): mixed $answer = $this->questionHelper->ask($this->input, $this, $question); if ($this->input->isInteractive()) { + if ($this->output instanceof ConsoleSectionOutput) { + // add the new line of the `return` to submit the input to ConsoleSectionOutput, because ConsoleSectionOutput is holding all it's lines. + // this is relevant when a `ConsoleSectionOutput::clear` is called. + $this->output->addNewLineOfInputSubmit(); + } $this->newLine(); $this->bufferedOutput->write("\n"); } @@ -305,6 +358,9 @@ public function askQuestion(Question $question): mixed return $answer; } + /** + * @return void + */ public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { @@ -317,6 +373,9 @@ public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORM } } + /** + * @return void + */ public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { @@ -329,6 +388,9 @@ public function write(string|iterable $messages, bool $newline = false, int $typ } } + /** + * @return void + */ public function newLine(int $count = 1) { parent::newLine($count); @@ -375,7 +437,7 @@ private function autoPrependText(): void { $fetched = $this->bufferedOutput->fetch(); // Prepend new line if last char isn't EOL: - if (!str_ends_with($fetched, "\n")) { + if ($fetched && !str_ends_with($fetched, "\n")) { $this->newLine(); } } diff --git a/app/vendor/symfony/console/Terminal.php b/app/vendor/symfony/console/Terminal.php index 216c609fa..3eda0376b 100644 --- a/app/vendor/symfony/console/Terminal.php +++ b/app/vendor/symfony/console/Terminal.php @@ -123,20 +123,19 @@ public static function hasSttyAvailable(): bool return self::$stty; } - // skip check if exec function is disabled - if (!\function_exists('exec')) { + // skip check if shell_exec function is disabled + if (!\function_exists('shell_exec')) { return false; } - exec('stty 2>&1', $output, $exitcode); - - return self::$stty = 0 === $exitcode; + return self::$stty = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); } - private static function initDimensions() + private static function initDimensions(): void { if ('\\' === \DIRECTORY_SEPARATOR) { - if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) { + $ansicon = getenv('ANSICON'); + if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) { // extract [w, H] from "wxh (WxH)" // or [w, h] from "wxh" self::$width = (int) $matches[1]; @@ -166,7 +165,7 @@ private static function hasVt100Support(): bool /** * Initializes dimensions using the output of an stty columns line. */ - private static function initDimensionsUsingStty() + private static function initDimensionsUsingStty(): void { if ($sttyString = self::getSttyColumns()) { if (preg_match('/rows.(\d+);.columns.(\d+);/is', $sttyString, $matches)) { @@ -216,6 +215,8 @@ private static function readFromProcess(string|array $command): ?string 2 => ['pipe', 'w'], ]; + $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0; + $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); if (!\is_resource($process)) { return null; @@ -226,6 +227,10 @@ private static function readFromProcess(string|array $command): ?string fclose($pipes[2]); proc_close($process); + if ($cp) { + sapi_windows_cp_set($cp); + } + return $info; } } diff --git a/app/vendor/symfony/console/Tester/TesterTrait.php b/app/vendor/symfony/console/Tester/TesterTrait.php index 9670a4968..497b8c8c7 100644 --- a/app/vendor/symfony/console/Tester/TesterTrait.php +++ b/app/vendor/symfony/console/Tester/TesterTrait.php @@ -128,7 +128,7 @@ public function setInputs(array $inputs): static * * verbosity: Sets the output verbosity flag * * capture_stderr_separately: Make output of stdOut and stdErr separately available */ - private function initOutput(array $options) + private function initOutput(array $options): void { $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; if (!$this->captureStreamsIndependently) { diff --git a/app/vendor/symfony/console/composer.json b/app/vendor/symfony/console/composer.json index bafe5d165..c34421299 100644 --- a/app/vendor/symfony/console/composer.json +++ b/app/vendor/symfony/console/composer.json @@ -2,7 +2,7 @@ "name": "symfony/console", "type": "library", "description": "Eases the creation of beautiful and testable command line interfaces", - "keywords": ["console", "cli", "command line", "terminal"], + "keywords": ["console", "cli", "command-line", "terminal"], "homepage": "https://symfony.com", "license": "MIT", "authors": [ @@ -17,9 +17,9 @@ ], "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/string": "^5.4|^6.0" }, "require-dev": { @@ -34,12 +34,6 @@ "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, - "suggest": { - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "", - "psr/log": "For using the console logger" - }, "conflict": { "symfony/dependency-injection": "<5.4", "symfony/dotenv": "<5.4", diff --git a/app/vendor/symfony/deprecation-contracts/LICENSE b/app/vendor/symfony/deprecation-contracts/LICENSE index 406242ff2..0ed3a2465 100644 --- a/app/vendor/symfony/deprecation-contracts/LICENSE +++ b/app/vendor/symfony/deprecation-contracts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020-2022 Fabien Potencier +Copyright (c) 2020-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/symfony/deprecation-contracts/README.md b/app/vendor/symfony/deprecation-contracts/README.md index 4957933a6..9814864c0 100644 --- a/app/vendor/symfony/deprecation-contracts/README.md +++ b/app/vendor/symfony/deprecation-contracts/README.md @@ -22,5 +22,5 @@ trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use This will generate the following message: `Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` -While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty +While not recommended, the deprecation notices can be completely ignored by declaring an empty `function trigger_deprecation() {}` in your application. diff --git a/app/vendor/symfony/deprecation-contracts/composer.json b/app/vendor/symfony/deprecation-contracts/composer.json index 774200fdc..c6d02d874 100644 --- a/app/vendor/symfony/deprecation-contracts/composer.json +++ b/app/vendor/symfony/deprecation-contracts/composer.json @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/app/vendor/symfony/filesystem/Filesystem.php b/app/vendor/symfony/filesystem/Filesystem.php index c7f3dd295..a379ce186 100644 --- a/app/vendor/symfony/filesystem/Filesystem.php +++ b/app/vendor/symfony/filesystem/Filesystem.php @@ -31,6 +31,8 @@ class Filesystem * If the target file is newer, it is overwritten only when the * $overwriteNewerFiles option is set to true. * + * @return void + * * @throws FileNotFoundException When originFile doesn't exist * @throws IOException When copy fails */ @@ -82,6 +84,8 @@ public function copy(string $originFile, string $targetFile, bool $overwriteNewe /** * Creates a directory recursively. * + * @return void + * * @throws IOException On any directory creation failure */ public function mkdir(string|iterable $dirs, int $mode = 0777) @@ -123,6 +127,8 @@ public function exists(string|iterable $files): bool * @param int|null $time The touch time as a Unix timestamp, if not supplied the current system time is used * @param int|null $atime The access time as a Unix timestamp, if not supplied the current system time is used * + * @return void + * * @throws IOException When touch fails */ public function touch(string|iterable $files, int $time = null, int $atime = null) @@ -137,6 +143,8 @@ public function touch(string|iterable $files, int $time = null, int $atime = nul /** * Removes files or directories. * + * @return void + * * @throws IOException When removal fails */ public function remove(string|iterable $files) @@ -161,7 +169,7 @@ private static function doRemove(array $files, bool $isRecursive): void } } elseif (is_dir($file)) { if (!$isRecursive) { - $tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-.')); + $tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-_')); if (file_exists($tmpName)) { try { @@ -203,12 +211,14 @@ private static function doRemove(array $files, bool $isRecursive): void * @param int $umask The mode mask (octal) * @param bool $recursive Whether change the mod recursively or not * + * @return void + * * @throws IOException When the change fails */ public function chmod(string|iterable $files, int $mode, int $umask = 0000, bool $recursive = false) { foreach ($this->toIterable($files) as $file) { - if (\is_int($mode) && !self::box('chmod', $file, $mode & ~$umask)) { + if (!self::box('chmod', $file, $mode & ~$umask)) { throw new IOException(sprintf('Failed to chmod file "%s": ', $file).self::$lastError, 0, null, $file); } if ($recursive && is_dir($file) && !is_link($file)) { @@ -223,6 +233,8 @@ public function chmod(string|iterable $files, int $mode, int $umask = 0000, bool * @param string|int $user A user name or number * @param bool $recursive Whether change the owner recursively or not * + * @return void + * * @throws IOException When the change fails */ public function chown(string|iterable $files, string|int $user, bool $recursive = false) @@ -249,6 +261,8 @@ public function chown(string|iterable $files, string|int $user, bool $recursive * @param string|int $group A group name or number * @param bool $recursive Whether change the group recursively or not * + * @return void + * * @throws IOException When the change fails */ public function chgrp(string|iterable $files, string|int $group, bool $recursive = false) @@ -272,6 +286,8 @@ public function chgrp(string|iterable $files, string|int $group, bool $recursive /** * Renames a file or a directory. * + * @return void + * * @throws IOException When target file or directory already exists * @throws IOException When origin cannot be renamed */ @@ -313,6 +329,8 @@ private function isReadable(string $filename): bool /** * Creates a symbolic link or copy a directory. * + * @return void + * * @throws IOException When symlink fails */ public function symlink(string $originDir, string $targetDir, bool $copyOnWindows = false) @@ -349,6 +367,8 @@ public function symlink(string $originDir, string $targetDir, bool $copyOnWindow * * @param string|string[] $targetFiles The target file(s) * + * @return void + * * @throws FileNotFoundException When original file is missing or not a file * @throws IOException When link fails, including if link already exists */ @@ -381,7 +401,7 @@ public function hardlink(string $originFile, string|iterable $targetFiles) /** * @param string $linkType Name of the link type, typically 'symbolic' or 'hard' */ - private function linkException(string $origin, string $target, string $linkType) + private function linkException(string $origin, string $target, string $linkType): never { if (self::$lastError) { if ('\\' === \DIRECTORY_SEPARATOR && str_contains(self::$lastError, 'error code(1314)')) { @@ -438,11 +458,9 @@ public function makePathRelative(string $endPath, string $startPath): string $startPath = str_replace('\\', '/', $startPath); } - $splitDriveLetter = function ($path) { - return (\strlen($path) > 2 && ':' === $path[1] && '/' === $path[2] && ctype_alpha($path[0])) - ? [substr($path, 2), strtoupper($path[0])] - : [$path, null]; - }; + $splitDriveLetter = fn ($path) => (\strlen($path) > 2 && ':' === $path[1] && '/' === $path[2] && ctype_alpha($path[0])) + ? [substr($path, 2), strtoupper($path[0])] + : [$path, null]; $splitPath = function ($path) { $result = []; @@ -508,6 +526,8 @@ public function makePathRelative(string $endPath, string $startPath): string * - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink(), defaults to false) * - $options['delete'] Whether to delete files that are not in the source directory (defaults to false) * + * @return void + * * @throws IOException When file type is unknown */ public function mirror(string $originDir, string $targetDir, \Traversable $iterator = null, array $options = []) @@ -632,6 +652,8 @@ public function tempnam(string $dir, string $prefix, string $suffix = ''): strin * * @param string|resource $content The data to write into the file * + * @return void + * * @throws IOException if the file cannot be written to */ public function dumpFile(string $filename, $content) @@ -642,6 +664,12 @@ public function dumpFile(string $filename, $content) $dir = \dirname($filename); + if (is_link($filename) && $linkTarget = $this->readlink($filename)) { + $this->dumpFile(Path::makeAbsolute($linkTarget, $dir), $content); + + return; + } + if (!is_dir($dir)) { $this->mkdir($dir); } @@ -671,6 +699,8 @@ public function dumpFile(string $filename, $content) * @param string|resource $content The content to append * @param bool $lock Whether the file should be locked when writing to it * + * @return void + * * @throws IOException If the file is not writable */ public function appendToFile(string $filename, $content/* , bool $lock = false */) @@ -730,7 +760,7 @@ private static function box(string $func, mixed ...$args): mixed /** * @internal */ - public static function handleError(int $type, string $msg) + public static function handleError(int $type, string $msg): void { self::$lastError = $msg; } diff --git a/app/vendor/symfony/filesystem/LICENSE b/app/vendor/symfony/filesystem/LICENSE index 008370457..0138f8f07 100644 --- a/app/vendor/symfony/filesystem/LICENSE +++ b/app/vendor/symfony/filesystem/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/symfony/finder/Comparator/NumberComparator.php b/app/vendor/symfony/finder/Comparator/NumberComparator.php index ff85d9677..dd3082077 100644 --- a/app/vendor/symfony/finder/Comparator/NumberComparator.php +++ b/app/vendor/symfony/finder/Comparator/NumberComparator.php @@ -35,7 +35,7 @@ class NumberComparator extends Comparator { /** - * @param string|int $test A comparison string or an integer + * @param string|null $test A comparison string or null * * @throws \InvalidArgumentException If the test is not understood */ diff --git a/app/vendor/symfony/finder/Finder.php b/app/vendor/symfony/finder/Finder.php index 7baecdf90..a3bf9a1a7 100644 --- a/app/vendor/symfony/finder/Finder.php +++ b/app/vendor/symfony/finder/Finder.php @@ -162,8 +162,8 @@ public function date(string|array $dates): static * * You can use patterns (delimited with / sign), globs or simple strings. * - * $finder->name('*.php') - * $finder->name('/\.php$/') // same as above + * $finder->name('/\.php$/') + * $finder->name('*.php') // same as above, without dot files * $finder->name('test.php') * $finder->name(['test.py', 'test.php']) * @@ -396,6 +396,8 @@ public function ignoreVCSIgnored(bool $ignoreVCSIgnored): static * @see ignoreVCS() * * @param string|string[] $pattern VCS patterns to ignore + * + * @return void */ public static function addVCSPattern(string|array $pattern) { @@ -671,9 +673,7 @@ public function getIterator(): \Iterator $iterator = new \AppendIterator(); foreach ($this->dirs as $dir) { - $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) { - return $this->searchInDirectory($dir); - }))); + $iterator->append(new \IteratorIterator(new LazyIterator(fn () => $this->searchInDirectory($dir)))); } foreach ($this->iterators as $it) { diff --git a/app/vendor/symfony/finder/Gitignore.php b/app/vendor/symfony/finder/Gitignore.php index 070074b3b..bf05c5b37 100644 --- a/app/vendor/symfony/finder/Gitignore.php +++ b/app/vendor/symfony/finder/Gitignore.php @@ -79,9 +79,7 @@ private static function lineToRegex(string $gitignoreLine): string } $regex = preg_quote(str_replace('\\', '', $gitignoreLine), '~'); - $regex = preg_replace_callback('~\\\\\[((?:\\\\!)?)([^\[\]]*)\\\\\]~', function (array $matches): string { - return '['.('' !== $matches[1] ? '^' : '').str_replace('\\-', '-', $matches[2]).']'; - }, $regex); + $regex = preg_replace_callback('~\\\\\[((?:\\\\!)?)([^\[\]]*)\\\\\]~', fn (array $matches): string => '['.('' !== $matches[1] ? '^' : '').str_replace('\\-', '-', $matches[2]).']', $regex); $regex = preg_replace('~(?:(?:\\\\\*){2,}(/?))+~', '(?:(?:(?!//).(? * * @extends \FilterIterator + * * @implements \RecursiveIterator */ class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator diff --git a/app/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/app/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php index c321aee7c..34cced688 100644 --- a/app/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ b/app/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php @@ -18,12 +18,13 @@ * Extends the \RecursiveDirectoryIterator to support relative paths. * * @author Victor Berchet + * * @extends \RecursiveDirectoryIterator */ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator { private bool $ignoreUnreadableDirs; - private ?bool $rewindable = null; + private bool $ignoreFirstRewind = true; // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations private string $rootPath; @@ -101,7 +102,6 @@ public function getChildren(): \RecursiveDirectoryIterator $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; // performance optimization to avoid redoing the same work in all children - $children->rewindable = &$this->rewindable; $children->rootPath = $this->rootPath; } @@ -111,36 +111,23 @@ public function getChildren(): \RecursiveDirectoryIterator } } - /** - * Do nothing for non rewindable stream. - */ - public function rewind(): void + public function next(): void { - if (false === $this->isRewindable()) { - return; - } + $this->ignoreFirstRewind = false; - parent::rewind(); + parent::next(); } - /** - * Checks if the stream is rewindable. - */ - public function isRewindable(): bool + public function rewind(): void { - if (null !== $this->rewindable) { - return $this->rewindable; - } - - if (false !== $stream = @opendir($this->getPath())) { - $infos = stream_get_meta_data($stream); - closedir($stream); + // some streams like FTP are not rewindable, ignore the first rewind after creation, + // as newly created DirectoryIterator does not need to be rewound + if ($this->ignoreFirstRewind) { + $this->ignoreFirstRewind = false; - if ($infos['seekable']) { - return $this->rewindable = true; - } + return; } - return $this->rewindable = false; + parent::rewind(); } } diff --git a/app/vendor/symfony/finder/Iterator/SortableIterator.php b/app/vendor/symfony/finder/Iterator/SortableIterator.php index e8b556502..177cd0b60 100644 --- a/app/vendor/symfony/finder/Iterator/SortableIterator.php +++ b/app/vendor/symfony/finder/Iterator/SortableIterator.php @@ -48,21 +48,13 @@ public function __construct(\Traversable $iterator, int|callable $sort, bool $re $order = $reverseOrder ? -1 : 1; if (self::SORT_BY_NAME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); } elseif (self::SORT_BY_NAME_NATURAL === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); } elseif (self::SORT_BY_NAME_CASE_INSENSITIVE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); } elseif (self::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strnatcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); } elseif (self::SORT_BY_TYPE === $sort) { $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { if ($a->isDir() && $b->isFile()) { @@ -74,29 +66,19 @@ public function __construct(\Traversable $iterator, int|callable $sort, bool $re return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); }; } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getATime() - $b->getATime()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getATime() - $b->getATime()); } elseif (self::SORT_BY_CHANGED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getCTime() - $b->getCTime()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getCTime() - $b->getCTime()); } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getMTime() - $b->getMTime()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getMTime() - $b->getMTime()); } elseif (self::SORT_BY_EXTENSION === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcmp($a->getExtension(), $b->getExtension()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * strnatcmp($a->getExtension(), $b->getExtension()); } elseif (self::SORT_BY_SIZE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getSize() - $b->getSize()); - }; + $this->sort = static fn (\SplFileInfo $a, \SplFileInfo $b) => $order * ($a->getSize() - $b->getSize()); } elseif (self::SORT_BY_NONE === $sort) { $this->sort = $order; } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort(...); + $this->sort = $reverseOrder ? static fn (\SplFileInfo $a, \SplFileInfo $b) => -$sort($a, $b) : $sort(...); } else { throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); } diff --git a/app/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php b/app/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php index 29fc2d99b..7e6051d38 100644 --- a/app/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +++ b/app/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php @@ -126,9 +126,7 @@ private function parentDirectoriesUpTo(string $from, string $upTo): array { return array_filter( $this->parentDirectoriesUpwards($from), - static function (string $directory) use ($upTo): bool { - return str_starts_with($directory, $upTo); - } + static fn (string $directory): bool => str_starts_with($directory, $upTo) ); } diff --git a/app/vendor/symfony/finder/LICENSE b/app/vendor/symfony/finder/LICENSE index 008370457..0138f8f07 100644 --- a/app/vendor/symfony/finder/LICENSE +++ b/app/vendor/symfony/finder/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/symfony/process/Exception/ProcessFailedException.php b/app/vendor/symfony/process/Exception/ProcessFailedException.php index 328acfde5..cf006daeb 100644 --- a/app/vendor/symfony/process/Exception/ProcessFailedException.php +++ b/app/vendor/symfony/process/Exception/ProcessFailedException.php @@ -47,6 +47,9 @@ public function __construct(Process $process) $this->process = $process; } + /** + * @return Process + */ public function getProcess() { return $this->process; diff --git a/app/vendor/symfony/process/Exception/ProcessTimedOutException.php b/app/vendor/symfony/process/Exception/ProcessTimedOutException.php index b052d72cb..e507ca309 100644 --- a/app/vendor/symfony/process/Exception/ProcessTimedOutException.php +++ b/app/vendor/symfony/process/Exception/ProcessTimedOutException.php @@ -38,22 +38,31 @@ public function __construct(Process $process, int $timeoutType) )); } + /** + * @return Process + */ public function getProcess() { return $this->process; } + /** + * @return bool + */ public function isGeneralTimeout() { return self::TYPE_GENERAL === $this->timeoutType; } + /** + * @return bool + */ public function isIdleTimeout() { return self::TYPE_IDLE === $this->timeoutType; } - public function getExceededTimeout() + public function getExceededTimeout(): ?float { return match ($this->timeoutType) { self::TYPE_GENERAL => $this->process->getTimeout(), diff --git a/app/vendor/symfony/process/ExecutableFinder.php b/app/vendor/symfony/process/ExecutableFinder.php index d9d111029..e3387dfe1 100644 --- a/app/vendor/symfony/process/ExecutableFinder.php +++ b/app/vendor/symfony/process/ExecutableFinder.php @@ -23,6 +23,8 @@ class ExecutableFinder /** * Replaces default suffixes of executable. + * + * @return void */ public function setSuffixes(array $suffixes) { @@ -31,6 +33,8 @@ public function setSuffixes(array $suffixes) /** * Adds new possible suffix to check for executable. + * + * @return void */ public function addSuffix(string $suffix) { diff --git a/app/vendor/symfony/process/InputStream.php b/app/vendor/symfony/process/InputStream.php index b8682baeb..086f5a9ed 100644 --- a/app/vendor/symfony/process/InputStream.php +++ b/app/vendor/symfony/process/InputStream.php @@ -23,12 +23,14 @@ class InputStream implements \IteratorAggregate { /** @var callable|null */ - private $onEmpty = null; + private $onEmpty; private $input = []; private $open = true; /** * Sets a callback that is called when the write buffer becomes empty. + * + * @return void */ public function onEmpty(callable $onEmpty = null) { @@ -40,6 +42,8 @@ public function onEmpty(callable $onEmpty = null) * * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar, * stream resource or \Traversable + * + * @return void */ public function write(mixed $input) { @@ -54,6 +58,8 @@ public function write(mixed $input) /** * Closes the write buffer. + * + * @return void */ public function close() { @@ -62,6 +68,8 @@ public function close() /** * Tells whether the write buffer is closed or not. + * + * @return bool */ public function isClosed() { diff --git a/app/vendor/symfony/process/LICENSE b/app/vendor/symfony/process/LICENSE index 008370457..0138f8f07 100644 --- a/app/vendor/symfony/process/LICENSE +++ b/app/vendor/symfony/process/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/symfony/process/PhpExecutableFinder.php b/app/vendor/symfony/process/PhpExecutableFinder.php index 3fab03e38..9ab8ac23f 100644 --- a/app/vendor/symfony/process/PhpExecutableFinder.php +++ b/app/vendor/symfony/process/PhpExecutableFinder.php @@ -54,7 +54,7 @@ public function find(bool $includeArgs = true): string|false $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; // PHP_BINARY return the current sapi executable - if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cgi-fcgi', 'cli', 'cli-server', 'phpdbg'], true)) { + if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cli', 'cli-server', 'phpdbg'], true)) { return \PHP_BINARY.$args; } diff --git a/app/vendor/symfony/process/PhpProcess.php b/app/vendor/symfony/process/PhpProcess.php index 486bc1dac..ef54a3d2b 100644 --- a/app/vendor/symfony/process/PhpProcess.php +++ b/app/vendor/symfony/process/PhpProcess.php @@ -55,6 +55,9 @@ public static function fromShellCommandline(string $command, string $cwd = null, throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); } + /** + * @return void + */ public function start(callable $callback = null, array $env = []) { if (null === $this->getCommandLine()) { diff --git a/app/vendor/symfony/process/Pipes/AbstractPipes.php b/app/vendor/symfony/process/Pipes/AbstractPipes.php index 51d3af0b5..ba3a97a3f 100644 --- a/app/vendor/symfony/process/Pipes/AbstractPipes.php +++ b/app/vendor/symfony/process/Pipes/AbstractPipes.php @@ -41,7 +41,7 @@ public function __construct(mixed $input) } } - public function close() + public function close(): void { foreach ($this->pipes as $pipe) { if (\is_resource($pipe)) { @@ -66,7 +66,7 @@ protected function hasSystemCallBeenInterrupted(): bool /** * Unblocks streams. */ - protected function unblock() + protected function unblock(): void { if (!$this->blocked) { return; @@ -170,7 +170,7 @@ protected function write(): ?array /** * @internal */ - public function handleError(int $type, string $msg) + public function handleError(int $type, string $msg): void { $this->lastError = $msg; } diff --git a/app/vendor/symfony/process/Pipes/PipesInterface.php b/app/vendor/symfony/process/Pipes/PipesInterface.php index 50eb5c47e..967f8de7f 100644 --- a/app/vendor/symfony/process/Pipes/PipesInterface.php +++ b/app/vendor/symfony/process/Pipes/PipesInterface.php @@ -57,5 +57,5 @@ public function haveReadSupport(): bool; /** * Closes file handles and pipes. */ - public function close(); + public function close(): void; } diff --git a/app/vendor/symfony/process/Pipes/WindowsPipes.php b/app/vendor/symfony/process/Pipes/WindowsPipes.php index 9f4dedb28..0d6ab12d3 100644 --- a/app/vendor/symfony/process/Pipes/WindowsPipes.php +++ b/app/vendor/symfony/process/Pipes/WindowsPipes.php @@ -172,7 +172,7 @@ public function areOpen(): bool return $this->pipes && $this->fileHandles; } - public function close() + public function close(): void { parent::close(); foreach ($this->fileHandles as $type => $handle) { diff --git a/app/vendor/symfony/process/Process.php b/app/vendor/symfony/process/Process.php index bdeab7e75..40dbd4162 100644 --- a/app/vendor/symfony/process/Process.php +++ b/app/vendor/symfony/process/Process.php @@ -285,6 +285,8 @@ public function mustRun(callable $callback = null, array $env = []): static * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR * + * @return void + * * @throws RuntimeException When process can't be launched * @throws RuntimeException When process is already running * @throws LogicException In case a callback is provided and output has been disabled @@ -421,7 +423,7 @@ public function wait(callable $callback = null): int do { $this->checkTimeout(); - $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); + $running = $this->isRunning() && ('\\' === \DIRECTORY_SEPARATOR || $this->processPipes->areOpen()); $this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); } while ($running); @@ -604,6 +606,8 @@ public function getIncrementalOutput(): string * * @param int $flags A bit field of Process::ITER_* flags * + * @return \Generator + * * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started */ @@ -872,7 +876,7 @@ public function getStatus(): string * Stops the process. * * @param int|float $timeout The timeout in seconds - * @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) + * @param int|null $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) * * @return int|null The exit-code of the process or null if it's not running */ @@ -910,7 +914,7 @@ public function stop(float $timeout = 10, int $signal = null): ?int * * @internal */ - public function addOutput(string $line) + public function addOutput(string $line): void { $this->lastOutputTime = microtime(true); @@ -924,7 +928,7 @@ public function addOutput(string $line) * * @internal */ - public function addErrorOutput(string $line) + public function addErrorOutput(string $line): void { $this->lastOutputTime = microtime(true); @@ -1138,6 +1142,8 @@ public function setInput(mixed $input): static * In case you run a background process (with the start method), you should * trigger this method regularly to ensure the process timeout * + * @return void + * * @throws ProcessTimedOutException In case the timeout was reached */ public function checkTimeout() @@ -1178,6 +1184,8 @@ public function getStartTime(): float * * Enabling the "create_new_console" option allows a subprocess to continue * to run after the main process exited, on both Windows and *nix + * + * @return void */ public function setOptions(array $options) { @@ -1253,9 +1261,7 @@ private function getDescriptors(): array protected function buildCallback(callable $callback = null): \Closure { if ($this->outputDisabled) { - return function ($type, $data) use ($callback): bool { - return null !== $callback && $callback($type, $data); - }; + return fn ($type, $data): bool => null !== $callback && $callback($type, $data); } $out = self::OUT; @@ -1275,6 +1281,8 @@ protected function buildCallback(callable $callback = null): \Closure * Updates the status of the process, reads pipes. * * @param bool $blocking Whether to use a blocking read call + * + * @return void */ protected function updateStatus(bool $blocking) { @@ -1323,7 +1331,7 @@ protected function isSigchildEnabled(): bool * * @throws LogicException in case output has been disabled or process is not started */ - private function readPipesForOutput(string $caller, bool $blocking = false) + private function readPipesForOutput(string $caller, bool $blocking = false): void { if ($this->outputDisabled) { throw new LogicException('Output has been disabled.'); @@ -1358,7 +1366,7 @@ private function validateTimeout(?float $timeout): ?float * @param bool $blocking Whether to use blocking calls or not * @param bool $close Whether to close file handles or not */ - private function readPipes(bool $blocking, bool $close) + private function readPipes(bool $blocking, bool $close): void { $result = $this->processPipes->readAndWrite($blocking, $close); @@ -1407,7 +1415,7 @@ private function close(): int /** * Resets data related to the latest run of the process. */ - private function resetProcessData() + private function resetProcessData(): void { $this->starttime = null; $this->callback = null; @@ -1480,8 +1488,6 @@ private function doSignal(int $signal, bool $throwException): bool private function prepareWindowsCommandLine(string $cmd, array &$env): string { $uid = uniqid('', true); - $varCount = 0; - $varCache = []; $cmd = preg_replace_callback( '/"(?:( [^"%!^]*+ @@ -1490,7 +1496,9 @@ private function prepareWindowsCommandLine(string $cmd, array &$env): string [^"%!^]*+ )++ ) | [^"]*+ )"/x', - function ($m) use (&$env, &$varCache, &$varCount, $uid) { + function ($m) use (&$env, $uid) { + static $varCount = 0; + static $varCache = []; if (!isset($m[1])) { return $m[0]; } @@ -1528,7 +1536,7 @@ function ($m) use (&$env, &$varCache, &$varCount, $uid) { * * @throws LogicException if the process has not run */ - private function requireProcessIsStarted(string $functionName) + private function requireProcessIsStarted(string $functionName): void { if (!$this->isStarted()) { throw new LogicException(sprintf('Process must be started before calling "%s()".', $functionName)); @@ -1540,7 +1548,7 @@ private function requireProcessIsStarted(string $functionName) * * @throws LogicException if the process is not yet terminated */ - private function requireProcessIsTerminated(string $functionName) + private function requireProcessIsTerminated(string $functionName): void { if (!$this->isTerminated()) { throw new LogicException(sprintf('Process must be terminated before calling "%s()".', $functionName)); @@ -1569,7 +1577,7 @@ private function escapeArgument(?string $argument): string return '"'.str_replace(['"', '^', '%', '!', "\n"], ['""', '"^^"', '"^%"', '"^!"', '!LF!'], $argument).'"'; } - private function replacePlaceholders(string $commandline, array $env) + private function replacePlaceholders(string $commandline, array $env): string { return preg_replace_callback('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/', function ($matches) use ($commandline, $env) { if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) { diff --git a/app/vendor/symfony/process/README.md b/app/vendor/symfony/process/README.md index a371d286b..afce5e45e 100644 --- a/app/vendor/symfony/process/README.md +++ b/app/vendor/symfony/process/README.md @@ -3,17 +3,6 @@ Process Component The Process component executes commands in sub-processes. -Sponsor -------- - -The Process component for Symfony 6.1 is [backed][1] by [SensioLabs][2]. - -As the creator of Symfony, SensioLabs supports companies using Symfony, with an -offering encompassing consultancy, expertise, services, training, and technical -assistance to ensure the success of web application development projects. - -Help Symfony by [sponsoring][3] its development! - Resources --------- @@ -22,7 +11,3 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) - -[1]: https://symfony.com/backers -[2]: https://sensiolabs.com -[3]: https://symfony.com/sponsor diff --git a/app/vendor/symfony/service-contracts/LICENSE b/app/vendor/symfony/service-contracts/LICENSE index 74cdc2dbf..7536caeae 100644 --- a/app/vendor/symfony/service-contracts/LICENSE +++ b/app/vendor/symfony/service-contracts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2022 Fabien Potencier +Copyright (c) 2018-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/symfony/service-contracts/README.md b/app/vendor/symfony/service-contracts/README.md index 41e054a10..42841a57d 100644 --- a/app/vendor/symfony/service-contracts/README.md +++ b/app/vendor/symfony/service-contracts/README.md @@ -3,7 +3,7 @@ Symfony Service Contracts A set of abstractions extracted out of the Symfony components. -Can be used to build on semantics that the Symfony components proved useful - and +Can be used to build on semantics that the Symfony components proved useful and that already have battle tested implementations. See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/app/vendor/symfony/service-contracts/ResetInterface.php b/app/vendor/symfony/service-contracts/ResetInterface.php index 1af1075ee..a4f389b01 100644 --- a/app/vendor/symfony/service-contracts/ResetInterface.php +++ b/app/vendor/symfony/service-contracts/ResetInterface.php @@ -26,5 +26,8 @@ */ interface ResetInterface { + /** + * @return void + */ public function reset(); } diff --git a/app/vendor/symfony/service-contracts/ServiceProviderInterface.php b/app/vendor/symfony/service-contracts/ServiceProviderInterface.php index a28fd82ea..c05e4bfe7 100644 --- a/app/vendor/symfony/service-contracts/ServiceProviderInterface.php +++ b/app/vendor/symfony/service-contracts/ServiceProviderInterface.php @@ -19,7 +19,7 @@ * @author Nicolas Grekas * @author Mateusz Sip * - * @template T of mixed + * @template-covariant T of mixed */ interface ServiceProviderInterface extends ContainerInterface { diff --git a/app/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/app/vendor/symfony/service-contracts/ServiceSubscriberTrait.php index f7cd3a941..f3b450cd6 100644 --- a/app/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ b/app/vendor/symfony/service-contracts/ServiceSubscriberTrait.php @@ -66,12 +66,13 @@ public static function getSubscribedServices(): array #[Required] public function setContainer(ContainerInterface $container): ?ContainerInterface { - $this->container = $container; - + $ret = null; if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) { - return parent::setContainer($container); + $ret = parent::setContainer($container); } - return null; + $this->container = $container; + + return $ret; } } diff --git a/app/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/app/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php index 88f6a0687..07d12b4a5 100644 --- a/app/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ b/app/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php @@ -11,82 +11,13 @@ namespace Symfony\Contracts\Service\Test; -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\ServiceLocatorTrait; +class_alias(ServiceLocatorTestCase::class, ServiceLocatorTest::class); -abstract class ServiceLocatorTest extends TestCase -{ - protected function getServiceLocator(array $factories): ContainerInterface +if (false) { + /** + * @deprecated since PHPUnit 9.6 + */ + class ServiceLocatorTest { - return new class($factories) implements ContainerInterface { - use ServiceLocatorTrait; - }; - } - - public function testHas() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - function () { return 'dummy'; }, - ]); - - $this->assertTrue($locator->has('foo')); - $this->assertTrue($locator->has('bar')); - $this->assertFalse($locator->has('dummy')); - } - - public function testGet() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('baz', $locator->get('bar')); - } - - public function testGetDoesNotMemoize() - { - $i = 0; - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$i) { - ++$i; - - return 'bar'; - }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame(2, $i); - } - - public function testThrowsOnUndefinedInternalService() - { - if (!$this->getExpectedException()) { - $this->expectException(\Psr\Container\NotFoundExceptionInterface::class); - $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); - } - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } - - public function testThrowsOnCircularReference() - { - $this->expectException(\Psr\Container\ContainerExceptionInterface::class); - $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - 'bar' => function () use (&$locator) { return $locator->get('baz'); }, - 'baz' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); } } diff --git a/app/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php b/app/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php new file mode 100644 index 000000000..a0f20a6a7 --- /dev/null +++ b/app/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service\Test; + +use PHPUnit\Framework\TestCase; +use Psr\Container\ContainerInterface; +use Symfony\Contracts\Service\ServiceLocatorTrait; + +abstract class ServiceLocatorTestCase extends TestCase +{ + protected function getServiceLocator(array $factories): ContainerInterface + { + return new class($factories) implements ContainerInterface { + use ServiceLocatorTrait; + }; + } + + public function testHas() + { + $locator = $this->getServiceLocator([ + 'foo' => function () { return 'bar'; }, + 'bar' => function () { return 'baz'; }, + function () { return 'dummy'; }, + ]); + + $this->assertTrue($locator->has('foo')); + $this->assertTrue($locator->has('bar')); + $this->assertFalse($locator->has('dummy')); + } + + public function testGet() + { + $locator = $this->getServiceLocator([ + 'foo' => function () { return 'bar'; }, + 'bar' => function () { return 'baz'; }, + ]); + + $this->assertSame('bar', $locator->get('foo')); + $this->assertSame('baz', $locator->get('bar')); + } + + public function testGetDoesNotMemoize() + { + $i = 0; + $locator = $this->getServiceLocator([ + 'foo' => function () use (&$i) { + ++$i; + + return 'bar'; + }, + ]); + + $this->assertSame('bar', $locator->get('foo')); + $this->assertSame('bar', $locator->get('foo')); + $this->assertSame(2, $i); + } + + public function testThrowsOnUndefinedInternalService() + { + if (!$this->getExpectedException()) { + $this->expectException(\Psr\Container\NotFoundExceptionInterface::class); + $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); + } + $locator = $this->getServiceLocator([ + 'foo' => function () use (&$locator) { return $locator->get('bar'); }, + ]); + + $locator->get('foo'); + } + + public function testThrowsOnCircularReference() + { + $this->expectException(\Psr\Container\ContainerExceptionInterface::class); + $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); + $locator = $this->getServiceLocator([ + 'foo' => function () use (&$locator) { return $locator->get('bar'); }, + 'bar' => function () use (&$locator) { return $locator->get('baz'); }, + 'baz' => function () use (&$locator) { return $locator->get('bar'); }, + ]); + + $locator->get('foo'); + } +} diff --git a/app/vendor/symfony/service-contracts/composer.json b/app/vendor/symfony/service-contracts/composer.json index 36b0d95e7..a64188b51 100644 --- a/app/vendor/symfony/service-contracts/composer.json +++ b/app/vendor/symfony/service-contracts/composer.json @@ -22,9 +22,6 @@ "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" }, "exclude-from-classmap": [ @@ -34,7 +31,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/app/vendor/symfony/string/AbstractUnicodeString.php b/app/vendor/symfony/string/AbstractUnicodeString.php index 52912276f..d19a61a9c 100644 --- a/app/vendor/symfony/string/AbstractUnicodeString.php +++ b/app/vendor/symfony/string/AbstractUnicodeString.php @@ -37,12 +37,8 @@ abstract class AbstractUnicodeString extends AbstractString private const ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; // the subset of folded case mappings that is not in lower case mappings - private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'İ', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; - private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'i̇', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; - - // the subset of upper case mappings that map one code point to many code points - private const UPPER_FROM = ['ß', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'և', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ', 'ʼn', 'ΐ', 'ΰ', 'ǰ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾶ', 'ῆ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῶ']; - private const UPPER_TO = ['SS', 'FF', 'FI', 'FL', 'FFI', 'FFL', 'ST', 'ST', 'ԵՒ', 'ՄՆ', 'ՄԵ', 'ՄԻ', 'ՎՆ', 'ՄԽ', 'ʼN', 'Ϊ́', 'Ϋ́', 'J̌', 'H̱', 'T̈', 'W̊', 'Y̊', 'Aʾ', 'Υ̓', 'Υ̓̀', 'Υ̓́', 'Υ̓͂', 'Α͂', 'Η͂', 'Ϊ̀', 'Ϊ́', 'Ι͂', 'Ϊ͂', 'Ϋ̀', 'Ϋ́', 'Ρ̓', 'Υ͂', 'Ϋ͂', 'Ω͂']; + private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; + private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; // the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'ʼn', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ', 'ƀ', 'Ɓ', 'Ƃ', 'ƃ', 'Ƈ', 'ƈ', 'Ɖ', 'Ɗ', 'Ƌ', 'ƌ', 'Ɛ', 'Ƒ', 'ƒ', 'Ɠ', 'ƕ', 'Ɩ', 'Ɨ', 'Ƙ', 'ƙ', 'ƚ', 'Ɲ', 'ƞ', 'Ƣ', 'ƣ', 'Ƥ', 'ƥ', 'ƫ', 'Ƭ', 'ƭ', 'Ʈ', 'Ʋ', 'Ƴ', 'ƴ', 'Ƶ', 'ƶ', 'DŽ', 'Dž', 'dž', 'Ǥ', 'ǥ', 'ȡ', 'Ȥ', 'ȥ', 'ȴ', 'ȵ', 'ȶ', 'ȷ', 'ȸ', 'ȹ', 'Ⱥ', 'Ȼ', 'ȼ', 'Ƚ', 'Ⱦ', 'ȿ', 'ɀ', 'Ƀ', 'Ʉ', 'Ɇ', 'ɇ', 'Ɉ', 'ɉ', 'Ɍ', 'ɍ', 'Ɏ', 'ɏ', 'ɓ', 'ɕ', 'ɖ', 'ɗ', 'ɛ', 'ɟ', 'ɠ', 'ɡ', 'ɢ', 'ɦ', 'ɧ', 'ɨ', 'ɪ', 'ɫ', 'ɬ', 'ɭ', 'ɱ', 'ɲ', 'ɳ', 'ɴ', 'ɶ', 'ɼ', 'ɽ', 'ɾ', 'ʀ', 'ʂ', 'ʈ', 'ʉ', 'ʋ', 'ʏ', 'ʐ', 'ʑ', 'ʙ', 'ʛ', 'ʜ', 'ʝ', 'ʟ', 'ʠ', 'ʣ', 'ʥ', 'ʦ', 'ʪ', 'ʫ', 'ᴀ', 'ᴁ', 'ᴃ', 'ᴄ', 'ᴅ', 'ᴆ', 'ᴇ', 'ᴊ', 'ᴋ', 'ᴌ', 'ᴍ', 'ᴏ', 'ᴘ', 'ᴛ', 'ᴜ', 'ᴠ', 'ᴡ', 'ᴢ', 'ᵫ', 'ᵬ', 'ᵭ', 'ᵮ', 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆']; @@ -159,7 +155,9 @@ public function ascii(array $rules = []): self public function camel(): static { $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) use (&$i) { + $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) { + static $i = 0; + return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); @@ -360,9 +358,7 @@ public function title(bool $allWords = false): static $limit = $allWords ? -1 : 1; - $str->string = preg_replace_callback('/\b./u', static function (array $m): string { - return mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, $str->string, $limit); + $str->string = preg_replace_callback('/\b./u', static fn (array $m): string => mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'), $str->string, $limit); return $str; } diff --git a/app/vendor/symfony/string/Inflector/EnglishInflector.php b/app/vendor/symfony/string/Inflector/EnglishInflector.php index 4474736a4..2cd6bb87b 100644 --- a/app/vendor/symfony/string/Inflector/EnglishInflector.php +++ b/app/vendor/symfony/string/Inflector/EnglishInflector.php @@ -55,6 +55,9 @@ final class EnglishInflector implements InflectorInterface // indices (index), appendices (appendix), prices (price) ['seci', 4, false, true, ['ex', 'ix', 'ice']], + // codes (code) + ['sedoc', 5, false, true, 'code'], + // selfies (selfie) ['seifles', 7, true, true, 'selfie'], @@ -64,6 +67,9 @@ final class EnglishInflector implements InflectorInterface // movies (movie) ['seivom', 6, true, true, 'movie'], + // names (name) + ['seman', 5, true, false, 'name'], + // conspectuses (conspectus), prospectuses (prospectus) ['sesutcep', 8, true, true, 'pectus'], @@ -88,6 +94,9 @@ final class EnglishInflector implements InflectorInterface // accesses (access), addresses (address), kisses (kiss) ['sess', 4, true, false, 'ss'], + // statuses (status) + ['sesutats', 8, true, true, 'status'], + // analyses (analysis), ellipses (ellipsis), fungi (fungus), // neuroses (neurosis), theses (thesis), emphases (emphasis), // oases (oasis), crises (crisis), houses (house), bases (base), @@ -132,6 +141,9 @@ final class EnglishInflector implements InflectorInterface // shoes (shoe) ['se', 2, true, true, ['', 'e']], + // status (status) + ['sutats', 6, true, true, 'status'], + // tags (tag) ['s', 1, true, true, ''], @@ -273,6 +285,9 @@ final class EnglishInflector implements InflectorInterface // circuses (circus) ['suc', 3, true, true, 'cuses'], + // status (status) + ['sutats', 6, true, true, ['status', 'statuses']], + // conspectuses (conspectus), prospectuses (prospectus) ['sutcep', 6, true, true, 'pectuses'], diff --git a/app/vendor/symfony/string/LICENSE b/app/vendor/symfony/string/LICENSE index 5c7ba0551..f37c76b59 100644 --- a/app/vendor/symfony/string/LICENSE +++ b/app/vendor/symfony/string/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019-2023 Fabien Potencier +Copyright (c) 2019-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/symfony/string/LazyString.php b/app/vendor/symfony/string/LazyString.php index 9523b8cdb..3128ebb36 100644 --- a/app/vendor/symfony/string/LazyString.php +++ b/app/vendor/symfony/string/LazyString.php @@ -30,7 +30,9 @@ public static function fromCallable(callable|array $callback, mixed ...$argument } $lazyString = new static(); - $lazyString->value = static function () use (&$callback, &$arguments, &$value): string { + $lazyString->value = static function () use (&$callback, &$arguments): string { + static $value; + if (null !== $arguments) { if (!\is_callable($callback)) { $callback[0] = $callback[0](); diff --git a/app/vendor/symfony/string/Slugger/AsciiSlugger.php b/app/vendor/symfony/string/Slugger/AsciiSlugger.php index 826d07ca0..6e550c61c 100644 --- a/app/vendor/symfony/string/Slugger/AsciiSlugger.php +++ b/app/vendor/symfony/string/Slugger/AsciiSlugger.php @@ -74,6 +74,9 @@ public function __construct(string $defaultLocale = null, array|\Closure $symbol $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; } + /** + * @return void + */ public function setLocale(string $locale) { $this->defaultLocale = $locale; @@ -121,9 +124,7 @@ public function slug(string $string, string $separator = '-', string $locale = n // If the symbols map is passed as a closure, there is no need to fallback to the parent locale // as the closure can just provide substitutions for all locales of interest. $symbolsMap = $this->symbolsMap; - array_unshift($transliterator, static function ($s) use ($symbolsMap, $locale) { - return $symbolsMap($s, $locale); - }); + array_unshift($transliterator, static fn ($s) => $symbolsMap($s, $locale)); } $unicodeString = (new UnicodeString($string))->ascii($transliterator); diff --git a/app/vendor/symfony/string/composer.json b/app/vendor/symfony/string/composer.json index 44a809d58..3545c8531 100644 --- a/app/vendor/symfony/string/composer.json +++ b/app/vendor/symfony/string/composer.json @@ -26,11 +26,11 @@ "symfony/error-handler": "^5.4|^6.0", "symfony/intl": "^6.2", "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", + "symfony/translation-contracts": "^2.5|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "autoload": { "psr-4": { "Symfony\\Component\\String\\": "" }, diff --git a/app/vendor/symfony/var-dumper/CHANGELOG.md b/app/vendor/symfony/var-dumper/CHANGELOG.md index ffa4daf2b..932987501 100644 --- a/app/vendor/symfony/var-dumper/CHANGELOG.md +++ b/app/vendor/symfony/var-dumper/CHANGELOG.md @@ -1,6 +1,14 @@ CHANGELOG ========= +6.3 +--- + + * Add caster for `WeakMap` + * Add support of named arguments to `dd()` and `dump()` to display the argument name + * Add support for `Relay\Relay` + * Add display of invisible characters + 6.2 --- diff --git a/app/vendor/symfony/var-dumper/Caster/AmqpCaster.php b/app/vendor/symfony/var-dumper/Caster/AmqpCaster.php index dc3b62198..22026f46a 100644 --- a/app/vendor/symfony/var-dumper/Caster/AmqpCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/AmqpCaster.php @@ -46,6 +46,9 @@ class AmqpCaster \AMQP_EX_TYPE_HEADERS => 'AMQP_EX_TYPE_HEADERS', ]; + /** + * @return array + */ public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -79,6 +82,9 @@ public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, return $a; } + /** + * @return array + */ public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -102,6 +108,9 @@ public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $ return $a; } + /** + * @return array + */ public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -125,6 +134,9 @@ public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNe return $a; } + /** + * @return array + */ public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -153,6 +165,9 @@ public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool return $a; } + /** + * @return array + */ public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, bool $isNested, int $filter = 0) { $prefix = Caster::PREFIX_VIRTUAL; diff --git a/app/vendor/symfony/var-dumper/Caster/Caster.php b/app/vendor/symfony/var-dumper/Caster/Caster.php index cd9b35f77..32c69ee04 100644 --- a/app/vendor/symfony/var-dumper/Caster/Caster.php +++ b/app/vendor/symfony/var-dumper/Caster/Caster.php @@ -36,6 +36,8 @@ class Caster public const PREFIX_VIRTUAL = "\0~\0"; public const PREFIX_DYNAMIC = "\0+\0"; public const PREFIX_PROTECTED = "\0*\0"; + // usage: sprintf(Caster::PATTERN_PRIVATE, $class, $property) + public const PATTERN_PRIVATE = "\0%s\0%s"; /** * Casts objects to arrays and adds the dynamic property prefix. @@ -115,7 +117,7 @@ public static function castObject(object $obj, string $class, bool $hasDebugInfo * @param array $a The array containing the properties to filter * @param int $filter A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out * @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set - * @param int &$count Set to the number of removed properties + * @param int|null &$count Set to the number of removed properties */ public static function filter(array $a, int $filter, array $listedProperties = [], ?int &$count = 0): array { diff --git a/app/vendor/symfony/var-dumper/Caster/ClassStub.php b/app/vendor/symfony/var-dumper/Caster/ClassStub.php index fb8377a03..86b44dd2a 100644 --- a/app/vendor/symfony/var-dumper/Caster/ClassStub.php +++ b/app/vendor/symfony/var-dumper/Caster/ClassStub.php @@ -56,9 +56,7 @@ public function __construct(string $identifier, callable|array|string $callable } if (str_contains($identifier, "@anonymous\0")) { - $this->value = $identifier = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $identifier); + $this->value = $identifier = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $identifier); } if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) { @@ -87,6 +85,9 @@ public function __construct(string $identifier, callable|array|string $callable } } + /** + * @return mixed + */ public static function wrapCallable(mixed $callable) { if (\is_object($callable) || !\is_callable($callable)) { diff --git a/app/vendor/symfony/var-dumper/Caster/DOMCaster.php b/app/vendor/symfony/var-dumper/Caster/DOMCaster.php index 8b770b8ae..d2d3fc129 100644 --- a/app/vendor/symfony/var-dumper/Caster/DOMCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/DOMCaster.php @@ -63,6 +63,9 @@ class DOMCaster \XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE', ]; + /** + * @return array + */ public static function castException(\DOMException $e, array $a, Stub $stub, bool $isNested) { $k = Caster::PREFIX_PROTECTED.'code'; @@ -73,6 +76,9 @@ public static function castException(\DOMException $e, array $a, Stub $stub, boo return $a; } + /** + * @return array + */ public static function castLength($dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -82,6 +88,9 @@ public static function castLength($dom, array $a, Stub $stub, bool $isNested) return $a; } + /** + * @return array + */ public static function castImplementation(\DOMImplementation $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -92,6 +101,9 @@ public static function castImplementation(\DOMImplementation $dom, array $a, Stu return $a; } + /** + * @return array + */ public static function castNode(\DOMNode $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -116,6 +128,9 @@ public static function castNode(\DOMNode $dom, array $a, Stub $stub, bool $isNes return $a; } + /** + * @return array + */ public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -132,6 +147,9 @@ public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub return $a; } + /** + * @return array + */ public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0) { $a += [ @@ -166,6 +184,9 @@ public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, boo return $a; } + /** + * @return array + */ public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -176,6 +197,9 @@ public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub return $a; } + /** + * @return array + */ public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -189,6 +213,9 @@ public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNes return $a; } + /** + * @return array + */ public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -199,6 +226,9 @@ public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool return $a; } + /** + * @return array + */ public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -208,6 +238,9 @@ public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNes return $a; } + /** + * @return array + */ public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -222,6 +255,9 @@ public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $s return $a; } + /** + * @return array + */ public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -232,6 +268,9 @@ public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, boo return $a; } + /** + * @return array + */ public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -246,6 +285,9 @@ public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $i return $a; } + /** + * @return array + */ public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, bool $isNested) { $a += [ @@ -256,6 +298,9 @@ public static function castProcessingInstruction(\DOMProcessingInstruction $dom, return $a; } + /** + * @return array + */ public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, bool $isNested) { $a += [ diff --git a/app/vendor/symfony/var-dumper/Caster/DateCaster.php b/app/vendor/symfony/var-dumper/Caster/DateCaster.php index 07e8c5ea8..a0cbddb76 100644 --- a/app/vendor/symfony/var-dumper/Caster/DateCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/DateCaster.php @@ -24,10 +24,13 @@ class DateCaster { private const PERIOD_LIMIT = 3; + /** + * @return array + */ public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, bool $isNested, int $filter) { $prefix = Caster::PREFIX_VIRTUAL; - $location = $d->getTimezone()->getLocation(); + $location = $d->getTimezone() ? $d->getTimezone()->getLocation() : null; $fromNow = (new \DateTimeImmutable())->diff($d); $title = $d->format('l, F j, Y') @@ -47,6 +50,9 @@ public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, return $a; } + /** + * @return array + */ public static function castInterval(\DateInterval $interval, array $a, Stub $stub, bool $isNested, int $filter) { $now = new \DateTimeImmutable('@0', new \DateTimeZone('UTC')); @@ -76,6 +82,9 @@ private static function formatInterval(\DateInterval $i): string return $i->format(rtrim($format)); } + /** + * @return array + */ public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, bool $isNested, int $filter) { $location = $timeZone->getLocation(); @@ -87,6 +96,9 @@ public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stu return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a; } + /** + * @return array + */ public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, bool $isNested, int $filter) { $dates = []; diff --git a/app/vendor/symfony/var-dumper/Caster/DoctrineCaster.php b/app/vendor/symfony/var-dumper/Caster/DoctrineCaster.php index 129b2cb47..3120c3d91 100644 --- a/app/vendor/symfony/var-dumper/Caster/DoctrineCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/DoctrineCaster.php @@ -25,6 +25,9 @@ */ class DoctrineCaster { + /** + * @return array + */ public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, bool $isNested) { foreach (['__cloner__', '__initializer__'] as $k) { @@ -37,6 +40,9 @@ public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, return $a; } + /** + * @return array + */ public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool $isNested) { foreach (['_entityPersister', '_identifier'] as $k) { @@ -49,6 +55,9 @@ public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool return $a; } + /** + * @return array + */ public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, bool $isNested) { foreach (['snapshot', 'association', 'typeClass'] as $k) { diff --git a/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php index 14caf71f3..02efb1b02 100644 --- a/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php @@ -11,6 +11,7 @@ namespace Symfony\Component\VarDumper\Caster; +use Symfony\Component\ErrorHandler\Exception\FlattenException; use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext; use Symfony\Component\VarDumper\Cloner\Stub; use Symfony\Component\VarDumper\Exception\ThrowingCasterException; @@ -46,16 +47,25 @@ class ExceptionCaster private static array $framesCache = []; + /** + * @return array + */ public static function castError(\Error $e, array $a, Stub $stub, bool $isNested, int $filter = 0) { return self::filterExceptionArray($stub->class, $a, "\0Error\0", $filter); } + /** + * @return array + */ public static function castException(\Exception $e, array $a, Stub $stub, bool $isNested, int $filter = 0) { return self::filterExceptionArray($stub->class, $a, "\0Exception\0", $filter); } + /** + * @return array + */ public static function castErrorException(\ErrorException $e, array $a, Stub $stub, bool $isNested) { if (isset($a[$s = Caster::PREFIX_PROTECTED.'severity'], self::$errorTypes[$a[$s]])) { @@ -65,6 +75,9 @@ public static function castErrorException(\ErrorException $e, array $a, Stub $st return $a; } + /** + * @return array + */ public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, bool $isNested) { $trace = Caster::PREFIX_VIRTUAL.'trace'; @@ -83,6 +96,9 @@ public static function castThrowingCasterException(ThrowingCasterException $e, a return $a; } + /** + * @return array + */ public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, bool $isNested) { $sPrefix = "\0".SilencedErrorContext::class."\0"; @@ -110,6 +126,9 @@ public static function castSilencedErrorContext(SilencedErrorContext $e, array $ return $a; } + /** + * @return array + */ public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, bool $isNested) { if (!$isNested) { @@ -184,6 +203,9 @@ public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, boo return $a; } + /** + * @return array + */ public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, bool $isNested) { if (!$isNested) { @@ -267,6 +289,19 @@ public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, boo return $a; } + /** + * @return array + */ + public static function castFlattenException(FlattenException $e, array $a, Stub $stub, bool $isNested) + { + if ($isNested) { + $k = sprintf(Caster::PATTERN_PRIVATE, FlattenException::class, 'traceAsString'); + $a[$k] = new CutStub($a[$k]); + } + + return $a; + } + private static function filterExceptionArray(string $xClass, array $a, string $xPrefix, int $filter): array { if (isset($a[$xPrefix.'trace'])) { @@ -285,12 +320,10 @@ private static function filterExceptionArray(string $xClass, array $a, string $x if (empty($a[$xPrefix.'previous'])) { unset($a[$xPrefix.'previous']); } - unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']); + unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message']); if (isset($a[Caster::PREFIX_PROTECTED.'message']) && str_contains($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) { - $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $a[Caster::PREFIX_PROTECTED.'message']); + $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $a[Caster::PREFIX_PROTECTED.'message']); } if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) { diff --git a/app/vendor/symfony/var-dumper/Caster/FiberCaster.php b/app/vendor/symfony/var-dumper/Caster/FiberCaster.php index c74a9e59c..b797dbd63 100644 --- a/app/vendor/symfony/var-dumper/Caster/FiberCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/FiberCaster.php @@ -20,6 +20,9 @@ */ final class FiberCaster { + /** + * @return array + */ public static function castFiber(\Fiber $fiber, array $a, Stub $stub, bool $isNested, int $filter = 0) { $prefix = Caster::PREFIX_VIRTUAL; diff --git a/app/vendor/symfony/var-dumper/Caster/IntlCaster.php b/app/vendor/symfony/var-dumper/Caster/IntlCaster.php index 1ed91d4d6..a4590f4b5 100644 --- a/app/vendor/symfony/var-dumper/Caster/IntlCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/IntlCaster.php @@ -21,6 +21,9 @@ */ class IntlCaster { + /** + * @return array + */ public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, bool $isNested) { $a += [ @@ -31,6 +34,9 @@ public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub return self::castError($c, $a); } + /** + * @return array + */ public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0) { $a += [ @@ -108,6 +114,9 @@ public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $ return self::castError($c, $a); } + /** + * @return array + */ public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, bool $isNested) { $a += [ @@ -125,6 +134,9 @@ public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, return self::castError($c, $a); } + /** + * @return array + */ public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, bool $isNested, int $filter = 0) { $a += [ @@ -142,6 +154,9 @@ public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, return self::castError($c, $a); } + /** + * @return array + */ public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0) { $a += [ diff --git a/app/vendor/symfony/var-dumper/Caster/LinkStub.php b/app/vendor/symfony/var-dumper/Caster/LinkStub.php index 4113e3a27..df95f8b0e 100644 --- a/app/vendor/symfony/var-dumper/Caster/LinkStub.php +++ b/app/vendor/symfony/var-dumper/Caster/LinkStub.php @@ -60,7 +60,7 @@ public function __construct(string $label, int $line = 0, string $href = null) } } - private function getComposerRoot(string $file, bool &$inVendor) + private function getComposerRoot(string $file, bool &$inVendor): string|false { if (!isset(self::$vendorRoots)) { self::$vendorRoots = []; diff --git a/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php b/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php index bc1fd63fa..2f161e8cb 100644 --- a/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php @@ -23,6 +23,9 @@ class MemcachedCaster private static array $optionConstants; private static array $defaultOptions; + /** + * @return array + */ public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $isNested) { $a += [ diff --git a/app/vendor/symfony/var-dumper/Caster/PdoCaster.php b/app/vendor/symfony/var-dumper/Caster/PdoCaster.php index 0372a6301..d68eae216 100644 --- a/app/vendor/symfony/var-dumper/Caster/PdoCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/PdoCaster.php @@ -59,6 +59,9 @@ class PdoCaster ], ]; + /** + * @return array + */ public static function castPdo(\PDO $c, array $a, Stub $stub, bool $isNested) { $attr = []; @@ -108,6 +111,9 @@ public static function castPdo(\PDO $c, array $a, Stub $stub, bool $isNested) return $a; } + /** + * @return array + */ public static function castPdoStatement(\PDOStatement $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; diff --git a/app/vendor/symfony/var-dumper/Caster/PgSqlCaster.php b/app/vendor/symfony/var-dumper/Caster/PgSqlCaster.php index d8e5b5253..0d8b3d919 100644 --- a/app/vendor/symfony/var-dumper/Caster/PgSqlCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/PgSqlCaster.php @@ -69,6 +69,9 @@ class PgSqlCaster 'function' => \PGSQL_DIAG_SOURCE_FUNCTION, ]; + /** + * @return array + */ public static function castLargeObject($lo, array $a, Stub $stub, bool $isNested) { $a['seek position'] = pg_lo_tell($lo); @@ -76,6 +79,9 @@ public static function castLargeObject($lo, array $a, Stub $stub, bool $isNested return $a; } + /** + * @return array + */ public static function castLink($link, array $a, Stub $stub, bool $isNested) { $a['status'] = pg_connection_status($link); @@ -108,6 +114,9 @@ public static function castLink($link, array $a, Stub $stub, bool $isNested) return $a; } + /** + * @return array + */ public static function castResult($result, array $a, Stub $stub, bool $isNested) { $a['num rows'] = pg_num_rows($result); diff --git a/app/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php b/app/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php index e7120191f..eb6c88db6 100644 --- a/app/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php @@ -21,6 +21,9 @@ */ class ProxyManagerCaster { + /** + * @return array + */ public static function castProxy(ProxyInterface $c, array $a, Stub $stub, bool $isNested) { if ($parent = get_parent_class($c)) { diff --git a/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php b/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php index 82b8c8aff..fcaa1b768 100644 --- a/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php @@ -31,6 +31,9 @@ */ class RdKafkaCaster { + /** + * @return array + */ public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -51,6 +54,9 @@ public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, return $a; } + /** + * @return array + */ public static function castTopic(Topic $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -62,6 +68,9 @@ public static function castTopic(Topic $c, array $a, Stub $stub, bool $isNested) return $a; } + /** + * @return array + */ public static function castTopicPartition(TopicPartition $c, array $a) { $prefix = Caster::PREFIX_VIRTUAL; @@ -75,6 +84,9 @@ public static function castTopicPartition(TopicPartition $c, array $a) return $a; } + /** + * @return array + */ public static function castMessage(Message $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -86,6 +98,9 @@ public static function castMessage(Message $c, array $a, Stub $stub, bool $isNes return $a; } + /** + * @return array + */ public static function castConf(Conf $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -97,6 +112,9 @@ public static function castConf(Conf $c, array $a, Stub $stub, bool $isNested) return $a; } + /** + * @return array + */ public static function castTopicConf(TopicConf $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -108,6 +126,9 @@ public static function castTopicConf(TopicConf $c, array $a, Stub $stub, bool $i return $a; } + /** + * @return array + */ public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -121,6 +142,9 @@ public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, bool $isNe return $a; } + /** + * @return array + */ public static function castCollectionMetadata(CollectionMetadata $c, array $a, Stub $stub, bool $isNested) { $a += iterator_to_array($c); @@ -128,6 +152,9 @@ public static function castCollectionMetadata(CollectionMetadata $c, array $a, S return $a; } + /** + * @return array + */ public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -140,6 +167,9 @@ public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, return $a; } + /** + * @return array + */ public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -153,6 +183,9 @@ public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stu return $a; } + /** + * @return array + */ public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -166,6 +199,9 @@ public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stu return $a; } + /** + * @return array + */ private static function extractMetadata(KafkaConsumer|\RdKafka $c) { $prefix = Caster::PREFIX_VIRTUAL; diff --git a/app/vendor/symfony/var-dumper/Caster/RedisCaster.php b/app/vendor/symfony/var-dumper/Caster/RedisCaster.php index eac25a12a..6ff046754 100644 --- a/app/vendor/symfony/var-dumper/Caster/RedisCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/RedisCaster.php @@ -11,6 +11,7 @@ namespace Symfony\Component\VarDumper\Caster; +use Relay\Relay; use Symfony\Component\VarDumper\Cloner\Stub; /** @@ -23,15 +24,15 @@ class RedisCaster { private const SERIALIZERS = [ - \Redis::SERIALIZER_NONE => 'NONE', - \Redis::SERIALIZER_PHP => 'PHP', + 0 => 'NONE', // Redis::SERIALIZER_NONE + 1 => 'PHP', // Redis::SERIALIZER_PHP 2 => 'IGBINARY', // Optional Redis::SERIALIZER_IGBINARY ]; private const MODES = [ - \Redis::ATOMIC => 'ATOMIC', - \Redis::MULTI => 'MULTI', - \Redis::PIPELINE => 'PIPELINE', + 0 => 'ATOMIC', // Redis::ATOMIC + 1 => 'MULTI', // Redis::MULTI + 2 => 'PIPELINE', // Redis::PIPELINE ]; private const COMPRESSION_MODES = [ @@ -46,7 +47,10 @@ class RedisCaster \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES => 'DISTRIBUTE_SLAVES', ]; - public static function castRedis(\Redis $c, array $a, Stub $stub, bool $isNested) + /** + * @return array + */ + public static function castRedis(\Redis|Relay $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -72,6 +76,9 @@ public static function castRedis(\Redis $c, array $a, Stub $stub, bool $isNested ]; } + /** + * @return array + */ public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -84,6 +91,9 @@ public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, bool ]; } + /** + * @return array + */ public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -102,9 +112,9 @@ public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, return $a; } - private static function getRedisOptions(\Redis|\RedisArray|\RedisCluster $redis, array $options = []): EnumStub + private static function getRedisOptions(\Redis|Relay|\RedisArray|\RedisCluster $redis, array $options = []): EnumStub { - $serializer = $redis->getOption(\Redis::OPT_SERIALIZER); + $serializer = $redis->getOption(\defined('Redis::OPT_SERIALIZER') ? \Redis::OPT_SERIALIZER : 1); if (\is_array($serializer)) { foreach ($serializer as &$v) { if (isset(self::SERIALIZERS[$v])) { @@ -136,11 +146,11 @@ private static function getRedisOptions(\Redis|\RedisArray|\RedisCluster $redis, } $options += [ - 'TCP_KEEPALIVE' => \defined('Redis::OPT_TCP_KEEPALIVE') ? $redis->getOption(\Redis::OPT_TCP_KEEPALIVE) : 0, - 'READ_TIMEOUT' => $redis->getOption(\Redis::OPT_READ_TIMEOUT), + 'TCP_KEEPALIVE' => \defined('Redis::OPT_TCP_KEEPALIVE') ? $redis->getOption(\Redis::OPT_TCP_KEEPALIVE) : Relay::OPT_TCP_KEEPALIVE, + 'READ_TIMEOUT' => $redis->getOption(\defined('Redis::OPT_READ_TIMEOUT') ? \Redis::OPT_READ_TIMEOUT : Relay::OPT_READ_TIMEOUT), 'COMPRESSION' => $compression, 'SERIALIZER' => $serializer, - 'PREFIX' => $redis->getOption(\Redis::OPT_PREFIX), + 'PREFIX' => $redis->getOption(\defined('Redis::OPT_PREFIX') ? \Redis::OPT_PREFIX : Relay::OPT_PREFIX), 'SCAN' => $retry, ]; diff --git a/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php index f6c8c7410..4adb9bc9f 100644 --- a/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php @@ -35,6 +35,9 @@ class ReflectionCaster 'isVariadic' => 'isVariadic', ]; + /** + * @return array + */ public static function castClosure(\Closure $c, array $a, Stub $stub, bool $isNested, int $filter = 0) { $prefix = Caster::PREFIX_VIRTUAL; @@ -71,6 +74,9 @@ public static function castClosure(\Closure $c, array $a, Stub $stub, bool $isNe return $a; } + /** + * @return array + */ public static function unsetClosureFileInfo(\Closure $c, array $a) { unset($a[Caster::PREFIX_VIRTUAL.'file'], $a[Caster::PREFIX_VIRTUAL.'line']); @@ -78,7 +84,7 @@ public static function unsetClosureFileInfo(\Closure $c, array $a) return $a; } - public static function castGenerator(\Generator $c, array $a, Stub $stub, bool $isNested) + public static function castGenerator(\Generator $c, array $a, Stub $stub, bool $isNested): array { // Cannot create ReflectionGenerator based on a terminated Generator try { @@ -92,6 +98,9 @@ public static function castGenerator(\Generator $c, array $a, Stub $stub, bool $ return self::castReflectionGenerator($reflectionGenerator, $a, $stub, $isNested); } + /** + * @return array + */ public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -114,6 +123,9 @@ public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $ return $a; } + /** + * @return array + */ public static function castAttribute(\ReflectionAttribute $c, array $a, Stub $stub, bool $isNested) { self::addMap($a, $c, [ @@ -124,6 +136,9 @@ public static function castAttribute(\ReflectionAttribute $c, array $a, Stub $st return $a; } + /** + * @return array + */ public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -159,6 +174,9 @@ public static function castReflectionGenerator(\ReflectionGenerator $c, array $a return $a; } + /** + * @return array + */ public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool $isNested, int $filter = 0) { $prefix = Caster::PREFIX_VIRTUAL; @@ -190,6 +208,9 @@ public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool return $a; } + /** + * @return array + */ public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, bool $isNested, int $filter = 0) { $prefix = Caster::PREFIX_VIRTUAL; @@ -248,6 +269,9 @@ public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, arra return $a; } + /** + * @return array + */ public static function castClassConstant(\ReflectionClassConstant $c, array $a, Stub $stub, bool $isNested) { $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); @@ -258,6 +282,9 @@ public static function castClassConstant(\ReflectionClassConstant $c, array $a, return $a; } + /** + * @return array + */ public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, bool $isNested) { $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); @@ -265,6 +292,9 @@ public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, bo return $a; } + /** + * @return array + */ public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -292,7 +322,7 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st if ($c->isOptional()) { try { $a[$prefix.'default'] = $v = $c->getDefaultValue(); - if ($c->isDefaultValueConstant()) { + if ($c->isDefaultValueConstant() && !\is_object($v)) { $a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v); } if (null === $v) { @@ -305,6 +335,9 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st return $a; } + /** + * @return array + */ public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, bool $isNested) { $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); @@ -315,6 +348,9 @@ public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub return $a; } + /** + * @return array + */ public static function castReference(\ReflectionReference $c, array $a, Stub $stub, bool $isNested) { $a[Caster::PREFIX_VIRTUAL.'id'] = $c->getId(); @@ -322,6 +358,9 @@ public static function castReference(\ReflectionReference $c, array $a, Stub $st return $a; } + /** + * @return array + */ public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, bool $isNested) { self::addMap($a, $c, [ @@ -338,6 +377,9 @@ public static function castExtension(\ReflectionExtension $c, array $a, Stub $st return $a; } + /** + * @return array + */ public static function castZendExtension(\ReflectionZendExtension $c, array $a, Stub $stub, bool $isNested) { self::addMap($a, $c, [ @@ -350,6 +392,9 @@ public static function castZendExtension(\ReflectionZendExtension $c, array $a, return $a; } + /** + * @return string + */ public static function getSignature(array $a) { $prefix = Caster::PREFIX_VIRTUAL; @@ -402,7 +447,7 @@ public static function getSignature(array $a) return $signature; } - private static function addExtra(array &$a, \Reflector $c) + private static function addExtra(array &$a, \Reflector $c): void { $x = isset($a[Caster::PREFIX_VIRTUAL.'extra']) ? $a[Caster::PREFIX_VIRTUAL.'extra']->value : []; @@ -418,7 +463,7 @@ private static function addExtra(array &$a, \Reflector $c) } } - private static function addMap(array &$a, object $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL) + private static function addMap(array &$a, object $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL): void { foreach ($map as $k => $m) { if ('isDisabled' === $k) { diff --git a/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php b/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php index 6db234e86..f3bbf3be4 100644 --- a/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php @@ -27,6 +27,9 @@ public static function castCurl(\CurlHandle $h, array $a, Stub $stub, bool $isNe return curl_getinfo($h); } + /** + * @return array + */ public static function castDba($dba, array $a, Stub $stub, bool $isNested) { $list = dba_list(); @@ -35,12 +38,15 @@ public static function castDba($dba, array $a, Stub $stub, bool $isNested) return $a; } + /** + * @return array + */ public static function castProcess($process, array $a, Stub $stub, bool $isNested) { return proc_get_status($process); } - public static function castStream($stream, array $a, Stub $stub, bool $isNested) + public static function castStream($stream, array $a, Stub $stub, bool $isNested): array { $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); if ($a['uri'] ?? false) { @@ -50,11 +56,17 @@ public static function castStream($stream, array $a, Stub $stub, bool $isNested) return $a; } + /** + * @return array + */ public static function castStreamContext($stream, array $a, Stub $stub, bool $isNested) { return @stream_context_get_params($stream) ?: $a; } + /** + * @return array + */ public static function castGd($gd, array $a, Stub $stub, bool $isNested) { $a['size'] = imagesx($gd).'x'.imagesy($gd); @@ -63,6 +75,9 @@ public static function castGd($gd, array $a, Stub $stub, bool $isNested) return $a; } + /** + * @return array + */ public static function castOpensslX509($h, array $a, Stub $stub, bool $isNested) { $stub->cut = -1; diff --git a/app/vendor/symfony/var-dumper/Caster/ScalarStub.php b/app/vendor/symfony/var-dumper/Caster/ScalarStub.php new file mode 100644 index 000000000..3bb1935b8 --- /dev/null +++ b/app/vendor/symfony/var-dumper/Caster/ScalarStub.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * Represents any arbitrary value. + * + * @author Alexandre Daubois + */ +class ScalarStub extends Stub +{ + public function __construct(mixed $value) + { + $this->value = $value; + } +} diff --git a/app/vendor/symfony/var-dumper/Caster/SplCaster.php b/app/vendor/symfony/var-dumper/Caster/SplCaster.php index 448afbad9..814d824d1 100644 --- a/app/vendor/symfony/var-dumper/Caster/SplCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/SplCaster.php @@ -29,16 +29,25 @@ class SplCaster \SplFileObject::READ_CSV => 'READ_CSV', ]; + /** + * @return array + */ public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, bool $isNested) { return self::castSplArray($c, $a, $stub, $isNested); } + /** + * @return array + */ public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, bool $isNested) { return self::castSplArray($c, $a, $stub, $isNested); } + /** + * @return array + */ public static function castHeap(\Iterator $c, array $a, Stub $stub, bool $isNested) { $a += [ @@ -48,6 +57,9 @@ public static function castHeap(\Iterator $c, array $a, Stub $stub, bool $isNest return $a; } + /** + * @return array + */ public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -63,6 +75,9 @@ public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, S return $a; } + /** + * @return array + */ public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool $isNested) { static $map = [ @@ -139,6 +154,9 @@ public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool return $a; } + /** + * @return array + */ public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, bool $isNested) { static $map = [ @@ -176,6 +194,9 @@ public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, b return $a; } + /** + * @return array + */ public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, bool $isNested) { $storage = []; @@ -184,10 +205,10 @@ public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $s $clone = clone $c; foreach ($clone as $obj) { - $storage[] = [ + $storage[] = new EnumStub([ 'object' => $obj, 'info' => $clone->getInfo(), - ]; + ]); } $a += [ @@ -197,6 +218,9 @@ public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $s return $a; } + /** + * @return array + */ public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub, bool $isNested) { $a[Caster::PREFIX_VIRTUAL.'innerIterator'] = $c->getInnerIterator(); @@ -204,6 +228,9 @@ public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub return $a; } + /** + * @return array + */ public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, bool $isNested) { $a[Caster::PREFIX_VIRTUAL.'object'] = $c->get(); @@ -211,6 +238,27 @@ public static function castWeakReference(\WeakReference $c, array $a, Stub $stub return $a; } + /** + * @return array + */ + public static function castWeakMap(\WeakMap $c, array $a, Stub $stub, bool $isNested) + { + $map = []; + + foreach (clone $c as $obj => $data) { + $map[] = new EnumStub([ + 'object' => $obj, + 'data' => $data, + ]); + } + + $a += [ + Caster::PREFIX_VIRTUAL.'map' => $map, + ]; + + return $a; + } + private static function castSplArray(\ArrayObject|\ArrayIterator $c, array $a, Stub $stub, bool $isNested): array { $prefix = Caster::PREFIX_VIRTUAL; @@ -221,7 +269,11 @@ private static function castSplArray(\ArrayObject|\ArrayIterator $c, array $a, S $a = Caster::castObject($c, $c::class, method_exists($c, '__debugInfo'), $stub->class); $c->setFlags($flags); } + + unset($a["\0ArrayObject\0storage"], $a["\0ArrayIterator\0storage"]); + $a += [ + $prefix.'storage' => $c->getArrayCopy(), $prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST), $prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS), ]; diff --git a/app/vendor/symfony/var-dumper/Caster/StubCaster.php b/app/vendor/symfony/var-dumper/Caster/StubCaster.php index 32ead7c27..4b93ff76f 100644 --- a/app/vendor/symfony/var-dumper/Caster/StubCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/StubCaster.php @@ -22,6 +22,9 @@ */ class StubCaster { + /** + * @return array + */ public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested) { if ($isNested) { @@ -43,11 +46,17 @@ public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested) return $a; } + /** + * @return array + */ public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, bool $isNested) { return $isNested ? $c->preservedSubset : $a; } + /** + * @return array + */ public static function cutInternals($obj, array $a, Stub $stub, bool $isNested) { if ($isNested) { @@ -59,6 +68,9 @@ public static function cutInternals($obj, array $a, Stub $stub, bool $isNested) return $a; } + /** + * @return array + */ public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $isNested) { if ($isNested) { @@ -81,4 +93,15 @@ public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $isNeste return $a; } + + /** + * @return array + */ + public static function castScalar(ScalarStub $scalarStub, array $a, Stub $stub) + { + $stub->type = Stub::TYPE_SCALAR; + $stub->attr['value'] = $scalarStub->value; + + return $a; + } } diff --git a/app/vendor/symfony/var-dumper/Caster/SymfonyCaster.php b/app/vendor/symfony/var-dumper/Caster/SymfonyCaster.php index f2ee0d62f..ebc00f90e 100644 --- a/app/vendor/symfony/var-dumper/Caster/SymfonyCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/SymfonyCaster.php @@ -31,6 +31,9 @@ class SymfonyCaster 'format' => 'getRequestFormat', ]; + /** + * @return array + */ public static function castRequest(Request $request, array $a, Stub $stub, bool $isNested) { $clone = null; @@ -46,6 +49,9 @@ public static function castRequest(Request $request, array $a, Stub $stub, bool return $a; } + /** + * @return array + */ public static function castHttpClient($client, array $a, Stub $stub, bool $isNested) { $multiKey = sprintf("\0%s\0multi", $client::class); @@ -56,6 +62,9 @@ public static function castHttpClient($client, array $a, Stub $stub, bool $isNes return $a; } + /** + * @return array + */ public static function castHttpClientResponse($response, array $a, Stub $stub, bool $isNested) { $stub->cut += \count($a); @@ -68,6 +77,9 @@ public static function castHttpClientResponse($response, array $a, Stub $stub, b return $a; } + /** + * @return array + */ public static function castLazyObjectState($state, array $a, Stub $stub, bool $isNested) { if (!$isNested) { @@ -76,14 +88,26 @@ public static function castLazyObjectState($state, array $a, Stub $stub, bool $i $stub->cut += \count($a) - 1; - return ['status' => new ConstStub(match ($a['status']) { + $instance = $a['realInstance'] ?? null; + + $a = ['status' => new ConstStub(match ($a['status']) { LazyObjectState::STATUS_INITIALIZED_FULL => 'INITIALIZED_FULL', LazyObjectState::STATUS_INITIALIZED_PARTIAL => 'INITIALIZED_PARTIAL', LazyObjectState::STATUS_UNINITIALIZED_FULL => 'UNINITIALIZED_FULL', LazyObjectState::STATUS_UNINITIALIZED_PARTIAL => 'UNINITIALIZED_PARTIAL', }, $a['status'])]; + + if ($instance) { + $a['realInstance'] = $instance; + --$stub->cut; + } + + return $a; } + /** + * @return array + */ public static function castUuid(Uuid $uuid, array $a, Stub $stub, bool $isNested) { $a[Caster::PREFIX_VIRTUAL.'toBase58'] = $uuid->toBase58(); @@ -97,6 +121,9 @@ public static function castUuid(Uuid $uuid, array $a, Stub $stub, bool $isNested return $a; } + /** + * @return array + */ public static function castUlid(Ulid $ulid, array $a, Stub $stub, bool $isNested) { $a[Caster::PREFIX_VIRTUAL.'toBase58'] = $ulid->toBase58(); diff --git a/app/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php b/app/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php index 506746b46..d802bbf2a 100644 --- a/app/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php @@ -43,6 +43,9 @@ class XmlReaderCaster \XMLReader::XML_DECLARATION => 'XML_DECLARATION', ]; + /** + * @return array + */ public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, bool $isNested) { try { diff --git a/app/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php b/app/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php index ba55fcedd..0cf42584a 100644 --- a/app/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php @@ -47,6 +47,9 @@ class XmlResourceCaster \XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING', ]; + /** + * @return array + */ public static function castXml($h, array $a, Stub $stub, bool $isNested) { $a['current_byte_index'] = xml_get_current_byte_index($h); diff --git a/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php index 6c3efdeb6..6a746b88e 100644 --- a/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +++ b/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php @@ -28,6 +28,7 @@ abstract class AbstractCloner implements ClonerInterface 'Symfony\Component\VarDumper\Caster\CutArrayStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castCutArray'], 'Symfony\Component\VarDumper\Caster\ConstStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castStub'], 'Symfony\Component\VarDumper\Caster\EnumStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castEnum'], + 'Symfony\Component\VarDumper\Caster\ScalarStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castScalar'], 'Fiber' => ['Symfony\Component\VarDumper\Caster\FiberCaster', 'castFiber'], @@ -94,6 +95,7 @@ abstract class AbstractCloner implements ClonerInterface 'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'], 'Symfony\Component\VarDumper\Caster\FrameStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'], 'Symfony\Component\VarDumper\Cloner\AbstractCloner' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], + 'Symfony\Component\ErrorHandler\Exception\FlattenException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFlattenException'], 'Symfony\Component\ErrorHandler\Exception\SilencedErrorContext' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castSilencedErrorContext'], 'Imagine\Image\ImageInterface' => ['Symfony\Component\VarDumper\Caster\ImagineCaster', 'castImage'], @@ -125,9 +127,11 @@ abstract class AbstractCloner implements ClonerInterface 'SplObjectStorage' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castObjectStorage'], 'SplPriorityQueue' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'], 'OuterIterator' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castOuterIterator'], + 'WeakMap' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castWeakMap'], 'WeakReference' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castWeakReference'], 'Redis' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'], + 'Relay\Relay' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'], 'RedisArray' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisArray'], 'RedisCluster' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisCluster'], @@ -229,6 +233,8 @@ public function __construct(array $casters = null) * see e.g. static::$defaultCasters. * * @param callable[] $casters A map of casters + * + * @return void */ public function addCasters(array $casters) { @@ -239,6 +245,8 @@ public function addCasters(array $casters) /** * Sets the maximum number of items to clone past the minimum depth in nested structures. + * + * @return void */ public function setMaxItems(int $maxItems) { @@ -247,6 +255,8 @@ public function setMaxItems(int $maxItems) /** * Sets the maximum cloned length for strings. + * + * @return void */ public function setMaxString(int $maxString) { @@ -256,6 +266,8 @@ public function setMaxString(int $maxString) /** * Sets the minimum tree depth where we are guaranteed to clone all the items. After this * depth is reached, only setMaxItems items will be cloned. + * + * @return void */ public function setMinDepth(int $minDepth) { diff --git a/app/vendor/symfony/var-dumper/Cloner/Data.php b/app/vendor/symfony/var-dumper/Cloner/Data.php index 6ecb883e8..928f72d7a 100644 --- a/app/vendor/symfony/var-dumper/Cloner/Data.php +++ b/app/vendor/symfony/var-dumper/Cloner/Data.php @@ -211,6 +211,11 @@ public function withContext(array $context): static return $data; } + public function getContext(): array + { + return $this->context; + } + /** * Seeks to a specific key in nested data structures. */ @@ -257,21 +262,21 @@ public function seek(string|int $key): ?static /** * Dumps data with a DumperInterface dumper. + * + * @return void */ public function dump(DumperInterface $dumper) { $refs = [0]; $cursor = new Cursor(); + $cursor->hashType = -1; + $cursor->attr = $this->context[SourceContextProvider::class] ?? []; + $label = $this->context['label'] ?? ''; - if ($cursor->attr = $this->context[SourceContextProvider::class] ?? []) { - $cursor->attr['if_links'] = true; - $cursor->hashType = -1; - $dumper->dumpScalar($cursor, 'default', '^'); - $cursor->attr = ['if_links' => true]; - $dumper->dumpScalar($cursor, 'default', ' '); - $cursor->hashType = 0; + if ($cursor->attr || '' !== $label) { + $dumper->dumpScalar($cursor, 'label', $label); } - + $cursor->hashType = 0; $this->dumpItem($dumper, $cursor, $refs, $this->data[$this->position][$this->key]); } @@ -280,7 +285,7 @@ public function dump(DumperInterface $dumper) * * @param mixed $item A Stub object or the original value being dumped */ - private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, mixed $item) + private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, mixed $item): void { $cursor->refIndex = 0; $cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0; @@ -362,6 +367,10 @@ private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, $dumper->leaveHash($cursor, $item->type, $item->class, $withChildren, $cut); break; + case Stub::TYPE_SCALAR: + $dumper->dumpScalar($cursor, 'default', $item->attr['value']); + break; + default: throw new \RuntimeException(sprintf('Unexpected Stub type: "%s".', $item->type)); } @@ -402,7 +411,7 @@ private function dumpChildren(DumperInterface $dumper, Cursor $parentCursor, arr return $hashCut; } - private function getStub(mixed $item) + private function getStub(mixed $item): mixed { if (!$item || !\is_array($item)) { return $item; diff --git a/app/vendor/symfony/var-dumper/Cloner/DumperInterface.php b/app/vendor/symfony/var-dumper/Cloner/DumperInterface.php index 61d02d240..4c5b315b6 100644 --- a/app/vendor/symfony/var-dumper/Cloner/DumperInterface.php +++ b/app/vendor/symfony/var-dumper/Cloner/DumperInterface.php @@ -20,6 +20,8 @@ interface DumperInterface { /** * Dumps a scalar value. + * + * @return void */ public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value); @@ -29,6 +31,8 @@ public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|n * @param string $str The string being dumped * @param bool $bin Whether $str is UTF-8 or binary encoded * @param int $cut The number of characters $str has been cut by + * + * @return void */ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut); @@ -38,6 +42,8 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut); * @param int $type A Cursor::HASH_* const for the type of hash * @param string|int|null $class The object class, resource type or array count * @param bool $hasChild When the dump of the hash has child item + * + * @return void */ public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild); @@ -48,6 +54,8 @@ public function enterHash(Cursor $cursor, int $type, string|int|null $class, boo * @param string|int|null $class The object class, resource type or array count * @param bool $hasChild When the dump of the hash has child item * @param int $cut The number of items the hash has been cut by + * + * @return void */ public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut); } diff --git a/app/vendor/symfony/var-dumper/Cloner/Stub.php b/app/vendor/symfony/var-dumper/Cloner/Stub.php index 1c5b88712..0c2a4b9d0 100644 --- a/app/vendor/symfony/var-dumper/Cloner/Stub.php +++ b/app/vendor/symfony/var-dumper/Cloner/Stub.php @@ -23,6 +23,7 @@ class Stub public const TYPE_ARRAY = 3; public const TYPE_OBJECT = 4; public const TYPE_RESOURCE = 5; + public const TYPE_SCALAR = 6; public const STRING_BINARY = 1; public const STRING_UTF8 = 2; diff --git a/app/vendor/symfony/var-dumper/Cloner/VarCloner.php b/app/vendor/symfony/var-dumper/Cloner/VarCloner.php index 4068c7c38..e168d0d3b 100644 --- a/app/vendor/symfony/var-dumper/Cloner/VarCloner.php +++ b/app/vendor/symfony/var-dumper/Cloner/VarCloner.php @@ -16,7 +16,6 @@ */ class VarCloner extends AbstractCloner { - private static string $gid; private static array $arrayCache = []; protected function doClone(mixed $var): array @@ -41,7 +40,6 @@ protected function doClone(mixed $var): array $stub = null; // Stub capturing the main properties of an original item value // or null if the original value is used directly - $gid = self::$gid ??= md5(random_bytes(6)); // Unique string used to detect the special $GLOBALS variable $arrayStub = new Stub(); $arrayStub->type = Stub::TYPE_ARRAY; $fromObjCast = false; diff --git a/app/vendor/symfony/var-dumper/Command/ServerDumpCommand.php b/app/vendor/symfony/var-dumper/Command/ServerDumpCommand.php index 1b06e694f..b64a884b9 100644 --- a/app/vendor/symfony/var-dumper/Command/ServerDumpCommand.php +++ b/app/vendor/symfony/var-dumper/Command/ServerDumpCommand.php @@ -54,7 +54,7 @@ public function __construct(DumpServer $server, array $descriptors = []) parent::__construct(); } - protected function configure() + protected function configure(): void { $this ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', implode(', ', $this->getAvailableFormats())), 'cli') diff --git a/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php index 2740b879e..053a90972 100644 --- a/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php @@ -155,6 +155,8 @@ public function dump(Data $data, $output = null): ?string * * @param int $depth The recursive depth in the dumped structure for the line being dumped, * or -1 to signal the end-of-dump to the line dumper callable + * + * @return void */ protected function dumpLine(int $depth) { @@ -164,6 +166,8 @@ protected function dumpLine(int $depth) /** * Generic line dumper callback. + * + * @return void */ protected function echoLine(string $line, int $depth, string $indentPad) { diff --git a/app/vendor/symfony/var-dumper/Dumper/CliDumper.php b/app/vendor/symfony/var-dumper/Dumper/CliDumper.php index c52ac4dbf..c155d4c79 100644 --- a/app/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/CliDumper.php @@ -51,6 +51,7 @@ class CliDumper extends AbstractDumper "\r" => '\r', "\033" => '\e', ]; + protected static $unicodeCharsRx = "/[\u{00A0}\u{00AD}\u{034F}\u{061C}\u{115F}\u{1160}\u{17B4}\u{17B5}\u{180E}\u{2000}-\u{200F}\u{202F}\u{205F}\u{2060}-\u{2064}\u{206A}-\u{206F}\u{3000}\u{2800}\u{3164}\u{FEFF}\u{FFA0}\u{1D159}\u{1D173}-\u{1D17A}]/u"; protected $collapseNextHash = false; protected $expandNextHash = false; @@ -85,6 +86,8 @@ public function __construct($output = null, string $charset = null, int $flags = /** * Enables/disables colored output. + * + * @return void */ public function setColors(bool $colors) { @@ -93,6 +96,8 @@ public function setColors(bool $colors) /** * Sets the maximum number of characters per line for dumped strings. + * + * @return void */ public function setMaxStringWidth(int $maxStringWidth) { @@ -103,6 +108,8 @@ public function setMaxStringWidth(int $maxStringWidth) * Configures styles. * * @param array $styles A map of style names to style definitions + * + * @return void */ public function setStyles(array $styles) { @@ -113,12 +120,17 @@ public function setStyles(array $styles) * Configures display options. * * @param array $displayOptions A map of display options to customize the behavior + * + * @return void */ public function setDisplayOptions(array $displayOptions) { $this->displayOptions = $displayOptions + $this->displayOptions; } + /** + * @return void + */ public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value) { $this->dumpKey($cursor); @@ -131,6 +143,11 @@ public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|n $style = 'default'; break; + case 'label': + $this->styles += ['label' => $this->styles['default']]; + $style = 'label'; + break; + case 'integer': $style = 'num'; @@ -174,6 +191,9 @@ public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|n $this->endValue($cursor); } + /** + * @return void + */ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) { $this->dumpKey($cursor); @@ -184,6 +204,9 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) } if ('' === $str) { $this->line .= '""'; + if ($cut) { + $this->line .= '…'.$cut; + } $this->endValue($cursor); } else { $attr += [ @@ -259,6 +282,9 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) } } + /** + * @return void + */ public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild) { $this->colors ??= $this->supportsColors(); @@ -295,6 +321,9 @@ public function enterHash(Cursor $cursor, int $type, string|int|null $class, boo } } + /** + * @return void + */ public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut) { if (empty($cursor->attr['cut_hash'])) { @@ -310,6 +339,8 @@ public function leaveHash(Cursor $cursor, int $type, string|int|null $class, boo * * @param bool $hasChild When the dump of the hash has child item * @param int $cut The number of items the hash has been cut by + * + * @return void */ protected function dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut) { @@ -326,6 +357,8 @@ protected function dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut) /** * Dumps a key in a hash structure. + * + * @return void */ protected function dumpKey(Cursor $cursor) { @@ -418,7 +451,8 @@ protected function style(string $style, string $value, array $attr = []): string $this->colors ??= $this->supportsColors(); $this->handlesHrefGracefully ??= 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100) + && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']); if (isset($attr['ellipsis'], $attr['ellipsis-type'])) { $prefix = substr($value, 0, -$attr['ellipsis']); @@ -450,7 +484,15 @@ protected function style(string $style, string $value, array $attr = []): string return $s.$endCchr; }, $value, -1, $cchrCount); - if ($this->colors) { + if (!($attr['binary'] ?? false)) { + $value = preg_replace_callback(static::$unicodeCharsRx, function ($c) use (&$cchrCount, $startCchr, $endCchr) { + ++$cchrCount; + + return $startCchr.'\u{'.strtoupper(dechex(mb_ord($c[0]))).'}'.$endCchr; + }, $value); + } + + if ($this->colors && '' !== $value) { if ($cchrCount && "\033" === $value[0]) { $value = substr($value, \strlen($startCchr)); } else { @@ -473,10 +515,15 @@ protected function style(string $style, string $value, array $attr = []): string } } if (isset($attr['href'])) { + if ('label' === $style) { + $value .= '^'; + } $value = "\033]8;;{$attr['href']}\033\\{$value}\033]8;;\033\\"; } - } elseif ($attr['if_links'] ?? false) { - return ''; + } + + if ('label' === $style && '' !== $value) { + $value .= ' '; } return $value; @@ -521,6 +568,9 @@ protected function supportsColors(): bool return static::$defaultColors = $this->hasColorSupport($h); } + /** + * @return void + */ protected function dumpLine(int $depth, bool $endOfValue = false) { if ($this->colors) { @@ -529,6 +579,9 @@ protected function dumpLine(int $depth, bool $endOfValue = false) parent::dumpLine($depth); } + /** + * @return void + */ protected function endValue(Cursor $cursor) { if (-1 === $cursor->hashType) { @@ -605,7 +658,7 @@ private function isWindowsTrueColor(): bool return $result; } - private function getSourceLink(string $file, int $line) + private function getSourceLink(string $file, int $line): string|false { if ($fmt = $this->displayOptions['fileLinkFormat']) { return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : ($fmt->format($file, $line) ?: 'file://'.$file.'#L'.$line); diff --git a/app/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php b/app/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php index d36e8bcf6..790285c97 100644 --- a/app/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php +++ b/app/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php @@ -44,7 +44,7 @@ public function getContext(): ?array $file = $trace[1]['file']; $line = $trace[1]['line']; - $name = false; + $name = '-' === $file || 'Standard input code' === $file ? 'Standard input code' : false; $fileExcerpt = false; for ($i = 2; $i < $this->limit; ++$i) { diff --git a/app/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php b/app/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php index 1ba803d81..84cfb4259 100644 --- a/app/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php @@ -31,13 +31,16 @@ public function __construct(DataDumperInterface $wrappedDumper, array $contextPr $this->contextProviders = $contextProviders; } + /** + * @return string|null + */ public function dump(Data $data) { - $context = []; + $context = $data->getContext(); foreach ($this->contextProviders as $contextProvider) { $context[$contextProvider::class] = $contextProvider->getContext(); } - $this->wrappedDumper->dump($data->withContext($context)); + return $this->wrappedDumper->dump($data->withContext($context)); } } diff --git a/app/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php b/app/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php index b173bccf3..df05b6af5 100644 --- a/app/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php +++ b/app/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php @@ -20,5 +20,8 @@ */ interface DataDumperInterface { + /** + * @return string|null + */ public function dump(Data $data); } diff --git a/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php index c818c919c..8a2570b2c 100644 --- a/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php @@ -82,12 +82,18 @@ public function __construct($output = null, string $charset = null, int $flags = $this->styles = static::$themes['dark'] ?? self::$themes['dark']; } + /** + * @return void + */ public function setStyles(array $styles) { $this->headerIsDumped = false; $this->styles = $styles + $this->styles; } + /** + * @return void + */ public function setTheme(string $themeName) { if (!isset(static::$themes[$themeName])) { @@ -101,6 +107,8 @@ public function setTheme(string $themeName) * Configures display options. * * @param array $displayOptions A map of display options to customize the behavior + * + * @return void */ public function setDisplayOptions(array $displayOptions) { @@ -110,6 +118,8 @@ public function setDisplayOptions(array $displayOptions) /** * Sets an HTML header that will be dumped once in the output stream. + * + * @return void */ public function setDumpHeader(?string $header) { @@ -118,6 +128,8 @@ public function setDumpHeader(?string $header) /** * Sets an HTML prefix and suffix that will encapse every single dump. + * + * @return void */ public function setDumpBoundaries(string $prefix, string $suffix) { @@ -136,6 +148,8 @@ public function dump(Data $data, $output = null, array $extraDisplayOptions = [] /** * Dumps the HTML header. + * + * @return string */ protected function getDumpHeader() { @@ -149,19 +163,15 @@ protected function getDumpHeader() '.$this->dumpHeader; } + /** + * @return void + */ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) { if ('' === $str && isset($cursor->attr['img-data'], $cursor->attr['content-type'])) { @@ -788,6 +802,9 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) } } + /** + * @return void + */ public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild) { if (Cursor::HASH_OBJECT === $type) { @@ -816,6 +833,9 @@ public function enterHash(Cursor $cursor, int $type, string|int|null $class, boo } } + /** + * @return void + */ public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut) { $this->dumpEllipsis($cursor, $hasChild, $cut); @@ -827,7 +847,7 @@ public function leaveHash(Cursor $cursor, int $type, string|int|null $class, boo protected function style(string $style, string $value, array $attr = []): string { - if ('' === $value) { + if ('' === $value && ('label' !== $style || !isset($attr['file']) && !isset($attr['href']))) { return ''; } @@ -862,7 +882,6 @@ protected function style(string $style, string $value, array $attr = []): string } elseif ('private' === $style) { $style .= sprintf(' title="Private property defined in class: `%s`"', esc($this->utf8Encode($attr['class']))); } - $map = static::$controlCharsMap; if (isset($attr['ellipsis'])) { $class = 'sf-dump-ellipsis'; @@ -881,6 +900,7 @@ protected function style(string $style, string $value, array $attr = []): string } } + $map = static::$controlCharsMap; $v = "".preg_replace_callback(static::$controlCharsRx, function ($c) use ($map) { $s = $b = '%s', esc($this->utf8Encode($attr['href'])), $target, $v); } if (isset($attr['lang'])) { $v = sprintf('%s', esc($attr['lang']), $v); } + if ('label' === $style) { + $v .= ' '; + } return $v; } + /** + * @return void + */ protected function dumpLine(int $depth, bool $endOfValue = false) { if (-1 === $this->lastDepth) { @@ -944,7 +979,7 @@ protected function dumpLine(int $depth, bool $endOfValue = false) AbstractDumper::dumpLine($depth); } - private function getSourceLink(string $file, int $line) + private function getSourceLink(string $file, int $line): string|false { $options = $this->extraDisplayOptions + $this->displayOptions; @@ -956,7 +991,7 @@ private function getSourceLink(string $file, int $line) } } -function esc(string $str) +function esc(string $str): string { return htmlspecialchars($str, \ENT_QUOTES, 'UTF-8'); } diff --git a/app/vendor/symfony/var-dumper/Dumper/ServerDumper.php b/app/vendor/symfony/var-dumper/Dumper/ServerDumper.php index f2c891b6a..98c214933 100644 --- a/app/vendor/symfony/var-dumper/Dumper/ServerDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/ServerDumper.php @@ -41,10 +41,15 @@ public function getContextProviders(): array return $this->connection->getContextProviders(); } + /** + * @return string|null + */ public function dump(Data $data) { if (!$this->connection->write($data) && $this->wrappedDumper) { - $this->wrappedDumper->dump($data); + return $this->wrappedDumper->dump($data); } + + return null; } } diff --git a/app/vendor/symfony/var-dumper/LICENSE b/app/vendor/symfony/var-dumper/LICENSE index 72412a62b..29f72d5e9 100644 --- a/app/vendor/symfony/var-dumper/LICENSE +++ b/app/vendor/symfony/var-dumper/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2023 Fabien Potencier +Copyright (c) 2014-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/symfony/var-dumper/Resources/functions/dump.php b/app/vendor/symfony/var-dumper/Resources/functions/dump.php index 6221a4d18..a0e5addff 100644 --- a/app/vendor/symfony/var-dumper/Resources/functions/dump.php +++ b/app/vendor/symfony/var-dumper/Resources/functions/dump.php @@ -9,40 +9,52 @@ * file that was distributed with this source code. */ +use Symfony\Component\VarDumper\Caster\ScalarStub; use Symfony\Component\VarDumper\VarDumper; if (!function_exists('dump')) { /** * @author Nicolas Grekas + * @author Alexandre Daubois */ - function dump(mixed $var, mixed ...$moreVars): mixed + function dump(mixed ...$vars): mixed { - VarDumper::dump($var); + if (!$vars) { + VarDumper::dump(new ScalarStub('🐛')); - foreach ($moreVars as $v) { - VarDumper::dump($v); + return null; } - if (1 < func_num_args()) { - return func_get_args(); + if (array_key_exists(0, $vars) && 1 === count($vars)) { + VarDumper::dump($vars[0]); + $k = 0; + } else { + foreach ($vars as $k => $v) { + VarDumper::dump($v, is_int($k) ? 1 + $k : $k); + } } - return $var; + if (1 < count($vars)) { + return $vars; + } + + return $vars[$k]; } } if (!function_exists('dd')) { - /** - * @return never - */ - function dd(...$vars): void + function dd(mixed ...$vars): never { if (!in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } - foreach ($vars as $v) { - VarDumper::dump($v); + if (array_key_exists(0, $vars) && 1 === count($vars)) { + VarDumper::dump($vars[0]); + } else { + foreach ($vars as $k => $v) { + VarDumper::dump($v, is_int($k) ? 1 + $k : $k); + } } exit(1); diff --git a/app/vendor/symfony/var-dumper/Server/Connection.php b/app/vendor/symfony/var-dumper/Server/Connection.php index 97b5b94f3..3c0f36864 100644 --- a/app/vendor/symfony/var-dumper/Server/Connection.php +++ b/app/vendor/symfony/var-dumper/Server/Connection.php @@ -62,7 +62,7 @@ public function write(Data $data): bool $context = array_filter($context); $encodedPayload = base64_encode(serialize([$data, $context]))."\n"; - set_error_handler([self::class, 'nullErrorHandler']); + set_error_handler(fn () => true); try { if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) { return true; @@ -82,16 +82,14 @@ public function write(Data $data): bool return false; } - private static function nullErrorHandler(int $t, string $m) - { - // no-op - } - + /** + * @return resource|null + */ private function createSocket() { - set_error_handler([self::class, 'nullErrorHandler']); + set_error_handler(fn () => true); try { - return stream_socket_client($this->host, $errno, $errstr, 3, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT); + return stream_socket_client($this->host, $errno, $errstr, 3) ?: null; } finally { restore_error_handler(); } diff --git a/app/vendor/symfony/var-dumper/VarDumper.php b/app/vendor/symfony/var-dumper/VarDumper.php index 840bfd649..2e1dad116 100644 --- a/app/vendor/symfony/var-dumper/VarDumper.php +++ b/app/vendor/symfony/var-dumper/VarDumper.php @@ -37,13 +37,19 @@ class VarDumper */ private static $handler; - public static function dump(mixed $var) + /** + * @param string|null $label + * + * @return mixed + */ + public static function dump(mixed $var/* , string $label = null */) { + $label = 2 <= \func_num_args() ? func_get_arg(1) : null; if (null === self::$handler) { self::register(); } - return (self::$handler)($var); + return (self::$handler)($var, $label); } public static function setHandler(callable $callable = null): ?callable @@ -90,8 +96,14 @@ private static function register(): void $dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]); } - self::$handler = function ($var) use ($cloner, $dumper) { - $dumper->dump($cloner->cloneVar($var)); + self::$handler = function ($var, string $label = null) use ($cloner, $dumper) { + $var = $cloner->cloneVar($var); + + if (null !== $label) { + $var = $var->withContext(['label' => $label]); + } + + $dumper->dump($var); }; } diff --git a/app/vendor/symfony/var-dumper/composer.json b/app/vendor/symfony/var-dumper/composer.json index 71ec64c0d..86383f22e 100644 --- a/app/vendor/symfony/var-dumper/composer.json +++ b/app/vendor/symfony/var-dumper/composer.json @@ -17,24 +17,20 @@ ], "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { "ext-iconv": "*", "symfony/console": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", "symfony/process": "^5.4|^6.0", "symfony/uid": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" }, "conflict": { - "phpunit/phpunit": "<5.4.3", "symfony/console": "<5.4" }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" - }, "autoload": { "files": [ "Resources/functions/dump.php" ], "psr-4": { "Symfony\\Component\\VarDumper\\": "" }, diff --git a/app/vendor/twig/markdown-extra/composer.json b/app/vendor/twig/markdown-extra/composer.json index f26143525..20389ff9b 100644 --- a/app/vendor/twig/markdown-extra/composer.json +++ b/app/vendor/twig/markdown-extra/composer.json @@ -30,10 +30,5 @@ "exclude-from-classmap": [ "/Tests/" ] - }, - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } } } diff --git a/app/vendor/twig/twig/CHANGELOG b/app/vendor/twig/twig/CHANGELOG index fd2c9c62e..b6551155c 100644 --- a/app/vendor/twig/twig/CHANGELOG +++ b/app/vendor/twig/twig/CHANGELOG @@ -1,3 +1,17 @@ +# 3.7.0 (2023-07-26) + + * Add support for the ...spread operator on arrays and hashes + +# 3.6.1 (2023-06-08) + + * Suppress some native return type deprecation messages + +# 3.6.0 (2023-05-03) + + * Allow psr/container 2.0 + * Add the new PHP 8.0 IntlDateFormatter::RELATIVE_* constants for date formatting + * Make the Lexer initialize itself lazily + # 3.5.1 (2023-02-08) * Arrow functions passed to the "reduce" filter now accept the current key as a third argument diff --git a/app/vendor/twig/twig/composer.json b/app/vendor/twig/twig/composer.json index 18d3135bb..aeea64053 100644 --- a/app/vendor/twig/twig/composer.json +++ b/app/vendor/twig/twig/composer.json @@ -30,7 +30,7 @@ }, "require-dev": { "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", - "psr/container": "^1.0" + "psr/container": "^1.0|^2.0" }, "autoload": { "psr-4" : { @@ -41,10 +41,5 @@ "psr-4" : { "Twig\\Tests\\" : "tests/" } - }, - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } } } diff --git a/app/vendor/twig/twig/src/Environment.php b/app/vendor/twig/twig/src/Environment.php index dd721b412..3c630c1b3 100644 --- a/app/vendor/twig/twig/src/Environment.php +++ b/app/vendor/twig/twig/src/Environment.php @@ -40,11 +40,11 @@ */ class Environment { - public const VERSION = '3.5.1'; - public const VERSION_ID = 30501; + public const VERSION = '3.7.0'; + public const VERSION_ID = 30700; public const MAJOR_VERSION = 3; - public const MINOR_VERSION = 5; - public const RELEASE_VERSION = 1; + public const MINOR_VERSION = 7; + public const RELEASE_VERSION = 0; public const EXTRA_VERSION = ''; private $charset; diff --git a/app/vendor/twig/twig/src/ExpressionParser.php b/app/vendor/twig/twig/src/ExpressionParser.php index 2048c3c54..38347cb39 100644 --- a/app/vendor/twig/twig/src/ExpressionParser.php +++ b/app/vendor/twig/twig/src/ExpressionParser.php @@ -334,7 +334,14 @@ public function parseArrayExpression() } $first = false; - $node->addElement($this->parseExpression()); + if ($stream->test(/* Token::SPREAD_TYPE */ 13)) { + $stream->next(); + $expr = $this->parseExpression(); + $expr->setAttribute('spread', true); + $node->addElement($expr); + } else { + $node->addElement($this->parseExpression()); + } } $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ']', 'An opened array is not properly closed'); @@ -359,6 +366,14 @@ public function parseHashExpression() } $first = false; + if ($stream->test(/* Token::SPREAD_TYPE */ 13)) { + $stream->next(); + $value = $this->parseExpression(); + $value->setAttribute('spread', true); + $node->addElement($value); + continue; + } + // a hash key can be: // // * a number -- 12 diff --git a/app/vendor/twig/twig/src/Extension/CoreExtension.php b/app/vendor/twig/twig/src/Extension/CoreExtension.php index f99adda45..0f1a10216 100644 --- a/app/vendor/twig/twig/src/Extension/CoreExtension.php +++ b/app/vendor/twig/twig/src/Extension/CoreExtension.php @@ -609,32 +609,34 @@ function twig_urlencode_filter($url) } /** - * Merges an array with another one. + * Merges any number of arrays or Traversable objects. * * {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %} * - * {% set items = items|merge({ 'peugeot': 'car' }) %} + * {% set items = items|merge({ 'peugeot': 'car' }, { 'banana': 'fruit' }) %} * - * {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #} + * {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'banana': 'fruit' } #} * - * @param array|\Traversable $arr1 An array - * @param array|\Traversable $arr2 An array + * @param array|\Traversable ...$arrays Any number of arrays or Traversable objects to merge * * @return array The merged array */ -function twig_array_merge($arr1, $arr2) +function twig_array_merge(...$arrays) { - if (!twig_test_iterable($arr1)) { - throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($arr1))); - } + $result = []; + + foreach ($arrays as $argNumber => $array) { + if (!twig_test_iterable($array)) { + throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" for argument %d.', \gettype($array), $argNumber + 1)); + } - if (!twig_test_iterable($arr2)) { - throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as second argument.', \gettype($arr2))); + $result = array_merge($result, twig_to_array($array)); } - return array_merge(twig_to_array($arr1), twig_to_array($arr2)); + return $result; } + /** * Slices a variable. * diff --git a/app/vendor/twig/twig/src/Lexer.php b/app/vendor/twig/twig/src/Lexer.php index 9ff028c87..6c45efbc9 100644 --- a/app/vendor/twig/twig/src/Lexer.php +++ b/app/vendor/twig/twig/src/Lexer.php @@ -19,6 +19,8 @@ */ class Lexer { + private $isInitialized = false; + private $tokens; private $code; private $cursor; @@ -61,6 +63,15 @@ public function __construct(Environment $env, array $options = []) 'whitespace_line_chars' => ' \t\0\x0B', 'interpolation' => ['#{', '}'], ], $options); + } + + private function initialize() + { + if ($this->isInitialized) { + return; + } + + $this->isInitialized = true; // when PHP 7.3 is the min version, we will be able to remove the '#' part in preg_quote as it's part of the default $this->regexes = [ @@ -153,6 +164,8 @@ public function __construct(Environment $env, array $options = []) public function tokenize(Source $source): TokenStream { + $this->initialize(); + $this->source = $source; $this->code = str_replace(["\r\n", "\r"], "\n", $source->getCode()); $this->cursor = 0; @@ -302,8 +315,13 @@ private function lexExpression(): void } } + // spread operator + if ('.' === $this->code[$this->cursor] && ($this->cursor + 2 < $this->end) && '.' === $this->code[$this->cursor + 1] && '.' === $this->code[$this->cursor + 2]) { + $this->pushToken(Token::SPREAD_TYPE, '...'); + $this->moveCursor('...'); + } // arrow function - if ('=' === $this->code[$this->cursor] && '>' === $this->code[$this->cursor + 1]) { + elseif ('=' === $this->code[$this->cursor] && '>' === $this->code[$this->cursor + 1]) { $this->pushToken(Token::ARROW_TYPE, '=>'); $this->moveCursor('=>'); } diff --git a/app/vendor/twig/twig/src/Node/Expression/ArrayExpression.php b/app/vendor/twig/twig/src/Node/Expression/ArrayExpression.php index 0e25fe46a..444283802 100644 --- a/app/vendor/twig/twig/src/Node/Expression/ArrayExpression.php +++ b/app/vendor/twig/twig/src/Node/Expression/ArrayExpression.php @@ -66,20 +66,70 @@ public function addElement(AbstractExpression $value, AbstractExpression $key = public function compile(Compiler $compiler): void { + $keyValuePairs = $this->getKeyValuePairs(); + $needsArrayMergeSpread = \PHP_VERSION_ID < 80100 && $this->hasSpreadItem($keyValuePairs); + + if ($needsArrayMergeSpread) { + $compiler->raw('twig_array_merge('); + } $compiler->raw('['); $first = true; - foreach ($this->getKeyValuePairs() as $pair) { + $reopenAfterMergeSpread = false; + $nextIndex = 0; + foreach ($keyValuePairs as $pair) { + if ($reopenAfterMergeSpread) { + $compiler->raw(', ['); + $reopenAfterMergeSpread = false; + } + + if ($needsArrayMergeSpread && $pair['value']->hasAttribute('spread')) { + $compiler->raw('], ')->subcompile($pair['value']); + $first = true; + $reopenAfterMergeSpread = true; + continue; + } if (!$first) { $compiler->raw(', '); } $first = false; - $compiler - ->subcompile($pair['key']) - ->raw(' => ') - ->subcompile($pair['value']) - ; + if ($pair['value']->hasAttribute('spread') && !$needsArrayMergeSpread) { + $compiler->raw('...')->subcompile($pair['value']); + ++$nextIndex; + } else { + $key = $pair['key'] instanceof ConstantExpression ? $pair['key']->getAttribute('value') : null; + + if ($nextIndex !== $key) { + if (\is_int($key)) { + $nextIndex = $key + 1; + } + $compiler + ->subcompile($pair['key']) + ->raw(' => ') + ; + } else { + ++$nextIndex; + } + + $compiler->subcompile($pair['value']); + } + } + if (!$reopenAfterMergeSpread) { + $compiler->raw(']'); } - $compiler->raw(']'); + if ($needsArrayMergeSpread) { + $compiler->raw(')'); + } + } + + private function hasSpreadItem(array $pairs): bool + { + foreach ($pairs as $pair) { + if ($pair['value']->hasAttribute('spread')) { + return true; + } + } + + return false; } } diff --git a/app/vendor/twig/twig/src/Token.php b/app/vendor/twig/twig/src/Token.php index 53a6cafc3..fd1a89d2a 100644 --- a/app/vendor/twig/twig/src/Token.php +++ b/app/vendor/twig/twig/src/Token.php @@ -35,6 +35,7 @@ final class Token public const INTERPOLATION_START_TYPE = 10; public const INTERPOLATION_END_TYPE = 11; public const ARROW_TYPE = 12; + public const SPREAD_TYPE = 13; public function __construct(int $type, $value, int $lineno) { @@ -133,6 +134,9 @@ public static function typeToString(int $type, bool $short = false): string case self::ARROW_TYPE: $name = 'ARROW_TYPE'; break; + case self::SPREAD_TYPE: + $name = 'SPREAD_TYPE'; + break; default: throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type)); } @@ -171,6 +175,8 @@ public static function typeToEnglish(int $type): string return 'end of string interpolation'; case self::ARROW_TYPE: return 'arrow function'; + case self::SPREAD_TYPE: + return 'spread operator'; default: throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type)); } diff --git a/app/vendor/twig/twig/src/TwigFilter.php b/app/vendor/twig/twig/src/TwigFilter.php index 94e5f9b01..e59919dd3 100644 --- a/app/vendor/twig/twig/src/TwigFilter.php +++ b/app/vendor/twig/twig/src/TwigFilter.php @@ -29,7 +29,7 @@ final class TwigFilter private $arguments = []; /** - * @param callable|null $callable A callable implementing the filter. If null, you need to overwrite the "node_class" option to customize compilation. + * @param callable|array|null $callable A callable implementing the filter. If null, you need to overwrite the "node_class" option to customize compilation. */ public function __construct(string $name, $callable = null, array $options = []) { @@ -57,7 +57,7 @@ public function getName(): string /** * Returns the callable to execute for this filter. * - * @return callable|null + * @return callable|array|null */ public function getCallable() { diff --git a/app/vendor/twig/twig/src/TwigFunction.php b/app/vendor/twig/twig/src/TwigFunction.php index 494d45b08..c10813224 100644 --- a/app/vendor/twig/twig/src/TwigFunction.php +++ b/app/vendor/twig/twig/src/TwigFunction.php @@ -29,7 +29,7 @@ final class TwigFunction private $arguments = []; /** - * @param callable|null $callable A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation. + * @param callable|array|null $callable A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation. */ public function __construct(string $name, $callable = null, array $options = []) { @@ -55,7 +55,7 @@ public function getName(): string /** * Returns the callable to execute for this function. * - * @return callable|null + * @return callable|array|null */ public function getCallable() { diff --git a/app/vendor/twig/twig/src/TwigTest.php b/app/vendor/twig/twig/src/TwigTest.php index 4c18632f5..7b81d9978 100644 --- a/app/vendor/twig/twig/src/TwigTest.php +++ b/app/vendor/twig/twig/src/TwigTest.php @@ -28,7 +28,7 @@ final class TwigTest private $arguments = []; /** - * @param callable|null $callable A callable implementing the test. If null, you need to overwrite the "node_class" option to customize compilation. + * @param callable|array|null $callable A callable implementing the test. If null, you need to overwrite the "node_class" option to customize compilation. */ public function __construct(string $name, $callable = null, array $options = []) { @@ -51,7 +51,7 @@ public function getName(): string /** * Returns the callable to execute for this test. * - * @return callable|null + * @return callable|array|null */ public function getCallable() {