diff --git a/app/vendor/adodb/adodb-php/adodb.inc.php b/app/vendor/adodb/adodb-php/adodb.inc.php index f15158f94..703c2f9fc 100644 --- a/app/vendor/adodb/adodb-php/adodb.inc.php +++ b/app/vendor/adodb/adodb-php/adodb.inc.php @@ -198,7 +198,7 @@ function ADODB_Setup() { /** * ADODB version as a string. */ - $ADODB_vers = 'v5.21.2 2021-08-22'; + $ADODB_vers = 'v5.21.3 2021-10-31'; /** * Determines whether recordset->RecordCount() is used. @@ -1672,17 +1672,19 @@ function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0) { // 0 to offset-1 which will be discarded anyway. So we disable $ADODB_COUNTRECS. global $ADODB_COUNTRECS; - $savec = $ADODB_COUNTRECS; - $ADODB_COUNTRECS = false; + try { + $savec = $ADODB_COUNTRECS; + $ADODB_COUNTRECS = false; - - if ($secs2cache != 0) { - $rs = $this->CacheExecute($secs2cache,$sql,$inputarr); - } else { - $rs = $this->Execute($sql,$inputarr); + if ($secs2cache != 0) { + $rs = $this->CacheExecute($secs2cache, $sql, $inputarr); + } else { + $rs = $this->Execute($sql, $inputarr); + } + } finally { + $ADODB_COUNTRECS = $savec; } - $ADODB_COUNTRECS = $savec; if ($rs && !$rs->EOF) { $rs = $this->_rs2rs($rs,$nrows,$offset); } @@ -1829,11 +1831,15 @@ public function CacheGetAssoc($secs2cache, $sql = false, $inputarr = false,$forc public function GetOne($sql, $inputarr=false) { global $ADODB_COUNTRECS,$ADODB_GETONE_EOF; - $crecs = $ADODB_COUNTRECS; - $ADODB_COUNTRECS = false; + try { + $crecs = $ADODB_COUNTRECS; + $ADODB_COUNTRECS = false; + $rs = $this->Execute($sql, $inputarr); + } finally { + $ADODB_COUNTRECS = $crecs; + } $ret = false; - $rs = $this->Execute($sql,$inputarr); if ($rs) { if ($rs->EOF) { $ret = $ADODB_GETONE_EOF; @@ -1843,7 +1849,6 @@ public function GetOne($sql, $inputarr=false) { $rs->Close(); } - $ADODB_COUNTRECS = $crecs; return $ret; } @@ -1972,10 +1977,14 @@ function OffsetDate($dayFraction,$date=false) { function GetArray($sql,$inputarr=false) { global $ADODB_COUNTRECS; - $savec = $ADODB_COUNTRECS; - $ADODB_COUNTRECS = false; - $rs = $this->Execute($sql,$inputarr); - $ADODB_COUNTRECS = $savec; + try { + $savec = $ADODB_COUNTRECS; + $ADODB_COUNTRECS = false; + $rs = $this->Execute($sql, $inputarr); + } finally { + $ADODB_COUNTRECS = $savec; + } + if (!$rs) if (defined('ADODB_PEAR')) { return ADODB_PEAR_Error(); @@ -1994,10 +2003,13 @@ function CacheGetAll($secs2cache,$sql=false,$inputarr=false) { function CacheGetArray($secs2cache,$sql=false,$inputarr=false) { global $ADODB_COUNTRECS; - $savec = $ADODB_COUNTRECS; - $ADODB_COUNTRECS = false; - $rs = $this->CacheExecute($secs2cache,$sql,$inputarr); - $ADODB_COUNTRECS = $savec; + try { + $savec = $ADODB_COUNTRECS; + $ADODB_COUNTRECS = false; + $rs = $this->CacheExecute($secs2cache, $sql, $inputarr); + } finally { + $ADODB_COUNTRECS = $savec; + } if (!$rs) if (defined('ADODB_PEAR')) { @@ -2028,12 +2040,14 @@ function GetRandRow($sql, $arr= false) { function GetRow($sql,$inputarr=false) { global $ADODB_COUNTRECS; - $crecs = $ADODB_COUNTRECS; - $ADODB_COUNTRECS = false; - - $rs = $this->Execute($sql,$inputarr); + try { + $crecs = $ADODB_COUNTRECS; + $ADODB_COUNTRECS = false; + $rs = $this->Execute($sql, $inputarr); + } finally { + $ADODB_COUNTRECS = $crecs; + } - $ADODB_COUNTRECS = $crecs; if ($rs) { if (!$rs->EOF) { $arr = $rs->fields; diff --git a/app/vendor/adodb/adodb-php/docs/changelog.md b/app/vendor/adodb/adodb-php/docs/changelog.md index 9ed825b0b..17664a955 100644 --- a/app/vendor/adodb/adodb-php/docs/changelog.md +++ b/app/vendor/adodb/adodb-php/docs/changelog.md @@ -14,6 +14,18 @@ Older changelogs: -------------------------------------------------------------------------------- +## [5.21.3] - 2021-10-31 + +### Fixed + +- core: Ensure temp $ADODB_COUNTRECS changes really are temporary + [#761](https://github.com/ADOdb/ADOdb/issues/761) +- mysqli: force error reporting mode to OFF (PHP 8.1 compatibility) + [#755](https://github.com/ADOdb/ADOdb/issues/755) +- pdo: fix metaIndexes declaration to match parent + [#717](https://github.com/ADOdb/ADOdb/issues/717) + + ## [5.21.2] - 2021-08-22 ### Fixed @@ -1117,6 +1129,9 @@ Released together with [v4.95](changelog_v4.x.md#495---17-may-2007) - Adodb5 version,more error checking code now will use exceptions if available. +[Unreleased]: https://github.com/adodb/adodb/compare/v5.21.3...master + +[5.21.3]: https://github.com/adodb/adodb/compare/v5.21.2...v5.21.3 [5.21.2]: https://github.com/adodb/adodb/compare/v5.21.1...v5.21.2 [5.21.1]: https://github.com/adodb/adodb/compare/v5.21.0...v5.21.1 [5.21.0]: https://github.com/adodb/adodb/compare/v5.21.0-rc.1...v5.21.0 diff --git a/app/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php b/app/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php index 352810cc0..160f5fa34 100644 --- a/app/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php +++ b/app/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php @@ -81,12 +81,25 @@ class ADODB_mysqli extends ADOConnection { */ private $usePreparedStatement = false; private $useLastInsertStatement = false; - + /** * @var bool True if the last executed statement is a SELECT {@see _query()} */ private $isSelectStatement = false; + /** + * ADODB_mysqli constructor. + */ + public function __construct() + { + parent::__construct(); + + // Forcing error reporting mode to OFF, which is no longer the default + // starting with PHP 8.1 (see #755) + mysqli_report(MYSQLI_REPORT_OFF); + } + + /** * Sets the isolation level of a transaction. * @@ -1126,7 +1139,7 @@ function _query($sql, $inputarr) return $mysql_res; */ - + if ($this->multiQuery) { $rs = mysqli_multi_query($this->_connectionID, $sql.';'); if ($rs) { diff --git a/app/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php b/app/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php index 0933bf144..cf8e4e264 100644 --- a/app/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php +++ b/app/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php @@ -273,10 +273,10 @@ function MetaColumns($table,$normalize=true) return $this->_driver->MetaColumns($table,$normalize); } - public function metaIndexes($table,$normalize=true) + public function metaIndexes($table,$normalize=true,$owner=false) { if (method_exists($this->_driver,'metaIndexes')) - return $this->_driver->metaIndexes($table,$normalize); + return $this->_driver->metaIndexes($table,$normalize,$owner); } /** diff --git a/app/vendor/cakephp/bake/composer.json b/app/vendor/cakephp/bake/composer.json index 881764551..f6429f021 100644 --- a/app/vendor/cakephp/bake/composer.json +++ b/app/vendor/cakephp/bake/composer.json @@ -41,8 +41,7 @@ "Pastry\\PastryTest\\": "tests/test_app/Plugin/PastryTest/src/", "WithBakeSubFolder\\": "tests/test_app/Plugin/WithBakeSubFolder/src/", "Bake\\Test\\": "tests/", - "Bake\\Test\\App\\": "tests/test_app/App/", - "Cake\\Test\\": "vendor/cakephp/cakephp/tests/" + "Bake\\Test\\App\\": "tests/test_app/App/" } }, "scripts": { @@ -53,7 +52,7 @@ "cs-check": "phpcs --parallel=16 -p src/ tests/", "cs-fix": "phpcbf --parallel=16 -p src/ tests/", "stan": "phpstan analyse src/ && psalm.phar", - "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:0.12.82 psalm/phar:~4.7.0 && mv composer.backup composer.json", + "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12 psalm/phar:~4.11.0 && mv composer.backup composer.json", "test": "phpunit", "test-coverage": "phpunit --coverage-clover=clover.xml" } diff --git a/app/vendor/cakephp/bake/docs/config/all.py b/app/vendor/cakephp/bake/docs/config/all.py index 9e899be5b..260522630 100644 --- a/app/vendor/cakephp/bake/docs/config/all.py +++ b/app/vendor/cakephp/bake/docs/config/all.py @@ -32,7 +32,7 @@ # The GitHub branch name for this version of the docs # for edit links to point at. -branch = 'master' +branch = '2.x' # Current version being built version = '2.x' diff --git a/app/vendor/cakephp/bake/src/Command/FixtureCommand.php b/app/vendor/cakephp/bake/src/Command/FixtureCommand.php index 1a9dfc1d8..784bf11ce 100644 --- a/app/vendor/cakephp/bake/src/Command/FixtureCommand.php +++ b/app/vendor/cakephp/bake/src/Command/FixtureCommand.php @@ -22,7 +22,6 @@ use Cake\Console\Arguments; use Cake\Console\ConsoleIo; use Cake\Console\ConsoleOptionParser; -use Cake\Console\Exception\StopException; use Cake\Core\Configure; use Cake\Database\Exception; use Cake\Database\Schema\TableSchemaInterface; @@ -168,7 +167,7 @@ protected function bake(string $model, string $useTable, Arguments $args, Consol $data = $this->readSchema($model, $useTable); } - $this->validateNames($data); + $this->validateNames($data, $io); if ($modelImport === null) { $schema = $this->_generateSchema($data); @@ -214,15 +213,16 @@ public function readSchema(string $name, string $table): TableSchemaInterface * Validates table and column names are supported. * * @param \Cake\Database\Schema\TableSchemaInterface $schema Table schema + * @param \Cake\Console\ConsoleIo $io Console io * @return void * @throws \Cake\Console\Exception\StopException When table or column names are not supported */ - public function validateNames(TableSchemaInterface $schema): void + public function validateNames(TableSchemaInterface $schema, ConsoleIo $io): void { foreach ($schema->columns() as $column) { - if (!is_string($column) || !ctype_alpha($column[0])) { - throw new StopException(sprintf( - 'Unable to bake table with integer column names or names that start with digits. Found `%s`.', + if (!is_string($column) || (!ctype_alpha($column[0]) && $column[0] !== '_')) { + $io->abort(sprintf( + 'Unable to bake model. Table column names must start with a letter or underscore. Found `%s`.', (string)$column )); } diff --git a/app/vendor/cakephp/bake/src/Command/ModelCommand.php b/app/vendor/cakephp/bake/src/Command/ModelCommand.php index ccca5bfcc..baae712e5 100644 --- a/app/vendor/cakephp/bake/src/Command/ModelCommand.php +++ b/app/vendor/cakephp/bake/src/Command/ModelCommand.php @@ -21,7 +21,6 @@ use Cake\Console\Arguments; use Cake\Console\ConsoleIo; use Cake\Console\ConsoleOptionParser; -use Cake\Console\Exception\StopException; use Cake\Core\Configure; use Cake\Database\Connection; use Cake\Database\Driver\Sqlserver; @@ -109,7 +108,7 @@ public function bake(string $name, Arguments $args, ConsoleIo $io): void { $table = $this->getTable($name, $args); $tableObject = $this->getTableObject($name, $table); - $this->validateNames($tableObject->getSchema()); + $this->validateNames($tableObject->getSchema(), $io); $data = $this->getTableContext($tableObject, $table, $name, $args, $io); $this->bakeTable($tableObject, $data, $args, $io); $this->bakeEntity($tableObject, $data, $args, $io); @@ -121,15 +120,16 @@ public function bake(string $name, Arguments $args, ConsoleIo $io): void * Validates table and column names are supported. * * @param \Cake\Database\Schema\TableSchemaInterface $schema Table schema + * @param \Cake\Console\ConsoleIo $io Console io * @return void * @throws \Cake\Console\Exception\StopException When table or column names are not supported */ - public function validateNames(TableSchemaInterface $schema): void + public function validateNames(TableSchemaInterface $schema, ConsoleIo $io): void { foreach ($schema->columns() as $column) { - if (!is_string($column) || !ctype_alpha($column[0])) { - throw new StopException(sprintf( - 'Unable to bake table with integer column names or names that start with digits. Found `%s`.', + if (!is_string($column) || (!ctype_alpha($column[0]) && $column[0] !== '_')) { + $io->abort(sprintf( + 'Unable to bake model. Table column names must start with a letter or underscore. Found `%s`.', (string)$column )); } diff --git a/app/vendor/cakephp/bake/tests/Fixture/ArticlesFixture.php b/app/vendor/cakephp/bake/tests/Fixture/ArticlesFixture.php new file mode 100644 index 000000000..7a8637cf5 --- /dev/null +++ b/app/vendor/cakephp/bake/tests/Fixture/ArticlesFixture.php @@ -0,0 +1,26 @@ + 1, 'title' => 'First Article', 'body' => 'First Article Body', 'published' => 'Y'], + ['author_id' => 3, 'title' => 'Second Article', 'body' => 'Second Article Body', 'published' => 'Y'], + ['author_id' => 1, 'title' => 'Third Article', 'body' => 'Third Article Body', 'published' => 'Y'], + ]; +} diff --git a/app/vendor/cakephp/bake/tests/Fixture/ArticlesTagsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/ArticlesTagsFixture.php new file mode 100644 index 000000000..41ab1499d --- /dev/null +++ b/app/vendor/cakephp/bake/tests/Fixture/ArticlesTagsFixture.php @@ -0,0 +1,21 @@ + 'mariano'], + ['name' => 'nate'], + ['name' => 'larry'], + ['name' => 'garrett'], + ]; +} diff --git a/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php index 48170c9ea..3473d942b 100644 --- a/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php +++ b/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php @@ -23,7 +23,7 @@ class BakeTemplateAuthorsFixture extends TestFixture { /** - * Avoid overriding core.authors + * Avoid overriding AuthorsFixture's table. * * @var string */ diff --git a/app/vendor/cakephp/bake/tests/Fixture/CommentsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/CommentsFixture.php new file mode 100644 index 000000000..eecb7608e --- /dev/null +++ b/app/vendor/cakephp/bake/tests/Fixture/CommentsFixture.php @@ -0,0 +1,29 @@ + 1, 'user_id' => 2, 'comment' => 'First Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:45:23', 'updated' => '2007-03-18 10:47:31'], + ['article_id' => 1, 'user_id' => 4, 'comment' => 'Second Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'], + ['article_id' => 1, 'user_id' => 1, 'comment' => 'Third Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:49:23', 'updated' => '2007-03-18 10:51:31'], + ['article_id' => 1, 'user_id' => 1, 'comment' => 'Fourth Comment for First Article', 'published' => 'N', 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31'], + ['article_id' => 2, 'user_id' => 1, 'comment' => 'First Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:53:23', 'updated' => '2007-03-18 10:55:31'], + ['article_id' => 2, 'user_id' => 2, 'comment' => 'Second Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:55:23', 'updated' => '2007-03-18 10:57:31'], + ]; +} diff --git a/app/vendor/cakephp/bake/tests/Fixture/PostsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/PostsFixture.php new file mode 100644 index 000000000..85478bb3b --- /dev/null +++ b/app/vendor/cakephp/bake/tests/Fixture/PostsFixture.php @@ -0,0 +1,26 @@ + 1, 'title' => 'First Post', 'body' => 'First Post Body', 'published' => 'Y'], + ['author_id' => 3, 'title' => 'Second Post', 'body' => 'Second Post Body', 'published' => 'Y'], + ['author_id' => 1, 'title' => 'Third Post', 'body' => 'Third Post Body', 'published' => 'Y'], + ]; +} diff --git a/app/vendor/cakephp/bake/tests/Fixture/TagsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/TagsFixture.php new file mode 100644 index 000000000..6d904d111 --- /dev/null +++ b/app/vendor/cakephp/bake/tests/Fixture/TagsFixture.php @@ -0,0 +1,26 @@ + 'tag1', 'description' => 'A big description', 'created' => '2016-01-01 00:00'], + ['name' => 'tag2', 'description' => 'Another big description', 'created' => '2016-01-01 00:00'], + ['name' => 'tag3', 'description' => 'Yet another one', 'created' => '2016-01-01 00:00'], + ]; +} diff --git a/app/vendor/cakephp/bake/tests/bootstrap.php b/app/vendor/cakephp/bake/tests/bootstrap.php index 4c4e3d14d..e214799cf 100644 --- a/app/vendor/cakephp/bake/tests/bootstrap.php +++ b/app/vendor/cakephp/bake/tests/bootstrap.php @@ -20,6 +20,8 @@ use Cake\Core\Configure; use Cake\Core\Plugin; use Cake\Datasource\ConnectionManager; +use Cake\Error\Debug\TextFormatter; +use Cake\TestSuite\Fixture\SchemaLoader; $findRoot = function ($root) { do { @@ -75,4 +77,12 @@ } ConnectionManager::setConfig('test', ['url' => getenv('DB_URL')]); +// Create test database schema +if (env('FIXTURE_SCHEMA_METADATA')) { + $loader = new SchemaLoader(); + $loader->loadInternalFile(env('FIXTURE_SCHEMA_METADATA')); +} + +Configure::write('Debugger.exportFormatter', TextFormatter::class); + Plugin::getCollection()->add(new \Bake\Plugin()); diff --git a/app/vendor/cakephp/bake/tests/schema.php b/app/vendor/cakephp/bake/tests/schema.php new file mode 100644 index 000000000..c0891568f --- /dev/null +++ b/app/vendor/cakephp/bake/tests/schema.php @@ -0,0 +1,514 @@ + 'authors', + 'columns' => [ + 'id' => [ + 'type' => 'integer', + ], + 'name' => [ + 'type' => 'string', + 'default' => null, + ], + ], + 'constraints' => [ + 'primary' => [ + 'type' => 'primary', + 'columns' => [ + 'id', + ], + ], + ], + ], + [ + 'table' => 'tags', + 'columns' => [ + 'id' => [ + 'type' => 'integer', + 'null' => false, + ], + 'name' => [ + 'type' => 'string', + 'null' => false, + ], + 'description' => [ + 'type' => 'text', + 'length' => 16777215, + ], + 'created' => [ + 'type' => 'datetime', + 'null' => true, + 'default' => null, + ], + ], + 'constraints' => [ + 'primary' => [ + 'type' => 'primary', + 'columns' => [ + 'id', + ], + ], + ], + ], + [ + 'table' => 'articles', + 'columns' => [ + 'id' => [ + 'type' => 'integer', + ], + 'author_id' => [ + 'type' => 'integer', + 'null' => true, + ], + 'title' => [ + 'type' => 'string', + 'null' => true, + ], + 'body' => 'text', + 'published' => [ + 'type' => 'string', + 'length' => 1, + 'default' => 'N', + ], + ], + 'constraints' => [ + 'primary' => [ + 'type' => 'primary', + 'columns' => [ + 'id', + ], + ], + ], + ], + [ + 'table' => 'articles_tags', + 'columns' => [ + 'article_id' => [ + 'type' => 'integer', + 'null' => false, + ], + 'tag_id' => [ + 'type' => 'integer', + 'null' => false, + ], + ], + 'constraints' => [ + 'unique_tag' => [ + 'type' => 'primary', + 'columns' => [ + 'article_id', + 'tag_id', + ], + ], + 'tag_id_fk' => [ + 'type' => 'foreign', + 'columns' => [ + 'tag_id', + ], + 'references' => [ + 'tags', + 'id', + ], + 'update' => 'cascade', + 'delete' => 'cascade', + ], + ], + ], + [ + 'table' => 'posts', + 'columns' => [ + 'id' => [ + 'type' => 'integer', + ], + 'author_id' => [ + 'type' => 'integer', + 'null' => false, + ], + 'title' => [ + 'type' => 'string', + 'null' => false, + ], + 'body' => 'text', + 'published' => [ + 'type' => 'string', + 'length' => 1, + 'default' => 'N', + ], + ], + 'constraints' => [ + 'primary' => [ + 'type' => 'primary', + 'columns' => [ + 'id', + ], + ], + ], + ], + [ + 'table' => 'comments', + 'columns' => [ + 'id' => [ + 'type' => 'integer', + ], + 'article_id' => [ + 'type' => 'integer', + 'null' => false, + ], + 'user_id' => [ + 'type' => 'integer', + 'null' => false, + ], + 'comment' => [ + 'type' => 'text', + ], + 'published' => [ + 'type' => 'string', + 'length' => 1, + 'default' => 'N', + ], + 'created' => [ + 'type' => 'datetime', + ], + 'updated' => [ + 'type' => 'datetime', + ], + ], + 'constraints' => [ + 'primary' => [ + 'type' => 'primary', + 'columns' => [ + 'id', + ], + ], + ], + ], + [ + 'table' => 'bake_articles_bake_tags', + 'columns' => [ + 'bake_article_id' => ['type' => 'integer', 'null' => false], + 'bake_tag_id' => ['type' => 'integer', 'null' => false], + ], + 'constraints' => ['UNIQUE_TAG' => ['type' => 'unique', 'columns' => ['bake_article_id', 'bake_tag_id']]], + ], + [ + 'table' => 'bake_articles', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'bake_user_id' => ['type' => 'integer', 'null' => false], + 'title' => ['type' => 'string', 'length' => 50, 'null' => false], + 'body' => 'text', + 'rating' => ['type' => 'float', 'unsigned' => true, 'default' => 0.0, 'null' => false], + 'score' => ['type' => 'decimal', 'unsigned' => true, 'default' => 0.0, 'null' => false], + 'published' => ['type' => 'boolean', 'length' => 1, 'default' => false, 'null' => false], + 'created' => 'datetime', + 'updated' => 'datetime', + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'car', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'bake_user_id' => ['type' => 'integer', 'null' => false], + 'title' => ['type' => 'string', 'null' => false], + 'body' => 'text', + 'published' => ['type' => 'boolean', 'length' => 1, 'default' => false], + 'created' => 'datetime', + 'updated' => 'datetime', + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'bake_comments', + 'columns' => [ + 'otherid' => ['type' => 'integer'], + 'bake_article_id' => ['type' => 'integer', 'null' => false], + 'bake_user_id' => ['type' => 'integer', 'null' => false], + 'comment' => 'text', + 'published' => ['type' => 'string', 'length' => 1, 'default' => 'N'], + 'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], + 'updated' => ['type' => 'datetime', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['otherid']]], + ], + [ + 'table' => 'bake_tags', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'tag' => ['type' => 'string', 'null' => false], + 'created' => 'datetime', + 'updated' => 'datetime', + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'bake_authors', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'role_id' => ['type' => 'integer', 'null' => false], + 'name' => ['type' => 'string', 'default' => null], + 'description' => ['type' => 'text', 'default' => null], + 'member' => ['type' => 'boolean'], + 'member_number' => ['type' => 'integer', 'null' => true], + 'account_balance' => ['type' => 'decimal', 'null' => true, 'precision' => 2, 'length' => 12], + 'created' => 'datetime', + 'modified' => 'datetime', + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'profiles', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'author_id' => ['type' => 'integer', 'null' => false], + 'nick' => ['type' => 'string', 'null' => false], + 'avatar' => ['type' => 'string', 'default' => null], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'roles', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'name' => ['type' => 'string', 'null' => false], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'binary_tests', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'byte' => ['type' => 'binary', 'length' => 1], + 'data' => ['type' => 'binary', 'length' => 300], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'categories', + 'columns' => [ + 'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], + 'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], + 'modified' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], + 'name' => ['type' => 'string', 'length' => 100, 'null' => false, 'default' => '', 'comment' => '', 'precision' => null, 'fixed' => null], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'categories_products', + 'columns' => [ + 'category_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], + 'product_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['category_id', 'product_id'], 'length' => []]], + ], + [ + 'table' => 'category_threads', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'parent_id' => ['type' => 'integer'], + 'name' => ['type' => 'string', 'null' => false], + 'lft' => ['type' => 'integer', 'unsigned' => true], + 'rght' => ['type' => 'integer', 'unsigned' => true], + 'created' => 'datetime', + 'updated' => 'datetime', + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'datatypes', + 'columns' => [ + 'id' => ['type' => 'integer', 'null' => false], + 'decimal_field' => ['type' => 'decimal', 'length' => '6', 'precision' => 3, 'default' => '0.000'], + 'float_field' => ['type' => 'float', 'length' => '5,2', 'null' => false, 'default' => null], + 'huge_int' => ['type' => 'biginteger'], + 'small_int' => ['type' => 'smallinteger'], + 'tiny_int' => ['type' => 'tinyinteger'], + 'bool' => ['type' => 'boolean', 'null' => false, 'default' => false], + 'uuid' => ['type' => 'uuid'], + 'timestamp_field' => ['type' => 'timestamp'], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'hidden_fields', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'password' => ['type' => 'string', 'null' => true, 'length' => 255], + 'auth_token' => ['type' => 'string', 'null' => true, 'length' => 255], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'users', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'username' => ['type' => 'string', 'null' => true, 'length' => 255], + 'password' => ['type' => 'string', 'null' => true, 'length' => 255], + 'created' => ['type' => 'timestamp', 'null' => true], + 'updated' => ['type' => 'timestamp', 'null' => true], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'invitations', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'sender_id' => ['type' => 'integer', 'null' => false], + 'receiver_id' => ['type' => 'integer', 'null' => false], + 'body' => 'text', + 'created' => 'datetime', + 'updated' => 'datetime', + ], + 'constraints' => [ + 'primary' => ['type' => 'primary', 'columns' => ['id']], + 'sender_idx' => [ + 'type' => 'foreign', + 'columns' => ['sender_id'], + 'references' => ['users', 'id'], + 'update' => 'noAction', + 'delete' => 'noAction', + ], + 'receiver_idx' => [ + 'type' => 'foreign', + 'columns' => ['receiver_id'], + 'references' => ['users', 'id'], + 'update' => 'noAction', + 'delete' => 'noAction', + ], + ], + ], + [ + 'table' => 'number_trees', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'name' => ['type' => 'string', 'length' => 50, 'null' => false], + 'parent_id' => 'integer', + 'lft' => ['type' => 'integer', 'unsigned' => true], + 'rght' => ['type' => 'integer', 'unsigned' => true], + 'depth' => ['type' => 'integer', 'unsigned' => true], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'old_products', + 'columns' => [ + 'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], + 'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], + 'modified' => ['type' => 'datetime', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null], + 'name' => ['type' => 'string', 'length' => 100, 'null' => false, 'default' => '', 'comment' => '', 'precision' => null, 'fixed' => null], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []]], + ], + [ + 'table' => 'products', + 'columns' => [ + 'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], + 'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], + 'modified' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], + 'name' => ['type' => 'string', 'length' => 100, 'null' => false, 'default' => '', 'comment' => '', 'precision' => null, 'fixed' => null], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []]], + ], + [ + 'table' => 'product_versions', + 'columns' => [ + 'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], + 'product_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], + 'version' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []]], + ], + [ + 'table' => 'todo_items', + 'columns' => [ + 'id' => ['type' => 'integer', 'null' => false], + 'user_id' => ['type' => 'integer', 'null' => false], + 'title' => ['type' => 'string', 'length' => 50, 'null' => false], + 'body' => ['type' => 'text'], + 'effort' => ['type' => 'decimal', 'default' => 0, 'null' => false], + 'completed' => ['type' => 'boolean', 'default' => false, 'null' => false], + 'todo_task_count' => ['type' => 'integer', 'default' => 0, 'null' => false], + 'created' => ['type' => 'datetime'], + 'updated' => ['type' => 'datetime'], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'todo_labels', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'label' => ['type' => 'string', 'null' => false], + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], + ], + [ + 'table' => 'todo_items_todo_labels', + 'columns' => [ + 'todo_item_id' => ['type' => 'integer', 'null' => false], + 'todo_label_id' => ['type' => 'integer', 'null' => false], + ], + 'constraints' => [ + 'primary' => ['type' => 'primary', 'columns' => ['todo_item_id', 'todo_label_id']], + 'item_fk' => [ + 'type' => 'foreign', + 'columns' => ['todo_item_id'], + 'references' => ['todo_items', 'id'], + 'update' => 'cascade', + 'delete' => 'cascade', + ], + 'label_fk' => [ + 'type' => 'foreign', + 'columns' => ['todo_label_id'], + 'references' => ['todo_labels', 'id'], + 'update' => 'cascade', + 'delete' => 'cascade', + ], + ], + ], + [ + 'table' => 'todo_tasks', + 'columns' => [ + 'uid' => ['type' => 'integer'], + 'todo_item_id' => ['type' => 'integer', 'null' => false], + 'title' => ['type' => 'string', 'length' => 50, 'null' => false], + 'body' => 'text', + 'completed' => ['type' => 'boolean', 'default' => false, 'null' => false], + 'effort' => ['type' => 'decimal', 'default' => 0.0, 'null' => false, 'unsigned' => true], + 'created' => 'datetime', + 'updated' => 'datetime', + ], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['uid']]], + ], + [ + 'table' => 'unique_fields', + 'columns' => [ + 'id' => ['type' => 'integer'], + 'username' => ['type' => 'string', 'null' => true, 'length' => 255], + 'email' => ['type' => 'string', 'null' => true, 'length' => 255], + 'field_1' => ['type' => 'string', 'null' => true, 'length' => 255], + 'field_2' => ['type' => 'string', 'null' => true,'length' => 255], + ], + 'constraints' => [ + 'primary' => [ + 'type' => 'primary', + 'columns' => ['id'], + ], + 'multiple_fields_unique' => [ + 'type' => 'unique', + 'columns' => [ + 'field_1', + 'field_2', + ], + ], + ], + ], +]; diff --git a/app/vendor/cakephp/cakephp/VERSION.txt b/app/vendor/cakephp/cakephp/VERSION.txt index 71215e8c5..78dc4583c 100644 --- a/app/vendor/cakephp/cakephp/VERSION.txt +++ b/app/vendor/cakephp/cakephp/VERSION.txt @@ -16,4 +16,4 @@ // @license https://opensource.org/licenses/mit-license.php MIT License // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -4.3.0 +4.3.1 diff --git a/app/vendor/cakephp/cakephp/composer.json b/app/vendor/cakephp/cakephp/composer.json index ef3bd4b9b..fc8677c76 100644 --- a/app/vendor/cakephp/cakephp/composer.json +++ b/app/vendor/cakephp/cakephp/composer.json @@ -31,6 +31,7 @@ "laminas/laminas-diactoros": "^2.2.2", "laminas/laminas-httphandlerrunner": "^1.1", "league/container": "^4.1.1", + "psr/container": "^2.0", "psr/http-client": "^1.0", "psr/http-server-handler": "^1.0", "psr/http-server-middleware": "^1.0", @@ -110,7 +111,7 @@ "@psalm" ], "stan-tests": "phpstan.phar analyze -c tests/phpstan.neon", - "stan-setup": "cp composer.json composer.backup && composer require --dev symfony/polyfill-php81 phpstan/phpstan:0.12.96 psalm/phar:~4.10.0 && mv composer.backup composer.json", + "stan-setup": "cp composer.json composer.backup && composer require --dev symfony/polyfill-php81 phpstan/phpstan:~1.0.0 psalm/phar:~4.11.0 && mv composer.backup composer.json", "test": "phpunit", "test-coverage": "phpunit --coverage-clover=clover.xml" }, diff --git a/app/vendor/cakephp/cakephp/src/Auth/BasicAuthenticate.php b/app/vendor/cakephp/cakephp/src/Auth/BasicAuthenticate.php index b7ff21612..4e55bf1c0 100644 --- a/app/vendor/cakephp/cakephp/src/Auth/BasicAuthenticate.php +++ b/app/vendor/cakephp/cakephp/src/Auth/BasicAuthenticate.php @@ -59,7 +59,7 @@ class BasicAuthenticate extends BaseAuthenticate * * @param \Cake\Http\ServerRequest $request The request to authenticate with. * @param \Cake\Http\Response $response The response to add headers to. - * @return array|false Either false on failure, or an array of user data on success. + * @return array|false Either false on failure, or an array of user data on success. */ public function authenticate(ServerRequest $request, Response $response) { diff --git a/app/vendor/cakephp/cakephp/src/Auth/PasswordHasherFactory.php b/app/vendor/cakephp/cakephp/src/Auth/PasswordHasherFactory.php index 7bdc352b1..06bebc0e1 100644 --- a/app/vendor/cakephp/cakephp/src/Auth/PasswordHasherFactory.php +++ b/app/vendor/cakephp/cakephp/src/Auth/PasswordHasherFactory.php @@ -27,7 +27,7 @@ class PasswordHasherFactory /** * Returns password hasher object out of a hasher name or a configuration array * - * @param array|string $passwordHasher Name of the password hasher or an array with + * @param array|string $passwordHasher Name of the password hasher or an array with * at least the key `className` set to the name of the class to use * @return \Cake\Auth\AbstractPasswordHasher Password hasher instance * @throws \RuntimeException If password hasher class not found or diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleInputArgument.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleInputArgument.php index ad9ffc73a..6a39e3e98 100644 --- a/app/vendor/cakephp/cakephp/src/Console/ConsoleInputArgument.php +++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleInputArgument.php @@ -58,7 +58,7 @@ class ConsoleInputArgument /** * Make a new Input Argument * - * @param array|string $name The long name of the option, or an array with all the properties. + * @param array|string $name The long name of the option, or an array with all the properties. * @param string $help The help text for this option * @param bool $required Whether this argument is required. Missing required args will trigger exceptions * @param array $choices Valid choices for this option. diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleInputSubcommand.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleInputSubcommand.php index 1892aeaa0..69d2ffeab 100644 --- a/app/vendor/cakephp/cakephp/src/Console/ConsoleInputSubcommand.php +++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleInputSubcommand.php @@ -53,9 +53,9 @@ class ConsoleInputSubcommand /** * Make a new Subcommand * - * @param array|string $name The long name of the subcommand, or an array with all the properties. + * @param array|string $name The long name of the subcommand, or an array with all the properties. * @param string $help The help text for this option. - * @param \Cake\Console\ConsoleOptionParser|array|null $parser A parser for this subcommand. + * @param \Cake\Console\ConsoleOptionParser|array|null $parser A parser for this subcommand. * Either a ConsoleOptionParser, or an array that can be used with ConsoleOptionParser::buildFromArray(). */ public function __construct($name, $help = '', $parser = null) diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleIo.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleIo.php index 46292c0bd..704f7951a 100644 --- a/app/vendor/cakephp/cakephp/src/Console/ConsoleIo.php +++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleIo.php @@ -335,7 +335,7 @@ protected function wrapMessageWithType(string $messageType, $message) * * **Warning** You cannot overwrite text that contains newlines. * - * @param array|string $message The message to output. + * @param array|string $message The message to output. * @param int $newlines Number of newlines to append. * @param int|null $size The number of bytes to overwrite. Defaults to the * length of the last message output. @@ -469,7 +469,7 @@ public function setStyle(string $style, array $definition): void * Prompts the user for input based on a list of options, and returns it. * * @param string $prompt Prompt text. - * @param array|string $options Array or string of options. + * @param array|string $options Array or string of options. * @param string|null $default Default input value. * @return string Either the default value, or the user-provided input. */ diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleOptionParser.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleOptionParser.php index 61bbea39b..d8bbb5e8a 100644 --- a/app/vendor/cakephp/cakephp/src/Console/ConsoleOptionParser.php +++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleOptionParser.php @@ -313,7 +313,7 @@ public function getCommand(): string /** * Sets the description text for shell/task. * - * @param array|string $text The text to set. If an array the + * @param array|string $text The text to set. If an array the * text will be imploded with "\n". * @return $this */ @@ -341,7 +341,7 @@ public function getDescription(): string * Sets an epilog to the parser. The epilog is added to the end of * the options and arguments listing when help is generated. * - * @param array|string $text The text to set. If an array the text will + * @param array|string $text The text to set. If an array the text will * be imploded with "\n". * @return $this */ diff --git a/app/vendor/cakephp/cakephp/src/Console/Shell.php b/app/vendor/cakephp/cakephp/src/Console/Shell.php index 529e4ca54..0fae3a508 100644 --- a/app/vendor/cakephp/cakephp/src/Console/Shell.php +++ b/app/vendor/cakephp/cakephp/src/Console/Shell.php @@ -620,7 +620,7 @@ public function param(string $name) * Prompts the user for input, and returns it. * * @param string $prompt Prompt text. - * @param array|string|null $options Array or string of options. + * @param array|string|null $options Array or string of options. * @param string|null $default Default input value. * @return string|null Either the default value, or the user-provided input. * @link https://book.cakephp.org/4/en/console-and-shells.html#Shell::in @@ -648,7 +648,7 @@ public function in(string $prompt, $options = null, ?string $default = null): ?s * - `indent` Indent the text with the string provided. Defaults to null. * * @param string $text Text the text to format. - * @param array|int $options Array of options to use, or an integer to wrap the text to. + * @param array|int $options Array of options to use, or an integer to wrap the text to. * @return string Wrapped / indented text * @see \Cake\Utility\Text::wrap() * @link https://book.cakephp.org/4/en/console-and-shells.html#Shell::wrapText diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php index c299a6151..d9b0a59e5 100644 --- a/app/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php +++ b/app/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php @@ -807,7 +807,7 @@ public function identify() /** * Loads the configured authentication objects. * - * @return array|null The loaded authorization objects, or null on empty authenticate value. + * @return array|null The loaded authorization objects, or null on empty authenticate value. * @throws \Cake\Core\Exception\CakeException */ public function constructAuthenticate(): ?array diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/FlashComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/FlashComponent.php index b3f1d780d..3ef889269 100644 --- a/app/vendor/cakephp/cakephp/src/Controller/Component/FlashComponent.php +++ b/app/vendor/cakephp/cakephp/src/Controller/Component/FlashComponent.php @@ -88,7 +88,7 @@ protected function flash(): FlashMessage /** * Proxy method to FlashMessage instance. * - * @param array|string $key The key to set, or a complete array of configs. + * @param array|string $key The key to set, or a complete array of configs. * @param mixed|null $value The value to set. * @param bool $merge Whether to recursively merge or overwrite existing config, defaults to true. * @return $this @@ -128,7 +128,7 @@ public function getConfigOrFail(string $key) /** * Proxy method to FlashMessage instance. * - * @param array|string $key The key to set, or a complete array of configs. + * @param array|string $key The key to set, or a complete array of configs. * @param mixed|null $value The value to set. * @return $this */ diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/PaginatorComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/PaginatorComponent.php index c6e4d2d3d..596a14a2e 100644 --- a/app/vendor/cakephp/cakephp/src/Controller/Component/PaginatorComponent.php +++ b/app/vendor/cakephp/cakephp/src/Controller/Component/PaginatorComponent.php @@ -279,7 +279,7 @@ protected function _setPagingParams(): void /** * Proxy setting config options to Paginator. * - * @param array|string $key The key to set, or a complete array of configs. + * @param array|string $key The key to set, or a complete array of configs. * @param mixed|null $value The value to set. * @param bool $merge Whether to recursively merge or overwrite existing config, defaults to true. * @return $this @@ -306,7 +306,7 @@ public function getConfig(?string $key = null, $default = null) /** * Proxy setting config options to Paginator. * - * @param array|string $key The key to set, or a complete array of configs. + * @param array|string $key The key to set, or a complete array of configs. * @param mixed|null $value The value to set. * @return $this */ diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/RequestHandlerComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/RequestHandlerComponent.php index 75d0604d9..f18c3cc64 100644 --- a/app/vendor/cakephp/cakephp/src/Controller/Component/RequestHandlerComponent.php +++ b/app/vendor/cakephp/cakephp/src/Controller/Component/RequestHandlerComponent.php @@ -284,7 +284,7 @@ public function accepts($type = null) /** * Determines the content type of the data the client has sent (i.e. in a POST request) * - * @param array|string|null $type Can be null (or no parameter), a string type name, or an array of types + * @param array|string|null $type Can be null (or no parameter), a string type name, or an array of types * @return mixed If a single type is supplied a boolean will be returned. If no type is provided * The mapped value of CONTENT_TYPE will be returned. If an array is supplied the first type * in the request content type will be returned. @@ -332,7 +332,7 @@ public function requestedWith($type = null) * if provided, and secondarily by the list of content-types provided in * HTTP_ACCEPT. * - * @param array|string|null $type An optional array of 'friendly' content-type names, i.e. + * @param array|string|null $type An optional array of 'friendly' content-type names, i.e. * 'html', 'xml', 'js', etc. * @return string|bool|null If $type is null or not provided, the first content-type in the * list, based on preference, is returned. If a single type is provided @@ -482,6 +482,7 @@ public function respondAs($type, array $options = []): bool return false; } + /** @psalm-suppress PossiblyInvalidArgument */ $response = $response->withType($cType); if (!empty($options['charset'])) { diff --git a/app/vendor/cakephp/cakephp/src/Controller/Controller.php b/app/vendor/cakephp/cakephp/src/Controller/Controller.php index ef4086961..730b7198e 100644 --- a/app/vendor/cakephp/cakephp/src/Controller/Controller.php +++ b/app/vendor/cakephp/cakephp/src/Controller/Controller.php @@ -60,7 +60,7 @@ * Controllers are created based on request parameters and * routing. By default controllers and actions use conventional names. * For example `/posts/index` maps to `PostsController::index()`. You can re-map - * URLs using Router::connect() or RouterBuilder::connect(). + * URLs using Router::connect() or RouteBuilder::connect(). * * ### Life cycle callbacks * diff --git a/app/vendor/cakephp/cakephp/src/Core/Configure.php b/app/vendor/cakephp/cakephp/src/Core/Configure.php index 0272fab71..e4e8f10d8 100644 --- a/app/vendor/cakephp/cakephp/src/Core/Configure.php +++ b/app/vendor/cakephp/cakephp/src/Core/Configure.php @@ -76,7 +76,7 @@ class Configure * ]); * ``` * - * @param array|string $config The key to write, can be a dot notation value. + * @param array|string $config The key to write, can be a dot notation value. * Alternatively can be an array containing key(s) and value(s). * @param mixed $value Value to set for var * @return void diff --git a/app/vendor/cakephp/cakephp/src/Core/Exception/CakeException.php b/app/vendor/cakephp/cakephp/src/Core/Exception/CakeException.php index 0a9f02452..82ef43738 100644 --- a/app/vendor/cakephp/cakephp/src/Core/Exception/CakeException.php +++ b/app/vendor/cakephp/cakephp/src/Core/Exception/CakeException.php @@ -40,7 +40,7 @@ class CakeException extends RuntimeException protected $_messageTemplate = ''; /** - * Array of headers to be passed to {@link \Cake\Http\Response::header()} + * Array of headers to be passed to {@link \Cake\Http\Response::withHeader()} * * @var array|null */ diff --git a/app/vendor/cakephp/cakephp/src/Core/InstanceConfigTrait.php b/app/vendor/cakephp/cakephp/src/Core/InstanceConfigTrait.php index 4ab8246ce..8813a196a 100644 --- a/app/vendor/cakephp/cakephp/src/Core/InstanceConfigTrait.php +++ b/app/vendor/cakephp/cakephp/src/Core/InstanceConfigTrait.php @@ -64,7 +64,7 @@ trait InstanceConfigTrait * $this->setConfig(['one' => 'value', 'another' => 'value']); * ``` * - * @param array|string $key The key to set, or a complete array of configs. + * @param array|string $key The key to set, or a complete array of configs. * @param mixed|null $value The value to set. * @param bool $merge Whether to recursively merge or overwrite existing config, defaults to true. * @return $this @@ -168,7 +168,7 @@ public function getConfigOrFail(string $key) * $this->configShallow(['one' => 'value', 'another' => 'value']); * ``` * - * @param array|string $key The key to set, or a complete array of configs. + * @param array|string $key The key to set, or a complete array of configs. * @param mixed|null $value The value to set. * @return $this */ @@ -217,7 +217,7 @@ protected function _configRead(?string $key) /** * Writes a config key. * - * @param array|string $key Key to write to. + * @param array|string $key Key to write to. * @param mixed $value Value to write. * @param string|bool $merge True to merge recursively, 'shallow' for simple merge, * false to overwrite, defaults to false. diff --git a/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php b/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php index 7ae4b47f7..c11a12c60 100644 --- a/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php +++ b/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php @@ -67,8 +67,8 @@ trait StaticConfigTrait * Cache::setConfig($arrayOfConfig); * ``` * - * @param array|string $key The name of the configuration, or an array of multiple configs. - * @param object|array|null $config An array of name => configuration data for adapter. + * @param array|string $key The name of the configuration, or an array of multiple configs. + * @param object|array|null $config An array of name => configuration data for adapter. * @throws \BadMethodCallException When trying to modify an existing config. * @throws \LogicException When trying to store an invalid structured config array. * @return void diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/CaseExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/CaseExpression.php index ff8441a2c..864a3bcce 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Expression/CaseExpression.php +++ b/app/vendor/cakephp/cakephp/src/Database/Expression/CaseExpression.php @@ -24,7 +24,7 @@ /** * This class represents a SQL Case statement * - * @deprecated 4.3.0 Use CaseStatementExpression instead or Query::case() + * @deprecated 4.3.0 Use QueryExpression::case() or CaseStatementExpression instead */ class CaseExpression implements ExpressionInterface { diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/CaseStatementExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/CaseStatementExpression.php index c06b95159..40bacf94b 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Expression/CaseStatementExpression.php +++ b/app/vendor/cakephp/cakephp/src/Database/Expression/CaseStatementExpression.php @@ -284,7 +284,7 @@ public function __construct($value = null, ?string $type = null) * you plan to use user data, either pass a single type for the `$type` argument (which forces the `$when` value to * be a non-array, and then always binds the data), use a conditions array where the user data is only passed on * the value side of the array entries, or custom bindings! - * @param array|string|null $type The when value type. Either an associative array when using array style + * @param array|string|null $type The when value type. Either an associative array when using array style * conditions, or else a string. If no type is provided, the type will be tried to be inferred from the value. * @return $this * @throws \LogicException In case this a closing `then()` call is required before calling this method. diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/QueryExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/QueryExpression.php index a9accfa21..35582dd04 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Expression/QueryExpression.php +++ b/app/vendor/cakephp/cakephp/src/Database/Expression/QueryExpression.php @@ -339,7 +339,7 @@ public function in($field, $values, $type = null) * @param array $types Associative array of types to be associated with the values * passed in $values * @return $this - * @deprecated 4.3.0 Use Query::case() or CaseStatementExpression instead + * @deprecated 4.3.0 Use QueryExpression::case() or CaseStatementExpression instead */ public function addCase($conditions, $values = [], $types = []) { diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/WhenThenExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/WhenThenExpression.php index 7413a2223..bf51eaf19 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Expression/WhenThenExpression.php +++ b/app/vendor/cakephp/cakephp/src/Database/Expression/WhenThenExpression.php @@ -111,7 +111,7 @@ public function __construct(?TypeMap $typeMap = null) * plan to use user data, either pass a single type for the `$type` argument (which forces the `$when` value to be * a non-array, and then always binds the data), use a conditions array where the user data is only passed on the * value side of the array entries, or custom bindings! - * @param array|string|null $type The when value type. Either an associative array when using array style + * @param array|string|null $type The when value type. Either an associative array when using array style * conditions, or else a string. If no type is provided, the type will be tried to be inferred from the value. * @return $this * @throws \InvalidArgumentException In case the `$when` argument is neither a non-empty array, nor a scalar value, diff --git a/app/vendor/cakephp/cakephp/src/Database/Query.php b/app/vendor/cakephp/cakephp/src/Database/Query.php index dcfc7a7ef..7cc59b5e2 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Query.php +++ b/app/vendor/cakephp/cakephp/src/Database/Query.php @@ -573,7 +573,10 @@ public function modifier($modifiers, $overwrite = false) if ($overwrite) { $this->_parts['modifier'] = []; } - $this->_parts['modifier'] = array_merge($this->_parts['modifier'], (array)$modifiers); + if (!is_array($modifiers)) { + $modifiers = [$modifiers]; + } + $this->_parts['modifier'] = array_merge($this->_parts['modifier'], $modifiers); return $this; } @@ -832,12 +835,12 @@ public function rightJoin($table, $conditions = [], $types = []) * This is a shorthand method for building joins via `join()`. * * The arguments of this method are identical to the `leftJoin()` shorthand, please refer - * to that methods description for further details. + * to that method's description for further details. * * @param array|string $table The table to join with * @param \Cake\Database\ExpressionInterface|array|string $conditions The conditions * to use for joining. - * @param array $types a list of types associated to the conditions used for converting + * @param array $types a list of types associated to the conditions used for converting * values to the corresponding database representation. * @return $this */ @@ -1297,7 +1300,7 @@ public function order($fields, $overwrite = false) * Order fields are not suitable for use with user supplied data as they are * not sanitized by the query builder. * - * @param \Cake\Database\Expression\QueryExpression|\Closure|string $field The field to order on. + * @param \Cake\Database\ExpressionInterface|\Closure|string $field The field to order on. * @param bool $overwrite Whether to reset the order clauses. * @return $this */ @@ -1331,7 +1334,7 @@ public function orderAsc($field, $overwrite = false) * Order fields are not suitable for use with user supplied data as they are * not sanitized by the query builder. * - * @param \Cake\Database\Expression\QueryExpression|\Closure|string $field The field to order on. + * @param \Cake\Database\ExpressionInterface|\Closure|string $field The field to order on. * @param bool $overwrite Whether to reset the order clauses. * @return $this */ @@ -1787,7 +1790,7 @@ public function update($table) * @param mixed $value The value to update $key to. Can be null if $key is an * array or QueryExpression. When $key is an array, this parameter will be * used as $types instead. - * @param array|string $types The column types to treat data as. + * @param array|string $types The column types to treat data as. * @return $this */ public function set($key, $value = null, $types = []) @@ -2361,7 +2364,14 @@ public function __clone() } if (is_array($part)) { foreach ($part as $i => $piece) { - if ($piece instanceof ExpressionInterface) { + if (is_array($piece)) { + foreach ($piece as $j => $value) { + if ($value instanceof ExpressionInterface) { + /** @psalm-suppress PossiblyUndefinedMethod */ + $this->_parts[$name][$i][$j] = clone $value; + } + } + } elseif ($piece instanceof ExpressionInterface) { /** @psalm-suppress PossiblyUndefinedMethod */ $this->_parts[$name][$i] = clone $piece; } diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/SchemaDialect.php b/app/vendor/cakephp/cakephp/src/Database/Schema/SchemaDialect.php index 0084a7a33..1d887d7ae 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Schema/SchemaDialect.php +++ b/app/vendor/cakephp/cakephp/src/Database/Schema/SchemaDialect.php @@ -99,7 +99,7 @@ protected function _convertOnClause(string $clause): string * Convert foreign key constraints references to a valid * stringified list * - * @param array|string $references The referenced columns of a foreign key constraint statement + * @param array|string $references The referenced columns of a foreign key constraint statement * @return string */ protected function _convertConstraintColumns($references): string diff --git a/app/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php b/app/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php index 160c40956..54adf540f 100644 --- a/app/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php +++ b/app/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php @@ -72,7 +72,7 @@ class ConnectionManager * * The connection will not be constructed until it is first used. * - * @param array|string $key The name of the connection config, or an array of multiple configs. + * @param array|string $key The name of the connection config, or an array of multiple configs. * @param array|null $config An array of name => config data for adapter. * @return void * @throws \Cake\Core\Exception\CakeException When trying to modify an existing config. @@ -195,7 +195,8 @@ public static function get(string $name, bool $useAliases = true) if (empty(static::$_config[$name])) { throw new MissingDatasourceConfigException(['name' => $name]); } - if (empty(static::$_registry)) { + /** @psalm-suppress RedundantPropertyInitializationCheck */ + if (!isset(static::$_registry)) { static::$_registry = new ConnectionRegistry(); } diff --git a/app/vendor/cakephp/cakephp/src/Datasource/EntityInterface.php b/app/vendor/cakephp/cakephp/src/Datasource/EntityInterface.php index 72dbc1e53..2f7b27337 100644 --- a/app/vendor/cakephp/cakephp/src/Datasource/EntityInterface.php +++ b/app/vendor/cakephp/cakephp/src/Datasource/EntityInterface.php @@ -130,7 +130,7 @@ public function setError(string $field, $errors, bool $overwrite = false); /** * Stores whether a field value can be changed or set in this entity. * - * @param array|string $field single or list of fields to change its accessibility + * @param array|string $field single or list of fields to change its accessibility * @param bool $set true marks the field as accessible, false will * mark it as protected. * @return $this @@ -181,7 +181,7 @@ public function extractOriginalChanged(array $fields): array; /** * Sets one or multiple fields to the specified value * - * @param array|string $field the name of field to set or a list of + * @param array|string $field the name of field to set or a list of * fields with their respective values * @param mixed $value The value to set to the field or an array if the * first argument is also an array, in which case will be treated as $options diff --git a/app/vendor/cakephp/cakephp/src/Datasource/EntityTrait.php b/app/vendor/cakephp/cakephp/src/Datasource/EntityTrait.php index 78c7078aa..616b3db34 100644 --- a/app/vendor/cakephp/cakephp/src/Datasource/EntityTrait.php +++ b/app/vendor/cakephp/cakephp/src/Datasource/EntityTrait.php @@ -210,7 +210,7 @@ public function __unset(string $field): void * $entity->set('name', 'Andrew'); * ``` * - * @param array|string $field the name of field to set or a list of + * @param array|string $field the name of field to set or a list of * fields with their respective values * @param mixed $value The value to set to the field or an array if the * first argument is also an array, in which case will be treated as $options @@ -1146,7 +1146,7 @@ public function setInvalidField(string $field, $value) * $entity->setAccess('*', false); // Mark all fields as protected * ``` * - * @param array|string $field Single or list of fields to change its accessibility + * @param array|string $field Single or list of fields to change its accessibility * @param bool $set True marks the field as accessible, false will * mark it as protected. * @return $this diff --git a/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php b/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php index e349b881c..708e05882 100644 --- a/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php +++ b/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php @@ -227,21 +227,15 @@ public function eagerLoaded(bool $value) */ public function aliasField(string $field, ?string $alias = null): array { - $namespaced = strpos($field, '.') !== false; - $aliasedField = $field; - - if ($namespaced) { + if (strpos($field, '.') === false) { + $alias = $alias ?: $this->getRepository()->getAlias(); + $aliasedField = $alias . '.' . $field; + } else { + $aliasedField = $field; [$alias, $field] = explode('.', $field); } - if (!$alias) { - $alias = $this->getRepository()->getAlias(); - } - $key = sprintf('%s__%s', $alias, $field); - if (!$namespaced) { - $aliasedField = $alias . '.' . $field; - } return [$key => $aliasedField]; } diff --git a/app/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php b/app/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php index 1a520a47c..c4b3f1d14 100644 --- a/app/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php +++ b/app/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php @@ -135,7 +135,7 @@ public function register(): void * @param string $description Error description * @param string|null $file File on which error occurred * @param int|null $line Line that triggered the error - * @param array|null $context Context + * @param array|null $context Context * @return bool True if error was handled */ public function handleError( diff --git a/app/vendor/cakephp/cakephp/src/Error/Debugger.php b/app/vendor/cakephp/cakephp/src/Error/Debugger.php index cd9bfe2bb..ad4395dae 100644 --- a/app/vendor/cakephp/cakephp/src/Error/Debugger.php +++ b/app/vendor/cakephp/cakephp/src/Error/Debugger.php @@ -214,7 +214,7 @@ public static function getInstance(?string $class = null) /** * Read or write configuration options for the Debugger instance. * - * @param array|string|null $key The key to get/set, or a complete array of configs. + * @param array|string|null $key The key to get/set, or a complete array of configs. * @param mixed|null $value The value to set. * @param bool $merge Whether to recursively merge or overwrite existing config, defaults to true. * @return mixed Config value being read, or the object itself on write operations. diff --git a/app/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php b/app/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php index 3aa9eb9fb..4baea0b89 100644 --- a/app/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php +++ b/app/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php @@ -396,10 +396,7 @@ protected function _outputMessage(string $template): Response $attributes = $e->getAttributes(); if ( $e instanceof MissingLayoutException || - ( - isset($attributes['file']) && - strpos($attributes['file'], 'error500') !== false - ) + strpos($attributes['file'], 'error500') !== false ) { return $this->_outputMessageSafe('error500'); } diff --git a/app/vendor/cakephp/cakephp/src/Filesystem/File.php b/app/vendor/cakephp/cakephp/src/Filesystem/File.php index 03041eeae..708a2583b 100644 --- a/app/vendor/cakephp/cakephp/src/Filesystem/File.php +++ b/app/vendor/cakephp/cakephp/src/Filesystem/File.php @@ -629,8 +629,8 @@ public function clearStatCache($all = false): void /** * Searches for a given text and replaces the text if found. * - * @param array|string $search Text(s) to search for. - * @param array|string $replace Text(s) to replace with. + * @param array|string $search Text(s) to search for. + * @param array|string $replace Text(s) to replace with. * @return bool Success */ public function replaceText($search, $replace): bool diff --git a/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php b/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php index 140ea4624..e593ccee8 100644 --- a/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php +++ b/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php @@ -397,7 +397,7 @@ public static function slashTerm(string $path): string * Returns $path with $element added, with correct slash in-between. * * @param string $path Path - * @param array|string $element Element to add at end of path + * @param array|string $element Element to add at end of path * @return string Combined path */ public static function addPathElement(string $path, $element): string diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Stream.php b/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Stream.php index 440cbb51d..18bfa0af9 100644 --- a/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Stream.php +++ b/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Stream.php @@ -168,11 +168,6 @@ protected function _buildHeaders(RequestInterface $request, array $options): voi protected function _buildContent(RequestInterface $request, array $options): void { $body = $request->getBody(); - if (empty($body)) { - $this->_contextOptions['content'] = ''; - - return; - } $body->rewind(); $this->_contextOptions['content'] = $body->getContents(); } diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Digest.php b/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Digest.php index 3ea83307f..577b1b78f 100644 --- a/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Digest.php +++ b/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Digest.php @@ -48,7 +48,7 @@ public function __construct(Client $client, ?array $options = null) * Add Authorization header to the request. * * @param \Cake\Http\Client\Request $request The request object. - * @param array $credentials Authentication credentials. + * @param array $credentials Authentication credentials. * @return \Cake\Http\Client\Request The updated request. * @see https://www.ietf.org/rfc/rfc2617.txt */ @@ -110,7 +110,7 @@ protected function _getServerInfo(Request $request, array $credentials): array * Generate the header Authorization * * @param \Cake\Http\Client\Request $request The request object. - * @param array $credentials Authentication credentials. + * @param array $credentials Authentication credentials. * @return string */ protected function _generateHeader(Request $request, array $credentials): string diff --git a/app/vendor/cakephp/cakephp/src/Http/Middleware/HttpsEnforcerMiddleware.php b/app/vendor/cakephp/cakephp/src/Http/Middleware/HttpsEnforcerMiddleware.php index 83188fee0..9176b9a43 100644 --- a/app/vendor/cakephp/cakephp/src/Http/Middleware/HttpsEnforcerMiddleware.php +++ b/app/vendor/cakephp/cakephp/src/Http/Middleware/HttpsEnforcerMiddleware.php @@ -82,6 +82,10 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface if ($this->config['redirect'] && $request->getMethod() === 'GET') { $uri = $request->getUri()->withScheme('https'); + $base = $request->getAttribute('base'); + if ($base) { + $uri = $uri->withPath($base . $uri->getPath()); + } return new RedirectResponse( $uri, diff --git a/app/vendor/cakephp/cakephp/src/Http/MiddlewareQueue.php b/app/vendor/cakephp/cakephp/src/Http/MiddlewareQueue.php index 81abb6c34..1069117c0 100644 --- a/app/vendor/cakephp/cakephp/src/Http/MiddlewareQueue.php +++ b/app/vendor/cakephp/cakephp/src/Http/MiddlewareQueue.php @@ -177,6 +177,7 @@ public function insertBefore(string $class, $middleware) $found = false; $i = 0; foreach ($this->queue as $i => $object) { + /** @psalm-suppress ArgumentTypeCoercion */ if ( ( is_string($object) @@ -210,6 +211,7 @@ public function insertAfter(string $class, $middleware) $found = false; $i = 0; foreach ($this->queue as $i => $object) { + /** @psalm-suppress ArgumentTypeCoercion */ if ( ( is_string($object) diff --git a/app/vendor/cakephp/cakephp/src/Http/Response.php b/app/vendor/cakephp/cakephp/src/Http/Response.php index 480ca02d1..5b71e61e6 100644 --- a/app/vendor/cakephp/cakephp/src/Http/Response.php +++ b/app/vendor/cakephp/cakephp/src/Http/Response.php @@ -557,6 +557,7 @@ protected function _setHeader(string $header, string $value): void /** * Clear header * + * @phpstan-param non-empty-string $header * @param string $header Header key. * @return void */ @@ -675,7 +676,7 @@ public function getReasonPhrase(): string * This is needed for RequestHandlerComponent and recognition of types. * * @param string $type Content type. - * @param array|string $mimeType Definition of the mime type. + * @param array|string $mimeType Definition of the mime type. * @return void */ public function setTypeMap(string $type, $mimeType): void @@ -1045,7 +1046,7 @@ public function withNotModified() * separated string. If no parameters are passed, then an * array with the current Vary header value is returned * - * @param array|string $cacheVariances A single Vary string or an array + * @param array|string $cacheVariances A single Vary string or an array * containing the list for variances. * @return static */ diff --git a/app/vendor/cakephp/cakephp/src/Http/ServerRequest.php b/app/vendor/cakephp/cakephp/src/Http/ServerRequest.php index f8e6cc2fa..183d01ebb 100644 --- a/app/vendor/cakephp/cakephp/src/Http/ServerRequest.php +++ b/app/vendor/cakephp/cakephp/src/Http/ServerRequest.php @@ -1087,7 +1087,7 @@ public function subdomains(int $tldLength = 1): array * by the client. * * @param string|null $type The content type to check for. Leave null to get all types a client accepts. - * @return array|bool Either an array of all the types the client accepts or a boolean if they accept the + * @return array|bool Either an array of all the types the client accepts or a boolean if they accept the * provided type. */ public function accepts(?string $type = null) @@ -1508,7 +1508,7 @@ public function withEnv(string $key, string $value) * If the request would be GET, response header "Allow: POST, DELETE" will be set * and a 405 error will be returned. * - * @param array|string $methods Allowed HTTP request methods. + * @param array|string $methods Allowed HTTP request methods. * @return true * @throws \Cake\Http\Exception\MethodNotAllowedException */ diff --git a/app/vendor/cakephp/cakephp/src/I18n/FrozenTime.php b/app/vendor/cakephp/cakephp/src/I18n/FrozenTime.php index 0f5d2e1d2..9711bf479 100644 --- a/app/vendor/cakephp/cakephp/src/I18n/FrozenTime.php +++ b/app/vendor/cakephp/cakephp/src/I18n/FrozenTime.php @@ -191,7 +191,7 @@ public function timeAgoInWords(array $options = []): string * Or one of DateTimeZone class constants * @param string|null $country A two-letter ISO 3166-1 compatible country code. * This option is only used when $filter is set to DateTimeZone::PER_COUNTRY - * @param array|bool $options If true (default value) groups the identifiers list by primary region. + * @param array|bool $options If true (default value) groups the identifiers list by primary region. * Otherwise, an array containing `group`, `abbr`, `before`, and `after` * keys. Setting `group` and `abbr` to true will group results and append * timezone abbreviation in the display value. Set `before` and `after` diff --git a/app/vendor/cakephp/cakephp/src/I18n/Time.php b/app/vendor/cakephp/cakephp/src/I18n/Time.php index 99ba8b36d..e82f29a3e 100644 --- a/app/vendor/cakephp/cakephp/src/I18n/Time.php +++ b/app/vendor/cakephp/cakephp/src/I18n/Time.php @@ -278,7 +278,7 @@ public function timeAgoInWords(array $options = []): string * Or one of DateTimeZone class constants * @param string|null $country A two-letter ISO 3166-1 compatible country code. * This option is only used when $filter is set to DateTimeZone::PER_COUNTRY - * @param array|bool $options If true (default value) groups the identifiers list by primary region. + * @param array|bool $options If true (default value) groups the identifiers list by primary region. * Otherwise, an array containing `group`, `abbr`, `before`, and `after` * keys. Setting `group` and `abbr` to true will group results and append * timezone abbreviation in the display value. Set `before` and `after` diff --git a/app/vendor/cakephp/cakephp/src/Log/Engine/BaseLog.php b/app/vendor/cakephp/cakephp/src/Log/Engine/BaseLog.php index 637c0111b..b6c3a3362 100644 --- a/app/vendor/cakephp/cakephp/src/Log/Engine/BaseLog.php +++ b/app/vendor/cakephp/cakephp/src/Log/Engine/BaseLog.php @@ -95,7 +95,7 @@ public function __construct(array $config = []) /** * Get the levels this logger is interested in. * - * @return array + * @return array */ public function levels(): array { @@ -105,7 +105,7 @@ public function levels(): array /** * Get the scopes this logger is interested in. * - * @return array|false + * @return array|false */ public function scopes() { diff --git a/app/vendor/cakephp/cakephp/src/Log/Log.php b/app/vendor/cakephp/cakephp/src/Log/Log.php index e46902b5b..aa39561b0 100644 --- a/app/vendor/cakephp/cakephp/src/Log/Log.php +++ b/app/vendor/cakephp/cakephp/src/Log/Log.php @@ -176,7 +176,8 @@ class Log */ protected static function _init(): void { - if (empty(static::$_registry)) { + /** @psalm-suppress RedundantPropertyInitializationCheck */ + if (!isset(static::$_registry)) { static::$_registry = new LogEngineRegistry(); } if (static::$_dirtyConfig) { @@ -215,7 +216,8 @@ protected static function _loadConfig(): void */ public static function reset(): void { - if (!empty(static::$_registry)) { + /** @psalm-suppress RedundantPropertyInitializationCheck */ + if (isset(static::$_registry)) { static::$_registry->reset(); } static::$_config = []; @@ -270,8 +272,8 @@ public static function levels(): array * Log::setConfig($arrayOfConfig); * ``` * - * @param array|string $key The name of the logger config, or an array of multiple configs. - * @param array|null $config An array of name => config data for adapter. + * @param array|string $key The name of the logger config, or an array of multiple configs. + * @param array|null $config An array of name => config data for adapter. * @return void * @throws \BadMethodCallException When trying to modify an existing config. */ diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Email.php b/app/vendor/cakephp/cakephp/src/Mailer/Email.php index 595c3542c..27323f3c1 100644 --- a/app/vendor/cakephp/cakephp/src/Mailer/Email.php +++ b/app/vendor/cakephp/cakephp/src/Mailer/Email.php @@ -115,7 +115,7 @@ class Email implements JsonSerializable, Serializable /** * Constructor * - * @param array|string|null $config Array of configs, or string to load configs from app.php + * @param array|string|null $config Array of configs, or string to load configs from app.php */ public function __construct($config = null) { @@ -290,7 +290,7 @@ public function message(?string $type = null) /** * Sets the configuration profile to use for this instance. * - * @param array|string $config String with configuration name, or + * @param array|string $config String with configuration name, or * an array with config. * @return $this */ @@ -358,7 +358,7 @@ public function getProfile(): array /** * Send an email using the specified content, template and layout * - * @param array|string|null $content String with message or array with messages + * @param array|string|null $content String with message or array with messages * @return array * @throws \BadMethodCallException * @psalm-return array{headers: string, message: string} @@ -386,7 +386,7 @@ public function send($content = null): array /** * Render email. * - * @param array|string|null $content Content array or string + * @param array|string|null $content Content array or string * @return void */ public function render($content = null): void @@ -471,7 +471,7 @@ protected function _logDelivery(array $contents): void /** * Converts given value to string * - * @param array|string $value The value to convert + * @param array|string $value The value to convert * @return string */ protected function flatten($value): string @@ -486,7 +486,7 @@ protected function flatten($value): string * If null, will try to use 'to' from transport config * @param string|null $subject String of subject or null to use 'subject' from transport config * @param array|string|null $message String with message or array with variables to be used in render - * @param array|string $config String to use Email delivery profile from app.php or array with configs + * @param array|string $config String to use Email delivery profile from app.php or array with configs * @param bool $send Send the email or just return the instance pre-configured * @return \Cake\Mailer\Email * @throws \InvalidArgumentException diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Mailer.php b/app/vendor/cakephp/cakephp/src/Mailer/Mailer.php index f46757b92..9c8e67783 100644 --- a/app/vendor/cakephp/cakephp/src/Mailer/Mailer.php +++ b/app/vendor/cakephp/cakephp/src/Mailer/Mailer.php @@ -201,7 +201,7 @@ class Mailer implements EventListenerInterface /** * Constructor * - * @param array|string|null $config Array of configs, or string to load configs from app.php + * @param array|string|null $config Array of configs, or string to load configs from app.php */ public function __construct($config = null) { @@ -411,7 +411,7 @@ public function deliver(string $content = '') /** * Sets the configuration profile to use for this instance. * - * @param array|string $config String with configuration name, or + * @param array|string $config String with configuration name, or * an array with config. * @return $this */ @@ -579,7 +579,7 @@ protected function logDelivery(array $contents): void /** * Set logging config. * - * @param array|string|true $log Log config. + * @param array|string|true $log Log config. * @return void */ protected function setLogConfig($log) @@ -601,7 +601,7 @@ protected function setLogConfig($log) /** * Converts given value to string * - * @param array|string $value The value to convert + * @param array|string $value The value to convert * @return string */ protected function flatten($value): string diff --git a/app/vendor/cakephp/cakephp/src/Mailer/MailerAwareTrait.php b/app/vendor/cakephp/cakephp/src/Mailer/MailerAwareTrait.php index 19b43b5f6..dee44ada9 100644 --- a/app/vendor/cakephp/cakephp/src/Mailer/MailerAwareTrait.php +++ b/app/vendor/cakephp/cakephp/src/Mailer/MailerAwareTrait.php @@ -32,7 +32,7 @@ trait MailerAwareTrait * Returns a mailer instance. * * @param string $name Mailer's name. - * @param array|string|null $config Array of configs, or profile name string. + * @param array|string|null $config Array of configs, or profile name string. * @return \Cake\Mailer\Mailer * @throws \Cake\Mailer\Exception\MissingMailerException if undefined mailer class. */ diff --git a/app/vendor/cakephp/cakephp/src/Network/Socket.php b/app/vendor/cakephp/cakephp/src/Network/Socket.php index 36cf5c0ac..0bc610e03 100644 --- a/app/vendor/cakephp/cakephp/src/Network/Socket.php +++ b/app/vendor/cakephp/cakephp/src/Network/Socket.php @@ -445,11 +445,11 @@ public function __destruct() public function reset(?array $state = null): void { if (empty($state)) { - static $initalState = []; - if (empty($initalState)) { - $initalState = get_class_vars(self::class); + static $initialState = []; + if (empty($initialState)) { + $initialState = get_class_vars(self::class); } - $state = $initalState; + $state = $initialState; } foreach ($state as $property => $value) { diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association.php b/app/vendor/cakephp/cakephp/src/ORM/Association.php index 2d89414b6..baf400520 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Association.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Association.php @@ -857,7 +857,7 @@ public function defaultRowValue(array $row, bool $joined): array * and modifies the query accordingly based of this association * configuration * - * @param array|string|null $type the type of query to perform, if an array is passed, + * @param array|string|null $type the type of query to perform, if an array is passed, * it will be interpreted as the `$options` parameter * @param array $options The options to for the find * @see \Cake\ORM\Table::find() diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php b/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php index 7b62a7474..ba3503b69 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php @@ -902,7 +902,7 @@ function () use ($sourceEntity, $targetEntities, $options) { * this association. * @param array<\Cake\Datasource\EntityInterface> $targetEntities List of entities persisted in the target table for * this association. - * @param array|bool $options List of options to be passed to the internal `delete` call, + * @param array|bool $options List of options to be passed to the internal `delete` call, * or a `boolean` as `cleanProperty` key shortcut. * @throws \InvalidArgumentException If non persisted entities are passed or if * any of them is lacking a primary key value. @@ -1060,7 +1060,7 @@ protected function junctionConditions(): array * If your association includes conditions or a finder, the junction table will be * included in the query's contained associations. * - * @param array|string|null $type the type of query to perform, if an array is passed, + * @param array|string|null $type the type of query to perform, if an array is passed, * it will be interpreted as the `$options` parameter * @param array $options The options to for the find * @see \Cake\ORM\Table::find() diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/HasMany.php b/app/vendor/cakephp/cakephp/src/ORM/Association/HasMany.php index adf4341c5..9dbeac72b 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Association/HasMany.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Association/HasMany.php @@ -335,7 +335,7 @@ public function link(EntityInterface $sourceEntity, array $targetEntities, array * this association * @param array $targetEntities list of entities persisted in the target table for * this association - * @param array|bool $options list of options to be passed to the internal `delete` call. + * @param array|bool $options list of options to be passed to the internal `delete` call. * If boolean it will be used a value for "cleanProperty" option. * @throws \InvalidArgumentException if non persisted entities are passed or if * any of them is lacking a primary key value diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectLoader.php b/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectLoader.php index 615543d1d..0ccff39a6 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectLoader.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectLoader.php @@ -317,7 +317,7 @@ protected function _addFilteringJoin(Query $query, $key, $subquery): Query * target table query given a filter key and some filtering values. * * @param \Cake\ORM\Query $query Target table's query - * @param array|string $key The fields that should be used for filtering + * @param array|string $key The fields that should be used for filtering * @param mixed $filter The value that should be used to match for $key * @return \Cake\ORM\Query */ diff --git a/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php b/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php index d36769284..f73f05923 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php +++ b/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php @@ -154,7 +154,7 @@ public function keys(): array /** * Get an array of associations matching a specific type. * - * @param array|string $class The type of associations you want. + * @param array|string $class The type of associations you want. * For example 'BelongsTo' or array like ['BelongsTo', 'HasOne'] * @return array<\Cake\ORM\Association> An array of Association objects. * @since 3.5.3 diff --git a/app/vendor/cakephp/cakephp/src/ORM/Exception/PersistenceFailedException.php b/app/vendor/cakephp/cakephp/src/ORM/Exception/PersistenceFailedException.php index 417142aba..291d8ced5 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Exception/PersistenceFailedException.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Exception/PersistenceFailedException.php @@ -40,7 +40,7 @@ class PersistenceFailedException extends CakeException * Constructor. * * @param \Cake\Datasource\EntityInterface $entity The entity on which the persistence operation failed - * @param array|string $message Either the string of the error message, or an array of attributes + * @param array|string $message Either the string of the error message, or an array of attributes * that are made available in the view, and sprintf()'d into Exception::$_messageTemplate * @param int|null $code The code of the error, is also the HTTP status code for the error. * @param \Throwable|null $previous the previous exception. diff --git a/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorInterface.php b/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorInterface.php index eb837c07c..24516e8ed 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorInterface.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorInterface.php @@ -38,9 +38,9 @@ public function getConfig(?string $alias = null): array; * Stores a list of options to be used when instantiating an object * with a matching alias. * - * @param array|string $alias Name of the alias or array to completely + * @param array|string $alias Name of the alias or array to completely * overwrite current config. - * @param array|null $options list of options for the alias + * @param array|null $options list of options for the alias * @return $this * @throws \RuntimeException When you attempt to configure an existing * table instance. diff --git a/app/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php b/app/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php index 510b221a7..7f9fd0294 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php @@ -78,7 +78,7 @@ class TableLocator extends AbstractLocator implements LocatorInterface /** * Constructor. * - * @param array|null $locations Locations where tables should be looked for. + * @param array|null $locations Locations where tables should be looked for. * If none provided, the default `Model\Table` under your app's namespace is used. */ public function __construct(?array $locations = null) diff --git a/app/vendor/cakephp/cakephp/src/ORM/Rule/ExistsIn.php b/app/vendor/cakephp/cakephp/src/ORM/Rule/ExistsIn.php index 71da04dd7..912c7199e 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Rule/ExistsIn.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Rule/ExistsIn.php @@ -30,7 +30,7 @@ class ExistsIn /** * The list of fields to check * - * @var array + * @var array */ protected $_fields; @@ -54,10 +54,10 @@ class ExistsIn * Available option for $options is 'allowNullableNulls' flag. * Set to true to accept composite foreign keys where one or more nullable columns are null. * - * @param array|string $fields The field or fields to check existence as primary key. + * @param array|string $fields The field or fields to check existence as primary key. * @param \Cake\ORM\Table|\Cake\ORM\Association|string $repository The repository where the * field will be looked for, or the association name for the repository. - * @param array $options The options that modify the rules behavior. + * @param array $options The options that modify the rule's behavior. * Options 'allowNullableNulls' will make the rule pass if given foreign keys are set to `null`. * Notice: allowNullableNulls cannot pass by database columns set to `NOT NULL`. */ diff --git a/app/vendor/cakephp/cakephp/src/ORM/RulesChecker.php b/app/vendor/cakephp/cakephp/src/ORM/RulesChecker.php index 2784dcc63..8136b6d82 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/RulesChecker.php +++ b/app/vendor/cakephp/cakephp/src/ORM/RulesChecker.php @@ -48,7 +48,7 @@ class RulesChecker extends BaseRulesChecker * - `allowMultipleNulls` Allows any field to have multiple null values. Defaults to false. * * @param array $fields The list of fields to check for uniqueness. - * @param array|string|null $message The error message to show in case the rule does not pass. Can + * @param array|string|null $message The error message to show in case the rule does not pass. Can * also be an array of options. When an array, the 'message' key can be used to provide a message. * @return \Cake\Datasource\RuleInvoker */ @@ -92,7 +92,7 @@ public function isUnique(array $fields, $message = null): RuleInvoker * @param array|string $field The field or list of fields to check for existence by * primary key lookup in the other table. * @param \Cake\ORM\Table|\Cake\ORM\Association|string $table The table name where the fields existence will be checked. - * @param array|string|null $message The error message to show in case the rule does not pass. Can + * @param array|string|null $message The error message to show in case the rule does not pass. Can * also be an array of options. When an array, the 'message' key can be used to provide a message. * @return \Cake\Datasource\RuleInvoker */ diff --git a/app/vendor/cakephp/cakephp/src/Routing/Exception/DuplicateNamedRouteException.php b/app/vendor/cakephp/cakephp/src/Routing/Exception/DuplicateNamedRouteException.php index f2a461157..d4ccf2200 100644 --- a/app/vendor/cakephp/cakephp/src/Routing/Exception/DuplicateNamedRouteException.php +++ b/app/vendor/cakephp/cakephp/src/Routing/Exception/DuplicateNamedRouteException.php @@ -30,7 +30,7 @@ class DuplicateNamedRouteException extends CakeException /** * Constructor. * - * @param array|string $message Either the string of the error message, or an array of attributes + * @param array|string $message Either the string of the error message, or an array of attributes * that are made available in the view, and sprintf()'d into Exception::$_messageTemplate * @param int|null $code The code of the error, is also the HTTP status code for the error. Defaults to 404. * @param \Throwable|null $previous the previous exception. diff --git a/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingRouteException.php b/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingRouteException.php index d15d653d5..ce88be3eb 100644 --- a/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingRouteException.php +++ b/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingRouteException.php @@ -38,7 +38,7 @@ class MissingRouteException extends CakeException /** * Constructor. * - * @param array|string $message Either the string of the error message, or an array of attributes + * @param array|string $message Either the string of the error message, or an array of attributes * that are made available in the view, and sprintf()'d into Exception::$_messageTemplate * @param int|null $code The code of the error, is also the HTTP status code for the error. Defaults to 404. * @param \Throwable|null $previous the previous exception. diff --git a/app/vendor/cakephp/cakephp/src/Routing/Router.php b/app/vendor/cakephp/cakephp/src/Routing/Router.php index e75ab7ac6..8e05e3ac0 100644 --- a/app/vendor/cakephp/cakephp/src/Routing/Router.php +++ b/app/vendor/cakephp/cakephp/src/Routing/Router.php @@ -206,12 +206,12 @@ public static function getNamedExpressions(): array * @throws \Cake\Core\Exception\CakeException * @see \Cake\Routing\RouteBuilder::connect() * @see \Cake\Routing\Router::scope() - * @deprecated 4.3.0 Use the non-static method `RouterBuilder::connect()` instead. + * @deprecated 4.3.0 Use the non-static method `RouteBuilder::connect()` instead. */ public static function connect($route, $defaults = [], $options = []): void { deprecationWarning( - '`Router::connect()` is deprecated, use the non-static method `RouterBuilder::connect()` instead.' + '`Router::connect()` is deprecated, use the non-static method `RouteBuilder::connect()` instead.' ); static::scope('/', function ($routes) use ($route, $defaults, $options): void { @@ -816,12 +816,12 @@ public static function createRouteBuilder(string $path, array $options = []): Ro * @param callable|null $callback The callback to invoke with the scoped collection. * @throws \InvalidArgumentException When an invalid callable is provided. * @return void - * @deprecated 4.3.0 Use the non-static method `RouterBuilder::scope()` instead. + * @deprecated 4.3.0 Use the non-static method `RouteBuilder::scope()` instead. */ public static function scope(string $path, $params = [], $callback = null): void { deprecationWarning( - '`Router::scope()` is deprecated, use the non-static method `RouterBuilder::scope()` instead.' + '`Router::scope()` is deprecated, use the non-static method `RouteBuilder::scope()` instead.' ); $options = []; @@ -855,12 +855,12 @@ public static function scope(string $path, $params = [], $callback = null): void * If you have no parameters, this argument can be a callable. * @param callable|null $callback The callback to invoke that builds the prefixed routes. * @return void - * @deprecated 4.3.0 Use the non-static method `RouterBuilder::prefix()` instead. + * @deprecated 4.3.0 Use the non-static method `RouteBuilder::prefix()` instead. */ public static function prefix(string $name, $params = [], $callback = null): void { deprecationWarning( - '`Router::prefix()` is deprecated, use the non-static method `RouterBuilder::prefix()` instead.' + '`Router::prefix()` is deprecated, use the non-static method `RouteBuilder::prefix()` instead.' ); if (!is_array($params)) { @@ -892,12 +892,12 @@ public static function prefix(string $name, $params = [], $callback = null): voi * @param callable|null $callback The callback to invoke that builds the plugin routes. * Only required when $options is defined * @return void - * @deprecated 4.3.0 Use the non-static method `RouterBuilder::plugin()` instead. + * @deprecated 4.3.0 Use the non-static method `RouteBuilder::plugin()` instead. */ public static function plugin(string $name, $options = [], $callback = null): void { deprecationWarning( - '`Router::plugin()` is deprecated, use the non-static method `RouterBuilder::plugin()` instead.' + '`Router::plugin()` is deprecated, use the non-static method `RouteBuilder::plugin()` instead.' ); if (!is_array($options)) { @@ -978,7 +978,7 @@ protected static function unwrapShortString(array $url) * - Vendor/Cms.Management/Admin/Articles::view * * @param string $url Route path in [Plugin.][Prefix/]Controller::action format - * @return array + * @return array */ public static function parseRoutePath(string $url): array { diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/ConnectionHelper.php b/app/vendor/cakephp/cakephp/src/TestSuite/ConnectionHelper.php index 7a7f3fca3..8bfdfe28d 100644 --- a/app/vendor/cakephp/cakephp/src/TestSuite/ConnectionHelper.php +++ b/app/vendor/cakephp/cakephp/src/TestSuite/ConnectionHelper.php @@ -77,7 +77,7 @@ public function enableQueryLogging(?array $connections = null): void * Drops all tables. * * @param string $connectionName Connection name - * @param array|null $tables List of tables names or null for all. + * @param array|null $tables List of tables names or null for all. * @return void */ public function dropTables(string $connectionName, ?array $tables = null): void @@ -111,7 +111,7 @@ public function dropTables(string $connectionName, ?array $tables = null): void * Truncates all tables. * * @param string $connectionName Connection name - * @param array|null $tables List of tables names or null for all. + * @param array|null $tables List of tables names or null for all. * @return void */ public function truncateTables(string $connectionName, ?array $tables = null): void diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCodeBase.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCodeBase.php index 0b13b5a71..d41e4da33 100644 --- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCodeBase.php +++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCodeBase.php @@ -19,20 +19,18 @@ * StatusCodeBase * * @internal - * @template TCode as array|int */ abstract class StatusCodeBase extends ResponseBase { /** - * @var array|int - * @psalm-var TCode + * @var array|int */ protected $code; /** * Check assertion * - * @param array|int $other Array of min/max status codes, or a single code + * @param array|int $other Array of min/max status codes, or a single code * @return bool * @psalm-suppress MoreSpecificImplementedParamType */ diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusError.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusError.php index 189d8112c..b46c155df 100644 --- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusError.php +++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusError.php @@ -19,12 +19,11 @@ * StatusError * * @internal - * @extends \Cake\TestSuite\Constraint\Response\StatusCodeBase> */ class StatusError extends StatusCodeBase { /** - * @var array + * @var array|int */ protected $code = [400, 429]; diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusFailure.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusFailure.php index 33d4df2de..21561261e 100644 --- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusFailure.php +++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusFailure.php @@ -19,12 +19,11 @@ * StatusFailure * * @internal - * @extends \Cake\TestSuite\Constraint\Response\StatusCodeBase> */ class StatusFailure extends StatusCodeBase { /** - * @var array + * @var array|int */ protected $code = [500, 505]; diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusOk.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusOk.php index 8047ff918..c8f67d868 100644 --- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusOk.php +++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusOk.php @@ -19,12 +19,11 @@ * StatusOk * * @internal - * @extends \Cake\TestSuite\Constraint\Response\StatusCodeBase> */ class StatusOk extends StatusCodeBase { /** - * @var array + * @var array|int */ protected $code = [200, 204]; diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusSuccess.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusSuccess.php index 10b873dee..f7dfff5aa 100644 --- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusSuccess.php +++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusSuccess.php @@ -19,12 +19,11 @@ * StatusSuccess * * @internal - * @extends \Cake\TestSuite\Constraint\Response\StatusCodeBase> */ class StatusSuccess extends StatusCodeBase { /** - * @var array + * @var array|int */ protected $code = [200, 308]; diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/TestFixture.php b/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/TestFixture.php index 62ae5d246..a8ef4c97a 100644 --- a/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/TestFixture.php +++ b/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/TestFixture.php @@ -245,20 +245,21 @@ protected function _schemaFromImport(): void protected function _schemaFromReflection(): void { $db = ConnectionManager::get($this->connection()); - $schemaCollection = $db->getSchemaCollection(); - $tables = $schemaCollection->listTables(); - - if (!in_array($this->table, $tables, true)) { - throw new CakeException( - sprintf( - 'Cannot describe schema for table `%s` for fixture `%s`: the table does not exist.', - $this->table, - static::class - ) + try { + $name = Inflector::camelize($this->table); + $ormTable = $this->fetchTable($name, ['connection' => $db]); + + /** @var \Cake\Database\Schema\TableSchema $schema */ + $schema = $ormTable->getSchema(); + $this->_schema = $schema; + } catch (CakeException $e) { + $message = sprintf( + 'Cannot describe schema for table `%s` for fixture `%s`. The table does not exist.', + $this->table, + static::class ); + throw new CakeException($message, null, $e); } - - $this->_schema = $schemaCollection->describe($this->table); } /** @@ -266,7 +267,8 @@ protected function _schemaFromReflection(): void */ public function create(ConnectionInterface $connection): bool { - if (empty($this->_schema)) { + /** @psalm-suppress RedundantPropertyInitializationCheck */ + if (!isset($this->_schema)) { return false; } @@ -302,7 +304,8 @@ public function create(ConnectionInterface $connection): bool */ public function drop(ConnectionInterface $connection): bool { - if (empty($this->_schema)) { + /** @psalm-suppress RedundantPropertyInitializationCheck */ + if (!isset($this->_schema)) { return false; } diff --git a/app/vendor/cakephp/cakephp/src/Utility/Hash.php b/app/vendor/cakephp/cakephp/src/Utility/Hash.php index a20ec2010..af52e9039 100644 --- a/app/vendor/cakephp/cakephp/src/Utility/Hash.php +++ b/app/vendor/cakephp/cakephp/src/Utility/Hash.php @@ -977,7 +977,7 @@ public static function apply(array $data, string $path, callable $function) * @param array $data An array of data to sort * @param string $path A Set-compatible path to the array value * @param string|int $dir See directions above. Defaults to 'asc'. - * @param array|string $type See direction types above. Defaults to 'regular'. + * @param array|string $type See direction types above. Defaults to 'regular'. * @return array Sorted array of data * @link https://book.cakephp.org/4/en/core-libraries/hash.html#Cake\Utility\Hash::sort */ diff --git a/app/vendor/cakephp/cakephp/src/Utility/Text.php b/app/vendor/cakephp/cakephp/src/Utility/Text.php index eb6f3cb37..570a24745 100644 --- a/app/vendor/cakephp/cakephp/src/Utility/Text.php +++ b/app/vendor/cakephp/cakephp/src/Utility/Text.php @@ -330,7 +330,7 @@ public static function cleanInsert(string $str, array $options): string * - `indentAt` 0 based index to start indenting at. Defaults to 0. * * @param string $text The text to format. - * @param array|int $options Array of options to use, or an integer to wrap the text to. + * @param array|int $options Array of options to use, or an integer to wrap the text to. * @return string Formatted text. */ public static function wrap(string $text, $options = []): string @@ -367,7 +367,7 @@ public static function wrap(string $text, $options = []): string * - `indentAt` 0 based index to start indenting at. Defaults to 0. * * @param string $text The text to format. - * @param array|int $options Array of options to use, or an integer to wrap the text to. + * @param array|int $options Array of options to use, or an integer to wrap the text to. * @return string Formatted text. */ public static function wrapBlock(string $text, $options = []): string @@ -492,7 +492,7 @@ protected static function _wordWrap(string $text, int $width = 72, string $break * - `limit` A limit, optional, defaults to -1 (none) * * @param string $text Text to search the phrase in. - * @param array|string $phrase The phrase or phrases that will be searched. + * @param array|string $phrase The phrase or phrases that will be searched. * @param array $options An array of HTML attributes and options. * @return string The highlighted text * @link https://book.cakephp.org/4/en/core-libraries/text.html#highlighting-substrings @@ -1147,7 +1147,7 @@ public static function transliterate(string $string, $transliterator = null): st * For e.g. this option can be set to '.' to generate clean file names. * * @param string $string the string you want to slug - * @param array|string $options If string it will be use as replacement character + * @param array|string $options If string it will be use as replacement character * or an array of options. * @return string * @see setTransliterator() diff --git a/app/vendor/cakephp/cakephp/src/Validation/Validation.php b/app/vendor/cakephp/cakephp/src/Validation/Validation.php index bf89f7211..d250a53a2 100644 --- a/app/vendor/cakephp/cakephp/src/Validation/Validation.php +++ b/app/vendor/cakephp/cakephp/src/Validation/Validation.php @@ -486,8 +486,8 @@ public static function custom($check, ?string $regex = null): bool * - `y` 2006 just the year without any separators * * @param mixed $check a valid date string/object - * @param array|string $format Use a string or an array of the keys above. - * Arrays should be passed as ['dmy', 'mdy', etc] + * @param array|string $format Use a string or an array of the keys above. + * Arrays should be passed as ['dmy', 'mdy', ...] * @param string|null $regex If a custom regular expression is used this is the only validation that will occur. * @return bool Success */ diff --git a/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php b/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php index d7ec3d568..2cd422e04 100644 --- a/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php +++ b/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php @@ -45,7 +45,7 @@ class MissingTemplateException extends CakeException /** * Constructor * - * @param array|string $file Either the file name as a string, or in an array for backwards compatibility. + * @param array|string $file Either the file name as a string, or in an array for backwards compatibility. * @param array $paths The path list that template could not be found in. * @param int|null $code The code of the error. * @param \Throwable|null $previous the previous exception. diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/FormHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/FormHelper.php index 49e937281..152e95e71 100644 --- a/app/vendor/cakephp/cakephp/src/View/Helper/FormHelper.php +++ b/app/vendor/cakephp/cakephp/src/View/Helper/FormHelper.php @@ -1440,7 +1440,7 @@ protected function _extractOption(string $name, array $options, $default = null) * used instead of the generated values if present. * * @param string $fieldName The name of the field to generate label for. - * @param array|string|null $label Label text or array with label attributes. + * @param array|string|null $label Label text or array with label attributes. * @param array $options Options for the label element. * @return string Generated label element */ diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/HtmlHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/HtmlHelper.php index c32d1d51c..1a2df5cd9 100644 --- a/app/vendor/cakephp/cakephp/src/View/Helper/HtmlHelper.php +++ b/app/vendor/cakephp/cakephp/src/View/Helper/HtmlHelper.php @@ -124,7 +124,7 @@ class HtmlHelper extends Helper * - `block` - Set to true to append output to view block "meta" or provide * custom block name. * - * @param array|string $type The title of the external resource, Or an array of attributes for a + * @param array|string $type The title of the external resource, Or an array of attributes for a * custom meta tag. * @param array|string|null $content The address of the external resource or string for content attribute * @param array $options Other attributes for the generated tag. If the type attribute is html, @@ -725,8 +725,8 @@ public function tableHeaders(array $names, ?array $trOptions = null, ?array $thO * Returns a formatted string of table rows (TR's with TD's in them). * * @param array|string $data Array of table data - * @param array|bool|null $oddTrOptions HTML options for odd TR elements if true useCount is used - * @param array|bool|null $evenTrOptions HTML options for even TR elements + * @param array|bool|null $oddTrOptions HTML options for odd TR elements if true useCount is used + * @param array|bool|null $evenTrOptions HTML options for even TR elements * @param bool $useCount adds class "column-$i" * @param bool $continueOddEven If false, will use a non-static $count variable, * so that the odd/even count is reset to zero just for that call. @@ -767,7 +767,9 @@ public function tableCells( $count++; $cellsOut = $this->_renderCells($line, $useCount); $opts = $count % 2 ? $oddTrOptions : $evenTrOptions; - $out[] = $this->tableRow(implode(' ', $cellsOut), (array)$opts); + /** @var array $options */ + $options = (array)$opts; + $out[] = $this->tableRow(implode(' ', $cellsOut), $options); } return implode("\n", $out); diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php index 45dd0c448..d7fa2f310 100644 --- a/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php +++ b/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php @@ -413,7 +413,7 @@ public function next(string $title = 'Next >>', array $options = []): string * - `lock` Lock direction. Will only use the default direction then, defaults to false. * * @param string $key The name of the key that the recordset should be sorted. - * @param array|string|null $title Title for the link. If $title is null $key will be used + * @param array|string|null $title Title for the link. If $title is null $key will be used * for the title and will be generated by inflection. It can also be an array * with keys `asc` and `desc` for specifying separate titles based on the direction. * @param array $options Options for sorting link. See above for list of keys. diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/TextHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/TextHelper.php index c340348c0..b9c1d4b48 100644 --- a/app/vendor/cakephp/cakephp/src/View/Helper/TextHelper.php +++ b/app/vendor/cakephp/cakephp/src/View/Helper/TextHelper.php @@ -412,7 +412,7 @@ public function toList(array $list, ?string $and = null, string $separator = ', * For e.g. this option can be set to '.' to generate clean file names. * * @param string $string the string you want to slug - * @param array|string $options If string it will be used as replacement character + * @param array|string $options If string it will be used as replacement character * or an array of options. * @return string * @see \Cake\Utility\Text::setTransliterator() diff --git a/app/vendor/cakephp/cakephp/src/View/View.php b/app/vendor/cakephp/cakephp/src/View/View.php index c1a6fd2ae..2e3c51950 100644 --- a/app/vendor/cakephp/cakephp/src/View/View.php +++ b/app/vendor/cakephp/cakephp/src/View/View.php @@ -636,12 +636,17 @@ public function getConfig(?string $key = null, $default = null) * @return string Rendered Element * @throws \Cake\View\Exception\MissingElementException When an element is missing and `ignoreMissing` * is false. + * @psalm-param array{cache?:array|true, callbacks?:bool, plugin?:string|false, ignoreMissing?:bool} $options */ public function element(string $name, array $data = [], array $options = []): string { - $options += ['callbacks' => false, 'cache' => null, 'plugin' => null]; + $options += ['callbacks' => false, 'cache' => null, 'plugin' => null, 'ignoreMissing' => false]; if (isset($options['cache'])) { - $options['cache'] = $this->_elementCache($name, $data, $options); + $options['cache'] = $this->_elementCache( + $name, + $data, + array_diff_key($options, ['callbacks' => false, 'plugin' => null, 'ignoreMissing' => null]) + ); } $pluginCheck = $options['plugin'] !== false; @@ -655,13 +660,13 @@ public function element(string $name, array $data = [], array $options = []): st return $this->_renderElement($file, $data, $options); } - if (empty($options['ignoreMissing'])) { - [$plugin, $elementName] = $this->pluginSplit($name, $pluginCheck); - $paths = iterator_to_array($this->getElementPaths($plugin)); - throw new MissingElementException([$name . $this->_ext, $elementName . $this->_ext], $paths); + if ($options['ignoreMissing']) { + return ''; } - return ''; + [$plugin, $elementName] = $this->pluginSplit($name, $pluginCheck); + $paths = iterator_to_array($this->getElementPaths($plugin)); + throw new MissingElementException([$name . $this->_ext, $elementName . $this->_ext], $paths); } /** @@ -1605,12 +1610,12 @@ protected function _paths(?string $plugin = null, bool $cached = true): array * @param array $data Data * @param array $options Element options * @return array Element Cache configuration. - * @psalm-param array{cache:(array{key:string, config:string}|string|null), callbacks:mixed, plugin:mixed} $options * @psalm-return array{key:string, config:string} */ protected function _elementCache(string $name, array $data, array $options): array { if (isset($options['cache']['key'], $options['cache']['config'])) { + /** @psalm-var array{key:string, config:string}*/ $cache = $options['cache']; $cache['key'] = 'element_' . $cache['key']; @@ -1626,7 +1631,7 @@ protected function _elementCache(string $name, array $data, array $options): arr $elementKey = str_replace(['\\', '/'], '_', $name); $cache = $options['cache']; - unset($options['cache'], $options['callbacks'], $options['plugin']); + unset($options['cache']); $keys = array_merge( [$pluginKey, $elementKey], array_keys($options), diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php index feedd6fd1..26714cfa9 100644 --- a/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php +++ b/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php @@ -145,7 +145,7 @@ protected function _isDisabled(array $radio, $disabled): bool * Renders a single radio input and label. * * @param string|int $val The value of the radio input. - * @param array|string $text The label text, or complex radio type. + * @param array|string $text The label text, or complex radio type. * @param array $data Additional options for input generation. * @param \Cake\View\Form\ContextInterface $context The form context * @return string diff --git a/app/vendor/cakephp/migrations/composer.json b/app/vendor/cakephp/migrations/composer.json index 05c681bb9..07a733eb0 100644 --- a/app/vendor/cakephp/migrations/composer.json +++ b/app/vendor/cakephp/migrations/composer.json @@ -24,10 +24,10 @@ "cakephp/cache": "^4.3.0" }, "require-dev": { - "phpunit/phpunit": "~8.5.0", + "phpunit/phpunit": "^8.5.0 || ^9.5.0", "cakephp/cakephp": "^4.3.0", - "cakephp/bake": "^2.5.0", - "cakephp/cakephp-codesniffer": "~4.1" + "cakephp/bake": "^2.6.0", + "cakephp/cakephp-codesniffer": "^4.1" }, "autoload": { "psr-4": { diff --git a/app/vendor/cakephp/migrations/docs/en/index.rst b/app/vendor/cakephp/migrations/docs/en/index.rst index 56107f84f..49e41f76c 100644 --- a/app/vendor/cakephp/migrations/docs/en/index.rst +++ b/app/vendor/cakephp/migrations/docs/en/index.rst @@ -860,6 +860,15 @@ beginning:: // Run the Documents migrations on the test_docs connection. $migrator->run(['plugin' => 'Documents', 'connection' => 'test_docs']); + +If you need to run multiple sets of migrations, those can be run as follows:: + + // Run migrations for plugin Contacts on the ``test`` connection, and Documents on the ``test_docs`` connection + $migrator->runMany([ + ['plugin' => 'Contacts'], + ['plugin' => 'Documents', 'connection' => 'test_docs'] + ]); + If you need to see additional debugging output from migrations are being run, you can enable a ``debug`` level logger. diff --git a/app/vendor/cakephp/migrations/docs/fr/index.rst b/app/vendor/cakephp/migrations/docs/fr/index.rst index b8e78cd0a..ae66592a9 100644 --- a/app/vendor/cakephp/migrations/docs/fr/index.rst +++ b/app/vendor/cakephp/migrations/docs/fr/index.rst @@ -854,6 +854,50 @@ migrations. Vous pouvez aussi utiliser les options ``--source``, ``--connection`` et ``--plugin`` comme pour la commande ``migrate``. + +Utiliser Migrations dans les Tests +================================== + +Si votre application fait usage des migrations, vous pouvez ré-utiliser +celles-ci afin de maintenir le schéma de votre base de données de test. Dans +le fichier ``tests/bootstrap.php``, vous pouvez utiliser la +classe ``Migrator`` pour construire le schéma avant que vos tests ne soient lancés. +La classe ``Migrator`` réutilisera le schéma existant si il correspond à vos migrations. +Si vos migrations ont évolué depuis le dernier lancement de vos tests, toutes les +tables des connections de test concernées seront effacées et les migrations seront relancées +afin d'actualiser le schéma:: + + // dans tests/bootstrap.php + use Migrations\TestSuite\Migrator; + + $migrator = new Migrator(); + + // Simple setup sans plugins + $migrator->run(); + + // Setup sur une base de données autre que 'test' + $migrator->run(['connection' => 'test_other']); + + // Setup pour un plugin + $migrator->run(['plugin' => 'Contacts']); + + // Lancer les migrations du plugin Documents sur la connection test_docs. + $migrator->run(['plugin' => 'Documents', 'connection' => 'test_docs']); + + +Si vos migrations se trouvent à différents endroits, celles-ci doivent être executées ainsi:: + + // Migrations du plugin Contacts sur la connection ``test``, et du plugin Documents sur la connection ``test_docs`` + $migrator->runMany([ + ['plugin' => 'Contacts'], + ['plugin' => 'Documents', 'connection' => 'test_docs'] + ]); + +Les informations relatives au status des migrations de test sont rapportées dans les logs de l'application. + +.. versionadded: 3.2.0 + Migrator was added to complement the new fixtures in CakePHP 4.3.0. + Utiliser Migrations dans les Plugins ==================================== diff --git a/app/vendor/cakephp/migrations/src/TestSuite/Migrator.php b/app/vendor/cakephp/migrations/src/TestSuite/Migrator.php index 6d554230f..9bce49bed 100644 --- a/app/vendor/cakephp/migrations/src/TestSuite/Migrator.php +++ b/app/vendor/cakephp/migrations/src/TestSuite/Migrator.php @@ -35,43 +35,86 @@ public function __construct() } /** - * Runs migrations. + * Runs one set of migrations. + * This is useful if all your migrations are located in config/Migrations, + * or in a single directory, or in a single plugin. * * For options, {@see \Migrations\Migrations::migrate()}. * - * @param array $options Migrate options + * @param array $options Migrate options. Connection defaults to `test`. * @param bool $truncateTables Truncate all tables after running migrations. Defaults to true. * @return void */ public function run( array $options = [], bool $truncateTables = true + ): void { + $this->runMany([$options], $truncateTables); + } + + /** + * Runs multiple sets of migrations. + * This is useful if your migrations are located in multiple sources, plugins or connections. + * + * For options, {@see \Migrations\Migrations::migrate()}. + * + * Example: + * + * $this->runMany([ + * ['connection' => 'some-connection', 'source' => 'some/directory'], + * ['plugin' => 'PluginA'] + * ]); + * + * @param array> $options Array of option arrays. + * @param bool $truncateTables Truncate all tables after running migrations. Defaults to true. + * @return void + */ + public function runMany( + array $options = [], + bool $truncateTables = true ): void { // Don't recreate schema if we are in a phpunit separate process test. if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { return; } - $options += ['connection' => 'test']; - $migrations = new Migrations(); - - if ($this->shouldDropTables($migrations, $options)) { - $dropTables = $this->getNonPhinxTables($options['connection']); - if (count($dropTables)) { - $this->helper->dropTables($options['connection'], $dropTables); + // Detect all connections involved, and mark those with changed status. + $connectionsToDrop = []; + $connectionsList = []; + foreach ($options as $i => $migrationSet) { + $migrationSet += ['connection' => 'test']; + $options[$i] = $migrationSet; + $connectionName = $migrationSet['connection']; + if (!in_array($connectionName, $connectionsList)) { + $connectionsList[] = $connectionName; } - $phinxTables = $this->getPhinxTables($options['connection']); - if (count($phinxTables)) { - $this->helper->truncateTables($options['connection'], $phinxTables); + + $migrations = new Migrations(); + if (!in_array($connectionName, $connectionsToDrop) && $this->shouldDropTables($migrations, $migrationSet)) { + $connectionsToDrop[] = $connectionName; } } - if (!$migrations->migrate($options)) { - throw new RuntimeException(sprintf('Unable to migrate fixtures for `%s`.', $options['connection'])); + foreach ($connectionsToDrop as $connectionName) { + $this->dropTables($connectionName); + } + + // Run all sets of migrations + foreach ($options as $migrationSet) { + $migrations = new Migrations(); + + if (!$migrations->migrate($migrationSet)) { + throw new RuntimeException( + sprintf('Unable to migrate fixtures for `%s`.', $migrationSet['connection']) + ); + } } + // Truncate all connections if required in parameters if ($truncateTables) { - $this->truncate($options['connection']); + foreach ($connectionsList as $connectionName) { + $this->truncate($connectionName); + } } } @@ -129,6 +172,25 @@ protected function shouldDropTables(Migrations $migrations, array $options): boo return false; } + /** + * Drops the regular tables of the provided connection + * and truncates the phinx tables. + * + * @param string $connection Connection on which tables are dropped. + * @return void + */ + protected function dropTables(string $connection): void + { + $dropTables = $this->getNonPhinxTables($connection); + if (count($dropTables)) { + $this->helper->dropTables($connection, $dropTables); + } + $phinxTables = $this->getPhinxTables($connection); + if (count($phinxTables)) { + $this->helper->truncateTables($connection, $phinxTables); + } + } + /** * Get the list of tables that are phinxlog * diff --git a/app/vendor/composer/InstalledVersions.php b/app/vendor/composer/InstalledVersions.php index 7c5502ca4..d50e0c9fc 100644 --- a/app/vendor/composer/InstalledVersions.php +++ b/app/vendor/composer/InstalledVersions.php @@ -24,8 +24,21 @@ */ class InstalledVersions { + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + */ private static $installed; + + /** + * @var bool|null + */ private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ private static $installedByVendor = array(); /** diff --git a/app/vendor/composer/autoload_classmap.php b/app/vendor/composer/autoload_classmap.php index 71d8d303b..53e82c769 100644 --- a/app/vendor/composer/autoload_classmap.php +++ b/app/vendor/composer/autoload_classmap.php @@ -8,9 +8,7 @@ return array( 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', 'Mobile_Detect' => $vendorDir . '/mobiledetect/mobiledetectlib/Mobile_Detect.php', - 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', 'PHPUnit\\Exception' => $vendorDir . '/phpunit/phpunit/src/Exception.php', 'PHPUnit\\Framework\\ActualValueIsNotAnObjectException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php', 'PHPUnit\\Framework\\Assert' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert.php', diff --git a/app/vendor/composer/autoload_files.php b/app/vendor/composer/autoload_files.php index 5a22c48ac..7c30393a1 100644 --- a/app/vendor/composer/autoload_files.php +++ b/app/vendor/composer/autoload_files.php @@ -7,17 +7,12 @@ return array( '9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', - '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', '07d7f1a47144818725fd8d91a907ac57' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', @@ -42,8 +37,10 @@ '90236b492da7ca2983a2ad6e33e4152e' => $vendorDir . '/cakephp/cakephp/src/I18n/functions.php', '2cb76c05856dfb60ada40ef54138d49a' => $vendorDir . '/cakephp/cakephp/src/Routing/functions.php', 'b1fc73705e1bec51cd2b20a32cf1c60a' => $vendorDir . '/cakephp/cakephp/src/Utility/bootstrap.php', + '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', + '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', '801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php', - 'bf9f5270ae66ac6fa0290b4bf47867b7' => $vendorDir . '/adodb/adodb-php/adodb.inc.php', '9e907be52ac44624247b526b1e9ccfae' => $vendorDir . '/cakephp/repl/src/functions.php', + 'bf9f5270ae66ac6fa0290b4bf47867b7' => $vendorDir . '/adodb/adodb-php/adodb.inc.php', ); diff --git a/app/vendor/composer/autoload_psr4.php b/app/vendor/composer/autoload_psr4.php index fd1765d4c..fc5ccf05d 100644 --- a/app/vendor/composer/autoload_psr4.php +++ b/app/vendor/composer/autoload_psr4.php @@ -12,17 +12,14 @@ 'Twig\\' => array($vendorDir . '/twig/twig/src'), 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), + 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'), 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), - 'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'), 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'), - 'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'), 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), 'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'), + 'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'), 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), 'Symfony\\Component\\Config\\' => array($vendorDir . '/symfony/config'), 'SlevomatCodingStandard\\' => array($vendorDir . '/slevomat/coding-standard/SlevomatCodingStandard'), diff --git a/app/vendor/composer/autoload_static.php b/app/vendor/composer/autoload_static.php index 9614c6e4a..13443dcb2 100644 --- a/app/vendor/composer/autoload_static.php +++ b/app/vendor/composer/autoload_static.php @@ -8,17 +8,12 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7 { public static $files = array ( '9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', - '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', '07d7f1a47144818725fd8d91a907ac57' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', @@ -43,10 +38,12 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7 '90236b492da7ca2983a2ad6e33e4152e' => __DIR__ . '/..' . '/cakephp/cakephp/src/I18n/functions.php', '2cb76c05856dfb60ada40ef54138d49a' => __DIR__ . '/..' . '/cakephp/cakephp/src/Routing/functions.php', 'b1fc73705e1bec51cd2b20a32cf1c60a' => __DIR__ . '/..' . '/cakephp/cakephp/src/Utility/bootstrap.php', + '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', + '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', '801c31d8ed748cfa537fa45402288c95' => __DIR__ . '/..' . '/psy/psysh/src/functions.php', - 'bf9f5270ae66ac6fa0290b4bf47867b7' => __DIR__ . '/..' . '/adodb/adodb-php/adodb.inc.php', '9e907be52ac44624247b526b1e9ccfae' => __DIR__ . '/..' . '/cakephp/repl/src/functions.php', + 'bf9f5270ae66ac6fa0290b4bf47867b7' => __DIR__ . '/..' . '/adodb/adodb-php/adodb.inc.php', ); public static $prefixLengthsPsr4 = array ( @@ -67,17 +64,14 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7 array ( 'Symfony\\Polyfill\\Php81\\' => 23, 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Php73\\' => 23, + 'Symfony\\Polyfill\\Php72\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31, 'Symfony\\Polyfill\\Ctype\\' => 23, - 'Symfony\\Contracts\\Service\\' => 26, 'Symfony\\Component\\VarDumper\\' => 28, - 'Symfony\\Component\\String\\' => 25, 'Symfony\\Component\\Process\\' => 26, 'Symfony\\Component\\Finder\\' => 25, 'Symfony\\Component\\Filesystem\\' => 29, + 'Symfony\\Component\\Debug\\' => 24, 'Symfony\\Component\\Console\\' => 26, 'Symfony\\Component\\Config\\' => 25, 'SlevomatCodingStandard\\' => 23, @@ -187,38 +181,22 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7 array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', ), - 'Symfony\\Polyfill\\Php73\\' => + 'Symfony\\Polyfill\\Php72\\' => array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', + 0 => __DIR__ . '/..' . '/symfony/polyfill-php72', ), 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', ), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', - ), - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme', - ), 'Symfony\\Polyfill\\Ctype\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', ), - 'Symfony\\Contracts\\Service\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/service-contracts', - ), 'Symfony\\Component\\VarDumper\\' => array ( 0 => __DIR__ . '/..' . '/symfony/var-dumper', ), - 'Symfony\\Component\\String\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/string', - ), 'Symfony\\Component\\Process\\' => array ( 0 => __DIR__ . '/..' . '/symfony/process', @@ -231,6 +209,10 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7 array ( 0 => __DIR__ . '/..' . '/symfony/filesystem', ), + 'Symfony\\Component\\Debug\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/debug', + ), 'Symfony\\Component\\Console\\' => array ( 0 => __DIR__ . '/..' . '/symfony/console', @@ -464,9 +446,7 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7 public static $classMap = array ( 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', 'Mobile_Detect' => __DIR__ . '/..' . '/mobiledetect/mobiledetectlib/Mobile_Detect.php', - 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', 'PHPUnit\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Exception.php', 'PHPUnit\\Framework\\ActualValueIsNotAnObjectException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php', 'PHPUnit\\Framework\\Assert' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert.php', diff --git a/app/vendor/composer/ca-bundle/res/cacert.pem b/app/vendor/composer/ca-bundle/res/cacert.pem index 456003b9e..0bf312fe5 100644 --- a/app/vendor/composer/ca-bundle/res/cacert.pem +++ b/app/vendor/composer/ca-bundle/res/cacert.pem @@ -1,7 +1,7 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Mon Jul 5 21:35:54 2021 GMT +## Certificate data from Mozilla as of: Tue Oct 26 03:12:05 2021 GMT ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates @@ -14,9 +14,7 @@ ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.28. -## SHA256: c8f6733d1ff4e6a4769c182971a1234f95ae079247a9c439a13423fe8ba5c24f -## -## Modified to remove expiring DST Root CA X3: 2021-09-25. +## SHA256: bb36818a81feaa4cca61101e6d6276cd09e972efcb08112dfed846918ca41d7f ## @@ -3154,3 +3152,81 @@ WWRrJ8/vJ8HjJLWG965+Mk2weWjROeiQWMODvA8s1pfrzgzhIMfatz7DP78v3DSk+yshzWePS/Tj OPQD8rv7gmsHINFSH5pkAnuYZttcTVoP0ISVoDwUQwbKytu4QTbaakRnh6+v40URFWkIsr4WOZck bxJF0WddCajJFdr60qZfE2Efv4WstK2tBZQIgx51F9NxO5NQI1mg7TyRVJ12AMXDuDjb -----END CERTIFICATE----- + +TunTrust Root CA +================ +-----BEGIN CERTIFICATE----- +MIIFszCCA5ugAwIBAgIUEwLV4kBMkkaGFmddtLu7sms+/BMwDQYJKoZIhvcNAQELBQAwYTELMAkG +A1UEBhMCVE4xNzA1BgNVBAoMLkFnZW5jZSBOYXRpb25hbGUgZGUgQ2VydGlmaWNhdGlvbiBFbGVj +dHJvbmlxdWUxGTAXBgNVBAMMEFR1blRydXN0IFJvb3QgQ0EwHhcNMTkwNDI2MDg1NzU2WhcNNDQw +NDI2MDg1NzU2WjBhMQswCQYDVQQGEwJUTjE3MDUGA1UECgwuQWdlbmNlIE5hdGlvbmFsZSBkZSBD +ZXJ0aWZpY2F0aW9uIEVsZWN0cm9uaXF1ZTEZMBcGA1UEAwwQVHVuVHJ1c3QgUm9vdCBDQTCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMPN0/y9BFPdDCA61YguBUtB9YOCfvdZn56eY+hz +2vYGqU8ftPkLHzmMmiDQfgbU7DTZhrx1W4eI8NLZ1KMKsmwb60ksPqxd2JQDoOw05TDENX37Jk0b +bjBU2PWARZw5rZzJJQRNmpA+TkBuimvNKWfGzC3gdOgFVwpIUPp6Q9p+7FuaDmJ2/uqdHYVy7BG7 +NegfJ7/Boce7SBbdVtfMTqDhuazb1YMZGoXRlJfXyqNlC/M4+QKu3fZnz8k/9YosRxqZbwUN/dAd +gjH8KcwAWJeRTIAAHDOFli/LQcKLEITDCSSJH7UP2dl3RxiSlGBcx5kDPP73lad9UKGAwqmDrViW +VSHbhlnUr8a83YFuB9tgYv7sEG7aaAH0gxupPqJbI9dkxt/con3YS7qC0lH4Zr8GRuR5KiY2eY8f +Tpkdso8MDhz/yV3A/ZAQprE38806JG60hZC/gLkMjNWb1sjxVj8agIl6qeIbMlEsPvLfe/ZdeikZ +juXIvTZxi11Mwh0/rViizz1wTaZQmCXcI/m4WEEIcb9PuISgjwBUFfyRbVinljvrS5YnzWuioYas +DXxU5mZMZl+QviGaAkYt5IPCgLnPSz7ofzwB7I9ezX/SKEIBlYrilz0QIX32nRzFNKHsLA4KUiwS +VXAkPcvCFDVDXSdOvsC9qnyW5/yeYa1E0wCXAgMBAAGjYzBhMB0GA1UdDgQWBBQGmpsfU33x9aTI +04Y+oXNZtPdEITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFAaamx9TffH1pMjThj6hc1m0 +90QhMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAqgVutt0Vyb+zxiD2BkewhpMl +0425yAA/l/VSJ4hxyXT968pk21vvHl26v9Hr7lxpuhbI87mP0zYuQEkHDVneixCwSQXi/5E/S7fd +Ao74gShczNxtr18UnH1YeA32gAm56Q6XKRm4t+v4FstVEuTGfbvE7Pi1HE4+Z7/FXxttbUcoqgRY +YdZ2vyJ/0Adqp2RT8JeNnYA/u8EH22Wv5psymsNUk8QcCMNE+3tjEUPRahphanltkE8pjkcFwRJp +adbGNjHh/PqAulxPxOu3Mqz4dWEX1xAZufHSCe96Qp1bWgvUxpVOKs7/B9dPfhgGiPEZtdmYu65x +xBzndFlY7wyJz4sfdZMaBBSSSFCp61cpABbjNhzI+L/wM9VBD8TMPN3pM0MBkRArHtG5Xc0yGYuP +jCB31yLEQtyEFpslbei0VXF/sHyz03FJuc9SpAQ/3D2gu68zngowYI7bnV2UqL1g52KAdoGDDIzM +MEZJ4gzSqK/rYXHv5yJiqfdcZGyfFoxnNidF9Ql7v/YQCvGwjVRDjAS6oz/v4jXH+XTgbzRB0L9z +ZVcg+ZtnemZoJE6AZb0QmQZZ8mWvuMZHu/2QeItBcy6vVR/cO5JyboTT0GFMDcx2V+IthSIVNg3r +AZ3r2OvEhJn7wAzMMujjd9qDRIueVSjAi1jTkD5OGwDxFa2DK5o= +-----END CERTIFICATE----- + +HARICA TLS RSA Root CA 2021 +=========================== +-----BEGIN CERTIFICATE----- +MIIFpDCCA4ygAwIBAgIQOcqTHO9D88aOk8f0ZIk4fjANBgkqhkiG9w0BAQsFADBsMQswCQYDVQQG +EwJHUjE3MDUGA1UECgwuSGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u +cyBDQTEkMCIGA1UEAwwbSEFSSUNBIFRMUyBSU0EgUm9vdCBDQSAyMDIxMB4XDTIxMDIxOTEwNTUz +OFoXDTQ1MDIxMzEwNTUzN1owbDELMAkGA1UEBhMCR1IxNzA1BgNVBAoMLkhlbGxlbmljIEFjYWRl +bWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ0ExJDAiBgNVBAMMG0hBUklDQSBUTFMgUlNB +IFJvb3QgQ0EgMjAyMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAIvC569lmwVnlskN +JLnQDmT8zuIkGCyEf3dRywQRNrhe7Wlxp57kJQmXZ8FHws+RFjZiPTgE4VGC/6zStGndLuwRo0Xu +a2s7TL+MjaQenRG56Tj5eg4MmOIjHdFOY9TnuEFE+2uva9of08WRiFukiZLRgeaMOVig1mlDqa2Y +Ulhu2wr7a89o+uOkXjpFc5gH6l8Cct4MpbOfrqkdtx2z/IpZ525yZa31MJQjB/OCFks1mJxTuy/K +5FrZx40d/JiZ+yykgmvwKh+OC19xXFyuQnspiYHLA6OZyoieC0AJQTPb5lh6/a6ZcMBaD9YThnEv +dmn8kN3bLW7R8pv1GmuebxWMevBLKKAiOIAkbDakO/IwkfN4E8/BPzWr8R0RI7VDIp4BkrcYAuUR +0YLbFQDMYTfBKnya4dC6s1BG7oKsnTH4+yPiAwBIcKMJJnkVU2DzOFytOOqBAGMUuTNe3QvboEUH +GjMJ+E20pwKmafTCWQWIZYVWrkvL4N48fS0ayOn7H6NhStYqE613TBoYm5EPWNgGVMWX+Ko/IIqm +haZ39qb8HOLubpQzKoNQhArlT4b4UEV4AIHrW2jjJo3Me1xR9BQsQL4aYB16cmEdH2MtiKrOokWQ +CPxrvrNQKlr9qEgYRtaQQJKQCoReaDH46+0N0x3GfZkYVVYnZS6NRcUk7M7jAgMBAAGjQjBAMA8G +A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFApII6ZgpJIKM+qTW8VX6iVNvRLuMA4GA1UdDwEB/wQE +AwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAPpBIqm5iFSVmewzVjIuJndftTgfvnNAUX15QvWiWkKQU +EapobQk1OUAJ2vQJLDSle1mESSmXdMgHHkdt8s4cUCbjnj1AUz/3f5Z2EMVGpdAgS1D0NTsY9FVq +QRtHBmg8uwkIYtlfVUKqrFOFrJVWNlar5AWMxajaH6NpvVMPxP/cyuN+8kyIhkdGGvMA9YCRotxD +QpSbIPDRzbLrLFPCU3hKTwSUQZqPJzLB5UkZv/HywouoCjkxKLR9YjYsTewfM7Z+d21+UPCfDtcR +j88YxeMn/ibvBZ3PzzfF0HvaO7AWhAw6k9a+F9sPPg4ZeAnHqQJyIkv3N3a6dcSFA1pj1bF1BcK5 +vZStjBWZp5N99sXzqnTPBIWUmAD04vnKJGW/4GKvyMX6ssmeVkjaef2WdhW+o45WxLM0/L5H9MG0 +qPzVMIho7suuyWPEdr6sOBjhXlzPrjoiUevRi7PzKzMHVIf6tLITe7pTBGIBnfHAT+7hOtSLIBD6 +Alfm78ELt5BGnBkpjNxvoEppaZS3JGWg/6w/zgH7IS79aPib8qXPMThcFarmlwDB31qlpzmq6YR/ +PFGoOtmUW4y/Twhx5duoXNTSpv4Ao8YWxw/ogM4cKGR0GQjTQuPOAF1/sdwTsOEFy9EgqoZ0njnn +kf3/W9b3raYvAwtt41dU63ZTGI0RmLo= +-----END CERTIFICATE----- + +HARICA TLS ECC Root CA 2021 +=========================== +-----BEGIN CERTIFICATE----- +MIICVDCCAdugAwIBAgIQZ3SdjXfYO2rbIvT/WeK/zjAKBggqhkjOPQQDAzBsMQswCQYDVQQGEwJH +UjE3MDUGA1UECgwuSGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBD +QTEkMCIGA1UEAwwbSEFSSUNBIFRMUyBFQ0MgUm9vdCBDQSAyMDIxMB4XDTIxMDIxOTExMDExMFoX +DTQ1MDIxMzExMDEwOVowbDELMAkGA1UEBhMCR1IxNzA1BgNVBAoMLkhlbGxlbmljIEFjYWRlbWlj +IGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ0ExJDAiBgNVBAMMG0hBUklDQSBUTFMgRUNDIFJv +b3QgQ0EgMjAyMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABDgI/rGgltJ6rK9JOtDA4MM7KKrxcm1l +AEeIhPyaJmuqS7psBAqIXhfyVYf8MLA04jRYVxqEU+kw2anylnTDUR9YSTHMmE5gEYd103KUkE+b +ECUqqHgtvpBBWJAVcqeht6NCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUyRtTgRL+BNUW +0aq8mm+3oJUZbsowDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMDA2cAMGQCMBHervjcToiwqfAi +rcJRQO9gcS3ujwLEXQNwSaSS6sUUiHCm0w2wqsosQJz76YJumgIwK0eaB8bRwoF8yguWGEEbo/Qw +CZ61IygNnxS2PFOiTAZpffpskcYqSUXm7LcT4Tps +-----END CERTIFICATE----- diff --git a/app/vendor/composer/ca-bundle/src/CaBundle.php b/app/vendor/composer/ca-bundle/src/CaBundle.php index 0109ba037..d99c00f69 100644 --- a/app/vendor/composer/ca-bundle/src/CaBundle.php +++ b/app/vendor/composer/ca-bundle/src/CaBundle.php @@ -108,7 +108,7 @@ public static function getSystemCaRootBundlePath(LoggerInterface $logger = null) return self::$caPath = $caBundle; } - if ($caBundle && self::caDirUsable($caBundle)) { + if ($caBundle && self::caDirUsable($caBundle, $logger)) { return self::$caPath = $caBundle; } } @@ -335,19 +335,97 @@ private static function getEnvVariable($name) /** * @param string|false $certFile + * @param LoggerInterface|null $logger * @return bool */ private static function caFileUsable($certFile, LoggerInterface $logger = null) { - return $certFile && @is_file($certFile) && @is_readable($certFile) && static::validateCaFile($certFile, $logger); + return $certFile + && static::isFile($certFile, $logger) + && static::isReadable($certFile, $logger) + && static::validateCaFile($certFile, $logger); } /** * @param string|false $certDir + * @param LoggerInterface|null $logger * @return bool */ - private static function caDirUsable($certDir) + private static function caDirUsable($certDir, LoggerInterface $logger = null) { - return $certDir && @is_dir($certDir) && @is_readable($certDir) && glob($certDir . '/*'); + return $certDir + && static::isDir($certDir, $logger) + && static::isReadable($certDir, $logger) + && static::glob($certDir . '/*', $logger); + } + + /** + * @param string $certFile + * @param LoggerInterface|null $logger + * @return bool + */ + private static function isFile($certFile, LoggerInterface $logger = null) + { + $isFile = @is_file($certFile); + if (!$isFile && $logger) { + $logger->debug(sprintf('Checked CA file %s does not exist or it is not a file.', $certFile)); + } + + return $isFile; + } + + /** + * @param string $certDir + * @param LoggerInterface|null $logger + * @return bool + */ + private static function isDir($certDir, LoggerInterface $logger = null) + { + $isDir = @is_dir($certDir); + if (!$isDir && $logger) { + $logger->debug(sprintf('Checked directory %s does not exist or it is not a directory.', $certDir)); + } + + return $isDir; + } + + /** + * @param string $certFileOrDir + * @param LoggerInterface|null $logger + * @return bool + */ + private static function isReadable($certFileOrDir, LoggerInterface $logger = null) + { + $isReadable = @is_readable($certFileOrDir); + if (!$isReadable && $logger) { + $logger->debug(sprintf('Checked file or directory %s is not readable.', $certFileOrDir)); + } + + return $isReadable; + } + + /** + * @param string $pattern + * @param LoggerInterface|null $logger + * @return bool + */ + private static function glob($pattern, LoggerInterface $logger = null) + { + $certs = glob($pattern); + if ($certs === false) { + if ($logger) { + $logger->debug(sprintf("An error occurred while trying to find certificates for pattern: %s", $pattern)); + } + return false; + } + + if (count($certs) === 0) { + if ($logger) { + $logger->debug(sprintf("No CA files found for pattern: %s", $pattern)); + } + return false; + } + + return true; } } diff --git a/app/vendor/composer/composer/.gitignore b/app/vendor/composer/composer/.gitignore index 0b1fb77c0..3db374fdf 100644 --- a/app/vendor/composer/composer/.gitignore +++ b/app/vendor/composer/composer/.gitignore @@ -9,4 +9,4 @@ phpunit.xml .vagrant Vagrantfile .idea -.php_cs.cache +.php-cs-fixer.cache diff --git a/app/vendor/composer/composer/.php-cs-fixer.php b/app/vendor/composer/composer/.php-cs-fixer.php new file mode 100644 index 000000000..4031efea1 --- /dev/null +++ b/app/vendor/composer/composer/.php-cs-fixer.php @@ -0,0 +1,68 @@ + + Jordi Boggiano + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. +EOF; + +$finder = PhpCsFixer\Finder::create() + ->files() + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') + ->name('*.php') + ->notPath('Fixtures') +; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PSR2' => true, + 'array_syntax' => array('syntax' => 'long'), + 'binary_operator_spaces' => true, + 'blank_line_before_statement' => array('statements' => array('declare', 'return')), + 'cast_spaces' => array('space' => 'single'), + 'header_comment' => array('header' => $header), + 'include' => true, + + 'class_attributes_separation' => array('elements' => array('method' => 'one', 'trait_import' => 'none')), + 'no_blank_lines_after_class_opening' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, + 'no_leading_import_slash' => true, + 'no_leading_namespace_whitespace' => true, + 'no_trailing_comma_in_singleline_array' => true, + 'no_whitespace_in_blank_line' => true, + 'object_operator_without_whitespace' => true, + //'phpdoc_align' => true, + 'phpdoc_indent' => true, + 'phpdoc_no_access' => true, + 'phpdoc_no_package' => true, + //'phpdoc_order' => true, + 'phpdoc_scalar' => true, + 'phpdoc_trim' => true, + 'phpdoc_types' => true, + 'psr_autoloading' => true, + 'single_blank_line_before_namespace' => true, + 'standardize_not_equals' => true, + 'ternary_operator_spaces' => true, + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], + 'unary_operator_spaces' => true, + + // imports + 'no_unused_imports' => true, + 'fully_qualified_strict_types' => true, + 'single_line_after_imports' => true, + 'fully_qualified_strict_types' => true, + //'global_namespace_import' => ['import_classes' => true], + 'no_leading_import_slash' => true, + 'single_import_per_statement' => true, + ]) + ->setUsingCache(true) + ->setRiskyAllowed(true) + ->setFinder($finder) +; diff --git a/app/vendor/composer/composer/CHANGELOG.md b/app/vendor/composer/composer/CHANGELOG.md index 983bc68a3..ae55a5967 100644 --- a/app/vendor/composer/composer/CHANGELOG.md +++ b/app/vendor/composer/composer/CHANGELOG.md @@ -1,3 +1,26 @@ +### [2.1.12] 2021-11-09 + + * Fixed issues in proxied binary files relying on __FILE__ / __DIR__ on php <8 (#10261) + * Fixed 9999999-dev being shown in some cases by the `show` command (#10260) + * Fixed GitHub Actions output escaping regression on PHP 8.1 (#10250) + +### [2.1.11] 2021-11-02 + + * Fixed issues in proxied binary files when using declare() on php <8 (#10249) + * Fixed GitHub Actions output escaping issues (#10243) + +### [2.1.10] 2021-10-29 + + * Added type annotations to all classes, which may have an effect on CI/static analysis for people using Composer as a dependency (#10159) + * Fixed CurlDownloader requesting gzip encoding even when no gzip support is present (#10153) + * Fixed regression in 2.1.6 where the help command was not working for plugin commands (#10147) + * Fixed warning showing when an invalid cache dir is configured but unused (#10125) + * Fixed `require` command reverting changes even though dependency resolution succeeded when something fails in scripts for example (#10118) + * Fixed `require` not finding the right package version when some newly required extension is missing from the system (#10167) + * Fixed proxied binary file issues, now using output buffering (e1dbd65aff) + * Fixed and improved error reporting in several edge cases (#9804, #10136, #10163, #10224, #10209) + * Fixed some more Windows CLI parameter escaping edge cases + ### [2.1.9] 2021-10-05 * Security: Fixed command injection vulnerability on Windows (GHSA-frqg-7g38-6gcf / CVE-2021-41116) @@ -1274,6 +1297,9 @@ * Initial release +[2.1.12]: https://github.com/composer/composer/compare/2.1.11...2.1.12 +[2.1.11]: https://github.com/composer/composer/compare/2.1.10...2.1.11 +[2.1.10]: https://github.com/composer/composer/compare/2.1.9...2.1.10 [2.1.9]: https://github.com/composer/composer/compare/2.1.8...2.1.9 [2.1.8]: https://github.com/composer/composer/compare/2.1.7...2.1.8 [2.1.7]: https://github.com/composer/composer/compare/2.1.6...2.1.7 diff --git a/app/vendor/composer/composer/README.md b/app/vendor/composer/composer/README.md index 99c2cc866..bc7d8c645 100644 --- a/app/vendor/composer/composer/README.md +++ b/app/vendor/composer/composer/README.md @@ -5,7 +5,7 @@ Composer helps you declare, manage, and install dependencies of PHP projects. See [https://getcomposer.org/](https://getcomposer.org/) for more information and documentation. -[![Continuous Integration](https://github.com/composer/composer/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/composer/composer/actions) +[![Continuous Integration](https://github.com/composer/composer/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/composer/composer/actions) Installation / Usage -------------------- diff --git a/app/vendor/composer/composer/bin/composer b/app/vendor/composer/composer/bin/composer index 62c18974d..cee476b6d 100755 --- a/app/vendor/composer/composer/bin/composer +++ b/app/vendor/composer/composer/bin/composer @@ -24,6 +24,12 @@ if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '4.0', '>=')) { echo 'HHVM 4.0 has dropped support for Composer, please use PHP instead. Aborting.'.PHP_EOL; exit(1); } +if (!extension_loaded('iconv') && !extension_loaded('mbstring')) { + echo 'The iconv OR mbstring extension is required and both are missing.' + .PHP_EOL.'Install either of them or recompile php without --disable-iconv.' + .PHP_EOL.'Aborting.'.PHP_EOL; + exit(1); +} if (function_exists('ini_set')) { @ini_set('display_errors', '1'); diff --git a/app/vendor/composer/composer/composer.json b/app/vendor/composer/composer/composer.json index 9225f2e5f..a13c6b5d4 100644 --- a/app/vendor/composer/composer/composer.json +++ b/app/vendor/composer/composer/composer.json @@ -29,7 +29,7 @@ "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^2.0", "justinrainbow/json-schema": "^5.2.11", - "psr/log": "^1.0", + "psr/log": "^1.0 || ^2.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", @@ -55,7 +55,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-main": "2.1-dev" } }, "autoload": { diff --git a/app/vendor/composer/composer/composer.lock b/app/vendor/composer/composer/composer.lock index 22981a039..e628c1a23 100644 --- a/app/vendor/composer/composer/composer.lock +++ b/app/vendor/composer/composer/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dfe550a024c0c2bb0784765e457968af", + "content-hash": "d3dfd8964a34240eba83383a25e2f1fb", "packages": [ { "name": "composer/ca-bundle", - "version": "1.2.11", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582" + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", - "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", "shasum": "" }, "require": { @@ -64,7 +64,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.11" + "source": "https://github.com/composer/ca-bundle/tree/1.3.1" }, "funding": [ { @@ -80,7 +80,7 @@ "type": "tidelift" } ], - "time": "2021-09-25T20:32:43+00:00" + "time": "2021-10-28T20:44:15+00:00" }, { "name": "composer/metadata-minifier", @@ -153,16 +153,16 @@ }, { "name": "composer/semver", - "version": "3.2.5", + "version": "3.2.6", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + "reference": "83e511e247de329283478496f7a1e114c9517506" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", + "reference": "83e511e247de329283478496f7a1e114c9517506", "shasum": "" }, "require": { @@ -214,7 +214,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.5" + "source": "https://github.com/composer/semver/tree/3.2.6" }, "funding": [ { @@ -230,7 +230,7 @@ "type": "tidelift" } ], - "time": "2021-05-24T12:41:47+00:00" + "time": "2021-10-25T11:34:17+00:00" }, { "name": "composer/spdx-licenses", diff --git a/app/vendor/composer/composer/doc/00-intro.md b/app/vendor/composer/composer/doc/00-intro.md index 8afd60090..acd5ee3e6 100644 --- a/app/vendor/composer/composer/doc/00-intro.md +++ b/app/vendor/composer/composer/doc/00-intro.md @@ -49,7 +49,7 @@ Linux and macOS. Composer offers a convenient installer that you can execute directly from the command line. Feel free to [download this file](https://getcomposer.org/installer) -or review it on [GitHub](https://github.com/composer/getcomposer.org/blob/master/web/installer) +or review it on [GitHub](https://github.com/composer/getcomposer.org/blob/main/web/installer) if you wish to know more about the inner workings of the installer. The source is plain PHP. diff --git a/app/vendor/composer/composer/doc/03-cli.md b/app/vendor/composer/composer/doc/03-cli.md index c35eabb61..6722fa8b3 100644 --- a/app/vendor/composer/composer/doc/03-cli.md +++ b/app/vendor/composer/composer/doc/03-cli.md @@ -9,7 +9,7 @@ can give you more information. As Composer uses [symfony/console](https://github.com/symfony/console) you can call commands by short name if it's not ambiguous. ```sh -composer dump +php composer.phar dump ``` calls `composer dump-autoload`. @@ -230,7 +230,7 @@ to the command. php composer.phar require "vendor/package:2.*" vendor/package2:dev-master ``` -If you do not specify a package, composer will prompt you to search for a package, and given results, provide a list of matches to require. +If you do not specify a package, Composer will prompt you to search for a package, and given results, provide a list of matches to require. ### Options @@ -694,7 +694,7 @@ If Composer was not installed as a PHAR, this command is not available. ## config -The `config` command allows you to edit composer config settings and repositories +The `config` command allows you to edit Composer config settings and repositories in either the local `composer.json` file or the global `config.json` file. Additionally it lets you edit most properties in the local `composer.json`. @@ -907,7 +907,7 @@ runs. ### Options -* **--list (-l):** List the available composer binaries. +* **--list (-l):** List the available Composer binaries. ## diagnose @@ -1030,8 +1030,9 @@ it points to `$XDG_CONFIG_HOME/composer`. On other \*nix systems, it points to #### COMPOSER_HOME/config.json You may put a `config.json` file into the location which `COMPOSER_HOME` points -to. Composer will merge this configuration with your project's `composer.json` -when you run the `install` and `update` commands. +to. Composer will partially (only `config` and `repositories` keys) merge this +configuration with your project's `composer.json` when you run the `install` and +`update` commands. This file allows you to set [repositories](05-repositories.md) and [configuration](06-config.md) for the user's projects. @@ -1042,7 +1043,7 @@ configuration in the project's `composer.json` always wins. ### COMPOSER_HTACCESS_PROTECT Defaults to `1`. If set to `0`, Composer will not create `.htaccess` files in the -composer home, cache, and data directories. +Composer home, cache, and data directories. ### COMPOSER_MEMORY_LIMIT diff --git a/app/vendor/composer/composer/doc/04-schema.md b/app/vendor/composer/composer/doc/04-schema.md index 849e5ee68..dbc02ff24 100644 --- a/app/vendor/composer/composer/doc/04-schema.md +++ b/app/vendor/composer/composer/doc/04-schema.md @@ -791,7 +791,7 @@ The following repository types are supported: * **vcs:** The version control system repository can fetch packages from git, svn, fossil and hg repositories. * **package:** If you depend on a project that does not have any support for - composer whatsoever you can define the package inline using a `package` + Composer whatsoever you can define the package inline using a `package` repository. You basically inline the `composer.json` object. For more information on any of these, see [Repositories](05-repositories.md). diff --git a/app/vendor/composer/composer/doc/05-repositories.md b/app/vendor/composer/composer/doc/05-repositories.md index f8a68fa30..2379165bb 100644 --- a/app/vendor/composer/composer/doc/05-repositories.md +++ b/app/vendor/composer/composer/doc/05-repositories.md @@ -186,7 +186,7 @@ The array of versions can also optionally be minified using [composer/metadata-minifier](https://packagist.org/packages/composer/metadata-minifier). If you do that, you should add a `"minified": "composer/2.0"` key at the top level to indicate to Composer it must expand the version -list back into the original data. See +list back into the original data. See https://repo.packagist.org/p2/monolog/monolog.json for an example. Any requested package which does not exist MUST return a 404 status code, @@ -199,7 +199,7 @@ the 404-requests, you can also specify an `"available-packages"` key in `packages.json` which should be an array with all the package names that your repository contain. Alternatively you can specify an `"available-package-patterns"` key which is an array of package name patterns -(with `*` matching any string, e.g. `vendor/*` would make composer look up +(with `*` matching any string, e.g. `vendor/*` would make Composer look up every matching package name in this repository). This field is optional. @@ -411,7 +411,7 @@ attempt to use github's zip files. Please note: * **To let Composer choose which driver to use** the repository type needs to be defined as "vcs" -* **If you already used a private repository**, this means Composer should have cloned it in cache. If you want to install the same package with drivers, remember to launch the command `composer clearcache` followed by the command `composer update` to update composer cache and install the package from dist. +* **If you already used a private repository**, this means Composer should have cloned it in cache. If you want to install the same package with drivers, remember to launch the command `composer clearcache` followed by the command `composer update` to update Composer cache and install the package from dist. #### BitBucket Driver Configuration @@ -750,7 +750,7 @@ You can disable the default Packagist.org repository by adding this to your You can disable Packagist.org globally by using the global config flag: ```bash -composer config -g repo.packagist false +php composer.phar config -g repo.packagist false ``` ← [Schema](04-schema.md) | [Config](06-config.md) → diff --git a/app/vendor/composer/composer/doc/06-config.md b/app/vendor/composer/composer/doc/06-config.md index dffff2104..96bd1840e 100644 --- a/app/vendor/composer/composer/doc/06-config.md +++ b/app/vendor/composer/composer/doc/06-config.md @@ -257,7 +257,7 @@ If it is `auto` then Composer only installs .bat proxy files when on Windows or set to `full` then both .bat files for Windows and scripts for Unix-based operating systems will be installed for each binary. This is mainly useful if you run Composer inside a linux VM but still want the `.bat` proxies available for use -in the Windows host OS. If set to `symlink` Composer will always symlink even on +in the Windows host OS. If set to `symlink` Composer will always symlink even on Windows/WSL. ## prepend-autoloader @@ -344,7 +344,7 @@ Example: ## htaccess-protect Defaults to `true`. If set to `false`, Composer will not create `.htaccess` files -in the composer home, cache, and data directories. +in the Composer home, cache, and data directories. ## lock diff --git a/app/vendor/composer/composer/doc/07-runtime.md b/app/vendor/composer/composer/doc/07-runtime.md index 3e345ad38..79f0022fd 100644 --- a/app/vendor/composer/composer/doc/07-runtime.md +++ b/app/vendor/composer/composer/doc/07-runtime.md @@ -95,7 +95,7 @@ possible for safety. ---- A few other methods are available for more complex usages, please refer to the -source/docblocks of [the class itself](https://github.com/composer/composer/blob/master/src/Composer/InstalledVersions.php). +source/docblocks of [the class itself](https://github.com/composer/composer/blob/main/src/Composer/InstalledVersions.php). ### Knowing the path in which a package is installed diff --git a/app/vendor/composer/composer/doc/08-community.md b/app/vendor/composer/composer/doc/08-community.md index 7c48a94a8..210256451 100644 --- a/app/vendor/composer/composer/doc/08-community.md +++ b/app/vendor/composer/composer/doc/08-community.md @@ -7,7 +7,7 @@ contributing. If you would like to contribute to Composer, please read the [README](https://github.com/composer/composer) and -[CONTRIBUTING](https://github.com/composer/composer/blob/master/.github/CONTRIBUTING.md) +[CONTRIBUTING](https://github.com/composer/composer/blob/main/.github/CONTRIBUTING.md) documents. The most important guidelines are described as follows: diff --git a/app/vendor/composer/composer/doc/articles/aliases.md b/app/vendor/composer/composer/doc/articles/aliases.md index c03ec52f2..193396e06 100644 --- a/app/vendor/composer/composer/doc/articles/aliases.md +++ b/app/vendor/composer/composer/doc/articles/aliases.md @@ -89,7 +89,7 @@ Add this to your project's root `composer.json`: } ``` -Or let composer add it for you with: +Or let Composer add it for you with: ``` php composer.phar require monolog/monolog:"dev-bugfix as 1.0.x-dev" diff --git a/app/vendor/composer/composer/doc/articles/authentication-for-private-packages.md b/app/vendor/composer/composer/doc/articles/authentication-for-private-packages.md index bbc21ee0d..4dda9a9b8 100644 --- a/app/vendor/composer/composer/doc/articles/authentication-for-private-packages.md +++ b/app/vendor/composer/composer/doc/articles/authentication-for-private-packages.md @@ -63,7 +63,7 @@ For all authentication methods it is possible to edit them using the command lin To manually edit it, run: ```sh -composer config --global --editor [--auth] +php composer.phar config --global --editor [--auth] ``` For specific authentication implementations, see their sections; @@ -80,7 +80,7 @@ To fix this you need to open the file in an editor and fix the error. To find th your global `auth.json`, execute: ```sh -composer config --global home +php composer.phar config --global home ``` The folder will contain your global `auth.json` if it exists. @@ -115,13 +115,13 @@ Read more about the usage of this environment variable [here](../03-cli.md#compo ### Command line http-basic ```sh -composer config [--global] http-basic.example.org username password +php composer.phar config [--global] http-basic.example.org username password ``` ### Manual http-basic ```sh -composer config [--global] --editor --auth +php composer.phar config [--global] --editor --auth ``` ```json @@ -147,13 +147,13 @@ If the username e.g. is an email address it needs to be passed as `name%40exampl ### Command line inline http-basic ```sh -composer config [--global] repositories composer.unique-name https://username:password@repo.example.org +php composer.phar config [--global] repositories composer.unique-name https://username:password@repo.example.org ``` ### Manual inline http-basic ```sh -composer config [--global] --editor +php composer.phar config [--global] --editor ``` ```json @@ -172,7 +172,7 @@ composer config [--global] --editor ### Manual custom token authentication ```sh -composer config [--global] --editor +php composer.phar config [--global] --editor ``` ```json @@ -201,13 +201,13 @@ composer config [--global] --editor ### Command line gitlab-oauth ```sh -composer config [--global] gitlab-oauth.example.org token +php composer.phar config [--global] gitlab-oauth.example.org token ``` ### Manual gitlab-oauth ```sh -composer config [--global] --editor --auth +php composer.phar config [--global] --editor --auth ``` ```json @@ -226,18 +226,18 @@ composer config [--global] --editor --auth To create a new access token, go to your [access tokens section on GitLab](https://gitlab.com/-/profile/personal_access_tokens) (or the equivalent URL on your private instance) and create a new token. See also [the GitLab access token documentation](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token) for more informations. -When creating a gitlab token manually, make sure it has either the `read_api` or `api` scope. +When creating a gitlab token manually, make sure it has either the `read_api` or `api` scope. ### Command line gitlab-token ```sh -composer config [--global] gitlab-token.example.org token +php composer.phar config [--global] gitlab-token.example.org token ``` ### Manual gitlab-token ```sh -composer config [--global] --editor --auth +php composer.phar config [--global] --editor --auth ``` ```json @@ -250,19 +250,24 @@ composer config [--global] --editor --auth ## github-oauth -To create a new access token, head to your [token settings section on Github](https://github.com/settings/tokens) and [generate a new token](https://github.com/settings/tokens/new). For public repositories when rate limited, the `public_repo` scope is required, for private repositories the `repo:status` scope is needed. -Read more about it [here](https://github.com/blog/1509-personal-api-tokens). +To create a new access token, head to your [token settings section on Github](https://github.com/settings/tokens) and [generate a new token](https://github.com/settings/tokens/new). + +For public repositories when rate limited, a token *without* any particular scope is sufficient (see `(no scope)` in the [scopes documentation](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps)). Such tokens grant read-only access to public information. + +For private repositories, the `repo` scope is needed. Note that the token will be given broad read/write access to all of your private repositories and much more - see the [scopes documentation](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps) for a complete list. As of writing (November 2021), it seems not to be possible to further limit permissions for such tokens. + +Read more about [Personal Access Tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token), or subscribe to the [roadmap item for better scoped tokens in GitHub](https://github.com/github/roadmap/issues/184). ### Command line github-oauth ```sh -composer config [--global] github-oauth.github.com token +php composer.phar config [--global] github-oauth.github.com token ``` ### Manual github-oauth ```sh -composer config [--global] --editor --auth +php composer.phar config [--global] --editor --auth ``` ```json @@ -280,13 +285,13 @@ The BitBucket driver uses OAuth to access your private repositories via the BitB ### Command line bitbucket-oauth ```sh -composer config [--global] bitbucket-oauth.bitbucket.org consumer-key consumer-secret +php composer.phar config [--global] bitbucket-oauth.bitbucket.org consumer-key consumer-secret ``` ### Manual bitbucket-oauth ```sh -composer config [--global] --editor --auth +php composer.phar config [--global] --editor --auth ``` ```json diff --git a/app/vendor/composer/composer/doc/articles/custom-installers.md b/app/vendor/composer/composer/doc/articles/custom-installers.md index 9c0ee2b65..02d62b836 100644 --- a/app/vendor/composer/composer/doc/articles/custom-installers.md +++ b/app/vendor/composer/composer/doc/articles/custom-installers.md @@ -13,6 +13,16 @@ library. In these cases you could consider creating a Custom Installer to handle your specific logic. +## Alternative to custom installers with Composer 2.1+ + +As of Composer 2.1, the `Composer\InstalledVersions` class has a +[`getInstalledPackagesByType`](https://getcomposer.org/doc/07-runtime.md#knowing-which-packages-of-a-given-type-are-installed) +method which can let you figure out at runtime which plugins/modules/extensions are installed. + +It is highly recommended to use that instead of building new custom +installers if you are building a new application. This has the advantage of leaving +all vendor code in the vendor directory, and not requiring custom installer code. + ## Calling a Custom Installer Suppose that your project already has a Custom Installer for specific modules @@ -164,7 +174,7 @@ use Composer\Installer\LibraryInstaller; class TemplateInstaller extends LibraryInstaller { /** - * {@inheritDoc} + * @inheritDoc */ public function getInstallPath(PackageInterface $package) { @@ -181,7 +191,7 @@ class TemplateInstaller extends LibraryInstaller } /** - * {@inheritDoc} + * @inheritDoc */ public function supports($packageType) { @@ -200,6 +210,6 @@ different installation path. [1]: ../04-schema.md#type [2]: ../04-schema.md#extra -[3]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/PluginInterface.php -[4]: https://github.com/composer/composer/blob/master/src/Composer/Installer/InstallerInterface.php -[5]: https://github.com/composer/composer/blob/master/src/Composer/Installer/LibraryInstaller.php +[3]: https://github.com/composer/composer/blob/main/src/Composer/Plugin/PluginInterface.php +[4]: https://github.com/composer/composer/blob/main/src/Composer/Installer/InstallerInterface.php +[5]: https://github.com/composer/composer/blob/main/src/Composer/Installer/LibraryInstaller.php diff --git a/app/vendor/composer/composer/doc/articles/handling-private-packages.md b/app/vendor/composer/composer/doc/articles/handling-private-packages.md index 6dd0b8ee9..3e3c93bb2 100644 --- a/app/vendor/composer/composer/doc/articles/handling-private-packages.md +++ b/app/vendor/composer/composer/doc/articles/handling-private-packages.md @@ -132,7 +132,7 @@ it, pass the VCS repository URL as an optional argument: ## Usage -In your projects all you need to add now is your own composer repository using +In your projects all you need to add now is your own Composer repository using the `packages.example.org` as URL, then you can require your private packages and everything should work smoothly. You don't need to copy all your repositories in every project anymore. Only that one unique repository that @@ -323,7 +323,7 @@ is set to true. * `providers`: optional, `false` by default, when enabled (`true`) each package will be dumped into a separate include file which will be only - loaded by composer when the package is really required. Speeds up composer + loaded by Composer when the package is really required. Speeds up composer handling for repositories with huge number of packages like f.i. packagist. * `output-dir`: optional, defines where to output the repository files if not provided as an argument when calling the `build` command. diff --git a/app/vendor/composer/composer/doc/articles/plugins.md b/app/vendor/composer/composer/doc/articles/plugins.md index df374405b..e19e32562 100644 --- a/app/vendor/composer/composer/doc/articles/plugins.md +++ b/app/vendor/composer/composer/doc/articles/plugins.md @@ -325,12 +325,12 @@ process however, so do not use it in plugins which do not absolutely require it. [1]: ../04-schema.md#type [2]: ../04-schema.md#extra -[3]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/PluginInterface.php -[4]: https://github.com/composer/composer/blob/master/src/Composer/Composer.php -[5]: https://github.com/composer/composer/blob/master/src/Composer/IO/IOInterface.php -[6]: https://github.com/composer/composer/blob/master/src/Composer/EventDispatcher/EventSubscriberInterface.php +[3]: https://github.com/composer/composer/blob/main/src/Composer/Plugin/PluginInterface.php +[4]: https://github.com/composer/composer/blob/main/src/Composer/Composer.php +[5]: https://github.com/composer/composer/blob/main/src/Composer/IO/IOInterface.php +[6]: https://github.com/composer/composer/blob/main/src/Composer/EventDispatcher/EventSubscriberInterface.php [7]: ../01-basic-usage.md#package-versions -[8]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/Capable.php -[9]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/Capability/CommandProvider.php +[8]: https://github.com/composer/composer/blob/main/src/Composer/Plugin/Capable.php +[9]: https://github.com/composer/composer/blob/main/src/Composer/Plugin/Capability/CommandProvider.php [10]: https://symfony.com/doc/current/components/console.html -[11]: https://github.com/composer/composer/blob/master/src/Composer/Util/SyncHelper.php +[11]: https://github.com/composer/composer/blob/main/src/Composer/Util/SyncHelper.php diff --git a/app/vendor/composer/composer/doc/articles/repository-priorities.md b/app/vendor/composer/composer/doc/articles/repository-priorities.md index e0053a80b..d87eed6dd 100644 --- a/app/vendor/composer/composer/doc/articles/repository-priorities.md +++ b/app/vendor/composer/composer/doc/articles/repository-priorities.md @@ -16,7 +16,7 @@ Canonical repositories are better for a few reasons: has been found somewhere. It also avoids loading duplicate packages in case the same package is present in several of your repositories. - Security wise, it is safer to treat them canonically as it means that packages you -expect to come from your most important repositories will never be loaded from +expect to come from your most important repositories will never be loaded from another repository instead. Let's say you have a private repository which is not canonical, and you require your private package `foo/bar ^2.0` for example. Now if someone publishes @@ -62,7 +62,7 @@ You can also filter packages which a repository will be able to load, either by selecting which ones you want, or by excluding those you do not want. For example here we want to pick only the package `foo/bar` and all the packages from -`some-vendor/` from this composer repository. +`some-vendor/` from this Composer repository. ```json { diff --git a/app/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md b/app/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md index 2ee30a6d1..fe6d1a110 100644 --- a/app/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md +++ b/app/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md @@ -33,9 +33,9 @@ An example where we have two branches: To resolve the conflict when we merge these two branches: - We choose the branch that has the most changes, and accept the `composer.json` and `composer.lock` - files from that branch. In this case, we choose the composer files from branch 2. + files from that branch. In this case, we choose the Composer files from branch 2. - We reapply the changes from the other branch (branch 1). In this case we have to run - ```composer require package/A``` again. + `composer require package/A` again. ## 2. Validating your merged files @@ -43,8 +43,8 @@ Before committing, make sure the resulting `composer.json` and `composer.lock` f To do this, run the following commands: ```sh -composer validate -composer install [--dry-run] +php composer.phar validate +php composer.phar install [--dry-run] ``` ## Important considerations diff --git a/app/vendor/composer/composer/doc/articles/scripts.md b/app/vendor/composer/composer/doc/articles/scripts.md index ae43f26a0..30fa03851 100644 --- a/app/vendor/composer/composer/doc/articles/scripts.md +++ b/app/vendor/composer/composer/doc/articles/scripts.md @@ -178,22 +178,22 @@ Depending on the [script types](#event-names) you will get various event subclasses containing various getters with relevant data and associated objects: -- Base class: [`Composer\EventDispatcher\Event`](https://github.com/composer/composer/blob/master/src/Composer/EventDispatcher/Event.php) -- Command Events: [`Composer\Script\Event`](https://github.com/composer/composer/blob/master/src/Composer/Script/Event.php) -- Installer Events: [`Composer\Installer\InstallerEvent`](https://github.com/composer/composer/blob/master/src/Composer/Installer/InstallerEvent.php) -- Package Events: [`Composer\Installer\PackageEvent`](https://github.com/composer/composer/blob/master/src/Composer/Installer/PackageEvent.php) +- Base class: [`Composer\EventDispatcher\Event`](https://github.com/composer/composer/blob/main/src/Composer/EventDispatcher/Event.php) +- Command Events: [`Composer\Script\Event`](https://github.com/composer/composer/blob/main/src/Composer/Script/Event.php) +- Installer Events: [`Composer\Installer\InstallerEvent`](https://github.com/composer/composer/blob/main/src/Composer/Installer/InstallerEvent.php) +- Package Events: [`Composer\Installer\PackageEvent`](https://github.com/composer/composer/blob/main/src/Composer/Installer/PackageEvent.php) - Plugin Events: - - init: [`Composer\EventDispatcher\Event`](https://github.com/composer/composer/blob/master/src/Composer/EventDispatcher/Event.php) - - command: [`Composer\Plugin\CommandEvent`](https://github.com/composer/composer/blob/master/src/Composer/Plugin/CommandEvent.php) - - pre-file-download: [`Composer\Plugin\PreFileDownloadEvent`](https://github.com/composer/composer/blob/master/src/Composer/Plugin/PreFileDownloadEvent.php) - - post-file-download: [`Composer\Plugin\PostFileDownloadEvent`](https://github.com/composer/composer/blob/master/src/Composer/Plugin/PostFileDownloadEvent.php) + - init: [`Composer\EventDispatcher\Event`](https://github.com/composer/composer/blob/main/src/Composer/EventDispatcher/Event.php) + - command: [`Composer\Plugin\CommandEvent`](https://github.com/composer/composer/blob/main/src/Composer/Plugin/CommandEvent.php) + - pre-file-download: [`Composer\Plugin\PreFileDownloadEvent`](https://github.com/composer/composer/blob/main/src/Composer/Plugin/PreFileDownloadEvent.php) + - post-file-download: [`Composer\Plugin\PostFileDownloadEvent`](https://github.com/composer/composer/blob/main/src/Composer/Plugin/PostFileDownloadEvent.php) ## Running scripts manually If you would like to run the scripts for an event manually, the syntax is: ```sh -composer run-script [--dev] [--no-dev] script +php composer.phar run-script [--dev] [--no-dev] script ``` For example `composer run-script post-install-cmd` will run any @@ -276,7 +276,7 @@ To disable the timeout of a single script call, you must use the `run-script` co command and specify the `--timeout` parameter: ``` -composer run-script --timeout=0 test +php composer.phar run-script --timeout=0 test ``` ## Referencing scripts diff --git a/app/vendor/composer/composer/doc/articles/troubleshooting.md b/app/vendor/composer/composer/doc/articles/troubleshooting.md index 669d4ce55..0182f9231 100644 --- a/app/vendor/composer/composer/doc/articles/troubleshooting.md +++ b/app/vendor/composer/composer/doc/articles/troubleshooting.md @@ -9,7 +9,7 @@ This is a list of common pitfalls on using Composer, and how to avoid them. 1. When facing any kind of problems using Composer, be sure to **work with the latest version**. See [self-update](../03-cli.md#self-update) for details. - + 2. Before asking anyone, run [`composer diagnose`](../03-cli.md#diagnose) to check for common problems. If it all checks out, proceed to the next steps. @@ -84,7 +84,7 @@ indirectly) back on the root package itself, issues can occur in two cases: ## I have a dependency which contains a "repositories" definition in its composer.json, but it seems to be ignored. The [`repositories`](../04-schema.md#repositories) configuration property is defined as [root-only](../04-schema.md#root-package). It is not inherited. You can read more about the reasons behind this in the "[why can't -composer load repositories recursively?](../faqs/why-can't-composer-load-repositories-recursively.md)" article. +Composer load repositories recursively?](../faqs/why-can't-composer-load-repositories-recursively.md)" article. The simplest work-around to this limitation, is moving or duplicating the `repositories` definition into your root composer.json. @@ -189,7 +189,7 @@ manually create a token using the [procedure documented here](authentication-for Now Composer should install/update without asking for authentication. ## proc_open(): fork failed errors -If composer shows proc_open() fork failed on some commands: +If Composer shows proc_open() fork failed on some commands: `PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar` @@ -216,7 +216,7 @@ You can make a permanent swap file following this [tutorial](https://www.digital ## proc_open(): failed to open stream errors (Windows) -If composer shows proc_open(NUL) errors on Windows: +If Composer shows proc_open(NUL) errors on Windows: `proc_open(NUL): failed to open stream: No such file or directory` @@ -288,7 +288,7 @@ Disable IPv6 on that device (in this case "Wi-Fi"): networksetup -setv6off Wi-Fi ``` -Run composer ... +Run Composer ... You can enable IPv6 again with: @@ -312,7 +312,7 @@ As a workaround, open a SSH connection to your Git host before running Composer: ```bash ssh -t git@mygitserver.tld -composer update +php composer.phar update ``` See also https://github.com/composer/composer/issues/4180 for more information. diff --git a/app/vendor/composer/composer/doc/articles/versions.md b/app/vendor/composer/composer/doc/articles/versions.md index 47f1f8910..4fd1f40b9 100644 --- a/app/vendor/composer/composer/doc/articles/versions.md +++ b/app/vendor/composer/composer/doc/articles/versions.md @@ -78,7 +78,7 @@ If you want Composer to check out a branch instead of a tag, you need to point i In the above example, if you wanted to check out the `my-feature` branch, you would specify `dev-my-feature` as the version constraint in your `require` clause. This would result in Composer cloning the `my-library` repository into my `vendor` directory and checking out the `my-feature` branch. -When branch names look like versions, we have to clarify for composer that we're trying to check out a branch and not a tag. In the above example, we have two version branches: `v1` and `v2`. To get Composer to check out one of these branches, you must specify a version constraint that looks like this: `v1.x-dev`. The `.x` is an arbitrary string that Composer requires to tell it that we're talking about the `v1` branch and not a `v1` tag (alternatively, you can name the branch `v1.x` instead of `v1`). In the case of a branch with a version-like name (`v1`, in this case), you append `-dev` as a suffix, rather than using `dev-` as a prefix. +When branch names look like versions, we have to clarify for Composer that we're trying to check out a branch and not a tag. In the above example, we have two version branches: `v1` and `v2`. To get Composer to check out one of these branches, you must specify a version constraint that looks like this: `v1.x-dev`. The `.x` is an arbitrary string that Composer requires to tell it that we're talking about the `v1` branch and not a `v1` tag (alternatively, you can name the branch `v1.x` instead of `v1`). In the case of a branch with a version-like name (`v1`, in this case), you append `-dev` as a suffix, rather than using `dev-` as a prefix. ### Stabilities @@ -213,7 +213,7 @@ Examples: To allow various stabilities without enforcing them at the constraint level however, you may use [stability-flags](../04-schema.md#package-links) like -`@` (e.g. `@dev`) to let composer know that a given package +`@` (e.g. `@dev`) to let Composer know that a given package can be installed in a different stability than your default minimum-stability setting. All available stability flags are listed on the minimum-stability section of the [schema page](../04-schema.md#minimum-stability). diff --git a/app/vendor/composer/composer/doc/faqs/how-to-install-composer-programmatically.md b/app/vendor/composer/composer/doc/faqs/how-to-install-composer-programmatically.md index 6299b6d40..77666f6e3 100644 --- a/app/vendor/composer/composer/doc/faqs/how-to-install-composer-programmatically.md +++ b/app/vendor/composer/composer/doc/faqs/how-to-install-composer-programmatically.md @@ -39,4 +39,4 @@ wget https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902c ``` You may replace the commit hash by whatever the last commit hash is on -https://github.com/composer/getcomposer.org/commits/master +https://github.com/composer/getcomposer.org/commits/main diff --git a/app/vendor/composer/composer/doc/faqs/how-to-install-untrusted-packages-safely.md b/app/vendor/composer/composer/doc/faqs/how-to-install-untrusted-packages-safely.md index 1b3e9d383..9776f85a2 100644 --- a/app/vendor/composer/composer/doc/faqs/how-to-install-untrusted-packages-safely.md +++ b/app/vendor/composer/composer/doc/faqs/how-to-install-untrusted-packages-safely.md @@ -9,11 +9,14 @@ You can disable plugins and scripts during package installation or updates with syntax so only Composer's code, and no third party code, will execute: ```sh -composer install --no-plugins --no-scripts ... -composer update --no-plugins --no-scripts ... +php composer.phar install --no-plugins --no-scripts ... +php composer.phar update --no-plugins --no-scripts ... ``` The `exec` command will always run third party code as the user which runs `composer`. In some cases, like in CI systems or such where you want to install untrusted dependencies, the safest way to do it is to run the above command. + +See [Environment variable - COMPOSER_ALLOW_SUPERUSER](../03-cli.md#composer-allow-superuser) +for more info on how to disable warning diff --git a/app/vendor/composer/composer/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md b/app/vendor/composer/composer/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md index 67d4133d4..32552e067 100644 --- a/app/vendor/composer/composer/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md +++ b/app/vendor/composer/composer/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md @@ -26,7 +26,7 @@ If you really feel like you must do this, you have a few options: you can add them to your git repo. You can do that with `rm -rf vendor/**/.git` in ZSH or `find vendor/ -type d -name ".git" -exec rm -rf {} \;` in Bash. But this means you will have to delete those dependencies from disk before - running composer update. + running `composer update`. 4. Add a .gitignore rule (`/vendor/**/.git`) to ignore all the vendor `.git` folders. This approach does not require that you delete dependencies from disk prior to - running a composer update. + running a `composer update`. diff --git a/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php b/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php index 47c888ab7..482dc0c21 100644 --- a/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php +++ b/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php @@ -22,7 +22,6 @@ use Composer\Repository\InstalledRepositoryInterface; use Composer\Repository\PlatformRepository; use Composer\Semver\Constraint\Bound; -use Composer\Semver\Constraint\MatchAllConstraint; use Composer\Util\Filesystem; use Composer\Util\Platform; use Composer\Script\ScriptEvents; @@ -71,7 +70,7 @@ class AutoloadGenerator private $runScripts = false; /** - * @var bool|array + * @var bool|string[] */ private $ignorePlatformReqs = false; @@ -81,16 +80,20 @@ public function __construct(EventDispatcher $eventDispatcher, IOInterface $io = $this->io = $io; } + /** + * @param bool $devMode + * @return void + */ public function setDevMode($devMode = true) { $this->devMode = (bool) $devMode; } /** - * Whether or not generated autoloader considers the class map - * authoritative. + * Whether generated autoloader considers the class map authoritative. * * @param bool $classMapAuthoritative + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -98,10 +101,11 @@ public function setClassMapAuthoritative($classMapAuthoritative) } /** - * Whether or not generated autoloader considers APCu caching. + * Whether generated autoloader considers APCu caching. * * @param bool $apcu * @param string|null $apcuPrefix + * @return void */ public function setApcu($apcu, $apcuPrefix = null) { @@ -110,9 +114,10 @@ public function setApcu($apcu, $apcuPrefix = null) } /** - * Set whether to run scripts or not + * Whether to run scripts or not * * @param bool $runScripts + * @return void */ public function setRunScripts($runScripts = true) { @@ -120,13 +125,14 @@ public function setRunScripts($runScripts = true) } /** - * Sets whether platform requirements should be ignored + * Whether platform requirements should be ignored. * * If this is set to true, the platform check file will not be generated * If this is set to false, the platform check file will be generated with all requirements * If this is set to string[], those packages will be ignored from the platform check file * - * @param array|bool $ignorePlatformReqs + * @param bool|string[] $ignorePlatformReqs + * @return void */ public function setIgnorePlatformRequirements($ignorePlatformReqs) { @@ -139,6 +145,13 @@ public function setIgnorePlatformRequirements($ignorePlatformReqs) } } + /** + * @param string $targetDir + * @param bool $scanPsrPackages + * @param string $suffix + * @return int + * @throws \Seld\JsonLint\ParsingException + */ public function dump(Config $config, InstalledRepositoryInterface $localRepo, RootPackageInterface $rootPackage, InstallationManager $installationManager, $targetDir, $scanPsrPackages = false, $suffix = '') { if ($this->classMapAuthoritative) { @@ -406,7 +419,19 @@ public static function autoload(\$class) return count($classMap); } - private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $excluded, $namespaceFilter, $autoloadType, array $classMap, array &$ambiguousClasses, array &$scannedFiles) + /** + * @param string $basePath + * @param string $vendorPath + * @param string $dir + * @param ?array $excluded + * @param ?string $namespaceFilter + * @param ?string $autoloadType + * @param array $classMap + * @param array> $ambiguousClasses + * @param array $scannedFiles + * @return array + */ + private function addClassMapCode(Filesystem $filesystem, $basePath, $vendorPath, $dir, $excluded, $namespaceFilter, $autoloadType, array $classMap, array &$ambiguousClasses, array &$scannedFiles) { foreach ($this->generateClassMap($dir, $excluded, $namespaceFilter, $autoloadType, true, $scannedFiles) as $class => $path) { $pathCode = $this->getPathCode($filesystem, $basePath, $vendorPath, $path).",\n"; @@ -421,7 +446,13 @@ private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $exc } /** - * @param ?array $excluded + * @param string $dir + * @param ?array $excluded + * @param ?string $namespaceFilter + * @param ?string $autoloadType + * @param bool $showAmbiguousWarning + * @param array $scannedFiles + * @return array */ private function generateClassMap($dir, $excluded, $namespaceFilter, $autoloadType, $showAmbiguousWarning, array &$scannedFiles) { @@ -449,7 +480,9 @@ private function generateClassMap($dir, $excluded, $namespaceFilter, $autoloadTy } /** - * @param RootPackageInterface $rootPackage + * @param InstallationManager $installationManager + * @param PackageInterface[] $packages + * @return array */ public function buildPackageMap(InstallationManager $installationManager, PackageInterface $rootPackage, array $packages) { @@ -472,8 +505,7 @@ public function buildPackageMap(InstallationManager $installationManager, Packag } /** - * @param PackageInterface $package - * + * @return void * @throws \InvalidArgumentException Throws an exception, if the package has illegal settings. */ protected function validatePackage(PackageInterface $package) @@ -496,10 +528,17 @@ protected function validatePackage(PackageInterface $package) /** * Compiles an ordered list of namespace => path mappings * - * @param array $packageMap array of array(package, installDir-relative-to-composer.json) - * @param RootPackageInterface $rootPackage root package instance - * @param bool|string[] $filteredDevPackages If an array, the list of packages that must be removed. If bool, whether to filter out require-dev packages - * @return array array('psr-0' => array('Ns\\Foo' => array('installDir'))) + * @param array $packageMap array of array(package, installDir-relative-to-composer.json) + * @param RootPackageInterface $rootPackage root package instance + * @param bool|string[] $filteredDevPackages If an array, the list of packages that must be removed. If bool, whether to filter out require-dev packages + * @return array + * @phpstan-return array{ + * 'psr-0': array>, + * 'psr-4': array>, + * 'classmap': array, + * 'files': array, + * 'exclude-from-classmap': array, + * } */ public function parseAutoloads(array $packageMap, PackageInterface $rootPackage, $filteredDevPackages = false) { @@ -534,9 +573,10 @@ public function parseAutoloads(array $packageMap, PackageInterface $rootPackage, } /** - * Registers an autoloader based on an autoload map returned by parseAutoloads + * Registers an autoloader based on an autoload-map returned by parseAutoloads * - * @param array $autoloads see parseAutoloads return value + * @param array $autoloads see parseAutoloads return value + * @param ?string $vendorDir * @return ClassLoader */ public function createLoader(array $autoloads, $vendorDir = null) @@ -574,6 +614,14 @@ public function createLoader(array $autoloads, $vendorDir = null) return $loader; } + /** + * @param array $packageMap + * @param string $basePath + * @param string $vendorPath + * @param string $vendorPathCode + * @param string $appBaseDirCode + * @return ?string + */ protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode) { $includePaths = array(); @@ -592,7 +640,7 @@ protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem } if (!$includePaths) { - return; + return null; } $includePathsCode = ''; @@ -614,6 +662,14 @@ protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem EOF; } + /** + * @param array $files + * @param string $basePath + * @param string $vendorPath + * @param string $vendorPathCode + * @param string $appBaseDirCode + * @return ?string + */ protected function getIncludeFilesFile(array $files, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode) { $filesCode = ''; @@ -623,7 +679,7 @@ protected function getIncludeFilesFile(array $files, Filesystem $filesystem, $ba } if (!$filesCode) { - return false; + return null; } return <<isAbsolutePath($path)) { @@ -670,6 +732,13 @@ protected function getPathCode(Filesystem $filesystem, $basePath, $vendorPath, $ return $baseDir . var_export($path, true); } + /** + * @param array $packageMap + * @param string[] $ignorePlatformReqs + * @param bool $checkPlatform + * @param string[] $devPackageNames + * @return ?string + */ protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs, $checkPlatform, array $devPackageNames) { $lowestPhpVersion = Bound::zero(); @@ -680,7 +749,7 @@ protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs $package = $item[0]; foreach (array_merge($package->getReplaces(), $package->getProvides()) as $link) { if (preg_match('{^ext-(.+)$}iD', $link->getTarget(), $match)) { - $extensionProviders[$match[1]][] = $link->getConstraint() ?: new MatchAllConstraint(); + $extensionProviders[$match[1]][] = $link->getConstraint(); } } } @@ -697,7 +766,8 @@ protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs continue; } - if ('php' === $link->getTarget() && ($constraint = $link->getConstraint())) { + if ('php' === $link->getTarget()) { + $constraint = $link->getConstraint(); if ($constraint->getLowerBound()->compareTo($lowestPhpVersion, '>')) { $lowestPhpVersion = $constraint->getLowerBound(); } @@ -707,7 +777,7 @@ protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs // skip extension checks if they have a valid provider/replacer if (isset($extensionProviders[$match[1]])) { foreach ($extensionProviders[$match[1]] as $provided) { - if (!$link->getConstraint() || $provided->matches($link->getConstraint())) { + if ($provided->matches($link->getConstraint())) { continue 2; } } @@ -822,6 +892,11 @@ protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs PLATFORM_CHECK; } + /** + * @param string $vendorPathToTargetDirCode + * @param string $suffix + * @return string + */ protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix) { $lastChar = $vendorPathToTargetDirCode[strlen($vendorPathToTargetDirCode) - 1]; @@ -843,6 +918,20 @@ protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix) AUTOLOAD; } + /** + * @param bool $useClassMap + * @param bool $useIncludePath + * @param ?string $targetDirLoader + * @param bool $useIncludeFiles + * @param string $vendorPathCode unused in this method + * @param string $appBaseDirCode unused in this method + * @param string $suffix + * @param bool $useGlobalIncludePath + * @param string $prependAutoloader 'true'|'false' + * @param string $staticPhpVersion + * @param bool $checkPlatform + * @return string + */ protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $useIncludeFiles, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion, $checkPlatform) { $file = <<
$packageMap + * @param string $type one of: 'psr-0'|'psr-4'|'classmap'|'files' + * @return array|array>|array + */ protected function parseAutoloadsType(array $packageMap, $type, RootPackageInterface $rootPackage) { $autoloads = array(); @@ -1195,6 +1297,10 @@ function ($matches) use (&$updir) { return $autoloads; } + /** + * @param string $path + * @return string + */ protected function getFileIdentifier(PackageInterface $package, $path) { return md5($package->getName() . ':' . $path); @@ -1203,9 +1309,11 @@ protected function getFileIdentifier(PackageInterface $package, $path) /** * Filters out dev-dependencies * - * @param array $packageMap + * @param array $packageMap * @param RootPackageInterface $rootPackage - * @return array + * @return array + * + * @phpstan-param array $packageMap */ protected function filterPackageMap(array $packageMap, RootPackageInterface $rootPackage) { @@ -1258,8 +1366,8 @@ function ($item) use ($include) { * * Packages of equal weight retain the original order * - * @param array $packageMap - * @return array + * @param array $packageMap + * @return array */ protected function sortPackageMap(array $packageMap) { diff --git a/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php b/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php index 1bb204362..6910fcb6f 100644 --- a/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php +++ b/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php @@ -33,8 +33,9 @@ class ClassMapGenerator /** * Generate a class map file * - * @param \Traversable|array $dirs Directories or a single path to search in + * @param \Traversable|array $dirs Directories or a single path to search in * @param string $file The name of the class map file + * @return void */ public static function dump($dirs, $file) { @@ -50,14 +51,14 @@ public static function dump($dirs, $file) /** * Iterate over all files in the given directory searching for classes * - * @param \Traversable|string|array $path The path to search in or an iterator - * @param string $excluded Regex that matches file paths to be excluded from the classmap - * @param ?IOInterface $io IO object - * @param ?string $namespace Optional namespace prefix to filter by - * @param ?string $autoloadType psr-0|psr-4 Optional autoload standard to use mapping rules - * + * @param \Traversable<\SplFileInfo>|string|array $path The path to search in or an iterator + * @param string $excluded Regex that matches file paths to be excluded from the classmap + * @param ?IOInterface $io IO object + * @param ?string $namespace Optional namespace prefix to filter by + * @param ?string $autoloadType psr-0|psr-4 Optional autoload standard to use mapping rules + * @param array $scannedFiles + * @return array A class map array * @throws \RuntimeException When the path is neither an existing file nor directory - * @return array A class map array */ public static function createMap($path, $excluded = null, IOInterface $io = null, $namespace = null, $autoloadType = null, &$scannedFiles = array()) { @@ -147,13 +148,13 @@ public static function createMap($path, $excluded = null, IOInterface $io = null /** * Remove classes which could not have been loaded by namespace autoloaders * - * @param array $classes found classes in given file - * @param string $filePath current file - * @param string $baseNamespace prefix of given autoload mapping - * @param string $namespaceType psr-0|psr-4 - * @param string $basePath root directory of given autoload mapping - * @param ?IOInterface $io IO object - * @return array valid classes + * @param array $classes found classes in given file + * @param string $filePath current file + * @param string $baseNamespace prefix of given autoload mapping + * @param string $namespaceType psr-0|psr-4 + * @param string $basePath root directory of given autoload mapping + * @param ?IOInterface $io IO object + * @return array valid classes */ private static function filterByNamespace($classes, $filePath, $baseNamespace, $namespaceType, $basePath, $io) { @@ -210,7 +211,7 @@ private static function filterByNamespace($classes, $filePath, $baseNamespace, $ * * @param string $path The file to check * @throws \RuntimeException - * @return array The found classes + * @return array The found classes */ private static function findClasses($path) { @@ -283,6 +284,9 @@ private static function findClasses($path) return $classes; } + /** + * @return string + */ private static function getExtraTypes() { static $extraTypes = null; diff --git a/app/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php b/app/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php index 9b0872aad..677f7e978 100644 --- a/app/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php +++ b/app/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php @@ -1,5 +1,15 @@ + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Composer\Autoload; /** @@ -10,6 +20,7 @@ class PhpFileCleaner { /** @var array */ private static $typeConfig; + /** @var string */ private static $restPattern; @@ -34,6 +45,10 @@ class PhpFileCleaner /** @var int */ private $index = 0; + /** + * @param string[] $types + * @return void + */ public static function setTypeConfig($types) { foreach ($types as $type) { @@ -47,6 +62,10 @@ public static function setTypeConfig($types) self::$restPattern = '{[^?"\'contents = $contents; @@ -54,6 +73,9 @@ public function __construct($contents, $maxMatches) $this->maxMatches = $maxMatches; } + /** + * @return string + */ public function clean() { $clean = ''; @@ -106,6 +128,7 @@ public function clean() && \preg_match($type['pattern'], $this->contents, $match, 0, $this->index - 1) ) { $clean .= $match[0]; + return $clean; } } @@ -123,6 +146,9 @@ public function clean() return $clean; } + /** + * @return void + */ private function skipToPhp() { while ($this->index < $this->len) { @@ -135,6 +161,10 @@ private function skipToPhp() } } + /** + * @param string $delimiter + * @return void + */ private function skipString($delimiter) { $this->index += 1; @@ -151,6 +181,9 @@ private function skipString($delimiter) } } + /** + * @return void + */ private function skipComment() { $this->index += 2; @@ -164,6 +197,9 @@ private function skipComment() } } + /** + * @return void + */ private function skipToNewline() { while ($this->index < $this->len) { @@ -174,6 +210,10 @@ private function skipToNewline() } } + /** + * @param string $delimiter + * @return void + */ private function skipHeredoc($delimiter) { $firstDelimiterChar = $delimiter[0]; @@ -193,6 +233,7 @@ private function skipHeredoc($delimiter) && $this->match($delimiterPattern) ) { $this->index += $delimiterLength; + return; } break; @@ -212,11 +253,20 @@ private function skipHeredoc($delimiter) } } + /** + * @param string $char + * @return bool + */ private function peek($char) { return $this->index + 1 < $this->len && $this->contents[$this->index + 1] === $char; } + /** + * @param string $regex + * @param ?array $match + * @return bool + */ private function match($regex, array &$match = null) { if (\preg_match($regex, $this->contents, $match, 0, $this->index)) { diff --git a/app/vendor/composer/composer/src/Composer/Cache.php b/app/vendor/composer/composer/src/Composer/Cache.php index a3aaebf57..b1baef8ea 100644 --- a/app/vendor/composer/composer/src/Composer/Cache.php +++ b/app/vendor/composer/composer/src/Composer/Cache.php @@ -24,12 +24,19 @@ */ class Cache { + /** @var bool|null */ private static $cacheCollected = null; + /** @var IOInterface */ private $io; + /** @var string */ private $root; - private $enabled = true; + /** @var ?bool */ + private $enabled = null; + /** @var string */ private $allowlist; + /** @var Filesystem */ private $filesystem; + /** @var bool */ private $readOnly; /** @@ -49,21 +56,13 @@ public function __construct(IOInterface $io, $cacheDir, $allowlist = 'a-z0-9.', if (!self::isUsable($cacheDir)) { $this->enabled = false; - - return; - } - - if ( - (!is_dir($this->root) && !Silencer::call('mkdir', $this->root, 0777, true)) - || !is_writable($this->root) - ) { - $this->io->writeError('Cannot create cache directory ' . $this->root . ', or directory is not writable. Proceeding without cache'); - $this->enabled = false; } } /** * @param bool $readOnly + * + * @return void */ public function setReadOnly($readOnly) { @@ -78,24 +77,52 @@ public function isReadOnly() return $this->readOnly; } + /** + * @param string $path + * + * @return bool + */ public static function isUsable($path) { return !preg_match('{(^|[\\\\/])(\$null|nul|NUL|/dev/null)([\\\\/]|$)}', $path); } + /** + * @return bool + */ public function isEnabled() { + if ($this->enabled === null) { + $this->enabled = true; + + if ( + (!is_dir($this->root) && !Silencer::call('mkdir', $this->root, 0777, true)) + || !is_writable($this->root) + ) { + $this->io->writeError('Cannot create cache directory ' . $this->root . ', or directory is not writable. Proceeding without cache'); + $this->enabled = false; + } + } + return $this->enabled; } + /** + * @return string + */ public function getRoot() { return $this->root; } + /** + * @param string $file + * + * @return string|false + */ public function read($file) { - if ($this->enabled) { + if ($this->isEnabled()) { $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { $this->io->writeError('Reading '.$this->root . $file.' from cache', true, IOInterface::DEBUG); @@ -107,9 +134,15 @@ public function read($file) return false; } + /** + * @param string $file + * @param string $contents + * + * @return bool + */ public function write($file, $contents) { - if ($this->enabled && !$this->readOnly) { + if ($this->isEnabled() && !$this->readOnly) { $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); $this->io->writeError('Writing '.$this->root . $file.' into cache', true, IOInterface::DEBUG); @@ -145,10 +178,15 @@ public function write($file, $contents) /** * Copy a file into the cache + * + * @param string $file + * @param string $source + * + * @return bool */ public function copyFrom($file, $source) { - if ($this->enabled && !$this->readOnly) { + if ($this->isEnabled() && !$this->readOnly) { $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); $this->filesystem->ensureDirectoryExists(dirname($this->root . $file)); @@ -166,10 +204,15 @@ public function copyFrom($file, $source) /** * Copy a file out of the cache + * + * @param string $file + * @param string $target + * + * @return bool */ public function copyTo($file, $target) { - if ($this->enabled) { + if ($this->isEnabled()) { $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { try { @@ -189,6 +232,9 @@ public function copyTo($file, $target) return false; } + /** + * @return bool + */ public function gcIsNecessary() { if (self::$cacheCollected) { @@ -207,9 +253,14 @@ public function gcIsNecessary() return !mt_rand(0, 50); } + /** + * @param string $file + * + * @return bool + */ public function remove($file) { - if ($this->enabled) { + if ($this->isEnabled()) { $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { return $this->filesystem->unlink($this->root . $file); @@ -219,9 +270,12 @@ public function remove($file) return false; } + /** + * @return bool + */ public function clear() { - if ($this->enabled) { + if ($this->isEnabled()) { $this->filesystem->emptyDirectory($this->root); return true; @@ -230,9 +284,15 @@ public function clear() return false; } + /** + * @param int $ttl + * @param int $maxSize + * + * @return bool + */ public function gc($ttl, $maxSize) { - if ($this->enabled) { + if ($this->isEnabled()) { $expire = new \DateTime(); $expire->modify('-'.$ttl.' seconds'); @@ -260,9 +320,14 @@ public function gc($ttl, $maxSize) return false; } + /** + * @param string $file + * + * @return string|false + */ public function sha1($file) { - if ($this->enabled) { + if ($this->isEnabled()) { $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { return sha1_file($this->root . $file); @@ -272,9 +337,14 @@ public function sha1($file) return false; } + /** + * @param string $file + * + * @return string|false + */ public function sha256($file) { - if ($this->enabled) { + if ($this->isEnabled()) { $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { return hash_file('sha256', $this->root . $file); @@ -284,6 +354,9 @@ public function sha256($file) return false; } + /** + * @return Finder + */ protected function getFinder() { return Finder::create()->in($this->root)->files(); diff --git a/app/vendor/composer/composer/src/Composer/Command/AboutCommand.php b/app/vendor/composer/composer/src/Composer/Command/AboutCommand.php index 931c20e55..38ac0f226 100644 --- a/app/vendor/composer/composer/src/Composer/Command/AboutCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/AboutCommand.php @@ -21,6 +21,9 @@ */ class AboutCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this diff --git a/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php b/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php index 3acf4fd04..c30c2364d 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php @@ -16,6 +16,7 @@ use Composer\IO\IOInterface; use Composer\Config; use Composer\Composer; +use Composer\Package\BasePackage; use Composer\Package\CompletePackageInterface; use Composer\Repository\CompositeRepository; use Composer\Repository\RepositoryFactory; @@ -37,6 +38,9 @@ */ class ArchiveCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this @@ -108,6 +112,17 @@ protected function execute(InputInterface $input, OutputInterface $output) return $returnCode; } + /** + * @param string|null $packageName + * @param string|null $version + * @param string $format + * @param string $dest + * @param string|null $fileName + * @param bool $ignoreFilters + * + * @return int + * @throws \Exception + */ protected function archive(IOInterface $io, Config $config, $packageName = null, $version = null, $format = 'tar', $dest = '.', $fileName = null, $ignoreFilters = false, Composer $composer = null) { if ($composer) { @@ -142,7 +157,10 @@ protected function archive(IOInterface $io, Config $config, $packageName = null, } /** - * @return CompletePackageInterface|false + * @param string $packageName + * @param string|null $version + * + * @return (BasePackage&CompletePackageInterface)|false */ protected function selectPackage(IOInterface $io, $packageName, $version = null) { diff --git a/app/vendor/composer/composer/src/Composer/Command/BaseCommand.php b/app/vendor/composer/composer/src/Composer/Command/BaseCommand.php index b473fbe80..5e98226f4 100644 --- a/app/vendor/composer/composer/src/Composer/Command/BaseCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/BaseCommand.php @@ -23,6 +23,7 @@ use Composer\Plugin\PluginEvents; use Composer\Util\Platform; use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Helper\TableSeparator; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Command\Command; @@ -74,7 +75,7 @@ public function getComposer($required = true, $disablePlugins = null) } /** - * @param Composer $composer + * @return void */ public function setComposer(Composer $composer) { @@ -83,6 +84,8 @@ public function setComposer(Composer $composer) /** * Removes the cached composer instance + * + * @return void */ public function resetComposer() { @@ -121,7 +124,7 @@ public function getIO() } /** - * @param IOInterface $io + * @return void */ public function setIO(IOInterface $io) { @@ -129,7 +132,9 @@ public function setIO(IOInterface $io) } /** - * {@inheritDoc} + * @inheritDoc + * + * @return void */ protected function initialize(InputInterface $input, OutputInterface $output) { @@ -154,8 +159,6 @@ protected function initialize(InputInterface $input, OutputInterface $output) /** * Returns preferSource and preferDist values based on the configuration. * - * @param Config $config - * @param InputInterface $input * @param bool $keepVcsRequiresPreferSource * * @return bool[] An array composed of the preferSource and preferDist values @@ -209,6 +212,11 @@ protected function getPreferredInstallOptions(Config $config, InputInterface $in return array($preferSource, $preferDist); } + /** + * @param array $requirements + * + * @return array + */ protected function formatRequirements(array $requirements) { $requires = array(); @@ -223,6 +231,11 @@ protected function formatRequirements(array $requirements) return $requires; } + /** + * @param array $requirements + * + * @return list + */ protected function normalizeRequirements(array $requirements) { $parser = new VersionParser(); @@ -230,6 +243,11 @@ protected function normalizeRequirements(array $requirements) return $parser->parseNameVersionPairs($requirements); } + /** + * @param array $table + * + * @return void + */ protected function renderTable(array $table, OutputInterface $output) { $renderer = new Table($output); @@ -246,6 +264,9 @@ protected function renderTable(array $table, OutputInterface $output) $renderer->setRows($table)->render(); } + /** + * @return int + */ protected function getTerminalWidth() { if (class_exists('Symfony\Component\Console\Terminal')) { diff --git a/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php b/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php index 962c1b2ce..ae91abae6 100644 --- a/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php @@ -14,6 +14,7 @@ use Composer\Package\Link; use Composer\Package\PackageInterface; +use Composer\Package\CompletePackageInterface; use Composer\Package\RootPackage; use Composer\Repository\InstalledArrayRepository; use Composer\Repository\CompositeRepository; @@ -46,8 +47,6 @@ class BaseDependencyCommand extends BaseCommand /** * Execute the command. * - * @param InputInterface $input - * @param OutputInterface $output * @param bool $inverted Whether to invert matching process (why-not vs why behaviour) * @return int Exit code of the operation. */ @@ -121,7 +120,7 @@ protected function doExecute(InputInterface $input, OutputInterface $output, $in } elseif ($renderTree) { $this->initStyles($output); $root = $packages[0]; - $this->getIO()->write(sprintf('%s %s %s', $root->getPrettyName(), $root->getPrettyVersion(), $root->getDescription())); + $this->getIO()->write(sprintf('%s %s %s', $root->getPrettyName(), $root->getPrettyVersion(), $root instanceof CompletePackageInterface ? $root->getDescription() : '')); $this->printTree($results); } else { $this->printTable($output, $results); @@ -133,8 +132,9 @@ protected function doExecute(InputInterface $input, OutputInterface $output, $in /** * Assembles and prints a bottom-up table of the dependencies. * - * @param OutputInterface $output - * @param array $results + * @param array[] $results + * + * @return void */ protected function printTable(OutputInterface $output, $results) { @@ -170,7 +170,7 @@ protected function printTable(OutputInterface $output, $results) /** * Init styles for tree * - * @param OutputInterface $output + * @return void */ protected function initStyles(OutputInterface $output) { @@ -191,9 +191,11 @@ protected function initStyles(OutputInterface $output) /** * Recursively prints a tree of the selected results. * - * @param array $results Results to be printed at this level. - * @param string $prefix Prefix of the current tree level. - * @param int $level Current level of recursion. + * @param array[] $results Results to be printed at this level. + * @param string $prefix Prefix of the current tree level. + * @param int $level Current level of recursion. + * + * @return void */ protected function printTree($results, $prefix = '', $level = 1) { @@ -203,7 +205,7 @@ protected function printTree($results, $prefix = '', $level = 1) /** * @var PackageInterface $package * @var Link $link - * @var array|bool $children + * @var mixed[]|bool $children */ list($package, $link, $children) = $result; @@ -221,6 +223,11 @@ protected function printTree($results, $prefix = '', $level = 1) } } + /** + * @param string $line + * + * @return void + */ private function writeTreeLine($line) { $io = $this->getIO(); diff --git a/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php b/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php index 2f68a65cb..170e25f29 100644 --- a/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php @@ -23,6 +23,9 @@ class CheckPlatformReqsCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this->setName('check-platform-reqs') @@ -43,6 +46,9 @@ protected function configure() ); } + /** + * @return int + */ protected function execute(InputInterface $input, OutputInterface $output) { $composer = $this->getComposer(); @@ -166,6 +172,11 @@ protected function execute(InputInterface $input, OutputInterface $output) return $exitCode; } + /** + * @param array[] $results + * + * @return void + */ protected function printTable(OutputInterface $output, $results) { $rows = array(); diff --git a/app/vendor/composer/composer/src/Composer/Command/ClearCacheCommand.php b/app/vendor/composer/composer/src/Composer/Command/ClearCacheCommand.php index bdbdd80cf..51e02b789 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ClearCacheCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ClearCacheCommand.php @@ -22,6 +22,9 @@ */ class ClearCacheCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this @@ -39,6 +42,9 @@ protected function configure() ; } + /** + * @return int + */ protected function execute(InputInterface $input, OutputInterface $output) { $config = Factory::createConfig(); diff --git a/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php b/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php index 39b4604d3..4f486cc83 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php @@ -59,7 +59,7 @@ class ConfigCommand extends BaseCommand protected $authConfigSource; /** - * {@inheritDoc} + * @return void */ protected function configure() { @@ -149,7 +149,8 @@ protected function configure() } /** - * {@inheritDoc} + * @return void + * @throws \Exception */ protected function initialize(InputInterface $input, OutputInterface $output) { @@ -205,7 +206,8 @@ protected function initialize(InputInterface $input, OutputInterface $output) } /** - * {@inheritDoc} + * @return int + * @throws \Seld\JsonLint\ParsingException */ protected function execute(InputInterface $input, OutputInterface $output) { @@ -759,6 +761,14 @@ function ($vals) { throw new \InvalidArgumentException('Setting '.$settingKey.' does not exist or is not supported by this command'); } + /** + * @param string $key + * @param array{callable, callable} $callbacks Validator and normalizer callbacks + * @param array $values + * @param string $method + * + * @return void + */ protected function handleSingleValue($key, array $callbacks, array $values, $method) { list($validator, $normalizer) = $callbacks; @@ -783,9 +793,17 @@ protected function handleSingleValue($key, array $callbacks, array $values, $met } } - return call_user_func(array($this->configSource, $method), $key, $normalizedValue); + call_user_func(array($this->configSource, $method), $key, $normalizedValue); } + /** + * @param string $key + * @param array{callable, callable} $callbacks Validator and normalizer callbacks + * @param array $values + * @param string $method + * + * @return void + */ protected function handleMultiValue($key, array $callbacks, array $values, $method) { list($validator, $normalizer) = $callbacks; @@ -796,16 +814,17 @@ protected function handleMultiValue($key, array $callbacks, array $values, $meth )); } - return call_user_func(array($this->configSource, $method), $key, $normalizer($values)); + call_user_func(array($this->configSource, $method), $key, $normalizer($values)); } /** * Display the contents of the file in a pretty formatted way * - * @param array $contents - * @param array $rawContents - * @param OutputInterface $output - * @param string|null $k + * @param array $contents + * @param array $rawContents + * @param string|null $k + * + * @return void */ protected function listConfiguration(array $contents, array $rawContents, OutputInterface $output, $k = null) { diff --git a/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php b/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php index b64b01e18..da01080f6 100644 --- a/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php @@ -56,6 +56,9 @@ class CreateProjectCommand extends BaseCommand */ protected $suggestedPackagesReporter; + /** + * @return void + */ protected function configure() { $this @@ -115,6 +118,9 @@ protected function configure() ; } + /** + * @return int + */ protected function execute(InputInterface $input, OutputInterface $output) { $config = Factory::createConfig(); @@ -159,7 +165,27 @@ protected function execute(InputInterface $input, OutputInterface $output) ); } - public function installProject(IOInterface $io, Config $config, InputInterface $input, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repositories = null, $disablePlugins = false, $noScripts = false, $noProgress = false, $noInstall = false, $ignorePlatformReqs = false, $secureHttp = true, $addRepository = false) + /** + * @param string|null $packageName + * @param string|null $directory + * @param string|null $packageVersion + * @param string $stability + * @param bool $preferSource + * @param bool $preferDist + * @param bool $installDevPackages + * @param string|array|null $repositories + * @param bool $disablePlugins + * @param bool $noScripts + * @param bool $noProgress + * @param bool $noInstall + * @param bool $ignorePlatformReqs + * @param bool $secureHttp + * @param bool $addRepository + * + * @return int + * @throws \Exception + */ + public function installProject(IOInterface $io, Config $config, InputInterface $input, $packageName = null, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repositories = null, $disablePlugins = false, $noScripts = false, $noProgress = false, $noInstall = false, $ignorePlatformReqs = false, $secureHttp = true, $addRepository = false) { $oldCwd = getcwd(); @@ -304,6 +330,24 @@ public function installProject(IOInterface $io, Config $config, InputInterface $ return 0; } + /** + * @param string $packageName + * @param string|null $directory + * @param string|null $packageVersion + * @param string|null $stability + * @param bool $preferSource + * @param bool $preferDist + * @param bool $installDevPackages + * @param array|null $repositories + * @param bool $disablePlugins + * @param bool $noScripts + * @param bool $noProgress + * @param bool $ignorePlatformReqs + * @param bool $secureHttp + * + * @return bool + * @throws \Exception + */ protected function installRootPackage(IOInterface $io, Config $config, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, array $repositories = null, $disablePlugins = false, $noScripts = false, $noProgress = false, $ignorePlatformReqs = false, $secureHttp = true) { if (!$secureHttp) { diff --git a/app/vendor/composer/composer/src/Composer/Command/DependsCommand.php b/app/vendor/composer/composer/src/Composer/Command/DependsCommand.php index c1ebe7eab..9ea939946 100644 --- a/app/vendor/composer/composer/src/Composer/Command/DependsCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/DependsCommand.php @@ -24,6 +24,8 @@ class DependsCommand extends BaseDependencyCommand { /** * Configure command metadata. + * + * @return void */ protected function configure() { @@ -51,8 +53,6 @@ protected function configure() /** * Execute the function. * - * @param InputInterface $input - * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php b/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php index 2fdd99bf2..8e4e617cc 100644 --- a/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php @@ -48,6 +48,9 @@ class DiagnoseCommand extends BaseCommand /** @var int */ protected $exitCode = 0; + /** + * @return void + */ protected function configure() { $this @@ -66,7 +69,7 @@ protected function configure() } /** - * {@inheritdoc} + * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { @@ -195,6 +198,9 @@ protected function execute(InputInterface $input, OutputInterface $output) return $this->exitCode; } + /** + * @return string|true + */ private function checkComposerSchema() { $validator = new ConfigValidator($this->getIO()); @@ -219,6 +225,9 @@ private function checkComposerSchema() return true; } + /** + * @return string|true + */ private function checkGit() { if (!function_exists('proc_open')) { @@ -233,6 +242,11 @@ private function checkGit() return true; } + /** + * @param string $proto + * + * @return string|string[]|true + */ private function checkHttp($proto, Config $config) { $result = $this->checkConnectivity(); @@ -268,6 +282,9 @@ private function checkHttp($proto, Config $config) return true; } + /** + * @return string|true|\Exception + */ private function checkHttpProxy() { $result = $this->checkConnectivity(); @@ -293,6 +310,12 @@ private function checkHttpProxy() return true; } + /** + * @param string $domain + * @param string $token + * + * @return string|true|\Exception + */ private function checkGithubOauth($domain, $token) { $result = $this->checkConnectivity(); @@ -322,7 +345,7 @@ private function checkGithubOauth($domain, $token) * @param string $domain * @param string $token * @throws TransportException - * @return array|string + * @return mixed|string */ private function getGithubRateLimit($domain, $token = null) { @@ -341,7 +364,10 @@ private function getGithubRateLimit($domain, $token = null) return $data['resources']['core']; } - private function checkDiskSpace($config) + /** + * @return string|true + */ + private function checkDiskSpace(Config $config) { $minSpaceFree = 1024 * 1024; if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree) @@ -353,7 +379,10 @@ private function checkDiskSpace($config) return true; } - private function checkPubKeys($config) + /** + * @return string[]|true + */ + private function checkPubKeys(Config $config) { $home = $config->get('home'); $errors = array(); @@ -382,7 +411,10 @@ private function checkPubKeys($config) return $errors ?: true; } - private function checkVersion($config) + /** + * @return string|\Exception|true + */ + private function checkVersion(Config $config) { $result = $this->checkConnectivity(); if ($result !== true) { @@ -403,6 +435,9 @@ private function checkVersion($config) return true; } + /** + * @return string + */ private function getCurlVersion() { if (extension_loaded('curl')) { @@ -413,7 +448,7 @@ private function getCurlVersion() $version = curl_version(); return ''.$version['version'].' '. - 'libz '.(isset($version['libz_version']) ? $version['libz_version'] : 'missing').' '. + 'libz '.(!empty($version['libz_version']) ? $version['libz_version'] : 'missing').' '. 'ssl '.(isset($version['ssl_version']) ? $version['ssl_version'] : 'missing').''; } @@ -422,6 +457,8 @@ private function getCurlVersion() /** * @param bool|string|string[]|\Exception $result + * + * @return void */ private function outputResult($result) { @@ -469,6 +506,9 @@ private function outputResult($result) } } + /** + * @return string|true + */ private function checkPlatform() { $output = ''; @@ -699,7 +739,7 @@ private function checkPlatform() /** * Check if allow_url_fopen is ON * - * @return true|string + * @return string|true */ private function checkConnectivity() { diff --git a/app/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php b/app/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php index c4b0b9926..20da6fb15 100644 --- a/app/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php @@ -23,6 +23,9 @@ */ class DumpAutoloadCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this @@ -50,6 +53,9 @@ protected function configure() ; } + /** + * @return int + */ protected function execute(InputInterface $input, OutputInterface $output) { $composer = $this->getComposer(); diff --git a/app/vendor/composer/composer/src/Composer/Command/ExecCommand.php b/app/vendor/composer/composer/src/Composer/Command/ExecCommand.php index 167a2be0d..7cc2c3fae 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ExecCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ExecCommand.php @@ -22,6 +22,9 @@ */ class ExecCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this @@ -46,6 +49,9 @@ protected function configure() ; } + /** + * @return int + */ protected function execute(InputInterface $input, OutputInterface $output) { $composer = $this->getComposer(); diff --git a/app/vendor/composer/composer/src/Composer/Command/FundCommand.php b/app/vendor/composer/composer/src/Composer/Command/FundCommand.php index edba9e806..00bbca4af 100644 --- a/app/vendor/composer/composer/src/Composer/Command/FundCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/FundCommand.php @@ -28,6 +28,9 @@ */ class FundCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this->setName('fund') @@ -38,6 +41,9 @@ protected function configure() ; } + /** + * @return int + */ protected function execute(InputInterface $input, OutputInterface $output) { $composer = $this->getComposer(); @@ -125,6 +131,10 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } + /** + * @param array[] $fundings + * @return array[] + */ private function insertFundingData(array $fundings, CompletePackageInterface $package) { foreach ($package->getFunding() as $fundingOption) { diff --git a/app/vendor/composer/composer/src/Composer/Command/GlobalCommand.php b/app/vendor/composer/composer/src/Composer/Command/GlobalCommand.php index c78ea7109..9fd711fe5 100644 --- a/app/vendor/composer/composer/src/Composer/Command/GlobalCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/GlobalCommand.php @@ -25,6 +25,9 @@ */ class GlobalCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this @@ -57,6 +60,10 @@ protected function configure() ; } + /** + * @return int|void + * @throws \Symfony\Component\Console\Exception\ExceptionInterface + */ public function run(InputInterface $input, OutputInterface $output) { if (!method_exists($input, '__toString')) { @@ -112,7 +119,7 @@ public function run(InputInterface $input, OutputInterface $output) } /** - * {@inheritDoc} + * @inheritDoc */ public function isProxyCommand() { diff --git a/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php b/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php index 1a228b871..ad4a42713 100644 --- a/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php @@ -29,7 +29,9 @@ class HomeCommand extends BaseCommand { /** - * {@inheritDoc} + * @inheritDoc + * + * @return void */ protected function configure() { @@ -56,7 +58,7 @@ protected function configure() } /** - * {@inheritDoc} + * @inheritDoc */ protected function execute(InputInterface $input, OutputInterface $output) { @@ -97,6 +99,11 @@ protected function execute(InputInterface $input, OutputInterface $output) return $return; } + /** + * @param bool $showHomepage + * @param bool $showOnly + * @return bool + */ private function handlePackage(CompletePackageInterface $package, $showHomepage, $showOnly) { $support = $package->getSupport(); @@ -122,6 +129,7 @@ private function handlePackage(CompletePackageInterface $package, $showHomepage, * opens a url in your system default browser * * @param string $url + * @return void */ private function openBrowser($url) { @@ -129,7 +137,9 @@ private function openBrowser($url) $process = new ProcessExecutor($this->getIO()); if (Platform::isWindows()) { - return $process->execute('start "web" explorer ' . $url, $output); + $process->execute('start "web" explorer ' . $url, $output); + + return; } $linux = $process->execute('which xdg-open', $output); diff --git a/app/vendor/composer/composer/src/Composer/Command/InitCommand.php b/app/vendor/composer/composer/src/Composer/Command/InitCommand.php index c8888f07e..d2e09e0f9 100644 --- a/app/vendor/composer/composer/src/Composer/Command/InitCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/InitCommand.php @@ -53,7 +53,9 @@ class InitCommand extends BaseCommand private $repositorySets; /** - * {@inheritdoc} + * @inheritDoc + * + * @return void */ protected function configure() { @@ -88,7 +90,10 @@ protected function configure() } /** - * {@inheritdoc} + * @inheritDoc + * + * @return int + * @throws \Seld\JsonLint\ParsingException */ protected function execute(InputInterface $input, OutputInterface $output) { @@ -219,7 +224,9 @@ protected function execute(InputInterface $input, OutputInterface $output) } /** - * {@inheritdoc} + * @inheritDoc + * + * @return void */ protected function interact(InputInterface $input, OutputInterface $output) { @@ -461,7 +468,7 @@ function ($value) use ($autoload) { /** * @private * @param string $author - * @return array + * @return array{name: string, email: string} */ public function parseAuthorString($author) { @@ -480,11 +487,18 @@ public function parseAuthorString($author) ); } + /** + * @param string $name + * @return list + */ protected function findPackages($name) { return $this->getRepos()->search($name); } + /** + * @return CompositeRepository + */ protected function getRepos() { if (!$this->repos) { @@ -497,6 +511,16 @@ protected function getRepos() return $this->repos; } + /** + * @param array $requires + * @param PlatformRepository|null $platformRepo + * @param string $preferredStability + * @param bool $checkProvidedVersions + * @param bool $fixed + * + * @return array + * @throws \Exception + */ final protected function determineRequirements(InputInterface $input, OutputInterface $output, $requires = array(), PlatformRepository $platformRepo = null, $preferredStability = 'stable', $checkProvidedVersions = true, $fixed = false) { if ($requires) { @@ -663,6 +687,11 @@ final protected function determineRequirements(InputInterface $input, OutputInte return $requires; } + /** + * @param string $author + * + * @return array + */ protected function formatAuthors($author) { return array($this->parseAuthorString($author)); @@ -696,6 +725,9 @@ function ($part) { return join('\\', $namespace); } + /** + * @return array + */ protected function getGitConfig() { if (null !== $this->gitConfig) { @@ -761,6 +793,12 @@ protected function hasVendorIgnore($ignoreFile, $vendor = 'vendor') return false; } + /** + * @param string $ignoreFile + * @param string $vendor + * + * @return void + */ protected function addVendorIgnore($ignoreFile, $vendor = '/vendor/') { $contents = ""; @@ -775,6 +813,11 @@ protected function addVendorIgnore($ignoreFile, $vendor = '/vendor/') file_put_contents($ignoreFile, $contents . $vendor. "\n"); } + /** + * @param string $email + * + * @return bool + */ protected function isValidEmail($email) { // assume it's valid if we can't validate it @@ -790,6 +833,11 @@ protected function isValidEmail($email) return false !== filter_var($email, FILTER_VALIDATE_EMAIL); } + /** + * @param string|null $minimumStability + * + * @return RepositorySet + */ private function getRepositorySet(InputInterface $input, $minimumStability = null) { $key = $minimumStability ?: 'default'; @@ -802,6 +850,9 @@ private function getRepositorySet(InputInterface $input, $minimumStability = nul return $this->repositorySets[$key]; } + /** + * @return string + */ private function getMinimumStability(InputInterface $input) { if ($input->hasOption('stability')) { @@ -823,7 +874,6 @@ private function getMinimumStability(InputInterface $input) * * This returns a version with the ~ operator prefixed when possible. * - * @param InputInterface $input * @param string $name * @param PlatformRepository|null $platformRepo * @param string $preferredStability @@ -831,7 +881,7 @@ private function getMinimumStability(InputInterface $input) * @param string $minimumStability * @param bool $fixed * @throws \InvalidArgumentException - * @return array name version + * @return array{string, string} name version */ private function findBestVersionAndNameForPackage(InputInterface $input, $name, PlatformRepository $platformRepo = null, $preferredStability = 'stable', $requiredVersion = null, $minimumStability = null, $fixed = null) { @@ -854,10 +904,10 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name, return array($name, $requiredVersion ?: '*'); } - // Check whether the PHP version was the problem + // Check whether the package requirements were the problem if (true !== $ignorePlatformReqs && ($candidate = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, true))) { throw new \InvalidArgumentException(sprintf( - 'Package %s%s has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version' . $this->getPlatformExceptionDetails($candidate, $platformRepo), + 'Package %s%s has requirements incompatible with your PHP version, PHP extensions and Composer version' . $this->getPlatformExceptionDetails($candidate, $platformRepo), $name, $requiredVersion ? ' at version '.$requiredVersion : '' )); @@ -936,6 +986,9 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name, ); } + /** + * @return string + */ private function getPlatformExceptionDetails(PackageInterface $candidate, PlatformRepository $platformRepo = null) { $details = array(); @@ -969,6 +1022,11 @@ private function getPlatformExceptionDetails(PackageInterface $candidate, Platfo return ':'.PHP_EOL.' - ' . implode(PHP_EOL.' - ', $details); } + /** + * @param string $package + * + * @return array + */ private function findSimilar($package) { try { @@ -993,7 +1051,10 @@ private function findSimilar($package) return array_keys(array_slice($similarPackages, 0, 5)); } - private function updateDependencies($output) + /** + * @return void + */ + private function updateDependencies(OutputInterface $output) { try { $updateCommand = $this->getApplication()->find('update'); @@ -1004,7 +1065,10 @@ private function updateDependencies($output) } } - private function runDumpAutoloadCommand($output) + /** + * @return void + */ + private function runDumpAutoloadCommand(OutputInterface $output) { try { $command = $this->getApplication()->find('dump-autoload'); @@ -1015,6 +1079,10 @@ private function runDumpAutoloadCommand($output) } } + /** + * @param array> $options + * @return bool + */ private function hasDependencies($options) { $requires = (array) $options['require']; diff --git a/app/vendor/composer/composer/src/Composer/Command/InstallCommand.php b/app/vendor/composer/composer/src/Composer/Command/InstallCommand.php index eda9c25cf..583fc33a1 100644 --- a/app/vendor/composer/composer/src/Composer/Command/InstallCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/InstallCommand.php @@ -29,6 +29,9 @@ */ class InstallCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this diff --git a/app/vendor/composer/composer/src/Composer/Command/LicensesCommand.php b/app/vendor/composer/composer/src/Composer/Command/LicensesCommand.php index b4544cf50..5375ab08d 100644 --- a/app/vendor/composer/composer/src/Composer/Command/LicensesCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/LicensesCommand.php @@ -13,6 +13,7 @@ namespace Composer\Command; use Composer\Json\JsonFile; +use Composer\Package\CompletePackageInterface; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; use Composer\Package\PackageInterface; @@ -28,6 +29,9 @@ */ class LicensesCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this @@ -48,6 +52,9 @@ protected function configure() ; } + /** + * @return int + */ protected function execute(InputInterface $input, OutputInterface $output) { $composer = $this->getComposer(); @@ -91,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $table->addRow(array( $package->getPrettyName(), $package->getFullPrettyVersion(), - implode(', ', $package->getLicense()) ?: 'none', + implode(', ', $package instanceof CompletePackageInterface ? $package->getLicense() : array()) ?: 'none', )); } $table->render(); @@ -102,7 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output) foreach ($packages as $package) { $dependencies[$package->getPrettyName()] = array( 'version' => $package->getFullPrettyVersion(), - 'license' => $package->getLicense(), + 'license' => $package instanceof CompletePackageInterface ? $package->getLicense() : array(), ); } @@ -117,7 +124,7 @@ protected function execute(InputInterface $input, OutputInterface $output) case 'summary': $usedLicenses = array(); foreach ($packages as $package) { - $license = $package->getLicense(); + $license = $package instanceof CompletePackageInterface ? $package->getLicense() : array(); $licenseName = $license[0]; if (!isset($usedLicenses[$licenseName])) { $usedLicenses[$licenseName] = 0; @@ -149,10 +156,8 @@ protected function execute(InputInterface $input, OutputInterface $output) /** * Find package requires and child requires * - * @param RepositoryInterface $repo - * @param PackageInterface $package - * @param array $bucket - * @return array + * @param array $bucket + * @return array */ private function filterRequiredPackages(RepositoryInterface $repo, PackageInterface $package, $bucket = array()) { @@ -178,9 +183,9 @@ function ($package) use ($requires, $packageListNames) { /** * Adds packages to the package list * - * @param array $packages the list of packages to add - * @param array $bucket the list to add packages to - * @return array + * @param PackageInterface[] $packages the list of packages to add + * @param array $bucket the list to add packages to + * @return array */ public function appendPackages(array $packages, array $bucket) { diff --git a/app/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php b/app/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php index ace1631d8..0b38f2f0e 100644 --- a/app/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php @@ -23,6 +23,9 @@ */ class OutdatedCommand extends ShowCommand { + /** + * @return void + */ protected function configure() { $this @@ -94,7 +97,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } /** - * {@inheritDoc} + * @inheritDoc */ public function isProxyCommand() { diff --git a/app/vendor/composer/composer/src/Composer/Command/ProhibitsCommand.php b/app/vendor/composer/composer/src/Composer/Command/ProhibitsCommand.php index 9931a881b..c51d320f5 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ProhibitsCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ProhibitsCommand.php @@ -24,6 +24,8 @@ class ProhibitsCommand extends BaseDependencyCommand { /** * Configure command metadata. + * + * @return void */ protected function configure() { @@ -52,8 +54,6 @@ protected function configure() /** * Execute the function. * - * @param InputInterface $input - * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php b/app/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php index c92564658..94da95f1d 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php @@ -29,6 +29,9 @@ */ class ReinstallCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this diff --git a/app/vendor/composer/composer/src/Composer/Command/RemoveCommand.php b/app/vendor/composer/composer/src/Composer/Command/RemoveCommand.php index 3cd865126..926500c09 100644 --- a/app/vendor/composer/composer/src/Composer/Command/RemoveCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/RemoveCommand.php @@ -31,6 +31,9 @@ */ class RemoveCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this @@ -70,6 +73,9 @@ protected function configure() ; } + /** + * @return void + */ protected function interact(InputInterface $input, OutputInterface $output) { if ($input->getOption('unused')) { @@ -117,6 +123,10 @@ protected function interact(InputInterface $input, OutputInterface $output) } } + /** + * @return int + * @throws \Seld\JsonLint\ParsingException + */ protected function execute(InputInterface $input, OutputInterface $output) { $packages = $input->getArgument('packages'); diff --git a/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php b/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php index 578e2a208..c629af5db 100644 --- a/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php @@ -20,6 +20,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Composer\Factory; use Composer\Installer; +use Composer\Installer\InstallerEvents; use Composer\Json\JsonFile; use Composer\Json\JsonManipulator; use Composer\Package\Version\VersionParser; @@ -52,7 +53,12 @@ class RequireCommand extends InitCommand private $lock; /** @var ?string contents before modification if the lock file exists */ private $lockBackup; + /** @var bool */ + private $dependencyResolutionCompleted = false; + /** + * @return void + */ protected function configure() { $this @@ -103,6 +109,10 @@ protected function configure() ; } + /** + * @return int + * @throws \Seld\JsonLint\ParsingException + */ protected function execute(InputInterface $input, OutputInterface $output) { if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) { @@ -270,11 +280,18 @@ protected function execute(InputInterface $input, OutputInterface $output) try { return $this->doUpdate($input, $output, $io, $requirements, $requireKey, $removeKey); } catch (\Exception $e) { - $this->revertComposerFile(false); + if (!$this->dependencyResolutionCompleted) { + $this->revertComposerFile(false); + } throw $e; } } + /** + * @param array $newRequirements + * @param string $requireKey + * @return string[] + */ private function getInconsistentRequireKeys(array $newRequirements, $requireKey) { $requireKeys = $this->getPackagesByRequireKey(); @@ -291,6 +308,9 @@ private function getInconsistentRequireKeys(array $newRequirements, $requireKey) return $inconsistentRequirements; } + /** + * @return array + */ private function getPackagesByRequireKey() { $composerDefinition = $this->json->read(); @@ -311,6 +331,22 @@ private function getPackagesByRequireKey() ); } + /** + * @private + * @return void + */ + public function markSolverComplete() + { + $this->dependencyResolutionCompleted = true; + } + + /** + * @param array $requirements + * @param string $requireKey + * @param string $removeKey + * @return int + * @throws \Exception + */ private function doUpdate(InputInterface $input, OutputInterface $output, IOInterface $io, array $requirements, $requireKey, $removeKey) { // Update packages @@ -318,6 +354,9 @@ private function doUpdate(InputInterface $input, OutputInterface $output, IOInte $composer = $this->getComposer(true, $input->getOption('no-plugins')); $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts')); + $this->dependencyResolutionCompleted = false; + $composer->getEventDispatcher()->addListener(InstallerEvents::PRE_OPERATIONS_EXEC, array($this, 'markSolverComplete'), 10000); + if ($input->getOption('dry-run')) { $rootPackage = $composer->getPackage(); $links = array( @@ -387,13 +426,28 @@ private function doUpdate(InputInterface $input, OutputInterface $output, IOInte $status = $install->run(); if ($status !== 0) { + if ($status === Installer::ERROR_DEPENDENCY_RESOLUTION_FAILED) { + foreach ($this->normalizeRequirements($input->getArgument('packages')) as $req) { + if (!isset($req['version'])) { + $io->writeError('You can also try re-running composer require with an explicit version constraint, e.g. "composer require '.$req['name'].':*" to figure out if any version is installable, or "composer require '.$req['name'].':^2.1" if you know which you need.'); + break; + } + } + } $this->revertComposerFile(false); } return $status; } - private function updateFileCleanly($json, array $new, $requireKey, $removeKey, $sortPackages) + /** + * @param array $new + * @param string $requireKey + * @param string $removeKey + * @param bool $sortPackages + * @return bool + */ + private function updateFileCleanly(JsonFile $json, array $new, $requireKey, $removeKey, $sortPackages) { $contents = file_get_contents($json->getPath()); @@ -420,6 +474,10 @@ protected function interact(InputInterface $input, OutputInterface $output) return; } + /** + * @param bool $hardExit + * @return void + */ public function revertComposerFile($hardExit = true) { $io = $this->getIO(); diff --git a/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php b/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php index 81b625786..6bb0f0a64 100644 --- a/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php @@ -44,6 +44,9 @@ class RunScriptCommand extends BaseCommand ScriptEvents::POST_AUTOLOAD_DUMP, ); + /** + * @return void + */ protected function configure() { $this @@ -109,6 +112,9 @@ protected function execute(InputInterface $input, OutputInterface $output) return $composer->getEventDispatcher()->dispatchScript($script, $devMode, $args); } + /** + * @return int + */ protected function listScripts(OutputInterface $output) { $scripts = $this->getComposer()->getPackage()->getScripts(); diff --git a/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php b/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php index 63f0f9e6a..1cf3e2ba9 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php @@ -27,6 +27,10 @@ class ScriptAliasCommand extends BaseCommand /** @var string */ private $description; + /** + * @param string $script + * @param string $description + */ public function __construct($script, $description) { $this->script = $script; @@ -35,6 +39,9 @@ public function __construct($script, $description) parent::__construct(); } + /** + * @return void + */ protected function configure() { $this @@ -57,6 +64,9 @@ protected function configure() ; } + /** + * @return int + */ protected function execute(InputInterface $input, OutputInterface $output) { $composer = $this->getComposer(); diff --git a/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php b/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php index 8b51d530a..a4e63198b 100644 --- a/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php @@ -29,6 +29,9 @@ */ class SearchCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this diff --git a/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php b/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php index 70e65d252..360442a1c 100644 --- a/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php @@ -38,6 +38,9 @@ class SelfUpdateCommand extends BaseCommand const HOMEPAGE = 'getcomposer.org'; const OLD_INSTALL_EXT = '-old.phar'; + /** + * @return void + */ protected function configure() { $this @@ -70,8 +73,17 @@ protected function configure() ; } + /** + * @return int + * @throws FilesystemException + */ protected function execute(InputInterface $input, OutputInterface $output) { + // trigger autoloading of a few classes which may be needed when verifying/swapping the phar file + // to ensure we do not try to load them from the new phar, see https://github.com/composer/composer/issues/10252 + class_exists('Composer\Util\Platform'); + class_exists('Composer\Downloader\FilesystemException'); + $config = Factory::createConfig(); if ($config->get('disable-tls') === true) { @@ -105,7 +117,9 @@ protected function execute(InputInterface $input, OutputInterface $output) $localFilename = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0]; if ($input->getOption('update-keys')) { - return $this->fetchKeys($io, $config); + $this->fetchKeys($io, $config); + + return 0; } // ensure composer.phar location is accessible @@ -199,7 +213,7 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } - $tempFilename = $tmpDir . '/' . basename($localFilename, '.phar').'-temp.phar'; + $tempFilename = $tmpDir . '/' . basename($localFilename, '.phar').'-temp'.rand(0, 10000000).'.phar'; $backupFile = sprintf( '%s/%s-%s%s', $rollbackDir, @@ -324,6 +338,10 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } + /** + * @return void + * @throws \Exception + */ protected function fetchKeys(IOInterface $io, Config $config) { if (!$io->isInteractive()) { @@ -369,6 +387,12 @@ protected function fetchKeys(IOInterface $io, Config $config) $io->write('Public keys stored in '.$config->get('home')); } + /** + * @param string $rollbackDir + * @param string $localFilename + * @return int + * @throws FilesystemException + */ protected function rollback(OutputInterface $output, $rollbackDir, $localFilename) { $rollbackVersion = $this->getLastBackupVersion($rollbackDir); @@ -448,6 +472,12 @@ protected function setLocalPhar($localFilename, $newFilename, $backupTarget = nu } } + /** + * @param string $rollbackDir + * @param string|null $except + * + * @return void + */ protected function cleanBackups($rollbackDir, $except = null) { $finder = $this->getOldInstallationFinder($rollbackDir); @@ -464,6 +494,10 @@ protected function cleanBackups($rollbackDir, $except = null) } } + /** + * @param string $rollbackDir + * @return string|false + */ protected function getLastBackupVersion($rollbackDir) { $finder = $this->getOldInstallationFinder($rollbackDir); @@ -477,6 +511,10 @@ protected function getLastBackupVersion($rollbackDir) return false; } + /** + * @param string $rollbackDir + * @return Finder + */ protected function getOldInstallationFinder($rollbackDir) { return Finder::create() diff --git a/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php b/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php index 75fb8ffdc..ea9c1dac8 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php @@ -59,6 +59,9 @@ class ShowCommand extends BaseCommand /** @var ?RepositorySet */ private $repositorySet; + /** + * @return void + */ protected function configure() { $this @@ -430,7 +433,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $packageViewData['latest-status'] = $this->getUpdateStatus($latestPackage, $package); $latestLength = max($latestLength, strlen($latestPackage->getFullPrettyVersion())); } - if ($writeDescription) { + if ($writeDescription && $package instanceof CompletePackageInterface) { $packageViewData['description'] = $package->getDescription(); } if ($writePath) { @@ -553,6 +556,9 @@ protected function execute(InputInterface $input, OutputInterface $output) return $exitCode; } + /** + * @return string[] + */ protected function getRootRequires() { $rootPackage = $this->getComposer()->getPackage(); @@ -563,6 +569,9 @@ protected function getRootRequires() ); } + /** + * @return array|string|string[] + */ protected function getVersionStyle(PackageInterface $latestPackage, PackageInterface $package) { return $this->updateStatusToVersionStyle($this->getUpdateStatus($latestPackage, $package)); @@ -571,12 +580,10 @@ protected function getVersionStyle(PackageInterface $latestPackage, PackageInter /** * finds a package by name and version if provided * - * @param InstalledRepository $installedRepo - * @param RepositoryInterface $repos * @param string $name * @param ConstraintInterface|string $version * @throws \InvalidArgumentException - * @return array array(CompletePackageInterface, array of versions) + * @return array{CompletePackageInterface|null, array} */ protected function getPackage(InstalledRepository $installedRepo, RepositoryInterface $repos, $name, $version = null) { @@ -597,6 +604,11 @@ protected function getPackage(InstalledRepository $installedRepo, RepositoryInte } $matches = $pool->whatProvides($name, $constraint); foreach ($matches as $index => $package) { + // avoid showing the 9999999-dev alias if the default branch has no branch-alias set + if ($package instanceof AliasPackage && $package->getVersion() === VersionParser::DEFAULT_BRANCH_ALIAS) { + $package = $package->getAliasOf(); + } + // select an exact match if it is in the installed repo and no specific version was required if (null === $version && $installedRepo->hasPackage($package)) { $matchedPackage = $package; @@ -617,10 +629,10 @@ protected function getPackage(InstalledRepository $installedRepo, RepositoryInte /** * Prints package info. * - * @param CompletePackageInterface $package - * @param array $versions - * @param InstalledRepository $installedRepo + * @param array $versions * @param PackageInterface|null $latestPackage + * + * @return void */ protected function printPackageInfo(CompletePackageInterface $package, array $versions, InstalledRepository $installedRepo, PackageInterface $latestPackage = null) { @@ -645,10 +657,10 @@ protected function printPackageInfo(CompletePackageInterface $package, array $ve /** * Prints package metadata. * - * @param CompletePackageInterface $package - * @param array $versions - * @param InstalledRepository $installedRepo + * @param array $versions * @param PackageInterface|null $latestPackage + * + * @return void */ protected function printMeta(CompletePackageInterface $package, array $versions, InstalledRepository $installedRepo, PackageInterface $latestPackage = null) { @@ -713,9 +725,9 @@ protected function printMeta(CompletePackageInterface $package, array $versions, /** * Prints all available versions of this package and highlights the installed one if any. * - * @param CompletePackageInterface $package - * @param array $versions - * @param InstalledRepository $installedRepo + * @param array $versions + * + * @return void */ protected function printVersions(CompletePackageInterface $package, array $versions, InstalledRepository $installedRepo) { @@ -741,9 +753,10 @@ protected function printVersions(CompletePackageInterface $package, array $versi /** * print link objects * - * @param CompletePackageInterface $package * @param string $linkType * @param string $title + * + * @return void */ protected function printLinks(CompletePackageInterface $package, $linkType, $title = null) { @@ -761,7 +774,7 @@ protected function printLinks(CompletePackageInterface $package, $linkType, $tit /** * Prints the licenses of a package with metadata * - * @param CompletePackageInterface $package + * @return void */ protected function printLicenses(CompletePackageInterface $package) { @@ -791,10 +804,9 @@ protected function printLicenses(CompletePackageInterface $package) /** * Prints package info in JSON format. * - * @param CompletePackageInterface $package - * @param array $versions - * @param InstalledRepository $installedRepo - * @param PackageInterface|null $latestPackage + * @param array $versions + * + * @return void */ protected function printPackageInfoAsJson(CompletePackageInterface $package, array $versions, InstalledRepository $installedRepo, PackageInterface $latestPackage = null) { @@ -862,6 +874,11 @@ protected function printPackageInfoAsJson(CompletePackageInterface $package, arr $this->getIO()->write(JsonFile::encode($json)); } + /** + * @param array $json + * @param array $versions + * @return array + */ private function appendVersions($json, array $versions) { uasort($versions, 'version_compare'); @@ -871,6 +888,10 @@ private function appendVersions($json, array $versions) return $json; } + /** + * @param array $json + * @return array + */ private function appendLicenses($json, CompletePackageInterface $package) { if ($licenses = $package->getLicense()) { @@ -894,6 +915,10 @@ private function appendLicenses($json, CompletePackageInterface $package) return $json; } + /** + * @param array $json + * @return array + */ private function appendAutoload($json, CompletePackageInterface $package) { if ($package->getAutoload()) { @@ -923,6 +948,10 @@ private function appendAutoload($json, CompletePackageInterface $package) return $json; } + /** + * @param array $json + * @return array + */ private function appendLinks($json, CompletePackageInterface $package) { foreach (Link::$TYPES as $linkType) { @@ -932,6 +961,11 @@ private function appendLinks($json, CompletePackageInterface $package) return $json; } + /** + * @param array $json + * @param string $linkType + * @return array + */ private function appendLink($json, CompletePackageInterface $package, $linkType) { $links = $package->{'get' . ucfirst($linkType)}(); @@ -950,7 +984,7 @@ private function appendLink($json, CompletePackageInterface $package, $linkType) /** * Init styles for tree * - * @param OutputInterface $output + * @return void */ protected function initStyles(OutputInterface $output) { @@ -971,7 +1005,8 @@ protected function initStyles(OutputInterface $output) /** * Display the tree * - * @param array $arrayTree + * @param array> $arrayTree + * @return void */ protected function displayPackageTree(array $arrayTree) { @@ -1016,10 +1051,7 @@ protected function displayPackageTree(array $arrayTree) /** * Generate the package tree * - * @param PackageInterface $package - * @param InstalledRepository $installedRepo - * @param RepositoryInterface $remoteRepos - * @return array + * @return array>|string|null> */ protected function generatePackageTree( PackageInterface $package, @@ -1061,10 +1093,12 @@ protected function generatePackageTree( /** * Display a package tree * - * @param array|string $package - * @param array $packagesInTree - * @param string $previousTreeBar - * @param int $level + * @param array>|string|null>|string $package + * @param array $packagesInTree + * @param string $previousTreeBar + * @param int $level + * + * @return void */ protected function displayTree( $package, @@ -1114,12 +1148,9 @@ protected function displayTree( /** * Display a package tree * - * @param string $name - * @param Link $link - * @param InstalledRepository $installedRepo - * @param RepositoryInterface $remoteRepos - * @param array $packagesInTree - * @return array + * @param string $name + * @param string[] $packagesInTree + * @return array>|string>> */ protected function addTree( $name, @@ -1161,6 +1192,10 @@ protected function addTree( return $children; } + /** + * @param string $updateStatus + * @return string + */ private function updateStatusToVersionStyle($updateStatus) { // 'up-to-date' is printed green @@ -1169,6 +1204,9 @@ private function updateStatusToVersionStyle($updateStatus) return str_replace(array('up-to-date', 'semver-safe-update', 'update-possible'), array('info', 'highlight', 'comment'), $updateStatus); } + /** + * @return string + */ private function getUpdateStatus(PackageInterface $latestPackage, PackageInterface $package) { if ($latestPackage->getFullPrettyVersion() === $package->getFullPrettyVersion()) { @@ -1188,6 +1226,11 @@ private function getUpdateStatus(PackageInterface $latestPackage, PackageInterfa return 'update-possible'; } + /** + * @param string $line + * + * @return void + */ private function writeTreeLine($line) { $io = $this->getIO(); @@ -1201,10 +1244,7 @@ private function writeTreeLine($line) /** * Given a package, this finds the latest package matching it * - * @param PackageInterface $package - * @param Composer $composer - * @param PlatformRepository $platformRepo - * @param bool $minorOnly + * @param bool $minorOnly * * @return PackageInterface|false */ @@ -1257,10 +1297,8 @@ private function getRepositorySet(Composer $composer) /** * Find package requires and child requires * - * @param RepositoryInterface $repo - * @param PackageInterface $package - * @param array $bucket - * @return array + * @param array $bucket + * @return array */ private function filterRequiredPackages(RepositoryInterface $repo, PackageInterface $package, $bucket = array()) { diff --git a/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php b/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php index ede91ac13..cc4876fd0 100644 --- a/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php @@ -37,6 +37,7 @@ class StatusCommand extends BaseCommand const EXIT_CODE_VERSION_CHANGES = 4; /** + * @return void * @throws \Symfony\Component\Console\Exception\InvalidArgumentException */ protected function configure() @@ -59,8 +60,6 @@ protected function configure() } /** - * @param InputInterface $input - * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output) @@ -82,7 +81,6 @@ protected function execute(InputInterface $input, OutputInterface $output) } /** - * @param InputInterface $input * @return int */ private function doExecute(InputInterface $input) diff --git a/app/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php b/app/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php index cb1f4e9a6..345890e61 100644 --- a/app/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php @@ -23,6 +23,9 @@ class SuggestsCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this @@ -48,7 +51,7 @@ protected function configure() } /** - * {@inheritDoc} + * @inheritDoc */ protected function execute(InputInterface $input, OutputInterface $output) { diff --git a/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php b/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php index 0fe582299..84c99ffd7 100644 --- a/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php @@ -36,6 +36,9 @@ */ class UpdateCommand extends BaseCommand { + /** + * @return void + */ protected function configure() { $this @@ -105,6 +108,10 @@ protected function configure() ; } + /** + * @return int + * @throws \Exception + */ protected function execute(InputInterface $input, OutputInterface $output) { $io = $this->getIO(); @@ -241,6 +248,10 @@ protected function execute(InputInterface $input, OutputInterface $output) return $install->run(); } + /** + * @param array $packages + * @return array + */ private function getPackagesInteractively(IOInterface $io, InputInterface $input, OutputInterface $output, Composer $composer, array $packages) { if (!$input->isInteractive()) { @@ -304,6 +315,10 @@ private function getPackagesInteractively(IOInterface $io, InputInterface $input throw new \RuntimeException('Installation aborted.'); } + /** + * @param string $constraint + * @return Link + */ private function appendConstraintToLink(Link $link, $constraint) { $parser = new VersionParser; diff --git a/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php b/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php index fdb424423..e66cbf23b 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php @@ -13,6 +13,7 @@ namespace Composer\Command; use Composer\Factory; +use Composer\IO\IOInterface; use Composer\Package\Loader\ValidatingArrayLoader; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; @@ -35,6 +36,7 @@ class ValidateCommand extends BaseCommand { /** * configure + * @return void */ protected function configure() { @@ -65,9 +67,6 @@ protected function configure() } /** - * @param InputInterface $input - * @param OutputInterface $output - * * @return int */ protected function execute(InputInterface $input, OutputInterface $output) @@ -161,7 +160,19 @@ protected function execute(InputInterface $input, OutputInterface $output) return max($eventCode, $exitCode); } - private function outputResult($io, $name, &$errors, &$warnings, $checkPublish = false, $publishErrors = array(), $checkLock = false, $lockErrors = array(), $printSchemaUrl = false) + /** + * @param string $name + * @param string[] $errors + * @param string[] $warnings + * @param bool $checkPublish + * @param string[] $publishErrors + * @param bool $checkLock + * @param string[] $lockErrors + * @param bool $printSchemaUrl + * + * @return void + */ + private function outputResult(IOInterface $io, $name, &$errors, &$warnings, $checkPublish = false, $publishErrors = array(), $checkLock = false, $lockErrors = array(), $printSchemaUrl = false) { $doPrintSchemaUrl = false; diff --git a/app/vendor/composer/composer/src/Composer/Compiler.php b/app/vendor/composer/composer/src/Composer/Compiler.php index 8476a529f..cd27a5f72 100644 --- a/app/vendor/composer/composer/src/Composer/Compiler.php +++ b/app/vendor/composer/composer/src/Composer/Compiler.php @@ -27,14 +27,20 @@ */ class Compiler { + /** @var string */ private $version; + /** @var string */ private $branchAliasVersion = ''; + /** @var \DateTime */ private $versionDate; /** * Compiles composer into a single phar file * - * @param string $pharFile The full path to the file to create + * @param string $pharFile The full path to the file to create + * + * @return void + * * @throws \RuntimeException */ public function compile($pharFile = 'composer.phar') @@ -79,12 +85,12 @@ public function compile($pharFile = 'composer.phar') if ($process->run() == 0) { $this->version = trim($process->getOutput()); } else { - // get branch-alias defined in composer.json for dev-master (if any) + // get branch-alias defined in composer.json for dev-main (if any) $localConfig = __DIR__.'/../../composer.json'; $file = new JsonFile($localConfig); $localConfig = $file->read(); - if (isset($localConfig['extra']['branch-alias']['dev-master'])) { - $this->branchAliasVersion = $localConfig['extra']['branch-alias']['dev-master']; + if (isset($localConfig['extra']['branch-alias']['dev-main'])) { + $this->branchAliasVersion = $localConfig['extra']['branch-alias']['dev-main']; } } @@ -211,7 +217,12 @@ private function getRelativeFilePath($file) return strtr($relativePath, '\\', '/'); } - private function addFile($phar, $file, $strip = true) + /** + * @param bool $strip + * + * @return void + */ + private function addFile(\Phar $phar, \SplFileInfo $file, $strip = true) { $path = $this->getRelativeFilePath($file); $content = file_get_contents($file); @@ -236,7 +247,10 @@ private function addFile($phar, $file, $strip = true) $phar->addFromString($path, $content); } - private function addComposerBin($phar) + /** + * @return void + */ + private function addComposerBin(\Phar $phar) { $content = file_get_contents(__DIR__.'/../../bin/composer'); $content = preg_replace('{^#!/usr/bin/env php\s*}', '', $content); @@ -277,6 +291,9 @@ private function stripWhitespace($source) return $output; } + /** + * @return string + */ private function getStub() { $stub = <<<'EOF' @@ -313,7 +330,7 @@ private function getStub() // add warning once the phar is older than 60 days if (preg_match('{^[a-f0-9]+$}', $this->version)) { - $warningTime = $this->versionDate->format('U') + 60 * 86400; + $warningTime = ((int) $this->versionDate->format('U')) + 60 * 86400; $stub .= "define('COMPOSER_DEV_WARNING_TIME', $warningTime);\n"; } diff --git a/app/vendor/composer/composer/src/Composer/Composer.php b/app/vendor/composer/composer/src/Composer/Composer.php index 8d06dd7a0..62bbc9b31 100644 --- a/app/vendor/composer/composer/src/Composer/Composer.php +++ b/app/vendor/composer/composer/src/Composer/Composer.php @@ -51,9 +51,9 @@ class Composer * const RELEASE_DATE = '@release_date@'; * const SOURCE_VERSION = '1.8-dev+source'; */ - const VERSION = '2.1.9'; + const VERSION = '2.1.12'; const BRANCH_ALIAS_VERSION = ''; - const RELEASE_DATE = '2021-10-05 09:47:38'; + const RELEASE_DATE = '2021-11-09 16:02:04'; const SOURCE_VERSION = ''; /** @@ -67,6 +67,9 @@ class Composer */ const RUNTIME_API_VERSION = '2.1.0'; + /** + * @return string + */ public static function getVersion() { // no replacement done, this must be a source checkout @@ -138,7 +141,6 @@ public static function getVersion() private $archiveManager; /** - * @param RootPackageInterface $package * @return void */ public function setPackage(RootPackageInterface $package) @@ -155,7 +157,7 @@ public function getPackage() } /** - * @param Config $config + * @return void */ public function setConfig(Config $config) { @@ -171,7 +173,7 @@ public function getConfig() } /** - * @param Locker $locker + * @return void */ public function setLocker(Locker $locker) { @@ -187,7 +189,7 @@ public function getLocker() } /** - * @param Loop $loop + * @return void */ public function setLoop(Loop $loop) { @@ -203,7 +205,7 @@ public function getLoop() } /** - * @param RepositoryManager $manager + * @return void */ public function setRepositoryManager(RepositoryManager $manager) { @@ -219,7 +221,7 @@ public function getRepositoryManager() } /** - * @param DownloadManager $manager + * @return void */ public function setDownloadManager(DownloadManager $manager) { @@ -235,7 +237,7 @@ public function getDownloadManager() } /** - * @param ArchiveManager $manager + * @return void */ public function setArchiveManager(ArchiveManager $manager) { @@ -251,7 +253,7 @@ public function getArchiveManager() } /** - * @param InstallationManager $manager + * @return void */ public function setInstallationManager(InstallationManager $manager) { @@ -267,7 +269,7 @@ public function getInstallationManager() } /** - * @param PluginManager $manager + * @return void */ public function setPluginManager(PluginManager $manager) { @@ -283,7 +285,7 @@ public function getPluginManager() } /** - * @param EventDispatcher $eventDispatcher + * @return void */ public function setEventDispatcher(EventDispatcher $eventDispatcher) { @@ -299,7 +301,7 @@ public function getEventDispatcher() } /** - * @param AutoloadGenerator $autoloadGenerator + * @return void */ public function setAutoloadGenerator(AutoloadGenerator $autoloadGenerator) { diff --git a/app/vendor/composer/composer/src/Composer/Config.php b/app/vendor/composer/composer/src/Composer/Config.php index 4cb7ab8ae..5e0ab4bc0 100644 --- a/app/vendor/composer/composer/src/Composer/Config.php +++ b/app/vendor/composer/composer/src/Composer/Config.php @@ -25,6 +25,7 @@ class Config { const RELATIVE_PATHS = 1; + /** @var array */ public static $defaultConfig = array( 'process-timeout' => 300, 'use-include-path' => false, @@ -77,6 +78,7 @@ class Config // bearer ); + /** @var array */ public static $defaultRepositories = array( 'packagist.org' => array( 'type' => 'composer', @@ -84,14 +86,19 @@ class Config ), ); + /** @var array */ private $config; + /** @var ?string */ private $baseDir; + /** @var array */ private $repositories; /** @var ConfigSourceInterface */ private $configSource; /** @var ConfigSourceInterface */ private $authConfigSource; + /** @var bool */ private $useEnvironment; + /** @var array */ private $warnedHosts = array(); /** @@ -107,21 +114,33 @@ public function __construct($useEnvironment = true, $baseDir = null) $this->baseDir = $baseDir; } + /** + * @return void + */ public function setConfigSource(ConfigSourceInterface $source) { $this->configSource = $source; } + /** + * @return ConfigSourceInterface + */ public function getConfigSource() { return $this->configSource; } + /** + * @return void + */ public function setAuthConfigSource(ConfigSourceInterface $source) { $this->authConfigSource = $source; } + /** + * @return ConfigSourceInterface + */ public function getAuthConfigSource() { return $this->authConfigSource; @@ -130,7 +149,9 @@ public function getAuthConfigSource() /** * Merges new config values with the existing ones (overriding) * - * @param array $config + * @param array $config + * + * @return void */ public function merge($config) { @@ -171,13 +192,13 @@ public function merge($config) foreach ($newRepos as $name => $repository) { // disable a repository by name if (false === $repository) { - $this->disableRepoByName($name); + $this->disableRepoByName((string) $name); continue; } // disable a repository with an anonymous {"name": false} repo if (is_array($repository) && 1 === count($repository) && false === current($repository)) { - $this->disableRepoByName(key($repository)); + $this->disableRepoByName((string) key($repository)); continue; } @@ -202,7 +223,7 @@ public function merge($config) } /** - * @return array + * @return array */ public function getRepositories() { @@ -215,6 +236,7 @@ public function getRepositories() * @param string $key * @param int $flags Options (see class constants) * @throws \RuntimeException + * * @return mixed */ public function get($key, $flags = 0) @@ -366,6 +388,11 @@ public function get($key, $flags = 0) } } + /** + * @param int $flags + * + * @return array + */ public function all($flags = 0) { $all = array( @@ -378,6 +405,9 @@ public function all($flags = 0) return $all; } + /** + * @return array + */ public function raw() { return array( @@ -402,6 +432,7 @@ public function has($key) * * @param string|int|null $value a config string that can contain {$refs-to-other-config} * @param int $flags Options (see class constants) + * * @return string|int|null */ private function process($value, $flags) @@ -452,6 +483,11 @@ private function getComposerEnv($var) return false; } + /** + * @param string $name + * + * @return void + */ private function disableRepoByName($name) { if (isset($this->repositories[$name])) { @@ -466,6 +502,8 @@ private function disableRepoByName($name) * * @param string $url * @param IOInterface $io + * + * @return void */ public function prohibitUrlByConfig($url, IOInterface $io = null) { @@ -508,6 +546,8 @@ public function prohibitUrlByConfig($url, IOInterface $io = null) * "vendor/bin/long-running-script --watch" * ] * } + * + * @return void */ public static function disableProcessTimeout() { diff --git a/app/vendor/composer/composer/src/Composer/Config/ConfigSourceInterface.php b/app/vendor/composer/composer/src/Composer/Config/ConfigSourceInterface.php index e1ef38de0..111d5d53c 100644 --- a/app/vendor/composer/composer/src/Composer/Config/ConfigSourceInterface.php +++ b/app/vendor/composer/composer/src/Composer/Config/ConfigSourceInterface.php @@ -23,8 +23,11 @@ interface ConfigSourceInterface /** * Add a repository * - * @param string $name Name - * @param array|false $config Configuration + * @param string $name Name + * @param mixed[]|false $config Configuration + * @param bool $append Whether the repo should be appended (true) or prepended (false) + * + * @return void */ public function addRepository($name, $config, $append = true); @@ -32,14 +35,18 @@ public function addRepository($name, $config, $append = true); * Remove a repository * * @param string $name + * + * @return void */ public function removeRepository($name); /** * Add a config setting * - * @param string $name Name - * @param string|array $value Value + * @param string $name Name + * @param mixed $value Value + * + * @return void */ public function addConfigSetting($name, $value); @@ -47,6 +54,8 @@ public function addConfigSetting($name, $value); * Remove a config setting * * @param string $name + * + * @return void */ public function removeConfigSetting($name); @@ -55,6 +64,8 @@ public function removeConfigSetting($name); * * @param string $name Name * @param string $value Value + * + * @return void */ public function addProperty($name, $value); @@ -62,6 +73,8 @@ public function addProperty($name, $value); * Remove a property * * @param string $name + * + * @return void */ public function removeProperty($name); @@ -71,6 +84,8 @@ public function removeProperty($name); * @param string $type Type (require, require-dev, provide, suggest, replace, conflict) * @param string $name Name * @param string $value Value + * + * @return void */ public function addLink($type, $name, $value); @@ -79,6 +94,8 @@ public function addLink($type, $name, $value); * * @param string $type Type (require, require-dev, provide, suggest, replace, conflict) * @param string $name Name + * + * @return void */ public function removeLink($type, $name); diff --git a/app/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php b/app/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php index 4be155782..d9165d719 100644 --- a/app/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php +++ b/app/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php @@ -49,7 +49,7 @@ public function __construct(JsonFile $file, $authConfig = false) } /** - * {@inheritdoc} + * @inheritDoc */ public function getName() { @@ -57,7 +57,7 @@ public function getName() } /** - * {@inheritdoc} + * @inheritDoc */ public function addRepository($name, $config, $append = true) { @@ -86,7 +86,7 @@ public function addRepository($name, $config, $append = true) } /** - * {@inheritdoc} + * @inheritDoc */ public function removeRepository($name) { @@ -96,7 +96,7 @@ public function removeRepository($name) } /** - * {@inheritdoc} + * @inheritDoc */ public function addConfigSetting($name, $value) { @@ -116,7 +116,7 @@ public function addConfigSetting($name, $value) } /** - * {@inheritdoc} + * @inheritDoc */ public function removeConfigSetting($name) { @@ -136,7 +136,7 @@ public function removeConfigSetting($name) } /** - * {@inheritdoc} + * @inheritDoc */ public function addProperty($name, $value) { @@ -159,7 +159,7 @@ public function addProperty($name, $value) } /** - * {@inheritdoc} + * @inheritDoc */ public function removeProperty($name) { @@ -182,7 +182,7 @@ public function removeProperty($name) } /** - * {@inheritdoc} + * @inheritDoc */ public function addLink($type, $name, $value) { @@ -192,7 +192,7 @@ public function addLink($type, $name, $value) } /** - * {@inheritdoc} + * @inheritDoc */ public function removeLink($type, $name) { @@ -206,6 +206,13 @@ public function removeLink($type, $name) }); } + /** + * @param string $method + * @param mixed ...$args + * @param callable $fallback + * + * @return void + */ protected function manipulateJson($method, $args, $fallback) { $args = func_get_args(); @@ -290,7 +297,7 @@ protected function manipulateJson($method, $args, $fallback) /** * Prepend a reference to an element to the beginning of an array. * - * @param array $array + * @param mixed[] $array * @param mixed $value * @return int */ diff --git a/app/vendor/composer/composer/src/Composer/Console/Application.php b/app/vendor/composer/composer/src/Composer/Console/Application.php index bdc9b2a32..7880d1471 100644 --- a/app/vendor/composer/composer/src/Composer/Console/Application.php +++ b/app/vendor/composer/composer/src/Composer/Console/Application.php @@ -117,7 +117,7 @@ public function __construct() } /** - * {@inheritDoc} + * @inheritDoc */ public function run(InputInterface $input = null, OutputInterface $output = null) { @@ -129,7 +129,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null } /** - * {@inheritDoc} + * @inheritDoc */ public function doRun(InputInterface $input, OutputInterface $output) { @@ -196,10 +196,10 @@ public function doRun(InputInterface $input, OutputInterface $output) // not a composer command, so try loading plugin ones false === $commandName // list command requires plugin commands to show them - || in_array($commandName, array('', 'list'), true) + || in_array($commandName, array('', 'list', 'help'), true) ); - if ($mayNeedPluginCommand && !$this->disablePluginsByDefault && !$this->hasPluginCommands && 'global' !== $commandName) { + if ($mayNeedPluginCommand && !$this->disablePluginsByDefault && !$this->hasPluginCommands) { try { foreach ($this->getPluginCommands() as $command) { if ($this->has($command->getName())) { @@ -368,9 +368,9 @@ private function getNewWorkingDir(InputInterface $input) } /** - * {@inheritDoc} + * @return void */ - private function hintCommonErrors($exception) + private function hintCommonErrors(\Exception $exception) { $io = $this->getIO(); @@ -451,6 +451,8 @@ public function getComposer($required = true, $disablePlugins = null) /** * Removes the cached composer instance + * + * @return void */ public function resetComposer() { @@ -468,6 +470,9 @@ public function getIO() return $this->io; } + /** + * @return string + */ public function getHelp() { return self::$logo . parent::getHelp(); @@ -517,7 +522,7 @@ protected function getDefaultCommands() } /** - * {@inheritDoc} + * @inheritDoc */ public function getLongVersion() { @@ -535,7 +540,7 @@ public function getLongVersion() } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultInputDefinition() { @@ -548,6 +553,9 @@ protected function getDefaultInputDefinition() return $definition; } + /** + * @return Command\BaseCommand[] + */ private function getPluginCommands() { $commands = array(); diff --git a/app/vendor/composer/composer/src/Composer/Console/GithubActionError.php b/app/vendor/composer/composer/src/Composer/Console/GithubActionError.php index c862dd9be..49048ffcf 100644 --- a/app/vendor/composer/composer/src/Composer/Console/GithubActionError.php +++ b/app/vendor/composer/composer/src/Composer/Console/GithubActionError.php @@ -30,21 +30,51 @@ public function __construct(IOInterface $io) * @param string $message * @param null|string $file * @param null|int $line + * + * @return void */ public function emit($message, $file = null, $line = null) { if (getenv('GITHUB_ACTIONS') && !getenv('COMPOSER_TESTS_ARE_RUNNING')) { - // newlines need to be encoded - // see https://github.com/actions/starter-workflows/issues/68#issuecomment-581479448 - $message = str_replace("\n", '%0A', $message); + $message = $this->escapeData($message); if ($file && $line) { + $file = $this->escapeProperty($file); $this->io->write("::error file=". $file .",line=". $line ."::". $message); } elseif ($file) { + $file = $this->escapeProperty($file); $this->io->write("::error file=". $file ."::". $message); } else { $this->io->write("::error ::". $message); } } } + + /** + * @param string $data + * @return string + */ + private function escapeData($data) { + // see https://github.com/actions/toolkit/blob/4f7fb6513a355689f69f0849edeb369a4dc81729/packages/core/src/command.ts#L80-L85 + $data = str_replace("%", '%25', $data); + $data = str_replace("\r", '%0D', $data); + $data = str_replace("\n", '%0A', $data); + + return $data; + } + + /** + * @param string $property + * @return string + */ + private function escapeProperty($property) { + // see https://github.com/actions/toolkit/blob/4f7fb6513a355689f69f0849edeb369a4dc81729/packages/core/src/command.ts#L87-L94 + $property = str_replace("%", '%25', $property); + $property = str_replace("\r", '%0D', $property); + $property = str_replace("\n", '%0A', $property); + $property = str_replace(":", '%3A', $property); + $property = str_replace(",", '%2C', $property); + + return $property; + } } diff --git a/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php b/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php index acef97325..f15494b58 100644 --- a/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php +++ b/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php @@ -13,6 +13,7 @@ namespace Composer\Console; use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Formatter\OutputFormatterStyle; /** * @author Jordi Boggiano @@ -51,13 +52,18 @@ class HtmlOutputFormatter extends OutputFormatter ); /** - * @param array $styles Array of "name => FormatterStyle" instances + * @param array $styles Array of "name => FormatterStyle" instances */ public function __construct(array $styles = array()) { parent::__construct(true, $styles); } + /** + * @param string $message + * + * @return string + */ public function format($message) { $formatted = parent::format($message); @@ -67,6 +73,11 @@ public function format($message) return preg_replace_callback("{\033\[([0-9;]+)m(.*?)\033\[(?:".$clearEscapeCodes.";)*?".$clearEscapeCodes."m}s", array($this, 'formatHtml'), $formatted); } + /** + * @param string[] $matches + * + * @return string + */ private function formatHtml($matches) { $out = 'package, $lock); } + /** + * @param bool $lock + * @return string + */ public static function format(PackageInterface $package, $lock = false) { return ($lock ? 'Locking ' : 'Installing ').''.$package->getPrettyName().' ('.$package->getFullPrettyVersion().')'; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php index a1aa1219f..320fc54c0 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php @@ -44,7 +44,7 @@ public function getPackage() } /** - * {@inheritDoc} + * @inheritDoc */ public function show($lock) { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php index d0c193478..f447047d4 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php @@ -44,7 +44,7 @@ public function getPackage() } /** - * {@inheritDoc} + * @inheritDoc */ public function show($lock) { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/SolverOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/SolverOperation.php index 7ab87fe8a..ad8855d2c 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/SolverOperation.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/SolverOperation.php @@ -32,7 +32,7 @@ public function getOperationType() } /** - * {@inheritDoc} + * @inheritDoc */ public function __toString() { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UninstallOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UninstallOperation.php index 585fdb1e5..ebfe98df8 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UninstallOperation.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UninstallOperation.php @@ -44,13 +44,17 @@ public function getPackage() } /** - * {@inheritDoc} + * @inheritDoc */ public function show($lock) { return self::format($this->package, $lock); } + /** + * @param bool $lock + * @return string + */ public static function format(PackageInterface $package, $lock = false) { return 'Removing '.$package->getPrettyName().' ('.$package->getFullPrettyVersion().')'; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UpdateOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UpdateOperation.php index 543c8e783..be9a49c22 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UpdateOperation.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UpdateOperation.php @@ -65,13 +65,17 @@ public function getTargetPackage() } /** - * {@inheritDoc} + * @inheritDoc */ public function show($lock) { return self::format($this->initialPackage, $this->targetPackage, $lock); } + /** + * @param bool $lock + * @return string + */ public static function format(PackageInterface $initialPackage, PackageInterface $targetPackage, $lock = false) { $fromVersion = $initialPackage->getFullPrettyVersion(); diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/PolicyInterface.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/PolicyInterface.php index b10a43e9f..48ce24e16 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/PolicyInterface.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/PolicyInterface.php @@ -13,13 +13,25 @@ namespace Composer\DependencyResolver; use Composer\Package\PackageInterface; +use Composer\Semver\Constraint\Constraint; /** * @author Nils Adermann */ interface PolicyInterface { + /** + * @param string $operator + * @return bool + * + * @phpstan-param Constraint::STR_OP_* $operator + */ public function versionCompare(PackageInterface $a, PackageInterface $b, $operator); + /** + * @param int[] $literals + * @param ?string $requiredPackage + * @return int[] + */ public function selectPreferredPackages(Pool $pool, array $literals, $requiredPackage = null); } diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php index 733b0edf5..0ee5c7f4c 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php @@ -12,11 +12,11 @@ namespace Composer\DependencyResolver; +use Composer\Package\BasePackage; use Composer\Package\Version\VersionParser; use Composer\Semver\CompilingMatcher; use Composer\Semver\Constraint\ConstraintInterface; use Composer\Semver\Constraint\Constraint; -use Composer\Package\BasePackage; /** * A package pool contains all packages for dependency resolution @@ -37,6 +37,10 @@ class Pool implements \Countable /** @var BasePackage[] */ protected $unacceptableFixedOrLockedPackages; + /** + * @param BasePackage[] $packages + * @param BasePackage[] $unacceptableFixedOrLockedPackages + */ public function __construct(array $packages = array(), array $unacceptableFixedOrLockedPackages = array()) { $this->versionParser = new VersionParser; @@ -44,6 +48,10 @@ public function __construct(array $packages = array(), array $unacceptableFixedO $this->unacceptableFixedOrLockedPackages = $unacceptableFixedOrLockedPackages; } + /** + * @param BasePackage[] $packages + * @return void + */ private function setPackages(array $packages) { $id = 1; @@ -80,6 +88,7 @@ public function packageById($id) /** * Returns how many packages have been loaded into the pool + * @return int */ #[\ReturnTypeWillChange] public function count() @@ -90,10 +99,10 @@ public function count() /** * Searches all packages providing the given package name and match the constraint * - * @param string $name The package name to be searched for - * @param ConstraintInterface $constraint A constraint that all returned + * @param string $name The package name to be searched for + * @param ?ConstraintInterface $constraint A constraint that all returned * packages must match or null to return all - * @return BasePackage[] A set of packages + * @return BasePackage[] A set of packages */ public function whatProvides($name, ConstraintInterface $constraint = null) { @@ -106,9 +115,12 @@ public function whatProvides($name, ConstraintInterface $constraint = null) } /** - * @see whatProvides + * @param string $name The package name to be searched for + * @param ?ConstraintInterface $constraint A constraint that all returned + * packages must match or null to return all + * @return BasePackage[] */ - private function computeWhatProvides($name, $constraint) + private function computeWhatProvides($name, ConstraintInterface $constraint = null) { if (!isset($this->packageByName[$name])) { return array(); @@ -125,6 +137,10 @@ private function computeWhatProvides($name, $constraint) return $matches; } + /** + * @param int $literal + * @return BasePackage + */ public function literalToPackage($literal) { $packageId = abs($literal); @@ -132,6 +148,11 @@ public function literalToPackage($literal) return $this->packageById($packageId); } + /** + * @param int $literal + * @param array $installedMap + * @return string + */ public function literalToPrettyString($literal, $installedMap) { $package = $this->literalToPackage($literal); @@ -149,9 +170,7 @@ public function literalToPrettyString($literal, $installedMap) * Checks if the package matches the given constraint directly or through * provided or replaced packages * - * @param BasePackage $candidate * @param string $name Name of the package to be matched - * @param ConstraintInterface $constraint The constraint to verify * @return bool */ public function match(BasePackage $candidate, $name, ConstraintInterface $constraint = null) @@ -194,6 +213,9 @@ public function match(BasePackage $candidate, $name, ConstraintInterface $constr return false; } + /** + * @return bool + */ public function isUnacceptableFixedOrLockedPackage(BasePackage $package) { return \in_array($package, $this->unacceptableFixedOrLockedPackages, true); diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php index 97159a3c8..2705f6181 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php @@ -18,12 +18,12 @@ use Composer\Package\BasePackage; use Composer\Package\CompleteAliasPackage; use Composer\Package\CompletePackage; -use Composer\Package\CompletePackageInterface; use Composer\Package\PackageInterface; use Composer\Package\Version\StabilityFilter; use Composer\Plugin\PluginEvents; use Composer\Plugin\PrePoolCreateEvent; use Composer\Repository\PlatformRepository; +use Composer\Repository\RepositoryInterface; use Composer\Repository\RootPackageRepository; use Composer\Semver\CompilingMatcher; use Composer\Semver\Constraint\Constraint; @@ -86,12 +86,11 @@ class PoolBuilder */ private $loadedPerRepo = array(); /** - * @var PackageInterface[] + * @var BasePackage[] */ private $packages = array(); /** - * @var PackageInterface[] - * @phpstan-var list + * @var BasePackage[] */ private $unacceptableFixedOrLockedPackages = array(); /** @var string[] */ @@ -139,6 +138,10 @@ public function __construct(array $acceptableStabilities, array $stabilityFlags, $this->io = $io; } + /** + * @param RepositoryInterface[] $repositories + * @return Pool + */ public function buildPool(array $repositories, Request $request) { if ($request->getUpdateAllowList()) { @@ -261,6 +264,10 @@ public function buildPool(array $repositories, Request $request) return $pool; } + /** + * @param string $name + * @return void + */ private function markPackageNameForLoading(Request $request, $name, ConstraintInterface $constraint) { // Skip platform requires at this stage @@ -316,6 +323,10 @@ private function markPackageNameForLoading(Request $request, $name, ConstraintIn unset($this->loadedPackages[$name]); } + /** + * @param RepositoryInterface[] $repositories + * @return void + */ private function loadPackagesMarkedForLoading(Request $request, $repositories) { foreach ($this->packagesToLoad as $name => $constraint) { @@ -348,6 +359,10 @@ private function loadPackagesMarkedForLoading(Request $request, $repositories) } } + /** + * @param bool $propagateUpdate + * @return void + */ private function loadPackage(Request $request, BasePackage $package, $propagateUpdate = true) { $index = $this->indexCounter++; @@ -434,6 +449,7 @@ private function loadPackage(Request $request, BasePackage $package, $propagateU /** * Checks if a particular name is required directly in the request * + * @param string $name packageName * @return bool */ private function isRootRequire(Request $request, $name) @@ -445,9 +461,10 @@ private function isRootRequire(Request $request, $name) /** * Checks whether the update allow list allows this package in the lock file to be updated + * * @return bool */ - private function isUpdateAllowed(PackageInterface $package) + private function isUpdateAllowed(BasePackage $package) { // Path repo packages are never loaded from lock, to force them to always remain in sync // unless symlinking is disabled in which case we probably should rather treat them like @@ -469,6 +486,9 @@ private function isUpdateAllowed(PackageInterface $package) return false; } + /** + * @return void + */ private function warnAboutNonMatchingUpdateAllowList(Request $request) { foreach ($this->updateAllowList as $pattern => $void) { @@ -496,6 +516,9 @@ private function warnAboutNonMatchingUpdateAllowList(Request $request) /** * Reverts the decision to use a locked package if a partial update with transitive dependencies * found that this package actually needs to be updated + * + * @param string $name + * @return void */ private function unlockPackage(Request $request, $name) { @@ -534,7 +557,11 @@ private function unlockPackage(Request $request, $name) } } - private function removeLoadedPackage(Request $request, PackageInterface $package, $index) + /** + * @param int $index + * @return void + */ + private function removeLoadedPackage(Request $request, BasePackage $package, $index) { unset($this->packages[$index]); if (isset($this->aliasMap[spl_object_hash($package)])) { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php index 35ce3b045..507e45d17 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php @@ -14,6 +14,8 @@ use Composer\Package\CompletePackageInterface; use Composer\Package\AliasPackage; +use Composer\Package\BasePackage; +use Composer\Package\PackageInterface; use Composer\Package\RootPackageInterface; use Composer\Repository\RepositorySet; use Composer\Repository\LockArrayRepository; @@ -47,6 +49,7 @@ class Problem * Add a rule as a reason * * @param Rule $rule A rule which is a reason for this problem + * @return void */ public function addRule(Rule $rule) { @@ -56,7 +59,7 @@ public function addRule(Rule $rule) /** * Retrieve all reasons for this problem * - * @return array The problem's reasons + * @return array> The problem's reasons */ public function getReasons() { @@ -66,7 +69,9 @@ public function getReasons() /** * A human readable textual representation of the problem's reasons * - * @param array $installedMap A map of all present packages + * @param bool $isVerbose + * @param array $installedMap A map of all present packages + * @param array $learnedPool * @return string */ public function getPrettyString(RepositorySet $repositorySet, Request $request, Pool $pool, $isVerbose, array $installedMap = array(), array $learnedPool = array()) @@ -101,6 +106,12 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, } /** + * @param Rule[] $rules + * @param string $indent + * @param bool $isVerbose + * @param array $installedMap A map of all present packages + * @param array $learnedPool + * @return string * @internal */ public static function formatDeduplicatedRules($rules, $indent, RepositorySet $repositorySet, Request $request, Pool $pool, $isVerbose, array $installedMap = array(), array $learnedPool = array()) @@ -144,6 +155,9 @@ public static function formatDeduplicatedRules($rules, $indent, RepositorySet $r return "\n$indent- ".implode("\n$indent- ", $result); } + /** + * @return bool + */ public function isCausedByLock(RepositorySet $repositorySet, Request $request, Pool $pool) { foreach ($this->reasons as $sectionRules) { @@ -153,6 +167,8 @@ public function isCausedByLock(RepositorySet $repositorySet, Request $request, P } } } + + return false; } /** @@ -160,6 +176,7 @@ public function isCausedByLock(RepositorySet $repositorySet, Request $request, P * * @param string $id A canonical identifier for the reason * @param Rule $reason The reason descriptor + * @return void */ protected function addReason($id, Rule $reason) { @@ -172,6 +189,9 @@ protected function addReason($id, Rule $reason) } } + /** + * @return void + */ public function nextSection() { $this->section++; @@ -179,8 +199,11 @@ public function nextSection() /** * @internal + * @param bool $isVerbose + * @param string $packageName + * @return array{0: string, 1: string} */ - public static function getMissingPackageReason(RepositorySet $repositorySet, Request $request, Pool $pool, $isVerbose, $packageName, $constraint = null) + public static function getMissingPackageReason(RepositorySet $repositorySet, Request $request, Pool $pool, $isVerbose, $packageName, ConstraintInterface $constraint = null) { // handle php/hhvm if ($packageName === 'php' || $packageName === 'php-64bit' || $packageName === 'hhvm') { @@ -273,7 +296,7 @@ public static function getMissingPackageReason(RepositorySet $repositorySet, Req if ($packages = $repositorySet->findPackages($packageName, $constraint, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES)) { // we must first verify if a valid package would be found in a lower priority repository if ($allReposPackages = $repositorySet->findPackages($packageName, $constraint, RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) { - return self::computeCheckForLowerPrioRepo($isVerbose, $packageName, $constraint, $packages, $allReposPackages, 'minimum-stability'); + return self::computeCheckForLowerPrioRepo($isVerbose, $packageName, $packages, $allReposPackages, 'minimum-stability', $constraint); } return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose).' but '.(self::hasMultipleNames($packages) ? 'these do' : 'it does').' not match your minimum-stability.'); @@ -283,7 +306,7 @@ public static function getMissingPackageReason(RepositorySet $repositorySet, Req if ($packages = $repositorySet->findPackages($packageName, null, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES)) { // we must first verify if a valid package would be found in a lower priority repository if ($allReposPackages = $repositorySet->findPackages($packageName, $constraint, RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) { - return self::computeCheckForLowerPrioRepo($isVerbose, $packageName, $constraint, $packages, $allReposPackages, 'constraint'); + return self::computeCheckForLowerPrioRepo($isVerbose, $packageName, $packages, $allReposPackages, 'constraint', $constraint); } $suffix = ''; @@ -331,6 +354,9 @@ public static function getMissingPackageReason(RepositorySet $repositorySet, Req /** * @internal + * @param PackageInterface[] $packages + * @param bool $isVerbose + * @return string */ public static function getPackageList(array $packages, $isVerbose) { @@ -360,6 +386,11 @@ public static function getPackageList(array $packages, $isVerbose) return implode(', ', $prepared); } + /** + * @param string $version + * @param string $packageName + * @return string + */ private static function getPlatformPackageVersion(Pool $pool, $packageName, $version) { $available = $pool->whatProvides($packageName); @@ -377,7 +408,9 @@ private static function getPlatformPackageVersion(Pool $pool, $packageName, $ver } /** - * @param string[] $versions an array of pretty versions, with normalized versions as keys + * @param string[] $versions an array of pretty versions, with normalized versions as keys + * @param int $max + * @param int $maxDev * @return list a list of pretty versions and '...' where versions were removed */ private static function condenseVersionList(array $versions, $max, $maxDev = 16) @@ -410,6 +443,10 @@ private static function condenseVersionList(array $versions, $max, $maxDev = 16) return $filtered; } + /** + * @param PackageInterface[] $packages + * @return bool + */ private static function hasMultipleNames(array $packages) { $name = null; @@ -424,7 +461,15 @@ private static function hasMultipleNames(array $packages) return false; } - private static function computeCheckForLowerPrioRepo($isVerbose, $packageName, $constraint, array $higherRepoPackages, array $allReposPackages, $reason) + /** + * @param bool $isVerbose + * @param string $packageName + * @param PackageInterface[] $higherRepoPackages + * @param PackageInterface[] $allReposPackages + * @param string $reason + * @return array{0: string, 1: string} + */ + private static function computeCheckForLowerPrioRepo($isVerbose, $packageName, array $higherRepoPackages, array $allReposPackages, $reason, ConstraintInterface $constraint = null) { $nextRepoPackages = array(); $nextRepo = null; @@ -461,10 +506,9 @@ private static function computeCheckForLowerPrioRepo($isVerbose, $packageName, $ /** * Turns a constraint into text usable in a sentence describing a request * - * @param ?ConstraintInterface $constraint * @return string */ - protected static function constraintToText($constraint) + protected static function constraintToText(ConstraintInterface $constraint = null) { return $constraint ? ' '.$constraint->getPrettyString() : ''; } diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Request.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Request.php index 3514bd4c8..3b680ad0b 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Request.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Request.php @@ -12,7 +12,7 @@ namespace Composer\DependencyResolver; -use Composer\Package\Package; +use Composer\Package\BasePackage; use Composer\Package\PackageInterface; use Composer\Repository\LockArrayRepository; use Composer\Semver\Constraint\ConstraintInterface; @@ -44,11 +44,11 @@ class Request protected $lockedRepository; /** @var array */ protected $requires = array(); - /** @var array */ + /** @var array */ protected $fixedPackages = array(); - /** @var array */ + /** @var array */ protected $lockedPackages = array(); - /** @var array */ + /** @var array */ protected $fixedLockedPackages = array(); /** @var string[] */ protected $updateAllowList = array(); @@ -60,6 +60,10 @@ public function __construct(LockArrayRepository $lockedRepository = null) $this->lockedRepository = $lockedRepository; } + /** + * @param string $packageName + * @return void + */ public function requireName($packageName, ConstraintInterface $constraint = null) { $packageName = strtolower($packageName); @@ -78,8 +82,10 @@ public function requireName($packageName, ConstraintInterface $constraint = null * * This is used for platform packages which cannot be modified by Composer. A rule enforcing their installation is * generated for dependency resolution. Partial updates with dependencies cannot in any way modify these packages. + * + * @return void */ - public function fixPackage(PackageInterface $package) + public function fixPackage(BasePackage $package) { $this->fixedPackages[spl_object_hash($package)] = $package; } @@ -93,8 +99,10 @@ public function fixPackage(PackageInterface $package) * However unlike fixed packages there will not be a special rule enforcing their installation for the solver, so * if nothing requires these packages they will be removed. Additionally in a partial update these packages can be * unlocked, meaning other versions can be installed if explicitly requested as part of the update. + * + * @return void */ - public function lockPackage(PackageInterface $package) + public function lockPackage(BasePackage $package) { $this->lockedPackages[spl_object_hash($package)] = $package; } @@ -105,71 +113,115 @@ public function lockPackage(PackageInterface $package) * This is necessary for the composer install step which verifies the lock file integrity and should not allow * removal of any packages. At the same time lock packages there cannot simply be marked fixed, as error reporting * would then report them as platform packages, so this still marks them as locked packages at the same time. + * + * @return void */ - public function fixLockedPackage(PackageInterface $package) + public function fixLockedPackage(BasePackage $package) { $this->fixedPackages[spl_object_hash($package)] = $package; $this->fixedLockedPackages[spl_object_hash($package)] = $package; } - public function unlockPackage(PackageInterface $package) + /** + * @return void + */ + public function unlockPackage(BasePackage $package) { unset($this->lockedPackages[spl_object_hash($package)]); } + /** + * @param string[] $updateAllowList + * @param false|self::UPDATE_* $updateAllowTransitiveDependencies + * @return void + */ public function setUpdateAllowList($updateAllowList, $updateAllowTransitiveDependencies) { $this->updateAllowList = $updateAllowList; $this->updateAllowTransitiveDependencies = $updateAllowTransitiveDependencies; } + /** + * @return string[] + */ public function getUpdateAllowList() { return $this->updateAllowList; } + /** + * @return bool + */ public function getUpdateAllowTransitiveDependencies() { return $this->updateAllowTransitiveDependencies !== self::UPDATE_ONLY_LISTED; } + /** + * @return bool + */ public function getUpdateAllowTransitiveRootDependencies() { return $this->updateAllowTransitiveDependencies === self::UPDATE_LISTED_WITH_TRANSITIVE_DEPS; } + /** + * @return array + */ public function getRequires() { return $this->requires; } + /** + * @return array + */ public function getFixedPackages() { return $this->fixedPackages; } - public function isFixedPackage(PackageInterface $package) + /** + * @return bool + */ + public function isFixedPackage(BasePackage $package) { return isset($this->fixedPackages[spl_object_hash($package)]); } + /** + * @return array + */ public function getLockedPackages() { return $this->lockedPackages; } + /** + * @return bool + */ public function isLockedPackage(PackageInterface $package) { return isset($this->lockedPackages[spl_object_hash($package)]) || isset($this->fixedLockedPackages[spl_object_hash($package)]); } + /** + * @return array + */ public function getFixedOrLockedPackages() { return array_merge($this->fixedPackages, $this->lockedPackages); } - // TODO look into removing the packageIds option, the only place true is used is for the installed map in the solver problems - // some locked packages may not be in the pool so they have a package->id of -1 + /** + * @param bool $packageIds + * @return array + * + * @TODO look into removing the packageIds option, the only place true is used + * is for the installed map in the solver problems. + * Some locked packages may not be in the pool, + * so they have a package->id of -1 + */ public function getPresentMap($packageIds = false) { $presentMap = array(); @@ -187,6 +239,9 @@ public function getPresentMap($packageIds = false) return $presentMap; } + /** + * @return BasePackage[] + */ public function getFixedPackagesMap() { $fixedPackagesMap = array(); @@ -198,6 +253,9 @@ public function getFixedPackagesMap() return $fixedPackagesMap; } + /** + * @return ?LockArrayRepository + */ public function getLockedRepository() { return $this->lockedRepository; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php index edc486496..bafd57994 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php @@ -12,11 +12,11 @@ namespace Composer\DependencyResolver; -use Composer\Package\Link; -use Composer\Package\BasePackage; use Composer\Package\AliasPackage; -use Composer\Repository\RepositorySet; +use Composer\Package\BasePackage; +use Composer\Package\Link; use Composer\Repository\PlatformRepository; +use Composer\Repository\RepositorySet; use Composer\Package\Version\VersionParser; use Composer\Semver\Constraint\Constraint; use Composer\Semver\Constraint\ConstraintInterface; @@ -54,8 +54,8 @@ abstract class Rule protected $reasonData; /** - * @param self::RULE_* $reason A RULE_* constant describing the reason for generating this rule - * @param Link|BasePackage|ConstraintInterface|string $reasonData + * @param self::RULE_* $reason A RULE_* constant describing the reason for generating this rule + * @param mixed $reasonData * * @phpstan-param ReasonData $reasonData */ @@ -68,26 +68,42 @@ public function __construct($reason, $reasonData) (255 << self::BITFIELD_TYPE); } + /** + * @return int[] + */ abstract public function getLiterals(); + /** + * @return int|string + */ abstract public function getHash(); abstract public function __toString(); + /** + * @param Rule $rule + * @return bool + */ abstract public function equals(Rule $rule); + /** + * @return int + */ public function getReason() { return ($this->bitfield & (255 << self::BITFIELD_REASON)) >> self::BITFIELD_REASON; } + /** + * @phpstan-return ReasonData + */ public function getReasonData() { return $this->reasonData; } /** - * @return ?string + * @return string|null */ public function getRequiredPackage() { @@ -108,38 +124,63 @@ public function getRequiredPackage() return null; } + /** + * @param RuleSet::TYPE_* $type + * @return void + */ public function setType($type) { $this->bitfield = ($this->bitfield & ~(255 << self::BITFIELD_TYPE)) | ((255 & $type) << self::BITFIELD_TYPE); } + /** + * @return int + */ public function getType() { return ($this->bitfield & (255 << self::BITFIELD_TYPE)) >> self::BITFIELD_TYPE; } + /** + * @return void + */ public function disable() { $this->bitfield = ($this->bitfield & ~(255 << self::BITFIELD_DISABLED)) | (1 << self::BITFIELD_DISABLED); } + /** + * @return void + */ public function enable() { $this->bitfield &= ~(255 << self::BITFIELD_DISABLED); } + /** + * @return bool + */ public function isDisabled() { return (bool) (($this->bitfield & (255 << self::BITFIELD_DISABLED)) >> self::BITFIELD_DISABLED); } + /** + * @return bool + */ public function isEnabled() { return !(($this->bitfield & (255 << self::BITFIELD_DISABLED)) >> self::BITFIELD_DISABLED); } + /** + * @return bool + */ abstract public function isAssertion(); + /** + * @return bool + */ public function isCausedByLock(RepositorySet $repositorySet, Request $request, Pool $pool) { if ($this->getReason() === self::RULE_PACKAGE_REQUIRES) { @@ -187,6 +228,12 @@ public function isCausedByLock(RepositorySet $repositorySet, Request $request, P return false; } + /** + * @param bool $isVerbose + * @param BasePackage[] $installedMap + * @param array $learnedPool + * @return string + */ public function getPrettyString(RepositorySet $repositorySet, Request $request, Pool $pool, $isVerbose, array $installedMap = array(), array $learnedPool = array()) { $literals = $this->getLiterals(); @@ -396,12 +443,11 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, } /** - * @param Pool $pool - * @param array $packages - * + * @param array $packages An array containing packages or literals + * @param bool $isVerbose * @return string */ - protected function formatPackagesUnique($pool, array $packages, $isVerbose) + protected function formatPackagesUnique(Pool $pool, array $packages, $isVerbose) { foreach ($packages as $index => $package) { if (!\is_object($package)) { @@ -412,6 +458,9 @@ protected function formatPackagesUnique($pool, array $packages, $isVerbose) return Problem::getPackageList($packages, $isVerbose); } + /** + * @return BasePackage + */ private function deduplicateDefaultBranchAlias(BasePackage $package) { if ($package instanceof AliasPackage && $package->getPrettyVersion() === VersionParser::DEFAULT_BRANCH_ALIAS) { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule2Literals.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule2Literals.php index 6a4c599ce..cf5e20792 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule2Literals.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule2Literals.php @@ -12,11 +12,9 @@ namespace Composer\DependencyResolver; -use Composer\Package\BasePackage; -use Composer\Package\Link; - /** * @author Nils Adermann + * @phpstan-import-type ReasonData from Rule */ class Rule2Literals extends Rule { @@ -26,8 +24,12 @@ class Rule2Literals extends Rule protected $literal2; /** - * @param int $literal1 - * @param int $literal2 + * @param int $literal1 + * @param int $literal2 + * @param Rule::RULE_* $reason A RULE_* constant + * @param mixed $reasonData + * + * @phpstan-param ReasonData $reasonData */ public function __construct($literal1, $literal2, $reason, $reasonData) { @@ -48,7 +50,9 @@ public function getLiterals() return array($this->literal1, $this->literal2); } - /** @return string */ + /** + * @inheritDoc + */ public function getHash() { return $this->literal1.','.$this->literal2; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php index ba9aeaee2..b754046a6 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php @@ -32,9 +32,8 @@ class RuleSet implements \IteratorAggregate, \Countable */ public $ruleById = array(); - /** @var array<255|0|1|4, string> */ + /** @var array<0|1|4, string> */ protected static $types = array( - 255 => 'UNKNOWN', self::TYPE_PACKAGE => 'PACKAGE', self::TYPE_REQUEST => 'REQUEST', self::TYPE_LEARNED => 'LEARNED', @@ -56,6 +55,10 @@ public function __construct() } } + /** + * @param self::TYPE_* $type + * @return void + */ public function add(Rule $rule, $type) { if (!isset(self::$types[$type])) { @@ -100,12 +103,19 @@ public function add(Rule $rule, $type) } } + /** + * @return int + */ #[\ReturnTypeWillChange] public function count() { return $this->nextRuleId; } + /** + * @param int $id + * @return Rule + */ public function ruleById($id) { return $this->ruleById[$id]; @@ -148,6 +158,10 @@ public function getIteratorFor($types) return new RuleSetIterator($rules); } + /** + * @param array|self::TYPE_* $types + * @return RuleSetIterator + */ public function getIteratorWithout($types) { if (!\is_array($types)) { @@ -167,11 +181,14 @@ public function getIteratorWithout($types) public function getTypes() { $types = self::$types; - unset($types[255]); return array_keys($types); } + /** + * @param bool $isVerbose + * @return string + */ public function getPrettyString(RepositorySet $repositorySet = null, Request $request = null, Pool $pool = null, $isVerbose = false) { $string = "\n"; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php index 245f1fdda..e20a6299e 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php @@ -14,7 +14,6 @@ use Composer\Package\BasePackage; use Composer\Package\AliasPackage; -use Composer\Package\PackageInterface; use Composer\Repository\PlatformRepository; /** @@ -29,9 +28,9 @@ class RuleSetGenerator protected $pool; /** @var RuleSet */ protected $rules; - /** @var array */ + /** @var array */ protected $addedMap = array(); - /** @var array */ + /** @var array */ protected $addedPackagesByNames = array(); public function __construct(PolicyInterface $policy, Pool $pool) @@ -47,13 +46,11 @@ public function __construct(PolicyInterface $policy, Pool $pool) * This rule is of the form (-A|B|C), where B and C are the providers of * one requirement of the package A. * - * @param BasePackage $package The package with a requirement - * @param array $providers The providers of the requirement - * @param Rule::RULE_* $reason A RULE_* constant describing the - * reason for generating this rule - * @param mixed $reasonData Any data, e.g. the requirement name, - * that goes with the reason - * @return Rule|null The generated rule or null if tautological + * @param BasePackage $package The package with a requirement + * @param BasePackage[] $providers The providers of the requirement + * @param Rule::RULE_* $reason A RULE_* constant describing the reason for generating this rule + * @param mixed $reasonData Any data, e.g. the requirement name, that goes with the reason + * @return Rule|null The generated rule or null if tautological * * @phpstan-param ReasonData $reasonData */ @@ -102,13 +99,11 @@ protected function createInstallOneOfRule(array $packages, $reason, $reasonData) * The rule for conflicting packages A and B is (-A|-B). A is called the issuer * and B the provider. * - * @param BasePackage $issuer The package declaring the conflict - * @param BasePackage $provider The package causing the conflict - * @param Rule::RULE_* $reason A RULE_* constant describing the - * reason for generating this rule - * @param mixed $reasonData Any data, e.g. the package name, that - * goes with the reason - * @return Rule|null The generated rule + * @param BasePackage $issuer The package declaring the conflict + * @param BasePackage $provider The package causing the conflict + * @param Rule::RULE_* $reason A RULE_* constant describing the reason for generating this rule + * @param mixed $reasonData Any data, e.g. the package name, that goes with the reason + * @return ?Rule The generated rule * * @phpstan-param ReasonData $reasonData */ @@ -122,7 +117,15 @@ protected function createRule2Literals(BasePackage $issuer, BasePackage $provide return new Rule2Literals(-$issuer->id, -$provider->id, $reason, $reasonData); } - protected function createMultiConflictRule(array $packages, $reason, $reasonData = null) + /** + * @param BasePackage[] $packages + * @param Rule::RULE_* $reason A RULE_* constant + * @param mixed $reasonData + * @return Rule + * + * @phpstan-param ReasonData $reasonData + */ + protected function createMultiConflictRule(array $packages, $reason, $reasonData) { $literals = array(); foreach ($packages as $package) { @@ -142,8 +145,10 @@ protected function createMultiConflictRule(array $packages, $reason, $reasonData * To be able to directly pass in the result of one of the rule creation * methods null is allowed which will not insert a rule. * - * @param int $type A TYPE_* constant defining the rule type + * @param RuleSet::TYPE_* $type A TYPE_* constant defining the rule type * @param Rule $newRule The rule about to be added + * + * @return void */ private function addRule($type, Rule $newRule = null) { @@ -154,6 +159,10 @@ private function addRule($type, Rule $newRule = null) $this->rules->add($newRule, $type); } + /** + * @param bool|string[] $ignorePlatformReqs + * @return void + */ protected function addRulesForPackage(BasePackage $package, $ignorePlatformReqs) { /** @var \SplQueue */ @@ -202,6 +211,10 @@ protected function addRulesForPackage(BasePackage $package, $ignorePlatformReqs) } } + /** + * @param bool|string[] $ignorePlatformReqs + * @return void + */ protected function addConflictRules($ignorePlatformReqs = false) { /** @var BasePackage $package */ @@ -237,6 +250,10 @@ protected function addConflictRules($ignorePlatformReqs = false) } } + /** + * @param bool|string[] $ignorePlatformReqs + * @return void + */ protected function addRulesForRequest(Request $request, $ignorePlatformReqs) { foreach ($request->getFixedPackages() as $package) { @@ -278,6 +295,10 @@ protected function addRulesForRequest(Request $request, $ignorePlatformReqs) } } + /** + * @param bool|string[] $ignorePlatformReqs + * @return void + */ protected function addRulesForRootAliases($ignorePlatformReqs) { foreach ($this->pool->getPackages() as $package) { @@ -294,7 +315,8 @@ protected function addRulesForRootAliases($ignorePlatformReqs) } /** - * @param bool|array $ignorePlatformReqs + * @param bool|string[] $ignorePlatformReqs + * @return RuleSet */ public function getRulesFor(Request $request, $ignorePlatformReqs = false) { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php index 2726253d2..1450c1cba 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php @@ -42,18 +42,27 @@ public function __construct(array $rules) $this->rewind(); } + /** + * @return Rule + */ #[\ReturnTypeWillChange] public function current() { return $this->rules[$this->currentType][$this->currentOffset]; } + /** + * @return RuleSet::TYPE_*|-1 + */ #[\ReturnTypeWillChange] public function key() { return $this->currentType; } + /** + * @return void + */ #[\ReturnTypeWillChange] public function next() { @@ -79,6 +88,9 @@ public function next() } } + /** + * @return void + */ #[\ReturnTypeWillChange] public function rewind() { @@ -99,6 +111,9 @@ public function rewind() } while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType])); } + /** + * @return bool + */ #[\ReturnTypeWillChange] public function valid() { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchChain.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchChain.php index 52795ea89..a03aaf2f6 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchChain.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchChain.php @@ -27,6 +27,7 @@ class RuleWatchChain extends \SplDoublyLinkedList * Moves the internal iterator to the specified offset * * @param int $offset The offset to seek to. + * @return void */ public function seek($offset) { @@ -41,6 +42,8 @@ public function seek($offset) * incorrectly sets the internal iterator if you delete the current value * this method sets the internal iterator back to the following element * using the seek method. + * + * @return void */ public function remove() { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php index 76b6abb55..e9e3caa17 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php @@ -38,6 +38,7 @@ class RuleWatchGraph * watch changes in any literals. * * @param RuleWatchNode $node The rule node to be inserted into the graph + * @return void */ public function insert(RuleWatchNode $node) { @@ -87,7 +88,7 @@ public function insert(RuleWatchNode $node) * register decisions resulting from propagation * @return Rule|null If a conflict is found the conflicting rule is returned */ - public function propagateLiteral($decidedLiteral, $level, $decisions) + public function propagateLiteral($decidedLiteral, $level, Decisions $decisions) { // we invert the decided literal here, example: // A was decided => (-A|B) now requires B to be true, so we look for @@ -153,6 +154,7 @@ public function propagateLiteral($decidedLiteral, $level, $decisions) * @param int $fromLiteral A literal the node used to watch * @param int $toLiteral A literal the node should watch now * @param RuleWatchNode $node The rule node to be moved + * @return void */ protected function moveWatch($fromLiteral, $toLiteral, RuleWatchNode $node) { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php index 24fccd8d3..a0abf254d 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php @@ -52,6 +52,7 @@ public function __construct(Rule $rule) * likely to quickly lead to further decisions. * * @param Decisions $decisions The decisions made so far by the solver + * @return void */ public function watch2OnHighest(Decisions $decisions) { @@ -104,6 +105,7 @@ public function getOtherWatch($literal) * * @param int $from The previously watched literal * @param int $to The literal to be watched now + * @return void */ public function moveWatch($from, $to) { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php index 7454ea74e..c8979748b 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php @@ -13,7 +13,7 @@ namespace Composer\DependencyResolver; use Composer\IO\IOInterface; -use Composer\Package\PackageInterface; +use Composer\Package\BasePackage; use Composer\Repository\PlatformRepository; /** @@ -36,7 +36,7 @@ class Solver protected $watchGraph; /** @var Decisions */ protected $decisions; - /** @var PackageInterface[] */ + /** @var BasePackage[] */ protected $fixedMap; /** @var int */ @@ -56,11 +56,6 @@ class Solver /** @var IOInterface */ protected $io; - /** - * @param PolicyInterface $policy - * @param Pool $pool - * @param IOInterface $io - */ public function __construct(PolicyInterface $policy, Pool $pool, IOInterface $io) { $this->io = $io; @@ -76,6 +71,9 @@ public function getRuleSetSize() return \count($this->rules); } + /** + * @return Pool + */ public function getPool() { return $this->pool; @@ -83,6 +81,9 @@ public function getPool() // aka solver_makeruledecisions + /** + * @return void + */ private function makeAssertionRuleDecisions() { $decisionStart = \count($this->decisions) - 1; @@ -153,6 +154,9 @@ private function makeAssertionRuleDecisions() } } + /** + * @return void + */ protected function setupFixedMap(Request $request) { $this->fixedMap = array(); @@ -162,8 +166,8 @@ protected function setupFixedMap(Request $request) } /** - * @param Request $request - * @param bool|array $ignorePlatformReqs + * @param bool|string[] $ignorePlatformReqs + * @return void */ protected function checkForRootRequireProblems(Request $request, $ignorePlatformReqs) { @@ -181,8 +185,7 @@ protected function checkForRootRequireProblems(Request $request, $ignorePlatform } /** - * @param Request $request - * @param bool|array $ignorePlatformReqs + * @param bool|string[] $ignorePlatformReqs * @return LockTransaction */ public function solve(Request $request, $ignorePlatformReqs = false) @@ -251,6 +254,8 @@ protected function propagate($level) * Reverts a decision at the given level. * * @param int $level + * + * @return void */ private function revert($level) { @@ -291,7 +296,6 @@ private function revert($level) * * @param int $level * @param string|int $literal - * @param Rule $rule * @return int */ private function setPropagateLearn($level, $literal, Rule $rule) @@ -319,11 +323,6 @@ private function setPropagateLearn($level, $literal, Rule $rule) "Trying to revert to invalid level ".(int) $newLevel." from level ".(int) $level."." ); } - if (!$newRule) { - throw new SolverBugException( - "No rule was learned from analyzing $rule at level $level." - ); - } $level = $newLevel; @@ -345,8 +344,7 @@ private function setPropagateLearn($level, $literal, Rule $rule) /** * @param int $level - * @param array $decisionQueue - * @param Rule $rule + * @param int[] $decisionQueue * @return int */ private function selectAndInstall($level, array $decisionQueue, Rule $rule) @@ -366,8 +364,7 @@ private function selectAndInstall($level, array $decisionQueue, Rule $rule) /** * @param int $level - * @param Rule $rule - * @return array + * @return array{int, int, GenericRule, int} */ protected function analyze($level, Rule $rule) { @@ -513,6 +510,10 @@ protected function analyze($level, Rule $rule) return array($learnedLiterals[0], $ruleLevel, $newRule, $why); } + /** + * @param array $ruleSeen + * @return void + */ private function analyzeUnsolvableRule(Problem $problem, Rule $conflictRule, array &$ruleSeen) { $why = spl_object_hash($conflictRule); @@ -541,7 +542,6 @@ private function analyzeUnsolvableRule(Problem $problem, Rule $conflictRule, arr } /** - * @param Rule $conflictRule * @return int */ private function analyzeUnsolvable(Rule $conflictRule) @@ -599,6 +599,8 @@ private function analyzeUnsolvable(Rule $conflictRule) * we have enabled or disabled some of our rules. We now re-enable all * of our learnt rules except the ones that were learnt from rules that * are now disabled. + * + * @return void */ private function enableDisableLearnedRules() { @@ -622,6 +624,9 @@ private function enableDisableLearnedRules() } } + /** + * @return void + */ private function runSat() { $this->propagateIndex = 0; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverBugException.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverBugException.php index 6920411f5..31932a265 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverBugException.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverBugException.php @@ -17,6 +17,9 @@ */ class SolverBugException extends \RuntimeException { + /** + * @param string $message + */ public function __construct($message) { parent::__construct( diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php index 93eab3e63..d332fee58 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php @@ -14,20 +14,21 @@ use Composer\Util\IniHelper; use Composer\Repository\RepositorySet; -use Composer\Package\PackageInterface; /** * @author Nils Adermann */ class SolverProblemsException extends \RuntimeException { + const ERROR_DEPENDENCY_RESOLUTION_FAILED = 2; + /** @var Problem[] */ protected $problems; /** @var array */ protected $learnedPool; /** - * @param Problem[] $problems + * @param Problem[] $problems * @param array $learnedPool */ public function __construct(array $problems, array $learnedPool) @@ -35,9 +36,14 @@ public function __construct(array $problems, array $learnedPool) $this->problems = $problems; $this->learnedPool = $learnedPool; - parent::__construct('Failed resolving dependencies with '.count($problems).' problems, call getPrettyString to get formatted details', 2); + parent::__construct('Failed resolving dependencies with '.count($problems).' problems, call getPrettyString to get formatted details', self::ERROR_DEPENDENCY_RESOLUTION_FAILED); } + /** + * @param bool $isVerbose + * @param bool $isDevExtraction + * @return string + */ public function getPrettyString(RepositorySet $repositorySet, Request $request, Pool $pool, $isVerbose, $isDevExtraction = false) { $installedMap = $request->getPresentMap(true); @@ -52,7 +58,7 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, $hasExtensionProblems = true; } - $isCausedByLock |= $problem->isCausedByLock($repositorySet, $request, $pool); + $isCausedByLock = $isCausedByLock || $problem->isCausedByLock($repositorySet, $request, $pool); } $i = 1; @@ -91,11 +97,17 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, return $text; } + /** + * @return Problem[] + */ public function getProblems() { return $this->problems; } + /** + * @return string + */ private function createExtensionHint() { $paths = IniHelper::getAll(); @@ -111,6 +123,10 @@ private function createExtensionHint() return $text; } + /** + * @param Rule[][] $reasonSets + * @return bool + */ private function hasExtensionProblems(array $reasonSets) { foreach ($reasonSets as $reasonSet) { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php index 1cda16927..ef9c74174 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php @@ -46,6 +46,10 @@ class Transaction */ protected $resultPackagesByName = array(); + /** + * @param PackageInterface[] $presentPackages + * @param PackageInterface[] $resultPackages + */ public function __construct($presentPackages, $resultPackages) { $this->presentPackages = $presentPackages; @@ -53,12 +57,18 @@ public function __construct($presentPackages, $resultPackages) $this->operations = $this->calculateOperations(); } - /** @return OperationInterface[] */ + /** + * @return OperationInterface[] + */ public function getOperations() { return $this->operations; } + /** + * @param PackageInterface[] $resultPackages + * @return void + */ private function setResultPackageMaps($resultPackages) { $packageSort = function (PackageInterface $a, PackageInterface $b) { @@ -88,6 +98,9 @@ private function setResultPackageMaps($resultPackages) } } + /** + * @return OperationInterface[] + */ protected function calculateOperations() { $operations = array(); @@ -228,6 +241,9 @@ protected function getRootPackages() return $roots; } + /** + * @return PackageInterface[] + */ protected function getProvidersInResult(Link $link) { if (!isset($this->resultPackagesByName[$link->getTarget()])) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/ArchiveDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/ArchiveDownloader.php index f3e444d59..570de63d8 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/ArchiveDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/ArchiveDownloader.php @@ -27,7 +27,38 @@ abstract class ArchiveDownloader extends FileDownloader { /** - * {@inheritDoc} + * @var array + * @protected + */ + public $cleanupExecuted = array(); + + /** + * @return PromiseInterface|null + */ + public function prepare($type, PackageInterface $package, $path, PackageInterface $prevPackage = null) + { + unset($this->cleanupExecuted[$package->getName()]); + + return parent::prepare($type, $package, $path, $prevPackage); + } + + /** + * @return PromiseInterface|null + */ + public function cleanup($type, PackageInterface $package, $path, PackageInterface $prevPackage = null) + { + $this->cleanupExecuted[$package->getName()] = true; + + return parent::cleanup($type, $package, $path, $prevPackage); + } + + /** + * @inheritDoc + * + * @param bool $output + * + * @return PromiseInterface + * * @throws \RuntimeException * @throws \UnexpectedValueException */ @@ -184,7 +215,7 @@ public function install(PackageInterface $package, $path, $output = true) } /** - * {@inheritDoc} + * @inheritDoc */ protected function getInstallOperationAppendix(PackageInterface $package, $path) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php b/app/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php index 7616229cb..fe737d1b5 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php @@ -81,7 +81,8 @@ public function setPreferDist($preferDist) /** * Sets fine tuned preference settings for package level source/dist selection. * - * @param array $preferences array of preferences by package patterns + * @param array $preferences array of preferences by package patterns + * * @return DownloadManager */ public function setPreferences(array $preferences) @@ -163,6 +164,9 @@ public function getDownloaderForPackage(PackageInterface $package) return $downloader; } + /** + * @return string + */ public function getDownloaderType(DownloaderInterface $downloader) { return array_search($downloader, $this->downloaders); @@ -450,6 +454,8 @@ private function getAvailableSources(PackageInterface $package, PackageInterface * * If any Installer provides a path with a trailing slash, this can cause bugs so make sure we remove them * + * @param string $dir + * * @return string */ private function normalizeTargetDir($dir) diff --git a/app/vendor/composer/composer/src/Composer/Downloader/DownloaderInterface.php b/app/vendor/composer/composer/src/Composer/Downloader/DownloaderInterface.php index ef2357958..b19f902a8 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/DownloaderInterface.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/DownloaderInterface.php @@ -33,6 +33,7 @@ public function getInstallationSource(); /** * This should do any network-related tasks to prepare for an upcoming install/update * + * @param string $path download path * @return PromiseInterface|null */ public function download(PackageInterface $package, $path, PackageInterface $prevPackage = null); diff --git a/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php index e915d6995..feefe6421 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php @@ -57,6 +57,13 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface protected $eventDispatcher; /** @var ProcessExecutor */ protected $process; + /** + * @var array + * @private + * @internal + */ + public static $downloadMetadata = array(); + /** * @private this is only public for php 5.3 support in closures * @@ -88,12 +95,12 @@ public function __construct(IOInterface $io, Config $config, HttpDownloader $htt if ($this->cache && $this->cache->gcIsNecessary()) { $this->io->writeError('Running cache garbage collection', true, IOInterface::VERY_VERBOSE); - $this->cache->gc($config->get('cache-files-ttl'), $config->get('cache-files-maxsize')); + $this->cache->gc((int) $config->get('cache-files-ttl'), (int) $config->get('cache-files-maxsize')); } } /** - * {@inheritDoc} + * @inheritDoc */ public function getInstallationSource() { @@ -101,7 +108,9 @@ public function getInstallationSource() } /** - * {@inheritDoc} + * @inheritDoc + * + * @param bool $output */ public function download(PackageInterface $package, $path, PackageInterface $prevPackage = null, $output = true) { @@ -216,6 +225,7 @@ public function download(PackageInterface $package, $path, PackageInterface $pre $accept = function ($response) use ($cache, $package, $fileName, $self, &$urls) { $url = reset($urls); $cacheKey = $url['cacheKey']; + FileDownloader::$downloadMetadata[$package->getName()] = @filesize($fileName) ?: $response->getHeader('Content-Length') ?: '?'; if ($cache && !$cache->isReadOnly()) { $self->lastCacheWrites[$package->getName()] = $cacheKey; @@ -284,7 +294,7 @@ public function download(PackageInterface $package, $path, PackageInterface $pre } /** - * {@inheritDoc} + * @inheritDoc */ public function prepare($type, PackageInterface $package, $path, PackageInterface $prevPackage = null) { @@ -292,7 +302,7 @@ public function prepare($type, PackageInterface $package, $path, PackageInterfac } /** - * {@inheritDoc} + * @inheritDoc */ public function cleanup($type, PackageInterface $package, $path, PackageInterface $prevPackage = null) { @@ -323,7 +333,9 @@ public function cleanup($type, PackageInterface $package, $path, PackageInterfac } /** - * {@inheritDoc} + * @inheritDoc + * + * @param bool $output */ public function install(PackageInterface $package, $path, $output = true) { @@ -351,6 +363,8 @@ public function install(PackageInterface $package, $path, $output = true) /** * TODO mark private in v3 * @protected This is public due to PHP 5.3 + * + * @return void */ public function clearLastCacheWrite(PackageInterface $package) { @@ -363,6 +377,10 @@ public function clearLastCacheWrite(PackageInterface $package) /** * TODO mark private in v3 * @protected This is public due to PHP 5.3 + * + * @param string $path + * + * @return void */ public function addCleanupPath(PackageInterface $package, $path) { @@ -372,6 +390,10 @@ public function addCleanupPath(PackageInterface $package, $path) /** * TODO mark private in v3 * @protected This is public due to PHP 5.3 + * + * @param string $path + * + * @return void */ public function removeCleanupPath(PackageInterface $package, $path) { @@ -384,7 +406,7 @@ public function removeCleanupPath(PackageInterface $package, $path) } /** - * {@inheritDoc} + * @inheritDoc */ public function update(PackageInterface $initial, PackageInterface $target, $path) { @@ -405,7 +427,9 @@ public function update(PackageInterface $initial, PackageInterface $target, $pat } /** - * {@inheritDoc} + * @inheritDoc + * + * @param bool $output */ public function remove(PackageInterface $package, $path, $output = true) { @@ -467,7 +491,7 @@ protected function processUrl(PackageInterface $package, $url) } /** - * {@inheritDoc} + * @inheritDoc * @throws \RuntimeException */ public function getLocalChanges(PackageInterface $package, $targetDir) diff --git a/app/vendor/composer/composer/src/Composer/Downloader/FilesystemException.php b/app/vendor/composer/composer/src/Composer/Downloader/FilesystemException.php index 891ab5e4b..f297e4b98 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/FilesystemException.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/FilesystemException.php @@ -19,6 +19,11 @@ */ class FilesystemException extends \Exception { + /** + * @param string $message + * @param int $code + * @param \Exception|null $previous + */ public function __construct($message = '', $code = 0, \Exception $previous = null) { parent::__construct("Filesystem exception: \n".$message, $code, $previous); diff --git a/app/vendor/composer/composer/src/Composer/Downloader/FossilDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/FossilDownloader.php index d96c4f4ff..ccef029f6 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/FossilDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/FossilDownloader.php @@ -21,7 +21,7 @@ class FossilDownloader extends VcsDownloader { /** - * {@inheritDoc} + * @inheritDoc */ protected function doDownload(PackageInterface $package, $path, $url, PackageInterface $prevPackage = null) { @@ -29,7 +29,7 @@ protected function doDownload(PackageInterface $package, $path, $url, PackageInt } /** - * {@inheritDoc} + * @inheritDoc */ protected function doInstall(PackageInterface $package, $path, $url) { @@ -57,7 +57,7 @@ protected function doInstall(PackageInterface $package, $path, $url) } /** - * {@inheritDoc} + * @inheritDoc */ protected function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url) { @@ -80,7 +80,7 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target, } /** - * {@inheritDoc} + * @inheritDoc */ public function getLocalChanges(PackageInterface $package, $path) { @@ -94,7 +94,7 @@ public function getLocalChanges(PackageInterface $package, $path) } /** - * {@inheritDoc} + * @inheritDoc */ protected function getCommitLogs($fromReference, $toReference, $path) { @@ -118,7 +118,7 @@ protected function getCommitLogs($fromReference, $toReference, $path) } /** - * {@inheritDoc} + * @inheritDoc */ protected function hasMetadataRepository($path) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php index f8e157894..3a9e94427 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php @@ -21,6 +21,7 @@ use Composer\Util\Platform; use Composer\Util\ProcessExecutor; use Composer\Cache; +use React\Promise\PromiseInterface; /** * @author Jordi Boggiano @@ -54,7 +55,7 @@ public function __construct(IOInterface $io, Config $config, ProcessExecutor $pr } /** - * {@inheritDoc} + * @inheritDoc */ protected function doDownload(PackageInterface $package, $path, $url, PackageInterface $prevPackage = null) { @@ -79,7 +80,7 @@ protected function doDownload(PackageInterface $package, $path, $url, PackageInt } /** - * {@inheritDoc} + * @inheritDoc */ protected function doInstall(PackageInterface $package, $path, $url) { @@ -119,8 +120,9 @@ protected function doInstall(PackageInterface $package, $path, $url) }; $this->gitUtil->runCommand($commandCallable, $url, $path, true); - if ($url !== $package->getSourceUrl()) { - $this->updateOriginUrl($path, $package->getSourceUrl()); + $sourceUrl = $package->getSourceUrl(); + if ($url !== $sourceUrl && $sourceUrl !== null) { + $this->updateOriginUrl($path, $sourceUrl); } else { $this->setPushUrl($path, $url); } @@ -136,7 +138,7 @@ protected function doInstall(PackageInterface $package, $path, $url) } /** - * {@inheritDoc} + * @inheritDoc */ protected function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url) { @@ -193,7 +195,7 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target, $updateOriginUrl = true; } } - if ($updateOriginUrl) { + if ($updateOriginUrl && $target->getSourceUrl() !== null) { $this->updateOriginUrl($path, $target->getSourceUrl()); } @@ -201,7 +203,7 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target, } /** - * {@inheritDoc} + * @inheritDoc */ public function getLocalChanges(PackageInterface $package, $path) { @@ -218,6 +220,9 @@ public function getLocalChanges(PackageInterface $package, $path) return trim($output) ?: null; } + /** + * @return null|string + */ public function getUnpushedChanges(PackageInterface $package, $path) { GitUtil::cleanEnv(); @@ -313,7 +318,7 @@ public function getUnpushedChanges(PackageInterface $package, $path) } /** - * {@inheritDoc} + * @inheritDoc */ protected function cleanChanges(PackageInterface $package, $path, $update) { @@ -326,7 +331,7 @@ protected function cleanChanges(PackageInterface $package, $path, $update) } if (!$changes = $this->getLocalChanges($package, $path)) { - return; + return \React\Promise\resolve(); } if (!$this->io->isInteractive()) { @@ -395,10 +400,12 @@ protected function cleanChanges(PackageInterface $package, $path, $update) break; } } + + return \React\Promise\resolve(); } /** - * {@inheritDoc} + * @inheritDoc */ protected function reapplyChanges($path) { @@ -482,12 +489,24 @@ protected function updateToCommit($path, $reference, $branch, $date) throw new \RuntimeException(Url::sanitize('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput())); } + /** + * @param string $path + * @param string $url + * + * @return void + */ protected function updateOriginUrl($path, $url) { $this->process->execute(sprintf('git remote set-url origin -- %s', ProcessExecutor::escape($url)), $output, $path); $this->setPushUrl($path, $url); } + /** + * @param string $path + * @param string $url + * + * @return void + */ protected function setPushUrl($path, $url) { // set push url for github projects @@ -503,7 +522,7 @@ protected function setPushUrl($path, $url) } /** - * {@inheritDoc} + * @inheritDoc */ protected function getCommitLogs($fromReference, $toReference, $path) { @@ -518,7 +537,10 @@ protected function getCommitLogs($fromReference, $toReference, $path) } /** - * @param string $path + * @param string $path + * + * @return PromiseInterface + * * @throws \RuntimeException */ protected function discardChanges($path) @@ -529,10 +551,15 @@ protected function discardChanges($path) } $this->hasDiscardedChanges[$path] = true; + + return \React\Promise\resolve(); } /** - * @param string $path + * @param string $path + * + * @return PromiseInterface + * * @throws \RuntimeException */ protected function stashChanges($path) @@ -543,10 +570,15 @@ protected function stashChanges($path) } $this->hasStashedChanges[$path] = true; + + return \React\Promise\resolve(); } /** - * @param string $path + * @param string $path + * + * @return void + * * @throws \RuntimeException */ protected function viewDiff($path) @@ -559,6 +591,11 @@ protected function viewDiff($path) $this->io->writeError($output); } + /** + * @param string $path + * + * @return string + */ protected function normalizePath($path) { if (Platform::isWindows() && strlen($path) > 0) { @@ -581,7 +618,7 @@ protected function normalizePath($path) } /** - * {@inheritDoc} + * @inheritDoc */ protected function hasMetadataRepository($path) { @@ -590,6 +627,10 @@ protected function hasMetadataRepository($path) return is_dir($path.'/.git'); } + /** + * @param string $reference + * @return string + */ protected function getShortHash($reference) { if (!$this->io->isVerbose() && preg_match('{^[0-9a-f]{40}$}', $reference)) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/GzipDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/GzipDownloader.php index df0cc908e..8b5caf474 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/GzipDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/GzipDownloader.php @@ -53,6 +53,12 @@ protected function extract(PackageInterface $package, $file, $path) return \React\Promise\resolve(); } + /** + * @param string $file + * @param string $targetFilepath + * + * @return void + */ private function extractUsingExt($file, $targetFilepath) { $archiveFile = gzopen($file, 'rb'); diff --git a/app/vendor/composer/composer/src/Composer/Downloader/HgDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/HgDownloader.php index f68ed8c8f..45b0e2874 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/HgDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/HgDownloader.php @@ -22,7 +22,7 @@ class HgDownloader extends VcsDownloader { /** - * {@inheritDoc} + * @inheritDoc */ protected function doDownload(PackageInterface $package, $path, $url, PackageInterface $prevPackage = null) { @@ -34,7 +34,7 @@ protected function doDownload(PackageInterface $package, $path, $url, PackageInt } /** - * {@inheritDoc} + * @inheritDoc */ protected function doInstall(PackageInterface $package, $path, $url) { @@ -56,7 +56,7 @@ protected function doInstall(PackageInterface $package, $path, $url) } /** - * {@inheritDoc} + * @inheritDoc */ protected function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url) { @@ -79,7 +79,7 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target, } /** - * {@inheritDoc} + * @inheritDoc */ public function getLocalChanges(PackageInterface $package, $path) { @@ -93,7 +93,7 @@ public function getLocalChanges(PackageInterface $package, $path) } /** - * {@inheritDoc} + * @inheritDoc */ protected function getCommitLogs($fromReference, $toReference, $path) { @@ -107,7 +107,7 @@ protected function getCommitLogs($fromReference, $toReference, $path) } /** - * {@inheritDoc} + * @inheritDoc */ protected function hasMetadataRepository($path) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php index be1b1262d..ffaed5515 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php @@ -36,7 +36,7 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter const STRATEGY_MIRROR = 20; /** - * {@inheritdoc} + * @inheritDoc */ public function download(PackageInterface $package, $path, PackageInterface $prevPackage = null, $output = true) { @@ -72,7 +72,7 @@ public function download(PackageInterface $package, $path, PackageInterface $pre } /** - * {@inheritdoc} + * @inheritDoc */ public function install(PackageInterface $package, $path, $output = true) { @@ -158,7 +158,7 @@ public function install(PackageInterface $package, $path, $output = true) } /** - * {@inheritDoc} + * @inheritDoc */ public function remove(PackageInterface $package, $path, $output = true) { @@ -203,7 +203,7 @@ public function remove(PackageInterface $package, $path, $output = true) } /** - * {@inheritDoc} + * @inheritDoc */ public function getVcsReference(PackageInterface $package, $path) { @@ -221,7 +221,7 @@ public function getVcsReference(PackageInterface $package, $path) } /** - * {@inheritDoc} + * @inheritDoc */ protected function getInstallOperationAppendix(PackageInterface $package, $path) { @@ -244,6 +244,11 @@ protected function getInstallOperationAppendix(PackageInterface $package, $path) return ': Mirroring from '.$package->getDistUrl(); } + /** + * @param mixed[] $transportOptions + * + * @phpstan-return array{self::STRATEGY_*, non-empty-list} + */ private function computeAllowedStrategies(array $transportOptions) { // When symlink transport option is null, both symlink and mirror are allowed diff --git a/app/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php index dc30f8361..0c0c5d74d 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php @@ -25,7 +25,7 @@ class PerforceDownloader extends VcsDownloader protected $perforce; /** - * {@inheritDoc} + * @inheritDoc */ protected function doDownload(PackageInterface $package, $path, $url, PackageInterface $prevPackage = null) { @@ -33,12 +33,12 @@ protected function doDownload(PackageInterface $package, $path, $url, PackageInt } /** - * {@inheritDoc} + * @inheritDoc */ public function doInstall(PackageInterface $package, $path, $url) { $ref = $package->getSourceReference(); - $label = $this->getLabelFromSourceReference($ref); + $label = $this->getLabelFromSourceReference((string) $ref); $this->io->writeError('Cloning ' . $ref); $this->initPerforce($package, $path, $url); @@ -52,6 +52,11 @@ public function doInstall(PackageInterface $package, $path, $url) return \React\Promise\resolve(); } + /** + * @param string $ref + * + * @return string|null + */ private function getLabelFromSourceReference($ref) { $pos = strpos($ref, '@'); @@ -62,6 +67,12 @@ private function getLabelFromSourceReference($ref) return null; } + /** + * @param string $path + * @param string $url + * + * @return void + */ public function initPerforce(PackageInterface $package, $path, $url) { if (!empty($this->perforce)) { @@ -78,13 +89,16 @@ public function initPerforce(PackageInterface $package, $path, $url) $this->perforce = Perforce::create($repoConfig, $url, $path, $this->process, $this->io); } + /** + * @return array + */ private function getRepoConfig(VcsRepository $repository) { return $repository->getRepoConfig(); } /** - * {@inheritDoc} + * @inheritDoc */ protected function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url) { @@ -92,7 +106,7 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target, } /** - * {@inheritDoc} + * @inheritDoc */ public function getLocalChanges(PackageInterface $package, $path) { @@ -102,20 +116,23 @@ public function getLocalChanges(PackageInterface $package, $path) } /** - * {@inheritDoc} + * @inheritDoc */ protected function getCommitLogs($fromReference, $toReference, $path) { return $this->perforce->getCommitLogs($fromReference, $toReference); } - public function setPerforce($perforce) + /** + * @return void + */ + public function setPerforce(Perforce $perforce) { $this->perforce = $perforce; } /** - * {@inheritDoc} + * @inheritDoc */ protected function hasMetadataRepository($path) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/PharDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/PharDownloader.php index 89ef4363f..2bfd70a72 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/PharDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/PharDownloader.php @@ -22,7 +22,7 @@ class PharDownloader extends ArchiveDownloader { /** - * {@inheritDoc} + * @inheritDoc */ protected function extract(PackageInterface $package, $file, $path) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php index f36b04917..fa5596094 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php @@ -16,6 +16,7 @@ use Composer\Util\Svn as SvnUtil; use Composer\Repository\VcsRepository; use Composer\Util\ProcessExecutor; +use React\Promise\PromiseInterface; /** * @author Ben Bieker @@ -27,7 +28,7 @@ class SvnDownloader extends VcsDownloader protected $cacheCredentials = true; /** - * {@inheritDoc} + * @inheritDoc */ protected function doDownload(PackageInterface $package, $path, $url, PackageInterface $prevPackage = null) { @@ -41,7 +42,7 @@ protected function doDownload(PackageInterface $package, $path, $url, PackageInt } /** - * {@inheritDoc} + * @inheritDoc */ protected function doInstall(PackageInterface $package, $path, $url) { @@ -63,7 +64,7 @@ protected function doInstall(PackageInterface $package, $path, $url) } /** - * {@inheritDoc} + * @inheritDoc */ protected function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url) { @@ -87,7 +88,7 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target, } /** - * {@inheritDoc} + * @inheritDoc */ public function getLocalChanges(PackageInterface $package, $path) { @@ -126,12 +127,12 @@ protected function execute(PackageInterface $package, $baseUrl, $command, $url, } /** - * {@inheritDoc} + * @inheritDoc */ protected function cleanChanges(PackageInterface $package, $path, $update) { if (!$changes = $this->getLocalChanges($package, $path)) { - return; + return \React\Promise\resolve(); } if (!$this->io->isInteractive()) { @@ -182,10 +183,12 @@ protected function cleanChanges(PackageInterface $package, $path, $update) break; } } + + return \React\Promise\resolve(); } /** - * {@inheritDoc} + * @inheritDoc */ protected function getCommitLogs($fromReference, $toReference, $path) { @@ -227,15 +230,22 @@ protected function getCommitLogs($fromReference, $toReference, $path) return "Could not retrieve changes between $fromReference and $toReference due to missing revision information"; } + /** + * @param string $path + * + * @return PromiseInterface + */ protected function discardChanges($path) { if (0 !== $this->process->execute('svn revert -R .', $output, $path)) { throw new \RuntimeException("Could not reset changes\n\n:".$this->process->getErrorOutput()); } + + return \React\Promise\resolve(); } /** - * {@inheritDoc} + * @inheritDoc */ protected function hasMetadataRepository($path) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/TarDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/TarDownloader.php index 65346030e..da4c98289 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/TarDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/TarDownloader.php @@ -22,7 +22,7 @@ class TarDownloader extends ArchiveDownloader { /** - * {@inheritDoc} + * @inheritDoc */ protected function extract(PackageInterface $package, $file, $path) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/TransportException.php b/app/vendor/composer/composer/src/Composer/Downloader/TransportException.php index a478e5807..92be261a6 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/TransportException.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/TransportException.php @@ -17,47 +17,71 @@ */ class TransportException extends \RuntimeException { - /** @var ?array */ + /** @var ?array */ protected $headers; /** @var ?string */ protected $response; /** @var ?int */ protected $statusCode; - /** @var ?array */ + /** @var array */ protected $responseInfo = array(); + /** + * @param array $headers + * + * @return void + */ public function setHeaders($headers) { $this->headers = $headers; } + /** + * @return ?array + */ public function getHeaders() { return $this->headers; } + /** + * @param ?string $response + * + * @return void + */ public function setResponse($response) { $this->response = $response; } + /** + * @return ?string + */ public function getResponse() { return $this->response; } + /** + * @param ?int $statusCode + * + * @return void + */ public function setStatusCode($statusCode) { $this->statusCode = $statusCode; } + /** + * @return ?int + */ public function getStatusCode() { return $this->statusCode; } /** - * @return array + * @return array */ public function getResponseInfo() { @@ -65,7 +89,9 @@ public function getResponseInfo() } /** - * @param array $responseInfo + * @param array $responseInfo + * + * @return void */ public function setResponseInfo(array $responseInfo) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php index 53c573679..eaea3d9da 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php @@ -50,7 +50,7 @@ public function __construct(IOInterface $io, Config $config, ProcessExecutor $pr } /** - * {@inheritDoc} + * @inheritDoc */ public function getInstallationSource() { @@ -58,7 +58,7 @@ public function getInstallationSource() } /** - * {@inheritDoc} + * @inheritDoc */ public function download(PackageInterface $package, $path, PackageInterface $prevPackage = null) { @@ -91,7 +91,7 @@ public function download(PackageInterface $package, $path, PackageInterface $pre } /** - * {@inheritDoc} + * @inheritDoc */ public function prepare($type, PackageInterface $package, $path, PackageInterface $prevPackage = null) { @@ -108,7 +108,7 @@ public function prepare($type, PackageInterface $package, $path, PackageInterfac } /** - * {@inheritDoc} + * @inheritDoc */ public function cleanup($type, PackageInterface $package, $path, PackageInterface $prevPackage = null) { @@ -121,7 +121,7 @@ public function cleanup($type, PackageInterface $package, $path, PackageInterfac } /** - * {@inheritDoc} + * @inheritDoc */ public function install(PackageInterface $package, $path) { @@ -156,7 +156,7 @@ public function install(PackageInterface $package, $path) } /** - * {@inheritDoc} + * @inheritDoc */ public function update(PackageInterface $initial, PackageInterface $target, $path) { @@ -220,7 +220,7 @@ public function update(PackageInterface $initial, PackageInterface $target, $pat } /** - * {@inheritDoc} + * @inheritDoc */ public function remove(PackageInterface $package, $path) { @@ -236,7 +236,7 @@ public function remove(PackageInterface $package, $path) } /** - * {@inheritDoc} + * @inheritDoc */ public function getVcsReference(PackageInterface $package, $path) { @@ -259,6 +259,9 @@ public function getVcsReference(PackageInterface $package, $path) * @param string $path * @param bool $update if true (update) the changes can be stashed and reapplied after an update, * if false (remove) the changes should be assumed to be lost if the operation is not aborted + * + * @return PromiseInterface + * * @throws \RuntimeException in case the operation must be aborted */ protected function cleanChanges(PackageInterface $package, $path, $update) @@ -274,7 +277,10 @@ protected function cleanChanges(PackageInterface $package, $path, $update) /** * Reapply previously stashes changes if applicable, only called after an update (regardless if successful or not) * - * @param string $path + * @param string $path + * + * @return void + * * @throws \RuntimeException in case the operation must be aborted or the patch does not apply cleanly */ protected function reapplyChanges($path) @@ -336,6 +342,8 @@ abstract protected function getCommitLogs($fromReference, $toReference, $path); abstract protected function hasMetadataRepository($path); /** + * @param string[] $urls + * * @return string[] */ private function prepareUrls(array $urls) diff --git a/app/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php index 2a93c9f9c..30fa1c9da 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php @@ -36,7 +36,7 @@ class ZipDownloader extends ArchiveDownloader private $zipArchiveObject; /** - * {@inheritDoc} + * @inheritDoc */ public function download(PackageInterface $package, $path, PackageInterface $prevPackage = null, $output = true) { @@ -149,8 +149,12 @@ private function extractWithSystemUnzip(PackageInterface $package, $file, $path) try { $promise = $this->process->executeAsync($command); - return $promise->then(function ($process) use ($tryFallback, $command, $package, $file) { + return $promise->then(function ($process) use ($tryFallback, $command, $package, $file, $self) { if (!$process->isSuccessful()) { + if (isset($self->cleanupExecuted[$package->getName()])) { + throw new \RuntimeException('Failed to extract '.$package->getName().' as the installation was aborted by another package operation.'); + } + $output = $process->getErrorOutput(); $output = str_replace(', '.$file.'.zip or '.$file.'.ZIP', '', $output); diff --git a/app/vendor/composer/composer/src/Composer/EventDispatcher/Event.php b/app/vendor/composer/composer/src/Composer/EventDispatcher/Event.php index 51cfda4f8..8563809f5 100644 --- a/app/vendor/composer/composer/src/Composer/EventDispatcher/Event.php +++ b/app/vendor/composer/composer/src/Composer/EventDispatcher/Event.php @@ -95,6 +95,8 @@ public function isPropagationStopped() /** * Prevents the event from being passed to further listeners + * + * @return void */ public function stopPropagation() { diff --git a/app/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php b/app/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php index ca23a1bdd..06e30792c 100644 --- a/app/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php +++ b/app/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php @@ -77,6 +77,7 @@ public function __construct(Composer $composer, IOInterface $io, ProcessExecutor * Set whether script handlers are active or not * * @param bool $runScripts + * @return $this */ public function setRunScripts($runScripts = true) { @@ -105,12 +106,12 @@ public function dispatch($eventName, Event $event = null) /** * Dispatch a script event. * - * @param string $eventName The constant in ScriptEvents - * @param bool $devMode - * @param array $additionalArgs Arguments passed by the user - * @param array $flags Optional flags to pass data not as argument - * @return int return code of the executed script if any, for php scripts a false return - * value is changed to 1, anything else to 0 + * @param string $eventName The constant in ScriptEvents + * @param bool $devMode + * @param array $additionalArgs Arguments passed by the user + * @param array $flags Optional flags to pass data not as argument + * @return int return code of the executed script if any, for php scripts a false return + * value is changed to 1, anything else to 0 */ public function dispatchScript($eventName, $devMode = false, $additionalArgs = array(), $flags = array()) { @@ -120,11 +121,11 @@ public function dispatchScript($eventName, $devMode = false, $additionalArgs = a /** * Dispatch a package event. * - * @param string $eventName The constant in PackageEvents - * @param bool $devMode Whether or not we are in dev mode - * @param RepositoryInterface $localRepo The installed repository - * @param array $operations The list of operations - * @param OperationInterface $operation The package being installed/updated/removed + * @param string $eventName The constant in PackageEvents + * @param bool $devMode Whether or not we are in dev mode + * @param RepositoryInterface $localRepo The installed repository + * @param OperationInterface[] $operations The list of operations + * @param OperationInterface $operation The package being installed/updated/removed * * @return int return code of the executed script if any, for php scripts a false return * value is changed to 1, anything else to 0 @@ -336,6 +337,11 @@ protected function doDispatch(Event $event) return $returnMax; } + /** + * @param string $exec + * + * @return int + */ protected function executeTty($exec) { if ($this->io->isInteractive()) { @@ -345,6 +351,9 @@ protected function executeTty($exec) return $this->process->execute($exec); } + /** + * @return string + */ protected function getPhpExecCommand() { $finder = new PhpExecutableFinder(); @@ -365,6 +374,8 @@ protected function getPhpExecCommand() * @param string $className * @param string $methodName * @param Event $event Event invoking the PHP callable + * + * @return mixed */ protected function executeEventPhpScript($className, $methodName, Event $event) { @@ -383,6 +394,8 @@ protected function executeEventPhpScript($className, $methodName, Event $event) * @param string $eventName The event name - typically a constant * @param callable $listener A callable expecting an event argument * @param int $priority A higher value represents a higher priority + * + * @return void */ public function addListener($eventName, $listener, $priority = 0) { @@ -391,6 +404,8 @@ public function addListener($eventName, $listener, $priority = 0) /** * @param callable|object $listener A callable or an object instance for which all listeners should be removed + * + * @return void */ public function removeListener($listener) { @@ -411,6 +426,8 @@ public function removeListener($listener) * @see EventSubscriberInterface * * @param EventSubscriberInterface $subscriber + * + * @return void */ public function addSubscriber(EventSubscriberInterface $subscriber) { @@ -431,7 +448,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber) * Retrieves all listeners for a given event * * @param Event $event - * @return array All listeners: callables and scripts + * @return array All listeners: callables and scripts */ protected function getListeners(Event $event) { @@ -465,7 +482,7 @@ public function hasEventListeners(Event $event) * Finds all listeners defined as scripts in the package * * @param Event $event Event object - * @return array Listeners + * @return string[] Listeners */ protected function getScriptListeners(Event $event) { @@ -536,13 +553,16 @@ protected function pushEvent(Event $event) /** * Pops the active event from the stack * - * @return mixed + * @return string|null */ protected function popEvent() { return array_pop($this->eventStack); } + /** + * @return void + */ private function ensureBinDirIsInPath() { $pathStr = 'PATH'; diff --git a/app/vendor/composer/composer/src/Composer/EventDispatcher/EventSubscriberInterface.php b/app/vendor/composer/composer/src/Composer/EventDispatcher/EventSubscriberInterface.php index 6b0c4ca06..4de66c80b 100644 --- a/app/vendor/composer/composer/src/Composer/EventDispatcher/EventSubscriberInterface.php +++ b/app/vendor/composer/composer/src/Composer/EventDispatcher/EventSubscriberInterface.php @@ -42,7 +42,7 @@ interface EventSubscriberInterface * * array('eventName' => array('methodName', $priority)) * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) * - * @return array The event names to listen to + * @return array> The event names to listen to */ public static function getSubscribedEvents(); } diff --git a/app/vendor/composer/composer/src/Composer/Factory.php b/app/vendor/composer/composer/src/Composer/Factory.php index d67ccf29a..7d08ec4d5 100644 --- a/app/vendor/composer/composer/src/Composer/Factory.php +++ b/app/vendor/composer/composer/src/Composer/Factory.php @@ -20,7 +20,6 @@ use Composer\Package\RootPackageInterface; use Composer\Repository\RepositoryManager; use Composer\Repository\RepositoryFactory; -use Composer\Repository\WritableRepositoryInterface; use Composer\Util\Filesystem; use Composer\Util\Platform; use Composer\Util\ProcessExecutor; @@ -171,12 +170,13 @@ protected static function getDataDir($home) } /** - * @param IOInterface|null $io + * @param string|null $cwd + * * @return Config */ public static function createConfig(IOInterface $io = null, $cwd = null) { - $cwd = $cwd ?: getcwd(); + $cwd = $cwd ?: (string) getcwd(); $config = new Config(true, $cwd); @@ -229,23 +229,33 @@ public static function createConfig(IOInterface $io = null, $cwd = null) $authData = json_decode($composerAuthEnv, true); if (null === $authData) { - throw new \UnexpectedValueException('COMPOSER_AUTH environment variable is malformed, should be a valid JSON object'); - } - - if ($io && $io->isDebug()) { - $io->writeError('Loading auth config from COMPOSER_AUTH'); + if ($io) { + $io->writeError('COMPOSER_AUTH environment variable is malformed, should be a valid JSON object'); + } + } else { + if ($io && $io->isDebug()) { + $io->writeError('Loading auth config from COMPOSER_AUTH'); + } + $config->merge(array('config' => $authData)); } - $config->merge(array('config' => $authData)); } return $config; } + /** + * @return string + */ public static function getComposerFile() { return trim(getenv('COMPOSER')) ?: './composer.json'; } + /** + * @param string $composerFile + * + * @return string + */ public static function getLockFile($composerFile) { return "json" === pathinfo($composerFile, PATHINFO_EXTENSION) @@ -253,6 +263,9 @@ public static function getLockFile($composerFile) : $composerFile . '.lock'; } + /** + * @return array{highlight: OutputFormatterStyle, warning: OutputFormatterStyle} + */ public static function createAdditionalStyles() { return array( @@ -277,18 +290,19 @@ public static function createOutput() /** * Creates a Composer instance * - * @param IOInterface $io IO instance - * @param array|string|null $localConfig either a configuration array or a filename to read from, if null it will - * read from the default filename - * @param bool $disablePlugins Whether plugins should not be loaded - * @param bool $fullLoad Whether to initialize everything or only main project stuff (used when loading the global composer) + * @param IOInterface $io IO instance + * @param array|string|null $localConfig either a configuration array or a filename to read from, if null it will + * read from the default filename + * @param bool $disablePlugins Whether plugins should not be loaded + * @param string|null $cwd + * @param bool $fullLoad Whether to initialize everything or only main project stuff (used when loading the global composer) * @throws \InvalidArgumentException * @throws \UnexpectedValueException * @return Composer */ public function createComposer(IOInterface $io, $localConfig = null, $disablePlugins = false, $cwd = null, $fullLoad = true) { - $cwd = $cwd ?: getcwd(); + $cwd = $cwd ?: (string) getcwd(); // load Composer configuration if (null === $localConfig) { @@ -456,6 +470,8 @@ public static function createGlobal(IOInterface $io, $disablePlugins = false) /** * @param Repository\RepositoryManager $rm * @param string $vendorDir + * + * @return void */ protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, $vendorDir, RootPackageInterface $rootPackage, ProcessExecutor $process = null) { @@ -468,7 +484,9 @@ protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, $v } /** - * @param Config $config + * @param bool $disablePlugins + * @param bool $fullLoad + * * @return Composer|null */ protected function createGlobalComposer(IOInterface $io, Config $config, $disablePlugins, $fullLoad = false) @@ -569,9 +587,7 @@ public function createInstallationManager(Loop $loop, IOInterface $io, EventDisp } /** - * @param Installer\InstallationManager $im - * @param Composer $composer - * @param IO\IOInterface $io + * @return void */ protected function createDefaultInstallers(Installer\InstallationManager $im, Composer $composer, IOInterface $io, ProcessExecutor $process = null) { @@ -585,7 +601,9 @@ protected function createDefaultInstallers(Installer\InstallationManager $im, Co /** * @param InstalledRepositoryInterface $repo repository to purge packages from - * @param Installer\InstallationManager $im manager to check whether packages are still installed + * @param Installer\InstallationManager $im manager to check whether packages are still installed + * + * @return void */ protected function purgePackages(InstalledRepositoryInterface $repo, Installer\InstallationManager $im) { @@ -596,6 +614,9 @@ protected function purgePackages(InstalledRepositoryInterface $repo, Installer\I } } + /** + * @return Package\Loader\RootPackageLoader + */ protected function loadRootPackage(RepositoryManager $rm, Config $config, VersionParser $parser, VersionGuesser $guesser, IOInterface $io) { return new Package\Loader\RootPackageLoader($rm, $config, $parser, $guesser, $io); @@ -620,7 +641,7 @@ public static function create(IOInterface $io, $config = null, $disablePlugins = * * @param IOInterface $io IO instance * @param Config $config Config instance - * @param array $options Array of options passed directly to HttpDownloader constructor + * @param mixed[] $options Array of options passed directly to HttpDownloader constructor * @return HttpDownloader */ public static function createHttpDownloader(IOInterface $io, Config $config, $options = array()) diff --git a/app/vendor/composer/composer/src/Composer/IO/BaseIO.php b/app/vendor/composer/composer/src/Composer/IO/BaseIO.php index 380902fa7..b1c11a1cb 100644 --- a/app/vendor/composer/composer/src/Composer/IO/BaseIO.php +++ b/app/vendor/composer/composer/src/Composer/IO/BaseIO.php @@ -22,7 +22,7 @@ abstract class BaseIO implements IOInterface protected $authentications = array(); /** - * {@inheritDoc} + * @inheritDoc */ public function getAuthentications() { @@ -30,7 +30,7 @@ public function getAuthentications() } /** - * {@inheritDoc} + * @return void */ public function resetAuthentications() { @@ -38,7 +38,7 @@ public function resetAuthentications() } /** - * {@inheritDoc} + * @inheritDoc */ public function hasAuthentication($repositoryName) { @@ -46,7 +46,7 @@ public function hasAuthentication($repositoryName) } /** - * {@inheritDoc} + * @inheritDoc */ public function getAuthentication($repositoryName) { @@ -58,7 +58,7 @@ public function getAuthentication($repositoryName) } /** - * {@inheritDoc} + * @inheritDoc */ public function setAuthentication($repositoryName, $username, $password = null) { @@ -66,7 +66,7 @@ public function setAuthentication($repositoryName, $username, $password = null) } /** - * {@inheritDoc} + * @inheritDoc */ public function writeRaw($messages, $newline = true, $verbosity = self::NORMAL) { @@ -74,7 +74,7 @@ public function writeRaw($messages, $newline = true, $verbosity = self::NORMAL) } /** - * {@inheritDoc} + * @inheritDoc */ public function writeErrorRaw($messages, $newline = true, $verbosity = self::NORMAL) { @@ -87,6 +87,8 @@ public function writeErrorRaw($messages, $newline = true, $verbosity = self::NOR * @param string $repositoryName The unique name of repository * @param string $username The username * @param string $password The password + * + * @return void */ protected function checkAndSetAuthentication($repositoryName, $username, $password = null) { @@ -107,7 +109,7 @@ protected function checkAndSetAuthentication($repositoryName, $username, $passwo } /** - * {@inheritDoc} + * @inheritDoc */ public function loadConfiguration(Config $config) { @@ -157,7 +159,7 @@ public function loadConfiguration(Config $config) } /** - * {@inheritDoc} + * @inheritDoc */ public function emergency($message, array $context = array()) { @@ -165,7 +167,7 @@ public function emergency($message, array $context = array()) } /** - * {@inheritDoc} + * @inheritDoc */ public function alert($message, array $context = array()) { @@ -173,7 +175,7 @@ public function alert($message, array $context = array()) } /** - * {@inheritDoc} + * @inheritDoc */ public function critical($message, array $context = array()) { @@ -181,7 +183,7 @@ public function critical($message, array $context = array()) } /** - * {@inheritDoc} + * @inheritDoc */ public function error($message, array $context = array()) { @@ -189,7 +191,7 @@ public function error($message, array $context = array()) } /** - * {@inheritDoc} + * @inheritDoc */ public function warning($message, array $context = array()) { @@ -197,7 +199,7 @@ public function warning($message, array $context = array()) } /** - * {@inheritDoc} + * @inheritDoc */ public function notice($message, array $context = array()) { @@ -205,7 +207,7 @@ public function notice($message, array $context = array()) } /** - * {@inheritDoc} + * @inheritDoc */ public function info($message, array $context = array()) { @@ -213,7 +215,7 @@ public function info($message, array $context = array()) } /** - * {@inheritDoc} + * @inheritDoc */ public function debug($message, array $context = array()) { @@ -221,7 +223,7 @@ public function debug($message, array $context = array()) } /** - * {@inheritDoc} + * @inheritDoc */ public function log($level, $message, array $context = array()) { diff --git a/app/vendor/composer/composer/src/Composer/IO/BufferIO.php b/app/vendor/composer/composer/src/Composer/IO/BufferIO.php index e86500e2d..ea9864e91 100644 --- a/app/vendor/composer/composer/src/Composer/IO/BufferIO.php +++ b/app/vendor/composer/composer/src/Composer/IO/BufferIO.php @@ -46,6 +46,9 @@ public function __construct($input = '', $verbosity = StreamOutput::VERBOSITY_NO ))); } + /** + * @return string output + */ public function getOutput() { fseek($this->output->getStream(), 0); @@ -66,6 +69,13 @@ public function getOutput() return $output; } + /** + * @param string[] $inputs + * + * @see createStream + * + * @return void + */ public function setUserInputs(array $inputs) { if (!$this->input instanceof StreamableInputInterface) { @@ -76,6 +86,11 @@ public function setUserInputs(array $inputs) $this->input->setInteractive(true); } + /** + * @param string[] $inputs + * + * @return false|resource stream + */ private function createStream(array $inputs) { $stream = fopen('php://memory', 'r+'); diff --git a/app/vendor/composer/composer/src/Composer/IO/ConsoleIO.php b/app/vendor/composer/composer/src/Composer/IO/ConsoleIO.php index d6aa538c1..9c8b467fe 100644 --- a/app/vendor/composer/composer/src/Composer/IO/ConsoleIO.php +++ b/app/vendor/composer/composer/src/Composer/IO/ConsoleIO.php @@ -68,6 +68,8 @@ public function __construct(InputInterface $input, OutputInterface $output, Help /** * @param float $startTime + * + * @return void */ public function enableDebugging($startTime) { @@ -75,7 +77,7 @@ public function enableDebugging($startTime) } /** - * {@inheritDoc} + * @inheritDoc */ public function isInteractive() { @@ -83,7 +85,7 @@ public function isInteractive() } /** - * {@inheritDoc} + * @inheritDoc */ public function isDecorated() { @@ -91,7 +93,7 @@ public function isDecorated() } /** - * {@inheritDoc} + * @inheritDoc */ public function isVerbose() { @@ -99,7 +101,7 @@ public function isVerbose() } /** - * {@inheritDoc} + * @inheritDoc */ public function isVeryVerbose() { @@ -107,7 +109,7 @@ public function isVeryVerbose() } /** - * {@inheritDoc} + * @inheritDoc */ public function isDebug() { @@ -115,7 +117,7 @@ public function isDebug() } /** - * {@inheritDoc} + * @inheritDoc */ public function write($messages, $newline = true, $verbosity = self::NORMAL) { @@ -123,7 +125,7 @@ public function write($messages, $newline = true, $verbosity = self::NORMAL) } /** - * {@inheritDoc} + * @inheritDoc */ public function writeError($messages, $newline = true, $verbosity = self::NORMAL) { @@ -131,7 +133,7 @@ public function writeError($messages, $newline = true, $verbosity = self::NORMAL } /** - * {@inheritDoc} + * @inheritDoc */ public function writeRaw($messages, $newline = true, $verbosity = self::NORMAL) { @@ -139,7 +141,7 @@ public function writeRaw($messages, $newline = true, $verbosity = self::NORMAL) } /** - * {@inheritDoc} + * @inheritDoc */ public function writeErrorRaw($messages, $newline = true, $verbosity = self::NORMAL) { @@ -147,10 +149,13 @@ public function writeErrorRaw($messages, $newline = true, $verbosity = self::NOR } /** - * @param array|string $messages - * @param bool $newline - * @param bool $stderr - * @param int $verbosity + * @param string[]|string $messages + * @param bool $newline + * @param bool $stderr + * @param int $verbosity + * @param bool $raw + * + * @return void */ private function doWrite($messages, $newline, $stderr, $verbosity, $raw = false) { @@ -187,7 +192,7 @@ private function doWrite($messages, $newline, $stderr, $verbosity, $raw = false) } /** - * {@inheritDoc} + * @inheritDoc */ public function overwrite($messages, $newline = true, $size = null, $verbosity = self::NORMAL) { @@ -195,7 +200,7 @@ public function overwrite($messages, $newline = true, $size = null, $verbosity = } /** - * {@inheritDoc} + * @inheritDoc */ public function overwriteError($messages, $newline = true, $size = null, $verbosity = self::NORMAL) { @@ -203,11 +208,13 @@ public function overwriteError($messages, $newline = true, $size = null, $verbos } /** - * @param array|string $messages + * @param string[]|string $messages * @param bool $newline * @param int|null $size * @param bool $stderr * @param int $verbosity + * + * @return void */ private function doOverwrite($messages, $newline, $size, $stderr, $verbosity) { @@ -257,7 +264,7 @@ public function getProgressBar($max = 0) } /** - * {@inheritDoc} + * @inheritDoc */ public function ask($question, $default = null) { @@ -269,7 +276,7 @@ public function ask($question, $default = null) } /** - * {@inheritDoc} + * @inheritDoc */ public function askConfirmation($question, $default = true) { @@ -281,7 +288,7 @@ public function askConfirmation($question, $default = true) } /** - * {@inheritDoc} + * @inheritDoc */ public function askAndValidate($question, $validator, $attempts = null, $default = null) { @@ -295,7 +302,7 @@ public function askAndValidate($question, $validator, $attempts = null, $default } /** - * {@inheritDoc} + * @inheritDoc */ public function askAndHideAnswer($question) { @@ -308,7 +315,7 @@ public function askAndHideAnswer($question) } /** - * {@inheritDoc} + * @inheritDoc */ public function select($question, $choices, $default, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false) { diff --git a/app/vendor/composer/composer/src/Composer/IO/IOInterface.php b/app/vendor/composer/composer/src/Composer/IO/IOInterface.php index fd2a2d503..cf19321c2 100644 --- a/app/vendor/composer/composer/src/Composer/IO/IOInterface.php +++ b/app/vendor/composer/composer/src/Composer/IO/IOInterface.php @@ -66,56 +66,68 @@ public function isDecorated(); /** * Writes a message to the output. * - * @param string|array $messages The message as an array of lines or a single string - * @param bool $newline Whether to add a newline or not - * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * @param string|string[] $messages The message as an array of lines or a single string + * @param bool $newline Whether to add a newline or not + * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * + * @return void */ public function write($messages, $newline = true, $verbosity = self::NORMAL); /** * Writes a message to the error output. * - * @param string|array $messages The message as an array of lines or a single string - * @param bool $newline Whether to add a newline or not - * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * @param string|string[] $messages The message as an array of lines or a single string + * @param bool $newline Whether to add a newline or not + * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * + * @return void */ public function writeError($messages, $newline = true, $verbosity = self::NORMAL); /** * Writes a message to the output, without formatting it. * - * @param string|array $messages The message as an array of lines or a single string - * @param bool $newline Whether to add a newline or not - * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * @param string|string[] $messages The message as an array of lines or a single string + * @param bool $newline Whether to add a newline or not + * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * + * @return void */ public function writeRaw($messages, $newline = true, $verbosity = self::NORMAL); /** * Writes a message to the error output, without formatting it. * - * @param string|array $messages The message as an array of lines or a single string - * @param bool $newline Whether to add a newline or not - * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * @param string|string[] $messages The message as an array of lines or a single string + * @param bool $newline Whether to add a newline or not + * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * + * @return void */ public function writeErrorRaw($messages, $newline = true, $verbosity = self::NORMAL); /** * Overwrites a previous message to the output. * - * @param string|array $messages The message as an array of lines or a single string - * @param bool $newline Whether to add a newline or not - * @param int $size The size of line - * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * @param string|string[] $messages The message as an array of lines or a single string + * @param bool $newline Whether to add a newline or not + * @param int $size The size of line + * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * + * @return void */ public function overwrite($messages, $newline = true, $size = null, $verbosity = self::NORMAL); /** * Overwrites a previous message to the error output. * - * @param string|array $messages The message as an array of lines or a single string - * @param bool $newline Whether to add a newline or not - * @param int $size The size of line - * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * @param string|string[] $messages The message as an array of lines or a single string + * @param bool $newline Whether to add a newline or not + * @param int $size The size of line + * @param int $verbosity Verbosity level from the VERBOSITY_* constants + * + * @return void */ public function overwriteError($messages, $newline = true, $size = null, $verbosity = self::NORMAL); @@ -172,21 +184,21 @@ public function askAndHideAnswer($question); * Asks the user to select a value. * * @param string $question The question to ask - * @param array $choices List of choices to pick from + * @param string[] $choices List of choices to pick from * @param bool|string $default The default answer if the user enters nothing * @param bool|int $attempts Max number of times to ask before giving up (false by default, which means infinite) * @param string $errorMessage Message which will be shown if invalid value from choice list would be picked * @param bool $multiselect Select more than one value separated by comma * * @throws \InvalidArgumentException - * @return int|string|array|bool The selected value or values (the key of the choices array) + * @return int|string|string[]|bool The selected value or values (the key of the choices array) */ public function select($question, $choices, $default, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false); /** * Get all authentication information entered. * - * @return array The map of authentication data + * @return array The map of authentication data */ public function getAuthentications(); @@ -204,16 +216,18 @@ public function hasAuthentication($repositoryName); * * @param string $repositoryName The unique name of repository * - * @return array The 'username' and 'password' + * @return array{username: string|null, password: string|null} */ public function getAuthentication($repositoryName); /** * Set the authentication information for the repository. * - * @param string $repositoryName The unique name of repository - * @param string $username The username - * @param string $password The password + * @param string $repositoryName The unique name of repository + * @param string $username The username + * @param ?string $password The password + * + * @return void */ public function setAuthentication($repositoryName, $username, $password = null); @@ -221,6 +235,8 @@ public function setAuthentication($repositoryName, $username, $password = null); * Loads authentications from a config instance * * @param Config $config + * + * @return void */ public function loadConfiguration(Config $config); } diff --git a/app/vendor/composer/composer/src/Composer/IO/NullIO.php b/app/vendor/composer/composer/src/Composer/IO/NullIO.php index 9dc9d3a0f..89c574e43 100644 --- a/app/vendor/composer/composer/src/Composer/IO/NullIO.php +++ b/app/vendor/composer/composer/src/Composer/IO/NullIO.php @@ -20,7 +20,7 @@ class NullIO extends BaseIO { /** - * {@inheritDoc} + * @inheritDoc */ public function isInteractive() { @@ -28,7 +28,7 @@ public function isInteractive() } /** - * {@inheritDoc} + * @inheritDoc */ public function isVerbose() { @@ -36,7 +36,7 @@ public function isVerbose() } /** - * {@inheritDoc} + * @inheritDoc */ public function isVeryVerbose() { @@ -44,7 +44,7 @@ public function isVeryVerbose() } /** - * {@inheritDoc} + * @inheritDoc */ public function isDebug() { @@ -52,7 +52,7 @@ public function isDebug() } /** - * {@inheritDoc} + * @inheritDoc */ public function isDecorated() { @@ -60,35 +60,35 @@ public function isDecorated() } /** - * {@inheritDoc} + * @inheritDoc */ public function write($messages, $newline = true, $verbosity = self::NORMAL) { } /** - * {@inheritDoc} + * @inheritDoc */ public function writeError($messages, $newline = true, $verbosity = self::NORMAL) { } /** - * {@inheritDoc} + * @inheritDoc */ public function overwrite($messages, $newline = true, $size = 80, $verbosity = self::NORMAL) { } /** - * {@inheritDoc} + * @inheritDoc */ public function overwriteError($messages, $newline = true, $size = 80, $verbosity = self::NORMAL) { } /** - * {@inheritDoc} + * @inheritDoc */ public function ask($question, $default = null) { @@ -96,7 +96,7 @@ public function ask($question, $default = null) } /** - * {@inheritDoc} + * @inheritDoc */ public function askConfirmation($question, $default = true) { @@ -104,7 +104,7 @@ public function askConfirmation($question, $default = true) } /** - * {@inheritDoc} + * @inheritDoc */ public function askAndValidate($question, $validator, $attempts = null, $default = null) { @@ -112,7 +112,7 @@ public function askAndValidate($question, $validator, $attempts = null, $default } /** - * {@inheritDoc} + * @inheritDoc */ public function askAndHideAnswer($question) { @@ -120,7 +120,7 @@ public function askAndHideAnswer($question) } /** - * {@inheritDoc} + * @inheritDoc */ public function select($question, $choices, $default, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false) { diff --git a/app/vendor/composer/composer/src/Composer/InstalledVersions.php b/app/vendor/composer/composer/src/Composer/InstalledVersions.php index 7c5502ca4..d50e0c9fc 100644 --- a/app/vendor/composer/composer/src/Composer/InstalledVersions.php +++ b/app/vendor/composer/composer/src/Composer/InstalledVersions.php @@ -24,8 +24,21 @@ */ class InstalledVersions { + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + */ private static $installed; + + /** + * @var bool|null + */ private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ private static $installedByVendor = array(); /** diff --git a/app/vendor/composer/composer/src/Composer/Installer.php b/app/vendor/composer/composer/src/Composer/Installer.php index d04005132..411c1d6e0 100644 --- a/app/vendor/composer/composer/src/Composer/Installer.php +++ b/app/vendor/composer/composer/src/Composer/Installer.php @@ -66,6 +66,13 @@ */ class Installer { + const ERROR_NONE = 0; // no error/success state + const ERROR_GENERIC_FAILURE = 1; + const ERROR_NO_LOCK_FILE_FOR_PARTIAL_UPDATE = 3; + const ERROR_LOCK_FILE_INVALID = 4; + // used/declared in SolverProblemsException, carried over here for completeness + const ERROR_DEPENDENCY_RESOLUTION_FAILED = 2; + /** * @var IOInterface */ @@ -77,13 +84,13 @@ class Installer protected $config; /** - * @var RootPackageInterface + * @var RootPackageInterface&BasePackage */ protected $package; // TODO can we get rid of the below and just use the package itself? /** - * @var RootPackageInterface + * @var RootPackageInterface&BasePackage */ protected $fixedRootPackage; @@ -117,23 +124,41 @@ class Installer */ protected $autoloadGenerator; + /** @var bool */ protected $preferSource = false; + /** @var bool */ protected $preferDist = false; + /** @var bool */ protected $optimizeAutoloader = false; + /** @var bool */ protected $classMapAuthoritative = false; + /** @var bool */ protected $apcuAutoloader = false; - protected $apcuAutoloaderPrefix; + /** @var string|null */ + protected $apcuAutoloaderPrefix = null; + /** @var bool */ protected $devMode = false; + /** @var bool */ protected $dryRun = false; + /** @var bool */ protected $verbose = false; + /** @var bool */ protected $update = false; + /** @var bool */ protected $install = true; + /** @var bool */ protected $dumpAutoloader = true; + /** @var bool */ protected $runScripts = true; + /** @var bool|string[] */ protected $ignorePlatformReqs = false; + /** @var bool */ protected $preferStable = false; + /** @var bool */ protected $preferLowest = false; + /** @var bool */ protected $writeLock; + /** @var bool */ protected $executeOperations = true; /** @var bool */ @@ -141,9 +166,10 @@ class Installer /** * Array of package names/globs flagged for update * - * @var array|null + * @var string[]|null */ protected $updateAllowList = null; + /** @var Request::UPDATE_* */ protected $updateAllowTransitiveDependencies = Request::UPDATE_ONLY_LISTED; /** @@ -161,7 +187,7 @@ class Installer * * @param IOInterface $io * @param Config $config - * @param RootPackageInterface $package + * @param RootPackageInterface&BasePackage $package * @param DownloadManager $downloadManager * @param RepositoryManager $repositoryManager * @param Locker $locker @@ -190,6 +216,7 @@ public function __construct(IOInterface $io, Config $config, RootPackageInterfac * * @throws \Exception * @return int 0 on success or a positive error code on failure + * @phpstan-return self::ERROR_* */ public function run() { @@ -345,6 +372,11 @@ public function run() return 0; } + /** + * @param bool $doInstall + * + * @return int + */ protected function doUpdate(InstalledRepositoryInterface $localRepo, $doInstall) { $platformRepo = $this->createPlatformRepo(true); @@ -368,7 +400,7 @@ protected function doUpdate(InstalledRepositoryInterface $localRepo, $doInstall) if (($this->updateAllowList || $this->updateMirrors) && !$lockedRepository) { $this->io->writeError('Cannot update ' . ($this->updateMirrors ? 'lock file information' : 'only a partial set of packages') . ' without a lock file present. Run `composer update` to generate a lock file.', true, IOInterface::QUIET); - return 1; + return self::ERROR_NO_LOCK_FILE_FOR_PARTIAL_UPDATE; } $this->io->writeError('Loading composer repositories with package information'); @@ -415,7 +447,7 @@ protected function doUpdate(InstalledRepositoryInterface $localRepo, $doInstall) $ghe = new GithubActionError($this->io); $ghe->emit($err."\n".$prettyProblem); - return max(1, $e->getCode()); + return max(self::ERROR_GENERIC_FAILURE, $e->getCode()); } $this->io->writeError("Analyzed ".count($pool)." packages to resolve dependencies", true, IOInterface::VERBOSE); @@ -546,6 +578,13 @@ protected function doUpdate(InstalledRepositoryInterface $localRepo, $doInstall) /** * Run the solver a second time on top of the existing update result with only the current result set in the pool * and see what packages would get removed if we only had the non-dev packages in the solver request + * + * @param array> $aliases + * + * @return int + * + * @phpstan-param list $aliases + * @phpstan-return self::ERROR_* */ protected function extractDevPackages(LockTransaction $lockTransaction, PlatformRepository $platformRepo, array $aliases, PolicyInterface $policy, LockArrayRepository $lockedRepository = null) { @@ -584,7 +623,7 @@ protected function extractDevPackages(LockTransaction $lockTransaction, Platform $ghe = new GithubActionError($this->io); $ghe->emit($err."\n".$prettyProblem); - return max(1, $e->getCode()); + return max(self::ERROR_GENERIC_FAILURE, $e->getCode()); } $lockTransaction->setNonDevPackages($nonDevLockTransaction); @@ -642,7 +681,7 @@ protected function doInstall(InstalledRepositoryInterface $localRepo, $alreadySo if (0 !== count($lockTransaction->getOperations())) { $this->io->writeError('Your lock file cannot be installed on this system without changes. Please run composer update.', true, IOInterface::QUIET); - return 1; + return self::ERROR_LOCK_FILE_INVALID; } } catch (SolverProblemsException $e) { $err = 'Your lock file does not contain a compatible set of packages. Please run composer update.'; @@ -654,7 +693,7 @@ protected function doInstall(InstalledRepositoryInterface $localRepo, $alreadySo $ghe = new GithubActionError($this->io); $ghe->emit($err."\n".$prettyProblem); - return max(1, $e->getCode()); + return max(self::ERROR_GENERIC_FAILURE, $e->getCode()); } } @@ -713,6 +752,11 @@ protected function doInstall(InstalledRepositoryInterface $localRepo, $alreadySo return 0; } + /** + * @param bool $forUpdate + * + * @return PlatformRepository + */ protected function createPlatformRepo($forUpdate) { if ($forUpdate) { @@ -725,11 +769,13 @@ protected function createPlatformRepo($forUpdate) } /** - * @param bool $forUpdate - * @param PlatformRepository $platformRepo - * @param array $rootAliases - * @param RepositoryInterface|null $lockedRepository + * @param bool $forUpdate + * @param array> $rootAliases + * @param RepositoryInterface|null $lockedRepository + * * @return RepositorySet + * + * @phpstan-param list $rootAliases */ private function createRepositorySet($forUpdate, PlatformRepository $platformRepo, array $rootAliases = array(), $lockedRepository = null) { @@ -795,6 +841,8 @@ private function createRepositorySet($forUpdate, PlatformRepository $platformRep } /** + * @param bool $forUpdate + * * @return DefaultPolicy */ private function createPolicy($forUpdate) @@ -818,6 +866,7 @@ private function createPolicy($forUpdate) } /** + * @param RootPackageInterface&BasePackage $rootPackage * @return Request */ private function createRequest(RootPackageInterface $rootPackage, PlatformRepository $platformRepo, LockArrayRepository $lockedRepository = null) @@ -851,6 +900,12 @@ private function createRequest(RootPackageInterface $rootPackage, PlatformReposi return $request; } + /** + * @param LockArrayRepository|null $lockedRepository + * @param bool $includeDevRequires + * + * @return void + */ private function requirePackagesForUpdate(Request $request, LockArrayRepository $lockedRepository = null, $includeDevRequires = true) { // if we're updating mirrors we want to keep exactly the same versions installed which are in the lock file, but we want current remote metadata @@ -879,8 +934,11 @@ private function requirePackagesForUpdate(Request $request, LockArrayRepository } /** - * @param bool $forUpdate - * @return array + * @param bool $forUpdate + * + * @return array> + * + * @phpstan-return list */ private function getRootAliases($forUpdate) { @@ -894,8 +952,9 @@ private function getRootAliases($forUpdate) } /** - * @param array $links - * @return array + * @param Link[] $links + * + * @return array */ private function extractPlatformRequirements(array $links) { @@ -914,7 +973,7 @@ private function extractPlatformRequirements(array $links) * * This is to prevent any accidental modification of the existing repos on disk * - * @param RepositoryManager $rm + * @return void */ private function mockLocalRepositories(RepositoryManager $rm) { @@ -1180,7 +1239,8 @@ public function isVerbose() * If this is set to false, no platform requirements are ignored * If this is set to string[], those packages will be ignored * - * @param bool|array $ignorePlatformReqs + * @param bool|string[] $ignorePlatformReqs + * * @return Installer */ public function setIgnorePlatformRequirements($ignorePlatformReqs) @@ -1213,7 +1273,8 @@ public function setUpdateMirrors($updateMirrors) * restrict the update operation to a few packages, all other packages * that are already installed will be kept at their current version * - * @param array $packages + * @param string[] $packages + * * @return Installer */ public function setUpdateAllowList(array $packages) diff --git a/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php index c692e72b3..084bef18a 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php @@ -51,6 +51,12 @@ public function __construct(IOInterface $io, $binDir, $binCompat, Filesystem $fi $this->filesystem = $filesystem ?: new Filesystem(); } + /** + * @param string $installPath + * @param bool $warnOnOverwrite + * + * @return void + */ public function installBinaries(PackageInterface $package, $installPath, $warnOnOverwrite = true) { $binaries = $this->getBinaries($package); @@ -103,6 +109,9 @@ public function installBinaries(PackageInterface $package, $installPath, $warnOn } } + /** + * @return void + */ public function removeBinaries(PackageInterface $package) { $this->initializeBinDir(); @@ -127,6 +136,11 @@ public function removeBinaries(PackageInterface $package) } } + /** + * @param string $bin + * + * @return string + */ public static function determineBinaryCaller($bin) { if ('.bat' === substr($bin, -4) || '.exe' === substr($bin, -4)) { @@ -143,11 +157,21 @@ public static function determineBinaryCaller($bin) return 'php'; } + /** + * @return string[] + */ protected function getBinaries(PackageInterface $package) { return $package->getBinaries(); } + /** + * @param string $binPath + * @param string $link + * @param string $bin + * + * @return void + */ protected function installFullBinaries($binPath, $link, $bin, PackageInterface $package) { // add unixy support for cygwin and similar environments @@ -164,6 +188,12 @@ protected function installFullBinaries($binPath, $link, $bin, PackageInterface $ } } + /** + * @param string $binPath + * @param string $link + * + * @return void + */ protected function installSymlinkBinaries($binPath, $link) { if (!$this->filesystem->relativeSymlink($binPath, $link)) { @@ -171,18 +201,33 @@ protected function installSymlinkBinaries($binPath, $link) } } + /** + * @param string $binPath + * @param string $link + * + * @return void + */ protected function installUnixyProxyBinaries($binPath, $link) { file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link)); Silencer::call('chmod', $link, 0777 & ~umask()); } + /** + * @return void + */ protected function initializeBinDir() { $this->filesystem->ensureDirectoryExists($this->binDir); $this->binDir = realpath($this->binDir); } + /** + * @param string $bin + * @param string $link + * + * @return string + */ protected function generateWindowsProxyCode($bin, $link) { $binPath = $this->filesystem->findShortestPath($link, $bin); @@ -194,6 +239,12 @@ protected function generateWindowsProxyCode($bin, $link) "{$caller} \"%BIN_TARGET%\" %*\r\n"; } + /** + * @param string $bin + * @param string $link + * + * @return string + */ protected function generateUnixyProxyCode($bin, $link) { $binPath = $this->filesystem->findShortestPath($link, $bin); @@ -204,46 +255,114 @@ protected function generateUnixyProxyCode($bin, $link) $binContents = file_get_contents($bin); // For php files, we generate a PHP proxy instead of a shell one, // which allows calling the proxy with a custom php process - if (preg_match('{^(?:#!(?:/usr)?/bin/env php|#!(?:/usr)?/bin/php| var_export(\$binPath, true), - '__DIR__' => var_export(dirname(\$binPath), true), - )); - - eval(\$contents); - exit(0); +namespace Composer; + +\$binPath = __DIR__ . "/" . $binPathExported; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private \$handle; + private \$position; + + public function stream_open(\$path, \$mode, \$options, &\$opened_path) + { + // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution + \$opened_path = substr(\$path, 21); + \$opened_path = realpath(\$opened_path) ?: \$opened_path; + \$this->handle = fopen(\$opened_path, \$mode); + \$this->position = 0; + + // remove all traces of this stream wrapper once it has been used + stream_wrapper_unregister('composer-bin-proxy'); + + return (bool) \$this->handle; + } + + public function stream_read(\$count) + { + \$data = fread(\$this->handle, \$count); + + if (\$this->position === 0) { + \$data = preg_replace('{^#!.*\\r?\\n}', '', \$data); + } + + \$this->position += strlen(\$data); + + return \$data; + } + + public function stream_cast(\$castAs) + { + return \$this->handle; + } + + public function stream_close() + { + fclose(\$this->handle); + } + + public function stream_lock(\$operation) + { + return \$operation ? flock(\$this->handle, \$operation) : true; + } + + public function stream_tell() + { + return \$this->position; + } + + public function stream_eof() + { + return feof(\$this->handle); + } + + public function stream_stat() + { + return fstat(\$this->handle); + } + + public function stream_set_option(\$option, \$arg1, \$arg2) + { + return true; + } + } + } + + if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { + include("composer-bin-proxy://" . \$binPath); + exit(0); + } } + include \$binPath; PROXY; - } } - $proxyCode = << /dev/null; cd $binDir && pwd) @@ -260,7 +379,5 @@ protected function generateUnixyProxyCode($bin, $link) "\${dir}/$binFile" "\$@" PROXY; - - return $proxyCode; } } diff --git a/app/vendor/composer/composer/src/Composer/Installer/BinaryPresenceInterface.php b/app/vendor/composer/composer/src/Composer/Installer/BinaryPresenceInterface.php index 2749ffafd..61907f778 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/BinaryPresenceInterface.php +++ b/app/vendor/composer/composer/src/Composer/Installer/BinaryPresenceInterface.php @@ -25,6 +25,8 @@ interface BinaryPresenceInterface * Make sure binaries are installed for a given package. * * @param PackageInterface $package package instance + * + * @return void */ public function ensureBinariesPresence(PackageInterface $package); } diff --git a/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php b/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php index 5b254384e..6429e1b56 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php +++ b/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php @@ -23,6 +23,7 @@ use Composer\DependencyResolver\Operation\UninstallOperation; use Composer\DependencyResolver\Operation\MarkAliasInstalledOperation; use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation; +use Composer\Downloader\FileDownloader; use Composer\EventDispatcher\EventDispatcher; use Composer\Util\Loop; use Composer\Util\Platform; @@ -59,15 +60,21 @@ public function __construct(Loop $loop, IOInterface $io, EventDispatcher $eventD $this->eventDispatcher = $eventDispatcher; } + /** + * @return void + */ public function reset() { $this->notifiablePackages = array(); + FileDownloader::$downloadMetadata = array(); } /** * Adds installer * * @param InstallerInterface $installer installer instance + * + * @return void */ public function addInstaller(InstallerInterface $installer) { @@ -79,6 +86,8 @@ public function addInstaller(InstallerInterface $installer) * Removes installer * * @param InstallerInterface $installer installer instance + * + * @return void */ public function removeInstaller(InstallerInterface $installer) { @@ -94,6 +103,8 @@ public function removeInstaller(InstallerInterface $installer) * We prevent any plugins from being instantiated by simply * deactivating the installer for them. This ensure that no third-party * code is ever executed. + * + * @return void */ public function disablePlugins() { @@ -153,6 +164,8 @@ public function isPackageInstalled(InstalledRepositoryInterface $repo, PackageIn * If the installer associated to this package doesn't handle that function, it'll do nothing. * * @param PackageInterface $package Package instance + * + * @return void */ public function ensureBinariesPresence(PackageInterface $package) { @@ -176,6 +189,8 @@ public function ensureBinariesPresence(PackageInterface $package) * @param OperationInterface[] $operations operations to execute * @param bool $devMode whether the install is being run in dev mode * @param bool $runScripts whether to dispatch script events + * + * @return void */ public function execute(InstalledRepositoryInterface $repo, array $operations, $devMode = true, $runScripts = true) { @@ -293,8 +308,13 @@ public function execute(InstalledRepositoryInterface $repo, array $operations, $ } /** - * @param array $operations List of operations to execute in this batch - * @param array $allOperations Complete list of operations to be executed in the install job, used for event listeners + * @param OperationInterface[] $operations List of operations to execute in this batch + * @param PromiseInterface[] $cleanupPromises + * @param bool $devMode + * @param bool $runScripts + * @param OperationInterface[] $allOperations Complete list of operations to be executed in the install job, used for event listeners + * + * @return void */ private function downloadAndExecuteBatch(InstalledRepositoryInterface $repo, array $operations, array &$cleanupPromises, $devMode, $runScripts, array $allOperations) { @@ -309,9 +329,11 @@ private function downloadAndExecuteBatch(InstalledRepositoryInterface $repo, arr } if ($opType === 'update') { + /** @var UpdateOperation $operation */ $package = $operation->getTargetPackage(); $initialPackage = $operation->getInitialPackage(); } else { + /** @var InstallOperation|MarkAliasInstalledOperation|MarkAliasUninstalledOperation|UninstallOperation $operation */ $package = $operation->getPackage(); $initialPackage = null; } @@ -345,8 +367,8 @@ private function downloadAndExecuteBatch(InstalledRepositoryInterface $repo, arr $batches = array(); $batch = array(); foreach ($operations as $index => $operation) { - if (in_array($operation->getOperationType(), array('update', 'install'), true)) { - $package = $operation->getOperationType() === 'update' ? $operation->getTargetPackage() : $operation->getPackage(); + if ($operation instanceof InstallOperation || $operation instanceof UpdateOperation) { + $package = $operation instanceof UpdateOperation ? $operation->getTargetPackage() : $operation->getPackage(); if ($package->getType() === 'composer-plugin' || $package->getType() === 'composer-installer') { if ($batch) { $batches[] = $batch; @@ -370,8 +392,13 @@ private function downloadAndExecuteBatch(InstalledRepositoryInterface $repo, arr } /** - * @param array $operations List of operations to execute in this batch - * @param array $allOperations Complete list of operations to be executed in the install job, used for event listeners + * @param OperationInterface[] $operations List of operations to execute in this batch + * @param PromiseInterface[] $cleanupPromises + * @param bool $devMode + * @param bool $runScripts + * @param OperationInterface[] $allOperations Complete list of operations to be executed in the install job, used for event listeners + * + * @return void */ private function executeBatch(InstalledRepositoryInterface $repo, array $operations, array $cleanupPromises, $devMode, $runScripts, array $allOperations) { @@ -393,9 +420,11 @@ private function executeBatch(InstalledRepositoryInterface $repo, array $operati } if ($opType === 'update') { + /** @var UpdateOperation $operation */ $package = $operation->getTargetPackage(); $initialPackage = $operation->getInitialPackage(); } else { + /** @var InstallOperation|MarkAliasInstalledOperation|MarkAliasUninstalledOperation|UninstallOperation $operation */ $package = $operation->getPackage(); $initialPackage = null; } @@ -448,6 +477,11 @@ private function executeBatch(InstalledRepositoryInterface $repo, array $operati } } + /** + * @param PromiseInterface[] $promises + * + * @return void + */ private function waitOnPromises(array $promises) { $progress = null; @@ -475,6 +509,8 @@ private function waitOnPromises(array $promises) * * @param InstalledRepositoryInterface $repo repository in which to check * @param InstallOperation $operation operation instance + * + * @return PromiseInterface|null */ public function install(InstalledRepositoryInterface $repo, InstallOperation $operation) { @@ -491,6 +527,8 @@ public function install(InstalledRepositoryInterface $repo, InstallOperation $op * * @param InstalledRepositoryInterface $repo repository in which to check * @param UpdateOperation $operation operation instance + * + * @return PromiseInterface|null */ public function update(InstalledRepositoryInterface $repo, UpdateOperation $operation) { @@ -524,6 +562,8 @@ public function update(InstalledRepositoryInterface $repo, UpdateOperation $oper * * @param InstalledRepositoryInterface $repo repository in which to check * @param UninstallOperation $operation operation instance + * + * @return PromiseInterface|null */ public function uninstall(InstalledRepositoryInterface $repo, UninstallOperation $operation) { @@ -538,6 +578,8 @@ public function uninstall(InstalledRepositoryInterface $repo, UninstallOperation * * @param InstalledRepositoryInterface $repo repository in which to check * @param MarkAliasInstalledOperation $operation operation instance + * + * @return void */ public function markAliasInstalled(InstalledRepositoryInterface $repo, MarkAliasInstalledOperation $operation) { @@ -553,6 +595,8 @@ public function markAliasInstalled(InstalledRepositoryInterface $repo, MarkAlias * * @param InstalledRepositoryInterface $repo repository in which to check * @param MarkAliasUninstalledOperation $operation operation instance + * + * @return void */ public function markAliasUninstalled(InstalledRepositoryInterface $repo, MarkAliasUninstalledOperation $operation) { @@ -574,11 +618,19 @@ public function getInstallPath(PackageInterface $package) return $installer->getInstallPath($package); } + /** + * @param bool $outputProgress + * + * @return void + */ public function setOutputProgress($outputProgress) { $this->outputProgress = $outputProgress; } + /** + * @return void + */ public function notifyInstalls(IOInterface $io) { $promises = array(); @@ -612,10 +664,18 @@ public function notifyInstalls(IOInterface $io) $postData = array('downloads' => array()); foreach ($packages as $package) { - $postData['downloads'][] = array( + $packageNotification = array( 'name' => $package->getPrettyName(), 'version' => $package->getVersion(), ); + if (strpos($repoUrl, 'packagist.org/') !== false) { + if (isset(FileDownloader::$downloadMetadata[$package->getName()])) { + $packageNotification['downloaded'] = FileDownloader::$downloadMetadata[$package->getName()]; + } else { + $packageNotification['downloaded'] = false; + } + } + $postData['downloads'][] = $packageNotification; } $opts = array( @@ -638,6 +698,9 @@ public function notifyInstalls(IOInterface $io) $this->reset(); } + /** + * @return void + */ private function markForNotification(PackageInterface $package) { if ($package->getNotificationUrl()) { diff --git a/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php index 239e5d129..1d8c743bb 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php @@ -67,7 +67,7 @@ public function __construct(IOInterface $io, Composer $composer, $type = 'librar } /** - * {@inheritDoc} + * @inheritDoc */ public function supports($packageType) { @@ -75,7 +75,7 @@ public function supports($packageType) } /** - * {@inheritDoc} + * @inheritDoc */ public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -93,7 +93,7 @@ public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface } /** - * {@inheritDoc} + * @inheritDoc */ public function download(PackageInterface $package, PackageInterface $prevPackage = null) { @@ -104,7 +104,7 @@ public function download(PackageInterface $package, PackageInterface $prevPackag } /** - * {@inheritDoc} + * @inheritDoc */ public function prepare($type, PackageInterface $package, PackageInterface $prevPackage = null) { @@ -115,7 +115,7 @@ public function prepare($type, PackageInterface $package, PackageInterface $prev } /** - * {@inheritDoc} + * @inheritDoc */ public function cleanup($type, PackageInterface $package, PackageInterface $prevPackage = null) { @@ -126,7 +126,7 @@ public function cleanup($type, PackageInterface $package, PackageInterface $prev } /** - * {@inheritDoc} + * @inheritDoc */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -155,7 +155,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa } /** - * {@inheritDoc} + * @inheritDoc */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { @@ -184,7 +184,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini } /** - * {@inheritDoc} + * @inheritDoc */ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -215,7 +215,7 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $ } /** - * {@inheritDoc} + * @inheritDoc */ public function getInstallPath(PackageInterface $package) { @@ -258,6 +258,9 @@ protected function getPackageBasePath(PackageInterface $package) return $installPath; } + /** + * @return PromiseInterface|null + */ protected function installCode(PackageInterface $package) { $downloadPath = $this->getInstallPath($package); @@ -265,6 +268,9 @@ protected function installCode(PackageInterface $package) return $this->downloadManager->install($package, $downloadPath); } + /** + * @return PromiseInterface|null + */ protected function updateCode(PackageInterface $initial, PackageInterface $target) { $initialDownloadPath = $this->getInstallPath($initial); @@ -298,6 +304,9 @@ protected function updateCode(PackageInterface $initial, PackageInterface $targe return $this->downloadManager->update($initial, $target, $targetDownloadPath); } + /** + * @return PromiseInterface|null + */ protected function removeCode(PackageInterface $package) { $downloadPath = $this->getPackageBasePath($package); @@ -305,6 +314,9 @@ protected function removeCode(PackageInterface $package) return $this->downloadManager->remove($package, $downloadPath); } + /** + * @return void + */ protected function initializeVendorDir() { $this->filesystem->ensureDirectoryExists($this->vendorDir); diff --git a/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php index 936f72536..ccc71c3fa 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php @@ -35,7 +35,7 @@ public function __construct(IOInterface $io) } /** - * {@inheritDoc} + * @inheritDoc */ public function supports($packageType) { @@ -43,7 +43,7 @@ public function supports($packageType) } /** - * {@inheritDoc} + * @inheritDoc */ public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -51,7 +51,7 @@ public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface } /** - * {@inheritDoc} + * @inheritDoc */ public function download(PackageInterface $package, PackageInterface $prevPackage = null) { @@ -60,7 +60,7 @@ public function download(PackageInterface $package, PackageInterface $prevPackag } /** - * {@inheritDoc} + * @inheritDoc */ public function prepare($type, PackageInterface $package, PackageInterface $prevPackage = null) { @@ -69,7 +69,7 @@ public function prepare($type, PackageInterface $package, PackageInterface $prev } /** - * {@inheritDoc} + * @inheritDoc */ public function cleanup($type, PackageInterface $package, PackageInterface $prevPackage = null) { @@ -78,7 +78,7 @@ public function cleanup($type, PackageInterface $package, PackageInterface $prev } /** - * {@inheritDoc} + * @inheritDoc */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -90,7 +90,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa } /** - * {@inheritDoc} + * @inheritDoc */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { @@ -107,7 +107,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini } /** - * {@inheritDoc} + * @inheritDoc */ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -123,7 +123,7 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $ } /** - * {@inheritDoc} + * @inheritDoc */ public function getInstallPath(PackageInterface $package) { diff --git a/app/vendor/composer/composer/src/Composer/Installer/NoopInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/NoopInstaller.php index 1342db4ac..d1aa1fa18 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/NoopInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/NoopInstaller.php @@ -25,7 +25,7 @@ class NoopInstaller implements InstallerInterface { /** - * {@inheritDoc} + * @inheritDoc */ public function supports($packageType) { @@ -33,7 +33,7 @@ public function supports($packageType) } /** - * {@inheritDoc} + * @inheritDoc */ public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -41,7 +41,7 @@ public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface } /** - * {@inheritDoc} + * @inheritDoc */ public function download(PackageInterface $package, PackageInterface $prevPackage = null) { @@ -49,7 +49,7 @@ public function download(PackageInterface $package, PackageInterface $prevPackag } /** - * {@inheritDoc} + * @inheritDoc */ public function prepare($type, PackageInterface $package, PackageInterface $prevPackage = null) { @@ -57,7 +57,7 @@ public function prepare($type, PackageInterface $package, PackageInterface $prev } /** - * {@inheritDoc} + * @inheritDoc */ public function cleanup($type, PackageInterface $package, PackageInterface $prevPackage = null) { @@ -65,7 +65,7 @@ public function cleanup($type, PackageInterface $package, PackageInterface $prev } /** - * {@inheritDoc} + * @inheritDoc */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -77,7 +77,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa } /** - * {@inheritDoc} + * @inheritDoc */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { @@ -94,7 +94,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini } /** - * {@inheritDoc} + * @inheritDoc */ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -107,7 +107,7 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $ } /** - * {@inheritDoc} + * @inheritDoc */ public function getInstallPath(PackageInterface $package) { diff --git a/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php index 120253216..3fc09638b 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php @@ -40,7 +40,7 @@ public function __construct(IOInterface $io, Composer $composer, Filesystem $fs } /** - * {@inheritDoc} + * @inheritDoc */ public function supports($packageType) { @@ -48,7 +48,7 @@ public function supports($packageType) } /** - * {@inheritDoc} + * @inheritDoc */ public function download(PackageInterface $package, PackageInterface $prevPackage = null) { @@ -61,7 +61,7 @@ public function download(PackageInterface $package, PackageInterface $prevPackag } /** - * {@inheritDoc} + * @inheritDoc */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -84,7 +84,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa } /** - * {@inheritDoc} + * @inheritDoc */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { @@ -117,6 +117,8 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $ /** * TODO v3 should make this private once we can drop PHP 5.3 support * @private + * + * @return void */ public function rollbackInstall(\Exception $e, InstalledRepositoryInterface $repo, PackageInterface $package) { diff --git a/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php index d03e97521..42bb77aca 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php @@ -32,6 +32,9 @@ class ProjectInstaller implements InstallerInterface /** @var Filesystem */ private $filesystem; + /** + * @param string $installPath + */ public function __construct($installPath, DownloadManager $dm, Filesystem $fs) { $this->installPath = rtrim(strtr($installPath, '\\', '/'), '/').'/'; @@ -51,7 +54,7 @@ public function supports($packageType) } /** - * {@inheritDoc} + * @inheritDoc */ public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -59,7 +62,7 @@ public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface } /** - * {@inheritDoc} + * @inheritDoc */ public function download(PackageInterface $package, PackageInterface $prevPackage = null) { @@ -75,7 +78,7 @@ public function download(PackageInterface $package, PackageInterface $prevPackag } /** - * {@inheritDoc} + * @inheritDoc */ public function prepare($type, PackageInterface $package, PackageInterface $prevPackage = null) { @@ -83,7 +86,7 @@ public function prepare($type, PackageInterface $package, PackageInterface $prev } /** - * {@inheritDoc} + * @inheritDoc */ public function cleanup($type, PackageInterface $package, PackageInterface $prevPackage = null) { @@ -91,7 +94,7 @@ public function cleanup($type, PackageInterface $package, PackageInterface $prev } /** - * {@inheritDoc} + * @inheritDoc */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { @@ -99,7 +102,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa } /** - * {@inheritDoc} + * @inheritDoc */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { @@ -107,7 +110,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini } /** - * {@inheritDoc} + * @inheritDoc */ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) { diff --git a/app/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php b/app/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php index 4db5931d3..901852307 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php +++ b/app/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php @@ -44,7 +44,7 @@ public function __construct(IOInterface $io) } /** - * @return array Suggested packages with source, target and reason keys. + * @return array Suggested packages with source, target and reason keys. */ public function getPackages() { diff --git a/app/vendor/composer/composer/src/Composer/Json/JsonFile.php b/app/vendor/composer/composer/src/Composer/Json/JsonFile.php index 1f830452c..a83f2fd73 100644 --- a/app/vendor/composer/composer/src/Composer/Json/JsonFile.php +++ b/app/vendor/composer/composer/src/Composer/Json/JsonFile.php @@ -115,9 +115,10 @@ public function read() /** * Writes json file. * - * @param array $hash writes hash into json file + * @param mixed[] $hash writes hash into json file * @param int $options json_encode options (defaults to JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) * @throws \UnexpectedValueException|\Exception + * @return void */ public function write(array $hash, $options = 448) { @@ -158,7 +159,11 @@ public function write(array $hash, $options = 448) } /** - * modify file properties only if content modified + * Modify file properties only if content modified + * + * @param string $path + * @param string $content + * @return int|false */ private function filePutContentsIfModified($path, $content) { @@ -268,6 +273,7 @@ public static function encode($data, $options = 448) * * @param int $code return code of json_last_error function * @throws \RuntimeException + * @return void */ private static function throwEncodeError($code) { diff --git a/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php b/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php index b1c82a687..2d8b1afeb 100644 --- a/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php +++ b/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php @@ -37,6 +37,9 @@ class JsonManipulator /** @var string */ private $indent; + /** + * @param string $contents + */ public function __construct($contents) { $contents = trim($contents); @@ -51,11 +54,21 @@ public function __construct($contents) $this->detectIndenting(); } + /** + * @return string + */ public function getContents() { return $this->contents . $this->newline; } + /** + * @param string $type + * @param string $package + * @param string $constraint + * @param bool $sortPackages + * @return bool + */ public function addLink($type, $package, $constraint, $sortPackages = false) { $decoded = JsonFile::parseJson($this->contents); @@ -116,7 +129,8 @@ public function addLink($type, $package, $constraint, $sortPackages = false) * * @link https://getcomposer.org/doc/02-libraries.md#platform-packages * - * @param array $packages + * @param array $packages + * @return void */ private function sortPackages(array &$packages = array()) { @@ -149,26 +163,50 @@ private function sortPackages(array &$packages = array()) }); } + /** + * @param string $name + * @param array $config + * @param bool $append + * @return bool + */ public function addRepository($name, $config, $append = true) { return $this->addSubNode('repositories', $name, $config, $append); } + /** + * @param string $name + * @return bool + */ public function removeRepository($name) { return $this->removeSubNode('repositories', $name); } + /** + * @param string $name + * @param mixed $value + * @return bool + */ public function addConfigSetting($name, $value) { return $this->addSubNode('config', $name, $value); } + /** + * @param string $name + * @return bool + */ public function removeConfigSetting($name) { return $this->removeSubNode('config', $name); } + /** + * @param string $name + * @param mixed $value + * @return bool + */ public function addProperty($name, $value) { if (strpos($name, 'suggest.') === 0) { @@ -186,6 +224,10 @@ public function addProperty($name, $value) return $this->addMainKey($name, $value); } + /** + * @param string $name + * @return bool + */ public function removeProperty($name) { if (strpos($name, 'suggest.') === 0) { @@ -203,6 +245,13 @@ public function removeProperty($name) return $this->removeMainKey($name); } + /** + * @param string $mainNode + * @param string $name + * @param mixed $value + * @param bool $append + * @return bool + */ public function addSubNode($mainNode, $name, $value, $append = true) { $decoded = JsonFile::parseJson($this->contents); @@ -310,6 +359,11 @@ public function addSubNode($mainNode, $name, $value, $append = true) return true; } + /** + * @param string $mainNode + * @param string $name + * @return bool + */ public function removeSubNode($mainNode, $name) { $decoded = JsonFile::parseJson($this->contents); @@ -411,6 +465,11 @@ public function removeSubNode($mainNode, $name) return true; } + /** + * @param string $key + * @param mixed $content + * @return bool + */ public function addMainKey($key, $content) { $decoded = JsonFile::parseJson($this->contents); @@ -451,6 +510,10 @@ public function addMainKey($key, $content) return true; } + /** + * @param string $key + * @return bool + */ public function removeMainKey($key) { $decoded = JsonFile::parseJson($this->contents); @@ -484,6 +547,10 @@ public function removeMainKey($key) return false; } + /** + * @param string $key + * @return bool + */ public function removeMainKeyIfEmpty($key) { $decoded = JsonFile::parseJson($this->contents); @@ -499,6 +566,11 @@ public function removeMainKeyIfEmpty($key) return true; } + /** + * @param mixed $data + * @param int $depth + * @return string + */ public function format($data, $depth = 0) { if (is_array($data)) { @@ -524,6 +596,9 @@ public function format($data, $depth = 0) return JsonFile::encode($data); } + /** + * @return void + */ protected function detectIndenting() { if ($this->pregMatch('{^([ \t]+)"}m', $this->contents, $match)) { @@ -533,6 +608,12 @@ protected function detectIndenting() } } + /** + * @param string $re + * @param string $str + * @param array $matches + * @return int + */ protected function pregMatch($re, $str, &$matches = array()) { $count = preg_match($re, $str, $matches); diff --git a/app/vendor/composer/composer/src/Composer/Package/AliasPackage.php b/app/vendor/composer/composer/src/Composer/Package/AliasPackage.php index c993230c6..4dd2bd9aa 100644 --- a/app/vendor/composer/composer/src/Composer/Package/AliasPackage.php +++ b/app/vendor/composer/composer/src/Composer/Package/AliasPackage.php @@ -20,11 +20,20 @@ */ class AliasPackage extends BasePackage { + /** @var string */ protected $version; + /** @var string */ protected $prettyVersion; + /** @var bool */ protected $dev; + /** @var bool */ protected $rootPackageAlias = false; + /** + * @var string + * @phpstan-var 'stable'|'RC'|'beta'|'alpha'|'dev' + */ protected $stability; + /** @var bool */ protected $hasSelfVersionRequires = false; /** @var BasePackage */ @@ -72,7 +81,7 @@ public function getAliasOf() } /** - * {@inheritDoc} + * @inheritDoc */ public function getVersion() { @@ -80,7 +89,7 @@ public function getVersion() } /** - * {@inheritDoc} + * @inheritDoc */ public function getStability() { @@ -88,7 +97,7 @@ public function getStability() } /** - * {@inheritDoc} + * @inheritDoc */ public function getPrettyVersion() { @@ -96,7 +105,7 @@ public function getPrettyVersion() } /** - * {@inheritDoc} + * @inheritDoc */ public function isDev() { @@ -104,7 +113,7 @@ public function isDev() } /** - * {@inheritDoc} + * @inheritDoc */ public function getRequires() { @@ -112,7 +121,7 @@ public function getRequires() } /** - * {@inheritDoc} + * @inheritDoc * @return array */ public function getConflicts() @@ -121,7 +130,7 @@ public function getConflicts() } /** - * {@inheritDoc} + * @inheritDoc * @return array */ public function getProvides() @@ -130,7 +139,7 @@ public function getProvides() } /** - * {@inheritDoc} + * @inheritDoc * @return array */ public function getReplaces() @@ -139,7 +148,7 @@ public function getReplaces() } /** - * {@inheritDoc} + * @inheritDoc */ public function getDevRequires() { @@ -208,6 +217,9 @@ protected function replaceSelfVersionDependencies(array $links, $linkType) return $links; } + /** + * @return bool + */ public function hasSelfVersionRequires() { return $this->hasSelfVersionRequires; diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFilter.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFilter.php index f49486a04..6f25923d7 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFilter.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFilter.php @@ -17,6 +17,7 @@ class ArchivableFilesFilter extends FilterIterator { + /** @var string[] */ private $dirs = array(); /** @@ -35,6 +36,11 @@ public function accept() return true; } + /** + * @param string $sources + * + * @return void + */ public function addEmptyDir(PharData $phar, $sources) { foreach ($this->dirs as $filepath) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php index 98cdf941b..96459f872 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php @@ -35,9 +35,9 @@ class ArchivableFilesFinder extends \FilterIterator /** * Initializes the internal Symfony Finder with appropriate filters * - * @param string $sources Path to source files to be archived - * @param array $excludes Composer's own exclude rules from composer.json - * @param bool $ignoreFilters Ignore filters when looking for files + * @param string $sources Path to source files to be archived + * @param string[] $excludes Composer's own exclude rules from composer.json + * @param bool $ignoreFilters Ignore filters when looking for files */ public function __construct($sources, array $excludes, $ignoreFilters = false) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php index 356c53646..d41d5df1b 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php @@ -52,6 +52,8 @@ public function __construct(DownloadManager $downloadManager, Loop $loop) /** * @param ArchiverInterface $archiver + * + * @return void */ public function addArchiver(ArchiverInterface $archiver) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiverInterface.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiverInterface.php index 4e5fa54f9..4ea8dc485 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiverInterface.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiverInterface.php @@ -22,10 +22,11 @@ interface ArchiverInterface /** * Create an archive from the sources. * - * @param string $sources The sources directory - * @param string $target The target file - * @param string $format The format used for archive - * @param array $excludes A list of patterns for files to exclude + * @param string $sources The sources directory + * @param string $target The target file + * @param string $format The format used for archive + * @param string[] $excludes A list of patterns for files to exclude + * @param bool $ignoreFilters Whether to ignore filters when looking for files * * @return string The path to the written archive file */ diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/BaseExcludeFilter.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/BaseExcludeFilter.php index a67ad272a..71462ef98 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/BaseExcludeFilter.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/BaseExcludeFilter.php @@ -25,7 +25,7 @@ abstract class BaseExcludeFilter protected $sourcePath; /** - * @var array + * @var array array of [$pattern, $negate, $stripLeadingSlash] arrays */ protected $excludePatterns; @@ -44,7 +44,7 @@ public function __construct($sourcePath) * Negated patterns overwrite exclude decisions of previous filters. * * @param string $relativePath The file's path relative to the sourcePath - * @param bool $exclude Whether a previous filter wants to exclude this file + * @param bool $exclude Whether a previous filter wants to exclude this file * * @return bool Whether the file should be excluded */ @@ -70,10 +70,10 @@ public function filter($relativePath, $exclude) /** * Processes a file containing exclude rules of different formats per line * - * @param array $lines A set of lines to be parsed + * @param string[] $lines A set of lines to be parsed * @param callable $lineParser The parser to be used on each line * - * @return array Exclude patterns to be used in filter() + * @return array Exclude patterns to be used in filter() */ protected function parseLines(array $lines, $lineParser) { @@ -99,9 +99,9 @@ function ($pattern) { /** * Generates a set of exclude patterns for filter() from gitignore rules * - * @param array $rules A list of exclude rules in gitignore syntax + * @param string[] $rules A list of exclude rules in gitignore syntax * - * @return array Exclude patterns + * @return array Exclude patterns */ protected function generatePatterns($rules) { @@ -118,7 +118,7 @@ protected function generatePatterns($rules) * * @param string $rule An exclude rule in gitignore syntax * - * @return array An exclude pattern + * @return array{0: string, 1: bool, 2: bool} An exclude pattern */ protected function generatePattern($rule) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ComposerExcludeFilter.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ComposerExcludeFilter.php index 9e663869c..3a5a5179d 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ComposerExcludeFilter.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ComposerExcludeFilter.php @@ -20,8 +20,8 @@ class ComposerExcludeFilter extends BaseExcludeFilter { /** - * @param string $sourcePath Directory containing sources to be filtered - * @param array $excludeRules An array of exclude rules from composer.json + * @param string $sourcePath Directory containing sources to be filtered + * @param string[] $excludeRules An array of exclude rules from composer.json */ public function __construct($sourcePath, array $excludeRules) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/GitExcludeFilter.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/GitExcludeFilter.php index f79734855..f08d460f7 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/GitExcludeFilter.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/GitExcludeFilter.php @@ -52,7 +52,7 @@ public function __construct($sourcePath) * * @param string $line A line from .gitignore * - * @return array An exclude pattern for filter() + * @return array{0: string, 1: bool, 2: bool} An exclude pattern for filter() */ public function parseGitIgnoreLine($line) { @@ -64,7 +64,7 @@ public function parseGitIgnoreLine($line) * * @param string $line A line from .gitattributes * - * @return array|null An exclude pattern for filter() + * @return array{0: string, 1: bool, 2: bool}|null An exclude pattern for filter() */ public function parseGitAttributesLine($line) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php index b83b7756b..95880475e 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php @@ -54,7 +54,7 @@ public function __construct($sourcePath) * * @param string $line A line from .hgignore * - * @return array|null An exclude pattern for filter() + * @return array{0: string, 1: bool, 2: bool}|null An exclude pattern for filter() */ public function parseHgIgnoreLine($line) { @@ -80,7 +80,7 @@ public function parseHgIgnoreLine($line) * * @param string $line A line from .hgignore in glob mode * - * @return array An exclude pattern for filter() + * @return array{0: string, 1: bool, 2: bool} An exclude pattern for filter() */ protected function patternFromGlob($line) { @@ -95,7 +95,7 @@ protected function patternFromGlob($line) * * @param string $line A line from .hgignore in regexp mode * - * @return array An exclude pattern for filter() + * @return array{0: string, 1: bool, 2: bool} An exclude pattern for filter() */ public function patternFromRegex($line) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php index 955d1b3c9..582e4537e 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php @@ -19,6 +19,7 @@ */ class PharArchiver implements ArchiverInterface { + /** @var array */ protected static $formats = array( 'zip' => \Phar::ZIP, 'tar' => \Phar::TAR, @@ -26,13 +27,14 @@ class PharArchiver implements ArchiverInterface 'tar.bz2' => \Phar::TAR, ); + /** @var array */ protected static $compressFormats = array( 'tar.gz' => \Phar::GZ, 'tar.bz2' => \Phar::BZ2, ); /** - * {@inheritdoc} + * @inheritDoc */ public function archive($sources, $target, $format, array $excludes = array(), $ignoreFilters = false) { @@ -93,7 +95,7 @@ public function archive($sources, $target, $format, array $excludes = array(), $ } /** - * {@inheritdoc} + * @inheritDoc */ public function supports($format, $sourceType) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php index c0ce41d65..46d610dd9 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php @@ -20,12 +20,13 @@ */ class ZipArchiver implements ArchiverInterface { + /** @var array */ protected static $formats = array( - 'zip' => 1, + 'zip' => true, ); /** - * {@inheritdoc} + * @inheritDoc */ public function archive($sources, $target, $format, array $excludes = array(), $ignoreFilters = false) { @@ -76,13 +77,16 @@ public function archive($sources, $target, $format, array $excludes = array(), $ } /** - * {@inheritdoc} + * @inheritDoc */ public function supports($format, $sourceType) { return isset(static::$formats[$format]) && $this->compressionAvailable(); } + /** + * @return bool + */ private function compressionAvailable() { return class_exists('ZipArchive'); diff --git a/app/vendor/composer/composer/src/Composer/Package/BasePackage.php b/app/vendor/composer/composer/src/Composer/Package/BasePackage.php index 04a57f5bc..27a1edb48 100644 --- a/app/vendor/composer/composer/src/Composer/Package/BasePackage.php +++ b/app/vendor/composer/composer/src/Composer/Package/BasePackage.php @@ -23,7 +23,7 @@ abstract class BasePackage implements PackageInterface { /** - * @phpstan-var array + * @phpstan-var array * @internal */ public static $supportedLinkTypes = array( @@ -40,6 +40,7 @@ abstract class BasePackage implements PackageInterface const STABILITY_ALPHA = 15; const STABILITY_DEV = 20; + /** @var array */ public static $stabilities = array( 'stable' => self::STABILITY_STABLE, 'RC' => self::STABILITY_RC, @@ -75,7 +76,7 @@ public function __construct($name) } /** - * {@inheritDoc} + * @inheritDoc */ public function getName() { @@ -83,7 +84,7 @@ public function getName() } /** - * {@inheritDoc} + * @inheritDoc */ public function getPrettyName() { @@ -91,7 +92,7 @@ public function getPrettyName() } /** - * {@inheritDoc} + * @inheritDoc */ public function getNames($provides = true) { @@ -113,7 +114,7 @@ public function getNames($provides = true) } /** - * {@inheritDoc} + * @inheritDoc */ public function setId($id) { @@ -121,7 +122,7 @@ public function setId($id) } /** - * {@inheritDoc} + * @inheritDoc */ public function getId() { @@ -129,7 +130,7 @@ public function getId() } /** - * {@inheritDoc} + * @inheritDoc */ public function setRepository(RepositoryInterface $repository) { @@ -140,7 +141,7 @@ public function setRepository(RepositoryInterface $repository) } /** - * {@inheritDoc} + * @inheritDoc */ public function getRepository() { @@ -167,6 +168,9 @@ public function getUniqueName() return $this->getName().'-'.$this->getVersion(); } + /** + * @return bool + */ public function equals(PackageInterface $package) { $self = $this; @@ -196,7 +200,7 @@ public function getPrettyString() } /** - * {@inheritDoc} + * @inheritDoc */ public function getFullPrettyVersion($truncate = true, $displayMode = PackageInterface::DISPLAY_SOURCE_REF_IF_DEV) { @@ -230,6 +234,11 @@ public function getFullPrettyVersion($truncate = true, $displayMode = PackageInt return $this->getPrettyVersion() . ' ' . $reference; } + /** + * @return int + * + * @phpstan-return self::STABILITY_* + */ public function getStabilityPriority() { return self::$stabilities[$this->getStability()]; diff --git a/app/vendor/composer/composer/src/Composer/Package/Comparer/Comparer.php b/app/vendor/composer/composer/src/Composer/Package/Comparer/Comparer.php index 652a94d28..06ebf7daa 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Comparer/Comparer.php +++ b/app/vendor/composer/composer/src/Composer/Package/Comparer/Comparer.php @@ -19,20 +19,39 @@ */ class Comparer { + /** @var string Source directory */ private $source; + /** @var string Target directory */ private $update; + /** @var array{changed?: string[], removed?: string[], added?: string[]} */ private $changed; + /** + * @param string $source + * + * @return void + */ public function setSource($source) { $this->source = $source; } + /** + * @param string $update + * + * @return void + */ public function setUpdate($update) { $this->update = $update; } + /** + * @param bool $toString + * @param bool $explicated + * + * @return array{changed?: string[], removed?: string[], added?: string[]}|string|false false if no change, string only if $toString is true + */ public function getChanged($toString = false, $explicated = false) { $changed = $this->changed; @@ -59,6 +78,9 @@ public function getChanged($toString = false, $explicated = false) return $changed; } + /** + * @return void + */ public function doCompare() { $source = array(); @@ -97,6 +119,12 @@ public function doCompare() } } + /** + * @param string $dir + * @param mixed $array + * + * @return array>|false + */ private function doTree($dir, &$array) { if ($dh = opendir($dir)) { diff --git a/app/vendor/composer/composer/src/Composer/Package/CompletePackage.php b/app/vendor/composer/composer/src/Composer/Package/CompletePackage.php index dc0b115c3..5a6ec4cb2 100644 --- a/app/vendor/composer/composer/src/Composer/Package/CompletePackage.php +++ b/app/vendor/composer/composer/src/Composer/Package/CompletePackage.php @@ -19,21 +19,33 @@ */ class CompletePackage extends Package implements CompletePackageInterface { + /** @var mixed[] */ protected $repositories = array(); + /** @var string[] */ protected $license = array(); + /** @var string[] */ protected $keywords = array(); + /** @var array */ protected $authors = array(); - protected $description; - protected $homepage; + /** @var ?string */ + protected $description = null; + /** @var ?string */ + protected $homepage = null; + /** @var array Map of script name to array of handlers */ protected $scripts = array(); + /** @var array{issues?: string, forum?: string, wiki?: string, source?: string, email?: string, irc?: string, docs?: string, rss?: string, chat?: string} */ protected $support = array(); + /** @var array */ protected $funding = array(); + /** @var bool|string */ protected $abandoned = false; - protected $archiveName; + /** @var ?string */ + protected $archiveName = null; + /** @var string[] */ protected $archiveExcludes = array(); /** - * {@inheritDoc} + * @inheritDoc */ public function setScripts(array $scripts) { @@ -41,7 +53,7 @@ public function setScripts(array $scripts) } /** - * {@inheritDoc} + * @inheritDoc */ public function getScripts() { @@ -49,7 +61,7 @@ public function getScripts() } /** - * {@inheritDoc} + * @inheritDoc */ public function setRepositories(array $repositories) { @@ -57,7 +69,7 @@ public function setRepositories(array $repositories) } /** - * {@inheritDoc} + * @inheritDoc */ public function getRepositories() { @@ -65,7 +77,7 @@ public function getRepositories() } /** - * {@inheritDoc} + * @inheritDoc */ public function setLicense(array $license) { @@ -73,7 +85,7 @@ public function setLicense(array $license) } /** - * {@inheritDoc} + * @inheritDoc */ public function getLicense() { @@ -81,7 +93,7 @@ public function getLicense() } /** - * {@inheritDoc} + * @inheritDoc */ public function setKeywords(array $keywords) { @@ -89,7 +101,7 @@ public function setKeywords(array $keywords) } /** - * {@inheritDoc} + * @inheritDoc */ public function getKeywords() { @@ -97,7 +109,7 @@ public function getKeywords() } /** - * {@inheritDoc} + * @inheritDoc */ public function setAuthors(array $authors) { @@ -105,7 +117,7 @@ public function setAuthors(array $authors) } /** - * {@inheritDoc} + * @inheritDoc */ public function getAuthors() { @@ -113,7 +125,7 @@ public function getAuthors() } /** - * {@inheritDoc} + * @inheritDoc */ public function setDescription($description) { @@ -121,7 +133,7 @@ public function setDescription($description) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDescription() { @@ -129,7 +141,7 @@ public function getDescription() } /** - * {@inheritDoc} + * @inheritDoc */ public function setHomepage($homepage) { @@ -137,7 +149,7 @@ public function setHomepage($homepage) } /** - * {@inheritDoc} + * @inheritDoc */ public function getHomepage() { @@ -145,7 +157,7 @@ public function getHomepage() } /** - * {@inheritDoc} + * @inheritDoc */ public function setSupport(array $support) { @@ -153,7 +165,7 @@ public function setSupport(array $support) } /** - * {@inheritDoc} + * @inheritDoc */ public function getSupport() { @@ -161,7 +173,7 @@ public function getSupport() } /** - * {@inheritDoc} + * @inheritDoc */ public function setFunding(array $funding) { @@ -169,7 +181,7 @@ public function setFunding(array $funding) } /** - * {@inheritDoc} + * @inheritDoc */ public function getFunding() { @@ -177,7 +189,7 @@ public function getFunding() } /** - * {@inheritDoc} + * @inheritDoc */ public function isAbandoned() { @@ -185,7 +197,7 @@ public function isAbandoned() } /** - * {@inheritDoc} + * @inheritDoc */ public function setAbandoned($abandoned) { @@ -193,7 +205,7 @@ public function setAbandoned($abandoned) } /** - * {@inheritDoc} + * @inheritDoc */ public function getReplacementPackage() { @@ -201,7 +213,7 @@ public function getReplacementPackage() } /** - * {@inheritDoc} + * @inheritDoc */ public function setArchiveName($name) { @@ -209,7 +221,7 @@ public function setArchiveName($name) } /** - * {@inheritDoc} + * @inheritDoc */ public function getArchiveName() { @@ -217,7 +229,7 @@ public function getArchiveName() } /** - * {@inheritDoc} + * @inheritDoc */ public function setArchiveExcludes(array $excludes) { @@ -225,7 +237,7 @@ public function setArchiveExcludes(array $excludes) } /** - * {@inheritDoc} + * @inheritDoc */ public function getArchiveExcludes() { diff --git a/app/vendor/composer/composer/src/Composer/Package/CompletePackageInterface.php b/app/vendor/composer/composer/src/Composer/Package/CompletePackageInterface.php index 0d9425496..00e4a088e 100644 --- a/app/vendor/composer/composer/src/Composer/Package/CompletePackageInterface.php +++ b/app/vendor/composer/composer/src/Composer/Package/CompletePackageInterface.php @@ -22,7 +22,7 @@ interface CompletePackageInterface extends PackageInterface /** * Returns the scripts of this package * - * @return array array('script name' => array('listeners')) + * @return array Map of script name to array of handlers */ public function getScripts(); @@ -35,14 +35,14 @@ public function setScripts(array $scripts); /** * Returns an array of repositories * - * @return array Repositories + * @return mixed[] Repositories */ public function getRepositories(); /** * Set the repositories * - * @param array $repositories + * @param mixed[] $repositories * @return void */ public function setRepositories(array $repositories); @@ -80,7 +80,7 @@ public function setKeywords(array $keywords); /** * Returns the package description * - * @return string + * @return ?string */ public function getDescription(); @@ -95,7 +95,7 @@ public function setDescription($description); /** * Returns the package homepage * - * @return string + * @return ?string */ public function getHomepage(); @@ -127,14 +127,14 @@ public function setAuthors(array $authors); /** * Returns the support information * - * @return array + * @return array{issues?: string, forum?: string, wiki?: string, source?: string, email?: string, irc?: string, docs?: string, rss?: string, chat?: string} */ public function getSupport(); /** * Set the support information * - * @param array $support + * @param array{issues?: string, forum?: string, wiki?: string, source?: string, email?: string, irc?: string, docs?: string, rss?: string, chat?: string} $support * @return void */ public function setSupport(array $support); @@ -144,14 +144,14 @@ public function setSupport(array $support); * * Each item will contain type and url keys * - * @return array + * @return array */ public function getFunding(); /** * Set the funding * - * @param array $funding + * @param array $funding * @return void */ public function setFunding(array $funding); @@ -179,7 +179,7 @@ public function setAbandoned($abandoned); /** * Returns default base filename for archive * - * @return array + * @return ?string */ public function getArchiveName(); @@ -194,7 +194,7 @@ public function setArchiveName($name); /** * Returns a list of patterns to exclude from package archives * - * @return array + * @return string[] */ public function getArchiveExcludes(); diff --git a/app/vendor/composer/composer/src/Composer/Package/Dumper/ArrayDumper.php b/app/vendor/composer/composer/src/Composer/Package/Dumper/ArrayDumper.php index e3b053b87..9b6e40946 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Dumper/ArrayDumper.php +++ b/app/vendor/composer/composer/src/Composer/Package/Dumper/ArrayDumper.php @@ -23,6 +23,9 @@ */ class ArrayDumper { + /** + * @return array + */ public function dump(PackageInterface $package) { $keys = array( @@ -139,6 +142,12 @@ public function dump(PackageInterface $package) return $data; } + /** + * @param array $keys + * @param array $data + * + * @return array + */ private function dumpValues(PackageInterface $package, array $keys, array $data) { foreach ($keys as $method => $key) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php b/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php index 4367b9a3a..fce22dffb 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php +++ b/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php @@ -12,7 +12,6 @@ namespace Composer\Package\Loader; -use Composer\Package\AliasPackage; use Composer\Package\BasePackage; use Composer\Package\CompleteAliasPackage; use Composer\Package\CompletePackage; @@ -20,9 +19,7 @@ use Composer\Package\PackageInterface; use Composer\Package\CompletePackageInterface; use Composer\Package\Link; -use Composer\Package\Package; use Composer\Package\RootAliasPackage; -use Composer\Package\RootPackageInterface; use Composer\Package\Version\VersionParser; /** @@ -31,9 +28,14 @@ */ class ArrayLoader implements LoaderInterface { + /** @var VersionParser */ protected $versionParser; + /** @var bool */ protected $loadOptions; + /** + * @param bool $loadOptions + */ public function __construct(VersionParser $parser = null, $loadOptions = false) { if (!$parser) { @@ -44,14 +46,7 @@ public function __construct(VersionParser $parser = null, $loadOptions = false) } /** - * @template PackageClass of CompletePackageInterface - * - * @param array $config package data - * @param string $class FQCN to be instantiated - * - * @return CompletePackage|CompleteAliasPackage|RootPackage|RootAliasPackage - * - * @phpstan-param class-string $class + * @inheritDoc */ public function load(array $config, $class = 'Composer\Package\CompletePackage') { @@ -81,7 +76,8 @@ public function load(array $config, $class = 'Composer\Package\CompletePackage') } /** - * @param array $versions + * @param list> $versions + * * @return list */ public function loadPackages(array $versions) @@ -103,9 +99,12 @@ public function loadPackages(array $versions) /** * @template PackageClass of CompletePackageInterface - * @param array $config package data - * @param string $class FQCN to be instantiated + * + * @param mixed[] $config package data + * @param string $class FQCN to be instantiated + * * @return CompletePackage|RootPackage + * * @phpstan-param class-string $class */ private function createObject(array $config, $class) @@ -133,8 +132,9 @@ private function createObject(array $config, $class) } /** - * @param CompletePackage $package - * @param array $config package data + * @param CompletePackage $package + * @param mixed[] $config package data + * * @return RootPackage|RootAliasPackage|CompletePackage|CompleteAliasPackage */ private function configureObject(PackageInterface $package, array $config) @@ -309,9 +309,10 @@ private function configureObject(PackageInterface $package, array $config) } /** - * @param array $linkCache - * @param PackageInterface $package - * @param array $config + * @param array>>> $linkCache + * @param PackageInterface $package + * @param mixed[] $config + * * @return void */ private function configureCachedLinks(&$linkCache, $package, array $config) @@ -344,11 +345,14 @@ private function configureCachedLinks(&$linkCache, $package, array $config) } /** - * @param string $source source package name - * @param string $sourceVersion source package version (pretty version ideally) - * @param Link::TYPE_* $description link description (e.g. requires, replaces, ..) - * @param array $links array of package name => constraint mappings + * @param string $source source package name + * @param string $sourceVersion source package version (pretty version ideally) + * @param string $description link description (e.g. requires, replaces, ..) + * @param array $links array of package name => constraint mappings + * * @return Link[] + * + * @phpstan-param Link::TYPE_* $description */ public function parseLinks($source, $sourceVersion, $description, $links) { @@ -385,7 +389,8 @@ private function createLink($source, $sourceVersion, $description, $target, $pre /** * Retrieves a branch alias (dev-master => 1.0.x-dev for example) if it exists * - * @param array $config the entire package config + * @param mixed[] $config the entire package config + * * @return string|null normalized version of the branch alias or null if there is none */ public function getBranchAlias(array $config) diff --git a/app/vendor/composer/composer/src/Composer/Package/Loader/InvalidPackageException.php b/app/vendor/composer/composer/src/Composer/Package/Loader/InvalidPackageException.php index 2f0c845c6..25141de25 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Loader/InvalidPackageException.php +++ b/app/vendor/composer/composer/src/Composer/Package/Loader/InvalidPackageException.php @@ -17,10 +17,18 @@ */ class InvalidPackageException extends \Exception { + /** @var string[] */ private $errors; + /** @var string[] */ private $warnings; + /** @var mixed[] package config */ private $data; + /** + * @param string[] $errors + * @param string[] $warnings + * @param mixed[] $data + */ public function __construct(array $errors, array $warnings, array $data) { $this->errors = $errors; @@ -29,16 +37,25 @@ public function __construct(array $errors, array $warnings, array $data) parent::__construct("Invalid package information: \n".implode("\n", array_merge($errors, $warnings))); } + /** + * @return mixed[] + */ public function getData() { return $this->data; } + /** + * @return string[] + */ public function getErrors() { return $this->errors; } + /** + * @return string[] + */ public function getWarnings() { return $this->warnings; diff --git a/app/vendor/composer/composer/src/Composer/Package/Loader/JsonLoader.php b/app/vendor/composer/composer/src/Composer/Package/Loader/JsonLoader.php index 66f75c034..9e9ae689e 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Loader/JsonLoader.php +++ b/app/vendor/composer/composer/src/Composer/Package/Loader/JsonLoader.php @@ -21,6 +21,7 @@ */ class JsonLoader { + /** @var LoaderInterface */ private $loader; public function __construct(LoaderInterface $loader) diff --git a/app/vendor/composer/composer/src/Composer/Package/Loader/LoaderInterface.php b/app/vendor/composer/composer/src/Composer/Package/Loader/LoaderInterface.php index 295ddf95b..9a89d68aa 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Loader/LoaderInterface.php +++ b/app/vendor/composer/composer/src/Composer/Package/Loader/LoaderInterface.php @@ -12,6 +12,12 @@ namespace Composer\Package\Loader; +use Composer\Package\CompletePackageInterface; +use Composer\Package\CompletePackage; +use Composer\Package\CompleteAliasPackage; +use Composer\Package\RootAliasPackage; +use Composer\Package\RootPackage; + /** * Defines a loader that takes an array to create package instances * @@ -22,9 +28,14 @@ interface LoaderInterface /** * Converts a package from an array to a real instance * - * @param array $package Package config - * @param string $class Package class to use - * @return \Composer\Package\PackageInterface + * @template PackageClass of CompletePackageInterface + * + * @param mixed[] $config package data + * @param string $class FQCN to be instantiated + * + * @return CompletePackage|CompleteAliasPackage|RootPackage|RootAliasPackage + * + * @phpstan-param class-string $class */ - public function load(array $package, $class = 'Composer\Package\CompletePackage'); + public function load(array $config, $class = 'Composer\Package\CompletePackage'); } diff --git a/app/vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php b/app/vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php index f2e7ebf86..ed9a4a88c 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php +++ b/app/vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php @@ -15,7 +15,6 @@ use Composer\Package\BasePackage; use Composer\Config; use Composer\IO\IOInterface; -use Composer\Package\Package; use Composer\Package\RootAliasPackage; use Composer\Repository\RepositoryFactory; use Composer\Package\Version\VersionGuesser; @@ -58,11 +57,15 @@ public function __construct(RepositoryManager $manager, Config $config, VersionP } /** + * @inheritDoc + * * @template PackageClass of RootPackage - * @param array $config package data - * @param class-string $class FQCN to be instantiated - * @param string $cwd cwd of the root package to be used to guess the version if it is not provided + * + * @param string|null $cwd + * * @return RootPackage|RootAliasPackage + * + * @phpstan-param class-string $class */ public function load(array $config, $class = 'Composer\Package\RootPackage', $cwd = null) { @@ -183,6 +186,12 @@ public function load(array $config, $class = 'Composer\Package\RootPackage', $cw return $package; } + /** + * @param array $requires + * @param list $aliases + * + * @return list + */ private function extractAliases(array $requires, array $aliases) { foreach ($requires as $reqName => $reqVersion) { @@ -203,10 +212,20 @@ private function extractAliases(array $requires, array $aliases) /** * @internal + * + * @param array $requires + * @param string $minimumStability + * @param array $stabilityFlags + * + * @return array + * + * @phpstan-param array $stabilityFlags + * @phpstan-return array */ public static function extractStabilityFlags(array $requires, $minimumStability, array $stabilityFlags) { $stabilities = BasePackage::$stabilities; + /** @var int $minimumStability */ $minimumStability = $stabilities[$minimumStability]; foreach ($requires as $reqName => $reqVersion) { $constraints = array(); @@ -259,6 +278,11 @@ public static function extractStabilityFlags(array $requires, $minimumStability, /** * @internal + * + * @param array $requires + * @param array $references + * + * @return array */ public static function extractReferences(array $requires, array $references) { diff --git a/app/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php b/app/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php index 62fa84943..a39184400 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php +++ b/app/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php @@ -27,14 +27,25 @@ class ValidatingArrayLoader implements LoaderInterface const CHECK_UNBOUND_CONSTRAINTS = 1; const CHECK_STRICT_CONSTRAINTS = 2; + /** @var LoaderInterface */ private $loader; + /** @var VersionParser */ private $versionParser; + /** @var string[] */ private $errors; + /** @var string[] */ private $warnings; + /** @var mixed[] */ private $config; + /** @var bool */ private $strictName; + /** @var int One or more of self::CHECK_* constants */ private $flags; + /** + * @param bool $strictName + * @param int $flags + */ public function __construct(LoaderInterface $loader, $strictName = true, VersionParser $parser = null, $flags = 0) { $this->loader = $loader; @@ -43,6 +54,9 @@ public function __construct(LoaderInterface $loader, $strictName = true, Version $this->flags = $flags; } + /** + * @inheritDoc + */ public function load(array $config, $class = 'Composer\Package\CompletePackage') { $this->errors = array(); @@ -388,25 +402,37 @@ public function load(array $config, $class = 'Composer\Package\CompletePackage') } $package = $this->loader->load($this->config, $class); - $this->config = null; + $this->config = array(); return $package; } + /** + * @return string[] + */ public function getWarnings() { return $this->warnings; } + /** + * @return string[] + */ public function getErrors() { return $this->errors; } + /** + * @param string $name + * @param bool $isLink + * + * @return string|null + */ public static function hasPackageNamingError($name, $isLink = false) { if (PlatformRepository::isPlatformPackage($name)) { - return; + return null; } if (!preg_match('{^[a-z0-9](?:[_.-]?[a-z0-9]+)*/[a-z0-9](?:(?:[_.]?|-{0,2})[a-z0-9]+)*$}iD', $name)) { @@ -433,8 +459,20 @@ public static function hasPackageNamingError($name, $isLink = false) return $name.' is invalid, it should not contain uppercase characters. We suggest using '.$suggestName.' instead.'; } + + return null; } + /** + * @param string $property + * @param string $regex + * @param bool $mandatory + * + * @return bool + * + * @phpstan-param non-empty-string $property + * @phpstan-param non-empty-string $regex + */ private function validateRegex($property, $regex, $mandatory = false) { if (!$this->validateString($property, $mandatory)) { @@ -456,6 +494,14 @@ private function validateRegex($property, $regex, $mandatory = false) return true; } + /** + * @param string $property + * @param bool $mandatory + * + * @return bool + * + * @phpstan-param non-empty-string $property + */ private function validateString($property, $mandatory = false) { if (isset($this->config[$property]) && !is_string($this->config[$property])) { @@ -477,6 +523,14 @@ private function validateString($property, $mandatory = false) return true; } + /** + * @param string $property + * @param bool $mandatory + * + * @return bool + * + * @phpstan-param non-empty-string $property + */ private function validateArray($property, $mandatory = false) { if (isset($this->config[$property]) && !is_array($this->config[$property])) { @@ -498,6 +552,16 @@ private function validateArray($property, $mandatory = false) return true; } + /** + * @param string $property + * @param string|null $regex + * @param bool $mandatory + * + * @return bool + * + * @phpstan-param non-empty-string $property + * @phpstan-param non-empty-string|null $regex + */ private function validateFlatArray($property, $regex = null, $mandatory = false) { if (!$this->validateArray($property, $mandatory)) { @@ -524,6 +588,14 @@ private function validateFlatArray($property, $regex = null, $mandatory = false) return $pass; } + /** + * @param string $property + * @param bool $mandatory + * + * @return bool + * + * @phpstan-param non-empty-string $property + */ private function validateUrl($property, $mandatory = false) { if (!$this->validateString($property, $mandatory)) { @@ -540,6 +612,12 @@ private function validateUrl($property, $mandatory = false) return true; } + /** + * @param mixed $value + * @param string[] $schemes + * + * @return bool + */ private function filterUrl($value, array $schemes = array('http', 'https')) { if ($value === '') { diff --git a/app/vendor/composer/composer/src/Composer/Package/Locker.php b/app/vendor/composer/composer/src/Composer/Package/Locker.php index 2ab1e2052..e96152338 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Locker.php +++ b/app/vendor/composer/composer/src/Composer/Package/Locker.php @@ -46,8 +46,10 @@ class Locker private $dumper; /** @var ProcessExecutor */ private $process; - private $lockDataCache; - private $virtualFileWritten; + /** @var mixed[]|null */ + private $lockDataCache = null; + /** @var bool */ + private $virtualFileWritten = false; /** * Initializes packages locker. @@ -249,6 +251,9 @@ public function getPlatformRequirements($withDevReqs = false) return $requirements; } + /** + * @return string + */ public function getMinimumStability() { $lockData = $this->getLockData(); @@ -256,6 +261,9 @@ public function getMinimumStability() return isset($lockData['minimum-stability']) ? $lockData['minimum-stability'] : 'stable'; } + /** + * @return array + */ public function getStabilityFlags() { $lockData = $this->getLockData(); @@ -263,6 +271,9 @@ public function getStabilityFlags() return isset($lockData['stability-flags']) ? $lockData['stability-flags'] : array(); } + /** + * @return bool|null + */ public function getPreferStable() { $lockData = $this->getLockData(); @@ -272,6 +283,9 @@ public function getPreferStable() return isset($lockData['prefer-stable']) ? $lockData['prefer-stable'] : null; } + /** + * @return bool|null + */ public function getPreferLowest() { $lockData = $this->getLockData(); @@ -281,6 +295,9 @@ public function getPreferLowest() return isset($lockData['prefer-lowest']) ? $lockData['prefer-lowest'] : null; } + /** + * @return array + */ public function getPlatformOverrides() { $lockData = $this->getLockData(); @@ -288,6 +305,11 @@ public function getPlatformOverrides() return isset($lockData['platform-overrides']) ? $lockData['platform-overrides'] : array(); } + /** + * @return string[][] + * + * @phpstan-return list + */ public function getAliases() { $lockData = $this->getLockData(); @@ -295,6 +317,9 @@ public function getAliases() return isset($lockData['aliases']) ? $lockData['aliases'] : array(); } + /** + * @return array + */ public function getLockData() { if (null !== $this->lockDataCache) { @@ -311,19 +336,21 @@ public function getLockData() /** * Locks provided data into lockfile. * - * @param array $packages array of packages - * @param mixed $devPackages array of dev packages or null if installed without --dev - * @param array $platformReqs array of package name => constraint for required platform packages - * @param mixed $platformDevReqs array of package name => constraint for dev-required platform packages - * @param array $aliases array of aliases - * @param string $minimumStability - * @param array $stabilityFlags - * @param bool $preferStable - * @param bool $preferLowest - * @param array $platformOverrides - * @param bool $write Whether to actually write data to disk, useful in tests and for --dry-run + * @param PackageInterface[] $packages array of packages + * @param PackageInterface[]|null $devPackages array of dev packages or null if installed without --dev + * @param array $platformReqs array of package name => constraint for required platform packages + * @param array $platformDevReqs array of package name => constraint for dev-required platform packages + * @param string[][] $aliases array of aliases + * @param string $minimumStability + * @param array $stabilityFlags + * @param bool $preferStable + * @param bool $preferLowest + * @param array $platformOverrides + * @param bool $write Whether to actually write data to disk, useful in tests and for --dry-run * * @return bool + * + * @phpstan-param list $aliases */ public function setLockData(array $packages, $devPackages, array $platformReqs, $platformDevReqs, array $aliases, $minimumStability, array $stabilityFlags, $preferStable, $preferLowest, array $platformOverrides, $write = true) { @@ -384,6 +411,13 @@ public function setLockData(array $packages, $devPackages, array $platformReqs, return false; } + /** + * @param PackageInterface[] $packages + * + * @return mixed[][] + * + * @phpstan-return list> + */ private function lockPackages(array $packages) { $locked = array(); diff --git a/app/vendor/composer/composer/src/Composer/Package/Package.php b/app/vendor/composer/composer/src/Composer/Package/Package.php index 2b3ccb1aa..cd447fc3f 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Package.php +++ b/app/vendor/composer/composer/src/Composer/Package/Package.php @@ -34,7 +34,7 @@ class Package extends BasePackage protected $sourceUrl; /** @var ?string */ protected $sourceReference; - /** @var ?array */ + /** @var ?array */ protected $sourceMirrors; /** @var ?string */ protected $distType; @@ -44,7 +44,7 @@ class Package extends BasePackage protected $distReference; /** @var ?string */ protected $distSha1Checksum; - /** @var ?array */ + /** @var ?array */ protected $distMirrors; /** @var string */ protected $version; @@ -58,7 +58,10 @@ class Package extends BasePackage protected $binaries = array(); /** @var bool */ protected $dev; - /** @var string */ + /** + * @var string + * @phpstan-var 'stable'|'RC'|'beta'|'alpha'|'dev' + */ protected $stability; /** @var ?string */ protected $notificationUrl; @@ -105,7 +108,7 @@ public function __construct($name, $version, $prettyVersion) } /** - * {@inheritDoc} + * @inheritDoc */ public function isDev() { @@ -114,6 +117,8 @@ public function isDev() /** * @param string $type + * + * @return void */ public function setType($type) { @@ -121,7 +126,7 @@ public function setType($type) } /** - * {@inheritDoc} + * @inheritDoc */ public function getType() { @@ -129,7 +134,7 @@ public function getType() } /** - * {@inheritDoc} + * @inheritDoc */ public function getStability() { @@ -138,6 +143,8 @@ public function getStability() /** * @param string $targetDir + * + * @return void */ public function setTargetDir($targetDir) { @@ -145,7 +152,7 @@ public function setTargetDir($targetDir) } /** - * {@inheritDoc} + * @inheritDoc */ public function getTargetDir() { @@ -157,7 +164,9 @@ public function getTargetDir() } /** - * @param array $extra + * @param mixed[] $extra + * + * @return void */ public function setExtra(array $extra) { @@ -165,7 +174,7 @@ public function setExtra(array $extra) } /** - * {@inheritDoc} + * @inheritDoc */ public function getExtra() { @@ -173,7 +182,9 @@ public function getExtra() } /** - * @param array $binaries + * @param string[] $binaries + * + * @return void */ public function setBinaries(array $binaries) { @@ -181,7 +192,7 @@ public function setBinaries(array $binaries) } /** - * {@inheritDoc} + * @inheritDoc */ public function getBinaries() { @@ -189,7 +200,9 @@ public function getBinaries() } /** - * {@inheritDoc} + * @inheritDoc + * + * @return void */ public function setInstallationSource($type) { @@ -197,7 +210,7 @@ public function setInstallationSource($type) } /** - * {@inheritDoc} + * @inheritDoc */ public function getInstallationSource() { @@ -206,6 +219,8 @@ public function getInstallationSource() /** * @param string $type + * + * @return void */ public function setSourceType($type) { @@ -213,7 +228,7 @@ public function setSourceType($type) } /** - * {@inheritDoc} + * @inheritDoc */ public function getSourceType() { @@ -222,6 +237,8 @@ public function getSourceType() /** * @param string $url + * + * @return void */ public function setSourceUrl($url) { @@ -229,7 +246,7 @@ public function setSourceUrl($url) } /** - * {@inheritDoc} + * @inheritDoc */ public function getSourceUrl() { @@ -238,6 +255,8 @@ public function getSourceUrl() /** * @param string $reference + * + * @return void */ public function setSourceReference($reference) { @@ -245,7 +264,7 @@ public function setSourceReference($reference) } /** - * {@inheritDoc} + * @inheritDoc */ public function getSourceReference() { @@ -253,7 +272,9 @@ public function getSourceReference() } /** - * {@inheritDoc} + * @inheritDoc + * + * @return void */ public function setSourceMirrors($mirrors) { @@ -261,7 +282,7 @@ public function setSourceMirrors($mirrors) } /** - * {@inheritDoc} + * @inheritDoc */ public function getSourceMirrors() { @@ -269,7 +290,7 @@ public function getSourceMirrors() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSourceUrls() { @@ -278,6 +299,8 @@ public function getSourceUrls() /** * @param string $type + * + * @return void */ public function setDistType($type) { @@ -285,7 +308,7 @@ public function setDistType($type) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDistType() { @@ -294,6 +317,8 @@ public function getDistType() /** * @param string $url + * + * @return void */ public function setDistUrl($url) { @@ -301,7 +326,7 @@ public function setDistUrl($url) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDistUrl() { @@ -310,6 +335,8 @@ public function getDistUrl() /** * @param string $reference + * + * @return void */ public function setDistReference($reference) { @@ -317,7 +344,7 @@ public function setDistReference($reference) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDistReference() { @@ -326,6 +353,8 @@ public function getDistReference() /** * @param string $sha1checksum + * + * @return void */ public function setDistSha1Checksum($sha1checksum) { @@ -333,7 +362,7 @@ public function setDistSha1Checksum($sha1checksum) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDistSha1Checksum() { @@ -341,7 +370,9 @@ public function getDistSha1Checksum() } /** - * {@inheritDoc} + * @inheritDoc + * + * @return void */ public function setDistMirrors($mirrors) { @@ -349,7 +380,7 @@ public function setDistMirrors($mirrors) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDistMirrors() { @@ -357,7 +388,7 @@ public function getDistMirrors() } /** - * {@inheritDoc} + * @inheritDoc */ public function getDistUrls() { @@ -365,7 +396,7 @@ public function getDistUrls() } /** - * {@inheritDoc} + * @inheritDoc */ public function getTransportOptions() { @@ -373,7 +404,7 @@ public function getTransportOptions() } /** - * {@inheritDoc} + * @inheritDoc */ public function setTransportOptions(array $options) { @@ -381,7 +412,7 @@ public function setTransportOptions(array $options) } /** - * {@inheritDoc} + * @inheritDoc */ public function getVersion() { @@ -389,7 +420,7 @@ public function getVersion() } /** - * {@inheritDoc} + * @inheritDoc */ public function getPrettyVersion() { @@ -400,6 +431,8 @@ public function getPrettyVersion() * Set the releaseDate * * @param \DateTime $releaseDate + * + * @return void */ public function setReleaseDate(\DateTime $releaseDate) { @@ -407,7 +440,7 @@ public function setReleaseDate(\DateTime $releaseDate) } /** - * {@inheritDoc} + * @inheritDoc */ public function getReleaseDate() { @@ -418,6 +451,8 @@ public function getReleaseDate() * Set the required packages * * @param array $requires A set of package links + * + * @return void */ public function setRequires(array $requires) { @@ -425,7 +460,7 @@ public function setRequires(array $requires) } /** - * {@inheritDoc} + * @inheritDoc */ public function getRequires() { @@ -436,6 +471,8 @@ public function getRequires() * Set the conflicting packages * * @param array $conflicts A set of package links + * + * @return void */ public function setConflicts(array $conflicts) { @@ -443,7 +480,7 @@ public function setConflicts(array $conflicts) } /** - * {@inheritDoc} + * @inheritDoc * @return array */ public function getConflicts() @@ -455,6 +492,8 @@ public function getConflicts() * Set the provided virtual packages * * @param array $provides A set of package links + * + * @return void */ public function setProvides(array $provides) { @@ -462,7 +501,7 @@ public function setProvides(array $provides) } /** - * {@inheritDoc} + * @inheritDoc * @return array */ public function getProvides() @@ -474,6 +513,8 @@ public function getProvides() * Set the packages this one replaces * * @param array $replaces A set of package links + * + * @return void */ public function setReplaces(array $replaces) { @@ -481,7 +522,7 @@ public function setReplaces(array $replaces) } /** - * {@inheritDoc} + * @inheritDoc * @return array */ public function getReplaces() @@ -493,6 +534,8 @@ public function getReplaces() * Set the recommended packages * * @param array $devRequires A set of package links + * + * @return void */ public function setDevRequires(array $devRequires) { @@ -500,7 +543,7 @@ public function setDevRequires(array $devRequires) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDevRequires() { @@ -511,6 +554,8 @@ public function getDevRequires() * Set the suggested packages * * @param array $suggests A set of package names/comments + * + * @return void */ public function setSuggests(array $suggests) { @@ -518,7 +563,7 @@ public function setSuggests(array $suggests) } /** - * {@inheritDoc} + * @inheritDoc */ public function getSuggests() { @@ -529,6 +574,10 @@ public function getSuggests() * Set the autoload mapping * * @param array $autoload Mapping of autoloading rules + * + * @return void + * + * @phpstan-param array{psr-0?: array, psr-4?: array, classmap?: list, files?: list} $autoload */ public function setAutoload(array $autoload) { @@ -536,7 +585,7 @@ public function setAutoload(array $autoload) } /** - * {@inheritDoc} + * @inheritDoc */ public function getAutoload() { @@ -547,6 +596,10 @@ public function getAutoload() * Set the dev autoload mapping * * @param array $devAutoload Mapping of dev autoloading rules + * + * @return void + * + * @phpstan-param array{psr-0?: array, psr-4?: array, classmap?: list, files?: list} $devAutoload */ public function setDevAutoload(array $devAutoload) { @@ -554,7 +607,7 @@ public function setDevAutoload(array $devAutoload) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDevAutoload() { @@ -564,7 +617,9 @@ public function getDevAutoload() /** * Sets the list of paths added to PHP's include path. * - * @param array $includePaths List of directories. + * @param string[] $includePaths List of directories. + * + * @return void */ public function setIncludePaths(array $includePaths) { @@ -572,7 +627,7 @@ public function setIncludePaths(array $includePaths) } /** - * {@inheritDoc} + * @inheritDoc */ public function getIncludePaths() { @@ -583,6 +638,8 @@ public function getIncludePaths() * Sets the notification URL * * @param string $notificationUrl + * + * @return void */ public function setNotificationUrl($notificationUrl) { @@ -590,7 +647,7 @@ public function setNotificationUrl($notificationUrl) } /** - * {@inheritDoc} + * @inheritDoc */ public function getNotificationUrl() { @@ -599,6 +656,8 @@ public function getNotificationUrl() /** * @param bool $defaultBranch + * + * @return void */ public function setIsDefaultBranch($defaultBranch) { @@ -606,7 +665,7 @@ public function setIsDefaultBranch($defaultBranch) } /** - * {@inheritDoc} + * @inheritDoc */ public function isDefaultBranch() { @@ -614,7 +673,7 @@ public function isDefaultBranch() } /** - * {@inheritDoc} + * @inheritDoc */ public function setSourceDistReferences($reference) { @@ -639,6 +698,8 @@ public function setSourceDistReferences($reference) * * @param string $version The package's normalized version * @param string $prettyVersion The package's non-normalized version + * + * @return void */ public function replaceVersion($version, $prettyVersion) { @@ -649,6 +710,17 @@ public function replaceVersion($version, $prettyVersion) $this->dev = $this->stability === 'dev'; } + /** + * @param string|null $url + * @param mixed[]|null $mirrors + * @param string|null $ref + * @param string|null $type + * @param string $urlType + * + * @return string[] + * + * @phpstan-param list|null $mirrors + */ protected function getUrls($url, $mirrors, $ref, $type, $urlType) { if (!$url) { diff --git a/app/vendor/composer/composer/src/Composer/Package/PackageInterface.php b/app/vendor/composer/composer/src/Composer/Package/PackageInterface.php index c3df0fd63..89dce5101 100644 --- a/app/vendor/composer/composer/src/Composer/Package/PackageInterface.php +++ b/app/vendor/composer/composer/src/Composer/Package/PackageInterface.php @@ -55,6 +55,8 @@ public function getNames($provides = true); * Allows the solver to set an id for this package to refer to it. * * @param int $id + * + * @return void */ public function setId($id); @@ -98,6 +100,8 @@ public function getExtra(); * * @param string $type source/dist * @phpstan-param 'source'|'dist'|null $type + * + * @return void */ public function setInstallationSource($type); @@ -140,12 +144,12 @@ public function getSourceReference(); /** * Returns the source mirrors of this package * - * @return ?array + * @return ?array */ public function getSourceMirrors(); /** - * @param ?array $mirrors + * @param ?array $mirrors * @return void */ public function setSourceMirrors($mirrors); @@ -188,12 +192,12 @@ public function getDistSha1Checksum(); /** * Returns the dist mirrors of this package * - * @return ?array + * @return ?array */ public function getDistMirrors(); /** - * @param ?array $mirrors + * @param ?array $mirrors * @return void */ public function setDistMirrors($mirrors); @@ -236,6 +240,8 @@ public function getReleaseDate(); * Returns the stability of this package: one of (dev, alpha, beta, RC, stable) * * @return string + * + * @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev' */ public function getStability(); @@ -326,6 +332,8 @@ public function getIncludePaths(); * Stores a reference to the repository that owns the package * * @param RepositoryInterface $repository + * + * @return void */ public function setRepository(RepositoryInterface $repository); @@ -386,6 +394,8 @@ public function getTransportOptions(); /** * Configures the list of options to download package dist files * + * @param mixed[] $options + * * @return void */ public function setTransportOptions(array $options); diff --git a/app/vendor/composer/composer/src/Composer/Package/RootAliasPackage.php b/app/vendor/composer/composer/src/Composer/Package/RootAliasPackage.php index 78139eb02..4817653dc 100644 --- a/app/vendor/composer/composer/src/Composer/Package/RootAliasPackage.php +++ b/app/vendor/composer/composer/src/Composer/Package/RootAliasPackage.php @@ -41,7 +41,7 @@ public function getAliasOf() } /** - * {@inheritDoc} + * @inheritDoc */ public function getAliases() { @@ -49,7 +49,7 @@ public function getAliases() } /** - * {@inheritDoc} + * @inheritDoc */ public function getMinimumStability() { @@ -57,7 +57,7 @@ public function getMinimumStability() } /** - * {@inheritDoc} + * @inheritDoc */ public function getStabilityFlags() { @@ -65,7 +65,7 @@ public function getStabilityFlags() } /** - * {@inheritDoc} + * @inheritDoc */ public function getReferences() { @@ -73,7 +73,7 @@ public function getReferences() } /** - * {@inheritDoc} + * @inheritDoc */ public function getPreferStable() { @@ -81,7 +81,7 @@ public function getPreferStable() } /** - * {@inheritDoc} + * @inheritDoc */ public function getConfig() { @@ -89,7 +89,7 @@ public function getConfig() } /** - * {@inheritDoc} + * @inheritDoc */ public function setRequires(array $require) { @@ -99,7 +99,7 @@ public function setRequires(array $require) } /** - * {@inheritDoc} + * @inheritDoc */ public function setDevRequires(array $devRequire) { @@ -109,7 +109,7 @@ public function setDevRequires(array $devRequire) } /** - * {@inheritDoc} + * @inheritDoc */ public function setConflicts(array $conflicts) { @@ -118,7 +118,7 @@ public function setConflicts(array $conflicts) } /** - * {@inheritDoc} + * @inheritDoc */ public function setProvides(array $provides) { @@ -127,7 +127,7 @@ public function setProvides(array $provides) } /** - * {@inheritDoc} + * @inheritDoc */ public function setReplaces(array $replaces) { @@ -136,7 +136,7 @@ public function setReplaces(array $replaces) } /** - * {@inheritDoc} + * @inheritDoc */ public function setAutoload(array $autoload) { @@ -144,7 +144,7 @@ public function setAutoload(array $autoload) } /** - * {@inheritDoc} + * @inheritDoc */ public function setDevAutoload(array $devAutoload) { @@ -152,7 +152,7 @@ public function setDevAutoload(array $devAutoload) } /** - * {@inheritDoc} + * @inheritDoc */ public function setStabilityFlags(array $stabilityFlags) { @@ -160,7 +160,7 @@ public function setStabilityFlags(array $stabilityFlags) } /** - * {@inheritDoc} + * @inheritDoc */ public function setMinimumStability($minimumStability) { @@ -168,7 +168,7 @@ public function setMinimumStability($minimumStability) } /** - * {@inheritDoc} + * @inheritDoc */ public function setPreferStable($preferStable) { @@ -176,7 +176,7 @@ public function setPreferStable($preferStable) } /** - * {@inheritDoc} + * @inheritDoc */ public function setConfig(array $config) { @@ -184,7 +184,7 @@ public function setConfig(array $config) } /** - * {@inheritDoc} + * @inheritDoc */ public function setReferences(array $references) { @@ -192,7 +192,7 @@ public function setReferences(array $references) } /** - * {@inheritDoc} + * @inheritDoc */ public function setAliases(array $aliases) { @@ -200,7 +200,7 @@ public function setAliases(array $aliases) } /** - * {@inheritDoc} + * @inheritDoc */ public function setSuggests(array $suggests) { @@ -208,7 +208,7 @@ public function setSuggests(array $suggests) } /** - * {@inheritDoc} + * @inheritDoc */ public function setExtra(array $extra) { diff --git a/app/vendor/composer/composer/src/Composer/Package/RootPackage.php b/app/vendor/composer/composer/src/Composer/Package/RootPackage.php index 945bfd17e..070e7b6c9 100644 --- a/app/vendor/composer/composer/src/Composer/Package/RootPackage.php +++ b/app/vendor/composer/composer/src/Composer/Package/RootPackage.php @@ -21,11 +21,17 @@ class RootPackage extends CompletePackage implements RootPackageInterface { const DEFAULT_PRETTY_VERSION = '1.0.0+no-version-set'; + /** @var string */ protected $minimumStability = 'stable'; + /** @var bool */ protected $preferStable = false; + /** @var array Map of package name to stability constant */ protected $stabilityFlags = array(); + /** @var mixed[] */ protected $config = array(); + /** @var array Map of package name to reference/commit hash */ protected $references = array(); + /** @var array */ protected $aliases = array(); /** @@ -37,7 +43,7 @@ public function setMinimumStability($minimumStability) } /** - * {@inheritDoc} + * @inheritDoc */ public function getMinimumStability() { @@ -45,7 +51,7 @@ public function getMinimumStability() } /** - * {@inheritDoc} + * @inheritDoc */ public function setStabilityFlags(array $stabilityFlags) { @@ -53,7 +59,7 @@ public function setStabilityFlags(array $stabilityFlags) } /** - * {@inheritDoc} + * @inheritDoc */ public function getStabilityFlags() { @@ -69,7 +75,7 @@ public function setPreferStable($preferStable) } /** - * {@inheritDoc} + * @inheritDoc */ public function getPreferStable() { @@ -85,7 +91,7 @@ public function setConfig(array $config) } /** - * {@inheritDoc} + * @inheritDoc */ public function getConfig() { @@ -101,7 +107,7 @@ public function setReferences(array $references) } /** - * {@inheritDoc} + * @inheritDoc */ public function getReferences() { @@ -117,7 +123,7 @@ public function setAliases(array $aliases) } /** - * {@inheritDoc} + * @inheritDoc */ public function getAliases() { diff --git a/app/vendor/composer/composer/src/Composer/Package/RootPackageInterface.php b/app/vendor/composer/composer/src/Composer/Package/RootPackageInterface.php index ecd72e444..1092832dc 100644 --- a/app/vendor/composer/composer/src/Composer/Package/RootPackageInterface.php +++ b/app/vendor/composer/composer/src/Composer/Package/RootPackageInterface.php @@ -22,7 +22,7 @@ interface RootPackageInterface extends CompletePackageInterface /** * Returns a set of package names and their aliases * - * @return array + * @return array */ public function getAliases(); @@ -38,7 +38,7 @@ public function getMinimumStability(); * * array('foo/bar' => 'dev') * - * @return array + * @return array */ public function getStabilityFlags(); @@ -47,7 +47,7 @@ public function getStabilityFlags(); * * array('foo/bar' => 'abcd1234') * - * @return array + * @return array */ public function getReferences(); @@ -61,7 +61,7 @@ public function getPreferStable(); /** * Returns the root package's configuration * - * @return array + * @return mixed[] */ public function getConfig(); @@ -69,6 +69,8 @@ public function getConfig(); * Set the required packages * * @param Link[] $requires A set of package links + * + * @return void */ public function setRequires(array $requires); @@ -76,6 +78,8 @@ public function setRequires(array $requires); * Set the recommended packages * * @param Link[] $devRequires A set of package links + * + * @return void */ public function setDevRequires(array $devRequires); @@ -83,6 +87,8 @@ public function setDevRequires(array $devRequires); * Set the conflicting packages * * @param Link[] $conflicts A set of package links + * + * @return void */ public function setConflicts(array $conflicts); @@ -90,6 +96,8 @@ public function setConflicts(array $conflicts); * Set the provided virtual packages * * @param Link[] $provides A set of package links + * + * @return void */ public function setProvides(array $provides); @@ -97,34 +105,44 @@ public function setProvides(array $provides); * Set the packages this one replaces * * @param Link[] $replaces A set of package links + * + * @return void */ public function setReplaces(array $replaces); /** * Set the repositories * - * @param array $repositories + * @param mixed[] $repositories + * + * @return void */ public function setRepositories(array $repositories); /** * Set the autoload mapping * - * @param array $autoload Mapping of autoloading rules + * @param array{psr-0?: array, psr-4?: array, classmap?: list, files?: list} $autoload Mapping of autoloading rules + * + * @return void */ public function setAutoload(array $autoload); /** * Set the dev autoload mapping * - * @param array $devAutoload Mapping of dev autoloading rules + * @param array{psr-0?: array, psr-4?: array, classmap?: list, files?: list} $devAutoload Mapping of dev autoloading rules + * + * @return void */ public function setDevAutoload(array $devAutoload); /** * Set the stabilityFlags * - * @param array $stabilityFlags + * @param array $stabilityFlags + * + * @return void */ public function setStabilityFlags(array $stabilityFlags); @@ -132,6 +150,8 @@ public function setStabilityFlags(array $stabilityFlags); * Set the minimumStability * * @param string $minimumStability + * + * @return void */ public function setMinimumStability($minimumStability); @@ -139,39 +159,51 @@ public function setMinimumStability($minimumStability); * Set the preferStable * * @param bool $preferStable + * + * @return void */ public function setPreferStable($preferStable); /** * Set the config * - * @param array $config + * @param mixed[] $config + * + * @return void */ public function setConfig(array $config); /** * Set the references * - * @param array $references + * @param array $references + * + * @return void */ public function setReferences(array $references); /** * Set the aliases * - * @param array $aliases + * @param array $aliases + * + * @return void */ public function setAliases(array $aliases); /** * Set the suggested packages * - * @param array $suggests A set of package names/comments + * @param array $suggests A set of package names/comments + * + * @return void */ public function setSuggests(array $suggests); /** - * @param array $extra + * @param mixed[] $extra + * + * @return void */ public function setExtra(array $extra); } diff --git a/app/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php b/app/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php index ef8a057bb..504263a6c 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php +++ b/app/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php @@ -26,6 +26,8 @@ * * @author Jordi Boggiano * @author Samuel Roze + * + * @phpstan-type Version array{version: string, commit: string|null, pretty_version: string|null, feature_version?: string|null, feature_pretty_version?: string|null} */ class VersionGuesser { @@ -57,10 +59,11 @@ public function __construct(Config $config, ProcessExecutor $process, SemverVers } /** - * @param array $packageConfig - * @param string $path Path to guess into + * @param array $packageConfig + * @param string $path Path to guess into * - * @return null|array versionData, 'version', 'pretty_version' and 'commit' keys, if the version is a feature branch, 'feature_version' and 'feature_pretty_version' keys may also be returned + * @return array|null + * @phpstan-return Version|null */ public function guessVersion(array $packageConfig, $path) { @@ -91,6 +94,14 @@ public function guessVersion(array $packageConfig, $path) return null; } + /** + * @param array $versionData + * + * @phpstan-param Version $versionData + * + * @return array + * @phpstan-return Version + */ private function postprocess(array $versionData) { if (!empty($versionData['feature_version']) && $versionData['feature_version'] === $versionData['version'] && $versionData['feature_pretty_version'] === $versionData['pretty_version']) { @@ -108,6 +119,12 @@ private function postprocess(array $versionData) return $versionData; } + /** + * @param array $packageConfig + * @param string $path + * + * @return array{version: string|null, commit: string|null, pretty_version: string|null, feature_version?: string|null, feature_pretty_version?: string|null} + */ private function guessGitVersion(array $packageConfig, $path) { GitUtil::cleanEnv(); @@ -188,6 +205,11 @@ private function guessGitVersion(array $packageConfig, $path) return array('version' => $version, 'commit' => $commit, 'pretty_version' => $prettyVersion); } + /** + * @param string $path + * + * @return array{version: string, pretty_version: string}|null + */ private function versionFromGitTags($path) { // try to fetch current version from git tags @@ -203,6 +225,12 @@ private function versionFromGitTags($path) return null; } + /** + * @param array $packageConfig + * @param string $path + * + * @return array{version: string|null, commit: ''|null, pretty_version: string|null, feature_version?: string|null, feature_pretty_version?: string|null}|null + */ private function guessHgVersion(array $packageConfig, $path) { // try to fetch current version from hg branch @@ -232,8 +260,21 @@ private function guessHgVersion(array $packageConfig, $path) return $result; } + + return null; } + /** + * @param array $packageConfig + * @param string|null $version + * @param string[] $branches + * @param string $scmCmdline + * @param string $path + * + * @phpstan-param non-empty-string $scmCmdline + * + * @return array{version: string|null, pretty_version: string|null} + */ private function guessFeatureVersion(array $packageConfig, $version, array $branches, $scmCmdline, $path) { $prettyVersion = $version; @@ -292,6 +333,12 @@ private function guessFeatureVersion(array $packageConfig, $version, array $bran return array('version' => $version, 'pretty_version' => $prettyVersion); } + /** + * @param array $packageConfig + * @param string|null $branchName + * + * @return bool + */ private function isFeatureBranch(array $packageConfig, $branchName) { $nonFeatureBranches = ''; @@ -302,6 +349,11 @@ private function isFeatureBranch(array $packageConfig, $branchName) return !preg_match('{^(' . $nonFeatureBranches . '|master|main|latest|next|current|support|tip|trunk|default|develop|\d+\..+)$}', $branchName, $match); } + /** + * @param string $path + * + * @return array{version: string|null, commit: '', pretty_version: string|null} + */ private function guessFossilVersion($path) { $version = null; @@ -326,6 +378,12 @@ private function guessFossilVersion($path) return array('version' => $version, 'commit' => '', 'pretty_version' => $prettyVersion); } + /** + * @param array $packageConfig + * @param string $path + * + * @return array{version: string, commit: '', pretty_version: string}|null + */ private function guessSvnVersion(array $packageConfig, $path) { SvnUtil::cleanEnv(); @@ -357,5 +415,7 @@ private function guessSvnVersion(array $packageConfig, $path) return array('version' => $version, 'commit' => '', 'pretty_version' => $prettyVersion); } } + + return null; } } diff --git a/app/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php b/app/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php index df3e9feb2..c848522e2 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php +++ b/app/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php @@ -15,15 +15,17 @@ use Composer\Repository\PlatformRepository; use Composer\Semver\VersionParser as SemverVersionParser; use Composer\Semver\Semver; +use Composer\Semver\Constraint\ConstraintInterface; class VersionParser extends SemverVersionParser { const DEFAULT_BRANCH_ALIAS = '9999999-dev'; + /** @var array Constraint parsing cache */ private static $constraints = array(); /** - * {@inheritDoc} + * @inheritDoc */ public function parseConstraints($constraints) { @@ -40,9 +42,9 @@ public function parseConstraints($constraints) * The parsing results in an array of arrays, each of which * contain a 'name' key with value and optionally a 'version' key with value. * - * @param array $pairs a set of package/version pairs separated by ":", "=" or " " + * @param string[] $pairs a set of package/version pairs separated by ":", "=" or " " * - * @return array[] array of arrays containing a name and (if provided) a version + * @return list */ public function parseNameVersionPairs(array $pairs) { @@ -68,6 +70,9 @@ public function parseNameVersionPairs(array $pairs) } /** + * @param string $normalizedFrom + * @param string $normalizedTo + * * @return bool */ public static function isUpgrade($normalizedFrom, $normalizedTo) diff --git a/app/vendor/composer/composer/src/Composer/Package/Version/VersionSelector.php b/app/vendor/composer/composer/src/Composer/Package/Version/VersionSelector.php index ab5355d1a..79972999a 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Version/VersionSelector.php +++ b/app/vendor/composer/composer/src/Composer/Package/Version/VersionSelector.php @@ -21,6 +21,7 @@ use Composer\Repository\RepositorySet; use Composer\Repository\PlatformRepository; use Composer\Semver\Constraint\Constraint; +use Composer\Semver\Constraint\ConstraintInterface; /** * Selects the best possible version for a package @@ -30,10 +31,13 @@ */ class VersionSelector { + /** @var RepositorySet */ private $repositorySet; + /** @var array */ private $platformConstraints = array(); + /** @var VersionParser */ private $parser; /** @@ -53,10 +57,12 @@ public function __construct(RepositorySet $repositorySet, PlatformRepository $pl * Given a package name and optional version, returns the latest PackageInterface * that matches. * - * @param string $packageName - * @param string $targetPackageVersion - * @param string $preferredStability - * @param bool|array $ignorePlatformReqs + * @param string $packageName + * @param string $targetPackageVersion + * @param string $preferredStability + * @param bool|string[] $ignorePlatformReqs + * @param int $repoSetFlags + * * @return PackageInterface|false */ public function findBestCandidate($packageName, $targetPackageVersion = null, $preferredStability = 'stable', $ignorePlatformReqs = false, $repoSetFlags = 0) @@ -76,14 +82,20 @@ public function findBestCandidate($packageName, $targetPackageVersion = null, $p $reqs = $pkg->getRequires(); foreach ($reqs as $name => $link) { - if (!in_array($name, $ignorePlatformReqs, true) && isset($platformConstraints[$name])) { - foreach ($platformConstraints[$name] as $constraint) { - if ($link->getConstraint()->matches($constraint)) { - continue 2; + if (!in_array($name, $ignorePlatformReqs, true)) { + if (isset($platformConstraints[$name])) { + foreach ($platformConstraints[$name] as $constraint) { + if ($link->getConstraint()->matches($constraint)) { + continue 2; + } } - } - return false; + return false; + } elseif (PlatformRepository::isPlatformPackage($name)) { + // Package requires a platform package that is unknown on current platform. + // It means that current platform cannot validate this constraint and so package is not installable. + return false; + } } } @@ -183,6 +195,13 @@ public function findRecommendedRequireVersion(PackageInterface $package) return $package->getPrettyVersion(); } + /** + * @param string $version + * @param string $prettyVersion + * @param string $stability + * + * @return string + */ private function transformVersion($version, $prettyVersion, $stability) { // attempt to transform 2.1.1 to 2.1 @@ -211,6 +230,9 @@ private function transformVersion($version, $prettyVersion, $stability) return '^' . $version; } + /** + * @return VersionParser + */ private function getParser() { if ($this->parser === null) { diff --git a/app/vendor/composer/composer/src/Composer/Platform/HhvmDetector.php b/app/vendor/composer/composer/src/Composer/Platform/HhvmDetector.php index 7bf1beb2c..7fee999a6 100644 --- a/app/vendor/composer/composer/src/Composer/Platform/HhvmDetector.php +++ b/app/vendor/composer/composer/src/Composer/Platform/HhvmDetector.php @@ -31,11 +31,17 @@ public function __construct(ExecutableFinder $executableFinder = null, ProcessEx $this->processExecutor = $processExecutor; } + /** + * @return void + */ public function reset() { self::$hhvmVersion = null; } + /** + * @return string|null + */ public function getVersion() { if (null !== self::$hhvmVersion) { @@ -60,6 +66,6 @@ public function getVersion() } } - return self::$hhvmVersion; + return self::$hhvmVersion ?: null; } } diff --git a/app/vendor/composer/composer/src/Composer/Platform/Runtime.php b/app/vendor/composer/composer/src/Composer/Platform/Runtime.php index 4e9caff57..250a21aa7 100644 --- a/app/vendor/composer/composer/src/Composer/Platform/Runtime.php +++ b/app/vendor/composer/composer/src/Composer/Platform/Runtime.php @@ -15,8 +15,9 @@ class Runtime { /** - * @param string $constant - * @param class-string $class + * @param string $constant + * @param class-string $class + * * @return bool */ public function hasConstant($constant, $class = null) @@ -25,8 +26,9 @@ public function hasConstant($constant, $class = null) } /** - * @param string $constant - * @param class-string $class + * @param string $constant + * @param class-string $class + * * @return mixed */ public function getConstant($constant, $class = null) @@ -35,7 +37,8 @@ public function getConstant($constant, $class = null) } /** - * @param string $fn + * @param string $fn + * * @return bool */ public function hasFunction($fn) @@ -44,8 +47,9 @@ public function hasFunction($fn) } /** - * @param callable $callable - * @param array $arguments + * @param callable $callable + * @param mixed[] $arguments + * * @return mixed */ public function invoke($callable, array $arguments = array()) @@ -54,7 +58,8 @@ public function invoke($callable, array $arguments = array()) } /** - * @param class-string $class + * @param class-string $class + * * @return bool */ public function hasClass($class) @@ -63,9 +68,11 @@ public function hasClass($class) } /** - * @param class-string $class - * @param array $arguments + * @param class-string $class + * @param mixed[] $arguments + * * @return object + * @throws \ReflectionException */ public function construct($class, array $arguments = array()) { @@ -85,7 +92,8 @@ public function getExtensions() } /** - * @param string $extension + * @param string $extension + * * @return string */ public function getExtensionVersion($extension) @@ -94,8 +102,10 @@ public function getExtensionVersion($extension) } /** - * @param string $extension + * @param string $extension + * * @return string + * @throws \ReflectionException */ public function getExtensionInfo($extension) { diff --git a/app/vendor/composer/composer/src/Composer/Platform/Version.php b/app/vendor/composer/composer/src/Composer/Platform/Version.php index a55266c86..f3ed82a96 100644 --- a/app/vendor/composer/composer/src/Composer/Platform/Version.php +++ b/app/vendor/composer/composer/src/Composer/Platform/Version.php @@ -92,6 +92,12 @@ public static function convertOpenldapVersionId($versionId) return self::convertVersionId($versionId, 100); } + /** + * @param int $versionId + * @param int $base + * + * @return string + */ private static function convertVersionId($versionId, $base) { return sprintf( diff --git a/app/vendor/composer/composer/src/Composer/Plugin/CommandEvent.php b/app/vendor/composer/composer/src/Composer/Plugin/CommandEvent.php index 0697df97a..6d81ee2cb 100644 --- a/app/vendor/composer/composer/src/Composer/Plugin/CommandEvent.php +++ b/app/vendor/composer/composer/src/Composer/Plugin/CommandEvent.php @@ -45,8 +45,8 @@ class CommandEvent extends Event * @param string $commandName The command name * @param InputInterface $input * @param OutputInterface $output - * @param array $args Arguments passed by the user - * @param array $flags Optional flags to pass data not as argument + * @param mixed[] $args Arguments passed by the user + * @param mixed[] $flags Optional flags to pass data not as argument */ public function __construct($name, $commandName, $input, $output, array $args = array(), array $flags = array()) { diff --git a/app/vendor/composer/composer/src/Composer/Plugin/PluginInterface.php b/app/vendor/composer/composer/src/Composer/Plugin/PluginInterface.php index 305a784bc..c7c42c5f9 100644 --- a/app/vendor/composer/composer/src/Composer/Plugin/PluginInterface.php +++ b/app/vendor/composer/composer/src/Composer/Plugin/PluginInterface.php @@ -39,6 +39,8 @@ interface PluginInterface * * @param Composer $composer * @param IOInterface $io + * + * @return void */ public function activate(Composer $composer, IOInterface $io); @@ -51,6 +53,8 @@ public function activate(Composer $composer, IOInterface $io); * * @param Composer $composer * @param IOInterface $io + * + * @return void */ public function deactivate(Composer $composer, IOInterface $io); @@ -61,6 +65,8 @@ public function deactivate(Composer $composer, IOInterface $io); * * @param Composer $composer * @param IOInterface $io + * + * @return void */ public function uninstall(Composer $composer, IOInterface $io); } diff --git a/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php b/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php index eb13aad0e..39052d84f 100644 --- a/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php +++ b/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php @@ -73,6 +73,8 @@ public function __construct(IOInterface $io, Composer $composer, Composer $globa /** * Loads all plugins from currently installed plugin packages + * + * @return void */ public function loadInstalledPlugins() { @@ -91,7 +93,7 @@ public function loadInstalledPlugins() /** * Gets all currently active plugin instances * - * @return array plugins + * @return array plugins */ public function getPlugins() { @@ -118,6 +120,8 @@ public function getGlobalComposer() * @param bool $failOnMissingClasses By default this silently skips plugins that can not be found, but if set to true it fails with an exception * @param bool $isGlobalPlugin Set to true to denote plugins which are installed in the global Composer directory * + * @return void + * * @throws \UnexpectedValueException */ public function registerPackage(PackageInterface $package, $failOnMissingClasses = false, $isGlobalPlugin = false) @@ -242,6 +246,8 @@ public function registerPackage(PackageInterface $package, $failOnMissingClasses * * @param PackageInterface $package * + * @return void + * * @throws \UnexpectedValueException */ public function deactivatePackage(PackageInterface $package) @@ -276,6 +282,8 @@ public function deactivatePackage(PackageInterface $package) * * @param PackageInterface $package * + * @return void + * * @throws \UnexpectedValueException */ public function uninstallPackage(PackageInterface $package) @@ -318,7 +326,10 @@ protected function getPluginApiVersion() * to do it. * * @param PluginInterface $plugin plugin instance + * @param bool $isGlobalPlugin * @param ?PackageInterface $sourcePackage Package from which the plugin comes from + * + * @return void */ public function addPlugin(PluginInterface $plugin, $isGlobalPlugin = false, PackageInterface $sourcePackage = null) { @@ -346,6 +357,8 @@ public function addPlugin(PluginInterface $plugin, $isGlobalPlugin = false, Pack * to do it. * * @param PluginInterface $plugin plugin instance + * + * @return void */ public function removePlugin(PluginInterface $plugin) { @@ -369,6 +382,8 @@ public function removePlugin(PluginInterface $plugin) * to do it. * * @param PluginInterface $plugin plugin instance + * + * @return void */ public function uninstallPlugin(PluginInterface $plugin) { @@ -386,6 +401,9 @@ public function uninstallPlugin(PluginInterface $plugin) * call this method as early as possible. * * @param RepositoryInterface $repo Repository to scan for plugins to install + * @param bool $isGlobalRepo + * + * @return void * * @throws \RuntimeException */ @@ -409,11 +427,11 @@ private function loadRepository(RepositoryInterface $repo, $isGlobalRepo) /** * Recursively generates a map of package names to packages for all deps * - * @param InstalledRepository $installedRepo Set of local repos - * @param array $collected Current state of the map for recursion - * @param PackageInterface $package The package to analyze + * @param InstalledRepository $installedRepo Set of local repos + * @param array $collected Current state of the map for recursion + * @param PackageInterface $package The package to analyze * - * @return array Map of package names to packages + * @return array Map of package names to packages */ private function collectDependencies(InstalledRepository $installedRepo, array $collected, PackageInterface $package) { @@ -479,7 +497,7 @@ protected function getCapabilityImplementationClassName(PluginInterface $plugin, * @param PluginInterface $plugin * @param class-string $capabilityClassName The fully qualified name of the API interface which the plugin may provide * an implementation of. - * @param array $ctorArgs Arguments passed to Capability's constructor. + * @param array $ctorArgs Arguments passed to Capability's constructor. * Keeping it an array will allow future values to be passed w\o changing the signature. * @return null|Capability * @phpstan-param class-string $capabilityClassName @@ -512,7 +530,7 @@ public function getPluginCapability(PluginInterface $plugin, $capabilityClassNam * @template CapabilityClass of Capability * @param class-string $capabilityClassName The fully qualified name of the API interface which the plugin may provide * an implementation of. - * @param array $ctorArgs Arguments passed to Capability's constructor. + * @param array $ctorArgs Arguments passed to Capability's constructor. * Keeping it an array will allow future values to be passed w\o changing the signature. * @return CapabilityClass[] */ diff --git a/app/vendor/composer/composer/src/Composer/Plugin/PreFileDownloadEvent.php b/app/vendor/composer/composer/src/Composer/Plugin/PreFileDownloadEvent.php index 1c07d5ca6..9e675d438 100644 --- a/app/vendor/composer/composer/src/Composer/Plugin/PreFileDownloadEvent.php +++ b/app/vendor/composer/composer/src/Composer/Plugin/PreFileDownloadEvent.php @@ -92,6 +92,8 @@ public function getProcessedUrl() * Sets the processed URL that will be downloaded. * * @param string $processedUrl New processed URL + * + * @return void */ public function setProcessedUrl($processedUrl) { @@ -112,6 +114,8 @@ public function getCustomCacheKey() * Sets a custom package cache key for this download. * * @param string|null $customCacheKey New cache key + * + * @return void */ public function setCustomCacheKey($customCacheKey) { @@ -146,7 +150,7 @@ public function getContext() * * Only available for events with type metadata, for packages set the transport options on the package itself. * - * @return array + * @return mixed[] */ public function getTransportOptions() { @@ -158,7 +162,9 @@ public function getTransportOptions() * * Only available for events with type metadata, for packages set the transport options on the package itself. * - * @param array $options + * @param mixed[] $options + * + * @return void */ public function setTransportOptions(array $options) { diff --git a/app/vendor/composer/composer/src/Composer/Plugin/PrePoolCreateEvent.php b/app/vendor/composer/composer/src/Composer/Plugin/PrePoolCreateEvent.php index baa4bc985..ff7702553 100644 --- a/app/vendor/composer/composer/src/Composer/Plugin/PrePoolCreateEvent.php +++ b/app/vendor/composer/composer/src/Composer/Plugin/PrePoolCreateEvent.php @@ -15,7 +15,6 @@ use Composer\EventDispatcher\Event; use Composer\Repository\RepositoryInterface; use Composer\DependencyResolver\Request; -use Composer\Package\PackageInterface; use Composer\Package\BasePackage; /** @@ -54,11 +53,11 @@ class PrePoolCreateEvent extends Event */ private $rootReferences; /** - * @var PackageInterface[] + * @var BasePackage[] */ private $packages; /** - * @var PackageInterface[] + * @var BasePackage[] */ private $unacceptableFixedPackages; @@ -69,6 +68,8 @@ class PrePoolCreateEvent extends Event * @param int[] $stabilityFlags array of package name => BasePackage::STABILITY_* value * @param array[] $rootAliases array of package => version => [alias, alias_normalized] * @param string[] $rootReferences + * @param BasePackage[] $packages + * @param BasePackage[] $unacceptableFixedPackages * * @phpstan-param array $acceptableStabilities * @phpstan-param array $stabilityFlags @@ -142,7 +143,7 @@ public function getRootReferences() } /** - * @return PackageInterface[] + * @return BasePackage[] */ public function getPackages() { @@ -150,7 +151,7 @@ public function getPackages() } /** - * @return PackageInterface[] + * @return BasePackage[] */ public function getUnacceptableFixedPackages() { @@ -158,7 +159,9 @@ public function getUnacceptableFixedPackages() } /** - * @param PackageInterface[] $packages + * @param BasePackage[] $packages + * + * @return void */ public function setPackages(array $packages) { @@ -166,7 +169,9 @@ public function setPackages(array $packages) } /** - * @param PackageInterface[] $packages + * @param BasePackage[] $packages + * + * @return void */ public function setUnacceptableFixedPackages(array $packages) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php b/app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php index 8b44547a1..1e7d69f73 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php @@ -30,14 +30,17 @@ */ class ArrayRepository implements RepositoryInterface { - /** @var ?array */ + /** @var ?array */ protected $packages = null; /** - * @var ?array indexed by package unique name and used to cache hasPackage calls + * @var ?array indexed by package unique name and used to cache hasPackage calls */ protected $packageMap = null; + /** + * @param array $packages + */ public function __construct(array $packages = array()) { foreach ($packages as $package) { @@ -51,7 +54,7 @@ public function getRepoName() } /** - * {@inheritDoc} + * @inheritDoc */ public function loadPackages(array $packageMap, array $acceptableStabilities, array $stabilityFlags, array $alreadyLoaded = array()) { @@ -91,7 +94,7 @@ public function loadPackages(array $packageMap, array $acceptableStabilities, ar } /** - * {@inheritDoc} + * @inheritDoc */ public function findPackage($name, $constraint) { @@ -115,7 +118,7 @@ public function findPackage($name, $constraint) } /** - * {@inheritDoc} + * @inheritDoc */ public function findPackages($name, $constraint = null) { @@ -140,7 +143,7 @@ public function findPackages($name, $constraint = null) } /** - * {@inheritDoc} + * @inheritDoc */ public function search($query, $mode = 0, $type = null) { @@ -163,6 +166,10 @@ public function search($query, $mode = 0, $type = null) 'name' => $package->getPrettyName(), 'description' => $package instanceof CompletePackageInterface ? $package->getDescription() : null, ); + + if ($package instanceof CompletePackageInterface && $package->isAbandoned()) { + $matches[$name]['abandoned'] = $package->getReplacementPackage() ?: true; + } } } @@ -170,7 +177,7 @@ public function search($query, $mode = 0, $type = null) } /** - * {@inheritDoc} + * @inheritDoc */ public function hasPackage(PackageInterface $package) { @@ -188,6 +195,8 @@ public function hasPackage(PackageInterface $package) * Adds a new package to the repository * * @param PackageInterface $package + * + * @return void */ public function addPackage(PackageInterface $package) { @@ -209,7 +218,7 @@ public function addPackage(PackageInterface $package) } /** - * {@inheritDoc} + * @inheritDoc */ public function getProviders($packageName) { @@ -235,10 +244,12 @@ public function getProviders($packageName) } /** - * @phpstan-param PackageInterface&BasePackage $package + * @param string $alias + * @param string $prettyAlias + * * @return AliasPackage|CompleteAliasPackage */ - protected function createAliasPackage(PackageInterface $package, $alias, $prettyAlias) + protected function createAliasPackage(BasePackage $package, $alias, $prettyAlias) { while ($package instanceof AliasPackage) { $package = $package->getAliasOf(); @@ -255,6 +266,8 @@ protected function createAliasPackage(PackageInterface $package, $alias, $pretty * Removes package from repository. * * @param PackageInterface $package package instance + * + * @return void */ public function removePackage(PackageInterface $package) { @@ -273,7 +286,7 @@ public function removePackage(PackageInterface $package) } /** - * {@inheritDoc} + * @inheritDoc */ public function getPackages() { @@ -305,6 +318,8 @@ public function count() /** * Initializes the packages array. Mostly meant as an extension point. + * + * @return void */ protected function initialize() { diff --git a/app/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php b/app/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php index 02b593a0b..715075dea 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php @@ -14,6 +14,7 @@ use Composer\IO\IOInterface; use Composer\Json\JsonFile; +use Composer\Package\BasePackage; use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\LoaderInterface; use Composer\Util\Tar; @@ -29,11 +30,14 @@ class ArtifactRepository extends ArrayRepository implements ConfigurableReposito /** @var string */ protected $lookup; - /** @var mixed[] */ + /** @var array{url: string} */ protected $repoConfig; /** @var IOInterface */ private $io; + /** + * @param array{url: string} $repoConfig + */ public function __construct(array $repoConfig, IOInterface $io) { parent::__construct(); @@ -64,6 +68,11 @@ protected function initialize() $this->scanDirectory($this->lookup); } + /** + * @param string $path + * + * @return void + */ private function scanDirectory($path) { $io = $this->io; @@ -90,6 +99,9 @@ private function scanDirectory($path) } } + /** + * @return ?BasePackage + */ private function getComposerInformation(\SplFileInfo $file) { $json = null; @@ -114,7 +126,7 @@ private function getComposerInformation(\SplFileInfo $file) } if (null === $json) { - return false; + return null; } $package = JsonFile::parseJson($json, $file->getPathname().'#composer.json'); diff --git a/app/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php b/app/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php index 75b3aabec..113c2074b 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php @@ -91,9 +91,9 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito private $allowSslDowngrade = false; /** @var ?EventDispatcher */ private $eventDispatcher; - /** @var ?array */ + /** @var ?array> */ private $sourceMirrors; - /** @var ?array */ + /** @var ?array */ private $distMirrors; /** @var bool */ private $degradedMode = false; @@ -128,6 +128,10 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito */ public $versionParser; + /** + * @param array $repoConfig + * @phpstan-param array{url: string, options?: mixed[], type?: 'composer', allow_ssl_downgrade?: bool} $repoConfig + */ public function __construct(array $repoConfig, IOInterface $io, Config $config, HttpDownloader $httpDownloader, EventDispatcher $eventDispatcher = null) { parent::__construct(); @@ -184,7 +188,7 @@ public function getRepoConfig() } /** - * {@inheritDoc} + * @inheritDoc */ public function findPackage($name, $constraint) { @@ -224,7 +228,7 @@ public function findPackage($name, $constraint) } /** - * {@inheritDoc} + * @inheritDoc */ public function findPackages($name, $constraint = null) { @@ -263,6 +267,13 @@ public function findPackages($name, $constraint = null) return parent::findPackages($name, $constraint); } + /** + * @param array $packages + * @param ConstraintInterface|null $constraint + * @param bool $returnFirstMatch + * + * @return BasePackage|array|null + */ private function filterPackages(array $packages, $constraint = null, $returnFirstMatch = false) { if (null === $constraint) { @@ -324,6 +335,11 @@ public function getPackages() return parent::getPackages(); } + /** + * @param string|null $packageFilter + * + * @return string[] + */ public function getPackageNames($packageFilter = null) { $hasProviders = $this->hasProviders(); @@ -444,7 +460,7 @@ public function loadPackages(array $packageNameMap, array $acceptableStabilities } /** - * {@inheritDoc} + * @inheritDoc */ public function search($query, $mode = 0, $type = null) { @@ -462,9 +478,11 @@ public function search($query, $mode = 0, $type = null) $results = array(); foreach ($search['results'] as $result) { // do not show virtual packages in results as they are not directly useful from a composer perspective - if (empty($result['virtual'])) { - $results[] = array('name' => $result['name'], 'description' => $result['description']); + if (!empty($result['virtual'])) { + continue; } + + $results[] = $result; } return $results; @@ -523,6 +541,9 @@ public function getProviders($packageName) return $result; } + /** + * @return string[] + */ private function getProviderNames() { $this->loadRootServerFile(); @@ -543,6 +564,9 @@ private function getProviderNames() return array(); } + /** + * @return void + */ protected function configurePackageTransportOptions(PackageInterface $package) { foreach ($package->getDistUrls() as $url) { @@ -554,6 +578,9 @@ protected function configurePackageTransportOptions(PackageInterface $package) } } + /** + * @return bool + */ private function hasProviders() { $this->loadRootServerFile(); @@ -563,7 +590,13 @@ private function hasProviders() /** * @param string $name package name - * @return array|mixed + * @param array|null $acceptableStabilities + * @phpstan-param array|null $acceptableStabilities + * @param array|null $stabilityFlags an array of package name => BasePackage::STABILITY_* value + * @phpstan-param array|null $stabilityFlags + * @param array> $alreadyLoaded + * + * @return array */ private function whatProvides($name, array $acceptableStabilities = null, array $stabilityFlags = null, array $alreadyLoaded = array()) { @@ -699,7 +732,7 @@ private function whatProvides($name, array $acceptableStabilities = null, array } /** - * {@inheritDoc} + * @inheritDoc */ protected function initialize() { @@ -724,7 +757,14 @@ public function addPackage(PackageInterface $package) } /** - * @param array $packageNames array of package name => ConstraintInterface|null - if a constraint is provided, only packages matching it will be loaded + * @param array $packageNames array of package name => ConstraintInterface|null - if a constraint is provided, only packages matching it will be loaded + * @param array|null $acceptableStabilities + * @phpstan-param array|null $acceptableStabilities + * @param array|null $stabilityFlags an array of package name => BasePackage::STABILITY_* value + * @phpstan-param array|null $stabilityFlags + * @param array> $alreadyLoaded + * + * @return array{namesFound: array, packages: array} */ private function loadAsyncPackages(array $packageNames, array $acceptableStabilities = null, array $stabilityFlags = null, array $alreadyLoaded = array()) { @@ -829,8 +869,17 @@ private function loadAsyncPackages(array $packageNames, array $acceptableStabili /** * TODO v3 should make this private once we can drop PHP 5.3 support * - * @param string $name package name (must be lowercased already) * @private + * + * @param ConstraintInterface|null $constraint + * @param string $name package name (must be lowercased already) + * @param array $versionData + * @param array|null $acceptableStabilities + * @phpstan-param array|null $acceptableStabilities + * @param array|null $stabilityFlags an array of package name => BasePackage::STABILITY_* value + * @phpstan-param array|null $stabilityFlags + * + * @return bool */ public function isVersionAcceptable($constraint, $name, $versionData, array $acceptableStabilities = null, array $stabilityFlags = null) { @@ -855,6 +904,9 @@ public function isVersionAcceptable($constraint, $name, $versionData, array $acc return false; } + /** + * @return string + */ private function getPackagesJsonUrl() { $jsonUrlParts = parse_url($this->url); @@ -866,6 +918,9 @@ private function getPackagesJsonUrl() return $this->url . '/packages.json'; } + /** + * @return array + */ protected function loadRootServerFile() { if (null !== $this->rootData) { @@ -977,6 +1032,11 @@ protected function loadRootServerFile() return $this->rootData = $data; } + /** + * @param string $url + * + * @return string + */ private function canonicalizeUrl($url) { if ('/' === $url[0]) { @@ -990,6 +1050,9 @@ private function canonicalizeUrl($url) return $url; } + /** + * @return array[] + */ private function loadDataFromServer() { $data = $this->loadRootServerFile(); @@ -997,6 +1060,9 @@ private function loadDataFromServer() return $this->loadIncludes($data); } + /** + * @return bool + */ private function hasPartialPackages() { if ($this->hasPartialPackages && null === $this->partialPackagesByName) { @@ -1006,6 +1072,11 @@ private function hasPartialPackages() return $this->hasPartialPackages; } + /** + * @param array{providers?: array, provider-includes?: array} $data + * + * @return void + */ private function loadProviderListings($data) { if (isset($data['providers'])) { @@ -1031,6 +1102,11 @@ private function loadProviderListings($data) } } + /** + * @param array[] $data + * + * @return array[] + */ private function loadIncludes($data) { $packages = array(); @@ -1038,8 +1114,10 @@ private function loadIncludes($data) // legacy repo handling if (!isset($data['packages']) && !isset($data['includes'])) { foreach ($data as $pkg) { - foreach ($pkg['versions'] as $metadata) { - $packages[] = $metadata; + if (isset($pkg['versions']) && is_array($pkg['versions'])) { + foreach ($pkg['versions'] as $metadata) { + $packages[] = $metadata; + } } } @@ -1056,8 +1134,8 @@ private function loadIncludes($data) if (isset($data['includes'])) { foreach ($data['includes'] as $include => $metadata) { - if (isset($metadata['sha1']) && $this->cache->sha1($include) === $metadata['sha1']) { - $includedData = json_decode($this->cache->read($include), true); + if (isset($metadata['sha1']) && $this->cache->sha1((string) $include) === $metadata['sha1']) { + $includedData = json_decode($this->cache->read((string) $include), true); } else { $includedData = $this->fetchFile($include); } @@ -1070,8 +1148,11 @@ private function loadIncludes($data) /** * TODO v3 should make this private once we can drop PHP 5.3 support - * * @private + * + * @param array[] $packages + * @param string|null $source + * * @return list */ public function createPackages(array $packages, $source = null) @@ -1103,6 +1184,14 @@ public function createPackages(array $packages, $source = null) } } + /** + * @param string $filename + * @param string|null $cacheKey + * @param string|null $sha256 + * @param bool $storeLastModifiedTime + * + * @return array + */ protected function fetchFile($filename, $cacheKey = null, $sha256 = null, $storeLastModifiedTime = false) { if (null === $cacheKey) { @@ -1128,7 +1217,7 @@ protected function fetchFile($filename, $cacheKey = null, $sha256 = null, $store } $response = $this->httpDownloader->get($filename, $options); - $json = $response->getBody(); + $json = (string) $response->getBody(); if ($sha256 && $sha256 !== hash('sha256', $json)) { // undo downgrade before trying again if http seems to be hijacked or modifying content somehow if ($this->allowSslDowngrade) { @@ -1160,7 +1249,7 @@ protected function fetchFile($filename, $cacheKey = null, $sha256 = null, $store $lastModifiedDate = $response->getHeader('last-modified'); if ($lastModifiedDate) { $data['last-modified'] = $lastModifiedDate; - $json = json_encode($data); + $json = JsonFile::encode($data, 0); } } $this->cache->write($cacheKey, $json); @@ -1216,6 +1305,13 @@ protected function fetchFile($filename, $cacheKey = null, $sha256 = null, $store return $data; } + /** + * @param string $filename + * @param string $cacheKey + * @param string $lastModifiedTime + * + * @return array|true + */ private function fetchFileIfLastModified($filename, $cacheKey, $lastModifiedTime) { $retries = 3; @@ -1235,7 +1331,7 @@ private function fetchFileIfLastModified($filename, $cacheKey, $lastModifiedTime } $options['http']['header'][] = 'If-Modified-Since: '.$lastModifiedTime; $response = $this->httpDownloader->get($filename, $options); - $json = $response->getBody(); + $json = (string) $response->getBody(); if ($json === '' && $response->getStatusCode() === 304) { return true; } @@ -1252,7 +1348,7 @@ private function fetchFileIfLastModified($filename, $cacheKey, $lastModifiedTime $response->collect(); if ($lastModifiedDate) { $data['last-modified'] = $lastModifiedDate; - $json = json_encode($data); + $json = JsonFile::encode($data, 0); } if (!$this->cache->isReadOnly()) { $this->cache->write($cacheKey, $json); @@ -1281,8 +1377,17 @@ private function fetchFileIfLastModified($filename, $cacheKey, $lastModifiedTime return true; } } + + throw new \LogicException('Should not happen'); } + /** + * @param string $filename + * @param string $cacheKey + * @param string|null $lastModifiedTime + * + * @return \React\Promise\PromiseInterface + */ private function asyncFetchFile($filename, $cacheKey, $lastModifiedTime = null) { $retries = 3; @@ -1328,7 +1433,7 @@ private function asyncFetchFile($filename, $cacheKey, $lastModifiedTime = null) return array('packages' => array()); } - $json = $response->getBody(); + $json = (string) $response->getBody(); if ($json === '' && $response->getStatusCode() === 304) { $repo->freshMetadataUrls[$filename] = true; @@ -1408,6 +1513,8 @@ private function asyncFetchFile($filename, $cacheKey, $lastModifiedTime = null) * This initializes the packages key of a partial packages.json that contain some packages inlined + a providers-lazy-url * * This should only be called once + * + * @return void */ private function initializePartialPackages() { diff --git a/app/vendor/composer/composer/src/Composer/Repository/CompositeRepository.php b/app/vendor/composer/composer/src/Composer/Repository/CompositeRepository.php index 8426364a5..d6cfc46e7 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/CompositeRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/CompositeRepository.php @@ -49,7 +49,7 @@ public function getRepoName() /** * Returns all the wrapped repositories * - * @return array + * @return RepositoryInterface[] */ public function getRepositories() { @@ -57,7 +57,7 @@ public function getRepositories() } /** - * {@inheritdoc} + * @inheritDoc */ public function hasPackage(PackageInterface $package) { @@ -72,7 +72,7 @@ public function hasPackage(PackageInterface $package) } /** - * {@inheritdoc} + * @inheritDoc */ public function findPackage($name, $constraint) { @@ -88,7 +88,7 @@ public function findPackage($name, $constraint) } /** - * {@inheritdoc} + * @inheritDoc */ public function findPackages($name, $constraint = null) { @@ -102,7 +102,7 @@ public function findPackages($name, $constraint = null) } /** - * {@inheritDoc} + * @inheritDoc */ public function loadPackages(array $packageMap, array $acceptableStabilities, array $stabilityFlags, array $alreadyLoaded = array()) { @@ -122,7 +122,7 @@ public function loadPackages(array $packageMap, array $acceptableStabilities, ar } /** - * {@inheritdoc} + * @inheritDoc */ public function search($query, $mode = 0, $type = null) { @@ -136,7 +136,7 @@ public function search($query, $mode = 0, $type = null) } /** - * {@inheritdoc} + * @inheritDoc */ public function getPackages() { @@ -150,7 +150,7 @@ public function getPackages() } /** - * {@inheritdoc} + * @inheritDoc */ public function getProviders($packageName) { @@ -164,7 +164,7 @@ public function getProviders($packageName) } /** - * {@inheritdoc} + * @return void */ public function removePackage(PackageInterface $package) { @@ -176,7 +176,7 @@ public function removePackage(PackageInterface $package) } /** - * {@inheritdoc} + * @inheritDoc */ #[\ReturnTypeWillChange] public function count() @@ -193,6 +193,8 @@ public function count() /** * Add a repository. * @param RepositoryInterface $repository + * + * @return void */ public function addRepository(RepositoryInterface $repository) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/ConfigurableRepositoryInterface.php b/app/vendor/composer/composer/src/Composer/Repository/ConfigurableRepositoryInterface.php index ff202dc88..46a535830 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/ConfigurableRepositoryInterface.php +++ b/app/vendor/composer/composer/src/Composer/Repository/ConfigurableRepositoryInterface.php @@ -19,5 +19,8 @@ */ interface ConfigurableRepositoryInterface { + /** + * @return mixed[] + */ public function getRepoConfig(); } diff --git a/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php b/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php index debdb7a89..6f130ce05 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php @@ -154,6 +154,12 @@ public function write($devMode, InstallationManager $installationManager) } } + /** + * @param array $array + * @param int $level + * + * @return string + */ private function dumpToPhpCode(array $array = array(), $level = 0) { $lines = "array(\n"; @@ -186,7 +192,11 @@ private function dumpToPhpCode(array $array = array(), $level = 0) } /** - * @return ?array + * @param array $installPaths + * @param bool $devMode + * @param string $repoDir + * + * @return ?array */ private function generateInstalledVersions(InstallationManager $installationManager, array $installPaths, $devMode, $repoDir) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/FilterRepository.php b/app/vendor/composer/composer/src/Composer/Repository/FilterRepository.php index 8ce7be05f..429659129 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/FilterRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/FilterRepository.php @@ -31,6 +31,9 @@ class FilterRepository implements RepositoryInterface /** @var RepositoryInterface */ private $repo; + /** + * @param array{only?: array, exclude?: array, canonical?: bool} $options + */ public function __construct(RepositoryInterface $repo, array $options) { if (isset($options['only'])) { @@ -78,7 +81,7 @@ public function getRepository() } /** - * {@inheritdoc} + * @inheritDoc */ public function hasPackage(PackageInterface $package) { @@ -86,7 +89,7 @@ public function hasPackage(PackageInterface $package) } /** - * {@inheritdoc} + * @inheritDoc */ public function findPackage($name, $constraint) { @@ -98,7 +101,7 @@ public function findPackage($name, $constraint) } /** - * {@inheritdoc} + * @inheritDoc */ public function findPackages($name, $constraint = null) { @@ -110,7 +113,7 @@ public function findPackages($name, $constraint = null) } /** - * {@inheritDoc} + * @inheritDoc */ public function loadPackages(array $packageMap, array $acceptableStabilities, array $stabilityFlags, array $alreadyLoaded = array()) { @@ -133,7 +136,7 @@ public function loadPackages(array $packageMap, array $acceptableStabilities, ar } /** - * {@inheritdoc} + * @inheritDoc */ public function search($query, $mode = 0, $type = null) { @@ -149,7 +152,7 @@ public function search($query, $mode = 0, $type = null) } /** - * {@inheritdoc} + * @inheritDoc */ public function getPackages() { @@ -164,7 +167,7 @@ public function getPackages() } /** - * {@inheritdoc} + * @inheritDoc */ public function getProviders($packageName) { @@ -179,7 +182,7 @@ public function getProviders($packageName) } /** - * {@inheritdoc} + * @inheritDoc */ #[\ReturnTypeWillChange] public function count() @@ -191,6 +194,11 @@ public function count() return 0; } + /** + * @param string $name + * + * @return bool + */ private function isAllowed($name) { if (!$this->only && !$this->exclude) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/InstalledArrayRepository.php b/app/vendor/composer/composer/src/Composer/Repository/InstalledArrayRepository.php index e8a5f8194..40673e7f7 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/InstalledArrayRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/InstalledArrayRepository.php @@ -27,7 +27,7 @@ public function getRepoName() } /** - * {@inheritDoc} + * @inheritDoc */ public function isFresh() { diff --git a/app/vendor/composer/composer/src/Composer/Repository/InstalledFilesystemRepository.php b/app/vendor/composer/composer/src/Composer/Repository/InstalledFilesystemRepository.php index f526f31c2..ac8bef79a 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/InstalledFilesystemRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/InstalledFilesystemRepository.php @@ -25,7 +25,7 @@ public function getRepoName() } /** - * {@inheritDoc} + * @inheritDoc */ public function isFresh() { diff --git a/app/vendor/composer/composer/src/Composer/Repository/InstalledRepository.php b/app/vendor/composer/composer/src/Composer/Repository/InstalledRepository.php index 13c5fddbb..db0967ba7 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/InstalledRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/InstalledRepository.php @@ -12,6 +12,8 @@ namespace Composer\Repository; +use Composer\Package\BasePackage; +use Composer\Package\PackageInterface; use Composer\Package\Version\VersionParser; use Composer\Semver\Constraint\ConstraintInterface; use Composer\Semver\Constraint\Constraint; @@ -30,6 +32,12 @@ */ class InstalledRepository extends CompositeRepository { + /** + * @param string $name + * @param ConstraintInterface|string|null $constraint + * + * @return BasePackage[] + */ public function findPackagesWithReplacersAndProviders($name, $constraint = null) { $name = strtolower($name); @@ -52,7 +60,7 @@ public function findPackagesWithReplacersAndProviders($name, $constraint = null) foreach (array_merge($candidate->getProvides(), $candidate->getReplaces()) as $link) { if ( $name === $link->getTarget() - && ($constraint === null || $link->getConstraint() === null || $constraint->matches($link->getConstraint())) + && ($constraint === null || $constraint->matches($link->getConstraint())) ) { $matches[] = $candidate; continue 2; @@ -75,7 +83,9 @@ public function findPackagesWithReplacersAndProviders($name, $constraint = null) * @param bool $invert Whether to invert matches to discover reasons for the package *NOT* to be installed. * @param bool $recurse Whether to recursively expand the requirement tree up to the root package. * @param string[] $packagesFound Used internally when recurring - * @return array An associative array of arrays as described above. + * + * @return array[] An associative array of arrays as described above. + * @phpstan-return array */ public function getDependents($needle, $constraint = null, $invert = false, $recurse = true, $packagesFound = null) { @@ -247,8 +257,7 @@ public function getRepoName() } /** - * Add a repository. - * @param RepositoryInterface $repository + * @inheritDoc */ public function addRepository(RepositoryInterface $repository) { @@ -258,7 +267,9 @@ public function addRepository(RepositoryInterface $repository) || $repository instanceof RootPackageRepository || $repository instanceof PlatformRepository ) { - return parent::addRepository($repository); + parent::addRepository($repository); + + return; } throw new \LogicException('An InstalledRepository can not contain a repository of type '.get_class($repository).' ('.$repository->getRepoName().')'); diff --git a/app/vendor/composer/composer/src/Composer/Repository/PackageRepository.php b/app/vendor/composer/composer/src/Composer/Repository/PackageRepository.php index c5576cf7e..06f987d43 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/PackageRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/PackageRepository.php @@ -28,7 +28,7 @@ class PackageRepository extends ArrayRepository /** * Initializes filesystem repository. * - * @param array $config package definition + * @param array{package: array} $config package definition */ public function __construct(array $config) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/PathRepository.php b/app/vendor/composer/composer/src/Composer/Repository/PathRepository.php index 7232e0368..afdf84749 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/PathRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/PathRepository.php @@ -95,7 +95,7 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn /** * Initializes path repository. * - * @param array $repoConfig + * @param array{url: string, options?: array{symlink?: bool, relative?: bool, versions?: array}} $repoConfig * @param IOInterface $io * @param Config $config */ diff --git a/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php b/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php index 5cd1ae27c..d34f557d5 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php @@ -57,6 +57,9 @@ class PlatformRepository extends ArrayRepository /** @var HhvmDetector */ private $hhvmDetector; + /** + * @param array $overrides + */ public function __construct(array $packages = array(), array $overrides = array(), Runtime $runtime = null, HhvmDetector $hhvmDetector = null) { $this->runtime = $runtime ?: new Runtime(); @@ -487,7 +490,7 @@ protected function initialize() } /** - * {@inheritDoc} + * @inheritDoc */ public function addPackage(PackageInterface $package) { @@ -523,6 +526,9 @@ public function addPackage(PackageInterface $package) } /** + * @param array{version: string, name: string} $override + * @param string|null $name + * * @return CompletePackage */ private function addOverriddenPackage(array $override, $name = null) @@ -545,6 +551,8 @@ private function addOverriddenPackage(array $override, $name = null) * * @param string $name * @param null|string $prettyVersion + * + * @return void */ private function addExtension($name, $prettyVersion) { @@ -590,6 +598,8 @@ private function buildPackageName($name) * @param string|null $description * @param string[] $replaces * @param string[] $provides + * + * @return void */ private function addLibrary($name, $prettyVersion, $description = null, array $replaces = array(), array $provides = array()) { @@ -640,6 +650,7 @@ public static function isPlatformPackage($name) * be correct. * * @internal + * @return string|null */ public static function getPlatformPhpVersion() { diff --git a/app/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php b/app/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php index 4eeaa14aa..713d4d9c0 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php +++ b/app/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php @@ -73,7 +73,7 @@ public static function fromString(IOInterface $io, Config $config, $repository, /** * @param IOInterface $io * @param Config $config - * @param array $repoConfig + * @param array $repoConfig * @return RepositoryInterface */ public static function createRepo(IOInterface $io, Config $config, array $repoConfig, RepositoryManager $rm = null) @@ -140,6 +140,8 @@ public static function manager(IOInterface $io, Config $config, HttpDownloader $ } /** + * @param array $repoConfigs + * * @return RepositoryInterface[] */ private static function createRepos(RepositoryManager $rm, array $repoConfigs) @@ -168,6 +170,13 @@ private static function createRepos(RepositoryManager $rm, array $repoConfigs) return $repos; } + /** + * @param int|string $index + * @param array{url?: string} $repo + * @param array $existingRepos + * + * @return string + */ public static function generateRepositoryName($index, array $repo, array $existingRepos) { $name = is_int($index) && isset($repo['url']) ? preg_replace('{^https?://}i', '', $repo['url']) : $index; diff --git a/app/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php b/app/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php index 3b0760e0e..e8be2a07c 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php +++ b/app/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php @@ -43,8 +43,7 @@ public function hasPackage(PackageInterface $package); * @param string $name package name * @param string|ConstraintInterface $constraint package version or version constraint to match against * - * @return PackageInterface|null - * @phpstan-return (BasePackage&PackageInterface)|null + * @return BasePackage|null */ public function findPackage($name, $constraint); @@ -54,16 +53,14 @@ public function findPackage($name, $constraint); * @param string $name package name * @param string|ConstraintInterface $constraint package version or version constraint to match against * - * @return PackageInterface[] - * @phpstan-return array + * @return BasePackage[] */ public function findPackages($name, $constraint = null); /** * Returns list of registered packages. * - * @return PackageInterface[] - * @phpstan-return array + * @return BasePackage[] */ public function getPackages(); @@ -81,7 +78,7 @@ public function getPackages(); * @return array * * @phpstan-param array $packageNameMap - * @phpstan-return array{namesFound: string[], packages: array} + * @phpstan-return array{namesFound: array, packages: array} */ public function loadPackages(array $packageNameMap, array $acceptableStabilities, array $stabilityFlags, array $alreadyLoaded = array()); @@ -93,7 +90,7 @@ public function loadPackages(array $packageNameMap, array $acceptableStabilities * @param string $type The type of package to search for. Defaults to all types of packages * * @return array[] an array of array('name' => '...', 'description' => '...'|null) - * @phpstan-return list + * @phpstan-return list */ public function search($query, $mode = 0, $type = null); diff --git a/app/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php b/app/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php index 12123ce7b..a230c25e9 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php +++ b/app/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php @@ -32,7 +32,7 @@ class RepositoryManager private $localRepository; /** @var list */ private $repositories = array(); - /** @var array */ + /** @var array> */ private $repositoryClasses = array(); /** @var IOInterface */ private $io; @@ -97,6 +97,8 @@ public function findPackages($name, $constraint) * Adds repository * * @param RepositoryInterface $repository repository instance + * + * @return void */ public function addRepository(RepositoryInterface $repository) { @@ -109,6 +111,8 @@ public function addRepository(RepositoryInterface $repository) * This is useful when injecting additional repositories that should trump Packagist, e.g. from a plugin. * * @param RepositoryInterface $repository repository instance + * + * @return void */ public function prependRepository(RepositoryInterface $repository) { @@ -119,7 +123,7 @@ public function prependRepository(RepositoryInterface $repository) * Returns a new repository for a specific installation type. * * @param string $type repository type - * @param array $config repository configuration + * @param array $config repository configuration * @param string $name repository name * @throws \InvalidArgumentException if repository for provided type is not registered * @return RepositoryInterface @@ -154,7 +158,9 @@ public function createRepository($type, $config, $name = null) * Stores repository class for a specific installation type. * * @param string $type installation type - * @param string $class class name of the repo implementation + * @param class-string $class class name of the repo implementation + * + * @return void */ public function setRepositoryClass($type, $class) { @@ -175,6 +181,8 @@ public function getRepositories() * Sets local repository for the project. * * @param InstalledRepositoryInterface $repository repository instance + * + * @return void */ public function setLocalRepository(InstalledRepositoryInterface $repository) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/RepositorySet.php b/app/vendor/composer/composer/src/Composer/Repository/RepositorySet.php index d87a334b3..44ae258e7 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/RepositorySet.php +++ b/app/vendor/composer/composer/src/Composer/Repository/RepositorySet.php @@ -22,7 +22,6 @@ use Composer\Package\AliasPackage; use Composer\Package\CompleteAliasPackage; use Composer\Package\CompletePackage; -use Composer\Package\CompletePackageInterface; use Composer\Semver\Constraint\ConstraintInterface; use Composer\Package\Version\StabilityFilter; @@ -113,6 +112,11 @@ public function __construct($minimumStability = 'stable', array $stabilityFlags } } + /** + * @param bool $allow + * + * @return void + */ public function allowInstalledRepositories($allow = true) { $this->allowInstalledRepositories = $allow; @@ -134,6 +138,8 @@ public function getRootRequires() * repository the search for that package ends, and following repos will not be consulted. * * @param RepositoryInterface $repo A package repository + * + * @return void */ public function addRepository(RepositoryInterface $repo) { @@ -160,7 +166,7 @@ public function addRepository(RepositoryInterface $repo) * @param string $name * @param ConstraintInterface|null $constraint * @param int $flags any of the ALLOW_* constants from this class to tweak what is returned - * @return array + * @return BasePackage[] */ public function findPackages($name, ConstraintInterface $constraint = null, $flags = 0) { @@ -292,12 +298,22 @@ public function createPoolWithAllPackages() return new Pool($packages); } - // TODO unify this with above in some simpler version without "request"? + /** + * @param string $packageName + * + * @return Pool + */ public function createPoolForPackage($packageName, LockArrayRepository $lockedRepo = null) { + // TODO unify this with above in some simpler version without "request"? return $this->createPoolForPackages(array($packageName), $lockedRepo); } + /** + * @param string[] $packageNames + * + * @return Pool + */ public function createPoolForPackages($packageNames, LockArrayRepository $lockedRepo = null) { $request = new Request($lockedRepo); @@ -313,6 +329,12 @@ public function createPoolForPackages($packageNames, LockArrayRepository $locked return $this->createPool($request, new NullIO()); } + /** + * @param array[] $aliases + * @phpstan-param list $aliases + * + * @return array> + */ private static function getRootAliasesPerPackage(array $aliases) { $normalizedAliases = array(); diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php index 8bd47a7a2..596d7437b 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php @@ -51,7 +51,7 @@ abstract class BitbucketDriver extends VcsDriver protected $vcsType; /** - * {@inheritDoc} + * @inheritDoc */ public function initialize() { @@ -72,7 +72,7 @@ public function initialize() } /** - * {@inheritDoc} + * @inheritDoc */ public function getUrl() { @@ -120,7 +120,7 @@ protected function getRepoData() } /** - * {@inheritDoc} + * @inheritDoc */ public function getComposerInformation($identifier) { @@ -194,7 +194,7 @@ public function getComposerInformation($identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getFileContent($file, $identifier) { @@ -221,7 +221,7 @@ public function getFileContent($file, $identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getChangeDate($identifier) { @@ -248,7 +248,7 @@ public function getChangeDate($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getSource($identifier) { @@ -260,7 +260,7 @@ public function getSource($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDist($identifier) { @@ -279,7 +279,7 @@ public function getDist($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getTags() { @@ -323,7 +323,7 @@ public function getTags() } /** - * {@inheritDoc} + * @inheritDoc */ public function getBranches() { @@ -393,9 +393,9 @@ protected function fetchWithOAuthCredentials($url, $fetchingRepoData = false) } if (!$this->io->isInteractive() && $fetchingRepoData) { - if ($this->attemptCloneFallback()) { - return new Response(array('url' => 'dummy'), 200, array(), 'null'); - } + $this->attemptCloneFallback(); + + return new Response(array('url' => 'dummy'), 200, array(), 'null'); } } @@ -412,6 +412,9 @@ abstract protected function generateSshUrl(); /** * @phpstan-impure + * + * @return true + * @throws \RuntimeException */ protected function attemptCloneFallback() { @@ -437,7 +440,7 @@ protected function attemptCloneFallback() abstract protected function setupFallbackDriver($url); /** - * @param array $cloneLinks + * @param array $cloneLinks * @return void */ protected function parseCloneUrls(array $cloneLinks) @@ -452,7 +455,7 @@ protected function parseCloneUrls(array $cloneLinks) } /** - * @return array|null + * @return (array{name: string}&mixed[])|null */ protected function getMainBranchData() { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php index c4c468f40..e78c399a8 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php @@ -35,7 +35,7 @@ class FossilDriver extends VcsDriver protected $checkoutDir; /** - * {@inheritDoc} + * @inheritDoc */ public function initialize() { @@ -50,7 +50,7 @@ public function initialize() if (Filesystem::isLocalPath($this->url) && is_dir($this->url)) { $this->checkoutDir = $this->url; } else { - if (!Cache::isUsable($this->config->get('cache-repo-dir')) || !Cache::isUsable($this->config->get('cache-vcs-dir'))) { + if (!Cache::isUsable((string) $this->config->get('cache-repo-dir')) || !Cache::isUsable((string) $this->config->get('cache-vcs-dir'))) { throw new \RuntimeException('FossilDriver requires a usable cache directory, and it looks like you set it to be disabled'); } @@ -67,6 +67,8 @@ public function initialize() /** * Check that fossil can be invoked via command line. + * + * @return void */ protected function checkFossil() { @@ -77,6 +79,8 @@ protected function checkFossil() /** * Clone or update existing local fossil repository. + * + * @return void */ protected function updateLocalRepo() { @@ -114,7 +118,7 @@ protected function updateLocalRepo() } /** - * {@inheritDoc} + * @inheritDoc */ public function getRootIdentifier() { @@ -126,7 +130,7 @@ public function getRootIdentifier() } /** - * {@inheritDoc} + * @inheritDoc */ public function getUrl() { @@ -134,7 +138,7 @@ public function getUrl() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSource($identifier) { @@ -142,7 +146,7 @@ public function getSource($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDist($identifier) { @@ -150,7 +154,7 @@ public function getDist($identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getFileContent($file, $identifier) { @@ -165,7 +169,7 @@ public function getFileContent($file, $identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getChangeDate($identifier) { @@ -176,7 +180,7 @@ public function getChangeDate($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getTags() { @@ -195,7 +199,7 @@ public function getTags() } /** - * {@inheritDoc} + * @inheritDoc */ public function getBranches() { @@ -215,7 +219,7 @@ public function getBranches() } /** - * {@inheritDoc} + * @inheritDoc */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php index ab59c23e1..df80ea25c 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php @@ -21,7 +21,7 @@ class GitBitbucketDriver extends BitbucketDriver { /** - * {@inheritDoc} + * @inheritDoc */ public function getRootIdentifier() { @@ -53,7 +53,7 @@ public function getRootIdentifier() } /** - * {@inheritDoc} + * @inheritDoc */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { @@ -71,7 +71,7 @@ public static function supports(IOInterface $io, Config $config, $url, $deep = f } /** - * {@inheritdoc} + * @inheritDoc */ protected function setupFallbackDriver($url) { @@ -86,7 +86,7 @@ protected function setupFallbackDriver($url) } /** - * {@inheritdoc} + * @inheritDoc */ protected function generateSshUrl() { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php index 4fef3f702..dd0bab0f5 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php @@ -35,7 +35,7 @@ class GitDriver extends VcsDriver protected $repoDir; /** - * {@inheritDoc} + * @inheritDoc */ public function initialize() { @@ -47,7 +47,7 @@ public function initialize() $this->repoDir = $this->url; $cacheUrl = realpath($this->url); } else { - if (!Cache::isUsable($this->config->get('cache-vcs-dir'))) { + if (!Cache::isUsable((string) $this->config->get('cache-vcs-dir'))) { throw new \RuntimeException('GitDriver requires a usable cache directory, and it looks like you set it to be disabled'); } @@ -85,7 +85,7 @@ public function initialize() } /** - * {@inheritDoc} + * @inheritDoc */ public function getRootIdentifier() { @@ -109,7 +109,7 @@ public function getRootIdentifier() } /** - * {@inheritDoc} + * @inheritDoc */ public function getUrl() { @@ -117,7 +117,7 @@ public function getUrl() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSource($identifier) { @@ -125,7 +125,7 @@ public function getSource($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDist($identifier) { @@ -133,7 +133,7 @@ public function getDist($identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getFileContent($file, $identifier) { @@ -148,7 +148,7 @@ public function getFileContent($file, $identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getChangeDate($identifier) { @@ -161,7 +161,7 @@ public function getChangeDate($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getTags() { @@ -180,7 +180,7 @@ public function getTags() } /** - * {@inheritDoc} + * @inheritDoc */ public function getBranches() { @@ -203,7 +203,7 @@ public function getBranches() } /** - * {@inheritDoc} + * @inheritDoc */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php index af0ef59da..f186bb6f5 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php @@ -54,7 +54,7 @@ class GitHubDriver extends VcsDriver protected $gitDriver = null; /** - * {@inheritDoc} + * @inheritDoc */ public function initialize() { @@ -77,13 +77,16 @@ public function initialize() $this->fetchRootIdentifier(); } + /** + * @return string + */ public function getRepositoryUrl() { return 'https://'.$this->originUrl.'/'.$this->owner.'/'.$this->repository; } /** - * {@inheritDoc} + * @inheritDoc */ public function getRootIdentifier() { @@ -95,7 +98,7 @@ public function getRootIdentifier() } /** - * {@inheritDoc} + * @inheritDoc */ public function getUrl() { @@ -107,7 +110,7 @@ public function getUrl() } /** - * {@inheritDoc} + * @return string */ protected function getApiUrl() { @@ -121,7 +124,7 @@ protected function getApiUrl() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSource($identifier) { @@ -140,7 +143,7 @@ public function getSource($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDist($identifier) { @@ -150,7 +153,7 @@ public function getDist($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getComposerInformation($identifier) { @@ -192,6 +195,9 @@ public function getComposerInformation($identifier) return $this->infoCache[$identifier]; } + /** + * @return array|false + */ private function getFundingInfo() { if (null !== $this->fundingInfo) { @@ -275,7 +281,7 @@ private function getFundingInfo() } /** - * {@inheritdoc} + * @inheritDoc */ public function getFileContent($file, $identifier) { @@ -293,7 +299,7 @@ public function getFileContent($file, $identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getChangeDate($identifier) { @@ -308,7 +314,7 @@ public function getChangeDate($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getTags() { @@ -334,7 +340,7 @@ public function getTags() } /** - * {@inheritDoc} + * @inheritDoc */ public function getBranches() { @@ -363,7 +369,7 @@ public function getBranches() } /** - * {@inheritDoc} + * @inheritDoc */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { @@ -388,7 +394,7 @@ public static function supports(IOInterface $io, Config $config, $url, $deep = f /** * Gives back the loaded /repos// result * - * @return array|null + * @return mixed[]|null */ public function getRepoData() { @@ -412,7 +418,9 @@ protected function generateSshUrl() } /** - * {@inheritDoc} + * @inheritDoc + * + * @param bool $fetchingRepoData */ protected function getContents($url, $fetchingRepoData = false) { @@ -434,9 +442,9 @@ protected function getContents($url, $fetchingRepoData = false) } if (!$this->io->isInteractive()) { - if ($this->attemptCloneFallback()) { - return new Response(array('url' => 'dummy'), 200, array(), 'null'); - } + $this->attemptCloneFallback(); + + return new Response(array('url' => 'dummy'), 200, array(), 'null'); } $scopesIssued = array(); @@ -464,12 +472,12 @@ protected function getContents($url, $fetchingRepoData = false) } if (!$this->io->isInteractive() && $fetchingRepoData) { - if ($this->attemptCloneFallback()) { - return new Response(array('url' => 'dummy'), 200, array(), 'null'); - } + $this->attemptCloneFallback(); + + return new Response(array('url' => 'dummy'), 200, array(), 'null'); } - $rateLimited = $gitHubUtil->isRateLimited($e->getHeaders()); + $rateLimited = $gitHubUtil->isRateLimited((array) $e->getHeaders()); if (!$this->io->hasAuthentication($this->originUrl)) { if (!$this->io->isInteractive()) { @@ -502,6 +510,7 @@ protected function getContents($url, $fetchingRepoData = false) /** * Fetch root identifier from GitHub * + * @return void * @throws TransportException */ protected function fetchRootIdentifier() @@ -540,6 +549,12 @@ protected function fetchRootIdentifier() $this->isArchived = !empty($this->repoData['archived']); } + /** + * @phpstan-impure + * + * @return true + * @throws \RuntimeException + */ protected function attemptCloneFallback() { $this->isPrivate = true; @@ -560,6 +575,11 @@ protected function attemptCloneFallback() } } + /** + * @param string $url + * + * @return void + */ protected function setupGitDriver($url) { $this->gitDriver = new GitDriver( @@ -572,12 +592,14 @@ protected function setupGitDriver($url) $this->gitDriver->initialize(); } + /** + * @return string|null + */ protected function getNextPage(Response $response) { $header = $response->getHeader('link'); - if (!$header) { - return; + return null; } $links = explode(',', $header); @@ -586,5 +608,7 @@ protected function getNextPage(Response $response) return $match[1]; } } + + return null; } } diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php index 8e9d9059d..cfecee898 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php @@ -88,7 +88,7 @@ class GitLabDriver extends VcsDriver * * SSH urls use https by default. Set "secure-http": false on the repository config to use http instead. * - * {@inheritDoc} + * @inheritDoc */ public function initialize() { @@ -132,6 +132,8 @@ public function initialize() * Mainly useful for tests. * * @internal + * + * @return void */ public function setHttpDownloader(HttpDownloader $httpDownloader) { @@ -139,7 +141,7 @@ public function setHttpDownloader(HttpDownloader $httpDownloader) } /** - * {@inheritDoc} + * @inheritDoc */ public function getComposerInformation($identifier) { @@ -175,7 +177,7 @@ public function getComposerInformation($identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getFileContent($file, $identifier) { @@ -207,7 +209,7 @@ public function getFileContent($file, $identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getChangeDate($identifier) { @@ -223,7 +225,7 @@ public function getChangeDate($identifier) } /** - * {@inheritDoc} + * @return string */ public function getRepositoryUrl() { @@ -235,7 +237,7 @@ public function getRepositoryUrl() } /** - * {@inheritDoc} + * @inheritDoc */ public function getUrl() { @@ -247,7 +249,7 @@ public function getUrl() } /** - * {@inheritDoc} + * @inheritDoc */ public function getDist($identifier) { @@ -257,7 +259,7 @@ public function getDist($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getSource($identifier) { @@ -269,7 +271,7 @@ public function getSource($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getRootIdentifier() { @@ -281,7 +283,7 @@ public function getRootIdentifier() } /** - * {@inheritDoc} + * @inheritDoc */ public function getBranches() { @@ -297,7 +299,7 @@ public function getBranches() } /** - * {@inheritDoc} + * @inheritDoc */ public function getTags() { @@ -373,6 +375,9 @@ protected function getReferences($type) return $references; } + /** + * @return void + */ protected function fetchProject() { // we need to fetch the default branch from the api @@ -386,6 +391,12 @@ protected function fetchProject() } } + /** + * @phpstan-impure + * + * @return true + * @throws \RuntimeException + */ protected function attemptCloneFallback() { if ($this->isPrivate === false) { @@ -423,11 +434,19 @@ protected function generateSshUrl() return 'git@' . $this->originUrl . ':'.$this->namespace.'/'.$this->repository.'.git'; } + /** + * @return string + */ protected function generatePublicUrl() { return $this->scheme . '://' . $this->originUrl . '/'.$this->namespace.'/'.$this->repository.'.git'; } + /** + * @param string $url + * + * @return void + */ protected function setupGitDriver($url) { $this->gitDriver = new GitDriver( @@ -441,7 +460,9 @@ protected function setupGitDriver($url) } /** - * {@inheritDoc} + * @inheritDoc + * + * @param bool $fetchingRepoData */ protected function getContents($url, $fetchingRepoData = false) { @@ -470,7 +491,9 @@ protected function getContents($url, $fetchingRepoData = false) if (!$moreThanGuestAccess) { $this->io->writeError('GitLab token with Guest only access detected'); - return $this->attemptCloneFallback(); + $this->attemptCloneFallback(); + + return new Response(array('url' => 'dummy'), 200, array(), 'null'); } } @@ -501,9 +524,9 @@ protected function getContents($url, $fetchingRepoData = false) } if (!$this->io->isInteractive()) { - if ($this->attemptCloneFallback()) { - return new Response(array('url' => 'dummy'), 200, array(), 'null'); - } + $this->attemptCloneFallback(); + + return new Response(array('url' => 'dummy'), 200, array(), 'null'); } $this->io->writeError('Failed to download ' . $this->namespace . '/' . $this->repository . ':' . $e->getMessage() . ''); $gitLabUtil->authorizeOAuthInteractively($this->scheme, $this->originUrl, 'Your credentials are required to fetch private repository metadata ('.$this->url.')'); @@ -516,9 +539,9 @@ protected function getContents($url, $fetchingRepoData = false) } if (!$this->io->isInteractive() && $fetchingRepoData) { - if ($this->attemptCloneFallback()) { - return new Response(array('url' => 'dummy'), 200, array(), 'null'); - } + $this->attemptCloneFallback(); + + return new Response(array('url' => 'dummy'), 200, array(), 'null'); } throw $e; @@ -533,7 +556,7 @@ protected function getContents($url, $fetchingRepoData = false) * Uses the config `gitlab-domains` to see if the driver supports the url for the * repository given. * - * {@inheritDoc} + * @inheritDoc */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { @@ -558,6 +581,9 @@ public static function supports(IOInterface $io, Config $config, $url, $deep = f return true; } + /** + * @return string|null + */ protected function getNextPage(Response $response) { $header = $response->getHeader('link'); @@ -568,13 +594,17 @@ protected function getNextPage(Response $response) return $match[1]; } } + + return null; } /** - * @param array $configuredDomains - * @param string $guessedDomain - * @param array $urlParts - * @return bool|string + * @param array $configuredDomains + * @param string $guessedDomain + * @param array $urlParts + * @param string $portNumber + * + * @return string|false */ private static function determineOrigin(array $configuredDomains, $guessedDomain, array &$urlParts, $portNumber) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php index 71505cf52..bd6734690 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php @@ -21,7 +21,7 @@ class HgBitbucketDriver extends BitbucketDriver { /** - * {@inheritDoc} + * @inheritDoc */ public function getRootIdentifier() { @@ -53,7 +53,7 @@ public function getRootIdentifier() } /** - * {@inheritDoc} + * @inheritDoc */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { @@ -71,7 +71,7 @@ public static function supports(IOInterface $io, Config $config, $url, $deep = f } /** - * {@inheritdoc} + * @inheritDoc */ protected function setupFallbackDriver($url) { @@ -86,7 +86,7 @@ protected function setupFallbackDriver($url) } /** - * {@inheritdoc} + * @inheritDoc */ protected function generateSshUrl() { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php index 56e35ea30..b1f63afd4 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php @@ -34,14 +34,14 @@ class HgDriver extends VcsDriver protected $repoDir; /** - * {@inheritDoc} + * @inheritDoc */ public function initialize() { if (Filesystem::isLocalPath($this->url)) { $this->repoDir = $this->url; } else { - if (!Cache::isUsable($this->config->get('cache-vcs-dir'))) { + if (!Cache::isUsable((string) $this->config->get('cache-vcs-dir'))) { throw new \RuntimeException('HgDriver requires a usable cache directory, and it looks like you set it to be disabled'); } @@ -83,7 +83,7 @@ public function initialize() } /** - * {@inheritDoc} + * @inheritDoc */ public function getRootIdentifier() { @@ -97,7 +97,7 @@ public function getRootIdentifier() } /** - * {@inheritDoc} + * @inheritDoc */ public function getUrl() { @@ -105,7 +105,7 @@ public function getUrl() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSource($identifier) { @@ -113,7 +113,7 @@ public function getSource($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDist($identifier) { @@ -121,7 +121,7 @@ public function getDist($identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getFileContent($file, $identifier) { @@ -136,7 +136,7 @@ public function getFileContent($file, $identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getChangeDate($identifier) { @@ -153,7 +153,7 @@ public function getChangeDate($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getTags() { @@ -175,7 +175,7 @@ public function getTags() } /** - * {@inheritDoc} + * @inheritDoc */ public function getBranches() { @@ -205,7 +205,7 @@ public function getBranches() } /** - * {@inheritDoc} + * @inheritDoc */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php index 76249fd54..3a8c99758 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php @@ -31,7 +31,7 @@ class PerforceDriver extends VcsDriver protected $perforce = null; /** - * {@inheritDoc} + * @inheritDoc */ public function initialize() { @@ -47,17 +47,20 @@ public function initialize() $this->perforce->writeP4ClientSpec(); $this->perforce->connectClient(); - - return true; } + /** + * @param array $repoConfig + * + * @return void + */ private function initPerforce($repoConfig) { if (!empty($this->perforce)) { return; } - if (!Cache::isUsable($this->config->get('cache-vcs-dir'))) { + if (!Cache::isUsable((string) $this->config->get('cache-vcs-dir'))) { throw new \RuntimeException('PerforceDriver requires a usable cache directory, and it looks like you set it to be disabled'); } @@ -66,7 +69,7 @@ private function initPerforce($repoConfig) } /** - * {@inheritdoc} + * @inheritDoc */ public function getFileContent($file, $identifier) { @@ -74,7 +77,7 @@ public function getFileContent($file, $identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getChangeDate($identifier) { @@ -82,7 +85,7 @@ public function getChangeDate($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getRootIdentifier() { @@ -90,7 +93,7 @@ public function getRootIdentifier() } /** - * {@inheritDoc} + * @inheritDoc */ public function getBranches() { @@ -98,7 +101,7 @@ public function getBranches() } /** - * {@inheritDoc} + * @inheritDoc */ public function getTags() { @@ -106,7 +109,7 @@ public function getTags() } /** - * {@inheritDoc} + * @inheritDoc */ public function getDist($identifier) { @@ -114,7 +117,7 @@ public function getDist($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getSource($identifier) { @@ -127,7 +130,7 @@ public function getSource($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getUrl() { @@ -135,7 +138,7 @@ public function getUrl() } /** - * {@inheritDoc} + * @inheritDoc */ public function hasComposerFile($identifier) { @@ -145,7 +148,7 @@ public function hasComposerFile($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getContents($url) { @@ -153,7 +156,7 @@ public function getContents($url) } /** - * {@inheritDoc} + * @inheritDoc */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { @@ -165,7 +168,7 @@ public static function supports(IOInterface $io, Config $config, $url, $deep = f } /** - * {@inheritDoc} + * @inheritDoc */ public function cleanup() { @@ -173,11 +176,17 @@ public function cleanup() $this->perforce = null; } + /** + * @return string + */ public function getDepot() { return $this->depot; } + /** + * @return string + */ public function getBranch() { return $this->branch; diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php index 9ea596115..f375c900a 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php @@ -54,7 +54,7 @@ class SvnDriver extends VcsDriver private $util; /** - * {@inheritDoc} + * @inheritDoc */ public function initialize() { @@ -90,7 +90,7 @@ public function initialize() } /** - * {@inheritDoc} + * @inheritDoc */ public function getRootIdentifier() { @@ -98,7 +98,7 @@ public function getRootIdentifier() } /** - * {@inheritDoc} + * @inheritDoc */ public function getUrl() { @@ -106,7 +106,7 @@ public function getUrl() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSource($identifier) { @@ -114,7 +114,7 @@ public function getSource($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDist($identifier) { @@ -122,7 +122,7 @@ public function getDist($identifier) } /** - * {@inheritdoc} + * @inheritDoc */ protected function shouldCache($identifier) { @@ -130,7 +130,7 @@ protected function shouldCache($identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getComposerInformation($identifier) { @@ -191,7 +191,7 @@ public function getFileContent($file, $identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getChangeDate($identifier) { @@ -217,7 +217,7 @@ public function getChangeDate($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function getTags() { @@ -246,7 +246,7 @@ public function getTags() } /** - * {@inheritDoc} + * @inheritDoc */ public function getBranches() { @@ -299,7 +299,7 @@ public function getBranches() } /** - * {@inheritDoc} + * @inheritDoc */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php index 7e287e33c..060e20a4b 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php @@ -51,7 +51,7 @@ abstract class VcsDriver implements VcsDriverInterface /** * Constructor. * - * @param array $repoConfig The repository configuration + * @param array{url: string}&array $repoConfig The repository configuration * @param IOInterface $io The IO instance * @param Config $config The composer configuration * @param HttpDownloader $httpDownloader Remote Filesystem, injectable for mocking @@ -84,7 +84,7 @@ protected function shouldCache($identifier) } /** - * {@inheritdoc} + * @inheritDoc */ public function getComposerInformation($identifier) { @@ -96,7 +96,7 @@ public function getComposerInformation($identifier) $composer = $this->getBaseComposerInformation($identifier); if ($this->shouldCache($identifier)) { - $this->cache->write($identifier, json_encode($composer)); + $this->cache->write($identifier, JsonFile::encode($composer, 0)); } $this->infoCache[$identifier] = $composer; @@ -105,6 +105,11 @@ public function getComposerInformation($identifier) return $this->infoCache[$identifier]; } + /** + * @param string $identifier + * + * @return array|null + */ protected function getBaseComposerInformation($identifier) { $composerFileContent = $this->getFileContent('composer.json', $identifier); @@ -123,7 +128,7 @@ protected function getBaseComposerInformation($identifier) } /** - * {@inheritDoc} + * @inheritDoc */ public function hasComposerFile($identifier) { @@ -167,7 +172,7 @@ protected function getContents($url) } /** - * {@inheritDoc} + * @inheritDoc */ public function cleanup() { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriverInterface.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriverInterface.php index 22cb33007..cdddd022b 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriverInterface.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriverInterface.php @@ -22,14 +22,16 @@ interface VcsDriverInterface { /** * Initializes the driver (git clone, svn checkout, fetch info etc) + * + * @return void */ public function initialize(); /** * Return the composer.json file information * - * @param string $identifier Any identifier to a specific branch/tag/commit - * @return array containing all infos from the composer.json file + * @param string $identifier Any identifier to a specific branch/tag/commit + * @return mixed[] containing all infos from the composer.json file */ public function getComposerInformation($identifier); @@ -60,26 +62,28 @@ public function getRootIdentifier(); /** * Return list of branches in the repository * - * @return array Branch names as keys, identifiers as values + * @return array Branch names as keys, identifiers as values */ public function getBranches(); /** * Return list of tags in the repository * - * @return array Tag names as keys, identifiers as values + * @return array Tag names as keys, identifiers as values */ public function getTags(); /** - * @param string $identifier Any identifier to a specific branch/tag/commit - * @return array|null With type, url reference and shasum keys. + * @param string $identifier Any identifier to a specific branch/tag/commit + * + * @return array{type: string, url: string, reference: string, shasum: string}|null */ public function getDist($identifier); /** - * @param string $identifier Any identifier to a specific branch/tag/commit - * @return array With type, url and reference keys. + * @param string $identifier Any identifier to a specific branch/tag/commit + * + * @return array{type: string, url: string, reference: string} */ public function getSource($identifier); @@ -101,6 +105,8 @@ public function hasComposerFile($identifier); /** * Performs any cleanup necessary as the driver is not longer needed + * + * @return void */ public function cleanup(); diff --git a/app/vendor/composer/composer/src/Composer/Repository/VcsRepository.php b/app/vendor/composer/composer/src/Composer/Repository/VcsRepository.php index 1b7c72949..8469a33c8 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/VcsRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/VcsRepository.php @@ -58,7 +58,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt protected $processExecutor; /** @var bool */ protected $branchErrorOccurred = false; - /** @var array */ + /** @var array> */ private $drivers; /** @var ?VcsDriverInterface */ private $driver; @@ -69,6 +69,10 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt /** @var array<'tags'|'branches', array> */ private $versionTransportExceptions = array(); + /** + * @param array{url: string, type?: string}&array $repoConfig + * @param array>|null $drivers + */ public function __construct(array $repoConfig, IOInterface $io, Config $config, HttpDownloader $httpDownloader, EventDispatcher $dispatcher = null, ProcessExecutor $process = null, array $drivers = null, VersionCacheInterface $versionCache = null) { parent::__construct(); @@ -113,11 +117,17 @@ public function getRepoConfig() return $this->repoConfig; } + /** + * @return void + */ public function setLoader(LoaderInterface $loader) { $this->loader = $loader; } + /** + * @return VcsDriverInterface|null + */ public function getDriver() { if ($this->driver) { @@ -149,18 +159,29 @@ public function getDriver() return $this->driver; } } + + return null; } + /** + * @return bool + */ public function hadInvalidBranches() { return $this->branchErrorOccurred; } + /** + * @return string[] + */ public function getEmptyReferences() { return $this->emptyReferences; } + /** + * @return array<'tags'|'branches', array> + */ public function getVersionTransportExceptions() { return $this->versionTransportExceptions; @@ -399,6 +420,13 @@ protected function initialize() } } + /** + * @param VcsDriverInterface $driver + * @param array{name?: string, dist?: array{type: string, url: string, reference: string, shasum: string}, source?: array{type: string, url: string, reference: string}} $data + * @param string $identifier + * + * @return array{name: string|null, dist: array{type: string, url: string, reference: string, shasum: string}|null, source: array{type: string, url: string, reference: string}} + */ protected function preProcess(VcsDriverInterface $driver, array $data, $identifier) { // keep the name of the main identifier for all packages @@ -417,6 +445,11 @@ protected function preProcess(VcsDriverInterface $driver, array $data, $identifi return $data; } + /** + * @param string $branch + * + * @return string|false + */ private function validateBranch($branch) { try { @@ -432,6 +465,11 @@ private function validateBranch($branch) return false; } + /** + * @param string $version + * + * @return string|false + */ private function validateTag($version) { try { @@ -442,10 +480,19 @@ private function validateTag($version) return false; } + /** + * @param string $version + * @param string $identifier + * @param bool $isVerbose + * @param bool $isVeryVerbose + * @param bool $isDefaultBranch + * + * @return \Composer\Package\CompletePackage|\Composer\Package\CompleteAliasPackage|null|false null if no cache present, false if the absence of a version was cached + */ private function getCachedPackageVersion($version, $identifier, $isVerbose, $isVeryVerbose, $isDefaultBranch = false) { if (!$this->versionCache) { - return; + return null; } $cachedPackage = $this->versionCache->getVersionPackage($version, $identifier); diff --git a/app/vendor/composer/composer/src/Composer/Repository/VersionCacheInterface.php b/app/vendor/composer/composer/src/Composer/Repository/VersionCacheInterface.php index 3b05fb8ff..80de9833c 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/VersionCacheInterface.php +++ b/app/vendor/composer/composer/src/Composer/Repository/VersionCacheInterface.php @@ -15,9 +15,9 @@ interface VersionCacheInterface { /** - * @param string $version - * @param string $identifier - * @return array|null|false Package version data if found, false to indicate the identifier is known but has no package, null for an unknown identifier + * @param string $version + * @param string $identifier + * @return mixed[]|null|false Package version data if found, false to indicate the identifier is known but has no package, null for an unknown identifier */ public function getVersionPackage($version, $identifier); } diff --git a/app/vendor/composer/composer/src/Composer/Repository/WritableArrayRepository.php b/app/vendor/composer/composer/src/Composer/Repository/WritableArrayRepository.php index de253112d..2cf2f576a 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/WritableArrayRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/WritableArrayRepository.php @@ -28,7 +28,7 @@ class WritableArrayRepository extends ArrayRepository implements WritableReposit protected $devPackageNames = array(); /** - * {@inheritDoc} + * @inheritDoc */ public function setDevPackageNames(array $devPackageNames) { @@ -36,7 +36,7 @@ public function setDevPackageNames(array $devPackageNames) } /** - * {@inheritDoc} + * @inheritDoc */ public function getDevPackageNames() { @@ -44,21 +44,21 @@ public function getDevPackageNames() } /** - * {@inheritDoc} + * @inheritDoc */ public function write($devMode, InstallationManager $installationManager) { } /** - * {@inheritDoc} + * @inheritDoc */ public function reload() { } /** - * {@inheritDoc} + * @inheritDoc */ public function getCanonicalPackages() { diff --git a/app/vendor/composer/composer/src/Composer/Repository/WritableRepositoryInterface.php b/app/vendor/composer/composer/src/Composer/Repository/WritableRepositoryInterface.php index f1d8b9e95..376af2108 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/WritableRepositoryInterface.php +++ b/app/vendor/composer/composer/src/Composer/Repository/WritableRepositoryInterface.php @@ -26,6 +26,7 @@ interface WritableRepositoryInterface extends RepositoryInterface * Writes repository (f.e. to the disc). * * @param bool $devMode Whether dev requirements were included or not in this installation + * @return void */ public function write($devMode, InstallationManager $installationManager); @@ -33,6 +34,7 @@ public function write($devMode, InstallationManager $installationManager); * Adds package to the repository. * * @param PackageInterface $package package instance + * @return void */ public function addPackage(PackageInterface $package); @@ -40,6 +42,7 @@ public function addPackage(PackageInterface $package); * Removes package from the repository. * * @param PackageInterface $package package instance + * @return void */ public function removePackage(PackageInterface $package); @@ -52,11 +55,14 @@ public function getCanonicalPackages(); /** * Forces a reload of all packages. + * + * @return void */ public function reload(); /** * @param string[] $devPackageNames + * @return void */ public function setDevPackageNames(array $devPackageNames); diff --git a/app/vendor/composer/composer/src/Composer/Script/Event.php b/app/vendor/composer/composer/src/Composer/Script/Event.php index af8bf55e7..83aef267a 100644 --- a/app/vendor/composer/composer/src/Composer/Script/Event.php +++ b/app/vendor/composer/composer/src/Composer/Script/Event.php @@ -47,12 +47,12 @@ class Event extends BaseEvent /** * Constructor. * - * @param string $name The event name - * @param Composer $composer The composer object - * @param IOInterface $io The IOInterface object - * @param bool $devMode Whether or not we are in dev mode - * @param array $args Arguments passed by the user - * @param array $flags Optional flags to pass data not as argument + * @param string $name The event name + * @param Composer $composer The composer object + * @param IOInterface $io The IOInterface object + * @param bool $devMode Whether or not we are in dev mode + * @param array $args Arguments passed by the user + * @param mixed[] $flags Optional flags to pass data not as argument */ public function __construct($name, Composer $composer, IOInterface $io, $devMode = false, array $args = array(), array $flags = array()) { diff --git a/app/vendor/composer/composer/src/Composer/SelfUpdate/Keys.php b/app/vendor/composer/composer/src/Composer/SelfUpdate/Keys.php index a8f02e3e2..808b8766d 100644 --- a/app/vendor/composer/composer/src/Composer/SelfUpdate/Keys.php +++ b/app/vendor/composer/composer/src/Composer/SelfUpdate/Keys.php @@ -17,6 +17,11 @@ */ class Keys { + /** + * @param string $path + * + * @return string + */ public static function fingerprint($path) { $hash = strtoupper(hash('sha256', preg_replace('{\s}', '', file_get_contents($path)))); diff --git a/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php b/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php index 591c11253..9e617fb13 100644 --- a/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php +++ b/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php @@ -38,6 +38,9 @@ public function __construct(Config $config, HttpDownloader $httpDownloader) $this->config = $config; } + /** + * @return string + */ public function getChannel() { if ($this->channel) { @@ -55,6 +58,11 @@ public function getChannel() return $this->channel = 'stable'; } + /** + * @param string $channel + * + * @return void + */ public function setChannel($channel) { if (!in_array($channel, self::$channels, true)) { @@ -66,6 +74,11 @@ public function setChannel($channel) file_put_contents($channelFile, (is_numeric($channel) ? 'stable' : $channel).PHP_EOL); } + /** + * @param string|null $channel + * + * @return array{path: string, version: string, min-php: int} + */ public function getLatest($channel = null) { $versions = $this->getVersionsData(); @@ -79,6 +92,9 @@ public function getLatest($channel = null) throw new \UnexpectedValueException('There is no version of Composer available for your PHP version ('.PHP_VERSION.')'); } + /** + * @return array> + */ private function getVersionsData() { if (!$this->versionsData) { diff --git a/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php b/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php index b8dc44407..6f6f2447d 100644 --- a/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php +++ b/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php @@ -37,6 +37,8 @@ public function __construct(IOInterface $io, Config $config) /** * @param string $origin * @param string|bool $storeAuth + * + * @return void */ public function storeAuth($origin, $storeAuth) { @@ -120,8 +122,11 @@ public function promptAuthIfNeeded($url, $origin, $statusCode, $reason = null, $ $message = "\n".'Could not fetch '.$url.', enter your ' . $origin . ' credentials ' .($statusCode === 401 ? 'to access private repos' : 'to go over the API rate limit'); $gitLabUtil = new GitLab($this->io, $this->config, null); - if ($this->io->hasAuthentication($origin) && ($auth = $this->io->getAuthentication($origin)) && in_array($auth['password'], array('gitlab-ci-token', 'private-token', 'oauth2'), true)) { - throw new TransportException("Invalid credentials for '" . $url . "', aborting.", $statusCode); + if ($this->io->hasAuthentication($origin)) { + $auth = $this->io->getAuthentication($origin); + if (in_array($auth['password'], array('gitlab-ci-token', 'private-token', 'oauth2'), true)) { + throw new TransportException("Invalid credentials for '" . $url . "', aborting.", $statusCode); + } } if (!$gitLabUtil->authorizeOAuth($origin) @@ -189,10 +194,11 @@ public function promptAuthIfNeeded($url, $origin, $statusCode, $reason = null, $ } /** - * @param array $headers - * @param string $origin - * @param string $url - * @return array updated headers array + * @param string[] $headers + * @param string $origin + * @param string $url + * + * @return string[] updated headers array */ public function addAuthenticationHeader(array $headers, $origin, $url) { diff --git a/app/vendor/composer/composer/src/Composer/Util/Bitbucket.php b/app/vendor/composer/composer/src/Composer/Util/Bitbucket.php index 445dbed7e..62a46c1c5 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Bitbucket.php +++ b/app/vendor/composer/composer/src/Composer/Util/Bitbucket.php @@ -211,16 +211,17 @@ public function requestToken($originUrl, $consumerKey, $consumerSecret) throw new \LogicException('Failed to initialize token above'); } - // side effect above caused this, https://github.com/phpstan/phpstan/issues/5129 - // @phpstan-ignore-next-line return $this->token['access_token']; } /** * Store the new/updated credentials to the configuration + * * @param string $originUrl * @param string $consumerKey * @param string $consumerSecret + * + * @return void */ private function storeInAuthConfig($originUrl, $consumerKey, $consumerSecret) { diff --git a/app/vendor/composer/composer/src/Composer/Util/ComposerMirror.php b/app/vendor/composer/composer/src/Composer/Util/ComposerMirror.php index c73a2702c..047c9c29b 100644 --- a/app/vendor/composer/composer/src/Composer/Util/ComposerMirror.php +++ b/app/vendor/composer/composer/src/Composer/Util/ComposerMirror.php @@ -19,6 +19,16 @@ */ class ComposerMirror { + /** + * @param string $mirrorUrl + * @param string $packageName + * @param string $version + * @param string|null $reference + * @param string|null $type + * @param string|null $prettyVersion + * + * @return string + */ public static function processUrl($mirrorUrl, $packageName, $version, $reference, $type, $prettyVersion = null) { if ($reference) { @@ -36,6 +46,14 @@ public static function processUrl($mirrorUrl, $packageName, $version, $reference return str_replace($from, $to, $mirrorUrl); } + /** + * @param string $mirrorUrl + * @param string $packageName + * @param string $url + * @param string|null $type + * + * @return string + */ public static function processGitUrl($mirrorUrl, $packageName, $url, $type) { if (preg_match('#^(?:(?:https?|git)://github\.com/|git@github\.com:)([^/]+)/(.+?)(?:\.git)?$#', $url, $match)) { @@ -53,6 +71,14 @@ public static function processGitUrl($mirrorUrl, $packageName, $url, $type) ); } + /** + * @param string $mirrorUrl + * @param string $packageName + * @param string $url + * @param string $type + * + * @return string + */ public static function processHgUrl($mirrorUrl, $packageName, $url, $type) { return self::processGitUrl($mirrorUrl, $packageName, $url, $type); diff --git a/app/vendor/composer/composer/src/Composer/Util/ConfigValidator.php b/app/vendor/composer/composer/src/Composer/Util/ConfigValidator.php index a73b91651..b64f48d4b 100644 --- a/app/vendor/composer/composer/src/Composer/Util/ConfigValidator.php +++ b/app/vendor/composer/composer/src/Composer/Util/ConfigValidator.php @@ -45,7 +45,7 @@ public function __construct(IOInterface $io) * @param int $arrayLoaderValidationFlags Flags for ArrayLoader validation * @param int $flags Flags for validation * - * @return array a triple containing the errors, publishable errors, and warnings + * @return array{list, list, list} a triple containing the errors, publishable errors, and warnings */ public function validate($file, $arrayLoaderValidationFlags = ValidatingArrayLoader::CHECK_ALL, $flags = self::CHECK_VERSION) { diff --git a/app/vendor/composer/composer/src/Composer/Util/ErrorHandler.php b/app/vendor/composer/composer/src/Composer/Util/ErrorHandler.php index 8e96191f2..7933f04e0 100644 --- a/app/vendor/composer/composer/src/Composer/Util/ErrorHandler.php +++ b/app/vendor/composer/composer/src/Composer/Util/ErrorHandler.php @@ -82,6 +82,8 @@ public static function handle($level, $message, $file, $line) * Register error handler. * * @param IOInterface|null $io + * + * @return void */ public static function register(IOInterface $io = null) { diff --git a/app/vendor/composer/composer/src/Composer/Util/Filesystem.php b/app/vendor/composer/composer/src/Composer/Util/Filesystem.php index 5f99d8d30..bf2ee1dda 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Filesystem.php +++ b/app/vendor/composer/composer/src/Composer/Util/Filesystem.php @@ -32,6 +32,11 @@ public function __construct(ProcessExecutor $executor = null) $this->processExecutor = $executor; } + /** + * @param string $file + * + * @return bool + */ public function remove($file) { if (is_dir($file)) { @@ -62,6 +67,12 @@ public function isDirEmpty($dir) return \count($finder) === 0; } + /** + * @param string $dir + * @param bool $ensureDirectoryExists + * + * @return void + */ public function emptyDirectory($dir, $ensureDirectoryExists = true) { if (is_link($dir) && file_exists($dir)) { @@ -163,6 +174,7 @@ public function removeDirectoryAsync($directory) /** * @param string $directory + * @param bool $fallbackToPhp * * @return bool|null Returns null, when no edge case was hit. Otherwise a bool whether removal was successfull */ @@ -240,6 +252,11 @@ public function removeDirectoryPhp($directory) return $this->rmdir($directory); } + /** + * @param string $directory + * + * @return void + */ public function ensureDirectoryExists($directory) { if (!is_dir($directory)) { @@ -326,6 +343,8 @@ public function rmdir($path) * * @param string $source * @param string $target + * + * @return void */ public function copyThenRemove($source, $target) { @@ -370,6 +389,12 @@ public function copy($source, $target) return $result; } + /** + * @param string $source + * @param string $target + * + * @return void + */ public function rename($source, $target) { if (true === @rename($source, $target)) { @@ -605,13 +630,18 @@ public static function isLocalPath($path) return (bool) preg_match('{^(file://(?!//)|/(?!/)|/?[a-z]:[\\\\/]|\.\.[\\\\/]|[a-z0-9_.-]+[\\\\/])}i', $path); } + /** + * @param string $path + * + * @return string + */ public static function getPlatformPath($path) { if (Platform::isWindows()) { $path = preg_replace('{^(?:file:///([a-z]):?/)}i', 'file://$1:/', $path); } - return preg_replace('{^file://}i', '', $path); + return (string) preg_replace('{^file://}i', '', $path); } /** @@ -641,6 +671,11 @@ public static function isReadable($path) return false; } + /** + * @param string $directory + * + * @return int + */ protected function directorySize($directory) { $it = new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS); @@ -767,6 +802,8 @@ private function resolveSymlinkedDirectorySymlink($pathname) * * @param string $target * @param string $junction + * + * @return void */ public function junction($target, $junction) { @@ -845,6 +882,12 @@ public function removeJunction($junction) return $this->rmdir($junction); } + /** + * @param string $path + * @param string $content + * + * @return int|false + */ public function filePutContentsIfModified($path, $content) { $currentContent = @file_get_contents($path); @@ -860,6 +903,8 @@ public function filePutContentsIfModified($path, $content) * * @param string $source * @param string $target + * + * @return void */ public function safeCopy($source, $target) { @@ -876,6 +921,11 @@ public function safeCopy($source, $target) /** * compare 2 files * https://stackoverflow.com/questions/3060125/can-i-use-file-get-contents-to-compare-two-files + * + * @param string $a + * @param string $b + * + * @return bool */ private function filesAreEqual($a, $b) { diff --git a/app/vendor/composer/composer/src/Composer/Util/Git.php b/app/vendor/composer/composer/src/Composer/Util/Git.php index 8eab2c7c7..a350629db 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Git.php +++ b/app/vendor/composer/composer/src/Composer/Util/Git.php @@ -40,6 +40,14 @@ public function __construct(IOInterface $io, Config $config, ProcessExecutor $pr $this->filesystem = $fs; } + /** + * @param callable $commandCallable + * @param string $url + * @param string|null $cwd + * @param bool $initialClone + * + * @return void + */ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) { // Ensure we are allowed to use this URL by config @@ -257,6 +265,12 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) } } + /** + * @param string $url + * @param string $dir + * + * @return bool + */ public function syncMirror($url, $dir) { if (getenv('COMPOSER_DISABLE_NETWORK') && getenv('COMPOSER_DISABLE_NETWORK') !== 'prime') { @@ -295,6 +309,13 @@ public function syncMirror($url, $dir) return true; } + /** + * @param string $url + * @param string $dir + * @param string $ref + * + * @return bool + */ public function fetchRefOrSyncMirror($url, $dir, $ref) { if ($this->checkRefIsInMirror($dir, $ref)) { @@ -308,6 +329,9 @@ public function fetchRefOrSyncMirror($url, $dir, $ref) return false; } + /** + * @return string + */ public static function getNoShowSignatureFlag(ProcessExecutor $process) { $gitVersion = self::getVersion($process); @@ -318,6 +342,12 @@ public static function getNoShowSignatureFlag(ProcessExecutor $process) return ''; } + /** + * @param string $dir + * @param string $ref + * + * @return bool + */ private function checkRefIsInMirror($dir, $ref) { if (is_dir($dir) && 0 === $this->process->execute('git rev-parse --git-dir', $output, $dir) && trim($output) === '.') { @@ -331,6 +361,12 @@ private function checkRefIsInMirror($dir, $ref) return false; } + /** + * @param string $url + * @param string[] $match + * + * @return bool + */ private function isAuthenticationFailure($url, &$match) { if (!preg_match('{^(https?://)([^/]+)(.*)$}i', $url, $match)) { @@ -355,6 +391,9 @@ private function isAuthenticationFailure($url, &$match) return false; } + /** + * @return void + */ public static function cleanEnv() { if (PHP_VERSION_ID < 50400 && ini_get('safe_mode') && false === strpos(ini_get('safe_mode_allowed_env_vars'), 'GIT_ASKPASS')) { @@ -383,16 +422,28 @@ public static function cleanEnv() Platform::clearEnv('DYLD_LIBRARY_PATH'); } + /** + * @return non-empty-string + */ public static function getGitHubDomainsRegex(Config $config) { return '(' . implode('|', array_map('preg_quote', $config->get('github-domains'))) . ')'; } + /** + * @return non-empty-string + */ public static function getGitLabDomainsRegex(Config $config) { return '(' . implode('|', array_map('preg_quote', $config->get('gitlab-domains'))) . ')'; } + /** + * @param non-empty-string $message + * @param string $url + * + * @return never + */ private function throwException($message, $url) { // git might delete a directory when it fails and php will not know @@ -422,7 +473,13 @@ public static function getVersion(ProcessExecutor $process) return self::$version; } - private function maskCredentials(string $error, array $credentials) + /** + * @param string $error + * @param string[] $credentials + * + * @return string + */ + private function maskCredentials($error, array $credentials) { $maskedCredentials = array(); diff --git a/app/vendor/composer/composer/src/Composer/Util/GitHub.php b/app/vendor/composer/composer/src/Composer/Util/GitHub.php index b081afeff..190b50fe1 100644 --- a/app/vendor/composer/composer/src/Composer/Util/GitHub.php +++ b/app/vendor/composer/composer/src/Composer/Util/GitHub.php @@ -90,9 +90,15 @@ public function authorizeOAuthInteractively($originUrl, $message = null) } $note .= ' ' . date('Y-m-d Hi'); + $url = 'https://'.$originUrl.'/settings/tokens/new?scopes=&description=' . str_replace('%20', '+', rawurlencode($note)); + $this->io->writeError(sprintf('When working with _public_ GitHub repositories only, head to %s to retrieve a token.', $url)); + $this->io->writeError('This token will have read-only permission for public information only.'); + $url = 'https://'.$originUrl.'/settings/tokens/new?scopes=repo&description=' . str_replace('%20', '+', rawurlencode($note)); - $this->io->writeError(sprintf('Head to %s', $url)); - $this->io->writeError(sprintf('to retrieve a token. It will be stored in "%s" for future use by Composer.', $this->config->getAuthConfigSource()->getName())); + $this->io->writeError(sprintf('When you need to access _private_ GitHub repositories as well, go to %s', $url)); + $this->io->writeError('Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.'); + $this->io->writeError(sprintf('Tokens will be stored in plain text in "%s" for future use by Composer.', $this->config->getAuthConfigSource()->getName())); + $this->io->writeError('For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth'); $token = trim($this->io->askAndHideAnswer('Token (hidden): ')); @@ -132,11 +138,11 @@ public function authorizeOAuthInteractively($originUrl, $message = null) } /** - * Extract ratelimit from response. + * Extract rate limit from response. * - * @param array $headers Headers from Composer\Downloader\TransportException. + * @param string[] $headers Headers from Composer\Downloader\TransportException. * - * @return array Associative array with the keys limit and reset. + * @return array{limit: int|'?', reset: string} */ public function getRateLimit(array $headers) { @@ -167,7 +173,7 @@ public function getRateLimit(array $headers) /** * Finds whether a request failed due to rate limiting * - * @param array $headers Headers from Composer\Downloader\TransportException. + * @param string[] $headers Headers from Composer\Downloader\TransportException. * * @return bool */ diff --git a/app/vendor/composer/composer/src/Composer/Util/GitLab.php b/app/vendor/composer/composer/src/Composer/Util/GitLab.php index e5287991b..f81a469c2 100644 --- a/app/vendor/composer/composer/src/Composer/Util/GitLab.php +++ b/app/vendor/composer/composer/src/Composer/Util/GitLab.php @@ -160,6 +160,14 @@ public function authorizeOAuthInteractively($scheme, $originUrl, $message = null throw new \RuntimeException('Invalid GitLab credentials 5 times in a row, aborting.'); } + /** + * @param string $scheme + * @param string $originUrl + * + * @return array{access_token: non-empty-string, token_type: non-empty-string, expires_in: positive-int} + * + * @see https://docs.gitlab.com/ee/api/oauth2.html#resource-owner-password-credentials-flow + */ private function createToken($scheme, $originUrl) { $username = $this->io->ask('Username: '); diff --git a/app/vendor/composer/composer/src/Composer/Util/Hg.php b/app/vendor/composer/composer/src/Composer/Util/Hg.php index b6321c17a..94f1313f9 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Hg.php +++ b/app/vendor/composer/composer/src/Composer/Util/Hg.php @@ -45,6 +45,13 @@ public function __construct(IOInterface $io, Config $config, ProcessExecutor $pr $this->process = $process; } + /** + * @param callable $commandCallable + * @param string $url + * @param string|null $cwd + * + * @return void + */ public function runCommand($commandCallable, $url, $cwd) { $this->config->prohibitUrlByConfig($url, $this->io); @@ -75,6 +82,12 @@ public function runCommand($commandCallable, $url, $cwd) $this->throwException('Failed to clone ' . $url . ', ' . "\n\n" . $error, $url); } + /** + * @param non-empty-string $message + * @param string $url + * + * @return never + */ private function throwException($message, $url) { if (null === self::getVersion($this->process)) { diff --git a/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php b/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php index cb1f6daea..2ecc6e9b6 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php @@ -195,8 +195,9 @@ private function initDownload($resolve, $reject, $origin, $url, $options, $copyT curl_setopt($curlHandle, CURLOPT_TIMEOUT, max((int) ini_get("default_socket_timeout"), 300)); curl_setopt($curlHandle, CURLOPT_WRITEHEADER, $headerHandle); curl_setopt($curlHandle, CURLOPT_FILE, $bodyHandle); - curl_setopt($curlHandle, CURLOPT_ENCODING, "gzip"); + curl_setopt($curlHandle, CURLOPT_ENCODING, ""); // let cURL set the Accept-Encoding header to what it supports curl_setopt($curlHandle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); + if (function_exists('curl_share_init')) { curl_setopt($curlHandle, CURLOPT_SHARE, $this->shareHandle); } @@ -304,6 +305,8 @@ public function abortRequest($id) */ public function tick() { + static $timeoutWarning = false; + if (!$this->jobs) { return; } @@ -342,6 +345,12 @@ public function tick() $error = curl_strerror($errno); } $progress['error_code'] = $errno; + + if ($errno === 28 /* CURLE_OPERATION_TIMEDOUT */ && isset($progress['namelookup_time']) && $progress['namelookup_time'] == 0 && !$timeoutWarning) { + $timeoutWarning = true; + $this->io->writeError('A connection timeout was encountered. If you intend to run Composer without connecting to the internet, run the command again prefixed with COMPOSER_DISABLE_NETWORK=1 to make Composer run in offline mode.'); + } + throw new TransportException('curl error '.$errno.' while downloading '.Url::sanitize($progress['url']).': '.$error); } $statusCode = $progress['http_code']; @@ -566,7 +575,7 @@ private function failResponse(array $job, Response $response, $errorMessage) } $details = ''; - if ($response->getHeader('content-type') === 'application/json') { + if (in_array(strtolower($response->getHeader('content-type')), array('application/json', 'application/json; charset=utf-8'), true)) { $details = ':'.PHP_EOL.substr($response->getBody(), 0, 200).(strlen($response->getBody()) > 200 ? '...' : ''); } diff --git a/app/vendor/composer/composer/src/Composer/Util/Http/ProxyHelper.php b/app/vendor/composer/composer/src/Composer/Util/Http/ProxyHelper.php index 611980676..001fb9b83 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Http/ProxyHelper.php +++ b/app/vendor/composer/composer/src/Composer/Util/Http/ProxyHelper.php @@ -23,8 +23,9 @@ class ProxyHelper /** * Returns proxy environment values * + * @return array{string|null, string|null, string|null} httpProxy, httpsProxy, noProxy values + * * @throws \RuntimeException on malformed url - * @return array httpProxy, httpsProxy, noProxy values */ public static function getProxyData() { @@ -59,8 +60,9 @@ public static function getProxyData() /** * Returns http context options for the proxy url * - * @param string $proxyUrl - * @return array + * @param string $proxyUrl + * + * @return array{http: array{proxy: string, header?: string}} */ public static function getContextOptions($proxyUrl) { @@ -90,8 +92,10 @@ public static function getContextOptions($proxyUrl) /** * Sets/unsets request_fulluri value in http context options array * - * @param string $requestUrl - * @param array $options Set by method + * @param string $requestUrl + * @param mixed[] $options Set by method + * + * @return void */ public static function setRequestFullUri($requestUrl, array &$options) { @@ -105,8 +109,9 @@ public static function setRequestFullUri($requestUrl, array &$options) /** * Searches $_SERVER for case-sensitive values * - * @param array $names Names to search for - * @param mixed $name Name of any found value + * @param string[] $names Names to search for + * @param string|null $name Name of any found value + * * @return string|null The found value */ private static function getProxyEnv(array $names, &$name) @@ -151,8 +156,9 @@ private static function checkProxy($proxyUrl, $envName) /** * Formats a url from its component parts * - * @param array $proxy Values from parse_url - * @param bool $includeAuth Whether to include authorization values + * @param array{scheme: string, host: string, port?: int, user?: string, pass?: string} $proxy + * @param bool $includeAuth + * * @return string The formatted value */ private static function formatParsedUrl(array $proxy, $includeAuth) diff --git a/app/vendor/composer/composer/src/Composer/Util/Http/ProxyManager.php b/app/vendor/composer/composer/src/Composer/Util/Http/ProxyManager.php index 586b08e83..00ecd398d 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Http/ProxyManager.php +++ b/app/vendor/composer/composer/src/Composer/Util/Http/ProxyManager.php @@ -22,13 +22,20 @@ */ class ProxyManager { - private $error; + /** @var ?string */ + private $error = null; + /** @var array{http: ?string, https: ?string} */ private $fullProxy; + /** @var array{http: ?string, https: ?string} */ private $safeProxy; + /** @var array{http: array{options: mixed[]|null}, https: array{options: mixed[]|null}} */ private $streams; + /** @var bool */ private $hasProxy; - private $info; - private $lastProxy; + /** @var ?string */ + private $info = null; + /** @var ?string */ + private $lastProxy = null; /** @var ?NoProxyPattern */ private $noProxyHandler = null; @@ -64,6 +71,8 @@ public static function getInstance() /** * Clears the persistent instance + * + * @return void */ public static function reset() { @@ -123,6 +132,8 @@ public function getFormattedProxy() /** * Initializes proxy values from the environment + * + * @return void */ private function initProxyData() { @@ -153,8 +164,10 @@ private function initProxyData() /** * Sets initial data * - * @param string $url Proxy url - * @param string $scheme Environment variable scheme + * @param non-empty-string $url Proxy url + * @param 'http'|'https' $scheme Environment variable scheme + * + * @return non-empty-string */ private function setData($url, $scheme) { diff --git a/app/vendor/composer/composer/src/Composer/Util/Perforce.php b/app/vendor/composer/composer/src/Composer/Util/Perforce.php index ea2b1152c..7d3929c94 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Perforce.php +++ b/app/vendor/composer/composer/src/Composer/Util/Perforce.php @@ -17,28 +17,54 @@ /** * @author Matt Whittom + * + * @phpstan-type RepoConfig array{unique_perforce_client_name?: string, depot?: string, branch?: string, p4user?: string, p4password?: string} */ class Perforce { + /** @var string */ protected $path; + /** @var ?string */ protected $p4Depot; + /** @var string */ protected $p4Client; + /** @var ?string */ protected $p4User; + /** @var ?string */ protected $p4Password; + /** @var string */ protected $p4Port; + /** @var string */ protected $p4Stream; + /** @var string */ protected $p4ClientSpec; + /** @var ?string */ protected $p4DepotType; + /** @var ?string */ protected $p4Branch; + /** @var ProcessExecutor */ protected $process; + /** @var string */ protected $uniquePerforceClientName; + /** @var bool */ protected $windowsFlag; + /** @var string */ protected $commandResult; + /** @var IOInterface */ protected $io; + /** @var Filesystem */ protected $filesystem; + /** + * @phpstan-param RepoConfig $repoConfig + * @param string $port + * @param string $path + * @param ProcessExecutor $process + * @param bool $isWindows + * @param IOInterface $io + */ public function __construct($repoConfig, $port, $path, ProcessExecutor $process, $isWindows, IOInterface $io) { $this->windowsFlag = $isWindows; @@ -49,11 +75,26 @@ public function __construct($repoConfig, $port, $path, ProcessExecutor $process, $this->io = $io; } + /** + * @phpstan-param RepoConfig $repoConfig + * @param string $port + * @param string $path + * @param ProcessExecutor $process + * @param IOInterface $io + * + * @return self + */ public static function create($repoConfig, $port, $path, ProcessExecutor $process, IOInterface $io) { return new Perforce($repoConfig, $port, $path, $process, Platform::isWindows(), $io); } + /** + * @param string $url + * @param ProcessExecutor $processExecutor + * + * @return bool + */ public static function checkServerExists($url, ProcessExecutor $processExecutor) { $output = null; @@ -61,6 +102,11 @@ public static function checkServerExists($url, ProcessExecutor $processExecutor) return 0 === $processExecutor->execute('p4 -p ' . ProcessExecutor::escape($url) . ' info -s', $output); } + /** + * @phpstan-param RepoConfig $repoConfig + * + * @return void + */ public function initialize($repoConfig) { $this->uniquePerforceClientName = $this->generateUniquePerforceClientName(); @@ -87,6 +133,12 @@ public function initialize($repoConfig) } } + /** + * @param string|null $depot + * @param string|null $branch + * + * @return void + */ public function initializeDepotAndBranch($depot, $branch) { if (isset($depot)) { @@ -97,11 +149,17 @@ public function initializeDepotAndBranch($depot, $branch) } } + /** + * @return non-empty-string + */ public function generateUniquePerforceClientName() { return gethostname() . "_" . time(); } + /** + * @return void + */ public function cleanupClientSpec() { $client = $this->getClient(); @@ -114,6 +172,11 @@ public function cleanupClientSpec() $fileSystem->remove($clientSpec); } + /** + * @param non-empty-string $command + * + * @return int + */ protected function executeCommand($command) { $this->commandResult = ''; @@ -121,6 +184,9 @@ protected function executeCommand($command) return $this->process->execute($command, $this->commandResult); } + /** + * @return string + */ public function getClient() { if (!isset($this->p4Client)) { @@ -131,11 +197,19 @@ public function getClient() return $this->p4Client; } + /** + * @return string + */ protected function getPath() { return $this->path; } + /** + * @param string $path + * + * @return void + */ public function initializePath($path) { $this->path = $path; @@ -143,11 +217,19 @@ public function initializePath($path) $fs->ensureDirectoryExists($path); } + /** + * @return string + */ protected function getPort() { return $this->p4Port; } + /** + * @param string $stream + * + * @return void + */ public function setStream($stream) { $this->p4Stream = $stream; @@ -158,11 +240,17 @@ public function setStream($stream) } } + /** + * @return bool + */ public function isStream() { return is_string($this->p4DepotType) && (strcmp($this->p4DepotType, 'stream') === 0); } + /** + * @return string + */ public function getStream() { if (!isset($this->p4Stream)) { @@ -176,6 +264,11 @@ public function getStream() return $this->p4Stream; } + /** + * @param string $stream + * + * @return string + */ public function getStreamWithoutLabel($stream) { $index = strpos($stream, '@'); @@ -186,21 +279,35 @@ public function getStreamWithoutLabel($stream) return substr($stream, 0, $index); } + /** + * @return non-empty-string + */ public function getP4ClientSpec() { return $this->path . '/' . $this->getClient() . '.p4.spec'; } + /** + * @return string|null + */ public function getUser() { return $this->p4User; } + /** + * @param string|null $user + * + * @return void + */ public function setUser($user) { $this->p4User = $user; } + /** + * @return void + */ public function queryP4User() { $this->getUser(); @@ -256,6 +363,9 @@ protected function getP4variable($name) return $result; } + /** + * @return string|null + */ public function queryP4Password() { if (isset($this->p4Password)) { @@ -270,6 +380,12 @@ public function queryP4Password() return $password; } + /** + * @param string $command + * @param bool $useClient + * + * @return non-empty-string + */ public function generateP4Command($command, $useClient = true) { $p4Command = 'p4 '; @@ -282,6 +398,9 @@ public function generateP4Command($command, $useClient = true) return $p4Command; } + /** + * @return bool + */ public function isLoggedIn() { $command = $this->generateP4Command('login -s', false); @@ -302,6 +421,9 @@ public function isLoggedIn() return true; } + /** + * @return void + */ public function connectClient() { $p4CreateClientCommand = $this->generateP4Command( @@ -310,6 +432,11 @@ public function connectClient() $this->executeCommand($p4CreateClientCommand); } + /** + * @param string|null $sourceReference + * + * @return void + */ public function syncCodeBase($sourceReference) { $prevDir = getcwd(); @@ -322,6 +449,11 @@ public function syncCodeBase($sourceReference) chdir($prevDir); } + /** + * @param resource|false $spec + * + * @return void + */ public function writeClientSpecToFile($spec) { fwrite($spec, 'Client: ' . $this->getClient() . PHP_EOL . PHP_EOL); @@ -345,6 +477,9 @@ public function writeClientSpecToFile($spec) } } + /** + * @return void + */ public function writeP4ClientSpec() { $clientSpec = $this->getP4ClientSpec(); @@ -358,6 +493,12 @@ public function writeP4ClientSpec() fclose($spec); } + /** + * @param resource $pipe + * @param mixed $name + * + * @return void + */ protected function read($pipe, $name) { if (feof($pipe)) { @@ -369,6 +510,11 @@ protected function read($pipe, $name) } } + /** + * @param string|null $password + * + * @return int + */ public function windowsLogin($password) { $command = $this->generateP4Command(' login -a'); @@ -377,12 +523,16 @@ public function windowsLogin($password) if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { $process = Process::fromShellCommandline($command, null, null, $password); } else { + // @phpstan-ignore-next-line $process = new Process($command, null, null, $password); } return $process->run(); } + /** + * @return void + */ public function p4Login() { $this->queryP4User(); @@ -400,6 +550,11 @@ public function p4Login() } } + /** + * @param string $identifier + * + * @return mixed|void + */ public function getComposerInformation($identifier) { $composerFileContent = $this->getFileContent('composer.json', $identifier); @@ -411,6 +566,12 @@ public function getComposerInformation($identifier) return json_decode($composerFileContent, true); } + /** + * @param string $file + * @param string $identifier + * + * @return string|null + */ public function getFileContent($file, $identifier) { $path = $this->getFilePath($file, $identifier); @@ -426,6 +587,12 @@ public function getFileContent($file, $identifier) return $result; } + /** + * @param string $file + * @param string $identifier + * + * @return string|null + */ public function getFilePath($file, $identifier) { $index = strpos($identifier, '@'); @@ -451,6 +618,9 @@ public function getFilePath($file, $identifier) return null; } + /** + * @return array{master: string} + */ public function getBranches() { $possibleBranches = array(); @@ -480,6 +650,9 @@ public function getBranches() return array('master' => $possibleBranches[$this->p4Branch] . '@'. $lastCommitNum); } + /** + * @return array + */ public function getTags() { $command = $this->generateP4Command('labels'); @@ -497,6 +670,9 @@ public function getTags() return $tags; } + /** + * @return bool + */ public function checkStream() { $command = $this->generateP4Command('depots', false); @@ -562,6 +738,9 @@ public function getCommitLogs($fromReference, $toReference) return $this->commandResult; } + /** + * @return Filesystem + */ public function getFilesystem() { if (empty($this->filesystem)) { @@ -571,6 +750,9 @@ public function getFilesystem() return $this->filesystem; } + /** + * @return void + */ public function setFilesystem(Filesystem $fs) { $this->filesystem = $fs; diff --git a/app/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php b/app/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php index 665b0e7b3..ddcf13139 100644 --- a/app/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php +++ b/app/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php @@ -14,7 +14,6 @@ use Composer\IO\IOInterface; use Symfony\Component\Process\Process; -use Symfony\Component\Process\ProcessUtils; use Symfony\Component\Process\Exception\RuntimeException; use React\Promise\Promise; use React\Promise\PromiseInterface; @@ -445,7 +444,7 @@ public static function setTimeout($timeout) /** * Escapes a string to be used as a shell argument. * - * @param ?string $argument The argument that will be escaped + * @param string|false|null $argument The argument that will be escaped * * @return string The escaped argument */ @@ -455,38 +454,50 @@ public static function escape($argument) } /** - * Copy of Symfony's Process::escapeArgument() which is private + * Escapes a string to be used as a shell argument for Symfony Process. * - * @param ?string $argument + * This method expects cmd.exe to be started with the /V:ON option, which + * enables delayed environment variable expansion using ! as the delimiter. + * If this is not the case, any escaped ^^!var^^! will be transformed to + * ^!var^! and introduce two unintended carets. + * + * Modified from https://github.com/johnstevenson/winbox-args + * MIT Licensed (c) John Stevenson + * + * @param string|false|null $argument * * @return string */ private static function escapeArgument($argument) { - if ('' === $argument || null === $argument) { - return '""'; + if ('' === ($argument = (string) $argument)) { + return escapeshellarg($argument); } - if ('\\' !== \DIRECTORY_SEPARATOR) { + + if (!Platform::isWindows()) { return "'".str_replace("'", "'\\''", $argument)."'"; } - if (false !== strpos($argument, "\0")) { - $argument = str_replace("\0", '?', $argument); + + // New lines break cmd.exe command parsing + $argument = strtr($argument, "\n", ' '); + + $quote = strpbrk($argument, " \t") !== false; + $argument = preg_replace('/(\\\\*)"/', '$1$1\\"', $argument, -1, $dquotes); + $meta = $dquotes || preg_match('/%[^%]+%|![^!]+!/', $argument); + + if (!$meta && !$quote) { + $quote = strpbrk($argument, '^&|<>()') !== false; } - if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { - return $argument; + + if ($quote) { + $argument = '"'.preg_replace('/(\\\\*)$/', '$1$1', $argument).'"'; } - $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); - return '"'.str_replace(array('"', '^', '%', '!', "\n"), array('""', '"^^"', '"^%"', '"^!"', '!LF!'), $argument).'"'; - } + if ($meta) { + $argument = preg_replace('/(["^&|<>()%])/', '^$1', $argument); + $argument = preg_replace('/(!)/', '^^$1', $argument); + } - /** - * @param string $arg - * @param string $char - * @return bool - */ - private static function isSurroundedBy($arg, $char) - { - return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; + return $argument; } } diff --git a/app/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php b/app/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php index 56ec5cadd..205c34a53 100644 --- a/app/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php +++ b/app/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php @@ -324,7 +324,7 @@ protected function get($originUrl, $fileUrl, $additionalOptions = array(), $file try { $e->setResponse($this->decodeResult($result, $http_response_header)); } catch (\Exception $discarded) { - $e->setResponse($result); + $e->setResponse($this->normalizeResult($result)); } $this->io->writeError('Content-Length mismatch, received '.Platform::strlen($result).' out of '.$contentLength.' bytes: (' . base64_encode($result).')', true, IOInterface::DEBUG); @@ -555,6 +555,7 @@ protected function get($originUrl, $fileUrl, $additionalOptions = array(), $file * @param string $originUrl The origin URL * @param string $fileUrl The file URL * @param resource $context The stream context + * @param string[] $responseHeaders * @param int $maxFileSize The maximum allowed file size * * @return string|false The response contents or false on failure @@ -592,12 +593,15 @@ protected function getRemoteContents($originUrl, $fileUrl, $context, array &$res /** * Get notification action. * - * @param int $notificationCode The notification code - * @param int $severity The severity level - * @param string $message The message - * @param int $messageCode The message code - * @param int $bytesTransferred The loaded size - * @param int $bytesMax The total size + * @param int $notificationCode The notification code + * @param int $severity The severity level + * @param string $message The message + * @param int $messageCode The message code + * @param int $bytesTransferred The loaded size + * @param int $bytesMax The total size + * + * @return void + * * @throws TransportException */ protected function callbackGet($notificationCode, $severity, $message, $messageCode, $bytesTransferred, $bytesMax) @@ -631,6 +635,13 @@ protected function callbackGet($notificationCode, $severity, $message, $messageC } } + /** + * @param positive-int $httpStatus + * @param string|null $reason + * @param string[] $headers + * + * @return void + */ protected function promptAuthAndRetry($httpStatus, $reason = null, $headers = array()) { $result = $this->authHelper->promptAuthIfNeeded($this->fileUrl, $this->originUrl, $httpStatus, $reason, $headers); @@ -643,6 +654,12 @@ protected function promptAuthAndRetry($httpStatus, $reason = null, $headers = ar } } + /** + * @param string $originUrl + * @param mixed[] $additionalOptions + * + * @return mixed[] + */ protected function getOptionsForUrl($originUrl, $additionalOptions) { $tlsOptions = array(); @@ -714,6 +731,13 @@ protected function getOptionsForUrl($originUrl, $additionalOptions) return $options; } + /** + * @param string[] $http_response_header + * @param mixed[] $additionalOptions + * @param string|false $result + * + * @return bool|string + */ private function handleRedirect(array $http_response_header, array $additionalOptions, $result) { if ($locationHeader = Response::findHeaderValue($http_response_header, 'location')) { @@ -763,6 +787,9 @@ private function handleRedirect(array $http_response_header, array $additionalOp * * @todo Remove when PHP 5.6 is minimum supported version. * + * @param string $url + * @param mixed[] $options + * * @return ?array{cn: string, fp: string} */ private function getCertificateCnAndFp($url, $options) @@ -807,6 +834,11 @@ private function getCertificateCnAndFp($url, $options) return null; } + /** + * @param string $url + * + * @return string + */ private function getUrlAuthority($url) { $defaultPorts = array( @@ -832,6 +864,12 @@ private function getUrlAuthority($url) return parse_url($url, PHP_URL_HOST).':'.$port; } + /** + * @param string|false $result + * @param string[] $http_response_header + * + * @return string|null + */ private function decodeResult($result, $http_response_header) { // decode gzip @@ -853,6 +891,20 @@ private function decodeResult($result, $http_response_header) } } + return $this->normalizeResult($result); + } + + /** + * @param string|false $result + * + * @return string|null + */ + private function normalizeResult($result) + { + if ($result === false) { + return null; + } + return $result; } } diff --git a/app/vendor/composer/installed.json b/app/vendor/composer/installed.json index f914410df..a743213b3 100644 --- a/app/vendor/composer/installed.json +++ b/app/vendor/composer/installed.json @@ -2,17 +2,17 @@ "packages": [ { "name": "adodb/adodb-php", - "version": "v5.21.2", - "version_normalized": "5.21.2.0", + "version": "v5.21.3", + "version_normalized": "5.21.3.0", "source": { "type": "git", "url": "https://github.com/ADOdb/ADOdb.git", - "reference": "aa161c28dfffcab13a3cb9bd407917573987f0f6" + "reference": "c5415722049f36c446a4034d15f1d17943f11458" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/aa161c28dfffcab13a3cb9bd407917573987f0f6", - "reference": "aa161c28dfffcab13a3cb9bd407917573987f0f6", + "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/c5415722049f36c446a4034d15f1d17943f11458", + "reference": "c5415722049f36c446a4034d15f1d17943f11458", "shasum": "" }, "require": { @@ -21,7 +21,7 @@ "require-dev": { "phpunit/phpunit": "^8.5" }, - "time": "2021-08-22T10:49:44+00:00", + "time": "2021-10-31T14:56:48+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -112,17 +112,17 @@ }, { "name": "cakephp/bake", - "version": "2.6.0", - "version_normalized": "2.6.0.0", + "version": "2.6.1", + "version_normalized": "2.6.1.0", "source": { "type": "git", "url": "https://github.com/cakephp/bake.git", - "reference": "793ab54ad56f505284eafd30fcffe26835f74b8e" + "reference": "e559b5f19d78b93609d89aac677cf289090d0742" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/bake/zipball/793ab54ad56f505284eafd30fcffe26835f74b8e", - "reference": "793ab54ad56f505284eafd30fcffe26835f74b8e", + "url": "https://api.github.com/repos/cakephp/bake/zipball/e559b5f19d78b93609d89aac677cf289090d0742", + "reference": "e559b5f19d78b93609d89aac677cf289090d0742", "shasum": "" }, "require": { @@ -137,7 +137,7 @@ "cakephp/plugin-installer": "^1.3", "phpunit/phpunit": "^8.5 || ^9.3" }, - "time": "2021-10-24T01:39:19+00:00", + "time": "2021-11-01T05:09:32+00:00", "type": "cakephp-plugin", "installation-source": "dist", "autoload": { @@ -171,17 +171,17 @@ }, { "name": "cakephp/cakephp", - "version": "4.3.0", - "version_normalized": "4.3.0.0", + "version": "4.3.1", + "version_normalized": "4.3.1.0", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp.git", - "reference": "fc71c2d7e1bda979da41ed1dea726d6e04240d3b" + "reference": "6b1cf0e74bbfbb73ecdb1e8a5d0fd36230930931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp/zipball/fc71c2d7e1bda979da41ed1dea726d6e04240d3b", - "reference": "fc71c2d7e1bda979da41ed1dea726d6e04240d3b", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/6b1cf0e74bbfbb73ecdb1e8a5d0fd36230930931", + "reference": "6b1cf0e74bbfbb73ecdb1e8a5d0fd36230930931", "shasum": "" }, "require": { @@ -194,6 +194,7 @@ "laminas/laminas-httphandlerrunner": "^1.1", "league/container": "^4.1.1", "php": ">=7.2.0", + "psr/container": "^2.0", "psr/http-client": "^1.0", "psr/http-server-handler": "^1.0", "psr/http-server-middleware": "^1.0", @@ -229,7 +230,7 @@ "lib-ICU": "The intl PHP library, to use Text::transliterate() or Text::slug()", "paragonie/csp-builder": "CSP builder, to use the CSP Middleware" }, - "time": "2021-10-24T01:34:13+00:00", + "time": "2021-11-06T15:39:56+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -463,17 +464,17 @@ }, { "name": "cakephp/migrations", - "version": "3.2.0", - "version_normalized": "3.2.0.0", + "version": "3.3.0", + "version_normalized": "3.3.0.0", "source": { "type": "git", "url": "https://github.com/cakephp/migrations.git", - "reference": "3da702e619880ade5a50313f9dcf65c968b65363" + "reference": "e0ee5fb22f21ee18f85d2fc554a22c3a5d119dea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/migrations/zipball/3da702e619880ade5a50313f9dcf65c968b65363", - "reference": "3da702e619880ade5a50313f9dcf65c968b65363", + "url": "https://api.github.com/repos/cakephp/migrations/zipball/e0ee5fb22f21ee18f85d2fc554a22c3a5d119dea", + "reference": "e0ee5fb22f21ee18f85d2fc554a22c3a5d119dea", "shasum": "" }, "require": { @@ -483,16 +484,16 @@ "robmorgan/phinx": "^0.12" }, "require-dev": { - "cakephp/bake": "^2.5.0", + "cakephp/bake": "^2.6.0", "cakephp/cakephp": "^4.3.0", - "cakephp/cakephp-codesniffer": "~4.1", - "phpunit/phpunit": "~8.5.0" + "cakephp/cakephp-codesniffer": "^4.1", + "phpunit/phpunit": "^8.5.0 || ^9.5.0" }, "suggest": { "cakephp/bake": "If you want to generate migrations.", "dereuromark/cakephp-ide-helper": "If you want to have IDE suggest/autocomplete when creating migrations." }, - "time": "2021-10-24T01:49:12+00:00", + "time": "2021-10-30T03:48:47+00:00", "type": "cakephp-plugin", "installation-source": "dist", "autoload": { @@ -756,17 +757,17 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.11", - "version_normalized": "1.2.11.0", + "version": "1.3.1", + "version_normalized": "1.3.1.0", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582" + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", - "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", "shasum": "" }, "require": { @@ -780,7 +781,7 @@ "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" }, - "time": "2021-09-25T20:32:43+00:00", + "time": "2021-10-28T20:44:15+00:00", "type": "library", "extra": { "branch-alias": { @@ -815,7 +816,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.11" + "source": "https://github.com/composer/ca-bundle/tree/1.3.1" }, "funding": [ { @@ -835,17 +836,17 @@ }, { "name": "composer/composer", - "version": "2.1.9", - "version_normalized": "2.1.9.0", + "version": "2.1.12", + "version_normalized": "2.1.12.0", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "e558c88f28d102d497adec4852802c0dc14c7077" + "reference": "6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/e558c88f28d102d497adec4852802c0dc14c7077", - "reference": "e558c88f28d102d497adec4852802c0dc14c7077", + "url": "https://api.github.com/repos/composer/composer/zipball/6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0", + "reference": "6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0", "shasum": "" }, "require": { @@ -856,7 +857,7 @@ "composer/xdebug-handler": "^2.0", "justinrainbow/json-schema": "^5.2.11", "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0", + "psr/log": "^1.0 || ^2.0", "react/promise": "^1.2 || ^2.7", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", @@ -874,14 +875,14 @@ "ext-zip": "Enabling the zip extension allows you to unzip archives", "ext-zlib": "Allow gzip compression of HTTP requests" }, - "time": "2021-10-05T07:47:38+00:00", + "time": "2021-11-09T15:02:04+00:00", "bin": [ "bin/composer" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-main": "2.1-dev" } }, "installation-source": "dist", @@ -916,7 +917,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.1.9" + "source": "https://github.com/composer/composer/tree/2.1.12" }, "funding": [ { @@ -1084,17 +1085,17 @@ }, { "name": "composer/semver", - "version": "3.2.5", - "version_normalized": "3.2.5.0", + "version": "3.2.6", + "version_normalized": "3.2.6.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + "reference": "83e511e247de329283478496f7a1e114c9517506" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", + "reference": "83e511e247de329283478496f7a1e114c9517506", "shasum": "" }, "require": { @@ -1104,7 +1105,7 @@ "phpstan/phpstan": "^0.12.54", "symfony/phpunit-bridge": "^4.2 || ^5" }, - "time": "2021-05-24T12:41:47+00:00", + "time": "2021-10-25T11:34:17+00:00", "type": "library", "extra": { "branch-alias": { @@ -1148,7 +1149,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.5" + "source": "https://github.com/composer/semver/tree/3.2.6" }, "funding": [ { @@ -1492,17 +1493,17 @@ }, { "name": "doctrine/dbal", - "version": "3.1.3", - "version_normalized": "3.1.3.0", + "version": "3.1.4", + "version_normalized": "3.1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "96b0053775a544b4a6ab47654dac0621be8b4cf8" + "reference": "821b4f01a36ce63ed36c090ea74767b72db367e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/96b0053775a544b4a6ab47654dac0621be8b4cf8", - "reference": "96b0053775a544b4a6ab47654dac0621be8b4cf8", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/821b4f01a36ce63ed36c090ea74767b72db367e9", + "reference": "821b4f01a36ce63ed36c090ea74767b72db367e9", "shasum": "" }, "require": { @@ -1515,19 +1516,19 @@ "require-dev": { "doctrine/coding-standard": "9.0.0", "jetbrains/phpstorm-stubs": "2021.1", - "phpstan/phpstan": "0.12.99", - "phpstan/phpstan-strict-rules": "^0.12.11", + "phpstan/phpstan": "1.1.1", + "phpstan/phpstan-strict-rules": "^1", "phpunit/phpunit": "9.5.10", "psalm/plugin-phpunit": "0.16.1", - "squizlabs/php_codesniffer": "3.6.0", + "squizlabs/php_codesniffer": "3.6.1", "symfony/cache": "^5.2|^6.0", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0|^6.0", - "vimeo/psalm": "4.10.0" + "vimeo/psalm": "4.12.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." }, - "time": "2021-10-02T16:15:05+00:00", + "time": "2021-11-15T16:44:33+00:00", "bin": [ "bin/doctrine-dbal" ], @@ -1584,7 +1585,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.1.3" + "source": "https://github.com/doctrine/dbal/tree/3.1.4" }, "funding": [ { @@ -2313,22 +2314,22 @@ }, { "name": "league/container", - "version": "4.1.2", - "version_normalized": "4.1.2.0", + "version": "4.2.0", + "version_normalized": "4.2.0.0", "source": { "type": "git", "url": "https://github.com/thephpleague/container.git", - "reference": "82a57588c630663d2600f046753b23ab6dcda9b5" + "reference": "375d13cb828649599ef5d48a339c4af7a26cd0ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/container/zipball/82a57588c630663d2600f046753b23ab6dcda9b5", - "reference": "82a57588c630663d2600f046753b23ab6dcda9b5", + "url": "https://api.github.com/repos/thephpleague/container/zipball/375d13cb828649599ef5d48a339c4af7a26cd0ab", + "reference": "375d13cb828649599ef5d48a339c4af7a26cd0ab", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "psr/container": "^2.0.0" + "psr/container": "^1.1 || ^2.0" }, "provide": { "psr/container-implementation": "^1.0" @@ -2345,7 +2346,7 @@ "scrutinizer/ocular": "^1.8", "squizlabs/php_codesniffer": "^3.6" }, - "time": "2021-07-26T07:04:36+00:00", + "time": "2021-11-16T10:29:06+00:00", "type": "library", "extra": { "branch-alias": { @@ -2386,7 +2387,7 @@ ], "support": { "issues": "https://github.com/thephpleague/container/issues", - "source": "https://github.com/thephpleague/container/tree/4.1.2" + "source": "https://github.com/thephpleague/container/tree/4.2.0" }, "funding": [ { @@ -2589,17 +2590,17 @@ }, { "name": "nikic/php-parser", - "version": "v4.13.0", - "version_normalized": "4.13.0.0", + "version": "v4.13.1", + "version_normalized": "4.13.1.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "50953a2691a922aa1769461637869a0a2faa3f53" + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", - "reference": "50953a2691a922aa1769461637869a0a2faa3f53", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/63a79e8daa781cac14e5195e63ed8ae231dd10fd", + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd", "shasum": "" }, "require": { @@ -2610,7 +2611,7 @@ "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, - "time": "2021-09-20T12:20:58+00:00", + "time": "2021-11-03T20:52:16+00:00", "bin": [ "bin/php-parse" ], @@ -2642,7 +2643,7 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.1" }, "install-path": "../nikic/php-parser" }, @@ -3123,24 +3124,24 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.7", - "version_normalized": "9.2.7.0", + "version": "9.2.8", + "version_normalized": "9.2.8.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218" + "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218", - "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cf04e88a2e3c56fc1a65488afd493325b4c1bc3e", + "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.12.0", + "nikic/php-parser": "^4.13.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -3158,7 +3159,7 @@ "ext-pcov": "*", "ext-xdebug": "*" }, - "time": "2021-09-17T05:39:03+00:00", + "time": "2021-10-30T08:01:38+00:00", "type": "library", "extra": { "branch-alias": { @@ -3191,7 +3192,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.8" }, "funding": [ { @@ -3562,23 +3563,23 @@ }, { "name": "psr/container", - "version": "2.0.1", - "version_normalized": "2.0.1.0", + "version": "2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/2ae37329ee82f91efadc282cc2d527fd6065a5ef", - "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, - "time": "2021-03-24T13:40:57+00:00", + "time": "2021-11-05T16:47:00+00:00", "type": "library", "extra": { "branch-alias": { @@ -3612,7 +3613,7 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.1" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, "install-path": "../psr/container" }, @@ -4676,17 +4677,17 @@ }, { "name": "sebastian/exporter", - "version": "4.0.3", - "version_normalized": "4.0.3.0", + "version": "4.0.4", + "version_normalized": "4.0.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", "shasum": "" }, "require": { @@ -4697,7 +4698,7 @@ "ext-mbstring": "*", "phpunit/phpunit": "^9.3" }, - "time": "2020-09-28T05:24:23+00:00", + "time": "2021-11-11T14:18:36+00:00", "type": "library", "extra": { "branch-alias": { @@ -4737,14 +4738,14 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" }, "funding": [ { @@ -5480,17 +5481,17 @@ }, { "name": "symfony/config", - "version": "v5.3.4", - "version_normalized": "5.3.4.0", + "version": "v5.3.10", + "version_normalized": "5.3.10.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "4268f3059c904c61636275182707f81645517a37" + "reference": "ac23c2f24d5634966d665d836c3933d54347e5d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/4268f3059c904c61636275182707f81645517a37", - "reference": "4268f3059c904c61636275182707f81645517a37", + "url": "https://api.github.com/repos/symfony/config/zipball/ac23c2f24d5634966d665d836c3933d54347e5d4", + "reference": "ac23c2f24d5634966d665d836c3933d54347e5d4", "shasum": "" }, "require": { @@ -5514,7 +5515,7 @@ "suggest": { "symfony/yaml": "To use the yaml reference dumper" }, - "time": "2021-07-21T12:40:44+00:00", + "time": "2021-10-22T09:06:52+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5542,7 +5543,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.3.4" + "source": "https://github.com/symfony/config/tree/v5.3.10" }, "funding": [ { @@ -5562,47 +5563,38 @@ }, { "name": "symfony/console", - "version": "v5.3.7", - "version_normalized": "5.3.7.0", + "version": "v3.4.47", + "version_normalized": "3.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" + "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", - "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", + "url": "https://api.github.com/repos/symfony/console/zipball/a10b1da6fc93080c180bba7219b5ff5b7518fe81", + "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" + "psr/log": "~1.0", + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" }, "suggest": { "psr/log": "For using the console logger", @@ -5610,7 +5602,7 @@ "symfony/lock": "", "symfony/process": "" }, - "time": "2021-08-25T20:02:16+00:00", + "time": "2020-10-24T10:57:07+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5635,16 +5627,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Eases the creation of beautiful and testable command line interfaces", + "description": "Symfony Console Component", "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command line", - "console", - "terminal" - ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.7" + "source": "https://github.com/symfony/console/tree/v3.4.47" }, "funding": [ { @@ -5662,6 +5648,77 @@ ], "install-path": "../symfony/console" }, + { + "name": "symfony/debug", + "version": "v4.4.31", + "version_normalized": "4.4.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "43ede438d4cb52cd589ae5dc070e9323866ba8e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/43ede438d4cb52cd589ae5dc070e9323866ba8e0", + "reference": "43ede438d4cb52cd589ae5dc070e9323866ba8e0", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "psr/log": "^1|^2|^3" + }, + "conflict": { + "symfony/http-kernel": "<3.4" + }, + "require-dev": { + "symfony/http-kernel": "^3.4|^4.0|^5.0" + }, + "time": "2021-09-24T13:30:14+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug/tree/v4.4.31" + }, + "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" + } + ], + "install-path": "../symfony/debug" + }, { "name": "symfony/deprecation-contracts", "version": "v2.4.0", @@ -5945,177 +6002,6 @@ ], "install-path": "../symfony/polyfill-ctype" }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2021-05-27T12:26:48+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "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.23.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" - } - ], - "install-path": "../symfony/polyfill-intl-grapheme" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2021-02-19T12:13:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "files": [ - "bootstrap.php" - ], - "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.23.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" - } - ], - "install-path": "../symfony/polyfill-intl-normalizer" - }, { "name": "symfony/polyfill-mbstring", "version": "v1.23.1", @@ -6200,24 +6086,24 @@ "install-path": "../symfony/polyfill-mbstring" }, { - "name": "symfony/polyfill-php73", + "name": "symfony/polyfill-php72", "version": "v1.23.0", "version_normalized": "1.23.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-02-19T12:13:01+00:00", + "time": "2021-05-27T09:17:38+00:00", "type": "library", "extra": { "branch-alias": { @@ -6231,13 +6117,10 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "Symfony\\Polyfill\\Php72\\": "" }, "files": [ "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -6254,7 +6137,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -6263,7 +6146,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" }, "funding": [ { @@ -6279,7 +6162,7 @@ "type": "tidelift" } ], - "install-path": "../symfony/polyfill-php73" + "install-path": "../symfony/polyfill-php72" }, { "name": "symfony/polyfill-php80", @@ -6514,192 +6397,43 @@ ], "install-path": "../symfony/process" }, - { - "name": "symfony/service-contracts", - "version": "v1.1.2", - "version_normalized": "1.1.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0", - "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "suggest": { - "psr/container": "", - "symfony/service-implementation": "" - }, - "time": "2019-05-28T07:50:59+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "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/v1.1.2" - }, - "install-path": "../symfony/service-contracts" - }, - { - "name": "symfony/string", - "version": "v5.3.7", - "version_normalized": "5.3.7.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", - "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" - }, - "require-dev": { - "symfony/error-handler": "^4.4|^5.0", - "symfony/http-client": "^4.4|^5.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0" - }, - "time": "2021-08-26T08:00:08+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "files": [ - "Resources/functions.php" - ], - "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/v5.3.7" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/string" - }, { "name": "symfony/var-dumper", - "version": "v5.3.8", - "version_normalized": "5.3.8.0", + "version": "v4.4.33", + "version_normalized": "4.4.33.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "eaaea4098be1c90c8285543e1356a09c8aa5c8da" + "reference": "50286e2b7189bfb4f419c0731e86632cddf7c5ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/eaaea4098be1c90c8285543e1356a09c8aa5c8da", - "reference": "eaaea4098be1c90c8285543e1356a09c8aa5c8da", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/50286e2b7189bfb4f419c0731e86632cddf7c5ee", + "reference": "50286e2b7189bfb4f419c0731e86632cddf7c5ee", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5", "symfony/polyfill-php80": "^1.16" }, "conflict": { - "phpunit/phpunit": "<5.4.3", - "symfony/console": "<4.4" + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^4.4|^5.0", + "symfony/console": "^3.4|^4.0|^5.0", "symfony/process": "^4.4|^5.0", - "twig/twig": "^2.13|^3.0.4" + "twig/twig": "^1.43|^2.13|^3.0.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2021-09-24T15:59:58+00:00", + "time": "2021-10-25T20:24:58+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -6737,7 +6471,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.3.8" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.33" }, "funding": [ { @@ -7137,6 +6871,7 @@ "slevomat/coding-standard", "squizlabs/php_codesniffer", "symfony/finder", + "symfony/polyfill-php72", "symfony/process", "symfony/var-dumper", "theseer/tokenizer", diff --git a/app/vendor/composer/installed.php b/app/vendor/composer/installed.php index 047681a97..efee8f859 100644 --- a/app/vendor/composer/installed.php +++ b/app/vendor/composer/installed.php @@ -5,18 +5,18 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '009a4763a555805b8aa0e5542fde04a978cde75c', + 'reference' => '0ee8a40af5a403c1a5c3aadf8eaec61c22b9dbf4', 'name' => 'cakephp/app', 'dev' => true, ), 'versions' => array( 'adodb/adodb-php' => array( - 'pretty_version' => 'v5.21.2', - 'version' => '5.21.2.0', + 'pretty_version' => 'v5.21.3', + 'version' => '5.21.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../adodb/adodb-php', 'aliases' => array(), - 'reference' => 'aa161c28dfffcab13a3cb9bd407917573987f0f6', + 'reference' => 'c5415722049f36c446a4034d15f1d17943f11458', 'dev_requirement' => false, ), 'brick/varexporter' => array( @@ -34,31 +34,31 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '009a4763a555805b8aa0e5542fde04a978cde75c', + 'reference' => '0ee8a40af5a403c1a5c3aadf8eaec61c22b9dbf4', 'dev_requirement' => false, ), 'cakephp/bake' => array( - 'pretty_version' => '2.6.0', - 'version' => '2.6.0.0', + 'pretty_version' => '2.6.1', + 'version' => '2.6.1.0', 'type' => 'cakephp-plugin', 'install_path' => __DIR__ . '/../cakephp/bake', 'aliases' => array(), - 'reference' => '793ab54ad56f505284eafd30fcffe26835f74b8e', + 'reference' => 'e559b5f19d78b93609d89aac677cf289090d0742', 'dev_requirement' => true, ), 'cakephp/cache' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/cakephp' => array( - 'pretty_version' => '4.3.0', - 'version' => '4.3.0.0', + 'pretty_version' => '4.3.1', + 'version' => '4.3.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../cakephp/cakephp', 'aliases' => array(), - 'reference' => 'fc71c2d7e1bda979da41ed1dea726d6e04240d3b', + 'reference' => '6b1cf0e74bbfbb73ecdb1e8a5d0fd36230930931', 'dev_requirement' => false, ), 'cakephp/cakephp-codesniffer' => array( @@ -82,31 +82,31 @@ 'cakephp/collection' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/console' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/core' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/database' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/datasource' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/debug_kit' => array( @@ -121,52 +121,52 @@ 'cakephp/event' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/filesystem' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/form' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/http' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/i18n' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/log' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/migrations' => array( - 'pretty_version' => '3.2.0', - 'version' => '3.2.0.0', + 'pretty_version' => '3.3.0', + 'version' => '3.3.0.0', 'type' => 'cakephp-plugin', 'install_path' => __DIR__ . '/../cakephp/migrations', 'aliases' => array(), - 'reference' => '3da702e619880ade5a50313f9dcf65c968b65363', + 'reference' => 'e0ee5fb22f21ee18f85d2fc554a22c3a5d119dea', 'dev_requirement' => false, ), 'cakephp/orm' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/plugin-installer' => array( @@ -199,13 +199,13 @@ 'cakephp/utility' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'cakephp/validation' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.3.0', + 0 => '4.3.1', ), ), 'components/jquery' => array( @@ -218,21 +218,21 @@ 'dev_requirement' => false, ), 'composer/ca-bundle' => array( - 'pretty_version' => '1.2.11', - 'version' => '1.2.11.0', + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/./ca-bundle', 'aliases' => array(), - 'reference' => '0b072d51c5a9c6f3412f7ea3ab043d6603cb2582', + 'reference' => '4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b', 'dev_requirement' => false, ), 'composer/composer' => array( - 'pretty_version' => '2.1.9', - 'version' => '2.1.9.0', + 'pretty_version' => '2.1.12', + 'version' => '2.1.12.0', 'type' => 'library', 'install_path' => __DIR__ . '/./composer', 'aliases' => array(), - 'reference' => 'e558c88f28d102d497adec4852802c0dc14c7077', + 'reference' => '6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0', 'dev_requirement' => true, ), 'composer/metadata-minifier' => array( @@ -254,12 +254,12 @@ 'dev_requirement' => false, ), 'composer/semver' => array( - 'pretty_version' => '3.2.5', - 'version' => '3.2.5.0', + 'pretty_version' => '3.2.6', + 'version' => '3.2.6.0', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), - 'reference' => '31f3ea725711245195f62e54ffa402d8ef2fdba9', + 'reference' => '83e511e247de329283478496f7a1e114c9517506', 'dev_requirement' => true, ), 'composer/spdx-licenses' => array( @@ -299,12 +299,12 @@ 'dev_requirement' => false, ), 'doctrine/dbal' => array( - 'pretty_version' => '3.1.3', - 'version' => '3.1.3.0', + 'pretty_version' => '3.1.4', + 'version' => '3.1.4.0', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/dbal', 'aliases' => array(), - 'reference' => '96b0053775a544b4a6ab47654dac0621be8b4cf8', + 'reference' => '821b4f01a36ce63ed36c090ea74767b72db367e9', 'dev_requirement' => false, ), 'doctrine/deprecations' => array( @@ -398,12 +398,12 @@ 'dev_requirement' => false, ), 'league/container' => array( - 'pretty_version' => '4.1.2', - 'version' => '4.1.2.0', + 'pretty_version' => '4.2.0', + 'version' => '4.2.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../league/container', 'aliases' => array(), - 'reference' => '82a57588c630663d2600f046753b23ab6dcda9b5', + 'reference' => '375d13cb828649599ef5d48a339c4af7a26cd0ab', 'dev_requirement' => false, ), 'm1/env' => array( @@ -437,12 +437,12 @@ ), ), 'nikic/php-parser' => array( - 'pretty_version' => 'v4.13.0', - 'version' => '4.13.0.0', + 'pretty_version' => 'v4.13.1', + 'version' => '4.13.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), - 'reference' => '50953a2691a922aa1769461637869a0a2faa3f53', + 'reference' => '63a79e8daa781cac14e5195e63ed8ae231dd10fd', 'dev_requirement' => true, ), 'ocramius/package-versions' => array( @@ -530,12 +530,12 @@ 'dev_requirement' => true, ), 'phpunit/php-code-coverage' => array( - 'pretty_version' => '9.2.7', - 'version' => '9.2.7.0', + 'pretty_version' => '9.2.8', + 'version' => '9.2.8.0', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-code-coverage', 'aliases' => array(), - 'reference' => 'd4c798ed8d51506800b441f7a13ecb0f76f12218', + 'reference' => 'cf04e88a2e3c56fc1a65488afd493325b4c1bc3e', 'dev_requirement' => true, ), 'phpunit/php-file-iterator' => array( @@ -584,12 +584,12 @@ 'dev_requirement' => true, ), 'psr/container' => array( - 'pretty_version' => '2.0.1', - 'version' => '2.0.1.0', + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), - 'reference' => '2ae37329ee82f91efadc282cc2d527fd6065a5ef', + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'dev_requirement' => false, ), 'psr/container-implementation' => array( @@ -667,7 +667,7 @@ 'psr/log-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '1.0|2.0', + 0 => '1.0', ), ), 'psr/simple-cache' => array( @@ -770,12 +770,12 @@ 'dev_requirement' => true, ), 'sebastian/exporter' => array( - 'pretty_version' => '4.0.3', - 'version' => '4.0.3.0', + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/exporter', 'aliases' => array(), - 'reference' => 'd89cc98761b8cb5a1a235a6b703ae50d34080e65', + 'reference' => '65e8b7db476c5dd267e65eea9cab77584d3cfff9', 'dev_requirement' => true, ), 'sebastian/global-state' => array( @@ -887,21 +887,30 @@ 'dev_requirement' => true, ), 'symfony/config' => array( - 'pretty_version' => 'v5.3.4', - 'version' => '5.3.4.0', + 'pretty_version' => 'v5.3.10', + 'version' => '5.3.10.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), - 'reference' => '4268f3059c904c61636275182707f81645517a37', + 'reference' => 'ac23c2f24d5634966d665d836c3933d54347e5d4', 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v5.3.7', - 'version' => '5.3.7.0', + 'pretty_version' => 'v3.4.47', + 'version' => '3.4.47.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), - 'reference' => '8b1008344647462ae6ec57559da166c2bfa5e16a', + 'reference' => 'a10b1da6fc93080c180bba7219b5ff5b7518fe81', + 'dev_requirement' => false, + ), + 'symfony/debug' => array( + 'pretty_version' => 'v4.4.31', + 'version' => '4.4.31.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/debug', + 'aliases' => array(), + 'reference' => '43ede438d4cb52cd589ae5dc070e9323866ba8e0', 'dev_requirement' => false, ), 'symfony/deprecation-contracts' => array( @@ -940,24 +949,6 @@ 'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', 'dev_requirement' => false, ), - 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', - 'aliases' => array(), - 'reference' => '16880ba9c5ebe3642d1995ab866db29270b36535', - 'dev_requirement' => false, - ), - 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', - 'aliases' => array(), - 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', - 'dev_requirement' => false, - ), 'symfony/polyfill-mbstring' => array( 'pretty_version' => 'v1.23.1', 'version' => '1.23.1.0', @@ -967,14 +958,14 @@ 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', 'dev_requirement' => false, ), - 'symfony/polyfill-php73' => array( + 'symfony/polyfill-php72' => array( 'pretty_version' => 'v1.23.0', 'version' => '1.23.0.0', 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php73', + 'install_path' => __DIR__ . '/../symfony/polyfill-php72', 'aliases' => array(), - 'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010', - 'dev_requirement' => false, + 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', + 'dev_requirement' => true, ), 'symfony/polyfill-php80' => array( 'pretty_version' => 'v1.23.1', @@ -1003,31 +994,13 @@ 'reference' => '38f26c7d6ed535217ea393e05634cb0b244a1967', 'dev_requirement' => true, ), - 'symfony/service-contracts' => array( - 'pretty_version' => 'v1.1.2', - 'version' => '1.1.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/service-contracts', - 'aliases' => array(), - 'reference' => '191afdcb5804db960d26d8566b7e9a2843cab3a0', - 'dev_requirement' => false, - ), - 'symfony/string' => array( - 'pretty_version' => 'v5.3.7', - 'version' => '5.3.7.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/string', - 'aliases' => array(), - 'reference' => '8d224396e28d30f81969f083a58763b8b9ceb0a5', - 'dev_requirement' => false, - ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v5.3.8', - 'version' => '5.3.8.0', + 'pretty_version' => 'v4.4.33', + 'version' => '4.4.33.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), - 'reference' => 'eaaea4098be1c90c8285543e1356a09c8aa5c8da', + 'reference' => '50286e2b7189bfb4f419c0731e86632cddf7c5ee', 'dev_requirement' => true, ), 'theseer/tokenizer' => array( diff --git a/app/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php b/app/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php index 53541309f..2dae866c6 100644 --- a/app/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php +++ b/app/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php @@ -33,24 +33,24 @@ final class Versions * @internal */ const VERSIONS = array ( - 'adodb/adodb-php' => 'v5.21.2@aa161c28dfffcab13a3cb9bd407917573987f0f6', - 'cakephp/cakephp' => '4.3.0@fc71c2d7e1bda979da41ed1dea726d6e04240d3b', + 'adodb/adodb-php' => 'v5.21.3@c5415722049f36c446a4034d15f1d17943f11458', + 'cakephp/cakephp' => '4.3.1@6b1cf0e74bbfbb73ecdb1e8a5d0fd36230930931', 'cakephp/chronos' => '2.3.0@3ecd6e7ae191c676570cd1bed51fd561de4606dd', - 'cakephp/migrations' => '3.2.0@3da702e619880ade5a50313f9dcf65c968b65363', + 'cakephp/migrations' => '3.3.0@e0ee5fb22f21ee18f85d2fc554a22c3a5d119dea', 'cakephp/plugin-installer' => '1.3.1@e27027aa2d3d8ab64452c6817629558685a064cb', 'components/jquery' => '3.6.0@6cf38ee1fd04b6adf8e7dda161283aa35be818c3', - 'composer/ca-bundle' => '1.2.11@0b072d51c5a9c6f3412f7ea3ab043d6603cb2582', + 'composer/ca-bundle' => '1.3.1@4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b', 'composer/package-versions-deprecated' => '1.11.99.4@b174585d1fe49ceed21928a945138948cb394600', 'doctrine/cache' => '2.1.1@331b4d5dbaeab3827976273e9356b3b453c300ce', - 'doctrine/dbal' => '3.1.3@96b0053775a544b4a6ab47654dac0621be8b4cf8', + 'doctrine/dbal' => '3.1.4@821b4f01a36ce63ed36c090ea74767b72db367e9', 'doctrine/deprecations' => 'v0.5.3@9504165960a1f83cc1480e2be1dd0a0478561314', 'doctrine/event-manager' => '1.1.1@41370af6a30faa9dc0368c4a6814d596e81aba7f', 'laminas/laminas-diactoros' => '2.8.0@0c26ef1d95b6d7e6e3943a243ba3dc0797227199', 'laminas/laminas-httphandlerrunner' => '1.5.0@5f94e55d93f756e8ad07b9049aeb3d6d84582d0e', 'laminas/laminas-zendframework-bridge' => '1.4.0@bf180a382393e7db5c1e8d0f2ec0c4af9c724baf', - 'league/container' => '4.1.2@82a57588c630663d2600f046753b23ab6dcda9b5', + 'league/container' => '4.2.0@375d13cb828649599ef5d48a339c4af7a26cd0ab', 'mobiledetect/mobiledetectlib' => '2.8.37@9841e3c46f5bd0739b53aed8ac677fa712943df7', - 'psr/container' => '2.0.1@2ae37329ee82f91efadc282cc2d527fd6065a5ef', + 'psr/container' => '2.0.2@c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'psr/http-client' => '1.0.1@2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', 'psr/http-factory' => '1.0.1@12ac7fcd07e5b077433f5f2bee95b3a771bf61be', 'psr/http-message' => '1.0.1@f6561bf28d520154e4b0ec72be95418abe6d9363', @@ -59,29 +59,25 @@ final class Versions 'psr/log' => '1.1.4@d49695b909c3b7628b6289db5479a1c204601f11', 'psr/simple-cache' => '1.0.1@408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', 'robmorgan/phinx' => '0.12.9@5a0146a74c1bc195d1f5da86afa3b68badf7d90e', - 'symfony/config' => 'v5.3.4@4268f3059c904c61636275182707f81645517a37', - 'symfony/console' => 'v5.3.7@8b1008344647462ae6ec57559da166c2bfa5e16a', + 'symfony/config' => 'v5.3.10@ac23c2f24d5634966d665d836c3933d54347e5d4', + 'symfony/console' => 'v3.4.47@a10b1da6fc93080c180bba7219b5ff5b7518fe81', + 'symfony/debug' => 'v4.4.31@43ede438d4cb52cd589ae5dc070e9323866ba8e0', 'symfony/deprecation-contracts' => 'v2.4.0@5f38c8804a9e97d23e0c8d63341088cd8a22d627', 'symfony/filesystem' => 'v5.3.4@343f4fe324383ca46792cae728a3b6e2f708fb32', 'symfony/polyfill-ctype' => 'v1.23.0@46cd95797e9df938fdd2b03693b5fca5e64b01ce', - 'symfony/polyfill-intl-grapheme' => 'v1.23.1@16880ba9c5ebe3642d1995ab866db29270b36535', - 'symfony/polyfill-intl-normalizer' => 'v1.23.0@8590a5f561694770bdcd3f9b5c69dde6945028e8', 'symfony/polyfill-mbstring' => 'v1.23.1@9174a3d80210dca8daa7f31fec659150bbeabfc6', - 'symfony/polyfill-php73' => 'v1.23.0@fba8933c384d6476ab14fb7b8526e5287ca7e010', 'symfony/polyfill-php80' => 'v1.23.1@1100343ed1a92e3a38f9ae122fc0eb21602547be', 'symfony/polyfill-php81' => 'v1.23.0@e66119f3de95efc359483f810c4c3e6436279436', - 'symfony/service-contracts' => 'v1.1.2@191afdcb5804db960d26d8566b7e9a2843cab3a0', - 'symfony/string' => 'v5.3.7@8d224396e28d30f81969f083a58763b8b9ceb0a5', 'twbs/bootstrap' => 'v5.1.3@1a6fdfae6be09b09eaced8f0e442ca6f7680a61e', 'brick/varexporter' => '0.3.5@05241f28dfcba2b51b11e2d750e296316ebbe518', - 'cakephp/bake' => '2.6.0@793ab54ad56f505284eafd30fcffe26835f74b8e', + 'cakephp/bake' => '2.6.1@e559b5f19d78b93609d89aac677cf289090d0742', 'cakephp/cakephp-codesniffer' => '4.5.1@6b17905db024b8d7e64a15296688545c61ab6694', 'cakephp/debug_kit' => '4.5.0@518887795e583796fc7ec5926cb89874416bc97a', 'cakephp/repl' => '0.1.0@6aa25db799a3bd062101b36f42a1ff0995654a56', 'cakephp/twig-view' => '1.3.0@14df50360b809a171d0688020fbdfe513763f89b', - 'composer/composer' => '2.1.9@e558c88f28d102d497adec4852802c0dc14c7077', + 'composer/composer' => '2.1.12@6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0', 'composer/metadata-minifier' => '1.0.0@c549d23829536f0d0e984aaabbf02af91f443207', - 'composer/semver' => '3.2.5@31f3ea725711245195f62e54ffa402d8ef2fdba9', + 'composer/semver' => '3.2.6@83e511e247de329283478496f7a1e114c9517506', 'composer/spdx-licenses' => '1.5.5@de30328a7af8680efdc03e396aad24befd513200', 'composer/xdebug-handler' => '2.0.2@84674dd3a7575ba617f5a76d7e9e29a7d3891339', 'dealerdirect/phpcodesniffer-composer-installer' => 'v0.7.1@fe390591e0241955f22eb9ba327d137e501c771c', @@ -92,7 +88,7 @@ final class Versions 'justinrainbow/json-schema' => '5.2.11@2ab6744b7296ded80f8cc4f9509abbff393399aa', 'm1/env' => '2.2.0@5c296e3e13450a207e12b343f3af1d7ab569f6f3', 'myclabs/deep-copy' => '1.10.2@776f831124e9c62e1a2c601ecc52e776d8bb7220', - 'nikic/php-parser' => 'v4.13.0@50953a2691a922aa1769461637869a0a2faa3f53', + 'nikic/php-parser' => 'v4.13.1@63a79e8daa781cac14e5195e63ed8ae231dd10fd', 'phar-io/manifest' => '2.0.3@97803eca37d319dfa7826cc2437fc020857acb53', 'phar-io/version' => '3.1.0@bae7c545bef187884426f042434e561ab1ddb182', 'phpdocumentor/reflection-common' => '2.2.0@1d01c49d4ed62f25aa84a747ad35d5a16924662b', @@ -101,7 +97,7 @@ final class Versions 'phpspec/prophecy' => '1.14.0@d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e', 'phpstan/phpdoc-parser' => '1.2.0@dbc093d7af60eff5cd575d2ed761b15ed40bd08e', 'phpstan/phpstan' => '0.12.99@b4d40f1d759942f523be267a1bab6884f46ca3f7', - 'phpunit/php-code-coverage' => '9.2.7@d4c798ed8d51506800b441f7a13ecb0f76f12218', + 'phpunit/php-code-coverage' => '9.2.8@cf04e88a2e3c56fc1a65488afd493325b4c1bc3e', 'phpunit/php-file-iterator' => '3.0.5@aa4be8575f26070b100fccb67faabb28f21f66f8', 'phpunit/php-invoker' => '3.1.1@5a10147d0aaf65b58940a0b72f71c9ac0423cc67', 'phpunit/php-text-template' => '2.0.4@5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', @@ -116,7 +112,7 @@ final class Versions 'sebastian/complexity' => '2.0.2@739b35e53379900cc9ac327b2147867b8b6efd88', 'sebastian/diff' => '4.0.4@3461e3fccc7cfdfc2720be910d3bd73c69be590d', 'sebastian/environment' => '5.1.3@388b6ced16caa751030f6a69e588299fa09200ac', - 'sebastian/exporter' => '4.0.3@d89cc98761b8cb5a1a235a6b703ae50d34080e65', + 'sebastian/exporter' => '4.0.4@65e8b7db476c5dd267e65eea9cab77584d3cfff9', 'sebastian/global-state' => '5.0.3@23bd5951f7ff26f12d4e3242864df3e08dec4e49', 'sebastian/lines-of-code' => '1.0.3@c1c2e997aa3146983ed888ad08b15470a2e22ecc', 'sebastian/object-enumerator' => '4.0.4@5c9eeac41b290a3712d88851518825ad78f45c71', @@ -130,13 +126,14 @@ final class Versions 'slevomat/coding-standard' => '7.0.16@14c324b2f2f0072933036c2f3abaeda16a56dcd3', 'squizlabs/php_codesniffer' => '3.6.1@f268ca40d54617c6e06757f83f699775c9b3ff2e', 'symfony/finder' => 'v5.3.7@a10000ada1e600d109a6c7632e9ac42e8bf2fb93', + 'symfony/polyfill-php72' => 'v1.23.0@9a142215a36a3888e30d0a9eeea9766764e96976', 'symfony/process' => 'v5.3.7@38f26c7d6ed535217ea393e05634cb0b244a1967', - 'symfony/var-dumper' => 'v5.3.8@eaaea4098be1c90c8285543e1356a09c8aa5c8da', + 'symfony/var-dumper' => 'v4.4.33@50286e2b7189bfb4f419c0731e86632cddf7c5ee', 'theseer/tokenizer' => '1.2.1@34a41e998c2183e22995f158c581e7b5e755ab9e', 'twig/markdown-extra' => 'v3.3.3@725a4ef89d93bb80fc63c67cf261bf7512649290', 'twig/twig' => 'v3.3.3@a27fa056df8a6384316288ca8b0fa3a35fdeb569', 'webmozart/assert' => '1.10.0@6964c76c7804814a842473e0c8fd15bab0f18e25', - 'cakephp/app' => 'dev-develop@009a4763a555805b8aa0e5542fde04a978cde75c', + 'cakephp/app' => 'dev-develop@0ee8a40af5a403c1a5c3aadf8eaec61c22b9dbf4', ); private function __construct() diff --git a/app/vendor/composer/platform_check.php b/app/vendor/composer/platform_check.php index 92370c5a0..580fa9609 100644 --- a/app/vendor/composer/platform_check.php +++ b/app/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70300)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 70400)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/app/vendor/composer/semver/CHANGELOG.md b/app/vendor/composer/semver/CHANGELOG.md index 67785e4d3..4542fa3b8 100644 --- a/app/vendor/composer/semver/CHANGELOG.md +++ b/app/vendor/composer/semver/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +### [3.2.6] 2021-10-25 + + * Fixed: type improvements to parseStability + ### [3.2.5] 2021-05-24 * Fixed: issue comparing disjunctive MultiConstraints to conjunctive ones (#127) diff --git a/app/vendor/composer/semver/src/VersionParser.php b/app/vendor/composer/semver/src/VersionParser.php index ee4420ae4..1754a7637 100644 --- a/app/vendor/composer/semver/src/VersionParser.php +++ b/app/vendor/composer/semver/src/VersionParser.php @@ -47,6 +47,7 @@ class VersionParser * @param string $version * * @return string + * @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev' */ public static function parseStability($version) { diff --git a/app/vendor/doctrine/dbal/README.md b/app/vendor/doctrine/dbal/README.md index 43caa5a53..8a1757886 100644 --- a/app/vendor/doctrine/dbal/README.md +++ b/app/vendor/doctrine/dbal/README.md @@ -7,7 +7,7 @@ | [![Code Coverage][Coverage image]][CodeCov 4.0] | [![Code Coverage][Coverage 3.1 image]][CodeCov 3.1] | [![Code Coverage][Coverage 2.13 image]][CodeCov 2.13] | | N/A | [![Code Coverage][TypeCov 3.1 image]][TypeCov 3.1] | N/A | -Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction. +Powerful ***D***ata***B***ase ***A***bstraction ***L***ayer with many features for database schema introspection and schema management. ## More resources: diff --git a/app/vendor/doctrine/dbal/composer.json b/app/vendor/doctrine/dbal/composer.json index 013b6b8dc..2374d79c2 100644 --- a/app/vendor/doctrine/dbal/composer.json +++ b/app/vendor/doctrine/dbal/composer.json @@ -40,14 +40,14 @@ "require-dev": { "doctrine/coding-standard": "9.0.0", "jetbrains/phpstorm-stubs": "2021.1", - "phpstan/phpstan": "0.12.99", - "phpstan/phpstan-strict-rules": "^0.12.11", + "phpstan/phpstan": "1.1.1", + "phpstan/phpstan-strict-rules": "^1", "phpunit/phpunit": "9.5.10", "psalm/plugin-phpunit": "0.16.1", - "squizlabs/php_codesniffer": "3.6.0", + "squizlabs/php_codesniffer": "3.6.1", "symfony/cache": "^5.2|^6.0", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0|^6.0", - "vimeo/psalm": "4.10.0" + "vimeo/psalm": "4.12.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." diff --git a/app/vendor/doctrine/dbal/src/Cache/QueryCacheProfile.php b/app/vendor/doctrine/dbal/src/Cache/QueryCacheProfile.php index 44f5868cf..21bd144dc 100644 --- a/app/vendor/doctrine/dbal/src/Cache/QueryCacheProfile.php +++ b/app/vendor/doctrine/dbal/src/Cache/QueryCacheProfile.php @@ -78,6 +78,10 @@ public function getCacheKey() */ public function generateCacheKeys($sql, $params, $types, array $connectionParams = []) { + if (isset($connectionParams['password'])) { + unset($connectionParams['password']); + } + $realCacheKey = 'query=' . $sql . '¶ms=' . serialize($params) . '&types=' . serialize($types) . diff --git a/app/vendor/doctrine/dbal/src/Connection.php b/app/vendor/doctrine/dbal/src/Connection.php index 466484234..7b3686c6a 100644 --- a/app/vendor/doctrine/dbal/src/Connection.php +++ b/app/vendor/doctrine/dbal/src/Connection.php @@ -1198,7 +1198,7 @@ public function getTransactionNestingLevel() * * @param string|null $name Name of the sequence object from which the ID should be returned. * - * @return string A string representation of the last inserted ID. + * @return string|int|false A string representation of the last inserted ID. * * @throws Exception */ @@ -1674,11 +1674,11 @@ private function _bindTypedValues(DriverStatement $stmt, array $params, array $t * @param mixed $value The value to bind. * @param int|string|Type|null $type The type to bind (PDO or DBAL). * - * @return mixed[] [0] => the (escaped) value, [1] => the binding type. + * @return array{mixed, int} [0] => the (escaped) value, [1] => the binding type. * * @throws Exception */ - private function getBindingInfo($value, $type) + private function getBindingInfo($value, $type): array { if (is_string($type)) { $type = Type::getType($type); @@ -1688,7 +1688,7 @@ private function getBindingInfo($value, $type) $value = $type->convertToDatabaseValue($value, $this->getDatabasePlatform()); $bindingType = $type->getBindingType(); } else { - $bindingType = $type; + $bindingType = $type ?? ParameterType::STRING; } return [$value, $bindingType]; diff --git a/app/vendor/doctrine/dbal/src/Driver/Connection.php b/app/vendor/doctrine/dbal/src/Driver/Connection.php index 73a77730f..9febe72a5 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Connection.php +++ b/app/vendor/doctrine/dbal/src/Driver/Connection.php @@ -46,7 +46,7 @@ public function exec(string $sql): int; * * @param string|null $name * - * @return string + * @return string|int|false * * @throws Exception */ diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php index bec380110..736345362 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php @@ -10,6 +10,7 @@ use Doctrine\DBAL\Driver\Statement as DriverStatement; use Doctrine\DBAL\ParameterType; use mysqli; +use mysqli_sql_exception; use function assert; use function floor; @@ -41,7 +42,7 @@ public function __construct( ?string $database = null, ?int $port = null, ?string $socket = null, - ?int $flags = null, + int $flags = 0, iterable $preInitializers = [], iterable $postInitializers = [] ) { @@ -52,7 +53,13 @@ public function __construct( $initializer->initialize($connection); } - if (! @$connection->real_connect($host, $username, $password, $database, $port, $socket, $flags)) { + try { + $success = @$connection->real_connect($host, $username, $password, $database, $port, $socket, $flags); + } catch (mysqli_sql_exception $e) { + throw ConnectionFailed::upcast($e); + } + + if (! $success) { throw ConnectionFailed::new($connection); } @@ -117,7 +124,13 @@ public function quote($value, $type = ParameterType::STRING) public function exec(string $sql): int { - if ($this->conn->query($sql) === false) { + try { + $result = $this->conn->query($sql); + } catch (mysqli_sql_exception $e) { + throw ConnectionError::upcast($e); + } + + if ($result === false) { throw ConnectionError::new($this->conn); } @@ -147,7 +160,11 @@ public function beginTransaction() */ public function commit() { - return $this->conn->commit(); + try { + return $this->conn->commit(); + } catch (mysqli_sql_exception $e) { + return false; + } } /** @@ -155,6 +172,10 @@ public function commit() */ public function rollBack() { - return $this->conn->rollback(); + try { + return $this->conn->rollback(); + } catch (mysqli_sql_exception $e) { + return false; + } } } diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php index 28897ed3d..d459863d8 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php @@ -29,7 +29,7 @@ public function connect(array $params) $host = $params['host'] ?? null; } - $flags = null; + $flags = 0; $preInitializers = $postInitializers = []; diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php index 25c33f065..ef5b98017 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php @@ -6,6 +6,8 @@ use Doctrine\DBAL\Driver\AbstractException; use mysqli; +use mysqli_sql_exception; +use ReflectionProperty; /** * @internal @@ -18,4 +20,12 @@ public static function new(mysqli $connection): self { return new self($connection->error, $connection->sqlstate, $connection->errno); } + + public static function upcast(mysqli_sql_exception $exception): self + { + $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); + $p->setAccessible(true); + + return new self($exception->getMessage(), $p->getValue($exception), (int) $exception->getCode(), $exception); + } } diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php index 16cab72e5..faceeb086 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php @@ -6,6 +6,8 @@ use Doctrine\DBAL\Driver\AbstractException; use mysqli; +use mysqli_sql_exception; +use ReflectionProperty; /** * @internal @@ -18,4 +20,12 @@ public static function new(mysqli $connection): self { return new self($connection->connect_error, 'HY000', $connection->connect_errno); } + + public static function upcast(mysqli_sql_exception $exception): self + { + $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); + $p->setAccessible(true); + + return new self($exception->getMessage(), $p->getValue($exception), (int) $exception->getCode(), $exception); + } } diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php index 7ac275d96..763b4eb77 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php @@ -6,6 +6,8 @@ use Doctrine\DBAL\Driver\AbstractException; use mysqli; +use mysqli_sql_exception; +use ReflectionProperty; use function sprintf; @@ -24,4 +26,17 @@ public static function fromCharset(mysqli $connection, string $charset): self $connection->errno ); } + + public static function upcast(mysqli_sql_exception $exception, string $charset): self + { + $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); + $p->setAccessible(true); + + return new self( + sprintf('Failed to set charset "%s": %s', $charset, $exception->getMessage()), + $p->getValue($exception), + (int) $exception->getCode(), + $exception + ); + } } diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/StatementError.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/StatementError.php index 70b0db775..78dc8556b 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/StatementError.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/StatementError.php @@ -5,7 +5,9 @@ namespace Doctrine\DBAL\Driver\Mysqli\Exception; use Doctrine\DBAL\Driver\AbstractException; +use mysqli_sql_exception; use mysqli_stmt; +use ReflectionProperty; /** * @internal @@ -18,4 +20,12 @@ public static function new(mysqli_stmt $statement): self { return new self($statement->error, $statement->sqlstate, $statement->errno); } + + public static function upcast(mysqli_sql_exception $exception): self + { + $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); + $p->setAccessible(true); + + return new self($exception->getMessage(), $p->getValue($exception), (int) $exception->getCode(), $exception); + } } diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Charset.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Charset.php index 362c95fe6..b32ecaf91 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Charset.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Charset.php @@ -7,6 +7,7 @@ use Doctrine\DBAL\Driver\Mysqli\Exception\InvalidCharset; use Doctrine\DBAL\Driver\Mysqli\Initializer; use mysqli; +use mysqli_sql_exception; final class Charset implements Initializer { @@ -20,7 +21,13 @@ public function __construct(string $charset) public function initialize(mysqli $connection): void { - if ($connection->set_charset($this->charset)) { + try { + $success = $connection->set_charset($this->charset); + } catch (mysqli_sql_exception $e) { + throw InvalidCharset::upcast($e, $this->charset); + } + + if ($success) { return; } diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php index 11e00f0b2..230471526 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php @@ -8,15 +8,14 @@ use Doctrine\DBAL\Driver\FetchUtils; use Doctrine\DBAL\Driver\Mysqli\Exception\StatementError; use Doctrine\DBAL\Driver\Result as ResultInterface; +use mysqli_sql_exception; use mysqli_stmt; use stdClass; use function array_combine; use function array_fill; use function array_map; -use function assert; use function count; -use function is_array; final class Result implements ResultInterface { @@ -60,7 +59,6 @@ public function __construct(mysqli_stmt $statement) $this->hasColumns = true; $fields = $meta->fetch_fields(); - assert(is_array($fields)); $this->columnNames = array_map(static function (stdClass $field): string { return $field->name; @@ -101,7 +99,11 @@ public function __construct(mysqli_stmt $statement) */ public function fetchNumeric() { - $ret = $this->statement->fetch(); + try { + $ret = $this->statement->fetch(); + } catch (mysqli_sql_exception $e) { + throw StatementError::upcast($e); + } if ($ret === false) { throw StatementError::new($this->statement); diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php index 9f802e112..249cb2c87 100644 --- a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php @@ -12,6 +12,7 @@ use Doctrine\DBAL\Driver\Statement as StatementInterface; use Doctrine\DBAL\ParameterType; use mysqli; +use mysqli_sql_exception; use mysqli_stmt; use function array_fill; @@ -43,7 +44,7 @@ final class Statement implements StatementInterface /** @var mysqli_stmt */ protected $_stmt; - /** @var mixed[]|null */ + /** @var mixed[] */ protected $_bindedValues; /** @var string */ @@ -67,7 +68,11 @@ public function __construct(mysqli $conn, $prepareString) { $this->_conn = $conn; - $stmt = $conn->prepare($prepareString); + try { + $stmt = $conn->prepare($prepareString); + } catch (mysqli_sql_exception $e) { + throw ConnectionError::upcast($e); + } if ($stmt === false) { throw ConnectionError::new($this->_conn); @@ -75,11 +80,7 @@ public function __construct(mysqli $conn, $prepareString) $this->_stmt = $stmt; - $paramCount = $this->_stmt->param_count; - if (0 >= $paramCount) { - return; - } - + $paramCount = $this->_stmt->param_count; $this->types = str_repeat('s', $paramCount); $this->_bindedValues = array_fill(1, $paramCount, null); } @@ -124,17 +125,21 @@ public function bindValue($param, $value, $type = ParameterType::STRING) */ public function execute($params = null): ResultInterface { - if ($this->_bindedValues !== null) { - if ($params !== null) { - if (! $this->bindUntypedValues($params)) { - throw StatementError::new($this->_stmt); - } - } else { - $this->bindTypedParameters(); + if ($params !== null && count($params) > 0) { + if (! $this->bindUntypedValues($params)) { + throw StatementError::new($this->_stmt); } + } elseif (count($this->_bindedValues) > 0) { + $this->bindTypedParameters(); + } + + try { + $result = $this->_stmt->execute(); + } catch (mysqli_sql_exception $e) { + throw StatementError::upcast($e); } - if (! $this->_stmt->execute()) { + if (! $result) { throw StatementError::new($this->_stmt); } diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php index 1bc5c62ce..b05892f96 100644 --- a/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php @@ -78,7 +78,8 @@ public function getServerVersion() throw Error::new($this->dbh); } - assert(preg_match('/\s+(\d+\.\d+\.\d+\.\d+\.\d+)\s+/', $version, $matches) === 1); + $result = preg_match('/\s+(\d+\.\d+\.\d+\.\d+\.\d+)\s+/', $version, $matches); + assert($result === 1); return $matches[1]; } diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php index 1f3afda20..56602a364 100644 --- a/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php @@ -98,9 +98,6 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le if ($type === ParameterType::LARGE_OBJECT) { $lob = oci_new_descriptor($this->_dbh, OCI_D_LOB); - - assert($lob !== false); - $lob->writeTemporary($variable, OCI_TEMP_BLOB); $variable =& $lob; diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php index d2da1625c..2f48874e0 100644 --- a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php @@ -59,7 +59,7 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le break; } - return $this->statement->bindParam($param, $variable, $type, $length, $driverOptions); + return $this->statement->bindParam($param, $variable, $type, $length ?? 0, $driverOptions); } /** diff --git a/app/vendor/doctrine/dbal/src/DriverManager.php b/app/vendor/doctrine/dbal/src/DriverManager.php index 58a0cc579..698e0438d 100644 --- a/app/vendor/doctrine/dbal/src/DriverManager.php +++ b/app/vendor/doctrine/dbal/src/DriverManager.php @@ -11,7 +11,6 @@ use function array_keys; use function array_merge; -use function assert; use function class_implements; use function in_array; use function is_string; @@ -299,8 +298,6 @@ private static function parseDatabaseUrl(array $params): array // (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid $url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localhost/', $params['url']); - assert(is_string($url)); - $url = parse_url($url); if ($url === false) { diff --git a/app/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php b/app/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php index e7f0819b5..f22fab5bc 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php @@ -3365,7 +3365,11 @@ final public function modifyLimitQuery($query, $limit, $offset = 0) )); } - return $this->doModifyLimitQuery($query, $limit, $offset); + if ($limit !== null) { + $limit = (int) $limit; + } + + return $this->doModifyLimitQuery($query, $limit, (int) $offset); } /** diff --git a/app/vendor/doctrine/dbal/src/Platforms/MariaDb1027Platform.php b/app/vendor/doctrine/dbal/src/Platforms/MariaDb1027Platform.php index 9fa84e98d..bb8e0b88d 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/MariaDb1027Platform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/MariaDb1027Platform.php @@ -10,7 +10,7 @@ * * Note: Should not be used with versions prior to 10.2.7. */ -final class MariaDb1027Platform extends MySQLPlatform +class MariaDb1027Platform extends MySQLPlatform { /** * {@inheritdoc} diff --git a/app/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php b/app/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php index 06bc5975e..379616f22 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php @@ -185,7 +185,7 @@ public function getListTableForeignKeysSQL($table, $database = null) } $sql = 'SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, ' . - 'k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ ' . + 'k.`REFERENCED_COLUMN_NAME`, k.`ORDINAL_POSITION` /*!50116 , c.update_rule, c.delete_rule */ ' . 'FROM information_schema.key_column_usage k /*!50116 ' . 'INNER JOIN information_schema.referential_constraints c ON ' . ' c.constraint_name = k.constraint_name AND ' . @@ -195,7 +195,8 @@ public function getListTableForeignKeysSQL($table, $database = null) return $sql . ' AND k.table_schema = ' . $databaseNameSql . ' /*!50116 AND c.constraint_schema = ' . $databaseNameSql . ' */' - . ' AND k.`REFERENCED_COLUMN_NAME` is not NULL'; + . ' AND k.`REFERENCED_COLUMN_NAME` is not NULL' + . ' ORDER BY k.`ORDINAL_POSITION`'; } /** diff --git a/app/vendor/doctrine/dbal/src/Platforms/SQLServer2012Platform.php b/app/vendor/doctrine/dbal/src/Platforms/SQLServer2012Platform.php index d94784d6c..4db8f055c 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/SQLServer2012Platform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/SQLServer2012Platform.php @@ -1010,7 +1010,8 @@ public function getListTableForeignKeysSQL($table, $database = null) INNER JOIN sys.objects AS o ON o.OBJECT_ID = fc.referenced_object_id ON f.OBJECT_ID = fc.constraint_object_id WHERE ' . - $this->getTableWhereClause($table, 'SCHEMA_NAME (f.schema_id)', 'OBJECT_NAME (f.parent_object_id)'); + $this->getTableWhereClause($table, 'SCHEMA_NAME (f.schema_id)', 'OBJECT_NAME (f.parent_object_id)') . + ' ORDER BY fc.constraint_column_id'; } /** @@ -1146,9 +1147,7 @@ public function getTrimExpression($str, $mode = TrimMode::UNSPECIFIED, $char = f */ public function getConcatExpression() { - $args = func_get_args(); - - return '(' . implode(' + ', $args) . ')'; + return sprintf('CONCAT(%s)', implode(', ', func_get_args())); } /** diff --git a/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php b/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php index 5dc1747cc..168182610 100644 --- a/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php +++ b/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php @@ -920,7 +920,8 @@ public function getAlterTableSQL(TableDiff $diff) continue; } - $columns = $this->replaceColumn($diff->name, $columns, $oldColumnName, $column); + $oldColumnName = strtolower($oldColumnName); + $columns = $this->replaceColumn($diff->name, $columns, $oldColumnName, $column); if (! isset($newColumnNames[$oldColumnName])) { continue; @@ -934,7 +935,8 @@ public function getAlterTableSQL(TableDiff $diff) continue; } - $columns = $this->replaceColumn($diff->name, $columns, $oldColumnName, $columnDiff->column); + $oldColumnName = strtolower($oldColumnName); + $columns = $this->replaceColumn($diff->name, $columns, $oldColumnName, $columnDiff->column); if (! isset($newColumnNames[$oldColumnName])) { continue; @@ -1016,7 +1018,7 @@ public function getAlterTableSQL(TableDiff $diff) private function replaceColumn($tableName, array $columns, $columnName, Column $column): array { $keys = array_keys($columns); - $index = array_search(strtolower($columnName), $keys, true); + $index = array_search($columnName, $keys, true); if ($index === false) { throw SchemaException::columnDoesNotExist($columnName, $tableName); diff --git a/app/vendor/doctrine/dbal/src/Query/QueryBuilder.php b/app/vendor/doctrine/dbal/src/Query/QueryBuilder.php index 246cde1a6..6d74d0105 100644 --- a/app/vendor/doctrine/dbal/src/Query/QueryBuilder.php +++ b/app/vendor/doctrine/dbal/src/Query/QueryBuilder.php @@ -405,7 +405,7 @@ public function getSQL() * ->select('u') * ->from('users', 'u') * ->where('u.id = :user_id') - * ->setParameter(':user_id', 1); + * ->setParameter('user_id', 1); * * * @param int|string $key Parameter position or name @@ -434,8 +434,8 @@ public function setParameter($key, $value, $type = null) * ->from('users', 'u') * ->where('u.id = :user_id1 OR u.id = :user_id2') * ->setParameters(array( - * ':user_id1' => 1, - * ':user_id2' => 2 + * 'user_id1' => 1, + * 'user_id2' => 2 * )); * * diff --git a/app/vendor/doctrine/dbal/src/SQL/Parser.php b/app/vendor/doctrine/dbal/src/SQL/Parser.php index 32d306ca0..f1ad6617f 100644 --- a/app/vendor/doctrine/dbal/src/SQL/Parser.php +++ b/app/vendor/doctrine/dbal/src/SQL/Parser.php @@ -2,6 +2,8 @@ namespace Doctrine\DBAL\SQL; +use Doctrine\DBAL\SQL\Parser\Exception; +use Doctrine\DBAL\SQL\Parser\Exception\RegularExpressionError; use Doctrine\DBAL\SQL\Parser\Visitor; use function array_merge; @@ -10,11 +12,14 @@ use function implode; use function key; use function next; +use function preg_last_error; use function preg_match; use function reset; use function sprintf; use function strlen; +use const PREG_NO_ERROR; + /** * The SQL parser that focuses on identifying prepared statement parameters. It implements parsing other tokens like * string literals and comments only as a way to not confuse their contents with the the parameter placeholders. @@ -27,17 +32,17 @@ */ final class Parser { - private const ANY = '.'; - private const SPECIAL = '[:\?\'"`\\[\\-\\/]'; + private const SPECIAL_CHARS = ':\?\'"`\\[\\-\\/'; private const BACKTICK_IDENTIFIER = '`[^`]*`'; private const BRACKET_IDENTIFIER = '(?determineExistingSchemaSearchPaths(); } + assert($this->existingSchemaPaths !== null); + return $this->existingSchemaPaths; } @@ -345,16 +346,22 @@ protected function _getPortableTableColumnDefinition($tableColumn) $matches = []; $autoincrement = false; - if (preg_match("/^nextval\('(.*)'(::.*)?\)$/", $tableColumn['default'], $matches) === 1) { + + if ( + $tableColumn['default'] !== null + && preg_match("/^nextval\('(.*)'(::.*)?\)$/", $tableColumn['default'], $matches) === 1 + ) { $tableColumn['sequence'] = $matches[1]; $tableColumn['default'] = null; $autoincrement = true; } - if (preg_match("/^['(](.*)[')]::/", $tableColumn['default'], $matches) === 1) { - $tableColumn['default'] = $matches[1]; - } elseif (preg_match('/^NULL::/', $tableColumn['default']) === 1) { - $tableColumn['default'] = null; + if ($tableColumn['default'] !== null) { + if (preg_match("/^['(](.*)[')]::/", $tableColumn['default'], $matches) === 1) { + $tableColumn['default'] = $matches[1]; + } elseif (preg_match('/^NULL::/', $tableColumn['default']) === 1) { + $tableColumn['default'] = null; + } } $length = $tableColumn['length'] ?? null; @@ -378,7 +385,8 @@ protected function _getPortableTableColumnDefinition($tableColumn) $dbType = strtolower($tableColumn['type']); if ( - strlen($tableColumn['domain_type']) > 0 + $tableColumn['domain_type'] !== null + && $tableColumn['domain_type'] !== '' && ! $this->_platform->hasDoctrineTypeMappingFor($tableColumn['type']) ) { $dbType = strtolower($tableColumn['domain_type']); @@ -518,7 +526,7 @@ protected function _getPortableTableColumnDefinition($tableColumn) */ private function fixVersion94NegativeNumericDefaultValue($defaultValue) { - if (strpos($defaultValue, '(') === 0) { + if ($defaultValue !== null && strpos($defaultValue, '(') === 0) { return trim($defaultValue, '()'); } diff --git a/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php index a448dd147..f1836fc52 100644 --- a/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php +++ b/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php @@ -6,7 +6,6 @@ use Doctrine\DBAL\Platforms\SQLServer2012Platform; use Doctrine\DBAL\Types\Type; use Doctrine\Deprecations\Deprecation; -use PDOException; use function assert; use function count; @@ -254,12 +253,6 @@ public function listTableIndexes($table) try { $tableIndexes = $this->_conn->fetchAllAssociative($sql); - } catch (PDOException $e) { - if ($e->getCode() === 'IMSSP') { - return []; - } - - throw $e; } catch (Exception $e) { if (strpos($e->getMessage(), 'SQLSTATE [01000, 15472]') === 0) { return []; diff --git a/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php b/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php index 8cff50f95..86a2842cb 100644 --- a/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php +++ b/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php @@ -133,6 +133,8 @@ protected function configure() /** * {@inheritdoc} * + * @return int + * * @throws Exception */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php b/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php index 4ccb32605..875f2a20b 100644 --- a/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php +++ b/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php @@ -59,6 +59,8 @@ protected function configure() /** * {@inheritdoc} * + * @return int + * * @throws Exception */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/league/container/.github/FUNDING.yml b/app/vendor/league/container/.github/FUNDING.yml deleted file mode 100644 index 3b7dd88ba..000000000 --- a/app/vendor/league/container/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: [philipobenito] diff --git a/app/vendor/league/container/.github/workflows/test.yml b/app/vendor/league/container/.github/workflows/test.yml deleted file mode 100644 index 109efc843..000000000 --- a/app/vendor/league/container/.github/workflows/test.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Tests - -on: - push: ~ - pull_request: ~ - -jobs: - phpcs: - name: PHPCS - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - uses: shivammathur/setup-php@v2 - with: - php-version: 7.2 - extensions: curl, mbstring - coverage: none - tools: composer:v2, cs2pr - - - run: composer update --no-progress - - run: vendor/bin/phpcs -q --report=checkstyle | cs2pr - - phpunit: - name: PHPUnit on ${{ matrix.php }} ${{ matrix.composer-flags }} - runs-on: ubuntu-latest - strategy: - matrix: - php: ['7.2', '7.3', '7.4'] - coverage: [true] - composer-flags: [''] - include: - - php: '8.0' - coverage: false - - php: '7.2' - coverage: false - composer-flags: '--prefer-lowest' - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, mbstring - coverage: pcov - tools: composer:v2 - - - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: "Use PHPUnit 9.3+ on PHP 8" - run: composer require --no-update --dev phpunit/phpunit:^9.3 - if: "matrix.php == '8.0'" - - - run: composer update --no-progress ${{ matrix.composer-flags }} - - - run: vendor/bin/phpunit --no-coverage - if: ${{ !matrix.coverage }} - - - run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - if: ${{ matrix.coverage }} - - - run: php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover - if: ${{ matrix.coverage }} - - phpstan: - name: PHPStan - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - uses: shivammathur/setup-php@v2 - with: - php-version: 7.2 - extensions: curl, mbstring - coverage: none - tools: composer:v2 - - - run: composer update --no-progress - - run: vendor/bin/phpstan analyse --no-progress diff --git a/app/vendor/league/container/CHANGELOG.md b/app/vendor/league/container/CHANGELOG.md index 08d3c4486..2362089c2 100644 --- a/app/vendor/league/container/CHANGELOG.md +++ b/app/vendor/league/container/CHANGELOG.md @@ -2,6 +2,11 @@ All Notable changes to `League\Container` will be documented in this file +## 4.2.0 + +### Added +- Support for psr/container 1.1.0. + ## 4.1.2 ### Fixed diff --git a/app/vendor/league/container/composer.json b/app/vendor/league/container/composer.json index 5165ccecf..423d3b197 100644 --- a/app/vendor/league/container/composer.json +++ b/app/vendor/league/container/composer.json @@ -21,7 +21,7 @@ ], "require": { "php": "^7.2 || ^8.0", - "psr/container": "^2.0.0" + "psr/container": "^1.1 || ^2.0" }, "require-dev": { "nette/php-generator": "^3.4", diff --git a/app/vendor/league/container/phpcs.xml b/app/vendor/league/container/phpcs.xml deleted file mode 100644 index d67debb04..000000000 --- a/app/vendor/league/container/phpcs.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - src - tests - - - diff --git a/app/vendor/league/container/phpstan.neon b/app/vendor/league/container/phpstan.neon deleted file mode 100644 index 91e645304..000000000 --- a/app/vendor/league/container/phpstan.neon +++ /dev/null @@ -1,4 +0,0 @@ -parameters: - level: 5 - paths: - - src diff --git a/app/vendor/league/container/phpunit.xml b/app/vendor/league/container/phpunit.xml deleted file mode 100644 index 1f0d1c034..000000000 --- a/app/vendor/league/container/phpunit.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - tests - - - - - src/ - - - - - - - - - - diff --git a/app/vendor/nikic/php-parser/.editorconfig b/app/vendor/nikic/php-parser/.editorconfig deleted file mode 100644 index 9c76d0708..000000000 --- a/app/vendor/nikic/php-parser/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*.y] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = space -indent_size = 4 diff --git a/app/vendor/nikic/php-parser/grammar/php7.y b/app/vendor/nikic/php-parser/grammar/php7.y index ef0f271c6..eac68d095 100644 --- a/app/vendor/nikic/php-parser/grammar/php7.y +++ b/app/vendor/nikic/php-parser/grammar/php7.y @@ -41,12 +41,12 @@ semi_reserved: | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC | T_READONLY ; -identifier_ex: +identifier_maybe_reserved: T_STRING { $$ = Node\Identifier[$1]; } | semi_reserved { $$ = Node\Identifier[$1]; } ; -identifier: +identifier_not_reserved: T_STRING { $$ = Node\Identifier[$1]; } ; @@ -181,14 +181,14 @@ non_empty_inline_use_declarations: unprefixed_use_declaration: namespace_name { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | namespace_name T_AS identifier + | namespace_name T_AS identifier_not_reserved { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } ; use_declaration: legacy_namespace_name { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | legacy_namespace_name T_AS identifier + | legacy_namespace_name T_AS identifier_not_reserved { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } ; @@ -208,7 +208,7 @@ non_empty_constant_declaration_list: ; constant_declaration: - identifier '=' expr { $$ = Node\Const_[$1, $3]; } + identifier_not_reserved '=' expr { $$ = Node\Const_[$1, $3]; } ; class_const_list: @@ -221,7 +221,7 @@ non_empty_class_const_list: ; class_const: - identifier_ex '=' expr { $$ = Node\Const_[$1, $3]; } + identifier_maybe_reserved '=' expr { $$ = Node\Const_[$1, $3]; } ; inner_statement_list_ex: @@ -289,8 +289,8 @@ non_empty_statement: | T_DECLARE '(' declare_list ')' declare_statement { $$ = Stmt\Declare_[$3, $5]; } | T_TRY '{' inner_statement_list '}' catches optional_finally { $$ = Stmt\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); } - | T_GOTO identifier semi { $$ = Stmt\Goto_[$2]; } - | identifier ':' { $$ = Stmt\Label[$1]; } + | T_GOTO identifier_not_reserved semi { $$ = Stmt\Goto_[$2]; } + | identifier_not_reserved ':' { $$ = Stmt\Label[$1]; } | error { $$ = array(); /* means: no statement */ } ; @@ -351,22 +351,22 @@ block_or_error: ; function_declaration_statement: - T_FUNCTION optional_ref identifier '(' parameter_list ')' optional_return_type block_or_error + T_FUNCTION optional_ref identifier_not_reserved '(' parameter_list ')' optional_return_type block_or_error { $$ = Stmt\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; } - | attributes T_FUNCTION optional_ref identifier '(' parameter_list ')' optional_return_type block_or_error + | attributes T_FUNCTION optional_ref identifier_not_reserved '(' parameter_list ')' optional_return_type block_or_error { $$ = Stmt\Function_[$4, ['byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; } ; class_declaration_statement: - optional_attributes class_entry_type identifier extends_from implements_list '{' class_statement_list '}' + optional_attributes class_entry_type identifier_not_reserved extends_from implements_list '{' class_statement_list '}' { $$ = Stmt\Class_[$3, ['type' => $2, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; $this->checkClass($$, #3); } - | optional_attributes T_INTERFACE identifier interface_extends_list '{' class_statement_list '}' + | optional_attributes T_INTERFACE identifier_not_reserved interface_extends_list '{' class_statement_list '}' { $$ = Stmt\Interface_[$3, ['extends' => $4, 'stmts' => $6, 'attrGroups' => $1]]; $this->checkInterface($$, #3); } - | optional_attributes T_TRAIT identifier '{' class_statement_list '}' + | optional_attributes T_TRAIT identifier_not_reserved '{' class_statement_list '}' { $$ = Stmt\Trait_[$3, ['stmts' => $5, 'attrGroups' => $1]]; } - | optional_attributes T_ENUM identifier enum_scalar_type implements_list '{' class_statement_list '}' + | optional_attributes T_ENUM identifier_not_reserved enum_scalar_type implements_list '{' class_statement_list '}' { $$ = Stmt\Enum_[$3, ['scalarType' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; $this->checkEnum($$, #3); } ; @@ -436,7 +436,7 @@ non_empty_declare_list: ; declare_list_element: - identifier '=' expr { $$ = Stmt\DeclareDeclare[$1, $3]; } + identifier_not_reserved '=' expr { $$ = Stmt\DeclareDeclare[$1, $3]; } ; switch_case_list: @@ -635,7 +635,7 @@ argument: expr { $$ = Node\Arg[$1, false, false]; } | ampersand variable { $$ = Node\Arg[$2, true, false]; } | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } - | identifier_ex ':' expr + | identifier_maybe_reserved ':' expr { $$ = new Node\Arg($3, false, false, attributes(), $1); } ; @@ -684,11 +684,12 @@ class_statement: | optional_attributes method_modifiers T_CONST class_const_list semi { $$ = new Stmt\ClassConst($4, $2, attributes(), $1); $this->checkClassConst($$, #2); } - | optional_attributes method_modifiers T_FUNCTION optional_ref identifier_ex '(' parameter_list ')' optional_return_type method_body + | optional_attributes method_modifiers T_FUNCTION optional_ref identifier_maybe_reserved '(' parameter_list ')' + optional_return_type method_body { $$ = Stmt\ClassMethod[$5, ['type' => $2, 'byRef' => $4, 'params' => $7, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; $this->checkClassMethod($$, #2); } | T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; } - | optional_attributes T_CASE identifier enum_case_expr semi + | optional_attributes T_CASE identifier_maybe_reserved enum_case_expr semi { $$ = Stmt\EnumCase[$3, $4, $1]; } | error { $$ = null; /* will be skipped */ } ; @@ -706,22 +707,22 @@ trait_adaptation_list: trait_adaptation: trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';' { $$ = Stmt\TraitUseAdaptation\Precedence[$1[0], $1[1], $3]; } - | trait_method_reference T_AS member_modifier identifier_ex ';' + | trait_method_reference T_AS member_modifier identifier_maybe_reserved ';' { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, $4]; } | trait_method_reference T_AS member_modifier ';' { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, null]; } - | trait_method_reference T_AS identifier ';' + | trait_method_reference T_AS identifier_not_reserved ';' { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } | trait_method_reference T_AS reserved_non_modifiers_identifier ';' { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } ; trait_method_reference_fully_qualified: - name T_PAAMAYIM_NEKUDOTAYIM identifier_ex { $$ = array($1, $3); } + name T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved { $$ = array($1, $3); } ; trait_method_reference: trait_method_reference_fully_qualified { $$ = $1; } - | identifier_ex { $$ = array(null, $1); } + | identifier_maybe_reserved { $$ = array(null, $1); } ; method_body: @@ -994,7 +995,7 @@ constant: ; class_constant: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex + class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved { $$ = Expr\ClassConstFetch[$1, $3]; } /* We interpret an isolated FOO:: as an unfinished class constant fetch. It could also be an unfinished static property fetch or unfinished scoped call. */ @@ -1113,13 +1114,13 @@ new_variable: ; member_name: - identifier_ex { $$ = $1; } + identifier_maybe_reserved { $$ = $1; } | '{' expr '}' { $$ = $2; } | simple_variable { $$ = $1; } ; property_name: - identifier { $$ = $1; } + identifier_not_reserved { $$ = $1; } | '{' expr '}' { $$ = $2; } | simple_variable { $$ = $1; } | error { $$ = Expr\Error[]; $this->errorState = 2; } @@ -1174,8 +1175,10 @@ encaps_str_varname: encaps_var: plain_variable { $$ = $1; } | plain_variable '[' encaps_var_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable T_OBJECT_OPERATOR identifier { $$ = Expr\PropertyFetch[$1, $3]; } - | plain_variable T_NULLSAFE_OBJECT_OPERATOR identifier { $$ = Expr\NullsafePropertyFetch[$1, $3]; } + | plain_variable T_OBJECT_OPERATOR identifier_not_reserved + { $$ = Expr\PropertyFetch[$1, $3]; } + | plain_variable T_NULLSAFE_OBJECT_OPERATOR identifier_not_reserved + { $$ = Expr\NullsafePropertyFetch[$1, $3]; } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Expr\Variable[$2]; } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = Expr\Variable[$2]; } | T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}' diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php b/app/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php index 7f02e6f24..7131c3d25 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php @@ -2,6 +2,7 @@ namespace PhpParser; +use function array_merge; use PhpParser\Node\Expr; use PhpParser\Node\Scalar; @@ -150,6 +151,8 @@ private function evaluateArray(Expr\Array_ $expr) { foreach ($expr->items as $item) { if (null !== $item->key) { $array[$this->evaluate($item->key)] = $this->evaluate($item->value); + } elseif ($item->unpack) { + $array = array_merge($array, $this->evaluate($item->value)); } else { $array[] = $this->evaluate($item->value); } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php index 2eb8213a3..c273fb7ee 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php @@ -42,7 +42,7 @@ public function __construct(array $subNodes = [], array $attributes = []) { $this->params = $subNodes['params'] ?? []; $returnType = $subNodes['returnType'] ?? null; $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; - $this->expr = $subNodes['expr'] ?? null; + $this->expr = $subNodes['expr']; $this->attrGroups = $subNodes['attrGroups'] ?? []; } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php index 32a3fef4f..7a0854b30 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php @@ -19,14 +19,14 @@ class Php7 extends \PhpParser\ParserAbstract { protected $tokenToSymbolMapSize = 396; protected $actionTableSize = 1196; - protected $gotoTableSize = 585; + protected $gotoTableSize = 545; protected $invalidSymbol = 168; protected $errorSymbol = 1; protected $defaultAction = -32766; protected $unexpectedTokenRule = 32767; - protected $YY2TBLSTATE = 419; + protected $YY2TBLSTATE = 420; protected $numNonLeafStates = 710; protected $symbolToName = array( @@ -244,125 +244,125 @@ class Php7 extends \PhpParser\ParserAbstract ); protected $action = array( - 131, 132, 133, 569, 134, 135, 0, 722, 723, 724, - 136, 36, 834, 911, 835, 468,-32766,-32766,-32766,-32767, - -32767,-32767,-32767, 100, 101, 102, 103, 104, 1068, 1069, + 132, 133, 134, 569, 135, 136, 0, 722, 723, 724, + 137, 37, 834, 911, 835, 469,-32766,-32766,-32766,-32767, + -32767,-32767,-32767, 101, 102, 103, 104, 105, 1068, 1069, 1070, 1067, 1066, 1065, 1071, 716, 715,-32766,-32766,-32766, -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, -32767, 545, 546,-32766,-32766, 725,-32766,-32766,-32766, 998, - 999, 806, 922, 446, 447, 448, 369, 370, 2, 266, - 137, 395, 729, 730, 731, 732, 413,-32766, 419,-32766, + 999, 806, 922, 447, 448, 449, 370, 371, 2, 267, + 138, 396, 729, 730, 731, 732, 414,-32766, 420,-32766, -32766,-32766,-32766,-32766, 990, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 763, 570, 764, 765, - 766, 767, 755, 756, 335, 336, 758, 759, 744, 745, - 746, 748, 749, 750, 345, 790, 791, 792, 793, 794, + 766, 767, 755, 756, 336, 337, 758, 759, 744, 745, + 746, 748, 749, 750, 346, 790, 791, 792, 793, 794, 795, 751, 752, 571, 572, 784, 775, 773, 774, 787, - 770, 771, 282, 419, 573, 574, 769, 575, 576, 577, - 578, 579, 580, 598, -575, 469, 491, 798, 772, 581, - 582, -575, 138,-32766,-32766,-32766, 131, 132, 133, 569, - 134, 135, 1017, 722, 723, 724, 136, 36, 1060,-32766, + 770, 771, 283, 420, 573, 574, 769, 575, 576, 577, + 578, 579, 580, 598, -575, 470, 14, 798, 772, 581, + 582, -575, 139,-32766,-32766,-32766, 132, 133, 134, 569, + 135, 136, 1017, 722, 723, 724, 137, 37, 1060,-32766, -32766,-32766, 1303, 696,-32766, 1304,-32766,-32766,-32766,-32766, -32766,-32766,-32766, 1068, 1069, 1070, 1067, 1066, 1065, 1071, - -32766, 716, 715, 371, 370, 1258,-32766,-32766,-32766, -572, - 105, 106, 107, 413, 269, 891, -572, 239, 1193, 1192, - 1194, 725,-32766,-32766,-32766, 1046, 108,-32766,-32766,-32766, - -32766, 986, 985, 984, 987, 266, 137, 395, 729, 730, - 731, 732, 12,-32766, 419,-32766,-32766,-32766,-32766, 998, + -32766, 716, 715, 372, 371, 1258,-32766,-32766,-32766, -572, + 106, 107, 108, 414, 270, 891, -572, 240, 1193, 1192, + 1194, 725,-32766,-32766,-32766, 1046, 109,-32766,-32766,-32766, + -32766, 986, 985, 984, 987, 267, 138, 396, 729, 730, + 731, 732, 12,-32766, 420,-32766,-32766,-32766,-32766, 998, 999, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 763, 570, 764, 765, 766, 767, 755, 756, - 335, 336, 758, 759, 744, 745, 746, 748, 749, 750, - 345, 790, 791, 792, 793, 794, 795, 751, 752, 571, - 572, 784, 775, 773, 774, 787, 770, 771, 881, 320, + 336, 337, 758, 759, 744, 745, 746, 748, 749, 750, + 346, 790, 791, 792, 793, 794, 795, 751, 752, 571, + 572, 784, 775, 773, 774, 787, 770, 771, 881, 321, 573, 574, 769, 575, 576, 577, 578, 579, 580,-32766, - 81, 82, 83, -575, 772, 581, 582, -575, 147, 747, + 82, 83, 84, -575, 772, 581, 582, -575, 148, 747, 717, 718, 719, 720, 721, 1278, 722, 723, 724, 760, - 761, 35, 1277, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 996, 269, 149, - -32766,-32766,-32766, 454, 455, 80, 33, -264, -572, 1016, - 108, 319, -572, 893, 725, 682, 803, 127, 998, 999, - 592,-32766, 1044,-32766,-32766,-32766, 809, 150, 726, 727, - 728, 729, 730, 731, 732, -88, 1198, 796, 277, -526, - 282,-32766,-32766,-32766, 733, 734, 735, 736, 737, 738, + 761, 36, 1277, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 996, 270, 150, + -32766,-32766,-32766, 455, 456, 81, 34, -264, -572, 1016, + 109, 320, -572, 893, 725, 682, 803, 128, 998, 999, + 592,-32766, 1044,-32766,-32766,-32766, 809, 151, 726, 727, + 728, 729, 730, 731, 732, -88, 1198, 796, 278, -526, + 283,-32766,-32766,-32766, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 763, 786, 764, 765, 766, 767, 755, 756, 757, 785, 758, 759, 744, 745, 746, 748, 749, 750, 789, 790, 791, 792, 793, 794, 795, 751, 752, 753, 754, 784, 775, 773, 774, 787, 770, - 771, 143, 804, 762, 768, 769, 776, 777, 779, 778, + 771, 144, 804, 762, 768, 769, 776, 777, 779, 778, 780, 781, -314, -526, -526, -193, -192, 772, 783, 782, - 48, 49, 50, 500, 51, 52, 238, 807, -526, -86, - 53, 54, -111, 55, 996, 252,-32766, -111, 800, -111, - -526, 541, -532, -352, 299, -352, 303, -111, -111, -111, - -111, -111, -111, -111, -111, 998, 999, 998, 999, 152, - -32766,-32766,-32766, 1191, 807, 125, 305, 1293, 56, 57, - 102, 103, 104, -111, 58, 1218, 59, 245, 246, 60, - 61, 62, 63, 64, 65, 66, 67, -525, 26, 267, - 68, 435, 501, -328, 808, -86, 1224, 1225, 502, 1189, - 807, 1198, 1230, 292, 1222, 40, 23, 503, 73, 504, - 953, 505, 319, 506, 802, 153, 507, 508, 278, 684, - 279, 42, 43, 436, 366, 365, 891, 44, 509, 34, - 248, -16, -566, 357, 331, 317, -566, 1198, 1193, 1192, - 1194, -527, 510, 511, 512, 332, -524, 1274, 47, 716, - 715, -525, -525, 333, 513, 514, 807, 1212, 1213, 1214, - 1215, 1209, 1210, 291, 359, 283, -525, 284, -314, 1216, - 1211, -193, -192, 1193, 1192, 1194, 292, 891, -525, 363, - -531, 69, 807, 315, 316, 319, 30, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - -153, -153, -153, 638, 24, -527, -527, 687, 378, 881, - -524, -524, 295, 296, 891, -153, 431, -153, 807, -153, - -527, -153, 716, 715, 432, -524, 798, 362, -111, 1105, - 1107, 364, -527, 433, 891, 139, 434, -524, 954, 126, - -524, 319, -111, -111, 688, 813, 380, -529, 11, 834, - 154, 835, 867, -111, -111, -111, -111, 46, 292,-32766, - 881, 654, 655, 73, 689, 1191, 1045, 319, 708, 148, - 398, 156,-32766,-32766,-32766, 31,-32766, -79,-32766, 122, + 49, 50, 51, 500, 52, 53, 239, 807, -526, -86, + 54, 55, -111, 56, 996, 253,-32766, -111, 800, -111, + -526, 541, -532, -352, 300, -352, 304, -111, -111, -111, + -111, -111, -111, -111, -111, 998, 999, 998, 999, 153, + -32766,-32766,-32766, 1191, 807, 126, 306, 1293, 57, 58, + 103, 104, 105, -111, 59, 1218, 60, 246, 247, 61, + 62, 63, 64, 65, 66, 67, 68, -525, 27, 268, + 69, 436, 501, -328, 808, -86, 1224, 1225, 502, 1189, + 807, 1198, 1230, 293, 1222, 41, 24, 503, 74, 504, + 953, 505, 320, 506, 802, 154, 507, 508, 279, 684, + 280, 43, 44, 437, 367, 366, 891, 45, 509, 35, + 249, -16, -566, 358, 332, 318, -566, 1198, 1193, 1192, + 1194, -527, 510, 511, 512, 333, -524, 1274, 48, 716, + 715, -525, -525, 334, 513, 514, 807, 1212, 1213, 1214, + 1215, 1209, 1210, 292, 360, 284, -525, 285, -314, 1216, + 1211, -193, -192, 1193, 1192, 1194, 293, 891, -525, 364, + -531, 70, 807, 316, 317, 320, 31, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + -153, -153, -153, 638, 25, -527, -527, 687, 379, 881, + -524, -524, 296, 297, 891, -153, 432, -153, 807, -153, + -527, -153, 716, 715, 433, -524, 798, 363, -111, 1105, + 1107, 365, -527, 434, 891, 140, 435, -524, 954, 127, + -524, 320, -111, -111, 688, 813, 381, -529, 11, 834, + 155, 835, 867, -111, -111, -111, -111, 47, 293,-32766, + 881, 654, 655, 74, 689, 1191, 1045, 320, 708, 149, + 399, 157,-32766,-32766,-32766, 32,-32766, -79,-32766, 123, -32766, 716, 715,-32766, 893, 891, 682, -153,-32766,-32766, - -32766, 716, 715, 891,-32766,-32766, 123, 881, 128, 73, - -32766, 410, 129, 319, -524, -524, 142, 140, -75,-32766, - 157, -529, -529, 319, 26, 691, 158, 881, 159, -524, - 160, 293, 294, 698, 367, 368, 807, -73,-32766, -72, - 1222, -524, 372, 373, 1191, 893, -71, 682, -529, 72, - -70,-32766,-32766,-32766, -69,-32766, -68,-32766, 124,-32766, + -32766, 716, 715, 891,-32766,-32766, 124, 881, 129, 74, + -32766, 411, 130, 320, -524, -524, 143, 141, -75,-32766, + 158, -529, -529, 320, 27, 691, 159, 881, 160, -524, + 161, 294, 295, 698, 368, 369, 807, -73,-32766, -72, + 1222, -524, 373, 374, 1191, 893, -71, 682, -529, 73, + -70,-32766,-32766,-32766, -69,-32766, -68,-32766, 125,-32766, 630, 631,-32766, -67, -66, -47, -51,-32766,-32766,-32766, - -18, 146, 270,-32766,-32766, 276, 697, 700, 881,-32766, - 410, 890, 893, 145, 682, 281, 881, 907,-32766, 280, - 513, 514, 285, 1212, 1213, 1214, 1215, 1209, 1210, 325, - 130, 144, 939, 286, 682, 1216, 1211, 108, 269,-32766, - 798, 807,-32766, 662, 639, 1191, 657, 71, 675, 1075, - 316, 319,-32766,-32766,-32766, 1305,-32766, 300,-32766, 628, - -32766, 430, 543,-32766,-32766, 923, 555, 924,-32766,-32766, + -18, 147, 271,-32766,-32766, 277, 697, 700, 881,-32766, + 411, 890, 893, 146, 682, 282, 881, 907,-32766, 281, + 513, 514, 286, 1212, 1213, 1214, 1215, 1209, 1210, 326, + 131, 145, 939, 287, 682, 1216, 1211, 109, 270,-32766, + 798, 807,-32766, 662, 639, 1191, 657, 72, 675, 1075, + 317, 320,-32766,-32766,-32766, 1305,-32766, 301,-32766, 628, + -32766, 431, 543,-32766,-32766, 923, 555, 924,-32766,-32766, -32766, 1229, 549,-32766,-32766,-32766, -4, 891, -490, 1191, - -32766, 410, 644, 893, 298, 682,-32766,-32766,-32766,-32766, - -32766, 893,-32766, 682,-32766, 13, 1231,-32766, 451, 479, + -32766, 411, 644, 893, 299, 682,-32766,-32766,-32766,-32766, + -32766, 893,-32766, 682,-32766, 13, 1231,-32766, 452, 480, 645, 909,-32766,-32766,-32766,-32766, 658, -480,-32766,-32766, - 0, 1191, 0, 0,-32766, 410, 0, 297,-32766,-32766, - -32766, 304,-32766,-32766,-32766, 0,-32766, 0, 806,-32766, - 0, 0, 0, 474,-32766,-32766,-32766,-32766, 0, 7, - -32766,-32766, 15, 1191, 561, 596,-32766, 410, 1219, 891, - -32766,-32766,-32766, 361,-32766,-32766,-32766, 818,-32766, -267, - 881,-32766, 38, 292, 0, 0,-32766,-32766,-32766, 39, - 705, 706,-32766,-32766, 872, 963, 940, 947,-32766, 410, - 937, 948, 364, 870, 426, 891, 935,-32766, 1049, 290, + 0, 1191, 0, 0,-32766, 411, 0, 298,-32766,-32766, + -32766, 305,-32766,-32766,-32766, 0,-32766, 0, 806,-32766, + 0, 0, 0, 475,-32766,-32766,-32766,-32766, 0, 7, + -32766,-32766, 16, 1191, 561, 596,-32766, 411, 1219, 891, + -32766,-32766,-32766, 362,-32766,-32766,-32766, 818,-32766, -267, + 881,-32766, 39, 293, 0, 0,-32766,-32766,-32766, 40, + 705, 706,-32766,-32766, 872, 963, 940, 947,-32766, 411, + 937, 948, 365, 870, 427, 891, 935,-32766, 1049, 291, 1244, 1052, 1053, -111, -111, 1050, 1051, 1057, -560, 1262, - 1296, 633, 0, 826, -111, -111, -111, -111, 32, 314, - -32766, 360, 683, 686, 690, 692, 1191, 693, 694, 695, - 699, 685, 319,-32766,-32766,-32766, 9,-32766, 702,-32766, + 1296, 633, 0, 826, -111, -111, -111, -111, 33, 315, + -32766, 361, 683, 686, 690, 692, 1191, 693, 694, 695, + 699, 685, 320,-32766,-32766,-32766, 9,-32766, 702,-32766, 868,-32766, 881, 1300,-32766, 893, 1302, 682, -4,-32766, -32766,-32766, 829, 828, 837,-32766,-32766, 916, -242, -242, - -242,-32766, 410, 955, 364, 26, 836, 1301, 915, 917, + -242,-32766, 411, 955, 365, 27, 836, 1301, 915, 917, -32766, 914, 1177, 900, 910, -111, -111, 807, 881, 898, 945, 1222, 946, 1299, 1256, 867, -111, -111, -111, -111, 1245, 1263, 1269, 1272, -241, -241, -241, -558, -532, -531, - 364, -530, 1, 27, 28, 37, 41, 45, 70, 0, - 74, -111, -111, 75, 76, 77, 78, 893, 79, 682, - -242, 867, -111, -111, -111, -111, 141, 151, 155, 244, - 321, 346, 514, 347, 1212, 1213, 1214, 1215, 1209, 1210, - 348, 349, 350, 351, 352, 353, 1216, 1211, 354, 355, - 356, 358, 427, 893, -265, 682, -241, -264, 71, 0, - 17, 316, 319, 18, 19, 20, 22, 397, 470, 471, - 478, 481, 482, 483, 484, 488, 489, 490, 498, 669, - 1202, 1145, 1220, 1019, 1018, 1181, -269, -103, 16, 21, - 25, 289, 396, 589, 593, 620, 674, 1149, 1197, 1146, + 365, -530, 1, 28, 29, 38, 42, 46, 71, 0, + 75, -111, -111, 76, 77, 78, 79, 893, 80, 682, + -242, 867, -111, -111, -111, -111, 142, 152, 156, 245, + 322, 347, 514, 348, 1212, 1213, 1214, 1215, 1209, 1210, + 349, 350, 351, 352, 353, 354, 1216, 1211, 355, 356, + 357, 359, 428, 893, -265, 682, -241, -264, 72, 0, + 18, 317, 320, 19, 20, 21, 23, 398, 471, 472, + 479, 482, 483, 484, 485, 489, 490, 491, 498, 669, + 1202, 1145, 1220, 1019, 1018, 1181, -269, -103, 17, 22, + 26, 290, 397, 589, 593, 620, 674, 1149, 1197, 1146, 1275, 0, -494, 1162, 0, 1223 ); @@ -491,9 +491,9 @@ class Php7 extends \PhpParser\ParserAbstract protected $actionBase = array( 0, -2, 154, 565, 876, 948, 984, 514, 53, 398, - 837, 307, 307, 67, 307, 307, 653, 724, 724, 732, - 724, 616, 673, 204, 204, 204, 625, 625, 625, 625, - 694, 694, 831, 831, 863, 799, 765, 936, 936, 936, + 837, 307, 307, 67, 307, 307, 307, 653, 724, 724, + 732, 724, 616, 673, 204, 204, 204, 625, 625, 625, + 625, 694, 694, 831, 831, 863, 799, 765, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, @@ -506,40 +506,40 @@ class Php7 extends \PhpParser\ParserAbstract 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 375, 519, 369, 701, 1017, 1023, 1019, 1024, 1015, - 1014, 1018, 1020, 1025, 911, 912, 782, 918, 919, 920, - 921, 1021, 841, 1016, 1022, 291, 291, 291, 291, 291, + 936, 936, 375, 519, 369, 701, 1017, 1023, 1019, 1024, + 1015, 1014, 1018, 1020, 1025, 911, 912, 782, 918, 919, + 920, 921, 1021, 841, 1016, 1022, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 290, 491, 44, 382, 382, 382, 382, 382, 382, + 291, 291, 290, 491, 44, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 160, 160, 160, 187, 684, 684, - 341, 203, 610, 47, 985, 985, 985, 985, 985, 985, - 985, 985, 985, 985, 144, 144, 7, 7, 7, 7, - 7, 371, -25, -25, -25, -25, 540, 385, 102, 576, - 358, 45, 377, 460, 460, 360, 231, 231, 231, 231, - 231, 231, -78, -78, -78, -78, -78, -66, 319, 457, - -94, 396, 423, 586, 586, 586, 586, 423, 423, 423, - 423, 750, 1029, 423, 423, 423, 511, 516, 516, 518, - 147, 147, 147, 516, 583, 777, 422, 583, 422, 194, - 92, 748, -40, 87, 412, 748, 617, 627, 198, 143, - 773, 658, 773, 1013, 757, 764, 717, 838, 860, 1026, - 800, 908, 806, 910, 219, 686, 1012, 1012, 1012, 1012, - 1012, 1012, 1012, 1012, 1012, 1012, 1012, 855, 552, 1013, - 286, 855, 855, 855, 552, 552, 552, 552, 552, 552, - 552, 552, 552, 552, 679, 286, 568, 626, 286, 794, - 552, 375, 758, 375, 375, 375, 375, 958, 375, 375, - 375, 375, 375, 375, 970, 769, -16, 375, 519, 12, - 12, 547, 83, 12, 12, 12, 12, 375, 375, 375, - 658, 781, 713, 666, 792, 448, 781, 781, 781, 438, - 444, 193, 447, 570, 523, 580, 760, 760, 767, 929, - 929, 760, 759, 760, 767, 934, 760, 929, 805, 359, - 648, 577, 611, 656, 929, 478, 760, 760, 760, 760, - 665, 760, 467, 433, 760, 760, 785, 774, 789, 60, - 929, 929, 929, 789, 596, 751, 751, 751, 811, 812, - 746, 771, 567, 498, 677, 348, 779, 771, 771, 760, - 640, 746, 771, 746, 771, 747, 771, 771, 771, 746, - 771, 760, 759, 585, 771, 734, 668, 224, 771, 6, + 382, 382, 382, 382, 382, 160, 160, 160, 187, 684, + 684, 341, 203, 610, 47, 985, 985, 985, 985, 985, + 985, 985, 985, 985, 985, 144, 144, 7, 7, 7, + 7, 7, 371, -25, -25, -25, -25, 540, 385, 102, + 576, 358, 45, 377, 460, 460, 360, 231, 231, 231, + 231, 231, 231, -78, -78, -78, -78, -78, -66, 319, + 457, -94, 396, 423, 586, 586, 586, 586, 423, 423, + 423, 423, 750, 1029, 423, 423, 423, 511, 516, 516, + 518, 147, 147, 147, 516, 583, 777, 422, 583, 422, + 194, 92, 748, -40, 87, 412, 748, 617, 627, 198, + 143, 773, 658, 773, 1013, 757, 764, 717, 838, 860, + 1026, 800, 908, 806, 910, 219, 686, 1012, 1012, 1012, + 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 855, 552, + 1013, 286, 855, 855, 855, 552, 552, 552, 552, 552, + 552, 552, 552, 552, 552, 679, 286, 568, 626, 286, + 794, 552, 375, 758, 375, 375, 375, 375, 958, 375, + 375, 375, 375, 375, 375, 970, 769, -16, 375, 519, + 12, 12, 547, 83, 12, 12, 12, 12, 375, 375, + 375, 658, 781, 713, 666, 792, 448, 781, 781, 781, + 438, 444, 193, 447, 570, 523, 580, 760, 760, 767, + 929, 929, 760, 759, 760, 767, 934, 760, 929, 805, + 359, 648, 577, 611, 656, 929, 478, 760, 760, 760, + 760, 665, 760, 467, 433, 760, 760, 785, 774, 789, + 60, 929, 929, 929, 789, 596, 751, 751, 751, 811, + 812, 746, 771, 567, 498, 677, 348, 779, 771, 771, + 760, 640, 746, 771, 746, 771, 747, 771, 771, 771, + 746, 771, 759, 585, 771, 734, 668, 224, 771, 6, 935, 937, 354, 940, 932, 941, 979, 942, 943, 851, 956, 933, 945, 931, 930, 780, 703, 720, 790, 729, 928, 768, 768, 768, 925, 768, 768, 768, 768, 768, @@ -562,7 +562,7 @@ class Php7 extends \PhpParser\ParserAbstract 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 458, 458, 458, 458, 458, 458, 307, 307, 307, - 307, 0, 0, 307, 0, 0, 458, 458, 458, 458, + 307, 0, 0, 307, 0, 0, 0, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, @@ -577,85 +577,85 @@ class Php7 extends \PhpParser\ParserAbstract 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 458, 458, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 0, 0, 0, 0, 0, + 291, 291, 291, 291, 291, 291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 0, 0, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 423, 423, - 291, 291, 0, 291, 423, 423, 423, 423, 423, 423, - 423, 423, 423, 423, 291, 291, 291, 291, 291, 291, - 291, 805, 147, 147, 147, 147, 423, 423, 423, 423, - 423, -88, -88, 147, 147, 423, 423, 423, 423, 423, - 423, 423, 423, 423, 423, 423, 423, 0, 0, 0, - 286, 422, 0, 759, 759, 759, 759, 0, 0, 0, - 0, 422, 422, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 286, 422, 0, 286, 0, 759, - 759, 423, 805, 805, 314, 423, 0, 0, 0, 0, - 286, 759, 286, 552, 422, 552, 552, 12, 375, 314, - 608, 608, 608, 608, 0, 658, 805, 805, 805, 805, - 805, 805, 805, 805, 805, 805, 805, 759, 0, 805, - 0, 759, 759, 759, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 759, - 0, 0, 929, 0, 0, 0, 0, 760, 0, 0, - 0, 0, 0, 0, 760, 934, 0, 0, 0, 0, - 0, 0, 759, 0, 0, 0, 0, 0, 0, 0, - 0, 768, 801, 0, 801, 0, 768, 768, 768 + 291, 291, 291, 291, 291, 291, 291, 291, 291, 423, + 423, 291, 291, 0, 291, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 291, 291, 291, 291, 291, + 291, 291, 805, 147, 147, 147, 147, 423, 423, 423, + 423, 423, -88, -88, 147, 147, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 423, 0, 0, + 0, 286, 422, 0, 759, 759, 759, 759, 0, 0, + 0, 0, 422, 422, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 286, 422, 0, 286, 0, + 759, 759, 423, 805, 805, 314, 423, 0, 0, 0, + 0, 286, 759, 286, 552, 422, 552, 552, 12, 375, + 314, 608, 608, 608, 608, 0, 658, 805, 805, 805, + 805, 805, 805, 805, 805, 805, 805, 805, 759, 0, + 805, 0, 759, 759, 759, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 759, 0, 0, 929, 0, 0, 0, 0, 760, 0, + 0, 0, 0, 0, 0, 760, 934, 0, 0, 0, + 0, 0, 0, 759, 0, 0, 0, 0, 0, 0, + 0, 0, 768, 801, 0, 801, 0, 768, 768, 768 ); protected $actionDefault = array( 3,32767, 103,32767,32767,32767,32767,32767,32767,32767, 32767,32767, 101,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 578, 578, 578, 578, - 32767,32767, 246, 103,32767,32767, 454, 372, 372, 372, - 32767,32767, 522, 522, 522, 522, 522, 522,32767,32767, - 32767,32767,32767,32767, 454,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 578, 578, 578, + 578,32767,32767, 246, 103,32767,32767, 454, 372, 372, + 372,32767,32767, 522, 522, 522, 522, 522, 522,32767, + 32767,32767,32767,32767,32767, 454,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 101,32767,32767, - 32767, 37, 7, 8, 10, 11, 50, 17, 310,32767, - 32767,32767,32767, 103,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 571,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 101,32767, + 32767,32767, 37, 7, 8, 10, 11, 50, 17, 310, + 32767,32767,32767,32767, 103,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 458, 437, 438, 440, 441, - 371, 523, 577, 313, 574, 370, 146, 325, 315, 234, - 316, 250, 459, 251, 460, 463, 464, 211, 279, 367, - 150, 401, 455, 403, 453, 457, 402, 377, 382, 383, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 375, 376, 456, 434, 433, 432, 399,32767,32767, - 400, 404, 374, 407,32767,32767,32767,32767,32767,32767, - 32767,32767, 103,32767, 405, 406, 423, 424, 421, 422, - 425,32767, 426, 427, 428, 429,32767,32767, 302,32767, - 32767, 351, 349, 414, 415, 302,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 516, 431, + 32767,32767,32767,32767,32767, 571,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 103,32767, 101, 518, 396, 398, 486, - 409, 410, 408, 378,32767, 493,32767, 103, 495,32767, - 32767,32767, 112,32767,32767,32767, 517,32767, 524, 524, - 32767, 479, 101, 194,32767, 194, 194,32767,32767,32767, - 32767,32767,32767,32767, 585, 479, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111,32767, 194, 111, - 32767,32767,32767, 101, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 189,32767, 260, 262, 103, 539, - 194,32767, 498,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 491,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 458, 437, 438, 440, + 441, 371, 523, 577, 313, 574, 370, 146, 325, 315, + 234, 316, 250, 459, 251, 460, 463, 464, 211, 279, + 367, 150, 401, 455, 403, 453, 457, 402, 377, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 375, 376, 456, 434, 433, 432, 399,32767, + 32767, 400, 404, 374, 407,32767,32767,32767,32767,32767, + 32767,32767,32767, 103,32767, 405, 406, 423, 424, 421, + 422, 425,32767, 426, 427, 428, 429,32767,32767, 302, + 32767,32767, 351, 349, 414, 415, 302,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 516, + 431,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 103,32767, 101, 518, 396, 398, + 486, 409, 410, 408, 378,32767, 493,32767, 103, 495, + 32767,32767,32767, 112,32767,32767,32767, 517,32767, 524, + 524,32767, 479, 101, 194,32767, 194, 194,32767,32767, + 32767,32767,32767,32767,32767, 585, 479, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111,32767, 194, + 111,32767,32767,32767, 101, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 189,32767, 260, 262, 103, + 539, 194,32767, 498,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 491,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 479, 419, 139,32767, 139, 524, 411, 412, 413, 481, - 524, 524, 524, 298, 281,32767,32767,32767,32767, 496, - 496, 101, 101, 101, 101, 491,32767,32767, 112, 100, - 100, 100, 100, 100, 104, 102,32767,32767,32767,32767, - 100,32767, 102, 102,32767,32767, 217, 208, 215, 102, - 32767, 543, 544, 215, 102, 219, 219, 219, 239, 239, - 470, 304, 102, 100, 102, 102, 196, 304, 304,32767, - 102, 470, 304, 470, 304, 198, 304, 304, 304, 470, - 304,32767,32767, 102, 304, 210, 100, 100, 304,32767, + 32767, 479, 419, 139,32767, 139, 524, 411, 412, 413, + 481, 524, 524, 524, 298, 281,32767,32767,32767,32767, + 496, 496, 101, 101, 101, 101, 491,32767,32767, 112, + 100, 100, 100, 100, 100, 104, 102,32767,32767,32767, + 32767, 100,32767, 102, 102,32767,32767, 217, 208, 215, + 102,32767, 543, 544, 215, 102, 219, 219, 219, 239, + 239, 470, 304, 102, 100, 102, 102, 196, 304, 304, + 32767, 102, 470, 304, 470, 304, 198, 304, 304, 304, + 470, 304,32767, 102, 304, 210, 100, 100, 304,32767, 32767,32767, 481,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767, 511,32767, 528, 541, 417, 418, 420, 526, 442, 443, 444, 445, 446, @@ -680,71 +680,67 @@ class Php7 extends \PhpParser\ParserAbstract ); protected $goto = array( - 193, 193, 670, 421, 643, 1022, 1290, 1290, 824, 415, - 307, 308, 328, 563, 313, 420, 329, 422, 622, 801, - 678, 341, 586, 1290, 825, 164, 164, 164, 164, 217, - 194, 190, 190, 174, 176, 212, 190, 190, 190, 190, - 190, 191, 191, 191, 191, 191, 191, 185, 186, 187, - 188, 189, 214, 212, 215, 521, 522, 411, 523, 525, - 526, 527, 528, 529, 530, 531, 532, 1091, 165, 166, - 167, 192, 168, 169, 170, 163, 171, 172, 173, 175, - 211, 213, 216, 234, 237, 240, 241, 243, 254, 255, - 256, 257, 258, 259, 260, 262, 263, 264, 265, 273, - 274, 310, 311, 312, 416, 417, 418, 568, 218, 219, + 194, 194, 670, 422, 643, 463, 1264, 1265, 1022, 416, + 308, 309, 329, 563, 314, 421, 330, 423, 622, 801, + 678, 637, 586, 651, 652, 653, 165, 165, 165, 165, + 218, 195, 191, 191, 175, 177, 213, 191, 191, 191, + 191, 191, 192, 192, 192, 192, 192, 192, 186, 187, + 188, 189, 190, 215, 213, 216, 521, 522, 412, 523, + 525, 526, 527, 528, 529, 530, 531, 532, 1091, 166, + 167, 168, 193, 169, 170, 171, 164, 172, 173, 174, + 176, 212, 214, 217, 235, 238, 241, 242, 244, 255, + 256, 257, 258, 259, 260, 261, 263, 264, 265, 266, + 274, 275, 311, 312, 313, 417, 418, 419, 568, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 177, 233, 178, 195, 196, 197, 235, - 185, 186, 187, 188, 189, 214, 1091, 198, 179, 180, - 181, 199, 195, 182, 236, 200, 198, 162, 201, 202, - 183, 203, 204, 205, 184, 206, 207, 208, 209, 210, - 322, 322, 322, 322, 827, 608, 608, 858, 547, 538, - 1186, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221, - 1221, 1239, 1239, 462, 1264, 1265, 799, 1239, 1239, 1239, - 1239, 1239, 1239, 1239, 1239, 1239, 1239, 387, 538, 547, - 556, 557, 394, 566, 588, 602, 603, 832, 938, 880, - 875, 876, 889, 14, 833, 877, 830, 878, 879, 831, - 453, 453, 884, 883, 885, 1187, 250, 250, 560, 453, - 1237, 1237, 815, 1043, 1039, 1040, 1237, 1237, 1237, 1237, - 1237, 1237, 1237, 1237, 1237, 1237, 820, 820, 1188, 1247, - 1248, 247, 247, 247, 247, 249, 251, 342, 343, 339, - 1190, 1190, 997, 1190, 997, 1279, 930, 401, 677, 997, + 230, 231, 232, 233, 178, 234, 179, 196, 197, 198, + 236, 186, 187, 188, 189, 190, 215, 1091, 199, 180, + 181, 182, 200, 196, 183, 237, 201, 199, 163, 202, + 203, 184, 204, 205, 206, 185, 207, 208, 209, 210, + 211, 323, 323, 323, 323, 827, 608, 608, 824, 547, + 538, 342, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221, + 1221, 1221, 1239, 1239, 288, 288, 288, 288, 1239, 1239, + 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 388, 538, + 547, 556, 557, 395, 566, 588, 602, 603, 832, 825, + 880, 875, 876, 889, 15, 833, 877, 830, 878, 879, + 831, 799, 251, 251, 883, 919, 992, 1000, 1004, 1001, + 1005, 1237, 1237, 938, 1043, 1039, 1040, 1237, 1237, 1237, + 1237, 1237, 1237, 1237, 1237, 1237, 1237, 858, 248, 248, + 248, 248, 250, 252, 533, 533, 533, 533, 487, 590, + 488, 1190, 1190, 997, 1190, 997, 494, 1290, 1290, 560, 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, - 997, 1261, 1261, 414, 1261, 597, 1190, 287, 287, 287, - 287, 1190, 1190, 1190, 1190, 959, 344, 1190, 1190, 1190, - 1271, 1271, 1271, 1271, 606, 640, 344, 344, 1273, 1273, - 1273, 1273, 1063, 1064, 637, 896, 651, 652, 653, 897, - 344, 344, 383, 344, 486, 1306, 487, 535, 535, 5, - 535, 6, 494, 559, 1257, 1140, 540, 524, 524, 344, - 318, 302, 642, 524, 524, 524, 524, 524, 524, 524, - 524, 524, 524, 444, 1266, 1267, 618, 619, 932, 932, - 932, 932, 820, 428, 444, 926, 933, 330, 533, 533, - 533, 533, 1030, 590, 817, 554, 1259, 1259, 1030, 704, - 621, 623, 845, 641, 1250, 805, 393, 660, 664, 973, - 668, 676, 969, 1183, 553, 842, 823, 1289, 1289, 564, - 600, 601, 385, 389, 548, 587, 591, 663, 962, 936, - 936, 934, 936, 703, 1289, 537, 971, 966, 438, 901, - 1079, 981, 1028, 438, 438, 805, 605, 805, 707, 854, - 1292, 978, 463, 539, 551, 1074, 467, 540, 539, 844, - 551, 646, 957, 386, 1171, 912, 1032, 838, 1172, 1175, - 913, 1176, 943, 567, 456, 457, 458, 0, 850, 0, - 1182, 1297, 1298, 253, 253, 0, 399, 400, 0, 0, - 0, 649, 0, 650, 423, 403, 404, 405, 840, 661, - 0, 423, 0, 406, 0, 0, 848, 337, 1009, 1002, - 1006, 1003, 1007, 852, 0, 0, 839, 1185, 495, 0, - 0, 0, 0, 438, 438, 438, 438, 438, 438, 438, - 438, 438, 438, 438, 0, 0, 438, 595, 609, 612, - 613, 614, 615, 634, 635, 636, 680, 853, 841, 1027, - 1031, 585, 1056, 0, 681, 667, 667, 941, 673, 1054, - 0, 0, 0, 0, 0, 271, 0, 0, 0, 0, - 536, 536, 919, 992, 1000, 1004, 1001, 1005, 0, 0, - 931, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 976, 976, 0, 1072, 857 + 997, 997, 1261, 1261, 1290, 1261, 340, 1190, 930, 402, + 677, 1279, 1190, 1190, 1190, 1190, 959, 345, 1190, 1190, + 1190, 1271, 1271, 1271, 1271, 606, 640, 345, 345, 1273, + 1273, 1273, 1273, 820, 820, 805, 896, 884, 840, 885, + 897, 345, 345, 5, 345, 6, 1306, 384, 535, 535, + 559, 535, 415, 852, 597, 1257, 839, 540, 524, 524, + 345, 1289, 1289, 642, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 445, 805, 1140, 805, 1289, 932, + 932, 932, 932, 1063, 1064, 445, 926, 933, 386, 390, + 548, 587, 591, 1030, 1292, 331, 554, 1259, 1259, 1030, + 704, 621, 623, 823, 641, 1250, 319, 303, 660, 664, + 973, 668, 676, 969, 429, 553, 962, 936, 936, 934, + 936, 703, 601, 537, 971, 966, 343, 344, 663, 817, + 595, 609, 612, 613, 614, 615, 634, 635, 636, 680, + 439, 1186, 845, 454, 454, 439, 439, 1266, 1267, 820, + 901, 1079, 454, 394, 539, 551, 1183, 605, 540, 539, + 842, 551, 978, 272, 387, 618, 619, 981, 536, 536, + 844, 707, 646, 957, 567, 457, 458, 459, 838, 850, + 254, 254, 1297, 1298, 400, 401, 976, 976, 464, 649, + 1182, 650, 1028, 404, 405, 406, 1187, 661, 424, 1032, + 407, 564, 600, 815, 338, 424, 854, 848, 853, 841, + 1027, 1031, 1009, 1002, 1006, 1003, 1007, 1185, 941, 1188, + 1247, 1248, 943, 0, 1074, 439, 439, 439, 439, 439, + 439, 439, 439, 439, 439, 439, 0, 468, 439, 585, + 1056, 931, 681, 667, 667, 0, 495, 673, 1054, 1171, + 912, 0, 0, 1172, 1175, 913, 1176, 0, 0, 0, + 0, 0, 0, 1072, 857 ); protected $gotoCheck = array( - 42, 42, 72, 65, 65, 119, 173, 173, 26, 65, + 42, 42, 72, 65, 65, 166, 166, 166, 119, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 7, - 9, 93, 122, 173, 27, 42, 42, 42, 42, 42, + 9, 84, 122, 84, 84, 84, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, @@ -758,91 +754,87 @@ class Php7 extends \PhpParser\ParserAbstract 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 23, 23, 23, 23, 15, 104, 104, 45, 75, 75, - 20, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 160, 160, 166, 166, 166, 6, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 15, 49, 15, - 15, 15, 15, 75, 15, 15, 15, 15, 15, 15, - 141, 141, 64, 15, 64, 20, 5, 5, 162, 141, - 161, 161, 20, 15, 15, 15, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 22, 22, 20, 20, - 20, 5, 5, 5, 5, 5, 5, 93, 93, 169, - 72, 72, 72, 72, 72, 171, 89, 89, 89, 72, + 42, 23, 23, 23, 23, 15, 104, 104, 26, 75, + 75, 93, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 160, 160, 24, 24, 24, 24, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 15, 27, + 15, 15, 15, 15, 75, 15, 15, 15, 15, 15, + 15, 6, 5, 5, 15, 87, 87, 87, 87, 87, + 87, 161, 161, 49, 15, 15, 15, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 45, 5, 5, + 5, 5, 5, 5, 103, 103, 103, 103, 147, 103, + 147, 72, 72, 72, 72, 72, 147, 173, 173, 162, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 122, 122, 13, 122, 13, 72, 24, 24, 24, - 24, 72, 72, 72, 72, 99, 14, 72, 72, 72, - 9, 9, 9, 9, 55, 55, 14, 14, 122, 122, - 122, 122, 136, 136, 84, 72, 84, 84, 84, 72, - 14, 14, 61, 14, 147, 14, 147, 19, 19, 46, - 19, 46, 147, 100, 122, 143, 14, 163, 163, 14, - 159, 159, 63, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 19, 168, 168, 83, 83, 19, 19, - 19, 19, 22, 109, 19, 19, 19, 29, 103, 103, - 103, 103, 122, 103, 18, 48, 122, 122, 122, 48, - 48, 48, 39, 48, 14, 12, 28, 48, 48, 48, - 48, 48, 48, 152, 9, 37, 25, 172, 172, 2, - 2, 9, 58, 58, 58, 58, 58, 14, 25, 25, - 25, 25, 25, 25, 172, 25, 25, 25, 23, 17, - 17, 106, 121, 23, 23, 12, 17, 12, 95, 41, - 172, 17, 149, 9, 9, 139, 82, 14, 9, 17, - 9, 17, 17, 9, 78, 78, 124, 17, 78, 78, - 78, 78, 92, 9, 9, 9, 9, -1, 9, -1, - 17, 9, 9, 5, 5, -1, 80, 80, -1, -1, - -1, 80, -1, 80, 113, 80, 80, 80, 35, 80, - -1, 113, -1, 80, -1, -1, 9, 80, 113, 113, - 113, 113, 113, 35, -1, -1, 35, 14, 9, -1, - -1, -1, -1, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, -1, -1, 23, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 16, 16, 16, - 16, 8, 8, -1, 8, 8, 8, 16, 8, 8, - -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, - 24, 24, 87, 87, 87, 87, 87, 87, -1, -1, - 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 103, 103, -1, 16, 16 + 72, 72, 122, 122, 173, 122, 169, 72, 89, 89, + 89, 171, 72, 72, 72, 72, 99, 14, 72, 72, + 72, 9, 9, 9, 9, 55, 55, 14, 14, 122, + 122, 122, 122, 22, 22, 12, 72, 64, 35, 64, + 72, 14, 14, 46, 14, 46, 14, 61, 19, 19, + 100, 19, 13, 35, 13, 122, 35, 14, 163, 163, + 14, 172, 172, 63, 163, 163, 163, 163, 163, 163, + 163, 163, 163, 163, 19, 12, 143, 12, 172, 19, + 19, 19, 19, 136, 136, 19, 19, 19, 58, 58, + 58, 58, 58, 122, 172, 29, 48, 122, 122, 122, + 48, 48, 48, 25, 48, 14, 159, 159, 48, 48, + 48, 48, 48, 48, 109, 9, 25, 25, 25, 25, + 25, 25, 9, 25, 25, 25, 93, 93, 14, 18, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 23, 20, 39, 141, 141, 23, 23, 168, 168, 22, + 17, 17, 141, 28, 9, 9, 152, 17, 14, 9, + 37, 9, 17, 24, 9, 83, 83, 106, 24, 24, + 17, 95, 17, 17, 9, 9, 9, 9, 17, 9, + 5, 5, 9, 9, 80, 80, 103, 103, 149, 80, + 17, 80, 121, 80, 80, 80, 20, 80, 113, 124, + 80, 2, 2, 20, 80, 113, 41, 9, 16, 16, + 16, 16, 113, 113, 113, 113, 113, 14, 16, 20, + 20, 20, 92, -1, 139, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, -1, 82, 23, 8, + 8, 16, 8, 8, 8, -1, 8, 8, 8, 78, + 78, -1, -1, 78, 78, 78, 78, -1, -1, -1, + -1, -1, -1, 16, 16 ); protected $gotoBase = array( - 0, 0, -285, 0, 0, 225, 173, 10, 524, 7, - 0, 0, 95, -47, 5, -174, 87, -33, 71, 61, - -212, 0, -76, 157, 284, 392, 4, 20, 56, 77, - 0, 0, 0, 0, 0, 118, 0, 63, 0, 65, - 0, -2, -1, 0, 0, 155, -378, 0, -308, 186, - 0, 0, 0, 0, 0, 266, 0, 0, 359, 0, - 0, 282, 0, 103, 204, -235, 0, 0, 0, 0, - 0, 0, -6, 0, 0, -167, 0, 0, 45, 170, - -11, 0, -27, -110, -376, 0, 0, 276, 0, -32, - 0, 0, 19, -448, 0, 30, 0, 0, 0, 262, - 292, 0, 0, 342, -73, 0, 62, 0, 0, 88, - 0, 0, 0, 206, 0, 0, 0, 0, 0, 3, - 0, 59, 15, 0, 14, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 41, 0, 0, 1, - 0, 188, 0, 66, 0, 0, 0, -157, 0, 2, - 0, 0, 35, 0, 0, 0, 0, 0, 0, 25, - -57, -8, 201, 99, 0, 0, -111, 0, -7, 231, - 0, 236, 96, -295, 0, 0 + 0, 0, -203, 0, 0, 221, 208, 10, 512, 7, + 0, 0, 24, 1, 5, -174, 47, -23, 105, 61, + 38, 0, -10, 158, 181, 379, 164, 205, 102, 84, + 0, 0, 0, 0, 0, -43, 0, 107, 0, 104, + 0, 54, -1, 0, 0, 235, -384, 0, -307, 210, + 0, 0, 0, 0, 0, 266, 0, 0, 324, 0, + 0, 286, 0, 103, 298, -236, 0, 0, 0, 0, + 0, 0, -6, 0, 0, -167, 0, 0, 129, 62, + -14, 0, 53, -22, -669, 0, 0, -52, 0, -11, + 0, 0, 68, -299, 0, 52, 0, 0, 0, 262, + 288, 0, 0, 227, -73, 0, 87, 0, 0, 118, + 0, 0, 0, 209, 0, 0, 0, 0, 0, 6, + 0, 108, 15, 0, 46, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 91, 0, 0, 69, + 0, 390, 0, 86, 0, 0, 0, -224, 0, 37, + 0, 0, 77, 0, 0, 0, 0, 0, 0, 70, + -57, -8, 241, 99, 0, 0, -290, 0, 65, 257, + 0, 261, 39, -35, 0, 0 ); protected $gotoDefault = array( -32768, 499, 711, 4, 712, 905, 788, 797, 583, 515, - 679, 338, 610, 412, 1255, 882, 1078, 565, 816, 1199, - 1207, 445, 819, 323, 701, 864, 865, 866, 390, 375, - 381, 388, 632, 611, 480, 851, 441, 843, 472, 846, - 440, 855, 161, 409, 497, 859, 3, 861, 542, 892, - 376, 869, 377, 656, 871, 550, 873, 874, 384, 391, - 392, 1083, 558, 607, 886, 242, 552, 887, 374, 888, - 895, 379, 382, 665, 452, 492, 485, 402, 1058, 594, - 629, 449, 466, 617, 616, 604, 465, 424, 407, 928, - 473, 450, 942, 340, 950, 709, 1090, 624, 475, 958, - 625, 965, 968, 516, 517, 464, 980, 268, 983, 476, - 1015, 647, 648, 995, 626, 627, 1013, 459, 584, 1021, - 442, 1029, 1243, 443, 1033, 261, 1036, 275, 408, 425, - 1041, 1042, 8, 1048, 671, 672, 10, 272, 496, 1073, - 666, 439, 1089, 429, 1159, 1161, 544, 477, 1179, 1178, - 659, 493, 1184, 1246, 437, 518, 460, 309, 519, 301, - 326, 306, 534, 288, 327, 520, 461, 1252, 1260, 324, - 29, 1280, 1291, 334, 562, 599 + 679, 339, 610, 413, 1255, 882, 1078, 565, 816, 1199, + 1207, 446, 819, 324, 701, 864, 865, 866, 391, 376, + 382, 389, 632, 611, 481, 851, 442, 843, 473, 846, + 441, 855, 162, 410, 497, 859, 3, 861, 542, 892, + 377, 869, 378, 656, 871, 550, 873, 874, 385, 392, + 393, 1083, 558, 607, 886, 243, 552, 887, 375, 888, + 895, 380, 383, 665, 453, 492, 486, 403, 1058, 594, + 629, 450, 467, 617, 616, 604, 466, 425, 408, 928, + 474, 451, 942, 341, 950, 709, 1090, 624, 476, 958, + 625, 965, 968, 516, 517, 465, 980, 269, 983, 477, + 1015, 647, 648, 995, 626, 627, 1013, 460, 584, 1021, + 443, 1029, 1243, 444, 1033, 262, 1036, 276, 409, 426, + 1041, 1042, 8, 1048, 671, 672, 10, 273, 496, 1073, + 666, 440, 1089, 430, 1159, 1161, 544, 478, 1179, 1178, + 659, 493, 1184, 1246, 438, 518, 461, 310, 519, 302, + 327, 307, 534, 289, 328, 520, 462, 1252, 1260, 325, + 30, 1280, 1291, 335, 562, 599 ); protected $ruleToNonTerminal = array( diff --git a/app/vendor/phpunit/php-code-coverage/ChangeLog.md b/app/vendor/phpunit/php-code-coverage/ChangeLog.md index fe6bcfdec..fb9353ae7 100644 --- a/app/vendor/phpunit/php-code-coverage/ChangeLog.md +++ b/app/vendor/phpunit/php-code-coverage/ChangeLog.md @@ -2,6 +2,14 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [9.2.8] - 2021-10-30 + +### Fixed + +* [#866](https://github.com/sebastianbergmann/php-code-coverage/issues/866): `CodeUnitFindingVisitor` does not handle `enum` type introduced in PHP 8.1 +* [#868](https://github.com/sebastianbergmann/php-code-coverage/pull/868): Uncovered files should be ignored unless requested +* [#876](https://github.com/sebastianbergmann/php-code-coverage/issues/876): PCOV driver causes 2x slowdown after upgrade to PHPUnit 9.5 + ## [9.2.7] - 2021-09-17 ### Fixed @@ -329,6 +337,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 7.1 +[9.2.8]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.7...9.2.8 [9.2.7]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.6...9.2.7 [9.2.6]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.5...9.2.6 [9.2.5]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.4...9.2.5 diff --git a/app/vendor/phpunit/php-code-coverage/composer.json b/app/vendor/phpunit/php-code-coverage/composer.json index 898484ffb..11c3add6c 100644 --- a/app/vendor/phpunit/php-code-coverage/composer.json +++ b/app/vendor/phpunit/php-code-coverage/composer.json @@ -32,7 +32,7 @@ "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.12.0", + "nikic/php-parser": "^4.13.0", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", "sebastian/code-unit-reverse-lookup": "^2.0.2", diff --git a/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php b/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php index 6445c6d27..553ced552 100644 --- a/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php +++ b/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php @@ -167,6 +167,8 @@ public function getData(bool $raw = false): ProcessedCodeCoverageData $this->processUncoveredFilesFromFilter(); } elseif ($this->includeUncoveredFiles) { $this->addUncoveredFilesFromFilter(); + } else { + $this->data->removeFilesWithNoCoverage(); } } diff --git a/app/vendor/phpunit/php-code-coverage/src/Driver/PcovDriver.php b/app/vendor/phpunit/php-code-coverage/src/Driver/PcovDriver.php index f4eca6031..c30b30c44 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Driver/PcovDriver.php +++ b/app/vendor/phpunit/php-code-coverage/src/Driver/PcovDriver.php @@ -9,7 +9,14 @@ */ namespace SebastianBergmann\CodeCoverage\Driver; +use const pcov\inclusive; +use function array_intersect; use function extension_loaded; +use function pcov\clear; +use function pcov\collect; +use function pcov\start; +use function pcov\stop; +use function pcov\waiting; use function phpversion; use SebastianBergmann\CodeCoverage\Filter; use SebastianBergmann\CodeCoverage\RawCodeCoverageData; @@ -38,21 +45,27 @@ public function __construct(Filter $filter) public function start(): void { - \pcov\start(); + start(); } public function stop(): RawCodeCoverageData { - \pcov\stop(); + stop(); - $collect = \pcov\collect( - \pcov\inclusive, - !$this->filter->isEmpty() ? $this->filter->files() : \pcov\waiting() - ); + $filesToCollectCoverageFor = waiting(); + $collected = []; - \pcov\clear(); + if ($filesToCollectCoverageFor) { + if (!$this->filter->isEmpty()) { + $filesToCollectCoverageFor = array_intersect($filesToCollectCoverageFor, $this->filter->files()); + } - return RawCodeCoverageData::fromXdebugWithoutPathCoverage($collect); + $collected = collect(inclusive, $filesToCollectCoverageFor); + + clear(); + } + + return RawCodeCoverageData::fromXdebugWithoutPathCoverage($collected); } public function nameAndVersion(): string diff --git a/app/vendor/phpunit/php-code-coverage/src/ProcessedCodeCoverageData.php b/app/vendor/phpunit/php-code-coverage/src/ProcessedCodeCoverageData.php index 1ed29ad52..9ecb536d9 100644 --- a/app/vendor/phpunit/php-code-coverage/src/ProcessedCodeCoverageData.php +++ b/app/vendor/phpunit/php-code-coverage/src/ProcessedCodeCoverageData.php @@ -132,6 +132,18 @@ public function renameFile(string $oldFile, string $newFile): void unset($this->lineCoverage[$oldFile], $this->functionCoverage[$oldFile]); } + public function removeFilesWithNoCoverage(): void + { + foreach ($this->lineCoverage as $file => $lines) { + foreach ($lines as $line) { + if (is_array($line) && !empty($line)) { + continue 2; + } + } + unset($file); + } + } + public function merge(self $newData): void { foreach ($newData->lineCoverage as $file => $lines) { diff --git a/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php b/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php index e79b59e57..cd6d0189d 100644 --- a/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php +++ b/app/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php @@ -13,11 +13,14 @@ use function rtrim; use function trim; use PhpParser\Node; +use PhpParser\Node\ComplexType; use PhpParser\Node\Identifier; +use PhpParser\Node\IntersectionType; use PhpParser\Node\Name; use PhpParser\Node\NullableType; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; +use PhpParser\Node\Stmt\Enum_; use PhpParser\Node\Stmt\Function_; use PhpParser\Node\Stmt\Interface_; use PhpParser\Node\Stmt\Trait_; @@ -32,17 +35,17 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract { /** - * @var array + * @psalm-var array}> */ private $classes = []; /** - * @var array + * @psalm-var array}> */ private $traits = []; /** - * @var array + * @psalm-var array */ private $functions = []; @@ -79,16 +82,25 @@ public function enterNode(Node $node) $this->processFunction($node); } + /** + * @psalm-return array}> + */ public function classes(): array { return $this->classes; } + /** + * @psalm-return array}> + */ public function traits(): array { return $this->traits; } + /** + * @psalm-return array + */ public function functions(): array { return $this->functions; @@ -157,24 +169,18 @@ private function signature(Node $node): string } /** - * @psalm-param Identifier|Name|NullableType|UnionType $type + * @psalm-param Identifier|Name|ComplexType $type */ private function type(Node $type): string { - assert($type instanceof Identifier || $type instanceof Name || $type instanceof NullableType || $type instanceof UnionType); + assert($type instanceof Identifier || $type instanceof Name || $type instanceof ComplexType); if ($type instanceof NullableType) { return '?' . $type->type; } - if ($type instanceof UnionType) { - $types = []; - - foreach ($type->types as $_type) { - $types[] = $_type->toString(); - } - - return implode('|', $types); + if ($type instanceof UnionType || $type instanceof IntersectionType) { + return $this->unionOrIntersectionAsString($type); } return $type->toString(); @@ -200,7 +206,7 @@ private function processClass(Class_ $node): void $this->classes[$namespacedName] = [ 'name' => $name, - 'namespacedName' => $namespacedName, + 'namespacedName' => (string) $namespacedName, 'namespace' => $this->namespace($namespacedName, $name), 'startLine' => $node->getStartLine(), 'endLine' => $node->getEndLine(), @@ -215,7 +221,7 @@ private function processTrait(Trait_ $node): void $this->traits[$namespacedName] = [ 'name' => $name, - 'namespacedName' => $namespacedName, + 'namespacedName' => (string) $namespacedName, 'namespace' => $this->namespace($namespacedName, $name), 'startLine' => $node->getStartLine(), 'endLine' => $node->getEndLine(), @@ -231,7 +237,7 @@ private function processMethod(ClassMethod $node): void return; } - assert($parentNode instanceof Class_ || $parentNode instanceof Trait_); + assert($parentNode instanceof Class_ || $parentNode instanceof Trait_ || $parentNode instanceof Enum_); assert(isset($parentNode->name)); assert(isset($parentNode->namespacedName)); assert($parentNode->namespacedName instanceof Name); @@ -290,4 +296,28 @@ private function namespace(string $namespacedName, string $name): string { return trim(rtrim($namespacedName, $name), '\\'); } + + /** + * @psalm-param UnionType|IntersectionType $type + */ + private function unionOrIntersectionAsString(ComplexType $type): string + { + if ($type instanceof UnionType) { + $separator = '|'; + } else { + $separator = '&'; + } + + $types = []; + + foreach ($type->types as $_type) { + if ($_type instanceof Name) { + $types[] = $_type->toCodeString(); + } else { + $types[] = $_type->toString(); + } + } + + return implode($separator, $types); + } } diff --git a/app/vendor/psr/container/composer.json b/app/vendor/psr/container/composer.json index 4bc837ac0..baf6cd1a0 100644 --- a/app/vendor/psr/container/composer.json +++ b/app/vendor/psr/container/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "autoload": { "psr-4": { diff --git a/app/vendor/psr/container/src/ContainerExceptionInterface.php b/app/vendor/psr/container/src/ContainerExceptionInterface.php index cf10b8b4f..0f213f2fe 100644 --- a/app/vendor/psr/container/src/ContainerExceptionInterface.php +++ b/app/vendor/psr/container/src/ContainerExceptionInterface.php @@ -2,9 +2,11 @@ namespace Psr\Container; +use Throwable; + /** * Base interface representing a generic exception in a container. */ -interface ContainerExceptionInterface +interface ContainerExceptionInterface extends Throwable { } diff --git a/app/vendor/sebastian/exporter/ChangeLog.md b/app/vendor/sebastian/exporter/ChangeLog.md index 913912c59..c691e81ab 100644 --- a/app/vendor/sebastian/exporter/ChangeLog.md +++ b/app/vendor/sebastian/exporter/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [4.0.4] - 2021-11-11 + +### Changed + +* [#37](https://github.com/sebastianbergmann/exporter/pull/37): Improve export of closed resources + ## [4.0.3] - 2020-09-28 ### Changed @@ -26,18 +32,33 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 7.0, PHP 7.1, and PHP 7.2 +## [3.1.4] - 2021-11-11 + +### Changed + +* [#38](https://github.com/sebastianbergmann/exporter/pull/38): Improve export of closed resources + +## [3.1.3] - 2020-11-30 + +### Changed + +* Changed PHP version constraint in `composer.json` from `^7.0` to `>=7.0` + ## [3.1.2] - 2019-09-14 ### Fixed -* Fixed [#29](https://github.com/sebastianbergmann/exporter/pull/29): Second parameter for `str_repeat()` must be an integer +* [#29](https://github.com/sebastianbergmann/exporter/pull/29): Second parameter for `str_repeat()` must be an integer ### Removed * Remove HHVM-specific code that is no longer needed +[4.0.4]: https://github.com/sebastianbergmann/exporter/compare/4.0.3...4.0.4 [4.0.3]: https://github.com/sebastianbergmann/exporter/compare/4.0.2...4.0.3 [4.0.2]: https://github.com/sebastianbergmann/exporter/compare/4.0.1...4.0.2 [4.0.1]: https://github.com/sebastianbergmann/exporter/compare/4.0.0...4.0.1 [4.0.0]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...4.0.0 +[3.1.4]: https://github.com/sebastianbergmann/exporter/compare/3.1.3...3.1.4 +[3.1.3]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...3.1.3 [3.1.2]: https://github.com/sebastianbergmann/exporter/compare/3.1.1...3.1.2 diff --git a/app/vendor/sebastian/exporter/LICENSE b/app/vendor/sebastian/exporter/LICENSE index aa33509cf..26dc7feca 100644 --- a/app/vendor/sebastian/exporter/LICENSE +++ b/app/vendor/sebastian/exporter/LICENSE @@ -1,6 +1,6 @@ Exporter -Copyright (c) 2002-2020, Sebastian Bergmann . +Copyright (c) 2002-2021, Sebastian Bergmann . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/app/vendor/sebastian/exporter/composer.json b/app/vendor/sebastian/exporter/composer.json index 477d5edd1..baa958443 100644 --- a/app/vendor/sebastian/exporter/composer.json +++ b/app/vendor/sebastian/exporter/composer.json @@ -2,7 +2,7 @@ "name": "sebastian/exporter", "description": "Provides the functionality to export PHP variables for visualization", "keywords": ["exporter","export"], - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "license": "BSD-3-Clause", "authors": [ { diff --git a/app/vendor/sebastian/exporter/src/Exporter.php b/app/vendor/sebastian/exporter/src/Exporter.php index e6fff5a49..692a0b21f 100644 --- a/app/vendor/sebastian/exporter/src/Exporter.php +++ b/app/vendor/sebastian/exporter/src/Exporter.php @@ -14,6 +14,7 @@ use function function_exists; use function get_class; use function get_resource_type; +use function gettype; use function implode; use function is_array; use function is_float; @@ -232,7 +233,11 @@ protected function recursiveExport(&$value, $indentation, $processed = null) } if (is_float($value) && (float) ((int) $value) === $value) { - return "$value.0"; + return "{$value}.0"; + } + + if (gettype($value) === 'resource (closed)') { + return 'resource (closed)'; } if (is_resource($value)) { @@ -262,7 +267,7 @@ protected function recursiveExport(&$value, $indentation, $processed = null) "'"; } - $whitespace = str_repeat(' ', (int) (4 * $indentation)); + $whitespace = str_repeat(' ', 4 * $indentation); if (!$processed) { $processed = new Context; diff --git a/app/vendor/symfony/config/Resource/GlobResource.php b/app/vendor/symfony/config/Resource/GlobResource.php index 2ac06986d..31937bc90 100644 --- a/app/vendor/symfony/config/Resource/GlobResource.php +++ b/app/vendor/symfony/config/Resource/GlobResource.php @@ -119,7 +119,7 @@ public function getIterator(): \Traversable } if (null !== $paths) { - sort($paths); + natsort($paths); foreach ($paths as $path) { if ($this->excludedPrefixes) { $normalizedPath = str_replace('\\', '/', $path); @@ -152,7 +152,7 @@ function (\SplFileInfo $file, $path) { ), \RecursiveIteratorIterator::LEAVES_ONLY )); - uasort($files, 'strnatcmp'); + uksort($files, 'strnatcmp'); foreach ($files as $path => $info) { if ($info->isFile()) { diff --git a/app/vendor/symfony/console/.gitignore b/app/vendor/symfony/console/.gitignore new file mode 100644 index 000000000..c49a5d8df --- /dev/null +++ b/app/vendor/symfony/console/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/app/vendor/symfony/console/Application.php b/app/vendor/symfony/console/Application.php index 769c65d63..e9e3defa1 100644 --- a/app/vendor/symfony/console/Application.php +++ b/app/vendor/symfony/console/Application.php @@ -13,19 +13,15 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\HelpCommand; -use Symfony\Component\Console\Command\LazyCommand; use Symfony\Component\Console\Command\ListCommand; -use Symfony\Component\Console\Command\SignalableCommandInterface; use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; use Symfony\Component\Console\Event\ConsoleCommandEvent; use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleSignalEvent; +use Symfony\Component\Console\Event\ConsoleExceptionEvent; use Symfony\Component\Console\Event\ConsoleTerminateEvent; use Symfony\Component\Console\Exception\CommandNotFoundException; use Symfony\Component\Console\Exception\ExceptionInterface; use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Exception\NamespaceNotFoundException; -use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Helper\DebugFormatterHelper; use Symfony\Component\Console\Helper\FormatterHelper; @@ -40,14 +36,13 @@ use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Input\StreamableInputInterface; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\SignalRegistry\SignalRegistry; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\ErrorHandler\ErrorHandler; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -use Symfony\Contracts\Service\ResetInterface; +use Symfony\Component\Debug\ErrorHandler; +use Symfony\Component\Debug\Exception\FatalThrowableError; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * An Application is the container for a collection of commands. @@ -64,7 +59,7 @@ * * @author Fabien Potencier */ -class Application implements ResetInterface +class Application { private $commands = []; private $wantHelps = false; @@ -81,24 +76,19 @@ class Application implements ResetInterface private $defaultCommand; private $singleCommand = false; private $initialized; - private $signalRegistry; - private $signalsToDispatchEvent = []; - public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') + /** + * @param string $name The name of the application + * @param string $version The version of the application + */ + public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN') { $this->name = $name; $this->version = $version; $this->terminal = new Terminal(); $this->defaultCommand = 'list'; - if (\defined('SIGINT') && SignalRegistry::isSupported()) { - $this->signalRegistry = new SignalRegistry(); - $this->signalsToDispatchEvent = [\SIGINT, \SIGTERM, \SIGUSR1, \SIGUSR2]; - } } - /** - * @final - */ public function setDispatcher(EventDispatcherInterface $dispatcher) { $this->dispatcher = $dispatcher; @@ -109,20 +99,6 @@ public function setCommandLoader(CommandLoaderInterface $commandLoader) $this->commandLoader = $commandLoader; } - public function getSignalRegistry(): SignalRegistry - { - if (!$this->signalRegistry) { - throw new RuntimeException('Signals are not supported. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - return $this->signalRegistry; - } - - public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) - { - $this->signalsToDispatchEvent = $signalsToDispatchEvent; - } - /** * Runs the current application. * @@ -132,10 +108,8 @@ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) */ public function run(InputInterface $input = null, OutputInterface $output = null) { - if (\function_exists('putenv')) { - @putenv('LINES='.$this->terminal->getHeight()); - @putenv('COLUMNS='.$this->terminal->getWidth()); - } + putenv('LINES='.$this->terminal->getHeight()); + putenv('COLUMNS='.$this->terminal->getWidth()); if (null === $input) { $input = new ArgvInput(); @@ -145,22 +119,29 @@ public function run(InputInterface $input = null, OutputInterface $output = null $output = new ConsoleOutput(); } - $renderException = function (\Throwable $e) use ($output) { + $renderException = function ($e) use ($output) { + if (!$e instanceof \Exception) { + $e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine()); + } if ($output instanceof ConsoleOutputInterface) { - $this->renderThrowable($e, $output->getErrorOutput()); + $this->renderException($e, $output->getErrorOutput()); } else { - $this->renderThrowable($e, $output); + $this->renderException($e, $output); } }; if ($phpHandler = set_exception_handler($renderException)) { restore_exception_handler(); if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) { - $errorHandler = true; - } elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) { - $phpHandler[0]->setExceptionHandler($errorHandler); + $debugHandler = true; + } elseif ($debugHandler = $phpHandler[0]->setExceptionHandler($renderException)) { + $phpHandler[0]->setExceptionHandler($debugHandler); } } + if (null !== $this->dispatcher && $this->dispatcher->hasListeners(ConsoleEvents::EXCEPTION)) { + @trigger_error(sprintf('The "ConsoleEvents::EXCEPTION" event is deprecated since Symfony 3.3 and will be removed in 4.0. Listen to the "ConsoleEvents::ERROR" event instead.'), \E_USER_DEPRECATED); + } + $this->configureIO($input, $output); try { @@ -189,7 +170,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null restore_exception_handler(); } restore_exception_handler(); - } elseif (!$errorHandler) { + } elseif (!$debugHandler) { $finalHandler = $phpHandler[0]->setExceptionHandler(null); if ($finalHandler !== $renderException) { $phpHandler[0]->setExceptionHandler($finalHandler); @@ -250,45 +231,24 @@ public function doRun(InputInterface $input, OutputInterface $output) } try { - $this->runningCommand = null; + $e = $this->runningCommand = null; // the command name MUST be the first element of the input $command = $this->find($name); + } catch (\Exception $e) { } catch (\Throwable $e) { - if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - if (0 === $event->getExitCode()) { - return 0; - } - - $e = $event->getError(); - } - - throw $e; - } - - $alternative = $alternatives[0]; - - $style = new SymfonyStyle($input, $output); - $style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error'); - if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); + } + if (null !== $e) { + if (null !== $this->dispatcher) { + $event = new ConsoleErrorEvent($input, $output, $e); + $this->dispatcher->dispatch(ConsoleEvents::ERROR, $event); + $e = $event->getError(); - return $event->getExitCode(); + if (0 === $event->getExitCode()) { + return 0; } - - return 1; } - $command = $this->find($alternative); - } - - if ($command instanceof LazyCommand) { - $command = $command->getCommand(); + throw $e; } $this->runningCommand = $command; @@ -298,13 +258,6 @@ public function doRun(InputInterface $input, OutputInterface $output) return $exitCode; } - /** - * {@inheritdoc} - */ - public function reset() - { - } - public function setHelperSet(HelperSet $helperSet) { $this->helperSet = $helperSet; @@ -372,10 +325,12 @@ public function areExceptionsCaught() /** * Sets whether to catch exceptions or not during commands execution. + * + * @param bool $boolean Whether to catch exceptions or not during commands execution */ - public function setCatchExceptions(bool $boolean) + public function setCatchExceptions($boolean) { - $this->catchExceptions = $boolean; + $this->catchExceptions = (bool) $boolean; } /** @@ -390,10 +345,12 @@ public function isAutoExitEnabled() /** * Sets whether to automatically exit after a command execution or not. + * + * @param bool $boolean Whether to automatically exit after a command execution or not */ - public function setAutoExit(bool $boolean) + public function setAutoExit($boolean) { - $this->autoExit = $boolean; + $this->autoExit = (bool) $boolean; } /** @@ -408,8 +365,10 @@ public function getName() /** * Sets the application name. - **/ - public function setName(string $name) + * + * @param string $name The application name + */ + public function setName($name) { $this->name = $name; } @@ -426,8 +385,10 @@ public function getVersion() /** * Sets the application version. + * + * @param string $version The application version */ - public function setVersion(string $version) + public function setVersion($version) { $this->version = $version; } @@ -453,9 +414,11 @@ public function getLongVersion() /** * Registers a new command. * + * @param string $name The command name + * * @return Command The newly created command */ - public function register(string $name) + public function register($name) { return $this->add(new Command($name)); } @@ -494,13 +457,11 @@ public function add(Command $command) return null; } - if (!$command instanceof LazyCommand) { - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - } + // Will throw if the command is not correctly initialized. + $command->getDefinition(); if (!$command->getName()) { - throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command))); + throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', \get_class($command))); } $this->commands[$command->getName()] = $command; @@ -515,11 +476,13 @@ public function add(Command $command) /** * Returns a registered command by name or alias. * + * @param string $name The command name or alias + * * @return Command A Command object * * @throws CommandNotFoundException When given command name does not exist */ - public function get(string $name) + public function get($name) { $this->init(); @@ -549,9 +512,11 @@ public function get(string $name) /** * Returns true if the command exists, false otherwise. * + * @param string $name The command name or alias + * * @return bool true if the command exists, false otherwise */ - public function has(string $name) + public function has($name) { $this->init(); @@ -586,14 +551,16 @@ public function getNamespaces() /** * Finds a registered namespace by a name or an abbreviation. * + * @param string $namespace A namespace or abbreviation to search for + * * @return string A registered namespace * - * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous + * @throws CommandNotFoundException When namespace is incorrect or ambiguous */ - public function findNamespace(string $namespace) + public function findNamespace($namespace) { $allNamespaces = $this->getNamespaces(); - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*'; + $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $namespace); $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); if (empty($namespaces)) { @@ -609,12 +576,12 @@ public function findNamespace(string $namespace) $message .= implode("\n ", $alternatives); } - throw new NamespaceNotFoundException($message, $alternatives); + throw new CommandNotFoundException($message, $alternatives); } $exact = \in_array($namespace, $namespaces, true); if (\count($namespaces) > 1 && !$exact) { - throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); + throw new CommandNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); } return $exact ? $namespace : reset($namespaces); @@ -626,11 +593,13 @@ public function findNamespace(string $namespace) * Contrary to get, this command tries to find the best * match if you give it an abbreviation of a name or alias. * + * @param string $name A command name or a command alias + * * @return Command A Command instance * * @throws CommandNotFoundException When command name is incorrect or ambiguous */ - public function find(string $name) + public function find($name) { $this->init(); @@ -649,7 +618,7 @@ public function find(string $name) } $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands); - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))).'[^:]*'; + $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name); $commands = preg_grep('{^'.$expr.'}', $allCommands); if (empty($commands)) { @@ -698,39 +667,29 @@ public function find(string $name) })); } - if (\count($commands) > 1) { + $exact = \in_array($name, $commands, true) || isset($aliases[$name]); + if (\count($commands) > 1 && !$exact) { $usableWidth = $this->terminal->getWidth() - 10; $abbrevs = array_values($commands); $maxLen = 0; foreach ($abbrevs as $abbrev) { - $maxLen = max(Helper::width($abbrev), $maxLen); + $maxLen = max(Helper::strlen($abbrev), $maxLen); } - $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { + $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen) { if ($commandList[$cmd]->isHidden()) { - unset($commands[array_search($cmd, $commands)]); - return false; } $abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription(); - return Helper::width($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev; + return Helper::strlen($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev; }, array_values($commands)); + $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs)); - if (\count($commands) > 1) { - $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs)); - - throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); - } - } - - $command = $this->get(reset($commands)); - - if ($command->isHidden()) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); + throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); } - return $command; + return $this->get($exact ? $name : reset($commands)); } /** @@ -738,9 +697,11 @@ public function find(string $name) * * The array keys are the full names and the values the command instances. * + * @param string $namespace A namespace name + * * @return Command[] An array of Command instances */ - public function all(string $namespace = null) + public function all($namespace = null) { $this->init(); @@ -780,9 +741,11 @@ public function all(string $namespace = null) /** * Returns an array of possible abbreviations given a set of names. * - * @return string[][] An array of abbreviations + * @param array $names An array of names + * + * @return array An array of abbreviations */ - public static function getAbbreviations(array $names) + public static function getAbbreviations($names) { $abbrevs = []; foreach ($names as $name) { @@ -795,42 +758,42 @@ public static function getAbbreviations(array $names) return $abbrevs; } - public function renderThrowable(\Throwable $e, OutputInterface $output): void + /** + * Renders a caught exception. + */ + public function renderException(\Exception $e, OutputInterface $output) { $output->writeln('', OutputInterface::VERBOSITY_QUIET); - $this->doRenderThrowable($e, $output); + $this->doRenderException($e, $output); if (null !== $this->runningCommand) { - $output->writeln(sprintf('%s', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); + $output->writeln(sprintf('%s', sprintf($this->runningCommand->getSynopsis(), $this->getName())), OutputInterface::VERBOSITY_QUIET); $output->writeln('', OutputInterface::VERBOSITY_QUIET); } } - protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void + protected function doRenderException(\Exception $e, OutputInterface $output) { do { $message = trim($e->getMessage()); if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $class = get_debug_type($e); - $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); - $len = Helper::width($title); + $title = sprintf(' [%s%s] ', \get_class($e), 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); + $len = Helper::strlen($title); } else { $len = 0; } - if (str_contains($message, "@anonymous\0")) { - $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $message); - } - $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX; + // HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327 + if (\defined('HHVM_VERSION') && $width > 1 << 31) { + $width = 1 << 31; + } $lines = []; foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) { foreach ($this->splitStringByWidth($line, $width - 4) as $line) { // pre-format lines to get the right string length - $lineLength = Helper::width($line) + 4; + $lineLength = Helper::strlen($line) + 4; $lines[] = [$line, $lineLength]; $len = max($lineLength, $len); @@ -843,7 +806,7 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo } $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title)))); + $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::strlen($title)))); } foreach ($lines as $line) { $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); @@ -867,11 +830,11 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo ]); for ($i = 0, $count = \count($trace); $i < $count; ++$i) { - $class = $trace[$i]['class'] ?? ''; - $type = $trace[$i]['type'] ?? ''; - $function = $trace[$i]['function'] ?? ''; - $file = $trace[$i]['file'] ?? 'n/a'; - $line = $trace[$i]['line'] ?? 'n/a'; + $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : ''; + $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : ''; + $function = isset($trace[$i]['function']) ? $trace[$i]['function'] : ''; + $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a'; + $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a'; $output->writeln(sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); } @@ -881,6 +844,70 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo } while ($e = $e->getPrevious()); } + /** + * Tries to figure out the terminal width in which this application runs. + * + * @return int|null + * + * @deprecated since version 3.2, to be removed in 4.0. Create a Terminal instance instead. + */ + protected function getTerminalWidth() + { + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), \E_USER_DEPRECATED); + + return $this->terminal->getWidth(); + } + + /** + * Tries to figure out the terminal height in which this application runs. + * + * @return int|null + * + * @deprecated since version 3.2, to be removed in 4.0. Create a Terminal instance instead. + */ + protected function getTerminalHeight() + { + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), \E_USER_DEPRECATED); + + return $this->terminal->getHeight(); + } + + /** + * Tries to figure out the terminal dimensions based on the current environment. + * + * @return array Array containing width and height + * + * @deprecated since version 3.2, to be removed in 4.0. Create a Terminal instance instead. + */ + public function getTerminalDimensions() + { + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.2 and will be removed in 4.0. Create a Terminal instance instead.', __METHOD__), \E_USER_DEPRECATED); + + return [$this->terminal->getWidth(), $this->terminal->getHeight()]; + } + + /** + * Sets terminal dimensions. + * + * Can be useful to force terminal dimensions for functional tests. + * + * @param int $width The width + * @param int $height The height + * + * @return $this + * + * @deprecated since version 3.2, to be removed in 4.0. Set the COLUMNS and LINES env vars instead. + */ + public function setTerminalDimensions($width, $height) + { + @trigger_error(sprintf('The "%s()" method is deprecated as of 3.2 and will be removed in 4.0. Set the COLUMNS and LINES env vars instead.', __METHOD__), \E_USER_DEPRECATED); + + putenv('COLUMNS='.$width); + putenv('LINES='.$height); + + return $this; + } + /** * Configures the input and output instances based on the user arguments and options. */ @@ -894,6 +921,22 @@ protected function configureIO(InputInterface $input, OutputInterface $output) if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) { $input->setInteractive(false); + } elseif (\function_exists('posix_isatty')) { + $inputStream = null; + + if ($input instanceof StreamableInputInterface) { + $inputStream = $input->getStream(); + } + + // This check ensures that calling QuestionHelper::setInputStream() works + // To be removed in 4.0 (in the same time as QuestionHelper::setInputStream) + if (!$inputStream && $this->getHelperSet()->has('question')) { + $inputStream = $this->getHelperSet()->get('question')->getInputStream(false); + } + + if (!@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) { + $input->setInteractive(false); + } } switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { @@ -924,9 +967,7 @@ protected function configureIO(InputInterface $input, OutputInterface $output) $input->setInteractive(false); } - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$shellVerbosity); - } + putenv('SHELL_VERBOSITY='.$shellVerbosity); $_ENV['SHELL_VERBOSITY'] = $shellVerbosity; $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity; } @@ -947,33 +988,6 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI } } - if ($command instanceof SignalableCommandInterface && ($this->signalsToDispatchEvent || $command->getSubscribedSignals())) { - if (!$this->signalRegistry) { - throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - if ($this->dispatcher) { - foreach ($this->signalsToDispatchEvent as $signal) { - $event = new ConsoleSignalEvent($command, $input, $output, $signal); - - $this->signalRegistry->register($signal, function ($signal, $hasNext) use ($event) { - $this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL); - - // No more handlers, we try to simulate PHP default behavior - if (!$hasNext) { - if (!\in_array($signal, [\SIGUSR1, \SIGUSR2], true)) { - exit(0); - } - } - }); - } - } - - foreach ($command->getSubscribedSignals() as $signal) { - $this->signalRegistry->register($signal, [$command, 'handleSignal']); - } - } - if (null === $this->dispatcher) { return $command->run($input, $output); } @@ -990,16 +1004,28 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI $e = null; try { - $this->dispatcher->dispatch($event, ConsoleEvents::COMMAND); + $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event); if ($event->commandShouldRun()) { $exitCode = $command->run($input, $output); } else { $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED; } + } catch (\Exception $e) { } catch (\Throwable $e) { + } + if (null !== $e) { + if ($this->dispatcher->hasListeners(ConsoleEvents::EXCEPTION)) { + $x = $e instanceof \Exception ? $e : new FatalThrowableError($e); + $event = new ConsoleExceptionEvent($command, $input, $output, $x, $x->getCode()); + $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event); + + if ($x !== $event->getException()) { + $e = $event->getException(); + } + } $event = new ConsoleErrorEvent($input, $output, $e, $command); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); + $this->dispatcher->dispatch(ConsoleEvents::ERROR, $event); $e = $event->getError(); if (0 === $exitCode = $event->getExitCode()) { @@ -1008,7 +1034,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI } $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); - $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE); + $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event); if (null !== $e) { throw $e; @@ -1036,11 +1062,13 @@ protected function getDefaultInputDefinition() { return new InputDefinition([ new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the '.$this->defaultCommand.' command'), + + new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'), new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), - new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', false), + new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'), + new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'), new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), ]); } @@ -1072,8 +1100,12 @@ protected function getDefaultHelperSet() /** * Returns abbreviated suggestions in string format. + * + * @param array $abbrevs Abbreviated suggestions to convert + * + * @return string A formatted string of abbreviated suggestions */ - private function getAbbreviationSuggestions(array $abbrevs): string + private function getAbbreviationSuggestions($abbrevs) { return ' '.implode("\n ", $abbrevs); } @@ -1083,9 +1115,12 @@ private function getAbbreviationSuggestions(array $abbrevs): string * * This method is not part of public API and should not be used directly. * + * @param string $name The full name of the command + * @param string $limit The maximum number of parts of the namespace + * * @return string The namespace of the command */ - public function extractNamespace(string $name, int $limit = null) + public function extractNamespace($name, $limit = null) { $parts = explode(':', $name, -1); @@ -1096,9 +1131,12 @@ public function extractNamespace(string $name, int $limit = null) * Finds alternative of $name among $collection, * if nothing is found in $collection, try in $abbrevs. * + * @param string $name The string + * @param iterable $collection The collection + * * @return string[] A sorted array of similar string */ - private function findAlternatives(string $name, iterable $collection): array + private function findAlternatives($name, $collection) { $threshold = 1e3; $alternatives = []; @@ -1119,7 +1157,7 @@ private function findAlternatives(string $name, iterable $collection): array } $lev = levenshtein($subname, $parts[$i]); - if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) { + if ($lev <= \strlen($subname) / 3 || '' !== $subname && false !== strpos($parts[$i], $subname)) { $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; } elseif ($exists) { $alternatives[$collectionName] += $threshold; @@ -1129,7 +1167,7 @@ private function findAlternatives(string $name, iterable $collection): array foreach ($collection as $item) { $lev = levenshtein($name, $item); - if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) { + if ($lev <= \strlen($name) / 3 || false !== strpos($item, $name)) { $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev; } } @@ -1143,11 +1181,14 @@ private function findAlternatives(string $name, iterable $collection): array /** * Sets the default Command name. * + * @param string $commandName The Command name + * @param bool $isSingleCommand Set to true if there is only one command in this application + * * @return self */ - public function setDefaultCommand(string $commandName, bool $isSingleCommand = false) + public function setDefaultCommand($commandName, $isSingleCommand = false) { - $this->defaultCommand = explode('|', ltrim($commandName, '|'))[0]; + $this->defaultCommand = $commandName; if ($isSingleCommand) { // Ensure the command exist @@ -1162,12 +1203,12 @@ public function setDefaultCommand(string $commandName, bool $isSingleCommand = f /** * @internal */ - public function isSingleCommand(): bool + public function isSingleCommand() { return $this->singleCommand; } - private function splitStringByWidth(string $string, int $width): array + private function splitStringByWidth($string, $width) { // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. // additionally, array_slice() is not enough as some character has doubled width. @@ -1179,21 +1220,15 @@ private function splitStringByWidth(string $string, int $width): array $utf8String = mb_convert_encoding($string, 'utf8', $encoding); $lines = []; $line = ''; - - $offset = 0; - while (preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) { - $offset += \strlen($m[0]); - - foreach (preg_split('//u', $m[0]) as $char) { - // test if $char could be appended to current line - if (mb_strwidth($line.$char, 'utf8') <= $width) { - $line .= $char; - continue; - } - // if not, push current line to array and make new line - $lines[] = str_pad($line, $width); - $line = $char; + foreach (preg_split('//u', $utf8String) as $char) { + // test if $char could be appended to current line + if (mb_strwidth($line.$char, 'utf8') <= $width) { + $line .= $char; + continue; } + // if not, push current line to array and make new line + $lines[] = str_pad($line, $width); + $line = $char; } $lines[] = \count($lines) ? str_pad($line, $width) : $line; @@ -1206,9 +1241,11 @@ private function splitStringByWidth(string $string, int $width): array /** * Returns all namespaces of the command name. * + * @param string $name The full name of the command + * * @return string[] The namespaces of the command */ - private function extractAllNamespaces(string $name): array + private function extractAllNamespaces($name) { // -1 as third argument is needed to skip the command short name when exploding $parts = explode(':', $name, -1); diff --git a/app/vendor/symfony/console/Attribute/AsCommand.php b/app/vendor/symfony/console/Attribute/AsCommand.php deleted file mode 100644 index b337f548f..000000000 --- a/app/vendor/symfony/console/Attribute/AsCommand.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Attribute; - -/** - * Service tag to autoconfigure commands. - */ -#[\Attribute(\Attribute::TARGET_CLASS)] -class AsCommand -{ - public function __construct( - public string $name, - public ?string $description = null, - array $aliases = [], - bool $hidden = false, - ) { - if (!$hidden && !$aliases) { - return; - } - - $name = explode('|', $name); - $name = array_merge($name, $aliases); - - if ($hidden && '' !== $name[0]) { - array_unshift($name, ''); - } - - $this->name = implode('|', $name); - } -} diff --git a/app/vendor/symfony/console/CHANGELOG.md b/app/vendor/symfony/console/CHANGELOG.md index 880856386..6dba1a4de 100644 --- a/app/vendor/symfony/console/CHANGELOG.md +++ b/app/vendor/symfony/console/CHANGELOG.md @@ -1,104 +1,6 @@ CHANGELOG ========= -5.3 ---- - - * Add `GithubActionReporter` to render annotations in a Github Action - * Add `InputOption::VALUE_NEGATABLE` flag to handle `--foo`/`--no-foo` options - * Add the `Command::$defaultDescription` static property and the `description` attribute - on the `console.command` tag to allow the `list` command to instantiate commands lazily - * Add option `--short` to the `list` command - * Add support for bright colors - * Add `#[AsCommand]` attribute for declaring commands on PHP 8 - * Add `Helper::width()` and `Helper::length()` - -5.2.0 ------ - - * Added `SingleCommandApplication::setAutoExit()` to allow testing via `CommandTester` - * added support for multiline responses to questions through `Question::setMultiline()` - and `Question::isMultiline()` - * Added `SignalRegistry` class to stack signals handlers - * Added support for signals: - * Added `Application::getSignalRegistry()` and `Application::setSignalsToDispatchEvent()` methods - * Added `SignalableCommandInterface` interface - * Added `TableCellStyle` class to customize table cell - * Removed `php ` prefix invocation from help messages. - -5.1.0 ------ - - * `Command::setHidden()` is final since Symfony 5.1 - * Add `SingleCommandApplication` - * Add `Cursor` class - -5.0.0 ------ - - * removed support for finding hidden commands using an abbreviation, use the full name instead - * removed `TableStyle::setCrossingChar()` method in favor of `TableStyle::setDefaultCrossingChar()` - * removed `TableStyle::setHorizontalBorderChar()` method in favor of `TableStyle::setDefaultCrossingChars()` - * removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()` - * removed `TableStyle::setVerticalBorderChar()` method in favor of `TableStyle::setVerticalBorderChars()` - * removed `TableStyle::getVerticalBorderChar()` method in favor of `TableStyle::getBorderChars()` - * removed support for returning `null` from `Command::execute()`, return `0` instead - * `ProcessHelper::run()` accepts only `array|Symfony\Component\Process\Process` for its `command` argument - * `Application::setDispatcher` accepts only `Symfony\Contracts\EventDispatcher\EventDispatcherInterface` - for its `dispatcher` argument - * renamed `Application::renderException()` and `Application::doRenderException()` - to `renderThrowable()` and `doRenderThrowable()` respectively. - -4.4.0 ------ - - * deprecated finding hidden commands using an abbreviation, use the full name instead - * added `Question::setTrimmable` default to true to allow the answer to be trimmed - * added method `minSecondsBetweenRedraws()` and `maxSecondsBetweenRedraws()` on `ProgressBar` - * `Application` implements `ResetInterface` - * marked all dispatched event classes as `@final` - * added support for displaying table horizontally - * deprecated returning `null` from `Command::execute()`, return `0` instead - * Deprecated the `Application::renderException()` and `Application::doRenderException()` methods, - use `renderThrowable()` and `doRenderThrowable()` instead. - * added support for the `NO_COLOR` env var (https://no-color.org/) - -4.3.0 ------ - - * added support for hyperlinks - * added `ProgressBar::iterate()` method that simplify updating the progress bar when iterating - * added `Question::setAutocompleterCallback()` to provide a callback function - that dynamically generates suggestions as the user types - -4.2.0 ------ - - * allowed passing commands as `[$process, 'ENV_VAR' => 'value']` to - `ProcessHelper::run()` to pass environment variables - * deprecated passing a command as a string to `ProcessHelper::run()`, - pass it the command as an array of its arguments instead - * made the `ProcessHelper` class final - * added `WrappableOutputFormatterInterface::formatAndWrap()` (implemented in `OutputFormatter`) - * added `capture_stderr_separately` option to `CommandTester::execute()` - -4.1.0 ------ - - * added option to run suggested command if command is not found and only 1 alternative is available - * added option to modify console output and print multiple modifiable sections - * added support for iterable messages in output `write` and `writeln` methods - -4.0.0 ------ - - * `OutputFormatter` throws an exception when unknown options are used - * removed `QuestionHelper::setInputStream()/getInputStream()` - * removed `Application::getTerminalWidth()/getTerminalHeight()` and - `Application::setTerminalDimensions()/getTerminalDimensions()` - * removed `ConsoleExceptionEvent` - * removed `ConsoleEvents::EXCEPTION` - 3.4.0 ----- @@ -114,23 +16,23 @@ CHANGELOG 3.3.0 ----- - * added `ExceptionListener` - * added `AddConsoleCommandPass` (originally in FrameworkBundle) - * [BC BREAK] `Input::getOption()` no longer returns the default value for options - with value optional explicitly passed empty - * added console.error event to catch exceptions thrown by other listeners - * deprecated console.exception event in favor of console.error - * added ability to handle `CommandNotFoundException` through the - `console.error` event - * deprecated default validation in `SymfonyQuestionHelper::ask` +* added `ExceptionListener` +* added `AddConsoleCommandPass` (originally in FrameworkBundle) +* [BC BREAK] `Input::getOption()` no longer returns the default value for options + with value optional explicitly passed empty +* added console.error event to catch exceptions thrown by other listeners +* deprecated console.exception event in favor of console.error +* added ability to handle `CommandNotFoundException` through the + `console.error` event +* deprecated default validation in `SymfonyQuestionHelper::ask` 3.2.0 ------ - * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs - * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) - * added StreamableInputInterface - * added LockableTrait +* added `setInputs()` method to CommandTester for ease testing of commands expecting inputs +* added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) +* added StreamableInputInterface +* added LockableTrait 3.1.0 ----- diff --git a/app/vendor/symfony/console/CI/GithubActionReporter.php b/app/vendor/symfony/console/CI/GithubActionReporter.php deleted file mode 100644 index a15c1ff18..000000000 --- a/app/vendor/symfony/console/CI/GithubActionReporter.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CI; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Utility class for Github actions. - * - * @author Maxime Steinhausser - */ -class GithubActionReporter -{ - private $output; - - /** - * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L80-L85 - */ - private const ESCAPED_DATA = [ - '%' => '%25', - "\r" => '%0D', - "\n" => '%0A', - ]; - - /** - * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L87-L94 - */ - private const ESCAPED_PROPERTIES = [ - '%' => '%25', - "\r" => '%0D', - "\n" => '%0A', - ':' => '%3A', - ',' => '%2C', - ]; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - } - - public static function isGithubActionEnvironment(): bool - { - return false !== getenv('GITHUB_ACTIONS'); - } - - /** - * Output an error using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message - */ - public function error(string $message, string $file = null, int $line = null, int $col = null): void - { - $this->log('error', $message, $file, $line, $col); - } - - /** - * Output a warning using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message - */ - public function warning(string $message, string $file = null, int $line = null, int $col = null): void - { - $this->log('warning', $message, $file, $line, $col); - } - - /** - * Output a debug log using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message - */ - public function debug(string $message, string $file = null, int $line = null, int $col = null): void - { - $this->log('debug', $message, $file, $line, $col); - } - - private function log(string $type, string $message, string $file = null, int $line = null, int $col = null): void - { - // Some values must be encoded. - $message = strtr($message, self::ESCAPED_DATA); - - if (!$file) { - // No file provided, output the message solely: - $this->output->writeln(sprintf('::%s::%s', $type, $message)); - - return; - } - - $this->output->writeln(sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message)); - } -} diff --git a/app/vendor/symfony/console/Color.php b/app/vendor/symfony/console/Color.php deleted file mode 100644 index 22a4ce9ff..000000000 --- a/app/vendor/symfony/console/Color.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Fabien Potencier - */ -final class Color -{ - private const COLORS = [ - 'black' => 0, - 'red' => 1, - 'green' => 2, - 'yellow' => 3, - 'blue' => 4, - 'magenta' => 5, - 'cyan' => 6, - 'white' => 7, - 'default' => 9, - ]; - - private const BRIGHT_COLORS = [ - 'gray' => 0, - 'bright-red' => 1, - 'bright-green' => 2, - 'bright-yellow' => 3, - 'bright-blue' => 4, - 'bright-magenta' => 5, - 'bright-cyan' => 6, - 'bright-white' => 7, - ]; - - private const AVAILABLE_OPTIONS = [ - 'bold' => ['set' => 1, 'unset' => 22], - 'underscore' => ['set' => 4, 'unset' => 24], - 'blink' => ['set' => 5, 'unset' => 25], - 'reverse' => ['set' => 7, 'unset' => 27], - 'conceal' => ['set' => 8, 'unset' => 28], - ]; - - private $foreground; - private $background; - private $options = []; - - public function __construct(string $foreground = '', string $background = '', array $options = []) - { - $this->foreground = $this->parseColor($foreground); - $this->background = $this->parseColor($background, true); - - foreach ($options as $option) { - if (!isset(self::AVAILABLE_OPTIONS[$option])) { - throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS)))); - } - - $this->options[$option] = self::AVAILABLE_OPTIONS[$option]; - } - } - - public function apply(string $text): string - { - return $this->set().$text.$this->unset(); - } - - public function set(): string - { - $setCodes = []; - if ('' !== $this->foreground) { - $setCodes[] = $this->foreground; - } - if ('' !== $this->background) { - $setCodes[] = $this->background; - } - foreach ($this->options as $option) { - $setCodes[] = $option['set']; - } - if (0 === \count($setCodes)) { - return ''; - } - - return sprintf("\033[%sm", implode(';', $setCodes)); - } - - public function unset(): string - { - $unsetCodes = []; - if ('' !== $this->foreground) { - $unsetCodes[] = 39; - } - if ('' !== $this->background) { - $unsetCodes[] = 49; - } - foreach ($this->options as $option) { - $unsetCodes[] = $option['unset']; - } - if (0 === \count($unsetCodes)) { - return ''; - } - - return sprintf("\033[%sm", implode(';', $unsetCodes)); - } - - private function parseColor(string $color, bool $background = false): string - { - if ('' === $color) { - return ''; - } - - if ('#' === $color[0]) { - $color = substr($color, 1); - - if (3 === \strlen($color)) { - $color = $color[0].$color[0].$color[1].$color[1].$color[2].$color[2]; - } - - if (6 !== \strlen($color)) { - throw new InvalidArgumentException(sprintf('Invalid "%s" color.', $color)); - } - - return ($background ? '4' : '3').$this->convertHexColorToAnsi(hexdec($color)); - } - - if (isset(self::COLORS[$color])) { - return ($background ? '4' : '3').self::COLORS[$color]; - } - - if (isset(self::BRIGHT_COLORS[$color])) { - return ($background ? '10' : '9').self::BRIGHT_COLORS[$color]; - } - - throw new InvalidArgumentException(sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS))))); - } - - private function convertHexColorToAnsi(int $color): string - { - $r = ($color >> 16) & 255; - $g = ($color >> 8) & 255; - $b = $color & 255; - - // see https://github.com/termstandard/colors/ for more information about true color support - if ('truecolor' !== getenv('COLORTERM')) { - return (string) $this->degradeHexColorToAnsi($r, $g, $b); - } - - return sprintf('8;2;%d;%d;%d', $r, $g, $b); - } - - private function degradeHexColorToAnsi(int $r, int $g, int $b): int - { - if (0 === round($this->getSaturation($r, $g, $b) / 50)) { - return 0; - } - - return (round($b / 255) << 2) | (round($g / 255) << 1) | round($r / 255); - } - - private function getSaturation(int $r, int $g, int $b): int - { - $r = $r / 255; - $g = $g / 255; - $b = $b / 255; - $v = max($r, $g, $b); - - if (0 === $diff = $v - min($r, $g, $b)) { - return 0; - } - - return (int) $diff * 100 / $v; - } -} diff --git a/app/vendor/symfony/console/Command/Command.php b/app/vendor/symfony/console/Command/Command.php index 3b09d99f4..d896f67fd 100644 --- a/app/vendor/symfony/console/Command/Command.php +++ b/app/vendor/symfony/console/Command/Command.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Console\Command; use Symfony\Component\Console\Application; -use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Exception\ExceptionInterface; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Exception\LogicException; @@ -30,21 +29,11 @@ */ class Command { - // see https://tldp.org/LDP/abs/html/exitcodes.html - public const SUCCESS = 0; - public const FAILURE = 1; - public const INVALID = 2; - /** * @var string|null The default command name */ protected static $defaultName; - /** - * @var string|null The default command description - */ - protected static $defaultDescription; - private $application; private $name; private $processTitle; @@ -53,8 +42,9 @@ class Command private $hidden = false; private $help = ''; private $description = ''; - private $fullDefinition; private $ignoreValidationErrors = false; + private $applicationDefinitionMerged = false; + private $applicationDefinitionMergedWithArgs = false; private $code; private $synopsis = []; private $usages = []; @@ -66,60 +56,24 @@ class Command public static function getDefaultName() { $class = static::class; - - if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { - return $attribute[0]->newInstance()->name; - } - $r = new \ReflectionProperty($class, 'defaultName'); return $class === $r->class ? static::$defaultName : null; } - /** - * @return string|null The default command description or null when no default description is set - */ - public static function getDefaultDescription(): ?string - { - $class = static::class; - - if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { - return $attribute[0]->newInstance()->description; - } - - $r = new \ReflectionProperty($class, 'defaultDescription'); - - return $class === $r->class ? static::$defaultDescription : null; - } - /** * @param string|null $name The name of the command; passing null means it must be set in configure() * * @throws LogicException When the command name is empty */ - public function __construct(string $name = null) + public function __construct($name = null) { $this->definition = new InputDefinition(); - if (null === $name && null !== $name = static::getDefaultName()) { - $aliases = explode('|', $name); - - if ('' === $name = array_shift($aliases)) { - $this->setHidden(true); - $name = array_shift($aliases); - } - - $this->setAliases($aliases); - } - - if (null !== $name) { + if (null !== $name || null !== $name = static::getDefaultName()) { $this->setName($name); } - if ('' === $this->description) { - $this->setDescription(static::getDefaultDescription() ?? ''); - } - $this->configure(); } @@ -141,8 +95,6 @@ public function setApplication(Application $application = null) } else { $this->helperSet = null; } - - $this->fullDefinition = null; } public function setHelperSet(HelperSet $helperSet) @@ -198,7 +150,7 @@ protected function configure() * execute() method, you set the code to execute by passing * a Closure to the setCode() method. * - * @return int 0 if everything went fine, or an exit code + * @return int|null null or 0 if everything went fine, or an error code * * @throws LogicException When this abstract method is not implemented * @@ -250,12 +202,16 @@ protected function initialize(InputInterface $input, OutputInterface $output) */ public function run(InputInterface $input, OutputInterface $output) { + // force the creation of the synopsis before the merge with the app definition + $this->getSynopsis(true); + $this->getSynopsis(false); + // add the application arguments and options $this->mergeApplicationDefinition(); // bind the input against the command specific arguments/options try { - $input->bind($this->getDefinition()); + $input->bind($this->definition); } catch (ExceptionInterface $e) { if (!$this->ignoreValidationErrors) { throw $e; @@ -294,13 +250,9 @@ public function run(InputInterface $input, OutputInterface $output) $input->validate(); if ($this->code) { - $statusCode = ($this->code)($input, $output); + $statusCode = \call_user_func($this->code, $input, $output); } else { $statusCode = $this->execute($input, $output); - - if (!\is_int($statusCode)) { - throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, "%s" returned.', static::class, get_debug_type($statusCode))); - } } return is_numeric($statusCode) ? (int) $statusCode : 0; @@ -325,13 +277,14 @@ public function setCode(callable $code) if ($code instanceof \Closure) { $r = new \ReflectionFunction($code); if (null === $r->getClosureThis()) { - set_error_handler(static function () {}); - try { - if ($c = \Closure::bind($code, $this)) { - $code = $c; - } - } finally { - restore_error_handler(); + if (\PHP_VERSION_ID < 70000) { + // Bug in PHP5: https://bugs.php.net/64761 + // This means that we cannot bind static closures and therefore we must + // ignore any errors here. There is no way to test if the closure is + // bindable. + $code = @\Closure::bind($code, $this); + } else { + $code = \Closure::bind($code, $this); } } } @@ -347,24 +300,23 @@ public function setCode(callable $code) * This method is not part of public API and should not be used directly. * * @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments - * - * @internal */ - public function mergeApplicationDefinition(bool $mergeArgs = true) + public function mergeApplicationDefinition($mergeArgs = true) { - if (null === $this->application) { + if (null === $this->application || (true === $this->applicationDefinitionMerged && ($this->applicationDefinitionMergedWithArgs || !$mergeArgs))) { return; } - $this->fullDefinition = new InputDefinition(); - $this->fullDefinition->setOptions($this->definition->getOptions()); - $this->fullDefinition->addOptions($this->application->getDefinition()->getOptions()); + $this->definition->addOptions($this->application->getDefinition()->getOptions()); + + $this->applicationDefinitionMerged = true; if ($mergeArgs) { - $this->fullDefinition->setArguments($this->application->getDefinition()->getArguments()); - $this->fullDefinition->addArguments($this->definition->getArguments()); - } else { - $this->fullDefinition->setArguments($this->definition->getArguments()); + $currentArguments = $this->definition->getArguments(); + $this->definition->setArguments($this->application->getDefinition()->getArguments()); + $this->definition->addArguments($currentArguments); + + $this->applicationDefinitionMergedWithArgs = true; } } @@ -383,7 +335,7 @@ public function setDefinition($definition) $this->definition->setDefinition($definition); } - $this->fullDefinition = null; + $this->applicationDefinitionMerged = false; return $this; } @@ -395,7 +347,11 @@ public function setDefinition($definition) */ public function getDefinition() { - return $this->fullDefinition ?? $this->getNativeDefinition(); + if (null === $this->definition) { + throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); + } + + return $this->definition; } /** @@ -410,29 +366,24 @@ public function getDefinition() */ public function getNativeDefinition() { - if (null === $this->definition) { - throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); - } - - return $this->definition; + return $this->getDefinition(); } /** * Adds an argument. * - * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL - * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) + * @param string $name The argument name + * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL + * @param string $description A description text + * @param string|string[]|null $default The default value (for InputArgument::OPTIONAL mode only) * * @throws InvalidArgumentException When argument mode is not valid * * @return $this */ - public function addArgument(string $name, int $mode = null, string $description = '', $default = null) + public function addArgument($name, $mode = null, $description = '', $default = null) { $this->definition->addArgument(new InputArgument($name, $mode, $description, $default)); - if (null !== $this->fullDefinition) { - $this->fullDefinition->addArgument(new InputArgument($name, $mode, $description, $default)); - } return $this; } @@ -440,20 +391,19 @@ public function addArgument(string $name, int $mode = null, string $description /** * Adds an option. * - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants - * @param mixed $default The default value (must be null for InputOption::VALUE_NONE) + * @param string $name The option name + * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants + * @param string $description A description text + * @param string|string[]|int|bool|null $default The default value (must be null for InputOption::VALUE_NONE) * * @throws InvalidArgumentException If option mode is invalid or incompatible * * @return $this */ - public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) + public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null) { $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); - if (null !== $this->fullDefinition) { - $this->fullDefinition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); - } return $this; } @@ -466,11 +416,13 @@ public function addOption(string $name, $shortcut = null, int $mode = null, stri * * $command->setName('foo:bar'); * + * @param string $name The command name + * * @return $this * * @throws InvalidArgumentException When the name is invalid */ - public function setName(string $name) + public function setName($name) { $this->validateName($name); @@ -485,9 +437,11 @@ public function setName(string $name) * This feature should be used only when creating a long process command, * like a daemon. * + * @param string $title The process title + * * @return $this */ - public function setProcessTitle(string $title) + public function setProcessTitle($title) { $this->processTitle = $title; @@ -506,15 +460,12 @@ public function getName() /** * @param bool $hidden Whether or not the command should be hidden from the list of commands - * The default value will be true in Symfony 6.0 - * - * @return $this * - * @final since Symfony 5.1 + * @return Command The current instance */ - public function setHidden(bool $hidden /*= true*/) + public function setHidden($hidden) { - $this->hidden = $hidden; + $this->hidden = (bool) $hidden; return $this; } @@ -530,9 +481,11 @@ public function isHidden() /** * Sets the description for the command. * + * @param string $description The description for the command + * * @return $this */ - public function setDescription(string $description) + public function setDescription($description) { $this->description = $description; @@ -552,9 +505,11 @@ public function getDescription() /** * Sets the help for the command. * + * @param string $help The help for the command + * * @return $this */ - public function setHelp(string $help) + public function setHelp($help) { $this->help = $help; @@ -603,16 +558,17 @@ public function getProcessedHelp() * * @throws InvalidArgumentException When an alias is invalid */ - public function setAliases(iterable $aliases) + public function setAliases($aliases) { - $list = []; + if (!\is_array($aliases) && !$aliases instanceof \Traversable) { + throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable.'); + } foreach ($aliases as $alias) { $this->validateName($alias); - $list[] = $alias; } - $this->aliases = \is_array($aliases) ? $aliases : $list; + $this->aliases = $aliases; return $this; } @@ -634,7 +590,7 @@ public function getAliases() * * @return string The synopsis */ - public function getSynopsis(bool $short = false) + public function getSynopsis($short = false) { $key = $short ? 'short' : 'long'; @@ -646,13 +602,15 @@ public function getSynopsis(bool $short = false) } /** - * Add a command usage example, it'll be prefixed with the command name. + * Add a command usage example. + * + * @param string $usage The usage, it'll be prefixed with the command name * * @return $this */ - public function addUsage(string $usage) + public function addUsage($usage) { - if (!str_starts_with($usage, $this->name)) { + if (0 !== strpos($usage, $this->name)) { $usage = sprintf('%s %s', $this->name, $usage); } @@ -674,12 +632,14 @@ public function getUsages() /** * Gets a helper instance by name. * + * @param string $name The helper name + * * @return mixed The helper value * * @throws LogicException if no HelperSet is defined * @throws InvalidArgumentException if the helper is not defined */ - public function getHelper(string $name) + public function getHelper($name) { if (null === $this->helperSet) { throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); @@ -693,9 +653,11 @@ public function getHelper(string $name) * * It must be non-empty and parts can optionally be separated by ":". * + * @param string $name + * * @throws InvalidArgumentException When the name is invalid */ - private function validateName(string $name) + private function validateName($name) { if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); diff --git a/app/vendor/symfony/console/Command/HelpCommand.php b/app/vendor/symfony/console/Command/HelpCommand.php index 9bcd7764d..23847766b 100644 --- a/app/vendor/symfony/console/Command/HelpCommand.php +++ b/app/vendor/symfony/console/Command/HelpCommand.php @@ -40,15 +40,15 @@ protected function configure() new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), ]) - ->setDescription('Display help for a command') + ->setDescription('Displays help for a command') ->setHelp(<<<'EOF' The %command.name% command displays help for a given command: - %command.full_name% list + php %command.full_name% list You can also output the help in other formats by using the --format option: - %command.full_name% --format=xml list + php %command.full_name% --format=xml list To display the list of available commands, please use the list command. EOF @@ -77,7 +77,5 @@ protected function execute(InputInterface $input, OutputInterface $output) ]); $this->command = null; - - return 0; } } diff --git a/app/vendor/symfony/console/Command/LazyCommand.php b/app/vendor/symfony/console/Command/LazyCommand.php deleted file mode 100644 index 763133e81..000000000 --- a/app/vendor/symfony/console/Command/LazyCommand.php +++ /dev/null @@ -1,211 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Nicolas Grekas - */ -final class LazyCommand extends Command -{ - private $command; - private $isEnabled; - - public function __construct(string $name, array $aliases, string $description, bool $isHidden, \Closure $commandFactory, ?bool $isEnabled = true) - { - $this->setName($name) - ->setAliases($aliases) - ->setHidden($isHidden) - ->setDescription($description); - - $this->command = $commandFactory; - $this->isEnabled = $isEnabled; - } - - public function ignoreValidationErrors(): void - { - $this->getCommand()->ignoreValidationErrors(); - } - - public function setApplication(Application $application = null): void - { - if ($this->command instanceof parent) { - $this->command->setApplication($application); - } - - parent::setApplication($application); - } - - public function setHelperSet(HelperSet $helperSet): void - { - if ($this->command instanceof parent) { - $this->command->setHelperSet($helperSet); - } - - parent::setHelperSet($helperSet); - } - - public function isEnabled(): bool - { - return $this->isEnabled ?? $this->getCommand()->isEnabled(); - } - - public function run(InputInterface $input, OutputInterface $output): int - { - return $this->getCommand()->run($input, $output); - } - - /** - * @return $this - */ - public function setCode(callable $code): self - { - $this->getCommand()->setCode($code); - - return $this; - } - - /** - * @internal - */ - public function mergeApplicationDefinition(bool $mergeArgs = true): void - { - $this->getCommand()->mergeApplicationDefinition($mergeArgs); - } - - /** - * @return $this - */ - public function setDefinition($definition): self - { - $this->getCommand()->setDefinition($definition); - - return $this; - } - - public function getDefinition(): InputDefinition - { - return $this->getCommand()->getDefinition(); - } - - public function getNativeDefinition(): InputDefinition - { - return $this->getCommand()->getNativeDefinition(); - } - - /** - * @return $this - */ - public function addArgument(string $name, int $mode = null, string $description = '', $default = null): self - { - $this->getCommand()->addArgument($name, $mode, $description, $default); - - return $this; - } - - /** - * @return $this - */ - public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null): self - { - $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default); - - return $this; - } - - /** - * @return $this - */ - public function setProcessTitle(string $title): self - { - $this->getCommand()->setProcessTitle($title); - - return $this; - } - - /** - * @return $this - */ - public function setHelp(string $help): self - { - $this->getCommand()->setHelp($help); - - return $this; - } - - public function getHelp(): string - { - return $this->getCommand()->getHelp(); - } - - public function getProcessedHelp(): string - { - return $this->getCommand()->getProcessedHelp(); - } - - public function getSynopsis(bool $short = false): string - { - return $this->getCommand()->getSynopsis($short); - } - - /** - * @return $this - */ - public function addUsage(string $usage): self - { - $this->getCommand()->addUsage($usage); - - return $this; - } - - public function getUsages(): array - { - return $this->getCommand()->getUsages(); - } - - /** - * @return mixed - */ - public function getHelper(string $name) - { - return $this->getCommand()->getHelper($name); - } - - public function getCommand(): parent - { - if (!$this->command instanceof \Closure) { - return $this->command; - } - - $command = $this->command = ($this->command)(); - $command->setApplication($this->getApplication()); - - if (null !== $this->getHelperSet()) { - $command->setHelperSet($this->getHelperSet()); - } - - $command->setName($this->getName()) - ->setAliases($this->getAliases()) - ->setHidden($this->isHidden()) - ->setDescription($this->getDescription()); - - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - - return $command; - } -} diff --git a/app/vendor/symfony/console/Command/ListCommand.php b/app/vendor/symfony/console/Command/ListCommand.php index a19228512..7259b1263 100644 --- a/app/vendor/symfony/console/Command/ListCommand.php +++ b/app/vendor/symfony/console/Command/ListCommand.php @@ -13,6 +13,7 @@ use Symfony\Component\Console\Helper\DescriptorHelper; use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -31,34 +32,37 @@ protected function configure() { $this ->setName('list') - ->setDefinition([ - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), - new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments'), - ]) - ->setDescription('List commands') + ->setDefinition($this->createDefinition()) + ->setDescription('Lists commands') ->setHelp(<<<'EOF' The %command.name% command lists all commands: - %command.full_name% + php %command.full_name% You can also display the commands for a specific namespace: - %command.full_name% test + php %command.full_name% test You can also output the information in other formats by using the --format option: - %command.full_name% --format=xml + php %command.full_name% --format=xml It's also possible to get raw list of commands (useful for embedding command runner): - %command.full_name% --raw + php %command.full_name% --raw EOF ) ; } + /** + * {@inheritdoc} + */ + public function getNativeDefinition() + { + return $this->createDefinition(); + } + /** * {@inheritdoc} */ @@ -69,9 +73,18 @@ protected function execute(InputInterface $input, OutputInterface $output) 'format' => $input->getOption('format'), 'raw_text' => $input->getOption('raw'), 'namespace' => $input->getArgument('namespace'), - 'short' => $input->getOption('short'), ]); + } - return 0; + /** + * {@inheritdoc} + */ + private function createDefinition() + { + return new InputDefinition([ + new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), + new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), + ]); } } diff --git a/app/vendor/symfony/console/Command/LockableTrait.php b/app/vendor/symfony/console/Command/LockableTrait.php index 60cfe360f..308ebf28c 100644 --- a/app/vendor/symfony/console/Command/LockableTrait.php +++ b/app/vendor/symfony/console/Command/LockableTrait.php @@ -12,8 +12,9 @@ namespace Symfony\Component\Console\Command; use Symfony\Component\Console\Exception\LogicException; +use Symfony\Component\Console\Exception\RuntimeException; +use Symfony\Component\Lock\Factory; use Symfony\Component\Lock\Lock; -use Symfony\Component\Lock\LockFactory; use Symfony\Component\Lock\Store\FlockStore; use Symfony\Component\Lock\Store\SemaphoreStore; @@ -29,24 +30,26 @@ trait LockableTrait /** * Locks a command. + * + * @return bool */ - private function lock(string $name = null, bool $blocking = false): bool + private function lock($name = null, $blocking = false) { if (!class_exists(SemaphoreStore::class)) { - throw new LogicException('To enable the locking feature you must install the symfony/lock component.'); + throw new RuntimeException('To enable the locking feature you must install the symfony/lock component.'); } if (null !== $this->lock) { throw new LogicException('A lock is already in place.'); } - if (SemaphoreStore::isSupported()) { + if (SemaphoreStore::isSupported($blocking)) { $store = new SemaphoreStore(); } else { $store = new FlockStore(); } - $this->lock = (new LockFactory($store))->createLock($name ?: $this->getName()); + $this->lock = (new Factory($store))->createLock($name ?: $this->getName()); if (!$this->lock->acquire($blocking)) { $this->lock = null; diff --git a/app/vendor/symfony/console/Command/SignalableCommandInterface.php b/app/vendor/symfony/console/Command/SignalableCommandInterface.php deleted file mode 100644 index d439728b6..000000000 --- a/app/vendor/symfony/console/Command/SignalableCommandInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -/** - * Interface for command reacting to signal. - * - * @author Grégoire Pineau - */ -interface SignalableCommandInterface -{ - /** - * Returns the list of signals to subscribe. - */ - public function getSubscribedSignals(): array; - - /** - * The method will be called when the application is signaled. - */ - public function handleSignal(int $signal): void; -} diff --git a/app/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php b/app/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php index d4f44e88f..ca1029cb6 100644 --- a/app/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php +++ b/app/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php @@ -22,18 +22,22 @@ interface CommandLoaderInterface /** * Loads a command. * + * @param string $name + * * @return Command * * @throws CommandNotFoundException */ - public function get(string $name); + public function get($name); /** * Checks if a command exists. * + * @param string $name + * * @return bool */ - public function has(string $name); + public function has($name); /** * @return string[] All registered command names diff --git a/app/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/app/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php index ddccb3d45..8000c7d5e 100644 --- a/app/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php +++ b/app/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php @@ -25,7 +25,8 @@ class ContainerCommandLoader implements CommandLoaderInterface private $commandMap; /** - * @param array $commandMap An array with command names as keys and service ids as values + * @param ContainerInterface $container A container from which to load command services + * @param array $commandMap An array with command names as keys and service ids as values */ public function __construct(ContainerInterface $container, array $commandMap) { @@ -36,7 +37,7 @@ public function __construct(ContainerInterface $container, array $commandMap) /** * {@inheritdoc} */ - public function get(string $name) + public function get($name) { if (!$this->has($name)) { throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); @@ -48,7 +49,7 @@ public function get(string $name) /** * {@inheritdoc} */ - public function has(string $name) + public function has($name) { return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]); } diff --git a/app/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/app/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php index 7e2db3464..d9c205571 100644 --- a/app/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php +++ b/app/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php @@ -33,7 +33,7 @@ public function __construct(array $factories) /** * {@inheritdoc} */ - public function has(string $name) + public function has($name) { return isset($this->factories[$name]); } @@ -41,7 +41,7 @@ public function has(string $name) /** * {@inheritdoc} */ - public function get(string $name) + public function get($name) { if (!isset($this->factories[$name])) { throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); diff --git a/app/vendor/symfony/console/ConsoleEvents.php b/app/vendor/symfony/console/ConsoleEvents.php index 6ae8f32b8..bf6cab9a1 100644 --- a/app/vendor/symfony/console/ConsoleEvents.php +++ b/app/vendor/symfony/console/ConsoleEvents.php @@ -11,11 +11,6 @@ namespace Symfony\Component\Console; -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleSignalEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; - /** * Contains all events dispatched by an Application. * @@ -26,19 +21,11 @@ final class ConsoleEvents /** * The COMMAND event allows you to attach listeners before any command is * executed by the console. It also allows you to modify the command, input and output - * before they are handed to the command. + * before they are handled to the command. * * @Event("Symfony\Component\Console\Event\ConsoleCommandEvent") */ - public const COMMAND = 'console.command'; - - /** - * The SIGNAL event allows you to perform some actions - * after the command execution was interrupted. - * - * @Event("Symfony\Component\Console\Event\ConsoleSignalEvent") - */ - public const SIGNAL = 'console.signal'; + const COMMAND = 'console.command'; /** * The TERMINATE event allows you to attach listeners after a command is @@ -46,27 +33,28 @@ final class ConsoleEvents * * @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent") */ - public const TERMINATE = 'console.terminate'; + const TERMINATE = 'console.terminate'; /** - * The ERROR event occurs when an uncaught exception or error appears. + * The EXCEPTION event occurs when an uncaught exception appears + * while executing Command#run(). * - * This event allows you to deal with the exception/error or + * This event allows you to deal with the exception or * to modify the thrown exception. * - * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") + * @Event("Symfony\Component\Console\Event\ConsoleExceptionEvent") + * + * @deprecated The console.exception event is deprecated since version 3.3 and will be removed in 4.0. Use the console.error event instead. */ - public const ERROR = 'console.error'; + const EXCEPTION = 'console.exception'; /** - * Event aliases. + * The ERROR event occurs when an uncaught exception or error appears. * - * These aliases can be consumed by RegisterListenersPass. + * This event allows you to deal with the exception/error or + * to modify the thrown exception. + * + * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") */ - public const ALIASES = [ - ConsoleCommandEvent::class => self::COMMAND, - ConsoleErrorEvent::class => self::ERROR, - ConsoleSignalEvent::class => self::SIGNAL, - ConsoleTerminateEvent::class => self::TERMINATE, - ]; + const ERROR = 'console.error'; } diff --git a/app/vendor/symfony/console/Cursor.php b/app/vendor/symfony/console/Cursor.php deleted file mode 100644 index dcb5b5ad3..000000000 --- a/app/vendor/symfony/console/Cursor.php +++ /dev/null @@ -1,168 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Pierre du Plessis - */ -final class Cursor -{ - private $output; - private $input; - - public function __construct(OutputInterface $output, $input = null) - { - $this->output = $output; - $this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+')); - } - - public function moveUp(int $lines = 1): self - { - $this->output->write(sprintf("\x1b[%dA", $lines)); - - return $this; - } - - public function moveDown(int $lines = 1): self - { - $this->output->write(sprintf("\x1b[%dB", $lines)); - - return $this; - } - - public function moveRight(int $columns = 1): self - { - $this->output->write(sprintf("\x1b[%dC", $columns)); - - return $this; - } - - public function moveLeft(int $columns = 1): self - { - $this->output->write(sprintf("\x1b[%dD", $columns)); - - return $this; - } - - public function moveToColumn(int $column): self - { - $this->output->write(sprintf("\x1b[%dG", $column)); - - return $this; - } - - public function moveToPosition(int $column, int $row): self - { - $this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column)); - - return $this; - } - - public function savePosition(): self - { - $this->output->write("\x1b7"); - - return $this; - } - - public function restorePosition(): self - { - $this->output->write("\x1b8"); - - return $this; - } - - public function hide(): self - { - $this->output->write("\x1b[?25l"); - - return $this; - } - - public function show(): self - { - $this->output->write("\x1b[?25h\x1b[?0c"); - - return $this; - } - - /** - * Clears all the output from the current line. - */ - public function clearLine(): self - { - $this->output->write("\x1b[2K"); - - return $this; - } - - /** - * Clears all the output from the current line after the current position. - */ - public function clearLineAfter(): self - { - $this->output->write("\x1b[K"); - - return $this; - } - - /** - * Clears all the output from the cursors' current position to the end of the screen. - */ - public function clearOutput(): self - { - $this->output->write("\x1b[0J"); - - return $this; - } - - /** - * Clears the entire screen. - */ - public function clearScreen(): self - { - $this->output->write("\x1b[2J"); - - return $this; - } - - /** - * Returns the current cursor position as x,y coordinates. - */ - public function getCurrentPosition(): array - { - static $isTtySupported; - - if (null === $isTtySupported && \function_exists('proc_open')) { - $isTtySupported = (bool) @proc_open('echo 1 >/dev/null', [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']], $pipes); - } - - if (!$isTtySupported) { - return [1, 1]; - } - - $sttyMode = shell_exec('stty -g'); - shell_exec('stty -icanon -echo'); - - @fwrite($this->input, "\033[6n"); - - $code = trim(fread($this->input, 1024)); - - shell_exec(sprintf('stty %s', $sttyMode)); - - sscanf($code, "\033[%d;%dR", $row, $col); - - return [$col, $row]; - } -} diff --git a/app/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/app/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php index 743e306d0..f656d6a86 100644 --- a/app/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ b/app/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php @@ -12,14 +12,11 @@ namespace Symfony\Component\Console\DependencyInjection; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\LazyCommand; use Symfony\Component\Console\CommandLoader\ContainerCommandLoader; -use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\TypedReference; /** @@ -31,19 +28,11 @@ class AddConsoleCommandPass implements CompilerPassInterface { private $commandLoaderServiceId; private $commandTag; - private $noPreloadTag; - private $privateTagName; - public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command', string $noPreloadTag = 'container.no_preload', string $privateTagName = 'container.private') + public function __construct($commandLoaderServiceId = 'console.command_loader', $commandTag = 'console.command') { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/console', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - $this->commandLoaderServiceId = $commandLoaderServiceId; $this->commandTag = $commandTag; - $this->noPreloadTag = $noPreloadTag; - $this->privateTagName = $privateTagName; } public function process(ContainerBuilder $container) @@ -52,14 +41,16 @@ public function process(ContainerBuilder $container) $lazyCommandMap = []; $lazyCommandRefs = []; $serviceIds = []; + $lazyServiceIds = []; foreach ($commandServices as $id => $tags) { $definition = $container->getDefinition($id); - $definition->addTag($this->noPreloadTag); $class = $container->getParameterBag()->resolveValue($definition->getClass()); + $commandId = 'console.command.'.strtolower(str_replace('\\', '_', $class)); + if (isset($tags[0]['command'])) { - $aliases = $tags[0]['command']; + $commandName = $tags[0]['command']; } else { if (!$r = $container->getReflectionClass($class)) { throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); @@ -67,44 +58,34 @@ public function process(ContainerBuilder $container) if (!$r->isSubclassOf(Command::class)) { throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); } - $aliases = $class::getDefaultName(); - } - - $aliases = explode('|', $aliases ?? ''); - $commandName = array_shift($aliases); - - if ($isHidden = '' === $commandName) { - $commandName = array_shift($aliases); + $commandName = $class::getDefaultName(); } if (null === $commandName) { - if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag($this->privateTagName)) { - $commandId = 'console.command.public_alias.'.$id; + if (isset($serviceIds[$commandId]) || $container->hasAlias($commandId)) { + $commandId = $commandId.'_'.$id; + } + if (!$definition->isPublic() || $definition->isPrivate()) { $container->setAlias($commandId, $id)->setPublic(true); $id = $commandId; } - $serviceIds[] = $id; + $serviceIds[$commandId] = $id; continue; } - $description = $tags[0]['description'] ?? null; - + $serviceIds[$commandId] = $id; + $lazyServiceIds[$id] = true; unset($tags[0]); $lazyCommandMap[$commandName] = $id; $lazyCommandRefs[$id] = new TypedReference($id, $class); - - foreach ($aliases as $alias) { - $lazyCommandMap[$alias] = $id; - } + $aliases = []; foreach ($tags as $tag) { if (isset($tag['command'])) { $aliases[] = $tag['command']; $lazyCommandMap[$tag['command']] = $id; } - - $description = $description ?? $tag['description'] ?? null; } $definition->addMethodCall('setName', [$commandName]); @@ -112,37 +93,14 @@ public function process(ContainerBuilder $container) if ($aliases) { $definition->addMethodCall('setAliases', [$aliases]); } - - if ($isHidden) { - $definition->addMethodCall('setHidden', [true]); - } - - if (!$description) { - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); - } - $description = $class::getDefaultDescription(); - } - - if ($description) { - $definition->addMethodCall('setDescription', [$description]); - - $container->register('.'.$id.'.lazy', LazyCommand::class) - ->setArguments([$commandName, $aliases, $description, $isHidden, new ServiceClosureArgument($lazyCommandRefs[$id])]); - - $lazyCommandRefs[$id] = new Reference('.'.$id.'.lazy'); - } } $container ->register($this->commandLoaderServiceId, ContainerCommandLoader::class) ->setPublic(true) - ->addTag($this->noPreloadTag) ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]); $container->setParameter('console.command.ids', $serviceIds); + $container->setParameter('console.lazy_command.ids', $lazyServiceIds); } } diff --git a/app/vendor/symfony/console/Descriptor/ApplicationDescription.php b/app/vendor/symfony/console/Descriptor/ApplicationDescription.php index 3970b9000..65b53084f 100644 --- a/app/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ b/app/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -22,7 +22,7 @@ */ class ApplicationDescription { - public const GLOBAL_NAMESPACE = '_global'; + const GLOBAL_NAMESPACE = '_global'; private $application; private $namespace; @@ -43,14 +43,21 @@ class ApplicationDescription */ private $aliases; - public function __construct(Application $application, string $namespace = null, bool $showHidden = false) + /** + * @param string|null $namespace + * @param bool $showHidden + */ + public function __construct(Application $application, $namespace = null, $showHidden = false) { $this->application = $application; $this->namespace = $namespace; $this->showHidden = $showHidden; } - public function getNamespaces(): array + /** + * @return array + */ + public function getNamespaces() { if (null === $this->namespaces) { $this->inspectApplication(); @@ -62,7 +69,7 @@ public function getNamespaces(): array /** * @return Command[] */ - public function getCommands(): array + public function getCommands() { if (null === $this->commands) { $this->inspectApplication(); @@ -72,15 +79,19 @@ public function getCommands(): array } /** + * @param string $name + * + * @return Command + * * @throws CommandNotFoundException */ - public function getCommand(string $name): Command + public function getCommand($name) { if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); } - return $this->commands[$name] ?? $this->aliases[$name]; + return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name]; } private function inspectApplication() @@ -111,7 +122,10 @@ private function inspectApplication() } } - private function sortCommands(array $commands): array + /** + * @return array + */ + private function sortCommands(array $commands) { $namespacedCommands = []; $globalCommands = []; diff --git a/app/vendor/symfony/console/Descriptor/Descriptor.php b/app/vendor/symfony/console/Descriptor/Descriptor.php index a3648301f..d25a708e4 100644 --- a/app/vendor/symfony/console/Descriptor/Descriptor.php +++ b/app/vendor/symfony/console/Descriptor/Descriptor.php @@ -34,7 +34,7 @@ abstract class Descriptor implements DescriptorInterface /** * {@inheritdoc} */ - public function describe(OutputInterface $output, object $object, array $options = []) + public function describe(OutputInterface $output, $object, array $options = []) { $this->output = $output; @@ -55,40 +55,53 @@ public function describe(OutputInterface $output, object $object, array $options $this->describeApplication($object, $options); break; default: - throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))); + throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', \get_class($object))); } } /** * Writes content to output. + * + * @param string $content + * @param bool $decorated */ - protected function write(string $content, bool $decorated = false) + protected function write($content, $decorated = false) { $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW); } /** * Describes an InputArgument instance. + * + * @return string|mixed */ abstract protected function describeInputArgument(InputArgument $argument, array $options = []); /** * Describes an InputOption instance. + * + * @return string|mixed */ abstract protected function describeInputOption(InputOption $option, array $options = []); /** * Describes an InputDefinition instance. + * + * @return string|mixed */ abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []); /** * Describes a Command instance. + * + * @return string|mixed */ abstract protected function describeCommand(Command $command, array $options = []); /** * Describes an Application instance. + * + * @return string|mixed */ abstract protected function describeApplication(Application $application, array $options = []); } diff --git a/app/vendor/symfony/console/Descriptor/DescriptorInterface.php b/app/vendor/symfony/console/Descriptor/DescriptorInterface.php index ebea30367..e3184a6a5 100644 --- a/app/vendor/symfony/console/Descriptor/DescriptorInterface.php +++ b/app/vendor/symfony/console/Descriptor/DescriptorInterface.php @@ -20,5 +20,10 @@ */ interface DescriptorInterface { - public function describe(OutputInterface $output, object $object, array $options = []); + /** + * Describes an object if supported. + * + * @param object $object + */ + public function describe(OutputInterface $output, $object, array $options = []); } diff --git a/app/vendor/symfony/console/Descriptor/JsonDescriptor.php b/app/vendor/symfony/console/Descriptor/JsonDescriptor.php index 1d2865941..e51c31db5 100644 --- a/app/vendor/symfony/console/Descriptor/JsonDescriptor.php +++ b/app/vendor/symfony/console/Descriptor/JsonDescriptor.php @@ -40,9 +40,6 @@ protected function describeInputArgument(InputArgument $argument, array $options protected function describeInputOption(InputOption $option, array $options = []) { $this->writeData($this->getInputOptionData($option), $options); - if ($option->isNegatable()) { - $this->writeData($this->getInputOptionData($option, true), $options); - } } /** @@ -58,7 +55,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o */ protected function describeCommand(Command $command, array $options = []) { - $this->writeData($this->getCommandData($command, $options['short'] ?? false), $options); + $this->writeData($this->getCommandData($command), $options); } /** @@ -66,12 +63,12 @@ protected function describeCommand(Command $command, array $options = []) */ protected function describeApplication(Application $application, array $options = []) { - $describedNamespace = $options['namespace'] ?? null; + $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; $description = new ApplicationDescription($application, $describedNamespace, true); $commands = []; foreach ($description->getCommands() as $command) { - $commands[] = $this->getCommandData($command, $options['short'] ?? false); + $commands[] = $this->getCommandData($command); } $data = []; @@ -98,12 +95,15 @@ protected function describeApplication(Application $application, array $options */ private function writeData(array $data, array $options) { - $flags = $options['json_encoding'] ?? 0; + $flags = isset($options['json_encoding']) ? $options['json_encoding'] : 0; $this->write(json_encode($data, $flags)); } - private function getInputArgumentData(InputArgument $argument): array + /** + * @return array + */ + private function getInputArgumentData(InputArgument $argument) { return [ 'name' => $argument->getName(), @@ -114,17 +114,12 @@ private function getInputArgumentData(InputArgument $argument): array ]; } - private function getInputOptionData(InputOption $option, bool $negated = false): array + /** + * @return array + */ + private function getInputOptionData(InputOption $option) { - return $negated ? [ - 'name' => '--no-'.$option->getName(), - 'shortcut' => '', - 'accept_value' => false, - 'is_value_required' => false, - 'is_multiple' => false, - 'description' => 'Negate the "--'.$option->getName().'" option', - 'default' => false, - ] : [ + return [ 'name' => '--'.$option->getName(), 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', 'accept_value' => $option->acceptValue(), @@ -135,7 +130,10 @@ private function getInputOptionData(InputOption $option, bool $negated = false): ]; } - private function getInputDefinitionData(InputDefinition $definition): array + /** + * @return array + */ + private function getInputDefinitionData(InputDefinition $definition) { $inputArguments = []; foreach ($definition->getArguments() as $name => $argument) { @@ -145,37 +143,26 @@ private function getInputDefinitionData(InputDefinition $definition): array $inputOptions = []; foreach ($definition->getOptions() as $name => $option) { $inputOptions[$name] = $this->getInputOptionData($option); - if ($option->isNegatable()) { - $inputOptions['no-'.$name] = $this->getInputOptionData($option, true); - } } return ['arguments' => $inputArguments, 'options' => $inputOptions]; } - private function getCommandData(Command $command, bool $short = false): array + /** + * @return array + */ + private function getCommandData(Command $command) { - $data = [ + $command->getSynopsis(); + $command->mergeApplicationDefinition(false); + + return [ 'name' => $command->getName(), + 'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()), 'description' => $command->getDescription(), + 'help' => $command->getProcessedHelp(), + 'definition' => $this->getInputDefinitionData($command->getNativeDefinition()), + 'hidden' => $command->isHidden(), ]; - - if ($short) { - $data += [ - 'usage' => $command->getAliases(), - ]; - } else { - $command->mergeApplicationDefinition(false); - - $data += [ - 'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()), - 'help' => $command->getProcessedHelp(), - 'definition' => $this->getInputDefinitionData($command->getDefinition()), - ]; - } - - $data['hidden'] = $command->isHidden(); - - return $data; } } diff --git a/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php index 21ceca6c2..e6245778f 100644 --- a/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ b/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php @@ -31,7 +31,7 @@ class MarkdownDescriptor extends Descriptor /** * {@inheritdoc} */ - public function describe(OutputInterface $output, object $object, array $options = []) + public function describe(OutputInterface $output, $object, array $options = []) { $decorated = $output->isDecorated(); $output->setDecorated(false); @@ -44,7 +44,7 @@ public function describe(OutputInterface $output, object $object, array $options /** * {@inheritdoc} */ - protected function write(string $content, bool $decorated = true) + protected function write($content, $decorated = true) { parent::write($content, $decorated); } @@ -69,9 +69,6 @@ protected function describeInputArgument(InputArgument $argument, array $options protected function describeInputOption(InputOption $option, array $options = []) { $name = '--'.$option->getName(); - if ($option->isNegatable()) { - $name .= '|--no-'.$option->getName(); - } if ($option->getShortcut()) { $name .= '|-'.str_replace('|', '|-', $option->getShortcut()).''; } @@ -82,7 +79,6 @@ protected function describeInputOption(InputOption $option, array $options = []) .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n" .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n" .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n" - .'* Is negatable: '.($option->isNegatable() ? 'yes' : 'no')."\n" .'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`' ); } @@ -96,9 +92,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o $this->write('### Arguments'); foreach ($definition->getArguments() as $argument) { $this->write("\n\n"); - if (null !== $describeInputArgument = $this->describeInputArgument($argument)) { - $this->write($describeInputArgument); - } + $this->write($this->describeInputArgument($argument)); } } @@ -110,9 +104,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o $this->write('### Options'); foreach ($definition->getOptions() as $option) { $this->write("\n\n"); - if (null !== $describeInputOption = $this->describeInputOption($option)) { - $this->write($describeInputOption); - } + $this->write($this->describeInputOption($option)); } } } @@ -122,25 +114,12 @@ protected function describeInputDefinition(InputDefinition $definition, array $o */ protected function describeCommand(Command $command, array $options = []) { - if ($options['short'] ?? false) { - $this->write( - '`'.$command->getName()."`\n" - .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - .'### Usage'."\n\n" - .array_reduce($command->getAliases(), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) - ); - - return; - } - + $command->getSynopsis(); $command->mergeApplicationDefinition(false); $this->write( '`'.$command->getName()."`\n" - .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" + .str_repeat('-', Helper::strlen($command->getName()) + 2)."\n\n" .($command->getDescription() ? $command->getDescription()."\n\n" : '') .'### Usage'."\n\n" .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) { @@ -153,10 +132,9 @@ protected function describeCommand(Command $command, array $options = []) $this->write($help); } - $definition = $command->getDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { + if ($command->getNativeDefinition()) { $this->write("\n\n"); - $this->describeInputDefinition($definition); + $this->describeInputDefinition($command->getNativeDefinition()); } } @@ -165,11 +143,11 @@ protected function describeCommand(Command $command, array $options = []) */ protected function describeApplication(Application $application, array $options = []) { - $describedNamespace = $options['namespace'] ?? null; + $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; $description = new ApplicationDescription($application, $describedNamespace); $title = $this->getApplicationTitle($application); - $this->write($title."\n".str_repeat('=', Helper::width($title))); + $this->write($title."\n".str_repeat('=', Helper::strlen($title))); foreach ($description->getNamespaces() as $namespace) { if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { @@ -185,13 +163,11 @@ protected function describeApplication(Application $application, array $options foreach ($description->getCommands() as $command) { $this->write("\n\n"); - if (null !== $describeCommand = $this->describeCommand($command, $options)) { - $this->write($describeCommand); - } + $this->write($this->describeCommand($command)); } } - private function getApplicationTitle(Application $application): string + private function getApplicationTitle(Application $application) { if ('UNKNOWN' !== $application->getName()) { if ('UNKNOWN' !== $application->getVersion()) { diff --git a/app/vendor/symfony/console/Descriptor/TextDescriptor.php b/app/vendor/symfony/console/Descriptor/TextDescriptor.php index fbb140ae7..9ca56ce9d 100644 --- a/app/vendor/symfony/console/Descriptor/TextDescriptor.php +++ b/app/vendor/symfony/console/Descriptor/TextDescriptor.php @@ -39,7 +39,7 @@ protected function describeInputArgument(InputArgument $argument, array $options $default = ''; } - $totalWidth = $options['total_width'] ?? Helper::width($argument->getName()); + $totalWidth = isset($options['total_width']) ? $options['total_width'] : Helper::strlen($argument->getName()); $spacingWidth = $totalWidth - \strlen($argument->getName()); $this->writeText(sprintf(' %s %s%s%s', @@ -71,13 +71,13 @@ protected function describeInputOption(InputOption $option, array $options = []) } } - $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]); + $totalWidth = isset($options['total_width']) ? $options['total_width'] : $this->calculateTotalWidthForOptions([$option]); $synopsis = sprintf('%s%s', $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ', - sprintf($option->isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s', $option->getName(), $value) + sprintf('--%s%s', $option->getName(), $value) ); - $spacingWidth = $totalWidth - Helper::width($synopsis); + $spacingWidth = $totalWidth - Helper::strlen($synopsis); $this->writeText(sprintf(' %s %s%s%s%s', $synopsis, @@ -96,7 +96,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o { $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); foreach ($definition->getArguments() as $argument) { - $totalWidth = max($totalWidth, Helper::width($argument->getName())); + $totalWidth = max($totalWidth, Helper::strlen($argument->getName())); } if ($definition->getArguments()) { @@ -117,7 +117,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o $this->writeText('Options:', $options); foreach ($definition->getOptions() as $option) { - if (\strlen($option->getShortcut() ?? '') > 1) { + if (\strlen($option->getShortcut()) > 1) { $laterOptions[] = $option; continue; } @@ -136,15 +136,10 @@ protected function describeInputDefinition(InputDefinition $definition, array $o */ protected function describeCommand(Command $command, array $options = []) { + $command->getSynopsis(true); + $command->getSynopsis(false); $command->mergeApplicationDefinition(false); - if ($description = $command->getDescription()) { - $this->writeText('Description:', $options); - $this->writeText("\n"); - $this->writeText(' '.$description); - $this->writeText("\n\n"); - } - $this->writeText('Usage:', $options); foreach (array_merge([$command->getSynopsis(true)], $command->getAliases(), $command->getUsages()) as $usage) { $this->writeText("\n"); @@ -152,15 +147,14 @@ protected function describeCommand(Command $command, array $options = []) } $this->writeText("\n"); - $definition = $command->getDefinition(); + $definition = $command->getNativeDefinition(); if ($definition->getOptions() || $definition->getArguments()) { $this->writeText("\n"); $this->describeInputDefinition($definition, $options); $this->writeText("\n"); } - $help = $command->getProcessedHelp(); - if ($help && $help !== $description) { + if ($help = $command->getProcessedHelp()) { $this->writeText("\n"); $this->writeText('Help:', $options); $this->writeText("\n"); @@ -174,7 +168,7 @@ protected function describeCommand(Command $command, array $options = []) */ protected function describeApplication(Application $application, array $options = []) { - $describedNamespace = $options['namespace'] ?? null; + $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; $description = new ApplicationDescription($application, $describedNamespace); if (isset($options['raw_text']) && $options['raw_text']) { @@ -208,9 +202,9 @@ protected function describeApplication(Application $application, array $options } // calculate max. width based on available commands per namespace - $width = $this->getColumnWidth(array_merge(...array_values(array_map(function ($namespace) use ($commands) { + $width = $this->getColumnWidth(\call_user_func_array('array_merge', array_map(function ($namespace) use ($commands) { return array_intersect($namespace['commands'], array_keys($commands)); - }, array_values($namespaces))))); + }, array_values($namespaces)))); if ($describedNamespace) { $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); @@ -234,7 +228,7 @@ protected function describeApplication(Application $application, array $options foreach ($namespace['commands'] as $name) { $this->writeText("\n"); - $spacingWidth = $width - Helper::width($name); + $spacingWidth = $width - Helper::strlen($name); $command = $commands[$name]; $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : ''; $this->writeText(sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); @@ -248,7 +242,7 @@ protected function describeApplication(Application $application, array $options /** * {@inheritdoc} */ - private function writeText(string $content, array $options = []) + private function writeText($content, array $options = []) { $this->write( isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, @@ -258,8 +252,10 @@ private function writeText(string $content, array $options = []) /** * Formats command aliases to show them in the command description. + * + * @return string */ - private function getCommandAliasesText(Command $command): string + private function getCommandAliasesText(Command $command) { $text = ''; $aliases = $command->getAliases(); @@ -275,8 +271,10 @@ private function getCommandAliasesText(Command $command): string * Formats input option/argument default value. * * @param mixed $default + * + * @return string */ - private function formatDefaultValue($default): string + private function formatDefaultValue($default) { if (\INF === $default) { return 'INF'; @@ -296,20 +294,22 @@ private function formatDefaultValue($default): string } /** - * @param array $commands + * @param (Command|string)[] $commands + * + * @return int */ - private function getColumnWidth(array $commands): int + private function getColumnWidth(array $commands) { $widths = []; foreach ($commands as $command) { if ($command instanceof Command) { - $widths[] = Helper::width($command->getName()); + $widths[] = Helper::strlen($command->getName()); foreach ($command->getAliases() as $alias) { - $widths[] = Helper::width($alias); + $widths[] = Helper::strlen($alias); } } else { - $widths[] = Helper::width($command); + $widths[] = Helper::strlen($command); } } @@ -318,17 +318,18 @@ private function getColumnWidth(array $commands): int /** * @param InputOption[] $options + * + * @return int */ - private function calculateTotalWidthForOptions(array $options): int + private function calculateTotalWidthForOptions(array $options) { $totalWidth = 0; foreach ($options as $option) { // "-" + shortcut + ", --" + name - $nameLength = 1 + max(Helper::width($option->getShortcut()), 1) + 4 + Helper::width($option->getName()); - if ($option->isNegatable()) { - $nameLength += 6 + Helper::width($option->getName()); // |--no- + name - } elseif ($option->acceptValue()) { - $valueLength = 1 + Helper::width($option->getName()); // = + value + $nameLength = 1 + max(Helper::strlen($option->getShortcut()), 1) + 4 + Helper::strlen($option->getName()); + + if ($option->acceptValue()) { + $valueLength = 1 + Helper::strlen($option->getName()); // = + value $valueLength += $option->isValueOptional() ? 2 : 0; // [ + ] $nameLength += $valueLength; diff --git a/app/vendor/symfony/console/Descriptor/XmlDescriptor.php b/app/vendor/symfony/console/Descriptor/XmlDescriptor.php index 4f7cd8b3e..2d2545864 100644 --- a/app/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ b/app/vendor/symfony/console/Descriptor/XmlDescriptor.php @@ -26,7 +26,10 @@ */ class XmlDescriptor extends Descriptor { - public function getInputDefinitionDocument(InputDefinition $definition): \DOMDocument + /** + * @return \DOMDocument + */ + public function getInputDefinitionDocument(InputDefinition $definition) { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->appendChild($definitionXML = $dom->createElement('definition')); @@ -44,42 +47,45 @@ public function getInputDefinitionDocument(InputDefinition $definition): \DOMDoc return $dom; } - public function getCommandDocument(Command $command, bool $short = false): \DOMDocument + /** + * @return \DOMDocument + */ + public function getCommandDocument(Command $command) { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->appendChild($commandXML = $dom->createElement('command')); + $command->getSynopsis(); + $command->mergeApplicationDefinition(false); + $commandXML->setAttribute('id', $command->getName()); $commandXML->setAttribute('name', $command->getName()); $commandXML->setAttribute('hidden', $command->isHidden() ? 1 : 0); $commandXML->appendChild($usagesXML = $dom->createElement('usages')); + foreach (array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) { + $usagesXML->appendChild($dom->createElement('usage', $usage)); + } + $commandXML->appendChild($descriptionXML = $dom->createElement('description')); $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getDescription()))); - if ($short) { - foreach ($command->getAliases() as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } - } else { - $command->mergeApplicationDefinition(false); - - foreach (array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } + $commandXML->appendChild($helpXML = $dom->createElement('help')); + $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getProcessedHelp()))); - $commandXML->appendChild($helpXML = $dom->createElement('help')); - $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getProcessedHelp()))); - - $definitionXML = $this->getInputDefinitionDocument($command->getDefinition()); - $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0)); - } + $definitionXML = $this->getInputDefinitionDocument($command->getNativeDefinition()); + $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0)); return $dom; } - public function getApplicationDocument(Application $application, string $namespace = null, bool $short = false): \DOMDocument + /** + * @param string|null $namespace + * + * @return \DOMDocument + */ + public function getApplicationDocument(Application $application, $namespace = null) { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->appendChild($rootXml = $dom->createElement('symfony')); @@ -100,7 +106,7 @@ public function getApplicationDocument(Application $application, string $namespa } foreach ($description->getCommands() as $command) { - $this->appendDocument($commandsXML, $this->getCommandDocument($command, $short)); + $this->appendDocument($commandsXML, $this->getCommandDocument($command)); } if (!$namespace) { @@ -149,7 +155,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o */ protected function describeCommand(Command $command, array $options = []) { - $this->writeDocument($this->getCommandDocument($command, $options['short'] ?? false)); + $this->writeDocument($this->getCommandDocument($command)); } /** @@ -157,7 +163,7 @@ protected function describeCommand(Command $command, array $options = []) */ protected function describeApplication(Application $application, array $options = []) { - $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null, $options['short'] ?? false)); + $this->writeDocument($this->getApplicationDocument($application, isset($options['namespace']) ? $options['namespace'] : null)); } /** @@ -179,7 +185,10 @@ private function writeDocument(\DOMDocument $dom) $this->write($dom->saveXML()); } - private function getInputArgumentDocument(InputArgument $argument): \DOMDocument + /** + * @return \DOMDocument + */ + private function getInputArgumentDocument(InputArgument $argument) { $dom = new \DOMDocument('1.0', 'UTF-8'); @@ -200,13 +209,16 @@ private function getInputArgumentDocument(InputArgument $argument): \DOMDocument return $dom; } - private function getInputOptionDocument(InputOption $option): \DOMDocument + /** + * @return \DOMDocument + */ + private function getInputOptionDocument(InputOption $option) { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->appendChild($objectXML = $dom->createElement('option')); $objectXML->setAttribute('name', '--'.$option->getName()); - $pos = strpos($option->getShortcut() ?? '', '|'); + $pos = strpos($option->getShortcut(), '|'); if (false !== $pos) { $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos)); $objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut())); @@ -231,17 +243,6 @@ private function getInputOptionDocument(InputOption $option): \DOMDocument } } - if ($option->isNegatable()) { - $dom->appendChild($objectXML = $dom->createElement('option')); - $objectXML->setAttribute('name', '--no-'.$option->getName()); - $objectXML->setAttribute('shortcut', ''); - $objectXML->setAttribute('accept_value', 0); - $objectXML->setAttribute('is_value_required', 0); - $objectXML->setAttribute('is_multiple', 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode('Negate the "--'.$option->getName().'" option')); - } - return $dom; } } diff --git a/app/vendor/symfony/console/Event/ConsoleCommandEvent.php b/app/vendor/symfony/console/Event/ConsoleCommandEvent.php index 08bd18fd1..2f517c1db 100644 --- a/app/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ b/app/vendor/symfony/console/Event/ConsoleCommandEvent.php @@ -16,12 +16,12 @@ * * @author Fabien Potencier */ -final class ConsoleCommandEvent extends ConsoleEvent +class ConsoleCommandEvent extends ConsoleEvent { /** * The return code for skipped commands, this will also be passed into the terminate event. */ - public const RETURN_CODE_DISABLED = 113; + const RETURN_CODE_DISABLED = 113; /** * Indicates if the command should be run or skipped. @@ -30,21 +30,30 @@ final class ConsoleCommandEvent extends ConsoleEvent /** * Disables the command, so it won't be run. + * + * @return bool */ - public function disableCommand(): bool + public function disableCommand() { return $this->commandShouldRun = false; } - public function enableCommand(): bool + /** + * Enables the command. + * + * @return bool + */ + public function enableCommand() { return $this->commandShouldRun = true; } /** * Returns true if the command is runnable, false otherwise. + * + * @return bool */ - public function commandShouldRun(): bool + public function commandShouldRun() { return $this->commandShouldRun; } diff --git a/app/vendor/symfony/console/Event/ConsoleErrorEvent.php b/app/vendor/symfony/console/Event/ConsoleErrorEvent.php index 57d9b38ba..51a5f56d5 100644 --- a/app/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ b/app/vendor/symfony/console/Event/ConsoleErrorEvent.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Console\Event; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -25,34 +26,58 @@ final class ConsoleErrorEvent extends ConsoleEvent private $error; private $exitCode; - public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null) + public function __construct(InputInterface $input, OutputInterface $output, $error, Command $command = null) { parent::__construct($command, $input, $output); - $this->error = $error; + $this->setError($error); } - public function getError(): \Throwable + /** + * Returns the thrown error/exception. + * + * @return \Throwable + */ + public function getError() { return $this->error; } - public function setError(\Throwable $error): void + /** + * Replaces the thrown error/exception. + * + * @param \Throwable $error + */ + public function setError($error) { + if (!$error instanceof \Throwable && !$error instanceof \Exception) { + throw new InvalidArgumentException(sprintf('The error passed to ConsoleErrorEvent must be an instance of \Throwable or \Exception, "%s" was passed instead.', \is_object($error) ? \get_class($error) : \gettype($error))); + } + $this->error = $error; } - public function setExitCode(int $exitCode): void + /** + * Sets the exit code. + * + * @param int $exitCode The command exit code + */ + public function setExitCode($exitCode) { - $this->exitCode = $exitCode; + $this->exitCode = (int) $exitCode; $r = new \ReflectionProperty($this->error, 'code'); $r->setAccessible(true); $r->setValue($this->error, $this->exitCode); } - public function getExitCode(): int + /** + * Gets the exit code. + * + * @return int The command exit code + */ + public function getExitCode() { - return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); + return null !== $this->exitCode ? $this->exitCode : (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); } } diff --git a/app/vendor/symfony/console/Event/ConsoleEvent.php b/app/vendor/symfony/console/Event/ConsoleEvent.php index 4e00f7c73..5440da216 100644 --- a/app/vendor/symfony/console/Event/ConsoleEvent.php +++ b/app/vendor/symfony/console/Event/ConsoleEvent.php @@ -14,7 +14,7 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Contracts\EventDispatcher\Event; +use Symfony\Component\EventDispatcher\Event; /** * Allows to inspect input and output of a command. @@ -28,7 +28,7 @@ class ConsoleEvent extends Event private $input; private $output; - public function __construct(?Command $command, InputInterface $input, OutputInterface $output) + public function __construct(Command $command = null, InputInterface $input, OutputInterface $output) { $this->command = $command; $this->input = $input; diff --git a/app/vendor/symfony/console/Event/ConsoleExceptionEvent.php b/app/vendor/symfony/console/Event/ConsoleExceptionEvent.php new file mode 100644 index 000000000..845119ee2 --- /dev/null +++ b/app/vendor/symfony/console/Event/ConsoleExceptionEvent.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +@trigger_error(sprintf('The "%s" class is deprecated since Symfony 3.3 and will be removed in 4.0. Use the ConsoleErrorEvent instead.', ConsoleExceptionEvent::class), \E_USER_DEPRECATED); + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Allows to handle exception thrown in a command. + * + * @author Fabien Potencier + * + * @deprecated since version 3.3, to be removed in 4.0. Use ConsoleErrorEvent instead. + */ +class ConsoleExceptionEvent extends ConsoleEvent +{ + private $exception; + private $exitCode; + + public function __construct(Command $command, InputInterface $input, OutputInterface $output, \Exception $exception, $exitCode) + { + parent::__construct($command, $input, $output); + + $this->setException($exception); + $this->exitCode = (int) $exitCode; + } + + /** + * Returns the thrown exception. + * + * @return \Exception The thrown exception + */ + public function getException() + { + return $this->exception; + } + + /** + * Replaces the thrown exception. + * + * This exception will be thrown if no response is set in the event. + * + * @param \Exception $exception The thrown exception + */ + public function setException(\Exception $exception) + { + $this->exception = $exception; + } + + /** + * Gets the exit code. + * + * @return int The command exit code + */ + public function getExitCode() + { + return $this->exitCode; + } +} diff --git a/app/vendor/symfony/console/Event/ConsoleSignalEvent.php b/app/vendor/symfony/console/Event/ConsoleSignalEvent.php deleted file mode 100644 index ef13ed2f5..000000000 --- a/app/vendor/symfony/console/Event/ConsoleSignalEvent.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author marie - */ -final class ConsoleSignalEvent extends ConsoleEvent -{ - private $handlingSignal; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal) - { - parent::__construct($command, $input, $output); - $this->handlingSignal = $handlingSignal; - } - - public function getHandlingSignal(): int - { - return $this->handlingSignal; - } -} diff --git a/app/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/app/vendor/symfony/console/Event/ConsoleTerminateEvent.php index 190038d1a..b6a5d7c0d 100644 --- a/app/vendor/symfony/console/Event/ConsoleTerminateEvent.php +++ b/app/vendor/symfony/console/Event/ConsoleTerminateEvent.php @@ -20,23 +20,38 @@ * * @author Francesco Levorato */ -final class ConsoleTerminateEvent extends ConsoleEvent +class ConsoleTerminateEvent extends ConsoleEvent { + /** + * The exit code of the command. + * + * @var int + */ private $exitCode; - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode) + public function __construct(Command $command, InputInterface $input, OutputInterface $output, $exitCode) { parent::__construct($command, $input, $output); $this->setExitCode($exitCode); } - public function setExitCode(int $exitCode): void + /** + * Sets the exit code. + * + * @param int $exitCode The command exit code + */ + public function setExitCode($exitCode) { - $this->exitCode = $exitCode; + $this->exitCode = (int) $exitCode; } - public function getExitCode(): int + /** + * Gets the exit code. + * + * @return int The command exit code + */ + public function getExitCode() { return $this->exitCode; } diff --git a/app/vendor/symfony/console/EventListener/ErrorListener.php b/app/vendor/symfony/console/EventListener/ErrorListener.php index 897d9853f..783c10793 100644 --- a/app/vendor/symfony/console/EventListener/ErrorListener.php +++ b/app/vendor/symfony/console/EventListener/ErrorListener.php @@ -40,12 +40,12 @@ public function onConsoleError(ConsoleErrorEvent $event) $error = $event->getError(); if (!$inputString = $this->getInputString($event)) { - $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); + $this->logger->error('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); return; } - $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); + $this->logger->error('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); } public function onConsoleTerminate(ConsoleTerminateEvent $event) @@ -77,7 +77,7 @@ public static function getSubscribedEvents() ]; } - private static function getInputString(ConsoleEvent $event): ?string + private static function getInputString(ConsoleEvent $event) { $commandName = $event->getCommand() ? $event->getCommand()->getName() : null; $input = $event->getInput(); diff --git a/app/vendor/symfony/console/Exception/CommandNotFoundException.php b/app/vendor/symfony/console/Exception/CommandNotFoundException.php index 590a71c77..d28fceb12 100644 --- a/app/vendor/symfony/console/Exception/CommandNotFoundException.php +++ b/app/vendor/symfony/console/Exception/CommandNotFoundException.php @@ -21,12 +21,12 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce private $alternatives; /** - * @param string $message Exception message to throw - * @param string[] $alternatives List of similar defined names - * @param int $code Exception code - * @param \Throwable|null $previous Previous exception used for the exception chaining + * @param string $message Exception message to throw + * @param array $alternatives List of similar defined names + * @param int $code Exception code + * @param \Exception $previous Previous exception used for the exception chaining */ - public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null) + public function __construct($message, array $alternatives = [], $code = 0, \Exception $previous = null) { parent::__construct($message, $code, $previous); @@ -34,7 +34,7 @@ public function __construct(string $message, array $alternatives = [], int $code } /** - * @return string[] A list of similar defined names + * @return array A list of similar defined names */ public function getAlternatives() { diff --git a/app/vendor/symfony/console/Exception/ExceptionInterface.php b/app/vendor/symfony/console/Exception/ExceptionInterface.php index 1624e13d0..491cc4c64 100644 --- a/app/vendor/symfony/console/Exception/ExceptionInterface.php +++ b/app/vendor/symfony/console/Exception/ExceptionInterface.php @@ -16,6 +16,6 @@ * * @author Jérôme Tamarelle */ -interface ExceptionInterface extends \Throwable +interface ExceptionInterface { } diff --git a/app/vendor/symfony/console/Exception/MissingInputException.php b/app/vendor/symfony/console/Exception/MissingInputException.php deleted file mode 100644 index 04f02ade4..000000000 --- a/app/vendor/symfony/console/Exception/MissingInputException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents failure to read input from stdin. - * - * @author Gabriel Ostrolucký - */ -class MissingInputException extends RuntimeException implements ExceptionInterface -{ -} diff --git a/app/vendor/symfony/console/Exception/NamespaceNotFoundException.php b/app/vendor/symfony/console/Exception/NamespaceNotFoundException.php deleted file mode 100644 index dd16e4508..000000000 --- a/app/vendor/symfony/console/Exception/NamespaceNotFoundException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect namespace typed in the console. - * - * @author Pierre du Plessis - */ -class NamespaceNotFoundException extends CommandNotFoundException -{ -} diff --git a/app/vendor/symfony/console/Formatter/NullOutputFormatter.php b/app/vendor/symfony/console/Formatter/NullOutputFormatter.php deleted file mode 100644 index 0aa0a5c25..000000000 --- a/app/vendor/symfony/console/Formatter/NullOutputFormatter.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * @author Tien Xuan Vo - */ -final class NullOutputFormatter implements OutputFormatterInterface -{ - private $style; - - /** - * {@inheritdoc} - */ - public function format(?string $message): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function getStyle(string $name): OutputFormatterStyleInterface - { - if ($this->style) { - return $this->style; - } - // to comply with the interface we must return a OutputFormatterStyleInterface - return $this->style = new NullOutputFormatterStyle(); - } - - /** - * {@inheritdoc} - */ - public function hasStyle(string $name): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isDecorated(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setStyle(string $name, OutputFormatterStyleInterface $style): void - { - // do nothing - } -} diff --git a/app/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php b/app/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php deleted file mode 100644 index bfd0afedd..000000000 --- a/app/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * @author Tien Xuan Vo - */ -final class NullOutputFormatterStyle implements OutputFormatterStyleInterface -{ - /** - * {@inheritdoc} - */ - public function apply(string $text): string - { - return $text; - } - - /** - * {@inheritdoc} - */ - public function setBackground(string $color = null): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setForeground(string $color = null): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setOption(string $option): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setOptions(array $options): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function unsetOption(string $option): void - { - // do nothing - } -} diff --git a/app/vendor/symfony/console/Formatter/OutputFormatter.php b/app/vendor/symfony/console/Formatter/OutputFormatter.php index 80d59b3b4..abc85398e 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatter.php @@ -17,28 +17,21 @@ * Formatter class for console output. * * @author Konstantin Kudryashov - * @author Roland Franssen */ -class OutputFormatter implements WrappableOutputFormatterInterface +class OutputFormatter implements OutputFormatterInterface { private $decorated; private $styles = []; private $styleStack; - public function __clone() - { - $this->styleStack = clone $this->styleStack; - foreach ($this->styles as $key => $value) { - $this->styles[$key] = clone $value; - } - } - /** * Escapes "<" special char in given text. * + * @param string $text Text to escape + * * @return string Escaped text */ - public static function escape(string $text) + public static function escape($text) { $text = preg_replace('/([^\\\\]?) FormatterStyle" instances + * @param bool $decorated Whether this formatter should actually decorate strings + * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances */ - public function __construct(bool $decorated = false, array $styles = []) + public function __construct($decorated = false, array $styles = []) { - $this->decorated = $decorated; + $this->decorated = (bool) $decorated; $this->setStyle('error', new OutputFormatterStyle('white', 'red')); $this->setStyle('info', new OutputFormatterStyle('green')); @@ -86,9 +84,9 @@ public function __construct(bool $decorated = false, array $styles = []) /** * {@inheritdoc} */ - public function setDecorated(bool $decorated) + public function setDecorated($decorated) { - $this->decorated = $decorated; + $this->decorated = (bool) $decorated; } /** @@ -102,7 +100,7 @@ public function isDecorated() /** * {@inheritdoc} */ - public function setStyle(string $name, OutputFormatterStyleInterface $style) + public function setStyle($name, OutputFormatterStyleInterface $style) { $this->styles[strtolower($name)] = $style; } @@ -110,7 +108,7 @@ public function setStyle(string $name, OutputFormatterStyleInterface $style) /** * {@inheritdoc} */ - public function hasStyle(string $name) + public function hasStyle($name) { return isset($this->styles[strtolower($name)]); } @@ -118,7 +116,7 @@ public function hasStyle(string $name) /** * {@inheritdoc} */ - public function getStyle(string $name) + public function getStyle($name) { if (!$this->hasStyle($name)) { throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name)); @@ -130,20 +128,12 @@ public function getStyle(string $name) /** * {@inheritdoc} */ - public function format(?string $message) - { - return $this->formatAndWrap($message, 0); - } - - /** - * {@inheritdoc} - */ - public function formatAndWrap(?string $message, int $width) + public function format($message) { + $message = (string) $message; $offset = 0; $output = ''; - $tagRegex = '[a-z][^<>]*+'; - $currentLineLength = 0; + $tagRegex = '[a-z][a-z0-9,_=;-]*+'; preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE); foreach ($matches[0] as $i => $match) { $pos = $match[1]; @@ -154,21 +144,21 @@ public function formatAndWrap(?string $message, int $width) } // add the text up to the next tag - $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); + $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset)); $offset = $pos + \strlen($text); // opening tag? if ($open = '/' != $text[1]) { $tag = $matches[1][$i][0]; } else { - $tag = $matches[3][$i][0] ?? ''; + $tag = isset($matches[3][$i][0]) ? $matches[3][$i][0] : ''; } if (!$open && !$tag) { // $this->styleStack->pop(); - } elseif (null === $style = $this->createStyleFromString($tag)) { - $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength); + } elseif (false === $style = $this->createStyleFromString($tag)) { + $output .= $this->applyCurrentStyle($text); } elseif ($open) { $this->styleStack->push($style); } else { @@ -176,9 +166,9 @@ public function formatAndWrap(?string $message, int $width) } } - $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); + $output .= $this->applyCurrentStyle(substr($message, $offset)); - if (str_contains($output, "\0")) { + if (false !== strpos($output, "\0")) { return strtr($output, ["\0" => '\\', '\\<' => '<']); } @@ -195,15 +185,19 @@ public function getStyleStack() /** * Tries to create new style instance from string. + * + * @param string $string + * + * @return OutputFormatterStyle|false false if string is not format string */ - private function createStyleFromString(string $string): ?OutputFormatterStyleInterface + private function createStyleFromString($string) { if (isset($this->styles[$string])) { return $this->styles[$string]; } if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) { - return null; + return false; } $style = new OutputFormatterStyle(); @@ -215,16 +209,20 @@ private function createStyleFromString(string $string): ?OutputFormatterStyleInt $style->setForeground(strtolower($match[1])); } elseif ('bg' == $match[0]) { $style->setBackground(strtolower($match[1])); - } elseif ('href' === $match[0]) { - $style->setHref($match[1]); } elseif ('options' === $match[0]) { preg_match_all('([^,;]+)', strtolower($match[1]), $options); $options = array_shift($options); foreach ($options as $option) { - $style->setOption($option); + try { + $style->setOption($option); + } catch (\InvalidArgumentException $e) { + @trigger_error(sprintf('Unknown style options are deprecated since Symfony 3.2 and will be removed in 4.0. Exception "%s".', $e->getMessage()), \E_USER_DEPRECATED); + + return false; + } } } else { - return null; + return false; } } @@ -233,51 +231,13 @@ private function createStyleFromString(string $string): ?OutputFormatterStyleInt /** * Applies current style from stack to text, if must be applied. + * + * @param string $text Input text + * + * @return string Styled text */ - private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string + private function applyCurrentStyle($text) { - if ('' === $text) { - return ''; - } - - if (!$width) { - return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text; - } - - if (!$currentLineLength && '' !== $current) { - $text = ltrim($text); - } - - if ($currentLineLength) { - $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n"; - $text = substr($text, $i); - } else { - $prefix = ''; - } - - preg_match('~(\\n)$~', $text, $matches); - $text = $prefix.preg_replace('~([^\\n]{'.$width.'})\\ *~', "\$1\n", $text); - $text = rtrim($text, "\n").($matches[1] ?? ''); - - if (!$currentLineLength && '' !== $current && "\n" !== substr($current, -1)) { - $text = "\n".$text; - } - - $lines = explode("\n", $text); - - foreach ($lines as $line) { - $currentLineLength += \strlen($line); - if ($width <= $currentLineLength) { - $currentLineLength = 0; - } - } - - if ($this->isDecorated()) { - foreach ($lines as $i => $line) { - $lines[$i] = $this->styleStack->getCurrent()->apply($line); - } - } - - return implode("\n", $lines); + return $this->isDecorated() && \strlen($text) > 0 ? $this->styleStack->getCurrent()->apply($text) : $text; } } diff --git a/app/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/app/vendor/symfony/console/Formatter/OutputFormatterInterface.php index 8c50d4196..281e240c5 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatterInterface.php @@ -20,8 +20,10 @@ interface OutputFormatterInterface { /** * Sets the decorated flag. + * + * @param bool $decorated Whether to decorate the messages or not */ - public function setDecorated(bool $decorated); + public function setDecorated($decorated); /** * Gets the decorated flag. @@ -32,27 +34,38 @@ public function isDecorated(); /** * Sets a new style. + * + * @param string $name The style name + * @param OutputFormatterStyleInterface $style The style instance */ - public function setStyle(string $name, OutputFormatterStyleInterface $style); + public function setStyle($name, OutputFormatterStyleInterface $style); /** * Checks if output formatter has style with specified name. * + * @param string $name + * * @return bool */ - public function hasStyle(string $name); + public function hasStyle($name); /** * Gets style options from style with specified name. * + * @param string $name + * * @return OutputFormatterStyleInterface * * @throws \InvalidArgumentException When style isn't defined */ - public function getStyle(string $name); + public function getStyle($name); /** * Formats a message according to the given styles. + * + * @param string $message The message to style + * + * @return string The styled message */ - public function format(?string $message); + public function format($message); } diff --git a/app/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/app/vendor/symfony/console/Formatter/OutputFormatterStyle.php index 0fb36ac63..7075c7211 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Console\Formatter; -use Symfony\Component\Console\Color; +use Symfony\Component\Console\Exception\InvalidArgumentException; /** * Formatter style class for defining styles. @@ -20,65 +20,123 @@ */ class OutputFormatterStyle implements OutputFormatterStyleInterface { - private $color; + private static $availableForegroundColors = [ + 'black' => ['set' => 30, 'unset' => 39], + 'red' => ['set' => 31, 'unset' => 39], + 'green' => ['set' => 32, 'unset' => 39], + 'yellow' => ['set' => 33, 'unset' => 39], + 'blue' => ['set' => 34, 'unset' => 39], + 'magenta' => ['set' => 35, 'unset' => 39], + 'cyan' => ['set' => 36, 'unset' => 39], + 'white' => ['set' => 37, 'unset' => 39], + 'default' => ['set' => 39, 'unset' => 39], + ]; + private static $availableBackgroundColors = [ + 'black' => ['set' => 40, 'unset' => 49], + 'red' => ['set' => 41, 'unset' => 49], + 'green' => ['set' => 42, 'unset' => 49], + 'yellow' => ['set' => 43, 'unset' => 49], + 'blue' => ['set' => 44, 'unset' => 49], + 'magenta' => ['set' => 45, 'unset' => 49], + 'cyan' => ['set' => 46, 'unset' => 49], + 'white' => ['set' => 47, 'unset' => 49], + 'default' => ['set' => 49, 'unset' => 49], + ]; + private static $availableOptions = [ + 'bold' => ['set' => 1, 'unset' => 22], + 'underscore' => ['set' => 4, 'unset' => 24], + 'blink' => ['set' => 5, 'unset' => 25], + 'reverse' => ['set' => 7, 'unset' => 27], + 'conceal' => ['set' => 8, 'unset' => 28], + ]; + private $foreground; private $background; - private $options; - private $href; - private $handlesHrefGracefully; + private $options = []; /** * Initializes output formatter style. * * @param string|null $foreground The style foreground color name * @param string|null $background The style background color name + * @param array $options The style options */ - public function __construct(string $foreground = null, string $background = null, array $options = []) + public function __construct($foreground = null, $background = null, array $options = []) { - $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); + if (null !== $foreground) { + $this->setForeground($foreground); + } + if (null !== $background) { + $this->setBackground($background); + } + if (\count($options)) { + $this->setOptions($options); + } } /** * {@inheritdoc} */ - public function setForeground(string $color = null) + public function setForeground($color = null) { - $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); + if (null === $color) { + $this->foreground = null; + + return; + } + + if (!isset(static::$availableForegroundColors[$color])) { + throw new InvalidArgumentException(sprintf('Invalid foreground color specified: "%s". Expected one of (%s).', $color, implode(', ', array_keys(static::$availableForegroundColors)))); + } + + $this->foreground = static::$availableForegroundColors[$color]; } /** * {@inheritdoc} */ - public function setBackground(string $color = null) + public function setBackground($color = null) { - $this->color = new Color($this->foreground, $this->background = $color ?: '', $this->options); - } + if (null === $color) { + $this->background = null; - public function setHref(string $url): void - { - $this->href = $url; + return; + } + + if (!isset(static::$availableBackgroundColors[$color])) { + throw new InvalidArgumentException(sprintf('Invalid background color specified: "%s". Expected one of (%s).', $color, implode(', ', array_keys(static::$availableBackgroundColors)))); + } + + $this->background = static::$availableBackgroundColors[$color]; } /** * {@inheritdoc} */ - public function setOption(string $option) + public function setOption($option) { - $this->options[] = $option; - $this->color = new Color($this->foreground, $this->background, $this->options); + if (!isset(static::$availableOptions[$option])) { + throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(static::$availableOptions)))); + } + + if (!\in_array(static::$availableOptions[$option], $this->options)) { + $this->options[] = static::$availableOptions[$option]; + } } /** * {@inheritdoc} */ - public function unsetOption(string $option) + public function unsetOption($option) { - $pos = array_search($option, $this->options); + if (!isset(static::$availableOptions[$option])) { + throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(static::$availableOptions)))); + } + + $pos = array_search(static::$availableOptions[$option], $this->options); if (false !== $pos) { unset($this->options[$pos]); } - - $this->color = new Color($this->foreground, $this->background, $this->options); } /** @@ -86,23 +144,40 @@ public function unsetOption(string $option) */ public function setOptions(array $options) { - $this->color = new Color($this->foreground, $this->background, $this->options = $options); + $this->options = []; + + foreach ($options as $option) { + $this->setOption($option); + } } /** * {@inheritdoc} */ - public function apply(string $text) + public function apply($text) { - if (null === $this->handlesHrefGracefully) { - $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); + $setCodes = []; + $unsetCodes = []; + + if (null !== $this->foreground) { + $setCodes[] = $this->foreground['set']; + $unsetCodes[] = $this->foreground['unset']; + } + if (null !== $this->background) { + $setCodes[] = $this->background['set']; + $unsetCodes[] = $this->background['unset']; + } + if (\count($this->options)) { + foreach ($this->options as $option) { + $setCodes[] = $option['set']; + $unsetCodes[] = $option['unset']; + } } - if (null !== $this->href && $this->handlesHrefGracefully) { - $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; + if (0 === \count($setCodes)) { + return $text; } - return $this->color->apply($text); + return sprintf("\033[%sm%s\033[%sm", implode(';', $setCodes), $text, implode(';', $unsetCodes)); } } diff --git a/app/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/app/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php index b30560d22..af171c270 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php @@ -20,23 +20,31 @@ interface OutputFormatterStyleInterface { /** * Sets style foreground color. + * + * @param string|null $color The color name */ - public function setForeground(string $color = null); + public function setForeground($color = null); /** * Sets style background color. + * + * @param string $color The color name */ - public function setBackground(string $color = null); + public function setBackground($color = null); /** * Sets some specific style option. + * + * @param string $option The option name */ - public function setOption(string $option); + public function setOption($option); /** * Unsets some specific style option. + * + * @param string $option The option name */ - public function unsetOption(string $option); + public function unsetOption($option); /** * Sets multiple style options at once. @@ -46,7 +54,9 @@ public function setOptions(array $options); /** * Applies the style to a given text. * + * @param string $text The text to style + * * @return string */ - public function apply(string $text); + public function apply($text); } diff --git a/app/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/app/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php index fc48dc0e1..506664991 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @@ -12,12 +12,11 @@ namespace Symfony\Component\Console\Formatter; use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Contracts\Service\ResetInterface; /** * @author Jean-François Simon */ -class OutputFormatterStyleStack implements ResetInterface +class OutputFormatterStyleStack { /** * @var OutputFormatterStyleInterface[] @@ -28,7 +27,7 @@ class OutputFormatterStyleStack implements ResetInterface public function __construct(OutputFormatterStyleInterface $emptyStyle = null) { - $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle(); + $this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle(); $this->reset(); } diff --git a/app/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php b/app/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php deleted file mode 100644 index 42319ee55..000000000 --- a/app/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output that supports word wrapping. - * - * @author Roland Franssen - */ -interface WrappableOutputFormatterInterface extends OutputFormatterInterface -{ - /** - * Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping). - */ - public function formatAndWrap(?string $message, int $width); -} diff --git a/app/vendor/symfony/console/Helper/DebugFormatterHelper.php b/app/vendor/symfony/console/Helper/DebugFormatterHelper.php index 9d07ec244..16d117553 100644 --- a/app/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ b/app/vendor/symfony/console/Helper/DebugFormatterHelper.php @@ -27,9 +27,13 @@ class DebugFormatterHelper extends Helper /** * Starts a debug formatting session. * + * @param string $id The id of the formatting session + * @param string $message The message to display + * @param string $prefix The prefix to use + * * @return string */ - public function start(string $id, string $message, string $prefix = 'RUN') + public function start($id, $message, $prefix = 'RUN') { $this->started[$id] = ['border' => ++$this->count % \count($this->colors)]; @@ -39,9 +43,15 @@ public function start(string $id, string $message, string $prefix = 'RUN') /** * Adds progress to a formatting session. * + * @param string $id The id of the formatting session + * @param string $buffer The message to display + * @param bool $error Whether to consider the buffer as error + * @param string $prefix The prefix for output + * @param string $errorPrefix The prefix for error output + * * @return string */ - public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR') + public function progress($id, $buffer, $error = false, $prefix = 'OUT', $errorPrefix = 'ERR') { $message = ''; @@ -75,9 +85,14 @@ public function progress(string $id, string $buffer, bool $error = false, string /** * Stops a formatting session. * + * @param string $id The id of the formatting session + * @param string $message The message to display + * @param bool $successful Whether to consider the result as success + * @param string $prefix The prefix for the end output + * * @return string */ - public function stop(string $id, string $message, bool $successful, string $prefix = 'RES') + public function stop($id, $message, $successful, $prefix = 'RES') { $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; @@ -92,7 +107,12 @@ public function stop(string $id, string $message, bool $successful, string $pref return $message; } - private function getBorder(string $id): string + /** + * @param string $id The id of the formatting session + * + * @return string + */ + private function getBorder($id) { return sprintf(' ', $this->colors[$this->started[$id]['border']]); } diff --git a/app/vendor/symfony/console/Helper/DescriptorHelper.php b/app/vendor/symfony/console/Helper/DescriptorHelper.php index f2ad9db7a..3055baefd 100644 --- a/app/vendor/symfony/console/Helper/DescriptorHelper.php +++ b/app/vendor/symfony/console/Helper/DescriptorHelper.php @@ -48,9 +48,11 @@ public function __construct() * * format: string, the output format name * * raw_text: boolean, sets output type as raw * + * @param object $object + * * @throws InvalidArgumentException when the given format is not supported */ - public function describe(OutputInterface $output, ?object $object, array $options = []) + public function describe(OutputInterface $output, $object, array $options = []) { $options = array_merge([ 'raw_text' => false, @@ -68,9 +70,11 @@ public function describe(OutputInterface $output, ?object $object, array $option /** * Registers a descriptor. * + * @param string $format + * * @return $this */ - public function register(string $format, DescriptorInterface $descriptor) + public function register($format, DescriptorInterface $descriptor) { $this->descriptors[$format] = $descriptor; diff --git a/app/vendor/symfony/console/Helper/Dumper.php b/app/vendor/symfony/console/Helper/Dumper.php deleted file mode 100644 index b013b6c52..000000000 --- a/app/vendor/symfony/console/Helper/Dumper.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\VarDumper\Cloner\ClonerInterface; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -/** - * @author Roland Franssen - */ -final class Dumper -{ - private $output; - private $dumper; - private $cloner; - private $handler; - - public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null) - { - $this->output = $output; - $this->dumper = $dumper; - $this->cloner = $cloner; - - if (class_exists(CliDumper::class)) { - $this->handler = function ($var): string { - $dumper = $this->dumper ?? $this->dumper = new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR); - $dumper->setColors($this->output->isDecorated()); - - return rtrim($dumper->dump(($this->cloner ?? $this->cloner = new VarCloner())->cloneVar($var)->withRefHandles(false), true)); - }; - } else { - $this->handler = function ($var): string { - switch (true) { - case null === $var: - return 'null'; - case true === $var: - return 'true'; - case false === $var: - return 'false'; - case \is_string($var): - return '"'.$var.'"'; - default: - return rtrim(print_r($var, true)); - } - }; - } - } - - public function __invoke($var): string - { - return ($this->handler)($var); - } -} diff --git a/app/vendor/symfony/console/Helper/FormatterHelper.php b/app/vendor/symfony/console/Helper/FormatterHelper.php index a1c33c22d..d6eccee8e 100644 --- a/app/vendor/symfony/console/Helper/FormatterHelper.php +++ b/app/vendor/symfony/console/Helper/FormatterHelper.php @@ -23,9 +23,13 @@ class FormatterHelper extends Helper /** * Formats a message within a section. * + * @param string $section The section name + * @param string $message The message + * @param string $style The style to apply to the section + * * @return string The format section */ - public function formatSection(string $section, string $message, string $style = 'info') + public function formatSection($section, $message, $style = 'info') { return sprintf('<%s>[%s] %s', $style, $section, $style, $message); } @@ -34,10 +38,12 @@ public function formatSection(string $section, string $message, string $style = * Formats a message as a block of text. * * @param string|array $messages The message to write in the block + * @param string $style The style to apply to the whole block + * @param bool $large Whether to return a large block * * @return string The formatter message */ - public function formatBlock($messages, string $style, bool $large = false) + public function formatBlock($messages, $style, $large = false) { if (!\is_array($messages)) { $messages = [$messages]; @@ -48,12 +54,12 @@ public function formatBlock($messages, string $style, bool $large = false) foreach ($messages as $message) { $message = OutputFormatter::escape($message); $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); - $len = max(self::width($message) + ($large ? 4 : 2), $len); + $len = max(self::strlen($message) + ($large ? 4 : 2), $len); } $messages = $large ? [str_repeat(' ', $len)] : []; for ($i = 0; isset($lines[$i]); ++$i) { - $messages[] = $lines[$i].str_repeat(' ', $len - self::width($lines[$i])); + $messages[] = $lines[$i].str_repeat(' ', $len - self::strlen($lines[$i])); } if ($large) { $messages[] = str_repeat(' ', $len); @@ -69,13 +75,17 @@ public function formatBlock($messages, string $style, bool $large = false) /** * Truncates a message to the given length. * + * @param string $message + * @param int $length + * @param string $suffix + * * @return string */ - public function truncate(string $message, int $length, string $suffix = '...') + public function truncate($message, $length, $suffix = '...') { - $computedLength = $length - self::width($suffix); + $computedLength = $length - self::strlen($suffix); - if ($computedLength > self::width($message)) { + if ($computedLength > self::strlen($message)) { return $message; } diff --git a/app/vendor/symfony/console/Helper/Helper.php b/app/vendor/symfony/console/Helper/Helper.php index cfcbbd9a1..0ddddf6bc 100644 --- a/app/vendor/symfony/console/Helper/Helper.php +++ b/app/vendor/symfony/console/Helper/Helper.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Console\Helper; use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\String\UnicodeString; /** * Helper is the base class for all helper classes. @@ -42,29 +41,12 @@ public function getHelperSet() /** * Returns the length of a string, using mb_strwidth if it is available. * - * @deprecated since Symfony 5.3 + * @param string $string The string to check its length * * @return int The length of the string */ - public static function strlen(?string $string) + public static function strlen($string) { - trigger_deprecation('symfony/console', '5.3', 'Method "%s()" is deprecated and will be removed in Symfony 6.0. Use Helper::width() or Helper::length() instead.', __METHOD__); - - return self::width($string); - } - - /** - * Returns the width of a string, using mb_strwidth if it is available. - * The width is how many characters positions the string will use. - */ - public static function width(?string $string): int - { - $string ?? $string = ''; - - if (preg_match('//u', $string)) { - return (new UnicodeString($string))->width(false); - } - if (false === $encoding = mb_detect_encoding($string, null, true)) { return \strlen($string); } @@ -72,34 +54,17 @@ public static function width(?string $string): int return mb_strwidth($string, $encoding); } - /** - * Returns the length of a string, using mb_strlen if it is available. - * The length is related to how many bytes the string will use. - */ - public static function length(?string $string): int - { - $string ?? $string = ''; - - if (preg_match('//u', $string)) { - return (new UnicodeString($string))->length(); - } - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return \strlen($string); - } - - return mb_strlen($string, $encoding); - } - /** * Returns the subset of a string, using mb_substr if it is available. * + * @param string $string String to subset + * @param int $from Start offset + * @param int|null $length Length to read + * * @return string The string subset */ - public static function substr(?string $string, int $from, int $length = null) + public static function substr($string, $from, $length = null) { - $string ?? $string = ''; - if (false === $encoding = mb_detect_encoding($string, null, true)) { return substr($string, $from, $length); } @@ -136,7 +101,7 @@ public static function formatTime($secs) } } - public static function formatMemory(int $memory) + public static function formatMemory($memory) { if ($memory >= 1024 * 1024 * 1024) { return sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); @@ -153,24 +118,19 @@ public static function formatMemory(int $memory) return sprintf('%d B', $memory); } - /** - * @deprecated since Symfony 5.3 - */ - public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, ?string $string) + public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, $string) { - trigger_deprecation('symfony/console', '5.3', 'Method "%s()" is deprecated and will be removed in Symfony 6.0. Use Helper::removeDecoration() instead.', __METHOD__); - - return self::width(self::removeDecoration($formatter, $string)); + return self::strlen(self::removeDecoration($formatter, $string)); } - public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) + public static function removeDecoration(OutputFormatterInterface $formatter, $string) { $isDecorated = $formatter->isDecorated(); $formatter->setDecorated(false); // remove <...> formatting - $string = $formatter->format($string ?? ''); + $string = $formatter->format($string); // remove already formatted characters - $string = preg_replace("/\033\[[^m]*m/", '', $string ?? ''); + $string = preg_replace("/\033\[[^m]*m/", '', $string); $formatter->setDecorated($isDecorated); return $string; diff --git a/app/vendor/symfony/console/Helper/HelperSet.php b/app/vendor/symfony/console/Helper/HelperSet.php index 679dceab1..c73fecd47 100644 --- a/app/vendor/symfony/console/Helper/HelperSet.php +++ b/app/vendor/symfony/console/Helper/HelperSet.php @@ -37,7 +37,13 @@ public function __construct(array $helpers = []) } } - public function set(HelperInterface $helper, string $alias = null) + /** + * Sets a helper. + * + * @param HelperInterface $helper The helper instance + * @param string $alias An alias + */ + public function set(HelperInterface $helper, $alias = null) { $this->helpers[$helper->getName()] = $helper; if (null !== $alias) { @@ -50,9 +56,11 @@ public function set(HelperInterface $helper, string $alias = null) /** * Returns true if the helper if defined. * + * @param string $name The helper name + * * @return bool true if the helper is defined, false otherwise */ - public function has(string $name) + public function has($name) { return isset($this->helpers[$name]); } @@ -60,11 +68,13 @@ public function has(string $name) /** * Gets a helper value. * + * @param string $name The helper name + * * @return HelperInterface The helper instance * * @throws InvalidArgumentException if the helper is not defined */ - public function get(string $name) + public function get($name) { if (!$this->has($name)) { throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); @@ -89,9 +99,8 @@ public function getCommand() } /** - * @return \Traversable + * @return Helper[] */ - #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->helpers); diff --git a/app/vendor/symfony/console/Helper/ProcessHelper.php b/app/vendor/symfony/console/Helper/ProcessHelper.php index f82c16bae..6cafb1fac 100644 --- a/app/vendor/symfony/console/Helper/ProcessHelper.php +++ b/app/vendor/symfony/console/Helper/ProcessHelper.php @@ -20,21 +20,22 @@ * The ProcessHelper class provides helpers to run external processes. * * @author Fabien Potencier - * - * @final */ class ProcessHelper extends Helper { /** * Runs an external process. * - * @param array|Process $cmd An instance of Process or an array of the command and arguments - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR + * @param OutputInterface $output An OutputInterface instance + * @param string|array|Process $cmd An instance of Process or an array of arguments to escape and run or a command to run + * @param string|null $error An error message that must be displayed if something went wrong + * @param callable|null $callback A PHP callback to run whenever there is some + * output available on STDOUT or STDERR + * @param int $verbosity The threshold for verbosity * * @return Process The process that ran */ - public function run(OutputInterface $output, $cmd, string $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process + public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE) { if (!class_exists(Process::class)) { throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".'); @@ -47,21 +48,9 @@ public function run(OutputInterface $output, $cmd, string $error = null, callabl $formatter = $this->getHelperSet()->get('debug_formatter'); if ($cmd instanceof Process) { - $cmd = [$cmd]; - } - - if (!\is_array($cmd)) { - throw new \TypeError(sprintf('The "command" argument of "%s()" must be an array or a "%s" instance, "%s" given.', __METHOD__, Process::class, get_debug_type($cmd))); - } - - if (\is_string($cmd[0] ?? null)) { - $process = new Process($cmd); - $cmd = []; - } elseif (($cmd[0] ?? null) instanceof Process) { - $process = $cmd[0]; - unset($cmd[0]); + $process = $cmd; } else { - throw new \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); + $process = new Process($cmd); } if ($verbosity <= $output->getVerbosity()) { @@ -72,7 +61,7 @@ public function run(OutputInterface $output, $cmd, string $error = null, callabl $callback = $this->wrapCallback($output, $process, $callback); } - $process->run($callback, $cmd); + $process->run($callback); if ($verbosity <= $output->getVerbosity()) { $message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode()); @@ -92,9 +81,11 @@ public function run(OutputInterface $output, $cmd, string $error = null, callabl * This is identical to run() except that an exception is thrown if the process * exits with a non-zero exit code. * - * @param string|Process $cmd An instance of Process or a command to run - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR + * @param OutputInterface $output An OutputInterface instance + * @param string|Process $cmd An instance of Process or a command to run + * @param string|null $error An error message that must be displayed if something went wrong + * @param callable|null $callback A PHP callback to run whenever there is some + * output available on STDOUT or STDERR * * @return Process The process that ran * @@ -102,7 +93,7 @@ public function run(OutputInterface $output, $cmd, string $error = null, callabl * * @see run() */ - public function mustRun(OutputInterface $output, $cmd, string $error = null, callable $callback = null): Process + public function mustRun(OutputInterface $output, $cmd, $error = null, callable $callback = null) { $process = $this->run($output, $cmd, $error, $callback); @@ -115,8 +106,14 @@ public function mustRun(OutputInterface $output, $cmd, string $error = null, cal /** * Wraps a Process callback to add debugging output. + * + * @param OutputInterface $output An OutputInterface interface + * @param Process $process The Process + * @param callable|null $callback A PHP callable + * + * @return callable */ - public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null): callable + public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null) { if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); @@ -128,12 +125,12 @@ public function wrapCallback(OutputInterface $output, Process $process, callable $output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type)); if (null !== $callback) { - $callback($type, $buffer); + \call_user_func($callback, $type, $buffer); } }; } - private function escapeString(string $str): string + private function escapeString($str) { return str_replace('<', '\\<', $str); } @@ -141,7 +138,7 @@ private function escapeString(string $str): string /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'process'; } diff --git a/app/vendor/symfony/console/Helper/ProgressBar.php b/app/vendor/symfony/console/Helper/ProgressBar.php index 1c03a1d96..4ee4912f6 100644 --- a/app/vendor/symfony/console/Helper/ProgressBar.php +++ b/app/vendor/symfony/console/Helper/ProgressBar.php @@ -11,10 +11,8 @@ namespace Symfony\Component\Console\Helper; -use Symfony\Component\Console\Cursor; use Symfony\Component\Console\Exception\LogicException; use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Terminal; @@ -26,16 +24,6 @@ */ final class ProgressBar { - public const FORMAT_VERBOSE = 'verbose'; - public const FORMAT_VERY_VERBOSE = 'very_verbose'; - public const FORMAT_DEBUG = 'debug'; - public const FORMAT_NORMAL = 'normal'; - - private const FORMAT_VERBOSE_NOMAX = 'verbose_nomax'; - private const FORMAT_VERY_VERBOSE_NOMAX = 'very_verbose_nomax'; - private const FORMAT_DEBUG_NOMAX = 'debug_nomax'; - private const FORMAT_NORMAL_NOMAX = 'normal_nomax'; - private $barWidth = 28; private $barChar; private $emptyBarChar = '-'; @@ -43,10 +31,6 @@ final class ProgressBar private $format; private $internalFormat; private $redrawFreq = 1; - private $writeCount; - private $lastWriteTime; - private $minSecondsBetweenRedraws = 0; - private $maxSecondsBetweenRedraws = 1; private $output; private $step = 0; private $max; @@ -57,16 +41,16 @@ final class ProgressBar private $messages = []; private $overwrite = true; private $terminal; - private $previousMessage; - private $cursor; + private $firstRun = true; private static $formatters; private static $formats; /** - * @param int $max Maximum steps (0 if unknown) + * @param OutputInterface $output An OutputInterface instance + * @param int $max Maximum steps (0 if unknown) */ - public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 1 / 25) + public function __construct(OutputInterface $output, $max = 0) { if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); @@ -76,21 +60,15 @@ public function __construct(OutputInterface $output, int $max = 0, float $minSec $this->setMaxSteps($max); $this->terminal = new Terminal(); - if (0 < $minSecondsBetweenRedraws) { - $this->redrawFreq = null; - $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws; - } - if (!$this->output->isDecorated()) { // disable overwrite when output does not support ANSI codes. $this->overwrite = false; // set a reasonable redraw frequency so output isn't flooded - $this->redrawFreq = null; + $this->setRedrawFrequency($max / 10); } $this->startTime = time(); - $this->cursor = new Cursor($output); } /** @@ -101,7 +79,7 @@ public function __construct(OutputInterface $output, int $max = 0, float $minSec * @param string $name The placeholder name (including the delimiter char like %) * @param callable $callable A PHP callable */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void + public static function setPlaceholderFormatterDefinition($name, callable $callable) { if (!self::$formatters) { self::$formatters = self::initPlaceholderFormatters(); @@ -117,13 +95,13 @@ public static function setPlaceholderFormatterDefinition(string $name, callable * * @return callable|null A PHP callable */ - public static function getPlaceholderFormatterDefinition(string $name): ?callable + public static function getPlaceholderFormatterDefinition($name) { if (!self::$formatters) { self::$formatters = self::initPlaceholderFormatters(); } - return self::$formatters[$name] ?? null; + return isset(self::$formatters[$name]) ? self::$formatters[$name] : null; } /** @@ -134,7 +112,7 @@ public static function getPlaceholderFormatterDefinition(string $name): ?callabl * @param string $name The format name * @param string $format A format string */ - public static function setFormatDefinition(string $name, string $format): void + public static function setFormatDefinition($name, $format) { if (!self::$formats) { self::$formats = self::initFormats(); @@ -150,13 +128,13 @@ public static function setFormatDefinition(string $name, string $format): void * * @return string|null A format string */ - public static function getFormatDefinition(string $name): ?string + public static function getFormatDefinition($name) { if (!self::$formats) { self::$formats = self::initFormats(); } - return self::$formats[$name] ?? null; + return isset(self::$formats[$name]) ? self::$formats[$name] : null; } /** @@ -169,80 +147,102 @@ public static function getFormatDefinition(string $name): ?string * @param string $message The text to associate with the placeholder * @param string $name The name of the placeholder */ - public function setMessage(string $message, string $name = 'message') + public function setMessage($message, $name = 'message') { $this->messages[$name] = $message; } - public function getMessage(string $name = 'message') + public function getMessage($name = 'message') { return $this->messages[$name]; } - public function getStartTime(): int + /** + * Gets the progress bar start time. + * + * @return int The progress bar start time + */ + public function getStartTime() { return $this->startTime; } - public function getMaxSteps(): int + /** + * Gets the progress bar maximal steps. + * + * @return int The progress bar max steps + */ + public function getMaxSteps() { return $this->max; } - public function getProgress(): int + /** + * Gets the current step position. + * + * @return int The progress bar step + */ + public function getProgress() { return $this->step; } - private function getStepWidth(): int + /** + * Gets the progress bar step width. + * + * @return int The progress bar step width + */ + private function getStepWidth() { return $this->stepWidth; } - public function getProgressPercent(): float + /** + * Gets the current progress bar percent. + * + * @return float The current progress bar percent + */ + public function getProgressPercent() { return $this->percent; } - public function getBarOffset(): float - { - return floor($this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth); - } - - public function getEstimated(): float - { - if (!$this->step) { - return 0; - } - - return round((time() - $this->startTime) / $this->step * $this->max); - } - - public function getRemaining(): float - { - if (!$this->step) { - return 0; - } - - return round((time() - $this->startTime) / $this->step * ($this->max - $this->step)); - } - - public function setBarWidth(int $size) + /** + * Sets the progress bar width. + * + * @param int $size The progress bar size + */ + public function setBarWidth($size) { - $this->barWidth = max(1, $size); + $this->barWidth = max(1, (int) $size); } - public function getBarWidth(): int + /** + * Gets the progress bar width. + * + * @return int The progress bar size + */ + public function getBarWidth() { return $this->barWidth; } - public function setBarCharacter(string $char) + /** + * Sets the bar character. + * + * @param string $char A character + */ + public function setBarCharacter($char) { $this->barChar = $char; } - public function getBarCharacter(): string + /** + * Gets the bar character. + * + * @return string A character + */ + public function getBarCharacter() { if (null === $this->barChar) { return $this->max ? '=' : $this->emptyBarChar; @@ -251,68 +251,65 @@ public function getBarCharacter(): string return $this->barChar; } - public function setEmptyBarCharacter(string $char) + /** + * Sets the empty bar character. + * + * @param string $char A character + */ + public function setEmptyBarCharacter($char) { $this->emptyBarChar = $char; } - public function getEmptyBarCharacter(): string + /** + * Gets the empty bar character. + * + * @return string A character + */ + public function getEmptyBarCharacter() { return $this->emptyBarChar; } - public function setProgressCharacter(string $char) + /** + * Sets the progress bar character. + * + * @param string $char A character + */ + public function setProgressCharacter($char) { $this->progressChar = $char; } - public function getProgressCharacter(): string + /** + * Gets the progress bar character. + * + * @return string A character + */ + public function getProgressCharacter() { return $this->progressChar; } - public function setFormat(string $format) - { - $this->format = null; - $this->internalFormat = $format; - } - /** - * Sets the redraw frequency. + * Sets the progress bar format. * - * @param int|null $freq The frequency in steps + * @param string $format The format */ - public function setRedrawFrequency(?int $freq) - { - $this->redrawFreq = null !== $freq ? max(1, $freq) : null; - } - - public function minSecondsBetweenRedraws(float $seconds): void + public function setFormat($format) { - $this->minSecondsBetweenRedraws = $seconds; - } - - public function maxSecondsBetweenRedraws(float $seconds): void - { - $this->maxSecondsBetweenRedraws = $seconds; + $this->format = null; + $this->internalFormat = $format; } /** - * Returns an iterator that will automatically update the progress bar when iterated. + * Sets the redraw frequency. * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable + * @param int|float $freq The frequency in steps */ - public function iterate(iterable $iterable, int $max = null): iterable + public function setRedrawFrequency($freq) { - $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0)); - - foreach ($iterable as $key => $value) { - yield $key => $value; - - $this->advance(); - } - - $this->finish(); + $this->redrawFreq = max((int) $freq, 1); } /** @@ -320,7 +317,7 @@ public function iterate(iterable $iterable, int $max = null): iterable * * @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged */ - public function start(int $max = null) + public function start($max = null) { $this->startTime = time(); $this->step = 0; @@ -338,63 +335,49 @@ public function start(int $max = null) * * @param int $step Number of steps to advance */ - public function advance(int $step = 1) + public function advance($step = 1) { $this->setProgress($this->step + $step); } /** * Sets whether to overwrite the progressbar, false for new line. + * + * @param bool $overwrite */ - public function setOverwrite(bool $overwrite) + public function setOverwrite($overwrite) { - $this->overwrite = $overwrite; + $this->overwrite = (bool) $overwrite; } - public function setProgress(int $step) + /** + * Sets the current progress. + * + * @param int $step The current progress + */ + public function setProgress($step) { + $step = (int) $step; + if ($this->max && $step > $this->max) { $this->max = $step; } elseif ($step < 0) { $step = 0; } - $redrawFreq = $this->redrawFreq ?? (($this->max ?: 10) / 10); - $prevPeriod = (int) ($this->step / $redrawFreq); - $currPeriod = (int) ($step / $redrawFreq); + $prevPeriod = (int) ($this->step / $this->redrawFreq); + $currPeriod = (int) ($step / $this->redrawFreq); $this->step = $step; $this->percent = $this->max ? (float) $this->step / $this->max : 0; - $timeInterval = microtime(true) - $this->lastWriteTime; - - // Draw regardless of other limits - if ($this->max === $step) { - $this->display(); - - return; - } - - // Throttling - if ($timeInterval < $this->minSecondsBetweenRedraws) { - return; - } - - // Draw each step period, but not too late - if ($prevPeriod !== $currPeriod || $timeInterval >= $this->maxSecondsBetweenRedraws) { + if ($prevPeriod !== $currPeriod || $this->max === $step) { $this->display(); } } - public function setMaxSteps(int $max) - { - $this->format = null; - $this->max = max(0, $max); - $this->stepWidth = $this->max ? Helper::width((string) $this->max) : 4; - } - /** * Finishes the progress output. */ - public function finish(): void + public function finish() { if (!$this->max) { $this->max = $this->step; @@ -411,7 +394,7 @@ public function finish(): void /** * Outputs the current progress string. */ - public function display(): void + public function display() { if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { return; @@ -431,7 +414,7 @@ public function display(): void * while a progress bar is running. * Call display() to show the progress bar again. */ - public function clear(): void + public function clear() { if (!$this->overwrite) { return; @@ -444,7 +427,12 @@ public function clear(): void $this->overwrite(''); } - private function setRealFormat(string $format) + /** + * Sets the progress bar format. + * + * @param string $format The format + */ + private function setRealFormat($format) { // try to use the _nomax variant if available if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { @@ -459,73 +447,65 @@ private function setRealFormat(string $format) } /** - * Overwrites a previous message to the output. + * Sets the progress bar maximal steps. + * + * @param int $max The progress bar max steps */ - private function overwrite(string $message): void + private function setMaxSteps($max) { - if ($this->previousMessage === $message) { - return; - } - - $originalMessage = $message; + $this->max = max(0, (int) $max); + $this->stepWidth = $this->max ? Helper::strlen($this->max) : 4; + } + /** + * Overwrites a previous message to the output. + * + * @param string $message The message + */ + private function overwrite($message) + { if ($this->overwrite) { - if (null !== $this->previousMessage) { - if ($this->output instanceof ConsoleSectionOutput) { - $messageLines = explode("\n", $message); - $lineCount = \count($messageLines); - foreach ($messageLines as $messageLine) { - $messageLineLength = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $messageLine)); - if ($messageLineLength > $this->terminal->getWidth()) { - $lineCount += floor($messageLineLength / $this->terminal->getWidth()); - } - } - $this->output->clear($lineCount); - } else { - for ($i = 0; $i < $this->formatLineCount; ++$i) { - $this->cursor->moveToColumn(1); - $this->cursor->clearLine(); - $this->cursor->moveUp(); - } - - $this->cursor->moveToColumn(1); - $this->cursor->clearLine(); + if (!$this->firstRun) { + // Erase previous lines + if ($this->formatLineCount > 0) { + $message = str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount).$message; } + + // Move the cursor to the beginning of the line and erase the line + $message = "\x0D\x1B[2K$message"; } } elseif ($this->step > 0) { $message = \PHP_EOL.$message; } - $this->previousMessage = $originalMessage; - $this->lastWriteTime = microtime(true); + $this->firstRun = false; $this->output->write($message); - ++$this->writeCount; } - private function determineBestFormat(): string + private function determineBestFormat() { switch ($this->output->getVerbosity()) { // OutputInterface::VERBOSITY_QUIET: display is disabled anyway case OutputInterface::VERBOSITY_VERBOSE: - return $this->max ? self::FORMAT_VERBOSE : self::FORMAT_VERBOSE_NOMAX; + return $this->max ? 'verbose' : 'verbose_nomax'; case OutputInterface::VERBOSITY_VERY_VERBOSE: - return $this->max ? self::FORMAT_VERY_VERBOSE : self::FORMAT_VERY_VERBOSE_NOMAX; + return $this->max ? 'very_verbose' : 'very_verbose_nomax'; case OutputInterface::VERBOSITY_DEBUG: - return $this->max ? self::FORMAT_DEBUG : self::FORMAT_DEBUG_NOMAX; + return $this->max ? 'debug' : 'debug_nomax'; default: - return $this->max ? self::FORMAT_NORMAL : self::FORMAT_NORMAL_NOMAX; + return $this->max ? 'normal' : 'normal_nomax'; } } - private static function initPlaceholderFormatters(): array + private static function initPlaceholderFormatters() { return [ 'bar' => function (self $bar, OutputInterface $output) { - $completeBars = $bar->getBarOffset(); + $completeBars = floor($bar->getMaxSteps() > 0 ? $bar->getProgressPercent() * $bar->getBarWidth() : $bar->getProgress() % $bar->getBarWidth()); $display = str_repeat($bar->getBarCharacter(), $completeBars); if ($completeBars < $bar->getBarWidth()) { - $emptyBars = $bar->getBarWidth() - $completeBars - Helper::length(Helper::removeDecoration($output->getFormatter(), $bar->getProgressCharacter())); + $emptyBars = $bar->getBarWidth() - $completeBars - Helper::strlenWithoutDecoration($output->getFormatter(), $bar->getProgressCharacter()); $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), $emptyBars); } @@ -539,14 +519,26 @@ private static function initPlaceholderFormatters(): array throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); } - return Helper::formatTime($bar->getRemaining()); + if (!$bar->getProgress()) { + $remaining = 0; + } else { + $remaining = round((time() - $bar->getStartTime()) / $bar->getProgress() * ($bar->getMaxSteps() - $bar->getProgress())); + } + + return Helper::formatTime($remaining); }, 'estimated' => function (self $bar) { if (!$bar->getMaxSteps()) { throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); } - return Helper::formatTime($bar->getEstimated()); + if (!$bar->getProgress()) { + $estimated = 0; + } else { + $estimated = round((time() - $bar->getStartTime()) / $bar->getProgress() * $bar->getMaxSteps()); + } + + return Helper::formatTime($estimated); }, 'memory' => function (self $bar) { return Helper::formatMemory(memory_get_usage(true)); @@ -563,29 +555,32 @@ private static function initPlaceholderFormatters(): array ]; } - private static function initFormats(): array + private static function initFormats() { return [ - self::FORMAT_NORMAL => ' %current%/%max% [%bar%] %percent:3s%%', - self::FORMAT_NORMAL_NOMAX => ' %current% [%bar%]', + 'normal' => ' %current%/%max% [%bar%] %percent:3s%%', + 'normal_nomax' => ' %current% [%bar%]', - self::FORMAT_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%', - self::FORMAT_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', + 'verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%', + 'verbose_nomax' => ' %current% [%bar%] %elapsed:6s%', - self::FORMAT_VERY_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%', - self::FORMAT_VERY_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', + 'very_verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%', + 'very_verbose_nomax' => ' %current% [%bar%] %elapsed:6s%', - self::FORMAT_DEBUG => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%', - self::FORMAT_DEBUG_NOMAX => ' %current% [%bar%] %elapsed:6s% %memory:6s%', + 'debug' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%', + 'debug_nomax' => ' %current% [%bar%] %elapsed:6s% %memory:6s%', ]; } - private function buildLine(): string + /** + * @return string + */ + private function buildLine() { $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; $callback = function ($matches) { if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { - $text = $formatter($this, $this->output); + $text = \call_user_func($formatter, $this, $this->output); } elseif (isset($this->messages[$matches[1]])) { $text = $this->messages[$matches[1]]; } else { @@ -602,7 +597,7 @@ private function buildLine(): string // gets string length for each sub line with multiline format $linesLength = array_map(function ($subLine) { - return Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))); + return Helper::strlenWithoutDecoration($this->output->getFormatter(), rtrim($subLine, "\r")); }, explode("\n", $line)); $linesWidth = max($linesLength); diff --git a/app/vendor/symfony/console/Helper/ProgressIndicator.php b/app/vendor/symfony/console/Helper/ProgressIndicator.php index 2d8774201..60ca0213b 100644 --- a/app/vendor/symfony/console/Helper/ProgressIndicator.php +++ b/app/vendor/symfony/console/Helper/ProgressIndicator.php @@ -34,10 +34,11 @@ class ProgressIndicator private static $formats; /** - * @param int $indicatorChangeInterval Change interval in milliseconds - * @param array|null $indicatorValues Animated indicator characters + * @param string|null $format Indicator format + * @param int $indicatorChangeInterval Change interval in milliseconds + * @param array|null $indicatorValues Animated indicator characters */ - public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null) + public function __construct(OutputInterface $output, $format = null, $indicatorChangeInterval = 100, $indicatorValues = null) { $this->output = $output; @@ -63,8 +64,10 @@ public function __construct(OutputInterface $output, string $format = null, int /** * Sets the current indicator message. + * + * @param string|null $message */ - public function setMessage(?string $message) + public function setMessage($message) { $this->message = $message; @@ -73,8 +76,10 @@ public function setMessage(?string $message) /** * Starts the indicator output. + * + * @param $message */ - public function start(string $message) + public function start($message) { if ($this->started) { throw new LogicException('Progress indicator already started.'); @@ -119,7 +124,7 @@ public function advance() * * @param $message */ - public function finish(string $message) + public function finish($message) { if (!$this->started) { throw new LogicException('Progress indicator has not yet been started.'); @@ -134,23 +139,28 @@ public function finish(string $message) /** * Gets the format for a given name. * + * @param string $name The format name + * * @return string|null A format string */ - public static function getFormatDefinition(string $name) + public static function getFormatDefinition($name) { if (!self::$formats) { self::$formats = self::initFormats(); } - return self::$formats[$name] ?? null; + return isset(self::$formats[$name]) ? self::$formats[$name] : null; } /** * Sets a placeholder formatter for a given name. * * This method also allow you to override an existing placeholder. + * + * @param string $name The placeholder name (including the delimiter char like %) + * @param callable $callable A PHP callable */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable) + public static function setPlaceholderFormatterDefinition($name, $callable) { if (!self::$formatters) { self::$formatters = self::initPlaceholderFormatters(); @@ -160,17 +170,19 @@ public static function setPlaceholderFormatterDefinition(string $name, callable } /** - * Gets the placeholder formatter for a given name (including the delimiter char like %). + * Gets the placeholder formatter for a given name. + * + * @param string $name The placeholder name (including the delimiter char like %) * * @return callable|null A PHP callable */ - public static function getPlaceholderFormatterDefinition(string $name) + public static function getPlaceholderFormatterDefinition($name) { if (!self::$formatters) { self::$formatters = self::initPlaceholderFormatters(); } - return self::$formatters[$name] ?? null; + return isset(self::$formatters[$name]) ? self::$formatters[$name] : null; } private function display() @@ -179,16 +191,18 @@ private function display() return; } - $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { - if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { - return $formatter($this); + $self = $this; + + $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) use ($self) { + if ($formatter = $self::getPlaceholderFormatterDefinition($matches[1])) { + return \call_user_func($formatter, $self); } return $matches[0]; - }, $this->format ?? '')); + }, $this->format)); } - private function determineBestFormat(): string + private function determineBestFormat() { switch ($this->output->getVerbosity()) { // OutputInterface::VERBOSITY_QUIET: display is disabled anyway @@ -204,8 +218,10 @@ private function determineBestFormat(): string /** * Overwrites a previous message to the output. + * + * @param string $message The message */ - private function overwrite(string $message) + private function overwrite($message) { if ($this->output->isDecorated()) { $this->output->write("\x0D\x1B[2K"); @@ -215,12 +231,12 @@ private function overwrite(string $message) } } - private function getCurrentTimeInMilliseconds(): float + private function getCurrentTimeInMilliseconds() { return round(microtime(true) * 1000); } - private static function initPlaceholderFormatters(): array + private static function initPlaceholderFormatters() { return [ 'indicator' => function (self $indicator) { @@ -238,7 +254,7 @@ private static function initPlaceholderFormatters(): array ]; } - private static function initFormats(): array + private static function initFormats() { return [ 'normal' => ' %indicator% %message%', diff --git a/app/vendor/symfony/console/Helper/QuestionHelper.php b/app/vendor/symfony/console/Helper/QuestionHelper.php index fd9095928..ac6f2be49 100644 --- a/app/vendor/symfony/console/Helper/QuestionHelper.php +++ b/app/vendor/symfony/console/Helper/QuestionHelper.php @@ -11,20 +11,17 @@ namespace Symfony\Component\Console\Helper; -use Symfony\Component\Console\Cursor; -use Symfony\Component\Console\Exception\MissingInputException; +use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\StreamableInputInterface; use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Terminal; -use function Symfony\Component\String\s; /** * The QuestionHelper class provides helpers to interact with the user. @@ -36,7 +33,6 @@ class QuestionHelper extends Helper private $inputStream; private static $shell; private static $stty = true; - private static $stdinIsInteractive; /** * Asks a question to the user. @@ -52,32 +48,84 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu } if (!$input->isInteractive()) { - return $this->getDefaultAnswer($question); + $default = $question->getDefault(); + + if (null === $default) { + return $default; + } + + if ($validator = $question->getValidator()) { + return \call_user_func($question->getValidator(), $default); + } elseif ($question instanceof ChoiceQuestion) { + $choices = $question->getChoices(); + + if (!$question->isMultiselect()) { + return isset($choices[$default]) ? $choices[$default] : $default; + } + + $default = explode(',', $default); + foreach ($default as $k => $v) { + $v = trim($v); + $default[$k] = isset($choices[$v]) ? $choices[$v] : $v; + } + } + + return $default; } if ($input instanceof StreamableInputInterface && $stream = $input->getStream()) { $this->inputStream = $stream; } - try { - if (!$question->getValidator()) { - return $this->doAsk($output, $question); - } + if (!$question->getValidator()) { + return $this->doAsk($output, $question); + } - $interviewer = function () use ($output, $question) { - return $this->doAsk($output, $question); - }; + $interviewer = function () use ($output, $question) { + return $this->doAsk($output, $question); + }; - return $this->validateAttempts($interviewer, $output, $question); - } catch (MissingInputException $exception) { - $input->setInteractive(false); + return $this->validateAttempts($interviewer, $output, $question); + } - if (null === $fallbackOutput = $this->getDefaultAnswer($question)) { - throw $exception; - } + /** + * Sets the input stream to read from when interacting with the user. + * + * This is mainly useful for testing purpose. + * + * @deprecated since version 3.2, to be removed in 4.0. Use + * StreamableInputInterface::setStream() instead. + * + * @param resource $stream The input stream + * + * @throws InvalidArgumentException In case the stream is not a resource + */ + public function setInputStream($stream) + { + @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.2 and will be removed in 4.0. Use %s::setStream() instead.', __METHOD__, StreamableInputInterface::class), \E_USER_DEPRECATED); + + if (!\is_resource($stream)) { + throw new InvalidArgumentException('Input stream must be a valid resource.'); + } + + $this->inputStream = $stream; + } - return $fallbackOutput; + /** + * Returns the helper's input stream. + * + * @deprecated since version 3.2, to be removed in 4.0. Use + * StreamableInputInterface::getStream() instead. + * + * @return resource + */ + public function getInputStream() + { + if (0 === \func_num_args() || func_get_arg(0)) { + @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.2 and will be removed in 4.0. Use %s::getStream() instead.', __METHOD__, StreamableInputInterface::class), \E_USER_DEPRECATED); } + + return $this->inputStream; } /** @@ -99,7 +147,7 @@ public static function disableStty() /** * Asks the question to the user. * - * @return mixed + * @return bool|mixed|string|null * * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden */ @@ -108,14 +156,18 @@ private function doAsk(OutputInterface $output, Question $question) $this->writePrompt($output, $question); $inputStream = $this->inputStream ?: \STDIN; - $autocomplete = $question->getAutocompleterCallback(); + $autocomplete = $question->getAutocompleterValues(); + + if (\function_exists('sapi_windows_cp_set')) { + // Codepage used by cmd.exe on Windows to allow special characters (éàüñ). + @sapi_windows_cp_set(1252); + } if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) { $ret = false; if ($question->isHidden()) { try { - $hiddenResponse = $this->getHiddenResponse($output, $inputStream, $question->isTrimmable()); - $ret = $question->isTrimmable() ? trim($hiddenResponse) : $hiddenResponse; + $ret = trim($this->getHiddenResponse($output, $inputStream)); } catch (RuntimeException $e) { if (!$question->isHiddenFallback()) { throw $e; @@ -124,21 +176,14 @@ private function doAsk(OutputInterface $output, Question $question) } if (false === $ret) { - $ret = $this->readInput($inputStream, $question); + $ret = fgets($inputStream, 4096); if (false === $ret) { - throw new MissingInputException('Aborted.'); - } - if ($question->isTrimmable()) { - $ret = trim($ret); + throw new RuntimeException('Aborted.'); } + $ret = trim($ret); } } else { - $autocomplete = $this->autocomplete($output, $question, $inputStream, $autocomplete); - $ret = $question->isTrimmable() ? trim($autocomplete) : $autocomplete; - } - - if ($output instanceof ConsoleSectionOutput) { - $output->addContent($ret); + $ret = trim($this->autocomplete($output, $question, $inputStream, \is_array($autocomplete) ? $autocomplete : iterator_to_array($autocomplete, false))); } $ret = \strlen($ret) > 0 ? $ret : $question->getDefault(); @@ -150,36 +195,6 @@ private function doAsk(OutputInterface $output, Question $question) return $ret; } - /** - * @return mixed - */ - private function getDefaultAnswer(Question $question) - { - $default = $question->getDefault(); - - if (null === $default) { - return $default; - } - - if ($validator = $question->getValidator()) { - return \call_user_func($question->getValidator(), $default); - } elseif ($question instanceof ChoiceQuestion) { - $choices = $question->getChoices(); - - if (!$question->isMultiselect()) { - return $choices[$default] ?? $default; - } - - $default = explode(',', $default); - foreach ($default as $k => $v) { - $v = $question->isTrimmable() ? trim($v) : $v; - $default[$k] = $choices[$v] ?? $v; - } - } - - return $default; - } - /** * Outputs the question prompt. */ @@ -199,16 +214,18 @@ protected function writePrompt(OutputInterface $output, Question $question) } /** + * @param string $tag + * * @return string[] */ - protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag) + protected function formatChoiceQuestionChoices(ChoiceQuestion $question, $tag) { $messages = []; - $maxWidth = max(array_map('self::width', array_keys($choices = $question->getChoices()))); + $maxWidth = max(array_map('self::strlen', array_keys($choices = $question->getChoices()))); foreach ($choices as $key => $value) { - $padding = str_repeat(' ', $maxWidth - self::width($key)); + $padding = str_repeat(' ', $maxWidth - self::strlen($key)); $messages[] = sprintf(" [<$tag>%s$padding] %s", $key, $value); } @@ -234,17 +251,17 @@ protected function writeError(OutputInterface $output, \Exception $error) * Autocompletes a question. * * @param resource $inputStream + * + * @return string */ - private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete): string + private function autocomplete(OutputInterface $output, Question $question, $inputStream, array $autocomplete) { - $cursor = new Cursor($output, $inputStream); - $fullChoice = ''; $ret = ''; $i = 0; $ofs = -1; - $matches = $autocomplete($ret); + $matches = $autocomplete; $numMatches = \count($matches); $sttyMode = shell_exec('stty -g'); @@ -262,18 +279,18 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) { shell_exec(sprintf('stty %s', $sttyMode)); - throw new MissingInputException('Aborted.'); + throw new RuntimeException('Aborted.'); } elseif ("\177" === $c) { // Backspace Character if (0 === $numMatches && 0 !== $i) { --$i; - $cursor->moveLeft(s($fullChoice)->slice(-1)->width(false)); - $fullChoice = self::substr($fullChoice, 0, $i); + // Move cursor backwards + $output->write("\033[1D"); } if (0 === $i) { $ofs = -1; - $matches = $autocomplete($ret); + $matches = $autocomplete; $numMatches = \count($matches); } else { $numMatches = 0; @@ -301,21 +318,12 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu } elseif (\ord($c) < 32) { if ("\t" === $c || "\n" === $c) { if ($numMatches > 0 && -1 !== $ofs) { - $ret = (string) $matches[$ofs]; + $ret = $matches[$ofs]; // Echo out remaining chars for current match $remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)))); $output->write($remainingCharacters); $fullChoice .= $remainingCharacters; - $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding); - - $matches = array_filter( - $autocomplete($ret), - function ($match) use ($ret) { - return '' === $ret || str_starts_with($match, $ret); - } - ); - $numMatches = \count($matches); - $ofs = -1; + $i = self::strlen($fullChoice); } if ("\n" === $c) { @@ -346,22 +354,25 @@ function ($match) use ($ret) { $numMatches = 0; $ofs = 0; - foreach ($autocomplete($ret) as $value) { + foreach ($autocomplete as $value) { // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) - if (str_starts_with($value, $tempRet)) { + if (0 === strpos($value, $tempRet)) { $matches[$numMatches++] = $value; } } } - $cursor->clearLineAfter(); + // Erase characters from cursor to end of line + $output->write("\033[K"); if ($numMatches > 0 && -1 !== $ofs) { - $cursor->savePosition(); + // Save cursor position + $output->write("\0337"); // Write highlighted text, complete the partially entered response $charactersEntered = \strlen(trim($this->mostRecentlyEnteredValue($fullChoice))); $output->write(''.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).''); - $cursor->restorePosition(); + // Restore cursor position + $output->write("\0338"); } } @@ -371,15 +382,15 @@ function ($match) use ($ret) { return $fullChoice; } - private function mostRecentlyEnteredValue(string $entered): string + private function mostRecentlyEnteredValue($entered) { // Determine the most recent value that the user entered - if (!str_contains($entered, ',')) { + if (false === strpos($entered, ',')) { return $entered; } $choices = explode(',', $entered); - if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) { + if (\strlen($lastChoice = trim($choices[\count($choices) - 1])) > 0) { return $lastChoice; } @@ -389,12 +400,14 @@ private function mostRecentlyEnteredValue(string $entered): string /** * Gets a hidden response from user. * - * @param resource $inputStream The handler resource - * @param bool $trimmable Is the answer trimmable + * @param OutputInterface $output An Output instance + * @param resource $inputStream The handler resource + * + * @return string The answer * * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden */ - private function getHiddenResponse(OutputInterface $output, $inputStream, bool $trimmable = true): string + private function getHiddenResponse(OutputInterface $output, $inputStream) { if ('\\' === \DIRECTORY_SEPARATOR) { $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; @@ -406,8 +419,7 @@ private function getHiddenResponse(OutputInterface $output, $inputStream, bool $ $exe = $tmpExe; } - $sExec = shell_exec('"'.$exe.'"'); - $value = $trimmable ? rtrim($sExec) : $sExec; + $value = rtrim(shell_exec($exe)); $output->writeln(''); if (isset($tmpExe)) { @@ -419,32 +431,39 @@ private function getHiddenResponse(OutputInterface $output, $inputStream, bool $ if (self::$stty && Terminal::hasSttyAvailable()) { $sttyMode = shell_exec('stty -g'); + shell_exec('stty -echo'); - } elseif ($this->isInteractiveInput($inputStream)) { - throw new RuntimeException('Unable to hide the response.'); - } + $value = fgets($inputStream, 4096); + shell_exec(sprintf('stty %s', $sttyMode)); - $value = fgets($inputStream, 4096); + if (false === $value) { + throw new RuntimeException('Aborted.'); + } - if (self::$stty && Terminal::hasSttyAvailable()) { - shell_exec(sprintf('stty %s', $sttyMode)); - } + $value = trim($value); + $output->writeln(''); - if (false === $value) { - throw new MissingInputException('Aborted.'); + return $value; } - if ($trimmable) { - $value = trim($value); + + if (false !== $shell = $this->getShell()) { + $readCmd = 'csh' === $shell ? 'set mypassword = $<' : 'read -r mypassword'; + $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd); + $value = rtrim(shell_exec($command)); + $output->writeln(''); + + return $value; } - $output->writeln(''); - return $value; + throw new RuntimeException('Unable to hide the response.'); } /** * Validates an attempt. * - * @param callable $interviewer A callable that will ask for a question and return the result + * @param callable $interviewer A callable that will ask for a question and return the result + * @param OutputInterface $output An Output instance + * @param Question $question A Question instance * * @return mixed The validated response * @@ -454,14 +473,13 @@ private function validateAttempts(callable $interviewer, OutputInterface $output { $error = null; $attempts = $question->getMaxAttempts(); - while (null === $attempts || $attempts--) { if (null !== $error) { $this->writeError($output, $error); } try { - return $question->getValidator()($interviewer()); + return \call_user_func($question->getValidator(), $interviewer()); } catch (RuntimeException $e) { throw $e; } catch (\Exception $error) { @@ -471,135 +489,30 @@ private function validateAttempts(callable $interviewer, OutputInterface $output throw $error; } - private function isInteractiveInput($inputStream): bool - { - if ('php://stdin' !== (stream_get_meta_data($inputStream)['uri'] ?? null)) { - return false; - } - - if (null !== self::$stdinIsInteractive) { - return self::$stdinIsInteractive; - } - - if (\function_exists('stream_isatty')) { - return self::$stdinIsInteractive = stream_isatty(fopen('php://stdin', 'r')); - } - - if (\function_exists('posix_isatty')) { - return self::$stdinIsInteractive = posix_isatty(fopen('php://stdin', 'r')); - } - - if (!\function_exists('exec')) { - return self::$stdinIsInteractive = true; - } - - exec('stty 2> /dev/null', $output, $status); - - return self::$stdinIsInteractive = 1 !== $status; - } - /** - * Reads one or more lines of input and returns what is read. + * Returns a valid unix shell. * - * @param resource $inputStream The handler resource - * @param Question $question The question being asked - * - * @return string|false The input received, false in case input could not be read + * @return string|bool The valid shell name, false in case no valid shell is found */ - private function readInput($inputStream, Question $question) + private function getShell() { - if (!$question->isMultiline()) { - $cp = $this->setIOCodepage(); - $ret = fgets($inputStream, 4096); - - return $this->resetIOCodepage($cp, $ret); - } - - $multiLineStreamReader = $this->cloneInputStream($inputStream); - if (null === $multiLineStreamReader) { - return false; + if (null !== self::$shell) { + return self::$shell; } - $ret = ''; - $cp = $this->setIOCodepage(); - while (false !== ($char = fgetc($multiLineStreamReader))) { - if (\PHP_EOL === "{$ret}{$char}") { - break; - } - $ret .= $char; - } + self::$shell = false; - return $this->resetIOCodepage($cp, $ret); - } - - /** - * Sets console I/O to the host code page. - * - * @return int Previous code page in IBM/EBCDIC format - */ - private function setIOCodepage(): int - { - if (\function_exists('sapi_windows_cp_set')) { - $cp = sapi_windows_cp_get(); - sapi_windows_cp_set(sapi_windows_cp_get('oem')); - - return $cp; - } - - return 0; - } - - /** - * Sets console I/O to the specified code page and converts the user input. - * - * @param string|false $input - * - * @return string|false - */ - private function resetIOCodepage(int $cp, $input) - { - if (0 !== $cp) { - sapi_windows_cp_set($cp); - - if (false !== $input && '' !== $input) { - $input = sapi_windows_cp_conv(sapi_windows_cp_get('oem'), $cp, $input); + if (file_exists('/usr/bin/env')) { + // handle other OSs with bash/zsh/ksh/csh if available to hide the answer + $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null"; + foreach (['bash', 'zsh', 'ksh', 'csh'] as $sh) { + if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) { + self::$shell = $sh; + break; + } } } - return $input; - } - - /** - * Clones an input stream in order to act on one instance of the same - * stream without affecting the other instance. - * - * @param resource $inputStream The handler resource - * - * @return resource|null The cloned resource, null in case it could not be cloned - */ - private function cloneInputStream($inputStream) - { - $streamMetaData = stream_get_meta_data($inputStream); - $seekable = $streamMetaData['seekable'] ?? false; - $mode = $streamMetaData['mode'] ?? 'rb'; - $uri = $streamMetaData['uri'] ?? null; - - if (null === $uri) { - return null; - } - - $cloneStream = fopen($uri, $mode); - - // For seekable and writable streams, add all the same data to the - // cloned stream and then seek to the same offset. - if (true === $seekable && !\in_array($mode, ['r', 'rb', 'rt'])) { - $offset = ftell($inputStream); - rewind($inputStream); - stream_copy_to_stream($inputStream, $cloneStream); - fseek($inputStream, $offset); - fseek($cloneStream, $offset); - } - - return $cloneStream; + return self::$shell; } } diff --git a/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php index 01f94aba4..86bebd9d7 100644 --- a/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php +++ b/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php @@ -11,7 +11,9 @@ namespace Symfony\Component\Console\Helper; +use Symfony\Component\Console\Exception\LogicException; use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\ConfirmationQuestion; @@ -25,6 +27,32 @@ */ class SymfonyQuestionHelper extends QuestionHelper { + /** + * {@inheritdoc} + * + * To be removed in 4.0 + */ + public function ask(InputInterface $input, OutputInterface $output, Question $question) + { + $validator = $question->getValidator(); + $question->setValidator(function ($value) use ($validator) { + if (null !== $validator) { + $value = $validator($value); + } else { + // make required + if (!\is_array($value) && !\is_bool($value) && 0 === \strlen($value)) { + @trigger_error('The default question validator is deprecated since Symfony 3.3 and will not be used anymore in version 4.0. Set a custom question validator if needed.', \E_USER_DEPRECATED); + + throw new LogicException('A value is required.'); + } + } + + return $value; + }); + + return parent::ask($input, $output, $question); + } + /** * {@inheritdoc} */ @@ -33,10 +61,6 @@ protected function writePrompt(OutputInterface $output, Question $question) $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); $default = $question->getDefault(); - if ($question->isMultiline()) { - $text .= sprintf(' (press %s to continue)', $this->getEofShortcut()); - } - switch (true) { case null === $default: $text = sprintf(' %s:', $text); @@ -62,7 +86,7 @@ protected function writePrompt(OutputInterface $output, Question $question) case $question instanceof ChoiceQuestion: $choices = $question->getChoices(); - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default)); + $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape(isset($choices[$default]) ? $choices[$default] : $default)); break; @@ -97,13 +121,4 @@ protected function writeError(OutputInterface $output, \Exception $error) parent::writeError($output, $error); } - - private function getEofShortcut(): string - { - if ('Windows' === \PHP_OS_FAMILY) { - return 'Ctrl+Z then Enter'; - } - - return 'Ctrl+D'; - } } diff --git a/app/vendor/symfony/console/Helper/Table.php b/app/vendor/symfony/console/Helper/Table.php index 15c515e99..e6dc6a8a5 100644 --- a/app/vendor/symfony/console/Helper/Table.php +++ b/app/vendor/symfony/console/Helper/Table.php @@ -12,10 +12,6 @@ namespace Symfony\Component\Console\Helper; use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; use Symfony\Component\Console\Output\OutputInterface; /** @@ -25,20 +21,9 @@ * @author Саша Стаменковић * @author Abdellatif Ait boudad * @author Max Grigorian - * @author Dany Maillard */ class Table { - private const SEPARATOR_TOP = 0; - private const SEPARATOR_TOP_BOTTOM = 1; - private const SEPARATOR_MID = 2; - private const SEPARATOR_BOTTOM = 3; - private const BORDER_OUTSIDE = 0; - private const BORDER_INSIDE = 1; - - private $headerTitle; - private $footerTitle; - /** * Table headers. */ @@ -48,7 +33,6 @@ class Table * Table rows. */ private $rows = []; - private $horizontal = false; /** * Column widths cache. @@ -83,12 +67,9 @@ class Table * @var array */ private $columnWidths = []; - private $columnMaxWidths = []; private static $styles; - private $rendered = false; - public function __construct(OutputInterface $output) { $this->output = $output; @@ -102,8 +83,11 @@ public function __construct(OutputInterface $output) /** * Sets a style definition. + * + * @param string $name The style name + * @param TableStyle $style A TableStyle instance */ - public static function setStyleDefinition(string $name, TableStyle $style) + public static function setStyleDefinition($name, TableStyle $style) { if (!self::$styles) { self::$styles = self::initStyles(); @@ -115,9 +99,11 @@ public static function setStyleDefinition(string $name, TableStyle $style) /** * Gets a style definition by name. * + * @param string $name The style name + * * @return TableStyle */ - public static function getStyleDefinition(string $name) + public static function getStyleDefinition($name) { if (!self::$styles) { self::$styles = self::initStyles(); @@ -157,12 +143,15 @@ public function getStyle() /** * Sets table column style. * - * @param TableStyle|string $name The style name or a TableStyle instance + * @param int $columnIndex Column index + * @param TableStyle|string $name The style name or a TableStyle instance * * @return $this */ - public function setColumnStyle(int $columnIndex, $name) + public function setColumnStyle($columnIndex, $name) { + $columnIndex = (int) $columnIndex; + $this->columnStyles[$columnIndex] = $this->resolveStyle($name); return $this; @@ -173,21 +162,30 @@ public function setColumnStyle(int $columnIndex, $name) * * If style was not set, it returns the global table style. * + * @param int $columnIndex Column index + * * @return TableStyle */ - public function getColumnStyle(int $columnIndex) + public function getColumnStyle($columnIndex) { - return $this->columnStyles[$columnIndex] ?? $this->getStyle(); + if (isset($this->columnStyles[$columnIndex])) { + return $this->columnStyles[$columnIndex]; + } + + return $this->getStyle(); } /** * Sets the minimum width of a column. * + * @param int $columnIndex Column index + * @param int $width Minimum column width in characters + * * @return $this */ - public function setColumnWidth(int $columnIndex, int $width) + public function setColumnWidth($columnIndex, $width) { - $this->columnWidths[$columnIndex] = $width; + $this->columnWidths[(int) $columnIndex] = (int) $width; return $this; } @@ -207,25 +205,6 @@ public function setColumnWidths(array $widths) return $this; } - /** - * Sets the maximum width of a column. - * - * Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while - * formatted strings are preserved. - * - * @return $this - */ - public function setColumnMaxWidth(int $columnIndex, int $width): self - { - if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) { - throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); - } - - $this->columnMaxWidths[$columnIndex] = $width; - - return $this; - } - public function setHeaders(array $headers) { $headers = array_values($headers); @@ -271,25 +250,6 @@ public function addRow($row) return $this; } - /** - * Adds a row to the table, and re-renders the table. - */ - public function appendRow($row): self - { - if (!$this->output instanceof ConsoleSectionOutput) { - throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); - } - - if ($this->rendered) { - $this->output->clear($this->calculateRowCount()); - } - - $this->addRow($row); - $this->render(); - - return $this; - } - public function setRow($column, array $row) { $this->rows[$column] = $row; @@ -297,27 +257,6 @@ public function setRow($column, array $row) return $this; } - public function setHeaderTitle(?string $title): self - { - $this->headerTitle = $title; - - return $this; - } - - public function setFooterTitle(?string $title): self - { - $this->footerTitle = $title; - - return $this; - } - - public function setHorizontal(bool $horizontal = true): self - { - $this->horizontal = $horizontal; - - return $this; - } - /** * Renders table to output. * @@ -333,71 +272,31 @@ public function setHorizontal(bool $horizontal = true): self */ public function render() { - $divider = new TableSeparator(); - if ($this->horizontal) { - $rows = []; - foreach ($this->headers[0] ?? [] as $i => $header) { - $rows[$i] = [$header]; - foreach ($this->rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - if (isset($row[$i])) { - $rows[$i][] = $row[$i]; - } elseif ($rows[$i][0] instanceof TableCell && $rows[$i][0]->getColspan() >= 2) { - // Noop, there is a "title" - } else { - $rows[$i][] = null; - } - } - } - } else { - $rows = array_merge($this->headers, [$divider], $this->rows); - } - - $this->calculateNumberOfColumns($rows); + $this->calculateNumberOfColumns(); + $rows = $this->buildTableRows($this->rows); + $headers = $this->buildTableRows($this->headers); - $rows = $this->buildTableRows($rows); - $this->calculateColumnsWidth($rows); - - $isHeader = !$this->horizontal; - $isFirstRow = $this->horizontal; - $hasTitle = (bool) $this->headerTitle; - foreach ($rows as $row) { - if ($divider === $row) { - $isHeader = false; - $isFirstRow = true; + $this->calculateColumnsWidth(array_merge($headers, $rows)); - continue; + $this->renderRowSeparator(); + if (!empty($headers)) { + foreach ($headers as $header) { + $this->renderRow($header, $this->style->getCellHeaderFormat()); + $this->renderRowSeparator(); } + } + foreach ($rows as $row) { if ($row instanceof TableSeparator) { $this->renderRowSeparator(); - - continue; - } - if (!$row) { - continue; - } - - if ($isHeader || $isFirstRow) { - $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $isFirstRow = false; - $hasTitle = false; - } - if ($this->horizontal) { - $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat()); } else { - $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat()); + $this->renderRow($row, $this->style->getCellRowFormat()); } } - $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat()); + if (!empty($rows)) { + $this->renderRowSeparator(); + } $this->cleanup(); - $this->rendered = true; } /** @@ -407,49 +306,19 @@ public function render() * * +-----+-----------+-------+ */ - private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null) + private function renderRowSeparator() { if (0 === $count = $this->numberOfColumns) { return; } - $borders = $this->style->getBorderChars(); - if (!$borders[0] && !$borders[2] && !$this->style->getCrossingChar()) { + if (!$this->style->getHorizontalBorderChar() && !$this->style->getCrossingChar()) { return; } - $crossings = $this->style->getCrossingChars(); - if (self::SEPARATOR_MID === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[2], $crossings[8], $crossings[0], $crossings[4]]; - } elseif (self::SEPARATOR_TOP === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[1], $crossings[2], $crossings[3]]; - } elseif (self::SEPARATOR_TOP_BOTTOM === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[9], $crossings[10], $crossings[11]]; - } else { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]]; - } - - $markup = $leftChar; + $markup = $this->style->getCrossingChar(); for ($column = 0; $column < $count; ++$column) { - $markup .= str_repeat($horizontal, $this->effectiveColumnWidths[$column]); - $markup .= $column === $count - 1 ? $rightChar : $midChar; - } - - if (null !== $title) { - $titleLength = Helper::width(Helper::removeDecoration($formatter = $this->output->getFormatter(), $formattedTitle = sprintf($titleFormat, $title))); - $markupLength = Helper::width($markup); - if ($titleLength > $limit = $markupLength - 4) { - $titleLength = $limit; - $formatLength = Helper::width(Helper::removeDecoration($formatter, sprintf($titleFormat, ''))); - $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); - } - - $titleStart = intdiv($markupLength - $titleLength, 2); - if (false === mb_detect_encoding($markup, null, true)) { - $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength); - } else { - $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength); - } + $markup .= str_repeat($this->style->getHorizontalBorderChar(), $this->effectiveColumnWidths[$column]).$this->style->getCrossingChar(); } $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup)); @@ -458,11 +327,9 @@ private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $tit /** * Renders vertical column separator. */ - private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string + private function renderColumnSeparator() { - $borders = $this->style->getBorderChars(); - - return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); + return sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar()); } /** @@ -471,29 +338,32 @@ private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string * Example: * * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | + * + * @param string $cellFormat */ - private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null) - { - $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); - $columns = $this->getRowColumns($row); - $last = \count($columns) - 1; - foreach ($columns as $i => $column) { - if ($firstCellFormat && 0 === $i) { - $rowContent .= $this->renderCell($row, $column, $firstCellFormat); - } else { - $rowContent .= $this->renderCell($row, $column, $cellFormat); - } - $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE); + private function renderRow(array $row, $cellFormat) + { + if (empty($row)) { + return; + } + + $rowContent = $this->renderColumnSeparator(); + foreach ($this->getRowColumns($row) as $column) { + $rowContent .= $this->renderCell($row, $column, $cellFormat); + $rowContent .= $this->renderColumnSeparator(); } $this->output->writeln($rowContent); } /** * Renders table cell with padding. + * + * @param int $column + * @param string $cellFormat */ - private function renderCell(array $row, int $column, string $cellFormat): string + private function renderCell(array $row, $column, $cellFormat) { - $cell = $row[$column] ?? ''; + $cell = isset($row[$column]) ? $row[$column] : ''; $width = $this->effectiveColumnWidths[$column]; if ($cell instanceof TableCell && $cell->getColspan() > 1) { // add the width of the following columns(numbers of colspan). @@ -510,45 +380,26 @@ private function renderCell(array $row, int $column, string $cellFormat): string $style = $this->getColumnStyle($column); if ($cell instanceof TableSeparator) { - return sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); + return sprintf($style->getBorderFormat(), str_repeat($style->getHorizontalBorderChar(), $width)); } - $width += Helper::length($cell) - Helper::length(Helper::removeDecoration($this->output->getFormatter(), $cell)); + $width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell); $content = sprintf($style->getCellRowContentFormat(), $cell); - $padType = $style->getPadType(); - if ($cell instanceof TableCell && $cell->getStyle() instanceof TableCellStyle) { - $isNotStyledByTag = !preg_match('/^<(\w+|(\w+=[\w,]+;?)*)>.+<\/(\w+|(\w+=\w+;?)*)?>$/', $cell); - if ($isNotStyledByTag) { - $cellFormat = $cell->getStyle()->getCellFormat(); - if (!\is_string($cellFormat)) { - $tag = http_build_query($cell->getStyle()->getTagOptions(), '', ';'); - $cellFormat = '<'.$tag.'>%s'; - } - - if (strstr($content, '')) { - $content = str_replace('', '', $content); - $width -= 3; - } - if (strstr($content, '')) { - $content = str_replace('', '', $content); - $width -= \strlen(''); - } - } - - $padType = $cell->getStyle()->getPadByAlign(); - } - - return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $padType)); + return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $style->getPadType())); } /** * Calculate number of columns for this table. */ - private function calculateNumberOfColumns(array $rows) + private function calculateNumberOfColumns() { + if (null !== $this->numberOfColumns) { + return; + } + $columns = [0]; - foreach ($rows as $row) { + foreach (array_merge($this->headers, $this->rows) as $row) { if ($row instanceof TableSeparator) { continue; } @@ -559,82 +410,57 @@ private function calculateNumberOfColumns(array $rows) $this->numberOfColumns = max($columns); } - private function buildTableRows(array $rows): TableRows + private function buildTableRows($rows) { - /** @var WrappableOutputFormatterInterface $formatter */ - $formatter = $this->output->getFormatter(); $unmergedRows = []; for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) { $rows = $this->fillNextRows($rows, $rowKey); // Remove any new line breaks and replace it with a new line foreach ($rows[$rowKey] as $column => $cell) { - $colspan = $cell instanceof TableCell ? $cell->getColspan() : 1; - - if (isset($this->columnMaxWidths[$column]) && Helper::width(Helper::removeDecoration($formatter, $cell)) > $this->columnMaxWidths[$column]) { - $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan); - } - if (!strstr($cell ?? '', "\n")) { + if (!strstr($cell, "\n")) { continue; } - $escaped = implode("\n", array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode("\n", $cell))); - $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; $lines = explode("\n", str_replace("\n", "\n", $cell)); foreach ($lines as $lineKey => $line) { - if ($colspan > 1) { - $line = new TableCell($line, ['colspan' => $colspan]); + if ($cell instanceof TableCell) { + $line = new TableCell($line, ['colspan' => $cell->getColspan()]); } if (0 === $lineKey) { $rows[$rowKey][$column] = $line; } else { - if (!\array_key_exists($rowKey, $unmergedRows) || !\array_key_exists($lineKey, $unmergedRows[$rowKey])) { - $unmergedRows[$rowKey][$lineKey] = $this->copyRow($rows, $rowKey); - } $unmergedRows[$rowKey][$lineKey][$column] = $line; } } } } - return new TableRows(function () use ($rows, $unmergedRows): \Traversable { - foreach ($rows as $rowKey => $row) { - yield $row instanceof TableSeparator ? $row : $this->fillCells($row); - - if (isset($unmergedRows[$rowKey])) { - foreach ($unmergedRows[$rowKey] as $row) { - yield $row instanceof TableSeparator ? $row : $this->fillCells($row); - } - } + $tableRows = []; + foreach ($rows as $rowKey => $row) { + $tableRows[] = $this->fillCells($row); + if (isset($unmergedRows[$rowKey])) { + $tableRows = array_merge($tableRows, $unmergedRows[$rowKey]); } - }); - } - - private function calculateRowCount(): int - { - $numberOfRows = \count(iterator_to_array($this->buildTableRows(array_merge($this->headers, [new TableSeparator()], $this->rows)))); - - if ($this->headers) { - ++$numberOfRows; // Add row for header separator - } - - if (\count($this->rows) > 0) { - ++$numberOfRows; // Add row for footer separator } - return $numberOfRows; + return $tableRows; } /** * fill rows that contains rowspan > 1. * + * @param int $line + * + * @return array + * * @throws InvalidArgumentException */ - private function fillNextRows(array $rows, int $line): array + private function fillNextRows(array $rows, $line) { $unmergedRows = []; foreach ($rows[$line] as $column => $cell) { if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) { - throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); + throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', \gettype($cell))); } if ($cell instanceof TableCell && $cell->getRowspan() > 1) { $nbLines = $cell->getRowspan() - 1; @@ -643,15 +469,15 @@ private function fillNextRows(array $rows, int $line): array $lines = explode("\n", str_replace("\n", "\n", $cell)); $nbLines = \count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines; - $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); + $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan()]); unset($lines[0]); } // create a two dimensional array (rowspan x colspan) $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, []), $unmergedRows); foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - $value = $lines[$unmergedRowKey - $line] ?? ''; - $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); + $value = isset($lines[$unmergedRowKey - $line]) ? $lines[$unmergedRowKey - $line] : ''; + $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan()]); if ($nbLines === $unmergedRowKey - $line) { break; } @@ -682,11 +508,12 @@ private function fillNextRows(array $rows, int $line): array /** * fill cells for a row that contains colspan > 1. + * + * @return array */ - private function fillCells(iterable $row) + private function fillCells($row) { $newRow = []; - foreach ($row as $column => $cell) { $newRow[] = $cell; if ($cell instanceof TableCell && $cell->getColspan() > 1) { @@ -700,7 +527,12 @@ private function fillCells(iterable $row) return $newRow ?: $row; } - private function copyRow(array $rows, int $line): array + /** + * @param int $line + * + * @return array + */ + private function copyRow(array $rows, $line) { $row = $rows[$line]; foreach ($row as $cellKey => $cellValue) { @@ -715,8 +547,10 @@ private function copyRow(array $rows, int $line): array /** * Gets number of columns by row. + * + * @return int */ - private function getNumberOfColumns(array $row): int + private function getNumberOfColumns(array $row) { $columns = \count($row); foreach ($row as $column) { @@ -728,8 +562,10 @@ private function getNumberOfColumns(array $row): int /** * Gets list of columns for the given row. + * + * @return array */ - private function getRowColumns(array $row): array + private function getRowColumns(array $row) { $columns = range(0, $this->numberOfColumns - 1); foreach ($row as $cellKey => $cell) { @@ -745,7 +581,7 @@ private function getRowColumns(array $row): array /** * Calculates columns widths. */ - private function calculateColumnsWidth(iterable $rows) + private function calculateColumnsWidth(array $rows) { for ($column = 0; $column < $this->numberOfColumns; ++$column) { $lengths = []; @@ -757,7 +593,7 @@ private function calculateColumnsWidth(iterable $rows) foreach ($row as $i => $cell) { if ($cell instanceof TableCell) { $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); - $textLength = Helper::width($textContent); + $textLength = Helper::strlen($textContent); if ($textLength > 0) { $contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan())); foreach ($contentColumns as $position => $content) { @@ -770,28 +606,39 @@ private function calculateColumnsWidth(iterable $rows) $lengths[] = $this->getCellWidth($row, $column); } - $this->effectiveColumnWidths[$column] = max($lengths) + Helper::width($this->style->getCellRowContentFormat()) - 2; + $this->effectiveColumnWidths[$column] = max($lengths) + Helper::strlen($this->style->getCellRowContentFormat()) - 2; } } - private function getColumnSeparatorWidth(): int + /** + * Gets column width. + * + * @return int + */ + private function getColumnSeparatorWidth() { - return Helper::width(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); + return Helper::strlen(sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar())); } - private function getCellWidth(array $row, int $column): int + /** + * Gets cell width. + * + * @param int $column + * + * @return int + */ + private function getCellWidth(array $row, $column) { $cellWidth = 0; if (isset($row[$column])) { $cell = $row[$column]; - $cellWidth = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $cell)); + $cellWidth = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell); } - $columnWidth = $this->columnWidths[$column] ?? 0; - $cellWidth = max($cellWidth, $columnWidth); + $columnWidth = isset($this->columnWidths[$column]) ? $this->columnWidths[$column] : 0; - return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth; + return max($cellWidth, $columnWidth); } /** @@ -803,54 +650,40 @@ private function cleanup() $this->numberOfColumns = null; } - private static function initStyles(): array + private static function initStyles() { $borderless = new TableStyle(); $borderless - ->setHorizontalBorderChars('=') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') + ->setHorizontalBorderChar('=') + ->setVerticalBorderChar(' ') + ->setCrossingChar(' ') ; $compact = new TableStyle(); $compact - ->setHorizontalBorderChars('') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar('') + ->setHorizontalBorderChar('') + ->setVerticalBorderChar(' ') + ->setCrossingChar('') ->setCellRowContentFormat('%s') ; $styleGuide = new TableStyle(); $styleGuide - ->setHorizontalBorderChars('-') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') + ->setHorizontalBorderChar('-') + ->setVerticalBorderChar(' ') + ->setCrossingChar(' ') ->setCellHeaderFormat('%s') ; - $box = (new TableStyle()) - ->setHorizontalBorderChars('─') - ->setVerticalBorderChars('│') - ->setCrossingChars('┼', '┌', '┬', '┐', '┤', '┘', '┴', '└', '├') - ; - - $boxDouble = (new TableStyle()) - ->setHorizontalBorderChars('═', '─') - ->setVerticalBorderChars('║', '│') - ->setCrossingChars('┼', '╔', '╤', '╗', '╢', '╝', '╧', '╚', '╟', '╠', '╪', '╣') - ; - return [ 'default' => new TableStyle(), 'borderless' => $borderless, 'compact' => $compact, 'symfony-style-guide' => $styleGuide, - 'box' => $box, - 'box-double' => $boxDouble, ]; } - private function resolveStyle($name): TableStyle + private function resolveStyle($name) { if ($name instanceof TableStyle) { return $name; diff --git a/app/vendor/symfony/console/Helper/TableCell.php b/app/vendor/symfony/console/Helper/TableCell.php index 1a7bc6ede..78e5d6975 100644 --- a/app/vendor/symfony/console/Helper/TableCell.php +++ b/app/vendor/symfony/console/Helper/TableCell.php @@ -22,11 +22,17 @@ class TableCell private $options = [ 'rowspan' => 1, 'colspan' => 1, - 'style' => null, ]; - public function __construct(string $value = '', array $options = []) + /** + * @param string $value + */ + public function __construct($value = '', array $options = []) { + if (is_numeric($value) && !\is_string($value)) { + $value = (string) $value; + } + $this->value = $value; // check option names @@ -34,10 +40,6 @@ public function __construct(string $value = '', array $options = []) throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); } - if (isset($options['style']) && !$options['style'] instanceof TableCellStyle) { - throw new InvalidArgumentException('The style option must be an instance of "TableCellStyle".'); - } - $this->options = array_merge($this->options, $options); } @@ -70,9 +72,4 @@ public function getRowspan() { return (int) $this->options['rowspan']; } - - public function getStyle(): ?TableCellStyle - { - return $this->options['style']; - } } diff --git a/app/vendor/symfony/console/Helper/TableCellStyle.php b/app/vendor/symfony/console/Helper/TableCellStyle.php deleted file mode 100644 index ad9aea83b..000000000 --- a/app/vendor/symfony/console/Helper/TableCellStyle.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Yewhen Khoptynskyi - */ -class TableCellStyle -{ - public const DEFAULT_ALIGN = 'left'; - - private $options = [ - 'fg' => 'default', - 'bg' => 'default', - 'options' => null, - 'align' => self::DEFAULT_ALIGN, - 'cellFormat' => null, - ]; - - private $tagOptions = [ - 'fg', - 'bg', - 'options', - ]; - - private $alignMap = [ - 'left' => \STR_PAD_RIGHT, - 'center' => \STR_PAD_BOTH, - 'right' => \STR_PAD_LEFT, - ]; - - public function __construct(array $options = []) - { - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - if (isset($options['align']) && !\array_key_exists($options['align'], $this->alignMap)) { - throw new InvalidArgumentException(sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys($this->alignMap)))); - } - - $this->options = array_merge($this->options, $options); - } - - public function getOptions(): array - { - return $this->options; - } - - /** - * Gets options we need for tag for example fg, bg. - * - * @return string[] - */ - public function getTagOptions() - { - return array_filter( - $this->getOptions(), - function ($key) { - return \in_array($key, $this->tagOptions) && isset($this->options[$key]); - }, - \ARRAY_FILTER_USE_KEY - ); - } - - public function getPadByAlign() - { - return $this->alignMap[$this->getOptions()['align']]; - } - - public function getCellFormat(): ?string - { - return $this->getOptions()['cellFormat']; - } -} diff --git a/app/vendor/symfony/console/Helper/TableRows.php b/app/vendor/symfony/console/Helper/TableRows.php deleted file mode 100644 index 16aabb3fc..000000000 --- a/app/vendor/symfony/console/Helper/TableRows.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * @internal - */ -class TableRows implements \IteratorAggregate -{ - private $generator; - - public function __construct(callable $generator) - { - $this->generator = $generator; - } - - public function getIterator(): \Traversable - { - $g = $this->generator; - - return $g(); - } -} diff --git a/app/vendor/symfony/console/Helper/TableStyle.php b/app/vendor/symfony/console/Helper/TableStyle.php index 07265b467..98d8847f4 100644 --- a/app/vendor/symfony/console/Helper/TableStyle.php +++ b/app/vendor/symfony/console/Helper/TableStyle.php @@ -19,29 +19,13 @@ * * @author Fabien Potencier * @author Саша Стаменковић - * @author Dany Maillard */ class TableStyle { private $paddingChar = ' '; - private $horizontalOutsideBorderChar = '-'; - private $horizontalInsideBorderChar = '-'; - private $verticalOutsideBorderChar = '|'; - private $verticalInsideBorderChar = '|'; + private $horizontalBorderChar = '-'; + private $verticalBorderChar = '|'; private $crossingChar = '+'; - private $crossingTopRightChar = '+'; - private $crossingTopMidChar = '+'; - private $crossingTopLeftChar = '+'; - private $crossingMidRightChar = '+'; - private $crossingBottomRightChar = '+'; - private $crossingBottomMidChar = '+'; - private $crossingBottomLeftChar = '+'; - private $crossingMidLeftChar = '+'; - private $crossingTopLeftBottomChar = '+'; - private $crossingTopMidBottomChar = '+'; - private $crossingTopRightBottomChar = '+'; - private $headerTitleFormat = ' %s '; - private $footerTitleFormat = ' %s '; private $cellHeaderFormat = '%s'; private $cellRowFormat = '%s'; private $cellRowContentFormat = ' %s '; @@ -51,9 +35,11 @@ class TableStyle /** * Sets padding character, used for cell padding. * + * @param string $paddingChar + * * @return $this */ - public function setPaddingChar(string $paddingChar) + public function setPaddingChar($paddingChar) { if (!$paddingChar) { throw new LogicException('The padding char must not be empty.'); @@ -75,161 +61,85 @@ public function getPaddingChar() } /** - * Sets horizontal border characters. + * Sets horizontal border character. * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * 1 ISBN 2 Title │ Author ║ - * ╠═══════════════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - */ - public function setHorizontalBorderChars(string $outside, string $inside = null): self - { - $this->horizontalOutsideBorderChar = $outside; - $this->horizontalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Sets vertical border characters. + * @param string $horizontalBorderChar * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * ║ ISBN │ Title │ Author ║ - * ╠═══════1═══════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ╟───────2───────┼──────────────────────────┼──────────────────╢ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * + * @return $this */ - public function setVerticalBorderChars(string $outside, string $inside = null): self + public function setHorizontalBorderChar($horizontalBorderChar) { - $this->verticalOutsideBorderChar = $outside; - $this->verticalInsideBorderChar = $inside ?? $outside; + $this->horizontalBorderChar = $horizontalBorderChar; return $this; } /** - * Gets border characters. + * Gets horizontal border character. * - * @internal + * @return string */ - public function getBorderChars(): array + public function getHorizontalBorderChar() { - return [ - $this->horizontalOutsideBorderChar, - $this->verticalOutsideBorderChar, - $this->horizontalInsideBorderChar, - $this->verticalInsideBorderChar, - ]; + return $this->horizontalBorderChar; } /** - * Sets crossing characters. + * Sets vertical border character. * - * Example: - * - * 1═══════════════2══════════════════════════2══════════════════3 - * ║ ISBN │ Title │ Author ║ - * 8'══════════════0'═════════════════════════0'═════════════════4' - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * 8───────────────0──────────────────────────0──────────────────4 - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * 7═══════════════6══════════════════════════6══════════════════5 - * + * @param string $verticalBorderChar * - * @param string $cross Crossing char (see #0 of example) - * @param string $topLeft Top left char (see #1 of example) - * @param string $topMid Top mid char (see #2 of example) - * @param string $topRight Top right char (see #3 of example) - * @param string $midRight Mid right char (see #4 of example) - * @param string $bottomRight Bottom right char (see #5 of example) - * @param string $bottomMid Bottom mid char (see #6 of example) - * @param string $bottomLeft Bottom left char (see #7 of example) - * @param string $midLeft Mid left char (see #8 of example) - * @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null - * @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null - * @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null + * @return $this */ - public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): self + public function setVerticalBorderChar($verticalBorderChar) { - $this->crossingChar = $cross; - $this->crossingTopLeftChar = $topLeft; - $this->crossingTopMidChar = $topMid; - $this->crossingTopRightChar = $topRight; - $this->crossingMidRightChar = $midRight; - $this->crossingBottomRightChar = $bottomRight; - $this->crossingBottomMidChar = $bottomMid; - $this->crossingBottomLeftChar = $bottomLeft; - $this->crossingMidLeftChar = $midLeft; - $this->crossingTopLeftBottomChar = $topLeftBottom ?? $midLeft; - $this->crossingTopMidBottomChar = $topMidBottom ?? $cross; - $this->crossingTopRightBottomChar = $topRightBottom ?? $midRight; + $this->verticalBorderChar = $verticalBorderChar; return $this; } /** - * Sets default crossing character used for each cross. + * Gets vertical border character. * - * @see {@link setCrossingChars()} for setting each crossing individually. + * @return string */ - public function setDefaultCrossingChar(string $char): self + public function getVerticalBorderChar() { - return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char); + return $this->verticalBorderChar; } /** - * Gets crossing character. + * Sets crossing character. * - * @return string + * @param string $crossingChar + * + * @return $this */ - public function getCrossingChar() + public function setCrossingChar($crossingChar) { - return $this->crossingChar; + $this->crossingChar = $crossingChar; + + return $this; } /** - * Gets crossing characters. + * Gets crossing character. * - * @internal + * @return string */ - public function getCrossingChars(): array + public function getCrossingChar() { - return [ - $this->crossingChar, - $this->crossingTopLeftChar, - $this->crossingTopMidChar, - $this->crossingTopRightChar, - $this->crossingMidRightChar, - $this->crossingBottomRightChar, - $this->crossingBottomMidChar, - $this->crossingBottomLeftChar, - $this->crossingMidLeftChar, - $this->crossingTopLeftBottomChar, - $this->crossingTopMidBottomChar, - $this->crossingTopRightBottomChar, - ]; + return $this->crossingChar; } /** * Sets header cell format. * + * @param string $cellHeaderFormat + * * @return $this */ - public function setCellHeaderFormat(string $cellHeaderFormat) + public function setCellHeaderFormat($cellHeaderFormat) { $this->cellHeaderFormat = $cellHeaderFormat; @@ -249,9 +159,11 @@ public function getCellHeaderFormat() /** * Sets row cell format. * + * @param string $cellRowFormat + * * @return $this */ - public function setCellRowFormat(string $cellRowFormat) + public function setCellRowFormat($cellRowFormat) { $this->cellRowFormat = $cellRowFormat; @@ -271,9 +183,11 @@ public function getCellRowFormat() /** * Sets row cell content format. * + * @param string $cellRowContentFormat + * * @return $this */ - public function setCellRowContentFormat(string $cellRowContentFormat) + public function setCellRowContentFormat($cellRowContentFormat) { $this->cellRowContentFormat = $cellRowContentFormat; @@ -293,9 +207,11 @@ public function getCellRowContentFormat() /** * Sets table border format. * + * @param string $borderFormat + * * @return $this */ - public function setBorderFormat(string $borderFormat) + public function setBorderFormat($borderFormat) { $this->borderFormat = $borderFormat; @@ -315,9 +231,11 @@ public function getBorderFormat() /** * Sets cell padding type. * + * @param int $padType STR_PAD_* + * * @return $this */ - public function setPadType(int $padType) + public function setPadType($padType) { if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) { throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); @@ -337,28 +255,4 @@ public function getPadType() { return $this->padType; } - - public function getHeaderTitleFormat(): string - { - return $this->headerTitleFormat; - } - - public function setHeaderTitleFormat(string $format): self - { - $this->headerTitleFormat = $format; - - return $this; - } - - public function getFooterTitleFormat(): string - { - return $this->footerTitleFormat; - } - - public function setFooterTitleFormat(string $format): self - { - $this->footerTitleFormat = $format; - - return $this; - } } diff --git a/app/vendor/symfony/console/Input/ArgvInput.php b/app/vendor/symfony/console/Input/ArgvInput.php index a33ca3519..fb2b3584f 100644 --- a/app/vendor/symfony/console/Input/ArgvInput.php +++ b/app/vendor/symfony/console/Input/ArgvInput.php @@ -43,9 +43,13 @@ class ArgvInput extends Input private $tokens; private $parsed; + /** + * @param array|null $argv An array of parameters from the CLI (in the argv format) + * @param InputDefinition|null $definition A InputDefinition instance + */ public function __construct(array $argv = null, InputDefinition $definition = null) { - $argv = $argv ?? $_SERVER['argv'] ?? []; + $argv = null !== $argv ? $argv : (isset($_SERVER['argv']) ? $_SERVER['argv'] : []); // strip the application name array_shift($argv); @@ -72,7 +76,7 @@ protected function parse() $this->parseArgument($token); } elseif ($parseOptions && '--' == $token) { $parseOptions = false; - } elseif ($parseOptions && str_starts_with($token, '--')) { + } elseif ($parseOptions && 0 === strpos($token, '--')) { $this->parseLongOption($token); } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { $this->parseShortOption($token); @@ -84,8 +88,10 @@ protected function parse() /** * Parses a short option. + * + * @param string $token The current token */ - private function parseShortOption(string $token) + private function parseShortOption($token) { $name = substr($token, 1); @@ -104,9 +110,11 @@ private function parseShortOption(string $token) /** * Parses a short option set. * + * @param string $name The current token + * * @throws RuntimeException When option given doesn't exist */ - private function parseShortOptionSet(string $name) + private function parseShortOptionSet($name) { $len = \strlen($name); for ($i = 0; $i < $len; ++$i) { @@ -128,13 +136,20 @@ private function parseShortOptionSet(string $name) /** * Parses a long option. + * + * @param string $token The current token */ - private function parseLongOption(string $token) + private function parseLongOption($token) { $name = substr($token, 2); if (false !== $pos = strpos($name, '=')) { if (0 === \strlen($value = substr($name, $pos + 1))) { + // if no value after "=" then substr() returns "" since php7 only, false before + // see https://php.net/migration70.incompatible.php#119151 + if (\PHP_VERSION_ID < 70000 && false === $value) { + $value = ''; + } array_unshift($this->parsed, $value); } $this->addLongOption(substr($name, 0, $pos), $value); @@ -146,9 +161,11 @@ private function parseLongOption(string $token) /** * Parses an argument. * + * @param string $token The current token + * * @throws RuntimeException When too many arguments are given */ - private function parseArgument(string $token) + private function parseArgument($token) { $c = \count($this->arguments); @@ -165,34 +182,23 @@ private function parseArgument(string $token) // unexpected argument } else { $all = $this->definition->getArguments(); - $symfonyCommandName = null; - if (($inputArgument = $all[$key = array_key_first($all)] ?? null) && 'command' === $inputArgument->getName()) { - $symfonyCommandName = $this->arguments['command'] ?? null; - unset($all[$key]); - } - if (\count($all)) { - if ($symfonyCommandName) { - $message = sprintf('Too many arguments to "%s" command, expected arguments "%s".', $symfonyCommandName, implode('" "', array_keys($all))); - } else { - $message = sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))); - } - } elseif ($symfonyCommandName) { - $message = sprintf('No arguments expected for "%s" command, got "%s".', $symfonyCommandName, $token); - } else { - $message = sprintf('No arguments expected, got "%s".', $token); + throw new RuntimeException(sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all)))); } - throw new RuntimeException($message); + throw new RuntimeException(sprintf('No arguments expected, got "%s".', $token)); } } /** * Adds a short option value. * + * @param string $shortcut The short option key + * @param mixed $value The value for the option + * * @throws RuntimeException When option given doesn't exist */ - private function addShortOption(string $shortcut, $value) + private function addShortOption($shortcut, $value) { if (!$this->definition->hasShortcut($shortcut)) { throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); @@ -204,22 +210,15 @@ private function addShortOption(string $shortcut, $value) /** * Adds a long option value. * + * @param string $name The long option key + * @param mixed $value The value for the option + * * @throws RuntimeException When option given doesn't exist */ - private function addLongOption(string $name, $value) + private function addLongOption($name, $value) { if (!$this->definition->hasOption($name)) { - if (!$this->definition->hasNegation($name)) { - throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); - } - - $optionName = $this->definition->negationToName($name); - if (null !== $value) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); - } - $this->options[$optionName] = false; - - return; + throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); } $option = $this->definition->getOption($name); @@ -264,7 +263,7 @@ public function getFirstArgument() $isOption = false; foreach ($this->tokens as $i => $token) { if ($token && '-' === $token[0]) { - if (str_contains($token, '=') || !isset($this->tokens[$i + 1])) { + if (false !== strpos($token, '=') || !isset($this->tokens[$i + 1])) { continue; } @@ -294,7 +293,7 @@ public function getFirstArgument() /** * {@inheritdoc} */ - public function hasParameterOption($values, bool $onlyParams = false) + public function hasParameterOption($values, $onlyParams = false) { $values = (array) $values; @@ -306,8 +305,8 @@ public function hasParameterOption($values, bool $onlyParams = false) // Options with values: // For long options, test for '--option=' at beginning // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) { + $leading = 0 === strpos($value, '--') ? $value.'=' : $value; + if ($token === $value || '' !== $leading && 0 === strpos($token, $leading)) { return true; } } @@ -319,7 +318,7 @@ public function hasParameterOption($values, bool $onlyParams = false) /** * {@inheritdoc} */ - public function getParameterOption($values, $default = false, bool $onlyParams = false) + public function getParameterOption($values, $default = false, $onlyParams = false) { $values = (array) $values; $tokens = $this->tokens; @@ -337,8 +336,8 @@ public function getParameterOption($values, $default = false, bool $onlyParams = // Options with values: // For long options, test for '--option=' at beginning // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ('' !== $leading && str_starts_with($token, $leading)) { + $leading = 0 === strpos($value, '--') ? $value.'=' : $value; + if ('' !== $leading && 0 === strpos($token, $leading)) { return substr($token, \strlen($leading)); } } diff --git a/app/vendor/symfony/console/Input/ArrayInput.php b/app/vendor/symfony/console/Input/ArrayInput.php index c65161484..b2ebc7c22 100644 --- a/app/vendor/symfony/console/Input/ArrayInput.php +++ b/app/vendor/symfony/console/Input/ArrayInput.php @@ -53,7 +53,7 @@ public function getFirstArgument() /** * {@inheritdoc} */ - public function hasParameterOption($values, bool $onlyParams = false) + public function hasParameterOption($values, $onlyParams = false) { $values = (array) $values; @@ -77,7 +77,7 @@ public function hasParameterOption($values, bool $onlyParams = false) /** * {@inheritdoc} */ - public function getParameterOption($values, $default = false, bool $onlyParams = false) + public function getParameterOption($values, $default = false, $onlyParams = false) { $values = (array) $values; @@ -108,13 +108,12 @@ public function __toString() $params = []; foreach ($this->parameters as $param => $val) { if ($param && \is_string($param) && '-' === $param[0]) { - $glue = ('-' === $param[1]) ? '=' : ' '; if (\is_array($val)) { foreach ($val as $v) { - $params[] = $param.('' != $v ? $glue.$this->escapeToken($v) : ''); + $params[] = $param.('' != $v ? '='.$this->escapeToken($v) : ''); } } else { - $params[] = $param.('' != $val ? $glue.$this->escapeToken($val) : ''); + $params[] = $param.('' != $val ? '='.$this->escapeToken($val) : ''); } } else { $params[] = \is_array($val) ? implode(' ', array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val); @@ -133,9 +132,9 @@ protected function parse() if ('--' === $key) { return; } - if (str_starts_with($key, '--')) { + if (0 === strpos($key, '--')) { $this->addLongOption(substr($key, 2), $value); - } elseif (str_starts_with($key, '-')) { + } elseif (0 === strpos($key, '-')) { $this->addShortOption(substr($key, 1), $value); } else { $this->addArgument($key, $value); @@ -146,9 +145,12 @@ protected function parse() /** * Adds a short option value. * + * @param string $shortcut The short option key + * @param mixed $value The value for the option + * * @throws InvalidOptionException When option given doesn't exist */ - private function addShortOption(string $shortcut, $value) + private function addShortOption($shortcut, $value) { if (!$this->definition->hasShortcut($shortcut)) { throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); @@ -160,20 +162,16 @@ private function addShortOption(string $shortcut, $value) /** * Adds a long option value. * + * @param string $name The long option key + * @param mixed $value The value for the option + * * @throws InvalidOptionException When option given doesn't exist * @throws InvalidOptionException When a required value is missing */ - private function addLongOption(string $name, $value) + private function addLongOption($name, $value) { if (!$this->definition->hasOption($name)) { - if (!$this->definition->hasNegation($name)) { - throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name)); - } - - $optionName = $this->definition->negationToName($name); - $this->options[$optionName] = false; - - return; + throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name)); } $option = $this->definition->getOption($name); @@ -194,8 +192,8 @@ private function addLongOption(string $name, $value) /** * Adds an argument value. * - * @param string|int $name The argument name - * @param mixed $value The value for the argument + * @param string $name The argument name + * @param mixed $value The value for the argument * * @throws InvalidArgumentException When argument given doesn't exist */ diff --git a/app/vendor/symfony/console/Input/Input.php b/app/vendor/symfony/console/Input/Input.php index d37460ed3..c1220316d 100644 --- a/app/vendor/symfony/console/Input/Input.php +++ b/app/vendor/symfony/console/Input/Input.php @@ -88,9 +88,9 @@ public function isInteractive() /** * {@inheritdoc} */ - public function setInteractive(bool $interactive) + public function setInteractive($interactive) { - $this->interactive = $interactive; + $this->interactive = (bool) $interactive; } /** @@ -104,19 +104,19 @@ public function getArguments() /** * {@inheritdoc} */ - public function getArgument(string $name) + public function getArgument($name) { if (!$this->definition->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); } - return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault(); + return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)->getDefault(); } /** * {@inheritdoc} */ - public function setArgument(string $name, $value) + public function setArgument($name, $value) { if (!$this->definition->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); @@ -128,7 +128,7 @@ public function setArgument(string $name, $value) /** * {@inheritdoc} */ - public function hasArgument(string $name) + public function hasArgument($name) { return $this->definition->hasArgument($name); } @@ -144,16 +144,8 @@ public function getOptions() /** * {@inheritdoc} */ - public function getOption(string $name) + public function getOption($name) { - if ($this->definition->hasNegation($name)) { - if (null === $value = $this->getOption($this->definition->negationToName($name))) { - return $value; - } - - return !$value; - } - if (!$this->definition->hasOption($name)) { throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); } @@ -164,13 +156,9 @@ public function getOption(string $name) /** * {@inheritdoc} */ - public function setOption(string $name, $value) + public function setOption($name, $value) { - if ($this->definition->hasNegation($name)) { - $this->options[$this->definition->negationToName($name)] = !$value; - - return; - } elseif (!$this->definition->hasOption($name)) { + if (!$this->definition->hasOption($name)) { throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); } @@ -180,17 +168,19 @@ public function setOption(string $name, $value) /** * {@inheritdoc} */ - public function hasOption(string $name) + public function hasOption($name) { - return $this->definition->hasOption($name) || $this->definition->hasNegation($name); + return $this->definition->hasOption($name); } /** * Escapes a token through escapeshellarg if it contains unsafe chars. * + * @param string $token + * * @return string */ - public function escapeToken(string $token) + public function escapeToken($token) { return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); } diff --git a/app/vendor/symfony/console/Input/InputArgument.php b/app/vendor/symfony/console/Input/InputArgument.php index 085aca5a7..4c2b6a66c 100644 --- a/app/vendor/symfony/console/Input/InputArgument.php +++ b/app/vendor/symfony/console/Input/InputArgument.php @@ -21,9 +21,9 @@ */ class InputArgument { - public const REQUIRED = 1; - public const OPTIONAL = 2; - public const IS_ARRAY = 4; + const REQUIRED = 1; + const OPTIONAL = 2; + const IS_ARRAY = 4; private $name; private $mode; @@ -31,18 +31,18 @@ class InputArgument private $description; /** - * @param string $name The argument name - * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL - * @param string $description A description text - * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) + * @param string $name The argument name + * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL + * @param string $description A description text + * @param string|string[]|null $default The default value (for self::OPTIONAL mode only) * * @throws InvalidArgumentException When argument mode is not valid */ - public function __construct(string $name, int $mode = null, string $description = '', $default = null) + public function __construct($name, $mode = null, $description = '', $default = null) { if (null === $mode) { $mode = self::OPTIONAL; - } elseif ($mode > 7 || $mode < 1) { + } elseif (!\is_int($mode) || $mode > 7 || $mode < 1) { throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); } @@ -86,7 +86,7 @@ public function isArray() /** * Sets the default value. * - * @param string|bool|int|float|array|null $default + * @param string|string[]|null $default The default value * * @throws LogicException When incorrect default value is given */ @@ -110,7 +110,7 @@ public function setDefault($default = null) /** * Returns the default value. * - * @return string|bool|int|float|array|null + * @return string|string[]|null The default value */ public function getDefault() { diff --git a/app/vendor/symfony/console/Input/InputDefinition.php b/app/vendor/symfony/console/Input/InputDefinition.php index fcbfd5271..d953f9bba 100644 --- a/app/vendor/symfony/console/Input/InputDefinition.php +++ b/app/vendor/symfony/console/Input/InputDefinition.php @@ -30,10 +30,9 @@ class InputDefinition { private $arguments; private $requiredCount; - private $lastArrayArgument; - private $lastOptionalArgument; + private $hasAnArrayArgument = false; + private $hasOptional; private $options; - private $negations; private $shortcuts; /** @@ -68,12 +67,12 @@ public function setDefinition(array $definition) * * @param InputArgument[] $arguments An array of InputArgument objects */ - public function setArguments(array $arguments = []) + public function setArguments($arguments = []) { $this->arguments = []; $this->requiredCount = 0; - $this->lastOptionalArgument = null; - $this->lastArrayArgument = null; + $this->hasOptional = false; + $this->hasAnArrayArgument = false; $this->addArguments($arguments); } @@ -82,7 +81,7 @@ public function setArguments(array $arguments = []) * * @param InputArgument[] $arguments An array of InputArgument objects */ - public function addArguments(?array $arguments = []) + public function addArguments($arguments = []) { if (null !== $arguments) { foreach ($arguments as $argument) { @@ -100,22 +99,22 @@ public function addArgument(InputArgument $argument) throw new LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); } - if (null !== $this->lastArrayArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an array argument "%s".', $argument->getName(), $this->lastArrayArgument->getName())); + if ($this->hasAnArrayArgument) { + throw new LogicException('Cannot add an argument after an array argument.'); } - if ($argument->isRequired() && null !== $this->lastOptionalArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an optional one "%s".', $argument->getName(), $this->lastOptionalArgument->getName())); + if ($argument->isRequired() && $this->hasOptional) { + throw new LogicException('Cannot add a required argument after an optional one.'); } if ($argument->isArray()) { - $this->lastArrayArgument = $argument; + $this->hasAnArrayArgument = true; } if ($argument->isRequired()) { ++$this->requiredCount; } else { - $this->lastOptionalArgument = $argument; + $this->hasOptional = true; } $this->arguments[$argument->getName()] = $argument; @@ -172,7 +171,7 @@ public function getArguments() */ public function getArgumentCount() { - return null !== $this->lastArrayArgument ? \PHP_INT_MAX : \count($this->arguments); + return $this->hasAnArrayArgument ? \PHP_INT_MAX : \count($this->arguments); } /** @@ -186,7 +185,9 @@ public function getArgumentRequiredCount() } /** - * @return array + * Gets the default values. + * + * @return array An array of default values */ public function getArgumentDefaults() { @@ -203,11 +204,10 @@ public function getArgumentDefaults() * * @param InputOption[] $options An array of InputOption objects */ - public function setOptions(array $options = []) + public function setOptions($options = []) { $this->options = []; $this->shortcuts = []; - $this->negations = []; $this->addOptions($options); } @@ -216,7 +216,7 @@ public function setOptions(array $options = []) * * @param InputOption[] $options An array of InputOption objects */ - public function addOptions(array $options = []) + public function addOptions($options = []) { foreach ($options as $option) { $this->addOption($option); @@ -231,9 +231,6 @@ public function addOption(InputOption $option) if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); } - if (isset($this->negations[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); - } if ($option->getShortcut()) { foreach (explode('|', $option->getShortcut()) as $shortcut) { @@ -249,24 +246,18 @@ public function addOption(InputOption $option) $this->shortcuts[$shortcut] = $option->getName(); } } - - if ($option->isNegatable()) { - $negatedName = 'no-'.$option->getName(); - if (isset($this->options[$negatedName])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $negatedName)); - } - $this->negations[$negatedName] = $option->getName(); - } } /** * Returns an InputOption by name. * + * @param string $name The InputOption name + * * @return InputOption A InputOption object * * @throws InvalidArgumentException When option given doesn't exist */ - public function getOption(string $name) + public function getOption($name) { if (!$this->hasOption($name)) { throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); @@ -281,9 +272,11 @@ public function getOption(string $name) * This method can't be used to check if the user included the option when * executing the command (use getOption() instead). * + * @param string $name The InputOption name + * * @return bool true if the InputOption object exists, false otherwise */ - public function hasOption(string $name) + public function hasOption($name) { return isset($this->options[$name]); } @@ -301,33 +294,31 @@ public function getOptions() /** * Returns true if an InputOption object exists by shortcut. * + * @param string $name The InputOption shortcut + * * @return bool true if the InputOption object exists, false otherwise */ - public function hasShortcut(string $name) + public function hasShortcut($name) { return isset($this->shortcuts[$name]); } - /** - * Returns true if an InputOption object exists by negated name. - */ - public function hasNegation(string $name): bool - { - return isset($this->negations[$name]); - } - /** * Gets an InputOption by shortcut. * + * @param string $shortcut The Shortcut name + * * @return InputOption An InputOption object */ - public function getOptionForShortcut(string $shortcut) + public function getOptionForShortcut($shortcut) { return $this->getOption($this->shortcutToName($shortcut)); } /** - * @return array + * Gets an array of default values. + * + * @return array An array of all default values */ public function getOptionDefaults() { @@ -342,11 +333,15 @@ public function getOptionDefaults() /** * Returns the InputOption name given a shortcut. * + * @param string $shortcut The shortcut + * + * @return string The InputOption name + * * @throws InvalidArgumentException When option given does not exist * * @internal */ - public function shortcutToName(string $shortcut): string + public function shortcutToName($shortcut) { if (!isset($this->shortcuts[$shortcut])) { throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); @@ -355,28 +350,14 @@ public function shortcutToName(string $shortcut): string return $this->shortcuts[$shortcut]; } - /** - * Returns the InputOption name given a negation. - * - * @throws InvalidArgumentException When option given does not exist - * - * @internal - */ - public function negationToName(string $negation): string - { - if (!isset($this->negations[$negation])) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $negation)); - } - - return $this->negations[$negation]; - } - /** * Gets the synopsis. * + * @param bool $short Whether to return the short version (with options folded) or not + * * @return string The synopsis */ - public function getSynopsis(bool $short = false) + public function getSynopsis($short = false) { $elements = []; @@ -395,8 +376,7 @@ public function getSynopsis(bool $short = false) } $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $negation = $option->isNegatable() ? sprintf('|--no-%s', $option->getName()) : ''; - $elements[] = sprintf('[%s--%s%s%s]', $shortcut, $option->getName(), $value, $negation); + $elements[] = sprintf('[%s--%s%s]', $shortcut, $option->getName(), $value); } } @@ -404,21 +384,21 @@ public function getSynopsis(bool $short = false) $elements[] = '[--]'; } - $tail = ''; foreach ($this->getArguments() as $argument) { $element = '<'.$argument->getName().'>'; - if ($argument->isArray()) { - $element .= '...'; + if (!$argument->isRequired()) { + $element = '['.$element.']'; + } elseif ($argument->isArray()) { + $element .= ' ('.$element.')'; } - if (!$argument->isRequired()) { - $element = '['.$element; - $tail .= ']'; + if ($argument->isArray()) { + $element .= '...'; } $elements[] = $element; } - return implode(' ', $elements).$tail; + return implode(' ', $elements); } } diff --git a/app/vendor/symfony/console/Input/InputInterface.php b/app/vendor/symfony/console/Input/InputInterface.php index d01da852f..b9bcf3bbc 100644 --- a/app/vendor/symfony/console/Input/InputInterface.php +++ b/app/vendor/symfony/console/Input/InputInterface.php @@ -41,7 +41,7 @@ public function getFirstArgument(); * * @return bool true if the value is contained in the raw parameters */ - public function hasParameterOption($values, bool $onlyParams = false); + public function hasParameterOption($values, $onlyParams = false); /** * Returns the value of a raw option (not parsed). @@ -51,13 +51,13 @@ public function hasParameterOption($values, bool $onlyParams = false); * Does not necessarily return the correct result for short options * when multiple flags are combined in the same option. * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param string|bool|int|float|array|null $default The default value to return if no result is found - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal + * @param string|array $values The value(s) to look for in the raw parameters (can be an array) + * @param mixed $default The default value to return if no result is found + * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal * * @return mixed The option value */ - public function getParameterOption($values, $default = false, bool $onlyParams = false); + public function getParameterOption($values, $default = false, $onlyParams = false); /** * Binds the current Input instance with the given arguments and options. @@ -76,66 +76,76 @@ public function validate(); /** * Returns all the given arguments merged with the default values. * - * @return array + * @return array */ public function getArguments(); /** * Returns the argument value for a given argument name. * - * @return mixed + * @param string $name The argument name + * + * @return string|string[]|null The argument value * * @throws InvalidArgumentException When argument given doesn't exist */ - public function getArgument(string $name); + public function getArgument($name); /** * Sets an argument value by name. * - * @param mixed $value The argument value + * @param string $name The argument name + * @param string|string[]|null $value The argument value * * @throws InvalidArgumentException When argument given doesn't exist */ - public function setArgument(string $name, $value); + public function setArgument($name, $value); /** * Returns true if an InputArgument object exists by name or position. * + * @param string|int $name The InputArgument name or position + * * @return bool true if the InputArgument object exists, false otherwise */ - public function hasArgument(string $name); + public function hasArgument($name); /** * Returns all the given options merged with the default values. * - * @return array + * @return array */ public function getOptions(); /** * Returns the option value for a given option name. * - * @return mixed + * @param string $name The option name + * + * @return string|string[]|bool|null The option value * * @throws InvalidArgumentException When option given doesn't exist */ - public function getOption(string $name); + public function getOption($name); /** * Sets an option value by name. * - * @param mixed $value The option value + * @param string $name The option name + * @param string|string[]|bool|null $value The option value * * @throws InvalidArgumentException When option given doesn't exist */ - public function setOption(string $name, $value); + public function setOption($name, $value); /** * Returns true if an InputOption object exists by name. * + * @param string $name The InputOption name + * * @return bool true if the InputOption object exists, false otherwise */ - public function hasOption(string $name); + public function hasOption($name); /** * Is this input means interactive? @@ -146,6 +156,8 @@ public function isInteractive(); /** * Sets the input interactivity. + * + * @param bool $interactive If the input should be interactive */ - public function setInteractive(bool $interactive); + public function setInteractive($interactive); } diff --git a/app/vendor/symfony/console/Input/InputOption.php b/app/vendor/symfony/console/Input/InputOption.php index 72b1b74de..b0bd28f51 100644 --- a/app/vendor/symfony/console/Input/InputOption.php +++ b/app/vendor/symfony/console/Input/InputOption.php @@ -21,30 +21,10 @@ */ class InputOption { - /** - * Do not accept input for the option (e.g. --yell). This is the default behavior of options. - */ - public const VALUE_NONE = 1; - - /** - * A value must be passed when the option is used (e.g. --iterations=5 or -i5). - */ - public const VALUE_REQUIRED = 2; - - /** - * The option may or may not have a value (e.g. --yell or --yell=loud). - */ - public const VALUE_OPTIONAL = 4; - - /** - * The option accepts multiple values (e.g. --dir=/foo --dir=/bar). - */ - public const VALUE_IS_ARRAY = 8; - - /** - * The option may have either positive or negative value (e.g. --ansi or --no-ansi). - */ - public const VALUE_NEGATABLE = 16; + const VALUE_NONE = 1; + const VALUE_REQUIRED = 2; + const VALUE_OPTIONAL = 4; + const VALUE_IS_ARRAY = 8; private $name; private $shortcut; @@ -53,17 +33,17 @@ class InputOption private $description; /** - * @param string $name The option name - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the VALUE_* constants - * @param string $description A description text - * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) + * @param string $name The option name + * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param int|null $mode The option mode: One of the VALUE_* constants + * @param string $description A description text + * @param string|string[]|int|bool|null $default The default value (must be null for self::VALUE_NONE) * * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) + public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null) { - if (str_starts_with($name, '--')) { + if (0 === strpos($name, '--')) { $name = substr($name, 2); } @@ -90,7 +70,7 @@ public function __construct(string $name, $shortcut = null, int $mode = null, st if (null === $mode) { $mode = self::VALUE_NONE; - } elseif ($mode >= (self::VALUE_NEGATABLE << 1) || $mode < 1) { + } elseif (!\is_int($mode) || $mode > 15 || $mode < 1) { throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); } @@ -102,9 +82,6 @@ public function __construct(string $name, $shortcut = null, int $mode = null, st if ($this->isArray() && !$this->acceptValue()) { throw new InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); } - if ($this->isNegatable() && $this->acceptValue()) { - throw new InvalidArgumentException('Impossible to have an option mode VALUE_NEGATABLE if the option also accepts a value.'); - } $this->setDefault($default); } @@ -169,13 +146,12 @@ public function isArray() return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); } - public function isNegatable(): bool - { - return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); - } - /** - * @param string|bool|int|float|array|null $default + * Sets the default value. + * + * @param string|string[]|int|bool|null $default The default value + * + * @throws LogicException When incorrect default value is given */ public function setDefault($default = null) { @@ -191,13 +167,13 @@ public function setDefault($default = null) } } - $this->default = $this->acceptValue() || $this->isNegatable() ? $default : false; + $this->default = $this->acceptValue() ? $default : false; } /** * Returns the default value. * - * @return string|bool|int|float|array|null + * @return string|string[]|int|bool|null The default value */ public function getDefault() { @@ -224,7 +200,6 @@ public function equals(self $option) return $option->getName() === $this->getName() && $option->getShortcut() === $this->getShortcut() && $option->getDefault() === $this->getDefault() - && $option->isNegatable() === $this->isNegatable() && $option->isArray() === $this->isArray() && $option->isValueRequired() === $this->isValueRequired() && $option->isValueOptional() === $this->isValueOptional() diff --git a/app/vendor/symfony/console/Input/StringInput.php b/app/vendor/symfony/console/Input/StringInput.php index eb5c07fdd..5032b340a 100644 --- a/app/vendor/symfony/console/Input/StringInput.php +++ b/app/vendor/symfony/console/Input/StringInput.php @@ -24,13 +24,13 @@ */ class StringInput extends ArgvInput { - public const REGEX_STRING = '([^\s]+?)(?:\s|(?buffer .= $message; diff --git a/app/vendor/symfony/console/Output/ConsoleOutput.php b/app/vendor/symfony/console/Output/ConsoleOutput.php index 2cda213a0..21a108fca 100644 --- a/app/vendor/symfony/console/Output/ConsoleOutput.php +++ b/app/vendor/symfony/console/Output/ConsoleOutput.php @@ -30,24 +30,16 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface { private $stderr; - private $consoleSectionOutputs = []; /** * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) */ - public function __construct(int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) + public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) { parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter); - if (null === $formatter) { - // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter. - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated); - - return; - } - $actualDecorated = $this->isDecorated(); $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter()); @@ -56,18 +48,10 @@ public function __construct(int $verbosity = self::VERBOSITY_NORMAL, bool $decor } } - /** - * Creates a new output section. - */ - public function section(): ConsoleSectionOutput - { - return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); - } - /** * {@inheritdoc} */ - public function setDecorated(bool $decorated) + public function setDecorated($decorated) { parent::setDecorated($decorated); $this->stderr->setDecorated($decorated); @@ -85,7 +69,7 @@ public function setFormatter(OutputFormatterInterface $formatter) /** * {@inheritdoc} */ - public function setVerbosity(int $level) + public function setVerbosity($level) { parent::setVerbosity($level); $this->stderr->setVerbosity($level); @@ -132,8 +116,10 @@ protected function hasStderrSupport() /** * Checks if current executing environment is IBM iSeries (OS400), which * doesn't properly convert character-encodings between ASCII to EBCDIC. + * + * @return bool */ - private function isRunningOS400(): bool + private function isRunningOS400() { $checks = [ \function_exists('php_uname') ? php_uname('s') : '', diff --git a/app/vendor/symfony/console/Output/ConsoleOutputInterface.php b/app/vendor/symfony/console/Output/ConsoleOutputInterface.php index 6b6635f58..b44ea7e05 100644 --- a/app/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ b/app/vendor/symfony/console/Output/ConsoleOutputInterface.php @@ -13,7 +13,7 @@ /** * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. - * This adds information about stderr and section output stream. + * This adds information about stderr output stream. * * @author Dariusz Górecki */ @@ -27,6 +27,4 @@ interface ConsoleOutputInterface extends OutputInterface public function getErrorOutput(); public function setErrorOutput(OutputInterface $error); - - public function section(): ConsoleSectionOutput; } diff --git a/app/vendor/symfony/console/Output/ConsoleSectionOutput.php b/app/vendor/symfony/console/Output/ConsoleSectionOutput.php deleted file mode 100644 index 8f1649758..000000000 --- a/app/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Terminal; - -/** - * @author Pierre du Plessis - * @author Gabriel Ostrolucký - */ -class ConsoleSectionOutput extends StreamOutput -{ - private $content = []; - private $lines = 0; - private $sections; - private $terminal; - - /** - * @param resource $stream - * @param ConsoleSectionOutput[] $sections - */ - public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter) - { - parent::__construct($stream, $verbosity, $decorated, $formatter); - array_unshift($sections, $this); - $this->sections = &$sections; - $this->terminal = new Terminal(); - } - - /** - * Clears previous output for this section. - * - * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared - */ - public function clear(int $lines = null) - { - if (empty($this->content) || !$this->isDecorated()) { - return; - } - - if ($lines) { - array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content - } else { - $lines = $this->lines; - $this->content = []; - } - - $this->lines -= $lines; - - parent::doWrite($this->popStreamContentUntilCurrentSection($lines), false); - } - - /** - * Overwrites the previous output with a new message. - * - * @param array|string $message - */ - public function overwrite($message) - { - $this->clear(); - $this->writeln($message); - } - - public function getContent(): string - { - return implode('', $this->content); - } - - /** - * @internal - */ - public function addContent(string $input) - { - foreach (explode(\PHP_EOL, $input) as $lineContent) { - $this->lines += ceil($this->getDisplayLength($lineContent) / $this->terminal->getWidth()) ?: 1; - $this->content[] = $lineContent; - $this->content[] = \PHP_EOL; - } - } - - /** - * {@inheritdoc} - */ - protected function doWrite(string $message, bool $newline) - { - if (!$this->isDecorated()) { - parent::doWrite($message, $newline); - - return; - } - - $erasedContent = $this->popStreamContentUntilCurrentSection(); - - $this->addContent($message); - - parent::doWrite($message, true); - parent::doWrite($erasedContent, false); - } - - /** - * At initial stage, cursor is at the end of stream output. This method makes cursor crawl upwards until it hits - * current section. Then it erases content it crawled through. Optionally, it erases part of current section too. - */ - private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0): string - { - $numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection; - $erasedContent = []; - - foreach ($this->sections as $section) { - if ($section === $this) { - break; - } - - $numberOfLinesToClear += $section->lines; - $erasedContent[] = $section->getContent(); - } - - if ($numberOfLinesToClear > 0) { - // move cursor up n lines - parent::doWrite(sprintf("\x1b[%dA", $numberOfLinesToClear), false); - // erase to end of screen - parent::doWrite("\x1b[0J", false); - } - - return implode('', array_reverse($erasedContent)); - } - - private function getDisplayLength(string $text): int - { - return Helper::width(Helper::removeDecoration($this->getFormatter(), str_replace("\t", ' ', $text))); - } -} diff --git a/app/vendor/symfony/console/Output/NullOutput.php b/app/vendor/symfony/console/Output/NullOutput.php index 3bbe63ea0..218f285bf 100644 --- a/app/vendor/symfony/console/Output/NullOutput.php +++ b/app/vendor/symfony/console/Output/NullOutput.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Console\Output; -use Symfony\Component\Console\Formatter\NullOutputFormatter; +use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Formatter\OutputFormatterInterface; /** @@ -24,8 +24,6 @@ */ class NullOutput implements OutputInterface { - private $formatter; - /** * {@inheritdoc} */ @@ -39,17 +37,14 @@ public function setFormatter(OutputFormatterInterface $formatter) */ public function getFormatter() { - if ($this->formatter) { - return $this->formatter; - } // to comply with the interface we must return a OutputFormatterInterface - return $this->formatter = new NullOutputFormatter(); + return new OutputFormatter(); } /** * {@inheritdoc} */ - public function setDecorated(bool $decorated) + public function setDecorated($decorated) { // do nothing } @@ -65,7 +60,7 @@ public function isDecorated() /** * {@inheritdoc} */ - public function setVerbosity(int $level) + public function setVerbosity($level) { // do nothing } @@ -113,7 +108,7 @@ public function isDebug() /** * {@inheritdoc} */ - public function writeln($messages, int $options = self::OUTPUT_NORMAL) + public function writeln($messages, $options = self::OUTPUT_NORMAL) { // do nothing } @@ -121,7 +116,7 @@ public function writeln($messages, int $options = self::OUTPUT_NORMAL) /** * {@inheritdoc} */ - public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL) { // do nothing } diff --git a/app/vendor/symfony/console/Output/Output.php b/app/vendor/symfony/console/Output/Output.php index f939f06c6..c3856cc57 100644 --- a/app/vendor/symfony/console/Output/Output.php +++ b/app/vendor/symfony/console/Output/Output.php @@ -37,10 +37,10 @@ abstract class Output implements OutputInterface * @param bool $decorated Whether to decorate messages * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) */ - public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) + public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = false, OutputFormatterInterface $formatter = null) { $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity; - $this->formatter = $formatter ?? new OutputFormatter(); + $this->formatter = $formatter ?: new OutputFormatter(); $this->formatter->setDecorated($decorated); } @@ -63,7 +63,7 @@ public function getFormatter() /** * {@inheritdoc} */ - public function setDecorated(bool $decorated) + public function setDecorated($decorated) { $this->formatter->setDecorated($decorated); } @@ -79,9 +79,9 @@ public function isDecorated() /** * {@inheritdoc} */ - public function setVerbosity(int $level) + public function setVerbosity($level) { - $this->verbosity = $level; + $this->verbosity = (int) $level; } /** @@ -127,7 +127,7 @@ public function isDebug() /** * {@inheritdoc} */ - public function writeln($messages, int $options = self::OUTPUT_NORMAL) + public function writeln($messages, $options = self::OUTPUT_NORMAL) { $this->write($messages, true, $options); } @@ -135,11 +135,9 @@ public function writeln($messages, int $options = self::OUTPUT_NORMAL) /** * {@inheritdoc} */ - public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL) { - if (!is_iterable($messages)) { - $messages = [$messages]; - } + $messages = (array) $messages; $types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN; $type = $types & $options ?: self::OUTPUT_NORMAL; @@ -163,12 +161,15 @@ public function write($messages, bool $newline = false, int $options = self::OUT break; } - $this->doWrite($message ?? '', $newline); + $this->doWrite($message, $newline); } } /** * Writes a message to the output. + * + * @param string $message A message to write to the output + * @param bool $newline Whether to add a newline or not */ - abstract protected function doWrite(string $message, bool $newline); + abstract protected function doWrite($message, $newline); } diff --git a/app/vendor/symfony/console/Output/OutputInterface.php b/app/vendor/symfony/console/Output/OutputInterface.php index 99ba755fc..ad785a4ce 100644 --- a/app/vendor/symfony/console/Output/OutputInterface.php +++ b/app/vendor/symfony/console/Output/OutputInterface.php @@ -20,37 +20,39 @@ */ interface OutputInterface { - public const VERBOSITY_QUIET = 16; - public const VERBOSITY_NORMAL = 32; - public const VERBOSITY_VERBOSE = 64; - public const VERBOSITY_VERY_VERBOSE = 128; - public const VERBOSITY_DEBUG = 256; + const VERBOSITY_QUIET = 16; + const VERBOSITY_NORMAL = 32; + const VERBOSITY_VERBOSE = 64; + const VERBOSITY_VERY_VERBOSE = 128; + const VERBOSITY_DEBUG = 256; - public const OUTPUT_NORMAL = 1; - public const OUTPUT_RAW = 2; - public const OUTPUT_PLAIN = 4; + const OUTPUT_NORMAL = 1; + const OUTPUT_RAW = 2; + const OUTPUT_PLAIN = 4; /** * Writes a message to the output. * - * @param string|iterable $messages The message as an iterable of strings or a single string - * @param bool $newline Whether to add a newline - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + * @param string|array $messages The message as an array of strings or a single string + * @param bool $newline Whether to add a newline + * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ - public function write($messages, bool $newline = false, int $options = 0); + public function write($messages, $newline = false, $options = 0); /** * Writes a message to the output and adds a newline at the end. * - * @param string|iterable $messages The message as an iterable of strings or a single string - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + * @param string|array $messages The message as an array of strings or a single string + * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ - public function writeln($messages, int $options = 0); + public function writeln($messages, $options = 0); /** * Sets the verbosity of the output. + * + * @param int $level The level of verbosity (one of the VERBOSITY constants) */ - public function setVerbosity(int $level); + public function setVerbosity($level); /** * Gets the current verbosity of the output. @@ -89,8 +91,10 @@ public function isDebug(); /** * Sets the decorated flag. + * + * @param bool $decorated Whether to decorate the messages */ - public function setDecorated(bool $decorated); + public function setDecorated($decorated); /** * Gets the decorated flag. diff --git a/app/vendor/symfony/console/Output/StreamOutput.php b/app/vendor/symfony/console/Output/StreamOutput.php index ea434527b..451051df8 100644 --- a/app/vendor/symfony/console/Output/StreamOutput.php +++ b/app/vendor/symfony/console/Output/StreamOutput.php @@ -39,7 +39,7 @@ class StreamOutput extends Output * * @throws InvalidArgumentException When first argument is not a real stream */ - public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) + public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) { if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); @@ -67,7 +67,7 @@ public function getStream() /** * {@inheritdoc} */ - protected function doWrite(string $message, bool $newline) + protected function doWrite($message, $newline) { if ($newline) { $message .= \PHP_EOL; @@ -93,11 +93,6 @@ protected function doWrite(string $message, bool $newline) */ protected function hasColorSupport() { - // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { - return false; - } - if ('Hyper' === getenv('TERM_PROGRAM')) { return true; } @@ -110,6 +105,16 @@ protected function hasColorSupport() || 'xterm' === getenv('TERM'); } - return stream_isatty($this->stream); + if (\function_exists('stream_isatty')) { + return @stream_isatty($this->stream); + } + + if (\function_exists('posix_isatty')) { + return @posix_isatty($this->stream); + } + + $stat = @fstat($this->stream); + // Check if formatted mode is S_IFCHR + return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; } } diff --git a/app/vendor/symfony/console/Output/TrimmedBufferOutput.php b/app/vendor/symfony/console/Output/TrimmedBufferOutput.php deleted file mode 100644 index 5455c5b47..000000000 --- a/app/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * A BufferedOutput that keeps only the last N chars. - * - * @author Jérémy Derussé - */ -class TrimmedBufferOutput extends Output -{ - private $maxLength; - private $buffer = ''; - - public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) { - if ($maxLength <= 0) { - throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); - } - - parent::__construct($verbosity, $decorated, $formatter); - $this->maxLength = $maxLength; - } - - /** - * Empties buffer and returns its content. - * - * @return string - */ - public function fetch() - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - /** - * {@inheritdoc} - */ - protected function doWrite(string $message, bool $newline) - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - - $this->buffer = substr($this->buffer, 0 - $this->maxLength); - } -} diff --git a/app/vendor/symfony/console/Question/ChoiceQuestion.php b/app/vendor/symfony/console/Question/ChoiceQuestion.php index 92b6e8663..62532844b 100644 --- a/app/vendor/symfony/console/Question/ChoiceQuestion.php +++ b/app/vendor/symfony/console/Question/ChoiceQuestion.php @@ -30,7 +30,7 @@ class ChoiceQuestion extends Question * @param array $choices The list of available choices * @param mixed $default The default answer to return */ - public function __construct(string $question, array $choices, $default = null) + public function __construct($question, array $choices, $default = null) { if (!$choices) { throw new \LogicException('Choice question must have at least 1 choice available.'); @@ -58,9 +58,11 @@ public function getChoices() * * When multiselect is set to true, multiple choices can be answered. * + * @param bool $multiselect + * * @return $this */ - public function setMultiselect(bool $multiselect) + public function setMultiselect($multiselect) { $this->multiselect = $multiselect; $this->setValidator($this->getDefaultValidator()); @@ -91,9 +93,11 @@ public function getPrompt() /** * Sets the prompt for choices. * + * @param string $prompt + * * @return $this */ - public function setPrompt(string $prompt) + public function setPrompt($prompt) { $this->prompt = $prompt; @@ -105,9 +109,11 @@ public function setPrompt(string $prompt) * * The error message has a string placeholder (%s) for the invalid value. * + * @param string $errorMessage + * * @return $this */ - public function setErrorMessage(string $errorMessage) + public function setErrorMessage($errorMessage) { $this->errorMessage = $errorMessage; $this->setValidator($this->getDefaultValidator()); @@ -115,7 +121,12 @@ public function setErrorMessage(string $errorMessage) return $this; } - private function getDefaultValidator(): callable + /** + * Returns the default answer validator. + * + * @return callable + */ + private function getDefaultValidator() { $choices = $this->choices; $errorMessage = $this->errorMessage; @@ -129,15 +140,9 @@ private function getDefaultValidator(): callable throw new InvalidArgumentException(sprintf($errorMessage, $selected)); } - $selectedChoices = explode(',', $selected); + $selectedChoices = array_map('trim', explode(',', $selected)); } else { - $selectedChoices = [$selected]; - } - - if ($this->isTrimmable()) { - foreach ($selectedChoices as $k => $v) { - $selectedChoices[$k] = trim($v); - } + $selectedChoices = [trim($selected)]; } $multiselectChoices = []; @@ -169,8 +174,7 @@ private function getDefaultValidator(): callable throw new InvalidArgumentException(sprintf($errorMessage, $value)); } - // For associative choices, consistently return the key as string: - $multiselectChoices[] = $isAssoc ? (string) $result : $result; + $multiselectChoices[] = (string) $result; } if ($multiselect) { diff --git a/app/vendor/symfony/console/Question/ConfirmationQuestion.php b/app/vendor/symfony/console/Question/ConfirmationQuestion.php index 4228521b9..d871fb8a7 100644 --- a/app/vendor/symfony/console/Question/ConfirmationQuestion.php +++ b/app/vendor/symfony/console/Question/ConfirmationQuestion.php @@ -25,9 +25,9 @@ class ConfirmationQuestion extends Question * @param bool $default The default answer to return, true or false * @param string $trueAnswerRegex A regex to match the "yes" answer */ - public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i') + public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i') { - parent::__construct($question, $default); + parent::__construct($question, (bool) $default); $this->trueAnswerRegex = $trueAnswerRegex; $this->setNormalizer($this->getDefaultNormalizer()); @@ -35,8 +35,10 @@ public function __construct(string $question, bool $default = true, string $true /** * Returns the default answer normalizer. + * + * @return callable */ - private function getDefaultNormalizer(): callable + private function getDefaultNormalizer() { $default = $this->getDefault(); $regex = $this->trueAnswerRegex; diff --git a/app/vendor/symfony/console/Question/Question.php b/app/vendor/symfony/console/Question/Question.php index 04d2d411d..7d016ecea 100644 --- a/app/vendor/symfony/console/Question/Question.php +++ b/app/vendor/symfony/console/Question/Question.php @@ -25,18 +25,16 @@ class Question private $attempts; private $hidden = false; private $hiddenFallback = true; - private $autocompleterCallback; + private $autocompleterValues; private $validator; private $default; private $normalizer; - private $trimmable = true; - private $multiline = false; /** - * @param string $question The question to ask to the user - * @param string|bool|int|float|null $default The default answer to return if the user enters nothing + * @param string $question The question to ask to the user + * @param mixed $default The default answer to return if the user enters nothing */ - public function __construct(string $question, $default = null) + public function __construct($question, $default = null) { $this->question = $question; $this->default = $default; @@ -55,33 +53,13 @@ public function getQuestion() /** * Returns the default answer. * - * @return string|bool|int|float|null + * @return mixed */ public function getDefault() { return $this->default; } - /** - * Returns whether the user response accepts newline characters. - */ - public function isMultiline(): bool - { - return $this->multiline; - } - - /** - * Sets whether the user response should accept newline characters. - * - * @return $this - */ - public function setMultiline(bool $multiline): self - { - $this->multiline = $multiline; - - return $this; - } - /** * Returns whether the user response must be hidden. * @@ -95,13 +73,15 @@ public function isHidden() /** * Sets whether the user response must be hidden or not. * + * @param bool $hidden + * * @return $this * * @throws LogicException In case the autocompleter is also used */ - public function setHidden(bool $hidden) + public function setHidden($hidden) { - if ($this->autocompleterCallback) { + if ($this->autocompleterValues) { throw new LogicException('A hidden question cannot use the autocompleter.'); } @@ -123,9 +103,11 @@ public function isHiddenFallback() /** * Sets whether to fallback on non-hidden question if the response can not be hidden. * + * @param bool $fallback + * * @return $this */ - public function setHiddenFallback(bool $fallback) + public function setHiddenFallback($fallback) { $this->hiddenFallback = (bool) $fallback; @@ -139,60 +121,34 @@ public function setHiddenFallback(bool $fallback) */ public function getAutocompleterValues() { - $callback = $this->getAutocompleterCallback(); - - return $callback ? $callback('') : null; + return $this->autocompleterValues; } /** * Sets values for the autocompleter. * + * @param iterable|null $values + * * @return $this * + * @throws InvalidArgumentException * @throws LogicException */ - public function setAutocompleterValues(?iterable $values) + public function setAutocompleterValues($values) { if (\is_array($values)) { $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); - - $callback = static function () use ($values) { - return $values; - }; - } elseif ($values instanceof \Traversable) { - $valueCache = null; - $callback = static function () use ($values, &$valueCache) { - return $valueCache ?? $valueCache = iterator_to_array($values, false); - }; - } else { - $callback = null; } - return $this->setAutocompleterCallback($callback); - } - - /** - * Gets the callback function used for the autocompleter. - */ - public function getAutocompleterCallback(): ?callable - { - return $this->autocompleterCallback; - } + if (null !== $values && !\is_array($values) && !$values instanceof \Traversable) { + throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or a `Traversable` object.'); + } - /** - * Sets the callback function used for the autocompleter. - * - * The callback is passed the user input as argument and should return an iterable of corresponding suggestions. - * - * @return $this - */ - public function setAutocompleterCallback(callable $callback = null): self - { - if ($this->hidden && null !== $callback) { + if ($this->hidden) { throw new LogicException('A hidden question cannot use the autocompleter.'); } - $this->autocompleterCallback = $callback; + $this->autocompleterValues = $values; return $this; } @@ -224,11 +180,13 @@ public function getValidator() * * Null means an unlimited number of attempts. * + * @param int|null $attempts + * * @return $this * * @throws InvalidArgumentException in case the number of attempts is invalid */ - public function setMaxAttempts(?int $attempts) + public function setMaxAttempts($attempts) { if (null !== $attempts) { $attempts = (int) $attempts; @@ -280,23 +238,8 @@ public function getNormalizer() return $this->normalizer; } - protected function isAssoc(array $array) + protected function isAssoc($array) { return (bool) \count(array_filter(array_keys($array), 'is_string')); } - - public function isTrimmable(): bool - { - return $this->trimmable; - } - - /** - * @return $this - */ - public function setTrimmable(bool $trimmable): self - { - $this->trimmable = $trimmable; - - return $this; - } } diff --git a/app/vendor/symfony/console/README.md b/app/vendor/symfony/console/README.md index c89b4a1a2..3e2fc605e 100644 --- a/app/vendor/symfony/console/README.md +++ b/app/vendor/symfony/console/README.md @@ -7,11 +7,11 @@ interfaces. Resources --------- - * [Documentation](https://symfony.com/doc/current/components/console.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Documentation](https://symfony.com/doc/current/components/console.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) Credits ------- diff --git a/app/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/app/vendor/symfony/console/SignalRegistry/SignalRegistry.php deleted file mode 100644 index ed93dd062..000000000 --- a/app/vendor/symfony/console/SignalRegistry/SignalRegistry.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\SignalRegistry; - -final class SignalRegistry -{ - private $signalHandlers = []; - - public function __construct() - { - if (\function_exists('pcntl_async_signals')) { - pcntl_async_signals(true); - } - } - - public function register(int $signal, callable $signalHandler): void - { - if (!isset($this->signalHandlers[$signal])) { - $previousCallback = pcntl_signal_get_handler($signal); - - if (\is_callable($previousCallback)) { - $this->signalHandlers[$signal][] = $previousCallback; - } - } - - $this->signalHandlers[$signal][] = $signalHandler; - - pcntl_signal($signal, [$this, 'handle']); - } - - public static function isSupported(): bool - { - if (!\function_exists('pcntl_signal')) { - return false; - } - - if (\in_array('pcntl_signal', explode(',', ini_get('disable_functions')))) { - return false; - } - - return true; - } - - /** - * @internal - */ - public function handle(int $signal): void - { - $count = \count($this->signalHandlers[$signal]); - - foreach ($this->signalHandlers[$signal] as $i => $signalHandler) { - $hasNext = $i !== $count - 1; - $signalHandler($signal, $hasNext); - } - } -} diff --git a/app/vendor/symfony/console/SingleCommandApplication.php b/app/vendor/symfony/console/SingleCommandApplication.php deleted file mode 100644 index c1831d1d2..000000000 --- a/app/vendor/symfony/console/SingleCommandApplication.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Grégoire Pineau - */ -class SingleCommandApplication extends Command -{ - private $version = 'UNKNOWN'; - private $autoExit = true; - private $running = false; - - public function setVersion(string $version): self - { - $this->version = $version; - - return $this; - } - - /** - * @final - */ - public function setAutoExit(bool $autoExit): self - { - $this->autoExit = $autoExit; - - return $this; - } - - public function run(InputInterface $input = null, OutputInterface $output = null): int - { - if ($this->running) { - return parent::run($input, $output); - } - - // We use the command name as the application name - $application = new Application($this->getName() ?: 'UNKNOWN', $this->version); - $application->setAutoExit($this->autoExit); - // Fix the usage of the command displayed with "--help" - $this->setName($_SERVER['argv'][0]); - $application->add($this); - $application->setDefaultCommand($this->getName(), true); - - $this->running = true; - try { - $ret = $application->run($input, $output); - } finally { - $this->running = false; - } - - return $ret ?? 1; - } -} diff --git a/app/vendor/symfony/console/Style/OutputStyle.php b/app/vendor/symfony/console/Style/OutputStyle.php index 67a98ff07..14d2d60b2 100644 --- a/app/vendor/symfony/console/Style/OutputStyle.php +++ b/app/vendor/symfony/console/Style/OutputStyle.php @@ -33,15 +33,17 @@ public function __construct(OutputInterface $output) /** * {@inheritdoc} */ - public function newLine(int $count = 1) + public function newLine($count = 1) { $this->output->write(str_repeat(\PHP_EOL, $count)); } /** + * @param int $max + * * @return ProgressBar */ - public function createProgressBar(int $max = 0) + public function createProgressBar($max = 0) { return new ProgressBar($this->output, $max); } @@ -49,7 +51,7 @@ public function createProgressBar(int $max = 0) /** * {@inheritdoc} */ - public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) + public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) { $this->output->write($messages, $newline, $type); } @@ -57,7 +59,7 @@ public function write($messages, bool $newline = false, int $type = self::OUTPUT /** * {@inheritdoc} */ - public function writeln($messages, int $type = self::OUTPUT_NORMAL) + public function writeln($messages, $type = self::OUTPUT_NORMAL) { $this->output->writeln($messages, $type); } @@ -65,7 +67,7 @@ public function writeln($messages, int $type = self::OUTPUT_NORMAL) /** * {@inheritdoc} */ - public function setVerbosity(int $level) + public function setVerbosity($level) { $this->output->setVerbosity($level); } @@ -81,7 +83,7 @@ public function getVerbosity() /** * {@inheritdoc} */ - public function setDecorated(bool $decorated) + public function setDecorated($decorated) { $this->output->setDecorated($decorated); } diff --git a/app/vendor/symfony/console/Style/StyleInterface.php b/app/vendor/symfony/console/Style/StyleInterface.php index 38d23b77e..3b5b8af51 100644 --- a/app/vendor/symfony/console/Style/StyleInterface.php +++ b/app/vendor/symfony/console/Style/StyleInterface.php @@ -20,13 +20,17 @@ interface StyleInterface { /** * Formats a command title. + * + * @param string $message */ - public function title(string $message); + public function title($message); /** * Formats a section title. + * + * @param string $message */ - public function section(string $message); + public function section($message); /** * Formats a list. @@ -83,47 +87,64 @@ public function table(array $headers, array $rows); /** * Asks a question. * + * @param string $question + * @param string|null $default + * @param callable|null $validator + * * @return mixed */ - public function ask(string $question, string $default = null, callable $validator = null); + public function ask($question, $default = null, $validator = null); /** * Asks a question with the user input hidden. * + * @param string $question + * @param callable|null $validator + * * @return mixed */ - public function askHidden(string $question, callable $validator = null); + public function askHidden($question, $validator = null); /** * Asks for confirmation. * + * @param string $question + * @param bool $default + * * @return bool */ - public function confirm(string $question, bool $default = true); + public function confirm($question, $default = true); /** * Asks a choice question. * + * @param string $question * @param string|int|null $default * * @return mixed */ - public function choice(string $question, array $choices, $default = null); + public function choice($question, array $choices, $default = null); /** * Add newline(s). + * + * @param int $count The number of newlines */ - public function newLine(int $count = 1); + public function newLine($count = 1); /** * Starts the progress output. + * + * @param int $max Maximum steps (0 if unknown) */ - public function progressStart(int $max = 0); + public function progressStart($max = 0); /** * Advances the progress output X steps. + * + * @param int $step Number of steps to advance */ - public function progressAdvance(int $step = 1); + public function progressAdvance($step = 1); /** * Finishes the progress output. diff --git a/app/vendor/symfony/console/Style/SymfonyStyle.php b/app/vendor/symfony/console/Style/SymfonyStyle.php index 3e67213e9..4d83779c5 100644 --- a/app/vendor/symfony/console/Style/SymfonyStyle.php +++ b/app/vendor/symfony/console/Style/SymfonyStyle.php @@ -11,18 +11,15 @@ namespace Symfony\Component\Console\Style; -use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Helper\SymfonyQuestionHelper; use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Helper\TableCell; -use Symfony\Component\Console\Helper\TableSeparator; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\TrimmedBufferOutput; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Question\Question; @@ -35,7 +32,7 @@ */ class SymfonyStyle extends OutputStyle { - public const MAX_LINE_LENGTH = 120; + const MAX_LINE_LENGTH = 120; private $input; private $questionHelper; @@ -46,7 +43,7 @@ class SymfonyStyle extends OutputStyle public function __construct(InputInterface $input, OutputInterface $output) { $this->input = $input; - $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter()); + $this->bufferedOutput = new BufferedOutput($output->getVerbosity(), false, clone $output->getFormatter()); // Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not. $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH; $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); @@ -58,8 +55,13 @@ public function __construct(InputInterface $input, OutputInterface $output) * Formats a message as a block of text. * * @param string|array $messages The message to write in the block + * @param string|null $type The block type (added in [] on first line) + * @param string|null $style The style to apply to the whole block + * @param string $prefix The prefix for the block + * @param bool $padding Whether to add vertical padding + * @param bool $escape Whether to escape the message */ - public function block($messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) + public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = true) { $messages = \is_array($messages) ? array_values($messages) : [$messages]; @@ -71,12 +73,12 @@ public function block($messages, string $type = null, string $style = null, stri /** * {@inheritdoc} */ - public function title(string $message) + public function title($message) { $this->autoPrependBlock(); $this->writeln([ sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('=', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), + sprintf('%s', str_repeat('=', Helper::strlenWithoutDecoration($this->getFormatter(), $message))), ]); $this->newLine(); } @@ -84,12 +86,12 @@ public function title(string $message) /** * {@inheritdoc} */ - public function section(string $message) + public function section($message) { $this->autoPrependBlock(); $this->writeln([ sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('-', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), + sprintf('%s', str_repeat('-', Helper::strlenWithoutDecoration($this->getFormatter(), $message))), ]); $this->newLine(); } @@ -152,7 +154,7 @@ public function error($message) */ public function warning($message) { - $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); + $this->block($message, 'WARNING', 'fg=white;bg=red', ' ', true); } /** @@ -163,16 +165,6 @@ public function note($message) $this->block($message, 'NOTE', 'fg=yellow', ' ! '); } - /** - * Formats an info message. - * - * @param string|array $message - */ - public function info($message) - { - $this->block($message, 'INFO', 'fg=green', ' ', true); - } - /** * {@inheritdoc} */ @@ -198,73 +190,10 @@ public function table(array $headers, array $rows) $this->newLine(); } - /** - * Formats a horizontal table. - */ - public function horizontalTable(array $headers, array $rows) - { - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); - - $table = new Table($this); - $table->setHeaders($headers); - $table->setRows($rows); - $table->setStyle($style); - $table->setHorizontal(true); - - $table->render(); - $this->newLine(); - } - - /** - * Formats a list of key/value horizontally. - * - * Each row can be one of: - * * 'A title' - * * ['key' => 'value'] - * * new TableSeparator() - * - * @param string|array|TableSeparator ...$list - */ - public function definitionList(...$list) - { - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); - - $table = new Table($this); - $headers = []; - $row = []; - foreach ($list as $value) { - if ($value instanceof TableSeparator) { - $headers[] = $value; - $row[] = $value; - continue; - } - if (\is_string($value)) { - $headers[] = new TableCell($value, ['colspan' => 2]); - $row[] = null; - continue; - } - if (!\is_array($value)) { - throw new InvalidArgumentException('Value should be an array, string, or an instance of TableSeparator.'); - } - $headers[] = key($value); - $row[] = current($value); - } - - $table->setHeaders($headers); - $table->setRows([$row]); - $table->setHorizontal(); - $table->setStyle($style); - - $table->render(); - $this->newLine(); - } - /** * {@inheritdoc} */ - public function ask(string $question, string $default = null, callable $validator = null) + public function ask($question, $default = null, $validator = null) { $question = new Question($question, $default); $question->setValidator($validator); @@ -275,7 +204,7 @@ public function ask(string $question, string $default = null, callable $validato /** * {@inheritdoc} */ - public function askHidden(string $question, callable $validator = null) + public function askHidden($question, $validator = null) { $question = new Question($question); @@ -288,7 +217,7 @@ public function askHidden(string $question, callable $validator = null) /** * {@inheritdoc} */ - public function confirm(string $question, bool $default = true) + public function confirm($question, $default = true) { return $this->askQuestion(new ConfirmationQuestion($question, $default)); } @@ -296,11 +225,11 @@ public function confirm(string $question, bool $default = true) /** * {@inheritdoc} */ - public function choice(string $question, array $choices, $default = null) + public function choice($question, array $choices, $default = null) { if (null !== $default) { $values = array_flip($choices); - $default = $values[$default] ?? $default; + $default = isset($values[$default]) ? $values[$default] : $default; } return $this->askQuestion(new ChoiceQuestion($question, $choices, $default)); @@ -309,7 +238,7 @@ public function choice(string $question, array $choices, $default = null) /** * {@inheritdoc} */ - public function progressStart(int $max = 0) + public function progressStart($max = 0) { $this->progressBar = $this->createProgressBar($max); $this->progressBar->start(); @@ -318,7 +247,7 @@ public function progressStart(int $max = 0) /** * {@inheritdoc} */ - public function progressAdvance(int $step = 1) + public function progressAdvance($step = 1) { $this->getProgressBar()->advance($step); } @@ -336,7 +265,7 @@ public function progressFinish() /** * {@inheritdoc} */ - public function createProgressBar(int $max = 0) + public function createProgressBar($max = 0) { $progressBar = parent::createProgressBar($max); @@ -375,37 +304,25 @@ public function askQuestion(Question $question) /** * {@inheritdoc} */ - public function writeln($messages, int $type = self::OUTPUT_NORMAL) + public function writeln($messages, $type = self::OUTPUT_NORMAL) { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::writeln($message, $type); - $this->writeBuffer($message, true, $type); - } + parent::writeln($messages, $type); + $this->bufferedOutput->writeln($this->reduceBuffer($messages), $type); } /** * {@inheritdoc} */ - public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) + public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::write($message, $newline, $type); - $this->writeBuffer($message, $newline, $type); - } + parent::write($messages, $newline, $type); + $this->bufferedOutput->write($this->reduceBuffer($messages), $newline, $type); } /** * {@inheritdoc} */ - public function newLine(int $count = 1) + public function newLine($count = 1) { parent::newLine($count); $this->bufferedOutput->write(str_repeat("\n", $count)); @@ -421,7 +338,10 @@ public function getErrorStyle() return new self($this->input, $this->getErrorOutput()); } - private function getProgressBar(): ProgressBar + /** + * @return ProgressBar + */ + private function getProgressBar() { if (!$this->progressBar) { throw new RuntimeException('The ProgressBar is not started.'); @@ -430,7 +350,7 @@ private function getProgressBar(): ProgressBar return $this->progressBar; } - private function autoPrependBlock(): void + private function autoPrependBlock() { $chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); @@ -443,25 +363,28 @@ private function autoPrependBlock(): void $this->newLine(2 - substr_count($chars, "\n")); } - private function autoPrependText(): void + private function autoPrependText() { $fetched = $this->bufferedOutput->fetch(); //Prepend new line if last char isn't EOL: - if (!str_ends_with($fetched, "\n")) { + if ("\n" !== substr($fetched, -1)) { $this->newLine(); } } - private function writeBuffer(string $message, bool $newLine, int $type): void + private function reduceBuffer($messages) { - // We need to know if the last chars are PHP_EOL - $this->bufferedOutput->write($message, $newLine, $type); + // We need to know if the two last chars are PHP_EOL + // Preserve the last 4 chars inserted (PHP_EOL on windows is two chars) in the history buffer + return array_map(function ($value) { + return substr($value, -4); + }, array_merge([$this->bufferedOutput->fetch()], (array) $messages)); } - private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array + private function createBlock($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = false) { $indentLength = 0; - $prefixLength = Helper::width(Helper::removeDecoration($this->getFormatter(), $prefix)); + $prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix); $lines = []; if (null !== $type) { @@ -476,12 +399,7 @@ private function createBlock(iterable $messages, string $type = null, string $st $message = OutputFormatter::escape($message); } - $decorationLength = Helper::width($message) - Helper::width(Helper::removeDecoration($this->getFormatter(), $message)); - $messageLineLength = min($this->lineLength - $prefixLength - $indentLength + $decorationLength, $this->lineLength); - $messageLines = explode(\PHP_EOL, wordwrap($message, $messageLineLength, \PHP_EOL, true)); - foreach ($messageLines as $messageLine) { - $lines[] = $messageLine; - } + $lines = array_merge($lines, explode(\PHP_EOL, wordwrap($message, $this->lineLength - $prefixLength - $indentLength, \PHP_EOL, true))); if (\count($messages) > 1 && $key < \count($messages) - 1) { $lines[] = ''; @@ -501,7 +419,7 @@ private function createBlock(iterable $messages, string $type = null, string $st } $line = $prefix.$line; - $line .= str_repeat(' ', max($this->lineLength - Helper::width(Helper::removeDecoration($this->getFormatter(), $line)), 0)); + $line .= str_repeat(' ', $this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line)); if ($style) { $line = sprintf('<%s>%s', $style, $line); diff --git a/app/vendor/symfony/console/Terminal.php b/app/vendor/symfony/console/Terminal.php index 5e5a3c2f7..774c5f76b 100644 --- a/app/vendor/symfony/console/Terminal.php +++ b/app/vendor/symfony/console/Terminal.php @@ -101,7 +101,7 @@ private static function initDimensions() /** * Returns whether STDOUT has vt100 support (some Windows 10+ configurations). */ - private static function hasVt100Support(): bool + private static function hasVt100Support() { return \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'w')); } @@ -129,7 +129,7 @@ private static function initDimensionsUsingStty() * * @return int[]|null An array composed of the width and the height or null if it could not be parsed */ - private static function getConsoleMode(): ?array + private static function getConsoleMode() { $info = self::readFromProcess('mode CON'); @@ -142,13 +142,20 @@ private static function getConsoleMode(): ?array /** * Runs and parses stty -a if it's available, suppressing any error output. + * + * @return string|null */ - private static function getSttyColumns(): ?string + private static function getSttyColumns() { return self::readFromProcess('stty -a | grep columns'); } - private static function readFromProcess(string $command): ?string + /** + * @param string $command + * + * @return string|null + */ + private static function readFromProcess($command) { if (!\function_exists('proc_open')) { return null; diff --git a/app/vendor/symfony/console/Tester/ApplicationTester.php b/app/vendor/symfony/console/Tester/ApplicationTester.php index d021c1435..355b07b16 100644 --- a/app/vendor/symfony/console/Tester/ApplicationTester.php +++ b/app/vendor/symfony/console/Tester/ApplicationTester.php @@ -13,6 +13,10 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\StreamOutput; /** * Eases the testing of console applications. @@ -26,11 +30,14 @@ */ class ApplicationTester { - use TesterTrait; - private $application; private $input; private $statusCode; + /** + * @var OutputInterface + */ + private $output; + private $captureStreamsIndependently = false; public function __construct(Application $application) { @@ -47,21 +54,123 @@ public function __construct(Application $application) * * verbosity: Sets the output verbosity flag * * capture_stderr_separately: Make output of stdOut and stdErr separately available * + * @param array $input An array of arguments and options + * @param array $options An array of options + * * @return int The command exit code */ - public function run(array $input, array $options = []) + public function run(array $input, $options = []) { $this->input = new ArrayInput($input); if (isset($options['interactive'])) { $this->input->setInteractive($options['interactive']); } - if ($this->inputs) { - $this->input->setStream(self::createStream($this->inputs)); - } + $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; + if (!$this->captureStreamsIndependently) { + $this->output = new StreamOutput(fopen('php://memory', 'w', false)); + if (isset($options['decorated'])) { + $this->output->setDecorated($options['decorated']); + } + if (isset($options['verbosity'])) { + $this->output->setVerbosity($options['verbosity']); + } + } else { + $this->output = new ConsoleOutput( + isset($options['verbosity']) ? $options['verbosity'] : ConsoleOutput::VERBOSITY_NORMAL, + isset($options['decorated']) ? $options['decorated'] : null + ); + + $errorOutput = new StreamOutput(fopen('php://memory', 'w', false)); + $errorOutput->setFormatter($this->output->getFormatter()); + $errorOutput->setVerbosity($this->output->getVerbosity()); + $errorOutput->setDecorated($this->output->isDecorated()); - $this->initOutput($options); + $reflectedOutput = new \ReflectionObject($this->output); + $strErrProperty = $reflectedOutput->getProperty('stderr'); + $strErrProperty->setAccessible(true); + $strErrProperty->setValue($this->output, $errorOutput); + + $reflectedParent = $reflectedOutput->getParentClass(); + $streamProperty = $reflectedParent->getProperty('stream'); + $streamProperty->setAccessible(true); + $streamProperty->setValue($this->output, fopen('php://memory', 'w', false)); + } return $this->statusCode = $this->application->run($this->input, $this->output); } + + /** + * Gets the display returned by the last execution of the application. + * + * @param bool $normalize Whether to normalize end of lines to \n or not + * + * @return string The display + */ + public function getDisplay($normalize = false) + { + rewind($this->output->getStream()); + + $display = stream_get_contents($this->output->getStream()); + + if ($normalize) { + $display = str_replace(\PHP_EOL, "\n", $display); + } + + return $display; + } + + /** + * Gets the output written to STDERR by the application. + * + * @param bool $normalize Whether to normalize end of lines to \n or not + * + * @return string + */ + public function getErrorOutput($normalize = false) + { + if (!$this->captureStreamsIndependently) { + throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.'); + } + + rewind($this->output->getErrorOutput()->getStream()); + + $display = stream_get_contents($this->output->getErrorOutput()->getStream()); + + if ($normalize) { + $display = str_replace(\PHP_EOL, "\n", $display); + } + + return $display; + } + + /** + * Gets the input instance used by the last execution of the application. + * + * @return InputInterface The current input instance + */ + public function getInput() + { + return $this->input; + } + + /** + * Gets the output instance used by the last execution of the application. + * + * @return OutputInterface The current output instance + */ + public function getOutput() + { + return $this->output; + } + + /** + * Gets the status code returned by the last execution of the application. + * + * @return int The status code + */ + public function getStatusCode() + { + return $this->statusCode; + } } diff --git a/app/vendor/symfony/console/Tester/CommandTester.php b/app/vendor/symfony/console/Tester/CommandTester.php index 57efc9a67..122989488 100644 --- a/app/vendor/symfony/console/Tester/CommandTester.php +++ b/app/vendor/symfony/console/Tester/CommandTester.php @@ -13,6 +13,9 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\StreamOutput; /** * Eases the testing of console commands. @@ -22,10 +25,10 @@ */ class CommandTester { - use TesterTrait; - private $command; private $input; + private $output; + private $inputs = []; private $statusCode; public function __construct(Command $command) @@ -38,10 +41,9 @@ public function __construct(Command $command) * * Available execution options: * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available + * * interactive: Sets the input interactive flag + * * decorated: Sets the output decorated flag + * * verbosity: Sets the output verbosity flag * * @param array $input An array of command arguments and options * @param array $options An array of execution options @@ -67,12 +69,94 @@ public function execute(array $input, array $options = []) $this->input->setInteractive($options['interactive']); } - if (!isset($options['decorated'])) { - $options['decorated'] = false; + $this->output = new StreamOutput(fopen('php://memory', 'w', false)); + $this->output->setDecorated(isset($options['decorated']) ? $options['decorated'] : false); + if (isset($options['verbosity'])) { + $this->output->setVerbosity($options['verbosity']); } - $this->initOutput($options); - return $this->statusCode = $this->command->run($this->input, $this->output); } + + /** + * Gets the display returned by the last execution of the command. + * + * @param bool $normalize Whether to normalize end of lines to \n or not + * + * @return string The display + */ + public function getDisplay($normalize = false) + { + if (null === $this->output) { + throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); + } + + rewind($this->output->getStream()); + + $display = stream_get_contents($this->output->getStream()); + + if ($normalize) { + $display = str_replace(\PHP_EOL, "\n", $display); + } + + return $display; + } + + /** + * Gets the input instance used by the last execution of the command. + * + * @return InputInterface The current input instance + */ + public function getInput() + { + return $this->input; + } + + /** + * Gets the output instance used by the last execution of the command. + * + * @return OutputInterface The current output instance + */ + public function getOutput() + { + return $this->output; + } + + /** + * Gets the status code returned by the last execution of the application. + * + * @return int The status code + */ + public function getStatusCode() + { + return $this->statusCode; + } + + /** + * Sets the user inputs. + * + * @param array $inputs An array of strings representing each input + * passed to the command input stream + * + * @return CommandTester + */ + public function setInputs(array $inputs) + { + $this->inputs = $inputs; + + return $this; + } + + private static function createStream(array $inputs) + { + $stream = fopen('php://memory', 'r+', false); + + foreach ($inputs as $input) { + fwrite($stream, $input.\PHP_EOL); + } + + rewind($stream); + + return $stream; + } } diff --git a/app/vendor/symfony/console/Tester/TesterTrait.php b/app/vendor/symfony/console/Tester/TesterTrait.php deleted file mode 100644 index 358341b10..000000000 --- a/app/vendor/symfony/console/Tester/TesterTrait.php +++ /dev/null @@ -1,186 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * @author Amrouche Hamza - */ -trait TesterTrait -{ - /** @var StreamOutput */ - private $output; - private $inputs = []; - private $captureStreamsIndependently = false; - - /** - * Gets the display returned by the last execution of the command or application. - * - * @throws \RuntimeException If it's called before the execute method - * - * @return string The display - */ - public function getDisplay(bool $normalize = false) - { - if (null === $this->output) { - throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); - } - - rewind($this->output->getStream()); - - $display = stream_get_contents($this->output->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the output written to STDERR by the application. - * - * @param bool $normalize Whether to normalize end of lines to \n or not - * - * @return string - */ - public function getErrorOutput(bool $normalize = false) - { - if (!$this->captureStreamsIndependently) { - throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.'); - } - - rewind($this->output->getErrorOutput()->getStream()); - - $display = stream_get_contents($this->output->getErrorOutput()->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the input instance used by the last execution of the command or application. - * - * @return InputInterface The current input instance - */ - public function getInput() - { - return $this->input; - } - - /** - * Gets the output instance used by the last execution of the command or application. - * - * @return OutputInterface The current output instance - */ - public function getOutput() - { - return $this->output; - } - - /** - * Gets the status code returned by the last execution of the command or application. - * - * @throws \RuntimeException If it's called before the execute method - * - * @return int The status code - */ - public function getStatusCode() - { - if (null === $this->statusCode) { - throw new \RuntimeException('Status code not initialized, did you execute the command before requesting the status code?'); - } - - return $this->statusCode; - } - - /** - * Sets the user inputs. - * - * @param array $inputs An array of strings representing each input - * passed to the command input stream - * - * @return $this - */ - public function setInputs(array $inputs) - { - $this->inputs = $inputs; - - return $this; - } - - /** - * Initializes the output property. - * - * Available options: - * - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - */ - private function initOutput(array $options) - { - $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; - if (!$this->captureStreamsIndependently) { - $this->output = new StreamOutput(fopen('php://memory', 'w', false)); - if (isset($options['decorated'])) { - $this->output->setDecorated($options['decorated']); - } - if (isset($options['verbosity'])) { - $this->output->setVerbosity($options['verbosity']); - } - } else { - $this->output = new ConsoleOutput( - $options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL, - $options['decorated'] ?? null - ); - - $errorOutput = new StreamOutput(fopen('php://memory', 'w', false)); - $errorOutput->setFormatter($this->output->getFormatter()); - $errorOutput->setVerbosity($this->output->getVerbosity()); - $errorOutput->setDecorated($this->output->isDecorated()); - - $reflectedOutput = new \ReflectionObject($this->output); - $strErrProperty = $reflectedOutput->getProperty('stderr'); - $strErrProperty->setAccessible(true); - $strErrProperty->setValue($this->output, $errorOutput); - - $reflectedParent = $reflectedOutput->getParentClass(); - $streamProperty = $reflectedParent->getProperty('stream'); - $streamProperty->setAccessible(true); - $streamProperty->setValue($this->output, fopen('php://memory', 'w', false)); - } - } - - /** - * @return resource - */ - private static function createStream(array $inputs) - { - $stream = fopen('php://memory', 'r+', false); - - foreach ($inputs as $input) { - fwrite($stream, $input.\PHP_EOL); - } - - rewind($stream); - - return $stream; - } -} diff --git a/app/vendor/symfony/console/Tests/ApplicationTest.php b/app/vendor/symfony/console/Tests/ApplicationTest.php new file mode 100644 index 000000000..16d856c46 --- /dev/null +++ b/app/vendor/symfony/console/Tests/ApplicationTest.php @@ -0,0 +1,1786 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tests; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\CommandLoader\FactoryCommandLoader; +use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass; +use Symfony\Component\Console\Event\ConsoleCommandEvent; +use Symfony\Component\Console\Event\ConsoleErrorEvent; +use Symfony\Component\Console\Event\ConsoleExceptionEvent; +use Symfony\Component\Console\Event\ConsoleTerminateEvent; +use Symfony\Component\Console\Exception\CommandNotFoundException; +use Symfony\Component\Console\Helper\FormatterHelper; +use Symfony\Component\Console\Helper\HelperSet; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\NullOutput; +use Symfony\Component\Console\Output\Output; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\StreamOutput; +use Symfony\Component\Console\Tester\ApplicationTester; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\EventDispatcher\EventDispatcher; + +class ApplicationTest extends TestCase +{ + protected static $fixturesPath; + + private $colSize; + + protected function setUp() + { + $this->colSize = getenv('COLUMNS'); + } + + protected function tearDown() + { + putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS'); + putenv('SHELL_VERBOSITY'); + unset($_ENV['SHELL_VERBOSITY']); + unset($_SERVER['SHELL_VERBOSITY']); + } + + public static function setUpBeforeClass() + { + self::$fixturesPath = realpath(__DIR__.'/Fixtures/'); + require_once self::$fixturesPath.'/FooCommand.php'; + require_once self::$fixturesPath.'/FooOptCommand.php'; + require_once self::$fixturesPath.'/Foo1Command.php'; + require_once self::$fixturesPath.'/Foo2Command.php'; + require_once self::$fixturesPath.'/Foo3Command.php'; + require_once self::$fixturesPath.'/Foo4Command.php'; + require_once self::$fixturesPath.'/Foo5Command.php'; + require_once self::$fixturesPath.'/FooSameCaseUppercaseCommand.php'; + require_once self::$fixturesPath.'/FooSameCaseLowercaseCommand.php'; + require_once self::$fixturesPath.'/FoobarCommand.php'; + require_once self::$fixturesPath.'/BarBucCommand.php'; + require_once self::$fixturesPath.'/FooSubnamespaced1Command.php'; + require_once self::$fixturesPath.'/FooSubnamespaced2Command.php'; + require_once self::$fixturesPath.'/TestAmbiguousCommandRegistering.php'; + require_once self::$fixturesPath.'/TestAmbiguousCommandRegistering2.php'; + require_once self::$fixturesPath.'/FooHiddenCommand.php'; + } + + protected function normalizeLineBreaks($text) + { + return str_replace(\PHP_EOL, "\n", $text); + } + + /** + * Replaces the dynamic placeholders of the command help text with a static version. + * The placeholder %command.full_name% includes the script path that is not predictable + * and can not be tested against. + */ + protected function ensureStaticCommandHelp(Application $application) + { + foreach ($application->all() as $command) { + $command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp())); + } + } + + public function testConstructor() + { + $application = new Application('foo', 'bar'); + $this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument'); + $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its second argument'); + $this->assertEquals(['help', 'list'], array_keys($application->all()), '__construct() registered the help and list commands by default'); + } + + public function testSetGetName() + { + $application = new Application(); + $application->setName('foo'); + $this->assertEquals('foo', $application->getName(), '->setName() sets the name of the application'); + } + + public function testSetGetVersion() + { + $application = new Application(); + $application->setVersion('bar'); + $this->assertEquals('bar', $application->getVersion(), '->setVersion() sets the version of the application'); + } + + public function testGetLongVersion() + { + $application = new Application('foo', 'bar'); + $this->assertEquals('foo bar', $application->getLongVersion(), '->getLongVersion() returns the long version of the application'); + } + + public function testHelp() + { + $application = new Application(); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_gethelp.txt', $this->normalizeLineBreaks($application->getHelp()), '->getHelp() returns a help message'); + } + + public function testAll() + { + $application = new Application(); + $commands = $application->all(); + $this->assertInstanceOf('Symfony\\Component\\Console\\Command\\HelpCommand', $commands['help'], '->all() returns the registered commands'); + + $application->add(new \FooCommand()); + $commands = $application->all('foo'); + $this->assertCount(1, $commands, '->all() takes a namespace as its first argument'); + } + + public function testAllWithCommandLoader() + { + $application = new Application(); + $commands = $application->all(); + $this->assertInstanceOf('Symfony\\Component\\Console\\Command\\HelpCommand', $commands['help'], '->all() returns the registered commands'); + + $application->add(new \FooCommand()); + $commands = $application->all('foo'); + $this->assertCount(1, $commands, '->all() takes a namespace as its first argument'); + + $application->setCommandLoader(new FactoryCommandLoader([ + 'foo:bar1' => function () { return new \Foo1Command(); }, + ])); + $commands = $application->all('foo'); + $this->assertCount(2, $commands, '->all() takes a namespace as its first argument'); + $this->assertInstanceOf(\FooCommand::class, $commands['foo:bar'], '->all() returns the registered commands'); + $this->assertInstanceOf(\Foo1Command::class, $commands['foo:bar1'], '->all() returns the registered commands'); + } + + public function testRegister() + { + $application = new Application(); + $command = $application->register('foo'); + $this->assertEquals('foo', $command->getName(), '->register() registers a new command'); + } + + public function testRegisterAmbiguous() + { + $code = function (InputInterface $input, OutputInterface $output) { + $output->writeln('It works!'); + }; + + $application = new Application(); + $application->setAutoExit(false); + $application + ->register('test-foo') + ->setAliases(['test']) + ->setCode($code); + + $application + ->register('test-bar') + ->setCode($code); + + $tester = new ApplicationTester($application); + $tester->run(['test']); + $this->assertStringContainsString('It works!', $tester->getDisplay(true)); + } + + public function testAdd() + { + $application = new Application(); + $application->add($foo = new \FooCommand()); + $commands = $application->all(); + $this->assertEquals($foo, $commands['foo:bar'], '->add() registers a command'); + + $application = new Application(); + $application->addCommands([$foo = new \FooCommand(), $foo1 = new \Foo1Command()]); + $commands = $application->all(); + $this->assertEquals([$foo, $foo1], [$commands['foo:bar'], $commands['foo:bar1']], '->addCommands() registers an array of commands'); + } + + public function testAddCommandWithEmptyConstructor() + { + $this->expectException('LogicException'); + $this->expectExceptionMessage('Command class "Foo5Command" is not correctly initialized. You probably forgot to call the parent constructor.'); + $application = new Application(); + $application->add(new \Foo5Command()); + } + + public function testHasGet() + { + $application = new Application(); + $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered'); + $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered'); + + $application->add($foo = new \FooCommand()); + $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered'); + $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name'); + $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias'); + + $application = new Application(); + $application->add($foo = new \FooCommand()); + // simulate --help + $r = new \ReflectionObject($application); + $p = $r->getProperty('wantHelps'); + $p->setAccessible(true); + $p->setValue($application, true); + $command = $application->get('foo:bar'); + $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $command, '->get() returns the help command if --help is provided as the input'); + } + + public function testHasGetWithCommandLoader() + { + $application = new Application(); + $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered'); + $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered'); + + $application->add($foo = new \FooCommand()); + $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered'); + $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name'); + $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias'); + + $application->setCommandLoader(new FactoryCommandLoader([ + 'foo:bar1' => function () { return new \Foo1Command(); }, + ])); + + $this->assertTrue($application->has('afoobar'), '->has() returns true if an instance is registered for an alias even with command loader'); + $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns an instance by name even with command loader'); + $this->assertEquals($foo, $application->get('afoobar'), '->get() returns an instance by alias even with command loader'); + $this->assertTrue($application->has('foo:bar1'), '->has() returns true for commands registered in the loader'); + $this->assertInstanceOf(\Foo1Command::class, $foo1 = $application->get('foo:bar1'), '->get() returns a command by name from the command loader'); + $this->assertTrue($application->has('afoobar1'), '->has() returns true for commands registered in the loader'); + $this->assertEquals($foo1, $application->get('afoobar1'), '->get() returns a command by name from the command loader'); + } + + public function testSilentHelp() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $tester = new ApplicationTester($application); + $tester->run(['-h' => true, '-q' => true], ['decorated' => false]); + + $this->assertEmpty($tester->getDisplay(true)); + } + + public function testGetInvalidCommand() + { + $this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException'); + $this->expectExceptionMessage('The command "foofoo" does not exist.'); + $application = new Application(); + $application->get('foofoo'); + } + + public function testGetNamespaces() + { + $application = new Application(); + $application->add(new \FooCommand()); + $application->add(new \Foo1Command()); + $this->assertEquals(['foo'], $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces'); + } + + public function testFindNamespace() + { + $application = new Application(); + $application->add(new \FooCommand()); + $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists'); + $this->assertEquals('foo', $application->findNamespace('f'), '->findNamespace() finds a namespace given an abbreviation'); + $application->add(new \Foo2Command()); + $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists'); + } + + public function testFindNamespaceWithSubnamespaces() + { + $application = new Application(); + $application->add(new \FooSubnamespaced1Command()); + $application->add(new \FooSubnamespaced2Command()); + $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns commands even if the commands are only contained in subnamespaces'); + } + + public function testFindAmbiguousNamespace() + { + $application = new Application(); + $application->add(new \BarBucCommand()); + $application->add(new \FooCommand()); + $application->add(new \Foo2Command()); + + $expectedMsg = "The namespace \"f\" is ambiguous.\nDid you mean one of these?\n foo\n foo1"; + + $this->expectException(CommandNotFoundException::class); + $this->expectExceptionMessage($expectedMsg); + + $application->findNamespace('f'); + } + + public function testFindNonAmbiguous() + { + $application = new Application(); + $application->add(new \TestAmbiguousCommandRegistering()); + $application->add(new \TestAmbiguousCommandRegistering2()); + $this->assertEquals('test-ambiguous', $application->find('test')->getName()); + } + + public function testFindInvalidNamespace() + { + $this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException'); + $this->expectExceptionMessage('There are no commands defined in the "bar" namespace.'); + $application = new Application(); + $application->findNamespace('bar'); + } + + public function testFindUniqueNameButNamespaceName() + { + $this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException'); + $this->expectExceptionMessage('Command "foo1" is not defined'); + $application = new Application(); + $application->add(new \FooCommand()); + $application->add(new \Foo1Command()); + $application->add(new \Foo2Command()); + + $application->find($commandName = 'foo1'); + } + + public function testFind() + { + $application = new Application(); + $application->add(new \FooCommand()); + + $this->assertInstanceOf('FooCommand', $application->find('foo:bar'), '->find() returns a command if its name exists'); + $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $application->find('h'), '->find() returns a command if its name exists'); + $this->assertInstanceOf('FooCommand', $application->find('f:bar'), '->find() returns a command if the abbreviation for the namespace exists'); + $this->assertInstanceOf('FooCommand', $application->find('f:b'), '->find() returns a command if the abbreviation for the namespace and the command name exist'); + $this->assertInstanceOf('FooCommand', $application->find('a'), '->find() returns a command if the abbreviation exists for an alias'); + } + + public function testFindCaseSensitiveFirst() + { + $application = new Application(); + $application->add(new \FooSameCaseUppercaseCommand()); + $application->add(new \FooSameCaseLowercaseCommand()); + + $this->assertInstanceOf('FooSameCaseUppercaseCommand', $application->find('f:B'), '->find() returns a command if the abbreviation is the correct case'); + $this->assertInstanceOf('FooSameCaseUppercaseCommand', $application->find('f:BAR'), '->find() returns a command if the abbreviation is the correct case'); + $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:b'), '->find() returns a command if the abbreviation is the correct case'); + $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:bar'), '->find() returns a command if the abbreviation is the correct case'); + } + + public function testFindCaseInsensitiveAsFallback() + { + $application = new Application(); + $application->add(new \FooSameCaseLowercaseCommand()); + + $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:b'), '->find() returns a command if the abbreviation is the correct case'); + $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:B'), '->find() will fallback to case insensitivity'); + $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('FoO:BaR'), '->find() will fallback to case insensitivity'); + } + + public function testFindCaseInsensitiveSuggestions() + { + $this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException'); + $this->expectExceptionMessage('Command "FoO:BaR" is ambiguous'); + $application = new Application(); + $application->add(new \FooSameCaseLowercaseCommand()); + $application->add(new \FooSameCaseUppercaseCommand()); + + $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('FoO:BaR'), '->find() will find two suggestions with case insensitivity'); + } + + public function testFindWithCommandLoader() + { + $application = new Application(); + $application->setCommandLoader(new FactoryCommandLoader([ + 'foo:bar' => $f = function () { return new \FooCommand(); }, + ])); + + $this->assertInstanceOf('FooCommand', $application->find('foo:bar'), '->find() returns a command if its name exists'); + $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $application->find('h'), '->find() returns a command if its name exists'); + $this->assertInstanceOf('FooCommand', $application->find('f:bar'), '->find() returns a command if the abbreviation for the namespace exists'); + $this->assertInstanceOf('FooCommand', $application->find('f:b'), '->find() returns a command if the abbreviation for the namespace and the command name exist'); + $this->assertInstanceOf('FooCommand', $application->find('a'), '->find() returns a command if the abbreviation exists for an alias'); + } + + /** + * @dataProvider provideAmbiguousAbbreviations + */ + public function testFindWithAmbiguousAbbreviations($abbreviation, $expectedExceptionMessage) + { + putenv('COLUMNS=120'); + $this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException'); + $this->expectExceptionMessage($expectedExceptionMessage); + + $application = new Application(); + $application->add(new \FooCommand()); + $application->add(new \Foo1Command()); + $application->add(new \Foo2Command()); + + $application->find($abbreviation); + } + + public function provideAmbiguousAbbreviations() + { + return [ + ['f', 'Command "f" is not defined.'], + [ + 'a', + "Command \"a\" is ambiguous.\nDid you mean one of these?\n". + " afoobar The foo:bar command\n". + " afoobar1 The foo:bar1 command\n". + ' afoobar2 The foo1:bar command', + ], + [ + 'foo:b', + "Command \"foo:b\" is ambiguous.\nDid you mean one of these?\n". + " foo:bar The foo:bar command\n". + " foo:bar1 The foo:bar1 command\n". + ' foo1:bar The foo1:bar command', + ], + ]; + } + + public function testFindCommandEqualNamespace() + { + $application = new Application(); + $application->add(new \Foo3Command()); + $application->add(new \Foo4Command()); + + $this->assertInstanceOf('Foo3Command', $application->find('foo3:bar'), '->find() returns the good command even if a namespace has same name'); + $this->assertInstanceOf('Foo4Command', $application->find('foo3:bar:toh'), '->find() returns a command even if its namespace equals another command name'); + } + + public function testFindCommandWithAmbiguousNamespacesButUniqueName() + { + $application = new Application(); + $application->add(new \FooCommand()); + $application->add(new \FoobarCommand()); + + $this->assertInstanceOf('FoobarCommand', $application->find('f:f')); + } + + public function testFindCommandWithMissingNamespace() + { + $application = new Application(); + $application->add(new \Foo4Command()); + + $this->assertInstanceOf('Foo4Command', $application->find('f::t')); + } + + /** + * @dataProvider provideInvalidCommandNamesSingle + */ + public function testFindAlternativeExceptionMessageSingle($name) + { + $this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException'); + $this->expectExceptionMessage('Did you mean this'); + $application = new Application(); + $application->add(new \Foo3Command()); + $application->find($name); + } + + public function provideInvalidCommandNamesSingle() + { + return [ + ['foo3:barr'], + ['fooo3:bar'], + ]; + } + + public function testFindAlternativeExceptionMessageMultiple() + { + putenv('COLUMNS=120'); + $application = new Application(); + $application->add(new \FooCommand()); + $application->add(new \Foo1Command()); + $application->add(new \Foo2Command()); + + // Command + plural + try { + $application->find('foo:baR'); + $this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertMatchesRegularExpression('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertMatchesRegularExpression('/foo1:bar/', $e->getMessage()); + $this->assertMatchesRegularExpression('/foo:bar/', $e->getMessage()); + } + + // Namespace + plural + try { + $application->find('foo2:bar'); + $this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertMatchesRegularExpression('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertMatchesRegularExpression('/foo1/', $e->getMessage()); + } + + $application->add(new \Foo3Command()); + $application->add(new \Foo4Command()); + + // Subnamespace + plural + try { + $application->find('foo3:'); + $this->fail('->find() should throw an Symfony\Component\Console\Exception\CommandNotFoundException if a command is ambiguous because of a subnamespace, with alternatives'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e); + $this->assertMatchesRegularExpression('/foo3:bar/', $e->getMessage()); + $this->assertMatchesRegularExpression('/foo3:bar:toh/', $e->getMessage()); + } + } + + public function testFindAlternativeCommands() + { + $application = new Application(); + + $application->add(new \FooCommand()); + $application->add(new \Foo1Command()); + $application->add(new \Foo2Command()); + + try { + $application->find($commandName = 'Unknown command'); + $this->fail('->find() throws a CommandNotFoundException if command does not exist'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist'); + $this->assertSame([], $e->getAlternatives()); + $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without alternatives'); + } + + // Test if "bar1" command throw a "CommandNotFoundException" and does not contain + // "foo:bar" as alternative because "bar1" is too far from "foo:bar" + try { + $application->find($commandName = 'bar1'); + $this->fail('->find() throws a CommandNotFoundException if command does not exist'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist'); + $this->assertSame(['afoobar1', 'foo:bar1'], $e->getAlternatives()); + $this->assertMatchesRegularExpression(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertMatchesRegularExpression('/afoobar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "afoobar1"'); + $this->assertMatchesRegularExpression('/foo:bar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "foo:bar1"'); + $this->assertDoesNotMatchRegularExpression('/foo:bar(?!1)/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without "foo:bar" alternative'); + } + } + + public function testFindAlternativeCommandsWithAnAlias() + { + $fooCommand = new \FooCommand(); + $fooCommand->setAliases(['foo2']); + + $application = new Application(); + $application->setCommandLoader(new FactoryCommandLoader([ + 'foo3' => static function () use ($fooCommand) { return $fooCommand; }, + ])); + $application->add($fooCommand); + + $result = $application->find('foo'); + + $this->assertSame($fooCommand, $result); + } + + public function testFindAlternativeNamespace() + { + $application = new Application(); + + $application->add(new \FooCommand()); + $application->add(new \Foo1Command()); + $application->add(new \Foo2Command()); + $application->add(new \Foo3Command()); + + try { + $application->find('Unknown-namespace:Unknown-command'); + $this->fail('->find() throws a CommandNotFoundException if namespace does not exist'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist'); + $this->assertSame([], $e->getAlternatives()); + $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, without alternatives'); + } + + try { + $application->find('foo2:command'); + $this->fail('->find() throws a CommandNotFoundException if namespace does not exist'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist'); + $this->assertCount(3, $e->getAlternatives()); + $this->assertContains('foo', $e->getAlternatives()); + $this->assertContains('foo1', $e->getAlternatives()); + $this->assertContains('foo3', $e->getAlternatives()); + $this->assertMatchesRegularExpression('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative'); + $this->assertMatchesRegularExpression('/foo/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"'); + $this->assertMatchesRegularExpression('/foo1/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"'); + $this->assertMatchesRegularExpression('/foo3/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo3"'); + } + } + + public function testFindAlternativesOutput() + { + $application = new Application(); + + $application->add(new \FooCommand()); + $application->add(new \Foo1Command()); + $application->add(new \Foo2Command()); + $application->add(new \Foo3Command()); + $application->add(new \FooHiddenCommand()); + + $expectedAlternatives = [ + 'afoobar', + 'afoobar1', + 'afoobar2', + 'foo1:bar', + 'foo3:bar', + 'foo:bar', + 'foo:bar1', + ]; + + try { + $application->find('foo'); + $this->fail('->find() throws a CommandNotFoundException if command is not defined'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command is not defined'); + $this->assertSame($expectedAlternatives, $e->getAlternatives()); + + $this->assertMatchesRegularExpression('/Command "foo" is not defined\..*Did you mean one of these\?.*/Ums', $e->getMessage()); + } + } + + public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces() + { + $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['getNamespaces'])->getMock(); + $application->expects($this->once()) + ->method('getNamespaces') + ->willReturn(['foo:sublong', 'bar:sub']); + + $this->assertEquals('foo:sublong', $application->findNamespace('f:sub')); + } + + public function testFindWithDoubleColonInNameThrowsException() + { + $this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException'); + $this->expectExceptionMessage('Command "foo::bar" is not defined.'); + $application = new Application(); + $application->add(new \FooCommand()); + $application->add(new \Foo4Command()); + $application->find('foo::bar'); + } + + public function testSetCatchExceptions() + { + $application = new Application(); + $application->setAutoExit(false); + putenv('COLUMNS=120'); + $tester = new ApplicationTester($application); + + $application->setCatchExceptions(true); + $this->assertTrue($application->areExceptionsCaught()); + + $tester->run(['command' => 'foo'], ['decorated' => false]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getDisplay(true), '->setCatchExceptions() sets the catch exception flag'); + + $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getErrorOutput(true), '->setCatchExceptions() sets the catch exception flag'); + $this->assertSame('', $tester->getDisplay(true)); + + $application->setCatchExceptions(false); + try { + $tester->run(['command' => 'foo'], ['decorated' => false]); + $this->fail('->setCatchExceptions() sets the catch exception flag'); + } catch (\Exception $e) { + $this->assertInstanceOf('\Exception', $e, '->setCatchExceptions() sets the catch exception flag'); + $this->assertEquals('Command "foo" is not defined.', $e->getMessage(), '->setCatchExceptions() sets the catch exception flag'); + } + } + + public function testAutoExitSetting() + { + $application = new Application(); + $this->assertTrue($application->isAutoExitEnabled()); + + $application->setAutoExit(false); + $this->assertFalse($application->isAutoExitEnabled()); + } + + public function testRenderException() + { + $application = new Application(); + $application->setAutoExit(false); + putenv('COLUMNS=120'); + $tester = new ApplicationTester($application); + + $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exception'); + + $tester->run(['command' => 'foo'], ['decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE, 'capture_stderr_separately' => true]); + $this->assertStringContainsString('Exception trace', $tester->getErrorOutput(), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose'); + + $tester->run(['command' => 'list', '--foo' => true], ['decorated' => false, 'capture_stderr_separately' => true]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $tester->getErrorOutput(true), '->renderException() renders the command synopsis when an exception occurs in the context of a command'); + + $application->add(new \Foo3Command()); + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo3:bar'], ['decorated' => false, 'capture_stderr_separately' => true]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); + + $tester->run(['command' => 'foo3:bar'], ['decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]); + $this->assertMatchesRegularExpression('/\[Exception\]\s*First exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is default and verbosity is verbose'); + $this->assertMatchesRegularExpression('/\[Exception\]\s*Second exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is 0 and verbosity is verbose'); + $this->assertMatchesRegularExpression('/\[Exception \(404\)\]\s*Third exception/', $tester->getDisplay(), '->renderException() renders a pretty exception with code exception when code exception is 404 and verbosity is verbose'); + + $tester->run(['command' => 'foo3:bar'], ['decorated' => true]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions'); + + $tester->run(['command' => 'foo3:bar'], ['decorated' => true, 'capture_stderr_separately' => true]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); + + $application = new Application(); + $application->setAutoExit(false); + putenv('COLUMNS=32'); + $tester = new ApplicationTester($application); + + $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal'); + putenv('COLUMNS=120'); + } + + public function testRenderExceptionWithDoubleWidthCharacters() + { + $application = new Application(); + $application->setAutoExit(false); + putenv('COLUMNS=120'); + $application->register('foo')->setCode(function () { + throw new \Exception('エラーメッセージ'); + }); + $tester = new ApplicationTester($application); + + $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]); + $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); + + $tester->run(['command' => 'foo'], ['decorated' => true, 'capture_stderr_separately' => true]); + $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); + + $application = new Application(); + $application->setAutoExit(false); + putenv('COLUMNS=32'); + $application->register('foo')->setCode(function () { + throw new \Exception('コマンドの実行中にエラーが発生しました。'); + }); + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]); + $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal'); + putenv('COLUMNS=120'); + } + + public function testRenderExceptionEscapesLines() + { + $application = new Application(); + $application->setAutoExit(false); + putenv('COLUMNS=22'); + $application->register('foo')->setCode(function () { + throw new \Exception('dont break here !'); + }); + $tester = new ApplicationTester($application); + + $tester->run(['command' => 'foo'], ['decorated' => false]); + $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting'); + putenv('COLUMNS=120'); + } + + public function testRenderExceptionLineBreaks() + { + $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['getTerminalWidth'])->getMock(); + $application->setAutoExit(false); + $application->expects($this->any()) + ->method('getTerminalWidth') + ->willReturn(120); + $application->register('foo')->setCode(function () { + throw new \InvalidArgumentException("\n\nline 1 with extra spaces \nline 2\n\nline 4\n"); + }); + $tester = new ApplicationTester($application); + + $tester->run(['command' => 'foo'], ['decorated' => false]); + $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks'); + } + + public function testRenderExceptionStackTraceContainsRootException() + { + $application = new Application(); + $application->setAutoExit(false); + $application->register('foo')->setCode(function () { + throw new \Exception('Verbose exception'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo'], ['decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]); + + $this->assertStringContainsString(sprintf('() at %s:', __FILE__), $tester->getDisplay()); + } + + public function testRun() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + $application->add($command = new \Foo1Command()); + $_SERVER['argv'] = ['cli.php', 'foo:bar1']; + + ob_start(); + $application->run(); + ob_end_clean(); + + $this->assertInstanceOf('Symfony\Component\Console\Input\ArgvInput', $command->input, '->run() creates an ArgvInput by default if none is given'); + $this->assertInstanceOf('Symfony\Component\Console\Output\ConsoleOutput', $command->output, '->run() creates a ConsoleOutput by default if none is given'); + + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $this->ensureStaticCommandHelp($application); + $tester = new ApplicationTester($application); + + $tester->run([], ['decorated' => false]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $tester->getDisplay(true), '->run() runs the list command if no argument is passed'); + + $tester->run(['--help' => true], ['decorated' => false]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if --help is passed'); + + $tester->run(['-h' => true], ['decorated' => false]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if -h is passed'); + + $tester->run(['command' => 'list', '--help' => true], ['decorated' => false]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if --help is passed'); + + $tester->run(['command' => 'list', '-h' => true], ['decorated' => false]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if -h is passed'); + + $tester->run(['--ansi' => true]); + $this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed'); + + $tester->run(['--no-ansi' => true]); + $this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed'); + + $tester->run(['--version' => true], ['decorated' => false]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if --version is passed'); + + $tester->run(['-V' => true], ['decorated' => false]); + $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if -v is passed'); + + $tester->run(['command' => 'list', '--quiet' => true]); + $this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed'); + $this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if --quiet is passed'); + + $tester->run(['command' => 'list', '-q' => true]); + $this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed'); + $this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if -q is passed'); + + $tester->run(['command' => 'list', '--verbose' => true]); + $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed'); + + $tester->run(['command' => 'list', '--verbose' => 1]); + $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose=1 is passed'); + + $tester->run(['command' => 'list', '--verbose' => 2]); + $this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to very verbose if --verbose=2 is passed'); + + $tester->run(['command' => 'list', '--verbose' => 3]); + $this->assertSame(Output::VERBOSITY_DEBUG, $tester->getOutput()->getVerbosity(), '->run() sets the output to debug if --verbose=3 is passed'); + + $tester->run(['command' => 'list', '--verbose' => 4]); + $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if unknown --verbose level is passed'); + + $tester->run(['command' => 'list', '-v' => true]); + $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed'); + + $tester->run(['command' => 'list', '-vv' => true]); + $this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed'); + + $tester->run(['command' => 'list', '-vvv' => true]); + $this->assertSame(Output::VERBOSITY_DEBUG, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed'); + + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + $application->add(new \FooCommand()); + $tester = new ApplicationTester($application); + + $tester->run(['command' => 'foo:bar', '--no-interaction' => true], ['decorated' => false]); + $this->assertSame('called'.\PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if --no-interaction is passed'); + + $tester->run(['command' => 'foo:bar', '-n' => true], ['decorated' => false]); + $this->assertSame('called'.\PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if -n is passed'); + } + + public function testRunWithGlobalOptionAndNoCommand() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + $application->getDefinition()->addOption(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)); + + $output = new StreamOutput(fopen('php://memory', 'w', false)); + $input = new ArgvInput(['cli.php', '--foo', 'bar']); + + $this->assertSame(0, $application->run($input, $output)); + } + + /** + * Issue #9285. + * + * If the "verbose" option is just before an argument in ArgvInput, + * an argument value should not be treated as verbosity value. + * This test will fail with "Not enough arguments." if broken + */ + public function testVerboseValueNotBreakArguments() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + $application->add(new \FooCommand()); + + $output = new StreamOutput(fopen('php://memory', 'w', false)); + + $input = new ArgvInput(['cli.php', '-v', 'foo:bar']); + $application->run($input, $output); + + $this->addToAssertionCount(1); + + $input = new ArgvInput(['cli.php', '--verbose', 'foo:bar']); + $application->run($input, $output); + + $this->addToAssertionCount(1); + } + + public function testRunReturnsIntegerExitCode() + { + $exception = new \Exception('', 4); + + $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['doRun'])->getMock(); + $application->setAutoExit(false); + $application->expects($this->once()) + ->method('doRun') + ->willThrowException($exception); + + $exitCode = $application->run(new ArrayInput([]), new NullOutput()); + + $this->assertSame(4, $exitCode, '->run() returns integer exit code extracted from raised exception'); + } + + public function testRunDispatchesIntegerExitCode() + { + $passedRightValue = false; + + // We can assume here that some other test asserts that the event is dispatched at all + $dispatcher = new EventDispatcher(); + $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) { + $passedRightValue = (4 === $event->getExitCode()); + }); + + $application = new Application(); + $application->setDispatcher($dispatcher); + $application->setAutoExit(false); + + $application->register('test')->setCode(function (InputInterface $input, OutputInterface $output) { + throw new \Exception('', 4); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'test']); + + $this->assertTrue($passedRightValue, '-> exit code 4 was passed in the console.terminate event'); + } + + public function testRunReturnsExitCodeOneForExceptionCodeZero() + { + $exception = new \Exception('', 0); + + $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['doRun'])->getMock(); + $application->setAutoExit(false); + $application->expects($this->once()) + ->method('doRun') + ->willThrowException($exception); + + $exitCode = $application->run(new ArrayInput([]), new NullOutput()); + + $this->assertSame(1, $exitCode, '->run() returns exit code 1 when exception code is 0'); + } + + public function testRunDispatchesExitCodeOneForExceptionCodeZero() + { + $passedRightValue = false; + + // We can assume here that some other test asserts that the event is dispatched at all + $dispatcher = new EventDispatcher(); + $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) { + $passedRightValue = (1 === $event->getExitCode()); + }); + + $application = new Application(); + $application->setDispatcher($dispatcher); + $application->setAutoExit(false); + + $application->register('test')->setCode(function (InputInterface $input, OutputInterface $output) { + throw new \Exception(); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'test']); + + $this->assertTrue($passedRightValue, '-> exit code 1 was passed in the console.terminate event'); + } + + public function testAddingOptionWithDuplicateShortcut() + { + $this->expectException('LogicException'); + $this->expectExceptionMessage('An option with shortcut "e" already exists.'); + $dispatcher = new EventDispatcher(); + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + $application->setDispatcher($dispatcher); + + $application->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'Environment')); + + $application + ->register('foo') + ->setAliases(['f']) + ->setDefinition([new InputOption('survey', 'e', InputOption::VALUE_REQUIRED, 'My option with a shortcut.')]) + ->setCode(function (InputInterface $input, OutputInterface $output) {}) + ; + + $input = new ArrayInput(['command' => 'foo']); + $output = new NullOutput(); + + $application->run($input, $output); + } + + /** + * @dataProvider getAddingAlreadySetDefinitionElementData + */ + public function testAddingAlreadySetDefinitionElementData($def) + { + $this->expectException('LogicException'); + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + $application + ->register('foo') + ->setDefinition([$def]) + ->setCode(function (InputInterface $input, OutputInterface $output) {}) + ; + + $input = new ArrayInput(['command' => 'foo']); + $output = new NullOutput(); + $application->run($input, $output); + } + + public function getAddingAlreadySetDefinitionElementData() + { + return [ + [new InputArgument('command', InputArgument::REQUIRED)], + [new InputOption('quiet', '', InputOption::VALUE_NONE)], + [new InputOption('query', 'q', InputOption::VALUE_NONE)], + ]; + } + + public function testGetDefaultHelperSetReturnsDefaultValues() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $helperSet = $application->getHelperSet(); + + $this->assertTrue($helperSet->has('formatter')); + } + + public function testAddingSingleHelperSetOverwritesDefaultValues() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $application->setHelperSet(new HelperSet([new FormatterHelper()])); + + $helperSet = $application->getHelperSet(); + + $this->assertTrue($helperSet->has('formatter')); + + // no other default helper set should be returned + $this->assertFalse($helperSet->has('dialog')); + $this->assertFalse($helperSet->has('progress')); + } + + public function testOverwritingDefaultHelperSetOverwritesDefaultValues() + { + $application = new CustomApplication(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $application->setHelperSet(new HelperSet([new FormatterHelper()])); + + $helperSet = $application->getHelperSet(); + + $this->assertTrue($helperSet->has('formatter')); + + // no other default helper set should be returned + $this->assertFalse($helperSet->has('dialog')); + $this->assertFalse($helperSet->has('progress')); + } + + public function testGetDefaultInputDefinitionReturnsDefaultValues() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $inputDefinition = $application->getDefinition(); + + $this->assertTrue($inputDefinition->hasArgument('command')); + + $this->assertTrue($inputDefinition->hasOption('help')); + $this->assertTrue($inputDefinition->hasOption('quiet')); + $this->assertTrue($inputDefinition->hasOption('verbose')); + $this->assertTrue($inputDefinition->hasOption('version')); + $this->assertTrue($inputDefinition->hasOption('ansi')); + $this->assertTrue($inputDefinition->hasOption('no-ansi')); + $this->assertTrue($inputDefinition->hasOption('no-interaction')); + } + + public function testOverwritingDefaultInputDefinitionOverwritesDefaultValues() + { + $application = new CustomApplication(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $inputDefinition = $application->getDefinition(); + + // check whether the default arguments and options are not returned any more + $this->assertFalse($inputDefinition->hasArgument('command')); + + $this->assertFalse($inputDefinition->hasOption('help')); + $this->assertFalse($inputDefinition->hasOption('quiet')); + $this->assertFalse($inputDefinition->hasOption('verbose')); + $this->assertFalse($inputDefinition->hasOption('version')); + $this->assertFalse($inputDefinition->hasOption('ansi')); + $this->assertFalse($inputDefinition->hasOption('no-ansi')); + $this->assertFalse($inputDefinition->hasOption('no-interaction')); + + $this->assertTrue($inputDefinition->hasOption('custom')); + } + + public function testSettingCustomInputDefinitionOverwritesDefaultValues() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $application->setDefinition(new InputDefinition([new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.')])); + + $inputDefinition = $application->getDefinition(); + + // check whether the default arguments and options are not returned any more + $this->assertFalse($inputDefinition->hasArgument('command')); + + $this->assertFalse($inputDefinition->hasOption('help')); + $this->assertFalse($inputDefinition->hasOption('quiet')); + $this->assertFalse($inputDefinition->hasOption('verbose')); + $this->assertFalse($inputDefinition->hasOption('version')); + $this->assertFalse($inputDefinition->hasOption('ansi')); + $this->assertFalse($inputDefinition->hasOption('no-ansi')); + $this->assertFalse($inputDefinition->hasOption('no-interaction')); + + $this->assertTrue($inputDefinition->hasOption('custom')); + } + + public function testRunWithDispatcher() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setDispatcher($this->getDispatcher()); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('foo.'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo']); + $this->assertEquals('before.foo.after.'.\PHP_EOL, $tester->getDisplay()); + } + + public function testRunWithExceptionAndDispatcher() + { + $this->expectException('LogicException'); + $this->expectExceptionMessage('error'); + $application = new Application(); + $application->setDispatcher($this->getDispatcher()); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + throw new \RuntimeException('foo'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo']); + } + + public function testRunDispatchesAllEventsWithException() + { + $application = new Application(); + $application->setDispatcher($this->getDispatcher()); + $application->setAutoExit(false); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('foo.'); + + throw new \RuntimeException('foo'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo']); + $this->assertStringContainsString('before.foo.error.after.', $tester->getDisplay()); + } + + public function testRunDispatchesAllEventsWithExceptionInListener() + { + $dispatcher = $this->getDispatcher(); + $dispatcher->addListener('console.command', function () { + throw new \RuntimeException('foo'); + }); + + $application = new Application(); + $application->setDispatcher($dispatcher); + $application->setAutoExit(false); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('foo.'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo']); + $this->assertStringContainsString('before.error.after.', $tester->getDisplay()); + } + + /** + * @requires PHP 7 + */ + public function testRunWithError() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('dym.'); + + throw new \Error('dymerr'); + }); + + $tester = new ApplicationTester($application); + + try { + $tester->run(['command' => 'dym']); + $this->fail('Error expected.'); + } catch (\Error $e) { + $this->assertSame('dymerr', $e->getMessage()); + } + } + + public function testRunAllowsErrorListenersToSilenceTheException() + { + $dispatcher = $this->getDispatcher(); + $dispatcher->addListener('console.error', function (ConsoleErrorEvent $event) { + $event->getOutput()->write('silenced.'); + + $event->setExitCode(0); + }); + + $dispatcher->addListener('console.command', function () { + throw new \RuntimeException('foo'); + }); + + $application = new Application(); + $application->setDispatcher($dispatcher); + $application->setAutoExit(false); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('foo.'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo']); + $this->assertStringContainsString('before.error.silenced.after.', $tester->getDisplay()); + $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $tester->getStatusCode()); + } + + public function testConsoleErrorEventIsTriggeredOnCommandNotFound() + { + $dispatcher = new EventDispatcher(); + $dispatcher->addListener('console.error', function (ConsoleErrorEvent $event) { + $this->assertNull($event->getCommand()); + $this->assertInstanceOf(CommandNotFoundException::class, $event->getError()); + $event->getOutput()->write('silenced command not found'); + }); + + $application = new Application(); + $application->setDispatcher($dispatcher); + $application->setAutoExit(false); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'unknown']); + $this->assertStringContainsString('silenced command not found', $tester->getDisplay()); + $this->assertEquals(1, $tester->getStatusCode()); + } + + /** + * @group legacy + * @expectedDeprecation The "ConsoleEvents::EXCEPTION" event is deprecated since Symfony 3.3 and will be removed in 4.0. Listen to the "ConsoleEvents::ERROR" event instead. + */ + public function testLegacyExceptionListenersAreStillTriggered() + { + $dispatcher = $this->getDispatcher(); + $dispatcher->addListener('console.exception', function (ConsoleExceptionEvent $event) { + $event->getOutput()->write('caught.'); + + $event->setException(new \RuntimeException('replaced in caught.')); + }); + + $application = new Application(); + $application->setDispatcher($dispatcher); + $application->setAutoExit(false); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + throw new \RuntimeException('foo'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo']); + $this->assertStringContainsString('before.caught.error.after.', $tester->getDisplay()); + $this->assertStringContainsString('replaced in caught.', $tester->getDisplay()); + } + + /** + * @requires PHP 7 + */ + public function testErrorIsRethrownIfNotHandledByConsoleErrorEvent() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + $application->setDispatcher(new EventDispatcher()); + + $application->register('dym')->setCode(function () { + throw new \Error('Something went wrong.'); + }); + + $tester = new ApplicationTester($application); + + try { + $tester->run(['command' => 'dym']); + $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.'); + } catch (\Error $e) { + $this->assertSame('Something went wrong.', $e->getMessage()); + } + } + + /** + * @requires PHP 7 + */ + public function testRunWithErrorAndDispatcher() + { + $this->expectException('LogicException'); + $this->expectExceptionMessage('error'); + $application = new Application(); + $application->setDispatcher($this->getDispatcher()); + $application->setAutoExit(false); + $application->setCatchExceptions(false); + + $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('dym.'); + + throw new \Error('dymerr'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'dym']); + $this->assertStringContainsString('before.dym.error.after.', $tester->getDisplay(), 'The PHP Error did not dispached events'); + } + + /** + * @requires PHP 7 + */ + public function testRunDispatchesAllEventsWithError() + { + $application = new Application(); + $application->setDispatcher($this->getDispatcher()); + $application->setAutoExit(false); + + $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('dym.'); + + throw new \Error('dymerr'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'dym']); + $this->assertStringContainsString('before.dym.error.after.', $tester->getDisplay(), 'The PHP Error did not dispached events'); + } + + /** + * @requires PHP 7 + */ + public function testRunWithErrorFailingStatusCode() + { + $application = new Application(); + $application->setDispatcher($this->getDispatcher()); + $application->setAutoExit(false); + + $application->register('dus')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('dus.'); + + throw new \Error('duserr'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'dus']); + $this->assertSame(1, $tester->getStatusCode(), 'Status code should be 1'); + } + + public function testRunWithDispatcherSkippingCommand() + { + $application = new Application(); + $application->setDispatcher($this->getDispatcher(true)); + $application->setAutoExit(false); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('foo.'); + }); + + $tester = new ApplicationTester($application); + $exitCode = $tester->run(['command' => 'foo']); + $this->assertStringContainsString('before.after.', $tester->getDisplay()); + $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $exitCode); + } + + public function testRunWithDispatcherAccessingInputOptions() + { + $noInteractionValue = null; + $quietValue = null; + + $dispatcher = $this->getDispatcher(); + $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use (&$noInteractionValue, &$quietValue) { + $input = $event->getInput(); + + $noInteractionValue = $input->getOption('no-interaction'); + $quietValue = $input->getOption('quiet'); + }); + + $application = new Application(); + $application->setDispatcher($dispatcher); + $application->setAutoExit(false); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('foo.'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo', '--no-interaction' => true]); + + $this->assertTrue($noInteractionValue); + $this->assertFalse($quietValue); + } + + public function testRunWithDispatcherAddingInputOptions() + { + $extraValue = null; + + $dispatcher = $this->getDispatcher(); + $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use (&$extraValue) { + $definition = $event->getCommand()->getDefinition(); + $input = $event->getInput(); + + $definition->addOption(new InputOption('extra', null, InputOption::VALUE_REQUIRED)); + $input->bind($definition); + + $extraValue = $input->getOption('extra'); + }); + + $application = new Application(); + $application->setDispatcher($dispatcher); + $application->setAutoExit(false); + + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('foo.'); + }); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'foo', '--extra' => 'some test value']); + + $this->assertEquals('some test value', $extraValue); + } + + /** + * @group legacy + */ + public function testTerminalDimensions() + { + $application = new Application(); + $originalDimensions = $application->getTerminalDimensions(); + $this->assertCount(2, $originalDimensions); + + $width = 80; + if ($originalDimensions[0] == $width) { + $width = 100; + } + + $application->setTerminalDimensions($width, 80); + $this->assertSame([$width, 80], $application->getTerminalDimensions()); + } + + public function testSetRunCustomDefaultCommand() + { + $command = new \FooCommand(); + + $application = new Application(); + $application->setAutoExit(false); + $application->add($command); + $application->setDefaultCommand($command->getName()); + + $tester = new ApplicationTester($application); + $tester->run([], ['interactive' => false]); + $this->assertEquals('called'.\PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); + + $application = new CustomDefaultCommandApplication(); + $application->setAutoExit(false); + + $tester = new ApplicationTester($application); + $tester->run([], ['interactive' => false]); + + $this->assertEquals('called'.\PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); + } + + public function testSetRunCustomDefaultCommandWithOption() + { + $command = new \FooOptCommand(); + + $application = new Application(); + $application->setAutoExit(false); + $application->add($command); + $application->setDefaultCommand($command->getName()); + + $tester = new ApplicationTester($application); + $tester->run(['--fooopt' => 'opt'], ['interactive' => false]); + + $this->assertEquals('called'.\PHP_EOL.'opt'.\PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); + } + + public function testSetRunCustomSingleCommand() + { + $command = new \FooCommand(); + + $application = new Application(); + $application->setAutoExit(false); + $application->add($command); + $application->setDefaultCommand($command->getName(), true); + + $tester = new ApplicationTester($application); + + $tester->run([]); + $this->assertStringContainsString('called', $tester->getDisplay()); + + $tester->run(['--help' => true]); + $this->assertStringContainsString('The foo:bar command', $tester->getDisplay()); + } + + public function testRunLazyCommandService() + { + $container = new ContainerBuilder(); + $container->addCompilerPass(new AddConsoleCommandPass()); + $container + ->register('lazy-command', LazyCommand::class) + ->addTag('console.command', ['command' => 'lazy:command']) + ->addTag('console.command', ['command' => 'lazy:alias']) + ->addTag('console.command', ['command' => 'lazy:alias2']); + $container->compile(); + + $application = new Application(); + $application->setCommandLoader($container->get('console.command_loader')); + $application->setAutoExit(false); + + $tester = new ApplicationTester($application); + + $tester->run(['command' => 'lazy:command']); + $this->assertSame("lazy-command called\n", $tester->getDisplay(true)); + + $tester->run(['command' => 'lazy:alias']); + $this->assertSame("lazy-command called\n", $tester->getDisplay(true)); + + $tester->run(['command' => 'lazy:alias2']); + $this->assertSame("lazy-command called\n", $tester->getDisplay(true)); + + $command = $application->get('lazy:command'); + $this->assertSame(['lazy:alias', 'lazy:alias2'], $command->getAliases()); + } + + public function testGetDisabledLazyCommand() + { + $this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException'); + $application = new Application(); + $application->setCommandLoader(new FactoryCommandLoader(['disabled' => function () { return new DisabledCommand(); }])); + $application->get('disabled'); + } + + public function testHasReturnsFalseForDisabledLazyCommand() + { + $application = new Application(); + $application->setCommandLoader(new FactoryCommandLoader(['disabled' => function () { return new DisabledCommand(); }])); + $this->assertFalse($application->has('disabled')); + } + + public function testAllExcludesDisabledLazyCommand() + { + $application = new Application(); + $application->setCommandLoader(new FactoryCommandLoader(['disabled' => function () { return new DisabledCommand(); }])); + $this->assertArrayNotHasKey('disabled', $application->all()); + } + + public function testFindAlternativesDoesNotLoadSameNamespaceCommandsOnExactMatch() + { + $application = new Application(); + $application->setAutoExit(false); + + $loaded = []; + + $application->setCommandLoader(new FactoryCommandLoader([ + 'foo:bar' => function () use (&$loaded) { + $loaded['foo:bar'] = true; + + return (new Command('foo:bar'))->setCode(function () {}); + }, + 'foo' => function () use (&$loaded) { + $loaded['foo'] = true; + + return (new Command('foo'))->setCode(function () {}); + }, + ])); + + $application->run(new ArrayInput(['command' => 'foo']), new NullOutput()); + + $this->assertSame(['foo' => true], $loaded); + } + + protected function getDispatcher($skipCommand = false) + { + $dispatcher = new EventDispatcher(); + $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use ($skipCommand) { + $event->getOutput()->write('before.'); + + if ($skipCommand) { + $event->disableCommand(); + } + }); + $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($skipCommand) { + $event->getOutput()->writeln('after.'); + + if (!$skipCommand) { + $event->setExitCode(ConsoleCommandEvent::RETURN_CODE_DISABLED); + } + }); + $dispatcher->addListener('console.error', function (ConsoleErrorEvent $event) { + $event->getOutput()->write('error.'); + + $event->setError(new \LogicException('error.', $event->getExitCode(), $event->getError())); + }); + + return $dispatcher; + } + + /** + * @requires PHP 7 + */ + public function testErrorIsRethrownIfNotHandledByConsoleErrorEventWithCatchingEnabled() + { + $application = new Application(); + $application->setAutoExit(false); + $application->setDispatcher(new EventDispatcher()); + + $application->register('dym')->setCode(function () { + throw new \Error('Something went wrong.'); + }); + + $tester = new ApplicationTester($application); + + try { + $tester->run(['command' => 'dym']); + $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.'); + } catch (\Error $e) { + $this->assertSame('Something went wrong.', $e->getMessage()); + } + } + + public function testCommandNameMismatchWithCommandLoaderKeyThrows() + { + $this->expectException(CommandNotFoundException::class); + $this->expectExceptionMessage('The "test" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".'); + + $app = new Application(); + $loader = new FactoryCommandLoader([ + 'test' => static function () { return new Command('test-command'); }, + ]); + + $app->setCommandLoader($loader); + $app->get('test'); + } +} + +class CustomApplication extends Application +{ + /** + * Overwrites the default input definition. + * + * @return InputDefinition An InputDefinition instance + */ + protected function getDefaultInputDefinition() + { + return new InputDefinition([new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.')]); + } + + /** + * Gets the default helper set with the helpers that should always be available. + * + * @return HelperSet A HelperSet instance + */ + protected function getDefaultHelperSet() + { + return new HelperSet([new FormatterHelper()]); + } +} + +class CustomDefaultCommandApplication extends Application +{ + /** + * Overwrites the constructor in order to set a different default command. + */ + public function __construct() + { + parent::__construct(); + + $command = new \FooCommand(); + $this->add($command); + $this->setDefaultCommand($command->getName()); + } +} + +class LazyCommand extends Command +{ + public function execute(InputInterface $input, OutputInterface $output) + { + $output->writeln('lazy-command called'); + } +} + +class DisabledCommand extends Command +{ + public function isEnabled() + { + return false; + } +} diff --git a/app/vendor/symfony/console/Tests/Command/CommandTest.php b/app/vendor/symfony/console/Tests/Command/CommandTest.php new file mode 100644 index 000000000..7421c09db --- /dev/null +++ b/app/vendor/symfony/console/Tests/Command/CommandTest.php @@ -0,0 +1,430 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tests\Command; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Helper\FormatterHelper; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Input\StringInput; +use Symfony\Component\Console\Output\NullOutput; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Tester\CommandTester; + +class CommandTest extends TestCase +{ + protected static $fixturesPath; + + public static function setUpBeforeClass() + { + self::$fixturesPath = __DIR__.'/../Fixtures/'; + require_once self::$fixturesPath.'/TestCommand.php'; + } + + public function testConstructor() + { + $command = new Command('foo:bar'); + $this->assertEquals('foo:bar', $command->getName(), '__construct() takes the command name as its first argument'); + } + + public function testCommandNameCannotBeEmpty() + { + $this->expectException('LogicException'); + $this->expectExceptionMessage('The command defined in "Symfony\Component\Console\Command\Command" cannot have an empty name.'); + (new Application())->add(new Command()); + } + + public function testSetApplication() + { + $application = new Application(); + $command = new \TestCommand(); + $command->setApplication($application); + $this->assertEquals($application, $command->getApplication(), '->setApplication() sets the current application'); + $this->assertEquals($application->getHelperSet(), $command->getHelperSet()); + } + + public function testSetApplicationNull() + { + $command = new \TestCommand(); + $command->setApplication(null); + $this->assertNull($command->getHelperSet()); + } + + public function testSetGetDefinition() + { + $command = new \TestCommand(); + $ret = $command->setDefinition($definition = new InputDefinition()); + $this->assertEquals($command, $ret, '->setDefinition() implements a fluent interface'); + $this->assertEquals($definition, $command->getDefinition(), '->setDefinition() sets the current InputDefinition instance'); + $command->setDefinition([new InputArgument('foo'), new InputOption('bar')]); + $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument'); + $this->assertTrue($command->getDefinition()->hasOption('bar'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument'); + $command->setDefinition(new InputDefinition()); + } + + public function testAddArgument() + { + $command = new \TestCommand(); + $ret = $command->addArgument('foo'); + $this->assertEquals($command, $ret, '->addArgument() implements a fluent interface'); + $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->addArgument() adds an argument to the command'); + } + + public function testAddOption() + { + $command = new \TestCommand(); + $ret = $command->addOption('foo'); + $this->assertEquals($command, $ret, '->addOption() implements a fluent interface'); + $this->assertTrue($command->getDefinition()->hasOption('foo'), '->addOption() adds an option to the command'); + } + + public function testSetHidden() + { + $command = new \TestCommand(); + $command->setHidden(true); + $this->assertTrue($command->isHidden()); + } + + public function testGetNamespaceGetNameSetName() + { + $command = new \TestCommand(); + $this->assertEquals('namespace:name', $command->getName(), '->getName() returns the command name'); + $command->setName('foo'); + $this->assertEquals('foo', $command->getName(), '->setName() sets the command name'); + + $ret = $command->setName('foobar:bar'); + $this->assertEquals($command, $ret, '->setName() implements a fluent interface'); + $this->assertEquals('foobar:bar', $command->getName(), '->setName() sets the command name'); + } + + /** + * @dataProvider provideInvalidCommandNames + */ + public function testInvalidCommandNames($name) + { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage(sprintf('Command name "%s" is invalid.', $name)); + + $command = new \TestCommand(); + $command->setName($name); + } + + public function provideInvalidCommandNames() + { + return [ + [''], + ['foo:'], + ]; + } + + public function testGetSetDescription() + { + $command = new \TestCommand(); + $this->assertEquals('description', $command->getDescription(), '->getDescription() returns the description'); + $ret = $command->setDescription('description1'); + $this->assertEquals($command, $ret, '->setDescription() implements a fluent interface'); + $this->assertEquals('description1', $command->getDescription(), '->setDescription() sets the description'); + } + + public function testGetSetHelp() + { + $command = new \TestCommand(); + $this->assertEquals('help', $command->getHelp(), '->getHelp() returns the help'); + $ret = $command->setHelp('help1'); + $this->assertEquals($command, $ret, '->setHelp() implements a fluent interface'); + $this->assertEquals('help1', $command->getHelp(), '->setHelp() sets the help'); + $command->setHelp(''); + $this->assertEquals('', $command->getHelp(), '->getHelp() does not fall back to the description'); + } + + public function testGetProcessedHelp() + { + $command = new \TestCommand(); + $command->setHelp('The %command.name% command does... Example: php %command.full_name%.'); + $this->assertStringContainsString('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly'); + $this->assertStringNotContainsString('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name%'); + + $command = new \TestCommand(); + $command->setHelp(''); + $this->assertStringContainsString('description', $command->getProcessedHelp(), '->getProcessedHelp() falls back to the description'); + + $command = new \TestCommand(); + $command->setHelp('The %command.name% command does... Example: php %command.full_name%.'); + $application = new Application(); + $application->add($command); + $application->setDefaultCommand('namespace:name', true); + $this->assertStringContainsString('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly in single command applications'); + $this->assertStringNotContainsString('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name% in single command applications'); + } + + public function testGetSetAliases() + { + $command = new \TestCommand(); + $this->assertEquals(['name'], $command->getAliases(), '->getAliases() returns the aliases'); + $ret = $command->setAliases(['name1']); + $this->assertEquals($command, $ret, '->setAliases() implements a fluent interface'); + $this->assertEquals(['name1'], $command->getAliases(), '->setAliases() sets the aliases'); + } + + public function testSetAliasesNull() + { + $command = new \TestCommand(); + $this->expectException('InvalidArgumentException'); + $command->setAliases(null); + } + + public function testGetSynopsis() + { + $command = new \TestCommand(); + $command->addOption('foo'); + $command->addArgument('bar'); + $this->assertEquals('namespace:name [--foo] [--] []', $command->getSynopsis(), '->getSynopsis() returns the synopsis'); + } + + public function testAddGetUsages() + { + $command = new \TestCommand(); + $command->addUsage('foo1'); + $command->addUsage('foo2'); + $this->assertContains('namespace:name foo1', $command->getUsages()); + $this->assertContains('namespace:name foo2', $command->getUsages()); + } + + public function testGetHelper() + { + $application = new Application(); + $command = new \TestCommand(); + $command->setApplication($application); + $formatterHelper = new FormatterHelper(); + $this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->getHelper() returns the correct helper'); + } + + public function testGetHelperWithoutHelperSet() + { + $this->expectException('LogicException'); + $this->expectExceptionMessage('Cannot retrieve helper "formatter" because there is no HelperSet defined.'); + $command = new \TestCommand(); + $command->getHelper('formatter'); + } + + public function testMergeApplicationDefinition() + { + $application1 = new Application(); + $application1->getDefinition()->addArguments([new InputArgument('foo')]); + $application1->getDefinition()->addOptions([new InputOption('bar')]); + $command = new \TestCommand(); + $command->setApplication($application1); + $command->setDefinition($definition = new InputDefinition([new InputArgument('bar'), new InputOption('foo')])); + + $r = new \ReflectionObject($command); + $m = $r->getMethod('mergeApplicationDefinition'); + $m->setAccessible(true); + $m->invoke($command); + $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition() merges the application arguments and the command arguments'); + $this->assertTrue($command->getDefinition()->hasArgument('bar'), '->mergeApplicationDefinition() merges the application arguments and the command arguments'); + $this->assertTrue($command->getDefinition()->hasOption('foo'), '->mergeApplicationDefinition() merges the application options and the command options'); + $this->assertTrue($command->getDefinition()->hasOption('bar'), '->mergeApplicationDefinition() merges the application options and the command options'); + + $m->invoke($command); + $this->assertEquals(3, $command->getDefinition()->getArgumentCount(), '->mergeApplicationDefinition() does not try to merge twice the application arguments and options'); + } + + public function testMergeApplicationDefinitionWithoutArgsThenWithArgsAddsArgs() + { + $application1 = new Application(); + $application1->getDefinition()->addArguments([new InputArgument('foo')]); + $application1->getDefinition()->addOptions([new InputOption('bar')]); + $command = new \TestCommand(); + $command->setApplication($application1); + $command->setDefinition($definition = new InputDefinition([])); + + $r = new \ReflectionObject($command); + $m = $r->getMethod('mergeApplicationDefinition'); + $m->setAccessible(true); + $m->invoke($command, false); + $this->assertTrue($command->getDefinition()->hasOption('bar'), '->mergeApplicationDefinition(false) merges the application and the command options'); + $this->assertFalse($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition(false) does not merge the application arguments'); + + $m->invoke($command, true); + $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition(true) merges the application arguments and the command arguments'); + + $m->invoke($command); + $this->assertEquals(2, $command->getDefinition()->getArgumentCount(), '->mergeApplicationDefinition() does not try to merge twice the application arguments'); + } + + public function testRunInteractive() + { + $tester = new CommandTester(new \TestCommand()); + + $tester->execute([], ['interactive' => true]); + + $this->assertEquals('interact called'.\PHP_EOL.'execute called'.\PHP_EOL, $tester->getDisplay(), '->run() calls the interact() method if the input is interactive'); + } + + public function testRunNonInteractive() + { + $tester = new CommandTester(new \TestCommand()); + + $tester->execute([], ['interactive' => false]); + + $this->assertEquals('execute called'.\PHP_EOL, $tester->getDisplay(), '->run() does not call the interact() method if the input is not interactive'); + } + + public function testExecuteMethodNeedsToBeOverridden() + { + $this->expectException('LogicException'); + $this->expectExceptionMessage('You must override the execute() method in the concrete command class.'); + $command = new Command('foo'); + $command->run(new StringInput(''), new NullOutput()); + } + + public function testRunWithInvalidOption() + { + $this->expectException('Symfony\Component\Console\Exception\InvalidOptionException'); + $this->expectExceptionMessage('The "--bar" option does not exist.'); + $command = new \TestCommand(); + $tester = new CommandTester($command); + $tester->execute(['--bar' => true]); + } + + public function testRunReturnsIntegerExitCode() + { + $command = new \TestCommand(); + $exitCode = $command->run(new StringInput(''), new NullOutput()); + $this->assertSame(0, $exitCode, '->run() returns integer exit code (treats null as 0)'); + + $command = $this->getMockBuilder('TestCommand')->setMethods(['execute'])->getMock(); + $command->expects($this->once()) + ->method('execute') + ->willReturn('2.3'); + $exitCode = $command->run(new StringInput(''), new NullOutput()); + $this->assertSame(2, $exitCode, '->run() returns integer exit code (casts numeric to int)'); + } + + public function testRunWithApplication() + { + $command = new \TestCommand(); + $command->setApplication(new Application()); + $exitCode = $command->run(new StringInput(''), new NullOutput()); + + $this->assertSame(0, $exitCode, '->run() returns an integer exit code'); + } + + public function testRunReturnsAlwaysInteger() + { + $command = new \TestCommand(); + + $this->assertSame(0, $command->run(new StringInput(''), new NullOutput())); + } + + public function testRunWithProcessTitle() + { + $command = new \TestCommand(); + $command->setApplication(new Application()); + $command->setProcessTitle('foo'); + $this->assertSame(0, $command->run(new StringInput(''), new NullOutput())); + if (\function_exists('cli_set_process_title')) { + if (null === @cli_get_process_title() && 'Darwin' === \PHP_OS) { + $this->markTestSkipped('Running "cli_get_process_title" as an unprivileged user is not supported on MacOS.'); + } + $this->assertEquals('foo', cli_get_process_title()); + } + } + + public function testSetCode() + { + $command = new \TestCommand(); + $ret = $command->setCode(function (InputInterface $input, OutputInterface $output) { + $output->writeln('from the code...'); + }); + $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); + $tester = new CommandTester($command); + $tester->execute([]); + $this->assertEquals('interact called'.\PHP_EOL.'from the code...'.\PHP_EOL, $tester->getDisplay()); + } + + public function getSetCodeBindToClosureTests() + { + return [ + [true, 'not bound to the command'], + [false, 'bound to the command'], + ]; + } + + /** + * @dataProvider getSetCodeBindToClosureTests + */ + public function testSetCodeBindToClosure($previouslyBound, $expected) + { + $code = createClosure(); + if ($previouslyBound) { + $code = $code->bindTo($this); + } + + $command = new \TestCommand(); + $command->setCode($code); + $tester = new CommandTester($command); + $tester->execute([]); + $this->assertEquals('interact called'.\PHP_EOL.$expected.\PHP_EOL, $tester->getDisplay()); + } + + public function testSetCodeWithStaticClosure() + { + $command = new \TestCommand(); + $command->setCode(self::createClosure()); + $tester = new CommandTester($command); + $tester->execute([]); + + if (\PHP_VERSION_ID < 70000) { + // Cannot bind static closures in PHP 5 + $this->assertEquals('interact called'.\PHP_EOL.'not bound'.\PHP_EOL, $tester->getDisplay()); + } else { + // Can bind static closures in PHP 7 + $this->assertEquals('interact called'.\PHP_EOL.'bound'.\PHP_EOL, $tester->getDisplay()); + } + } + + private static function createClosure() + { + return function (InputInterface $input, OutputInterface $output) { + $output->writeln(isset($this) ? 'bound' : 'not bound'); + }; + } + + public function testSetCodeWithNonClosureCallable() + { + $command = new \TestCommand(); + $ret = $command->setCode([$this, 'callableMethodCommand']); + $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); + $tester = new CommandTester($command); + $tester->execute([]); + $this->assertEquals('interact called'.\PHP_EOL.'from the code...'.\PHP_EOL, $tester->getDisplay()); + } + + public function callableMethodCommand(InputInterface $input, OutputInterface $output) + { + $output->writeln('from the code...'); + } +} + +// In order to get an unbound closure, we should create it outside a class +// scope. +function createClosure() +{ + return function (InputInterface $input, OutputInterface $output) { + $output->writeln($this instanceof Command ? 'bound to the command' : 'not bound to the command'); + }; +} diff --git a/app/vendor/symfony/console/Tests/Command/HelpCommandTest.php b/app/vendor/symfony/console/Tests/Command/HelpCommandTest.php new file mode 100644 index 000000000..5b25550a6 --- /dev/null +++ b/app/vendor/symfony/console/Tests/Command/HelpCommandTest.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tests\Command; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\HelpCommand; +use Symfony\Component\Console\Command\ListCommand; +use Symfony\Component\Console\Tester\CommandTester; + +class HelpCommandTest extends TestCase +{ + public function testExecuteForCommandAlias() + { + $command = new HelpCommand(); + $command->setApplication(new Application()); + $commandTester = new CommandTester($command); + $commandTester->execute(['command_name' => 'li'], ['decorated' => false]); + $this->assertStringContainsString('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias'); + $this->assertStringContainsString('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias'); + $this->assertStringContainsString('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias'); + } + + public function testExecuteForCommand() + { + $command = new HelpCommand(); + $commandTester = new CommandTester($command); + $command->setCommand(new ListCommand()); + $commandTester->execute([], ['decorated' => false]); + $this->assertStringContainsString('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); + $this->assertStringContainsString('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); + $this->assertStringContainsString('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); + } + + public function testExecuteForCommandWithXmlOption() + { + $command = new HelpCommand(); + $commandTester = new CommandTester($command); + $command->setCommand(new ListCommand()); + $commandTester->execute(['--format' => 'xml']); + $this->assertStringContainsString('getDisplay(), '->execute() returns an XML help text if --xml is passed'); + } + + public function testExecuteForApplicationCommand() + { + $application = new Application(); + $commandTester = new CommandTester($application->get('help')); + $commandTester->execute(['command_name' => 'list']); + $this->assertStringContainsString('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); + $this->assertStringContainsString('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); + $this->assertStringContainsString('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); + } + + public function testExecuteForApplicationCommandWithXmlOption() + { + $application = new Application(); + $commandTester = new CommandTester($application->get('help')); + $commandTester->execute(['command_name' => 'list', '--format' => 'xml']); + $this->assertStringContainsString('list [--raw] [--format FORMAT] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); + $this->assertStringContainsString('getDisplay(), '->execute() returns an XML help text if --format=xml is passed'); + } +} diff --git a/app/vendor/symfony/console/Tests/Command/ListCommandTest.php b/app/vendor/symfony/console/Tests/Command/ListCommandTest.php new file mode 100644 index 000000000..3908ca5bb --- /dev/null +++ b/app/vendor/symfony/console/Tests/Command/ListCommandTest.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tests\Command; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Tester\CommandTester; + +class ListCommandTest extends TestCase +{ + public function testExecuteListsCommands() + { + $application = new Application(); + $commandTester = new CommandTester($command = $application->get('list')); + $commandTester->execute(['command' => $command->getName()], ['decorated' => false]); + + $this->assertMatchesRegularExpression('/help\s{2,}Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands'); + } + + public function testExecuteListsCommandsWithXmlOption() + { + $application = new Application(); + $commandTester = new CommandTester($command = $application->get('list')); + $commandTester->execute(['command' => $command->getName(), '--format' => 'xml']); + $this->assertMatchesRegularExpression('/%s', $this->escapeHtml($link), $file, 0 < $line ? ' line '.$line : ''); + } + + /** + * Formats an array as a string. + */ + private function formatArgs(array $args): string + { + $result = []; + foreach ($args as $key => $item) { + if ('object' === $item[0]) { + $formattedValue = sprintf('object(%s)', $this->formatClass($item[1])); + } elseif ('array' === $item[0]) { + $formattedValue = sprintf('array(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); + } elseif ('null' === $item[0]) { + $formattedValue = 'null'; + } elseif ('boolean' === $item[0]) { + $formattedValue = ''.strtolower(var_export($item[1], true)).''; + } elseif ('resource' === $item[0]) { + $formattedValue = 'resource'; + } else { + $formattedValue = str_replace("\n", '', $this->escapeHtml(var_export($item[1], true))); + } + + $result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $this->escapeHtml($key), $formattedValue); + } + + return implode(', ', $result); + } + + /** + * HTML-encodes a string. + */ + private function escapeHtml(string $str): string + { + return htmlspecialchars($str, \ENT_COMPAT | \ENT_SUBSTITUTE, $this->charset); + } + + private function getSymfonyGhostAsSvg(): string + { + return ''.$this->addElementToGhost().''; + } + + private function addElementToGhost(): string + { + if (!isset(self::GHOST_ADDONS[date('m-d')])) { + return ''; + } + + return ''; + } +} diff --git a/app/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php b/app/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php new file mode 100644 index 000000000..64d755134 --- /dev/null +++ b/app/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php @@ -0,0 +1,183 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug\FatalErrorHandler; + +use Composer\Autoload\ClassLoader as ComposerClassLoader; +use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader; +use Symfony\Component\Debug\DebugClassLoader; +use Symfony\Component\Debug\Exception\ClassNotFoundException; +use Symfony\Component\Debug\Exception\FatalErrorException; + +@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ClassNotFoundFatalErrorHandler::class, \Symfony\Component\ErrorHandler\FatalErrorHandler\ClassNotFoundFatalErrorHandler::class), \E_USER_DEPRECATED); + +/** + * ErrorHandler for classes that do not exist. + * + * @author Fabien Potencier + * + * @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\FatalErrorHandler\ClassNotFoundFatalErrorHandler instead. + */ +class ClassNotFoundFatalErrorHandler implements FatalErrorHandlerInterface +{ + /** + * {@inheritdoc} + */ + public function handleError(array $error, FatalErrorException $exception) + { + if (!preg_match('/^(Class|Interface|Trait) [\'"]([^\'"]+)[\'"] not found$/', $error['message'], $matches)) { + return null; + } + $typeName = strtolower($matches[1]); + $fullyQualifiedClassName = $matches[2]; + + if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedClassName, '\\')) { + $className = substr($fullyQualifiedClassName, $namespaceSeparatorIndex + 1); + $namespacePrefix = substr($fullyQualifiedClassName, 0, $namespaceSeparatorIndex); + $message = sprintf('Attempted to load %s "%s" from namespace "%s".', $typeName, $className, $namespacePrefix); + $tail = ' for another namespace?'; + } else { + $className = $fullyQualifiedClassName; + $message = sprintf('Attempted to load %s "%s" from the global namespace.', $typeName, $className); + $tail = '?'; + } + + if ($candidates = $this->getClassCandidates($className)) { + $tail = array_pop($candidates).'"?'; + if ($candidates) { + $tail = ' for e.g. "'.implode('", "', $candidates).'" or "'.$tail; + } else { + $tail = ' for "'.$tail; + } + } + $message .= "\nDid you forget a \"use\" statement".$tail; + + return new ClassNotFoundException($message, $exception); + } + + /** + * Tries to guess the full namespace for a given class name. + * + * By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer + * autoloader (that should cover all common cases). + * + * @param string $class A class name (without its namespace) + * + * @return array An array of possible fully qualified class names + */ + private function getClassCandidates(string $class): array + { + if (!\is_array($functions = spl_autoload_functions())) { + return []; + } + + // find Symfony and Composer autoloaders + $classes = []; + + foreach ($functions as $function) { + if (!\is_array($function)) { + continue; + } + // get class loaders wrapped by DebugClassLoader + if ($function[0] instanceof DebugClassLoader) { + $function = $function[0]->getClassLoader(); + + if (!\is_array($function)) { + continue; + } + } + + if ($function[0] instanceof ComposerClassLoader || $function[0] instanceof SymfonyClassLoader) { + foreach ($function[0]->getPrefixes() as $prefix => $paths) { + foreach ($paths as $path) { + $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix)); + } + } + } + if ($function[0] instanceof ComposerClassLoader) { + foreach ($function[0]->getPrefixesPsr4() as $prefix => $paths) { + foreach ($paths as $path) { + $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix)); + } + } + } + } + + return array_unique($classes); + } + + private function findClassInPath(string $path, string $class, string $prefix): array + { + if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.\dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) { + return []; + } + + $classes = []; + $filename = $class.'.php'; + foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) { + if ($filename == $file->getFileName() && $class = $this->convertFileToClass($path, $file->getPathName(), $prefix)) { + $classes[] = $class; + } + } + + return $classes; + } + + private function convertFileToClass(string $path, string $file, string $prefix): ?string + { + $candidates = [ + // namespaced class + $namespacedClass = str_replace([$path.\DIRECTORY_SEPARATOR, '.php', '/'], ['', '', '\\'], $file), + // namespaced class (with target dir) + $prefix.$namespacedClass, + // namespaced class (with target dir and separator) + $prefix.'\\'.$namespacedClass, + // PEAR class + str_replace('\\', '_', $namespacedClass), + // PEAR class (with target dir) + str_replace('\\', '_', $prefix.$namespacedClass), + // PEAR class (with target dir and separator) + str_replace('\\', '_', $prefix.'\\'.$namespacedClass), + ]; + + if ($prefix) { + $candidates = array_filter($candidates, function ($candidate) use ($prefix) { return 0 === strpos($candidate, $prefix); }); + } + + // We cannot use the autoloader here as most of them use require; but if the class + // is not found, the new autoloader call will require the file again leading to a + // "cannot redeclare class" error. + foreach ($candidates as $candidate) { + if ($this->classExists($candidate)) { + return $candidate; + } + } + + try { + require_once $file; + } catch (\Throwable $e) { + return null; + } + + foreach ($candidates as $candidate) { + if ($this->classExists($candidate)) { + return $candidate; + } + } + + return null; + } + + private function classExists(string $class): bool + { + return class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false); + } +} diff --git a/app/vendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php b/app/vendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php new file mode 100644 index 000000000..cc7a0ffab --- /dev/null +++ b/app/vendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug\FatalErrorHandler; + +use Symfony\Component\Debug\Exception\FatalErrorException; + +@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FatalErrorHandlerInterface::class, \Symfony\Component\ErrorHandler\FatalErrorHandler\FatalErrorHandlerInterface::class), \E_USER_DEPRECATED); + +/** + * Attempts to convert fatal errors to exceptions. + * + * @author Fabien Potencier + * + * @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\FatalErrorHandler\FatalErrorHandlerInterface instead. + */ +interface FatalErrorHandlerInterface +{ + /** + * Attempts to convert an error into an exception. + * + * @param array $error An array as returned by error_get_last() + * + * @return FatalErrorException|null A FatalErrorException instance if the class is able to convert the error, null otherwise + */ + public function handleError(array $error, FatalErrorException $exception); +} diff --git a/app/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php b/app/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php new file mode 100644 index 000000000..95096a9cd --- /dev/null +++ b/app/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php @@ -0,0 +1,88 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug\FatalErrorHandler; + +use Symfony\Component\Debug\Exception\FatalErrorException; +use Symfony\Component\Debug\Exception\UndefinedFunctionException; + +@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedFunctionFatalErrorHandler::class, \Symfony\Component\ErrorHandler\ErrorEnhancer\UndefinedFunctionErrorEnhancer::class), \E_USER_DEPRECATED); + +/** + * ErrorHandler for undefined functions. + * + * @author Fabien Potencier + * + * @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\ErrorEnhancer\UndefinedFunctionErrorEnhancer instead. + */ +class UndefinedFunctionFatalErrorHandler implements FatalErrorHandlerInterface +{ + /** + * {@inheritdoc} + */ + public function handleError(array $error, FatalErrorException $exception) + { + $messageLen = \strlen($error['message']); + $notFoundSuffix = '()'; + $notFoundSuffixLen = \strlen($notFoundSuffix); + if ($notFoundSuffixLen > $messageLen) { + return null; + } + + if (0 !== substr_compare($error['message'], $notFoundSuffix, -$notFoundSuffixLen)) { + return null; + } + + $prefix = 'Call to undefined function '; + $prefixLen = \strlen($prefix); + if (0 !== strpos($error['message'], $prefix)) { + return null; + } + + $fullyQualifiedFunctionName = substr($error['message'], $prefixLen, -$notFoundSuffixLen); + if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedFunctionName, '\\')) { + $functionName = substr($fullyQualifiedFunctionName, $namespaceSeparatorIndex + 1); + $namespacePrefix = substr($fullyQualifiedFunctionName, 0, $namespaceSeparatorIndex); + $message = sprintf('Attempted to call function "%s" from namespace "%s".', $functionName, $namespacePrefix); + } else { + $functionName = $fullyQualifiedFunctionName; + $message = sprintf('Attempted to call function "%s" from the global namespace.', $functionName); + } + + $candidates = []; + foreach (get_defined_functions() as $type => $definedFunctionNames) { + foreach ($definedFunctionNames as $definedFunctionName) { + if (false !== $namespaceSeparatorIndex = strrpos($definedFunctionName, '\\')) { + $definedFunctionNameBasename = substr($definedFunctionName, $namespaceSeparatorIndex + 1); + } else { + $definedFunctionNameBasename = $definedFunctionName; + } + + if ($definedFunctionNameBasename === $functionName) { + $candidates[] = '\\'.$definedFunctionName; + } + } + } + + if ($candidates) { + sort($candidates); + $last = array_pop($candidates).'"?'; + if ($candidates) { + $candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last; + } else { + $candidates = '"'.$last; + } + $message .= "\nDid you mean to call ".$candidates; + } + + return new UndefinedFunctionException($message, $exception); + } +} diff --git a/app/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php b/app/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php new file mode 100644 index 000000000..4f622deec --- /dev/null +++ b/app/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug\FatalErrorHandler; + +use Symfony\Component\Debug\Exception\FatalErrorException; +use Symfony\Component\Debug\Exception\UndefinedMethodException; + +@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedMethodFatalErrorHandler::class, \Symfony\Component\ErrorHandler\ErrorEnhancer\UndefinedMethodErrorEnhancer::class), \E_USER_DEPRECATED); + +/** + * ErrorHandler for undefined methods. + * + * @author Grégoire Pineau + * + * @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\ErrorEnhancer\UndefinedMethodErrorEnhancer instead. + */ +class UndefinedMethodFatalErrorHandler implements FatalErrorHandlerInterface +{ + /** + * {@inheritdoc} + */ + public function handleError(array $error, FatalErrorException $exception) + { + preg_match('/^Call to undefined method (.*)::(.*)\(\)$/', $error['message'], $matches); + if (!$matches) { + return null; + } + + $className = $matches[1]; + $methodName = $matches[2]; + + $message = sprintf('Attempted to call an undefined method named "%s" of class "%s".', $methodName, $className); + + if ('' === $methodName || !class_exists($className) || null === $methods = get_class_methods($className)) { + // failed to get the class or its methods on which an unknown method was called (for example on an anonymous class) + return new UndefinedMethodException($message, $exception); + } + + $candidates = []; + foreach ($methods as $definedMethodName) { + $lev = levenshtein($methodName, $definedMethodName); + if ($lev <= \strlen($methodName) / 3 || false !== strpos($definedMethodName, $methodName)) { + $candidates[] = $definedMethodName; + } + } + + if ($candidates) { + sort($candidates); + $last = array_pop($candidates).'"?'; + if ($candidates) { + $candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last; + } else { + $candidates = '"'.$last; + } + + $message .= "\nDid you mean to call ".$candidates; + } + + return new UndefinedMethodException($message, $exception); + } +} diff --git a/app/vendor/symfony/polyfill-intl-normalizer/LICENSE b/app/vendor/symfony/debug/LICENSE similarity index 96% rename from app/vendor/symfony/polyfill-intl-normalizer/LICENSE rename to app/vendor/symfony/debug/LICENSE index 4cd8bdd30..9ff2d0d63 100644 --- a/app/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ b/app/vendor/symfony/debug/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2004-2021 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/vendor/symfony/debug/README.md b/app/vendor/symfony/debug/README.md new file mode 100644 index 000000000..31a824069 --- /dev/null +++ b/app/vendor/symfony/debug/README.md @@ -0,0 +1,30 @@ +Debug Component +=============== + +**CAUTION**: this component is deprecated since Symfony 4.4. Instead, use the +[ErrorHandler component](https://github.com/symfony/symfony/tree/master/src/Symfony/Component/ErrorHandler). + +----- + +The Debug component provides tools to ease debugging PHP code. + +Getting Started +--------------- + +``` +$ composer require symfony/debug +``` + +```php +use Symfony\Component\Debug\Debug; + +Debug::enable(); +``` + +Resources +--------- + + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/app/vendor/symfony/debug/composer.json b/app/vendor/symfony/debug/composer.json new file mode 100644 index 000000000..01e8f7832 --- /dev/null +++ b/app/vendor/symfony/debug/composer.json @@ -0,0 +1,35 @@ +{ + "name": "symfony/debug", + "type": "library", + "description": "Provides tools to ease debugging PHP code", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1.3", + "psr/log": "^1|^2|^3" + }, + "conflict": { + "symfony/http-kernel": "<3.4" + }, + "require-dev": { + "symfony/http-kernel": "^3.4|^4.0|^5.0" + }, + "autoload": { + "psr-4": { "Symfony\\Component\\Debug\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev" +} diff --git a/app/vendor/symfony/polyfill-intl-grapheme/Grapheme.php b/app/vendor/symfony/polyfill-intl-grapheme/Grapheme.php deleted file mode 100644 index 572da5df6..000000000 --- a/app/vendor/symfony/polyfill-intl-grapheme/Grapheme.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Grapheme; - -\define('SYMFONY_GRAPHEME_CLUSTER_RX', \PCRE_VERSION >= '8.32' ? '\X' : Grapheme::GRAPHEME_CLUSTER_RX); - -/** - * Partial intl implementation in pure PHP. - * - * Implemented: - * - grapheme_extract - Extract a sequence of grapheme clusters from a text buffer, which must be encoded in UTF-8 - * - grapheme_stripos - Find position (in grapheme units) of first occurrence of a case-insensitive string - * - grapheme_stristr - Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack - * - grapheme_strlen - Get string length in grapheme units - * - grapheme_strpos - Find position (in grapheme units) of first occurrence of a string - * - grapheme_strripos - Find position (in grapheme units) of last occurrence of a case-insensitive string - * - grapheme_strrpos - Find position (in grapheme units) of last occurrence of a string - * - grapheme_strstr - Returns part of haystack string from the first occurrence of needle to the end of haystack - * - grapheme_substr - Return part of a string - * - * @author Nicolas Grekas - * - * @internal - */ -final class Grapheme -{ - // (CRLF|([ZWNJ-ZWJ]|T+|L*(LV?V+|LV|LVT)T*|L+|[^Control])[Extend]*|[Control]) - // This regular expression is a work around for http://bugs.exim.org/1279 - public const GRAPHEME_CLUSTER_RX = '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; - - private const CASE_FOLD = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT, $start = 0, &$next = 0) - { - if (0 > $start) { - $start = \strlen($s) + $start; - } - - if (!is_scalar($s)) { - $hasError = false; - set_error_handler(function () use (&$hasError) { $hasError = true; }); - $next = substr($s, $start); - restore_error_handler(); - if ($hasError) { - substr($s, $start); - $s = ''; - } else { - $s = $next; - } - } else { - $s = substr($s, $start); - } - $size = (int) $size; - $type = (int) $type; - $start = (int) $start; - - if (\GRAPHEME_EXTR_COUNT !== $type && \GRAPHEME_EXTR_MAXBYTES !== $type && \GRAPHEME_EXTR_MAXCHARS !== $type) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('grapheme_extract(): Argument #3 ($type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS'); - } - - if (!isset($s[0]) || 0 > $size || 0 > $start) { - return false; - } - if (0 === $size) { - return ''; - } - - $next = $start; - - $s = preg_split('/('.SYMFONY_GRAPHEME_CLUSTER_RX.')/u', "\r\n".$s, $size + 1, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE); - - if (!isset($s[1])) { - return false; - } - - $i = 1; - $ret = ''; - - do { - if (\GRAPHEME_EXTR_COUNT === $type) { - --$size; - } elseif (\GRAPHEME_EXTR_MAXBYTES === $type) { - $size -= \strlen($s[$i]); - } else { - $size -= iconv_strlen($s[$i], 'UTF-8//IGNORE'); - } - - if ($size >= 0) { - $ret .= $s[$i]; - } - } while (isset($s[++$i]) && $size > 0); - - $next += \strlen($ret); - - return $ret; - } - - public static function grapheme_strlen($s) - { - preg_replace('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', '', $s, -1, $len); - - return 0 === $len && '' !== $s ? null : $len; - } - - public static function grapheme_substr($s, $start, $len = null) - { - if (null === $len) { - $len = 2147483647; - } - - preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $s, $s); - - $slen = \count($s[0]); - $start = (int) $start; - - if (0 > $start) { - $start += $slen; - } - if (0 > $start) { - if (\PHP_VERSION_ID < 80000) { - return false; - } - - $start = 0; - } - if ($start >= $slen) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - - $rem = $slen - $start; - - if (0 > $len) { - $len += $rem; - } - if (0 === $len) { - return ''; - } - if (0 > $len) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - if ($len > $rem) { - $len = $rem; - } - - return implode('', \array_slice($s[0], $start, $len)); - } - - public static function grapheme_strpos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 0); - } - - public static function grapheme_stripos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 1); - } - - public static function grapheme_strrpos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 2); - } - - public static function grapheme_strripos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 3); - } - - public static function grapheme_stristr($s, $needle, $beforeNeedle = false) - { - return mb_stristr($s, $needle, $beforeNeedle, 'UTF-8'); - } - - public static function grapheme_strstr($s, $needle, $beforeNeedle = false) - { - return mb_strstr($s, $needle, $beforeNeedle, 'UTF-8'); - } - - private static function grapheme_position($s, $needle, $offset, $mode) - { - $needle = (string) $needle; - if (80000 > \PHP_VERSION_ID && !preg_match('/./us', $needle)) { - return false; - } - $s = (string) $s; - if (!preg_match('/./us', $s)) { - return false; - } - if ($offset > 0) { - $s = self::grapheme_substr($s, $offset); - } elseif ($offset < 0) { - if (2 > $mode) { - $offset += self::grapheme_strlen($s); - $s = self::grapheme_substr($s, $offset); - if (0 > $offset) { - $offset = 0; - } - } elseif (0 > $offset += self::grapheme_strlen($needle)) { - $s = self::grapheme_substr($s, 0, $offset); - $offset = 0; - } else { - $offset = 0; - } - } - - // As UTF-8 is self-synchronizing, and we have ensured the strings are valid UTF-8, - // we can use normal binary string functions here. For case-insensitive searches, - // case fold the strings first. - $caseInsensitive = $mode & 1; - $reverse = $mode & 2; - if ($caseInsensitive) { - // Use the same case folding mode as mbstring does for mb_stripos(). - // Stick to SIMPLE case folding to avoid changing the length of the string, which - // might result in offsets being shifted. - $mode = \defined('MB_CASE_FOLD_SIMPLE') ? \MB_CASE_FOLD_SIMPLE : \MB_CASE_LOWER; - $s = mb_convert_case($s, $mode, 'UTF-8'); - $needle = mb_convert_case($needle, $mode, 'UTF-8'); - - if (!\defined('MB_CASE_FOLD_SIMPLE')) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); - $needle = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $needle); - } - } - if ($reverse) { - $needlePos = strrpos($s, $needle); - } else { - $needlePos = strpos($s, $needle); - } - - return false !== $needlePos ? self::grapheme_strlen(substr($s, 0, $needlePos)) + $offset : false; - } -} diff --git a/app/vendor/symfony/polyfill-intl-grapheme/README.md b/app/vendor/symfony/polyfill-intl-grapheme/README.md deleted file mode 100644 index 77523ea27..000000000 --- a/app/vendor/symfony/polyfill-intl-grapheme/README.md +++ /dev/null @@ -1,31 +0,0 @@ -Symfony Polyfill / Intl: Grapheme -================================= - -This component provides a partial, native PHP implementation of the -[Grapheme functions](https://php.net/intl.grapheme) from the -[Intl](https://php.net/intl) extension. - -- [`grapheme_extract`](https://php.net/grapheme_extract): Extract a sequence of grapheme - clusters from a text buffer, which must be encoded in UTF-8 -- [`grapheme_stripos`](https://php.net/grapheme_stripos): Find position (in grapheme units) - of first occurrence of a case-insensitive string -- [`grapheme_stristr`](https://php.net/grapheme_stristr): Returns part of haystack string - from the first occurrence of case-insensitive needle to the end of haystack -- [`grapheme_strlen`](https://php.net/grapheme_strlen): Get string length in grapheme units -- [`grapheme_strpos`](https://php.net/grapheme_strpos): Find position (in grapheme units) - of first occurrence of a string -- [`grapheme_strripos`](https://php.net/grapheme_strripos): Find position (in grapheme units) - of last occurrence of a case-insensitive string -- [`grapheme_strrpos`](https://php.net/grapheme_strrpos): Find position (in grapheme units) - of last occurrence of a string -- [`grapheme_strstr`](https://php.net/grapheme_strstr): Returns part of haystack string from - the first occurrence of needle to the end of haystack -- [`grapheme_substr`](https://php.net/grapheme_substr): Return part of a string - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/app/vendor/symfony/polyfill-intl-grapheme/bootstrap.php b/app/vendor/symfony/polyfill-intl-grapheme/bootstrap.php deleted file mode 100644 index a9ea03c7e..000000000 --- a/app/vendor/symfony/polyfill-intl-grapheme/bootstrap.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Grapheme as p; - -if (extension_loaded('intl')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('GRAPHEME_EXTR_COUNT')) { - define('GRAPHEME_EXTR_COUNT', 0); -} -if (!defined('GRAPHEME_EXTR_MAXBYTES')) { - define('GRAPHEME_EXTR_MAXBYTES', 1); -} -if (!defined('GRAPHEME_EXTR_MAXCHARS')) { - define('GRAPHEME_EXTR_MAXCHARS', 2); -} - -if (!function_exists('grapheme_extract')) { - function grapheme_extract($haystack, $size, $type = 0, $start = 0, &$next = 0) { return p\Grapheme::grapheme_extract($haystack, $size, $type, $start, $next); } -} -if (!function_exists('grapheme_stripos')) { - function grapheme_stripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_stripos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_stristr')) { - function grapheme_stristr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_stristr($haystack, $needle, $beforeNeedle); } -} -if (!function_exists('grapheme_strlen')) { - function grapheme_strlen($input) { return p\Grapheme::grapheme_strlen($input); } -} -if (!function_exists('grapheme_strpos')) { - function grapheme_strpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strpos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strripos')) { - function grapheme_strripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strripos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strrpos')) { - function grapheme_strrpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strrpos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strstr')) { - function grapheme_strstr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_strstr($haystack, $needle, $beforeNeedle); } -} -if (!function_exists('grapheme_substr')) { - function grapheme_substr($string, $offset, $length = null) { return p\Grapheme::grapheme_substr($string, $offset, $length); } -} diff --git a/app/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php b/app/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php deleted file mode 100644 index b8c078677..000000000 --- a/app/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Grapheme as p; - -if (!defined('GRAPHEME_EXTR_COUNT')) { - define('GRAPHEME_EXTR_COUNT', 0); -} -if (!defined('GRAPHEME_EXTR_MAXBYTES')) { - define('GRAPHEME_EXTR_MAXBYTES', 1); -} -if (!defined('GRAPHEME_EXTR_MAXCHARS')) { - define('GRAPHEME_EXTR_MAXCHARS', 2); -} - -if (!function_exists('grapheme_extract')) { - function grapheme_extract(?string $haystack, ?int $size, ?int $type = GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null): string|false { return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); } -} -if (!function_exists('grapheme_stripos')) { - function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_stristr')) { - function grapheme_stristr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_stristr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } -} -if (!function_exists('grapheme_strlen')) { - function grapheme_strlen(?string $string): int|false|null { return p\Grapheme::grapheme_strlen((string) $string); } -} -if (!function_exists('grapheme_strpos')) { - function grapheme_strpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strpos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strripos')) { - function grapheme_strripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strripos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strrpos')) { - function grapheme_strrpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strrpos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strstr')) { - function grapheme_strstr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_strstr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } -} -if (!function_exists('grapheme_substr')) { - function grapheme_substr(?string $string, ?int $offset, ?int $length = null): string|false { return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); } -} diff --git a/app/vendor/symfony/polyfill-intl-grapheme/composer.json b/app/vendor/symfony/polyfill-intl-grapheme/composer.json deleted file mode 100644 index 02c98ee30..000000000 --- a/app/vendor/symfony/polyfill-intl-grapheme/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/polyfill-intl-grapheme", - "type": "library", - "description": "Symfony polyfill for intl's grapheme_* functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "grapheme"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Grapheme\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-intl": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/app/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/app/vendor/symfony/polyfill-intl-normalizer/Normalizer.php deleted file mode 100644 index 4443c2322..000000000 --- a/app/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ /dev/null @@ -1,310 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Normalizer; - -/** - * Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension. - * - * It has been validated with Unicode 6.3 Normalization Conformance Test. - * See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations. - * - * @author Nicolas Grekas - * - * @internal - */ -class Normalizer -{ - public const FORM_D = \Normalizer::FORM_D; - public const FORM_KD = \Normalizer::FORM_KD; - public const FORM_C = \Normalizer::FORM_C; - public const FORM_KC = \Normalizer::FORM_KC; - public const NFD = \Normalizer::NFD; - public const NFKD = \Normalizer::NFKD; - public const NFC = \Normalizer::NFC; - public const NFKC = \Normalizer::NFKC; - - private static $C; - private static $D; - private static $KD; - private static $cC; - private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - - public static function isNormalized(string $s, int $form = self::FORM_C) - { - if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { - return false; - } - if (!isset($s[strspn($s, self::$ASCII)])) { - return true; - } - if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { - return true; - } - - return self::normalize($s, $form) === $s; - } - - public static function normalize(string $s, int $form = self::FORM_C) - { - if (!preg_match('//u', $s)) { - return false; - } - - switch ($form) { - case self::NFC: $C = true; $K = false; break; - case self::NFD: $C = false; $K = false; break; - case self::NFKC: $C = true; $K = true; break; - case self::NFKD: $C = false; $K = true; break; - default: - if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { - return $s; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form'); - } - - if ('' === $s) { - return ''; - } - - if ($K && null === self::$KD) { - self::$KD = self::getData('compatibilityDecomposition'); - } - - if (null === self::$D) { - self::$D = self::getData('canonicalDecomposition'); - self::$cC = self::getData('combiningClass'); - } - - if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { - mb_internal_encoding('8bit'); - } - - $r = self::decompose($s, $K); - - if ($C) { - if (null === self::$C) { - self::$C = self::getData('canonicalComposition'); - } - - $r = self::recompose($r); - } - if (null !== $mbEncoding) { - mb_internal_encoding($mbEncoding); - } - - return $r; - } - - private static function recompose($s) - { - $ASCII = self::$ASCII; - $compMap = self::$C; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - - $result = $tail = ''; - - $i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"]; - $len = \strlen($s); - - $lastUchr = substr($s, 0, $i); - $lastUcls = isset($combClass[$lastUchr]) ? 256 : 0; - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - if ($j = strspn($s, $ASCII, $i + 1)) { - $lastUchr .= substr($s, $i, $j); - $i += $j; - } - - $result .= $lastUchr; - $lastUchr = $s[$i]; - $lastUcls = 0; - ++$i; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - - if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr - || $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr - || $lastUcls) { - // Table lookup and combining chars composition - - $ucls = $combClass[$uchr] ?? 0; - - if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { - $lastUchr = $compMap[$lastUchr.$uchr]; - } elseif ($lastUcls = $ucls) { - $tail .= $uchr; - } else { - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - $result .= $lastUchr; - $lastUchr = $uchr; - } - } else { - // Hangul chars - - $L = \ord($lastUchr[2]) - 0x80; - $V = \ord($uchr[2]) - 0xA1; - $T = 0; - - $uchr = substr($s, $i + $ulen, 3); - - if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") { - $T = \ord($uchr[2]) - 0xA7; - 0 > $T && $T += 0x40; - $ulen += 3; - } - - $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; - $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); - } - - $i += $ulen; - } - - return $result.$lastUchr.$tail; - } - - private static function decompose($s, $c) - { - $result = ''; - - $ASCII = self::$ASCII; - $decompMap = self::$D; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - if ($c) { - $compatMap = self::$KD; - } - - $c = []; - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $j = 1 + strspn($s, $ASCII, $i + 1); - $result .= substr($s, $i, $j); - $i += $j; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) { - // Table lookup - - if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) { - $uchr = $j; - - $j = \strlen($uchr); - $ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"]; - - if ($ulen != $j) { - // Put trailing chars in $s - - $j -= $ulen; - $i -= $j; - - if (0 > $i) { - $s = str_repeat(' ', -$i).$s; - $len -= $i; - $i = 0; - } - - while ($j--) { - $s[$i + $j] = $uchr[$ulen + $j]; - } - - $uchr = substr($uchr, 0, $ulen); - } - } - if (isset($combClass[$uchr])) { - // Combining chars, for sorting - - if (!isset($c[$combClass[$uchr]])) { - $c[$combClass[$uchr]] = ''; - } - $c[$combClass[$uchr]] .= $uchr; - continue; - } - } else { - // Hangul chars - - $uchr = unpack('C*', $uchr); - $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; - - $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) - ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); - - if ($j %= 28) { - $uchr .= $j < 25 - ? ("\xE1\x86".\chr(0xA7 + $j)) - : ("\xE1\x87".\chr(0x67 + $j)); - } - } - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $result .= $uchr; - } - - if ($c) { - ksort($c); - $result .= implode('', $c); - } - - return $result; - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } -} diff --git a/app/vendor/symfony/polyfill-intl-normalizer/README.md b/app/vendor/symfony/polyfill-intl-normalizer/README.md deleted file mode 100644 index 15060c5f1..000000000 --- a/app/vendor/symfony/polyfill-intl-normalizer/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Symfony Polyfill / Intl: Normalizer -=================================== - -This component provides a fallback implementation for the -[`Normalizer`](https://php.net/Normalizer) class provided -by the [Intl](https://php.net/intl) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/app/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php b/app/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php deleted file mode 100644 index 0fdfc890a..000000000 --- a/app/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php +++ /dev/null @@ -1,17 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ŏ' => 'Ŏ', - 'ŏ' => 'ŏ', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'Ơ' => 'Ơ', - 'ơ' => 'ơ', - 'Ư' => 'Ư', - 'ư' => 'ư', - 'Ǎ' => 'Ǎ', - 'ǎ' => 'ǎ', - 'Ǐ' => 'Ǐ', - 'ǐ' => 'ǐ', - 'Ǒ' => 'Ǒ', - 'ǒ' => 'ǒ', - 'Ǔ' => 'Ǔ', - 'ǔ' => 'ǔ', - 'Ǖ' => 'Ǖ', - 'ǖ' => 'ǖ', - 'Ǘ' => 'Ǘ', - 'ǘ' => 'ǘ', - 'Ǚ' => 'Ǚ', - 'ǚ' => 'ǚ', - 'Ǜ' => 'Ǜ', - 'ǜ' => 'ǜ', - 'Ǟ' => 'Ǟ', - 'ǟ' => 'ǟ', - 'Ǡ' => 'Ǡ', - 'ǡ' => 'ǡ', - 'Ǣ' => 'Ǣ', - 'ǣ' => 'ǣ', - 'Ǧ' => 'Ǧ', - 'ǧ' => 'ǧ', - 'Ǩ' => 'Ǩ', - 'ǩ' => 'ǩ', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'ǭ' => 'ǭ', - 'Ǯ' => 'Ǯ', - 'ǯ' => 'ǯ', - 'ǰ' => 'ǰ', - 'Ǵ' => 'Ǵ', - 'ǵ' => 'ǵ', - 'Ǹ' => 'Ǹ', - 'ǹ' => 'ǹ', - 'Ǻ' => 'Ǻ', - 'ǻ' => 'ǻ', - 'Ǽ' => 'Ǽ', - 'ǽ' => 'ǽ', - 'Ǿ' => 'Ǿ', - 'ǿ' => 'ǿ', - 'Ȁ' => 'Ȁ', - 'ȁ' => 'ȁ', - 'Ȃ' => 'Ȃ', - 'ȃ' => 'ȃ', - 'Ȅ' => 'Ȅ', - 'ȅ' => 'ȅ', - 'Ȇ' => 'Ȇ', - 'ȇ' => 'ȇ', - 'Ȉ' => 'Ȉ', - 'ȉ' => 'ȉ', - 'Ȋ' => 'Ȋ', - 'ȋ' => 'ȋ', - 'Ȍ' => 'Ȍ', - 'ȍ' => 'ȍ', - 'Ȏ' => 'Ȏ', - 'ȏ' => 'ȏ', - 'Ȑ' => 'Ȑ', - 'ȑ' => 'ȑ', - 'Ȓ' => 'Ȓ', - 'ȓ' => 'ȓ', - 'Ȕ' => 'Ȕ', - 'ȕ' => 'ȕ', - 'Ȗ' => 'Ȗ', - 'ȗ' => 'ȗ', - 'Ș' => 'Ș', - 'ș' => 'ș', - 'Ț' => 'Ț', - 'ț' => 'ț', - 'Ȟ' => 'Ȟ', - 'ȟ' => 'ȟ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'ȭ', - 'Ȯ' => 'Ȯ', - 'ȯ' => 'ȯ', - 'Ȱ' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'Ȳ', - 'ȳ' => 'ȳ', - '΅' => '΅', - 'Ά' => 'Ά', - 'Έ' => 'Έ', - 'Ή' => 'Ή', - 'Ί' => 'Ί', - 'Ό' => 'Ό', - 'Ύ' => 'Ύ', - 'Ώ' => 'Ώ', - 'ΐ' => 'ΐ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'ά', - 'έ' => 'έ', - 'ή' => 'ή', - 'ί' => 'ί', - 'ΰ' => 'ΰ', - 'ϊ' => 'ϊ', - 'ϋ' => 'ϋ', - 'ό' => 'ό', - 'ύ' => 'ύ', - 'ώ' => 'ώ', - 'ϓ' => 'ϓ', - 'ϔ' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ё', - 'Ѓ' => 'Ѓ', - 'Ї' => 'Ї', - 'Ќ' => 'Ќ', - 'Ѝ' => 'Ѝ', - 'Ў' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'ѐ', - 'ё' => 'ё', - 'ѓ' => 'ѓ', - 'ї' => 'ї', - 'ќ' => 'ќ', - 'ѝ' => 'ѝ', - 'ў' => 'ў', - 'Ѷ' => 'Ѷ', - 'ѷ' => 'ѷ', - 'Ӂ' => 'Ӂ', - 'ӂ' => 'ӂ', - 'Ӑ' => 'Ӑ', - 'ӑ' => 'ӑ', - 'Ӓ' => 'Ӓ', - 'ӓ' => 'ӓ', - 'Ӗ' => 'Ӗ', - 'ӗ' => 'ӗ', - 'Ӛ' => 'Ӛ', - 'ӛ' => 'ӛ', - 'Ӝ' => 'Ӝ', - 'ӝ' => 'ӝ', - 'Ӟ' => 'Ӟ', - 'ӟ' => 'ӟ', - 'Ӣ' => 'Ӣ', - 'ӣ' => 'ӣ', - 'Ӥ' => 'Ӥ', - 'ӥ' => 'ӥ', - 'Ӧ' => 'Ӧ', - 'ӧ' => 'ӧ', - 'Ӫ' => 'Ӫ', - 'ӫ' => 'ӫ', - 'Ӭ' => 'Ӭ', - 'ӭ' => 'ӭ', - 'Ӯ' => 'Ӯ', - 'ӯ' => 'ӯ', - 'Ӱ' => 'Ӱ', - 'ӱ' => 'ӱ', - 'Ӳ' => 'Ӳ', - 'ӳ' => 'ӳ', - 'Ӵ' => 'Ӵ', - 'ӵ' => 'ӵ', - 'Ӹ' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ὲ' => 'ὲ', - 'ὴ' => 'ὴ', - 'ὶ' => 'ὶ', - 'ὸ' => 'ὸ', - 'ὺ' => 'ὺ', - 'ὼ' => 'ὼ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'ᾼ' => 'ᾼ', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Ὴ' => 'Ὴ', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ὼ' => 'Ὼ', - 'ῼ' => 'ῼ', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', -); diff --git a/app/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php b/app/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php deleted file mode 100644 index 5a3e8e096..000000000 --- a/app/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php +++ /dev/null @@ -1,2065 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ŏ' => 'Ŏ', - 'ŏ' => 'ŏ', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'Ơ' => 'Ơ', - 'ơ' => 'ơ', - 'Ư' => 'Ư', - 'ư' => 'ư', - 'Ǎ' => 'Ǎ', - 'ǎ' => 'ǎ', - 'Ǐ' => 'Ǐ', - 'ǐ' => 'ǐ', - 'Ǒ' => 'Ǒ', - 'ǒ' => 'ǒ', - 'Ǔ' => 'Ǔ', - 'ǔ' => 'ǔ', - 'Ǖ' => 'Ǖ', - 'ǖ' => 'ǖ', - 'Ǘ' => 'Ǘ', - 'ǘ' => 'ǘ', - 'Ǚ' => 'Ǚ', - 'ǚ' => 'ǚ', - 'Ǜ' => 'Ǜ', - 'ǜ' => 'ǜ', - 'Ǟ' => 'Ǟ', - 'ǟ' => 'ǟ', - 'Ǡ' => 'Ǡ', - 'ǡ' => 'ǡ', - 'Ǣ' => 'Ǣ', - 'ǣ' => 'ǣ', - 'Ǧ' => 'Ǧ', - 'ǧ' => 'ǧ', - 'Ǩ' => 'Ǩ', - 'ǩ' => 'ǩ', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'ǭ' => 'ǭ', - 'Ǯ' => 'Ǯ', - 'ǯ' => 'ǯ', - 'ǰ' => 'ǰ', - 'Ǵ' => 'Ǵ', - 'ǵ' => 'ǵ', - 'Ǹ' => 'Ǹ', - 'ǹ' => 'ǹ', - 'Ǻ' => 'Ǻ', - 'ǻ' => 'ǻ', - 'Ǽ' => 'Ǽ', - 'ǽ' => 'ǽ', - 'Ǿ' => 'Ǿ', - 'ǿ' => 'ǿ', - 'Ȁ' => 'Ȁ', - 'ȁ' => 'ȁ', - 'Ȃ' => 'Ȃ', - 'ȃ' => 'ȃ', - 'Ȅ' => 'Ȅ', - 'ȅ' => 'ȅ', - 'Ȇ' => 'Ȇ', - 'ȇ' => 'ȇ', - 'Ȉ' => 'Ȉ', - 'ȉ' => 'ȉ', - 'Ȋ' => 'Ȋ', - 'ȋ' => 'ȋ', - 'Ȍ' => 'Ȍ', - 'ȍ' => 'ȍ', - 'Ȏ' => 'Ȏ', - 'ȏ' => 'ȏ', - 'Ȑ' => 'Ȑ', - 'ȑ' => 'ȑ', - 'Ȓ' => 'Ȓ', - 'ȓ' => 'ȓ', - 'Ȕ' => 'Ȕ', - 'ȕ' => 'ȕ', - 'Ȗ' => 'Ȗ', - 'ȗ' => 'ȗ', - 'Ș' => 'Ș', - 'ș' => 'ș', - 'Ț' => 'Ț', - 'ț' => 'ț', - 'Ȟ' => 'Ȟ', - 'ȟ' => 'ȟ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'ȭ', - 'Ȯ' => 'Ȯ', - 'ȯ' => 'ȯ', - 'Ȱ' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'Ȳ', - 'ȳ' => 'ȳ', - '̀' => '̀', - '́' => '́', - '̓' => '̓', - '̈́' => '̈́', - 'ʹ' => 'ʹ', - ';' => ';', - '΅' => '΅', - 'Ά' => 'Ά', - '·' => '·', - 'Έ' => 'Έ', - 'Ή' => 'Ή', - 'Ί' => 'Ί', - 'Ό' => 'Ό', - 'Ύ' => 'Ύ', - 'Ώ' => 'Ώ', - 'ΐ' => 'ΐ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'ά', - 'έ' => 'έ', - 'ή' => 'ή', - 'ί' => 'ί', - 'ΰ' => 'ΰ', - 'ϊ' => 'ϊ', - 'ϋ' => 'ϋ', - 'ό' => 'ό', - 'ύ' => 'ύ', - 'ώ' => 'ώ', - 'ϓ' => 'ϓ', - 'ϔ' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ё', - 'Ѓ' => 'Ѓ', - 'Ї' => 'Ї', - 'Ќ' => 'Ќ', - 'Ѝ' => 'Ѝ', - 'Ў' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'ѐ', - 'ё' => 'ё', - 'ѓ' => 'ѓ', - 'ї' => 'ї', - 'ќ' => 'ќ', - 'ѝ' => 'ѝ', - 'ў' => 'ў', - 'Ѷ' => 'Ѷ', - 'ѷ' => 'ѷ', - 'Ӂ' => 'Ӂ', - 'ӂ' => 'ӂ', - 'Ӑ' => 'Ӑ', - 'ӑ' => 'ӑ', - 'Ӓ' => 'Ӓ', - 'ӓ' => 'ӓ', - 'Ӗ' => 'Ӗ', - 'ӗ' => 'ӗ', - 'Ӛ' => 'Ӛ', - 'ӛ' => 'ӛ', - 'Ӝ' => 'Ӝ', - 'ӝ' => 'ӝ', - 'Ӟ' => 'Ӟ', - 'ӟ' => 'ӟ', - 'Ӣ' => 'Ӣ', - 'ӣ' => 'ӣ', - 'Ӥ' => 'Ӥ', - 'ӥ' => 'ӥ', - 'Ӧ' => 'Ӧ', - 'ӧ' => 'ӧ', - 'Ӫ' => 'Ӫ', - 'ӫ' => 'ӫ', - 'Ӭ' => 'Ӭ', - 'ӭ' => 'ӭ', - 'Ӯ' => 'Ӯ', - 'ӯ' => 'ӯ', - 'Ӱ' => 'Ӱ', - 'ӱ' => 'ӱ', - 'Ӳ' => 'Ӳ', - 'ӳ' => 'ӳ', - 'Ӵ' => 'Ӵ', - 'ӵ' => 'ӵ', - 'Ӹ' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'क़' => 'क़', - 'ख़' => 'ख़', - 'ग़' => 'ग़', - 'ज़' => 'ज़', - 'ड़' => 'ड़', - 'ढ़' => 'ढ़', - 'फ़' => 'फ़', - 'य़' => 'य़', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ড়' => 'ড়', - 'ঢ়' => 'ঢ়', - 'য়' => 'য়', - 'ਲ਼' => 'ਲ਼', - 'ਸ਼' => 'ਸ਼', - 'ਖ਼' => 'ਖ਼', - 'ਗ਼' => 'ਗ਼', - 'ਜ਼' => 'ਜ਼', - 'ਫ਼' => 'ਫ਼', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ଡ଼' => 'ଡ଼', - 'ଢ଼' => 'ଢ଼', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'གྷ' => 'གྷ', - 'ཌྷ' => 'ཌྷ', - 'དྷ' => 'དྷ', - 'བྷ' => 'བྷ', - 'ཛྷ' => 'ཛྷ', - 'ཀྵ' => 'ཀྵ', - 'ཱི' => 'ཱི', - 'ཱུ' => 'ཱུ', - 'ྲྀ' => 'ྲྀ', - 'ླྀ' => 'ླྀ', - 'ཱྀ' => 'ཱྀ', - 'ྒྷ' => 'ྒྷ', - 'ྜྷ' => 'ྜྷ', - 'ྡྷ' => 'ྡྷ', - 'ྦྷ' => 'ྦྷ', - 'ྫྷ' => 'ྫྷ', - 'ྐྵ' => 'ྐྵ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ά' => 'ά', - 'ὲ' => 'ὲ', - 'έ' => 'έ', - 'ὴ' => 'ὴ', - 'ή' => 'ή', - 'ὶ' => 'ὶ', - 'ί' => 'ί', - 'ὸ' => 'ὸ', - 'ό' => 'ό', - 'ὺ' => 'ὺ', - 'ύ' => 'ύ', - 'ὼ' => 'ὼ', - 'ώ' => 'ώ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'Ά' => 'Ά', - 'ᾼ' => 'ᾼ', - 'ι' => 'ι', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Έ' => 'Έ', - 'Ὴ' => 'Ὴ', - 'Ή' => 'Ή', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ΐ' => 'ΐ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - 'Ί' => 'Ί', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ΰ' => 'ΰ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ύ' => 'Ύ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - '΅' => '΅', - '`' => '`', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ό' => 'Ό', - 'Ὼ' => 'Ὼ', - 'Ώ' => 'Ώ', - 'ῼ' => 'ῼ', - '´' => '´', - ' ' => ' ', - ' ' => ' ', - 'Ω' => 'Ω', - 'K' => 'K', - 'Å' => 'Å', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - '〈' => '〈', - '〉' => '〉', - '⫝̸' => '⫝̸', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '豈' => '豈', - '更' => '更', - '車' => '車', - '賈' => '賈', - '滑' => '滑', - '串' => '串', - '句' => '句', - '龜' => '龜', - '龜' => '龜', - '契' => '契', - '金' => '金', - '喇' => '喇', - '奈' => '奈', - '懶' => '懶', - '癩' => '癩', - '羅' => '羅', - '蘿' => '蘿', - '螺' => '螺', - '裸' => '裸', - '邏' => '邏', - '樂' => '樂', - '洛' => '洛', - '烙' => '烙', - '珞' => '珞', - '落' => '落', - '酪' => '酪', - '駱' => '駱', - '亂' => '亂', - '卵' => '卵', - '欄' => '欄', - '爛' => '爛', - '蘭' => '蘭', - '鸞' => '鸞', - '嵐' => '嵐', - '濫' => '濫', - '藍' => '藍', - '襤' => '襤', - '拉' => '拉', - '臘' => '臘', - '蠟' => '蠟', - '廊' => '廊', - '朗' => '朗', - '浪' => '浪', - '狼' => '狼', - '郎' => '郎', - '來' => '來', - '冷' => '冷', - '勞' => '勞', - '擄' => '擄', - '櫓' => '櫓', - '爐' => '爐', - '盧' => '盧', - '老' => '老', - '蘆' => '蘆', - '虜' => '虜', - '路' => '路', - '露' => '露', - '魯' => '魯', - '鷺' => '鷺', - '碌' => '碌', - '祿' => '祿', - '綠' => '綠', - '菉' => '菉', - '錄' => '錄', - '鹿' => '鹿', - '論' => '論', - '壟' => '壟', - '弄' => '弄', - '籠' => '籠', - '聾' => '聾', - '牢' => '牢', - '磊' => '磊', - '賂' => '賂', - '雷' => '雷', - '壘' => '壘', - '屢' => '屢', - '樓' => '樓', - '淚' => '淚', - '漏' => '漏', - '累' => '累', - '縷' => '縷', - '陋' => '陋', - '勒' => '勒', - '肋' => '肋', - '凜' => '凜', - '凌' => '凌', - '稜' => '稜', - '綾' => '綾', - '菱' => '菱', - '陵' => '陵', - '讀' => '讀', - '拏' => '拏', - '樂' => '樂', - '諾' => '諾', - '丹' => '丹', - '寧' => '寧', - '怒' => '怒', - '率' => '率', - '異' => '異', - '北' => '北', - '磻' => '磻', - '便' => '便', - '復' => '復', - '不' => '不', - '泌' => '泌', - '數' => '數', - '索' => '索', - '參' => '參', - '塞' => '塞', - '省' => '省', - '葉' => '葉', - '說' => '說', - '殺' => '殺', - '辰' => '辰', - '沈' => '沈', - '拾' => '拾', - '若' => '若', - '掠' => '掠', - '略' => '略', - '亮' => '亮', - '兩' => '兩', - '凉' => '凉', - '梁' => '梁', - '糧' => '糧', - '良' => '良', - '諒' => '諒', - '量' => '量', - '勵' => '勵', - '呂' => '呂', - '女' => '女', - '廬' => '廬', - '旅' => '旅', - '濾' => '濾', - '礪' => '礪', - '閭' => '閭', - '驪' => '驪', - '麗' => '麗', - '黎' => '黎', - '力' => '力', - '曆' => '曆', - '歷' => '歷', - '轢' => '轢', - '年' => '年', - '憐' => '憐', - '戀' => '戀', - '撚' => '撚', - '漣' => '漣', - '煉' => '煉', - '璉' => '璉', - '秊' => '秊', - '練' => '練', - '聯' => '聯', - '輦' => '輦', - '蓮' => '蓮', - '連' => '連', - '鍊' => '鍊', - '列' => '列', - '劣' => '劣', - '咽' => '咽', - '烈' => '烈', - '裂' => '裂', - '說' => '說', - '廉' => '廉', - '念' => '念', - '捻' => '捻', - '殮' => '殮', - '簾' => '簾', - '獵' => '獵', - '令' => '令', - '囹' => '囹', - '寧' => '寧', - '嶺' => '嶺', - '怜' => '怜', - '玲' => '玲', - '瑩' => '瑩', - '羚' => '羚', - '聆' => '聆', - '鈴' => '鈴', - '零' => '零', - '靈' => '靈', - '領' => '領', - '例' => '例', - '禮' => '禮', - '醴' => '醴', - '隸' => '隸', - '惡' => '惡', - '了' => '了', - '僚' => '僚', - '寮' => '寮', - '尿' => '尿', - '料' => '料', - '樂' => '樂', - '燎' => '燎', - '療' => '療', - '蓼' => '蓼', - '遼' => '遼', - '龍' => '龍', - '暈' => '暈', - '阮' => '阮', - '劉' => '劉', - '杻' => '杻', - '柳' => '柳', - '流' => '流', - '溜' => '溜', - '琉' => '琉', - '留' => '留', - '硫' => '硫', - '紐' => '紐', - '類' => '類', - '六' => '六', - '戮' => '戮', - '陸' => '陸', - '倫' => '倫', - '崙' => '崙', - '淪' => '淪', - '輪' => '輪', - '律' => '律', - '慄' => '慄', - '栗' => '栗', - '率' => '率', - '隆' => '隆', - '利' => '利', - '吏' => '吏', - '履' => '履', - '易' => '易', - '李' => '李', - '梨' => '梨', - '泥' => '泥', - '理' => '理', - '痢' => '痢', - '罹' => '罹', - '裏' => '裏', - '裡' => '裡', - '里' => '里', - '離' => '離', - '匿' => '匿', - '溺' => '溺', - '吝' => '吝', - '燐' => '燐', - '璘' => '璘', - '藺' => '藺', - '隣' => '隣', - '鱗' => '鱗', - '麟' => '麟', - '林' => '林', - '淋' => '淋', - '臨' => '臨', - '立' => '立', - '笠' => '笠', - '粒' => '粒', - '狀' => '狀', - '炙' => '炙', - '識' => '識', - '什' => '什', - '茶' => '茶', - '刺' => '刺', - '切' => '切', - '度' => '度', - '拓' => '拓', - '糖' => '糖', - '宅' => '宅', - '洞' => '洞', - '暴' => '暴', - '輻' => '輻', - '行' => '行', - '降' => '降', - '見' => '見', - '廓' => '廓', - '兀' => '兀', - '嗀' => '嗀', - '塚' => '塚', - '晴' => '晴', - '凞' => '凞', - '猪' => '猪', - '益' => '益', - '礼' => '礼', - '神' => '神', - '祥' => '祥', - '福' => '福', - '靖' => '靖', - '精' => '精', - '羽' => '羽', - '蘒' => '蘒', - '諸' => '諸', - '逸' => '逸', - '都' => '都', - '飯' => '飯', - '飼' => '飼', - '館' => '館', - '鶴' => '鶴', - '郞' => '郞', - '隷' => '隷', - '侮' => '侮', - '僧' => '僧', - '免' => '免', - '勉' => '勉', - '勤' => '勤', - '卑' => '卑', - '喝' => '喝', - '嘆' => '嘆', - '器' => '器', - '塀' => '塀', - '墨' => '墨', - '層' => '層', - '屮' => '屮', - '悔' => '悔', - '慨' => '慨', - '憎' => '憎', - '懲' => '懲', - '敏' => '敏', - '既' => '既', - '暑' => '暑', - '梅' => '梅', - '海' => '海', - '渚' => '渚', - '漢' => '漢', - '煮' => '煮', - '爫' => '爫', - '琢' => '琢', - '碑' => '碑', - '社' => '社', - '祉' => '祉', - '祈' => '祈', - '祐' => '祐', - '祖' => '祖', - '祝' => '祝', - '禍' => '禍', - '禎' => '禎', - '穀' => '穀', - '突' => '突', - '節' => '節', - '練' => '練', - '縉' => '縉', - '繁' => '繁', - '署' => '署', - '者' => '者', - '臭' => '臭', - '艹' => '艹', - '艹' => '艹', - '著' => '著', - '褐' => '褐', - '視' => '視', - '謁' => '謁', - '謹' => '謹', - '賓' => '賓', - '贈' => '贈', - '辶' => '辶', - '逸' => '逸', - '難' => '難', - '響' => '響', - '頻' => '頻', - '恵' => '恵', - '𤋮' => '𤋮', - '舘' => '舘', - '並' => '並', - '况' => '况', - '全' => '全', - '侀' => '侀', - '充' => '充', - '冀' => '冀', - '勇' => '勇', - '勺' => '勺', - '喝' => '喝', - '啕' => '啕', - '喙' => '喙', - '嗢' => '嗢', - '塚' => '塚', - '墳' => '墳', - '奄' => '奄', - '奔' => '奔', - '婢' => '婢', - '嬨' => '嬨', - '廒' => '廒', - '廙' => '廙', - '彩' => '彩', - '徭' => '徭', - '惘' => '惘', - '慎' => '慎', - '愈' => '愈', - '憎' => '憎', - '慠' => '慠', - '懲' => '懲', - '戴' => '戴', - '揄' => '揄', - '搜' => '搜', - '摒' => '摒', - '敖' => '敖', - '晴' => '晴', - '朗' => '朗', - '望' => '望', - '杖' => '杖', - '歹' => '歹', - '殺' => '殺', - '流' => '流', - '滛' => '滛', - '滋' => '滋', - '漢' => '漢', - '瀞' => '瀞', - '煮' => '煮', - '瞧' => '瞧', - '爵' => '爵', - '犯' => '犯', - '猪' => '猪', - '瑱' => '瑱', - '甆' => '甆', - '画' => '画', - '瘝' => '瘝', - '瘟' => '瘟', - '益' => '益', - '盛' => '盛', - '直' => '直', - '睊' => '睊', - '着' => '着', - '磌' => '磌', - '窱' => '窱', - '節' => '節', - '类' => '类', - '絛' => '絛', - '練' => '練', - '缾' => '缾', - '者' => '者', - '荒' => '荒', - '華' => '華', - '蝹' => '蝹', - '襁' => '襁', - '覆' => '覆', - '視' => '視', - '調' => '調', - '諸' => '諸', - '請' => '請', - '謁' => '謁', - '諾' => '諾', - '諭' => '諭', - '謹' => '謹', - '變' => '變', - '贈' => '贈', - '輸' => '輸', - '遲' => '遲', - '醙' => '醙', - '鉶' => '鉶', - '陼' => '陼', - '難' => '難', - '靖' => '靖', - '韛' => '韛', - '響' => '響', - '頋' => '頋', - '頻' => '頻', - '鬒' => '鬒', - '龜' => '龜', - '𢡊' => '𢡊', - '𢡄' => '𢡄', - '𣏕' => '𣏕', - '㮝' => '㮝', - '䀘' => '䀘', - '䀹' => '䀹', - '𥉉' => '𥉉', - '𥳐' => '𥳐', - '𧻓' => '𧻓', - '齃' => '齃', - '龎' => '龎', - 'יִ' => 'יִ', - 'ײַ' => 'ײַ', - 'שׁ' => 'שׁ', - 'שׂ' => 'שׂ', - 'שּׁ' => 'שּׁ', - 'שּׂ' => 'שּׂ', - 'אַ' => 'אַ', - 'אָ' => 'אָ', - 'אּ' => 'אּ', - 'בּ' => 'בּ', - 'גּ' => 'גּ', - 'דּ' => 'דּ', - 'הּ' => 'הּ', - 'וּ' => 'וּ', - 'זּ' => 'זּ', - 'טּ' => 'טּ', - 'יּ' => 'יּ', - 'ךּ' => 'ךּ', - 'כּ' => 'כּ', - 'לּ' => 'לּ', - 'מּ' => 'מּ', - 'נּ' => 'נּ', - 'סּ' => 'סּ', - 'ףּ' => 'ףּ', - 'פּ' => 'פּ', - 'צּ' => 'צּ', - 'קּ' => 'קּ', - 'רּ' => 'רּ', - 'שּ' => 'שּ', - 'תּ' => 'תּ', - 'וֹ' => 'וֹ', - 'בֿ' => 'בֿ', - 'כֿ' => 'כֿ', - 'פֿ' => 'פֿ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', - '𝅗𝅥' => '𝅗𝅥', - '𝅘𝅥' => '𝅘𝅥', - '𝅘𝅥𝅮' => '𝅘𝅥𝅮', - '𝅘𝅥𝅯' => '𝅘𝅥𝅯', - '𝅘𝅥𝅰' => '𝅘𝅥𝅰', - '𝅘𝅥𝅱' => '𝅘𝅥𝅱', - '𝅘𝅥𝅲' => '𝅘𝅥𝅲', - '𝆹𝅥' => '𝆹𝅥', - '𝆺𝅥' => '𝆺𝅥', - '𝆹𝅥𝅮' => '𝆹𝅥𝅮', - '𝆺𝅥𝅮' => '𝆺𝅥𝅮', - '𝆹𝅥𝅯' => '𝆹𝅥𝅯', - '𝆺𝅥𝅯' => '𝆺𝅥𝅯', - '丽' => '丽', - '丸' => '丸', - '乁' => '乁', - '𠄢' => '𠄢', - '你' => '你', - '侮' => '侮', - '侻' => '侻', - '倂' => '倂', - '偺' => '偺', - '備' => '備', - '僧' => '僧', - '像' => '像', - '㒞' => '㒞', - '𠘺' => '𠘺', - '免' => '免', - '兔' => '兔', - '兤' => '兤', - '具' => '具', - '𠔜' => '𠔜', - '㒹' => '㒹', - '內' => '內', - '再' => '再', - '𠕋' => '𠕋', - '冗' => '冗', - '冤' => '冤', - '仌' => '仌', - '冬' => '冬', - '况' => '况', - '𩇟' => '𩇟', - '凵' => '凵', - '刃' => '刃', - '㓟' => '㓟', - '刻' => '刻', - '剆' => '剆', - '割' => '割', - '剷' => '剷', - '㔕' => '㔕', - '勇' => '勇', - '勉' => '勉', - '勤' => '勤', - '勺' => '勺', - '包' => '包', - '匆' => '匆', - '北' => '北', - '卉' => '卉', - '卑' => '卑', - '博' => '博', - '即' => '即', - '卽' => '卽', - '卿' => '卿', - '卿' => '卿', - '卿' => '卿', - '𠨬' => '𠨬', - '灰' => '灰', - '及' => '及', - '叟' => '叟', - '𠭣' => '𠭣', - '叫' => '叫', - '叱' => '叱', - '吆' => '吆', - '咞' => '咞', - '吸' => '吸', - '呈' => '呈', - '周' => '周', - '咢' => '咢', - '哶' => '哶', - '唐' => '唐', - '啓' => '啓', - '啣' => '啣', - '善' => '善', - '善' => '善', - '喙' => '喙', - '喫' => '喫', - '喳' => '喳', - '嗂' => '嗂', - '圖' => '圖', - '嘆' => '嘆', - '圗' => '圗', - '噑' => '噑', - '噴' => '噴', - '切' => '切', - '壮' => '壮', - '城' => '城', - '埴' => '埴', - '堍' => '堍', - '型' => '型', - '堲' => '堲', - '報' => '報', - '墬' => '墬', - '𡓤' => '𡓤', - '売' => '売', - '壷' => '壷', - '夆' => '夆', - '多' => '多', - '夢' => '夢', - '奢' => '奢', - '𡚨' => '𡚨', - '𡛪' => '𡛪', - '姬' => '姬', - '娛' => '娛', - '娧' => '娧', - '姘' => '姘', - '婦' => '婦', - '㛮' => '㛮', - '㛼' => '㛼', - '嬈' => '嬈', - '嬾' => '嬾', - '嬾' => '嬾', - '𡧈' => '𡧈', - '寃' => '寃', - '寘' => '寘', - '寧' => '寧', - '寳' => '寳', - '𡬘' => '𡬘', - '寿' => '寿', - '将' => '将', - '当' => '当', - '尢' => '尢', - '㞁' => '㞁', - '屠' => '屠', - '屮' => '屮', - '峀' => '峀', - '岍' => '岍', - '𡷤' => '𡷤', - '嵃' => '嵃', - '𡷦' => '𡷦', - '嵮' => '嵮', - '嵫' => '嵫', - '嵼' => '嵼', - '巡' => '巡', - '巢' => '巢', - '㠯' => '㠯', - '巽' => '巽', - '帨' => '帨', - '帽' => '帽', - '幩' => '幩', - '㡢' => '㡢', - '𢆃' => '𢆃', - '㡼' => '㡼', - '庰' => '庰', - '庳' => '庳', - '庶' => '庶', - '廊' => '廊', - '𪎒' => '𪎒', - '廾' => '廾', - '𢌱' => '𢌱', - '𢌱' => '𢌱', - '舁' => '舁', - '弢' => '弢', - '弢' => '弢', - '㣇' => '㣇', - '𣊸' => '𣊸', - '𦇚' => '𦇚', - '形' => '形', - '彫' => '彫', - '㣣' => '㣣', - '徚' => '徚', - '忍' => '忍', - '志' => '志', - '忹' => '忹', - '悁' => '悁', - '㤺' => '㤺', - '㤜' => '㤜', - '悔' => '悔', - '𢛔' => '𢛔', - '惇' => '惇', - '慈' => '慈', - '慌' => '慌', - '慎' => '慎', - '慌' => '慌', - '慺' => '慺', - '憎' => '憎', - '憲' => '憲', - '憤' => '憤', - '憯' => '憯', - '懞' => '懞', - '懲' => '懲', - '懶' => '懶', - '成' => '成', - '戛' => '戛', - '扝' => '扝', - '抱' => '抱', - '拔' => '拔', - '捐' => '捐', - '𢬌' => '𢬌', - '挽' => '挽', - '拼' => '拼', - '捨' => '捨', - '掃' => '掃', - '揤' => '揤', - '𢯱' => '𢯱', - '搢' => '搢', - '揅' => '揅', - '掩' => '掩', - '㨮' => '㨮', - '摩' => '摩', - '摾' => '摾', - '撝' => '撝', - '摷' => '摷', - '㩬' => '㩬', - '敏' => '敏', - '敬' => '敬', - '𣀊' => '𣀊', - '旣' => '旣', - '書' => '書', - '晉' => '晉', - '㬙' => '㬙', - '暑' => '暑', - '㬈' => '㬈', - '㫤' => '㫤', - '冒' => '冒', - '冕' => '冕', - '最' => '最', - '暜' => '暜', - '肭' => '肭', - '䏙' => '䏙', - '朗' => '朗', - '望' => '望', - '朡' => '朡', - '杞' => '杞', - '杓' => '杓', - '𣏃' => '𣏃', - '㭉' => '㭉', - '柺' => '柺', - '枅' => '枅', - '桒' => '桒', - '梅' => '梅', - '𣑭' => '𣑭', - '梎' => '梎', - '栟' => '栟', - '椔' => '椔', - '㮝' => '㮝', - '楂' => '楂', - '榣' => '榣', - '槪' => '槪', - '檨' => '檨', - '𣚣' => '𣚣', - '櫛' => '櫛', - '㰘' => '㰘', - '次' => '次', - '𣢧' => '𣢧', - '歔' => '歔', - '㱎' => '㱎', - '歲' => '歲', - '殟' => '殟', - '殺' => '殺', - '殻' => '殻', - '𣪍' => '𣪍', - '𡴋' => '𡴋', - '𣫺' => '𣫺', - '汎' => '汎', - '𣲼' => '𣲼', - '沿' => '沿', - '泍' => '泍', - '汧' => '汧', - '洖' => '洖', - '派' => '派', - '海' => '海', - '流' => '流', - '浩' => '浩', - '浸' => '浸', - '涅' => '涅', - '𣴞' => '𣴞', - '洴' => '洴', - '港' => '港', - '湮' => '湮', - '㴳' => '㴳', - '滋' => '滋', - '滇' => '滇', - '𣻑' => '𣻑', - '淹' => '淹', - '潮' => '潮', - '𣽞' => '𣽞', - '𣾎' => '𣾎', - '濆' => '濆', - '瀹' => '瀹', - '瀞' => '瀞', - '瀛' => '瀛', - '㶖' => '㶖', - '灊' => '灊', - '災' => '災', - '灷' => '灷', - '炭' => '炭', - '𠔥' => '𠔥', - '煅' => '煅', - '𤉣' => '𤉣', - '熜' => '熜', - '𤎫' => '𤎫', - '爨' => '爨', - '爵' => '爵', - '牐' => '牐', - '𤘈' => '𤘈', - '犀' => '犀', - '犕' => '犕', - '𤜵' => '𤜵', - '𤠔' => '𤠔', - '獺' => '獺', - '王' => '王', - '㺬' => '㺬', - '玥' => '玥', - '㺸' => '㺸', - '㺸' => '㺸', - '瑇' => '瑇', - '瑜' => '瑜', - '瑱' => '瑱', - '璅' => '璅', - '瓊' => '瓊', - '㼛' => '㼛', - '甤' => '甤', - '𤰶' => '𤰶', - '甾' => '甾', - '𤲒' => '𤲒', - '異' => '異', - '𢆟' => '𢆟', - '瘐' => '瘐', - '𤾡' => '𤾡', - '𤾸' => '𤾸', - '𥁄' => '𥁄', - '㿼' => '㿼', - '䀈' => '䀈', - '直' => '直', - '𥃳' => '𥃳', - '𥃲' => '𥃲', - '𥄙' => '𥄙', - '𥄳' => '𥄳', - '眞' => '眞', - '真' => '真', - '真' => '真', - '睊' => '睊', - '䀹' => '䀹', - '瞋' => '瞋', - '䁆' => '䁆', - '䂖' => '䂖', - '𥐝' => '𥐝', - '硎' => '硎', - '碌' => '碌', - '磌' => '磌', - '䃣' => '䃣', - '𥘦' => '𥘦', - '祖' => '祖', - '𥚚' => '𥚚', - '𥛅' => '𥛅', - '福' => '福', - '秫' => '秫', - '䄯' => '䄯', - '穀' => '穀', - '穊' => '穊', - '穏' => '穏', - '𥥼' => '𥥼', - '𥪧' => '𥪧', - '𥪧' => '𥪧', - '竮' => '竮', - '䈂' => '䈂', - '𥮫' => '𥮫', - '篆' => '篆', - '築' => '築', - '䈧' => '䈧', - '𥲀' => '𥲀', - '糒' => '糒', - '䊠' => '䊠', - '糨' => '糨', - '糣' => '糣', - '紀' => '紀', - '𥾆' => '𥾆', - '絣' => '絣', - '䌁' => '䌁', - '緇' => '緇', - '縂' => '縂', - '繅' => '繅', - '䌴' => '䌴', - '𦈨' => '𦈨', - '𦉇' => '𦉇', - '䍙' => '䍙', - '𦋙' => '𦋙', - '罺' => '罺', - '𦌾' => '𦌾', - '羕' => '羕', - '翺' => '翺', - '者' => '者', - '𦓚' => '𦓚', - '𦔣' => '𦔣', - '聠' => '聠', - '𦖨' => '𦖨', - '聰' => '聰', - '𣍟' => '𣍟', - '䏕' => '䏕', - '育' => '育', - '脃' => '脃', - '䐋' => '䐋', - '脾' => '脾', - '媵' => '媵', - '𦞧' => '𦞧', - '𦞵' => '𦞵', - '𣎓' => '𣎓', - '𣎜' => '𣎜', - '舁' => '舁', - '舄' => '舄', - '辞' => '辞', - '䑫' => '䑫', - '芑' => '芑', - '芋' => '芋', - '芝' => '芝', - '劳' => '劳', - '花' => '花', - '芳' => '芳', - '芽' => '芽', - '苦' => '苦', - '𦬼' => '𦬼', - '若' => '若', - '茝' => '茝', - '荣' => '荣', - '莭' => '莭', - '茣' => '茣', - '莽' => '莽', - '菧' => '菧', - '著' => '著', - '荓' => '荓', - '菊' => '菊', - '菌' => '菌', - '菜' => '菜', - '𦰶' => '𦰶', - '𦵫' => '𦵫', - '𦳕' => '𦳕', - '䔫' => '䔫', - '蓱' => '蓱', - '蓳' => '蓳', - '蔖' => '蔖', - '𧏊' => '𧏊', - '蕤' => '蕤', - '𦼬' => '𦼬', - '䕝' => '䕝', - '䕡' => '䕡', - '𦾱' => '𦾱', - '𧃒' => '𧃒', - '䕫' => '䕫', - '虐' => '虐', - '虜' => '虜', - '虧' => '虧', - '虩' => '虩', - '蚩' => '蚩', - '蚈' => '蚈', - '蜎' => '蜎', - '蛢' => '蛢', - '蝹' => '蝹', - '蜨' => '蜨', - '蝫' => '蝫', - '螆' => '螆', - '䗗' => '䗗', - '蟡' => '蟡', - '蠁' => '蠁', - '䗹' => '䗹', - '衠' => '衠', - '衣' => '衣', - '𧙧' => '𧙧', - '裗' => '裗', - '裞' => '裞', - '䘵' => '䘵', - '裺' => '裺', - '㒻' => '㒻', - '𧢮' => '𧢮', - '𧥦' => '𧥦', - '䚾' => '䚾', - '䛇' => '䛇', - '誠' => '誠', - '諭' => '諭', - '變' => '變', - '豕' => '豕', - '𧲨' => '𧲨', - '貫' => '貫', - '賁' => '賁', - '贛' => '贛', - '起' => '起', - '𧼯' => '𧼯', - '𠠄' => '𠠄', - '跋' => '跋', - '趼' => '趼', - '跰' => '跰', - '𠣞' => '𠣞', - '軔' => '軔', - '輸' => '輸', - '𨗒' => '𨗒', - '𨗭' => '𨗭', - '邔' => '邔', - '郱' => '郱', - '鄑' => '鄑', - '𨜮' => '𨜮', - '鄛' => '鄛', - '鈸' => '鈸', - '鋗' => '鋗', - '鋘' => '鋘', - '鉼' => '鉼', - '鏹' => '鏹', - '鐕' => '鐕', - '𨯺' => '𨯺', - '開' => '開', - '䦕' => '䦕', - '閷' => '閷', - '𨵷' => '𨵷', - '䧦' => '䧦', - '雃' => '雃', - '嶲' => '嶲', - '霣' => '霣', - '𩅅' => '𩅅', - '𩈚' => '𩈚', - '䩮' => '䩮', - '䩶' => '䩶', - '韠' => '韠', - '𩐊' => '𩐊', - '䪲' => '䪲', - '𩒖' => '𩒖', - '頋' => '頋', - '頋' => '頋', - '頩' => '頩', - '𩖶' => '𩖶', - '飢' => '飢', - '䬳' => '䬳', - '餩' => '餩', - '馧' => '馧', - '駂' => '駂', - '駾' => '駾', - '䯎' => '䯎', - '𩬰' => '𩬰', - '鬒' => '鬒', - '鱀' => '鱀', - '鳽' => '鳽', - '䳎' => '䳎', - '䳭' => '䳭', - '鵧' => '鵧', - '𪃎' => '𪃎', - '䳸' => '䳸', - '𪄅' => '𪄅', - '𪈎' => '𪈎', - '𪊑' => '𪊑', - '麻' => '麻', - '䵖' => '䵖', - '黹' => '黹', - '黾' => '黾', - '鼅' => '鼅', - '鼏' => '鼏', - '鼖' => '鼖', - '鼻' => '鼻', - '𪘀' => '𪘀', -); diff --git a/app/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php b/app/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php deleted file mode 100644 index ec90f36eb..000000000 --- a/app/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php +++ /dev/null @@ -1,876 +0,0 @@ - 230, - '́' => 230, - '̂' => 230, - '̃' => 230, - '̄' => 230, - '̅' => 230, - '̆' => 230, - '̇' => 230, - '̈' => 230, - '̉' => 230, - '̊' => 230, - '̋' => 230, - '̌' => 230, - '̍' => 230, - '̎' => 230, - '̏' => 230, - '̐' => 230, - '̑' => 230, - '̒' => 230, - '̓' => 230, - '̔' => 230, - '̕' => 232, - '̖' => 220, - '̗' => 220, - '̘' => 220, - '̙' => 220, - '̚' => 232, - '̛' => 216, - '̜' => 220, - '̝' => 220, - '̞' => 220, - '̟' => 220, - '̠' => 220, - '̡' => 202, - '̢' => 202, - '̣' => 220, - '̤' => 220, - '̥' => 220, - '̦' => 220, - '̧' => 202, - '̨' => 202, - '̩' => 220, - '̪' => 220, - '̫' => 220, - '̬' => 220, - '̭' => 220, - '̮' => 220, - '̯' => 220, - '̰' => 220, - '̱' => 220, - '̲' => 220, - '̳' => 220, - '̴' => 1, - '̵' => 1, - '̶' => 1, - '̷' => 1, - '̸' => 1, - '̹' => 220, - '̺' => 220, - '̻' => 220, - '̼' => 220, - '̽' => 230, - '̾' => 230, - '̿' => 230, - '̀' => 230, - '́' => 230, - '͂' => 230, - '̓' => 230, - '̈́' => 230, - 'ͅ' => 240, - '͆' => 230, - '͇' => 220, - '͈' => 220, - '͉' => 220, - '͊' => 230, - '͋' => 230, - '͌' => 230, - '͍' => 220, - '͎' => 220, - '͐' => 230, - '͑' => 230, - '͒' => 230, - '͓' => 220, - '͔' => 220, - '͕' => 220, - '͖' => 220, - '͗' => 230, - '͘' => 232, - '͙' => 220, - '͚' => 220, - '͛' => 230, - '͜' => 233, - '͝' => 234, - '͞' => 234, - '͟' => 233, - '͠' => 234, - '͡' => 234, - '͢' => 233, - 'ͣ' => 230, - 'ͤ' => 230, - 'ͥ' => 230, - 'ͦ' => 230, - 'ͧ' => 230, - 'ͨ' => 230, - 'ͩ' => 230, - 'ͪ' => 230, - 'ͫ' => 230, - 'ͬ' => 230, - 'ͭ' => 230, - 'ͮ' => 230, - 'ͯ' => 230, - '҃' => 230, - '҄' => 230, - '҅' => 230, - '҆' => 230, - '҇' => 230, - '֑' => 220, - '֒' => 230, - '֓' => 230, - '֔' => 230, - '֕' => 230, - '֖' => 220, - '֗' => 230, - '֘' => 230, - '֙' => 230, - '֚' => 222, - '֛' => 220, - '֜' => 230, - '֝' => 230, - '֞' => 230, - '֟' => 230, - '֠' => 230, - '֡' => 230, - '֢' => 220, - '֣' => 220, - '֤' => 220, - '֥' => 220, - '֦' => 220, - '֧' => 220, - '֨' => 230, - '֩' => 230, - '֪' => 220, - '֫' => 230, - '֬' => 230, - '֭' => 222, - '֮' => 228, - '֯' => 230, - 'ְ' => 10, - 'ֱ' => 11, - 'ֲ' => 12, - 'ֳ' => 13, - 'ִ' => 14, - 'ֵ' => 15, - 'ֶ' => 16, - 'ַ' => 17, - 'ָ' => 18, - 'ֹ' => 19, - 'ֺ' => 19, - 'ֻ' => 20, - 'ּ' => 21, - 'ֽ' => 22, - 'ֿ' => 23, - 'ׁ' => 24, - 'ׂ' => 25, - 'ׄ' => 230, - 'ׅ' => 220, - 'ׇ' => 18, - 'ؐ' => 230, - 'ؑ' => 230, - 'ؒ' => 230, - 'ؓ' => 230, - 'ؔ' => 230, - 'ؕ' => 230, - 'ؖ' => 230, - 'ؗ' => 230, - 'ؘ' => 30, - 'ؙ' => 31, - 'ؚ' => 32, - 'ً' => 27, - 'ٌ' => 28, - 'ٍ' => 29, - 'َ' => 30, - 'ُ' => 31, - 'ِ' => 32, - 'ّ' => 33, - 'ْ' => 34, - 'ٓ' => 230, - 'ٔ' => 230, - 'ٕ' => 220, - 'ٖ' => 220, - 'ٗ' => 230, - '٘' => 230, - 'ٙ' => 230, - 'ٚ' => 230, - 'ٛ' => 230, - 'ٜ' => 220, - 'ٝ' => 230, - 'ٞ' => 230, - 'ٟ' => 220, - 'ٰ' => 35, - 'ۖ' => 230, - 'ۗ' => 230, - 'ۘ' => 230, - 'ۙ' => 230, - 'ۚ' => 230, - 'ۛ' => 230, - 'ۜ' => 230, - '۟' => 230, - '۠' => 230, - 'ۡ' => 230, - 'ۢ' => 230, - 'ۣ' => 220, - 'ۤ' => 230, - 'ۧ' => 230, - 'ۨ' => 230, - '۪' => 220, - '۫' => 230, - '۬' => 230, - 'ۭ' => 220, - 'ܑ' => 36, - 'ܰ' => 230, - 'ܱ' => 220, - 'ܲ' => 230, - 'ܳ' => 230, - 'ܴ' => 220, - 'ܵ' => 230, - 'ܶ' => 230, - 'ܷ' => 220, - 'ܸ' => 220, - 'ܹ' => 220, - 'ܺ' => 230, - 'ܻ' => 220, - 'ܼ' => 220, - 'ܽ' => 230, - 'ܾ' => 220, - 'ܿ' => 230, - '݀' => 230, - '݁' => 230, - '݂' => 220, - '݃' => 230, - '݄' => 220, - '݅' => 230, - '݆' => 220, - '݇' => 230, - '݈' => 220, - '݉' => 230, - '݊' => 230, - '߫' => 230, - '߬' => 230, - '߭' => 230, - '߮' => 230, - '߯' => 230, - '߰' => 230, - '߱' => 230, - '߲' => 220, - '߳' => 230, - '߽' => 220, - 'ࠖ' => 230, - 'ࠗ' => 230, - '࠘' => 230, - '࠙' => 230, - 'ࠛ' => 230, - 'ࠜ' => 230, - 'ࠝ' => 230, - 'ࠞ' => 230, - 'ࠟ' => 230, - 'ࠠ' => 230, - 'ࠡ' => 230, - 'ࠢ' => 230, - 'ࠣ' => 230, - 'ࠥ' => 230, - 'ࠦ' => 230, - 'ࠧ' => 230, - 'ࠩ' => 230, - 'ࠪ' => 230, - 'ࠫ' => 230, - 'ࠬ' => 230, - '࠭' => 230, - '࡙' => 220, - '࡚' => 220, - '࡛' => 220, - '࣓' => 220, - 'ࣔ' => 230, - 'ࣕ' => 230, - 'ࣖ' => 230, - 'ࣗ' => 230, - 'ࣘ' => 230, - 'ࣙ' => 230, - 'ࣚ' => 230, - 'ࣛ' => 230, - 'ࣜ' => 230, - 'ࣝ' => 230, - 'ࣞ' => 230, - 'ࣟ' => 230, - '࣠' => 230, - '࣡' => 230, - 'ࣣ' => 220, - 'ࣤ' => 230, - 'ࣥ' => 230, - 'ࣦ' => 220, - 'ࣧ' => 230, - 'ࣨ' => 230, - 'ࣩ' => 220, - '࣪' => 230, - '࣫' => 230, - '࣬' => 230, - '࣭' => 220, - '࣮' => 220, - '࣯' => 220, - 'ࣰ' => 27, - 'ࣱ' => 28, - 'ࣲ' => 29, - 'ࣳ' => 230, - 'ࣴ' => 230, - 'ࣵ' => 230, - 'ࣶ' => 220, - 'ࣷ' => 230, - 'ࣸ' => 230, - 'ࣹ' => 220, - 'ࣺ' => 220, - 'ࣻ' => 230, - 'ࣼ' => 230, - 'ࣽ' => 230, - 'ࣾ' => 230, - 'ࣿ' => 230, - '़' => 7, - '्' => 9, - '॑' => 230, - '॒' => 220, - '॓' => 230, - '॔' => 230, - '়' => 7, - '্' => 9, - '৾' => 230, - '਼' => 7, - '੍' => 9, - '઼' => 7, - '્' => 9, - '଼' => 7, - '୍' => 9, - '்' => 9, - '్' => 9, - 'ౕ' => 84, - 'ౖ' => 91, - '಼' => 7, - '್' => 9, - '഻' => 9, - '഼' => 9, - '്' => 9, - '්' => 9, - 'ุ' => 103, - 'ู' => 103, - 'ฺ' => 9, - '่' => 107, - '้' => 107, - '๊' => 107, - '๋' => 107, - 'ຸ' => 118, - 'ູ' => 118, - '຺' => 9, - '່' => 122, - '້' => 122, - '໊' => 122, - '໋' => 122, - '༘' => 220, - '༙' => 220, - '༵' => 220, - '༷' => 220, - '༹' => 216, - 'ཱ' => 129, - 'ི' => 130, - 'ུ' => 132, - 'ེ' => 130, - 'ཻ' => 130, - 'ོ' => 130, - 'ཽ' => 130, - 'ྀ' => 130, - 'ྂ' => 230, - 'ྃ' => 230, - '྄' => 9, - '྆' => 230, - '྇' => 230, - '࿆' => 220, - '့' => 7, - '္' => 9, - '်' => 9, - 'ႍ' => 220, - '፝' => 230, - '፞' => 230, - '፟' => 230, - '᜔' => 9, - '᜴' => 9, - '្' => 9, - '៝' => 230, - 'ᢩ' => 228, - '᤹' => 222, - '᤺' => 230, - '᤻' => 220, - 'ᨗ' => 230, - 'ᨘ' => 220, - '᩠' => 9, - '᩵' => 230, - '᩶' => 230, - '᩷' => 230, - '᩸' => 230, - '᩹' => 230, - '᩺' => 230, - '᩻' => 230, - '᩼' => 230, - '᩿' => 220, - '᪰' => 230, - '᪱' => 230, - '᪲' => 230, - '᪳' => 230, - '᪴' => 230, - '᪵' => 220, - '᪶' => 220, - '᪷' => 220, - '᪸' => 220, - '᪹' => 220, - '᪺' => 220, - '᪻' => 230, - '᪼' => 230, - '᪽' => 220, - 'ᪿ' => 220, - 'ᫀ' => 220, - '᬴' => 7, - '᭄' => 9, - '᭫' => 230, - '᭬' => 220, - '᭭' => 230, - '᭮' => 230, - '᭯' => 230, - '᭰' => 230, - '᭱' => 230, - '᭲' => 230, - '᭳' => 230, - '᮪' => 9, - '᮫' => 9, - '᯦' => 7, - '᯲' => 9, - '᯳' => 9, - '᰷' => 7, - '᳐' => 230, - '᳑' => 230, - '᳒' => 230, - '᳔' => 1, - '᳕' => 220, - '᳖' => 220, - '᳗' => 220, - '᳘' => 220, - '᳙' => 220, - '᳚' => 230, - '᳛' => 230, - '᳜' => 220, - '᳝' => 220, - '᳞' => 220, - '᳟' => 220, - '᳠' => 230, - '᳢' => 1, - '᳣' => 1, - '᳤' => 1, - '᳥' => 1, - '᳦' => 1, - '᳧' => 1, - '᳨' => 1, - '᳭' => 220, - '᳴' => 230, - '᳸' => 230, - '᳹' => 230, - '᷀' => 230, - '᷁' => 230, - '᷂' => 220, - '᷃' => 230, - '᷄' => 230, - '᷅' => 230, - '᷆' => 230, - '᷇' => 230, - '᷈' => 230, - '᷉' => 230, - '᷊' => 220, - '᷋' => 230, - '᷌' => 230, - '᷍' => 234, - '᷎' => 214, - '᷏' => 220, - '᷐' => 202, - '᷑' => 230, - '᷒' => 230, - 'ᷓ' => 230, - 'ᷔ' => 230, - 'ᷕ' => 230, - 'ᷖ' => 230, - 'ᷗ' => 230, - 'ᷘ' => 230, - 'ᷙ' => 230, - 'ᷚ' => 230, - 'ᷛ' => 230, - 'ᷜ' => 230, - 'ᷝ' => 230, - 'ᷞ' => 230, - 'ᷟ' => 230, - 'ᷠ' => 230, - 'ᷡ' => 230, - 'ᷢ' => 230, - 'ᷣ' => 230, - 'ᷤ' => 230, - 'ᷥ' => 230, - 'ᷦ' => 230, - 'ᷧ' => 230, - 'ᷨ' => 230, - 'ᷩ' => 230, - 'ᷪ' => 230, - 'ᷫ' => 230, - 'ᷬ' => 230, - 'ᷭ' => 230, - 'ᷮ' => 230, - 'ᷯ' => 230, - 'ᷰ' => 230, - 'ᷱ' => 230, - 'ᷲ' => 230, - 'ᷳ' => 230, - 'ᷴ' => 230, - '᷵' => 230, - '᷶' => 232, - '᷷' => 228, - '᷸' => 228, - '᷹' => 220, - '᷻' => 230, - '᷼' => 233, - '᷽' => 220, - '᷾' => 230, - '᷿' => 220, - '⃐' => 230, - '⃑' => 230, - '⃒' => 1, - '⃓' => 1, - '⃔' => 230, - '⃕' => 230, - '⃖' => 230, - '⃗' => 230, - '⃘' => 1, - '⃙' => 1, - '⃚' => 1, - '⃛' => 230, - '⃜' => 230, - '⃡' => 230, - '⃥' => 1, - '⃦' => 1, - '⃧' => 230, - '⃨' => 220, - '⃩' => 230, - '⃪' => 1, - '⃫' => 1, - '⃬' => 220, - '⃭' => 220, - '⃮' => 220, - '⃯' => 220, - '⃰' => 230, - '⳯' => 230, - '⳰' => 230, - '⳱' => 230, - '⵿' => 9, - 'ⷠ' => 230, - 'ⷡ' => 230, - 'ⷢ' => 230, - 'ⷣ' => 230, - 'ⷤ' => 230, - 'ⷥ' => 230, - 'ⷦ' => 230, - 'ⷧ' => 230, - 'ⷨ' => 230, - 'ⷩ' => 230, - 'ⷪ' => 230, - 'ⷫ' => 230, - 'ⷬ' => 230, - 'ⷭ' => 230, - 'ⷮ' => 230, - 'ⷯ' => 230, - 'ⷰ' => 230, - 'ⷱ' => 230, - 'ⷲ' => 230, - 'ⷳ' => 230, - 'ⷴ' => 230, - 'ⷵ' => 230, - 'ⷶ' => 230, - 'ⷷ' => 230, - 'ⷸ' => 230, - 'ⷹ' => 230, - 'ⷺ' => 230, - 'ⷻ' => 230, - 'ⷼ' => 230, - 'ⷽ' => 230, - 'ⷾ' => 230, - 'ⷿ' => 230, - '〪' => 218, - '〫' => 228, - '〬' => 232, - '〭' => 222, - '〮' => 224, - '〯' => 224, - '゙' => 8, - '゚' => 8, - '꙯' => 230, - 'ꙴ' => 230, - 'ꙵ' => 230, - 'ꙶ' => 230, - 'ꙷ' => 230, - 'ꙸ' => 230, - 'ꙹ' => 230, - 'ꙺ' => 230, - 'ꙻ' => 230, - '꙼' => 230, - '꙽' => 230, - 'ꚞ' => 230, - 'ꚟ' => 230, - '꛰' => 230, - '꛱' => 230, - '꠆' => 9, - '꠬' => 9, - '꣄' => 9, - '꣠' => 230, - '꣡' => 230, - '꣢' => 230, - '꣣' => 230, - '꣤' => 230, - '꣥' => 230, - '꣦' => 230, - '꣧' => 230, - '꣨' => 230, - '꣩' => 230, - '꣪' => 230, - '꣫' => 230, - '꣬' => 230, - '꣭' => 230, - '꣮' => 230, - '꣯' => 230, - '꣰' => 230, - '꣱' => 230, - '꤫' => 220, - '꤬' => 220, - '꤭' => 220, - '꥓' => 9, - '꦳' => 7, - '꧀' => 9, - 'ꪰ' => 230, - 'ꪲ' => 230, - 'ꪳ' => 230, - 'ꪴ' => 220, - 'ꪷ' => 230, - 'ꪸ' => 230, - 'ꪾ' => 230, - '꪿' => 230, - '꫁' => 230, - '꫶' => 9, - '꯭' => 9, - 'ﬞ' => 26, - '︠' => 230, - '︡' => 230, - '︢' => 230, - '︣' => 230, - '︤' => 230, - '︥' => 230, - '︦' => 230, - '︧' => 220, - '︨' => 220, - '︩' => 220, - '︪' => 220, - '︫' => 220, - '︬' => 220, - '︭' => 220, - '︮' => 230, - '︯' => 230, - '𐇽' => 220, - '𐋠' => 220, - '𐍶' => 230, - '𐍷' => 230, - '𐍸' => 230, - '𐍹' => 230, - '𐍺' => 230, - '𐨍' => 220, - '𐨏' => 230, - '𐨸' => 230, - '𐨹' => 1, - '𐨺' => 220, - '𐨿' => 9, - '𐫥' => 230, - '𐫦' => 220, - '𐴤' => 230, - '𐴥' => 230, - '𐴦' => 230, - '𐴧' => 230, - '𐺫' => 230, - '𐺬' => 230, - '𐽆' => 220, - '𐽇' => 220, - '𐽈' => 230, - '𐽉' => 230, - '𐽊' => 230, - '𐽋' => 220, - '𐽌' => 230, - '𐽍' => 220, - '𐽎' => 220, - '𐽏' => 220, - '𐽐' => 220, - '𑁆' => 9, - '𑁿' => 9, - '𑂹' => 9, - '𑂺' => 7, - '𑄀' => 230, - '𑄁' => 230, - '𑄂' => 230, - '𑄳' => 9, - '𑄴' => 9, - '𑅳' => 7, - '𑇀' => 9, - '𑇊' => 7, - '𑈵' => 9, - '𑈶' => 7, - '𑋩' => 7, - '𑋪' => 9, - '𑌻' => 7, - '𑌼' => 7, - '𑍍' => 9, - '𑍦' => 230, - '𑍧' => 230, - '𑍨' => 230, - '𑍩' => 230, - '𑍪' => 230, - '𑍫' => 230, - '𑍬' => 230, - '𑍰' => 230, - '𑍱' => 230, - '𑍲' => 230, - '𑍳' => 230, - '𑍴' => 230, - '𑑂' => 9, - '𑑆' => 7, - '𑑞' => 230, - '𑓂' => 9, - '𑓃' => 7, - '𑖿' => 9, - '𑗀' => 7, - '𑘿' => 9, - '𑚶' => 9, - '𑚷' => 7, - '𑜫' => 9, - '𑠹' => 9, - '𑠺' => 7, - '𑤽' => 9, - '𑤾' => 9, - '𑥃' => 7, - '𑧠' => 9, - '𑨴' => 9, - '𑩇' => 9, - '𑪙' => 9, - '𑰿' => 9, - '𑵂' => 7, - '𑵄' => 9, - '𑵅' => 9, - '𑶗' => 9, - '𖫰' => 1, - '𖫱' => 1, - '𖫲' => 1, - '𖫳' => 1, - '𖫴' => 1, - '𖬰' => 230, - '𖬱' => 230, - '𖬲' => 230, - '𖬳' => 230, - '𖬴' => 230, - '𖬵' => 230, - '𖬶' => 230, - '𖿰' => 6, - '𖿱' => 6, - '𛲞' => 1, - '𝅥' => 216, - '𝅦' => 216, - '𝅧' => 1, - '𝅨' => 1, - '𝅩' => 1, - '𝅭' => 226, - '𝅮' => 216, - '𝅯' => 216, - '𝅰' => 216, - '𝅱' => 216, - '𝅲' => 216, - '𝅻' => 220, - '𝅼' => 220, - '𝅽' => 220, - '𝅾' => 220, - '𝅿' => 220, - '𝆀' => 220, - '𝆁' => 220, - '𝆂' => 220, - '𝆅' => 230, - '𝆆' => 230, - '𝆇' => 230, - '𝆈' => 230, - '𝆉' => 230, - '𝆊' => 220, - '𝆋' => 220, - '𝆪' => 230, - '𝆫' => 230, - '𝆬' => 230, - '𝆭' => 230, - '𝉂' => 230, - '𝉃' => 230, - '𝉄' => 230, - '𞀀' => 230, - '𞀁' => 230, - '𞀂' => 230, - '𞀃' => 230, - '𞀄' => 230, - '𞀅' => 230, - '𞀆' => 230, - '𞀈' => 230, - '𞀉' => 230, - '𞀊' => 230, - '𞀋' => 230, - '𞀌' => 230, - '𞀍' => 230, - '𞀎' => 230, - '𞀏' => 230, - '𞀐' => 230, - '𞀑' => 230, - '𞀒' => 230, - '𞀓' => 230, - '𞀔' => 230, - '𞀕' => 230, - '𞀖' => 230, - '𞀗' => 230, - '𞀘' => 230, - '𞀛' => 230, - '𞀜' => 230, - '𞀝' => 230, - '𞀞' => 230, - '𞀟' => 230, - '𞀠' => 230, - '𞀡' => 230, - '𞀣' => 230, - '𞀤' => 230, - '𞀦' => 230, - '𞀧' => 230, - '𞀨' => 230, - '𞀩' => 230, - '𞀪' => 230, - '𞄰' => 230, - '𞄱' => 230, - '𞄲' => 230, - '𞄳' => 230, - '𞄴' => 230, - '𞄵' => 230, - '𞄶' => 230, - '𞋬' => 230, - '𞋭' => 230, - '𞋮' => 230, - '𞋯' => 230, - '𞣐' => 220, - '𞣑' => 220, - '𞣒' => 220, - '𞣓' => 220, - '𞣔' => 220, - '𞣕' => 220, - '𞣖' => 220, - '𞥄' => 230, - '𞥅' => 230, - '𞥆' => 230, - '𞥇' => 230, - '𞥈' => 230, - '𞥉' => 230, - '𞥊' => 7, -); diff --git a/app/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php b/app/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php deleted file mode 100644 index 157490289..000000000 --- a/app/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php +++ /dev/null @@ -1,3695 +0,0 @@ - ' ', - '¨' => ' ̈', - 'ª' => 'a', - '¯' => ' ̄', - '²' => '2', - '³' => '3', - '´' => ' ́', - 'µ' => 'μ', - '¸' => ' ̧', - '¹' => '1', - 'º' => 'o', - '¼' => '1⁄4', - '½' => '1⁄2', - '¾' => '3⁄4', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ŀ' => 'L·', - 'ŀ' => 'l·', - 'ʼn' => 'ʼn', - 'ſ' => 's', - 'DŽ' => 'DŽ', - 'Dž' => 'Dž', - 'dž' => 'dž', - 'LJ' => 'LJ', - 'Lj' => 'Lj', - 'lj' => 'lj', - 'NJ' => 'NJ', - 'Nj' => 'Nj', - 'nj' => 'nj', - 'DZ' => 'DZ', - 'Dz' => 'Dz', - 'dz' => 'dz', - 'ʰ' => 'h', - 'ʱ' => 'ɦ', - 'ʲ' => 'j', - 'ʳ' => 'r', - 'ʴ' => 'ɹ', - 'ʵ' => 'ɻ', - 'ʶ' => 'ʁ', - 'ʷ' => 'w', - 'ʸ' => 'y', - '˘' => ' ̆', - '˙' => ' ̇', - '˚' => ' ̊', - '˛' => ' ̨', - '˜' => ' ̃', - '˝' => ' ̋', - 'ˠ' => 'ɣ', - 'ˡ' => 'l', - 'ˢ' => 's', - 'ˣ' => 'x', - 'ˤ' => 'ʕ', - 'ͺ' => ' ͅ', - '΄' => ' ́', - '΅' => ' ̈́', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϒ' => 'Υ', - 'ϓ' => 'Ύ', - 'ϔ' => 'Ϋ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϲ' => 'ς', - 'ϴ' => 'Θ', - 'ϵ' => 'ε', - 'Ϲ' => 'Σ', - 'և' => 'եւ', - 'ٵ' => 'اٴ', - 'ٶ' => 'وٴ', - 'ٷ' => 'ۇٴ', - 'ٸ' => 'يٴ', - 'ำ' => 'ํา', - 'ຳ' => 'ໍາ', - 'ໜ' => 'ຫນ', - 'ໝ' => 'ຫມ', - '༌' => '་', - 'ཷ' => 'ྲཱྀ', - 'ཹ' => 'ླཱྀ', - 'ჼ' => 'ნ', - 'ᴬ' => 'A', - 'ᴭ' => 'Æ', - 'ᴮ' => 'B', - 'ᴰ' => 'D', - 'ᴱ' => 'E', - 'ᴲ' => 'Ǝ', - 'ᴳ' => 'G', - 'ᴴ' => 'H', - 'ᴵ' => 'I', - 'ᴶ' => 'J', - 'ᴷ' => 'K', - 'ᴸ' => 'L', - 'ᴹ' => 'M', - 'ᴺ' => 'N', - 'ᴼ' => 'O', - 'ᴽ' => 'Ȣ', - 'ᴾ' => 'P', - 'ᴿ' => 'R', - 'ᵀ' => 'T', - 'ᵁ' => 'U', - 'ᵂ' => 'W', - 'ᵃ' => 'a', - 'ᵄ' => 'ɐ', - 'ᵅ' => 'ɑ', - 'ᵆ' => 'ᴂ', - 'ᵇ' => 'b', - 'ᵈ' => 'd', - 'ᵉ' => 'e', - 'ᵊ' => 'ə', - 'ᵋ' => 'ɛ', - 'ᵌ' => 'ɜ', - 'ᵍ' => 'g', - 'ᵏ' => 'k', - 'ᵐ' => 'm', - 'ᵑ' => 'ŋ', - 'ᵒ' => 'o', - 'ᵓ' => 'ɔ', - 'ᵔ' => 'ᴖ', - 'ᵕ' => 'ᴗ', - 'ᵖ' => 'p', - 'ᵗ' => 't', - 'ᵘ' => 'u', - 'ᵙ' => 'ᴝ', - 'ᵚ' => 'ɯ', - 'ᵛ' => 'v', - 'ᵜ' => 'ᴥ', - 'ᵝ' => 'β', - 'ᵞ' => 'γ', - 'ᵟ' => 'δ', - 'ᵠ' => 'φ', - 'ᵡ' => 'χ', - 'ᵢ' => 'i', - 'ᵣ' => 'r', - 'ᵤ' => 'u', - 'ᵥ' => 'v', - 'ᵦ' => 'β', - 'ᵧ' => 'γ', - 'ᵨ' => 'ρ', - 'ᵩ' => 'φ', - 'ᵪ' => 'χ', - 'ᵸ' => 'н', - 'ᶛ' => 'ɒ', - 'ᶜ' => 'c', - 'ᶝ' => 'ɕ', - 'ᶞ' => 'ð', - 'ᶟ' => 'ɜ', - 'ᶠ' => 'f', - 'ᶡ' => 'ɟ', - 'ᶢ' => 'ɡ', - 'ᶣ' => 'ɥ', - 'ᶤ' => 'ɨ', - 'ᶥ' => 'ɩ', - 'ᶦ' => 'ɪ', - 'ᶧ' => 'ᵻ', - 'ᶨ' => 'ʝ', - 'ᶩ' => 'ɭ', - 'ᶪ' => 'ᶅ', - 'ᶫ' => 'ʟ', - 'ᶬ' => 'ɱ', - 'ᶭ' => 'ɰ', - 'ᶮ' => 'ɲ', - 'ᶯ' => 'ɳ', - 'ᶰ' => 'ɴ', - 'ᶱ' => 'ɵ', - 'ᶲ' => 'ɸ', - 'ᶳ' => 'ʂ', - 'ᶴ' => 'ʃ', - 'ᶵ' => 'ƫ', - 'ᶶ' => 'ʉ', - 'ᶷ' => 'ʊ', - 'ᶸ' => 'ᴜ', - 'ᶹ' => 'ʋ', - 'ᶺ' => 'ʌ', - 'ᶻ' => 'z', - 'ᶼ' => 'ʐ', - 'ᶽ' => 'ʑ', - 'ᶾ' => 'ʒ', - 'ᶿ' => 'θ', - 'ẚ' => 'aʾ', - 'ẛ' => 'ṡ', - '᾽' => ' ̓', - '᾿' => ' ̓', - '῀' => ' ͂', - '῁' => ' ̈͂', - '῍' => ' ̓̀', - '῎' => ' ̓́', - '῏' => ' ̓͂', - '῝' => ' ̔̀', - '῞' => ' ̔́', - '῟' => ' ̔͂', - '῭' => ' ̈̀', - '΅' => ' ̈́', - '´' => ' ́', - '῾' => ' ̔', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - '‑' => '‐', - '‗' => ' ̳', - '․' => '.', - '‥' => '..', - '…' => '...', - ' ' => ' ', - '″' => '′′', - '‴' => '′′′', - '‶' => '‵‵', - '‷' => '‵‵‵', - '‼' => '!!', - '‾' => ' ̅', - '⁇' => '??', - '⁈' => '?!', - '⁉' => '!?', - '⁗' => '′′′′', - ' ' => ' ', - '⁰' => '0', - 'ⁱ' => 'i', - '⁴' => '4', - '⁵' => '5', - '⁶' => '6', - '⁷' => '7', - '⁸' => '8', - '⁹' => '9', - '⁺' => '+', - '⁻' => '−', - '⁼' => '=', - '⁽' => '(', - '⁾' => ')', - 'ⁿ' => 'n', - '₀' => '0', - '₁' => '1', - '₂' => '2', - '₃' => '3', - '₄' => '4', - '₅' => '5', - '₆' => '6', - '₇' => '7', - '₈' => '8', - '₉' => '9', - '₊' => '+', - '₋' => '−', - '₌' => '=', - '₍' => '(', - '₎' => ')', - 'ₐ' => 'a', - 'ₑ' => 'e', - 'ₒ' => 'o', - 'ₓ' => 'x', - 'ₔ' => 'ə', - 'ₕ' => 'h', - 'ₖ' => 'k', - 'ₗ' => 'l', - 'ₘ' => 'm', - 'ₙ' => 'n', - 'ₚ' => 'p', - 'ₛ' => 's', - 'ₜ' => 't', - '₨' => 'Rs', - '℀' => 'a/c', - '℁' => 'a/s', - 'ℂ' => 'C', - '℃' => '°C', - '℅' => 'c/o', - '℆' => 'c/u', - 'ℇ' => 'Ɛ', - '℉' => '°F', - 'ℊ' => 'g', - 'ℋ' => 'H', - 'ℌ' => 'H', - 'ℍ' => 'H', - 'ℎ' => 'h', - 'ℏ' => 'ħ', - 'ℐ' => 'I', - 'ℑ' => 'I', - 'ℒ' => 'L', - 'ℓ' => 'l', - 'ℕ' => 'N', - '№' => 'No', - 'ℙ' => 'P', - 'ℚ' => 'Q', - 'ℛ' => 'R', - 'ℜ' => 'R', - 'ℝ' => 'R', - '℠' => 'SM', - '℡' => 'TEL', - '™' => 'TM', - 'ℤ' => 'Z', - 'ℨ' => 'Z', - 'ℬ' => 'B', - 'ℭ' => 'C', - 'ℯ' => 'e', - 'ℰ' => 'E', - 'ℱ' => 'F', - 'ℳ' => 'M', - 'ℴ' => 'o', - 'ℵ' => 'א', - 'ℶ' => 'ב', - 'ℷ' => 'ג', - 'ℸ' => 'ד', - 'ℹ' => 'i', - '℻' => 'FAX', - 'ℼ' => 'π', - 'ℽ' => 'γ', - 'ℾ' => 'Γ', - 'ℿ' => 'Π', - '⅀' => '∑', - 'ⅅ' => 'D', - 'ⅆ' => 'd', - 'ⅇ' => 'e', - 'ⅈ' => 'i', - 'ⅉ' => 'j', - '⅐' => '1⁄7', - '⅑' => '1⁄9', - '⅒' => '1⁄10', - '⅓' => '1⁄3', - '⅔' => '2⁄3', - '⅕' => '1⁄5', - '⅖' => '2⁄5', - '⅗' => '3⁄5', - '⅘' => '4⁄5', - '⅙' => '1⁄6', - '⅚' => '5⁄6', - '⅛' => '1⁄8', - '⅜' => '3⁄8', - '⅝' => '5⁄8', - '⅞' => '7⁄8', - '⅟' => '1⁄', - 'Ⅰ' => 'I', - 'Ⅱ' => 'II', - 'Ⅲ' => 'III', - 'Ⅳ' => 'IV', - 'Ⅴ' => 'V', - 'Ⅵ' => 'VI', - 'Ⅶ' => 'VII', - 'Ⅷ' => 'VIII', - 'Ⅸ' => 'IX', - 'Ⅹ' => 'X', - 'Ⅺ' => 'XI', - 'Ⅻ' => 'XII', - 'Ⅼ' => 'L', - 'Ⅽ' => 'C', - 'Ⅾ' => 'D', - 'Ⅿ' => 'M', - 'ⅰ' => 'i', - 'ⅱ' => 'ii', - 'ⅲ' => 'iii', - 'ⅳ' => 'iv', - 'ⅴ' => 'v', - 'ⅵ' => 'vi', - 'ⅶ' => 'vii', - 'ⅷ' => 'viii', - 'ⅸ' => 'ix', - 'ⅹ' => 'x', - 'ⅺ' => 'xi', - 'ⅻ' => 'xii', - 'ⅼ' => 'l', - 'ⅽ' => 'c', - 'ⅾ' => 'd', - 'ⅿ' => 'm', - '↉' => '0⁄3', - '∬' => '∫∫', - '∭' => '∫∫∫', - '∯' => '∮∮', - '∰' => '∮∮∮', - '①' => '1', - '②' => '2', - '③' => '3', - '④' => '4', - '⑤' => '5', - '⑥' => '6', - '⑦' => '7', - '⑧' => '8', - '⑨' => '9', - '⑩' => '10', - '⑪' => '11', - '⑫' => '12', - '⑬' => '13', - '⑭' => '14', - '⑮' => '15', - '⑯' => '16', - '⑰' => '17', - '⑱' => '18', - '⑲' => '19', - '⑳' => '20', - '⑴' => '(1)', - '⑵' => '(2)', - '⑶' => '(3)', - '⑷' => '(4)', - '⑸' => '(5)', - '⑹' => '(6)', - '⑺' => '(7)', - '⑻' => '(8)', - '⑼' => '(9)', - '⑽' => '(10)', - '⑾' => '(11)', - '⑿' => '(12)', - '⒀' => '(13)', - '⒁' => '(14)', - '⒂' => '(15)', - '⒃' => '(16)', - '⒄' => '(17)', - '⒅' => '(18)', - '⒆' => '(19)', - '⒇' => '(20)', - '⒈' => '1.', - '⒉' => '2.', - '⒊' => '3.', - '⒋' => '4.', - '⒌' => '5.', - '⒍' => '6.', - '⒎' => '7.', - '⒏' => '8.', - '⒐' => '9.', - '⒑' => '10.', - '⒒' => '11.', - '⒓' => '12.', - '⒔' => '13.', - '⒕' => '14.', - '⒖' => '15.', - '⒗' => '16.', - '⒘' => '17.', - '⒙' => '18.', - '⒚' => '19.', - '⒛' => '20.', - '⒜' => '(a)', - '⒝' => '(b)', - '⒞' => '(c)', - '⒟' => '(d)', - '⒠' => '(e)', - '⒡' => '(f)', - '⒢' => '(g)', - '⒣' => '(h)', - '⒤' => '(i)', - '⒥' => '(j)', - '⒦' => '(k)', - '⒧' => '(l)', - '⒨' => '(m)', - '⒩' => '(n)', - '⒪' => '(o)', - '⒫' => '(p)', - '⒬' => '(q)', - '⒭' => '(r)', - '⒮' => '(s)', - '⒯' => '(t)', - '⒰' => '(u)', - '⒱' => '(v)', - '⒲' => '(w)', - '⒳' => '(x)', - '⒴' => '(y)', - '⒵' => '(z)', - 'Ⓐ' => 'A', - 'Ⓑ' => 'B', - 'Ⓒ' => 'C', - 'Ⓓ' => 'D', - 'Ⓔ' => 'E', - 'Ⓕ' => 'F', - 'Ⓖ' => 'G', - 'Ⓗ' => 'H', - 'Ⓘ' => 'I', - 'Ⓙ' => 'J', - 'Ⓚ' => 'K', - 'Ⓛ' => 'L', - 'Ⓜ' => 'M', - 'Ⓝ' => 'N', - 'Ⓞ' => 'O', - 'Ⓟ' => 'P', - 'Ⓠ' => 'Q', - 'Ⓡ' => 'R', - 'Ⓢ' => 'S', - 'Ⓣ' => 'T', - 'Ⓤ' => 'U', - 'Ⓥ' => 'V', - 'Ⓦ' => 'W', - 'Ⓧ' => 'X', - 'Ⓨ' => 'Y', - 'Ⓩ' => 'Z', - 'ⓐ' => 'a', - 'ⓑ' => 'b', - 'ⓒ' => 'c', - 'ⓓ' => 'd', - 'ⓔ' => 'e', - 'ⓕ' => 'f', - 'ⓖ' => 'g', - 'ⓗ' => 'h', - 'ⓘ' => 'i', - 'ⓙ' => 'j', - 'ⓚ' => 'k', - 'ⓛ' => 'l', - 'ⓜ' => 'm', - 'ⓝ' => 'n', - 'ⓞ' => 'o', - 'ⓟ' => 'p', - 'ⓠ' => 'q', - 'ⓡ' => 'r', - 'ⓢ' => 's', - 'ⓣ' => 't', - 'ⓤ' => 'u', - 'ⓥ' => 'v', - 'ⓦ' => 'w', - 'ⓧ' => 'x', - 'ⓨ' => 'y', - 'ⓩ' => 'z', - '⓪' => '0', - '⨌' => '∫∫∫∫', - '⩴' => '::=', - '⩵' => '==', - '⩶' => '===', - 'ⱼ' => 'j', - 'ⱽ' => 'V', - 'ⵯ' => 'ⵡ', - '⺟' => '母', - '⻳' => '龟', - '⼀' => '一', - '⼁' => '丨', - '⼂' => '丶', - '⼃' => '丿', - '⼄' => '乙', - '⼅' => '亅', - '⼆' => '二', - '⼇' => '亠', - '⼈' => '人', - '⼉' => '儿', - '⼊' => '入', - '⼋' => '八', - '⼌' => '冂', - '⼍' => '冖', - '⼎' => '冫', - '⼏' => '几', - '⼐' => '凵', - '⼑' => '刀', - '⼒' => '力', - '⼓' => '勹', - '⼔' => '匕', - '⼕' => '匚', - '⼖' => '匸', - '⼗' => '十', - '⼘' => '卜', - '⼙' => '卩', - '⼚' => '厂', - '⼛' => '厶', - '⼜' => '又', - '⼝' => '口', - '⼞' => '囗', - '⼟' => '土', - '⼠' => '士', - '⼡' => '夂', - '⼢' => '夊', - '⼣' => '夕', - '⼤' => '大', - '⼥' => '女', - '⼦' => '子', - '⼧' => '宀', - '⼨' => '寸', - '⼩' => '小', - '⼪' => '尢', - '⼫' => '尸', - '⼬' => '屮', - '⼭' => '山', - '⼮' => '巛', - '⼯' => '工', - '⼰' => '己', - '⼱' => '巾', - '⼲' => '干', - '⼳' => '幺', - '⼴' => '广', - '⼵' => '廴', - '⼶' => '廾', - '⼷' => '弋', - '⼸' => '弓', - '⼹' => '彐', - '⼺' => '彡', - '⼻' => '彳', - '⼼' => '心', - '⼽' => '戈', - '⼾' => '戶', - '⼿' => '手', - '⽀' => '支', - '⽁' => '攴', - '⽂' => '文', - '⽃' => '斗', - '⽄' => '斤', - '⽅' => '方', - '⽆' => '无', - '⽇' => '日', - '⽈' => '曰', - '⽉' => '月', - '⽊' => '木', - '⽋' => '欠', - '⽌' => '止', - '⽍' => '歹', - '⽎' => '殳', - '⽏' => '毋', - '⽐' => '比', - '⽑' => '毛', - '⽒' => '氏', - '⽓' => '气', - '⽔' => '水', - '⽕' => '火', - '⽖' => '爪', - '⽗' => '父', - '⽘' => '爻', - '⽙' => '爿', - '⽚' => '片', - '⽛' => '牙', - '⽜' => '牛', - '⽝' => '犬', - '⽞' => '玄', - '⽟' => '玉', - '⽠' => '瓜', - '⽡' => '瓦', - '⽢' => '甘', - '⽣' => '生', - '⽤' => '用', - '⽥' => '田', - '⽦' => '疋', - '⽧' => '疒', - '⽨' => '癶', - '⽩' => '白', - '⽪' => '皮', - '⽫' => '皿', - '⽬' => '目', - '⽭' => '矛', - '⽮' => '矢', - '⽯' => '石', - '⽰' => '示', - '⽱' => '禸', - '⽲' => '禾', - '⽳' => '穴', - '⽴' => '立', - '⽵' => '竹', - '⽶' => '米', - '⽷' => '糸', - '⽸' => '缶', - '⽹' => '网', - '⽺' => '羊', - '⽻' => '羽', - '⽼' => '老', - '⽽' => '而', - '⽾' => '耒', - '⽿' => '耳', - '⾀' => '聿', - '⾁' => '肉', - '⾂' => '臣', - '⾃' => '自', - '⾄' => '至', - '⾅' => '臼', - '⾆' => '舌', - '⾇' => '舛', - '⾈' => '舟', - '⾉' => '艮', - '⾊' => '色', - '⾋' => '艸', - '⾌' => '虍', - '⾍' => '虫', - '⾎' => '血', - '⾏' => '行', - '⾐' => '衣', - '⾑' => '襾', - '⾒' => '見', - '⾓' => '角', - '⾔' => '言', - '⾕' => '谷', - '⾖' => '豆', - '⾗' => '豕', - '⾘' => '豸', - '⾙' => '貝', - '⾚' => '赤', - '⾛' => '走', - '⾜' => '足', - '⾝' => '身', - '⾞' => '車', - '⾟' => '辛', - '⾠' => '辰', - '⾡' => '辵', - '⾢' => '邑', - '⾣' => '酉', - '⾤' => '釆', - '⾥' => '里', - '⾦' => '金', - '⾧' => '長', - '⾨' => '門', - '⾩' => '阜', - '⾪' => '隶', - '⾫' => '隹', - '⾬' => '雨', - '⾭' => '靑', - '⾮' => '非', - '⾯' => '面', - '⾰' => '革', - '⾱' => '韋', - '⾲' => '韭', - '⾳' => '音', - '⾴' => '頁', - '⾵' => '風', - '⾶' => '飛', - '⾷' => '食', - '⾸' => '首', - '⾹' => '香', - '⾺' => '馬', - '⾻' => '骨', - '⾼' => '高', - '⾽' => '髟', - '⾾' => '鬥', - '⾿' => '鬯', - '⿀' => '鬲', - '⿁' => '鬼', - '⿂' => '魚', - '⿃' => '鳥', - '⿄' => '鹵', - '⿅' => '鹿', - '⿆' => '麥', - '⿇' => '麻', - '⿈' => '黃', - '⿉' => '黍', - '⿊' => '黑', - '⿋' => '黹', - '⿌' => '黽', - '⿍' => '鼎', - '⿎' => '鼓', - '⿏' => '鼠', - '⿐' => '鼻', - '⿑' => '齊', - '⿒' => '齒', - '⿓' => '龍', - '⿔' => '龜', - '⿕' => '龠', - ' ' => ' ', - '〶' => '〒', - '〸' => '十', - '〹' => '卄', - '〺' => '卅', - '゛' => ' ゙', - '゜' => ' ゚', - 'ゟ' => 'より', - 'ヿ' => 'コト', - 'ㄱ' => 'ᄀ', - 'ㄲ' => 'ᄁ', - 'ㄳ' => 'ᆪ', - 'ㄴ' => 'ᄂ', - 'ㄵ' => 'ᆬ', - 'ㄶ' => 'ᆭ', - 'ㄷ' => 'ᄃ', - 'ㄸ' => 'ᄄ', - 'ㄹ' => 'ᄅ', - 'ㄺ' => 'ᆰ', - 'ㄻ' => 'ᆱ', - 'ㄼ' => 'ᆲ', - 'ㄽ' => 'ᆳ', - 'ㄾ' => 'ᆴ', - 'ㄿ' => 'ᆵ', - 'ㅀ' => 'ᄚ', - 'ㅁ' => 'ᄆ', - 'ㅂ' => 'ᄇ', - 'ㅃ' => 'ᄈ', - 'ㅄ' => 'ᄡ', - 'ㅅ' => 'ᄉ', - 'ㅆ' => 'ᄊ', - 'ㅇ' => 'ᄋ', - 'ㅈ' => 'ᄌ', - 'ㅉ' => 'ᄍ', - 'ㅊ' => 'ᄎ', - 'ㅋ' => 'ᄏ', - 'ㅌ' => 'ᄐ', - 'ㅍ' => 'ᄑ', - 'ㅎ' => 'ᄒ', - 'ㅏ' => 'ᅡ', - 'ㅐ' => 'ᅢ', - 'ㅑ' => 'ᅣ', - 'ㅒ' => 'ᅤ', - 'ㅓ' => 'ᅥ', - 'ㅔ' => 'ᅦ', - 'ㅕ' => 'ᅧ', - 'ㅖ' => 'ᅨ', - 'ㅗ' => 'ᅩ', - 'ㅘ' => 'ᅪ', - 'ㅙ' => 'ᅫ', - 'ㅚ' => 'ᅬ', - 'ㅛ' => 'ᅭ', - 'ㅜ' => 'ᅮ', - 'ㅝ' => 'ᅯ', - 'ㅞ' => 'ᅰ', - 'ㅟ' => 'ᅱ', - 'ㅠ' => 'ᅲ', - 'ㅡ' => 'ᅳ', - 'ㅢ' => 'ᅴ', - 'ㅣ' => 'ᅵ', - 'ㅤ' => 'ᅠ', - 'ㅥ' => 'ᄔ', - 'ㅦ' => 'ᄕ', - 'ㅧ' => 'ᇇ', - 'ㅨ' => 'ᇈ', - 'ㅩ' => 'ᇌ', - 'ㅪ' => 'ᇎ', - 'ㅫ' => 'ᇓ', - 'ㅬ' => 'ᇗ', - 'ㅭ' => 'ᇙ', - 'ㅮ' => 'ᄜ', - 'ㅯ' => 'ᇝ', - 'ㅰ' => 'ᇟ', - 'ㅱ' => 'ᄝ', - 'ㅲ' => 'ᄞ', - 'ㅳ' => 'ᄠ', - 'ㅴ' => 'ᄢ', - 'ㅵ' => 'ᄣ', - 'ㅶ' => 'ᄧ', - 'ㅷ' => 'ᄩ', - 'ㅸ' => 'ᄫ', - 'ㅹ' => 'ᄬ', - 'ㅺ' => 'ᄭ', - 'ㅻ' => 'ᄮ', - 'ㅼ' => 'ᄯ', - 'ㅽ' => 'ᄲ', - 'ㅾ' => 'ᄶ', - 'ㅿ' => 'ᅀ', - 'ㆀ' => 'ᅇ', - 'ㆁ' => 'ᅌ', - 'ㆂ' => 'ᇱ', - 'ㆃ' => 'ᇲ', - 'ㆄ' => 'ᅗ', - 'ㆅ' => 'ᅘ', - 'ㆆ' => 'ᅙ', - 'ㆇ' => 'ᆄ', - 'ㆈ' => 'ᆅ', - 'ㆉ' => 'ᆈ', - 'ㆊ' => 'ᆑ', - 'ㆋ' => 'ᆒ', - 'ㆌ' => 'ᆔ', - 'ㆍ' => 'ᆞ', - 'ㆎ' => 'ᆡ', - '㆒' => '一', - '㆓' => '二', - '㆔' => '三', - '㆕' => '四', - '㆖' => '上', - '㆗' => '中', - '㆘' => '下', - '㆙' => '甲', - '㆚' => '乙', - '㆛' => '丙', - '㆜' => '丁', - '㆝' => '天', - '㆞' => '地', - '㆟' => '人', - '㈀' => '(ᄀ)', - '㈁' => '(ᄂ)', - '㈂' => '(ᄃ)', - '㈃' => '(ᄅ)', - '㈄' => '(ᄆ)', - '㈅' => '(ᄇ)', - '㈆' => '(ᄉ)', - '㈇' => '(ᄋ)', - '㈈' => '(ᄌ)', - '㈉' => '(ᄎ)', - '㈊' => '(ᄏ)', - '㈋' => '(ᄐ)', - '㈌' => '(ᄑ)', - '㈍' => '(ᄒ)', - '㈎' => '(가)', - '㈏' => '(나)', - '㈐' => '(다)', - '㈑' => '(라)', - '㈒' => '(마)', - '㈓' => '(바)', - '㈔' => '(사)', - '㈕' => '(아)', - '㈖' => '(자)', - '㈗' => '(차)', - '㈘' => '(카)', - '㈙' => '(타)', - '㈚' => '(파)', - '㈛' => '(하)', - '㈜' => '(주)', - '㈝' => '(오전)', - '㈞' => '(오후)', - '㈠' => '(一)', - '㈡' => '(二)', - '㈢' => '(三)', - '㈣' => '(四)', - '㈤' => '(五)', - '㈥' => '(六)', - '㈦' => '(七)', - '㈧' => '(八)', - '㈨' => '(九)', - '㈩' => '(十)', - '㈪' => '(月)', - '㈫' => '(火)', - '㈬' => '(水)', - '㈭' => '(木)', - '㈮' => '(金)', - '㈯' => '(土)', - '㈰' => '(日)', - '㈱' => '(株)', - '㈲' => '(有)', - '㈳' => '(社)', - '㈴' => '(名)', - '㈵' => '(特)', - '㈶' => '(財)', - '㈷' => '(祝)', - '㈸' => '(労)', - '㈹' => '(代)', - '㈺' => '(呼)', - '㈻' => '(学)', - '㈼' => '(監)', - '㈽' => '(企)', - '㈾' => '(資)', - '㈿' => '(協)', - '㉀' => '(祭)', - '㉁' => '(休)', - '㉂' => '(自)', - '㉃' => '(至)', - '㉄' => '問', - '㉅' => '幼', - '㉆' => '文', - '㉇' => '箏', - '㉐' => 'PTE', - '㉑' => '21', - '㉒' => '22', - '㉓' => '23', - '㉔' => '24', - '㉕' => '25', - '㉖' => '26', - '㉗' => '27', - '㉘' => '28', - '㉙' => '29', - '㉚' => '30', - '㉛' => '31', - '㉜' => '32', - '㉝' => '33', - '㉞' => '34', - '㉟' => '35', - '㉠' => 'ᄀ', - '㉡' => 'ᄂ', - '㉢' => 'ᄃ', - '㉣' => 'ᄅ', - '㉤' => 'ᄆ', - '㉥' => 'ᄇ', - '㉦' => 'ᄉ', - '㉧' => 'ᄋ', - '㉨' => 'ᄌ', - '㉩' => 'ᄎ', - '㉪' => 'ᄏ', - '㉫' => 'ᄐ', - '㉬' => 'ᄑ', - '㉭' => 'ᄒ', - '㉮' => '가', - '㉯' => '나', - '㉰' => '다', - '㉱' => '라', - '㉲' => '마', - '㉳' => '바', - '㉴' => '사', - '㉵' => '아', - '㉶' => '자', - '㉷' => '차', - '㉸' => '카', - '㉹' => '타', - '㉺' => '파', - '㉻' => '하', - '㉼' => '참고', - '㉽' => '주의', - '㉾' => '우', - '㊀' => '一', - '㊁' => '二', - '㊂' => '三', - '㊃' => '四', - '㊄' => '五', - '㊅' => '六', - '㊆' => '七', - '㊇' => '八', - '㊈' => '九', - '㊉' => '十', - '㊊' => '月', - '㊋' => '火', - '㊌' => '水', - '㊍' => '木', - '㊎' => '金', - '㊏' => '土', - '㊐' => '日', - '㊑' => '株', - '㊒' => '有', - '㊓' => '社', - '㊔' => '名', - '㊕' => '特', - '㊖' => '財', - '㊗' => '祝', - '㊘' => '労', - '㊙' => '秘', - '㊚' => '男', - '㊛' => '女', - '㊜' => '適', - '㊝' => '優', - '㊞' => '印', - '㊟' => '注', - '㊠' => '項', - '㊡' => '休', - '㊢' => '写', - '㊣' => '正', - '㊤' => '上', - '㊥' => '中', - '㊦' => '下', - '㊧' => '左', - '㊨' => '右', - '㊩' => '医', - '㊪' => '宗', - '㊫' => '学', - '㊬' => '監', - '㊭' => '企', - '㊮' => '資', - '㊯' => '協', - '㊰' => '夜', - '㊱' => '36', - '㊲' => '37', - '㊳' => '38', - '㊴' => '39', - '㊵' => '40', - '㊶' => '41', - '㊷' => '42', - '㊸' => '43', - '㊹' => '44', - '㊺' => '45', - '㊻' => '46', - '㊼' => '47', - '㊽' => '48', - '㊾' => '49', - '㊿' => '50', - '㋀' => '1月', - '㋁' => '2月', - '㋂' => '3月', - '㋃' => '4月', - '㋄' => '5月', - '㋅' => '6月', - '㋆' => '7月', - '㋇' => '8月', - '㋈' => '9月', - '㋉' => '10月', - '㋊' => '11月', - '㋋' => '12月', - '㋌' => 'Hg', - '㋍' => 'erg', - '㋎' => 'eV', - '㋏' => 'LTD', - '㋐' => 'ア', - '㋑' => 'イ', - '㋒' => 'ウ', - '㋓' => 'エ', - '㋔' => 'オ', - '㋕' => 'カ', - '㋖' => 'キ', - '㋗' => 'ク', - '㋘' => 'ケ', - '㋙' => 'コ', - '㋚' => 'サ', - '㋛' => 'シ', - '㋜' => 'ス', - '㋝' => 'セ', - '㋞' => 'ソ', - '㋟' => 'タ', - '㋠' => 'チ', - '㋡' => 'ツ', - '㋢' => 'テ', - '㋣' => 'ト', - '㋤' => 'ナ', - '㋥' => 'ニ', - '㋦' => 'ヌ', - '㋧' => 'ネ', - '㋨' => 'ノ', - '㋩' => 'ハ', - '㋪' => 'ヒ', - '㋫' => 'フ', - '㋬' => 'ヘ', - '㋭' => 'ホ', - '㋮' => 'マ', - '㋯' => 'ミ', - '㋰' => 'ム', - '㋱' => 'メ', - '㋲' => 'モ', - '㋳' => 'ヤ', - '㋴' => 'ユ', - '㋵' => 'ヨ', - '㋶' => 'ラ', - '㋷' => 'リ', - '㋸' => 'ル', - '㋹' => 'レ', - '㋺' => 'ロ', - '㋻' => 'ワ', - '㋼' => 'ヰ', - '㋽' => 'ヱ', - '㋾' => 'ヲ', - '㋿' => '令和', - '㌀' => 'アパート', - '㌁' => 'アルファ', - '㌂' => 'アンペア', - '㌃' => 'アール', - '㌄' => 'イニング', - '㌅' => 'インチ', - '㌆' => 'ウォン', - '㌇' => 'エスクード', - '㌈' => 'エーカー', - '㌉' => 'オンス', - '㌊' => 'オーム', - '㌋' => 'カイリ', - '㌌' => 'カラット', - '㌍' => 'カロリー', - '㌎' => 'ガロン', - '㌏' => 'ガンマ', - '㌐' => 'ギガ', - '㌑' => 'ギニー', - '㌒' => 'キュリー', - '㌓' => 'ギルダー', - '㌔' => 'キロ', - '㌕' => 'キログラム', - '㌖' => 'キロメートル', - '㌗' => 'キロワット', - '㌘' => 'グラム', - '㌙' => 'グラムトン', - '㌚' => 'クルゼイロ', - '㌛' => 'クローネ', - '㌜' => 'ケース', - '㌝' => 'コルナ', - '㌞' => 'コーポ', - '㌟' => 'サイクル', - '㌠' => 'サンチーム', - '㌡' => 'シリング', - '㌢' => 'センチ', - '㌣' => 'セント', - '㌤' => 'ダース', - '㌥' => 'デシ', - '㌦' => 'ドル', - '㌧' => 'トン', - '㌨' => 'ナノ', - '㌩' => 'ノット', - '㌪' => 'ハイツ', - '㌫' => 'パーセント', - '㌬' => 'パーツ', - '㌭' => 'バーレル', - '㌮' => 'ピアストル', - '㌯' => 'ピクル', - '㌰' => 'ピコ', - '㌱' => 'ビル', - '㌲' => 'ファラッド', - '㌳' => 'フィート', - '㌴' => 'ブッシェル', - '㌵' => 'フラン', - '㌶' => 'ヘクタール', - '㌷' => 'ペソ', - '㌸' => 'ペニヒ', - '㌹' => 'ヘルツ', - '㌺' => 'ペンス', - '㌻' => 'ページ', - '㌼' => 'ベータ', - '㌽' => 'ポイント', - '㌾' => 'ボルト', - '㌿' => 'ホン', - '㍀' => 'ポンド', - '㍁' => 'ホール', - '㍂' => 'ホーン', - '㍃' => 'マイクロ', - '㍄' => 'マイル', - '㍅' => 'マッハ', - '㍆' => 'マルク', - '㍇' => 'マンション', - '㍈' => 'ミクロン', - '㍉' => 'ミリ', - '㍊' => 'ミリバール', - '㍋' => 'メガ', - '㍌' => 'メガトン', - '㍍' => 'メートル', - '㍎' => 'ヤード', - '㍏' => 'ヤール', - '㍐' => 'ユアン', - '㍑' => 'リットル', - '㍒' => 'リラ', - '㍓' => 'ルピー', - '㍔' => 'ルーブル', - '㍕' => 'レム', - '㍖' => 'レントゲン', - '㍗' => 'ワット', - '㍘' => '0点', - '㍙' => '1点', - '㍚' => '2点', - '㍛' => '3点', - '㍜' => '4点', - '㍝' => '5点', - '㍞' => '6点', - '㍟' => '7点', - '㍠' => '8点', - '㍡' => '9点', - '㍢' => '10点', - '㍣' => '11点', - '㍤' => '12点', - '㍥' => '13点', - '㍦' => '14点', - '㍧' => '15点', - '㍨' => '16点', - '㍩' => '17点', - '㍪' => '18点', - '㍫' => '19点', - '㍬' => '20点', - '㍭' => '21点', - '㍮' => '22点', - '㍯' => '23点', - '㍰' => '24点', - '㍱' => 'hPa', - '㍲' => 'da', - '㍳' => 'AU', - '㍴' => 'bar', - '㍵' => 'oV', - '㍶' => 'pc', - '㍷' => 'dm', - '㍸' => 'dm2', - '㍹' => 'dm3', - '㍺' => 'IU', - '㍻' => '平成', - '㍼' => '昭和', - '㍽' => '大正', - '㍾' => '明治', - '㍿' => '株式会社', - '㎀' => 'pA', - '㎁' => 'nA', - '㎂' => 'μA', - '㎃' => 'mA', - '㎄' => 'kA', - '㎅' => 'KB', - '㎆' => 'MB', - '㎇' => 'GB', - '㎈' => 'cal', - '㎉' => 'kcal', - '㎊' => 'pF', - '㎋' => 'nF', - '㎌' => 'μF', - '㎍' => 'μg', - '㎎' => 'mg', - '㎏' => 'kg', - '㎐' => 'Hz', - '㎑' => 'kHz', - '㎒' => 'MHz', - '㎓' => 'GHz', - '㎔' => 'THz', - '㎕' => 'μl', - '㎖' => 'ml', - '㎗' => 'dl', - '㎘' => 'kl', - '㎙' => 'fm', - '㎚' => 'nm', - '㎛' => 'μm', - '㎜' => 'mm', - '㎝' => 'cm', - '㎞' => 'km', - '㎟' => 'mm2', - '㎠' => 'cm2', - '㎡' => 'm2', - '㎢' => 'km2', - '㎣' => 'mm3', - '㎤' => 'cm3', - '㎥' => 'm3', - '㎦' => 'km3', - '㎧' => 'm∕s', - '㎨' => 'm∕s2', - '㎩' => 'Pa', - '㎪' => 'kPa', - '㎫' => 'MPa', - '㎬' => 'GPa', - '㎭' => 'rad', - '㎮' => 'rad∕s', - '㎯' => 'rad∕s2', - '㎰' => 'ps', - '㎱' => 'ns', - '㎲' => 'μs', - '㎳' => 'ms', - '㎴' => 'pV', - '㎵' => 'nV', - '㎶' => 'μV', - '㎷' => 'mV', - '㎸' => 'kV', - '㎹' => 'MV', - '㎺' => 'pW', - '㎻' => 'nW', - '㎼' => 'μW', - '㎽' => 'mW', - '㎾' => 'kW', - '㎿' => 'MW', - '㏀' => 'kΩ', - '㏁' => 'MΩ', - '㏂' => 'a.m.', - '㏃' => 'Bq', - '㏄' => 'cc', - '㏅' => 'cd', - '㏆' => 'C∕kg', - '㏇' => 'Co.', - '㏈' => 'dB', - '㏉' => 'Gy', - '㏊' => 'ha', - '㏋' => 'HP', - '㏌' => 'in', - '㏍' => 'KK', - '㏎' => 'KM', - '㏏' => 'kt', - '㏐' => 'lm', - '㏑' => 'ln', - '㏒' => 'log', - '㏓' => 'lx', - '㏔' => 'mb', - '㏕' => 'mil', - '㏖' => 'mol', - '㏗' => 'PH', - '㏘' => 'p.m.', - '㏙' => 'PPM', - '㏚' => 'PR', - '㏛' => 'sr', - '㏜' => 'Sv', - '㏝' => 'Wb', - '㏞' => 'V∕m', - '㏟' => 'A∕m', - '㏠' => '1日', - '㏡' => '2日', - '㏢' => '3日', - '㏣' => '4日', - '㏤' => '5日', - '㏥' => '6日', - '㏦' => '7日', - '㏧' => '8日', - '㏨' => '9日', - '㏩' => '10日', - '㏪' => '11日', - '㏫' => '12日', - '㏬' => '13日', - '㏭' => '14日', - '㏮' => '15日', - '㏯' => '16日', - '㏰' => '17日', - '㏱' => '18日', - '㏲' => '19日', - '㏳' => '20日', - '㏴' => '21日', - '㏵' => '22日', - '㏶' => '23日', - '㏷' => '24日', - '㏸' => '25日', - '㏹' => '26日', - '㏺' => '27日', - '㏻' => '28日', - '㏼' => '29日', - '㏽' => '30日', - '㏾' => '31日', - '㏿' => 'gal', - 'ꚜ' => 'ъ', - 'ꚝ' => 'ь', - 'ꝰ' => 'ꝯ', - 'ꟸ' => 'Ħ', - 'ꟹ' => 'œ', - 'ꭜ' => 'ꜧ', - 'ꭝ' => 'ꬷ', - 'ꭞ' => 'ɫ', - 'ꭟ' => 'ꭒ', - 'ꭩ' => 'ʍ', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'st', - 'st' => 'st', - 'ﬓ' => 'մն', - 'ﬔ' => 'մե', - 'ﬕ' => 'մի', - 'ﬖ' => 'վն', - 'ﬗ' => 'մխ', - 'ﬠ' => 'ע', - 'ﬡ' => 'א', - 'ﬢ' => 'ד', - 'ﬣ' => 'ה', - 'ﬤ' => 'כ', - 'ﬥ' => 'ל', - 'ﬦ' => 'ם', - 'ﬧ' => 'ר', - 'ﬨ' => 'ת', - '﬩' => '+', - 'ﭏ' => 'אל', - 'ﭐ' => 'ٱ', - 'ﭑ' => 'ٱ', - 'ﭒ' => 'ٻ', - 'ﭓ' => 'ٻ', - 'ﭔ' => 'ٻ', - 'ﭕ' => 'ٻ', - 'ﭖ' => 'پ', - 'ﭗ' => 'پ', - 'ﭘ' => 'پ', - 'ﭙ' => 'پ', - 'ﭚ' => 'ڀ', - 'ﭛ' => 'ڀ', - 'ﭜ' => 'ڀ', - 'ﭝ' => 'ڀ', - 'ﭞ' => 'ٺ', - 'ﭟ' => 'ٺ', - 'ﭠ' => 'ٺ', - 'ﭡ' => 'ٺ', - 'ﭢ' => 'ٿ', - 'ﭣ' => 'ٿ', - 'ﭤ' => 'ٿ', - 'ﭥ' => 'ٿ', - 'ﭦ' => 'ٹ', - 'ﭧ' => 'ٹ', - 'ﭨ' => 'ٹ', - 'ﭩ' => 'ٹ', - 'ﭪ' => 'ڤ', - 'ﭫ' => 'ڤ', - 'ﭬ' => 'ڤ', - 'ﭭ' => 'ڤ', - 'ﭮ' => 'ڦ', - 'ﭯ' => 'ڦ', - 'ﭰ' => 'ڦ', - 'ﭱ' => 'ڦ', - 'ﭲ' => 'ڄ', - 'ﭳ' => 'ڄ', - 'ﭴ' => 'ڄ', - 'ﭵ' => 'ڄ', - 'ﭶ' => 'ڃ', - 'ﭷ' => 'ڃ', - 'ﭸ' => 'ڃ', - 'ﭹ' => 'ڃ', - 'ﭺ' => 'چ', - 'ﭻ' => 'چ', - 'ﭼ' => 'چ', - 'ﭽ' => 'چ', - 'ﭾ' => 'ڇ', - 'ﭿ' => 'ڇ', - 'ﮀ' => 'ڇ', - 'ﮁ' => 'ڇ', - 'ﮂ' => 'ڍ', - 'ﮃ' => 'ڍ', - 'ﮄ' => 'ڌ', - 'ﮅ' => 'ڌ', - 'ﮆ' => 'ڎ', - 'ﮇ' => 'ڎ', - 'ﮈ' => 'ڈ', - 'ﮉ' => 'ڈ', - 'ﮊ' => 'ژ', - 'ﮋ' => 'ژ', - 'ﮌ' => 'ڑ', - 'ﮍ' => 'ڑ', - 'ﮎ' => 'ک', - 'ﮏ' => 'ک', - 'ﮐ' => 'ک', - 'ﮑ' => 'ک', - 'ﮒ' => 'گ', - 'ﮓ' => 'گ', - 'ﮔ' => 'گ', - 'ﮕ' => 'گ', - 'ﮖ' => 'ڳ', - 'ﮗ' => 'ڳ', - 'ﮘ' => 'ڳ', - 'ﮙ' => 'ڳ', - 'ﮚ' => 'ڱ', - 'ﮛ' => 'ڱ', - 'ﮜ' => 'ڱ', - 'ﮝ' => 'ڱ', - 'ﮞ' => 'ں', - 'ﮟ' => 'ں', - 'ﮠ' => 'ڻ', - 'ﮡ' => 'ڻ', - 'ﮢ' => 'ڻ', - 'ﮣ' => 'ڻ', - 'ﮤ' => 'ۀ', - 'ﮥ' => 'ۀ', - 'ﮦ' => 'ہ', - 'ﮧ' => 'ہ', - 'ﮨ' => 'ہ', - 'ﮩ' => 'ہ', - 'ﮪ' => 'ھ', - 'ﮫ' => 'ھ', - 'ﮬ' => 'ھ', - 'ﮭ' => 'ھ', - 'ﮮ' => 'ے', - 'ﮯ' => 'ے', - 'ﮰ' => 'ۓ', - 'ﮱ' => 'ۓ', - 'ﯓ' => 'ڭ', - 'ﯔ' => 'ڭ', - 'ﯕ' => 'ڭ', - 'ﯖ' => 'ڭ', - 'ﯗ' => 'ۇ', - 'ﯘ' => 'ۇ', - 'ﯙ' => 'ۆ', - 'ﯚ' => 'ۆ', - 'ﯛ' => 'ۈ', - 'ﯜ' => 'ۈ', - 'ﯝ' => 'ۇٴ', - 'ﯞ' => 'ۋ', - 'ﯟ' => 'ۋ', - 'ﯠ' => 'ۅ', - 'ﯡ' => 'ۅ', - 'ﯢ' => 'ۉ', - 'ﯣ' => 'ۉ', - 'ﯤ' => 'ې', - 'ﯥ' => 'ې', - 'ﯦ' => 'ې', - 'ﯧ' => 'ې', - 'ﯨ' => 'ى', - 'ﯩ' => 'ى', - 'ﯪ' => 'ئا', - 'ﯫ' => 'ئا', - 'ﯬ' => 'ئە', - 'ﯭ' => 'ئە', - 'ﯮ' => 'ئو', - 'ﯯ' => 'ئو', - 'ﯰ' => 'ئۇ', - 'ﯱ' => 'ئۇ', - 'ﯲ' => 'ئۆ', - 'ﯳ' => 'ئۆ', - 'ﯴ' => 'ئۈ', - 'ﯵ' => 'ئۈ', - 'ﯶ' => 'ئې', - 'ﯷ' => 'ئې', - 'ﯸ' => 'ئې', - 'ﯹ' => 'ئى', - 'ﯺ' => 'ئى', - 'ﯻ' => 'ئى', - 'ﯼ' => 'ی', - 'ﯽ' => 'ی', - 'ﯾ' => 'ی', - 'ﯿ' => 'ی', - 'ﰀ' => 'ئج', - 'ﰁ' => 'ئح', - 'ﰂ' => 'ئم', - 'ﰃ' => 'ئى', - 'ﰄ' => 'ئي', - 'ﰅ' => 'بج', - 'ﰆ' => 'بح', - 'ﰇ' => 'بخ', - 'ﰈ' => 'بم', - 'ﰉ' => 'بى', - 'ﰊ' => 'بي', - 'ﰋ' => 'تج', - 'ﰌ' => 'تح', - 'ﰍ' => 'تخ', - 'ﰎ' => 'تم', - 'ﰏ' => 'تى', - 'ﰐ' => 'تي', - 'ﰑ' => 'ثج', - 'ﰒ' => 'ثم', - 'ﰓ' => 'ثى', - 'ﰔ' => 'ثي', - 'ﰕ' => 'جح', - 'ﰖ' => 'جم', - 'ﰗ' => 'حج', - 'ﰘ' => 'حم', - 'ﰙ' => 'خج', - 'ﰚ' => 'خح', - 'ﰛ' => 'خم', - 'ﰜ' => 'سج', - 'ﰝ' => 'سح', - 'ﰞ' => 'سخ', - 'ﰟ' => 'سم', - 'ﰠ' => 'صح', - 'ﰡ' => 'صم', - 'ﰢ' => 'ضج', - 'ﰣ' => 'ضح', - 'ﰤ' => 'ضخ', - 'ﰥ' => 'ضم', - 'ﰦ' => 'طح', - 'ﰧ' => 'طم', - 'ﰨ' => 'ظم', - 'ﰩ' => 'عج', - 'ﰪ' => 'عم', - 'ﰫ' => 'غج', - 'ﰬ' => 'غم', - 'ﰭ' => 'فج', - 'ﰮ' => 'فح', - 'ﰯ' => 'فخ', - 'ﰰ' => 'فم', - 'ﰱ' => 'فى', - 'ﰲ' => 'في', - 'ﰳ' => 'قح', - 'ﰴ' => 'قم', - 'ﰵ' => 'قى', - 'ﰶ' => 'قي', - 'ﰷ' => 'كا', - 'ﰸ' => 'كج', - 'ﰹ' => 'كح', - 'ﰺ' => 'كخ', - 'ﰻ' => 'كل', - 'ﰼ' => 'كم', - 'ﰽ' => 'كى', - 'ﰾ' => 'كي', - 'ﰿ' => 'لج', - 'ﱀ' => 'لح', - 'ﱁ' => 'لخ', - 'ﱂ' => 'لم', - 'ﱃ' => 'لى', - 'ﱄ' => 'لي', - 'ﱅ' => 'مج', - 'ﱆ' => 'مح', - 'ﱇ' => 'مخ', - 'ﱈ' => 'مم', - 'ﱉ' => 'مى', - 'ﱊ' => 'مي', - 'ﱋ' => 'نج', - 'ﱌ' => 'نح', - 'ﱍ' => 'نخ', - 'ﱎ' => 'نم', - 'ﱏ' => 'نى', - 'ﱐ' => 'ني', - 'ﱑ' => 'هج', - 'ﱒ' => 'هم', - 'ﱓ' => 'هى', - 'ﱔ' => 'هي', - 'ﱕ' => 'يج', - 'ﱖ' => 'يح', - 'ﱗ' => 'يخ', - 'ﱘ' => 'يم', - 'ﱙ' => 'يى', - 'ﱚ' => 'يي', - 'ﱛ' => 'ذٰ', - 'ﱜ' => 'رٰ', - 'ﱝ' => 'ىٰ', - 'ﱞ' => ' ٌّ', - 'ﱟ' => ' ٍّ', - 'ﱠ' => ' َّ', - 'ﱡ' => ' ُّ', - 'ﱢ' => ' ِّ', - 'ﱣ' => ' ّٰ', - 'ﱤ' => 'ئر', - 'ﱥ' => 'ئز', - 'ﱦ' => 'ئم', - 'ﱧ' => 'ئن', - 'ﱨ' => 'ئى', - 'ﱩ' => 'ئي', - 'ﱪ' => 'بر', - 'ﱫ' => 'بز', - 'ﱬ' => 'بم', - 'ﱭ' => 'بن', - 'ﱮ' => 'بى', - 'ﱯ' => 'بي', - 'ﱰ' => 'تر', - 'ﱱ' => 'تز', - 'ﱲ' => 'تم', - 'ﱳ' => 'تن', - 'ﱴ' => 'تى', - 'ﱵ' => 'تي', - 'ﱶ' => 'ثر', - 'ﱷ' => 'ثز', - 'ﱸ' => 'ثم', - 'ﱹ' => 'ثن', - 'ﱺ' => 'ثى', - 'ﱻ' => 'ثي', - 'ﱼ' => 'فى', - 'ﱽ' => 'في', - 'ﱾ' => 'قى', - 'ﱿ' => 'قي', - 'ﲀ' => 'كا', - 'ﲁ' => 'كل', - 'ﲂ' => 'كم', - 'ﲃ' => 'كى', - 'ﲄ' => 'كي', - 'ﲅ' => 'لم', - 'ﲆ' => 'لى', - 'ﲇ' => 'لي', - 'ﲈ' => 'ما', - 'ﲉ' => 'مم', - 'ﲊ' => 'نر', - 'ﲋ' => 'نز', - 'ﲌ' => 'نم', - 'ﲍ' => 'نن', - 'ﲎ' => 'نى', - 'ﲏ' => 'ني', - 'ﲐ' => 'ىٰ', - 'ﲑ' => 'ير', - 'ﲒ' => 'يز', - 'ﲓ' => 'يم', - 'ﲔ' => 'ين', - 'ﲕ' => 'يى', - 'ﲖ' => 'يي', - 'ﲗ' => 'ئج', - 'ﲘ' => 'ئح', - 'ﲙ' => 'ئخ', - 'ﲚ' => 'ئم', - 'ﲛ' => 'ئه', - 'ﲜ' => 'بج', - 'ﲝ' => 'بح', - 'ﲞ' => 'بخ', - 'ﲟ' => 'بم', - 'ﲠ' => 'به', - 'ﲡ' => 'تج', - 'ﲢ' => 'تح', - 'ﲣ' => 'تخ', - 'ﲤ' => 'تم', - 'ﲥ' => 'ته', - 'ﲦ' => 'ثم', - 'ﲧ' => 'جح', - 'ﲨ' => 'جم', - 'ﲩ' => 'حج', - 'ﲪ' => 'حم', - 'ﲫ' => 'خج', - 'ﲬ' => 'خم', - 'ﲭ' => 'سج', - 'ﲮ' => 'سح', - 'ﲯ' => 'سخ', - 'ﲰ' => 'سم', - 'ﲱ' => 'صح', - 'ﲲ' => 'صخ', - 'ﲳ' => 'صم', - 'ﲴ' => 'ضج', - 'ﲵ' => 'ضح', - 'ﲶ' => 'ضخ', - 'ﲷ' => 'ضم', - 'ﲸ' => 'طح', - 'ﲹ' => 'ظم', - 'ﲺ' => 'عج', - 'ﲻ' => 'عم', - 'ﲼ' => 'غج', - 'ﲽ' => 'غم', - 'ﲾ' => 'فج', - 'ﲿ' => 'فح', - 'ﳀ' => 'فخ', - 'ﳁ' => 'فم', - 'ﳂ' => 'قح', - 'ﳃ' => 'قم', - 'ﳄ' => 'كج', - 'ﳅ' => 'كح', - 'ﳆ' => 'كخ', - 'ﳇ' => 'كل', - 'ﳈ' => 'كم', - 'ﳉ' => 'لج', - 'ﳊ' => 'لح', - 'ﳋ' => 'لخ', - 'ﳌ' => 'لم', - 'ﳍ' => 'له', - 'ﳎ' => 'مج', - 'ﳏ' => 'مح', - 'ﳐ' => 'مخ', - 'ﳑ' => 'مم', - 'ﳒ' => 'نج', - 'ﳓ' => 'نح', - 'ﳔ' => 'نخ', - 'ﳕ' => 'نم', - 'ﳖ' => 'نه', - 'ﳗ' => 'هج', - 'ﳘ' => 'هم', - 'ﳙ' => 'هٰ', - 'ﳚ' => 'يج', - 'ﳛ' => 'يح', - 'ﳜ' => 'يخ', - 'ﳝ' => 'يم', - 'ﳞ' => 'يه', - 'ﳟ' => 'ئم', - 'ﳠ' => 'ئه', - 'ﳡ' => 'بم', - 'ﳢ' => 'به', - 'ﳣ' => 'تم', - 'ﳤ' => 'ته', - 'ﳥ' => 'ثم', - 'ﳦ' => 'ثه', - 'ﳧ' => 'سم', - 'ﳨ' => 'سه', - 'ﳩ' => 'شم', - 'ﳪ' => 'شه', - 'ﳫ' => 'كل', - 'ﳬ' => 'كم', - 'ﳭ' => 'لم', - 'ﳮ' => 'نم', - 'ﳯ' => 'نه', - 'ﳰ' => 'يم', - 'ﳱ' => 'يه', - 'ﳲ' => 'ـَّ', - 'ﳳ' => 'ـُّ', - 'ﳴ' => 'ـِّ', - 'ﳵ' => 'طى', - 'ﳶ' => 'طي', - 'ﳷ' => 'عى', - 'ﳸ' => 'عي', - 'ﳹ' => 'غى', - 'ﳺ' => 'غي', - 'ﳻ' => 'سى', - 'ﳼ' => 'سي', - 'ﳽ' => 'شى', - 'ﳾ' => 'شي', - 'ﳿ' => 'حى', - 'ﴀ' => 'حي', - 'ﴁ' => 'جى', - 'ﴂ' => 'جي', - 'ﴃ' => 'خى', - 'ﴄ' => 'خي', - 'ﴅ' => 'صى', - 'ﴆ' => 'صي', - 'ﴇ' => 'ضى', - 'ﴈ' => 'ضي', - 'ﴉ' => 'شج', - 'ﴊ' => 'شح', - 'ﴋ' => 'شخ', - 'ﴌ' => 'شم', - 'ﴍ' => 'شر', - 'ﴎ' => 'سر', - 'ﴏ' => 'صر', - 'ﴐ' => 'ضر', - 'ﴑ' => 'طى', - 'ﴒ' => 'طي', - 'ﴓ' => 'عى', - 'ﴔ' => 'عي', - 'ﴕ' => 'غى', - 'ﴖ' => 'غي', - 'ﴗ' => 'سى', - 'ﴘ' => 'سي', - 'ﴙ' => 'شى', - 'ﴚ' => 'شي', - 'ﴛ' => 'حى', - 'ﴜ' => 'حي', - 'ﴝ' => 'جى', - 'ﴞ' => 'جي', - 'ﴟ' => 'خى', - 'ﴠ' => 'خي', - 'ﴡ' => 'صى', - 'ﴢ' => 'صي', - 'ﴣ' => 'ضى', - 'ﴤ' => 'ضي', - 'ﴥ' => 'شج', - 'ﴦ' => 'شح', - 'ﴧ' => 'شخ', - 'ﴨ' => 'شم', - 'ﴩ' => 'شر', - 'ﴪ' => 'سر', - 'ﴫ' => 'صر', - 'ﴬ' => 'ضر', - 'ﴭ' => 'شج', - 'ﴮ' => 'شح', - 'ﴯ' => 'شخ', - 'ﴰ' => 'شم', - 'ﴱ' => 'سه', - 'ﴲ' => 'شه', - 'ﴳ' => 'طم', - 'ﴴ' => 'سج', - 'ﴵ' => 'سح', - 'ﴶ' => 'سخ', - 'ﴷ' => 'شج', - 'ﴸ' => 'شح', - 'ﴹ' => 'شخ', - 'ﴺ' => 'طم', - 'ﴻ' => 'ظم', - 'ﴼ' => 'اً', - 'ﴽ' => 'اً', - 'ﵐ' => 'تجم', - 'ﵑ' => 'تحج', - 'ﵒ' => 'تحج', - 'ﵓ' => 'تحم', - 'ﵔ' => 'تخم', - 'ﵕ' => 'تمج', - 'ﵖ' => 'تمح', - 'ﵗ' => 'تمخ', - 'ﵘ' => 'جمح', - 'ﵙ' => 'جمح', - 'ﵚ' => 'حمي', - 'ﵛ' => 'حمى', - 'ﵜ' => 'سحج', - 'ﵝ' => 'سجح', - 'ﵞ' => 'سجى', - 'ﵟ' => 'سمح', - 'ﵠ' => 'سمح', - 'ﵡ' => 'سمج', - 'ﵢ' => 'سمم', - 'ﵣ' => 'سمم', - 'ﵤ' => 'صحح', - 'ﵥ' => 'صحح', - 'ﵦ' => 'صمم', - 'ﵧ' => 'شحم', - 'ﵨ' => 'شحم', - 'ﵩ' => 'شجي', - 'ﵪ' => 'شمخ', - 'ﵫ' => 'شمخ', - 'ﵬ' => 'شمم', - 'ﵭ' => 'شمم', - 'ﵮ' => 'ضحى', - 'ﵯ' => 'ضخم', - 'ﵰ' => 'ضخم', - 'ﵱ' => 'طمح', - 'ﵲ' => 'طمح', - 'ﵳ' => 'طمم', - 'ﵴ' => 'طمي', - 'ﵵ' => 'عجم', - 'ﵶ' => 'عمم', - 'ﵷ' => 'عمم', - 'ﵸ' => 'عمى', - 'ﵹ' => 'غمم', - 'ﵺ' => 'غمي', - 'ﵻ' => 'غمى', - 'ﵼ' => 'فخم', - 'ﵽ' => 'فخم', - 'ﵾ' => 'قمح', - 'ﵿ' => 'قمم', - 'ﶀ' => 'لحم', - 'ﶁ' => 'لحي', - 'ﶂ' => 'لحى', - 'ﶃ' => 'لجج', - 'ﶄ' => 'لجج', - 'ﶅ' => 'لخم', - 'ﶆ' => 'لخم', - 'ﶇ' => 'لمح', - 'ﶈ' => 'لمح', - 'ﶉ' => 'محج', - 'ﶊ' => 'محم', - 'ﶋ' => 'محي', - 'ﶌ' => 'مجح', - 'ﶍ' => 'مجم', - 'ﶎ' => 'مخج', - 'ﶏ' => 'مخم', - 'ﶒ' => 'مجخ', - 'ﶓ' => 'همج', - 'ﶔ' => 'همم', - 'ﶕ' => 'نحم', - 'ﶖ' => 'نحى', - 'ﶗ' => 'نجم', - 'ﶘ' => 'نجم', - 'ﶙ' => 'نجى', - 'ﶚ' => 'نمي', - 'ﶛ' => 'نمى', - 'ﶜ' => 'يمم', - 'ﶝ' => 'يمم', - 'ﶞ' => 'بخي', - 'ﶟ' => 'تجي', - 'ﶠ' => 'تجى', - 'ﶡ' => 'تخي', - 'ﶢ' => 'تخى', - 'ﶣ' => 'تمي', - 'ﶤ' => 'تمى', - 'ﶥ' => 'جمي', - 'ﶦ' => 'جحى', - 'ﶧ' => 'جمى', - 'ﶨ' => 'سخى', - 'ﶩ' => 'صحي', - 'ﶪ' => 'شحي', - 'ﶫ' => 'ضحي', - 'ﶬ' => 'لجي', - 'ﶭ' => 'لمي', - 'ﶮ' => 'يحي', - 'ﶯ' => 'يجي', - 'ﶰ' => 'يمي', - 'ﶱ' => 'ممي', - 'ﶲ' => 'قمي', - 'ﶳ' => 'نحي', - 'ﶴ' => 'قمح', - 'ﶵ' => 'لحم', - 'ﶶ' => 'عمي', - 'ﶷ' => 'كمي', - 'ﶸ' => 'نجح', - 'ﶹ' => 'مخي', - 'ﶺ' => 'لجم', - 'ﶻ' => 'كمم', - 'ﶼ' => 'لجم', - 'ﶽ' => 'نجح', - 'ﶾ' => 'جحي', - 'ﶿ' => 'حجي', - 'ﷀ' => 'مجي', - 'ﷁ' => 'فمي', - 'ﷂ' => 'بحي', - 'ﷃ' => 'كمم', - 'ﷄ' => 'عجم', - 'ﷅ' => 'صمم', - 'ﷆ' => 'سخي', - 'ﷇ' => 'نجي', - 'ﷰ' => 'صلے', - 'ﷱ' => 'قلے', - 'ﷲ' => 'الله', - 'ﷳ' => 'اكبر', - 'ﷴ' => 'محمد', - 'ﷵ' => 'صلعم', - 'ﷶ' => 'رسول', - 'ﷷ' => 'عليه', - 'ﷸ' => 'وسلم', - 'ﷹ' => 'صلى', - 'ﷺ' => 'صلى الله عليه وسلم', - 'ﷻ' => 'جل جلاله', - '﷼' => 'ریال', - '︐' => ',', - '︑' => '、', - '︒' => '。', - '︓' => ':', - '︔' => ';', - '︕' => '!', - '︖' => '?', - '︗' => '〖', - '︘' => '〗', - '︙' => '...', - '︰' => '..', - '︱' => '—', - '︲' => '–', - '︳' => '_', - '︴' => '_', - '︵' => '(', - '︶' => ')', - '︷' => '{', - '︸' => '}', - '︹' => '〔', - '︺' => '〕', - '︻' => '【', - '︼' => '】', - '︽' => '《', - '︾' => '》', - '︿' => '〈', - '﹀' => '〉', - '﹁' => '「', - '﹂' => '」', - '﹃' => '『', - '﹄' => '』', - '﹇' => '[', - '﹈' => ']', - '﹉' => ' ̅', - '﹊' => ' ̅', - '﹋' => ' ̅', - '﹌' => ' ̅', - '﹍' => '_', - '﹎' => '_', - '﹏' => '_', - '﹐' => ',', - '﹑' => '、', - '﹒' => '.', - '﹔' => ';', - '﹕' => ':', - '﹖' => '?', - '﹗' => '!', - '﹘' => '—', - '﹙' => '(', - '﹚' => ')', - '﹛' => '{', - '﹜' => '}', - '﹝' => '〔', - '﹞' => '〕', - '﹟' => '#', - '﹠' => '&', - '﹡' => '*', - '﹢' => '+', - '﹣' => '-', - '﹤' => '<', - '﹥' => '>', - '﹦' => '=', - '﹨' => '\\', - '﹩' => '$', - '﹪' => '%', - '﹫' => '@', - 'ﹰ' => ' ً', - 'ﹱ' => 'ـً', - 'ﹲ' => ' ٌ', - 'ﹴ' => ' ٍ', - 'ﹶ' => ' َ', - 'ﹷ' => 'ـَ', - 'ﹸ' => ' ُ', - 'ﹹ' => 'ـُ', - 'ﹺ' => ' ِ', - 'ﹻ' => 'ـِ', - 'ﹼ' => ' ّ', - 'ﹽ' => 'ـّ', - 'ﹾ' => ' ْ', - 'ﹿ' => 'ـْ', - 'ﺀ' => 'ء', - 'ﺁ' => 'آ', - 'ﺂ' => 'آ', - 'ﺃ' => 'أ', - 'ﺄ' => 'أ', - 'ﺅ' => 'ؤ', - 'ﺆ' => 'ؤ', - 'ﺇ' => 'إ', - 'ﺈ' => 'إ', - 'ﺉ' => 'ئ', - 'ﺊ' => 'ئ', - 'ﺋ' => 'ئ', - 'ﺌ' => 'ئ', - 'ﺍ' => 'ا', - 'ﺎ' => 'ا', - 'ﺏ' => 'ب', - 'ﺐ' => 'ب', - 'ﺑ' => 'ب', - 'ﺒ' => 'ب', - 'ﺓ' => 'ة', - 'ﺔ' => 'ة', - 'ﺕ' => 'ت', - 'ﺖ' => 'ت', - 'ﺗ' => 'ت', - 'ﺘ' => 'ت', - 'ﺙ' => 'ث', - 'ﺚ' => 'ث', - 'ﺛ' => 'ث', - 'ﺜ' => 'ث', - 'ﺝ' => 'ج', - 'ﺞ' => 'ج', - 'ﺟ' => 'ج', - 'ﺠ' => 'ج', - 'ﺡ' => 'ح', - 'ﺢ' => 'ح', - 'ﺣ' => 'ح', - 'ﺤ' => 'ح', - 'ﺥ' => 'خ', - 'ﺦ' => 'خ', - 'ﺧ' => 'خ', - 'ﺨ' => 'خ', - 'ﺩ' => 'د', - 'ﺪ' => 'د', - 'ﺫ' => 'ذ', - 'ﺬ' => 'ذ', - 'ﺭ' => 'ر', - 'ﺮ' => 'ر', - 'ﺯ' => 'ز', - 'ﺰ' => 'ز', - 'ﺱ' => 'س', - 'ﺲ' => 'س', - 'ﺳ' => 'س', - 'ﺴ' => 'س', - 'ﺵ' => 'ش', - 'ﺶ' => 'ش', - 'ﺷ' => 'ش', - 'ﺸ' => 'ش', - 'ﺹ' => 'ص', - 'ﺺ' => 'ص', - 'ﺻ' => 'ص', - 'ﺼ' => 'ص', - 'ﺽ' => 'ض', - 'ﺾ' => 'ض', - 'ﺿ' => 'ض', - 'ﻀ' => 'ض', - 'ﻁ' => 'ط', - 'ﻂ' => 'ط', - 'ﻃ' => 'ط', - 'ﻄ' => 'ط', - 'ﻅ' => 'ظ', - 'ﻆ' => 'ظ', - 'ﻇ' => 'ظ', - 'ﻈ' => 'ظ', - 'ﻉ' => 'ع', - 'ﻊ' => 'ع', - 'ﻋ' => 'ع', - 'ﻌ' => 'ع', - 'ﻍ' => 'غ', - 'ﻎ' => 'غ', - 'ﻏ' => 'غ', - 'ﻐ' => 'غ', - 'ﻑ' => 'ف', - 'ﻒ' => 'ف', - 'ﻓ' => 'ف', - 'ﻔ' => 'ف', - 'ﻕ' => 'ق', - 'ﻖ' => 'ق', - 'ﻗ' => 'ق', - 'ﻘ' => 'ق', - 'ﻙ' => 'ك', - 'ﻚ' => 'ك', - 'ﻛ' => 'ك', - 'ﻜ' => 'ك', - 'ﻝ' => 'ل', - 'ﻞ' => 'ل', - 'ﻟ' => 'ل', - 'ﻠ' => 'ل', - 'ﻡ' => 'م', - 'ﻢ' => 'م', - 'ﻣ' => 'م', - 'ﻤ' => 'م', - 'ﻥ' => 'ن', - 'ﻦ' => 'ن', - 'ﻧ' => 'ن', - 'ﻨ' => 'ن', - 'ﻩ' => 'ه', - 'ﻪ' => 'ه', - 'ﻫ' => 'ه', - 'ﻬ' => 'ه', - 'ﻭ' => 'و', - 'ﻮ' => 'و', - 'ﻯ' => 'ى', - 'ﻰ' => 'ى', - 'ﻱ' => 'ي', - 'ﻲ' => 'ي', - 'ﻳ' => 'ي', - 'ﻴ' => 'ي', - 'ﻵ' => 'لآ', - 'ﻶ' => 'لآ', - 'ﻷ' => 'لأ', - 'ﻸ' => 'لأ', - 'ﻹ' => 'لإ', - 'ﻺ' => 'لإ', - 'ﻻ' => 'لا', - 'ﻼ' => 'لا', - '!' => '!', - '"' => '"', - '#' => '#', - '$' => '$', - '%' => '%', - '&' => '&', - ''' => '\'', - '(' => '(', - ')' => ')', - '*' => '*', - '+' => '+', - ',' => ',', - '-' => '-', - '.' => '.', - '/' => '/', - '0' => '0', - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - ':' => ':', - ';' => ';', - '<' => '<', - '=' => '=', - '>' => '>', - '?' => '?', - '@' => '@', - 'A' => 'A', - 'B' => 'B', - 'C' => 'C', - 'D' => 'D', - 'E' => 'E', - 'F' => 'F', - 'G' => 'G', - 'H' => 'H', - 'I' => 'I', - 'J' => 'J', - 'K' => 'K', - 'L' => 'L', - 'M' => 'M', - 'N' => 'N', - 'O' => 'O', - 'P' => 'P', - 'Q' => 'Q', - 'R' => 'R', - 'S' => 'S', - 'T' => 'T', - 'U' => 'U', - 'V' => 'V', - 'W' => 'W', - 'X' => 'X', - 'Y' => 'Y', - 'Z' => 'Z', - '[' => '[', - '\' => '\\', - ']' => ']', - '^' => '^', - '_' => '_', - '`' => '`', - 'a' => 'a', - 'b' => 'b', - 'c' => 'c', - 'd' => 'd', - 'e' => 'e', - 'f' => 'f', - 'g' => 'g', - 'h' => 'h', - 'i' => 'i', - 'j' => 'j', - 'k' => 'k', - 'l' => 'l', - 'm' => 'm', - 'n' => 'n', - 'o' => 'o', - 'p' => 'p', - 'q' => 'q', - 'r' => 'r', - 's' => 's', - 't' => 't', - 'u' => 'u', - 'v' => 'v', - 'w' => 'w', - 'x' => 'x', - 'y' => 'y', - 'z' => 'z', - '{' => '{', - '|' => '|', - '}' => '}', - '~' => '~', - '⦅' => '⦅', - '⦆' => '⦆', - '。' => '。', - '「' => '「', - '」' => '」', - '、' => '、', - '・' => '・', - 'ヲ' => 'ヲ', - 'ァ' => 'ァ', - 'ィ' => 'ィ', - 'ゥ' => 'ゥ', - 'ェ' => 'ェ', - 'ォ' => 'ォ', - 'ャ' => 'ャ', - 'ュ' => 'ュ', - 'ョ' => 'ョ', - 'ッ' => 'ッ', - 'ー' => 'ー', - 'ア' => 'ア', - 'イ' => 'イ', - 'ウ' => 'ウ', - 'エ' => 'エ', - 'オ' => 'オ', - 'カ' => 'カ', - 'キ' => 'キ', - 'ク' => 'ク', - 'ケ' => 'ケ', - 'コ' => 'コ', - 'サ' => 'サ', - 'シ' => 'シ', - 'ス' => 'ス', - 'セ' => 'セ', - 'ソ' => 'ソ', - 'タ' => 'タ', - 'チ' => 'チ', - 'ツ' => 'ツ', - 'テ' => 'テ', - 'ト' => 'ト', - 'ナ' => 'ナ', - 'ニ' => 'ニ', - 'ヌ' => 'ヌ', - 'ネ' => 'ネ', - 'ノ' => 'ノ', - 'ハ' => 'ハ', - 'ヒ' => 'ヒ', - 'フ' => 'フ', - 'ヘ' => 'ヘ', - 'ホ' => 'ホ', - 'マ' => 'マ', - 'ミ' => 'ミ', - 'ム' => 'ム', - 'メ' => 'メ', - 'モ' => 'モ', - 'ヤ' => 'ヤ', - 'ユ' => 'ユ', - 'ヨ' => 'ヨ', - 'ラ' => 'ラ', - 'リ' => 'リ', - 'ル' => 'ル', - 'レ' => 'レ', - 'ロ' => 'ロ', - 'ワ' => 'ワ', - 'ン' => 'ン', - '゙' => '゙', - '゚' => '゚', - 'ᅠ' => 'ᅠ', - 'ᄀ' => 'ᄀ', - 'ᄁ' => 'ᄁ', - 'ᆪ' => 'ᆪ', - 'ᄂ' => 'ᄂ', - 'ᆬ' => 'ᆬ', - 'ᆭ' => 'ᆭ', - 'ᄃ' => 'ᄃ', - 'ᄄ' => 'ᄄ', - 'ᄅ' => 'ᄅ', - 'ᆰ' => 'ᆰ', - 'ᆱ' => 'ᆱ', - 'ᆲ' => 'ᆲ', - 'ᆳ' => 'ᆳ', - 'ᆴ' => 'ᆴ', - 'ᆵ' => 'ᆵ', - 'ᄚ' => 'ᄚ', - 'ᄆ' => 'ᄆ', - 'ᄇ' => 'ᄇ', - 'ᄈ' => 'ᄈ', - 'ᄡ' => 'ᄡ', - 'ᄉ' => 'ᄉ', - 'ᄊ' => 'ᄊ', - 'ᄋ' => 'ᄋ', - 'ᄌ' => 'ᄌ', - 'ᄍ' => 'ᄍ', - 'ᄎ' => 'ᄎ', - 'ᄏ' => 'ᄏ', - 'ᄐ' => 'ᄐ', - 'ᄑ' => 'ᄑ', - 'ᄒ' => 'ᄒ', - 'ᅡ' => 'ᅡ', - 'ᅢ' => 'ᅢ', - 'ᅣ' => 'ᅣ', - 'ᅤ' => 'ᅤ', - 'ᅥ' => 'ᅥ', - 'ᅦ' => 'ᅦ', - 'ᅧ' => 'ᅧ', - 'ᅨ' => 'ᅨ', - 'ᅩ' => 'ᅩ', - 'ᅪ' => 'ᅪ', - 'ᅫ' => 'ᅫ', - 'ᅬ' => 'ᅬ', - 'ᅭ' => 'ᅭ', - 'ᅮ' => 'ᅮ', - 'ᅯ' => 'ᅯ', - 'ᅰ' => 'ᅰ', - 'ᅱ' => 'ᅱ', - 'ᅲ' => 'ᅲ', - 'ᅳ' => 'ᅳ', - 'ᅴ' => 'ᅴ', - 'ᅵ' => 'ᅵ', - '¢' => '¢', - '£' => '£', - '¬' => '¬', - ' ̄' => ' ̄', - '¦' => '¦', - '¥' => '¥', - '₩' => '₩', - '│' => '│', - '←' => '←', - '↑' => '↑', - '→' => '→', - '↓' => '↓', - '■' => '■', - '○' => '○', - '𝐀' => 'A', - '𝐁' => 'B', - '𝐂' => 'C', - '𝐃' => 'D', - '𝐄' => 'E', - '𝐅' => 'F', - '𝐆' => 'G', - '𝐇' => 'H', - '𝐈' => 'I', - '𝐉' => 'J', - '𝐊' => 'K', - '𝐋' => 'L', - '𝐌' => 'M', - '𝐍' => 'N', - '𝐎' => 'O', - '𝐏' => 'P', - '𝐐' => 'Q', - '𝐑' => 'R', - '𝐒' => 'S', - '𝐓' => 'T', - '𝐔' => 'U', - '𝐕' => 'V', - '𝐖' => 'W', - '𝐗' => 'X', - '𝐘' => 'Y', - '𝐙' => 'Z', - '𝐚' => 'a', - '𝐛' => 'b', - '𝐜' => 'c', - '𝐝' => 'd', - '𝐞' => 'e', - '𝐟' => 'f', - '𝐠' => 'g', - '𝐡' => 'h', - '𝐢' => 'i', - '𝐣' => 'j', - '𝐤' => 'k', - '𝐥' => 'l', - '𝐦' => 'm', - '𝐧' => 'n', - '𝐨' => 'o', - '𝐩' => 'p', - '𝐪' => 'q', - '𝐫' => 'r', - '𝐬' => 's', - '𝐭' => 't', - '𝐮' => 'u', - '𝐯' => 'v', - '𝐰' => 'w', - '𝐱' => 'x', - '𝐲' => 'y', - '𝐳' => 'z', - '𝐴' => 'A', - '𝐵' => 'B', - '𝐶' => 'C', - '𝐷' => 'D', - '𝐸' => 'E', - '𝐹' => 'F', - '𝐺' => 'G', - '𝐻' => 'H', - '𝐼' => 'I', - '𝐽' => 'J', - '𝐾' => 'K', - '𝐿' => 'L', - '𝑀' => 'M', - '𝑁' => 'N', - '𝑂' => 'O', - '𝑃' => 'P', - '𝑄' => 'Q', - '𝑅' => 'R', - '𝑆' => 'S', - '𝑇' => 'T', - '𝑈' => 'U', - '𝑉' => 'V', - '𝑊' => 'W', - '𝑋' => 'X', - '𝑌' => 'Y', - '𝑍' => 'Z', - '𝑎' => 'a', - '𝑏' => 'b', - '𝑐' => 'c', - '𝑑' => 'd', - '𝑒' => 'e', - '𝑓' => 'f', - '𝑔' => 'g', - '𝑖' => 'i', - '𝑗' => 'j', - '𝑘' => 'k', - '𝑙' => 'l', - '𝑚' => 'm', - '𝑛' => 'n', - '𝑜' => 'o', - '𝑝' => 'p', - '𝑞' => 'q', - '𝑟' => 'r', - '𝑠' => 's', - '𝑡' => 't', - '𝑢' => 'u', - '𝑣' => 'v', - '𝑤' => 'w', - '𝑥' => 'x', - '𝑦' => 'y', - '𝑧' => 'z', - '𝑨' => 'A', - '𝑩' => 'B', - '𝑪' => 'C', - '𝑫' => 'D', - '𝑬' => 'E', - '𝑭' => 'F', - '𝑮' => 'G', - '𝑯' => 'H', - '𝑰' => 'I', - '𝑱' => 'J', - '𝑲' => 'K', - '𝑳' => 'L', - '𝑴' => 'M', - '𝑵' => 'N', - '𝑶' => 'O', - '𝑷' => 'P', - '𝑸' => 'Q', - '𝑹' => 'R', - '𝑺' => 'S', - '𝑻' => 'T', - '𝑼' => 'U', - '𝑽' => 'V', - '𝑾' => 'W', - '𝑿' => 'X', - '𝒀' => 'Y', - '𝒁' => 'Z', - '𝒂' => 'a', - '𝒃' => 'b', - '𝒄' => 'c', - '𝒅' => 'd', - '𝒆' => 'e', - '𝒇' => 'f', - '𝒈' => 'g', - '𝒉' => 'h', - '𝒊' => 'i', - '𝒋' => 'j', - '𝒌' => 'k', - '𝒍' => 'l', - '𝒎' => 'm', - '𝒏' => 'n', - '𝒐' => 'o', - '𝒑' => 'p', - '𝒒' => 'q', - '𝒓' => 'r', - '𝒔' => 's', - '𝒕' => 't', - '𝒖' => 'u', - '𝒗' => 'v', - '𝒘' => 'w', - '𝒙' => 'x', - '𝒚' => 'y', - '𝒛' => 'z', - '𝒜' => 'A', - '𝒞' => 'C', - '𝒟' => 'D', - '𝒢' => 'G', - '𝒥' => 'J', - '𝒦' => 'K', - '𝒩' => 'N', - '𝒪' => 'O', - '𝒫' => 'P', - '𝒬' => 'Q', - '𝒮' => 'S', - '𝒯' => 'T', - '𝒰' => 'U', - '𝒱' => 'V', - '𝒲' => 'W', - '𝒳' => 'X', - '𝒴' => 'Y', - '𝒵' => 'Z', - '𝒶' => 'a', - '𝒷' => 'b', - '𝒸' => 'c', - '𝒹' => 'd', - '𝒻' => 'f', - '𝒽' => 'h', - '𝒾' => 'i', - '𝒿' => 'j', - '𝓀' => 'k', - '𝓁' => 'l', - '𝓂' => 'm', - '𝓃' => 'n', - '𝓅' => 'p', - '𝓆' => 'q', - '𝓇' => 'r', - '𝓈' => 's', - '𝓉' => 't', - '𝓊' => 'u', - '𝓋' => 'v', - '𝓌' => 'w', - '𝓍' => 'x', - '𝓎' => 'y', - '𝓏' => 'z', - '𝓐' => 'A', - '𝓑' => 'B', - '𝓒' => 'C', - '𝓓' => 'D', - '𝓔' => 'E', - '𝓕' => 'F', - '𝓖' => 'G', - '𝓗' => 'H', - '𝓘' => 'I', - '𝓙' => 'J', - '𝓚' => 'K', - '𝓛' => 'L', - '𝓜' => 'M', - '𝓝' => 'N', - '𝓞' => 'O', - '𝓟' => 'P', - '𝓠' => 'Q', - '𝓡' => 'R', - '𝓢' => 'S', - '𝓣' => 'T', - '𝓤' => 'U', - '𝓥' => 'V', - '𝓦' => 'W', - '𝓧' => 'X', - '𝓨' => 'Y', - '𝓩' => 'Z', - '𝓪' => 'a', - '𝓫' => 'b', - '𝓬' => 'c', - '𝓭' => 'd', - '𝓮' => 'e', - '𝓯' => 'f', - '𝓰' => 'g', - '𝓱' => 'h', - '𝓲' => 'i', - '𝓳' => 'j', - '𝓴' => 'k', - '𝓵' => 'l', - '𝓶' => 'm', - '𝓷' => 'n', - '𝓸' => 'o', - '𝓹' => 'p', - '𝓺' => 'q', - '𝓻' => 'r', - '𝓼' => 's', - '𝓽' => 't', - '𝓾' => 'u', - '𝓿' => 'v', - '𝔀' => 'w', - '𝔁' => 'x', - '𝔂' => 'y', - '𝔃' => 'z', - '𝔄' => 'A', - '𝔅' => 'B', - '𝔇' => 'D', - '𝔈' => 'E', - '𝔉' => 'F', - '𝔊' => 'G', - '𝔍' => 'J', - '𝔎' => 'K', - '𝔏' => 'L', - '𝔐' => 'M', - '𝔑' => 'N', - '𝔒' => 'O', - '𝔓' => 'P', - '𝔔' => 'Q', - '𝔖' => 'S', - '𝔗' => 'T', - '𝔘' => 'U', - '𝔙' => 'V', - '𝔚' => 'W', - '𝔛' => 'X', - '𝔜' => 'Y', - '𝔞' => 'a', - '𝔟' => 'b', - '𝔠' => 'c', - '𝔡' => 'd', - '𝔢' => 'e', - '𝔣' => 'f', - '𝔤' => 'g', - '𝔥' => 'h', - '𝔦' => 'i', - '𝔧' => 'j', - '𝔨' => 'k', - '𝔩' => 'l', - '𝔪' => 'm', - '𝔫' => 'n', - '𝔬' => 'o', - '𝔭' => 'p', - '𝔮' => 'q', - '𝔯' => 'r', - '𝔰' => 's', - '𝔱' => 't', - '𝔲' => 'u', - '𝔳' => 'v', - '𝔴' => 'w', - '𝔵' => 'x', - '𝔶' => 'y', - '𝔷' => 'z', - '𝔸' => 'A', - '𝔹' => 'B', - '𝔻' => 'D', - '𝔼' => 'E', - '𝔽' => 'F', - '𝔾' => 'G', - '𝕀' => 'I', - '𝕁' => 'J', - '𝕂' => 'K', - '𝕃' => 'L', - '𝕄' => 'M', - '𝕆' => 'O', - '𝕊' => 'S', - '𝕋' => 'T', - '𝕌' => 'U', - '𝕍' => 'V', - '𝕎' => 'W', - '𝕏' => 'X', - '𝕐' => 'Y', - '𝕒' => 'a', - '𝕓' => 'b', - '𝕔' => 'c', - '𝕕' => 'd', - '𝕖' => 'e', - '𝕗' => 'f', - '𝕘' => 'g', - '𝕙' => 'h', - '𝕚' => 'i', - '𝕛' => 'j', - '𝕜' => 'k', - '𝕝' => 'l', - '𝕞' => 'm', - '𝕟' => 'n', - '𝕠' => 'o', - '𝕡' => 'p', - '𝕢' => 'q', - '𝕣' => 'r', - '𝕤' => 's', - '𝕥' => 't', - '𝕦' => 'u', - '𝕧' => 'v', - '𝕨' => 'w', - '𝕩' => 'x', - '𝕪' => 'y', - '𝕫' => 'z', - '𝕬' => 'A', - '𝕭' => 'B', - '𝕮' => 'C', - '𝕯' => 'D', - '𝕰' => 'E', - '𝕱' => 'F', - '𝕲' => 'G', - '𝕳' => 'H', - '𝕴' => 'I', - '𝕵' => 'J', - '𝕶' => 'K', - '𝕷' => 'L', - '𝕸' => 'M', - '𝕹' => 'N', - '𝕺' => 'O', - '𝕻' => 'P', - '𝕼' => 'Q', - '𝕽' => 'R', - '𝕾' => 'S', - '𝕿' => 'T', - '𝖀' => 'U', - '𝖁' => 'V', - '𝖂' => 'W', - '𝖃' => 'X', - '𝖄' => 'Y', - '𝖅' => 'Z', - '𝖆' => 'a', - '𝖇' => 'b', - '𝖈' => 'c', - '𝖉' => 'd', - '𝖊' => 'e', - '𝖋' => 'f', - '𝖌' => 'g', - '𝖍' => 'h', - '𝖎' => 'i', - '𝖏' => 'j', - '𝖐' => 'k', - '𝖑' => 'l', - '𝖒' => 'm', - '𝖓' => 'n', - '𝖔' => 'o', - '𝖕' => 'p', - '𝖖' => 'q', - '𝖗' => 'r', - '𝖘' => 's', - '𝖙' => 't', - '𝖚' => 'u', - '𝖛' => 'v', - '𝖜' => 'w', - '𝖝' => 'x', - '𝖞' => 'y', - '𝖟' => 'z', - '𝖠' => 'A', - '𝖡' => 'B', - '𝖢' => 'C', - '𝖣' => 'D', - '𝖤' => 'E', - '𝖥' => 'F', - '𝖦' => 'G', - '𝖧' => 'H', - '𝖨' => 'I', - '𝖩' => 'J', - '𝖪' => 'K', - '𝖫' => 'L', - '𝖬' => 'M', - '𝖭' => 'N', - '𝖮' => 'O', - '𝖯' => 'P', - '𝖰' => 'Q', - '𝖱' => 'R', - '𝖲' => 'S', - '𝖳' => 'T', - '𝖴' => 'U', - '𝖵' => 'V', - '𝖶' => 'W', - '𝖷' => 'X', - '𝖸' => 'Y', - '𝖹' => 'Z', - '𝖺' => 'a', - '𝖻' => 'b', - '𝖼' => 'c', - '𝖽' => 'd', - '𝖾' => 'e', - '𝖿' => 'f', - '𝗀' => 'g', - '𝗁' => 'h', - '𝗂' => 'i', - '𝗃' => 'j', - '𝗄' => 'k', - '𝗅' => 'l', - '𝗆' => 'm', - '𝗇' => 'n', - '𝗈' => 'o', - '𝗉' => 'p', - '𝗊' => 'q', - '𝗋' => 'r', - '𝗌' => 's', - '𝗍' => 't', - '𝗎' => 'u', - '𝗏' => 'v', - '𝗐' => 'w', - '𝗑' => 'x', - '𝗒' => 'y', - '𝗓' => 'z', - '𝗔' => 'A', - '𝗕' => 'B', - '𝗖' => 'C', - '𝗗' => 'D', - '𝗘' => 'E', - '𝗙' => 'F', - '𝗚' => 'G', - '𝗛' => 'H', - '𝗜' => 'I', - '𝗝' => 'J', - '𝗞' => 'K', - '𝗟' => 'L', - '𝗠' => 'M', - '𝗡' => 'N', - '𝗢' => 'O', - '𝗣' => 'P', - '𝗤' => 'Q', - '𝗥' => 'R', - '𝗦' => 'S', - '𝗧' => 'T', - '𝗨' => 'U', - '𝗩' => 'V', - '𝗪' => 'W', - '𝗫' => 'X', - '𝗬' => 'Y', - '𝗭' => 'Z', - '𝗮' => 'a', - '𝗯' => 'b', - '𝗰' => 'c', - '𝗱' => 'd', - '𝗲' => 'e', - '𝗳' => 'f', - '𝗴' => 'g', - '𝗵' => 'h', - '𝗶' => 'i', - '𝗷' => 'j', - '𝗸' => 'k', - '𝗹' => 'l', - '𝗺' => 'm', - '𝗻' => 'n', - '𝗼' => 'o', - '𝗽' => 'p', - '𝗾' => 'q', - '𝗿' => 'r', - '𝘀' => 's', - '𝘁' => 't', - '𝘂' => 'u', - '𝘃' => 'v', - '𝘄' => 'w', - '𝘅' => 'x', - '𝘆' => 'y', - '𝘇' => 'z', - '𝘈' => 'A', - '𝘉' => 'B', - '𝘊' => 'C', - '𝘋' => 'D', - '𝘌' => 'E', - '𝘍' => 'F', - '𝘎' => 'G', - '𝘏' => 'H', - '𝘐' => 'I', - '𝘑' => 'J', - '𝘒' => 'K', - '𝘓' => 'L', - '𝘔' => 'M', - '𝘕' => 'N', - '𝘖' => 'O', - '𝘗' => 'P', - '𝘘' => 'Q', - '𝘙' => 'R', - '𝘚' => 'S', - '𝘛' => 'T', - '𝘜' => 'U', - '𝘝' => 'V', - '𝘞' => 'W', - '𝘟' => 'X', - '𝘠' => 'Y', - '𝘡' => 'Z', - '𝘢' => 'a', - '𝘣' => 'b', - '𝘤' => 'c', - '𝘥' => 'd', - '𝘦' => 'e', - '𝘧' => 'f', - '𝘨' => 'g', - '𝘩' => 'h', - '𝘪' => 'i', - '𝘫' => 'j', - '𝘬' => 'k', - '𝘭' => 'l', - '𝘮' => 'm', - '𝘯' => 'n', - '𝘰' => 'o', - '𝘱' => 'p', - '𝘲' => 'q', - '𝘳' => 'r', - '𝘴' => 's', - '𝘵' => 't', - '𝘶' => 'u', - '𝘷' => 'v', - '𝘸' => 'w', - '𝘹' => 'x', - '𝘺' => 'y', - '𝘻' => 'z', - '𝘼' => 'A', - '𝘽' => 'B', - '𝘾' => 'C', - '𝘿' => 'D', - '𝙀' => 'E', - '𝙁' => 'F', - '𝙂' => 'G', - '𝙃' => 'H', - '𝙄' => 'I', - '𝙅' => 'J', - '𝙆' => 'K', - '𝙇' => 'L', - '𝙈' => 'M', - '𝙉' => 'N', - '𝙊' => 'O', - '𝙋' => 'P', - '𝙌' => 'Q', - '𝙍' => 'R', - '𝙎' => 'S', - '𝙏' => 'T', - '𝙐' => 'U', - '𝙑' => 'V', - '𝙒' => 'W', - '𝙓' => 'X', - '𝙔' => 'Y', - '𝙕' => 'Z', - '𝙖' => 'a', - '𝙗' => 'b', - '𝙘' => 'c', - '𝙙' => 'd', - '𝙚' => 'e', - '𝙛' => 'f', - '𝙜' => 'g', - '𝙝' => 'h', - '𝙞' => 'i', - '𝙟' => 'j', - '𝙠' => 'k', - '𝙡' => 'l', - '𝙢' => 'm', - '𝙣' => 'n', - '𝙤' => 'o', - '𝙥' => 'p', - '𝙦' => 'q', - '𝙧' => 'r', - '𝙨' => 's', - '𝙩' => 't', - '𝙪' => 'u', - '𝙫' => 'v', - '𝙬' => 'w', - '𝙭' => 'x', - '𝙮' => 'y', - '𝙯' => 'z', - '𝙰' => 'A', - '𝙱' => 'B', - '𝙲' => 'C', - '𝙳' => 'D', - '𝙴' => 'E', - '𝙵' => 'F', - '𝙶' => 'G', - '𝙷' => 'H', - '𝙸' => 'I', - '𝙹' => 'J', - '𝙺' => 'K', - '𝙻' => 'L', - '𝙼' => 'M', - '𝙽' => 'N', - '𝙾' => 'O', - '𝙿' => 'P', - '𝚀' => 'Q', - '𝚁' => 'R', - '𝚂' => 'S', - '𝚃' => 'T', - '𝚄' => 'U', - '𝚅' => 'V', - '𝚆' => 'W', - '𝚇' => 'X', - '𝚈' => 'Y', - '𝚉' => 'Z', - '𝚊' => 'a', - '𝚋' => 'b', - '𝚌' => 'c', - '𝚍' => 'd', - '𝚎' => 'e', - '𝚏' => 'f', - '𝚐' => 'g', - '𝚑' => 'h', - '𝚒' => 'i', - '𝚓' => 'j', - '𝚔' => 'k', - '𝚕' => 'l', - '𝚖' => 'm', - '𝚗' => 'n', - '𝚘' => 'o', - '𝚙' => 'p', - '𝚚' => 'q', - '𝚛' => 'r', - '𝚜' => 's', - '𝚝' => 't', - '𝚞' => 'u', - '𝚟' => 'v', - '𝚠' => 'w', - '𝚡' => 'x', - '𝚢' => 'y', - '𝚣' => 'z', - '𝚤' => 'ı', - '𝚥' => 'ȷ', - '𝚨' => 'Α', - '𝚩' => 'Β', - '𝚪' => 'Γ', - '𝚫' => 'Δ', - '𝚬' => 'Ε', - '𝚭' => 'Ζ', - '𝚮' => 'Η', - '𝚯' => 'Θ', - '𝚰' => 'Ι', - '𝚱' => 'Κ', - '𝚲' => 'Λ', - '𝚳' => 'Μ', - '𝚴' => 'Ν', - '𝚵' => 'Ξ', - '𝚶' => 'Ο', - '𝚷' => 'Π', - '𝚸' => 'Ρ', - '𝚹' => 'Θ', - '𝚺' => 'Σ', - '𝚻' => 'Τ', - '𝚼' => 'Υ', - '𝚽' => 'Φ', - '𝚾' => 'Χ', - '𝚿' => 'Ψ', - '𝛀' => 'Ω', - '𝛁' => '∇', - '𝛂' => 'α', - '𝛃' => 'β', - '𝛄' => 'γ', - '𝛅' => 'δ', - '𝛆' => 'ε', - '𝛇' => 'ζ', - '𝛈' => 'η', - '𝛉' => 'θ', - '𝛊' => 'ι', - '𝛋' => 'κ', - '𝛌' => 'λ', - '𝛍' => 'μ', - '𝛎' => 'ν', - '𝛏' => 'ξ', - '𝛐' => 'ο', - '𝛑' => 'π', - '𝛒' => 'ρ', - '𝛓' => 'ς', - '𝛔' => 'σ', - '𝛕' => 'τ', - '𝛖' => 'υ', - '𝛗' => 'φ', - '𝛘' => 'χ', - '𝛙' => 'ψ', - '𝛚' => 'ω', - '𝛛' => '∂', - '𝛜' => 'ε', - '𝛝' => 'θ', - '𝛞' => 'κ', - '𝛟' => 'φ', - '𝛠' => 'ρ', - '𝛡' => 'π', - '𝛢' => 'Α', - '𝛣' => 'Β', - '𝛤' => 'Γ', - '𝛥' => 'Δ', - '𝛦' => 'Ε', - '𝛧' => 'Ζ', - '𝛨' => 'Η', - '𝛩' => 'Θ', - '𝛪' => 'Ι', - '𝛫' => 'Κ', - '𝛬' => 'Λ', - '𝛭' => 'Μ', - '𝛮' => 'Ν', - '𝛯' => 'Ξ', - '𝛰' => 'Ο', - '𝛱' => 'Π', - '𝛲' => 'Ρ', - '𝛳' => 'Θ', - '𝛴' => 'Σ', - '𝛵' => 'Τ', - '𝛶' => 'Υ', - '𝛷' => 'Φ', - '𝛸' => 'Χ', - '𝛹' => 'Ψ', - '𝛺' => 'Ω', - '𝛻' => '∇', - '𝛼' => 'α', - '𝛽' => 'β', - '𝛾' => 'γ', - '𝛿' => 'δ', - '𝜀' => 'ε', - '𝜁' => 'ζ', - '𝜂' => 'η', - '𝜃' => 'θ', - '𝜄' => 'ι', - '𝜅' => 'κ', - '𝜆' => 'λ', - '𝜇' => 'μ', - '𝜈' => 'ν', - '𝜉' => 'ξ', - '𝜊' => 'ο', - '𝜋' => 'π', - '𝜌' => 'ρ', - '𝜍' => 'ς', - '𝜎' => 'σ', - '𝜏' => 'τ', - '𝜐' => 'υ', - '𝜑' => 'φ', - '𝜒' => 'χ', - '𝜓' => 'ψ', - '𝜔' => 'ω', - '𝜕' => '∂', - '𝜖' => 'ε', - '𝜗' => 'θ', - '𝜘' => 'κ', - '𝜙' => 'φ', - '𝜚' => 'ρ', - '𝜛' => 'π', - '𝜜' => 'Α', - '𝜝' => 'Β', - '𝜞' => 'Γ', - '𝜟' => 'Δ', - '𝜠' => 'Ε', - '𝜡' => 'Ζ', - '𝜢' => 'Η', - '𝜣' => 'Θ', - '𝜤' => 'Ι', - '𝜥' => 'Κ', - '𝜦' => 'Λ', - '𝜧' => 'Μ', - '𝜨' => 'Ν', - '𝜩' => 'Ξ', - '𝜪' => 'Ο', - '𝜫' => 'Π', - '𝜬' => 'Ρ', - '𝜭' => 'Θ', - '𝜮' => 'Σ', - '𝜯' => 'Τ', - '𝜰' => 'Υ', - '𝜱' => 'Φ', - '𝜲' => 'Χ', - '𝜳' => 'Ψ', - '𝜴' => 'Ω', - '𝜵' => '∇', - '𝜶' => 'α', - '𝜷' => 'β', - '𝜸' => 'γ', - '𝜹' => 'δ', - '𝜺' => 'ε', - '𝜻' => 'ζ', - '𝜼' => 'η', - '𝜽' => 'θ', - '𝜾' => 'ι', - '𝜿' => 'κ', - '𝝀' => 'λ', - '𝝁' => 'μ', - '𝝂' => 'ν', - '𝝃' => 'ξ', - '𝝄' => 'ο', - '𝝅' => 'π', - '𝝆' => 'ρ', - '𝝇' => 'ς', - '𝝈' => 'σ', - '𝝉' => 'τ', - '𝝊' => 'υ', - '𝝋' => 'φ', - '𝝌' => 'χ', - '𝝍' => 'ψ', - '𝝎' => 'ω', - '𝝏' => '∂', - '𝝐' => 'ε', - '𝝑' => 'θ', - '𝝒' => 'κ', - '𝝓' => 'φ', - '𝝔' => 'ρ', - '𝝕' => 'π', - '𝝖' => 'Α', - '𝝗' => 'Β', - '𝝘' => 'Γ', - '𝝙' => 'Δ', - '𝝚' => 'Ε', - '𝝛' => 'Ζ', - '𝝜' => 'Η', - '𝝝' => 'Θ', - '𝝞' => 'Ι', - '𝝟' => 'Κ', - '𝝠' => 'Λ', - '𝝡' => 'Μ', - '𝝢' => 'Ν', - '𝝣' => 'Ξ', - '𝝤' => 'Ο', - '𝝥' => 'Π', - '𝝦' => 'Ρ', - '𝝧' => 'Θ', - '𝝨' => 'Σ', - '𝝩' => 'Τ', - '𝝪' => 'Υ', - '𝝫' => 'Φ', - '𝝬' => 'Χ', - '𝝭' => 'Ψ', - '𝝮' => 'Ω', - '𝝯' => '∇', - '𝝰' => 'α', - '𝝱' => 'β', - '𝝲' => 'γ', - '𝝳' => 'δ', - '𝝴' => 'ε', - '𝝵' => 'ζ', - '𝝶' => 'η', - '𝝷' => 'θ', - '𝝸' => 'ι', - '𝝹' => 'κ', - '𝝺' => 'λ', - '𝝻' => 'μ', - '𝝼' => 'ν', - '𝝽' => 'ξ', - '𝝾' => 'ο', - '𝝿' => 'π', - '𝞀' => 'ρ', - '𝞁' => 'ς', - '𝞂' => 'σ', - '𝞃' => 'τ', - '𝞄' => 'υ', - '𝞅' => 'φ', - '𝞆' => 'χ', - '𝞇' => 'ψ', - '𝞈' => 'ω', - '𝞉' => '∂', - '𝞊' => 'ε', - '𝞋' => 'θ', - '𝞌' => 'κ', - '𝞍' => 'φ', - '𝞎' => 'ρ', - '𝞏' => 'π', - '𝞐' => 'Α', - '𝞑' => 'Β', - '𝞒' => 'Γ', - '𝞓' => 'Δ', - '𝞔' => 'Ε', - '𝞕' => 'Ζ', - '𝞖' => 'Η', - '𝞗' => 'Θ', - '𝞘' => 'Ι', - '𝞙' => 'Κ', - '𝞚' => 'Λ', - '𝞛' => 'Μ', - '𝞜' => 'Ν', - '𝞝' => 'Ξ', - '𝞞' => 'Ο', - '𝞟' => 'Π', - '𝞠' => 'Ρ', - '𝞡' => 'Θ', - '𝞢' => 'Σ', - '𝞣' => 'Τ', - '𝞤' => 'Υ', - '𝞥' => 'Φ', - '𝞦' => 'Χ', - '𝞧' => 'Ψ', - '𝞨' => 'Ω', - '𝞩' => '∇', - '𝞪' => 'α', - '𝞫' => 'β', - '𝞬' => 'γ', - '𝞭' => 'δ', - '𝞮' => 'ε', - '𝞯' => 'ζ', - '𝞰' => 'η', - '𝞱' => 'θ', - '𝞲' => 'ι', - '𝞳' => 'κ', - '𝞴' => 'λ', - '𝞵' => 'μ', - '𝞶' => 'ν', - '𝞷' => 'ξ', - '𝞸' => 'ο', - '𝞹' => 'π', - '𝞺' => 'ρ', - '𝞻' => 'ς', - '𝞼' => 'σ', - '𝞽' => 'τ', - '𝞾' => 'υ', - '𝞿' => 'φ', - '𝟀' => 'χ', - '𝟁' => 'ψ', - '𝟂' => 'ω', - '𝟃' => '∂', - '𝟄' => 'ε', - '𝟅' => 'θ', - '𝟆' => 'κ', - '𝟇' => 'φ', - '𝟈' => 'ρ', - '𝟉' => 'π', - '𝟊' => 'Ϝ', - '𝟋' => 'ϝ', - '𝟎' => '0', - '𝟏' => '1', - '𝟐' => '2', - '𝟑' => '3', - '𝟒' => '4', - '𝟓' => '5', - '𝟔' => '6', - '𝟕' => '7', - '𝟖' => '8', - '𝟗' => '9', - '𝟘' => '0', - '𝟙' => '1', - '𝟚' => '2', - '𝟛' => '3', - '𝟜' => '4', - '𝟝' => '5', - '𝟞' => '6', - '𝟟' => '7', - '𝟠' => '8', - '𝟡' => '9', - '𝟢' => '0', - '𝟣' => '1', - '𝟤' => '2', - '𝟥' => '3', - '𝟦' => '4', - '𝟧' => '5', - '𝟨' => '6', - '𝟩' => '7', - '𝟪' => '8', - '𝟫' => '9', - '𝟬' => '0', - '𝟭' => '1', - '𝟮' => '2', - '𝟯' => '3', - '𝟰' => '4', - '𝟱' => '5', - '𝟲' => '6', - '𝟳' => '7', - '𝟴' => '8', - '𝟵' => '9', - '𝟶' => '0', - '𝟷' => '1', - '𝟸' => '2', - '𝟹' => '3', - '𝟺' => '4', - '𝟻' => '5', - '𝟼' => '6', - '𝟽' => '7', - '𝟾' => '8', - '𝟿' => '9', - '𞸀' => 'ا', - '𞸁' => 'ب', - '𞸂' => 'ج', - '𞸃' => 'د', - '𞸅' => 'و', - '𞸆' => 'ز', - '𞸇' => 'ح', - '𞸈' => 'ط', - '𞸉' => 'ي', - '𞸊' => 'ك', - '𞸋' => 'ل', - '𞸌' => 'م', - '𞸍' => 'ن', - '𞸎' => 'س', - '𞸏' => 'ع', - '𞸐' => 'ف', - '𞸑' => 'ص', - '𞸒' => 'ق', - '𞸓' => 'ر', - '𞸔' => 'ش', - '𞸕' => 'ت', - '𞸖' => 'ث', - '𞸗' => 'خ', - '𞸘' => 'ذ', - '𞸙' => 'ض', - '𞸚' => 'ظ', - '𞸛' => 'غ', - '𞸜' => 'ٮ', - '𞸝' => 'ں', - '𞸞' => 'ڡ', - '𞸟' => 'ٯ', - '𞸡' => 'ب', - '𞸢' => 'ج', - '𞸤' => 'ه', - '𞸧' => 'ح', - '𞸩' => 'ي', - '𞸪' => 'ك', - '𞸫' => 'ل', - '𞸬' => 'م', - '𞸭' => 'ن', - '𞸮' => 'س', - '𞸯' => 'ع', - '𞸰' => 'ف', - '𞸱' => 'ص', - '𞸲' => 'ق', - '𞸴' => 'ش', - '𞸵' => 'ت', - '𞸶' => 'ث', - '𞸷' => 'خ', - '𞸹' => 'ض', - '𞸻' => 'غ', - '𞹂' => 'ج', - '𞹇' => 'ح', - '𞹉' => 'ي', - '𞹋' => 'ل', - '𞹍' => 'ن', - '𞹎' => 'س', - '𞹏' => 'ع', - '𞹑' => 'ص', - '𞹒' => 'ق', - '𞹔' => 'ش', - '𞹗' => 'خ', - '𞹙' => 'ض', - '𞹛' => 'غ', - '𞹝' => 'ں', - '𞹟' => 'ٯ', - '𞹡' => 'ب', - '𞹢' => 'ج', - '𞹤' => 'ه', - '𞹧' => 'ح', - '𞹨' => 'ط', - '𞹩' => 'ي', - '𞹪' => 'ك', - '𞹬' => 'م', - '𞹭' => 'ن', - '𞹮' => 'س', - '𞹯' => 'ع', - '𞹰' => 'ف', - '𞹱' => 'ص', - '𞹲' => 'ق', - '𞹴' => 'ش', - '𞹵' => 'ت', - '𞹶' => 'ث', - '𞹷' => 'خ', - '𞹹' => 'ض', - '𞹺' => 'ظ', - '𞹻' => 'غ', - '𞹼' => 'ٮ', - '𞹾' => 'ڡ', - '𞺀' => 'ا', - '𞺁' => 'ب', - '𞺂' => 'ج', - '𞺃' => 'د', - '𞺄' => 'ه', - '𞺅' => 'و', - '𞺆' => 'ز', - '𞺇' => 'ح', - '𞺈' => 'ط', - '𞺉' => 'ي', - '𞺋' => 'ل', - '𞺌' => 'م', - '𞺍' => 'ن', - '𞺎' => 'س', - '𞺏' => 'ع', - '𞺐' => 'ف', - '𞺑' => 'ص', - '𞺒' => 'ق', - '𞺓' => 'ر', - '𞺔' => 'ش', - '𞺕' => 'ت', - '𞺖' => 'ث', - '𞺗' => 'خ', - '𞺘' => 'ذ', - '𞺙' => 'ض', - '𞺚' => 'ظ', - '𞺛' => 'غ', - '𞺡' => 'ب', - '𞺢' => 'ج', - '𞺣' => 'د', - '𞺥' => 'و', - '𞺦' => 'ز', - '𞺧' => 'ح', - '𞺨' => 'ط', - '𞺩' => 'ي', - '𞺫' => 'ل', - '𞺬' => 'م', - '𞺭' => 'ن', - '𞺮' => 'س', - '𞺯' => 'ع', - '𞺰' => 'ف', - '𞺱' => 'ص', - '𞺲' => 'ق', - '𞺳' => 'ر', - '𞺴' => 'ش', - '𞺵' => 'ت', - '𞺶' => 'ث', - '𞺷' => 'خ', - '𞺸' => 'ذ', - '𞺹' => 'ض', - '𞺺' => 'ظ', - '𞺻' => 'غ', - '🄀' => '0.', - '🄁' => '0,', - '🄂' => '1,', - '🄃' => '2,', - '🄄' => '3,', - '🄅' => '4,', - '🄆' => '5,', - '🄇' => '6,', - '🄈' => '7,', - '🄉' => '8,', - '🄊' => '9,', - '🄐' => '(A)', - '🄑' => '(B)', - '🄒' => '(C)', - '🄓' => '(D)', - '🄔' => '(E)', - '🄕' => '(F)', - '🄖' => '(G)', - '🄗' => '(H)', - '🄘' => '(I)', - '🄙' => '(J)', - '🄚' => '(K)', - '🄛' => '(L)', - '🄜' => '(M)', - '🄝' => '(N)', - '🄞' => '(O)', - '🄟' => '(P)', - '🄠' => '(Q)', - '🄡' => '(R)', - '🄢' => '(S)', - '🄣' => '(T)', - '🄤' => '(U)', - '🄥' => '(V)', - '🄦' => '(W)', - '🄧' => '(X)', - '🄨' => '(Y)', - '🄩' => '(Z)', - '🄪' => '〔S〕', - '🄫' => 'C', - '🄬' => 'R', - '🄭' => 'CD', - '🄮' => 'WZ', - '🄰' => 'A', - '🄱' => 'B', - '🄲' => 'C', - '🄳' => 'D', - '🄴' => 'E', - '🄵' => 'F', - '🄶' => 'G', - '🄷' => 'H', - '🄸' => 'I', - '🄹' => 'J', - '🄺' => 'K', - '🄻' => 'L', - '🄼' => 'M', - '🄽' => 'N', - '🄾' => 'O', - '🄿' => 'P', - '🅀' => 'Q', - '🅁' => 'R', - '🅂' => 'S', - '🅃' => 'T', - '🅄' => 'U', - '🅅' => 'V', - '🅆' => 'W', - '🅇' => 'X', - '🅈' => 'Y', - '🅉' => 'Z', - '🅊' => 'HV', - '🅋' => 'MV', - '🅌' => 'SD', - '🅍' => 'SS', - '🅎' => 'PPV', - '🅏' => 'WC', - '🅪' => 'MC', - '🅫' => 'MD', - '🅬' => 'MR', - '🆐' => 'DJ', - '🈀' => 'ほか', - '🈁' => 'ココ', - '🈂' => 'サ', - '🈐' => '手', - '🈑' => '字', - '🈒' => '双', - '🈓' => 'デ', - '🈔' => '二', - '🈕' => '多', - '🈖' => '解', - '🈗' => '天', - '🈘' => '交', - '🈙' => '映', - '🈚' => '無', - '🈛' => '料', - '🈜' => '前', - '🈝' => '後', - '🈞' => '再', - '🈟' => '新', - '🈠' => '初', - '🈡' => '終', - '🈢' => '生', - '🈣' => '販', - '🈤' => '声', - '🈥' => '吹', - '🈦' => '演', - '🈧' => '投', - '🈨' => '捕', - '🈩' => '一', - '🈪' => '三', - '🈫' => '遊', - '🈬' => '左', - '🈭' => '中', - '🈮' => '右', - '🈯' => '指', - '🈰' => '走', - '🈱' => '打', - '🈲' => '禁', - '🈳' => '空', - '🈴' => '合', - '🈵' => '満', - '🈶' => '有', - '🈷' => '月', - '🈸' => '申', - '🈹' => '割', - '🈺' => '営', - '🈻' => '配', - '🉀' => '〔本〕', - '🉁' => '〔三〕', - '🉂' => '〔二〕', - '🉃' => '〔安〕', - '🉄' => '〔点〕', - '🉅' => '〔打〕', - '🉆' => '〔盗〕', - '🉇' => '〔勝〕', - '🉈' => '〔敗〕', - '🉐' => '得', - '🉑' => '可', - '🯰' => '0', - '🯱' => '1', - '🯲' => '2', - '🯳' => '3', - '🯴' => '4', - '🯵' => '5', - '🯶' => '6', - '🯷' => '7', - '🯸' => '8', - '🯹' => '9', -); diff --git a/app/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/app/vendor/symfony/polyfill-intl-normalizer/bootstrap.php deleted file mode 100644 index 3608e5c05..000000000 --- a/app/vendor/symfony/polyfill-intl-normalizer/bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } -} diff --git a/app/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/app/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php deleted file mode 100644 index e36d1a947..000000000 --- a/app/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } -} diff --git a/app/vendor/symfony/polyfill-intl-normalizer/composer.json b/app/vendor/symfony/polyfill-intl-normalizer/composer.json deleted file mode 100644 index 393edf701..000000000 --- a/app/vendor/symfony/polyfill-intl-normalizer/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "symfony/polyfill-intl-normalizer", - "type": "library", - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "normalizer"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "suggest": { - "ext-intl": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/app/vendor/symfony/polyfill-intl-grapheme/LICENSE b/app/vendor/symfony/polyfill-php72/LICENSE similarity index 100% rename from app/vendor/symfony/polyfill-intl-grapheme/LICENSE rename to app/vendor/symfony/polyfill-php72/LICENSE diff --git a/app/vendor/symfony/polyfill-php72/Php72.php b/app/vendor/symfony/polyfill-php72/Php72.php new file mode 100644 index 000000000..5e20d5bf8 --- /dev/null +++ b/app/vendor/symfony/polyfill-php72/Php72.php @@ -0,0 +1,217 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php72; + +/** + * @author Nicolas Grekas + * @author Dariusz Rumiński + * + * @internal + */ +final class Php72 +{ + private static $hashMask; + + public static function utf8_encode($s) + { + $s .= $s; + $len = \strlen($s); + + for ($i = $len >> 1, $j = 0; $i < $len; ++$i, ++$j) { + switch (true) { + case $s[$i] < "\x80": $s[$j] = $s[$i]; break; + case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break; + default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break; + } + } + + return substr($s, 0, $j); + } + + public static function utf8_decode($s) + { + $s = (string) $s; + $len = \strlen($s); + + for ($i = 0, $j = 0; $i < $len; ++$i, ++$j) { + switch ($s[$i] & "\xF0") { + case "\xC0": + case "\xD0": + $c = (\ord($s[$i] & "\x1F") << 6) | \ord($s[++$i] & "\x3F"); + $s[$j] = $c < 256 ? \chr($c) : '?'; + break; + + case "\xF0": + ++$i; + // no break + + case "\xE0": + $s[$j] = '?'; + $i += 2; + break; + + default: + $s[$j] = $s[$i]; + } + } + + return substr($s, 0, $j); + } + + public static function php_os_family() + { + if ('\\' === \DIRECTORY_SEPARATOR) { + return 'Windows'; + } + + $map = [ + 'Darwin' => 'Darwin', + 'DragonFly' => 'BSD', + 'FreeBSD' => 'BSD', + 'NetBSD' => 'BSD', + 'OpenBSD' => 'BSD', + 'Linux' => 'Linux', + 'SunOS' => 'Solaris', + ]; + + return isset($map[\PHP_OS]) ? $map[\PHP_OS] : 'Unknown'; + } + + public static function spl_object_id($object) + { + if (null === self::$hashMask) { + self::initHashMask(); + } + if (null === $hash = spl_object_hash($object)) { + return; + } + + // On 32-bit systems, PHP_INT_SIZE is 4, + return self::$hashMask ^ hexdec(substr($hash, 16 - (\PHP_INT_SIZE * 2 - 1), (\PHP_INT_SIZE * 2 - 1))); + } + + public static function sapi_windows_vt100_support($stream, $enable = null) + { + if (!\is_resource($stream)) { + trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING); + + return false; + } + + $meta = stream_get_meta_data($stream); + + if ('STDIO' !== $meta['stream_type']) { + trigger_error('sapi_windows_vt100_support() was not able to analyze the specified stream', \E_USER_WARNING); + + return false; + } + + // We cannot actually disable vt100 support if it is set + if (false === $enable || !self::stream_isatty($stream)) { + return false; + } + + // The native function does not apply to stdin + $meta = array_map('strtolower', $meta); + $stdin = 'php://stdin' === $meta['uri'] || 'php://fd/0' === $meta['uri']; + + return !$stdin + && (false !== getenv('ANSICON') + || 'ON' === getenv('ConEmuANSI') + || 'xterm' === getenv('TERM') + || 'Hyper' === getenv('TERM_PROGRAM')); + } + + public static function stream_isatty($stream) + { + if (!\is_resource($stream)) { + trigger_error('stream_isatty() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING); + + return false; + } + + if ('\\' === \DIRECTORY_SEPARATOR) { + $stat = @fstat($stream); + // Check if formatted mode is S_IFCHR + return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; + } + + return \function_exists('posix_isatty') && @posix_isatty($stream); + } + + private static function initHashMask() + { + $obj = (object) []; + self::$hashMask = -1; + + // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below + $obFuncs = ['ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush']; + foreach (debug_backtrace(\PHP_VERSION_ID >= 50400 ? \DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) { + if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) { + $frame['line'] = 0; + break; + } + } + if (!empty($frame['line'])) { + ob_start(); + debug_zval_dump($obj); + self::$hashMask = (int) substr(ob_get_clean(), 17); + } + + self::$hashMask ^= hexdec(substr(spl_object_hash($obj), 16 - (\PHP_INT_SIZE * 2 - 1), (\PHP_INT_SIZE * 2 - 1))); + } + + public static function mb_chr($code, $encoding = null) + { + if (0x80 > $code %= 0x200000) { + $s = \chr($code); + } elseif (0x800 > $code) { + $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); + } elseif (0x10000 > $code) { + $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } else { + $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } + + if ('UTF-8' !== $encoding = $encoding ?? mb_internal_encoding()) { + $s = mb_convert_encoding($s, $encoding, 'UTF-8'); + } + + return $s; + } + + public static function mb_ord($s, $encoding = null) + { + if (null === $encoding) { + $s = mb_convert_encoding($s, 'UTF-8'); + } elseif ('UTF-8' !== $encoding) { + $s = mb_convert_encoding($s, 'UTF-8', $encoding); + } + + if (1 === \strlen($s)) { + return \ord($s); + } + + $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; + if (0xF0 <= $code) { + return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; + } + if (0xE0 <= $code) { + return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; + } + if (0xC0 <= $code) { + return (($code - 0xC0) << 6) + $s[2] - 0x80; + } + + return $code; + } +} diff --git a/app/vendor/symfony/polyfill-php72/README.md b/app/vendor/symfony/polyfill-php72/README.md new file mode 100644 index 000000000..59dec8a23 --- /dev/null +++ b/app/vendor/symfony/polyfill-php72/README.md @@ -0,0 +1,28 @@ +Symfony Polyfill / Php72 +======================== + +This component provides functions added to PHP 7.2 core: + +- [`spl_object_id`](https://php.net/spl_object_id) +- [`stream_isatty`](https://php.net/stream_isatty) + +On Windows only: + +- [`sapi_windows_vt100_support`](https://php.net/sapi_windows_vt100_support) + +Moved to core since 7.2 (was in the optional XML extension earlier): + +- [`utf8_encode`](https://php.net/utf8_encode) +- [`utf8_decode`](https://php.net/utf8_decode) + +Also, it provides constants added to PHP 7.2: +- [`PHP_FLOAT_*`](https://php.net/reserved.constants#constant.php-float-dig) +- [`PHP_OS_FAMILY`](https://php.net/reserved.constants#constant.php-os-family) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/app/vendor/symfony/polyfill-php72/bootstrap.php b/app/vendor/symfony/polyfill-php72/bootstrap.php new file mode 100644 index 000000000..b5c92d4c7 --- /dev/null +++ b/app/vendor/symfony/polyfill-php72/bootstrap.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php72 as p; + +if (\PHP_VERSION_ID >= 70200) { + return; +} + +if (!defined('PHP_FLOAT_DIG')) { + define('PHP_FLOAT_DIG', 15); +} +if (!defined('PHP_FLOAT_EPSILON')) { + define('PHP_FLOAT_EPSILON', 2.2204460492503E-16); +} +if (!defined('PHP_FLOAT_MIN')) { + define('PHP_FLOAT_MIN', 2.2250738585072E-308); +} +if (!defined('PHP_FLOAT_MAX')) { + define('PHP_FLOAT_MAX', 1.7976931348623157E+308); +} +if (!defined('PHP_OS_FAMILY')) { + define('PHP_OS_FAMILY', p\Php72::php_os_family()); +} + +if ('\\' === \DIRECTORY_SEPARATOR && !function_exists('sapi_windows_vt100_support')) { + function sapi_windows_vt100_support($stream, $enable = null) { return p\Php72::sapi_windows_vt100_support($stream, $enable); } +} +if (!function_exists('stream_isatty')) { + function stream_isatty($stream) { return p\Php72::stream_isatty($stream); } +} +if (!function_exists('utf8_encode')) { + function utf8_encode($string) { return p\Php72::utf8_encode($string); } +} +if (!function_exists('utf8_decode')) { + function utf8_decode($string) { return p\Php72::utf8_decode($string); } +} +if (!function_exists('spl_object_id')) { + function spl_object_id($object) { return p\Php72::spl_object_id($object); } +} +if (!function_exists('mb_ord')) { + function mb_ord($string, $encoding = null) { return p\Php72::mb_ord($string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr($codepoint, $encoding = null) { return p\Php72::mb_chr($codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } +} diff --git a/app/vendor/symfony/polyfill-php73/composer.json b/app/vendor/symfony/polyfill-php72/composer.json similarity index 76% rename from app/vendor/symfony/polyfill-php73/composer.json rename to app/vendor/symfony/polyfill-php72/composer.json index a7fe47875..c96c84477 100644 --- a/app/vendor/symfony/polyfill-php73/composer.json +++ b/app/vendor/symfony/polyfill-php72/composer.json @@ -1,7 +1,7 @@ { - "name": "symfony/polyfill-php73", + "name": "symfony/polyfill-php72", "type": "library", - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", "keywords": ["polyfill", "shim", "compatibility", "portable"], "homepage": "https://symfony.com", "license": "MIT", @@ -19,9 +19,8 @@ "php": ">=7.1" }, "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php73\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] + "psr-4": { "Symfony\\Polyfill\\Php72\\": "" }, + "files": [ "bootstrap.php" ] }, "minimum-stability": "dev", "extra": { diff --git a/app/vendor/symfony/polyfill-php73/LICENSE b/app/vendor/symfony/polyfill-php73/LICENSE deleted file mode 100644 index 3f853aaf3..000000000 --- a/app/vendor/symfony/polyfill-php73/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/app/vendor/symfony/polyfill-php73/Php73.php b/app/vendor/symfony/polyfill-php73/Php73.php deleted file mode 100644 index 65c35a6a1..000000000 --- a/app/vendor/symfony/polyfill-php73/Php73.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php73; - -/** - * @author Gabriel Caruso - * @author Ion Bazan - * - * @internal - */ -final class Php73 -{ - public static $startAt = 1533462603; - - /** - * @param bool $asNum - * - * @return array|float|int - */ - public static function hrtime($asNum = false) - { - $ns = microtime(false); - $s = substr($ns, 11) - self::$startAt; - $ns = 1E9 * (float) $ns; - - if ($asNum) { - $ns += $s * 1E9; - - return \PHP_INT_SIZE === 4 ? $ns : (int) $ns; - } - - return [$s, (int) $ns]; - } -} diff --git a/app/vendor/symfony/polyfill-php73/README.md b/app/vendor/symfony/polyfill-php73/README.md deleted file mode 100644 index b3ebbce51..000000000 --- a/app/vendor/symfony/polyfill-php73/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Symfony Polyfill / Php73 -======================== - -This component provides functions added to PHP 7.3 core: - -- [`array_key_first`](https://php.net/array_key_first) -- [`array_key_last`](https://php.net/array_key_last) -- [`hrtime`](https://php.net/function.hrtime) -- [`is_countable`](https://php.net/is_countable) -- [`JsonException`](https://php.net/JsonException) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/app/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php b/app/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php deleted file mode 100644 index 673d10022..000000000 --- a/app/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class JsonException extends Exception -{ -} diff --git a/app/vendor/symfony/polyfill-php73/bootstrap.php b/app/vendor/symfony/polyfill-php73/bootstrap.php deleted file mode 100644 index d6b215382..000000000 --- a/app/vendor/symfony/polyfill-php73/bootstrap.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php73 as p; - -if (\PHP_VERSION_ID >= 70300) { - return; -} - -if (!function_exists('is_countable')) { - function is_countable($value) { return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXmlElement; } -} -if (!function_exists('hrtime')) { - require_once __DIR__.'/Php73.php'; - p\Php73::$startAt = (int) microtime(true); - function hrtime($as_number = false) { return p\Php73::hrtime($as_number); } -} -if (!function_exists('array_key_first')) { - function array_key_first(array $array) { foreach ($array as $key => $value) { return $key; } } -} -if (!function_exists('array_key_last')) { - function array_key_last(array $array) { return key(array_slice($array, -1, 1, true)); } -} diff --git a/app/vendor/symfony/service-contracts/LICENSE b/app/vendor/symfony/service-contracts/LICENSE deleted file mode 100644 index 3f853aaf3..000000000 --- a/app/vendor/symfony/service-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/app/vendor/symfony/service-contracts/README.md b/app/vendor/symfony/service-contracts/README.md deleted file mode 100644 index d033a439b..000000000 --- a/app/vendor/symfony/service-contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Symfony Service Contracts -========================= - -A set of abstractions extracted out of the Symfony components. - -Can be used to build on semantics that the Symfony components proved useful - and -that already have battle tested implementations. - -See https://github.com/symfony/contracts/blob/master/README.md for more information. diff --git a/app/vendor/symfony/service-contracts/ResetInterface.php b/app/vendor/symfony/service-contracts/ResetInterface.php deleted file mode 100644 index 1af1075ee..000000000 --- a/app/vendor/symfony/service-contracts/ResetInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -/** - * Provides a way to reset an object to its initial state. - * - * When calling the "reset()" method on an object, it should be put back to its - * initial state. This usually means clearing any internal buffers and forwarding - * the call to internal dependencies. All properties of the object should be put - * back to the same state it had when it was first ready to use. - * - * This method could be called, for example, to recycle objects that are used as - * services, so that they can be used to handle several requests in the same - * process loop (note that we advise making your services stateless instead of - * implementing this interface when possible.) - */ -interface ResetInterface -{ - public function reset(); -} diff --git a/app/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/app/vendor/symfony/service-contracts/ServiceLocatorTrait.php deleted file mode 100644 index 71b1b7460..000000000 --- a/app/vendor/symfony/service-contracts/ServiceLocatorTrait.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; - -/** - * A trait to help implement ServiceProviderInterface. - * - * @author Robin Chalas - * @author Nicolas Grekas - */ -trait ServiceLocatorTrait -{ - private $factories; - private $loading = []; - private $providedTypes; - - /** - * @param callable[] $factories - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - /** - * {@inheritdoc} - */ - public function has($id) - { - return isset($this->factories[$id]); - } - - /** - * {@inheritdoc} - */ - public function get($id) - { - if (!isset($this->factories[$id])) { - throw $this->createNotFoundException($id); - } - - if (isset($this->loading[$id])) { - $ids = array_values($this->loading); - $ids = \array_slice($this->loading, array_search($id, $ids)); - $ids[] = $id; - - throw $this->createCircularReferenceException($id, $ids); - } - - $this->loading[$id] = $id; - try { - return $this->factories[$id]($this); - } finally { - unset($this->loading[$id]); - } - } - - /** - * {@inheritdoc} - */ - public function getProvidedServices(): array - { - if (null === $this->providedTypes) { - $this->providedTypes = []; - - foreach ($this->factories as $name => $factory) { - if (!\is_callable($factory)) { - $this->providedTypes[$name] = '?'; - } else { - $type = (new \ReflectionFunction($factory))->getReturnType(); - - $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '').$type->getName() : '?'; - } - } - } - - return $this->providedTypes; - } - - private function createNotFoundException(string $id): NotFoundExceptionInterface - { - if (!$alternatives = array_keys($this->factories)) { - $message = 'is empty...'; - } else { - $last = array_pop($alternatives); - if ($alternatives) { - $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last); - } else { - $message = sprintf('only knows about the "%s" service.', $last); - } - } - - if ($this->loading) { - $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message); - } else { - $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message); - } - - return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface { - }; - } - - private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface - { - return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface { - }; - } -} diff --git a/app/vendor/symfony/service-contracts/ServiceProviderInterface.php b/app/vendor/symfony/service-contracts/ServiceProviderInterface.php deleted file mode 100644 index c60ad0bd4..000000000 --- a/app/vendor/symfony/service-contracts/ServiceProviderInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; - -/** - * A ServiceProviderInterface exposes the identifiers and the types of services provided by a container. - * - * @author Nicolas Grekas - * @author Mateusz Sip - */ -interface ServiceProviderInterface extends ContainerInterface -{ - /** - * Returns an associative array of service types keyed by the identifiers provided by the current container. - * - * Examples: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the object provides a service named "logger" that implements Psr\Log\LoggerInterface - * * ['foo' => '?'] means the container provides service name "foo" of unspecified type - * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null - * - * @return string[] The provided service types, keyed by service names - */ - public function getProvidedServices(): array; -} diff --git a/app/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/app/vendor/symfony/service-contracts/ServiceSubscriberInterface.php deleted file mode 100644 index 8bb320f5b..000000000 --- a/app/vendor/symfony/service-contracts/ServiceSubscriberInterface.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -/** - * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method. - * - * The getSubscribedServices method returns an array of service types required by such instances, - * optionally keyed by the service names used internally. Service types that start with an interrogation - * mark "?" are optional, while the other ones are mandatory service dependencies. - * - * The injected service locators SHOULD NOT allow access to any other services not specified by the method. - * - * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally. - * This interface does not dictate any injection method for these service locators, although constructor - * injection is recommended. - * - * @author Nicolas Grekas - */ -interface ServiceSubscriberInterface -{ - /** - * Returns an array of service types required by such instances, optionally keyed by the service names used internally. - * - * For mandatory dependencies: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name - * internally to fetch a service which must implement Psr\Log\LoggerInterface. - * * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name - * internally to fetch an iterable of Psr\Log\LoggerInterface instances. - * * ['Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface'] - * - * otherwise: - * - * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency - * * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency - * * ['?Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface'] - * - * @return array The required service types, optionally keyed by service names - */ - public static function getSubscribedServices(); -} diff --git a/app/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/app/vendor/symfony/service-contracts/ServiceSubscriberTrait.php deleted file mode 100644 index ceaef6fa1..000000000 --- a/app/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; - -/** - * Implementation of ServiceSubscriberInterface that determines subscribed services from - * private method return types. Service ids are available as "ClassName::methodName". - * - * @author Kevin Bond - */ -trait ServiceSubscriberTrait -{ - /** @var ContainerInterface */ - private $container; - - public static function getSubscribedServices(): array - { - static $services; - - if (null !== $services) { - return $services; - } - - $services = \is_callable(['parent', __FUNCTION__]) ? parent::getSubscribedServices() : []; - - foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { - continue; - } - - if (self::class === $method->getDeclaringClass()->name && ($returnType = $method->getReturnType()) && !$returnType->isBuiltin()) { - $services[self::class.'::'.$method->name] = '?'.$returnType->getName(); - } - } - - return $services; - } - - /** - * @required - */ - public function setContainer(ContainerInterface $container) - { - $this->container = $container; - - if (\is_callable(['parent', __FUNCTION__])) { - return parent::setContainer($container); - } - } -} diff --git a/app/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/app/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php deleted file mode 100644 index 69594583f..000000000 --- a/app/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Test; - -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\ServiceLocatorTrait; - -class ServiceLocatorTest extends TestCase -{ - public function getServiceLocator(array $factories) - { - return new class($factories) implements ContainerInterface { - use ServiceLocatorTrait; - }; - } - - public function testHas() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - function () { return 'dummy'; }, - ]); - - $this->assertTrue($locator->has('foo')); - $this->assertTrue($locator->has('bar')); - $this->assertFalse($locator->has('dummy')); - } - - public function testGet() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('baz', $locator->get('bar')); - } - - public function testGetDoesNotMemoize() - { - $i = 0; - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$i) { - ++$i; - - return 'bar'; - }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame(2, $i); - } - - /** - * @expectedException \Psr\Container\NotFoundExceptionInterface - * @expectedExceptionMessage The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service. - */ - public function testThrowsOnUndefinedInternalService() - { - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } - - /** - * @expectedException \Psr\Container\ContainerExceptionInterface - * @expectedExceptionMessage Circular reference detected for service "bar", path: "bar -> baz -> bar". - */ - public function testThrowsOnCircularReference() - { - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - 'bar' => function () use (&$locator) { return $locator->get('baz'); }, - 'baz' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } -} diff --git a/app/vendor/symfony/service-contracts/composer.json b/app/vendor/symfony/service-contracts/composer.json deleted file mode 100644 index 54341174c..000000000 --- a/app/vendor/symfony/service-contracts/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "symfony/service-contracts", - "type": "library", - "description": "Generic abstractions related to writing services", - "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": "^7.1.3" - }, - "suggest": { - "psr/container": "", - "symfony/service-implementation": "" - }, - "autoload": { - "psr-4": { "Symfony\\Contracts\\Service\\": "" } - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - } -} diff --git a/app/vendor/symfony/string/AbstractString.php b/app/vendor/symfony/string/AbstractString.php deleted file mode 100644 index d3d95d40a..000000000 --- a/app/vendor/symfony/string/AbstractString.php +++ /dev/null @@ -1,727 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a string of abstract characters. - * - * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). - * This class is the abstract type to use as a type-hint when the logic you want to - * implement doesn't care about the exact variant it deals with. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -abstract class AbstractString implements \Stringable, \JsonSerializable -{ - public const PREG_PATTERN_ORDER = \PREG_PATTERN_ORDER; - public const PREG_SET_ORDER = \PREG_SET_ORDER; - public const PREG_OFFSET_CAPTURE = \PREG_OFFSET_CAPTURE; - public const PREG_UNMATCHED_AS_NULL = \PREG_UNMATCHED_AS_NULL; - - public const PREG_SPLIT = 0; - public const PREG_SPLIT_NO_EMPTY = \PREG_SPLIT_NO_EMPTY; - public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE; - public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE; - - protected $string = ''; - protected $ignoreCase = false; - - abstract public function __construct(string $string = ''); - - /** - * Unwraps instances of AbstractString back to strings. - * - * @return string[]|array - */ - public static function unwrap(array $values): array - { - foreach ($values as $k => $v) { - if ($v instanceof self) { - $values[$k] = $v->__toString(); - } elseif (\is_array($v) && $values[$k] !== $v = static::unwrap($v)) { - $values[$k] = $v; - } - } - - return $values; - } - - /** - * Wraps (and normalizes) strings in instances of AbstractString. - * - * @return static[]|array - */ - public static function wrap(array $values): array - { - $i = 0; - $keys = null; - - foreach ($values as $k => $v) { - if (\is_string($k) && '' !== $k && $k !== $j = (string) new static($k)) { - $keys = $keys ?? array_keys($values); - $keys[$i] = $j; - } - - if (\is_string($v)) { - $values[$k] = new static($v); - } elseif (\is_array($v) && $values[$k] !== $v = static::wrap($v)) { - $values[$k] = $v; - } - - ++$i; - } - - return null !== $keys ? array_combine($keys, $values) : $values; - } - - /** - * @param string|string[] $needle - * - * @return static - */ - public function after($needle, bool $includeNeedle = false, int $offset = 0): self - { - $str = clone $this; - $i = \PHP_INT_MAX; - - foreach ((array) $needle as $n) { - $n = (string) $n; - $j = $this->indexOf($n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - $str->string = $n; - } - } - - if (\PHP_INT_MAX === $i) { - return $str; - } - - if (!$includeNeedle) { - $i += $str->length(); - } - - return $this->slice($i); - } - - /** - * @param string|string[] $needle - * - * @return static - */ - public function afterLast($needle, bool $includeNeedle = false, int $offset = 0): self - { - $str = clone $this; - $i = null; - - foreach ((array) $needle as $n) { - $n = (string) $n; - $j = $this->indexOfLast($n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - $str->string = $n; - } - } - - if (null === $i) { - return $str; - } - - if (!$includeNeedle) { - $i += $str->length(); - } - - return $this->slice($i); - } - - /** - * @return static - */ - abstract public function append(string ...$suffix): self; - - /** - * @param string|string[] $needle - * - * @return static - */ - public function before($needle, bool $includeNeedle = false, int $offset = 0): self - { - $str = clone $this; - $i = \PHP_INT_MAX; - - foreach ((array) $needle as $n) { - $n = (string) $n; - $j = $this->indexOf($n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - $str->string = $n; - } - } - - if (\PHP_INT_MAX === $i) { - return $str; - } - - if ($includeNeedle) { - $i += $str->length(); - } - - return $this->slice(0, $i); - } - - /** - * @param string|string[] $needle - * - * @return static - */ - public function beforeLast($needle, bool $includeNeedle = false, int $offset = 0): self - { - $str = clone $this; - $i = null; - - foreach ((array) $needle as $n) { - $n = (string) $n; - $j = $this->indexOfLast($n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - $str->string = $n; - } - } - - if (null === $i) { - return $str; - } - - if ($includeNeedle) { - $i += $str->length(); - } - - return $this->slice(0, $i); - } - - /** - * @return int[] - */ - public function bytesAt(int $offset): array - { - $str = $this->slice($offset, 1); - - return '' === $str->string ? [] : array_values(unpack('C*', $str->string)); - } - - /** - * @return static - */ - abstract public function camel(): self; - - /** - * @return static[] - */ - abstract public function chunk(int $length = 1): array; - - /** - * @return static - */ - public function collapseWhitespace(): self - { - $str = clone $this; - $str->string = trim(preg_replace('/(?:\s{2,}+|[^\S ])/', ' ', $str->string)); - - return $str; - } - - /** - * @param string|string[] $needle - */ - public function containsAny($needle): bool - { - return null !== $this->indexOf($needle); - } - - /** - * @param string|string[] $suffix - */ - public function endsWith($suffix): bool - { - if (!\is_array($suffix) && !$suffix instanceof \Traversable) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($suffix as $s) { - if ($this->endsWith((string) $s)) { - return true; - } - } - - return false; - } - - /** - * @return static - */ - public function ensureEnd(string $suffix): self - { - if (!$this->endsWith($suffix)) { - return $this->append($suffix); - } - - $suffix = preg_quote($suffix); - $regex = '{('.$suffix.')(?:'.$suffix.')++$}D'; - - return $this->replaceMatches($regex.($this->ignoreCase ? 'i' : ''), '$1'); - } - - /** - * @return static - */ - public function ensureStart(string $prefix): self - { - $prefix = new static($prefix); - - if (!$this->startsWith($prefix)) { - return $this->prepend($prefix); - } - - $str = clone $this; - $i = $prefixLen = $prefix->length(); - - while ($this->indexOf($prefix, $i) === $i) { - $str = $str->slice($prefixLen); - $i += $prefixLen; - } - - return $str; - } - - /** - * @param string|string[] $string - */ - public function equalsTo($string): bool - { - if (!\is_array($string) && !$string instanceof \Traversable) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($string as $s) { - if ($this->equalsTo((string) $s)) { - return true; - } - } - - return false; - } - - /** - * @return static - */ - abstract public function folded(): self; - - /** - * @return static - */ - public function ignoreCase(): self - { - $str = clone $this; - $str->ignoreCase = true; - - return $str; - } - - /** - * @param string|string[] $needle - */ - public function indexOf($needle, int $offset = 0): ?int - { - if (!\is_array($needle) && !$needle instanceof \Traversable) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - $i = \PHP_INT_MAX; - - foreach ($needle as $n) { - $j = $this->indexOf((string) $n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - } - } - - return \PHP_INT_MAX === $i ? null : $i; - } - - /** - * @param string|string[] $needle - */ - public function indexOfLast($needle, int $offset = 0): ?int - { - if (!\is_array($needle) && !$needle instanceof \Traversable) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - $i = null; - - foreach ($needle as $n) { - $j = $this->indexOfLast((string) $n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - } - } - - return $i; - } - - public function isEmpty(): bool - { - return '' === $this->string; - } - - /** - * @return static - */ - abstract public function join(array $strings, string $lastGlue = null): self; - - public function jsonSerialize(): string - { - return $this->string; - } - - abstract public function length(): int; - - /** - * @return static - */ - abstract public function lower(): self; - - /** - * Matches the string using a regular expression. - * - * Pass PREG_PATTERN_ORDER or PREG_SET_ORDER as $flags to get all occurrences matching the regular expression. - * - * @return array All matches in a multi-dimensional array ordered according to flags - */ - abstract public function match(string $regexp, int $flags = 0, int $offset = 0): array; - - /** - * @return static - */ - abstract public function padBoth(int $length, string $padStr = ' '): self; - - /** - * @return static - */ - abstract public function padEnd(int $length, string $padStr = ' '): self; - - /** - * @return static - */ - abstract public function padStart(int $length, string $padStr = ' '): self; - - /** - * @return static - */ - abstract public function prepend(string ...$prefix): self; - - /** - * @return static - */ - public function repeat(int $multiplier): self - { - if (0 > $multiplier) { - throw new InvalidArgumentException(sprintf('Multiplier must be positive, %d given.', $multiplier)); - } - - $str = clone $this; - $str->string = str_repeat($str->string, $multiplier); - - return $str; - } - - /** - * @return static - */ - abstract public function replace(string $from, string $to): self; - - /** - * @param string|callable $to - * - * @return static - */ - abstract public function replaceMatches(string $fromRegexp, $to): self; - - /** - * @return static - */ - abstract public function reverse(): self; - - /** - * @return static - */ - abstract public function slice(int $start = 0, int $length = null): self; - - /** - * @return static - */ - abstract public function snake(): self; - - /** - * @return static - */ - abstract public function splice(string $replacement, int $start = 0, int $length = null): self; - - /** - * @return static[] - */ - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (null === $flags) { - throw new \TypeError('Split behavior when $flags is null must be implemented by child classes.'); - } - - if ($this->ignoreCase) { - $delimiter .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $chunks = preg_split($delimiter, $this->string, $limit, $flags)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Splitting failed with '.$k.'.'); - } - } - - throw new RuntimeException('Splitting failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - - if (self::PREG_SPLIT_OFFSET_CAPTURE & $flags) { - foreach ($chunks as &$chunk) { - $str->string = $chunk[0]; - $chunk[0] = clone $str; - } - } else { - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - } - - return $chunks; - } - - /** - * @param string|string[] $prefix - */ - public function startsWith($prefix): bool - { - if (!\is_array($prefix) && !$prefix instanceof \Traversable) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($prefix as $prefix) { - if ($this->startsWith((string) $prefix)) { - return true; - } - } - - return false; - } - - /** - * @return static - */ - abstract public function title(bool $allWords = false): self; - - public function toByteString(string $toEncoding = null): ByteString - { - $b = new ByteString(); - - $toEncoding = \in_array($toEncoding, ['utf8', 'utf-8', 'UTF8'], true) ? 'UTF-8' : $toEncoding; - - if (null === $toEncoding || $toEncoding === $fromEncoding = $this instanceof AbstractUnicodeString || preg_match('//u', $b->string) ? 'UTF-8' : 'Windows-1252') { - $b->string = $this->string; - - return $b; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - try { - $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $b->string = iconv('UTF-8', $toEncoding, $this->string); - } - } finally { - restore_error_handler(); - } - - return $b; - } - - public function toCodePointString(): CodePointString - { - return new CodePointString($this->string); - } - - public function toString(): string - { - return $this->string; - } - - public function toUnicodeString(): UnicodeString - { - return new UnicodeString($this->string); - } - - /** - * @return static - */ - abstract public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self; - - /** - * @return static - */ - abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self; - - /** - * @return static - */ - abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self; - - /** - * @return static - */ - public function truncate(int $length, string $ellipsis = '', bool $cut = true): self - { - $stringLength = $this->length(); - - if ($stringLength <= $length) { - return clone $this; - } - - $ellipsisLength = '' !== $ellipsis ? (new static($ellipsis))->length() : 0; - - if ($length < $ellipsisLength) { - $ellipsisLength = 0; - } - - if (!$cut) { - if (null === $length = $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { - return clone $this; - } - - $length += $ellipsisLength; - } - - $str = $this->slice(0, $length - $ellipsisLength); - - return $ellipsisLength ? $str->trimEnd()->append($ellipsis) : $str; - } - - /** - * @return static - */ - abstract public function upper(): self; - - /** - * Returns the printable length on a terminal. - */ - abstract public function width(bool $ignoreAnsiDecoration = true): int; - - /** - * @return static - */ - public function wordwrap(int $width = 75, string $break = "\n", bool $cut = false): self - { - $lines = '' !== $break ? $this->split($break) : [clone $this]; - $chars = []; - $mask = ''; - - if (1 === \count($lines) && '' === $lines[0]->string) { - return $lines[0]; - } - - foreach ($lines as $i => $line) { - if ($i) { - $chars[] = $break; - $mask .= '#'; - } - - foreach ($line->chunk() as $char) { - $chars[] = $char->string; - $mask .= ' ' === $char->string ? ' ' : '?'; - } - } - - $string = ''; - $j = 0; - $b = $i = -1; - $mask = wordwrap($mask, $width, '#', $cut); - - while (false !== $b = strpos($mask, '#', $b + 1)) { - for (++$i; $i < $b; ++$i) { - $string .= $chars[$j]; - unset($chars[$j++]); - } - - if ($break === $chars[$j] || ' ' === $chars[$j]) { - unset($chars[$j++]); - } - - $string .= $break; - } - - $str = clone $this; - $str->string = $string.implode('', $chars); - - return $str; - } - - public function __sleep(): array - { - return ['string']; - } - - public function __clone() - { - $this->ignoreCase = false; - } - - public function __toString(): string - { - return $this->string; - } -} diff --git a/app/vendor/symfony/string/AbstractUnicodeString.php b/app/vendor/symfony/string/AbstractUnicodeString.php deleted file mode 100644 index 8af75a106..000000000 --- a/app/vendor/symfony/string/AbstractUnicodeString.php +++ /dev/null @@ -1,580 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a string of abstract Unicode characters. - * - * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). - * This class is the abstract type to use as a type-hint when the logic you want to - * implement is Unicode-aware but doesn't care about code points vs grapheme clusters. - * - * @author Nicolas Grekas - * - * @throws ExceptionInterface - */ -abstract class AbstractUnicodeString extends AbstractString -{ - public const NFC = \Normalizer::NFC; - public const NFD = \Normalizer::NFD; - public const NFKC = \Normalizer::NFKC; - public const NFKD = \Normalizer::NFKD; - - // all ASCII letters sorted by typical frequency of occurrence - private const ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - - // the subset of folded case mappings that is not in lower case mappings - private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'İ', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; - private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'i̇', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; - - // the subset of upper case mappings that map one code point to many code points - private const UPPER_FROM = ['ß', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'և', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ', 'ʼn', 'ΐ', 'ΰ', 'ǰ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾶ', 'ῆ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῶ']; - private const UPPER_TO = ['SS', 'FF', 'FI', 'FL', 'FFI', 'FFL', 'ST', 'ST', 'ԵՒ', 'ՄՆ', 'ՄԵ', 'ՄԻ', 'ՎՆ', 'ՄԽ', 'ʼN', 'Ϊ́', 'Ϋ́', 'J̌', 'H̱', 'T̈', 'W̊', 'Y̊', 'Aʾ', 'Υ̓', 'Υ̓̀', 'Υ̓́', 'Υ̓͂', 'Α͂', 'Η͂', 'Ϊ̀', 'Ϊ́', 'Ι͂', 'Ϊ͂', 'Ϋ̀', 'Ϋ́', 'Ρ̓', 'Υ͂', 'Ϋ͂', 'Ω͂']; - - // the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD - private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'ʼn', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ', 'ƀ', 'Ɓ', 'Ƃ', 'ƃ', 'Ƈ', 'ƈ', 'Ɖ', 'Ɗ', 'Ƌ', 'ƌ', 'Ɛ', 'Ƒ', 'ƒ', 'Ɠ', 'ƕ', 'Ɩ', 'Ɨ', 'Ƙ', 'ƙ', 'ƚ', 'Ɲ', 'ƞ', 'Ƣ', 'ƣ', 'Ƥ', 'ƥ', 'ƫ', 'Ƭ', 'ƭ', 'Ʈ', 'Ʋ', 'Ƴ', 'ƴ', 'Ƶ', 'ƶ', 'DŽ', 'Dž', 'dž', 'Ǥ', 'ǥ', 'ȡ', 'Ȥ', 'ȥ', 'ȴ', 'ȵ', 'ȶ', 'ȷ', 'ȸ', 'ȹ', 'Ⱥ', 'Ȼ', 'ȼ', 'Ƚ', 'Ⱦ', 'ȿ', 'ɀ', 'Ƀ', 'Ʉ', 'Ɇ', 'ɇ', 'Ɉ', 'ɉ', 'Ɍ', 'ɍ', 'Ɏ', 'ɏ', 'ɓ', 'ɕ', 'ɖ', 'ɗ', 'ɛ', 'ɟ', 'ɠ', 'ɡ', 'ɢ', 'ɦ', 'ɧ', 'ɨ', 'ɪ', 'ɫ', 'ɬ', 'ɭ', 'ɱ', 'ɲ', 'ɳ', 'ɴ', 'ɶ', 'ɼ', 'ɽ', 'ɾ', 'ʀ', 'ʂ', 'ʈ', 'ʉ', 'ʋ', 'ʏ', 'ʐ', 'ʑ', 'ʙ', 'ʛ', 'ʜ', 'ʝ', 'ʟ', 'ʠ', 'ʣ', 'ʥ', 'ʦ', 'ʪ', 'ʫ', 'ᴀ', 'ᴁ', 'ᴃ', 'ᴄ', 'ᴅ', 'ᴆ', 'ᴇ', 'ᴊ', 'ᴋ', 'ᴌ', 'ᴍ', 'ᴏ', 'ᴘ', 'ᴛ', 'ᴜ', 'ᴠ', 'ᴡ', 'ᴢ', 'ᵫ', 'ᵬ', 'ᵭ', 'ᵮ', 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆']; - private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))']; - - private static $transliterators = []; - - /** - * @return static - */ - public static function fromCodePoints(int ...$codes): self - { - $string = ''; - - foreach ($codes as $code) { - if (0x80 > $code %= 0x200000) { - $string .= \chr($code); - } elseif (0x800 > $code) { - $string .= \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $string .= \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $string .= \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - } - - return new static($string); - } - - /** - * Generic UTF-8 to ASCII transliteration. - * - * Install the intl extension for best results. - * - * @param string[]|\Transliterator[]|\Closure[] $rules See "*-Latin" rules from Transliterator::listIDs() - */ - public function ascii(array $rules = []): self - { - $str = clone $this; - $s = $str->string; - $str->string = ''; - - array_unshift($rules, 'nfd'); - $rules[] = 'latin-ascii'; - - if (\function_exists('transliterator_transliterate')) { - $rules[] = 'any-latin/bgn'; - } - - $rules[] = 'nfkd'; - $rules[] = '[:nonspacing mark:] remove'; - - while (\strlen($s) - 1 > $i = strspn($s, self::ASCII)) { - if (0 < --$i) { - $str->string .= substr($s, 0, $i); - $s = substr($s, $i); - } - - if (!$rule = array_shift($rules)) { - $rules = []; // An empty rule interrupts the next ones - } - - if ($rule instanceof \Transliterator) { - $s = $rule->transliterate($s); - } elseif ($rule instanceof \Closure) { - $s = $rule($s); - } elseif ($rule) { - if ('nfd' === $rule = strtolower($rule)) { - normalizer_is_normalized($s, self::NFD) ?: $s = normalizer_normalize($s, self::NFD); - } elseif ('nfkd' === $rule) { - normalizer_is_normalized($s, self::NFKD) ?: $s = normalizer_normalize($s, self::NFKD); - } elseif ('[:nonspacing mark:] remove' === $rule) { - $s = preg_replace('/\p{Mn}++/u', '', $s); - } elseif ('latin-ascii' === $rule) { - $s = str_replace(self::TRANSLIT_FROM, self::TRANSLIT_TO, $s); - } elseif ('de-ascii' === $rule) { - $s = preg_replace("/([AUO])\u{0308}(?=\p{Ll})/u", '$1e', $s); - $s = str_replace(["a\u{0308}", "o\u{0308}", "u\u{0308}", "A\u{0308}", "O\u{0308}", "U\u{0308}"], ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], $s); - } elseif (\function_exists('transliterator_transliterate')) { - if (null === $transliterator = self::$transliterators[$rule] ?? self::$transliterators[$rule] = \Transliterator::create($rule)) { - if ('any-latin/bgn' === $rule) { - $rule = 'any-latin'; - $transliterator = self::$transliterators[$rule] ?? self::$transliterators[$rule] = \Transliterator::create($rule); - } - - if (null === $transliterator) { - throw new InvalidArgumentException(sprintf('Unknown transliteration rule "%s".', $rule)); - } - - self::$transliterators['any-latin/bgn'] = $transliterator; - } - - $s = $transliterator->transliterate($s); - } - } elseif (!\function_exists('iconv')) { - $s = preg_replace('/[^\x00-\x7F]/u', '?', $s); - } else { - $s = @preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) { - $c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]); - - if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) { - throw new \LogicException(sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class)); - } - - return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?'); - }, $s); - } - } - - $str->string .= $s; - - return $str; - } - - public function camel(): parent - { - $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b./u', static function ($m) use (&$i) { - return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); - - return $str; - } - - /** - * @return int[] - */ - public function codePointsAt(int $offset): array - { - $str = $this->slice($offset, 1); - - if ('' === $str->string) { - return []; - } - - $codePoints = []; - - foreach (preg_split('//u', $str->string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { - $codePoints[] = mb_ord($c, 'UTF-8'); - } - - return $codePoints; - } - - public function folded(bool $compat = true): parent - { - $str = clone $this; - - if (!$compat || \PHP_VERSION_ID < 70300 || !\defined('Normalizer::NFKC_CF')) { - $str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC); - $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8'); - } else { - $str->string = normalizer_normalize($str->string, \Normalizer::NFKC_CF); - } - - return $str; - } - - public function join(array $strings, string $lastGlue = null): parent - { - $str = clone $this; - - $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; - $str->string = implode($this->string, $strings).$tail; - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function lower(): parent - { - $str = clone $this; - $str->string = mb_strtolower(str_replace('İ', 'i̇', $str->string), 'UTF-8'); - - return $str; - } - - public function match(string $regexp, int $flags = 0, int $offset = 0): array - { - $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; - - if ($this->ignoreCase) { - $regexp .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $match($regexp.'u', $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - return $matches; - } - - /** - * @return static - */ - public function normalize(int $form = self::NFC): self - { - if (!\in_array($form, [self::NFC, self::NFD, self::NFKC, self::NFKD])) { - throw new InvalidArgumentException('Unsupported normalization form.'); - } - - $str = clone $this; - normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); - - return $str; - } - - public function padBoth(int $length, string $padStr = ' '): parent - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_BOTH); - } - - public function padEnd(int $length, string $padStr = ' '): parent - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_RIGHT); - } - - public function padStart(int $length, string $padStr = ' '): parent - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_LEFT); - } - - public function replaceMatches(string $fromRegexp, $to): parent - { - if ($this->ignoreCase) { - $fromRegexp .= 'i'; - } - - if (\is_array($to) || $to instanceof \Closure) { - if (!\is_callable($to)) { - throw new \TypeError(sprintf('Argument 2 passed to "%s::replaceMatches()" must be callable, array given.', static::class)); - } - - $replace = 'preg_replace_callback'; - $to = static function (array $m) use ($to): string { - $to = $to($m); - - if ('' !== $to && (!\is_string($to) || !preg_match('//u', $to))) { - throw new InvalidArgumentException('Replace callback must return a valid UTF-8 string.'); - } - - return $to; - }; - } elseif ('' !== $to && !preg_match('//u', $to)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } else { - $replace = 'preg_replace'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (null === $string = $replace($fromRegexp.'u', $to, $this->string)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - $str->string = $string; - - return $str; - } - - public function reverse(): parent - { - $str = clone $this; - $str->string = implode('', array_reverse(preg_split('/(\X)/u', $str->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY))); - - return $str; - } - - public function snake(): parent - { - $str = $this->camel()->title(); - $str->string = mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1_\2', $str->string), 'UTF-8'); - - return $str; - } - - public function title(bool $allWords = false): parent - { - $str = clone $this; - - $limit = $allWords ? -1 : 1; - - $str->string = preg_replace_callback('/\b./u', static function (array $m): string { - return mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, $str->string, $limit); - - return $str; - } - - public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): parent - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{^[$chars]++|[$chars]++$}uD", '', $str->string); - - return $str; - } - - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): parent - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{[$chars]++$}uD", '', $str->string); - - return $str; - } - - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): parent - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{^[$chars]++}uD", '', $str->string); - - return $str; - } - - public function upper(): parent - { - $str = clone $this; - $str->string = mb_strtoupper($str->string, 'UTF-8'); - - if (\PHP_VERSION_ID < 70300) { - $str->string = str_replace(self::UPPER_FROM, self::UPPER_TO, $str->string); - } - - return $str; - } - - public function width(bool $ignoreAnsiDecoration = true): int - { - $width = 0; - $s = str_replace(["\x00", "\x05", "\x07"], '', $this->string); - - if (false !== strpos($s, "\r")) { - $s = str_replace(["\r\n", "\r"], "\n", $s); - } - - if (!$ignoreAnsiDecoration) { - $s = preg_replace('/[\p{Cc}\x7F]++/u', '', $s); - } - - foreach (explode("\n", $s) as $s) { - if ($ignoreAnsiDecoration) { - $s = preg_replace('/(?:\x1B(?: - \[ [\x30-\x3F]*+ [\x20-\x2F]*+ [0x40-\x7E] - | [P\]X^_] .*? \x1B\\\\ - | [\x41-\x7E] - )|[\p{Cc}\x7F]++)/xu', '', $s); - } - - // Non printable characters have been dropped, so wcswidth cannot logically return -1. - $width += $this->wcswidth($s); - } - - return $width; - } - - /** - * @return static - */ - private function pad(int $len, self $pad, int $type): parent - { - $sLen = $this->length(); - - if ($len <= $sLen) { - return clone $this; - } - - $padLen = $pad->length(); - $freeLen = $len - $sLen; - $len = $freeLen % $padLen; - - switch ($type) { - case \STR_PAD_RIGHT: - return $this->append(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - case \STR_PAD_LEFT: - return $this->prepend(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - case \STR_PAD_BOTH: - $freeLen /= 2; - - $rightLen = ceil($freeLen); - $len = $rightLen % $padLen; - $str = $this->append(str_repeat($pad->string, intdiv($rightLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - $leftLen = floor($freeLen); - $len = $leftLen % $padLen; - - return $str->prepend(str_repeat($pad->string, intdiv($leftLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - default: - throw new InvalidArgumentException('Invalid padding type.'); - } - } - - /** - * Based on https://github.com/jquast/wcwidth, a Python implementation of https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c. - */ - private function wcswidth(string $string): int - { - $width = 0; - - foreach (preg_split('//u', $string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { - $codePoint = mb_ord($c, 'UTF-8'); - - if (0 === $codePoint // NULL - || 0x034F === $codePoint // COMBINING GRAPHEME JOINER - || (0x200B <= $codePoint && 0x200F >= $codePoint) // ZERO WIDTH SPACE to RIGHT-TO-LEFT MARK - || 0x2028 === $codePoint // LINE SEPARATOR - || 0x2029 === $codePoint // PARAGRAPH SEPARATOR - || (0x202A <= $codePoint && 0x202E >= $codePoint) // LEFT-TO-RIGHT EMBEDDING to RIGHT-TO-LEFT OVERRIDE - || (0x2060 <= $codePoint && 0x2063 >= $codePoint) // WORD JOINER to INVISIBLE SEPARATOR - ) { - continue; - } - - // Non printable characters - if (32 > $codePoint // C0 control characters - || (0x07F <= $codePoint && 0x0A0 > $codePoint) // C1 control characters and DEL - ) { - return -1; - } - - static $tableZero; - if (null === $tableZero) { - $tableZero = require __DIR__.'/Resources/data/wcswidth_table_zero.php'; - } - - if ($codePoint >= $tableZero[0][0] && $codePoint <= $tableZero[$ubound = \count($tableZero) - 1][1]) { - $lbound = 0; - while ($ubound >= $lbound) { - $mid = floor(($lbound + $ubound) / 2); - - if ($codePoint > $tableZero[$mid][1]) { - $lbound = $mid + 1; - } elseif ($codePoint < $tableZero[$mid][0]) { - $ubound = $mid - 1; - } else { - continue 2; - } - } - } - - static $tableWide; - if (null === $tableWide) { - $tableWide = require __DIR__.'/Resources/data/wcswidth_table_wide.php'; - } - - if ($codePoint >= $tableWide[0][0] && $codePoint <= $tableWide[$ubound = \count($tableWide) - 1][1]) { - $lbound = 0; - while ($ubound >= $lbound) { - $mid = floor(($lbound + $ubound) / 2); - - if ($codePoint > $tableWide[$mid][1]) { - $lbound = $mid + 1; - } elseif ($codePoint < $tableWide[$mid][0]) { - $ubound = $mid - 1; - } else { - $width += 2; - - continue 2; - } - } - } - - ++$width; - } - - return $width; - } -} diff --git a/app/vendor/symfony/string/ByteString.php b/app/vendor/symfony/string/ByteString.php deleted file mode 100644 index bbf8614cf..000000000 --- a/app/vendor/symfony/string/ByteString.php +++ /dev/null @@ -1,506 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a binary-safe string of bytes. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class ByteString extends AbstractString -{ - private const ALPHABET_ALPHANUMERIC = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - - public function __construct(string $string = '') - { - $this->string = $string; - } - - /* - * The following method was derived from code of the Hack Standard Library (v4.40 - 2020-05-03) - * - * https://github.com/hhvm/hsl/blob/80a42c02f036f72a42f0415e80d6b847f4bf62d5/src/random/private.php#L16 - * - * Code subject to the MIT license (https://github.com/hhvm/hsl/blob/master/LICENSE). - * - * Copyright (c) 2004-2020, Facebook, Inc. (https://www.facebook.com/) - */ - - public static function fromRandom(int $length = 16, string $alphabet = null): self - { - if ($length <= 0) { - throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length)); - } - - $alphabet = $alphabet ?? self::ALPHABET_ALPHANUMERIC; - $alphabetSize = \strlen($alphabet); - $bits = (int) ceil(log($alphabetSize, 2.0)); - if ($bits <= 0 || $bits > 56) { - throw new InvalidArgumentException('The length of the alphabet must in the [2^1, 2^56] range.'); - } - - $ret = ''; - while ($length > 0) { - $urandomLength = (int) ceil(2 * $length * $bits / 8.0); - $data = random_bytes($urandomLength); - $unpackedData = 0; - $unpackedBits = 0; - for ($i = 0; $i < $urandomLength && $length > 0; ++$i) { - // Unpack 8 bits - $unpackedData = ($unpackedData << 8) | \ord($data[$i]); - $unpackedBits += 8; - - // While we have enough bits to select a character from the alphabet, keep - // consuming the random data - for (; $unpackedBits >= $bits && $length > 0; $unpackedBits -= $bits) { - $index = ($unpackedData & ((1 << $bits) - 1)); - $unpackedData >>= $bits; - // Unfortunately, the alphabet size is not necessarily a power of two. - // Worst case, it is 2^k + 1, which means we need (k+1) bits and we - // have around a 50% chance of missing as k gets larger - if ($index < $alphabetSize) { - $ret .= $alphabet[$index]; - --$length; - } - } - } - } - - return new static($ret); - } - - public function bytesAt(int $offset): array - { - $str = $this->string[$offset] ?? ''; - - return '' === $str ? [] : [\ord($str)]; - } - - public function append(string ...$suffix): parent - { - $str = clone $this; - $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); - - return $str; - } - - public function camel(): parent - { - $str = clone $this; - $str->string = lcfirst(str_replace(' ', '', ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $str = clone $this; - $chunks = []; - - foreach (str_split($this->string, $length) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function endsWith($suffix): bool - { - if ($suffix instanceof parent) { - $suffix = $suffix->string; - } elseif (\is_array($suffix) || $suffix instanceof \Traversable) { - return parent::endsWith($suffix); - } else { - $suffix = (string) $suffix; - } - - return '' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase); - } - - public function equalsTo($string): bool - { - if ($string instanceof parent) { - $string = $string->string; - } elseif (\is_array($string) || $string instanceof \Traversable) { - return parent::equalsTo($string); - } else { - $string = (string) $string; - } - - if ('' !== $string && $this->ignoreCase) { - return 0 === strcasecmp($string, $this->string); - } - - return $string === $this->string; - } - - public function folded(): parent - { - $str = clone $this; - $str->string = strtolower($str->string); - - return $str; - } - - public function indexOf($needle, int $offset = 0): ?int - { - if ($needle instanceof parent) { - $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { - return parent::indexOf($needle, $offset); - } else { - $needle = (string) $needle; - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? stripos($this->string, $needle, $offset) : strpos($this->string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function indexOfLast($needle, int $offset = 0): ?int - { - if ($needle instanceof parent) { - $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { - return parent::indexOfLast($needle, $offset); - } else { - $needle = (string) $needle; - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? strripos($this->string, $needle, $offset) : strrpos($this->string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function isUtf8(): bool - { - return '' === $this->string || preg_match('//u', $this->string); - } - - public function join(array $strings, string $lastGlue = null): parent - { - $str = clone $this; - - $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; - $str->string = implode($this->string, $strings).$tail; - - return $str; - } - - public function length(): int - { - return \strlen($this->string); - } - - public function lower(): parent - { - $str = clone $this; - $str->string = strtolower($str->string); - - return $str; - } - - public function match(string $regexp, int $flags = 0, int $offset = 0): array - { - $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; - - if ($this->ignoreCase) { - $regexp .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $match($regexp, $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - return $matches; - } - - public function padBoth(int $length, string $padStr = ' '): parent - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_BOTH); - - return $str; - } - - public function padEnd(int $length, string $padStr = ' '): parent - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_RIGHT); - - return $str; - } - - public function padStart(int $length, string $padStr = ' '): parent - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_LEFT); - - return $str; - } - - public function prepend(string ...$prefix): parent - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$str->string; - - return $str; - } - - public function replace(string $from, string $to): parent - { - $str = clone $this; - - if ('' !== $from) { - $str->string = $this->ignoreCase ? str_ireplace($from, $to, $this->string) : str_replace($from, $to, $this->string); - } - - return $str; - } - - public function replaceMatches(string $fromRegexp, $to): parent - { - if ($this->ignoreCase) { - $fromRegexp .= 'i'; - } - - if (\is_array($to)) { - if (!\is_callable($to)) { - throw new \TypeError(sprintf('Argument 2 passed to "%s::replaceMatches()" must be callable, array given.', static::class)); - } - - $replace = 'preg_replace_callback'; - } else { - $replace = $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (null === $string = $replace($fromRegexp, $to, $this->string)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - $str->string = $string; - - return $str; - } - - public function reverse(): parent - { - $str = clone $this; - $str->string = strrev($str->string); - - return $str; - } - - public function slice(int $start = 0, int $length = null): parent - { - $str = clone $this; - $str->string = (string) substr($this->string, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function snake(): parent - { - $str = $this->camel()->title(); - $str->string = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $str->string)); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): parent - { - $str = clone $this; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit = $limit ?? \PHP_INT_MAX) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter, $limit, $flags); - } - - $str = clone $this; - $chunks = $this->ignoreCase - ? preg_split('{'.preg_quote($delimiter).'}iD', $this->string, $limit) - : explode($delimiter, $this->string, $limit); - - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - - return $chunks; - } - - public function startsWith($prefix): bool - { - if ($prefix instanceof parent) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - return '' !== $prefix && 0 === ($this->ignoreCase ? strncasecmp($this->string, $prefix, \strlen($prefix)) : strncmp($this->string, $prefix, \strlen($prefix))); - } - - public function title(bool $allWords = false): parent - { - $str = clone $this; - $str->string = $allWords ? ucwords($str->string) : ucfirst($str->string); - - return $str; - } - - public function toUnicodeString(string $fromEncoding = null): UnicodeString - { - return new UnicodeString($this->toCodePointString($fromEncoding)->string); - } - - public function toCodePointString(string $fromEncoding = null): CodePointString - { - $u = new CodePointString(); - - if (\in_array($fromEncoding, [null, 'utf8', 'utf-8', 'UTF8', 'UTF-8'], true) && preg_match('//u', $this->string)) { - $u->string = $this->string; - - return $u; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - try { - $validEncoding = false !== mb_detect_encoding($this->string, $fromEncoding ?? 'Windows-1252', true); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $u->string = iconv($fromEncoding ?? 'Windows-1252', 'UTF-8', $this->string); - - return $u; - } - } finally { - restore_error_handler(); - } - - if (!$validEncoding) { - throw new InvalidArgumentException(sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252')); - } - - $u->string = mb_convert_encoding($this->string, 'UTF-8', $fromEncoding ?? 'Windows-1252'); - - return $u; - } - - public function trim(string $chars = " \t\n\r\0\x0B\x0C"): parent - { - $str = clone $this; - $str->string = trim($str->string, $chars); - - return $str; - } - - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C"): parent - { - $str = clone $this; - $str->string = rtrim($str->string, $chars); - - return $str; - } - - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C"): parent - { - $str = clone $this; - $str->string = ltrim($str->string, $chars); - - return $str; - } - - public function upper(): parent - { - $str = clone $this; - $str->string = strtoupper($str->string); - - return $str; - } - - public function width(bool $ignoreAnsiDecoration = true): int - { - $string = preg_match('//u', $this->string) ? $this->string : preg_replace('/[\x80-\xFF]/', '?', $this->string); - - return (new CodePointString($string))->width($ignoreAnsiDecoration); - } -} diff --git a/app/vendor/symfony/string/CHANGELOG.md b/app/vendor/symfony/string/CHANGELOG.md deleted file mode 100644 index 700d21483..000000000 --- a/app/vendor/symfony/string/CHANGELOG.md +++ /dev/null @@ -1,30 +0,0 @@ -CHANGELOG -========= - -5.3 ---- - - * Made `AsciiSlugger` fallback to parent locale's symbolsMap - -5.2.0 ------ - - * added a `FrenchInflector` class - -5.1.0 ------ - - * added the `AbstractString::reverse()` method - * made `AbstractString::width()` follow POSIX.1-2001 - * added `LazyString` which provides memoizing stringable objects - * The component is not marked as `@experimental` anymore - * added the `s()` helper method to get either an `UnicodeString` or `ByteString` instance, - depending of the input string UTF-8 compliancy - * added `$cut` parameter to `Symfony\Component\String\AbstractString::truncate()` - * added `AbstractString::containsAny()` - * allow passing a string of custom characters to `ByteString::fromRandom()` - -5.0.0 ------ - - * added the component as experimental diff --git a/app/vendor/symfony/string/CodePointString.php b/app/vendor/symfony/string/CodePointString.php deleted file mode 100644 index 8ab920941..000000000 --- a/app/vendor/symfony/string/CodePointString.php +++ /dev/null @@ -1,270 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; - -/** - * Represents a string of Unicode code points encoded as UTF-8. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class CodePointString extends AbstractUnicodeString -{ - public function __construct(string $string = '') - { - if ('' !== $string && !preg_match('//u', $string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $this->string = $string; - } - - public function append(string ...$suffix): AbstractString - { - $str = clone $this; - $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $rx = '/('; - while (65535 < $length) { - $rx .= '.{65535}'; - $length -= 65535; - } - $rx .= '.{'.$length.'})/us'; - - $str = clone $this; - $chunks = []; - - foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function codePointsAt(int $offset): array - { - $str = $offset ? $this->slice($offset, 1) : $this; - - return '' === $str->string ? [] : [mb_ord($str->string, 'UTF-8')]; - } - - public function endsWith($suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (\is_array($suffix) || $suffix instanceof \Traversable) { - return parent::endsWith($suffix); - } else { - $suffix = (string) $suffix; - } - - if ('' === $suffix || !preg_match('//u', $suffix)) { - return false; - } - - if ($this->ignoreCase) { - return preg_match('{'.preg_quote($suffix).'$}iuD', $this->string); - } - - return \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix)); - } - - public function equalsTo($string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (\is_array($string) || $string instanceof \Traversable) { - return parent::equalsTo($string); - } else { - $string = (string) $string; - } - - if ('' !== $string && $this->ignoreCase) { - return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); - } - - return $string === $this->string; - } - - public function indexOf($needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { - return parent::indexOf($needle, $offset); - } else { - $needle = (string) $needle; - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? mb_stripos($this->string, $needle, $offset, 'UTF-8') : mb_strpos($this->string, $needle, $offset, 'UTF-8'); - - return false === $i ? null : $i; - } - - public function indexOfLast($needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { - return parent::indexOfLast($needle, $offset); - } else { - $needle = (string) $needle; - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? mb_strripos($this->string, $needle, $offset, 'UTF-8') : mb_strrpos($this->string, $needle, $offset, 'UTF-8'); - - return false === $i ? null : $i; - } - - public function length(): int - { - return mb_strlen($this->string, 'UTF-8'); - } - - public function prepend(string ...$prefix): AbstractString - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function replace(string $from, string $to): AbstractString - { - $str = clone $this; - - if ('' === $from || !preg_match('//u', $from)) { - return $str; - } - - if ('' !== $to && !preg_match('//u', $to)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - if ($this->ignoreCase) { - $str->string = implode($to, preg_split('{'.preg_quote($from).'}iuD', $this->string)); - } else { - $str->string = str_replace($from, $to, $this->string); - } - - return $str; - } - - public function slice(int $start = 0, int $length = null): AbstractString - { - $str = clone $this; - $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): AbstractString - { - if (!preg_match('//u', $replacement)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $str = clone $this; - $start = $start ? \strlen(mb_substr($this->string, 0, $start, 'UTF-8')) : 0; - $length = $length ? \strlen(mb_substr($this->string, $start, $length, 'UTF-8')) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit = $limit ?? \PHP_INT_MAX) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter.'u', $limit, $flags); - } - - if (!preg_match('//u', $delimiter)) { - throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); - } - - $str = clone $this; - $chunks = $this->ignoreCase - ? preg_split('{'.preg_quote($delimiter).'}iuD', $this->string, $limit) - : explode($delimiter, $this->string, $limit); - - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - - return $chunks; - } - - public function startsWith($prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (\is_array($prefix) || $prefix instanceof \Traversable) { - return parent::startsWith($prefix); - } else { - $prefix = (string) $prefix; - } - - if ('' === $prefix || !preg_match('//u', $prefix)) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos($this->string, $prefix, 0, 'UTF-8'); - } - - return 0 === strncmp($this->string, $prefix, \strlen($prefix)); - } -} diff --git a/app/vendor/symfony/string/Exception/ExceptionInterface.php b/app/vendor/symfony/string/Exception/ExceptionInterface.php deleted file mode 100644 index 361978656..000000000 --- a/app/vendor/symfony/string/Exception/ExceptionInterface.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -interface ExceptionInterface extends \Throwable -{ -} diff --git a/app/vendor/symfony/string/Exception/RuntimeException.php b/app/vendor/symfony/string/Exception/RuntimeException.php deleted file mode 100644 index 77cb091f9..000000000 --- a/app/vendor/symfony/string/Exception/RuntimeException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/app/vendor/symfony/string/Inflector/EnglishInflector.php b/app/vendor/symfony/string/Inflector/EnglishInflector.php deleted file mode 100644 index 39b8e9a62..000000000 --- a/app/vendor/symfony/string/Inflector/EnglishInflector.php +++ /dev/null @@ -1,508 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -final class EnglishInflector implements InflectorInterface -{ - /** - * Map English plural to singular suffixes. - * - * @see http://english-zone.com/spelling/plurals.html - */ - private const PLURAL_MAP = [ - // First entry: plural suffix, reversed - // Second entry: length of plural suffix - // Third entry: Whether the suffix may succeed a vocal - // Fourth entry: Whether the suffix may succeed a consonant - // Fifth entry: singular suffix, normal - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['a', 1, true, true, ['on', 'um']], - - // nebulae (nebula) - ['ea', 2, true, true, 'a'], - - // services (service) - ['secivres', 8, true, true, 'service'], - - // mice (mouse), lice (louse) - ['eci', 3, false, true, 'ouse'], - - // geese (goose) - ['esee', 4, false, true, 'oose'], - - // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) - ['i', 1, true, true, 'us'], - - // men (man), women (woman) - ['nem', 3, true, true, 'man'], - - // children (child) - ['nerdlihc', 8, true, true, 'child'], - - // oxen (ox) - ['nexo', 4, false, false, 'ox'], - - // indices (index), appendices (appendix), prices (price) - ['seci', 4, false, true, ['ex', 'ix', 'ice']], - - // selfies (selfie) - ['seifles', 7, true, true, 'selfie'], - - // movies (movie) - ['seivom', 6, true, true, 'movie'], - - // conspectuses (conspectus), prospectuses (prospectus) - ['sesutcep', 8, true, true, 'pectus'], - - // feet (foot) - ['teef', 4, true, true, 'foot'], - - // geese (goose) - ['eseeg', 5, true, true, 'goose'], - - // teeth (tooth) - ['hteet', 5, true, true, 'tooth'], - - // news (news) - ['swen', 4, true, true, 'news'], - - // series (series) - ['seires', 6, true, true, 'series'], - - // babies (baby) - ['sei', 3, false, true, 'y'], - - // accesses (access), addresses (address), kisses (kiss) - ['sess', 4, true, false, 'ss'], - - // analyses (analysis), ellipses (ellipsis), fungi (fungus), - // neuroses (neurosis), theses (thesis), emphases (emphasis), - // oases (oasis), crises (crisis), houses (house), bases (base), - // atlases (atlas) - ['ses', 3, true, true, ['s', 'se', 'sis']], - - // objectives (objective), alternative (alternatives) - ['sevit', 5, true, true, 'tive'], - - // drives (drive) - ['sevird', 6, false, true, 'drive'], - - // lives (life), wives (wife) - ['sevi', 4, false, true, 'ife'], - - // moves (move) - ['sevom', 5, true, true, 'move'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf), caves (cave), staves (staff) - ['sev', 3, true, true, ['f', 've', 'ff']], - - // axes (axis), axes (ax), axes (axe) - ['sexa', 4, false, false, ['ax', 'axe', 'axis']], - - // indexes (index), matrixes (matrix) - ['sex', 3, true, false, 'x'], - - // quizzes (quiz) - ['sezz', 4, true, false, 'z'], - - // bureaus (bureau) - ['suae', 4, false, true, 'eau'], - - // fees (fee), trees (tree), employees (employee) - ['see', 3, true, true, 'ee'], - - // edges (edge) - ['segd', 4, true, true, 'dge'], - - // roses (rose), garages (garage), cassettes (cassette), - // waltzes (waltz), heroes (hero), bushes (bush), arches (arch), - // shoes (shoe) - ['se', 2, true, true, ['', 'e']], - - // tags (tag) - ['s', 1, true, true, ''], - - // chateaux (chateau) - ['xuae', 4, false, true, 'eau'], - - // people (person) - ['elpoep', 6, true, true, 'person'], - ]; - - /** - * Map English singular to plural suffixes. - * - * @see http://english-zone.com/spelling/plurals.html - */ - private const SINGULAR_MAP = [ - // First entry: singular suffix, reversed - // Second entry: length of singular suffix - // Third entry: Whether the suffix may succeed a vocal - // Fourth entry: Whether the suffix may succeed a consonant - // Fifth entry: plural suffix, normal - - // criterion (criteria) - ['airetirc', 8, false, false, 'criterion'], - - // nebulae (nebula) - ['aluben', 6, false, false, 'nebulae'], - - // children (child) - ['dlihc', 5, true, true, 'children'], - - // prices (price) - ['eci', 3, false, true, 'ices'], - - // services (service) - ['ecivres', 7, true, true, 'services'], - - // lives (life), wives (wife) - ['efi', 3, false, true, 'ives'], - - // selfies (selfie) - ['eifles', 6, true, true, 'selfies'], - - // movies (movie) - ['eivom', 5, true, true, 'movies'], - - // lice (louse) - ['esuol', 5, false, true, 'lice'], - - // mice (mouse) - ['esuom', 5, false, true, 'mice'], - - // geese (goose) - ['esoo', 4, false, true, 'eese'], - - // houses (house), bases (base) - ['es', 2, true, true, 'ses'], - - // geese (goose) - ['esoog', 5, true, true, 'geese'], - - // caves (cave) - ['ev', 2, true, true, 'ves'], - - // drives (drive) - ['evird', 5, false, true, 'drives'], - - // objectives (objective), alternative (alternatives) - ['evit', 4, true, true, 'tives'], - - // moves (move) - ['evom', 4, true, true, 'moves'], - - // staves (staff) - ['ffats', 5, true, true, 'staves'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) - ['ff', 2, true, true, 'ffs'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) - ['f', 1, true, true, ['fs', 'ves']], - - // arches (arch) - ['hc', 2, true, true, 'ches'], - - // bushes (bush) - ['hs', 2, true, true, 'shes'], - - // teeth (tooth) - ['htoot', 5, true, true, 'teeth'], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['mu', 2, true, true, 'a'], - - // men (man), women (woman) - ['nam', 3, true, true, 'men'], - - // people (person) - ['nosrep', 6, true, true, ['persons', 'people']], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['noi', 3, true, true, 'ions'], - - // coupon (coupons) - ['nop', 3, true, true, 'pons'], - - // seasons (season), treasons (treason), poisons (poison), lessons (lesson) - ['nos', 3, true, true, 'sons'], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['no', 2, true, true, 'a'], - - // echoes (echo) - ['ohce', 4, true, true, 'echoes'], - - // heroes (hero) - ['oreh', 4, true, true, 'heroes'], - - // atlases (atlas) - ['salta', 5, true, true, 'atlases'], - - // irises (iris) - ['siri', 4, true, true, 'irises'], - - // analyses (analysis), ellipses (ellipsis), neuroses (neurosis) - // theses (thesis), emphases (emphasis), oases (oasis), - // crises (crisis) - ['sis', 3, true, true, 'ses'], - - // accesses (access), addresses (address), kisses (kiss) - ['ss', 2, true, false, 'sses'], - - // syllabi (syllabus) - ['suballys', 8, true, true, 'syllabi'], - - // buses (bus) - ['sub', 3, true, true, 'buses'], - - // circuses (circus) - ['suc', 3, true, true, 'cuses'], - - // conspectuses (conspectus), prospectuses (prospectus) - ['sutcep', 6, true, true, 'pectuses'], - - // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) - ['su', 2, true, true, 'i'], - - // news (news) - ['swen', 4, true, true, 'news'], - - // feet (foot) - ['toof', 4, true, true, 'feet'], - - // chateaux (chateau), bureaus (bureau) - ['uae', 3, false, true, ['eaus', 'eaux']], - - // oxen (ox) - ['xo', 2, false, false, 'oxen'], - - // hoaxes (hoax) - ['xaoh', 4, true, false, 'hoaxes'], - - // indices (index) - ['xedni', 5, false, true, ['indicies', 'indexes']], - - // boxes (box) - ['xo', 2, false, true, 'oxes'], - - // indexes (index), matrixes (matrix) - ['x', 1, true, false, ['cies', 'xes']], - - // appendices (appendix) - ['xi', 2, false, true, 'ices'], - - // babies (baby) - ['y', 1, false, true, 'ies'], - - // quizzes (quiz) - ['ziuq', 4, true, false, 'quizzes'], - - // waltzes (waltz) - ['z', 1, true, true, 'zes'], - ]; - - /** - * A list of words which should not be inflected, reversed. - */ - private const UNINFLECTED = [ - '', - - // data - 'atad', - - // deer - 'reed', - - // feedback - 'kcabdeef', - - // fish - 'hsif', - - // info - 'ofni', - - // moose - 'esoom', - - // series - 'seires', - - // sheep - 'peehs', - - // species - 'seiceps', - ]; - - /** - * {@inheritdoc} - */ - public function singularize(string $plural): array - { - $pluralRev = strrev($plural); - $lowerPluralRev = strtolower($pluralRev); - $pluralLength = \strlen($lowerPluralRev); - - // Check if the word is one which is not inflected, return early if so - if (\in_array($lowerPluralRev, self::UNINFLECTED, true)) { - return [$plural]; - } - - // The outer loop iterates over the entries of the plural table - // The inner loop $j iterates over the characters of the plural suffix - // in the plural table to compare them with the characters of the actual - // given plural suffix - foreach (self::PLURAL_MAP as $map) { - $suffix = $map[0]; - $suffixLength = $map[1]; - $j = 0; - - // Compare characters in the plural table and of the suffix of the - // given plural one by one - while ($suffix[$j] === $lowerPluralRev[$j]) { - // Let $j point to the next character - ++$j; - - // Successfully compared the last character - // Add an entry with the singular suffix to the singular array - if ($j === $suffixLength) { - // Is there any character preceding the suffix in the plural string? - if ($j < $pluralLength) { - $nextIsVocal = false !== strpos('aeiou', $lowerPluralRev[$j]); - - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one - break; - } - - if (!$map[3] && !$nextIsVocal) { - // suffix may not succeed a consonant but next char is one - break; - } - } - - $newBase = substr($plural, 0, $pluralLength - $suffixLength); - $newSuffix = $map[4]; - - // Check whether the first character in the plural suffix - // is uppercased. If yes, uppercase the first character in - // the singular suffix too - $firstUpper = ctype_upper($pluralRev[$j - 1]); - - if (\is_array($newSuffix)) { - $singulars = []; - - foreach ($newSuffix as $newSuffixEntry) { - $singulars[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); - } - - return $singulars; - } - - return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; - } - - // Suffix is longer than word - if ($j === $pluralLength) { - break; - } - } - } - - // Assume that plural and singular is identical - return [$plural]; - } - - /** - * {@inheritdoc} - */ - public function pluralize(string $singular): array - { - $singularRev = strrev($singular); - $lowerSingularRev = strtolower($singularRev); - $singularLength = \strlen($lowerSingularRev); - - // Check if the word is one which is not inflected, return early if so - if (\in_array($lowerSingularRev, self::UNINFLECTED, true)) { - return [$singular]; - } - - // The outer loop iterates over the entries of the singular table - // The inner loop $j iterates over the characters of the singular suffix - // in the singular table to compare them with the characters of the actual - // given singular suffix - foreach (self::SINGULAR_MAP as $map) { - $suffix = $map[0]; - $suffixLength = $map[1]; - $j = 0; - - // Compare characters in the singular table and of the suffix of the - // given plural one by one - - while ($suffix[$j] === $lowerSingularRev[$j]) { - // Let $j point to the next character - ++$j; - - // Successfully compared the last character - // Add an entry with the plural suffix to the plural array - if ($j === $suffixLength) { - // Is there any character preceding the suffix in the plural string? - if ($j < $singularLength) { - $nextIsVocal = false !== strpos('aeiou', $lowerSingularRev[$j]); - - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one - break; - } - - if (!$map[3] && !$nextIsVocal) { - // suffix may not succeed a consonant but next char is one - break; - } - } - - $newBase = substr($singular, 0, $singularLength - $suffixLength); - $newSuffix = $map[4]; - - // Check whether the first character in the singular suffix - // is uppercased. If yes, uppercase the first character in - // the singular suffix too - $firstUpper = ctype_upper($singularRev[$j - 1]); - - if (\is_array($newSuffix)) { - $plurals = []; - - foreach ($newSuffix as $newSuffixEntry) { - $plurals[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); - } - - return $plurals; - } - - return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; - } - - // Suffix is longer than word - if ($j === $singularLength) { - break; - } - } - } - - // Assume that plural is singular with a trailing `s` - return [$singular.'s']; - } -} diff --git a/app/vendor/symfony/string/Inflector/FrenchInflector.php b/app/vendor/symfony/string/Inflector/FrenchInflector.php deleted file mode 100644 index 42f6125aa..000000000 --- a/app/vendor/symfony/string/Inflector/FrenchInflector.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -/** - * French inflector. - * - * This class does only inflect nouns; not adjectives nor composed words like "soixante-dix". - */ -final class FrenchInflector implements InflectorInterface -{ - /** - * A list of all rules for pluralise. - * - * @see https://la-conjugaison.nouvelobs.com/regles/grammaire/le-pluriel-des-noms-121.php - */ - private const PLURALIZE_REGEXP = [ - // First entry: regexp - // Second entry: replacement - - // Words finishing with "s", "x" or "z" are invariables - // Les mots finissant par "s", "x" ou "z" sont invariables - ['/(s|x|z)$/i', '\1'], - - // Words finishing with "eau" are pluralized with a "x" - // Les mots finissant par "eau" prennent tous un "x" au pluriel - ['/(eau)$/i', '\1x'], - - // Words finishing with "au" are pluralized with a "x" excepted "landau" - // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" - ['/^(landau)$/i', '\1s'], - ['/(au)$/i', '\1x'], - - // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" - // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" - ['/^(pneu|bleu|émeu)$/i', '\1s'], - ['/(eu)$/i', '\1x'], - - // Words finishing with "al" are pluralized with a "aux" excepted - // Les mots finissant en "al" se terminent en "aux" sauf - ['/^(bal|carnaval|caracal|chacal|choral|corral|étal|festival|récital|val)$/i', '\1s'], - ['/al$/i', '\1aux'], - - // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux - ['/^(aspir|b|cor|ém|ferm|soupir|trav|vant|vitr)ail$/i', '\1aux'], - - // Bijou, caillou, chou, genou, hibou, joujou et pou qui prennent un x au pluriel - ['/^(bij|caill|ch|gen|hib|jouj|p)ou$/i', '\1oux'], - - // Invariable words - ['/^(cinquante|soixante|mille)$/i', '\1'], - - // French titles - ['/^(mon|ma)(sieur|dame|demoiselle|seigneur)$/', 'mes\2s'], - ['/^(Mon|Ma)(sieur|dame|demoiselle|seigneur)$/', 'Mes\2s'], - ]; - - /** - * A list of all rules for singularize. - */ - private const SINGULARIZE_REGEXP = [ - // First entry: regexp - // Second entry: replacement - - // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux - ['/((aspir|b|cor|ém|ferm|soupir|trav|vant|vitr))aux$/i', '\1ail'], - - // Words finishing with "eau" are pluralized with a "x" - // Les mots finissant par "eau" prennent tous un "x" au pluriel - ['/(eau)x$/i', '\1'], - - // Words finishing with "al" are pluralized with a "aux" expected - // Les mots finissant en "al" se terminent en "aux" sauf - ['/(amir|anim|arsen|boc|can|capit|capor|chev|crist|génér|hopit|hôpit|idé|journ|littor|loc|m|mét|minér|princip|radic|termin)aux$/i', '\1al'], - - // Words finishing with "au" are pluralized with a "x" excepted "landau" - // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" - ['/(au)x$/i', '\1'], - - // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" - // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" - ['/(eu)x$/i', '\1'], - - // Words finishing with "ou" are pluralized with a "s" excepted bijou, caillou, chou, genou, hibou, joujou, pou - // Les mots finissant par "ou" prennent un "s" sauf bijou, caillou, chou, genou, hibou, joujou, pou - ['/(bij|caill|ch|gen|hib|jouj|p)oux$/i', '\1ou'], - - // French titles - ['/^mes(dame|demoiselle)s$/', 'ma\1'], - ['/^Mes(dame|demoiselle)s$/', 'Ma\1'], - ['/^mes(sieur|seigneur)s$/', 'mon\1'], - ['/^Mes(sieur|seigneur)s$/', 'Mon\1'], - - //Default rule - ['/s$/i', ''], - ]; - - /** - * A list of words which should not be inflected. - * This list is only used by singularize. - */ - private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i'; - - /** - * {@inheritdoc} - */ - public function singularize(string $plural): array - { - if ($this->isInflectedWord($plural)) { - return [$plural]; - } - - foreach (self::SINGULARIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $plural)) { - return [preg_replace($regexp, $replace, $plural)]; - } - } - - return [$plural]; - } - - /** - * {@inheritdoc} - */ - public function pluralize(string $singular): array - { - if ($this->isInflectedWord($singular)) { - return [$singular]; - } - - foreach (self::PLURALIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $singular)) { - return [preg_replace($regexp, $replace, $singular)]; - } - } - - return [$singular.'s']; - } - - private function isInflectedWord(string $word): bool - { - return 1 === preg_match(self::UNINFLECTED, $word); - } -} diff --git a/app/vendor/symfony/string/Inflector/InflectorInterface.php b/app/vendor/symfony/string/Inflector/InflectorInterface.php deleted file mode 100644 index ad78070b0..000000000 --- a/app/vendor/symfony/string/Inflector/InflectorInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -interface InflectorInterface -{ - /** - * Returns the singular forms of a string. - * - * If the method can't determine the form with certainty, several possible singulars are returned. - * - * @return string[] An array of possible singular forms - */ - public function singularize(string $plural): array; - - /** - * Returns the plural forms of a string. - * - * If the method can't determine the form with certainty, several possible plurals are returned. - * - * @return string[] An array of possible plural forms - */ - public function pluralize(string $singular): array; -} diff --git a/app/vendor/symfony/string/LICENSE b/app/vendor/symfony/string/LICENSE deleted file mode 100644 index 383e7a545..000000000 --- a/app/vendor/symfony/string/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2019-2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/app/vendor/symfony/string/LazyString.php b/app/vendor/symfony/string/LazyString.php deleted file mode 100644 index b3801db77..000000000 --- a/app/vendor/symfony/string/LazyString.php +++ /dev/null @@ -1,164 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -/** - * A string whose value is computed lazily by a callback. - * - * @author Nicolas Grekas - */ -class LazyString implements \Stringable, \JsonSerializable -{ - private $value; - - /** - * @param callable|array $callback A callable or a [Closure, method] lazy-callable - * - * @return static - */ - public static function fromCallable($callback, ...$arguments): self - { - if (!\is_callable($callback) && !(\is_array($callback) && isset($callback[0]) && $callback[0] instanceof \Closure && 2 >= \count($callback))) { - throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, get_debug_type($callback))); - } - - $lazyString = new static(); - $lazyString->value = static function () use (&$callback, &$arguments, &$value): string { - if (null !== $arguments) { - if (!\is_callable($callback)) { - $callback[0] = $callback[0](); - $callback[1] = $callback[1] ?? '__invoke'; - } - $value = $callback(...$arguments); - $callback = self::getPrettyName($callback); - $arguments = null; - } - - return $value ?? ''; - }; - - return $lazyString; - } - - /** - * @param string|int|float|bool|\Stringable $value - * - * @return static - */ - public static function fromStringable($value): self - { - if (!self::isStringable($value)) { - throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a scalar or a stringable object, "%s" given.', __METHOD__, get_debug_type($value))); - } - - if (\is_object($value)) { - return static::fromCallable([$value, '__toString']); - } - - $lazyString = new static(); - $lazyString->value = (string) $value; - - return $lazyString; - } - - /** - * Tells whether the provided value can be cast to string. - */ - final public static function isStringable($value): bool - { - return \is_string($value) || $value instanceof self || (\is_object($value) ? method_exists($value, '__toString') : is_scalar($value)); - } - - /** - * Casts scalars and stringable objects to strings. - * - * @param object|string|int|float|bool $value - * - * @throws \TypeError When the provided value is not stringable - */ - final public static function resolve($value): string - { - return $value; - } - - /** - * @return string - */ - public function __toString() - { - if (\is_string($this->value)) { - return $this->value; - } - - try { - return $this->value = ($this->value)(); - } catch (\Throwable $e) { - if (\TypeError::class === \get_class($e) && __FILE__ === $e->getFile()) { - $type = explode(', ', $e->getMessage()); - $type = substr(array_pop($type), 0, -\strlen(' returned')); - $r = new \ReflectionFunction($this->value); - $callback = $r->getStaticVariables()['callback']; - - $e = new \TypeError(sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); - } - - if (\PHP_VERSION_ID < 70400) { - // leverage the ErrorHandler component with graceful fallback when it's not available - return trigger_error($e, \E_USER_ERROR); - } - - throw $e; - } - } - - public function __sleep(): array - { - $this->__toString(); - - return ['value']; - } - - public function jsonSerialize(): string - { - return $this->__toString(); - } - - private function __construct() - { - } - - private static function getPrettyName(callable $callback): string - { - if (\is_string($callback)) { - return $callback; - } - - if (\is_array($callback)) { - $class = \is_object($callback[0]) ? get_debug_type($callback[0]) : $callback[0]; - $method = $callback[1]; - } elseif ($callback instanceof \Closure) { - $r = new \ReflectionFunction($callback); - - if (false !== strpos($r->name, '{closure}') || !$class = $r->getClosureScopeClass()) { - return $r->name; - } - - $class = $class->name; - $method = $r->name; - } else { - $class = get_debug_type($callback); - $method = '__invoke'; - } - - return $class.'::'.$method; - } -} diff --git a/app/vendor/symfony/string/README.md b/app/vendor/symfony/string/README.md deleted file mode 100644 index 9c7e1e190..000000000 --- a/app/vendor/symfony/string/README.md +++ /dev/null @@ -1,14 +0,0 @@ -String Component -================ - -The String component provides an object-oriented API to strings and deals -with bytes, UTF-8 code points and grapheme clusters in a unified way. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/string.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/app/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/app/vendor/symfony/string/Resources/data/wcswidth_table_wide.php deleted file mode 100644 index e3a41cdf2..000000000 --- a/app/vendor/symfony/string/Resources/data/wcswidth_table_wide.php +++ /dev/null @@ -1,1119 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -if (!\function_exists(u::class)) { - function u(?string $string = ''): UnicodeString - { - return new UnicodeString($string ?? ''); - } -} - -if (!\function_exists(b::class)) { - function b(?string $string = ''): ByteString - { - return new ByteString($string ?? ''); - } -} - -if (!\function_exists(s::class)) { - /** - * @return UnicodeString|ByteString - */ - function s(?string $string = ''): AbstractString - { - $string = $string ?? ''; - - return preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string); - } -} diff --git a/app/vendor/symfony/string/Slugger/AsciiSlugger.php b/app/vendor/symfony/string/Slugger/AsciiSlugger.php deleted file mode 100644 index 5aecfeb5f..000000000 --- a/app/vendor/symfony/string/Slugger/AsciiSlugger.php +++ /dev/null @@ -1,183 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Slugger; - -use Symfony\Component\String\AbstractUnicodeString; -use Symfony\Component\String\UnicodeString; -use Symfony\Contracts\Translation\LocaleAwareInterface; - -if (!interface_exists(LocaleAwareInterface::class)) { - throw new \LogicException('You cannot use the "Symfony\Component\String\Slugger\AsciiSlugger" as the "symfony/translation-contracts" package is not installed. Try running "composer require symfony/translation-contracts".'); -} - -/** - * @author Titouan Galopin - */ -class AsciiSlugger implements SluggerInterface, LocaleAwareInterface -{ - private const LOCALE_TO_TRANSLITERATOR_ID = [ - 'am' => 'Amharic-Latin', - 'ar' => 'Arabic-Latin', - 'az' => 'Azerbaijani-Latin', - 'be' => 'Belarusian-Latin', - 'bg' => 'Bulgarian-Latin', - 'bn' => 'Bengali-Latin', - 'de' => 'de-ASCII', - 'el' => 'Greek-Latin', - 'fa' => 'Persian-Latin', - 'he' => 'Hebrew-Latin', - 'hy' => 'Armenian-Latin', - 'ka' => 'Georgian-Latin', - 'kk' => 'Kazakh-Latin', - 'ky' => 'Kirghiz-Latin', - 'ko' => 'Korean-Latin', - 'mk' => 'Macedonian-Latin', - 'mn' => 'Mongolian-Latin', - 'or' => 'Oriya-Latin', - 'ps' => 'Pashto-Latin', - 'ru' => 'Russian-Latin', - 'sr' => 'Serbian-Latin', - 'sr_Cyrl' => 'Serbian-Latin', - 'th' => 'Thai-Latin', - 'tk' => 'Turkmen-Latin', - 'uk' => 'Ukrainian-Latin', - 'uz' => 'Uzbek-Latin', - 'zh' => 'Han-Latin', - ]; - - private $defaultLocale; - private $symbolsMap = [ - 'en' => ['@' => 'at', '&' => 'and'], - ]; - - /** - * Cache of transliterators per locale. - * - * @var \Transliterator[] - */ - private $transliterators = []; - - /** - * @param array|\Closure|null $symbolsMap - */ - public function __construct(string $defaultLocale = null, $symbolsMap = null) - { - if (null !== $symbolsMap && !\is_array($symbolsMap) && !$symbolsMap instanceof \Closure) { - throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be array, Closure or null, "%s" given.', __METHOD__, \gettype($symbolsMap))); - } - - $this->defaultLocale = $defaultLocale; - $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; - } - - /** - * {@inheritdoc} - */ - public function setLocale($locale) - { - $this->defaultLocale = $locale; - } - - /** - * {@inheritdoc} - */ - public function getLocale() - { - return $this->defaultLocale; - } - - /** - * {@inheritdoc} - */ - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString - { - $locale = $locale ?? $this->defaultLocale; - - $transliterator = []; - if ($locale && ('de' === $locale || 0 === strpos($locale, 'de_'))) { - // Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl) - $transliterator = ['de-ASCII']; - } elseif (\function_exists('transliterator_transliterate') && $locale) { - $transliterator = (array) $this->createTransliterator($locale); - } - - if ($this->symbolsMap instanceof \Closure) { - // If the symbols map is passed as a closure, there is no need to fallback to the parent locale - // as the closure can just provide substitutions for all locales of interest. - $symbolsMap = $this->symbolsMap; - array_unshift($transliterator, static function ($s) use ($symbolsMap, $locale) { - return $symbolsMap($s, $locale); - }); - } - - $unicodeString = (new UnicodeString($string))->ascii($transliterator); - - if (\is_array($this->symbolsMap)) { - $map = null; - if (isset($this->symbolsMap[$locale])) { - $map = $this->symbolsMap[$locale]; - } else { - $parent = self::getParentLocale($locale); - if ($parent && isset($this->symbolsMap[$parent])) { - $map = $this->symbolsMap[$parent]; - } - } - if ($map) { - foreach ($map as $char => $replace) { - $unicodeString = $unicodeString->replace($char, ' '.$replace.' '); - } - } - } - - return $unicodeString - ->replaceMatches('/[^A-Za-z0-9]++/', $separator) - ->trim($separator) - ; - } - - private function createTransliterator(string $locale): ?\Transliterator - { - if (\array_key_exists($locale, $this->transliterators)) { - return $this->transliterators[$locale]; - } - - // Exact locale supported, cache and return - if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$locale] ?? null) { - return $this->transliterators[$locale] = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); - } - - // Locale not supported and no parent, fallback to any-latin - if (!$parent = self::getParentLocale($locale)) { - return $this->transliterators[$locale] = null; - } - - // Try to use the parent locale (ie. try "de" for "de_AT") and cache both locales - if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$parent] ?? null) { - $transliterator = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); - } - - return $this->transliterators[$locale] = $this->transliterators[$parent] = $transliterator ?? null; - } - - private static function getParentLocale(?string $locale): ?string - { - if (!$locale) { - return null; - } - if (false === $str = strrchr($locale, '_')) { - // no parent locale - return null; - } - - return substr($locale, 0, -\strlen($str)); - } -} diff --git a/app/vendor/symfony/string/Slugger/SluggerInterface.php b/app/vendor/symfony/string/Slugger/SluggerInterface.php deleted file mode 100644 index c679ed933..000000000 --- a/app/vendor/symfony/string/Slugger/SluggerInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Slugger; - -use Symfony\Component\String\AbstractUnicodeString; - -/** - * Creates a URL-friendly slug from a given string. - * - * @author Titouan Galopin - */ -interface SluggerInterface -{ - /** - * Creates a slug for the given string and locale, using appropriate transliteration when needed. - */ - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString; -} diff --git a/app/vendor/symfony/string/UnicodeString.php b/app/vendor/symfony/string/UnicodeString.php deleted file mode 100644 index 9b906c6fc..000000000 --- a/app/vendor/symfony/string/UnicodeString.php +++ /dev/null @@ -1,377 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; - -/** - * Represents a string of Unicode grapheme clusters encoded as UTF-8. - * - * A letter followed by combining characters (accents typically) form what Unicode defines - * as a grapheme cluster: a character as humans mean it in written texts. This class knows - * about the concept and won't split a letter apart from its combining accents. It also - * ensures all string comparisons happen on their canonically-composed representation, - * ignoring e.g. the order in which accents are listed when a letter has many of them. - * - * @see https://unicode.org/reports/tr15/ - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class UnicodeString extends AbstractUnicodeString -{ - public function __construct(string $string = '') - { - $this->string = normalizer_is_normalized($string) ? $string : normalizer_normalize($string); - - if (false === $this->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - } - - public function append(string ...$suffix): AbstractString - { - $str = clone $this; - $str->string = $this->string.(1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix)); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $rx = '/('; - while (65535 < $length) { - $rx .= '\X{65535}'; - $length -= 65535; - } - $rx .= '\X{'.$length.'})/u'; - - $str = clone $this; - $chunks = []; - - foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function endsWith($suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (\is_array($suffix) || $suffix instanceof \Traversable) { - return parent::endsWith($suffix); - } else { - $suffix = (string) $suffix; - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($suffix, $form) ?: $suffix = normalizer_normalize($suffix, $form); - - if ('' === $suffix || false === $suffix) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)), $suffix, 0, 'UTF-8'); - } - - return $suffix === grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)); - } - - public function equalsTo($string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (\is_array($string) || $string instanceof \Traversable) { - return parent::equalsTo($string); - } else { - $string = (string) $string; - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($string, $form) ?: $string = normalizer_normalize($string, $form); - - if ('' !== $string && false !== $string && $this->ignoreCase) { - return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); - } - - return $string === $this->string; - } - - public function indexOf($needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { - return parent::indexOf($needle, $offset); - } else { - $needle = (string) $needle; - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); - - if ('' === $needle || false === $needle) { - return null; - } - - try { - $i = $this->ignoreCase ? grapheme_stripos($this->string, $needle, $offset) : grapheme_strpos($this->string, $needle, $offset); - } catch (\ValueError $e) { - return null; - } - - return false === $i ? null : $i; - } - - public function indexOfLast($needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { - return parent::indexOfLast($needle, $offset); - } else { - $needle = (string) $needle; - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); - - if ('' === $needle || false === $needle) { - return null; - } - - $string = $this->string; - - if (0 > $offset) { - // workaround https://bugs.php.net/74264 - if (0 > $offset += grapheme_strlen($needle)) { - $string = grapheme_substr($string, 0, $offset); - } - $offset = 0; - } - - $i = $this->ignoreCase ? grapheme_strripos($string, $needle, $offset) : grapheme_strrpos($string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function join(array $strings, string $lastGlue = null): AbstractString - { - $str = parent::join($strings, $lastGlue); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - return $str; - } - - public function length(): int - { - return grapheme_strlen($this->string); - } - - /** - * @return static - */ - public function normalize(int $form = self::NFC): parent - { - $str = clone $this; - - if (\in_array($form, [self::NFC, self::NFKC], true)) { - normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); - } elseif (!\in_array($form, [self::NFD, self::NFKD], true)) { - throw new InvalidArgumentException('Unsupported normalization form.'); - } elseif (!normalizer_is_normalized($str->string, $form)) { - $str->string = normalizer_normalize($str->string, $form); - $str->ignoreCase = null; - } - - return $str; - } - - public function prepend(string ...$prefix): AbstractString - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function replace(string $from, string $to): AbstractString - { - $str = clone $this; - normalizer_is_normalized($from) ?: $from = normalizer_normalize($from); - - if ('' !== $from && false !== $from) { - $tail = $str->string; - $result = ''; - $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; - - while ('' !== $tail && false !== $i = $indexOf($tail, $from)) { - $slice = grapheme_substr($tail, 0, $i); - $result .= $slice.$to; - $tail = substr($tail, \strlen($slice) + \strlen($from)); - } - - $str->string = $result.$tail; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - } - - return $str; - } - - public function replaceMatches(string $fromRegexp, $to): AbstractString - { - $str = parent::replaceMatches($fromRegexp, $to); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - return $str; - } - - public function slice(int $start = 0, int $length = null): AbstractString - { - $str = clone $this; - - if (\PHP_VERSION_ID < 80000 && 0 > $start && grapheme_strlen($this->string) < -$start) { - $start = 0; - } - $str->string = (string) grapheme_substr($this->string, $start, $length ?? 2147483647); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): AbstractString - { - $str = clone $this; - - if (\PHP_VERSION_ID < 80000 && 0 > $start && grapheme_strlen($this->string) < -$start) { - $start = 0; - } - $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; - $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit = $limit ?? 2147483647) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter.'u', $limit, $flags); - } - - normalizer_is_normalized($delimiter) ?: $delimiter = normalizer_normalize($delimiter); - - if (false === $delimiter) { - throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); - } - - $str = clone $this; - $tail = $this->string; - $chunks = []; - $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; - - while (1 < $limit && false !== $i = $indexOf($tail, $delimiter)) { - $str->string = grapheme_substr($tail, 0, $i); - $chunks[] = clone $str; - $tail = substr($tail, \strlen($str->string) + \strlen($delimiter)); - --$limit; - } - - $str->string = $tail; - $chunks[] = clone $str; - - return $chunks; - } - - public function startsWith($prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (\is_array($prefix) || $prefix instanceof \Traversable) { - return parent::startsWith($prefix); - } else { - $prefix = (string) $prefix; - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($prefix, $form) ?: $prefix = normalizer_normalize($prefix, $form); - - if ('' === $prefix || false === $prefix) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES), $prefix, 0, 'UTF-8'); - } - - return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES); - } - - public function __wakeup() - { - if (!\is_string($this->string)) { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); - } - - public function __clone() - { - if (null === $this->ignoreCase) { - normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); - } - - $this->ignoreCase = false; - } -} diff --git a/app/vendor/symfony/string/composer.json b/app/vendor/symfony/string/composer.json deleted file mode 100644 index bfb03cd36..000000000 --- a/app/vendor/symfony/string/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "symfony/string", - "type": "library", - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "keywords": ["string", "utf8", "utf-8", "grapheme", "i18n", "unicode"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" - }, - "require-dev": { - "symfony/error-handler": "^4.4|^5.0", - "symfony/http-client": "^4.4|^5.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\String\\": "" }, - "files": [ "Resources/functions.php" ], - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/app/vendor/symfony/var-dumper/CHANGELOG.md b/app/vendor/symfony/var-dumper/CHANGELOG.md index f3956e6ae..94b1c17d1 100644 --- a/app/vendor/symfony/var-dumper/CHANGELOG.md +++ b/app/vendor/symfony/var-dumper/CHANGELOG.md @@ -1,18 +1,6 @@ CHANGELOG ========= -5.2.0 ------ - - * added support for PHPUnit `--colors` option - * added `VAR_DUMPER_FORMAT=server` env var value support - * prevent replacing the handler when the `VAR_DUMPER_FORMAT` env var is set - -5.1.0 ------ - - * added `RdKafka` support - 4.4.0 ----- diff --git a/app/vendor/symfony/var-dumper/Caster/AmqpCaster.php b/app/vendor/symfony/var-dumper/Caster/AmqpCaster.php index dc3b62198..60045ff7b 100644 --- a/app/vendor/symfony/var-dumper/Caster/AmqpCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/AmqpCaster.php @@ -18,7 +18,7 @@ * * @author Grégoire Pineau * - * @final + * @final since Symfony 4.4 */ class AmqpCaster { @@ -46,7 +46,7 @@ class AmqpCaster \AMQP_EX_TYPE_HEADERS => 'AMQP_EX_TYPE_HEADERS', ]; - public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, bool $isNested) + public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -79,7 +79,7 @@ public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, return $a; } - public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $isNested) + public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -102,7 +102,7 @@ public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $ return $a; } - public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNested) + public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -125,7 +125,7 @@ public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNe return $a; } - public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool $isNested) + public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -153,7 +153,7 @@ public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool return $a; } - public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, $isNested, $filter = 0) { $prefix = Caster::PREFIX_VIRTUAL; diff --git a/app/vendor/symfony/var-dumper/Caster/Caster.php b/app/vendor/symfony/var-dumper/Caster/Caster.php index 612b21f88..d35f3230b 100644 --- a/app/vendor/symfony/var-dumper/Caster/Caster.php +++ b/app/vendor/symfony/var-dumper/Caster/Caster.php @@ -40,11 +40,12 @@ class Caster /** * Casts objects to arrays and adds the dynamic property prefix. * - * @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not + * @param object $obj The object to cast + * @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not * * @return array The array-cast of the object, with prefixed dynamic properties */ - public static function castObject(object $obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array + public static function castObject($obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array { if ($hasDebugInfo) { try { @@ -68,7 +69,7 @@ public static function castObject(object $obj, string $class, bool $hasDebugInfo $i = 0; $prefixedKeys = []; foreach ($a as $k => $v) { - if ("\0" !== ($k[0] ?? '')) { + if (isset($k[0]) ? "\0" !== $k[0] : \PHP_VERSION_ID >= 70200) { if (!isset($publicProperties[$class])) { foreach ((new \ReflectionClass($class))->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) { $publicProperties[$class][$prop->name] = true; diff --git a/app/vendor/symfony/var-dumper/Caster/DOMCaster.php b/app/vendor/symfony/var-dumper/Caster/DOMCaster.php index 4dd16e0ee..5f2b9cd11 100644 --- a/app/vendor/symfony/var-dumper/Caster/DOMCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/DOMCaster.php @@ -18,7 +18,7 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class DOMCaster { @@ -63,7 +63,7 @@ class DOMCaster \XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE', ]; - public static function castException(\DOMException $e, array $a, Stub $stub, bool $isNested) + public static function castException(\DOMException $e, array $a, Stub $stub, $isNested) { $k = Caster::PREFIX_PROTECTED.'code'; if (isset($a[$k], self::ERROR_CODES[$a[$k]])) { @@ -73,7 +73,7 @@ public static function castException(\DOMException $e, array $a, Stub $stub, boo return $a; } - public static function castLength($dom, array $a, Stub $stub, bool $isNested) + public static function castLength($dom, array $a, Stub $stub, $isNested) { $a += [ 'length' => $dom->length, @@ -82,7 +82,7 @@ public static function castLength($dom, array $a, Stub $stub, bool $isNested) return $a; } - public static function castImplementation(\DOMImplementation $dom, array $a, Stub $stub, bool $isNested) + public static function castImplementation($dom, array $a, Stub $stub, $isNested) { $a += [ Caster::PREFIX_VIRTUAL.'Core' => '1.0', @@ -92,7 +92,7 @@ public static function castImplementation(\DOMImplementation $dom, array $a, Stu return $a; } - public static function castNode(\DOMNode $dom, array $a, Stub $stub, bool $isNested) + public static function castNode(\DOMNode $dom, array $a, Stub $stub, $isNested) { $a += [ 'nodeName' => $dom->nodeName, @@ -116,7 +116,7 @@ public static function castNode(\DOMNode $dom, array $a, Stub $stub, bool $isNes return $a; } - public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, bool $isNested) + public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, $isNested) { $a += [ 'nodeName' => $dom->nodeName, @@ -132,7 +132,7 @@ public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub return $a; } - public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, $isNested, $filter = 0) { $a += [ 'doctype' => $dom->doctype, @@ -166,7 +166,7 @@ public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, boo return $a; } - public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, bool $isNested) + public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, $isNested) { $a += [ 'data' => $dom->data, @@ -176,7 +176,7 @@ public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub return $a; } - public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNested) + public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, $isNested) { $a += [ 'name' => $dom->name, @@ -189,7 +189,7 @@ public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNes return $a; } - public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool $isNested) + public static function castElement(\DOMElement $dom, array $a, Stub $stub, $isNested) { $a += [ 'tagName' => $dom->tagName, @@ -199,7 +199,7 @@ public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool return $a; } - public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNested) + public static function castText(\DOMText $dom, array $a, Stub $stub, $isNested) { $a += [ 'wholeText' => $dom->wholeText, @@ -208,7 +208,7 @@ public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNes return $a; } - public static function castTypeinfo(\DOMTypeinfo $dom, array $a, Stub $stub, bool $isNested) + public static function castTypeinfo(\DOMTypeinfo $dom, array $a, Stub $stub, $isNested) { $a += [ 'typeName' => $dom->typeName, @@ -218,7 +218,7 @@ public static function castTypeinfo(\DOMTypeinfo $dom, array $a, Stub $stub, boo return $a; } - public static function castDomError(\DOMDomError $dom, array $a, Stub $stub, bool $isNested) + public static function castDomError(\DOMDomError $dom, array $a, Stub $stub, $isNested) { $a += [ 'severity' => $dom->severity, @@ -232,7 +232,7 @@ public static function castDomError(\DOMDomError $dom, array $a, Stub $stub, boo return $a; } - public static function castLocator(\DOMLocator $dom, array $a, Stub $stub, bool $isNested) + public static function castLocator(\DOMLocator $dom, array $a, Stub $stub, $isNested) { $a += [ 'lineNumber' => $dom->lineNumber, @@ -245,7 +245,7 @@ public static function castLocator(\DOMLocator $dom, array $a, Stub $stub, bool return $a; } - public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, bool $isNested) + public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, $isNested) { $a += [ 'name' => $dom->name, @@ -259,7 +259,7 @@ public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $s return $a; } - public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, bool $isNested) + public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, $isNested) { $a += [ 'publicId' => $dom->publicId, @@ -269,7 +269,7 @@ public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, boo return $a; } - public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $isNested) + public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, $isNested) { $a += [ 'publicId' => $dom->publicId, @@ -283,7 +283,7 @@ public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $i return $a; } - public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, bool $isNested) + public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, $isNested) { $a += [ 'target' => $dom->target, @@ -293,7 +293,7 @@ public static function castProcessingInstruction(\DOMProcessingInstruction $dom, return $a; } - public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, bool $isNested) + public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, $isNested) { $a += [ 'document' => $dom->document, diff --git a/app/vendor/symfony/var-dumper/Caster/DateCaster.php b/app/vendor/symfony/var-dumper/Caster/DateCaster.php index 1f61c327a..171fbde55 100644 --- a/app/vendor/symfony/var-dumper/Caster/DateCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/DateCaster.php @@ -18,13 +18,13 @@ * * @author Dany Maillard * - * @final + * @final since Symfony 4.4 */ class DateCaster { private const PERIOD_LIMIT = 3; - public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, bool $isNested, int $filter) + public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, $isNested, $filter) { $prefix = Caster::PREFIX_VIRTUAL; $location = $d->getTimezone()->getLocation(); @@ -47,7 +47,7 @@ public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, return $a; } - public static function castInterval(\DateInterval $interval, array $a, Stub $stub, bool $isNested, int $filter) + public static function castInterval(\DateInterval $interval, array $a, Stub $stub, $isNested, $filter) { $now = new \DateTimeImmutable(); $numberOfSeconds = $now->add($interval)->getTimestamp() - $now->getTimestamp(); @@ -75,7 +75,7 @@ private static function formatInterval(\DateInterval $i): string return $i->format(rtrim($format)); } - public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, bool $isNested, int $filter) + public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, $isNested, $filter) { $location = $timeZone->getLocation(); $formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P'); @@ -86,19 +86,21 @@ public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stu return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a; } - public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, bool $isNested, int $filter) + public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, $isNested, $filter) { $dates = []; - foreach (clone $p as $i => $d) { - if (self::PERIOD_LIMIT === $i) { - $now = new \DateTimeImmutable('now', new \DateTimeZone('UTC')); - $dates[] = sprintf('%s more', ($end = $p->getEndDate()) - ? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u'))) - : $p->recurrences - $i - ); - break; + if (\PHP_VERSION_ID >= 70107) { // see https://bugs.php.net/74639 + foreach (clone $p as $i => $d) { + if (self::PERIOD_LIMIT === $i) { + $now = new \DateTimeImmutable('now', new \DateTimeZone('UTC')); + $dates[] = sprintf('%s more', ($end = $p->getEndDate()) + ? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u'))) + : $p->recurrences - $i + ); + break; + } + $dates[] = sprintf('%s) %s', $i + 1, self::formatDateTime($d)); } - $dates[] = sprintf('%s) %s', $i + 1, self::formatDateTime($d)); } $period = sprintf( diff --git a/app/vendor/symfony/var-dumper/Caster/DoctrineCaster.php b/app/vendor/symfony/var-dumper/Caster/DoctrineCaster.php index 129b2cb47..7409508b0 100644 --- a/app/vendor/symfony/var-dumper/Caster/DoctrineCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/DoctrineCaster.php @@ -21,11 +21,11 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class DoctrineCaster { - public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, bool $isNested) + public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, $isNested) { foreach (['__cloner__', '__initializer__'] as $k) { if (\array_key_exists($k, $a)) { @@ -37,7 +37,7 @@ public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, return $a; } - public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool $isNested) + public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, $isNested) { foreach (['_entityPersister', '_identifier'] as $k) { if (\array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) { @@ -49,7 +49,7 @@ public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool return $a; } - public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, bool $isNested) + public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, $isNested) { foreach (['snapshot', 'association', 'typeClass'] as $k) { if (\array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) { diff --git a/app/vendor/symfony/var-dumper/Caster/DsCaster.php b/app/vendor/symfony/var-dumper/Caster/DsCaster.php index b34b67004..11423c9b2 100644 --- a/app/vendor/symfony/var-dumper/Caster/DsCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/DsCaster.php @@ -21,7 +21,7 @@ * * @author Jáchym Toušek * - * @final + * @final since Symfony 4.4 */ class DsCaster { diff --git a/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php index baa7a180b..f2c0f9687 100644 --- a/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php @@ -20,7 +20,7 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class ExceptionCaster { @@ -46,17 +46,17 @@ class ExceptionCaster private static $framesCache = []; - public static function castError(\Error $e, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castError(\Error $e, array $a, Stub $stub, $isNested, $filter = 0) { return self::filterExceptionArray($stub->class, $a, "\0Error\0", $filter); } - public static function castException(\Exception $e, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castException(\Exception $e, array $a, Stub $stub, $isNested, $filter = 0) { return self::filterExceptionArray($stub->class, $a, "\0Exception\0", $filter); } - public static function castErrorException(\ErrorException $e, array $a, Stub $stub, bool $isNested) + public static function castErrorException(\ErrorException $e, array $a, Stub $stub, $isNested) { if (isset($a[$s = Caster::PREFIX_PROTECTED.'severity'], self::$errorTypes[$a[$s]])) { $a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]); @@ -65,7 +65,7 @@ public static function castErrorException(\ErrorException $e, array $a, Stub $st return $a; } - public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, bool $isNested) + public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, $isNested) { $trace = Caster::PREFIX_VIRTUAL.'trace'; $prefix = Caster::PREFIX_PROTECTED; @@ -83,7 +83,7 @@ public static function castThrowingCasterException(ThrowingCasterException $e, a return $a; } - public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, bool $isNested) + public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, $isNested) { $sPrefix = "\0".SilencedErrorContext::class."\0"; @@ -110,7 +110,7 @@ public static function castSilencedErrorContext(SilencedErrorContext $e, array $ return $a; } - public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, bool $isNested) + public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, $isNested) { if (!$isNested) { return $a; @@ -184,7 +184,7 @@ public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, boo return $a; } - public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, bool $isNested) + public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, $isNested) { if (!$isNested) { return $a; @@ -212,20 +212,26 @@ public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, boo $ellipsisTail = $ellipsis->attr['ellipsis-tail'] ?? 0; $ellipsis = $ellipsis->attr['ellipsis'] ?? 0; - if (is_file($f['file']) && 0 <= self::$srcContext) { + if (file_exists($f['file']) && 0 <= self::$srcContext) { if (!empty($f['class']) && (is_subclass_of($f['class'], 'Twig\Template') || is_subclass_of($f['class'], 'Twig_Template')) && method_exists($f['class'], 'getDebugInfo')) { - $template = $f['object'] ?? unserialize(sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class'])); - - $ellipsis = 0; - $templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : ''); - $templateInfo = $template->getDebugInfo(); - if (isset($templateInfo[$f['line']])) { - if (!method_exists($template, 'getSourceContext') || !is_file($templatePath = $template->getSourceContext()->getPath())) { - $templatePath = null; - } - if ($templateSrc) { - $src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, 'twig', $templatePath, $f); - $srcKey = ($templatePath ?: $template->getTemplateName()).':'.$templateInfo[$f['line']]; + $template = null; + if (isset($f['object'])) { + $template = $f['object']; + } elseif ((new \ReflectionClass($f['class']))->isInstantiable()) { + $template = unserialize(sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class'])); + } + if (null !== $template) { + $ellipsis = 0; + $templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : ''); + $templateInfo = $template->getDebugInfo(); + if (isset($templateInfo[$f['line']])) { + if (!method_exists($template, 'getSourceContext') || !file_exists($templatePath = $template->getSourceContext()->getPath())) { + $templatePath = null; + } + if ($templateSrc) { + $src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, 'twig', $templatePath, $f); + $srcKey = ($templatePath ?: $template->getTemplateName()).':'.$templateInfo[$f['line']]; + } } } } diff --git a/app/vendor/symfony/var-dumper/Caster/GmpCaster.php b/app/vendor/symfony/var-dumper/Caster/GmpCaster.php index b018cc7f8..2b20e15dc 100644 --- a/app/vendor/symfony/var-dumper/Caster/GmpCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/GmpCaster.php @@ -19,11 +19,11 @@ * @author Hamza Amrouche * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class GmpCaster { - public static function castGmp(\GMP $gmp, array $a, Stub $stub, bool $isNested, int $filter): array + public static function castGmp(\GMP $gmp, array $a, Stub $stub, $isNested, $filter): array { $a[Caster::PREFIX_VIRTUAL.'value'] = new ConstStub(gmp_strval($gmp), gmp_strval($gmp)); diff --git a/app/vendor/symfony/var-dumper/Caster/ImgStub.php b/app/vendor/symfony/var-dumper/Caster/ImgStub.php index a16681f73..05789fe33 100644 --- a/app/vendor/symfony/var-dumper/Caster/ImgStub.php +++ b/app/vendor/symfony/var-dumper/Caster/ImgStub.php @@ -16,7 +16,7 @@ */ class ImgStub extends ConstStub { - public function __construct(string $data, string $contentType, string $size = '') + public function __construct(string $data, string $contentType, string $size) { $this->value = ''; $this->attr['img-data'] = $data; diff --git a/app/vendor/symfony/var-dumper/Caster/IntlCaster.php b/app/vendor/symfony/var-dumper/Caster/IntlCaster.php index 23b9d5da3..d7099cb18 100644 --- a/app/vendor/symfony/var-dumper/Caster/IntlCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/IntlCaster.php @@ -17,11 +17,11 @@ * @author Nicolas Grekas * @author Jan Schädlich * - * @final + * @final since Symfony 4.4 */ class IntlCaster { - public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, bool $isNested) + public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, $isNested) { $a += [ Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(), @@ -31,7 +31,7 @@ public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub return self::castError($c, $a); } - public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, $isNested, $filter = 0) { $a += [ Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(), @@ -108,7 +108,7 @@ public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $ return self::castError($c, $a); } - public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, bool $isNested) + public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, $isNested) { $a += [ Caster::PREFIX_VIRTUAL.'display_name' => $c->getDisplayName(), @@ -125,7 +125,7 @@ public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, return self::castError($c, $a); } - public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, $isNested, $filter = 0) { $a += [ Caster::PREFIX_VIRTUAL.'type' => $c->getType(), @@ -142,7 +142,7 @@ public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, return self::castError($c, $a); } - public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, $isNested, $filter = 0) { $a += [ Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(), @@ -158,7 +158,7 @@ public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, St return self::castError($c, $a); } - private static function castError(object $c, array $a): array + private static function castError($c, array $a): array { if ($errorCode = $c->getErrorCode()) { $a += [ diff --git a/app/vendor/symfony/var-dumper/Caster/LinkStub.php b/app/vendor/symfony/var-dumper/Caster/LinkStub.php index 7e0780339..c619d9dcb 100644 --- a/app/vendor/symfony/var-dumper/Caster/LinkStub.php +++ b/app/vendor/symfony/var-dumper/Caster/LinkStub.php @@ -43,7 +43,7 @@ public function __construct(string $label, int $line = 0, string $href = null) return; } - if (!is_file($href)) { + if (!file_exists($href)) { return; } if ($line) { @@ -72,7 +72,7 @@ private function getComposerRoot(string $file, bool &$inVendor) if ('C' === $class[0] && str_starts_with($class, 'ComposerAutoloaderInit')) { $r = new \ReflectionClass($class); $v = \dirname($r->getFileName(), 2); - if (is_file($v.'/composer/installed.json')) { + if (file_exists($v.'/composer/installed.json')) { self::$vendorRoots[] = $v.\DIRECTORY_SEPARATOR; } } @@ -91,7 +91,7 @@ private function getComposerRoot(string $file, bool &$inVendor) } $parent = $dir; - while (!@is_file($parent.'/composer.json')) { + while (!@file_exists($parent.'/composer.json')) { if (!@file_exists($parent)) { // open_basedir restriction in effect break; diff --git a/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php b/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php index cfef19acc..696cef18e 100644 --- a/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php @@ -16,14 +16,14 @@ /** * @author Jan Schädlich * - * @final + * @final since Symfony 4.4 */ class MemcachedCaster { private static $optionConstants; private static $defaultOptions; - public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $isNested) + public static function castMemcached(\Memcached $c, array $a, Stub $stub, $isNested) { $a += [ Caster::PREFIX_VIRTUAL.'servers' => $c->getServerList(), diff --git a/app/vendor/symfony/var-dumper/Caster/PdoCaster.php b/app/vendor/symfony/var-dumper/Caster/PdoCaster.php index 140473b53..47b0a62b7 100644 --- a/app/vendor/symfony/var-dumper/Caster/PdoCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/PdoCaster.php @@ -18,7 +18,7 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class PdoCaster { @@ -59,7 +59,7 @@ class PdoCaster ], ]; - public static function castPdo(\PDO $c, array $a, Stub $stub, bool $isNested) + public static function castPdo(\PDO $c, array $a, Stub $stub, $isNested) { $attr = []; $errmode = $c->getAttribute(\PDO::ATTR_ERRMODE); @@ -108,7 +108,7 @@ public static function castPdo(\PDO $c, array $a, Stub $stub, bool $isNested) return $a; } - public static function castPdoStatement(\PDOStatement $c, array $a, Stub $stub, bool $isNested) + public static function castPdoStatement(\PDOStatement $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; $a[$prefix.'errorInfo'] = $c->errorInfo(); diff --git a/app/vendor/symfony/var-dumper/Caster/PgSqlCaster.php b/app/vendor/symfony/var-dumper/Caster/PgSqlCaster.php index d8e5b5253..3097c5184 100644 --- a/app/vendor/symfony/var-dumper/Caster/PgSqlCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/PgSqlCaster.php @@ -18,7 +18,7 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class PgSqlCaster { @@ -69,14 +69,14 @@ class PgSqlCaster 'function' => \PGSQL_DIAG_SOURCE_FUNCTION, ]; - public static function castLargeObject($lo, array $a, Stub $stub, bool $isNested) + public static function castLargeObject($lo, array $a, Stub $stub, $isNested) { $a['seek position'] = pg_lo_tell($lo); return $a; } - public static function castLink($link, array $a, Stub $stub, bool $isNested) + public static function castLink($link, array $a, Stub $stub, $isNested) { $a['status'] = pg_connection_status($link); $a['status'] = new ConstStub(\PGSQL_CONNECTION_OK === $a['status'] ? 'PGSQL_CONNECTION_OK' : 'PGSQL_CONNECTION_BAD', $a['status']); @@ -108,7 +108,7 @@ public static function castLink($link, array $a, Stub $stub, bool $isNested) return $a; } - public static function castResult($result, array $a, Stub $stub, bool $isNested) + public static function castResult($result, array $a, Stub $stub, $isNested) { $a['num rows'] = pg_num_rows($result); $a['status'] = pg_result_status($result); diff --git a/app/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php b/app/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php index e7120191f..ec02f8137 100644 --- a/app/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php @@ -17,11 +17,11 @@ /** * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class ProxyManagerCaster { - public static function castProxy(ProxyInterface $c, array $a, Stub $stub, bool $isNested) + public static function castProxy(ProxyInterface $c, array $a, Stub $stub, $isNested) { if ($parent = get_parent_class($c)) { $stub->class .= ' - '.$parent; diff --git a/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php b/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php deleted file mode 100644 index db4bba8d3..000000000 --- a/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php +++ /dev/null @@ -1,186 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use RdKafka\Conf; -use RdKafka\Exception as RdKafkaException; -use RdKafka\KafkaConsumer; -use RdKafka\Message; -use RdKafka\Metadata\Broker as BrokerMetadata; -use RdKafka\Metadata\Collection as CollectionMetadata; -use RdKafka\Metadata\Partition as PartitionMetadata; -use RdKafka\Metadata\Topic as TopicMetadata; -use RdKafka\Topic; -use RdKafka\TopicConf; -use RdKafka\TopicPartition; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts RdKafka related classes to array representation. - * - * @author Romain Neutron - */ -class RdKafkaCaster -{ - public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - try { - $assignment = $c->getAssignment(); - } catch (RdKafkaException $e) { - $assignment = []; - } - - $a += [ - $prefix.'subscription' => $c->getSubscription(), - $prefix.'assignment' => $assignment, - ]; - - $a += self::extractMetadata($c); - - return $a; - } - - public static function castTopic(Topic $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'name' => $c->getName(), - ]; - - return $a; - } - - public static function castTopicPartition(TopicPartition $c, array $a) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'offset' => $c->getOffset(), - $prefix.'partition' => $c->getPartition(), - $prefix.'topic' => $c->getTopic(), - ]; - - return $a; - } - - public static function castMessage(Message $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'errstr' => $c->errstr(), - ]; - - return $a; - } - - public static function castConf(Conf $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - foreach ($c->dump() as $key => $value) { - $a[$prefix.$key] = $value; - } - - return $a; - } - - public static function castTopicConf(TopicConf $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - foreach ($c->dump() as $key => $value) { - $a[$prefix.$key] = $value; - } - - return $a; - } - - public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'out_q_len' => $c->getOutQLen(), - ]; - - $a += self::extractMetadata($c); - - return $a; - } - - public static function castCollectionMetadata(CollectionMetadata $c, array $a, Stub $stub, bool $isNested) - { - $a += iterator_to_array($c); - - return $a; - } - - public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'name' => $c->getTopic(), - $prefix.'partitions' => $c->getPartitions(), - ]; - - return $a; - } - - public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'id' => $c->getId(), - $prefix.'err' => $c->getErr(), - $prefix.'leader' => $c->getLeader(), - ]; - - return $a; - } - - public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'id' => $c->getId(), - $prefix.'host' => $c->getHost(), - $prefix.'port' => $c->getPort(), - ]; - - return $a; - } - - private static function extractMetadata($c) - { - $prefix = Caster::PREFIX_VIRTUAL; - - try { - $m = $c->getMetadata(true, null, 500); - } catch (RdKafkaException $e) { - return []; - } - - return [ - $prefix.'orig_broker_id' => $m->getOrigBrokerId(), - $prefix.'orig_broker_name' => $m->getOrigBrokerName(), - $prefix.'brokers' => $m->getBrokers(), - $prefix.'topics' => $m->getTopics(), - ]; - } -} diff --git a/app/vendor/symfony/var-dumper/Caster/RedisCaster.php b/app/vendor/symfony/var-dumper/Caster/RedisCaster.php index 8f97eaad3..bd877cb3e 100644 --- a/app/vendor/symfony/var-dumper/Caster/RedisCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/RedisCaster.php @@ -18,7 +18,7 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class RedisCaster { @@ -46,7 +46,7 @@ class RedisCaster \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES => 'DISTRIBUTE_SLAVES', ]; - public static function castRedis(\Redis $c, array $a, Stub $stub, bool $isNested) + public static function castRedis(\Redis $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -72,7 +72,7 @@ public static function castRedis(\Redis $c, array $a, Stub $stub, bool $isNested ]; } - public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, bool $isNested) + public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -84,7 +84,7 @@ public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, bool ]; } - public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, bool $isNested) + public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; $failover = $c->getOption(\RedisCluster::OPT_SLAVE_FAILOVER); diff --git a/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php index 1781f469d..819a61876 100644 --- a/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php @@ -18,7 +18,7 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class ReflectionCaster { @@ -35,7 +35,7 @@ class ReflectionCaster 'isVariadic' => 'isVariadic', ]; - public static function castClosure(\Closure $c, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castClosure(\Closure $c, array $a, Stub $stub, $isNested, $filter = 0) { $prefix = Caster::PREFIX_VIRTUAL; $c = new \ReflectionFunction($c); @@ -78,7 +78,7 @@ public static function unsetClosureFileInfo(\Closure $c, array $a) return $a; } - public static function castGenerator(\Generator $c, array $a, Stub $stub, bool $isNested) + public static function castGenerator(\Generator $c, array $a, Stub $stub, $isNested) { // Cannot create ReflectionGenerator based on a terminated Generator try { @@ -92,7 +92,7 @@ public static function castGenerator(\Generator $c, array $a, Stub $stub, bool $ return self::castReflectionGenerator($reflectionGenerator, $a, $stub, $isNested); } - public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $isNested) + public static function castType(\ReflectionType $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -114,17 +114,7 @@ public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $ return $a; } - public static function castAttribute(\ReflectionAttribute $c, array $a, Stub $stub, bool $isNested) - { - self::addMap($a, $c, [ - 'name' => 'getName', - 'arguments' => 'getArguments', - ]); - - return $a; - } - - public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, bool $isNested) + public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -159,7 +149,7 @@ public static function castReflectionGenerator(\ReflectionGenerator $c, array $a return $a; } - public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castClass(\ReflectionClass $c, array $a, Stub $stub, $isNested, $filter = 0) { $prefix = Caster::PREFIX_VIRTUAL; @@ -170,7 +160,7 @@ public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool self::addMap($a, $c, [ 'extends' => 'getParentClass', 'implements' => 'getInterfaceNames', - 'constants' => 'getReflectionConstants', + 'constants' => 'getConstants', ]); foreach ($c->getProperties() as $n) { @@ -181,8 +171,6 @@ public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool $a[$prefix.'methods'][$n->name] = $n; } - self::addAttributes($a, $c, $prefix); - if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) { self::addExtra($a, $c); } @@ -190,7 +178,7 @@ public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool return $a; } - public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, $isNested, $filter = 0) { $prefix = Caster::PREFIX_VIRTUAL; @@ -227,8 +215,6 @@ public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, arra $a[$prefix.'parameters'] = new EnumStub($a[$prefix.'parameters']); } - self::addAttributes($a, $c, $prefix); - if (!($filter & Caster::EXCLUDE_VERBOSE) && $v = $c->getStaticVariables()) { foreach ($v as $k => &$v) { if (\is_object($v)) { @@ -248,24 +234,14 @@ public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, arra return $a; } - public static function castClassConstant(\ReflectionClassConstant $c, array $a, Stub $stub, bool $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); - $a[Caster::PREFIX_VIRTUAL.'value'] = $c->getValue(); - - self::addAttributes($a, $c); - - return $a; - } - - public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, bool $isNested) + public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, $isNested) { $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); return $a; } - public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, bool $isNested) + public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -276,8 +252,6 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st 'allowsNull' => 'allowsNull', ]); - self::addAttributes($a, $c, $prefix); - if ($v = $c->getType()) { $a[$prefix.'typeHint'] = $v instanceof \ReflectionNamedType ? $v->getName() : (string) $v; } @@ -303,24 +277,22 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st return $a; } - public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, bool $isNested) + public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, $isNested) { $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); - - self::addAttributes($a, $c); self::addExtra($a, $c); return $a; } - public static function castReference(\ReflectionReference $c, array $a, Stub $stub, bool $isNested) + public static function castReference(\ReflectionReference $c, array $a, Stub $stub, $isNested) { $a[Caster::PREFIX_VIRTUAL.'id'] = $c->getId(); return $a; } - public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, bool $isNested) + public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, $isNested) { self::addMap($a, $c, [ 'version' => 'getVersion', @@ -336,7 +308,7 @@ public static function castExtension(\ReflectionExtension $c, array $a, Stub $st return $a; } - public static function castZendExtension(\ReflectionZendExtension $c, array $a, Stub $stub, bool $isNested) + public static function castZendExtension(\ReflectionZendExtension $c, array $a, Stub $stub, $isNested) { self::addMap($a, $c, [ 'version' => 'getVersion', @@ -384,6 +356,8 @@ public static function getSignature(array $a) $signature .= 10 > \strlen($v) && !str_contains($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'"; } elseif (\is_bool($v)) { $signature .= $v ? 'true' : 'false'; + } elseif (\is_object($v)) { + $signature .= 'new '.substr(strrchr('\\'.get_debug_type($v), '\\'), 1); } else { $signature .= $v; } @@ -414,7 +388,7 @@ private static function addExtra(array &$a, \Reflector $c) } } - private static function addMap(array &$a, object $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL) + private static function addMap(array &$a, $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL) { foreach ($map as $k => $m) { if (\PHP_VERSION_ID >= 80000 && 'isDisabled' === $k) { @@ -426,13 +400,4 @@ private static function addMap(array &$a, object $c, array $map, string $prefix } } } - - private static function addAttributes(array &$a, \Reflector $c, string $prefix = Caster::PREFIX_VIRTUAL): void - { - if (\PHP_VERSION_ID >= 80000) { - foreach ($c->getAttributes() as $n) { - $a[$prefix.'attributes'][] = $n; - } - } - } } diff --git a/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php b/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php index 6ae908524..a3278a886 100644 --- a/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php @@ -18,7 +18,7 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class ResourceCaster { @@ -27,12 +27,12 @@ class ResourceCaster * * @return array */ - public static function castCurl($h, array $a, Stub $stub, bool $isNested) + public static function castCurl($h, array $a, Stub $stub, $isNested) { return curl_getinfo($h); } - public static function castDba($dba, array $a, Stub $stub, bool $isNested) + public static function castDba($dba, array $a, Stub $stub, $isNested) { $list = dba_list(); $a['file'] = $list[(int) $dba]; @@ -40,12 +40,12 @@ public static function castDba($dba, array $a, Stub $stub, bool $isNested) return $a; } - public static function castProcess($process, array $a, Stub $stub, bool $isNested) + public static function castProcess($process, array $a, Stub $stub, $isNested) { return proc_get_status($process); } - public static function castStream($stream, array $a, Stub $stub, bool $isNested) + public static function castStream($stream, array $a, Stub $stub, $isNested) { $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); if ($a['uri'] ?? false) { @@ -55,12 +55,12 @@ public static function castStream($stream, array $a, Stub $stub, bool $isNested) return $a; } - public static function castStreamContext($stream, array $a, Stub $stub, bool $isNested) + public static function castStreamContext($stream, array $a, Stub $stub, $isNested) { return @stream_context_get_params($stream) ?: $a; } - public static function castGd($gd, array $a, Stub $stub, bool $isNested) + public static function castGd($gd, array $a, Stub $stub, $isNested) { $a['size'] = imagesx($gd).'x'.imagesy($gd); $a['trueColor'] = imageistruecolor($gd); @@ -68,7 +68,7 @@ public static function castGd($gd, array $a, Stub $stub, bool $isNested) return $a; } - public static function castMysqlLink($h, array $a, Stub $stub, bool $isNested) + public static function castMysqlLink($h, array $a, Stub $stub, $isNested) { $a['host'] = mysql_get_host_info($h); $a['protocol'] = mysql_get_proto_info($h); @@ -77,7 +77,7 @@ public static function castMysqlLink($h, array $a, Stub $stub, bool $isNested) return $a; } - public static function castOpensslX509($h, array $a, Stub $stub, bool $isNested) + public static function castOpensslX509($h, array $a, Stub $stub, $isNested) { $stub->cut = -1; $info = openssl_x509_parse($h, false); diff --git a/app/vendor/symfony/var-dumper/Caster/SplCaster.php b/app/vendor/symfony/var-dumper/Caster/SplCaster.php index 07f445116..be9d66bdd 100644 --- a/app/vendor/symfony/var-dumper/Caster/SplCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/SplCaster.php @@ -18,7 +18,7 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class SplCaster { @@ -29,17 +29,17 @@ class SplCaster \SplFileObject::READ_CSV => 'READ_CSV', ]; - public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, bool $isNested) + public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, $isNested) { return self::castSplArray($c, $a, $stub, $isNested); } - public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, bool $isNested) + public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, $isNested) { return self::castSplArray($c, $a, $stub, $isNested); } - public static function castHeap(\Iterator $c, array $a, Stub $stub, bool $isNested) + public static function castHeap(\Iterator $c, array $a, Stub $stub, $isNested) { $a += [ Caster::PREFIX_VIRTUAL.'heap' => iterator_to_array(clone $c), @@ -48,7 +48,7 @@ public static function castHeap(\Iterator $c, array $a, Stub $stub, bool $isNest return $a; } - public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, Stub $stub, bool $isNested) + public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, Stub $stub, $isNested) { $prefix = Caster::PREFIX_VIRTUAL; $mode = $c->getIteratorMode(); @@ -63,7 +63,7 @@ public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, S return $a; } - public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool $isNested) + public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, $isNested) { static $map = [ 'path' => 'getPath', @@ -147,7 +147,7 @@ public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool return $a; } - public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, bool $isNested) + public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, $isNested) { static $map = [ 'csvControl' => 'getCsvControl', @@ -184,7 +184,7 @@ public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, b return $a; } - public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, bool $isNested) + public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, $isNested) { $storage = []; unset($a[Caster::PREFIX_DYNAMIC."\0gcdata"]); // Don't hit https://bugs.php.net/65967 @@ -205,14 +205,14 @@ public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $s return $a; } - public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub, bool $isNested) + public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub, $isNested) { $a[Caster::PREFIX_VIRTUAL.'innerIterator'] = $c->getInnerIterator(); return $a; } - public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, bool $isNested) + public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, $isNested) { $a[Caster::PREFIX_VIRTUAL.'object'] = $c->get(); diff --git a/app/vendor/symfony/var-dumper/Caster/StubCaster.php b/app/vendor/symfony/var-dumper/Caster/StubCaster.php index 32ead7c27..b6332fb74 100644 --- a/app/vendor/symfony/var-dumper/Caster/StubCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/StubCaster.php @@ -18,11 +18,11 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class StubCaster { - public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested) + public static function castStub(Stub $c, array $a, Stub $stub, $isNested) { if ($isNested) { $stub->type = $c->type; @@ -43,12 +43,12 @@ public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested) return $a; } - public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, bool $isNested) + public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, $isNested) { return $isNested ? $c->preservedSubset : $a; } - public static function cutInternals($obj, array $a, Stub $stub, bool $isNested) + public static function cutInternals($obj, array $a, Stub $stub, $isNested) { if ($isNested) { $stub->cut += \count($a); @@ -59,7 +59,7 @@ public static function cutInternals($obj, array $a, Stub $stub, bool $isNested) return $a; } - public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $isNested) + public static function castEnum(EnumStub $c, array $a, Stub $stub, $isNested) { if ($isNested) { $stub->class = $c->dumpKeys ? '' : null; diff --git a/app/vendor/symfony/var-dumper/Caster/SymfonyCaster.php b/app/vendor/symfony/var-dumper/Caster/SymfonyCaster.php index b7e1dd43e..06f213ef0 100644 --- a/app/vendor/symfony/var-dumper/Caster/SymfonyCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/SymfonyCaster.php @@ -15,7 +15,7 @@ use Symfony\Component\VarDumper\Cloner\Stub; /** - * @final + * @final since Symfony 4.4 */ class SymfonyCaster { @@ -28,7 +28,7 @@ class SymfonyCaster 'format' => 'getRequestFormat', ]; - public static function castRequest(Request $request, array $a, Stub $stub, bool $isNested) + public static function castRequest(Request $request, array $a, Stub $stub, $isNested) { $clone = null; @@ -45,7 +45,7 @@ public static function castRequest(Request $request, array $a, Stub $stub, bool return $a; } - public static function castHttpClient($client, array $a, Stub $stub, bool $isNested) + public static function castHttpClient($client, array $a, Stub $stub, $isNested) { $multiKey = sprintf("\0%s\0multi", \get_class($client)); if (isset($a[$multiKey])) { @@ -55,7 +55,7 @@ public static function castHttpClient($client, array $a, Stub $stub, bool $isNes return $a; } - public static function castHttpClientResponse($response, array $a, Stub $stub, bool $isNested) + public static function castHttpClientResponse($response, array $a, Stub $stub, $isNested) { $stub->cut += \count($a); $a = []; diff --git a/app/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php b/app/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php index fa0b55dc7..e7a0f64af 100644 --- a/app/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php @@ -17,7 +17,7 @@ * * @author Baptiste Clavié * - * @final + * @final since Symfony 4.4 */ class XmlReaderCaster { @@ -42,8 +42,24 @@ class XmlReaderCaster \XMLReader::XML_DECLARATION => 'XML_DECLARATION', ]; - public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, bool $isNested) + public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, $isNested) { + try { + $properties = [ + 'LOADDTD' => @$reader->getParserProperty(\XMLReader::LOADDTD), + 'DEFAULTATTRS' => @$reader->getParserProperty(\XMLReader::DEFAULTATTRS), + 'VALIDATE' => @$reader->getParserProperty(\XMLReader::VALIDATE), + 'SUBST_ENTITIES' => @$reader->getParserProperty(\XMLReader::SUBST_ENTITIES), + ]; + } catch (\Error $e) { + $properties = [ + 'LOADDTD' => false, + 'DEFAULTATTRS' => false, + 'VALIDATE' => false, + 'SUBST_ENTITIES' => false, + ]; + } + $props = Caster::PREFIX_VIRTUAL.'parserProperties'; $info = [ 'localName' => $reader->localName, @@ -57,12 +73,7 @@ public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, b 'value' => $reader->value, 'namespaceURI' => $reader->namespaceURI, 'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI, - $props => [ - 'LOADDTD' => $reader->getParserProperty(\XMLReader::LOADDTD), - 'DEFAULTATTRS' => $reader->getParserProperty(\XMLReader::DEFAULTATTRS), - 'VALIDATE' => $reader->getParserProperty(\XMLReader::VALIDATE), - 'SUBST_ENTITIES' => $reader->getParserProperty(\XMLReader::SUBST_ENTITIES), - ], + $props => $properties, ]; if ($info[$props] = Caster::filter($info[$props], Caster::EXCLUDE_EMPTY, [], $count)) { diff --git a/app/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php b/app/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php index ba55fcedd..455fc065b 100644 --- a/app/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php @@ -18,7 +18,7 @@ * * @author Nicolas Grekas * - * @final + * @final since Symfony 4.4 */ class XmlResourceCaster { @@ -47,7 +47,7 @@ class XmlResourceCaster \XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING', ]; - public static function castXml($h, array $a, Stub $stub, bool $isNested) + public static function castXml($h, array $a, Stub $stub, $isNested) { $a['current_byte_index'] = xml_get_current_byte_index($h); $a['current_column_number'] = xml_get_current_column_number($h); diff --git a/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php index ac55da551..eeac88295 100644 --- a/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +++ b/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php @@ -32,10 +32,8 @@ abstract class AbstractCloner implements ClonerInterface 'Closure' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClosure'], 'Generator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castGenerator'], 'ReflectionType' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castType'], - 'ReflectionAttribute' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castAttribute'], 'ReflectionGenerator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castReflectionGenerator'], 'ReflectionClass' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClass'], - 'ReflectionClassConstant' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClassConstant'], 'ReflectionFunctionAbstract' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castFunctionAbstract'], 'ReflectionMethod' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castMethod'], 'ReflectionParameter' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castParameter'], @@ -78,7 +76,6 @@ abstract class AbstractCloner implements ClonerInterface 'ErrorException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castErrorException'], 'Exception' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castException'], 'Error' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castError'], - 'Symfony\Bridge\Monolog\Logger' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], 'Symfony\Component\DependencyInjection\ContainerInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], 'Symfony\Component\EventDispatcher\EventDispatcherInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], 'Symfony\Component\HttpClient\CurlHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], @@ -172,18 +169,6 @@ abstract class AbstractCloner implements ClonerInterface 'XmlParser' => ['Symfony\Component\VarDumper\Caster\XmlResourceCaster', 'castXml'], ':xml' => ['Symfony\Component\VarDumper\Caster\XmlResourceCaster', 'castXml'], - - 'RdKafka' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castRdKafka'], - 'RdKafka\Conf' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castConf'], - 'RdKafka\KafkaConsumer' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castKafkaConsumer'], - 'RdKafka\Metadata\Broker' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castBrokerMetadata'], - 'RdKafka\Metadata\Collection' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castCollectionMetadata'], - 'RdKafka\Metadata\Partition' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castPartitionMetadata'], - 'RdKafka\Metadata\Topic' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopicMetadata'], - 'RdKafka\Message' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castMessage'], - 'RdKafka\Topic' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopic'], - 'RdKafka\TopicPartition' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopicPartition'], - 'RdKafka\TopicConf' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopicConf'], ]; protected $maxItems = 2500; @@ -227,27 +212,33 @@ public function addCasters(array $casters) /** * Sets the maximum number of items to clone past the minimum depth in nested structures. + * + * @param int $maxItems */ - public function setMaxItems(int $maxItems) + public function setMaxItems($maxItems) { - $this->maxItems = $maxItems; + $this->maxItems = (int) $maxItems; } /** * Sets the maximum cloned length for strings. + * + * @param int $maxString */ - public function setMaxString(int $maxString) + public function setMaxString($maxString) { - $this->maxString = $maxString; + $this->maxString = (int) $maxString; } /** * Sets the minimum tree depth where we are guaranteed to clone all the items. After this * depth is reached, only setMaxItems items will be cloned. + * + * @param int $minDepth */ - public function setMinDepth(int $minDepth) + public function setMinDepth($minDepth) { - $this->minDepth = $minDepth; + $this->minDepth = (int) $minDepth; } /** @@ -258,7 +249,7 @@ public function setMinDepth(int $minDepth) * * @return Data The cloned variable represented by a Data object */ - public function cloneVar($var, int $filter = 0) + public function cloneVar($var, $filter = 0) { $this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) { if (\E_RECOVERABLE_ERROR === $type || \E_USER_ERROR === $type) { @@ -304,7 +295,7 @@ abstract protected function doClone($var); * * @return array The object casted as array */ - protected function castObject(Stub $stub, bool $isNested) + protected function castObject(Stub $stub, $isNested) { $obj = $stub->value; $class = $stub->class; @@ -363,7 +354,7 @@ protected function castObject(Stub $stub, bool $isNested) * * @return array The resource casted as array */ - protected function castResource(Stub $stub, bool $isNested) + protected function castResource(Stub $stub, $isNested) { $a = []; $res = $stub->value; diff --git a/app/vendor/symfony/var-dumper/Cloner/Data.php b/app/vendor/symfony/var-dumper/Cloner/Data.php index b17dc55e2..8f621b12a 100644 --- a/app/vendor/symfony/var-dumper/Cloner/Data.php +++ b/app/vendor/symfony/var-dumper/Cloner/Data.php @@ -124,13 +124,13 @@ public function count() public function getIterator() { if (!\is_array($value = $this->getValue())) { - throw new \LogicException(sprintf('"%s" object holds non-iterable type "%s".', self::class, get_debug_type($value))); + throw new \LogicException(sprintf('"%s" object holds non-iterable type "%s".', self::class, \gettype($value))); } yield from $value; } - public function __get(string $key) + public function __get($key) { if (null !== $data = $this->seek($key)) { $item = $this->getStub($data->data[$data->position][$data->key]); @@ -144,7 +144,7 @@ public function __get(string $key) /** * @return bool */ - public function __isset(string $key) + public function __isset($key) { return null !== $this->seek($key); } @@ -202,9 +202,11 @@ public function __toString() /** * Returns a depth limited clone of $this. * + * @param int $maxDepth The max dumped depth level + * * @return static */ - public function withMaxDepth(int $maxDepth) + public function withMaxDepth($maxDepth) { $data = clone $this; $data->maxDepth = (int) $maxDepth; @@ -215,9 +217,11 @@ public function withMaxDepth(int $maxDepth) /** * Limits the number of elements per depth level. * + * @param int $maxItemsPerDepth The max number of items dumped per depth level + * * @return static */ - public function withMaxItemsPerDepth(int $maxItemsPerDepth) + public function withMaxItemsPerDepth($maxItemsPerDepth) { $data = clone $this; $data->maxItemsPerDepth = (int) $maxItemsPerDepth; @@ -232,7 +236,7 @@ public function withMaxItemsPerDepth(int $maxItemsPerDepth) * * @return static */ - public function withRefHandles(bool $useRefHandles) + public function withRefHandles($useRefHandles) { $data = clone $this; $data->useRefHandles = $useRefHandles ? -1 : 0; diff --git a/app/vendor/symfony/var-dumper/Cloner/DumperInterface.php b/app/vendor/symfony/var-dumper/Cloner/DumperInterface.php index 6d60b723c..ec8ef2727 100644 --- a/app/vendor/symfony/var-dumper/Cloner/DumperInterface.php +++ b/app/vendor/symfony/var-dumper/Cloner/DumperInterface.php @@ -24,7 +24,7 @@ interface DumperInterface * @param string $type The PHP type of the value being dumped * @param string|int|float|bool $value The scalar value being dumped */ - public function dumpScalar(Cursor $cursor, string $type, $value); + public function dumpScalar(Cursor $cursor, $type, $value); /** * Dumps a string. @@ -33,7 +33,7 @@ public function dumpScalar(Cursor $cursor, string $type, $value); * @param bool $bin Whether $str is UTF-8 or binary encoded * @param int $cut The number of characters $str has been cut by */ - public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut); + public function dumpString(Cursor $cursor, $str, $bin, $cut); /** * Dumps while entering an hash. @@ -42,7 +42,7 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut); * @param string|int $class The object class, resource type or array count * @param bool $hasChild When the dump of the hash has child item */ - public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild); + public function enterHash(Cursor $cursor, $type, $class, $hasChild); /** * Dumps while leaving an hash. @@ -52,5 +52,5 @@ public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild); * @param bool $hasChild When the dump of the hash has child item * @param int $cut The number of items the hash has been cut by */ - public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut); + public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut); } diff --git a/app/vendor/symfony/var-dumper/Cloner/VarCloner.php b/app/vendor/symfony/var-dumper/Cloner/VarCloner.php index ad92ac341..cd6e7dcab 100644 --- a/app/vendor/symfony/var-dumper/Cloner/VarCloner.php +++ b/app/vendor/symfony/var-dumper/Cloner/VarCloner.php @@ -28,6 +28,7 @@ protected function doClone($var) $pos = 0; // Number of cloned items past the minimum depth $refsCounter = 0; // Hard references counter $queue = [[$var]]; // This breadth-first queue is the return value + $indexedArrays = []; // Map of queue indexes that hold numerically indexed arrays $hardRefs = []; // Map of original zval ids to stub objects $objRefs = []; // Map of original object handles to their stub object counterpart $objects = []; // Keep a ref to objects to ensure their handle cannot be reused while cloning @@ -62,6 +63,21 @@ protected function doClone($var) } $refs = $vals = $queue[$i]; + if (\PHP_VERSION_ID < 70200 && empty($indexedArrays[$i])) { + // see https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts + foreach ($vals as $k => $v) { + if (\is_int($k)) { + continue; + } + foreach ([$k => true] as $gk => $gv) { + } + if ($gk !== $k) { + $fromObjCast = true; + $refs = $vals = array_values($queue[$i]); + break; + } + } + } foreach ($vals as $k => $v) { // $v is the original value or a stub object in case of hard references @@ -177,10 +193,13 @@ protected function doClone($var) } else { $a = $v; } + } elseif (\PHP_VERSION_ID < 70200) { + $indexedArrays[$len] = true; } break; case \is_object($v): + case $v instanceof \__PHP_Incomplete_Class: if (empty($objRefs[$h = spl_object_id($v)])) { $stub = new Stub(); $stub->type = Stub::TYPE_OBJECT; diff --git a/app/vendor/symfony/var-dumper/Command/ServerDumpCommand.php b/app/vendor/symfony/var-dumper/Command/ServerDumpCommand.php index ead9d5bd0..b66301b52 100644 --- a/app/vendor/symfony/var-dumper/Command/ServerDumpCommand.php +++ b/app/vendor/symfony/var-dumper/Command/ServerDumpCommand.php @@ -35,7 +35,6 @@ class ServerDumpCommand extends Command { protected static $defaultName = 'server:dump'; - protected static $defaultDescription = 'Start a dump server that collects and displays dumps in a single place'; private $server; @@ -59,7 +58,7 @@ protected function configure() $this ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', $availableFormats), 'cli') - ->setDescription(self::$defaultDescription) + ->setDescription('Start a dump server that collects and displays dumps in a single place') ->setHelp(<<<'EOF' %command.name% starts a dump server that collects and displays dumps in a single place for debugging you application: diff --git a/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php index 6064ea99f..4ddaf5e74 100644 --- a/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php @@ -82,9 +82,11 @@ public function setOutput($output) /** * Sets the default character encoding to use for non-UTF8 strings. * + * @param string $charset The default character encoding to use for non-UTF8 strings + * * @return string The previous charset */ - public function setCharset(string $charset) + public function setCharset($charset) { $prev = $this->charset; @@ -103,7 +105,7 @@ public function setCharset(string $charset) * * @return string The previous indent pad */ - public function setIndentPad(string $pad) + public function setIndentPad($pad) { $prev = $this->indentPad; $this->indentPad = $pad; @@ -161,7 +163,7 @@ public function dump(Data $data, $output = null) * @param int $depth The recursive depth in the dumped structure for the line being dumped, * or -1 to signal the end-of-dump to the line dumper callable */ - protected function dumpLine(int $depth) + protected function dumpLine($depth) { ($this->lineDumper)($this->line, $depth, $this->indentPad); $this->line = ''; @@ -169,8 +171,12 @@ protected function dumpLine(int $depth) /** * Generic line dumper callback. + * + * @param string $line The line to write + * @param int $depth The recursive depth in the dumped structure + * @param string $indentPad The line indent pad */ - protected function echoLine(string $line, int $depth, string $indentPad) + protected function echoLine($line, $depth, $indentPad) { if (-1 !== $depth) { fwrite($this->outputStream, str_repeat($indentPad, $depth).$line."\n"); @@ -180,9 +186,11 @@ protected function echoLine(string $line, int $depth, string $indentPad) /** * Converts a non-UTF-8 string to UTF-8. * + * @param string|null $s The non-UTF-8 string to convert + * * @return string|null The string converted to UTF-8 */ - protected function utf8Encode(?string $s) + protected function utf8Encode($s) { if (null === $s || preg_match('//u', $s)) { return $s; diff --git a/app/vendor/symfony/var-dumper/Dumper/CliDumper.php b/app/vendor/symfony/var-dumper/Dumper/CliDumper.php index c1539ee05..b3d9e2561 100644 --- a/app/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/CliDumper.php @@ -88,18 +88,22 @@ public function __construct($output = null, string $charset = null, int $flags = /** * Enables/disables colored output. + * + * @param bool $colors */ - public function setColors(bool $colors) + public function setColors($colors) { - $this->colors = $colors; + $this->colors = (bool) $colors; } /** * Sets the maximum number of characters per line for dumped strings. + * + * @param int $maxStringWidth */ - public function setMaxStringWidth(int $maxStringWidth) + public function setMaxStringWidth($maxStringWidth) { - $this->maxStringWidth = $maxStringWidth; + $this->maxStringWidth = (int) $maxStringWidth; } /** @@ -125,7 +129,7 @@ public function setDisplayOptions(array $displayOptions) /** * {@inheritdoc} */ - public function dumpScalar(Cursor $cursor, string $type, $value) + public function dumpScalar(Cursor $cursor, $type, $value) { $this->dumpKey($cursor); @@ -179,7 +183,7 @@ public function dumpScalar(Cursor $cursor, string $type, $value) /** * {@inheritdoc} */ - public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) + public function dumpString(Cursor $cursor, $str, $bin, $cut) { $this->dumpKey($cursor); $attr = $cursor->attr; @@ -195,7 +199,7 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) 'length' => 0 <= $cut ? mb_strlen($str, 'UTF-8') + $cut : 0, 'binary' => $bin, ]; - $str = $bin && false !== strpos($str, "\0") ? [$str] : explode("\n", $str); + $str = explode("\n", $str); if (isset($str[1]) && !isset($str[2]) && !isset($str[1][0])) { unset($str[1]); $str[0] .= "\n"; @@ -267,7 +271,7 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) /** * {@inheritdoc} */ - public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild) + public function enterHash(Cursor $cursor, $type, $class, $hasChild) { if (null === $this->colors) { $this->colors = $this->supportsColors(); @@ -308,7 +312,7 @@ public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild) /** * {@inheritdoc} */ - public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut) + public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut) { if (empty($cursor->attr['cut_hash'])) { $this->dumpEllipsis($cursor, $hasChild, $cut); @@ -324,7 +328,7 @@ public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int * @param bool $hasChild When the dump of the hash has child item * @param int $cut The number of items the hash has been cut by */ - protected function dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut) + protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut) { if ($cut) { $this->line .= ' …'; @@ -428,7 +432,7 @@ protected function dumpKey(Cursor $cursor) * * @return string The value with style decoration */ - protected function style(string $style, string $value, array $attr = []) + protected function style($style, $value, $attr = []) { if (null === $this->colors) { $this->colors = $this->supportsColors(); @@ -523,14 +527,12 @@ protected function supportsColors() case '--color=yes': case '--color=force': case '--color=always': - case '--colors=always': return static::$defaultColors = true; case '--no-ansi': case '--color=no': case '--color=none': case '--color=never': - case '--colors=never': return static::$defaultColors = false; } } @@ -546,7 +548,7 @@ protected function supportsColors() /** * {@inheritdoc} */ - protected function dumpLine(int $depth, bool $endOfValue = false) + protected function dumpLine($depth, $endOfValue = false) { if ($this->colors) { $this->line = sprintf("\033[%sm%s\033[m", $this->styles['default'], $this->line); @@ -602,7 +604,17 @@ private function hasColorSupport($stream): bool || 'xterm' === getenv('TERM'); } - return stream_isatty($stream); + if (\function_exists('stream_isatty')) { + return @stream_isatty($stream); + } + + if (\function_exists('posix_isatty')) { + return @posix_isatty($stream); + } + + $stat = @fstat($stream); + // Check if formatted mode is S_IFCHR + return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; } /** @@ -619,7 +631,7 @@ private function isWindowsTrueColor(): bool || 'xterm' === getenv('TERM') || 'Hyper' === getenv('TERM_PROGRAM'); - if (!$result) { + if (!$result && \PHP_VERSION_ID >= 70200) { $version = sprintf( '%s.%s.%s', PHP_WINDOWS_VERSION_MAJOR, diff --git a/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php index 6c3abaa2b..8409a0c74 100644 --- a/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php @@ -116,16 +116,21 @@ public function setDisplayOptions(array $displayOptions) /** * Sets an HTML header that will be dumped once in the output stream. + * + * @param string $header An HTML string */ - public function setDumpHeader(?string $header) + public function setDumpHeader($header) { $this->dumpHeader = $header; } /** * Sets an HTML prefix and suffix that will encapse every single dump. + * + * @param string $prefix The prepended HTML string + * @param string $suffix The appended HTML string */ - public function setDumpBoundaries(string $prefix, string $suffix) + public function setDumpBoundaries($prefix, $suffix) { $this->dumpPrefix = $prefix; $this->dumpSuffix = $suffix; @@ -166,9 +171,6 @@ protected function getDumpHeader() e.addEventListener(n, cb, false); }; -refStyle.innerHTML = 'pre.sf-dump .sf-dump-compact, .sf-dump-str-collapse .sf-dump-str-collapse, .sf-dump-str-expand .sf-dump-str-expand { display: none; }'; -(doc.documentElement.firstElementChild || doc.documentElement.children[0]).appendChild(refStyle); -refStyle = doc.createElement('style'); (doc.documentElement.firstElementChild || doc.documentElement.children[0]).appendChild(refStyle); if (!doc.addEventListener) { @@ -422,13 +424,19 @@ function xpathHasClass(className) { a.innerHTML += ' '; } a.title = (a.title ? a.title+'\n[' : '[')+keyHint+'+click] Expand all children'; - a.innerHTML += elt.className == 'sf-dump-compact' ? '' : ''; + a.innerHTML += ''; a.className += ' sf-dump-toggle'; x = 1; if ('sf-dump' != elt.parentNode.className) { x += elt.parentNode.getAttribute('data-depth')/1; } + elt.setAttribute('data-depth', x); + var className = elt.className; + elt.className = 'sf-dump-expanded'; + if (className ? 'sf-dump-expanded' !== className : (x > options.maxDepth)) { + toggle(a); + } } else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) { a = a.substr(1); elt.className += ' '+a; @@ -663,6 +671,9 @@ function showCurrent(state) pre.sf-dump span { display: inline; } +pre.sf-dump .sf-dump-compact { + display: none; +} pre.sf-dump a { text-decoration: none; cursor: pointer; @@ -694,6 +705,12 @@ function showCurrent(state) padding:0; background:none; } +.sf-dump-str-collapse .sf-dump-str-collapse { + display: none; +} +.sf-dump-str-expand .sf-dump-str-expand { + display: none; +} .sf-dump-public.sf-dump-highlight, .sf-dump-protected.sf-dump-highlight, .sf-dump-private.sf-dump-highlight, @@ -785,12 +802,11 @@ function showCurrent(state) /** * {@inheritdoc} */ - public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) + public function dumpString(Cursor $cursor, $str, $bin, $cut) { if ('' === $str && isset($cursor->attr['img-data'], $cursor->attr['content-type'])) { $this->dumpKey($cursor); - $this->line .= $this->style('default', $cursor->attr['img-size'] ?? '', []); - $this->line .= $cursor->depth >= $this->displayOptions['maxDepth'] ? ' ' : ' '; + $this->line .= $this->style('default', $cursor->attr['img-size'] ?? '', []).' '; $this->endValue($cursor); $this->line .= $this->indentPad; $this->line .= sprintf('', $cursor->attr['content-type'], base64_encode($cursor->attr['img-data'])); @@ -803,23 +819,25 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) /** * {@inheritdoc} */ - public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild) + public function enterHash(Cursor $cursor, $type, $class, $hasChild) { if (Cursor::HASH_OBJECT === $type) { $cursor->attr['depth'] = $cursor->depth; } parent::enterHash($cursor, $type, $class, false); - if ($cursor->skipChildren || $cursor->depth >= $this->displayOptions['maxDepth']) { + if ($cursor->skipChildren) { $cursor->skipChildren = false; $eol = ' class=sf-dump-compact>'; - } else { + } elseif ($this->expandNextHash) { $this->expandNextHash = false; $eol = ' class=sf-dump-expanded>'; + } else { + $eol = '>'; } if ($hasChild) { - $this->line .= 'refIndex) { $r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2; $r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex; @@ -834,7 +852,7 @@ public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild) /** * {@inheritdoc} */ - public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut) + public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut) { $this->dumpEllipsis($cursor, $hasChild, $cut); if ($hasChild) { @@ -846,7 +864,7 @@ public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int /** * {@inheritdoc} */ - protected function style(string $style, string $value, array $attr = []) + protected function style($style, $value, $attr = []) { if ('' === $value) { return ''; @@ -941,7 +959,7 @@ protected function style(string $style, string $value, array $attr = []) /** * {@inheritdoc} */ - protected function dumpLine(int $depth, bool $endOfValue = false) + protected function dumpLine($depth, $endOfValue = false) { if (-1 === $this->lastDepth) { $this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line; diff --git a/app/vendor/symfony/var-dumper/README.md b/app/vendor/symfony/var-dumper/README.md index bdac24477..a0da8c9ab 100644 --- a/app/vendor/symfony/var-dumper/README.md +++ b/app/vendor/symfony/var-dumper/README.md @@ -3,7 +3,7 @@ VarDumper Component The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better `dump()` function that you can use instead -of `var_dump`. +of `var_dump()`. Resources --------- diff --git a/app/vendor/symfony/var-dumper/Server/DumpServer.php b/app/vendor/symfony/var-dumper/Server/DumpServer.php index 7cb5bf0c4..1c2c34812 100644 --- a/app/vendor/symfony/var-dumper/Server/DumpServer.php +++ b/app/vendor/symfony/var-dumper/Server/DumpServer.php @@ -52,10 +52,6 @@ public function listen(callable $callback): void } foreach ($this->getMessages() as $clientId => $message) { - if ($this->logger) { - $this->logger->info('Received a payload from client {clientId}', ['clientId' => $clientId]); - } - $payload = @unserialize(base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]); // Impossible to decode the message, give up. diff --git a/app/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php b/app/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php index 33d60c020..3d3d18eeb 100644 --- a/app/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php +++ b/app/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php @@ -42,17 +42,20 @@ protected function tearDownVarDumper(): void $this->varDumperConfig['flags'] = null; } - public function assertDumpEquals($expected, $data, int $filter = 0, string $message = '') + public function assertDumpEquals($expected, $data, $filter = 0, $message = '') { $this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); } - public function assertDumpMatchesFormat($expected, $data, int $filter = 0, string $message = '') + public function assertDumpMatchesFormat($expected, $data, $filter = 0, $message = '') { $this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); } - protected function getDump($data, $key = null, int $filter = 0): ?string + /** + * @return string|null + */ + protected function getDump($data, $key = null, $filter = 0) { if (null === $flags = $this->varDumperConfig['flags']) { $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; diff --git a/app/vendor/symfony/var-dumper/VarDumper.php b/app/vendor/symfony/var-dumper/VarDumper.php index b223e0651..febc1e0d1 100644 --- a/app/vendor/symfony/var-dumper/VarDumper.php +++ b/app/vendor/symfony/var-dumper/VarDumper.php @@ -11,18 +11,12 @@ namespace Symfony\Component\VarDumper; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; use Symfony\Component\VarDumper\Caster\ReflectionCaster; use Symfony\Component\VarDumper\Cloner\VarCloner; use Symfony\Component\VarDumper\Dumper\CliDumper; -use Symfony\Component\VarDumper\Dumper\ContextProvider\CliContextProvider; -use Symfony\Component\VarDumper\Dumper\ContextProvider\RequestContextProvider; use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider; use Symfony\Component\VarDumper\Dumper\ContextualizedDumper; use Symfony\Component\VarDumper\Dumper\HtmlDumper; -use Symfony\Component\VarDumper\Dumper\ServerDumper; // Load the global dump() function require_once __DIR__.'/Resources/functions/dump.php'; @@ -37,7 +31,20 @@ class VarDumper public static function dump($var) { if (null === self::$handler) { - self::register(); + $cloner = new VarCloner(); + $cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); + + if (isset($_SERVER['VAR_DUMPER_FORMAT'])) { + $dumper = 'html' === $_SERVER['VAR_DUMPER_FORMAT'] ? new HtmlDumper() : new CliDumper(); + } else { + $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper() : new HtmlDumper(); + } + + $dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]); + + self::$handler = function ($var) use ($cloner, $dumper) { + $dumper->dump($cloner->cloneVar($var)); + }; } return (self::$handler)($var); @@ -56,54 +63,4 @@ public static function setHandler(callable $callable = null) return $prevHandler; } - - private static function register(): void - { - $cloner = new VarCloner(); - $cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); - - $format = $_SERVER['VAR_DUMPER_FORMAT'] ?? null; - switch (true) { - case 'html' === $format: - $dumper = new HtmlDumper(); - break; - case 'cli' === $format: - $dumper = new CliDumper(); - break; - case 'server' === $format: - case $format && 'tcp' === parse_url($format, \PHP_URL_SCHEME): - $host = 'server' === $format ? $_SERVER['VAR_DUMPER_SERVER'] ?? '127.0.0.1:9912' : $format; - $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper(); - $dumper = new ServerDumper($host, $dumper, self::getDefaultContextProviders()); - break; - default: - $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper(); - } - - if (!$dumper instanceof ServerDumper) { - $dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]); - } - - self::$handler = function ($var) use ($cloner, $dumper) { - $dumper->dump($cloner->cloneVar($var)); - }; - } - - private static function getDefaultContextProviders(): array - { - $contextProviders = []; - - if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && (class_exists(Request::class))) { - $requestStack = new RequestStack(); - $requestStack->push(Request::createFromGlobals()); - $contextProviders['request'] = new RequestContextProvider($requestStack); - } - - $fileLinkFormatter = class_exists(FileLinkFormatter::class) ? new FileLinkFormatter(null, $requestStack ?? null) : null; - - return $contextProviders + [ - 'cli' => new CliContextProvider(), - 'source' => new SourceContextProvider(null, null, $fileLinkFormatter), - ]; - } } diff --git a/app/vendor/symfony/var-dumper/composer.json b/app/vendor/symfony/var-dumper/composer.json index 2d4889d00..d4e64cc9f 100644 --- a/app/vendor/symfony/var-dumper/composer.json +++ b/app/vendor/symfony/var-dumper/composer.json @@ -16,19 +16,20 @@ } ], "require": { - "php": ">=7.2.5", + "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5", "symfony/polyfill-php80": "^1.16" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^4.4|^5.0", + "symfony/console": "^3.4|^4.0|^5.0", "symfony/process": "^4.4|^5.0", - "twig/twig": "^2.13|^3.0.4" + "twig/twig": "^1.43|^2.13|^3.0.4" }, "conflict": { - "phpunit/phpunit": "<5.4.3", - "symfony/console": "<4.4" + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",