diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000000..17e514f9588 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,22 @@ +name: lint + +on: [push, pull_request] + +jobs: + phpcs: + runs-on: ubuntu-latest + name: PHP_CodeSniffer + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + tools: cs2pr + + - name: Install dependencies + run: composer install --prefer-dist + + - name: Run phpcs + run: vendor/bin/phpcs -q --report=checkstyle framework/ | cs2pr diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 0350dff093c..00000000000 --- a/.php_cs +++ /dev/null @@ -1,27 +0,0 @@ -setCacheFile(__DIR__ . '/tests/runtime/php_cs.cache') - ->mergeRules([ - 'braces' => [ - 'allow_single_line_closure' => true, - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__) - ->exclude('docs') - ->exclude('apps') - ->exclude('extensions') - // requirement checker should work even on PHP 4.3, so it needs special treatment - ->exclude('framework/requirements') - ->notPath('framework/classes.php') - ->notPath('framework/helpers/mimeTypes.php') - ->notPath('framework/views/messageConfig.php') - ); diff --git a/composer.json b/composer.json index d362dc15cc5..37a21f8ce9b 100644 --- a/composer.json +++ b/composer.json @@ -84,7 +84,8 @@ "dms/phpunit-arraysubset-asserts": "^0.5", "phpunit/phpunit": "^9.6", "cebe/indent": "~1.0.2", - "friendsofphp/php-cs-fixer": "^3.0" + "dealerdirect/phpcodesniffer-composer-installer": "*", + "yiisoft/yii2-coding-standards": "^3.0" }, "repositories": [ { @@ -102,14 +103,14 @@ }, "autoload-dev": { "psr-4": { - "yii\\cs\\": "cs/src/", "yii\\build\\": "build/", "yiiunit\\": "tests/" } }, "config": { "allow-plugins": { - "yiisoft/yii2-composer": true + "yiisoft/yii2-composer": true, + "dealerdirect/phpcodesniffer-composer-installer": true } }, "bin": [ diff --git a/composer.lock b/composer.lock index 51c8363b94d..e5d5f186df3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9ee35a67e578251573a9017059b62b76", + "content-hash": "7269257cc9e1f2b37d4e30c637bb226b", "packages": [ { "name": "bower-asset/inputmask", @@ -29,16 +29,16 @@ }, { "name": "bower-asset/jquery", - "version": "3.6.4", + "version": "3.7.1", "source": { "type": "git", - "url": "git@github.com:jquery/jquery-dist.git", - "reference": "91ef2d8836342875f2519b5815197ea0f23613cf" + "url": "https://github.com/jquery/jquery-dist.git", + "reference": "fde1f76e2799dd877c176abde0ec836553246991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/91ef2d8836342875f2519b5815197ea0f23613cf", - "reference": "91ef2d8836342875f2519b5815197ea0f23613cf" + "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/fde1f76e2799dd877c176abde0ec836553246991", + "reference": "fde1f76e2799dd877c176abde0ec836553246991" }, "type": "bower-asset", "license": [ @@ -47,16 +47,16 @@ }, { "name": "bower-asset/punycode", - "version": "v2.2.3", + "version": "v2.3.1", "source": { "type": "git", "url": "https://github.com/mathiasbynens/punycode.js.git", - "reference": "46d412120e2feb868876769a9847790ba278c882" + "reference": "9e1b2cda98d215d3a73fcbfe93c62e021f4ba768" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mathiasbynens/punycode.js/zipball/46d412120e2feb868876769a9847790ba278c882", - "reference": "46d412120e2feb868876769a9847790ba278c882" + "url": "https://api.github.com/repos/mathiasbynens/punycode.js/zipball/9e1b2cda98d215d3a73fcbfe93c62e021f4ba768", + "reference": "9e1b2cda98d215d3a73fcbfe93c62e021f4ba768" }, "type": "bower-asset" }, @@ -322,106 +322,39 @@ "time": "2014-05-23T14:40:08+00:00" }, { - "name": "composer/pcre", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.1" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-10-11T07:11:09+00:00" - }, - { - "name": "composer/semver", - "version": "3.4.0", + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "4be43904336affa5c2f70744a348312336afd0da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", + "reference": "4be43904336affa5c2f70744a348312336afd0da", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "composer/composer": "*", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" }, - "type": "library", + "type": "composer-plugin", "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "autoload": { "psr-4": { - "Composer\\Semver\\": "src" + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -430,114 +363,41 @@ ], "authors": [ { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" }, { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-08-31T09:50:34+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" } ], - "description": "Restarts a process without Xdebug.", + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", "keywords": [ - "Xdebug", - "performance" + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" ], "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2023-01-05T11:28:13+00:00" }, { "name": "dms/phpunit-arraysubset-asserts", @@ -581,54 +441,7 @@ "issues": "https://github.com/rdohms/phpunit-arraysubset-asserts/issues", "source": "https://github.com/rdohms/phpunit-arraysubset-asserts/tree/v0.5.0" }, - "time": "2023-02-01T09:20:38+00:00" - }, - { - "name": "doctrine/deprecations", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", - "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "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" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.2" - }, - "time": "2023-09-27T20:04:15+00:00" + "time": "2023-06-02T17:33:53+00:00" }, { "name": "doctrine/instantiator", @@ -700,99 +513,6 @@ ], "time": "2022-12-30T00:23:10+00:00" }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.35.1", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "ec1ccc264994b6764882669973ca435cf05bab08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ec1ccc264994b6764882669973ca435cf05bab08", - "reference": "ec1ccc264994b6764882669973ca435cf05bab08", - "shasum": "" - }, - "require": { - "composer/semver": "^3.3", - "composer/xdebug-handler": "^3.0.3", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.27", - "symfony/polyfill-php80": "^1.27", - "symfony/polyfill-php81": "^1.27", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" - }, - "require-dev": { - "facile-it/paraunit": "^1.3 || ^2.0", - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^2.0", - "mikey179/vfsstream": "^1.6.11", - "php-coveralls/php-coveralls": "^2.5.3", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.16", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "symfony/phpunit-bridge": "^6.2.3", - "symfony/yaml": "^5.4 || ^6.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz RumiƄski", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "keywords": [ - "Static code analysis", - "fixer", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.35.1" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2023-10-12T13:47:26+00:00" - }, { "name": "myclabs/deep-copy", "version": "1.11.1", @@ -854,25 +574,27 @@ }, { "name": "nikic/php-parser", - "version": "v4.17.1", + "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -880,7 +602,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -904,26 +626,27 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" }, - "time": "2023-08-13T19:53:39+00:00" + "time": "2024-03-05T20:51:40+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -964,9 +687,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -1021,23 +750,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.29", + "version": "9.2.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1087,7 +816,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" }, "funding": [ { @@ -1095,7 +824,7 @@ "type": "github" } ], - "time": "2023-09-19T04:57:46+00:00" + "time": "2024-03-02T06:37:42+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1340,16 +1069,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.13", + "version": "9.6.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1a156980d78a6666721b7e8e8502fe210b587fcd", + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd", "shasum": "" }, "require": { @@ -1423,7 +1152,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.17" }, "funding": [ { @@ -1439,272 +1168,119 @@ "type": "tidelift" } ], - "time": "2023-09-19T05:39:22+00:00" + "time": "2024-02-23T13:14:51+00:00" }, { - "name": "psr/container", - "version": "2.0.2", + "name": "sebastian/cli-parser", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, - "time": "2021-11-05T16:47:00+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" }, { - "name": "psr/event-dispatcher", - "version": "1.0.0", + "name": "sebastian/code-unit", + "version": "1.0.8", "source": { "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" }, - "time": "2019-01-08T18:20:26+00:00" - }, - { - "name": "psr/log", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" - }, - "time": "2021-07-14T16:46:02+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:08:49+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1837,20 +1413,20 @@ }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -1882,7 +1458,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, "funding": [ { @@ -1890,20 +1466,20 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { @@ -1948,7 +1524,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -1956,7 +1532,7 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", @@ -2023,16 +1599,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { @@ -2088,7 +1664,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { @@ -2096,20 +1672,20 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.6", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { @@ -2152,7 +1728,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { @@ -2160,24 +1736,24 @@ "type": "github" } ], - "time": "2023-08-02T09:26:13+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -2209,7 +1785,7 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, "funding": [ { @@ -2217,7 +1793,7 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-12-22T06:20:34+00:00" }, { "name": "sebastian/object-enumerator", @@ -2396,16 +1972,16 @@ }, { "name": "sebastian/resource-operations", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { @@ -2417,7 +1993,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2438,8 +2014,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -2447,7 +2022,7 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", @@ -2559,1344 +2134,220 @@ "time": "2020-09-28T06:39:44+00:00" }, { - "name": "symfony/console", - "version": "v6.3.8", + "name": "squizlabs/php_codesniffer", + "version": "3.9.0", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "0d14a9f6d04d4ac38a8cea1171f4554e325dae92" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0d14a9f6d04d4ac38a8cea1171f4554e325dae92", - "reference": "0d14a9f6d04d4ac38a8cea1171f4554e325dae92", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" }, "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ - "cli", - "command-line", - "console", - "terminal" + "phpcs", + "standards", + "static analysis" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.8" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" + "url": "https://github.com/PHPCSStandards", + "type": "github" }, { - "url": "https://github.com/fabpot", + "url": "https://github.com/jrfnl", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" } ], - "time": "2023-10-31T08:09:35+00:00" + "time": "2024-02-16T15:06:51+00:00" }, { - "name": "symfony/deprecation-contracts", - "version": "v3.4.0", + "name": "theseer/tokenizer", + "version": "1.2.3", "source": { "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { - "php": ">=8.1" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, "autoload": { - "files": [ - "function.php" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" } ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/theseer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v6.3.2", + "name": "yiisoft/yii2-coding-standards", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e" + "url": "https://github.com/yiisoft/yii2-coding-standards.git", + "reference": "8bc39acaae848aec1ad52b2af4cf380e3f0b104e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/adb01fe097a4ee930db9258a3cc906b5beb5cf2e", - "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e", + "url": "https://api.github.com/repos/yiisoft/yii2-coding-standards/zipball/8bc39acaae848aec1ad52b2af4cf380e3f0b104e", + "reference": "8bc39acaae848aec1ad52b2af4cf380e3f0b104e", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2.5|^3" + "php": ">=5.4.0", + "squizlabs/php_codesniffer": ">=3.2" }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/service-contracts": "<2.5" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^5.4|^6.0" - }, - "type": "library", + "type": "phpcodesniffer-standard", "autoload": { "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "yii\\console\\controllers\\": "src/console/controllers/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Qiang Xue", + "email": "qiang.xue@gmail.com", + "homepage": "https://www.yiiframework.com/", + "role": "Founder and project lead" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" + "name": "Alexander Makarov", + "email": "sam@rmcreative.ru", + "homepage": "https://rmcreative.ru/", + "role": "Core framework development" }, { - "url": "https://github.com/fabpot", - "type": "github" + "name": "Maurizio Domba", + "homepage": "https://mdomba.info/", + "role": "Core framework development" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-06T06:56:43+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v3.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/event-dispatcher": "^1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" + "name": "Carsten Brandt", + "email": "mail@cebe.cc", + "homepage": "https://cebe.cc/", + "role": "Core framework development" }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Timur Ruziev", + "email": "resurtm@gmail.com", + "homepage": "https://resurtm.com/", + "role": "Core framework development" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Paul Klimov", + "email": "klimov.paul@gmail.com", + "role": "Core framework development" } ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", + "description": "Yii PHP Framework Version 2 - Coding standard tools", + "homepage": "https://www.yiiframework.com/", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "codesniffer", + "framework", + "yii" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0" + "forum": "https://www.yiiframework.com/forum/", + "irc": "ircs://irc.libera.chat:6697/yii", + "issues": "https://github.com/yiisoft/yii2/issues?state=open", + "source": "https://github.com/yiisoft/yii2", + "wiki": "https://www.yiiframework.com/wiki/" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-05-23T14:45:45+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v6.3.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", - "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.3.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-06-01T08:30:39+00:00" - }, - { - "name": "symfony/finder", - "version": "v6.3.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a1b31d88c0e998168ca7792f222cbecee47428c4", - "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "require-dev": { - "symfony/filesystem": "^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v6.3.5" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-09-26T12:56:25+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v6.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd", - "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.3.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-05-12T14:21:09+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-28T09:04:16+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/process", - "version": "v6.3.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54", - "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v6.3.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-08-07T10:39:22+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838", - "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-30T20:28:31+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v6.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/service-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.3.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-02-16T10:14:28+00:00" - }, - { - "name": "symfony/string", - "version": "v6.3.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "13880a87790c76ef994c91e87efb96134522577a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/13880a87790c76ef994c91e87efb96134522577a", - "reference": "13880a87790c76ef994c91e87efb96134522577a", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v6.3.8" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-11-09T08:28:21+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" + "url": "https://opencollective.com/yiisoft", + "type": "open_collective" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2024-03-15T12:57:48+00:00" } ], "aliases": [], diff --git a/cs/TODO.md b/cs/TODO.md deleted file mode 100644 index 79862057096..00000000000 --- a/cs/TODO.md +++ /dev/null @@ -1 +0,0 @@ -This should be moved to separate package, like `yii\yii2-cs`. diff --git a/cs/src/YiiConfig.php b/cs/src/YiiConfig.php deleted file mode 100644 index 582ab283bf0..00000000000 --- a/cs/src/YiiConfig.php +++ /dev/null @@ -1,172 +0,0 @@ - - * @since 2.0.0 - */ -class YiiConfig extends Config -{ - /** - * {@inheritdoc} - */ - public function __construct($name = 'yii-cs-config') - { - parent::__construct($name); - - $this->setRiskyAllowed(true); - - $this->setRules([ - '@PSR2' => true, - 'array_syntax' => [ - 'syntax' => 'short', - ], - 'binary_operator_spaces' => [ - 'align_double_arrow' => false, - 'align_equals' => false, - ], - 'blank_line_after_opening_tag' => true, - 'cast_spaces' => true, - 'concat_space' => [ - 'spacing' => 'one', - ], - 'dir_constant' => true, - 'ereg_to_preg' => true, - 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, - 'include' => true, - 'heredoc_to_nowdoc' => true, - 'is_null' => [ - 'use_yoda_style' => false, - ], - 'linebreak_after_opening_tag' => true, - 'lowercase_cast' => true, - 'magic_constant_casing' => true, -// 'mb_str_functions' => true, // needs more discussion -// 'method_separation' => true, // conflicts with current Yii style with double line between properties and methods - 'modernize_types_casting' => true, - 'native_function_casing' => true, - 'new_with_braces' => true, - 'no_alias_functions' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_consecutive_blank_lines' => [ - 'tokens' => [ - 'break', - 'continue', -// 'extra', // conflicts with current Yii style with double line between properties and methods - 'return', - 'throw', - 'use', - 'use_trait', -// 'curly_brace_block', // breaks namespaces blocks - 'parenthesis_brace_block', - 'square_brace_block', - ], - ], - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_around_offset' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, -// 'ordered_class_elements' => [ // needs more discussion -// 'order' => [ -// 'use_trait', -// 'constant_public', -// 'constant_protected', -// 'constant_private', -// 'property_public', -// 'property_protected', -// 'property_private', -// 'construct', -// 'destruct', -// 'magic', -// ], -// ], - 'ordered_imports' => [ - 'sortAlgorithm' => 'alpha', - 'importsOrder' => [ - 'const', - 'function', - 'class', - ], - ], - 'php_unit_construct' => true, - 'php_unit_dedicate_assert' => true, - 'php_unit_fqcn_annotation' => true, -// 'php_unit_strict' => true, // needs more attention - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_indent' => true, -// 'phpdoc_inline_tag' => true, // see https://github.com/yiisoft/yii2/issues/11635 - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, -// 'phpdoc_order', // may be useful, but should be configurable: https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/1602 - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_summary' => true, -// 'phpdoc_to_comment' => true, // breaks phpdoc for define('CONSTANT', $value); - 'phpdoc_trim' => true, - 'phpdoc_types' => true, - 'phpdoc_var_without_name' => true, - 'protected_to_private' => true, - 'psr4' => true, - 'self_accessor' => true, - 'short_scalar_cast' => true, - 'single_blank_line_before_namespace' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - ]); - } - - /** - * Merge current rules' config with provided list of rules. - * - * @param array $rules - * @return $this - * @see setRules() - * @see ArrayHelper::merge() - */ - public function mergeRules(array $rules) - { - $this->setRules(ArrayHelper::merge($this->getRules(), $rules)); - - return $this; - } -} diff --git a/cs/src/YiisoftConfig.php b/cs/src/YiisoftConfig.php deleted file mode 100644 index 16dc6d6f871..00000000000 --- a/cs/src/YiisoftConfig.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @since 2.0.0 - */ -final class YiisoftConfig extends YiiConfig -{ - /** - * {@inheritdoc} - */ - public function __construct() - { - parent::__construct('yiisoft-cs-config'); - - $header = <<<'HEADER' -@link https://www.yiiframework.com/ -@copyright Copyright (c) 2008 Yii Software LLC -@license https://www.yiiframework.com/license/ -HEADER; - - $this->mergeRules([ - 'header_comment' => [ - 'header' => $header, - 'commentType' => 'PHPDoc', - 'separate' => 'bottom', - ], - ]); - } -} diff --git a/docs/guide-pt-BR/start-installation.md b/docs/guide-pt-BR/start-installation.md index a5228fb9b6d..1fcc2d07c4b 100644 --- a/docs/guide-pt-BR/start-installation.md +++ b/docs/guide-pt-BR/start-installation.md @@ -49,7 +49,7 @@ VocĂȘ pode atualizar o Composer executando o comando `composer self-update`. > A quantidade de solicitaçÔes depende do nĂșmero de dependĂȘncias que sua aplicação possui e pode extrapolar a > **taxa limite da API do Github**. Se vocĂȘ atingir esse limite, o Composer pode pedir a vocĂȘ suas credenciais de login para obter um > token de acesso Ă  API Github. Em conexĂ”es rĂĄpidas vocĂȘ pode atingir esse limite antes que o Composer consiga lidar com a situação, entĂŁo, recomendamos -> configurar um toke de acesso antes de instalar o Yii. +> configurar um token de acesso antes de instalar o Yii. > Por favor, consulte a [documentação do Composer sobre tokens da API Github](https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens) > para instruçÔes de como fazer isso. diff --git a/docs/guide/db-active-record.md b/docs/guide/db-active-record.md index 59537336c5c..f1f53ecbd0f 100644 --- a/docs/guide/db-active-record.md +++ b/docs/guide/db-active-record.md @@ -648,6 +648,17 @@ life cycle will happen: > - [[yii\db\ActiveRecord::updateCounters()]] > - [[yii\db\ActiveRecord::updateAllCounters()]] +> Note: DI is not supported by default due to performance concerns. You can add support if needed by overriding +> the [[yii\db\ActiveRecord::instantiate()|instantiate()]] method to instantiate the class via [[Yii::createObject()]]: +> +> ```php +> public static function instantiate($row) +> { +> return Yii::createObject(static::class); +> } +> ``` + + ### Refreshing Data Life Cycle When calling [[yii\db\ActiveRecord::refresh()|refresh()]] to refresh an Active Record instance, the diff --git a/docs/guide/input-tabular-input.md b/docs/guide/input-tabular-input.md index 44c9ffea1d5..f5aa95b57af 100644 --- a/docs/guide/input-tabular-input.md +++ b/docs/guide/input-tabular-input.md @@ -1,4 +1,4 @@ -Collecting tabular input +Collecting Tabular Input ======================== Sometimes you need to handle multiple models of the same kind in a single form. For example, multiple settings, where diff --git a/framework/BaseYii.php b/framework/BaseYii.php index c34360bebcb..12a5dd4268c 100644 --- a/framework/BaseYii.php +++ b/framework/BaseYii.php @@ -1,4 +1,5 @@ * @since 2.0 + * @phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols + * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace */ class Yii extends \yii\BaseYii { diff --git a/framework/assets/yii.activeForm.js b/framework/assets/yii.activeForm.js index 5b9ce4aaec2..045cfebcaa1 100644 --- a/framework/assets/yii.activeForm.js +++ b/framework/assets/yii.activeForm.js @@ -330,7 +330,7 @@ this.$form = $form; var $input = findInput($form, this); - var disabled = $input.toArray().reduce(function(result, next) { + var disabled = $input.toArray().reduce(function (result, next) { return result && $(next).is(':disabled'); }, true); if (disabled) { @@ -733,8 +733,7 @@ var errorAttributes = [], $input; $.each(data.attributes, function () { - var hasError = (submitting && updateInput($form, this, messages)) || (!submitting && attrHasError($form, - this, messages)); + var hasError = (submitting && updateInput($form, this, messages)) || (!submitting && attrHasError($form, this, messages)); $input = findInput($form, this); if (!$input.is(':disabled') && !this.cancelled && hasError) { diff --git a/framework/assets/yii.gridView.js b/framework/assets/yii.gridView.js index f02d4d95e94..cdcb3731960 100644 --- a/framework/assets/yii.gridView.js +++ b/framework/assets/yii.gridView.js @@ -198,7 +198,7 @@ $grid.find(checkAllInput + (all ? ":not(:checked)" : ":checked")).prop('checked', all).change(); }; initEventHandler($grid, 'checkRow', 'click.yiiGridView', "#" + id + " " + inputs, handler); - if($grid.find(inputs).length) { + if ($grid.find(inputs).length) { handler(); // Ensure "check all" checkbox is checked on page load if all data row checkboxes are initially checked. } }, @@ -245,7 +245,8 @@ * @param {string} selector jQuery selector * @param {function} callback The actual function to be executed with this event */ - function initEventHandler($gridView, type, event, selector, callback) { + function initEventHandler($gridView, type, event, selector, callback) + { var id = $gridView.attr('id'); var prevHandler = gridEventHandlers[id]; if (prevHandler !== undefined && prevHandler[type] !== undefined) { diff --git a/framework/assets/yii.js b/framework/assets/yii.js index 6384d07d172..e7a61f75456 100644 --- a/framework/assets/yii.js +++ b/framework/assets/yii.js @@ -353,7 +353,8 @@ window.yii = (function ($) { } }; - function initCsrfHandler() { + function initCsrfHandler() + { // automatically send CSRF token for all AJAX requests $.ajaxPrefilter(function (options, originalOptions, xhr) { if (!options.crossDomain && pub.getCsrfParam()) { @@ -363,7 +364,8 @@ window.yii = (function ($) { pub.refreshCsrfToken(); } - function initRedirectHandler() { + function initRedirectHandler() + { // handle AJAX redirection $(document).ajaxComplete(function (event, xhr) { var url = xhr && xhr.getResponseHeader('X-Redirect'); @@ -373,7 +375,8 @@ window.yii = (function ($) { }); } - function initAssetFilters() { + function initAssetFilters() + { /** * Used for storing loaded scripts and information about loading each script if it's in the process of loading. * A single script can have one of the following values: @@ -472,7 +475,8 @@ window.yii = (function ($) { }); } - function initDataMethods() { + function initDataMethods() + { var handler = function (event) { var $this = $(this), method = $this.data('method'), @@ -499,7 +503,8 @@ window.yii = (function ($) { .on('change.yii', pub.changeableSelector, handler); } - function isReloadableAsset(url) { + function isReloadableAsset(url) + { for (var i = 0; i < pub.reloadableScripts.length; i++) { var rule = getAbsoluteUrl(pub.reloadableScripts[i]); var match = new RegExp("^" + escapeRegExp(rule).split('\\*').join('.+') + "$").test(url); @@ -512,7 +517,8 @@ window.yii = (function ($) { } // https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex/6969486#6969486 - function escapeRegExp(str) { + function escapeRegExp(str) + { return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); } @@ -521,7 +527,8 @@ window.yii = (function ($) { * @param {string} url Initial URL * @returns {string} */ - function getAbsoluteUrl(url) { + function getAbsoluteUrl(url) + { return url.charAt(0) === '/' ? pub.getBaseCurrentUrl() + url : url; } diff --git a/framework/assets/yii.validation.js b/framework/assets/yii.validation.js index 2cae037e3c1..af80bb80493 100644 --- a/framework/assets/yii.validation.js +++ b/framework/assets/yii.validation.js @@ -95,7 +95,7 @@ yii.validation = (function ($) { }, validateImage: function (file, messages, options, deferred, fileReader, image) { - image.onload = function() { + image.onload = function () { validateImageSize(file, image, messages, options); deferred.resolve(); }; @@ -379,7 +379,8 @@ yii.validation = (function ($) { } }; - function getUploadedFiles(attribute, messages, options) { + function getUploadedFiles(attribute, messages, options) + { // Skip validation if File API is not available if (typeof File === "undefined") { return []; @@ -415,12 +416,13 @@ yii.validation = (function ($) { return files; } - function validateFile(file, messages, options) { + function validateFile(file, messages, options) + { if (options.extensions && options.extensions.length > 0) { var found = false; var filename = file.name.toLowerCase(); - for (var index=0; index < options.extensions.length; index++) { + for (var index = 0; index < options.extensions.length; index++) { var ext = options.extensions[index].toLowerCase(); if ((ext === '' && filename.indexOf('.') === -1) || (filename.substr(filename.length - options.extensions[index].length - 1) === ('.' + ext))) { found = true; @@ -448,7 +450,8 @@ yii.validation = (function ($) { } } - function validateMimeType(mimeTypes, fileType) { + function validateMimeType(mimeTypes, fileType) + { for (var i = 0, len = mimeTypes.length; i < len; i++) { if (new RegExp(mimeTypes[i]).test(fileType)) { return true; @@ -458,7 +461,8 @@ yii.validation = (function ($) { return false; } - function validateImageSize(file, image, messages, options) { + function validateImageSize(file, image, messages, options) + { if (options.minWidth && image.width < options.minWidth) { messages.push(options.underWidth.replace(/\{file\}/g, file.name)); } @@ -479,7 +483,8 @@ yii.validation = (function ($) { /** * PHP: `trim($path, ' /')`, JS: `yii.helpers.trim(path, {chars: ' /'})` */ - function trimString(value, options = {skipOnEmpty: true, chars: null}) { + function trimString(value, options = {skipOnEmpty: true, chars: null}) + { if (options.skipOnEmpty !== false && pub.isEmpty(value)) { return value; } diff --git a/framework/base/Action.php b/framework/base/Action.php index 45d95c59cbf..b5d04b80ddd 100644 --- a/framework/base/Action.php +++ b/framework/base/Action.php @@ -1,4 +1,5 @@ controller->bindActionParams($this, $params); - Yii::debug('Running action: ' . get_class($this) . '::run(), invoked by ' . get_class($this->controller), __METHOD__); + Yii::debug('Running action: ' . get_class($this) . '::run(), invoked by ' . get_class($this->controller), __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } diff --git a/framework/base/ActionEvent.php b/framework/base/ActionEvent.php index ab03d7366f1..9cfe64509ce 100644 --- a/framework/base/ActionEvent.php +++ b/framework/base/ActionEvent.php @@ -1,4 +1,5 @@ getName(); if (($component = $this->module->get($name, false)) instanceof $typeName) { $args[] = $component; - $requestedParams[$name] = "Component: " . get_class($component) . " \$$name"; + $requestedParams[$name] = 'Component: ' . get_class($component) . " \$$name"; } elseif ($this->module->has($typeName) && ($service = $this->module->get($typeName)) instanceof $typeName) { $args[] = $service; $requestedParams[$name] = 'Module ' . get_class($this->module) . " DI: $typeName \$$name"; diff --git a/framework/base/DynamicContentAwareInterface.php b/framework/base/DynamicContentAwareInterface.php index 58e2625c550..e605d8568f7 100644 --- a/framework/base/DynamicContentAwareInterface.php +++ b/framework/base/DynamicContentAwareInterface.php @@ -1,4 +1,5 @@ controllerNamespace . '\\' . str_replace('/', '\\', $prefix) . $className, '\\'); if (strpos($className, '-') !== false || !class_exists($className)) { return null; diff --git a/framework/base/NotSupportedException.php b/framework/base/NotSupportedException.php index 4161fb737f4..32a1bed9770 100644 --- a/framework/base/NotSupportedException.php +++ b/framework/base/NotSupportedException.php @@ -1,4 +1,5 @@ 30 ) { diff --git a/framework/base/StaticInstanceInterface.php b/framework/base/StaticInstanceInterface.php index 12cce4bfbc8..0d9af1134b5 100644 --- a/framework/base/StaticInstanceInterface.php +++ b/framework/base/StaticInstanceInterface.php @@ -1,4 +1,5 @@ dynamicPlaceholders[$placeholder] = $statements; -} + } /** * Evaluates the given PHP statements. diff --git a/framework/base/ViewContextInterface.php b/framework/base/ViewContextInterface.php index df2834c0d5c..ef2a1a4377d 100644 --- a/framework/base/ViewContextInterface.php +++ b/framework/base/ViewContextInterface.php @@ -1,4 +1,5 @@ skipUpdateOnClean + if ( + $this->skipUpdateOnClean && $event->name == ActiveRecord::EVENT_BEFORE_UPDATE && empty($this->owner->dirtyAttributes) ) { diff --git a/framework/behaviors/AttributeTypecastBehavior.php b/framework/behaviors/AttributeTypecastBehavior.php index a418b15de25..e2bde1b9a98 100644 --- a/framework/behaviors/AttributeTypecastBehavior.php +++ b/framework/behaviors/AttributeTypecastBehavior.php @@ -1,4 +1,5 @@ attributeTypes */ - private static $autoDetectedAttributeTypes = []; + private static $_autoDetectedAttributeTypes = []; /** @@ -193,7 +194,7 @@ class AttributeTypecastBehavior extends Behavior */ public static function clearAutoDetectedAttributeTypes() { - self::$autoDetectedAttributeTypes = []; + self::$_autoDetectedAttributeTypes = []; } /** @@ -205,10 +206,10 @@ public function attach($owner) if ($this->attributeTypes === null) { $ownerClass = get_class($this->owner); - if (!isset(self::$autoDetectedAttributeTypes[$ownerClass])) { - self::$autoDetectedAttributeTypes[$ownerClass] = $this->detectAttributeTypes(); + if (!isset(self::$_autoDetectedAttributeTypes[$ownerClass])) { + self::$_autoDetectedAttributeTypes[$ownerClass] = $this->detectAttributeTypes(); } - $this->attributeTypes = self::$autoDetectedAttributeTypes[$ownerClass]; + $this->attributeTypes = self::$_autoDetectedAttributeTypes[$ownerClass]; } } diff --git a/framework/behaviors/AttributesBehavior.php b/framework/behaviors/AttributesBehavior.php index df093864a34..5ab2ceea0d1 100644 --- a/framework/behaviors/AttributesBehavior.php +++ b/framework/behaviors/AttributesBehavior.php @@ -1,4 +1,5 @@ skipUpdateOnClean + if ( + $this->skipUpdateOnClean && $event->name === ActiveRecord::EVENT_BEFORE_UPDATE && empty($this->owner->dirtyAttributes) ) { @@ -152,7 +154,8 @@ public function evaluateAttributes($event) if (!empty($this->order[$event->name])) { $attributes = array_merge( array_intersect((array) $this->order[$event->name], $attributes), - array_diff($attributes, (array) $this->order[$event->name])); + array_diff($attributes, (array) $this->order[$event->name]) + ); } foreach ($attributes as $attribute) { if ($this->preserveNonEmptyValues && !empty($this->owner->$attribute)) { diff --git a/framework/behaviors/BlameableBehavior.php b/framework/behaviors/BlameableBehavior.php index f83b8b3f28c..f6396c33bfd 100755 --- a/framework/behaviors/BlameableBehavior.php +++ b/framework/behaviors/BlameableBehavior.php @@ -1,4 +1,5 @@ controller instanceof \yii\console\Controller && Yii::$app->controller->isColorEnabled($stream) - || Yii::$app instanceof \yii\console\Application && Console::streamSupportsAnsiColors($stream)) { + if ( + Yii::$app->controller instanceof \yii\console\Controller && Yii::$app->controller->isColorEnabled($stream) + || Yii::$app instanceof \yii\console\Application && Console::streamSupportsAnsiColors($stream) + ) { $message = Console::ansiFormat($message, $format); } diff --git a/framework/console/Exception.php b/framework/console/Exception.php index 59ee7d71acb..784857246da 100644 --- a/framework/console/Exception.php +++ b/framework/console/Exception.php @@ -1,4 +1,5 @@ getActionArgsHelp($action) as $argument => $help) { - $description = preg_replace("~\R~", '', addcslashes($help['comment'], ':')) ?: $argument; + $description = preg_replace('~\R~', '', addcslashes($help['comment'], ':')) ?: $argument; $this->stdout($argument . ':' . $description . "\n"); } $this->stdout("\n"); foreach ($controller->getActionOptionsHelp($action) as $argument => $help) { - $description = preg_replace("~\R~", '', addcslashes($help['comment'], ':')); + $description = preg_replace('~\R~', '', addcslashes($help['comment'], ':')); $this->stdout('--' . $argument . ($description ? ':' . $description : '') . "\n"); } } @@ -440,11 +441,12 @@ protected function getSubCommandHelp($controller, $actionID) if (!empty($args)) { foreach ($args as $name => $arg) { $this->stdout($this->formatOptionHelp( - '- ' . $this->ansiFormat($name, Console::FG_CYAN), - $arg['required'], - $arg['type'], - $arg['default'], - $arg['comment']) . "\n\n"); + '- ' . $this->ansiFormat($name, Console::FG_CYAN), + $arg['required'], + $arg['type'], + $arg['default'], + $arg['comment'] + ) . "\n\n"); } } @@ -452,12 +454,16 @@ protected function getSubCommandHelp($controller, $actionID) $this->stdout("\nOPTIONS\n\n", Console::BOLD); foreach ($options as $name => $option) { $this->stdout($this->formatOptionHelp( - $this->ansiFormat('--' . $name . $this->formatOptionAliases($controller, $name), - Console::FG_RED, empty($option['required']) ? Console::FG_RED : Console::BOLD), - !empty($option['required']), - $option['type'], - $option['default'], - $option['comment']) . "\n\n"); + $this->ansiFormat( + '--' . $name . $this->formatOptionAliases($controller, $name), + Console::FG_RED, + empty($option['required']) ? Console::FG_RED : Console::BOLD + ), + !empty($option['required']), + $option['type'], + $option['default'], + $option['comment'] + ) . "\n\n"); } } } diff --git a/framework/console/controllers/MessageController.php b/framework/console/controllers/MessageController.php index fb4e012f523..75238bb57c6 100644 --- a/framework/console/controllers/MessageController.php +++ b/framework/console/controllers/MessageController.php @@ -1,4 +1,5 @@ stdout('Inserting new messages...'); $insertCount = 0; @@ -392,9 +393,9 @@ protected function saveMessagesToDb($messages, $db, $sourceMessageTable, $messag $db->schema->insert($sourceMessageTable, ['category' => $category, 'message' => $msg]); } } - + $this->stdout($insertCount ? "{$insertCount} saved.\n" : "Nothing to save.\n"); - + $this->stdout($removeUnused ? 'Deleting obsoleted messages...' : 'Updating obsoleted messages...'); if (empty($obsolete)) { @@ -408,13 +409,13 @@ protected function saveMessagesToDb($messages, $db, $sourceMessageTable, $messag ->execute(); $this->stdout("{$affected} deleted.\n"); } elseif ($markUnused) { - $marked=0; + $marked = 0; $rows = (new Query()) ->select(['id', 'message']) ->from($sourceMessageTable) ->where(['in', 'id', array_keys($obsolete)]) ->all($db); - + foreach ($rows as $row) { $marked++; $db->createCommand()->update( @@ -428,64 +429,64 @@ protected function saveMessagesToDb($messages, $db, $sourceMessageTable, $messag $this->stdout("kept untouched.\n"); } } - + // get fresh message id list $freshMessagesIds = []; $rows = (new Query())->select(['id'])->from($sourceMessageTable)->all($db); foreach ($rows as $row) { $freshMessagesIds[] = $row['id']; } - - $this->stdout("Generating missing rows..."); + + $this->stdout('Generating missing rows...'); $generatedMissingRows = []; - + foreach ($languages as $language) { - $count = 0; - - // get list of ids of translations for this language - $msgRowsIds = []; - $msgRows = (new Query())->select(['id'])->from($messageTable)->where([ - 'language'=>$language, - ])->all($db); - foreach ($msgRows as $row) { - $msgRowsIds[] = $row['id']; - } - - // insert missing - foreach ($freshMessagesIds as $id) { - if (!in_array($id, $msgRowsIds)) { - $db->createCommand() - ->insert($messageTable, ['id' => $id, 'language' => $language]) - ->execute(); - $count++; + $count = 0; + + // get list of ids of translations for this language + $msgRowsIds = []; + $msgRows = (new Query())->select(['id'])->from($messageTable)->where([ + 'language' => $language, + ])->all($db); + foreach ($msgRows as $row) { + $msgRowsIds[] = $row['id']; } - } - if ($count) { - $generatedMissingRows[] = "{$count} for {$language}"; - } - } - - $this->stdout($generatedMissingRows ? implode(", ", $generatedMissingRows).".\n" : "Nothing to do.\n"); - - $this->stdout("Dropping unused languages..."); - $droppedLanguages=[]; - + + // insert missing + foreach ($freshMessagesIds as $id) { + if (!in_array($id, $msgRowsIds)) { + $db->createCommand() + ->insert($messageTable, ['id' => $id, 'language' => $language]) + ->execute(); + $count++; + } + } + if ($count) { + $generatedMissingRows[] = "{$count} for {$language}"; + } + } + + $this->stdout($generatedMissingRows ? implode(', ', $generatedMissingRows) . ".\n" : "Nothing to do.\n"); + + $this->stdout('Dropping unused languages...'); + $droppedLanguages = []; + $currentLanguages = []; $rows = (new Query())->select(['language'])->from($messageTable)->groupBy('language')->all($db); foreach ($rows as $row) { $currentLanguages[] = $row['language']; } - + foreach ($currentLanguages as $currentLanguage) { - if (!in_array($currentLanguage, $languages)) { - $deleted=$db->createCommand()->delete($messageTable, "language=:language", [ - 'language'=>$currentLanguage, - ])->execute(); - $droppedLanguages[] = "removed {$deleted} rows for $currentLanguage"; - } - } - - $this->stdout($droppedLanguages ? implode(", ", $droppedLanguages).".\n" : "Nothing to do.\n"); + if (!in_array($currentLanguage, $languages)) { + $deleted = $db->createCommand()->delete($messageTable, 'language=:language', [ + 'language' => $currentLanguage, + ])->execute(); + $droppedLanguages[] = "removed {$deleted} rows for $currentLanguage"; + } + } + + $this->stdout($droppedLanguages ? implode(', ', $droppedLanguages) . ".\n" : "Nothing to do.\n"); } /** diff --git a/framework/console/controllers/MigrateController.php b/framework/console/controllers/MigrateController.php index b2e1db3ec26..7b6b02e3d3c 100644 --- a/framework/console/controllers/MigrateController.php +++ b/framework/console/controllers/MigrateController.php @@ -1,4 +1,5 @@ templateFile; $table = null; - if (preg_match( - '/^create_?junction_?(?:table)?_?(?:for)?(.+)_?and(.+)_?tables?$/i', - $name, - $matches - )) { + if (preg_match('/^create_?junction_?(?:table)?_?(?:for)?(.+)_?and(.+)_?tables?$/i', $name, $matches)) { $templateFile = $this->generatorTemplateFiles['create_junction']; $firstTable = $this->normalizeTableName($matches[1]); $secondTable = $this->normalizeTableName($matches[2]); diff --git a/framework/console/controllers/ServeController.php b/framework/console/controllers/ServeController.php index b806f67d55b..2b8ce9f78c0 100644 --- a/framework/console/controllers/ServeController.php +++ b/framework/console/controllers/ServeController.php @@ -1,4 +1,5 @@ rows = array_map(function($row) { - return array_map(function($value) { + $this->rows = array_map(function ($row) { + return array_map(function ($value) { return empty($value) && !is_numeric($value) ? ' ' : (is_array($value) @@ -198,7 +199,8 @@ public function run() ); // Header if ($headerCount > 0) { - $buffer .= $this->renderRow($this->headers, + $buffer .= $this->renderRow( + $this->headers, $this->chars[self::CHAR_LEFT], $this->chars[self::CHAR_MIDDLE], $this->chars[self::CHAR_RIGHT] @@ -215,10 +217,12 @@ public function run() $this->chars[self::CHAR_RIGHT_MID] ); } - $buffer .= $this->renderRow($row, + $buffer .= $this->renderRow( + $row, $this->chars[self::CHAR_LEFT], $this->chars[self::CHAR_MIDDLE], - $this->chars[self::CHAR_RIGHT]); + $this->chars[self::CHAR_RIGHT] + ); } $buffer .= $this->renderSeparator( diff --git a/framework/data/ActiveDataFilter.php b/framework/data/ActiveDataFilter.php index be5704aa675..bf6eea2c32e 100644 --- a/framework/data/ActiveDataFilter.php +++ b/framework/data/ActiveDataFilter.php @@ -1,4 +1,5 @@ * @since 2.0 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ abstract class BaseDataProvider extends Component implements DataProviderInterface { diff --git a/framework/data/DataFilter.php b/framework/data/DataFilter.php index 587b7b10a58..2c12485153d 100644 --- a/framework/data/DataFilter.php +++ b/framework/data/DataFilter.php @@ -1,4 +1,5 @@ * @author Carsten Brandt * @since 2.0 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore * * @method ActiveRecordInterface|array|null one($db = null) See [[ActiveQueryInterface::one()]] for more info. * @method ActiveRecordInterface[] all($db = null) See [[ActiveQueryInterface::all()]] for more info. @@ -453,7 +455,8 @@ private function buildBuckets($models, $link, $viaModels = null, $viaQuery = nul * @param array $viaMap * @return array */ - private function mapVia($map, $viaMap) { + private function mapVia($map, $viaMap) + { $resultMap = []; foreach ($map as $key => $linkKeys) { $resultMap[$key] = []; diff --git a/framework/db/AfterSaveEvent.php b/framework/db/AfterSaveEvent.php index 3efccc10ec1..1a8a768d4fa 100644 --- a/framework/db/AfterSaveEvent.php +++ b/framework/db/AfterSaveEvent.php @@ -1,4 +1,5 @@ * @since 2.0.14 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ class ArrayExpression implements ExpressionInterface, \ArrayAccess, \Countable, \IteratorAggregate { diff --git a/framework/db/BaseActiveRecord.php b/framework/db/BaseActiveRecord.php index 48c14a573d1..725bf40c592 100644 --- a/framework/db/BaseActiveRecord.php +++ b/framework/db/BaseActiveRecord.php @@ -1,4 +1,5 @@ errorInfo[1]) ? $e->errorInfo[1] : null; - if ($this->getDbDriverName() !== 'sqlsrv' || $errorCode !== $this->mssqlNoMoreRowsErrorCode) { + if ($this->getDbDriverName() !== 'sqlsrv' || $errorCode !== self::MSSQL_NO_MORE_ROWS_ERROR_CODE) { throw $e; } } diff --git a/framework/db/CheckConstraint.php b/framework/db/CheckConstraint.php index 585032cfe80..1bb86d92bf4 100644 --- a/framework/db/CheckConstraint.php +++ b/framework/db/CheckConstraint.php @@ -1,4 +1,5 @@ type, [ @@ -123,12 +125,14 @@ protected function typecast($value) Schema::TYPE_BINARY, Schema::TYPE_CHAR ], - true) + true + ) ) { return null; } - if ($value === null + if ( + $value === null || gettype($value) === $this->phpType || $value instanceof ExpressionInterface || $value instanceof Query @@ -136,7 +140,8 @@ protected function typecast($value) return $value; } - if (is_array($value) + if ( + is_array($value) && count($value) === 2 && isset($value[1]) && in_array($value[1], $this->getPdoParamTypes(), true) @@ -154,7 +159,8 @@ protected function typecast($value) // ensure type cast always has . as decimal separator in all locales return StringHelper::floatToString($value); } - if (is_numeric($value) + if ( + is_numeric($value) && ColumnSchemaBuilder::CATEGORY_NUMERIC === ColumnSchemaBuilder::$typeCategoryMap[$this->type] ) { // https://github.com/yiisoft/yii2/issues/14663 @@ -174,7 +180,7 @@ protected function typecast($value) case 'boolean': // treating a 0 bit value as false too // https://github.com/yiisoft/yii2/issues/9006 - return (bool) $value && $value !== "\0"; + return (bool) $value && $value !== "\0" && strtolower($value) !== 'false'; case 'double': return (float) $value; } diff --git a/framework/db/Command.php b/framework/db/Command.php index 72eda72e4e1..344959c2741 100644 --- a/framework/db/Command.php +++ b/framework/db/Command.php @@ -1,4 +1,5 @@ _sql); diff --git a/framework/db/Connection.php b/framework/db/Connection.php index 38f1b1e644d..c8f61c05e45 100644 --- a/framework/db/Connection.php +++ b/framework/db/Connection.php @@ -1220,7 +1220,6 @@ protected function openFromPoolSequentially(array $pool, array $sharedConfig) // ignore the cache and try to connect anyway // $pool now only contains servers we did not already try in the loop above foreach ($pool as $config) { - /* @var $db Connection */ $db = Yii::createObject($config); try { diff --git a/framework/db/Constraint.php b/framework/db/Constraint.php index 6f210969694..b749a6dddf3 100644 --- a/framework/db/Constraint.php +++ b/framework/db/Constraint.php @@ -1,4 +1,5 @@ * @since 2.0.14 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ final class PdoValue implements ExpressionInterface { diff --git a/framework/db/PdoValueBuilder.php b/framework/db/PdoValueBuilder.php index 6bec24c94bd..2eae1532739 100644 --- a/framework/db/PdoValueBuilder.php +++ b/framework/db/PdoValueBuilder.php @@ -1,4 +1,5 @@ columns : []; $sets = []; foreach ($columns as $name => $value) { - $value = isset($columnSchemas[$name]) ? $columnSchemas[$name]->dbTypecast($value) : $value; if ($value instanceof ExpressionInterface) { $placeholder = $this->buildExpression($value, $params); @@ -1521,7 +1521,7 @@ public function buildWithQueries($withs, &$params) $result[] = $with['alias'] . ' AS (' . $with['query'] . ')'; } - return 'WITH ' . ($recursive ? 'RECURSIVE ' : '') . implode (', ', $result); + return 'WITH ' . ($recursive ? 'RECURSIVE ' : '') . implode(', ', $result); } /** diff --git a/framework/db/QueryExpressionBuilder.php b/framework/db/QueryExpressionBuilder.php index e811c053c99..bd88a758ea0 100644 --- a/framework/db/QueryExpressionBuilder.php +++ b/framework/db/QueryExpressionBuilder.php @@ -1,4 +1,5 @@ * @since 2.0.14 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ class BetweenColumnsCondition implements ConditionInterface { diff --git a/framework/db/conditions/BetweenColumnsConditionBuilder.php b/framework/db/conditions/BetweenColumnsConditionBuilder.php index 0795d0f2f85..516489c9c77 100644 --- a/framework/db/conditions/BetweenColumnsConditionBuilder.php +++ b/framework/db/conditions/BetweenColumnsConditionBuilder.php @@ -1,4 +1,5 @@ * @since 2.0.14 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ class BetweenCondition implements ConditionInterface { diff --git a/framework/db/conditions/BetweenConditionBuilder.php b/framework/db/conditions/BetweenConditionBuilder.php index 2af0a29fe7c..dde3f9c3bb9 100644 --- a/framework/db/conditions/BetweenConditionBuilder.php +++ b/framework/db/conditions/BetweenConditionBuilder.php @@ -1,4 +1,5 @@ * @since 2.0.14 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ class ExistsCondition implements ConditionInterface { diff --git a/framework/db/conditions/ExistsConditionBuilder.php b/framework/db/conditions/ExistsConditionBuilder.php index c7997d974cc..dcef6f7dcdc 100644 --- a/framework/db/conditions/ExistsConditionBuilder.php +++ b/framework/db/conditions/ExistsConditionBuilder.php @@ -1,4 +1,5 @@ * @since 2.0.14 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ class HashCondition implements ConditionInterface { diff --git a/framework/db/conditions/HashConditionBuilder.php b/framework/db/conditions/HashConditionBuilder.php index 9e0b5a48002..da77c709322 100644 --- a/framework/db/conditions/HashConditionBuilder.php +++ b/framework/db/conditions/HashConditionBuilder.php @@ -1,4 +1,5 @@ * @since 2.0.14 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ class InCondition implements ConditionInterface { diff --git a/framework/db/conditions/InConditionBuilder.php b/framework/db/conditions/InConditionBuilder.php index 3717c226b1f..32cb078ed79 100644 --- a/framework/db/conditions/InConditionBuilder.php +++ b/framework/db/conditions/InConditionBuilder.php @@ -1,4 +1,5 @@ queryBuilder->db->quoteColumnName($column); if ($operator === 'IN') { return sprintf('%s IS NULL', $column); diff --git a/framework/db/conditions/LikeCondition.php b/framework/db/conditions/LikeCondition.php index 0fe2a8fa0eb..8d203aab4cb 100644 --- a/framework/db/conditions/LikeCondition.php +++ b/framework/db/conditions/LikeCondition.php @@ -1,4 +1,5 @@ * @since 2.0.14 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ class NotCondition implements ConditionInterface { diff --git a/framework/db/conditions/NotConditionBuilder.php b/framework/db/conditions/NotConditionBuilder.php index 23772621f97..842d08a12e8 100644 --- a/framework/db/conditions/NotConditionBuilder.php +++ b/framework/db/conditions/NotConditionBuilder.php @@ -1,4 +1,5 @@ * @since 2.0.14 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ class SimpleCondition implements ConditionInterface { diff --git a/framework/db/conditions/SimpleConditionBuilder.php b/framework/db/conditions/SimpleConditionBuilder.php index 00a75115b8e..1983f52bfaf 100644 --- a/framework/db/conditions/SimpleConditionBuilder.php +++ b/framework/db/conditions/SimpleConditionBuilder.php @@ -1,4 +1,5 @@ hasLimit($limit)) { if ($limit instanceof Expression) { - $limit = '('. (string)$limit . ')'; + $limit = '(' . (string)$limit . ')'; } $sql = "SELECT TOP $limit * FROM ($sql) sub"; } else { @@ -199,7 +200,7 @@ public function alterColumn($table, $column, $type) if ($checkValue !== null) { $sqlAfter[] = "ALTER TABLE {$tableName} ADD CONSTRAINT " . $this->db->quoteColumnName("CK_{$constraintBase}") . - " CHECK (" . ($defaultValue instanceof Expression ? $checkValue : new Expression($checkValue)) . ")"; + ' CHECK (' . ($defaultValue instanceof Expression ? $checkValue : new Expression($checkValue)) . ')'; } if ($type->isUnique()) { @@ -307,10 +308,10 @@ protected function buildAddCommentSql($comment, $table, $column = null) throw new InvalidArgumentException("Table not found: $table"); } - $schemaName = $tableSchema->schemaName ? "N'" . $tableSchema->schemaName . "'": 'SCHEMA_NAME()'; - $tableName = "N" . $this->db->quoteValue($tableSchema->name); - $columnName = $column ? "N" . $this->db->quoteValue($column) : null; - $comment = "N" . $this->db->quoteValue($comment); + $schemaName = $tableSchema->schemaName ? "N'" . $tableSchema->schemaName . "'" : 'SCHEMA_NAME()'; + $tableName = 'N' . $this->db->quoteValue($tableSchema->name); + $columnName = $column ? 'N' . $this->db->quoteValue($column) : null; + $comment = 'N' . $this->db->quoteValue($comment); $functionParams = " @name = N'MS_description', @@ -373,9 +374,9 @@ protected function buildRemoveCommentSql($table, $column = null) throw new InvalidArgumentException("Table not found: $table"); } - $schemaName = $tableSchema->schemaName ? "N'" . $tableSchema->schemaName . "'": 'SCHEMA_NAME()'; - $tableName = "N" . $this->db->quoteValue($tableSchema->name); - $columnName = $column ? "N" . $this->db->quoteValue($column) : null; + $schemaName = $tableSchema->schemaName ? "N'" . $tableSchema->schemaName . "'" : 'SCHEMA_NAME()'; + $tableName = 'N' . $this->db->quoteValue($tableSchema->name); + $columnName = $column ? 'N' . $this->db->quoteValue($column) : null; return " IF EXISTS ( @@ -491,7 +492,7 @@ public function insert($table, $columns, &$params) } $quoteColumnName = $this->db->quoteColumnName($column->name); - $cols[] = $quoteColumnName . ' ' . $dbType . ' ' . ($column->allowNull ? "NULL" : ""); + $cols[] = $quoteColumnName . ' ' . $dbType . ' ' . ($column->allowNull ? 'NULL' : ''); $outputColumns[] = 'INSERTED.' . $quoteColumnName; } } @@ -628,7 +629,7 @@ protected function extractAlias($table) * @see https://docs.microsoft.com/sql/relational-databases/system-catalog-views/sys-objects-transact-sql * @return string the DROP CONSTRAINTS SQL */ - private function dropConstraintsForColumn($table, $column, $type='') + private function dropConstraintsForColumn($table, $column, $type = '') { return "DECLARE @tableName VARCHAR(MAX) = '" . $this->db->quoteTableName($table) . "' DECLARE @columnName VARCHAR(MAX) = '{$column}' @@ -648,7 +649,7 @@ private function dropConstraintsForColumn($table, $column, $type='') WHERE i.[is_unique_constraint]=1 and i.[object_id]=OBJECT_ID(@tableName) ) cons JOIN [sys].[objects] so ON so.[object_id]=cons.[object_id] - " . (!empty($type) ? " WHERE so.[type]='{$type}'" : "") . ") + " . (!empty($type) ? " WHERE so.[type]='{$type}'" : '') . ") IF @constraintName IS NULL BREAK EXEC (N'ALTER TABLE ' + @tableName + ' DROP CONSTRAINT [' + @constraintName + ']') END"; @@ -661,6 +662,6 @@ private function dropConstraintsForColumn($table, $column, $type='') public function dropColumn($table, $column) { return $this->dropConstraintsForColumn($table, $column) . "\nALTER TABLE " . $this->db->quoteTableName($table) - . " DROP COLUMN " . $this->db->quoteColumnName($column); + . ' DROP COLUMN ' . $this->db->quoteColumnName($column); } } diff --git a/framework/db/mssql/Schema.php b/framework/db/mssql/Schema.php index e20e6aa3429..13ea5340038 100644 --- a/framework/db/mssql/Schema.php +++ b/framework/db/mssql/Schema.php @@ -1,4 +1,5 @@ db->quoteValue($table->name); + $whereSql = '[t1].[table_name] = ' . $this->db->quoteValue($table->name); if ($table->catalogName !== null) { $columnsTableName = "{$table->catalogName}.{$columnsTableName}"; $whereSql .= " AND [t1].[table_catalog] = '{$table->catalogName}'"; diff --git a/framework/db/mssql/SqlsrvPDO.php b/framework/db/mssql/SqlsrvPDO.php index 4285e220df0..ed8139eefad 100644 --- a/framework/db/mssql/SqlsrvPDO.php +++ b/framework/db/mssql/SqlsrvPDO.php @@ -1,4 +1,5 @@ columns)->name]; $defaultValue = 'DEFAULT'; } - + foreach ($columns as $name) { $names[] = $this->db->quoteColumnName($name); $placeholders[] = $defaultValue; @@ -312,8 +313,7 @@ public function upsert($table, $insertColumns, $updateColumns, &$params) public function addCommentOnColumn($table, $column, $comment) { // Strip existing comment which may include escaped quotes - $definition = trim(preg_replace("/COMMENT '(?:''|[^'])*'/i", '', - $this->getColumnDefinition($table, $column))); + $definition = trim(preg_replace("/COMMENT '(?:''|[^'])*'/i", '', $this->getColumnDefinition($table, $column))); $checkRegex = '/CHECK *(\(([^()]|(?-2))*\))/'; $check = preg_match($checkRegex, $definition, $checkMatches); diff --git a/framework/db/mysql/Schema.php b/framework/db/mysql/Schema.php index 38dec4ca036..c3e8db4f51e 100644 --- a/framework/db/mysql/Schema.php +++ b/framework/db/mysql/Schema.php @@ -1,4 +1,5 @@ type, ['timestamp', 'datetime', 'date', 'time']) + if ( + in_array($column->type, ['timestamp', 'datetime', 'date', 'time']) && isset($info['default']) - && preg_match('/^current_timestamp(?:\(([0-9]*)\))?$/i', $info['default'], $matches)) { + && preg_match('/^current_timestamp(?:\(([0-9]*)\))?$/i', $info['default'], $matches) + ) { $column->defaultValue = new Expression('CURRENT_TIMESTAMP' . (!empty($matches[1]) ? '(' . $matches[1] . ')' : '')); } elseif (isset($type) && $type === 'bit') { $column->defaultValue = bindec(trim(isset($info['default']) ? $info['default'] : '', 'b\'')); diff --git a/framework/db/oci/ColumnSchemaBuilder.php b/framework/db/oci/ColumnSchemaBuilder.php index dcb5ff21ef8..b104588c4cd 100644 --- a/framework/db/oci/ColumnSchemaBuilder.php +++ b/framework/db/oci/ColumnSchemaBuilder.php @@ -1,4 +1,5 @@ primaryKey)>1) { + if (count($tableSchema->primaryKey) > 1) { throw new InvalidArgumentException("Can't reset sequence for composite primary key in table: $table"); } // use master connection to get the biggest PK value $value = $this->db->useMaster(function (Connection $db) use ($tableSchema) { return $db->createCommand( - 'SELECT MAX("' . $tableSchema->primaryKey[0] . '") FROM "'. $tableSchema->name . '"' + 'SELECT MAX("' . $tableSchema->primaryKey[0] . '") FROM "' . $tableSchema->name . '"' )->queryScalar(); }) + 1; } diff --git a/framework/db/oci/Schema.php b/framework/db/oci/Schema.php index 05b3cb5eac6..8173a5b6ed9 100644 --- a/framework/db/oci/Schema.php +++ b/framework/db/oci/Schema.php @@ -1,4 +1,5 @@ getType(), $expression->getDimension()-1); + return new $expressionClass($value, $expression->getType(), $expression->getDimension() - 1); } /** diff --git a/framework/db/pgsql/ArrayParser.php b/framework/db/pgsql/ArrayParser.php index 50a204e3c5d..e50ee3b7cda 100644 --- a/framework/db/pgsql/ArrayParser.php +++ b/framework/db/pgsql/ArrayParser.php @@ -1,4 +1,5 @@ * @author Dmytro Naumenko * @since 2.0.14 + * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore */ class ArrayParser { diff --git a/framework/db/pgsql/ColumnSchema.php b/framework/db/pgsql/ColumnSchema.php index 271c5f30c85..2e987bf54c2 100644 --- a/framework/db/pgsql/ColumnSchema.php +++ b/framework/db/pgsql/ColumnSchema.php @@ -1,4 +1,5 @@ db->quoteTableName($name); @@ -435,7 +437,7 @@ private function oldUpsert($table, $insertColumns, $updateColumns, &$params) list($updates, $params) = $this->prepareUpdateSets($table, $updateColumns, $params); $updateSql = 'UPDATE ' . $this->db->quoteTableName($table) . ' SET ' . implode(', ', $updates) . ' FROM "EXCLUDED" ' . $this->buildWhere($updateCondition, $params) - . ' RETURNING ' . $this->db->quoteTableName($table) .'.*'; + . ' RETURNING ' . $this->db->quoteTableName($table) . '.*'; $selectUpsertSubQuery = (new Query()) ->select(new Expression('1')) ->from('upsert') diff --git a/framework/db/pgsql/Schema.php b/framework/db/pgsql/Schema.php index c379176de0c..150f88ca33d 100644 --- a/framework/db/pgsql/Schema.php +++ b/framework/db/pgsql/Schema.php @@ -1,4 +1,5 @@ allowNull = $info['is_nullable']; $column->autoIncrement = $info['is_autoinc']; $column->comment = $info['column_comment']; - if ($info['type_scheme'] !== null && !in_array($info['type_scheme'], [$this->defaultSchema, 'pg_catalog'], true) - ) { + if ($info['type_scheme'] !== null && !in_array($info['type_scheme'], [$this->defaultSchema, 'pg_catalog'], true)) { $column->dbType = $info['type_scheme'] . '.' . $info['data_type']; } else { $column->dbType = $info['data_type']; diff --git a/framework/db/sqlite/ColumnSchemaBuilder.php b/framework/db/sqlite/ColumnSchemaBuilder.php index d9853b08ab3..7f3444d3d36 100644 --- a/framework/db/sqlite/ColumnSchemaBuilder.php +++ b/framework/db/sqlite/ColumnSchemaBuilder.php @@ -1,4 +1,5 @@ isBuiltin(); } - } else { $class = $param->getClass(); $isClass = $class !== null; diff --git a/framework/di/Instance.php b/framework/di/Instance.php index 39bd801b354..458b01f274c 100644 --- a/framework/di/Instance.php +++ b/framework/di/Instance.php @@ -1,4 +1,5 @@ matchAction($action) + if ( + $this->matchAction($action) && $this->matchRole($user) && $this->matchIP($request->getUserIP()) && $this->matchVerb($request->getMethod()) diff --git a/framework/filters/AjaxFilter.php b/framework/filters/AjaxFilter.php index 02b3d7ebf0e..a950946df95 100644 --- a/framework/filters/AjaxFilter.php +++ b/framework/filters/AjaxFilter.php @@ -1,4 +1,5 @@ filterAttribute === null) { + if ($this->filterAttribute === null) { $this->filterAttribute = $this->attribute; } } @@ -150,8 +151,10 @@ protected function renderHeaderCellContent() $label = Html::encode($label); } - if ($this->attribute !== null && $this->enableSorting && - ($sort = $this->grid->dataProvider->getSort()) !== false && $sort->hasAttribute($this->attribute)) { + if ( + $this->attribute !== null && $this->enableSorting && + ($sort = $this->grid->dataProvider->getSort()) !== false && $sort->hasAttribute($this->attribute) + ) { return $sort->link($this->attribute, array_merge($this->sortLinkOptions, ['label' => $label])); } diff --git a/framework/grid/GridView.php b/framework/grid/GridView.php index 8b5afefe7c1..30ccf79bf85 100644 --- a/framework/grid/GridView.php +++ b/framework/grid/GridView.php @@ -1,4 +1,5 @@ "''''", // single `'` should be encoded as `''`, which internally should be encoded as `''''` // Day '\d' => "'d'", - 'd' => 'dd', // Day of the month, 2 digits with leading zeros 01 to 31 + 'd' => 'dd', // Day of the month, 2 digits with leading zeros — 01 to 31 '\D' => "'D'", - 'D' => 'eee', // A textual representation of a day, three letters Mon through Sun + 'D' => 'eee', // A textual representation of a day, three letters — Mon through Sun '\j' => "'j'", - 'j' => 'd', // Day of the month without leading zeros 1 to 31 + 'j' => 'd', // Day of the month without leading zeros — 1 to 31 '\l' => "'l'", - 'l' => 'eeee', // A full textual representation of the day of the week Sunday through Saturday + 'l' => 'eeee', // A full textual representation of the day of the week — Sunday through Saturday '\N' => "'N'", 'N' => 'e', // ISO-8601 numeric representation of the day of the week, 1 (for Monday) through 7 (for Sunday) '\S' => "'S'", - 'S' => '', // English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j + 'S' => '', // English ordinal suffix for the day of the month, 2 characters — st, nd, rd or th. Works well with j '\w' => "'w'", - 'w' => '', // Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday) + 'w' => '', // Numeric representation of the day of the week — 0 (for Sunday) through 6 (for Saturday) '\z' => "'z'", - 'z' => 'D', // The day of the year (starting from 0) 0 through 365 + 'z' => 'D', // The day of the year (starting from 0) — 0 through 365 // Week '\W' => "'W'", - 'W' => 'w', // ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0) Example: 42 (the 42nd week in the year) + 'W' => 'w', // ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0) — Example: 42 (the 42nd week in the year) // Month '\F' => "'F'", 'F' => 'MMMM', // A full textual representation of a month, January through December '\m' => "'m'", - 'm' => 'MM', // Numeric representation of a month, with leading zeros 01 through 12 + 'm' => 'MM', // Numeric representation of a month, with leading zeros — 01 through 12 '\M' => "'M'", - 'M' => 'MMM', // A short textual representation of a month, three letters Jan through Dec + 'M' => 'MMM', // A short textual representation of a month, three letters — Jan through Dec '\n' => "'n'", - 'n' => 'M', // Numeric representation of a month, without leading zeros 1 through 12, not supported by ICU but we fallback to "with leading zero" + 'n' => 'M', // Numeric representation of a month, without leading zeros — 1 through 12, not supported by ICU but we fallback to "with leading zero" '\t' => "'t'", - 't' => '', // Number of days in the given month 28 through 31 + 't' => '', // Number of days in the given month — 28 through 31 // Year '\L' => "'L'", 'L' => '', // Whether it's a leap year, 1 if it is a leap year, 0 otherwise. '\o' => "'o'", 'o' => 'Y', // ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. '\Y' => "'Y'", - 'Y' => 'yyyy', // A full numeric representation of a year, 4 digits Examples: 1999 or 2003 + 'Y' => 'yyyy', // A full numeric representation of a year, 4 digits — Examples: 1999 or 2003 '\y' => "'y'", - 'y' => 'yy', // A two digit representation of a year Examples: 99 or 03 + 'y' => 'yy', // A two digit representation of a year — Examples: 99 or 03 // Time '\a' => "'a'", 'a' => 'a', // Lowercase Ante meridiem and Post meridiem, am or pm '\A' => "'A'", 'A' => 'a', // Uppercase Ante meridiem and Post meridiem, AM or PM, not supported by ICU but we fallback to lowercase '\B' => "'B'", - 'B' => '', // Swatch Internet time 000 through 999 + 'B' => '', // Swatch Internet time — 000 through 999 '\g' => "'g'", - 'g' => 'h', // 12-hour format of an hour without leading zeros 1 through 12 + 'g' => 'h', // 12-hour format of an hour without leading zeros — 1 through 12 '\G' => "'G'", 'G' => 'H', // 24-hour format of an hour without leading zeros 0 to 23h '\h' => "'h'", @@ -294,9 +295,9 @@ public static function convertDatePhpToIcu($pattern) '\H' => "'H'", 'H' => 'HH', // 24-hour format of an hour with leading zeros, 00 to 23 h '\i' => "'i'", - 'i' => 'mm', // Minutes with leading zeros 00 to 59 + 'i' => 'mm', // Minutes with leading zeros — 00 to 59 '\s' => "'s'", - 's' => 'ss', // Seconds, with leading zeros 00 through 59 + 's' => 'ss', // Seconds, with leading zeros — 00 through 59 '\u' => "'u'", 'u' => '', // Microseconds. Example: 654321 // Timezone @@ -482,37 +483,37 @@ public static function convertDatePhpToJui($pattern) // https://www.php.net/manual/en/function.date return strtr($pattern, [ // Day - 'd' => 'dd', // Day of the month, 2 digits with leading zeros 01 to 31 - 'D' => 'D', // A textual representation of a day, three letters Mon through Sun - 'j' => 'd', // Day of the month without leading zeros 1 to 31 - 'l' => 'DD', // A full textual representation of the day of the week Sunday through Saturday + 'd' => 'dd', // Day of the month, 2 digits with leading zeros — 01 to 31 + 'D' => 'D', // A textual representation of a day, three letters — Mon through Sun + 'j' => 'd', // Day of the month without leading zeros — 1 to 31 + 'l' => 'DD', // A full textual representation of the day of the week — Sunday through Saturday 'N' => '', // ISO-8601 numeric representation of the day of the week, 1 (for Monday) through 7 (for Sunday) - 'S' => '', // English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j - 'w' => '', // Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday) - 'z' => 'o', // The day of the year (starting from 0) 0 through 365 + 'S' => '', // English ordinal suffix for the day of the month, 2 characters — st, nd, rd or th. Works well with j + 'w' => '', // Numeric representation of the day of the week — 0 (for Sunday) through 6 (for Saturday) + 'z' => 'o', // The day of the year (starting from 0) — 0 through 365 // Week - 'W' => '', // ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0) Example: 42 (the 42nd week in the year) + 'W' => '', // ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0) — Example: 42 (the 42nd week in the year) // Month 'F' => 'MM', // A full textual representation of a month, January through December - 'm' => 'mm', // Numeric representation of a month, with leading zeros 01 through 12 - 'M' => 'M', // A short textual representation of a month, three letters Jan through Dec - 'n' => 'm', // Numeric representation of a month, without leading zeros 1 through 12 - 't' => '', // Number of days in the given month 28 through 31 + 'm' => 'mm', // Numeric representation of a month, with leading zeros — 01 through 12 + 'M' => 'M', // A short textual representation of a month, three letters — Jan through Dec + 'n' => 'm', // Numeric representation of a month, without leading zeros — 1 through 12 + 't' => '', // Number of days in the given month — 28 through 31 // Year 'L' => '', // Whether it's a leap year, 1 if it is a leap year, 0 otherwise. 'o' => '', // ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. - 'Y' => 'yy', // A full numeric representation of a year, 4 digits Examples: 1999 or 2003 - 'y' => 'y', // A two digit representation of a year Examples: 99 or 03 + 'Y' => 'yy', // A full numeric representation of a year, 4 digits — Examples: 1999 or 2003 + 'y' => 'y', // A two digit representation of a year — Examples: 99 or 03 // Time 'a' => '', // Lowercase Ante meridiem and Post meridiem, am or pm 'A' => '', // Uppercase Ante meridiem and Post meridiem, AM or PM, not supported by ICU but we fallback to lowercase - 'B' => '', // Swatch Internet time 000 through 999 - 'g' => '', // 12-hour format of an hour without leading zeros 1 through 12 + 'B' => '', // Swatch Internet time — 000 through 999 + 'g' => '', // 12-hour format of an hour without leading zeros — 1 through 12 'G' => '', // 24-hour format of an hour without leading zeros 0 to 23h 'h' => '', // 12-hour format of an hour with leading zeros, 01 to 12 h 'H' => '', // 24-hour format of an hour with leading zeros, 00 to 23 h - 'i' => '', // Minutes with leading zeros 00 to 59 - 's' => '', // Seconds, with leading zeros 00 through 59 + 'i' => '', // Minutes with leading zeros — 00 to 59 + 's' => '', // Seconds, with leading zeros — 00 through 59 'u' => '', // Microseconds. Example: 654321 // Timezone 'e' => '', // Timezone identifier. Examples: UTC, GMT, Atlantic/Azores diff --git a/framework/helpers/BaseHtml.php b/framework/helpers/BaseHtml.php index 45812e4165b..e610af6ca1f 100644 --- a/framework/helpers/BaseHtml.php +++ b/framework/helpers/BaseHtml.php @@ -1,4 +1,5 @@ '; - $options['style'] = isset($options['style']) ? rtrim($options['style'], ';') . '; display:none' : 'display:none'; + if ($emptyClass !== null) { + $options['class'] = $emptyClass; + } else { + $options['style'] = isset($options['style']) ? rtrim($options['style'], ';') . '; display:none' : 'display:none'; + } } else { $content = ''; } diff --git a/framework/helpers/BaseHtmlPurifier.php b/framework/helpers/BaseHtmlPurifier.php index 2397bff57ad..f707baabaf4 100644 --- a/framework/helpers/BaseHtmlPurifier.php +++ b/framework/helpers/BaseHtmlPurifier.php @@ -1,4 +1,5 @@ charset : 'UTF-8'; } - } diff --git a/framework/helpers/BaseIpHelper.php b/framework/helpers/BaseIpHelper.php index 5ab73a63106..98b97ddd56a 100644 --- a/framework/helpers/BaseIpHelper.php +++ b/framework/helpers/BaseIpHelper.php @@ -1,4 +1,5 @@ 'application/rtf', 'text/xml' => 'application/xml', diff --git a/framework/helpers/mimeExtensions.php b/framework/helpers/mimeExtensions.php index e4936030fd8..8247ff28297 100644 --- a/framework/helpers/mimeExtensions.php +++ b/framework/helpers/mimeExtensions.php @@ -1,4 +1,5 @@ 'ez', 'application/applixware' => 'aw', diff --git a/framework/helpers/mimeTypes.php b/framework/helpers/mimeTypes.php index f895e8d0728..c5ddb934900 100644 --- a/framework/helpers/mimeTypes.php +++ b/framework/helpers/mimeTypes.php @@ -1,4 +1,5 @@ 'application/vnd.lotus-1-2-3', '3dml' => 'text/vnd.in3d.3dml', @@ -1008,7 +1010,7 @@ # fix for bundled libmagic bug, see also https://github.com/yiisoft/yii2/issues/19925 if ((PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80122) || (PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80209)) { - $mimeTypes = array_replace($mimeTypes, array('xz' => 'application/octet-stream')); + $mimeTypes = array_replace($mimeTypes, ['xz' => 'application/octet-stream']); } return $mimeTypes; diff --git a/framework/i18n/DbMessageSource.php b/framework/i18n/DbMessageSource.php index 68f183f0444..f86be386c33 100644 --- a/framework/i18n/DbMessageSource.php +++ b/framework/i18n/DbMessageSource.php @@ -1,4 +1,5 @@ defaultTimeZone)) + new DateTimeZone($this->defaultTimeZone) + ) ) !== false ) { // try Y-m-d format (support invalid dates like 2012-13-01) return $checkDateTimeInfo ? [$timestamp, false, true] : $timestamp; @@ -891,7 +893,8 @@ protected function normalizeDatetimeValue($value, $checkDateTimeInfo = false) ($timestamp = DateTime::createFromFormat( 'Y-m-d H:i:s', $value, - new DateTimeZone($this->defaultTimeZone)) + new DateTimeZone($this->defaultTimeZone) + ) ) !== false ) { // try Y-m-d H:i:s format (support invalid dates like 2012-13-01 12:63:12) return $checkDateTimeInfo ? [$timestamp, true, true] : $timestamp; diff --git a/framework/i18n/GettextFile.php b/framework/i18n/GettextFile.php index 6e320348c31..519d9e1571c 100644 --- a/framework/i18n/GettextFile.php +++ b/framework/i18n/GettextFile.php @@ -1,4 +1,5 @@ bindValues([ + if ( + $command->bindValues([ ':level' => $level, ':category' => $category, ':log_time' => $timestamp, ':prefix' => $this->getMessagePrefix($message), ':message' => $text, - ])->execute() > 0) { + ])->execute() > 0 + ) { continue; } throw new LogRuntimeException('Unable to export log through database!'); diff --git a/framework/log/Dispatcher.php b/framework/log/Dispatcher.php index 11b6b0016a9..c913bc0873f 100644 --- a/framework/log/Dispatcher.php +++ b/framework/log/Dispatcher.php @@ -1,4 +1,5 @@ dbTargets === []) { + if ($this->_dbTargets === []) { $log = Yii::$app->getLog(); $usedTargets = []; @@ -45,17 +46,17 @@ protected function getDbTargets() if (!in_array($currentTarget, $usedTargets, true)) { // do not create same table twice $usedTargets[] = $currentTarget; - $this->dbTargets[] = $target; + $this->_dbTargets[] = $target; } } } - if ($this->dbTargets === []) { + if ($this->_dbTargets === []) { throw new InvalidConfigException('You should configure "log" component to use one or more database targets before executing this migration.'); } } - return $this->dbTargets; + return $this->_dbTargets; } public function up() diff --git a/framework/mail/BaseMailer.php b/framework/mail/BaseMailer.php index e334d74aa9d..ccc37500633 100644 --- a/framework/mail/BaseMailer.php +++ b/framework/mail/BaseMailer.php @@ -1,4 +1,5 @@ '', 'Unknown filter attribute "{attribute}"' => '', 'Unknown option: --{name}' => 'ĐĐŸĐ°ĐœĐžÒ› Ń‚Đ°ĐœĐ»ĐŸĐČ: --{name}', - 'Update' => 'ĐąĐ°ÒłŃ€ĐžŃ€ĐžĐ»Đ°Ńˆ', + 'Update' => 'ĐąĐ°ÒłŃ€ĐžŃ€Đ»Đ°Ńˆ', 'View' => 'Кўрош', 'Yes' => 'ÒČĐ°', 'You are not allowed to perform this action.' => 'ХОзга ушбу Đ°ĐŒĐ°Đ»ĐœĐž Đ±Đ°Đ¶Đ°Ń€ĐžŃˆĐłĐ° Ń€ŃƒÒłŃĐ°Ń‚ Đ±Đ”Ń€ĐžĐ»ĐŒĐ°ĐłĐ°Đœ.', diff --git a/framework/messages/uz/yii.php b/framework/messages/uz/yii.php index cf1a2f612f3..a17617bf489 100644 --- a/framework/messages/uz/yii.php +++ b/framework/messages/uz/yii.php @@ -1,4 +1,5 @@ keyPrefix instanceof Expression) { $expression = strtr($expression, [':prefix' => $this->keyPrefix->expression]); $params = $this->keyPrefix->params; diff --git a/framework/mutex/OracleMutex.php b/framework/mutex/OracleMutex.php index 1e15876edd8..c24c5f20b3f 100644 --- a/framework/mutex/OracleMutex.php +++ b/framework/mutex/OracleMutex.php @@ -1,4 +1,5 @@ from(['fkc' => 'sys.foreign_key_columns']) ->innerJoin(['c' => 'sys.columns'], 'fkc.parent_object_id = c.object_id AND fkc.parent_column_id = c.column_id') ->innerJoin(['r' => 'sys.columns'], 'fkc.referenced_object_id = r.object_id AND fkc.referenced_column_id = r.column_id') - ->andWhere('fkc.parent_object_id=OBJECT_ID(:fkc_parent_object_id)',[':fkc_parent_object_id' => $this->db->schema->getRawTableName($table)]) - ->andWhere('fkc.referenced_object_id=OBJECT_ID(:fkc_referenced_object_id)',[':fkc_referenced_object_id' => $this->db->schema->getRawTableName($referenceTable)]) + ->andWhere('fkc.parent_object_id=OBJECT_ID(:fkc_parent_object_id)', [':fkc_parent_object_id' => $this->db->schema->getRawTableName($table)]) + ->andWhere('fkc.referenced_object_id=OBJECT_ID(:fkc_referenced_object_id)', [':fkc_referenced_object_id' => $this->db->schema->getRawTableName($referenceTable)]) ->andWhere(['c.name' => $column]) ->andWhere(['r.name' => $referenceColumn]) ->scalar($this->db); @@ -77,8 +78,7 @@ public function up() BEGIN DELETE FROM {$schema}.{$authManager->itemChildTable} WHERE parent IN (SELECT name FROM deleted) OR child IN (SELECT name FROM deleted); DELETE FROM {$schema}.{$authManager->itemTable} WHERE name IN (SELECT name FROM deleted); - END;" - ); + END;"); $foreignKey = $this->findForeignKeyName($authManager->itemChildTable, 'child', $authManager->itemTable, 'name'); $this->execute("CREATE TRIGGER {$schema}.trigger_update_{$triggerSuffix} @@ -106,8 +106,7 @@ public function up() BEGIN ALTER TABLE {$authManager->itemChildTable} CHECK CONSTRAINT {$foreignKey}; END - END;" - ); + END;"); } } diff --git a/framework/rest/Action.php b/framework/rest/Action.php index c700d665c8f..ca9accb27cf 100644 --- a/framework/rest/Action.php +++ b/framework/rest/Action.php @@ -1,4 +1,5 @@ dataFile === null) { - if ($this->dataDirectory !== null) { $dataFile = $this->getTableSchema()->fullName . '.php'; } else { diff --git a/framework/test/ArrayFixture.php b/framework/test/ArrayFixture.php index c146ab34e33..faa59c7a539 100644 --- a/framework/test/ArrayFixture.php +++ b/framework/test/ArrayFixture.php @@ -1,4 +1,5 @@ forceMasterDb && method_exists($connection, 'useMaster')) { - $exists = $connection->useMaster(function() use ($relationQuery) { + $exists = $connection->useMaster(function () use ($relationQuery) { return $relationQuery->exists(); }); } else { @@ -328,7 +329,8 @@ private function applyTableAlias($query, $conditions, $alias = null) $prefixedColumn = "{$alias}.[[" . preg_replace( '/^' . preg_quote($alias, '/') . '\.(.*)$/', '$1', - $columnName) . ']]'; + $columnName + ) . ']]'; } else { // there is an expression, can't prefix it reliably $prefixedColumn = $columnName; diff --git a/framework/validators/FileValidator.php b/framework/validators/FileValidator.php index 28d97f9c972..a93814a39ab 100644 --- a/framework/validators/FileValidator.php +++ b/framework/validators/FileValidator.php @@ -1,4 +1,5 @@ range) + if ( + !is_array($this->range) && !($this->range instanceof \Closure) && !($this->range instanceof \Traversable) ) { @@ -75,7 +77,8 @@ protected function validateValue($value) { $in = false; - if ($this->allowArray + if ( + $this->allowArray && ($value instanceof \Traversable || is_array($value)) && ArrayHelper::isSubset($value, $this->range, $this->strict) ) { diff --git a/framework/validators/RegularExpressionValidator.php b/framework/validators/RegularExpressionValidator.php index 747c4d2a9ee..7de28d478b2 100644 --- a/framework/validators/RegularExpressionValidator.php +++ b/framework/validators/RegularExpressionValidator.php @@ -1,4 +1,5 @@ db->useMaster(function() use ($oldID) { + $row = $this->db->useMaster(function () use ($oldID) { return (new Query())->from($this->sessionTable) ->where(['id' => $oldID]) ->createCommand($this->db) diff --git a/framework/web/ErrorAction.php b/framework/web/ErrorAction.php index e59f3ab2453..7ac9b0cbe27 100644 --- a/framework/web/ErrorAction.php +++ b/framework/web/ErrorAction.php @@ -1,4 +1,5 @@ data) + if ( + is_array($response->data) && isset($response->data['data'], $response->data['callback']) ) { $response->content = sprintf( diff --git a/framework/web/Link.php b/framework/web/Link.php index 3f90fc66a28..bf62be8e76c 100644 --- a/framework/web/Link.php +++ b/framework/web/Link.php @@ -1,4 +1,5 @@ getSecureForwardedHeaderTrustedPart('for'); - if ($ip !== null && preg_match( - '/^\[?(?P(?:(?:(?:[0-9a-f]{1,4}:){1,6}(?:[0-9a-f]{1,4})?(?:(?::[0-9a-f]{1,4}){1,6}))|(?:\d{1,3}\.){3}\d{1,3}))\]?(?::(?P\d+))?$/', - $ip, - $matches - )) { + if ( + $ip !== null && preg_match( + '/^\[?(?P(?:(?:(?:[0-9a-f]{1,4}:){1,6}(?:[0-9a-f]{1,4})?(?:(?::[0-9a-f]{1,4}){1,6}))|(?:\d{1,3}\.){3}\d{1,3}))\]?(?::(?P\d+))?$/', + $ip, + $matches + ) + ) { $ip = $this->getUserIpFromIpHeader($matches['ip']); if ($ip !== null) { return $ip; @@ -1286,7 +1292,7 @@ protected function getUserIpFromIpHeader($ips) public function getUserHost() { $userIp = $this->getUserIpFromIpHeaders(); - if($userIp === null) { + if ($userIp === null) { return $this->getRemoteHost(); } return gethostbyaddr($userIp); @@ -1975,8 +1981,7 @@ protected function getSecureForwardedHeaderParts() preg_match_all('/(?:[^",]++|"[^"]++")+/', $forwarded, $forwardedElements); foreach ($forwardedElements[0] as $forwardedPairs) { - preg_match_all('/(?P\w+)\s*=\s*(?:(?P[^",;]*[^",;\s])|"(?P[^"]+)")/', $forwardedPairs, - $matches, PREG_SET_ORDER); + preg_match_all('/(?P\w+)\s*=\s*(?:(?P[^",;]*[^",;\s])|"(?P[^"]+)")/', $forwardedPairs, $matches, PREG_SET_ORDER); $this->_secureForwardedHeaderParts[] = array_reduce($matches, function ($carry, $item) { $value = $item['value']; if (isset($item['value2']) && $item['value2'] !== '') { diff --git a/framework/web/RequestParserInterface.php b/framework/web/RequestParserInterface.php index 44a1051a6dd..cbc02ba731a 100644 --- a/framework/web/RequestParserInterface.php +++ b/framework/web/RequestParserInterface.php @@ -1,4 +1,5 @@ getIsActive()) { if (isset($_SESSION)) { - $this->frozenSessionData = $_SESSION; + $this->_frozenSessionData = $_SESSION; } $this->close(); Yii::info('Session frozen', __METHOD__); @@ -1029,8 +1028,7 @@ protected function freeze() */ protected function unfreeze() { - if (null !== $this->frozenSessionData) { - + if (null !== $this->_frozenSessionData) { YII_DEBUG ? session_start() : @session_start(); if ($this->getIsActive()) { @@ -1041,8 +1039,8 @@ protected function unfreeze() Yii::error($message, __METHOD__); } - $_SESSION = $this->frozenSessionData; - $this->frozenSessionData = null; + $_SESSION = $this->_frozenSessionData; + $this->_frozenSessionData = null; } } diff --git a/framework/web/SessionIterator.php b/framework/web/SessionIterator.php index e4b4c9eb809..433ebd943ac 100644 --- a/framework/web/SessionIterator.php +++ b/framework/web/SessionIterator.php @@ -1,4 +1,5 @@ getRequest(); $canRedirect = !$checkAcceptHeader || $this->checkRedirectAcceptable(); - if ($this->enableSession + if ( + $this->enableSession && $request->getIsGet() && (!$checkAjax || !$request->getIsAjax()) && $canRedirect diff --git a/framework/web/UserEvent.php b/framework/web/UserEvent.php index 34a028910bf..404d2c52d3d 100644 --- a/framework/web/UserEvent.php +++ b/framework/web/UserEvent.php @@ -1,4 +1,5 @@ useTraversableAsArray && !$data instanceof Arrayable) ) { foreach ($data as $name => $value) { diff --git a/framework/web/YiiAsset.php b/framework/web/YiiAsset.php index a66908b8a9d..52a73d795da 100644 --- a/framework/web/YiiAsset.php +++ b/framework/web/YiiAsset.php @@ -1,4 +1,5 @@ + + + + + + + + + + + + + + + + framework/views/* + diff --git a/tests/framework/db/SchemaTest.php b/tests/framework/db/SchemaTest.php index b9074c022f1..d9fdf744a3d 100644 --- a/tests/framework/db/SchemaTest.php +++ b/tests/framework/db/SchemaTest.php @@ -555,7 +555,40 @@ public function testColumnSchemaDbTypecastWithEmptyCharType(): void $this->assertSame('', $columnSchema->dbTypecast('')); } - public function testFindUniqueIndexes(): void + /** + * @dataProvider columnSchemaDbTypecastBooleanPhpTypeProvider + * @param mixed $value + * @param bool $expected + */ + public function testColumnSchemaDbTypecastBooleanPhpType($value, $expected) + { + $columnSchema = new ColumnSchema(['phpType' => Schema::TYPE_BOOLEAN]); + $this->assertSame($expected, $columnSchema->dbTypecast($value)); + } + + public function columnSchemaDbTypecastBooleanPhpTypeProvider() + { + return [ + [1, true], + [0, false], + ['1', true], + ['0', false], + + // https://github.com/yiisoft/yii2/issues/9006 + ["\1", true], + ["\0", false], + + // https://github.com/yiisoft/yii2/pull/20122 + ['TRUE', true], + ['FALSE', false], + ['true', true], + ['false', false], + ['True', true], + ['False', false], + ]; + } + + public function testFindUniqueIndexes() { if ($this->driverName === 'sqlsrv') { $this->markTestSkipped('`\yii\db\mssql\Schema::findUniqueIndexes()` returns only unique constraints not unique indexes.'); diff --git a/tests/framework/helpers/HtmlTest.php b/tests/framework/helpers/HtmlTest.php index ed35f05c4bc..c5fabd9b5fb 100644 --- a/tests/framework/helpers/HtmlTest.php +++ b/tests/framework/helpers/HtmlTest.php @@ -1630,6 +1630,11 @@ function ($model): void { $model->addError('name', 'Error message. Here are even more chars: ""'); }, ], + [ + 'empty_class', + ['emptyClass' => 'd-none'], + '

Please fix the following errors:

    ', + ], ]; } diff --git a/tests/framework/log/TargetTest.php b/tests/framework/log/TargetTest.php index c6cceb3eaf4..bd422af738f 100644 --- a/tests/framework/log/TargetTest.php +++ b/tests/framework/log/TargetTest.php @@ -75,7 +75,12 @@ public function testFilter(array $filter, array $expected): void $logger->log('testH', Logger::LEVEL_ERROR, 'yii.db.Command.whatever'); $logger->log('testI', Logger::LEVEL_ERROR, 'yii\db\Command::query'); - $this->assertEquals(count($expected), count(static::$messages), 'Expected ' . implode(',', $expected) . ', got ' . implode(',', array_column(static::$messages, 0))); + $messageColumn = []; + foreach (static::$messages as $message) { + $messageColumn[] = $message[0]; + } + + $this->assertEquals(count($expected), count(static::$messages), 'Expected ' . implode(',', $expected) . ', got ' . implode(',', $messageColumn)); $i = 0; foreach ($expected as $e) { $this->assertEquals('test' . $e, static::$messages[$i++][0]);