diff --git a/composer.json b/composer.json index 8437cb31..875d4bd8 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ ], "config": { "platform": { - "php": "7.4" + "php": "8.0" } }, "require": { @@ -16,7 +16,6 @@ "sergeytsalkov/meekrodb": "^2.3", "league/plates": "^3.3", "guzzlehttp/guzzle": "^6.3", - "scssphp/scssphp": "^1.0", "monolog/monolog": "^1.23", "firephp/firephp-core": "^0.4.0", "vlucas/valitron": "^1.4", @@ -51,5 +50,5 @@ "f_config/config.php" ] } - + } diff --git a/composer.lock b/composer.lock index 265d7589..1679a960 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "317938cff7b30806f4e385a70f4943fc", + "content-hash": "94cfbcb22b9f475e421ad5009391006f", "packages": [ { "name": "brandonwamboldt/utilphp", @@ -122,16 +122,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": { @@ -183,7 +183,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": [ { @@ -199,7 +199,7 @@ "type": "tidelift" } ], - "time": "2021-05-24T12:41:47+00:00" + "time": "2021-10-25T11:34:17+00:00" }, { "name": "composer/xdebug-handler", @@ -267,34 +267,30 @@ }, { "name": "doctrine/inflector", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210" + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/9cf661f4eb38f7c881cac67c75ea9b00bf97b210", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^7.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "doctrine/coding-standard": "^8.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^4.10" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" @@ -342,7 +338,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.x" + "source": "https://github.com/doctrine/inflector/tree/2.0.4" }, "funding": [ { @@ -358,7 +354,7 @@ "type": "tidelift" } ], - "time": "2020-05-29T15:13:26+00:00" + "time": "2021-10-22T20:16:43+00:00" }, { "name": "erusev/parsedown", @@ -674,16 +670,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.4.1", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "" }, "require": { @@ -695,7 +691,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -711,10 +707,25 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", @@ -723,22 +734,36 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.1" + "source": "https://github.com/guzzle/promises/tree/1.5.1" }, - "time": "2021-03-07T09:25:29+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.8.2", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91" + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", "shasum": "" }, "require": { @@ -775,13 +800,34 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], @@ -798,22 +844,36 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.2" + "source": "https://github.com/guzzle/psr7/tree/1.8.3" }, - "time": "2021-04-26T09:17:50+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-05T13:56:00+00:00" }, { "name": "illuminate/bus", - "version": "v8.61.0", + "version": "v8.69.0", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "808097c0dfd893309bd77b00139586c516b965c9" + "reference": "be400399687b97d5558a224e970060fd5d5f2735" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/808097c0dfd893309bd77b00139586c516b965c9", - "reference": "808097c0dfd893309bd77b00139586c516b965c9", + "url": "https://api.github.com/repos/illuminate/bus/zipball/be400399687b97d5558a224e970060fd5d5f2735", + "reference": "be400399687b97d5558a224e970060fd5d5f2735", "shasum": "" }, "require": { @@ -853,20 +913,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-08-10T16:49:48+00:00" + "time": "2021-10-21T19:19:36+00:00" }, { "name": "illuminate/collections", - "version": "v8.61.0", + "version": "v8.69.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "18fa841df912ec56849351dd6ca8928e8a98b69d" + "reference": "05f286ec5fd2dd286e8384577047efc375c8954c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/18fa841df912ec56849351dd6ca8928e8a98b69d", - "reference": "18fa841df912ec56849351dd6ca8928e8a98b69d", + "url": "https://api.github.com/repos/illuminate/collections/zipball/05f286ec5fd2dd286e8384577047efc375c8954c", + "reference": "05f286ec5fd2dd286e8384577047efc375c8954c", "shasum": "" }, "require": { @@ -907,20 +967,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-09-08T12:48:16+00:00" + "time": "2021-10-22T18:01:46+00:00" }, { "name": "illuminate/container", - "version": "v8.61.0", + "version": "v8.69.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "862b64ea4ab56e307a1676104a1b93295d347ad0" + "reference": "ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/862b64ea4ab56e307a1676104a1b93295d347ad0", - "reference": "862b64ea4ab56e307a1676104a1b93295d347ad0", + "url": "https://api.github.com/repos/illuminate/container/zipball/ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d", + "reference": "ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d", "shasum": "" }, "require": { @@ -958,20 +1018,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-09-09T13:55:23+00:00" + "time": "2021-09-15T14:32:50+00:00" }, { "name": "illuminate/contracts", - "version": "v8.61.0", + "version": "v8.69.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "ab4bb4ec3b36905ccf972c84f9aaa2bdd1153913" + "reference": "e76f4bce73a2a1656add24bd5210ebc4b8af49c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/ab4bb4ec3b36905ccf972c84f9aaa2bdd1153913", - "reference": "ab4bb4ec3b36905ccf972c84f9aaa2bdd1153913", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/e76f4bce73a2a1656add24bd5210ebc4b8af49c0", + "reference": "e76f4bce73a2a1656add24bd5210ebc4b8af49c0", "shasum": "" }, "require": { @@ -1006,20 +1066,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-09-08T12:09:40+00:00" + "time": "2021-10-22T18:01:46+00:00" }, { "name": "illuminate/database", - "version": "v8.61.0", + "version": "v8.69.0", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "acc11d6839ddb3b694bc6585177fa5141b70c693" + "reference": "43c7ffb6299ae55b000b286cf1278afd268ef29f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/acc11d6839ddb3b694bc6585177fa5141b70c693", - "reference": "acc11d6839ddb3b694bc6585177fa5141b70c693", + "url": "https://api.github.com/repos/illuminate/database/zipball/43c7ffb6299ae55b000b286cf1278afd268ef29f", + "reference": "43c7ffb6299ae55b000b286cf1278afd268ef29f", "shasum": "" }, "require": { @@ -1033,7 +1093,7 @@ "symfony/console": "^5.1.4" }, "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.2).", "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", "illuminate/console": "Required to use the database commands (^8.0).", "illuminate/events": "Required to use the observers with Eloquent (^8.0).", @@ -1074,20 +1134,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-09-13T18:43:43+00:00" + "time": "2021-10-29T19:46:53+00:00" }, { "name": "illuminate/events", - "version": "v8.61.0", + "version": "v8.69.0", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", - "reference": "7def78033f29cd0c0383513b27c291d233a7f90e" + "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/events/zipball/7def78033f29cd0c0383513b27c291d233a7f90e", - "reference": "7def78033f29cd0c0383513b27c291d233a7f90e", + "url": "https://api.github.com/repos/illuminate/events/zipball/b7f06cafb6c09581617f2ca05d69e9b159e5a35d", + "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d", "shasum": "" }, "require": { @@ -1129,11 +1189,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-08-16T21:45:47+00:00" + "time": "2021-09-15T14:32:50+00:00" }, { "name": "illuminate/macroable", - "version": "v8.61.0", + "version": "v8.69.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -1179,7 +1239,7 @@ }, { "name": "illuminate/pipeline", - "version": "v8.61.0", + "version": "v8.69.0", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -1227,16 +1287,16 @@ }, { "name": "illuminate/support", - "version": "v8.61.0", + "version": "v8.69.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "b0a21c41163381dd9a5abbd68fe85ed7b4247d30" + "reference": "a8851b7001530d3c11626a81449ed9b63dd10db7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/b0a21c41163381dd9a5abbd68fe85ed7b4247d30", - "reference": "b0a21c41163381dd9a5abbd68fe85ed7b4247d30", + "url": "https://api.github.com/repos/illuminate/support/zipball/a8851b7001530d3c11626a81449ed9b63dd10db7", + "reference": "a8851b7001530d3c11626a81449ed9b63dd10db7", "shasum": "" }, "require": { @@ -1246,7 +1306,7 @@ "illuminate/collections": "^8.0", "illuminate/contracts": "^8.0", "illuminate/macroable": "^8.0", - "nesbot/carbon": "^2.31", + "nesbot/carbon": "^2.53.1", "php": "^7.3|^8.0", "voku/portable-ascii": "^1.4.8" }, @@ -1255,8 +1315,8 @@ }, "suggest": { "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0).", - "ramsey/uuid": "Required to use Str::uuid() (^4.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", + "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", "symfony/process": "Required to use the composer class (^5.1.4).", "symfony/var-dumper": "Required to use the dd function (^5.1.4).", "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." @@ -1291,7 +1351,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-09-13T18:43:43+00:00" + "time": "2021-10-29T13:34:03+00:00" }, { "name": "league/plates", @@ -1490,16 +1550,16 @@ }, { "name": "nesbot/carbon", - "version": "2.53.1", + "version": "2.54.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "f4655858a784988f880c1b8c7feabbf02dfdf045" + "reference": "eed83939f1aed3eee517d03a33f5ec587ac529b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/f4655858a784988f880c1b8c7feabbf02dfdf045", - "reference": "f4655858a784988f880c1b8c7feabbf02dfdf045", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/eed83939f1aed3eee517d03a33f5ec587ac529b5", + "reference": "eed83939f1aed3eee517d03a33f5ec587ac529b5", "shasum": "" }, "require": { @@ -1510,6 +1570,7 @@ "symfony/translation": "^3.4 || ^4.0 || ^5.0" }, "require-dev": { + "doctrine/dbal": "^2.0 || ^3.0", "doctrine/orm": "^2.7", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", @@ -1580,7 +1641,7 @@ "type": "tidelift" } ], - "time": "2021-09-06T09:29:23+00:00" + "time": "2021-11-01T21:22:20+00:00" }, { "name": "netresearch/jsonmapper", @@ -1773,20 +1834,20 @@ }, { "name": "nette/utils", - "version": "v3.2.2", + "version": "v3.2.5", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "967cfc4f9a1acd5f1058d76715a424c53343c20c" + "reference": "9cd80396ca58d7969ab44fc7afcf03624dfa526e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/967cfc4f9a1acd5f1058d76715a424c53343c20c", - "reference": "967cfc4f9a1acd5f1058d76715a424c53343c20c", + "url": "https://api.github.com/repos/nette/utils/zipball/9cd80396ca58d7969ab44fc7afcf03624dfa526e", + "reference": "9cd80396ca58d7969ab44fc7afcf03624dfa526e", "shasum": "" }, "require": { - "php": ">=7.2 <8.1" + "php": ">=7.2 <8.2" }, "conflict": { "nette/di": "<3.0.6" @@ -1852,9 +1913,9 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.2" + "source": "https://github.com/nette/utils/tree/v3.2.5" }, - "time": "2021-03-03T22:53:25+00:00" + "time": "2021-09-20T10:50:11+00:00" }, { "name": "pguardiario/phpuri", @@ -2110,16 +2171,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.2", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { @@ -2130,7 +2191,8 @@ "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.2" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -2160,22 +2222,22 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" }, - "time": "2020-09-03T19:13:55+00:00" + "time": "2021-10-19T17:43:47+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { @@ -2183,7 +2245,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -2209,26 +2272,26 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" }, - "time": "2020-09-17T18:55:26+00:00" + "time": "2021-10-02T14:08:47+00:00" }, { "name": "psr/container", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", "autoload": { @@ -2257,9 +2320,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "psr/http-message", @@ -2461,23 +2524,23 @@ }, { "name": "sabre/event", - "version": "5.1.2", + "version": "5.1.4", "source": { "type": "git", "url": "https://github.com/sabre-io/event.git", - "reference": "c120bec57c17b6251a496efc82b732418b49d50a" + "reference": "d7da22897125d34d7eddf7977758191c06a74497" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/event/zipball/c120bec57c17b6251a496efc82b732418b49d50a", - "reference": "c120bec57c17b6251a496efc82b732418b49d50a", + "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497", + "reference": "d7da22897125d34d7eddf7977758191c06a74497", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.16.1", + "friendsofphp/php-cs-fixer": "~2.17.1", "phpstan/phpstan": "^0.12", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" }, @@ -2523,80 +2586,7 @@ "issues": "https://github.com/sabre-io/event/issues", "source": "https://github.com/fruux/sabre-event" }, - "time": "2020-10-03T11:02:22+00:00" - }, - { - "name": "scssphp/scssphp", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/scssphp/scssphp.git", - "reference": "b83594e2323c5d6e80785df3f91b9d1d32aad530" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/scssphp/scssphp/zipball/b83594e2323c5d6e80785df3f91b9d1d32aad530", - "reference": "b83594e2323c5d6e80785df3f91b9d1d32aad530", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-json": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4", - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3 || ^9.4", - "sass/sass-spec": "*", - "squizlabs/php_codesniffer": "~3.5", - "symfony/phpunit-bridge": "^5.1", - "twbs/bootstrap": "~5.0", - "twbs/bootstrap4": "4.6.0", - "zurb/foundation": "~6.5" - }, - "suggest": { - "ext-iconv": "Can be used as fallback when ext-mbstring is not available", - "ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv" - }, - "bin": [ - "bin/pscss" - ], - "type": "library", - "autoload": { - "psr-4": { - "ScssPhp\\ScssPhp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthon Pang", - "email": "apang@softwaredevelopment.ca", - "homepage": "https://github.com/robocoder" - }, - { - "name": "Cédric Morin", - "email": "cedric@yterium.com", - "homepage": "https://github.com/Cerdic" - } - ], - "description": "scssphp is a compiler for SCSS written in PHP.", - "homepage": "http://scssphp.github.io/scssphp/", - "keywords": [ - "css", - "less", - "sass", - "scss", - "stylesheet" - ], - "support": { - "issues": "https://github.com/scssphp/scssphp/issues", - "source": "https://github.com/scssphp/scssphp/tree/v1.6.0" - }, - "time": "2021-07-02T16:28:10+00:00" + "time": "2021-11-04T06:51:17+00:00" }, { "name": "sergeytsalkov/meekrodb", @@ -2648,16 +2638,16 @@ }, { "name": "symfony/console", - "version": "v5.3.6", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" + "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "url": "https://api.github.com/repos/symfony/console/zipball/d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", + "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", "shasum": "" }, "require": { @@ -2727,7 +2717,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.6" + "source": "https://github.com/symfony/console/tree/v5.3.10" }, "funding": [ { @@ -2743,7 +2733,7 @@ "type": "tidelift" } ], - "time": "2021-07-27T19:10:22+00:00" + "time": "2021-10-26T09:30:15+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2814,16 +2804,16 @@ }, { "name": "symfony/lock", - "version": "v4.4.27", + "version": "v4.4.33", "source": { "type": "git", "url": "https://github.com/symfony/lock.git", - "reference": "6ca476d4ac992802f2a4043929f68f1818449486" + "reference": "567d29b1bc6e3937652054dafc069151d17824a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/lock/zipball/6ca476d4ac992802f2a4043929f68f1818449486", - "reference": "6ca476d4ac992802f2a4043929f68f1818449486", + "url": "https://api.github.com/repos/symfony/lock/zipball/567d29b1bc6e3937652054dafc069151d17824a9", + "reference": "567d29b1bc6e3937652054dafc069151d17824a9", "shasum": "" }, "require": { @@ -2872,7 +2862,7 @@ "semaphore" ], "support": { - "source": "https://github.com/symfony/lock/tree/v4.4.27" + "source": "https://github.com/symfony/lock/tree/v4.4.33" }, "funding": [ { @@ -2888,7 +2878,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:41:52+00:00" + "time": "2021-10-05T20:27:01+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3620,16 +3610,16 @@ }, { "name": "symfony/string", - "version": "v5.3.3", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", "shasum": "" }, "require": { @@ -3683,7 +3673,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.3" + "source": "https://github.com/symfony/string/tree/v5.3.10" }, "funding": [ { @@ -3699,20 +3689,20 @@ "type": "tidelift" } ], - "time": "2021-06-27T11:44:38+00:00" + "time": "2021-10-27T18:21:46+00:00" }, { "name": "symfony/translation", - "version": "v5.3.7", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6" + "reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6", - "reference": "4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6", + "url": "https://api.github.com/repos/symfony/translation/zipball/6ef197aea2ac8b9cd63e0da7522b3771714035aa", + "reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa", "shasum": "" }, "require": { @@ -3778,7 +3768,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.3.7" + "source": "https://github.com/symfony/translation/tree/v5.3.10" }, "funding": [ { @@ -3794,7 +3784,7 @@ "type": "tidelift" } ], - "time": "2021-08-26T08:22:53+00:00" + "time": "2021-10-10T06:43:24+00:00" }, { "name": "symfony/translation-contracts", @@ -3876,16 +3866,16 @@ }, { "name": "tysonandre/var_representation_polyfill", - "version": "0.0.2", + "version": "0.1.1", "source": { "type": "git", "url": "https://github.com/TysonAndre/var_representation_polyfill.git", - "reference": "3f17999ee1f257319ddc6721dd26ebbc5d175f33" + "reference": "0a942e74e18af5514749895507bc6ca7ab96399a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/3f17999ee1f257319ddc6721dd26ebbc5d175f33", - "reference": "3f17999ee1f257319ddc6721dd26ebbc5d175f33", + "url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/0a942e74e18af5514749895507bc6ca7ab96399a", + "reference": "0a942e74e18af5514749895507bc6ca7ab96399a", "shasum": "" }, "require": { @@ -3896,6 +3886,9 @@ "phan/phan": "^4.0", "phpunit/phpunit": "^8.5.0" }, + "suggest": { + "ext-var_representation": "*" + }, "type": "library", "autoload": { "psr-4": { @@ -3914,16 +3907,16 @@ "name": "Tyson Andre" } ], - "description": "Polyfill for var_representation", + "description": "Polyfill for var_representation: convert a variable to a string in a way that fixes the shortcomings of var_export", "keywords": [ "var_export", "var_representation" ], "support": { "issues": "https://github.com/TysonAndre/var_representation_polyfill/issues", - "source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.0.2" + "source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.1.1" }, - "time": "2021-06-26T18:55:02+00:00" + "time": "2021-08-16T00:12:50+00:00" }, { "name": "vlucas/valitron", @@ -4181,7 +4174,7 @@ "platform": [], "platform-dev": [], "platform-overrides": { - "php": "7.4" + "php": "8.0" }, "plugin-api-version": "2.0.0" } diff --git a/vendor/bin/pscss b/vendor/bin/pscss deleted file mode 120000 index d08fca2f..00000000 --- a/vendor/bin/pscss +++ /dev/null @@ -1 +0,0 @@ -../scssphp/scssphp/bin/pscss \ No newline at end of file diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index acb4dd79..b54c107b 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -29,7 +29,7 @@ private static $installed = array ( 'aliases' => array ( ), - 'reference' => 'cf3f40b5787b2a1aed9255775143108ef5b1f278', + 'reference' => '872755e57f84720a9c4c63d5455441f83c41f6c6', 'name' => 'sammo-hid/sammo', ), 'versions' => @@ -54,12 +54,12 @@ private static $installed = array ( ), 'composer/semver' => array ( - 'pretty_version' => '3.2.5', - 'version' => '3.2.5.0', + 'pretty_version' => '3.2.6', + 'version' => '3.2.6.0', 'aliases' => array ( ), - 'reference' => '31f3ea725711245195f62e54ffa402d8ef2fdba9', + 'reference' => '83e511e247de329283478496f7a1e114c9517506', ), 'composer/xdebug-handler' => array ( @@ -72,12 +72,12 @@ private static $installed = array ( ), 'doctrine/inflector' => array ( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', 'aliases' => array ( ), - 'reference' => '9cf661f4eb38f7c881cac67c75ea9b00bf97b210', + 'reference' => '8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89', ), 'erusev/parsedown' => array ( @@ -135,80 +135,80 @@ private static $installed = array ( ), 'guzzlehttp/promises' => array ( - 'pretty_version' => '1.4.1', - 'version' => '1.4.1.0', + 'pretty_version' => '1.5.1', + 'version' => '1.5.1.0', 'aliases' => array ( ), - 'reference' => '8e7d04f1f6450fef59366c399cfad4b9383aa30d', + 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', ), 'guzzlehttp/psr7' => array ( - 'pretty_version' => '1.8.2', - 'version' => '1.8.2.0', + 'pretty_version' => '1.8.3', + 'version' => '1.8.3.0', 'aliases' => array ( ), - 'reference' => 'dc960a912984efb74d0a90222870c72c87f10c91', + 'reference' => '1afdd860a2566ed3c2b0b4a3de6e23434a79ec85', ), 'illuminate/bus' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => '808097c0dfd893309bd77b00139586c516b965c9', + 'reference' => 'be400399687b97d5558a224e970060fd5d5f2735', ), 'illuminate/collections' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => '18fa841df912ec56849351dd6ca8928e8a98b69d', + 'reference' => '05f286ec5fd2dd286e8384577047efc375c8954c', ), 'illuminate/container' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => '862b64ea4ab56e307a1676104a1b93295d347ad0', + 'reference' => 'ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d', ), 'illuminate/contracts' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => 'ab4bb4ec3b36905ccf972c84f9aaa2bdd1153913', + 'reference' => 'e76f4bce73a2a1656add24bd5210ebc4b8af49c0', ), 'illuminate/database' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => 'acc11d6839ddb3b694bc6585177fa5141b70c693', + 'reference' => '43c7ffb6299ae55b000b286cf1278afd268ef29f', ), 'illuminate/events' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => '7def78033f29cd0c0383513b27c291d233a7f90e', + 'reference' => 'b7f06cafb6c09581617f2ca05d69e9b159e5a35d', ), 'illuminate/macroable' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), @@ -216,8 +216,8 @@ private static $installed = array ( ), 'illuminate/pipeline' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), @@ -225,12 +225,12 @@ private static $installed = array ( ), 'illuminate/support' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => 'b0a21c41163381dd9a5abbd68fe85ed7b4247d30', + 'reference' => 'a8851b7001530d3c11626a81449ed9b63dd10db7', ), 'league/plates' => array ( @@ -261,12 +261,12 @@ private static $installed = array ( ), 'nesbot/carbon' => array ( - 'pretty_version' => '2.53.1', - 'version' => '2.53.1.0', + 'pretty_version' => '2.54.0', + 'version' => '2.54.0.0', 'aliases' => array ( ), - 'reference' => 'f4655858a784988f880c1b8c7feabbf02dfdf045', + 'reference' => 'eed83939f1aed3eee517d03a33f5ec587ac529b5', ), 'netresearch/jsonmapper' => array ( @@ -297,12 +297,12 @@ private static $installed = array ( ), 'nette/utils' => array ( - 'pretty_version' => 'v3.2.2', - 'version' => '3.2.2.0', + 'pretty_version' => 'v3.2.5', + 'version' => '3.2.5.0', 'aliases' => array ( ), - 'reference' => '967cfc4f9a1acd5f1058d76715a424c53343c20c', + 'reference' => '9cd80396ca58d7969ab44fc7afcf03624dfa526e', ), 'pguardiario/phpuri' => array ( @@ -351,30 +351,30 @@ private static $installed = array ( ), 'phpdocumentor/reflection-docblock' => array ( - 'pretty_version' => '5.2.2', - 'version' => '5.2.2.0', + 'pretty_version' => '5.3.0', + 'version' => '5.3.0.0', 'aliases' => array ( ), - 'reference' => '069a785b2141f5bcf49f3e353548dc1cce6df556', + 'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170', ), 'phpdocumentor/type-resolver' => array ( - 'pretty_version' => '1.4.0', - 'version' => '1.4.0.0', + 'pretty_version' => '1.5.1', + 'version' => '1.5.1.0', 'aliases' => array ( ), - 'reference' => '6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0', + 'reference' => 'a12f7e301eb7258bb68acd89d4aefa05c2906cae', ), 'psr/container' => array ( - 'pretty_version' => '1.1.1', - 'version' => '1.1.1.0', + 'pretty_version' => '1.1.2', + 'version' => '1.1.2.0', 'aliases' => array ( ), - 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', + 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', ), 'psr/container-implementation' => array ( @@ -436,12 +436,12 @@ private static $installed = array ( ), 'sabre/event' => array ( - 'pretty_version' => '5.1.2', - 'version' => '5.1.2.0', + 'pretty_version' => '5.1.4', + 'version' => '5.1.4.0', 'aliases' => array ( ), - 'reference' => 'c120bec57c17b6251a496efc82b732418b49d50a', + 'reference' => 'd7da22897125d34d7eddf7977758191c06a74497', ), 'sammo-hid/sammo' => array ( @@ -450,16 +450,7 @@ private static $installed = array ( 'aliases' => array ( ), - 'reference' => 'cf3f40b5787b2a1aed9255775143108ef5b1f278', - ), - 'scssphp/scssphp' => - array ( - 'pretty_version' => 'v1.6.0', - 'version' => '1.6.0.0', - 'aliases' => - array ( - ), - 'reference' => 'b83594e2323c5d6e80785df3f91b9d1d32aad530', + 'reference' => '872755e57f84720a9c4c63d5455441f83c41f6c6', ), 'sergeytsalkov/meekrodb' => array ( @@ -472,12 +463,12 @@ private static $installed = array ( ), 'symfony/console' => array ( - 'pretty_version' => 'v5.3.6', - 'version' => '5.3.6.0', + 'pretty_version' => 'v5.3.10', + 'version' => '5.3.10.0', 'aliases' => array ( ), - 'reference' => '51b71afd6d2dc8f5063199357b9880cea8d8bfe2', + 'reference' => 'd4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3', ), 'symfony/deprecation-contracts' => array ( @@ -490,12 +481,12 @@ private static $installed = array ( ), 'symfony/lock' => array ( - 'pretty_version' => 'v4.4.27', - 'version' => '4.4.27.0', + 'pretty_version' => 'v4.4.33', + 'version' => '4.4.33.0', 'aliases' => array ( ), - 'reference' => '6ca476d4ac992802f2a4043929f68f1818449486', + 'reference' => '567d29b1bc6e3937652054dafc069151d17824a9', ), 'symfony/polyfill-ctype' => array ( @@ -580,21 +571,21 @@ private static $installed = array ( ), 'symfony/string' => array ( - 'pretty_version' => 'v5.3.3', - 'version' => '5.3.3.0', + 'pretty_version' => 'v5.3.10', + 'version' => '5.3.10.0', 'aliases' => array ( ), - 'reference' => 'bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1', + 'reference' => 'd70c35bb20bbca71fc4ab7921e3c6bda1a82a60c', ), 'symfony/translation' => array ( - 'pretty_version' => 'v5.3.7', - 'version' => '5.3.7.0', + 'pretty_version' => 'v5.3.10', + 'version' => '5.3.10.0', 'aliases' => array ( ), - 'reference' => '4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6', + 'reference' => '6ef197aea2ac8b9cd63e0da7522b3771714035aa', ), 'symfony/translation-contracts' => array ( @@ -614,12 +605,12 @@ private static $installed = array ( ), 'tysonandre/var_representation_polyfill' => array ( - 'pretty_version' => '0.0.2', - 'version' => '0.0.2.0', + 'pretty_version' => '0.1.1', + 'version' => '0.1.1.0', 'aliases' => array ( ), - 'reference' => '3f17999ee1f257319ddc6721dd26ebbc5d175f33', + 'reference' => '0a942e74e18af5514749895507bc6ca7ab96399a', ), 'vlucas/valitron' => array ( diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 5af92e89..17ca643e 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -108,6 +108,7 @@ return array( 'Nette\\Utils\\Reflection' => $vendorDir . '/nette/utils/src/Utils/Reflection.php', 'Nette\\Utils\\RegexpException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\Strings' => $vendorDir . '/nette/utils/src/Utils/Strings.php', + 'Nette\\Utils\\Type' => $vendorDir . '/nette/utils/src/Utils/Type.php', 'Nette\\Utils\\UnknownImageFileException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\Validators' => $vendorDir . '/nette/utils/src/Utils/Validators.php', 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index f642b481..6e758f8b 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -27,7 +27,6 @@ return array( 'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'), 'Symfony\\Component\\Lock\\' => array($vendorDir . '/symfony/lock'), 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), - 'ScssPhp\\ScssPhp\\' => array($vendorDir . '/scssphp/scssphp/src'), 'Sabre\\Event\\' => array($vendorDir . '/sabre/event/lib'), 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index d89f49f7..245fbae9 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -76,7 +76,6 @@ class ComposerStaticInit67b09c83b85c3bc0027caefe5bba171a 'Symfony\\Component\\String\\' => 25, 'Symfony\\Component\\Lock\\' => 23, 'Symfony\\Component\\Console\\' => 26, - 'ScssPhp\\ScssPhp\\' => 16, 'Sabre\\Event\\' => 12, ), 'P' => @@ -218,10 +217,6 @@ class ComposerStaticInit67b09c83b85c3bc0027caefe5bba171a array ( 0 => __DIR__ . '/..' . '/symfony/console', ), - 'ScssPhp\\ScssPhp\\' => - array ( - 0 => __DIR__ . '/..' . '/scssphp/scssphp/src', - ), 'Sabre\\Event\\' => array ( 0 => __DIR__ . '/..' . '/sabre/event/lib', @@ -472,6 +467,7 @@ class ComposerStaticInit67b09c83b85c3bc0027caefe5bba171a 'Nette\\Utils\\Reflection' => __DIR__ . '/..' . '/nette/utils/src/Utils/Reflection.php', 'Nette\\Utils\\RegexpException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\Strings' => __DIR__ . '/..' . '/nette/utils/src/Utils/Strings.php', + 'Nette\\Utils\\Type' => __DIR__ . '/..' . '/nette/utils/src/Utils/Type.php', 'Nette\\Utils\\UnknownImageFileException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\Validators' => __DIR__ . '/..' . '/nette/utils/src/Utils/Validators.php', 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 1e032978..ad0ee3c1 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -118,17 +118,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": { @@ -138,7 +138,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": { @@ -182,7 +182,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": [ { @@ -269,36 +269,32 @@ }, { "name": "doctrine/inflector", - "version": "2.0.3", - "version_normalized": "2.0.3.0", + "version": "2.0.4", + "version_normalized": "2.0.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210" + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/9cf661f4eb38f7c881cac67c75ea9b00bf97b210", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^7.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "doctrine/coding-standard": "^8.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^4.10" }, - "time": "2020-05-29T15:13:26+00:00", + "time": "2021-10-22T20:16:43+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -347,7 +343,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.x" + "source": "https://github.com/doctrine/inflector/tree/2.0.4" }, "funding": [ { @@ -684,17 +680,17 @@ }, { "name": "guzzlehttp/promises", - "version": "1.4.1", - "version_normalized": "1.4.1.0", + "version": "1.5.1", + "version_normalized": "1.5.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "" }, "require": { @@ -703,11 +699,11 @@ "require-dev": { "symfony/phpunit-bridge": "^4.4 || ^5.1" }, - "time": "2021-03-07T09:25:29+00:00", + "time": "2021-10-22T20:56:57+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "installation-source": "dist", @@ -724,10 +720,25 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", @@ -736,23 +747,37 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.1" + "source": "https://github.com/guzzle/promises/tree/1.5.1" }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], "install-path": "../guzzlehttp/promises" }, { "name": "guzzlehttp/psr7", - "version": "1.8.2", - "version_normalized": "1.8.2.0", + "version": "1.8.3", + "version_normalized": "1.8.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91" + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", "shasum": "" }, "require": { @@ -770,7 +795,7 @@ "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2021-04-26T09:17:50+00:00", + "time": "2021-10-05T13:56:00+00:00", "type": "library", "extra": { "branch-alias": { @@ -791,13 +816,34 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], @@ -814,23 +860,37 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.2" + "source": "https://github.com/guzzle/psr7/tree/1.8.3" }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], "install-path": "../guzzlehttp/psr7" }, { "name": "illuminate/bus", - "version": "v8.61.0", - "version_normalized": "8.61.0.0", + "version": "v8.69.0", + "version_normalized": "8.69.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "808097c0dfd893309bd77b00139586c516b965c9" + "reference": "be400399687b97d5558a224e970060fd5d5f2735" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/808097c0dfd893309bd77b00139586c516b965c9", - "reference": "808097c0dfd893309bd77b00139586c516b965c9", + "url": "https://api.github.com/repos/illuminate/bus/zipball/be400399687b97d5558a224e970060fd5d5f2735", + "reference": "be400399687b97d5558a224e970060fd5d5f2735", "shasum": "" }, "require": { @@ -843,7 +903,7 @@ "suggest": { "illuminate/queue": "Required to use closures when chaining jobs (^7.0)." }, - "time": "2021-08-10T16:49:48+00:00", + "time": "2021-10-21T19:19:36+00:00", "type": "library", "extra": { "branch-alias": { @@ -876,17 +936,17 @@ }, { "name": "illuminate/collections", - "version": "v8.61.0", - "version_normalized": "8.61.0.0", + "version": "v8.69.0", + "version_normalized": "8.69.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "18fa841df912ec56849351dd6ca8928e8a98b69d" + "reference": "05f286ec5fd2dd286e8384577047efc375c8954c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/18fa841df912ec56849351dd6ca8928e8a98b69d", - "reference": "18fa841df912ec56849351dd6ca8928e8a98b69d", + "url": "https://api.github.com/repos/illuminate/collections/zipball/05f286ec5fd2dd286e8384577047efc375c8954c", + "reference": "05f286ec5fd2dd286e8384577047efc375c8954c", "shasum": "" }, "require": { @@ -897,7 +957,7 @@ "suggest": { "symfony/var-dumper": "Required to use the dump method (^5.1.4)." }, - "time": "2021-09-08T12:48:16+00:00", + "time": "2021-10-22T18:01:46+00:00", "type": "library", "extra": { "branch-alias": { @@ -933,17 +993,17 @@ }, { "name": "illuminate/container", - "version": "v8.61.0", - "version_normalized": "8.61.0.0", + "version": "v8.69.0", + "version_normalized": "8.69.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "862b64ea4ab56e307a1676104a1b93295d347ad0" + "reference": "ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/862b64ea4ab56e307a1676104a1b93295d347ad0", - "reference": "862b64ea4ab56e307a1676104a1b93295d347ad0", + "url": "https://api.github.com/repos/illuminate/container/zipball/ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d", + "reference": "ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d", "shasum": "" }, "require": { @@ -954,7 +1014,7 @@ "provide": { "psr/container-implementation": "1.0" }, - "time": "2021-09-09T13:55:23+00:00", + "time": "2021-09-15T14:32:50+00:00", "type": "library", "extra": { "branch-alias": { @@ -987,17 +1047,17 @@ }, { "name": "illuminate/contracts", - "version": "v8.61.0", - "version_normalized": "8.61.0.0", + "version": "v8.69.0", + "version_normalized": "8.69.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "ab4bb4ec3b36905ccf972c84f9aaa2bdd1153913" + "reference": "e76f4bce73a2a1656add24bd5210ebc4b8af49c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/ab4bb4ec3b36905ccf972c84f9aaa2bdd1153913", - "reference": "ab4bb4ec3b36905ccf972c84f9aaa2bdd1153913", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/e76f4bce73a2a1656add24bd5210ebc4b8af49c0", + "reference": "e76f4bce73a2a1656add24bd5210ebc4b8af49c0", "shasum": "" }, "require": { @@ -1005,7 +1065,7 @@ "psr/container": "^1.0", "psr/simple-cache": "^1.0" }, - "time": "2021-09-08T12:09:40+00:00", + "time": "2021-10-22T18:01:46+00:00", "type": "library", "extra": { "branch-alias": { @@ -1038,17 +1098,17 @@ }, { "name": "illuminate/database", - "version": "v8.61.0", - "version_normalized": "8.61.0.0", + "version": "v8.69.0", + "version_normalized": "8.69.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "acc11d6839ddb3b694bc6585177fa5141b70c693" + "reference": "43c7ffb6299ae55b000b286cf1278afd268ef29f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/acc11d6839ddb3b694bc6585177fa5141b70c693", - "reference": "acc11d6839ddb3b694bc6585177fa5141b70c693", + "url": "https://api.github.com/repos/illuminate/database/zipball/43c7ffb6299ae55b000b286cf1278afd268ef29f", + "reference": "43c7ffb6299ae55b000b286cf1278afd268ef29f", "shasum": "" }, "require": { @@ -1062,7 +1122,7 @@ "symfony/console": "^5.1.4" }, "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.2).", "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", "illuminate/console": "Required to use the database commands (^8.0).", "illuminate/events": "Required to use the observers with Eloquent (^8.0).", @@ -1070,7 +1130,7 @@ "illuminate/pagination": "Required to paginate the result set (^8.0).", "symfony/finder": "Required to use Eloquent model factories (^5.1.4)." }, - "time": "2021-09-13T18:43:43+00:00", + "time": "2021-10-29T19:46:53+00:00", "type": "library", "extra": { "branch-alias": { @@ -1109,17 +1169,17 @@ }, { "name": "illuminate/events", - "version": "v8.61.0", - "version_normalized": "8.61.0.0", + "version": "v8.69.0", + "version_normalized": "8.69.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", - "reference": "7def78033f29cd0c0383513b27c291d233a7f90e" + "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/events/zipball/7def78033f29cd0c0383513b27c291d233a7f90e", - "reference": "7def78033f29cd0c0383513b27c291d233a7f90e", + "url": "https://api.github.com/repos/illuminate/events/zipball/b7f06cafb6c09581617f2ca05d69e9b159e5a35d", + "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d", "shasum": "" }, "require": { @@ -1131,7 +1191,7 @@ "illuminate/support": "^8.0", "php": "^7.3|^8.0" }, - "time": "2021-08-16T21:45:47+00:00", + "time": "2021-09-15T14:32:50+00:00", "type": "library", "extra": { "branch-alias": { @@ -1167,8 +1227,8 @@ }, { "name": "illuminate/macroable", - "version": "v8.61.0", - "version_normalized": "8.61.0.0", + "version": "v8.69.0", + "version_normalized": "8.69.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -1216,8 +1276,8 @@ }, { "name": "illuminate/pipeline", - "version": "v8.61.0", - "version_normalized": "8.61.0.0", + "version": "v8.69.0", + "version_normalized": "8.69.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -1267,17 +1327,17 @@ }, { "name": "illuminate/support", - "version": "v8.61.0", - "version_normalized": "8.61.0.0", + "version": "v8.69.0", + "version_normalized": "8.69.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "b0a21c41163381dd9a5abbd68fe85ed7b4247d30" + "reference": "a8851b7001530d3c11626a81449ed9b63dd10db7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/b0a21c41163381dd9a5abbd68fe85ed7b4247d30", - "reference": "b0a21c41163381dd9a5abbd68fe85ed7b4247d30", + "url": "https://api.github.com/repos/illuminate/support/zipball/a8851b7001530d3c11626a81449ed9b63dd10db7", + "reference": "a8851b7001530d3c11626a81449ed9b63dd10db7", "shasum": "" }, "require": { @@ -1287,7 +1347,7 @@ "illuminate/collections": "^8.0", "illuminate/contracts": "^8.0", "illuminate/macroable": "^8.0", - "nesbot/carbon": "^2.31", + "nesbot/carbon": "^2.53.1", "php": "^7.3|^8.0", "voku/portable-ascii": "^1.4.8" }, @@ -1296,13 +1356,13 @@ }, "suggest": { "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0).", - "ramsey/uuid": "Required to use Str::uuid() (^4.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", + "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", "symfony/process": "Required to use the composer class (^5.1.4).", "symfony/var-dumper": "Required to use the dd function (^5.1.4).", "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." }, - "time": "2021-09-13T18:43:43+00:00", + "time": "2021-10-29T13:34:03+00:00", "type": "library", "extra": { "branch-alias": { @@ -1542,17 +1602,17 @@ }, { "name": "nesbot/carbon", - "version": "2.53.1", - "version_normalized": "2.53.1.0", + "version": "2.54.0", + "version_normalized": "2.54.0.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "f4655858a784988f880c1b8c7feabbf02dfdf045" + "reference": "eed83939f1aed3eee517d03a33f5ec587ac529b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/f4655858a784988f880c1b8c7feabbf02dfdf045", - "reference": "f4655858a784988f880c1b8c7feabbf02dfdf045", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/eed83939f1aed3eee517d03a33f5ec587ac529b5", + "reference": "eed83939f1aed3eee517d03a33f5ec587ac529b5", "shasum": "" }, "require": { @@ -1563,6 +1623,7 @@ "symfony/translation": "^3.4 || ^4.0 || ^5.0" }, "require-dev": { + "doctrine/dbal": "^2.0 || ^3.0", "doctrine/orm": "^2.7", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", @@ -1572,7 +1633,7 @@ "phpunit/phpunit": "^7.5.20 || ^8.5.14", "squizlabs/php_codesniffer": "^3.4" }, - "time": "2021-09-06T09:29:23+00:00", + "time": "2021-11-01T21:22:20+00:00", "bin": [ "bin/carbon" ], @@ -1833,21 +1894,21 @@ }, { "name": "nette/utils", - "version": "v3.2.2", - "version_normalized": "3.2.2.0", + "version": "v3.2.5", + "version_normalized": "3.2.5.0", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "967cfc4f9a1acd5f1058d76715a424c53343c20c" + "reference": "9cd80396ca58d7969ab44fc7afcf03624dfa526e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/967cfc4f9a1acd5f1058d76715a424c53343c20c", - "reference": "967cfc4f9a1acd5f1058d76715a424c53343c20c", + "url": "https://api.github.com/repos/nette/utils/zipball/9cd80396ca58d7969ab44fc7afcf03624dfa526e", + "reference": "9cd80396ca58d7969ab44fc7afcf03624dfa526e", "shasum": "" }, "require": { - "php": ">=7.2 <8.1" + "php": ">=7.2 <8.2" }, "conflict": { "nette/di": "<3.0.6" @@ -1866,7 +1927,7 @@ "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", "ext-xml": "to use Strings::length() etc. when mbstring is not available" }, - "time": "2021-03-03T22:53:25+00:00", + "time": "2021-09-20T10:50:11+00:00", "type": "library", "extra": { "branch-alias": { @@ -1915,7 +1976,7 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.2" + "source": "https://github.com/nette/utils/tree/v3.2.5" }, "install-path": "../nette/utils" }, @@ -2176,17 +2237,17 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.2", - "version_normalized": "5.2.2.0", + "version": "5.3.0", + "version_normalized": "5.3.0.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { @@ -2197,9 +2258,10 @@ "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.2" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, - "time": "2020-09-03T19:13:55+00:00", + "time": "2021-10-19T17:43:47+00:00", "type": "library", "extra": { "branch-alias": { @@ -2229,23 +2291,23 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" }, "install-path": "../phpdocumentor/reflection-docblock" }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", - "version_normalized": "1.4.0.0", + "version": "1.5.1", + "version_normalized": "1.5.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { @@ -2253,9 +2315,10 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, - "time": "2020-09-17T18:55:26+00:00", + "time": "2021-10-02T14:08:47+00:00", "type": "library", "extra": { "branch-alias": { @@ -2281,29 +2344,29 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" }, "install-path": "../phpdocumentor/type-resolver" }, { "name": "psr/container", - "version": "1.1.1", - "version_normalized": "1.1.1.0", + "version": "1.1.2", + "version_normalized": "1.1.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, - "time": "2021-03-05T17:36:06+00:00", + "time": "2021-11-05T16:50:12+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2332,7 +2395,7 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, "install-path": "../psr/container" }, @@ -2541,28 +2604,28 @@ }, { "name": "sabre/event", - "version": "5.1.2", - "version_normalized": "5.1.2.0", + "version": "5.1.4", + "version_normalized": "5.1.4.0", "source": { "type": "git", "url": "https://github.com/sabre-io/event.git", - "reference": "c120bec57c17b6251a496efc82b732418b49d50a" + "reference": "d7da22897125d34d7eddf7977758191c06a74497" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/event/zipball/c120bec57c17b6251a496efc82b732418b49d50a", - "reference": "c120bec57c17b6251a496efc82b732418b49d50a", + "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497", + "reference": "d7da22897125d34d7eddf7977758191c06a74497", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.16.1", + "friendsofphp/php-cs-fixer": "~2.17.1", "phpstan/phpstan": "^0.12", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" }, - "time": "2020-10-03T11:02:22+00:00", + "time": "2021-11-04T06:51:17+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2608,82 +2671,6 @@ }, "install-path": "../sabre/event" }, - { - "name": "scssphp/scssphp", - "version": "v1.6.0", - "version_normalized": "1.6.0.0", - "source": { - "type": "git", - "url": "https://github.com/scssphp/scssphp.git", - "reference": "b83594e2323c5d6e80785df3f91b9d1d32aad530" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/scssphp/scssphp/zipball/b83594e2323c5d6e80785df3f91b9d1d32aad530", - "reference": "b83594e2323c5d6e80785df3f91b9d1d32aad530", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-json": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4", - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3 || ^9.4", - "sass/sass-spec": "*", - "squizlabs/php_codesniffer": "~3.5", - "symfony/phpunit-bridge": "^5.1", - "twbs/bootstrap": "~5.0", - "twbs/bootstrap4": "4.6.0", - "zurb/foundation": "~6.5" - }, - "suggest": { - "ext-iconv": "Can be used as fallback when ext-mbstring is not available", - "ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv" - }, - "time": "2021-07-02T16:28:10+00:00", - "bin": [ - "bin/pscss" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "ScssPhp\\ScssPhp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthon Pang", - "email": "apang@softwaredevelopment.ca", - "homepage": "https://github.com/robocoder" - }, - { - "name": "Cédric Morin", - "email": "cedric@yterium.com", - "homepage": "https://github.com/Cerdic" - } - ], - "description": "scssphp is a compiler for SCSS written in PHP.", - "homepage": "http://scssphp.github.io/scssphp/", - "keywords": [ - "css", - "less", - "sass", - "scss", - "stylesheet" - ], - "support": { - "issues": "https://github.com/scssphp/scssphp/issues", - "source": "https://github.com/scssphp/scssphp/tree/v1.6.0" - }, - "install-path": "../scssphp/scssphp" - }, { "name": "sergeytsalkov/meekrodb", "version": "v2.4", @@ -2737,17 +2724,17 @@ }, { "name": "symfony/console", - "version": "v5.3.6", - "version_normalized": "5.3.6.0", + "version": "v5.3.10", + "version_normalized": "5.3.10.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" + "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "url": "https://api.github.com/repos/symfony/console/zipball/d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", + "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", "shasum": "" }, "require": { @@ -2785,7 +2772,7 @@ "symfony/lock": "", "symfony/process": "" }, - "time": "2021-07-27T19:10:22+00:00", + "time": "2021-10-26T09:30:15+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2819,7 +2806,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.6" + "source": "https://github.com/symfony/console/tree/v5.3.10" }, "funding": [ { @@ -2909,17 +2896,17 @@ }, { "name": "symfony/lock", - "version": "v4.4.27", - "version_normalized": "4.4.27.0", + "version": "v4.4.33", + "version_normalized": "4.4.33.0", "source": { "type": "git", "url": "https://github.com/symfony/lock.git", - "reference": "6ca476d4ac992802f2a4043929f68f1818449486" + "reference": "567d29b1bc6e3937652054dafc069151d17824a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/lock/zipball/6ca476d4ac992802f2a4043929f68f1818449486", - "reference": "6ca476d4ac992802f2a4043929f68f1818449486", + "url": "https://api.github.com/repos/symfony/lock/zipball/567d29b1bc6e3937652054dafc069151d17824a9", + "reference": "567d29b1bc6e3937652054dafc069151d17824a9", "shasum": "" }, "require": { @@ -2934,7 +2921,7 @@ "doctrine/dbal": "^2.6|^3.0", "predis/predis": "~1.0" }, - "time": "2021-07-23T15:41:52+00:00", + "time": "2021-10-05T20:27:01+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2970,7 +2957,7 @@ "semaphore" ], "support": { - "source": "https://github.com/symfony/lock/tree/v4.4.27" + "source": "https://github.com/symfony/lock/tree/v4.4.33" }, "funding": [ { @@ -3745,17 +3732,17 @@ }, { "name": "symfony/string", - "version": "v5.3.3", - "version_normalized": "5.3.3.0", + "version": "v5.3.10", + "version_normalized": "5.3.10.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", "shasum": "" }, "require": { @@ -3772,7 +3759,7 @@ "symfony/translation-contracts": "^1.1|^2", "symfony/var-exporter": "^4.4|^5.0" }, - "time": "2021-06-27T11:44:38+00:00", + "time": "2021-10-27T18:21:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3811,7 +3798,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.3" + "source": "https://github.com/symfony/string/tree/v5.3.10" }, "funding": [ { @@ -3831,17 +3818,17 @@ }, { "name": "symfony/translation", - "version": "v5.3.7", - "version_normalized": "5.3.7.0", + "version": "v5.3.10", + "version_normalized": "5.3.10.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6" + "reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6", - "reference": "4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6", + "url": "https://api.github.com/repos/symfony/translation/zipball/6ef197aea2ac8b9cd63e0da7522b3771714035aa", + "reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa", "shasum": "" }, "require": { @@ -3878,7 +3865,7 @@ "symfony/config": "", "symfony/yaml": "" }, - "time": "2021-08-26T08:22:53+00:00", + "time": "2021-10-10T06:43:24+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3909,7 +3896,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.3.7" + "source": "https://github.com/symfony/translation/tree/v5.3.10" }, "funding": [ { @@ -4010,17 +3997,17 @@ }, { "name": "tysonandre/var_representation_polyfill", - "version": "0.0.2", - "version_normalized": "0.0.2.0", + "version": "0.1.1", + "version_normalized": "0.1.1.0", "source": { "type": "git", "url": "https://github.com/TysonAndre/var_representation_polyfill.git", - "reference": "3f17999ee1f257319ddc6721dd26ebbc5d175f33" + "reference": "0a942e74e18af5514749895507bc6ca7ab96399a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/3f17999ee1f257319ddc6721dd26ebbc5d175f33", - "reference": "3f17999ee1f257319ddc6721dd26ebbc5d175f33", + "url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/0a942e74e18af5514749895507bc6ca7ab96399a", + "reference": "0a942e74e18af5514749895507bc6ca7ab96399a", "shasum": "" }, "require": { @@ -4031,7 +4018,10 @@ "phan/phan": "^4.0", "phpunit/phpunit": "^8.5.0" }, - "time": "2021-06-26T18:55:02+00:00", + "suggest": { + "ext-var_representation": "*" + }, + "time": "2021-08-16T00:12:50+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4051,14 +4041,14 @@ "name": "Tyson Andre" } ], - "description": "Polyfill for var_representation", + "description": "Polyfill for var_representation: convert a variable to a string in a way that fixes the shortcomings of var_export", "keywords": [ "var_export", "var_representation" ], "support": { "issues": "https://github.com/TysonAndre/var_representation_polyfill/issues", - "source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.0.2" + "source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.1.1" }, "install-path": "../tysonandre/var_representation_polyfill" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 18beb265..eb067000 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -6,7 +6,7 @@ 'aliases' => array ( ), - 'reference' => 'cf3f40b5787b2a1aed9255775143108ef5b1f278', + 'reference' => '872755e57f84720a9c4c63d5455441f83c41f6c6', 'name' => 'sammo-hid/sammo', ), 'versions' => @@ -31,12 +31,12 @@ ), 'composer/semver' => array ( - 'pretty_version' => '3.2.5', - 'version' => '3.2.5.0', + 'pretty_version' => '3.2.6', + 'version' => '3.2.6.0', 'aliases' => array ( ), - 'reference' => '31f3ea725711245195f62e54ffa402d8ef2fdba9', + 'reference' => '83e511e247de329283478496f7a1e114c9517506', ), 'composer/xdebug-handler' => array ( @@ -49,12 +49,12 @@ ), 'doctrine/inflector' => array ( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', 'aliases' => array ( ), - 'reference' => '9cf661f4eb38f7c881cac67c75ea9b00bf97b210', + 'reference' => '8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89', ), 'erusev/parsedown' => array ( @@ -112,80 +112,80 @@ ), 'guzzlehttp/promises' => array ( - 'pretty_version' => '1.4.1', - 'version' => '1.4.1.0', + 'pretty_version' => '1.5.1', + 'version' => '1.5.1.0', 'aliases' => array ( ), - 'reference' => '8e7d04f1f6450fef59366c399cfad4b9383aa30d', + 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', ), 'guzzlehttp/psr7' => array ( - 'pretty_version' => '1.8.2', - 'version' => '1.8.2.0', + 'pretty_version' => '1.8.3', + 'version' => '1.8.3.0', 'aliases' => array ( ), - 'reference' => 'dc960a912984efb74d0a90222870c72c87f10c91', + 'reference' => '1afdd860a2566ed3c2b0b4a3de6e23434a79ec85', ), 'illuminate/bus' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => '808097c0dfd893309bd77b00139586c516b965c9', + 'reference' => 'be400399687b97d5558a224e970060fd5d5f2735', ), 'illuminate/collections' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => '18fa841df912ec56849351dd6ca8928e8a98b69d', + 'reference' => '05f286ec5fd2dd286e8384577047efc375c8954c', ), 'illuminate/container' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => '862b64ea4ab56e307a1676104a1b93295d347ad0', + 'reference' => 'ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d', ), 'illuminate/contracts' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => 'ab4bb4ec3b36905ccf972c84f9aaa2bdd1153913', + 'reference' => 'e76f4bce73a2a1656add24bd5210ebc4b8af49c0', ), 'illuminate/database' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => 'acc11d6839ddb3b694bc6585177fa5141b70c693', + 'reference' => '43c7ffb6299ae55b000b286cf1278afd268ef29f', ), 'illuminate/events' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => '7def78033f29cd0c0383513b27c291d233a7f90e', + 'reference' => 'b7f06cafb6c09581617f2ca05d69e9b159e5a35d', ), 'illuminate/macroable' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), @@ -193,8 +193,8 @@ ), 'illuminate/pipeline' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), @@ -202,12 +202,12 @@ ), 'illuminate/support' => array ( - 'pretty_version' => 'v8.61.0', - 'version' => '8.61.0.0', + 'pretty_version' => 'v8.69.0', + 'version' => '8.69.0.0', 'aliases' => array ( ), - 'reference' => 'b0a21c41163381dd9a5abbd68fe85ed7b4247d30', + 'reference' => 'a8851b7001530d3c11626a81449ed9b63dd10db7', ), 'league/plates' => array ( @@ -238,12 +238,12 @@ ), 'nesbot/carbon' => array ( - 'pretty_version' => '2.53.1', - 'version' => '2.53.1.0', + 'pretty_version' => '2.54.0', + 'version' => '2.54.0.0', 'aliases' => array ( ), - 'reference' => 'f4655858a784988f880c1b8c7feabbf02dfdf045', + 'reference' => 'eed83939f1aed3eee517d03a33f5ec587ac529b5', ), 'netresearch/jsonmapper' => array ( @@ -274,12 +274,12 @@ ), 'nette/utils' => array ( - 'pretty_version' => 'v3.2.2', - 'version' => '3.2.2.0', + 'pretty_version' => 'v3.2.5', + 'version' => '3.2.5.0', 'aliases' => array ( ), - 'reference' => '967cfc4f9a1acd5f1058d76715a424c53343c20c', + 'reference' => '9cd80396ca58d7969ab44fc7afcf03624dfa526e', ), 'pguardiario/phpuri' => array ( @@ -328,30 +328,30 @@ ), 'phpdocumentor/reflection-docblock' => array ( - 'pretty_version' => '5.2.2', - 'version' => '5.2.2.0', + 'pretty_version' => '5.3.0', + 'version' => '5.3.0.0', 'aliases' => array ( ), - 'reference' => '069a785b2141f5bcf49f3e353548dc1cce6df556', + 'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170', ), 'phpdocumentor/type-resolver' => array ( - 'pretty_version' => '1.4.0', - 'version' => '1.4.0.0', + 'pretty_version' => '1.5.1', + 'version' => '1.5.1.0', 'aliases' => array ( ), - 'reference' => '6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0', + 'reference' => 'a12f7e301eb7258bb68acd89d4aefa05c2906cae', ), 'psr/container' => array ( - 'pretty_version' => '1.1.1', - 'version' => '1.1.1.0', + 'pretty_version' => '1.1.2', + 'version' => '1.1.2.0', 'aliases' => array ( ), - 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', + 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', ), 'psr/container-implementation' => array ( @@ -413,12 +413,12 @@ ), 'sabre/event' => array ( - 'pretty_version' => '5.1.2', - 'version' => '5.1.2.0', + 'pretty_version' => '5.1.4', + 'version' => '5.1.4.0', 'aliases' => array ( ), - 'reference' => 'c120bec57c17b6251a496efc82b732418b49d50a', + 'reference' => 'd7da22897125d34d7eddf7977758191c06a74497', ), 'sammo-hid/sammo' => array ( @@ -427,16 +427,7 @@ 'aliases' => array ( ), - 'reference' => 'cf3f40b5787b2a1aed9255775143108ef5b1f278', - ), - 'scssphp/scssphp' => - array ( - 'pretty_version' => 'v1.6.0', - 'version' => '1.6.0.0', - 'aliases' => - array ( - ), - 'reference' => 'b83594e2323c5d6e80785df3f91b9d1d32aad530', + 'reference' => '872755e57f84720a9c4c63d5455441f83c41f6c6', ), 'sergeytsalkov/meekrodb' => array ( @@ -449,12 +440,12 @@ ), 'symfony/console' => array ( - 'pretty_version' => 'v5.3.6', - 'version' => '5.3.6.0', + 'pretty_version' => 'v5.3.10', + 'version' => '5.3.10.0', 'aliases' => array ( ), - 'reference' => '51b71afd6d2dc8f5063199357b9880cea8d8bfe2', + 'reference' => 'd4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3', ), 'symfony/deprecation-contracts' => array ( @@ -467,12 +458,12 @@ ), 'symfony/lock' => array ( - 'pretty_version' => 'v4.4.27', - 'version' => '4.4.27.0', + 'pretty_version' => 'v4.4.33', + 'version' => '4.4.33.0', 'aliases' => array ( ), - 'reference' => '6ca476d4ac992802f2a4043929f68f1818449486', + 'reference' => '567d29b1bc6e3937652054dafc069151d17824a9', ), 'symfony/polyfill-ctype' => array ( @@ -557,21 +548,21 @@ ), 'symfony/string' => array ( - 'pretty_version' => 'v5.3.3', - 'version' => '5.3.3.0', + 'pretty_version' => 'v5.3.10', + 'version' => '5.3.10.0', 'aliases' => array ( ), - 'reference' => 'bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1', + 'reference' => 'd70c35bb20bbca71fc4ab7921e3c6bda1a82a60c', ), 'symfony/translation' => array ( - 'pretty_version' => 'v5.3.7', - 'version' => '5.3.7.0', + 'pretty_version' => 'v5.3.10', + 'version' => '5.3.10.0', 'aliases' => array ( ), - 'reference' => '4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6', + 'reference' => '6ef197aea2ac8b9cd63e0da7522b3771714035aa', ), 'symfony/translation-contracts' => array ( @@ -591,12 +582,12 @@ ), 'tysonandre/var_representation_polyfill' => array ( - 'pretty_version' => '0.0.2', - 'version' => '0.0.2.0', + 'pretty_version' => '0.1.1', + 'version' => '0.1.1.0', 'aliases' => array ( ), - 'reference' => '3f17999ee1f257319ddc6721dd26ebbc5d175f33', + 'reference' => '0a942e74e18af5514749895507bc6ca7ab96399a', ), 'vlucas/valitron' => array ( diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index 92370c5a..580fa960 100644 --- a/vendor/composer/platform_check.php +++ b/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/vendor/composer/semver/CHANGELOG.md b/vendor/composer/semver/CHANGELOG.md index 67785e4d..4542fa3b 100644 --- a/vendor/composer/semver/CHANGELOG.md +++ b/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/vendor/composer/semver/src/VersionParser.php b/vendor/composer/semver/src/VersionParser.php index ee4420ae..1754a763 100644 --- a/vendor/composer/semver/src/VersionParser.php +++ b/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/vendor/doctrine/inflector/README.md b/vendor/doctrine/inflector/README.md index 341f8b2a..6e3a97f7 100644 --- a/vendor/doctrine/inflector/README.md +++ b/vendor/doctrine/inflector/README.md @@ -3,6 +3,5 @@ Doctrine Inflector is a small library that can perform string manipulations with regard to uppercase/lowercase and singular/plural forms of words. -[![Build Status](https://travis-ci.org/doctrine/inflector.svg)](https://travis-ci.org/doctrine/inflector) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/doctrine/inflector/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/doctrine/inflector/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/doctrine/inflector/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/doctrine/inflector/?branch=master) +[![Build Status](https://github.com/doctrine/inflector/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/inflector/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.0.x) +[![Code Coverage](https://codecov.io/gh/doctrine/inflector/branch/2.0.x/graph/badge.svg)](https://codecov.io/gh/doctrine/inflector/branch/2.0.x) diff --git a/vendor/doctrine/inflector/composer.json b/vendor/doctrine/inflector/composer.json index 0cd85e5f..f08fdc3b 100644 --- a/vendor/doctrine/inflector/composer.json +++ b/vendor/doctrine/inflector/composer.json @@ -16,11 +16,12 @@ "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^7.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "doctrine/coding-standard": "^8.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^4.10" }, "autoload": { "psr-4": { @@ -31,10 +32,5 @@ "psr-4": { "Doctrine\\Tests\\Inflector\\": "tests/Doctrine/Tests/Inflector" } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } } } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php index b59ac46c..2d529087 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php @@ -17,7 +17,7 @@ class CachedWordInflector implements WordInflector $this->wordInflector = $wordInflector; } - public function inflect(string $word) : string + public function inflect(string $word): string { return $this->cache[$word] ?? $this->cache[$word] = $this->wordInflector->inflect($word); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php index 1b15061a..166061d2 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Doctrine\Inflector; use Doctrine\Inflector\Rules\Ruleset; + use function array_unshift; abstract class GenericLanguageInflectorFactory implements LanguageInflectorFactory @@ -21,7 +22,7 @@ abstract class GenericLanguageInflectorFactory implements LanguageInflectorFacto $this->pluralRulesets[] = $this->getPluralRuleset(); } - final public function build() : Inflector + final public function build(): Inflector { return new Inflector( new CachedWordInflector(new RulesetInflector( @@ -33,7 +34,7 @@ abstract class GenericLanguageInflectorFactory implements LanguageInflectorFacto ); } - final public function withSingularRules(?Ruleset $singularRules, bool $reset = false) : LanguageInflectorFactory + final public function withSingularRules(?Ruleset $singularRules, bool $reset = false): LanguageInflectorFactory { if ($reset) { $this->singularRulesets = []; @@ -46,7 +47,7 @@ abstract class GenericLanguageInflectorFactory implements LanguageInflectorFacto return $this; } - final public function withPluralRules(?Ruleset $pluralRules, bool $reset = false) : LanguageInflectorFactory + final public function withPluralRules(?Ruleset $pluralRules, bool $reset = false): LanguageInflectorFactory { if ($reset) { $this->pluralRulesets = []; @@ -59,7 +60,7 @@ abstract class GenericLanguageInflectorFactory implements LanguageInflectorFacto return $this; } - abstract protected function getSingularRuleset() : Ruleset; + abstract protected function getSingularRuleset(): Ruleset; - abstract protected function getPluralRuleset() : Ruleset; + abstract protected function getPluralRuleset(): Ruleset; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php index 24119185..610a4cf4 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Doctrine\Inflector; use RuntimeException; + use function chr; use function function_exists; use function lcfirst; @@ -228,7 +229,7 @@ class Inflector /** * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'. */ - public function tableize(string $word) : string + public function tableize(string $word): string { $tableized = preg_replace('~(?<=\\w)([A-Z])~u', '_$1', $word); @@ -245,7 +246,7 @@ class Inflector /** * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'. */ - public function classify(string $word) : string + public function classify(string $word): string { return str_replace([' ', '_', '-'], '', ucwords($word, ' _-')); } @@ -253,7 +254,7 @@ class Inflector /** * Camelizes a word. This uses the classify() method and turns the first character to lowercase. */ - public function camelize(string $word) : string + public function camelize(string $word): string { return lcfirst($this->classify($word)); } @@ -283,7 +284,7 @@ class Inflector * * @return string The string with all delimiter-separated words capitalized. */ - public function capitalize(string $string, string $delimiters = " \n\t\r\0\x0B-") : string + public function capitalize(string $string, string $delimiters = " \n\t\r\0\x0B-"): string { return ucwords($string, $delimiters); } @@ -293,7 +294,7 @@ class Inflector * * @param string $string The string to check for utf8 characters in. */ - public function seemsUtf8(string $string) : bool + public function seemsUtf8(string $string): bool { for ($i = 0; $i < strlen($string); $i++) { if (ord($string[$i]) < 0x80) { @@ -331,7 +332,7 @@ class Inflector * * @return string Unaccented string */ - public function unaccent(string $string) : string + public function unaccent(string $string): string { if (preg_match('/[\x80-\xff]/', $string) === false) { return $string; @@ -444,7 +445,7 @@ class Inflector * * @return string Urlized string. */ - public function urlize(string $string) : string + public function urlize(string $string): string { // Remove all non url friendly characters with the unaccent function $unaccented = $this->unaccent($string); @@ -487,7 +488,7 @@ class Inflector * * @return string The word in singular form. */ - public function singularize(string $word) : string + public function singularize(string $word): string { return $this->singularizer->inflect($word); } @@ -499,7 +500,7 @@ class Inflector * * @return string The word in plural form. */ - public function pluralize(string $word) : string + public function pluralize(string $word): string { return $this->pluralizer->inflect($word); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php index 44bba5d7..a0740a74 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php @@ -11,30 +11,37 @@ use Doctrine\Inflector\Rules\Portuguese; use Doctrine\Inflector\Rules\Spanish; use Doctrine\Inflector\Rules\Turkish; use InvalidArgumentException; + use function sprintf; final class InflectorFactory { - public static function create() : LanguageInflectorFactory + public static function create(): LanguageInflectorFactory { return self::createForLanguage(Language::ENGLISH); } - public static function createForLanguage(string $language) : LanguageInflectorFactory + public static function createForLanguage(string $language): LanguageInflectorFactory { switch ($language) { case Language::ENGLISH: return new English\InflectorFactory(); + case Language::FRENCH: return new French\InflectorFactory(); + case Language::NORWEGIAN_BOKMAL: return new NorwegianBokmal\InflectorFactory(); + case Language::PORTUGUESE: return new Portuguese\InflectorFactory(); + case Language::SPANISH: return new Spanish\InflectorFactory(); + case Language::TURKISH: return new Turkish\InflectorFactory(); + default: throw new InvalidArgumentException(sprintf( 'Language "%s" is not supported.', diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php index a80dd6c4..a58f43c0 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php @@ -15,7 +15,7 @@ interface LanguageInflectorFactory * * @return $this */ - public function withSingularRules(?Ruleset $singularRules, bool $reset = false) : self; + public function withSingularRules(?Ruleset $singularRules, bool $reset = false): self; /** * Applies custom rules for pluralisation @@ -24,10 +24,10 @@ interface LanguageInflectorFactory * * @return $this */ - public function withPluralRules(?Ruleset $pluralRules, bool $reset = false) : self; + public function withPluralRules(?Ruleset $pluralRules, bool $reset = false): self; /** * Builds the inflector instance with all applicable rules */ - public function build() : Inflector; + public function build(): Inflector; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php index 63806ecc..2fdf5353 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php @@ -6,7 +6,7 @@ namespace Doctrine\Inflector; class NoopWordInflector implements WordInflector { - public function inflect(string $word) : string + public function inflect(string $word): string { return $word; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php index 0de97a27..8f0919fc 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('(s)tatuses$'), '\1\2tatus'); yield new Transformation(new Pattern('(s)tatus$'), '\1\2tatus'); @@ -62,7 +62,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('(s)tatus$'), '\1\2tatuses'); yield new Transformation(new Pattern('(quiz)$'), '\1zes'); @@ -94,7 +94,7 @@ class Inflectible /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('atlas'), new Word('atlases')); yield new Substitution(new Word('axe'), new Word('axes')); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php index cd40021f..85f92aa8 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php index fcc1d19c..7ccc1038 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php index be37a97b..e2656cc4 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); @@ -33,7 +33,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); @@ -46,7 +46,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern('\w+media'); yield new Pattern('advice'); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php index b3f22ed2..c8f1f8fd 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('/(b|cor|ém|gemm|soupir|trav|vant|vitr)aux$/'), '\1ail'); yield new Transformation(new Pattern('/ails$/'), 'ail'); @@ -26,21 +26,22 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('/(s|x|z)$/'), '\1'); yield new Transformation(new Pattern('/(b|cor|ém|gemm|soupir|trav|vant|vitr)ail$/'), '\1aux'); yield new Transformation(new Pattern('/ail$/'), 'ails'); + yield new Transformation(new Pattern('/(chacal|carnaval|festival|récital)$/'), '\1s'); yield new Transformation(new Pattern('/al$/'), 'aux'); - yield new Transformation(new Pattern('/(bleu|émeu|landau|lieu|pneu|sarrau)$/'), '\1s'); - yield new Transformation(new Pattern('/(bijou|caillou|chou|genou|hibou|joujou|pou|au|eu|eau)$/'), '\1x'); + yield new Transformation(new Pattern('/(bleu|émeu|landau|pneu|sarrau)$/'), '\1s'); + yield new Transformation(new Pattern('/(bijou|caillou|chou|genou|hibou|joujou|lieu|pou|au|eu|eau)$/'), '\1x'); yield new Transformation(new Pattern('/$/'), 's'); } /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('monsieur'), new Word('messieurs')); yield new Substitution(new Word('madame'), new Word('mesdames')); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php index 7042d498..62e31f08 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php index d25f8a8c..6cd45bc5 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php index 2fdc020a..3cf2444a 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); } @@ -19,7 +19,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); } @@ -27,7 +27,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern(''); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php index 9fae0f36..c00317dc 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('/re$/i'), 'r'); yield new Transformation(new Pattern('/er$/i'), ''); @@ -23,7 +23,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('/e$/i'), 'er'); yield new Transformation(new Pattern('/r$/i'), 're'); @@ -33,7 +33,7 @@ class Inflectible /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('konto'), new Word('konti')); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php index 41b9b384..912ae41b 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php index 5a92132a..9902d353 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php index c6b9fc79..5d878c6d 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); } @@ -19,7 +19,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); } @@ -27,7 +27,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern('barn'); yield new Pattern('fjell'); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php index 3486eba5..a5f0ef77 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php @@ -25,17 +25,17 @@ final class Pattern } } - public function getPattern() : string + public function getPattern(): string { return $this->pattern; } - public function getRegex() : string + public function getRegex(): string { return $this->regex; } - public function matches(string $word) : bool + public function matches(string $word): bool { return preg_match($this->getRegex(), $word) === 1; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php index a71f1ed2..e8d45cb7 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php @@ -20,14 +20,14 @@ class Patterns { $this->patterns = $patterns; - $patterns = array_map(static function (Pattern $pattern) : string { + $patterns = array_map(static function (Pattern $pattern): string { return $pattern->getPattern(); }, $this->patterns); $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i'; } - public function matches(string $word) : bool + public function matches(string $word): bool { return preg_match($this->regex, $word, $regs) === 1; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php index 155055f7..95564d49 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('/^(g|)ases$/i'), '\1ás'); yield new Transformation(new Pattern('/(japon|escoc|ingl|dinamarqu|fregu|portugu)eses$/i'), '\1ês'); @@ -37,7 +37,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('/^(alem|c|p)ao$/i'), '\1aes'); yield new Transformation(new Pattern('/^(irm|m)ao$/i'), '\1aos'); @@ -61,7 +61,7 @@ class Inflectible /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('abdomen'), new Word('abdomens')); yield new Substitution(new Word('alemão'), new Word('alemães')); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php index 536587e0..bf12d54f 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php index de69b7ec..897f1776 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php index 52360c45..58c34f9b 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); } @@ -19,7 +19,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); } @@ -27,7 +27,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern('tórax'); yield new Pattern('tênis'); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php index a2d32c1d..39889b79 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php @@ -22,17 +22,17 @@ class Ruleset $this->irregular = $irregular; } - public function getRegular() : Transformations + public function getRegular(): Transformations { return $this->regular; } - public function getUninflected() : Patterns + public function getUninflected(): Patterns { return $this->uninflected; } - public function getIrregular() : Substitutions + public function getIrregular(): Substitutions { return $this->irregular; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php index 6cace86a..c6862fa4 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('/ereses$/'), 'erés'); yield new Transformation(new Pattern('/iones$/'), 'ión'); @@ -26,7 +26,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('/ú([sn])$/i'), 'u\1es'); yield new Transformation(new Pattern('/ó([sn])$/i'), 'o\1es'); @@ -42,7 +42,7 @@ class Inflectible /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('el'), new Word('los')); yield new Substitution(new Word('papá'), new Word('papás')); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php index da643bda..85084ca3 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php index f77a739b..d7399725 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php index b13281e8..c743b393 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); } @@ -19,7 +19,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); } @@ -27,7 +27,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern('lunes'); yield new Pattern('rompecabezas'); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php index 681ab631..471aff9e 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php @@ -18,12 +18,12 @@ final class Substitution $this->to = $to; } - public function getFrom() : Word + public function getFrom(): Word { return $this->from; } - public function getTo() : Word + public function getTo(): Word { return $this->to; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php index 24cc34a8..17ee2961 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Doctrine\Inflector\Rules; use Doctrine\Inflector\WordInflector; + use function strtolower; use function strtoupper; use function substr; @@ -21,7 +22,7 @@ class Substitutions implements WordInflector } } - public function getFlippedSubstitutions() : Substitutions + public function getFlippedSubstitutions(): Substitutions { $substitutions = []; @@ -35,7 +36,7 @@ class Substitutions implements WordInflector return new Substitutions(...$substitutions); } - public function inflect(string $word) : string + public function inflect(string $word): string { $lowerWord = strtolower($word); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php index 84ef08b8..30dcd594 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Doctrine\Inflector\Rules; use Doctrine\Inflector\WordInflector; + use function preg_replace; final class Transformation implements WordInflector @@ -21,17 +22,17 @@ final class Transformation implements WordInflector $this->replacement = $replacement; } - public function getPattern() : Pattern + public function getPattern(): Pattern { return $this->pattern; } - public function getReplacement() : string + public function getReplacement(): string { return $this->replacement; } - public function inflect(string $word) : string + public function inflect(string $word): string { return (string) preg_replace($this->pattern->getRegex(), $this->replacement, $word); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php index 9f4724e5..b6a48fa8 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php @@ -16,7 +16,7 @@ class Transformations implements WordInflector $this->transformations = $transformations; } - public function inflect(string $word) : string + public function inflect(string $word): string { foreach ($this->transformations as $transformation) { if ($transformation->getPattern()->matches($word)) { diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php index 74900cb9..d7b7064c 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('/l[ae]r$/i'), ''); } @@ -22,7 +22,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('/([eöiü][^aoıueöiü]{0,6})$/u'), '\1ler'); yield new Transformation(new Pattern('/([aoıu][^aoıueöiü]{0,6})$/u'), '\1lar'); @@ -31,7 +31,7 @@ class Inflectible /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('ben'), new Word('biz')); yield new Substitution(new Word('sen'), new Word('siz')); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php index 83b80467..c6cdebe9 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php index dd0840c5..ea564ac7 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php index c95ccbf9..a75d2486 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); } @@ -19,7 +19,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); } @@ -27,7 +27,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern('lunes'); yield new Pattern('rompecabezas'); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php index 5156e934..98e93ba2 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php @@ -14,7 +14,7 @@ class Word $this->word = $word; } - public function getWord() : string + public function getWord(): string { return $this->word; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php index 0e3a5ebd..12b2ed5b 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Doctrine\Inflector; use Doctrine\Inflector\Rules\Ruleset; + use function array_merge; /** @@ -26,7 +27,7 @@ class RulesetInflector implements WordInflector $this->rulesets = array_merge([$ruleset], $rulesets); } - public function inflect(string $word) : string + public function inflect(string $word): string { if ($word === '') { return ''; diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php index f2570558..b88b1d69 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php @@ -6,5 +6,5 @@ namespace Doctrine\Inflector; interface WordInflector { - public function inflect(string $word) : string; + public function inflect(string $word): string; } diff --git a/vendor/doctrine/inflector/psalm.xml b/vendor/doctrine/inflector/psalm.xml new file mode 100644 index 00000000..677e8d4d --- /dev/null +++ b/vendor/doctrine/inflector/psalm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/vendor/guzzlehttp/promises/CHANGELOG.md b/vendor/guzzlehttp/promises/CHANGELOG.md index 14796c47..235e13bc 100644 --- a/vendor/guzzlehttp/promises/CHANGELOG.md +++ b/vendor/guzzlehttp/promises/CHANGELOG.md @@ -1,7 +1,26 @@ # CHANGELOG +## 1.5.1 - 2021-10-22 + +### Fixed + +- Revert "Call handler when waiting on fulfilled/rejected Promise" +- Fix pool memory leak when empty array of promises provided + +## 1.5.0 - 2021-10-07 + +### Changed + +- Call handler when waiting on fulfilled/rejected Promise + +### Fixed + +- Fix manually settle promises generated with Utils::task + ## 1.4.1 - 2021-02-18 +### Fixed + - Fixed `each_limit` skipping promises and failing ## 1.4.0 - 2020-09-30 diff --git a/vendor/guzzlehttp/promises/LICENSE b/vendor/guzzlehttp/promises/LICENSE index 67f91a14..9f0f943b 100644 --- a/vendor/guzzlehttp/promises/LICENSE +++ b/vendor/guzzlehttp/promises/LICENSE @@ -1,4 +1,9 @@ -Copyright (c) 2015-2016 Michael Dowling, https://github.com/mtdowling +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling +Copyright (c) 2015 Graham Campbell +Copyright (c) 2017 Tobias Schultze +Copyright (c) 2020 Tobias Nyholm 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/vendor/guzzlehttp/promises/README.md b/vendor/guzzlehttp/promises/README.md index a95c6059..c175fec7 100644 --- a/vendor/guzzlehttp/promises/README.md +++ b/vendor/guzzlehttp/promises/README.md @@ -530,3 +530,18 @@ A static API was first introduced in 1.4.0, in order to mitigate problems with f | `is_rejected` | `Is::rejected` | | `is_settled` | `Is::settled` | | `coroutine` | `Coroutine::of` | + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information. + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/promises/composer.json b/vendor/guzzlehttp/promises/composer.json index db44d9e3..c959fb32 100644 --- a/vendor/guzzlehttp/promises/composer.json +++ b/vendor/guzzlehttp/promises/composer.json @@ -4,10 +4,25 @@ "keywords": ["promise"], "license": "MIT", "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "require": { @@ -33,7 +48,11 @@ }, "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } + }, + "config": { + "preferred-install": "dist", + "sort-packages": true } } diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php index 748f4712..38ecb59b 100644 --- a/vendor/guzzlehttp/promises/src/EachPromise.php +++ b/vendor/guzzlehttp/promises/src/EachPromise.php @@ -79,9 +79,7 @@ class EachPromise implements PromisorInterface $this->createPromise(); /** @psalm-assert Promise $this->aggregate */ $this->iterable->rewind(); - if (!$this->checkIfFinished()) { - $this->refillPending(); - } + $this->refillPending(); } catch (\Throwable $e) { /** * @psalm-suppress NullReference @@ -107,6 +105,9 @@ class EachPromise implements PromisorInterface { $this->mutex = false; $this->aggregate = new Promise(function () { + if ($this->checkIfFinished()) { + return; + } reset($this->pending); // Consume a potentially fluctuating list of promises while // ensuring that indexes are maintained (precluding array_shift). diff --git a/vendor/guzzlehttp/promises/src/Utils.php b/vendor/guzzlehttp/promises/src/Utils.php index 1cee8620..8647126d 100644 --- a/vendor/guzzlehttp/promises/src/Utils.php +++ b/vendor/guzzlehttp/promises/src/Utils.php @@ -48,7 +48,9 @@ final class Utils $promise = new Promise([$queue, 'run']); $queue->add(function () use ($task, $promise) { try { - $promise->resolve($task()); + if (Is::pending($promise)) { + $promise->resolve($task()); + } } catch (\Throwable $e) { $promise->reject($e); } catch (\Exception $e) { diff --git a/vendor/guzzlehttp/psr7/.github/FUNDING.yml b/vendor/guzzlehttp/psr7/.github/FUNDING.yml new file mode 100644 index 00000000..7d222c58 --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: [Nyholm, GrahamCampbell] +tidelift: "packagist/guzzlehttp/psr7" diff --git a/vendor/guzzlehttp/psr7/.github/stale.yml b/vendor/guzzlehttp/psr7/.github/stale.yml new file mode 100644 index 00000000..53faa71b --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/stale.yml @@ -0,0 +1,14 @@ +daysUntilStale: 120 +daysUntilClose: 14 +exemptLabels: + - lifecycle/keep-open + - lifecycle/ready-for-merge +# Label to use when marking an issue as stale +staleLabel: lifecycle/stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/vendor/guzzlehttp/psr7/.github/workflows/bc.yml b/vendor/guzzlehttp/psr7/.github/workflows/bc.yml deleted file mode 100644 index 9eaedbce..00000000 --- a/vendor/guzzlehttp/psr7/.github/workflows/bc.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: BC Check - -on: - pull_request: - -jobs: - roave-bc-check: - name: Roave BC Check - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Roave BC Check - uses: docker://nyholm/roave-bc-check-ga diff --git a/vendor/guzzlehttp/psr7/.github/workflows/ci.yml b/vendor/guzzlehttp/psr7/.github/workflows/ci.yml index da7414e5..eda7dceb 100644 --- a/vendor/guzzlehttp/psr7/.github/workflows/ci.yml +++ b/vendor/guzzlehttp/psr7/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: max-parallel: 10 matrix: - php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] steps: - name: Set up PHP @@ -23,8 +23,12 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Mimic PHP 8.0 + run: composer config platform.php 8.0.999 + if: matrix.php > 8 + - name: Install dependencies - run: composer update --no-interaction --no-progress --prefer-dist + run: composer update --no-interaction --no-progress - name: Run tests run: make test diff --git a/vendor/guzzlehttp/psr7/.github/workflows/integration.yml b/vendor/guzzlehttp/psr7/.github/workflows/integration.yml index b6e0eb24..3c31f9ef 100644 --- a/vendor/guzzlehttp/psr7/.github/workflows/integration.yml +++ b/vendor/guzzlehttp/psr7/.github/workflows/integration.yml @@ -26,7 +26,7 @@ jobs: - name: Download dependencies uses: ramsey/composer-install@v1 with: - composer-options: --no-interaction --prefer-dist --optimize-autoloader + composer-options: --no-interaction --optimize-autoloader - name: Start server run: php -S 127.0.0.1:10002 tests/Integration/server.php & diff --git a/vendor/guzzlehttp/psr7/CHANGELOG.md b/vendor/guzzlehttp/psr7/CHANGELOG.md index 6a6b7bf9..f40736c4 100644 --- a/vendor/guzzlehttp/psr7/CHANGELOG.md +++ b/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +## 1.8.3 - 2021-10-05 + +### Fixed + +- Return `null` in caching stream size if remote size is `null` + ## 1.8.2 - 2021-04-26 ### Fixed diff --git a/vendor/guzzlehttp/psr7/LICENSE b/vendor/guzzlehttp/psr7/LICENSE index 581d95f9..51c7ec81 100644 --- a/vendor/guzzlehttp/psr7/LICENSE +++ b/vendor/guzzlehttp/psr7/LICENSE @@ -1,4 +1,11 @@ -Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling +Copyright (c) 2015 Márk Sági-Kazár +Copyright (c) 2015 Graham Campbell +Copyright (c) 2016 Tobias Schultze +Copyright (c) 2016 George Mponos +Copyright (c) 2018 Tobias Nyholm 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/vendor/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md index acfabfdc..464cae4f 100644 --- a/vendor/guzzlehttp/psr7/README.md +++ b/vendor/guzzlehttp/psr7/README.md @@ -807,3 +807,18 @@ Whether two URIs can be considered equivalent. Both URIs are normalized automati `$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. This of course assumes they will be resolved against the same base URI. If this is not the case, determination of equivalence or difference of relative references does not mean anything. + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/psr7/composer.json b/vendor/guzzlehttp/psr7/composer.json index 58dcb07e..bfa7cfdc 100644 --- a/vendor/guzzlehttp/psr7/composer.json +++ b/vendor/guzzlehttp/psr7/composer.json @@ -1,17 +1,37 @@ { "name": "guzzlehttp/psr7", - "type": "library", "description": "PSR-7 message implementation that also provides common utility methods", "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"], "license": "MIT", "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], @@ -45,5 +65,9 @@ "branch-alias": { "dev-master": "1.7-dev" } + }, + "config": { + "preferred-install": "dist", + "sort-packages": true } } diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php index fe749e98..febade9f 100644 --- a/vendor/guzzlehttp/psr7/src/CachingStream.php +++ b/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -36,7 +36,13 @@ class CachingStream implements StreamInterface public function getSize() { - return max($this->stream->getSize(), $this->remoteStream->getSize()); + $remoteSize = $this->remoteStream->getSize(); + + if (null === $remoteSize) { + return null; + } + + return max($this->stream->getSize(), $remoteSize); } public function rewind() diff --git a/vendor/illuminate/bus/Batch.php b/vendor/illuminate/bus/Batch.php index 7e5dddba..db8779d3 100644 --- a/vendor/illuminate/bus/Batch.php +++ b/vendor/illuminate/bus/Batch.php @@ -7,7 +7,6 @@ use Closure; use Illuminate\Contracts\Queue\Factory as QueueFactory; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Queue\CallQueuedClosure; -use Illuminate\Queue\SerializableClosure; use Illuminate\Support\Arr; use Illuminate\Support\Collection; use JsonSerializable; @@ -420,7 +419,7 @@ class Batch implements Arrayable, JsonSerializable /** * Invoke a batch callback handler. * - * @param \Illuminate\Queue\SerializableClosure|callable $handler + * @param callable $handler * @param \Illuminate\Bus\Batch $batch * @param \Throwable|null $e * @return void @@ -428,9 +427,7 @@ class Batch implements Arrayable, JsonSerializable protected function invokeHandlerCallback($handler, Batch $batch, Throwable $e = null) { try { - return $handler instanceof SerializableClosure - ? $handler->__invoke($batch, $e) - : call_user_func($handler, $batch, $e); + return $handler($batch, $e); } catch (Throwable $e) { if (function_exists('report')) { report($e); diff --git a/vendor/illuminate/bus/PendingBatch.php b/vendor/illuminate/bus/PendingBatch.php index a80284b9..a831c5fb 100644 --- a/vendor/illuminate/bus/PendingBatch.php +++ b/vendor/illuminate/bus/PendingBatch.php @@ -6,7 +6,7 @@ use Closure; use Illuminate\Bus\Events\BatchDispatched; use Illuminate\Contracts\Container\Container; use Illuminate\Contracts\Events\Dispatcher as EventDispatcher; -use Illuminate\Queue\SerializableClosure; +use Illuminate\Queue\SerializableClosureFactory; use Illuminate\Support\Arr; use Illuminate\Support\Collection; use Throwable; @@ -78,7 +78,7 @@ class PendingBatch public function then($callback) { $this->options['then'][] = $callback instanceof Closure - ? new SerializableClosure($callback) + ? SerializableClosureFactory::make($callback) : $callback; return $this; @@ -103,7 +103,7 @@ class PendingBatch public function catch($callback) { $this->options['catch'][] = $callback instanceof Closure - ? new SerializableClosure($callback) + ? SerializableClosureFactory::make($callback) : $callback; return $this; @@ -128,7 +128,7 @@ class PendingBatch public function finally($callback) { $this->options['finally'][] = $callback instanceof Closure - ? new SerializableClosure($callback) + ? SerializableClosureFactory::make($callback) : $callback; return $this; diff --git a/vendor/illuminate/bus/Queueable.php b/vendor/illuminate/bus/Queueable.php index b4270e84..8e930605 100644 --- a/vendor/illuminate/bus/Queueable.php +++ b/vendor/illuminate/bus/Queueable.php @@ -4,7 +4,6 @@ namespace Illuminate\Bus; use Closure; use Illuminate\Queue\CallQueuedClosure; -use Illuminate\Queue\SerializableClosure; use Illuminate\Support\Arr; use RuntimeException; @@ -245,7 +244,7 @@ trait Queueable public function invokeChainCatchCallbacks($e) { collect($this->chainCatchCallbacks)->each(function ($callback) use ($e) { - $callback instanceof SerializableClosure ? $callback->__invoke($e) : call_user_func($callback, $e); + $callback($e); }); } } diff --git a/vendor/illuminate/bus/UniqueLock.php b/vendor/illuminate/bus/UniqueLock.php new file mode 100644 index 00000000..a937b186 --- /dev/null +++ b/vendor/illuminate/bus/UniqueLock.php @@ -0,0 +1,48 @@ +cache = $cache; + } + + /** + * Attempt to acquire a lock for the given job. + * + * @param mixed $job + * @return bool + */ + public function acquire($job) + { + $uniqueId = method_exists($job, 'uniqueId') + ? $job->uniqueId() + : ($job->uniqueId ?? ''); + + $cache = method_exists($job, 'uniqueVia') + ? $job->uniqueVia() + : $this->cache; + + return (bool) $cache->lock( + $key = 'laravel_unique_job:'.get_class($job).$uniqueId, + $job->uniqueFor ?? 0 + )->get(); + } +} diff --git a/vendor/illuminate/collections/Arr.php b/vendor/illuminate/collections/Arr.php index 2c38b3cc..d4ebd899 100644 --- a/vendor/illuminate/collections/Arr.php +++ b/vendor/illuminate/collections/Arr.php @@ -393,6 +393,19 @@ class Arr return array_keys($keys) !== $keys; } + /** + * Determines if an array is a list. + * + * An array is a "list" if all array keys are sequential integers starting from 0 with no gaps in between. + * + * @param array $array + * @return bool + */ + public static function isList($array) + { + return ! self::isAssoc($array); + } + /** * Get a subset of the items from the given array. * diff --git a/vendor/illuminate/collections/Collection.php b/vendor/illuminate/collections/Collection.php index fae1dcf8..a6e3e934 100644 --- a/vendor/illuminate/collections/Collection.php +++ b/vendor/illuminate/collections/Collection.php @@ -4,11 +4,12 @@ namespace Illuminate\Support; use ArrayAccess; use ArrayIterator; +use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString; use Illuminate\Support\Traits\EnumeratesValues; use Illuminate\Support\Traits\Macroable; use stdClass; -class Collection implements ArrayAccess, Enumerable +class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerable { use EnumeratesValues, Macroable; @@ -501,6 +502,29 @@ class Collection implements ArrayAccess, Enumerable return true; } + /** + * Determine if any of the keys exist in the collection. + * + * @param mixed $key + * @return bool + */ + public function hasAny($key) + { + if ($this->isEmpty()) { + return false; + } + + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if ($this->has($value)) { + return true; + } + } + + return false; + } + /** * Concatenate values of a given key as a string. * @@ -1411,6 +1435,28 @@ class Collection implements ArrayAccess, Enumerable return $this; } + /** + * Return only unique items from the collection array. + * + * @param string|callable|null $key + * @param bool $strict + * @return static + */ + public function unique($key = null, $strict = false) + { + $callback = $this->valueRetriever($key); + + $exists = []; + + return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) { + if (in_array($id = $callback($item, $key), $exists, $strict)) { + return true; + } + + $exists[] = $id; + }); + } + /** * Reset the keys on the underlying array. * diff --git a/vendor/illuminate/collections/LazyCollection.php b/vendor/illuminate/collections/LazyCollection.php index 09f6114f..70f10706 100644 --- a/vendor/illuminate/collections/LazyCollection.php +++ b/vendor/illuminate/collections/LazyCollection.php @@ -5,12 +5,13 @@ namespace Illuminate\Support; use ArrayIterator; use Closure; use DateTimeInterface; +use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString; use Illuminate\Support\Traits\EnumeratesValues; use Illuminate\Support\Traits\Macroable; use IteratorAggregate; use stdClass; -class LazyCollection implements Enumerable +class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable { use EnumeratesValues, Macroable; @@ -512,6 +513,25 @@ class LazyCollection implements Enumerable return false; } + /** + * Determine if any of the keys exist in the collection. + * + * @param mixed $key + * @return bool + */ + public function hasAny($key) + { + $keys = array_flip(is_array($key) ? $key : func_get_args()); + + foreach ($this as $key => $value) { + if (array_key_exists($key, $keys)) { + return true; + } + } + + return false; + } + /** * Concatenate values of a given key as a string. * @@ -1352,6 +1372,30 @@ class LazyCollection implements Enumerable }); } + /** + * Return only unique items from the collection array. + * + * @param string|callable|null $key + * @param bool $strict + * @return static + */ + public function unique($key = null, $strict = false) + { + $callback = $this->valueRetriever($key); + + return new static(function () use ($callback, $strict) { + $exists = []; + + foreach ($this as $key => $item) { + if (! in_array($id = $callback($item, $key), $exists, $strict)) { + yield $key => $item; + + $exists[] = $id; + } + } + }); + } + /** * Reset the keys on the underlying array. * diff --git a/vendor/illuminate/collections/Traits/EnumeratesValues.php b/vendor/illuminate/collections/Traits/EnumeratesValues.php index 19f32a32..9eb31ea8 100644 --- a/vendor/illuminate/collections/Traits/EnumeratesValues.php +++ b/vendor/illuminate/collections/Traits/EnumeratesValues.php @@ -15,6 +15,7 @@ use Illuminate\Support\HigherOrderWhenProxy; use JsonSerializable; use Symfony\Component\VarDumper\VarDumper; use Traversable; +use UnexpectedValueException; /** * @property-read HigherOrderCollectionProxy $average @@ -45,6 +46,13 @@ use Traversable; */ trait EnumeratesValues { + /** + * Indicates that the object's string representation should be escaped when __toString is invoked. + * + * @var bool + */ + protected $escapeWhenCastingToString = false; + /** * The methods that can be proxied. * @@ -744,6 +752,49 @@ trait EnumeratesValues return $result; } + /** + * Reduce the collection to multiple aggregate values. + * + * @param callable $callback + * @param mixed ...$initial + * @return array + * + * @deprecated Use "reduceSpread" instead + * + * @throws \UnexpectedValueException + */ + public function reduceMany(callable $callback, ...$initial) + { + return $this->reduceSpread($callback, ...$initial); + } + + /** + * Reduce the collection to multiple aggregate values. + * + * @param callable $callback + * @param mixed ...$initial + * @return array + * + * @throws \UnexpectedValueException + */ + public function reduceSpread(callable $callback, ...$initial) + { + $result = $initial; + + foreach ($this as $key => $value) { + $result = call_user_func_array($callback, array_merge($result, [$value, $key])); + + if (! is_array($result)) { + throw new UnexpectedValueException(sprintf( + "%s::reduceMany expects reducer to return an array, but got a '%s' instead.", + class_basename(static::class), gettype($result) + )); + } + } + + return $result; + } + /** * Reduce an associative collection to a single value. * @@ -773,28 +824,6 @@ trait EnumeratesValues }); } - /** - * Return only unique items from the collection array. - * - * @param string|callable|null $key - * @param bool $strict - * @return static - */ - public function unique($key = null, $strict = false) - { - $callback = $this->valueRetriever($key); - - $exists = []; - - return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) { - if (in_array($id = $callback($item, $key), $exists, $strict)) { - return true; - } - - $exists[] = $id; - }); - } - /** * Return only unique items from the collection array using strict comparison. * @@ -878,7 +907,22 @@ trait EnumeratesValues */ public function __toString() { - return $this->toJson(); + return $this->escapeWhenCastingToString + ? e($this->toJson()) + : $this->toJson(); + } + + /** + * Indicate that the model's string representation should be escaped when __toString is invoked. + * + * @param bool $escape + * @return $this + */ + public function escapeWhenCastingToString($escape = true) + { + $this->escapeWhenCastingToString = $escape; + + return $this; } /** diff --git a/vendor/illuminate/container/Container.php b/vendor/illuminate/container/Container.php index 6900226d..bf7bb8e5 100755 --- a/vendor/illuminate/container/Container.php +++ b/vendor/illuminate/container/Container.php @@ -187,7 +187,9 @@ class Container implements ArrayAccess, ContainerContract } /** - * {@inheritdoc} + * {@inheritdoc} + * + * @return bool */ public function has($id) { @@ -693,7 +695,9 @@ class Container implements ArrayAccess, ContainerContract } /** - * {@inheritdoc} + * {@inheritdoc} + * + * @return mixed */ public function get($id) { diff --git a/vendor/illuminate/container/Util.php b/vendor/illuminate/container/Util.php index 8180a45a..8f7e9171 100644 --- a/vendor/illuminate/container/Util.php +++ b/vendor/illuminate/container/Util.php @@ -53,7 +53,7 @@ class Util $type = $parameter->getType(); if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) { - return; + return null; } $name = $type->getName(); diff --git a/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php b/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php new file mode 100644 index 00000000..e1be6fef --- /dev/null +++ b/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php @@ -0,0 +1,14 @@ +beforeExecutingCallbacks as $beforeExecutingCallback) { + $beforeExecutingCallback($query, $bindings, $this); + } + $this->reconnectIfMissingConnection(); $start = microtime(true); @@ -807,6 +818,19 @@ class Connection implements ConnectionInterface $this->setPdo(null)->setReadPdo(null); } + /** + * Register a hook to be run just before a database query is executed. + * + * @param \Closure $callback + * @return $this + */ + public function beforeExecuting(Closure $callback) + { + $this->beforeExecutingCallbacks[] = $callback; + + return $this; + } + /** * Register a database query listener with the connection. * diff --git a/vendor/illuminate/database/Console/Factories/stubs/factory.stub b/vendor/illuminate/database/Console/Factories/stubs/factory.stub index f7a898c9..3e00f365 100644 --- a/vendor/illuminate/database/Console/Factories/stubs/factory.stub +++ b/vendor/illuminate/database/Console/Factories/stubs/factory.stub @@ -3,17 +3,9 @@ namespace {{ factoryNamespace }}; use Illuminate\Database\Eloquent\Factories\Factory; -use {{ namespacedModel }}; class {{ factory }}Factory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var string - */ - protected $model = {{ model }}::class; - /** * Define the model's default state. * diff --git a/vendor/illuminate/database/Console/PruneCommand.php b/vendor/illuminate/database/Console/PruneCommand.php index 74be6b92..d84b0a01 100644 --- a/vendor/illuminate/database/Console/PruneCommand.php +++ b/vendor/illuminate/database/Console/PruneCommand.php @@ -19,7 +19,8 @@ class PruneCommand extends Command */ protected $signature = 'model:prune {--model=* : Class names of the models to be pruned} - {--chunk=1000 : The number of models to retrieve per chunk of models to be deleted}'; + {--chunk=1000 : The number of models to retrieve per chunk of models to be deleted} + {--pretend : Display the number of prunable records found instead of deleting them}'; /** * The console command description. @@ -44,6 +45,14 @@ class PruneCommand extends Command return; } + if ($this->option('pretend')) { + $models->each(function ($model) { + $this->pretendToPrune($model); + }); + + return; + } + $events->listen(ModelsPruned::class, function ($event) { $this->info("{$event->count} [{$event->model}] records have been pruned."); }); @@ -78,7 +87,7 @@ class PruneCommand extends Command return collect($models); } - return collect((new Finder)->in(app_path('Models'))->files()) + return collect((new Finder)->in(app_path('Models'))->files()->name('*.php')) ->map(function ($model) { $namespace = $this->laravel->getNamespace(); @@ -104,4 +113,26 @@ class PruneCommand extends Command return in_array(Prunable::class, $uses) || in_array(MassPrunable::class, $uses); } + + /** + * Display how many models will be pruned. + * + * @param string $model + * @return void + */ + protected function pretendToPrune($model) + { + $instance = new $model; + + $count = $instance->prunable() + ->when(in_array(SoftDeletes::class, class_uses_recursive(get_class($instance))), function ($query) { + $query->withTrashed(); + })->count(); + + if ($count === 0) { + $this->info("No prunable [$model] records found."); + } else { + $this->info("{$count} [{$model}] records will be pruned."); + } + } } diff --git a/vendor/illuminate/database/DBAL/TimestampType.php b/vendor/illuminate/database/DBAL/TimestampType.php index 0ab733cf..296773f4 100644 --- a/vendor/illuminate/database/DBAL/TimestampType.php +++ b/vendor/illuminate/database/DBAL/TimestampType.php @@ -4,12 +4,15 @@ namespace Illuminate\Database\DBAL; use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\PhpDateTimeMappingType; use Doctrine\DBAL\Types\Type; -class TimestampType extends Type +class TimestampType extends Type implements PhpDateTimeMappingType { /** * {@inheritdoc} + * + * @return string */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { @@ -97,6 +100,8 @@ class TimestampType extends Type /** * {@inheritdoc} + * + * @return string */ public function getName() { diff --git a/vendor/illuminate/database/DetectsConcurrencyErrors.php b/vendor/illuminate/database/DetectsConcurrencyErrors.php index adbe4dc4..c6c66f43 100644 --- a/vendor/illuminate/database/DetectsConcurrencyErrors.php +++ b/vendor/illuminate/database/DetectsConcurrencyErrors.php @@ -16,7 +16,7 @@ trait DetectsConcurrencyErrors */ protected function causedByConcurrencyError(Throwable $e) { - if ($e instanceof PDOException && $e->getCode() === '40001') { + if ($e instanceof PDOException && ($e->getCode() === 40001 || $e->getCode() === '40001')) { return true; } diff --git a/vendor/illuminate/database/DetectsLostConnections.php b/vendor/illuminate/database/DetectsLostConnections.php index 93be53b2..1cbd7b15 100644 --- a/vendor/illuminate/database/DetectsLostConnections.php +++ b/vendor/illuminate/database/DetectsLostConnections.php @@ -54,6 +54,8 @@ trait DetectsLostConnections 'SQLSTATE[08S01]: Communication link failure', 'SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host', 'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: No route to host', + 'The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.', + 'SQLSTATE[08006] [7] could not translate host name', ]); } } diff --git a/vendor/illuminate/database/Eloquent/Casts/AsStringable.php b/vendor/illuminate/database/Eloquent/Casts/AsStringable.php new file mode 100644 index 00000000..912659f3 --- /dev/null +++ b/vendor/illuminate/database/Eloquent/Casts/AsStringable.php @@ -0,0 +1,32 @@ +serializeClassCastableAttribute($key, $attributes[$key]); } + if ($this->isEnumCastable($key)) { + $attributes[$key] = isset($attributes[$key]) ? $attributes[$key]->value : null; + } + if ($attributes[$key] instanceof Arrayable) { $attributes[$key] = $attributes[$key]->toArray(); } @@ -620,6 +626,10 @@ trait HasAttributes return $this->asTimestamp($value); } + if ($this->isEnumCastable($key)) { + return $this->getEnumCastableAttributeValue($key, $value); + } + if ($this->isClassCastable($key)) { return $this->getClassCastableAttributeValue($key, $value); } @@ -655,6 +665,24 @@ trait HasAttributes } } + /** + * Cast the given attribute to an enum. + * + * @param string $key + * @param mixed $value + * @return mixed + */ + protected function getEnumCastableAttributeValue($key, $value) + { + if (is_null($value)) { + return; + } + + $castType = $this->getCasts()[$key]; + + return $castType::from($value); + } + /** * Get the type of cast for a model attribute. * @@ -765,6 +793,12 @@ trait HasAttributes $value = $this->fromDateTime($value); } + if ($this->isEnumCastable($key)) { + $this->setEnumCastableAttribute($key, $value); + + return $this; + } + if ($this->isClassCastable($key)) { $this->setClassCastableAttribute($key, $value); @@ -883,6 +917,18 @@ trait HasAttributes } } + /** + * Set the value of an enum castable attribute. + * + * @param string $key + * @param \BackedEnum $value + * @return void + */ + protected function setEnumCastableAttribute($key, $value) + { + $this->attributes[$key] = isset($value) ? $value->value : null; + } + /** * Get an array attribute with the given key and value set. * @@ -1217,7 +1263,18 @@ trait HasAttributes */ protected function isDateCastable($key) { - return $this->hasCast($key, ['date', 'datetime', 'custom_datetime', 'immutable_date', 'immutable_datetime', 'immutable_custom_datetime']); + return $this->hasCast($key, ['date', 'datetime', 'immutable_date', 'immutable_datetime']); + } + + /** + * Determine whether a value is Date / DateTime custom-castable for inbound manipulation. + * + * @param string $key + * @return bool + */ + protected function isDateCastableWithCustomFormat($key) + { + return $this->hasCast($key, ['custom_datetime', 'immutable_custom_datetime']); } /** @@ -1269,6 +1326,29 @@ trait HasAttributes throw new InvalidCastException($this->getModel(), $key, $castType); } + /** + * Determine if the given key is cast using an enum. + * + * @param string $key + * @return bool + */ + protected function isEnumCastable($key) + { + if (! array_key_exists($key, $this->getCasts())) { + return false; + } + + $castType = $this->getCasts()[$key]; + + if (in_array($castType, static::$primitiveCastTypes)) { + return false; + } + + if (function_exists('enum_exists') && enum_exists($castType)) { + return true; + } + } + /** * Determine if the key is deviable using a custom class. * @@ -1294,8 +1374,9 @@ trait HasAttributes */ protected function isClassSerializable($key) { - return $this->isClassCastable($key) && - method_exists($this->parseCasterClass($this->getCasts()[$key]), 'serialize'); + return ! $this->isEnumCastable($key) && + $this->isClassCastable($key) && + method_exists($this->resolveCasterClass($key), 'serialize'); } /** @@ -1643,7 +1724,7 @@ trait HasAttributes return true; } elseif (is_null($attribute)) { return false; - } elseif ($this->isDateAttribute($key) || $this->isDateCastable($key)) { + } elseif ($this->isDateAttribute($key) || $this->isDateCastableWithCustomFormat($key)) { return $this->fromDateTime($attribute) === $this->fromDateTime($original); } elseif ($this->hasCast($key, ['object', 'collection'])) { @@ -1658,6 +1739,8 @@ trait HasAttributes } elseif ($this->hasCast($key, static::$primitiveCastTypes)) { return $this->castAttribute($key, $attribute) === $this->castAttribute($key, $original); + } elseif ($this->isClassCastable($key) && in_array($this->getCasts()[$key], [AsArrayObject::class, AsCollection::class])) { + return $this->fromJson($attribute) === $this->fromJson($original); } return is_numeric($attribute) && is_numeric($original) diff --git a/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php b/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php index c2baa667..aae3ffb1 100644 --- a/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php +++ b/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php @@ -2,8 +2,11 @@ namespace Illuminate\Database\Eloquent\Concerns; +use BadMethodCallException; use Closure; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\RelationNotFoundException; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query\Builder as QueryBuilder; @@ -455,6 +458,56 @@ trait QueriesRelationships return $this->whereMorphedTo($relation, $model, 'or'); } + /** + * Add a "belongs to" relationship where clause to the query. + * + * @param \Illuminate\Database\Eloquent\Model $related + * @param string $relationship + * @param string $boolean + * @return $this + * + * @throws \Exception + */ + public function whereBelongsTo($related, $relationshipName = null, $boolean = 'and') + { + if ($relationshipName === null) { + $relationshipName = Str::camel(class_basename($related)); + } + + try { + $relationship = $this->model->{$relationshipName}(); + } catch (BadMethodCallException $exception) { + throw RelationNotFoundException::make($this->model, $relationshipName); + } + + if (! $relationship instanceof BelongsTo) { + throw RelationNotFoundException::make($this->model, $relationshipName, BelongsTo::class); + } + + $this->where( + $relationship->getQualifiedForeignKeyName(), + '=', + $related->getAttributeValue($relationship->getOwnerKeyName()), + $boolean, + ); + + return $this; + } + + /** + * Add an "BelongsTo" relationship with an "or where" clause to the query. + * + * @param \Illuminate\Database\Eloquent\Model $related + * @param string $relationship + * @return $this + * + * @throws \Exception + */ + public function orWhereBelongsTo($related, $relationshipName = null) + { + return $this->whereBelongsTo($related, $relationshipName, 'or'); + } + /** * Add subselect queries to include an aggregate value for a relationship. * diff --git a/vendor/illuminate/database/Eloquent/Factories/Factory.php b/vendor/illuminate/database/Eloquent/Factories/Factory.php index 11cb5adc..9bdce1c7 100644 --- a/vendor/illuminate/database/Eloquent/Factories/Factory.php +++ b/vendor/illuminate/database/Eloquent/Factories/Factory.php @@ -10,20 +10,21 @@ use Illuminate\Database\Eloquent\Collection as EloquentCollection; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; use Illuminate\Support\Str; +use Illuminate\Support\Traits\Conditionable; use Illuminate\Support\Traits\ForwardsCalls; use Illuminate\Support\Traits\Macroable; use Throwable; abstract class Factory { - use ForwardsCalls, Macroable { + use Conditionable, ForwardsCalls, Macroable { __call as macroCall; } /** * The name of the factory's corresponding model. * - * @var string + * @var string|null */ protected $model; diff --git a/vendor/illuminate/database/Eloquent/Model.php b/vendor/illuminate/database/Eloquent/Model.php index 3c57ac76..b07fdb4f 100644 --- a/vendor/illuminate/database/Eloquent/Model.php +++ b/vendor/illuminate/database/Eloquent/Model.php @@ -8,6 +8,7 @@ use Illuminate\Contracts\Queue\QueueableCollection; use Illuminate\Contracts\Queue\QueueableEntity; use Illuminate\Contracts\Routing\UrlRoutable; use Illuminate\Contracts\Support\Arrayable; +use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Database\ConnectionResolverInterface as Resolver; use Illuminate\Database\Eloquent\Collection as EloquentCollection; @@ -22,7 +23,7 @@ use Illuminate\Support\Traits\ForwardsCalls; use JsonSerializable; use LogicException; -abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jsonable, JsonSerializable, QueueableEntity, UrlRoutable +abstract class Model implements Arrayable, ArrayAccess, CanBeEscapedWhenCastToString, HasBroadcastChannel, Jsonable, JsonSerializable, QueueableEntity, UrlRoutable { use Concerns\HasAttributes, Concerns\HasEvents, @@ -110,6 +111,13 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso */ public $wasRecentlyCreated = false; + /** + * Indicates that the object's string representation should be escaped when __toString is invoked. + * + * @var bool + */ + protected $escapeWhenCastingToString = false; + /** * The connection resolver instance. * @@ -2128,7 +2136,22 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso */ public function __toString() { - return $this->toJson(); + return $this->escapeWhenCastingToString + ? e($this->toJson()) + : $this->toJson(); + } + + /** + * Indicate that the object's string representation should be escaped when __toString is invoked. + * + * @param bool $escape + * @return $this + */ + public function escapeWhenCastingToString($escape = true) + { + $this->escapeWhenCastingToString = $escape; + + return $this; } /** diff --git a/vendor/illuminate/database/Eloquent/RelationNotFoundException.php b/vendor/illuminate/database/Eloquent/RelationNotFoundException.php index 5acc0b30..73257bb1 100755 --- a/vendor/illuminate/database/Eloquent/RelationNotFoundException.php +++ b/vendor/illuminate/database/Eloquent/RelationNotFoundException.php @@ -25,13 +25,18 @@ class RelationNotFoundException extends RuntimeException * * @param object $model * @param string $relation + * @param string|null $type * @return static */ - public static function make($model, $relation) + public static function make($model, $relation, $type = null) { $class = get_class($model); - $instance = new static("Call to undefined relationship [{$relation}] on model [{$class}]."); + $instance = new static( + is_null($type) + ? "Call to undefined relationship [{$relation}] on model [{$class}]." + : "Call to undefined relationship [{$relation}] on model [{$class}] of type [{$type}].", + ); $instance->model = $class; $instance->relation = $relation; diff --git a/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php b/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php index 32bdf884..5c93b8f8 100755 --- a/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php +++ b/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php @@ -277,7 +277,7 @@ class BelongsToMany extends Relation // Once we have an array dictionary of child objects we can easily match the // children back to their parent using the dictionary and the keys on the - // the parent models. Then we will return the hydrated models back out. + // parent models. Then we should return these hydrated models back out. foreach ($models as $model) { $key = $this->getDictionaryKey($model->{$this->parentKey}); diff --git a/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php b/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php index 71fa6bde..6f6b1b7f 100644 --- a/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php +++ b/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php @@ -102,7 +102,9 @@ trait CanBeOneOfMany if (isset($previous)) { $this->addOneOfManyJoinSubQuery($subQuery, $previous['subQuery'], $previous['column']); - } elseif (isset($closure)) { + } + + if (isset($closure)) { $closure($subQuery); } @@ -122,6 +124,12 @@ trait CanBeOneOfMany $this->addConstraints(); + $columns = $this->query->getQuery()->columns; + + if (is_null($columns) || $columns === ['*']) { + $this->select([$this->qualifyColumn('*')]); + } + return $this; } @@ -137,7 +145,7 @@ trait CanBeOneOfMany { return $this->ofMany(collect(Arr::wrap($column))->mapWithKeys(function ($column) { return [$column => 'MAX']; - })->all(), 'MAX', $relation ?: $this->guessRelationship()); + })->all(), 'MAX', $relation); } /** @@ -152,7 +160,7 @@ trait CanBeOneOfMany { return $this->ofMany(collect(Arr::wrap($column))->mapWithKeys(function ($column) { return [$column => 'MIN']; - })->all(), 'MIN', $relation ?: $this->guessRelationship()); + })->all(), 'MIN', $relation); } /** @@ -179,14 +187,15 @@ trait CanBeOneOfMany protected function newOneOfManySubQuery($groupBy, $column = null, $aggregate = null) { $subQuery = $this->query->getModel() - ->newQuery(); + ->newQuery() + ->withoutGlobalScopes($this->removedScopes()); foreach (Arr::wrap($groupBy) as $group) { $subQuery->groupBy($this->qualifyRelatedColumn($group)); } if (! is_null($column)) { - $subQuery->selectRaw($aggregate.'('.$subQuery->getQuery()->grammar->wrap($column).') as '.$subQuery->getQuery()->grammar->wrap($column)); + $subQuery->selectRaw($aggregate.'('.$subQuery->getQuery()->grammar->wrap($subQuery->qualifyColumn($column)).') as '.$subQuery->getQuery()->grammar->wrap($column.'_aggregate')); } $this->addOneOfManySubQueryConstraints($subQuery, $groupBy, $column, $aggregate); @@ -208,7 +217,7 @@ trait CanBeOneOfMany $subQuery->applyBeforeQueryCallbacks(); $parent->joinSub($subQuery, $this->relationName, function ($join) use ($on) { - $join->on($this->qualifySubSelectColumn($on), '=', $this->qualifyRelatedColumn($on)); + $join->on($this->qualifySubSelectColumn($on.'_aggregate'), '=', $this->qualifyRelatedColumn($on)); $this->addOneOfManyJoinSubQueryConstraints($join, $on); }); diff --git a/vendor/illuminate/database/Eloquent/Relations/Relation.php b/vendor/illuminate/database/Eloquent/Relations/Relation.php index 445778d4..aa8ce5a0 100755 --- a/vendor/illuminate/database/Eloquent/Relations/Relation.php +++ b/vendor/illuminate/database/Eloquent/Relations/Relation.php @@ -407,7 +407,7 @@ abstract class Relation /** * Define the morph map for polymorphic relations and require all morphed models to be explicitly mapped. * - * @param array|null $map + * @param array $map * @param bool $merge * @return array */ diff --git a/vendor/illuminate/database/PDO/SqlServerDriver.php b/vendor/illuminate/database/PDO/SqlServerDriver.php index bbb3bbd3..1373fc49 100644 --- a/vendor/illuminate/database/PDO/SqlServerDriver.php +++ b/vendor/illuminate/database/PDO/SqlServerDriver.php @@ -6,6 +6,9 @@ use Doctrine\DBAL\Driver\AbstractSQLServerDriver; class SqlServerDriver extends AbstractSQLServerDriver { + /** + * @return \Doctrine\DBAL\Driver\Connection + */ public function connect(array $params) { return new SqlServerConnection( diff --git a/vendor/illuminate/database/Query/Builder.php b/vendor/illuminate/database/Query/Builder.php index eebdc158..82354391 100755 --- a/vendor/illuminate/database/Query/Builder.php +++ b/vendor/illuminate/database/Query/Builder.php @@ -20,6 +20,7 @@ use Illuminate\Support\Str; use Illuminate\Support\Traits\ForwardsCalls; use Illuminate\Support\Traits\Macroable; use InvalidArgumentException; +use LogicException; use RuntimeException; class Builder @@ -1960,7 +1961,7 @@ class Builder /** * Add an "order by" clause to the query. * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column + * @param \Closure|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column * @param string $direction * @return $this * @@ -1993,7 +1994,7 @@ class Builder /** * Add a descending "order by" clause to the query. * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column + * @param \Closure|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column * @return $this */ public function orderByDesc($column) @@ -2004,7 +2005,7 @@ class Builder /** * Add an "order by" clause for a timestamp to the query. * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column + * @param \Closure|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column * @return $this */ public function latest($column = 'created_at') @@ -2015,7 +2016,7 @@ class Builder /** * Add an "order by" clause for a timestamp to the query. * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column + * @param \Closure|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column * @return $this */ public function oldest($column = 'created_at') @@ -3000,6 +3001,27 @@ class Builder )); } + /** + * Update records in a PostgreSQL database using the update from syntax. + * + * @param array $values + * @return int + */ + public function updateFrom(array $values) + { + if (! method_exists($this->grammar, 'compileUpdateFrom')) { + throw new LogicException('This database engine does not support the updateFrom method.'); + } + + $this->applyBeforeQueryCallbacks(); + + $sql = $this->grammar->compileUpdateFrom($this, $values); + + return $this->connection->update($sql, $this->cleanBindings( + $this->grammar->prepareBindingsForUpdateFrom($this->bindings, $values) + )); + } + /** * Insert or update a record matching the attributes, and fill it with values. * @@ -3402,7 +3424,7 @@ class Builder /** * Die and dump the current SQL and bindings. * - * @return void + * @return never */ public function dd() { diff --git a/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php b/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php index 85ff0121..d40d163c 100755 --- a/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php +++ b/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php @@ -260,6 +260,114 @@ class PostgresGrammar extends Grammar return "{$field} = jsonb_set({$field}::jsonb, {$path}, {$this->parameter($value)})"; } + /** + * Compile an update from statement into SQL. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $values + * @return string + */ + public function compileUpdateFrom(Builder $query, $values) + { + $table = $this->wrapTable($query->from); + + // Each one of the columns in the update statements needs to be wrapped in the + // keyword identifiers, also a place-holder needs to be created for each of + // the values in the list of bindings so we can make the sets statements. + $columns = $this->compileUpdateColumns($query, $values); + + $from = ''; + + if (isset($query->joins)) { + // When using Postgres, updates with joins list the joined tables in the from + // clause, which is different than other systems like MySQL. Here, we will + // compile out the tables that are joined and add them to a from clause. + $froms = collect($query->joins)->map(function ($join) { + return $this->wrapTable($join->table); + })->all(); + + if (count($froms) > 0) { + $from = ' from '.implode(', ', $froms); + } + } + + $where = $this->compileUpdateWheres($query); + + return trim("update {$table} set {$columns}{$from} {$where}"); + } + + /** + * Compile the additional where clauses for updates with joins. + * + * @param \Illuminate\Database\Query\Builder $query + * @return string + */ + protected function compileUpdateWheres(Builder $query) + { + $baseWheres = $this->compileWheres($query); + + if (! isset($query->joins)) { + return $baseWheres; + } + + // Once we compile the join constraints, we will either use them as the where + // clause or append them to the existing base where clauses. If we need to + // strip the leading boolean we will do so when using as the only where. + $joinWheres = $this->compileUpdateJoinWheres($query); + + if (trim($baseWheres) == '') { + return 'where '.$this->removeLeadingBoolean($joinWheres); + } + + return $baseWheres.' '.$joinWheres; + } + + /** + * Compile the "join" clause where clauses for an update. + * + * @param \Illuminate\Database\Query\Builder $query + * @return string + */ + protected function compileUpdateJoinWheres(Builder $query) + { + $joinWheres = []; + + // Here we will just loop through all of the join constraints and compile them + // all out then implode them. This should give us "where" like syntax after + // everything has been built and then we will join it to the real wheres. + foreach ($query->joins as $join) { + foreach ($join->wheres as $where) { + $method = "where{$where['type']}"; + + $joinWheres[] = $where['boolean'].' '.$this->$method($query, $where); + } + } + + return implode(' ', $joinWheres); + } + + /** + * Prepare the bindings for an update statement. + * + * @param array $bindings + * @param array $values + * @return array + */ + public function prepareBindingsForUpdateFrom(array $bindings, array $values) + { + $values = collect($values)->map(function ($value, $column) { + return is_array($value) || ($this->isJsonSelector($column) && ! $this->isExpression($value)) + ? json_encode($value) + : $value; + })->all(); + + $bindingsWithoutWhere = Arr::except($bindings, ['select', 'where']); + + return array_values( + array_merge($values, $bindings['where'], Arr::flatten($bindingsWithoutWhere)) + ); + } + /** * Compile an update statement with joins or limit into SQL. * diff --git a/vendor/illuminate/database/Schema/ForeignKeyDefinition.php b/vendor/illuminate/database/Schema/ForeignKeyDefinition.php index 0354cc92..a03fcff7 100644 --- a/vendor/illuminate/database/Schema/ForeignKeyDefinition.php +++ b/vendor/illuminate/database/Schema/ForeignKeyDefinition.php @@ -24,6 +24,16 @@ class ForeignKeyDefinition extends Fluent return $this->onUpdate('cascade'); } + /** + * Indicate that updates should be restricted. + * + * @return $this + */ + public function restrictOnUpdate() + { + return $this->onUpdate('restrict'); + } + /** * Indicate that deletes should cascade. * diff --git a/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php b/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php index 6167b21e..260935f8 100644 --- a/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php +++ b/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php @@ -198,6 +198,7 @@ class ChangeColumn 'binary', 'boolean', 'date', + 'dateTime', 'decimal', 'double', 'float', diff --git a/vendor/illuminate/database/Schema/MySqlSchemaState.php b/vendor/illuminate/database/Schema/MySqlSchemaState.php index e772fb68..9bbec7a4 100644 --- a/vendor/illuminate/database/Schema/MySqlSchemaState.php +++ b/vendor/illuminate/database/Schema/MySqlSchemaState.php @@ -85,7 +85,7 @@ class MySqlSchemaState extends SchemaState */ protected function baseDumpCommand() { - $command = 'mysqldump '.$this->connectionString().' --skip-add-locks --skip-comments --skip-set-charset --tz-utc'; + $command = 'mysqldump '.$this->connectionString().' --no-tablespaces --skip-add-locks --skip-comments --skip-set-charset --tz-utc'; if (! $this->connection->isMaria()) { $command .= ' --column-statistics=0 --set-gtid-purged=OFF'; diff --git a/vendor/illuminate/database/Schema/SchemaState.php b/vendor/illuminate/database/Schema/SchemaState.php index 5629a7aa..e6f35ab9 100644 --- a/vendor/illuminate/database/Schema/SchemaState.php +++ b/vendor/illuminate/database/Schema/SchemaState.php @@ -58,7 +58,7 @@ abstract class SchemaState $this->files = $files ?: new Filesystem; $this->processFactory = $processFactory ?: function (...$arguments) { - return Process::fromShellCommandline(...$arguments); + return Process::fromShellCommandline(...$arguments)->setTimeout(null); }; $this->handleOutputUsing(function () { diff --git a/vendor/illuminate/database/composer.json b/vendor/illuminate/database/composer.json index 0a7cda07..c7398fde 100644 --- a/vendor/illuminate/database/composer.json +++ b/vendor/illuminate/database/composer.json @@ -35,7 +35,7 @@ } }, "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.2).", "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", "illuminate/console": "Required to use the database commands (^8.0).", "illuminate/events": "Required to use the observers with Eloquent (^8.0).", diff --git a/vendor/illuminate/events/InvokeQueuedClosure.php b/vendor/illuminate/events/InvokeQueuedClosure.php index caabe457..bc68b19d 100644 --- a/vendor/illuminate/events/InvokeQueuedClosure.php +++ b/vendor/illuminate/events/InvokeQueuedClosure.php @@ -7,7 +7,7 @@ class InvokeQueuedClosure /** * Handle the event. * - * @param \Illuminate\Queue\SerializableClosure $closure + * @param \Laravel\SerializableClosure\SerializableClosure $closure * @param array $arguments * @return void */ @@ -19,7 +19,7 @@ class InvokeQueuedClosure /** * Handle a job failure. * - * @param \Illuminate\Queue\SerializableClosure $closure + * @param \Laravel\SerializableClosure\SerializableClosure $closure * @param array $arguments * @param array $catchCallbacks * @param \Throwable $exception diff --git a/vendor/illuminate/events/QueuedClosure.php b/vendor/illuminate/events/QueuedClosure.php index 1d640959..82590598 100644 --- a/vendor/illuminate/events/QueuedClosure.php +++ b/vendor/illuminate/events/QueuedClosure.php @@ -3,7 +3,7 @@ namespace Illuminate\Events; use Closure; -use Illuminate\Queue\SerializableClosure; +use Illuminate\Queue\SerializableClosureFactory; class QueuedClosure { @@ -114,10 +114,10 @@ class QueuedClosure { return function (...$arguments) { dispatch(new CallQueuedListener(InvokeQueuedClosure::class, 'handle', [ - 'closure' => new SerializableClosure($this->closure), + 'closure' => SerializableClosureFactory::make($this->closure), 'arguments' => $arguments, 'catch' => collect($this->catchCallbacks)->map(function ($callback) { - return new SerializableClosure($callback); + return SerializableClosureFactory::make($callback); })->all(), ]))->onConnection($this->connection)->onQueue($this->queue)->delay($this->delay); }; diff --git a/vendor/illuminate/support/Facades/App.php b/vendor/illuminate/support/Facades/App.php index d0004db8..0adb144d 100755 --- a/vendor/illuminate/support/Facades/App.php +++ b/vendor/illuminate/support/Facades/App.php @@ -11,6 +11,8 @@ namespace Illuminate\Support\Facades; * @method static bool configurationIsCached() * @method static bool hasBeenBootstrapped() * @method static bool isDownForMaintenance() + * @method static bool isLocal() + * @method static bool isProduction() * @method static bool routesAreCached() * @method static bool runningInConsole() * @method static bool runningUnitTests() @@ -34,7 +36,7 @@ namespace Illuminate\Support\Facades; * @method static string storagePath(string $path = '') * @method static string version() * @method static string|bool environment(string|array ...$environments) - * @method static void abort(int $code, string $message = '', array $headers = []) + * @method static never abort(int $code, string $message = '', array $headers = []) * @method static void boot() * @method static void booted(callable $callback) * @method static void booting(callable $callback) diff --git a/vendor/illuminate/support/Facades/Bus.php b/vendor/illuminate/support/Facades/Bus.php index 4be212e5..80006746 100644 --- a/vendor/illuminate/support/Facades/Bus.php +++ b/vendor/illuminate/support/Facades/Bus.php @@ -24,6 +24,7 @@ use Illuminate\Support\Testing\Fakes\BusFake; * @method static void assertDispatchedAfterResponseTimes(string $command, int $times = 1) * @method static void assertNotDispatchedAfterResponse(string|\Closure $command, callable $callback = null) * @method static void assertBatched(callable $callback) + * @method static void assertChained(array $expectedChain) * * @see \Illuminate\Contracts\Bus\Dispatcher */ diff --git a/vendor/illuminate/support/Facades/DB.php b/vendor/illuminate/support/Facades/DB.php index 997f790c..554dd220 100755 --- a/vendor/illuminate/support/Facades/DB.php +++ b/vendor/illuminate/support/Facades/DB.php @@ -28,6 +28,7 @@ namespace Illuminate\Support\Facades; * @method static void enableQueryLog() * @method static void disableQueryLog() * @method static void flushQueryLog() + * @method static \Illuminate\Database\Connection beforeExecuting(\Closure $callback) * @method static void listen(\Closure $callback) * @method static void rollBack(int $toLevel = null) * @method static void setDefaultConnection(string $name) diff --git a/vendor/illuminate/support/Facades/Event.php b/vendor/illuminate/support/Facades/Event.php index 41665381..cb4107fc 100755 --- a/vendor/illuminate/support/Facades/Event.php +++ b/vendor/illuminate/support/Facades/Event.php @@ -17,7 +17,7 @@ use Illuminate\Support\Testing\Fakes\EventFake; * @method static void assertDispatchedTimes(string $event, int $times = 1) * @method static void assertNotDispatched(string|\Closure $event, callable|int $callback = null) * @method static void assertNothingDispatched() - * @method static void assertListening(string $expectedEvent, string expectedListener) + * @method static void assertListening(string $expectedEvent, string $expectedListener) * @method static void flush(string $event) * @method static void forget(string $event) * @method static void forgetPushed() diff --git a/vendor/illuminate/support/Facades/Hash.php b/vendor/illuminate/support/Facades/Hash.php index 2c71090e..b9855fdd 100755 --- a/vendor/illuminate/support/Facades/Hash.php +++ b/vendor/illuminate/support/Facades/Hash.php @@ -7,6 +7,7 @@ namespace Illuminate\Support\Facades; * @method static bool check(string $value, string $hashedValue, array $options = []) * @method static bool needsRehash(string $hashedValue, array $options = []) * @method static string make(string $value, array $options = []) + * @method static \Illuminate\Hashing\HashManager extend($driver, \Closure $callback) * * @see \Illuminate\Hashing\HashManager */ diff --git a/vendor/illuminate/support/Facades/Queue.php b/vendor/illuminate/support/Facades/Queue.php index 1947f88a..5af1329e 100755 --- a/vendor/illuminate/support/Facades/Queue.php +++ b/vendor/illuminate/support/Facades/Queue.php @@ -19,7 +19,7 @@ use Illuminate\Support\Testing\Fakes\QueueFake; * @method static void assertNotPushed(string|\Closure $job, callable $callback = null) * @method static void assertNothingPushed() * @method static void assertPushed(string|\Closure $job, callable|int $callback = null) - * @method static void assertPushedOn(string $queue, string|\Closure $job, callable|int $callback = null) + * @method static void assertPushedOn(string $queue, string|\Closure $job, callable $callback = null) * @method static void assertPushedWithChain(string $job, array $expectedChain = [], callable $callback = null) * * @see \Illuminate\Queue\QueueManager diff --git a/vendor/illuminate/support/ServiceProvider.php b/vendor/illuminate/support/ServiceProvider.php index 1f361b1d..6c530c12 100755 --- a/vendor/illuminate/support/ServiceProvider.php +++ b/vendor/illuminate/support/ServiceProvider.php @@ -97,8 +97,12 @@ abstract class ServiceProvider */ public function callBootingCallbacks() { - foreach ($this->bootingCallbacks as $callback) { - $this->app->call($callback); + $index = 0; + + while ($index < count($this->bootingCallbacks)) { + $this->app->call($this->bootingCallbacks[$index]); + + $index++; } } @@ -109,8 +113,12 @@ abstract class ServiceProvider */ public function callBootedCallbacks() { - foreach ($this->bootedCallbacks as $callback) { - $this->app->call($callback); + $index = 0; + + while ($index < count($this->bootedCallbacks)) { + $this->app->call($this->bootedCallbacks[$index]); + + $index++; } } diff --git a/vendor/illuminate/support/Str.php b/vendor/illuminate/support/Str.php index f1ab26d3..5b341c0d 100644 --- a/vendor/illuminate/support/Str.php +++ b/vendor/illuminate/support/Str.php @@ -253,11 +253,15 @@ class Str { $patterns = Arr::wrap($pattern); + $value = (string) $value; + if (empty($patterns)) { return false; } foreach ($patterns as $pattern) { + $pattern = (string) $pattern; + // If the given value is an exact match we can of course return true right // from the beginning. Otherwise, we will translate asterisks and do an // actual pattern match against the two strings to see if they match. @@ -394,6 +398,38 @@ class Str return (string) $converter->convertToHtml($string); } + /** + * Masks a portion of a string with a repeated character. + * + * @param string $string + * @param string $character + * @param int $index + * @param int|null $length + * @param string $encoding + * @return string + */ + public static function mask($string, $character, $index, $length = null, $encoding = 'UTF-8') + { + if ($character === '') { + return $string; + } + + if (is_null($length) && PHP_MAJOR_VERSION < 8) { + $length = mb_strlen($string, $encoding); + } + + $segment = mb_substr($string, $index, $length, $encoding); + + if ($segment === '') { + return $string; + } + + $start = mb_substr($string, 0, mb_strpos($string, $segment, 0, $encoding), $encoding); + $end = mb_substr($string, mb_strpos($string, $segment, 0, $encoding) + mb_strlen($segment, $encoding)); + + return $start.str_repeat(mb_substr($character, 0, 1, $encoding), mb_strlen($segment, $encoding)).$end; + } + /** * Get the string matching the given pattern. * @@ -675,6 +711,27 @@ class Str return mb_convert_case($value, MB_CASE_TITLE, 'UTF-8'); } + /** + * Convert the given string to title case for each word. + * + * @param string $value + * @return string + */ + public static function headline($value) + { + $parts = explode('_', static::replace(' ', '_', $value)); + + if (count($parts) > 1) { + $parts = array_map([static::class, 'title'], $parts); + } + + $studly = static::studly(implode($parts)); + + $words = preg_split('/(?=[A-Z])/', $studly, -1, PREG_SPLIT_NO_EMPTY); + + return implode(' ', $words); + } + /** * Get the singular form of an English word. * diff --git a/vendor/illuminate/support/Stringable.php b/vendor/illuminate/support/Stringable.php index 9fa57c52..a7d21b0e 100644 --- a/vendor/illuminate/support/Stringable.php +++ b/vendor/illuminate/support/Stringable.php @@ -342,6 +342,20 @@ class Stringable implements JsonSerializable return new static(Str::markdown($this->value, $options)); } + /** + * Masks a portion of a string with a repeated character. + * + * @param string $character + * @param int $index + * @param int|null $length + * @param string $encoding + * @return static + */ + public function mask($character, $index, $length = null, $encoding = 'UTF-8') + { + return new static(Str::mask($this->value, $character, $index, $length, $encoding)); + } + /** * Get the string matching the given pattern. * @@ -565,6 +579,17 @@ class Stringable implements JsonSerializable return new static(Str::start($this->value, $prefix)); } + /** + * Strip HTML and PHP tags from the given string. + * + * @param string $allowedTags + * @return static + */ + public function stripTags($allowedTags = null) + { + return new static(strip_tags($this->value, $allowedTags)); + } + /** * Convert the given string to upper-case. * @@ -585,6 +610,16 @@ class Stringable implements JsonSerializable return new static(Str::title($this->value)); } + /** + * Convert the given string to title case for each word. + * + * @return static + */ + public function headline() + { + return new static(Str::headline($this->value)); + } + /** * Get the singular form of an English word. * @@ -778,7 +813,7 @@ class Stringable implements JsonSerializable /** * Dump the string and end the script. * - * @return void + * @return never */ public function dd() { diff --git a/vendor/illuminate/support/Testing/Fakes/BusFake.php b/vendor/illuminate/support/Testing/Fakes/BusFake.php index 46346c94..52a95306 100644 --- a/vendor/illuminate/support/Testing/Fakes/BusFake.php +++ b/vendor/illuminate/support/Testing/Fakes/BusFake.php @@ -135,6 +135,16 @@ class BusFake implements QueueingDispatcher ); } + /** + * Assert that no jobs were dispatched. + * + * @return void + */ + public function assertNothingDispatched() + { + PHPUnit::assertEmpty($this->commands, 'Jobs were dispatched unexpectedly.'); + } + /** * Assert if a job was explicitly dispatched synchronously based on a truth-test callback. * diff --git a/vendor/illuminate/support/Testing/Fakes/NotificationFake.php b/vendor/illuminate/support/Testing/Fakes/NotificationFake.php index 28526d59..214f99b9 100644 --- a/vendor/illuminate/support/Testing/Fakes/NotificationFake.php +++ b/vendor/illuminate/support/Testing/Fakes/NotificationFake.php @@ -7,6 +7,7 @@ use Exception; use Illuminate\Contracts\Notifications\Dispatcher as NotificationDispatcher; use Illuminate\Contracts\Notifications\Factory as NotificationFactory; use Illuminate\Contracts\Translation\HasLocalePreference; +use Illuminate\Notifications\AnonymousNotifiable; use Illuminate\Support\Collection; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; @@ -31,6 +32,20 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory */ public $locale; + /** + * Assert if a notification was sent on-demand based on a truth-test callback. + * + * @param string|\Closure $notification + * @param callable|null $callback + * @return void + * + * @throws \Exception + */ + public function assertSentOnDemand($notification, $callback = null) + { + $this->assertSentTo(new AnonymousNotifiable, $notification, $callback); + } + /** * Assert if a notification was sent based on a truth-test callback. * @@ -69,6 +84,18 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory ); } + /** + * Assert if a notification was sent on-demand a number of times. + * + * @param string $notification + * @param int $times + * @return void + */ + public function assertSentOnDemandTimes($notification, $times = 1) + { + return $this->assertSentToTimes(new AnonymousNotifiable, $notification, $times); + } + /** * Assert if a notification was sent a number of times. * @@ -232,9 +259,24 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory $notification->id = Str::uuid()->toString(); } + $notifiableChannels = $channels ?: $notification->via($notifiable); + + if (method_exists($notification, 'shouldSend')) { + $notifiableChannels = array_filter( + $notifiableChannels, + function ($channel) use ($notification, $notifiable) { + return $notification->shouldSend($notifiable, $channel) !== false; + } + ); + + if (empty($notifiableChannels)) { + continue; + } + } + $this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [ 'notification' => $notification, - 'channels' => $channels ?: $notification->via($notifiable), + 'channels' => $notifiableChannels, 'notifiable' => $notifiable, 'locale' => $notification->locale ?? $this->locale ?? value(function () use ($notifiable) { if ($notifiable instanceof HasLocalePreference) { diff --git a/vendor/illuminate/support/composer.json b/vendor/illuminate/support/composer.json index 4493dac3..15dfe4a6 100644 --- a/vendor/illuminate/support/composer.json +++ b/vendor/illuminate/support/composer.json @@ -21,7 +21,7 @@ "illuminate/collections": "^8.0", "illuminate/contracts": "^8.0", "illuminate/macroable": "^8.0", - "nesbot/carbon": "^2.31", + "nesbot/carbon": "^2.53.1", "voku/portable-ascii": "^1.4.8" }, "conflict": { @@ -42,8 +42,8 @@ }, "suggest": { "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0).", - "ramsey/uuid": "Required to use Str::uuid() (^4.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", + "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", "symfony/process": "Required to use the composer class (^5.1.4).", "symfony/var-dumper": "Required to use the dd function (^5.1.4).", "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." diff --git a/vendor/nesbot/carbon/bin/carbon b/vendor/nesbot/carbon/bin/carbon index fdcbb5c2..b53ab738 100755 --- a/vendor/nesbot/carbon/bin/carbon +++ b/vendor/nesbot/carbon/bin/carbon @@ -1,6 +1,8 @@ #!/usr/bin/env php format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) @@ -5012,8 +5026,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * * /!\ Use this method for unit tests only. * - * @param Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback + * @param Closure|static|string|false|null $testNow real or mock Carbon instance + * @param Closure|null $callback * * @return mixed */ diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php index 76c162d5..09051a2e 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Exceptions\BadFluentConstructorException; @@ -191,14 +192,14 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface /** * Interval spec period designators */ - const PERIOD_PREFIX = 'P'; - const PERIOD_YEARS = 'Y'; - const PERIOD_MONTHS = 'M'; - const PERIOD_DAYS = 'D'; - const PERIOD_TIME_PREFIX = 'T'; - const PERIOD_HOURS = 'H'; - const PERIOD_MINUTES = 'M'; - const PERIOD_SECONDS = 'S'; + public const PERIOD_PREFIX = 'P'; + public const PERIOD_YEARS = 'Y'; + public const PERIOD_MONTHS = 'M'; + public const PERIOD_DAYS = 'D'; + public const PERIOD_TIME_PREFIX = 'T'; + public const PERIOD_HOURS = 'H'; + public const PERIOD_MINUTES = 'M'; + public const PERIOD_SECONDS = 'S'; /** * A translator to ... er ... translate stuff @@ -522,10 +523,10 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface * echo Carboninterval::createFromFormat('H:i', '1:30'); * ``` * - * @param string $format Format of the $interval input string - * @param string $interval Input string to convert into an interval + * @param string $format Format of the $interval input string + * @param string|null $interval Input string to convert into an interval * - * @throws Exception when the $interval cannot be parsed as an interval. + * @throws \Carbon\Exceptions\ParseErrorException when the $interval cannot be parsed as an interval. * * @return static */ @@ -1905,8 +1906,8 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface /** * Add given parameters to the current interval. * - * @param int $years - * @param int $months + * @param int $years + * @param int $months * @param int|float $weeks * @param int|float $days * @param int|float $hours @@ -1935,8 +1936,8 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface /** * Add given parameters to the current interval. * - * @param int $years - * @param int $months + * @param int $years + * @param int $months * @param int|float $weeks * @param int|float $days * @param int|float $hours diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php index 01cbf7ab..197f3709 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Exceptions\InvalidCastException; @@ -1626,14 +1627,14 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable return $this->setStartDate($first, $second); case 'sinceNow': - return $this->setStartDate(new Carbon, $first); + return $this->setStartDate(new Carbon(), $first); case 'end': case 'until': return $this->setEndDate($first, $second); case 'untilNow': - return $this->setEndDate(new Carbon, $first); + return $this->setEndDate(new Carbon(), $first); case 'dates': case 'between': diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php b/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php index 2bd36c43..b4d16ba9 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php @@ -8,12 +8,14 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Exceptions\InvalidCastException; use Carbon\Exceptions\InvalidTimeZoneException; use DateTimeInterface; use DateTimeZone; +use Throwable; class CarbonTimeZone extends DateTimeZone { @@ -198,7 +200,7 @@ class CarbonTimeZone extends DateTimeZone // @codeCoverageIgnoreStart try { $offset = @$this->getOffset($date) ?: 0; - } catch (\Throwable $e) { + } catch (Throwable $e) { $offset = 0; } // @codeCoverageIgnoreEnd diff --git a/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php b/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php index d53b1f49..4f35d6c6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php +++ b/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\Cli; class Invoker diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php index 35c5558a..ccc457fc 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Doctrine\DBAL\Platforms\AbstractPlatform; diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php index 32397434..bf476a77 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Doctrine\DBAL\Platforms\AbstractPlatform; @@ -12,6 +17,8 @@ class CarbonImmutableType extends DateTimeImmutableType implements CarbonDoctrin { /** * {@inheritdoc} + * + * @return string */ public function getName() { @@ -20,6 +27,8 @@ class CarbonImmutableType extends DateTimeImmutableType implements CarbonDoctrin /** * {@inheritdoc} + * + * @return bool */ public function requiresSQLCommentHint(AbstractPlatform $platform) { diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php index e5f52c7d..9289d84d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Doctrine\DBAL\Platforms\AbstractPlatform; @@ -12,6 +17,8 @@ class CarbonType extends DateTimeType implements CarbonDoctrineType { /** * {@inheritdoc} + * + * @return string */ public function getName() { @@ -20,6 +27,8 @@ class CarbonType extends DateTimeType implements CarbonDoctrineType /** * {@inheritdoc} + * + * @return bool */ public function requiresSQLCommentHint(AbstractPlatform $platform) { diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php index fa0d5b00..8f2fdee8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Carbon\Carbon; @@ -26,6 +31,9 @@ trait CarbonTypeConverter return Carbon::class; } + /** + * @return string + */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { $precision = ($fieldDeclaration['precision'] ?: 10) === 10 diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php index f9744b81..642fd413 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; class DateTimeDefaultPrecision diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php index bc2aa797..b3a08719 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php index a9f453eb..d5cd5564 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php index 7a28f39c..1d7ec542 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php index 307a4ee1..73c2dd86 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface BadMethodCallException extends Exception diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php index 86e8a15e..3bbbd77d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface Exception diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php index 5fb1c681..a48d4f93 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php index 60ed740d..9739f4d1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface InvalidArgumentException extends Exception diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php index 77466c7d..d2f37019 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php index f5dbfe2f..99bb91c0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php index dd26a901..3341b49d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php index b4c76dc8..5f9f142e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php index abe1aef3..a37e3f5e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php index b061ef16..ede47712 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php index 03bd8ac4..892e16e8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php index bc124a65..3fbe3fc4 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php index 78ce9392..2b4c48e3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Carbon\CarbonInterface; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php index 8bdda85b..41bb6290 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php index 8aab1925..adbc36cd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php index 33cd1b52..54822d95 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php index 3510b409..0314c5d8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php index 6ca5f5f5..24bf5a68 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface RuntimeException extends Exception diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php index 838847ba..8bd8653e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php index 7f8ec9eb..39ee12c5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php index 4591d35b..6c8c01b6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php index 36468724..901db986 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php index 5020369a..c9e9c9ff 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php index d2f76eee..d965c82a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php index b38ae12d..6f8b39f5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Factory.php b/vendor/nesbot/carbon/src/Carbon/Factory.php index a614043f..3b2a5170 100644 --- a/vendor/nesbot/carbon/src/Carbon/Factory.php +++ b/vendor/nesbot/carbon/src/Carbon/Factory.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Closure; @@ -19,208 +20,208 @@ use ReflectionMethod; * * * - * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a - * new instance. - * @method Carbon|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * @method Carbon createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. - * @method Carbon|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method Carbon|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). - * @method Carbon|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. - * @method Carbon|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. - * @method Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. - * @method Carbon createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. - * @method Carbon createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. - * @method Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * If one of the set values is not valid, an InvalidDateException - * will be thrown. - * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. - * @method Carbon disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method Carbon enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * @method Carbon fromSerialized($value) Create an instance from a serialized string. - * @method void genericMacro($macro, $priority = 0) Register a custom macro. - * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native - * name, region and variant of the locale. - * @method array getDays() Get the days of the week - * @method string|null getFallbackLocale() Get the fallback locale. - * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). - * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). - * @method array getIsoUnits() Returns list of locale units for ISO formatting. - * @method Carbon getLastErrors() {@inheritdoc} - * @method string getLocale() Get the current translator locale. - * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. - * @method int getMidDayAt() get midday/noon hour - * @method Closure|Carbon getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. - * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. - * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. - * @method int getWeekEndsAt() Get the last day of week - * @method int getWeekStartsAt() Get the first day of week - * @method array getWeekendDays() Get weekend days - * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasMacro($name) Checks if macro is registered globally. - * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. - * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * @method Carbon instance($date) Create a Carbon instance from a DateTime one. - * @method bool isImmutable() Returns true if the current class/instance is immutable. - * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. - * @method bool isMutable() Returns true if the current class/instance is mutable. - * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. - * (It can be overridden in specific instances.) - * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * @method void macro($name, $macro) Register a custom macro. - * @method Carbon|null make($var) Make a Carbon instance from given variable if possible. - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * @method Carbon maxValue() Create a Carbon instance for the greatest supported date. - * @method Carbon minValue() Create a Carbon instance for the lowest supported date. - * @method void mixin($mixin) Mix another object into the class. - * @method Carbon now($tz = null) Get a Carbon instance for the current date and time. - * @method Carbon parse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method Carbon parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). - * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). - * @method Carbon|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method Carbon rawParse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method Carbon resetMacros() Remove all macros and generic macros. - * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string - * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather transform Carbon object before the serialization. - * JSON serialize all Carbon instances using the given callback. - * @method Carbon setFallbackLocale($locale) Set the fallback locale. - * @method Carbon setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. - * Pass 'auto' as locale to use closest language from the current LC_TIME locale. - * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider mid-day is always 12pm, then if you need to test if it's an other - * hour, test it explicitly: - * $date->format('G') == 13 - * or to set explicitly to a given hour: - * $date->setTime(13, 0, 0, 0) - * Set midday/noon hour - * @method Carbon setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * To clear the test instance call this method using the default - * parameter of null. - * /!\ Use this method for unit tests only. - * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and - * use other method or custom format passed to format() method if you need to dump an other string - * format. - * Set the default format used when type juggling a Carbon instance to a string - * @method void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) Set the default translator instance to use. - * @method Carbon setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use UTF-8 language packages on every machine. - * Set if UTF8 will be used for localized date/time. - * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek - * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the - * start of week according to current locale selected and implicitly the end of week. - * Set the last day of week - * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the - * 'first_day_of_week' locale setting to change the start of week according to current locale - * selected and implicitly the end of week. - * Set the first day of week - * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider week-end is always saturday and sunday, and if you have some custom - * week-end days to handle, give to those days an other name and create a macro for them: - * ``` - * Carbon::macro('isDayOff', function ($date) { - * return $date->isSunday() || $date->isMonday(); - * }); - * Carbon::macro('isNotDayOff', function ($date) { - * return !$date->isDayOff(); - * }); - * if ($someDate->isDayOff()) ... - * if ($someDate->isNotDayOff()) ... - * // Add 5 not-off days - * $count = 5; - * while ($someDate->isDayOff() || ($count-- > 0)) { - * $someDate->addDay(); - * } - * ``` - * Set weekend days - * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). - * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). - * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). - * @method Carbon today($tz = null) Create a Carbon instance for today. - * @method Carbon tomorrow($tz = null) Create a Carbon instance for tomorrow. - * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. - * @method string translateWith(\Symfony\Component\Translation\TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. - * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method Carbon useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. - * Using setTestNow to set the date, executing the callback, then - * clearing the test instance. - * /!\ Use this method for unit tests only. - * @method Carbon yesterday($tz = null) Create a Carbon instance for yesterday. + * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a + * new instance. + * @method Carbon|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * @method Carbon createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. + * @method Carbon|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method Carbon|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). + * @method Carbon|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. + * @method Carbon|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. + * @method Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. + * @method Carbon createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. + * @method Carbon createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. + * @method Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * If one of the set values is not valid, an InvalidDateException + * will be thrown. + * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. + * @method Carbon disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method Carbon enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, + * then return the result of the closure (or null if the closure was void). + * @method Carbon fromSerialized($value) Create an instance from a serialized string. + * @method void genericMacro($macro, $priority = 0) Register a custom macro. + * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native + * name, region and variant of the locale. + * @method array getDays() Get the days of the week + * @method string|null getFallbackLocale() Get the fallback locale. + * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). + * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). + * @method array getIsoUnits() Returns list of locale units for ISO formatting. + * @method array getLastErrors() {@inheritdoc} + * @method string getLocale() Get the current translator locale. + * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. + * @method int getMidDayAt() get midday/noon hour + * @method Closure|Carbon getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" + * instance is created. + * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. + * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. + * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. + * @method int getWeekEndsAt() Get the last day of week + * @method int getWeekStartsAt() Get the first day of week + * @method array getWeekendDays() Get weekend days + * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasMacro($name) Checks if macro is registered globally. + * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. + * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance + * is anything that is not null. + * @method Carbon instance($date) Create a Carbon instance from a DateTime one. + * @method bool isImmutable() Returns true if the current class/instance is immutable. + * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. + * @method bool isMutable() Returns true if the current class/instance is mutable. + * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. + * (It can be overridden in specific instances.) + * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). + * Support is considered enabled if the 3 words are translated in the given locale. + * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). + * Support is considered enabled if the 2 words are translated in the given locale. + * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. + * Support is considered enabled if either year, day or hour has a short variant translated. + * @method void macro($name, $macro) Register a custom macro. + * @method Carbon|null make($var) Make a Carbon instance from given variable if possible. + * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * @method Carbon maxValue() Create a Carbon instance for the greatest supported date. + * @method Carbon minValue() Create a Carbon instance for the lowest supported date. + * @method void mixin($mixin) Mix another object into the class. + * @method Carbon now($tz = null) Get a Carbon instance for the current date and time. + * @method Carbon parse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method Carbon parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). + * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). + * @method Carbon|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method Carbon rawParse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method Carbon resetMacros() Remove all macros and generic macros. + * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string + * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather transform Carbon object before the serialization. + * JSON serialize all Carbon instances using the given callback. + * @method Carbon setFallbackLocale($locale) Set the fallback locale. + * @method Carbon setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. + * Pass 'auto' as locale to use closest language from the current LC_TIME locale. + * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider mid-day is always 12pm, then if you need to test if it's an other + * hour, test it explicitly: + * $date->format('G') == 13 + * or to set explicitly to a given hour: + * $date->setTime(13, 0, 0, 0) + * Set midday/noon hour + * @method Carbon setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * Note the timezone parameter was left out of the examples above and + * has no affect as the mock value will be returned regardless of its value. + * To clear the test instance call this method using the default + * parameter of null. + * /!\ Use this method for unit tests only. + * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and + * use other method or custom format passed to format() method if you need to dump an other string + * format. + * Set the default format used when type juggling a Carbon instance to a string + * @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use. + * @method Carbon setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use UTF-8 language packages on every machine. + * Set if UTF8 will be used for localized date/time. + * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek + * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the + * start of week according to current locale selected and implicitly the end of week. + * Set the last day of week + * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the + * 'first_day_of_week' locale setting to change the start of week according to current locale + * selected and implicitly the end of week. + * Set the first day of week + * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider week-end is always saturday and sunday, and if you have some custom + * week-end days to handle, give to those days an other name and create a macro for them: + * ``` + * Carbon::macro('isDayOff', function ($date) { + * return $date->isSunday() || $date->isMonday(); + * }); + * Carbon::macro('isNotDayOff', function ($date) { + * return !$date->isDayOff(); + * }); + * if ($someDate->isDayOff()) ... + * if ($someDate->isNotDayOff()) ... + * // Add 5 not-off days + * $count = 5; + * while ($someDate->isDayOff() || ($count-- > 0)) { + * $someDate->addDay(); + * } + * ``` + * Set weekend days + * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). + * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). + * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). + * @method Carbon today($tz = null) Create a Carbon instance for today. + * @method Carbon tomorrow($tz = null) Create a Carbon instance for tomorrow. + * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. + * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. + * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method Carbon useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. + * Using setTestNow to set the date, executing the callback, then + * clearing the test instance. + * /!\ Use this method for unit tests only. + * @method Carbon yesterday($tz = null) Create a Carbon instance for yesterday. * * */ diff --git a/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php b/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php index 3aa286c0..d4ee0304 100644 --- a/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php +++ b/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Closure; @@ -17,208 +18,208 @@ use Closure; * * * - * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a - * new instance. - * @method CarbonImmutable|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * @method CarbonImmutable createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. - * @method CarbonImmutable|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method CarbonImmutable|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). - * @method CarbonImmutable|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. - * @method CarbonImmutable|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. - * @method CarbonImmutable createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. - * @method CarbonImmutable createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. - * @method CarbonImmutable createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. - * @method CarbonImmutable|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * If one of the set values is not valid, an InvalidDateException - * will be thrown. - * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. - * @method CarbonImmutable disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method CarbonImmutable enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * @method CarbonImmutable fromSerialized($value) Create an instance from a serialized string. - * @method void genericMacro($macro, $priority = 0) Register a custom macro. - * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native - * name, region and variant of the locale. - * @method array getDays() Get the days of the week - * @method string|null getFallbackLocale() Get the fallback locale. - * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). - * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). - * @method array getIsoUnits() Returns list of locale units for ISO formatting. - * @method CarbonImmutable getLastErrors() {@inheritdoc} - * @method string getLocale() Get the current translator locale. - * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. - * @method int getMidDayAt() get midday/noon hour - * @method Closure|CarbonImmutable getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. - * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. - * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. - * @method int getWeekEndsAt() Get the last day of week - * @method int getWeekStartsAt() Get the first day of week - * @method array getWeekendDays() Get weekend days - * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasMacro($name) Checks if macro is registered globally. - * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. - * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * @method CarbonImmutable instance($date) Create a Carbon instance from a DateTime one. - * @method bool isImmutable() Returns true if the current class/instance is immutable. - * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. - * @method bool isMutable() Returns true if the current class/instance is mutable. - * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. - * (It can be overridden in specific instances.) - * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * @method void macro($name, $macro) Register a custom macro. - * @method CarbonImmutable|null make($var) Make a Carbon instance from given variable if possible. - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * @method CarbonImmutable maxValue() Create a Carbon instance for the greatest supported date. - * @method CarbonImmutable minValue() Create a Carbon instance for the lowest supported date. - * @method void mixin($mixin) Mix another object into the class. - * @method CarbonImmutable now($tz = null) Get a Carbon instance for the current date and time. - * @method CarbonImmutable parse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method CarbonImmutable parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). - * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). - * @method CarbonImmutable|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method CarbonImmutable rawParse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method CarbonImmutable resetMacros() Remove all macros and generic macros. - * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string - * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather transform Carbon object before the serialization. - * JSON serialize all Carbon instances using the given callback. - * @method CarbonImmutable setFallbackLocale($locale) Set the fallback locale. - * @method CarbonImmutable setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. - * Pass 'auto' as locale to use closest language from the current LC_TIME locale. - * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider mid-day is always 12pm, then if you need to test if it's an other - * hour, test it explicitly: - * $date->format('G') == 13 - * or to set explicitly to a given hour: - * $date->setTime(13, 0, 0, 0) - * Set midday/noon hour - * @method CarbonImmutable setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * To clear the test instance call this method using the default - * parameter of null. - * /!\ Use this method for unit tests only. - * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and - * use other method or custom format passed to format() method if you need to dump an other string - * format. - * Set the default format used when type juggling a Carbon instance to a string - * @method void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) Set the default translator instance to use. - * @method CarbonImmutable setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use UTF-8 language packages on every machine. - * Set if UTF8 will be used for localized date/time. - * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek - * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the - * start of week according to current locale selected and implicitly the end of week. - * Set the last day of week - * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the - * 'first_day_of_week' locale setting to change the start of week according to current locale - * selected and implicitly the end of week. - * Set the first day of week - * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider week-end is always saturday and sunday, and if you have some custom - * week-end days to handle, give to those days an other name and create a macro for them: - * ``` - * Carbon::macro('isDayOff', function ($date) { - * return $date->isSunday() || $date->isMonday(); - * }); - * Carbon::macro('isNotDayOff', function ($date) { - * return !$date->isDayOff(); - * }); - * if ($someDate->isDayOff()) ... - * if ($someDate->isNotDayOff()) ... - * // Add 5 not-off days - * $count = 5; - * while ($someDate->isDayOff() || ($count-- > 0)) { - * $someDate->addDay(); - * } - * ``` - * Set weekend days - * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). - * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). - * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). - * @method CarbonImmutable today($tz = null) Create a Carbon instance for today. - * @method CarbonImmutable tomorrow($tz = null) Create a Carbon instance for tomorrow. - * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. - * @method string translateWith(\Symfony\Component\Translation\TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. - * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method CarbonImmutable useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. - * Using setTestNow to set the date, executing the callback, then - * clearing the test instance. - * /!\ Use this method for unit tests only. - * @method CarbonImmutable yesterday($tz = null) Create a Carbon instance for yesterday. + * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a + * new instance. + * @method CarbonImmutable|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * @method CarbonImmutable createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. + * @method CarbonImmutable|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method CarbonImmutable|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). + * @method CarbonImmutable|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. + * @method CarbonImmutable|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. + * @method CarbonImmutable createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. + * @method CarbonImmutable createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. + * @method CarbonImmutable createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. + * @method CarbonImmutable|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * If one of the set values is not valid, an InvalidDateException + * will be thrown. + * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. + * @method CarbonImmutable disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method CarbonImmutable enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, + * then return the result of the closure (or null if the closure was void). + * @method CarbonImmutable fromSerialized($value) Create an instance from a serialized string. + * @method void genericMacro($macro, $priority = 0) Register a custom macro. + * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native + * name, region and variant of the locale. + * @method array getDays() Get the days of the week + * @method string|null getFallbackLocale() Get the fallback locale. + * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). + * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). + * @method array getIsoUnits() Returns list of locale units for ISO formatting. + * @method array getLastErrors() {@inheritdoc} + * @method string getLocale() Get the current translator locale. + * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. + * @method int getMidDayAt() get midday/noon hour + * @method Closure|CarbonImmutable getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" + * instance is created. + * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. + * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. + * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. + * @method int getWeekEndsAt() Get the last day of week + * @method int getWeekStartsAt() Get the first day of week + * @method array getWeekendDays() Get weekend days + * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasMacro($name) Checks if macro is registered globally. + * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. + * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance + * is anything that is not null. + * @method CarbonImmutable instance($date) Create a Carbon instance from a DateTime one. + * @method bool isImmutable() Returns true if the current class/instance is immutable. + * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. + * @method bool isMutable() Returns true if the current class/instance is mutable. + * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. + * (It can be overridden in specific instances.) + * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). + * Support is considered enabled if the 3 words are translated in the given locale. + * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). + * Support is considered enabled if the 2 words are translated in the given locale. + * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. + * Support is considered enabled if either year, day or hour has a short variant translated. + * @method void macro($name, $macro) Register a custom macro. + * @method CarbonImmutable|null make($var) Make a Carbon instance from given variable if possible. + * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * @method CarbonImmutable maxValue() Create a Carbon instance for the greatest supported date. + * @method CarbonImmutable minValue() Create a Carbon instance for the lowest supported date. + * @method void mixin($mixin) Mix another object into the class. + * @method CarbonImmutable now($tz = null) Get a Carbon instance for the current date and time. + * @method CarbonImmutable parse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method CarbonImmutable parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). + * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). + * @method CarbonImmutable|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method CarbonImmutable rawParse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method CarbonImmutable resetMacros() Remove all macros and generic macros. + * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string + * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather transform Carbon object before the serialization. + * JSON serialize all Carbon instances using the given callback. + * @method CarbonImmutable setFallbackLocale($locale) Set the fallback locale. + * @method CarbonImmutable setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. + * Pass 'auto' as locale to use closest language from the current LC_TIME locale. + * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider mid-day is always 12pm, then if you need to test if it's an other + * hour, test it explicitly: + * $date->format('G') == 13 + * or to set explicitly to a given hour: + * $date->setTime(13, 0, 0, 0) + * Set midday/noon hour + * @method CarbonImmutable setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * Note the timezone parameter was left out of the examples above and + * has no affect as the mock value will be returned regardless of its value. + * To clear the test instance call this method using the default + * parameter of null. + * /!\ Use this method for unit tests only. + * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and + * use other method or custom format passed to format() method if you need to dump an other string + * format. + * Set the default format used when type juggling a Carbon instance to a string + * @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use. + * @method CarbonImmutable setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use UTF-8 language packages on every machine. + * Set if UTF8 will be used for localized date/time. + * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek + * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the + * start of week according to current locale selected and implicitly the end of week. + * Set the last day of week + * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the + * 'first_day_of_week' locale setting to change the start of week according to current locale + * selected and implicitly the end of week. + * Set the first day of week + * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider week-end is always saturday and sunday, and if you have some custom + * week-end days to handle, give to those days an other name and create a macro for them: + * ``` + * Carbon::macro('isDayOff', function ($date) { + * return $date->isSunday() || $date->isMonday(); + * }); + * Carbon::macro('isNotDayOff', function ($date) { + * return !$date->isDayOff(); + * }); + * if ($someDate->isDayOff()) ... + * if ($someDate->isNotDayOff()) ... + * // Add 5 not-off days + * $count = 5; + * while ($someDate->isDayOff() || ($count-- > 0)) { + * $someDate->addDay(); + * } + * ``` + * Set weekend days + * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). + * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). + * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). + * @method CarbonImmutable today($tz = null) Create a Carbon instance for today. + * @method CarbonImmutable tomorrow($tz = null) Create a Carbon instance for tomorrow. + * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. + * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. + * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method CarbonImmutable useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. + * Using setTestNow to set the date, executing the callback, then + * clearing the test instance. + * /!\ Use this method for unit tests only. + * @method CarbonImmutable yesterday($tz = null) Create a Carbon instance for yesterday. * * */ diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php b/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php index 40d8d86c..f2fcf053 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/af.php', [ 'meridiem' => ['v', 'n'], 'weekdays' => ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php index 93f4c839..27896bd0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/af.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/agq.php b/vendor/nesbot/carbon/src/Carbon/Lang/agq.php index 58c7a110..70114649 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/agq.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/agq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a.g', 'a.k'], 'weekdays' => ['tsuʔntsɨ', 'tsuʔukpà', 'tsuʔughɔe', 'tsuʔutɔ̀mlò', 'tsuʔumè', 'tsuʔughɨ̂m', 'tsuʔndzɨkɔʔɔ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php index 8d377adb..e790b99e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php index 8d377adb..e790b99e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php index 8d377adb..e790b99e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php index 8d377adb..e790b99e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php index 8d377adb..e790b99e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php index 8d377adb..e790b99e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php index 8d377adb..e790b99e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php index 8d377adb..e790b99e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php index 8d377adb..e790b99e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/asa.php b/vendor/nesbot/carbon/src/Carbon/Lang/asa.php index 83897571..03bb4839 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/asa.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/asa.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['icheheavo', 'ichamthi'], 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php index d6979180..28fc62fe 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/az.php', [ 'weekdays' => ['базар', 'базар ертәси', 'чәршәнбә ахшамы', 'чәршәнбә', 'ҹүмә ахшамы', 'ҹүмә', 'шәнбә'], 'weekdays_short' => ['Б.', 'Б.Е.', 'Ч.А.', 'Ч.', 'Ҹ.А.', 'Ҹ.', 'Ш.'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php index 8346a5dd..0be33914 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/az.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bas.php b/vendor/nesbot/carbon/src/Carbon/Lang/bas.php index 1b342bbc..41bfa1d8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bas.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bas.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['I bikɛ̂glà', 'I ɓugajɔp'], 'weekdays' => ['ŋgwà nɔ̂y', 'ŋgwà njaŋgumba', 'ŋgwà ûm', 'ŋgwà ŋgê', 'ŋgwà mbɔk', 'ŋgwà kɔɔ', 'ŋgwà jôn'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/be.php b/vendor/nesbot/carbon/src/Carbon/Lang/be.php index ce8dbe83..51b4d0cc 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/be.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/be.php @@ -8,9 +8,14 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + // @codeCoverageIgnoreStart + +use Carbon\CarbonInterface; +use Symfony\Component\Translation\PluralizationRules; + if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - \Symfony\Component\Translation\PluralizationRules::set(function ($number) { + PluralizationRules::set(function ($number) { return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); }, 'be'); } @@ -113,7 +118,7 @@ return [ 'nextDay' => '[Заўтра ў] LT', 'nextWeek' => '[У] dddd [ў] LT', 'lastDay' => '[Учора ў] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 1: case 2: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bez.php b/vendor/nesbot/carbon/src/Carbon/Lang/bez.php index 1facc9dc..d59c5ef5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bez.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bez.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['pamilau', 'pamunyi'], 'weekdays' => ['pa mulungu', 'pa shahuviluha', 'pa hivili', 'pa hidatu', 'pa hitayi', 'pa hihanu', 'pa shahulembela'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bg.php b/vendor/nesbot/carbon/src/Carbon/Lang/bg.php index 0e17673e..f7680740 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bg.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bg.php @@ -17,6 +17,9 @@ * - JD Isaacks * - Glavić */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count година|:count години', 'a_year' => 'година|:count години', @@ -63,7 +66,7 @@ return [ 'nextDay' => '[Утре в] LT', 'nextWeek' => 'dddd [в] LT', 'lastDay' => '[Вчера в] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 0: case 3: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php b/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php index 85c0783e..b53874d3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/bg.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php b/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php index c3d9d8b1..380abb1e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/bo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php index a377fb54..ca50d049 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/bo.php', [ 'meridiem' => ['སྔ་དྲོ་', 'ཕྱི་དྲོ་'], 'weekdays' => ['གཟའ་ཉི་མ་', 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ་', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php index 9d939fd9..7f541858 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/br.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs.php index d2fc5aaa..e5d68083 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bs.php @@ -18,6 +18,9 @@ * - Serhan Apaydın * - JD Isaacks */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count godina|:count godine|:count godina', 'y' => ':count godina|:count godine|:count godina', @@ -55,7 +58,7 @@ return [ 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 0: return '[u] [nedjelju] [u] LT'; @@ -68,7 +71,7 @@ return [ } }, 'lastDay' => '[jučer u] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 0: case 3: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php index 4dd21bab..0a591176 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/bs.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php index 09221e0a..e1a17447 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/bs.php', [ 'meridiem' => ['пре подне', 'поподне'], 'weekdays' => ['недјеља', 'понедјељак', 'уторак', 'сриједа', 'четвртак', 'петак', 'субота'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php index 91ed1cc8..b4e363e7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/bs.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca.php index 5c914397..b8b19946 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca.php @@ -21,6 +21,9 @@ * - Xavi * - qcardona */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count any|:count anys', 'a_year' => 'un any|:count anys', @@ -69,19 +72,19 @@ return [ 'LLLL' => 'dddd D MMMM [de] YYYY [a les] H:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $current) { + 'sameDay' => function (CarbonInterface $current) { return '[avui a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'nextDay' => function (\Carbon\CarbonInterface $current) { + 'nextDay' => function (CarbonInterface $current) { return '[demà a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { return 'dddd [a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'lastDay' => function (\Carbon\CarbonInterface $current) { + 'lastDay' => function (CarbonInterface $current) { return '[ahir a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { return '[el] dddd [passat a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, 'sameElse' => 'L', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php index f5718c39..861acd2a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php index 84236064..50049786 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ca.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php index f5718c39..861acd2a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php index f5718c39..861acd2a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php index f5718c39..861acd2a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php b/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php index ec616a77..99c1dcac 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['𑄢𑄧𑄝𑄨𑄝𑄢𑄴', '𑄥𑄧𑄟𑄴𑄝𑄢𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴', '𑄝𑄪𑄖𑄴𑄝𑄢𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴', '𑄥𑄧𑄚𑄨𑄝𑄢𑄴'], 'weekdays_short' => ['𑄢𑄧𑄝𑄨', '𑄥𑄧𑄟𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴', '𑄝𑄪𑄖𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴', '𑄥𑄧𑄚𑄨'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php index 18bd1224..c1fa8af0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ccp.php', [ 'weekend' => [0, 0], ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php b/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php index e4244082..09bcc1c7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php index a16a3467..ea2517e8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/cs.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cu.php b/vendor/nesbot/carbon/src/Carbon/Lang/cu.php index 02c983aa..d6d13128 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php index ddff8931..197bd8d3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/cv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php b/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php index 541127c6..2c8148d0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/cy.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php b/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php index b3bac1a9..392c4841 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/da.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php b/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php index b2ba81f5..ea5698b9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/da.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dav.php b/vendor/nesbot/carbon/src/Carbon/Lang/dav.php index 79f021e1..e95ec4bb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dav.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dav.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Luma lwa K', 'luma lwa p'], 'weekdays' => ['Ituku ja jumwa', 'Kuramuka jimweri', 'Kuramuka kawi', 'Kuramuka kadadu', 'Kuramuka kana', 'Kuramuka kasanu', 'Kifula nguwo'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php b/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php index 82edfa1d..03e606a6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/de.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dje.php b/vendor/nesbot/carbon/src/Carbon/Lang/dje.php index 08ddbf13..74b7ac12 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dje.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dje.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Subbaahi', 'Zaarikay b'], 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamisi', 'Alzuma', 'Asibti'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dua.php b/vendor/nesbot/carbon/src/Carbon/Lang/dua.php index 65d712f5..55e5c7c3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dua.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dua.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['idiɓa', 'ebyámu'], 'weekdays' => ['éti', 'mɔ́sú', 'kwasú', 'mukɔ́sú', 'ŋgisú', 'ɗónɛsú', 'esaɓasú'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dv.php b/vendor/nesbot/carbon/src/Carbon/Lang/dv.php index a2b60dff..4b8d7e1a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dv.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dv.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + $months = [ 'ޖެނުއަރީ', 'ފެބްރުއަރީ', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php b/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php index 208fb5a3..2668d5b0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php @@ -3,7 +3,7 @@ /** * This file is part of the Carbon package. * - * (c) Ahmed Ali + * (c) Brian Nesbitt * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php b/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php index ecb649b0..33082e67 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Dimas', 'Teneŋ', 'Talata', 'Alarbay', 'Aramisay', 'Arjuma', 'Sibiti'], 'weekdays_short' => ['Dim', 'Ten', 'Tal', 'Ala', 'Ara', 'Arj', 'Sib'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php b/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php index 5aab48d9..f60bc6f2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['KI', 'UT'], 'weekdays' => ['Kiumia', 'Njumatatu', 'Njumaine', 'Njumatano', 'Aramithi', 'Njumaa', 'NJumamothii'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ee.php b/vendor/nesbot/carbon/src/Carbon/Lang/ee.php index 2fd9dcd8..f96c5c9d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ee.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ee.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ŋ', 'ɣ'], 'weekdays' => ['kɔsiɖa', 'dzoɖa', 'blaɖa', 'kuɖa', 'yawoɖa', 'fiɖa', 'memleɖa'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php index 02d77e6d..7a8b36c9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ee.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/el.php b/vendor/nesbot/carbon/src/Carbon/Lang/el.php index 09cf7e89..7c40f9c1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/el.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/el.php @@ -19,6 +19,9 @@ * - yiannisdesp * - Ilias Kasmeridis (iliaskasm) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count χρόνος|:count χρόνια', 'a_year' => 'ένας χρόνος|:count χρόνια', @@ -65,7 +68,7 @@ return [ 'nextDay' => '[Αύριο {}] LT', 'nextWeek' => 'dddd [{}] LT', 'lastDay' => '[Χθες {}] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 6: return '[το προηγούμενο] dddd [{}] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php index 6ae11c9a..11457b0c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php index 1d0d34ff..67bceaad 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php index ce4780c6..c4e2557e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php index ed0b3f93..5ee95241 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php index 9f2a3f74..e2dd81db 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php index 31f60e19..f086dc63 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es.php b/vendor/nesbot/carbon/src/Carbon/Lang/es.php index daaf2570..f77ec39c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es.php @@ -27,6 +27,9 @@ * - Daniel Commesse Liévanos (danielcommesse) * - Pete Scopes (pdscopes) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count año|:count años', 'a_year' => 'un año|:count años', @@ -77,19 +80,19 @@ return [ 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $current) { + 'sameDay' => function (CarbonInterface $current) { return '[hoy a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'nextDay' => function (\Carbon\CarbonInterface $current) { + 'nextDay' => function (CarbonInterface $current) { return '[mañana a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { return 'dddd [a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'lastDay' => function (\Carbon\CarbonInterface $current) { + 'lastDay' => function (CarbonInterface $current) { return '[ayer a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { return '[el] dddd [pasado a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, 'sameElse' => 'L', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php index e9dbe2b9..378d0547 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php index e9dbe2b9..378d0547 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php index 96391d47..f02e1a66 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php index 96391d47..f02e1a66 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php index 96391d47..f02e1a66 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php index 96391d47..f02e1a66 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php index ea345b21..deae06a1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'formats' => [ diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php b/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php index 3588f627..0f112b34 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/et.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php index 442cca79..0d1e82a9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/eu.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php b/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php index f5ae8cf9..7808ab50 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kíkíríg', 'ngəgógəle'], 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndi', 'sɔ́ndɔ məlú mə́bɛ̌', 'sɔ́ndɔ məlú mə́lɛ́', 'sɔ́ndɔ məlú mə́nyi', 'fúladé', 'séradé'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php index 06566fa4..69471004 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fa.php', [ 'meridiem' => ['ق', 'ب'], 'weekend' => [4, 5], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php b/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php index 6d1832c2..08d01825 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fa.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php index dafa98e3..b797ac09 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ff.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php index dafa98e3..b797ac09 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ff.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php index 65276d3f..2f4c29f6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ff.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php index 3597fa22..920f1caa 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php b/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php index e0f45378..657f2c5b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fo.php', [ 'formats' => [ 'L' => 'DD.MM.yy', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php b/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php index 6a4bc313..6d736167 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php index 52b951cd..67d37878 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'meridiem' => ['mat.', 'soir'], ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php index 40579a46..2f060869 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'formats' => [ diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php index 2c1ab853..ae8db5fa 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php index 7d2b1dbe..1bf034dc 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php index d177a7d7..37cf83f0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php index 2c1ab853..ae8db5fa 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php index d177a7d7..37cf83f0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php index d3e26568..6905e7a8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'weekend' => [5, 6], 'formats' => [ diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php index d177a7d7..37cf83f0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php index f9801e87..ec3ee359 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php index d50630cf..57b0c4fb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ga.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php b/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php index 80da9c65..4fc26b3d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gd.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gl.php b/vendor/nesbot/carbon/src/Carbon/Lang/gl.php index 58c1db15..088b0f28 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gl.php @@ -17,6 +17,9 @@ * - Diego Vilariño * - Sebastian Thierer */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count ano|:count anos', 'a_year' => 'un ano|:count anos', @@ -65,19 +68,19 @@ return [ 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $current) { + 'sameDay' => function (CarbonInterface $current) { return '[hoxe '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, - 'nextDay' => function (\Carbon\CarbonInterface $current) { + 'nextDay' => function (CarbonInterface $current) { return '[mañá '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { return 'dddd ['.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, - 'lastDay' => function (\Carbon\CarbonInterface $current) { + 'lastDay' => function (CarbonInterface $current) { return '[onte '.($current->hour !== 1 ? 'á' : 'a').'] LT'; }, - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { return '[o] dddd [pasado '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, 'sameElse' => 'L', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php index 12a565ff..9d6c1d96 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php index 5e54a368..612bb886 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return [ 'year' => ':count voros|:count vorsam', 'y' => ':countv', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php index 0dba9c54..594eb25d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gsw.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php index e0e7b234..3581dcfb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/gsw.php', [ 'meridiem' => ['vorm.', 'nam.'], 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php index e0e7b234..3581dcfb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/gsw.php', [ 'meridiem' => ['vorm.', 'nam.'], 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gu.php b/vendor/nesbot/carbon/src/Carbon/Lang/gu.php index 7c7872bc..8bc43114 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gu.php @@ -18,7 +18,7 @@ return [ 'year' => 'એક વર્ષ|:count વર્ષ', 'y' => ':countવર્ષ|:countવર્ષો', - 'month' => 'એક મહિનો|:count મહિનો', + 'month' => 'એક મહિનો|:count મહિના', 'm' => ':countમહિનો|:countમહિના', 'week' => ':count અઠવાડિયું|:count અઠવાડિયા', 'w' => ':countઅઠ.|:countઅઠ.', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php index c5784408..02654b1f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gu.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/guz.php b/vendor/nesbot/carbon/src/Carbon/Lang/guz.php index aa9769ce..6230165c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/guz.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/guz.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Ma', 'Mo'], 'weekdays' => ['Chumapiri', 'Chumatato', 'Chumaine', 'Chumatano', 'Aramisi', 'Ichuma', 'Esabato'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php b/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php index bce5e415..f9f99a73 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ha.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php index bce5e415..f9f99a73 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ha.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php index bce5e415..f9f99a73 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ha.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/haw.php b/vendor/nesbot/carbon/src/Carbon/Lang/haw.php index 51715d8e..cdd36861 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/haw.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/haw.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['Ianuali', 'Pepeluali', 'Malaki', 'ʻApelila', 'Mei', 'Iune', 'Iulai', 'ʻAukake', 'Kepakemapa', 'ʻOkakopa', 'Nowemapa', 'Kekemapa'], 'months_short' => ['Ian.', 'Pep.', 'Mal.', 'ʻAp.', 'Mei', 'Iun.', 'Iul.', 'ʻAu.', 'Kep.', 'ʻOk.', 'Now.', 'Kek.'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php b/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php index 57c4fec8..14fab3e9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/he.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php index ac302995..749dd97c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/hi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hr.php b/vendor/nesbot/carbon/src/Carbon/Lang/hr.php index acb7e92c..cfd85fd4 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hr.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/hr.php @@ -27,6 +27,9 @@ * - Stjepan Majdak * - Vanja Retkovac (vr00) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count godinu|:count godine|:count godina', 'y' => ':count god.|:count god.|:count god.', @@ -67,7 +70,7 @@ return [ 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[u] [nedjelju] [u] LT'; @@ -80,7 +83,7 @@ return [ } }, 'lastDay' => '[jučer u] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: case 3: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php b/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php index 2ae141dc..db74d8c7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/hr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hu.php b/vendor/nesbot/carbon/src/Carbon/Lang/hu.php index 673f9dc4..b2d2ac11 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/hu.php @@ -15,6 +15,9 @@ * - Brett Johnson * - balping */ + +use Carbon\CarbonInterface; + $huWeekEndings = ['vasárnap', 'hétfőn', 'kedden', 'szerdán', 'csütörtökön', 'pénteken', 'szombaton']; return [ @@ -99,11 +102,11 @@ return [ 'calendar' => [ 'sameDay' => '[ma] LT[-kor]', 'nextDay' => '[holnap] LT[-kor]', - 'nextWeek' => function (\Carbon\CarbonInterface $date) use ($huWeekEndings) { + 'nextWeek' => function (CarbonInterface $date) use ($huWeekEndings) { return '['.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; }, 'lastDay' => '[tegnap] LT[-kor]', - 'lastWeek' => function (\Carbon\CarbonInterface $date) use ($huWeekEndings) { + 'lastWeek' => function (CarbonInterface $date) use ($huWeekEndings) { return '[múlt '.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; }, 'sameElse' => 'L', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php b/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php index b33a6319..b1c48541 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/hu.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php b/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php index d19e4f40..e65449b8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php b/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php index 406112af..d5953a14 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/id.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ii.php b/vendor/nesbot/carbon/src/Carbon/Lang/ii.php index 30f83740..a4246c27 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ii.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ii.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ꎸꄑ', 'ꁯꋒ'], 'weekdays' => ['ꑭꆏꑍ', 'ꆏꊂꋍ', 'ꆏꊂꑍ', 'ꆏꊂꌕ', 'ꆏꊂꇖ', 'ꆏꊂꉬ', 'ꆏꊂꃘ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/in.php b/vendor/nesbot/carbon/src/Carbon/Lang/in.php index 406112af..d5953a14 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/in.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/in.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/id.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php b/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php index 8b91bb23..4d35c448 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/is.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it.php b/vendor/nesbot/carbon/src/Carbon/Lang/it.php index c23d8db1..605bcbb5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/it.php @@ -22,6 +22,9 @@ * - Davide Casiraghi (davide-casiraghi) * - Pete Scopes (pdscopes) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count anno|:count anni', 'a_year' => 'un anno|:count anni', @@ -81,7 +84,7 @@ return [ 'nextDay' => '[Domani alle] LT', 'nextWeek' => 'dddd [alle] LT', 'lastDay' => '[Ieri alle] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[la scorsa] dddd [alle] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php b/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php index 57fab39a..5e8fc92f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/it.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php b/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php index 57fab39a..5e8fc92f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/it.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/iw.php b/vendor/nesbot/carbon/src/Carbon/Lang/iw.php index a8034e83..a26e3506 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/iw.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/iw.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'], 'months_short' => ['ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ja.php b/vendor/nesbot/carbon/src/Carbon/Lang/ja.php index fa4cb367..1ca67519 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ja.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ja.php @@ -21,6 +21,9 @@ * - toyama satoshi * - atakigawa */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count年', 'y' => ':count年', @@ -56,7 +59,7 @@ return [ 'calendar' => [ 'sameDay' => '[今日] LT', 'nextDay' => '[明日] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($other->week !== $current->week) { return '[来週]dddd LT'; } @@ -64,7 +67,7 @@ return [ return 'dddd LT'; }, 'lastDay' => '[昨日] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'lastWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($other->week !== $current->week) { return '[先週]dddd LT'; } diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php b/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php index 9e035fdb..c2836253 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ja.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php b/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php index bad6beb7..6a1e77a8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php b/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php index f8cc72c1..ed92e8e7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ka.php b/vendor/nesbot/carbon/src/Carbon/Lang/ka.php index 5ddb957d..a5d563d3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ka.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ka.php @@ -24,6 +24,9 @@ * - Avtandil Kikabidze (akalongman) * - Levan Velijanashvili (Stichoza) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count წელი', 'y' => ':count წელი', @@ -149,7 +152,7 @@ return [ 'calendar' => [ 'sameDay' => '[დღეს], LT[-ზე]', 'nextDay' => '[ხვალ], LT[-ზე]', - 'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { return ($current->isSameWeek($other) ? '' : '[შემდეგ] ').'dddd, LT[-ზე]'; }, 'lastDay' => '[გუშინ], LT[-ზე]', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php index dd77fa3e..a26d9305 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ka.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kam.php b/vendor/nesbot/carbon/src/Carbon/Lang/kam.php index 0fb6b2ea..0fc70d70 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kam.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kam.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Ĩyakwakya', 'Ĩyawĩoo'], 'weekdays' => ['Wa kyumwa', 'Wa kwambĩlĩlya', 'Wa kelĩ', 'Wa katatũ', 'Wa kana', 'Wa katano', 'Wa thanthatũ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kde.php b/vendor/nesbot/carbon/src/Carbon/Lang/kde.php index 8acdaba3..fbcc9f3d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kde.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kde.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Muhi', 'Chilo'], 'weekdays' => ['Liduva lyapili', 'Liduva lyatatu', 'Liduva lyanchechi', 'Liduva lyannyano', 'Liduva lyannyano na linji', 'Liduva lyannyano na mavili', 'Liduva litandi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kea.php b/vendor/nesbot/carbon/src/Carbon/Lang/kea.php index 8a334e24..8b6c21b9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kea.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kea.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['dumingu', 'sigunda-fera', 'tersa-fera', 'kuarta-fera', 'kinta-fera', 'sesta-fera', 'sabadu'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/khq.php b/vendor/nesbot/carbon/src/Carbon/Lang/khq.php index f0649e7c..7a834cf0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/khq.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/khq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Adduha', 'Aluula'], 'weekdays' => ['Alhadi', 'Atini', 'Atalata', 'Alarba', 'Alhamiisa', 'Aljuma', 'Assabdu'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ki.php b/vendor/nesbot/carbon/src/Carbon/Lang/ki.php index 5754ffc1..d86afc50 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ki.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ki.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Kiroko', 'Hwaĩ-inĩ'], 'weekdays' => ['Kiumia', 'Njumatatũ', 'Njumaine', 'Njumatana', 'Aramithi', 'Njumaa', 'Njumamothi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php index af4a5b2b..7dc5ebcc 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/kk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php b/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php index bad6beb7..6a1e77a8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kln.php b/vendor/nesbot/carbon/src/Carbon/Lang/kln.php index b034ba50..b9c39968 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kln.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kln.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['krn', 'koosk'], 'weekdays' => ['Kotisap', 'Kotaai', 'Koaeng’', 'Kosomok', 'Koang’wan', 'Komuut', 'Kolo'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php b/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php index ef3b415e..92e5fdbd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/km.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php index 7c6c9096..30e3d886 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/kn.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php b/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php index 55b40fa2..4ba802b3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ko.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php index d8eba2cb..9d873a27 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ko.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php b/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php index 424099dc..aaa00614 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['makeo', 'nyiaghuo'], 'weekdays' => ['Jumaapii', 'Jumaatatu', 'Jumaane', 'Jumaatano', 'Alhamisi', 'Ijumaa', 'Jumaamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php b/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php index 8fb55989..84a59672 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['sárúwá', 'cɛɛ́nko'], 'weekdays' => ['sɔ́ndǝ', 'lǝndí', 'maadí', 'mɛkrɛdí', 'jǝǝdí', 'júmbá', 'samdí'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php b/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php index 44c60a4d..95457e24 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['v.M.', 'n.M.'], 'weekdays' => ['Sunndaach', 'Mohndaach', 'Dinnsdaach', 'Metwoch', 'Dunnersdaach', 'Friidaach', 'Samsdaach'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php index 11fce2d8..4243a82f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ku.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php index 4426bea4..9923a31e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ky.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lag.php b/vendor/nesbot/carbon/src/Carbon/Lang/lag.php index dc959c96..f3f57f6a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lag.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lag.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['TOO', 'MUU'], 'weekdays' => ['Jumapíiri', 'Jumatátu', 'Jumaíne', 'Jumatáano', 'Alamíisi', 'Ijumáa', 'Jumamóosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lb.php b/vendor/nesbot/carbon/src/Carbon/Lang/lb.php index db048342..7636655e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lb.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lb.php @@ -16,6 +16,9 @@ * - dan-nl * - Simon Lelorrain (slelorrain) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count Joer', 'y' => ':countJ', @@ -57,7 +60,7 @@ return [ 'nextDay' => '[Muer um] LT', 'nextWeek' => 'dddd [um] LT', 'lastDay' => '[Gëschter um] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule switch ($date->dayOfWeek) { case 2: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php b/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php index c8625fe9..414bd4d0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lb.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php b/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php index 968b0588..ae73a97b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'month' => ':count haŋwí', // less reliable diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php index e244096c..7fdb7f1b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php index e244096c..7fdb7f1b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php index e244096c..7fdb7f1b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php b/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php index c0a1d6b4..9b7fd9bf 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php b/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php index 10661bb0..546e6791 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'minute' => ':count هنر', // less reliable diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php index 449d8632..d42f5e97 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/lrc.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php b/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php index c3087f4e..f772d38b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lu.php b/vendor/nesbot/carbon/src/Carbon/Lang/lu.php index 8dab5417..c8cd83af 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Dinda', 'Dilolo'], 'weekdays' => ['Lumingu', 'Nkodya', 'Ndàayà', 'Ndangù', 'Njòwa', 'Ngòvya', 'Lubingu'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/luo.php b/vendor/nesbot/carbon/src/Carbon/Lang/luo.php index 201ca969..b55af731 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/luo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/luo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['OD', 'OT'], 'weekdays' => ['Jumapil', 'Wuok Tich', 'Tich Ariyo', 'Tich Adek', 'Tich Ang’wen', 'Tich Abich', 'Ngeso'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/luy.php b/vendor/nesbot/carbon/src/Carbon/Lang/luy.php index 52191253..2b37e3e3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/luy.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/luy.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Jumapiri', 'Jumatatu', 'Jumanne', 'Jumatano', 'Murwa wa Kanne', 'Murwa wa Katano', 'Jumamosi'], 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lv.php b/vendor/nesbot/carbon/src/Carbon/Lang/lv.php index 724b58df..693eceb5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lv.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lv.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use Carbon\CarbonInterface; /** @@ -168,6 +177,6 @@ return [ 'weekdays_short' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], 'weekdays_min' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], 'months' => ['janvārī', 'februārī', 'martā', 'aprīlī', 'maijā', 'jūnijā', 'jūlijā', 'augustā', 'septembrī', 'oktobrī', 'novembrī', 'decembrī'], - 'months_short' => ['Janv', 'Feb', 'Mar', 'Apr', 'Mai', 'Jūn', 'Jūl', 'Aug', 'Sept', 'Okt', 'Nov', 'Dec'], + 'months_short' => ['janv.', 'febr.', 'martā', 'apr.', 'maijā', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.'], 'meridiem' => ['priekšpusdiena', 'pēcpusdiena'], ]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php b/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php index 46c0f430..ee91c369 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mas.php b/vendor/nesbot/carbon/src/Carbon/Lang/mas.php index 723ae67e..cbd610c2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mas.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mas.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Ɛnkakɛnyá', 'Ɛndámâ'], 'weekdays' => ['Jumapílí', 'Jumatátu', 'Jumane', 'Jumatánɔ', 'Alaámisi', 'Jumáa', 'Jumamósi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php index aa382b72..56e29053 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/mas.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mer.php b/vendor/nesbot/carbon/src/Carbon/Lang/mer.php index cb7ba8d7..2e14597f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mer.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mer.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['RŨ', 'ŨG'], 'weekdays' => ['Kiumia', 'Muramuko', 'Wairi', 'Wethatu', 'Wena', 'Wetano', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php b/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php index 65798a80..2a80960d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['wichishu', 'mchochil’l'], 'weekdays' => ['Sabato', 'Jumatatu', 'Jumanne', 'Jumatano', 'Arahamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php b/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php index a5a07543..a126c9ff 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], 'weekdays_short' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php index 123d2292..6b964e3a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php b/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php index b56783ee..57faa318 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mk.php b/vendor/nesbot/carbon/src/Carbon/Lang/mk.php index 853bc96d..d822de09 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mk.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mk.php @@ -19,6 +19,9 @@ * - JD Isaacks * - Tomi Atanasoski */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count година|:count години', 'a_year' => 'година|:count години', @@ -65,7 +68,7 @@ return [ 'nextDay' => '[Утре во] LT', 'nextWeek' => '[Во] dddd [во] LT', 'lastDay' => '[Вчера во] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: case 3: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php b/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php index 06ff7d9d..95e2ff9c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php index 20878dce..000e7958 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ml.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mn.php b/vendor/nesbot/carbon/src/Carbon/Lang/mn.php index 25f65b33..717d199b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mn.php @@ -5,11 +5,8 @@ * * (c) Brian Nesbitt * - * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. - * - * @translator Batmandakh Erdenebileg */ /* diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php b/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php index b8fef24c..e5ce426c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mn.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mo.php b/vendor/nesbot/carbon/src/Carbon/Lang/mo.php index dd7c8f09..102afcde 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mo.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ro.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php index 556cefa2..7bca919f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms.php index ed7d48f8..36934eeb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ms.php @@ -75,12 +75,18 @@ return [ 'sameElse' => 'L', ], 'meridiem' => function ($hour) { + if ($hour < 1) { + return 'tengah malam'; + } + if ($hour < 12) { return 'pagi'; } - if ($hour < 15) { + + if ($hour < 13) { return 'tengah hari'; } + if ($hour < 19) { return 'petang'; } diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php index ea2b453b..ef837a2d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ms.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php index 097a168f..77cb83d2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ms.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php b/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php index 6ec2b339..9534f687 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mua.php b/vendor/nesbot/carbon/src/Carbon/Lang/mua.php index 8f1f9dcb..a3a3c6fd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mua.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mua.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['comme', 'lilli'], 'weekdays' => ['Com’yakke', 'Comlaaɗii', 'Comzyiiɗii', 'Comkolle', 'Comkaldǝɓlii', 'Comgaisuu', 'Comzyeɓsuu'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php b/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php index 1f27ccae..a0108dd4 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/my.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php b/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php index 6ad36042..70f5f23c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fa.php', [ 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/naq.php b/vendor/nesbot/carbon/src/Carbon/Lang/naq.php index 614ced43..fbd9be91 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/naq.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/naq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ǁgoagas', 'ǃuias'], 'weekdays' => ['Sontaxtsees', 'Mantaxtsees', 'Denstaxtsees', 'Wunstaxtsees', 'Dondertaxtsees', 'Fraitaxtsees', 'Satertaxtsees'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php b/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php index bd643a8e..31678c53 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nb.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php index 93cbaef1..ce0210bc 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/nb.php', [ 'formats' => [ 'LL' => 'D. MMM YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nd.php b/vendor/nesbot/carbon/src/Carbon/Lang/nd.php index d6fdaad3..f75d9a71 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nd.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nd.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sonto', 'Mvulo', 'Sibili', 'Sithathu', 'Sine', 'Sihlanu', 'Mgqibelo'], 'weekdays_short' => ['Son', 'Mvu', 'Sib', 'Sit', 'Sin', 'Sih', 'Mgq'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php index 2583bcf8..f68d00e3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ne.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php b/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php index 38caa1e5..27840c0f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ne.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php index 521d2d69..c269197b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php index 521d2d69..c269197b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php index 521d2d69..c269197b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php index 521d2d69..c269197b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php b/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php index f8850e29..4d1df6e5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['maná', 'kugú'], 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndɔ', 'sɔ́ndɔ mafú mába', 'sɔ́ndɔ mafú málal', 'sɔ́ndɔ mafú mána', 'mabágá má sukul', 'sásadi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php b/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php index ebbe0b78..8e168711 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nn.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php b/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php index fa6a448e..007d2399 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['mbaʼámbaʼ', 'ncwònzém'], 'weekdays' => null, diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nus.php b/vendor/nesbot/carbon/src/Carbon/Lang/nus.php index 033e9756..789bc391 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nus.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nus.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['RW', 'TŊ'], 'weekdays' => ['Cäŋ kuɔth', 'Jiec la̱t', 'Rɛw lätni', 'Diɔ̱k lätni', 'Ŋuaan lätni', 'Dhieec lätni', 'Bäkɛl lätni'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php b/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php index fdc2ff46..8660ea42 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/oc.php b/vendor/nesbot/carbon/src/Carbon/Lang/oc.php index 94c3e04c..89693e67 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/oc.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/oc.php @@ -14,8 +14,10 @@ * - Quentí */ // @codeCoverageIgnoreStart +use Symfony\Component\Translation\PluralizationRules; + if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - \Symfony\Component\Translation\PluralizationRules::set(function ($number) { + PluralizationRules::set(function ($number) { return $number == 1 ? 0 : 1; }, 'oc'); } diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php index fde859fd..01eb5c14 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/oc.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php b/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php index 46483439..044760e3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/om.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php index b29a40fb..f5a4d1c9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/om.php', [ 'day_of_first_week_of_year' => 0, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php b/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php index 8b04dee2..39b06532 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ur.php', [ 'weekdays' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], 'weekdays_short' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php b/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php index c0d35ecb..7adff5c3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/pa.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pl.php b/vendor/nesbot/carbon/src/Carbon/Lang/pl.php index ec3f52e5..109f3e4c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pl.php @@ -27,6 +27,9 @@ * - Jan (aso824) * - diverpl */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count rok|:count lata|:count lat', 'a_year' => 'rok|:count lata|:count lat', @@ -73,7 +76,7 @@ return [ 'calendar' => [ 'sameDay' => '[Dziś o] LT', 'nextDay' => '[Jutro o] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[W niedzielę o] LT'; @@ -88,7 +91,7 @@ return [ } }, 'lastDay' => '[Wczoraj o] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[W zeszłą niedzielę o] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php b/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php index 69cd6976..222bcdb4 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/prg.php b/vendor/nesbot/carbon/src/Carbon/Lang/prg.php index d0fd2f0d..6e63f4ad 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/prg.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/prg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php b/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php index e63121e3..6ec51804 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ps.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt.php index e36ca4c3..0af89499 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt.php @@ -23,6 +23,9 @@ * - Sebastian Thierer * - Claudson Martins (claudsonm) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count ano|:count anos', 'a_year' => 'um ano|:count anos', @@ -81,7 +84,7 @@ return [ 'nextDay' => '[Amanhã às] LT', 'nextWeek' => 'dddd [às] LT', 'lastDay' => '[Ontem às] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: case 6: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php index 3d13bca6..22c01ec5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php index 3d13bca6..22c01ec5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php index 3d13bca6..22c01ec5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php index 3d13bca6..22c01ec5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php index 3d13bca6..22c01ec5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php index 3d13bca6..22c01ec5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php index 331fa5cc..f2b5eab7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/pt.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php index 93bac23d..fbc0c97b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/pt.php', [ 'first_day_of_week' => 0, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php index 3d13bca6..22c01ec5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php index 3d13bca6..22c01ec5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/qu.php b/vendor/nesbot/carbon/src/Carbon/Lang/qu.php index 5f3a3924..65278cd1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/qu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/qu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es_UY.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php b/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php index 91635d59..d5db6bf5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/qu.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php b/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php index 91635d59..d5db6bf5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/qu.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rn.php b/vendor/nesbot/carbon/src/Carbon/Lang/rn.php index 637d4e5e..8ab958eb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/rn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Z.MU.', 'Z.MW.'], 'weekdays' => ['Ku w’indwi', 'Ku wa mbere', 'Ku wa kabiri', 'Ku wa gatatu', 'Ku wa kane', 'Ku wa gatanu', 'Ku wa gatandatu'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php index 0ba6f68a..ad1d2fa8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ro.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php b/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php index dd7c8f09..102afcde 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ro.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rof.php b/vendor/nesbot/carbon/src/Carbon/Lang/rof.php index 80ab454f..205fc266 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rof.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/rof.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kang’ama', 'kingoto'], 'weekdays' => ['Ijumapili', 'Ijumatatu', 'Ijumanne', 'Ijumatano', 'Alhamisi', 'Ijumaa', 'Ijumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru.php index 93e0e01b..673b043b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru.php @@ -35,6 +35,9 @@ * - Vladislav UnsealedOne * - dima-bzz */ + +use Carbon\CarbonInterface; + $transformDiff = function ($input) { return strtr($input, [ 'неделя' => 'неделю', @@ -97,7 +100,7 @@ return [ 'calendar' => [ 'sameDay' => '[Сегодня, в] LT', 'nextDay' => '[Завтра, в] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($current->week !== $other->week) { switch ($current->dayOfWeek) { case 0: @@ -120,7 +123,7 @@ return [ return '[В] dddd, [в] LT'; }, 'lastDay' => '[Вчера, в] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'lastWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($current->week !== $other->week) { switch ($current->dayOfWeek) { case 0: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php index 2c8d78f8..8ca7df34 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php index 2c8d78f8..8ca7df34 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php index 2c8d78f8..8ca7df34 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php index 2c8d78f8..8ca7df34 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php index 2c8d78f8..8ca7df34 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php b/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php index f8cc72c1..ed92e8e7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/saq.php b/vendor/nesbot/carbon/src/Carbon/Lang/saq.php index eebfac99..ff8bf604 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/saq.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/saq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Tesiran', 'Teipa'], 'weekdays' => ['Mderot ee are', 'Mderot ee kuni', 'Mderot ee ong’wan', 'Mderot ee inet', 'Mderot ee ile', 'Mderot ee sapa', 'Mderot ee kwe'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php b/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php index 9b737837..e29ca379 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Lwamilawu', 'Pashamihe'], 'weekdays' => ['Mulungu', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alahamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sd.php b/vendor/nesbot/carbon/src/Carbon/Lang/sd.php index ad8c0009..0022c5a9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sd.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sd.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + $months = [ 'جنوري', 'فيبروري', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php index b2b967ea..cf01805d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/se.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php b/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php index 83bbf78b..177c7e94 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/se.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php b/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php index 83bbf78b..177c7e94 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/se.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/seh.php b/vendor/nesbot/carbon/src/Carbon/Lang/seh.php index 3ad889ab..babf9afb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/seh.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/seh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Dimingu', 'Chiposi', 'Chipiri', 'Chitatu', 'Chinai', 'Chishanu', 'Sabudu'], 'weekdays_short' => ['Dim', 'Pos', 'Pir', 'Tat', 'Nai', 'Sha', 'Sab'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ses.php b/vendor/nesbot/carbon/src/Carbon/Lang/ses.php index 9355184f..e1099e65 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ses.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ses.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Adduha', 'Aluula'], 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamiisa', 'Alzuma', 'Asibti'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sg.php b/vendor/nesbot/carbon/src/Carbon/Lang/sg.php index 7f8e9daf..9264e893 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sg.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ND', 'LK'], 'weekdays' => ['Bikua-ôko', 'Bïkua-ûse', 'Bïkua-ptâ', 'Bïkua-usïö', 'Bïkua-okü', 'Lâpôsö', 'Lâyenga'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sh.php b/vendor/nesbot/carbon/src/Carbon/Lang/sh.php index a953df42..e4aa5a1c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sh.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sh.php @@ -8,9 +8,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + // @codeCoverageIgnoreStart +use Symfony\Component\Translation\PluralizationRules; + if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - \Symfony\Component\Translation\PluralizationRules::set(function ($number) { + PluralizationRules::set(function ($number) { return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); }, 'sh'); } diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shi.php b/vendor/nesbot/carbon/src/Carbon/Lang/shi.php index ee5aa0bc..78151869 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shi.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/shi.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ⵜⵉⴼⴰⵡⵜ', 'ⵜⴰⴷⴳⴳⵯⴰⵜ'], 'weekdays' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵕⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php index a5580c30..cddfb242 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/shi.php', [ 'meridiem' => ['tifawt', 'tadggʷat'], 'weekdays' => ['asamas', 'aynas', 'asinas', 'akṛas', 'akwas', 'asimwas', 'asiḍyas'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php b/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php index e51ed130..f3df1f2c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/shi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php b/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php index 6c5be974..81c44e0e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/si.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php index be3d1f24..0515601a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sl.php b/vendor/nesbot/carbon/src/Carbon/Lang/sl.php index 56d0f1bf..2e197212 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sl.php @@ -29,6 +29,9 @@ * - Lovro Tramšek (Lovro1107) * - burut13 */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count leto|:count leti|:count leta|:count let', 'y' => ':count leto|:count leti|:count leta|:count let', @@ -96,7 +99,7 @@ return [ 'nextDay' => '[jutri ob] LT', 'nextWeek' => 'dddd [ob] LT', 'lastDay' => '[včeraj ob] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[preteklo] [nedeljo] [ob] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php b/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php index da9fef05..5dad8c81 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/smn.php b/vendor/nesbot/carbon/src/Carbon/Lang/smn.php index b252ebbd..20add023 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/smn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/smn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ip.', 'ep.'], 'weekdays' => ['pasepeeivi', 'vuossaargâ', 'majebaargâ', 'koskoho', 'tuorâstuv', 'vástuppeeivi', 'lávurduv'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sn.php b/vendor/nesbot/carbon/src/Carbon/Lang/sn.php index 62c82b10..4f25028a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['Svondo', 'Muvhuro', 'Chipiri', 'Chitatu', 'China', 'Chishanu', 'Mugovera'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php index 0bfbdf3a..ea5df3f2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sq.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php index c844fe0d..62f752c4 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sq.php', [ 'formats' => [ 'L' => 'D.M.YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php index c844fe0d..62f752c4 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sq.php', [ 'formats' => [ 'L' => 'D.M.YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr.php index 6ecf2d02..68ba663a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr.php @@ -19,6 +19,9 @@ * - Glavić * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count godina|:count godine|:count godina', 'y' => ':count g.', @@ -64,7 +67,7 @@ return [ 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[u nedelju u] LT'; @@ -77,7 +80,7 @@ return [ } }, 'lastDay' => '[juče u] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[prošle nedelje u] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php index 85407423..c09df19c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php @@ -20,6 +20,9 @@ * - Nikola Zeravcic * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return [ 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', 'y' => ':count г.', @@ -63,7 +66,7 @@ return [ 'calendar' => [ 'sameDay' => '[данас у] LT', 'nextDay' => '[сутра у] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[у недељу у] LT'; @@ -76,7 +79,7 @@ return [ } }, 'lastDay' => '[јуче у] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[прошле недеље у] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php index 36405d38..0fb63d76 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Cyrl.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php index fb6179ee..d13229ab 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php @@ -14,6 +14,9 @@ * - Glavić * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return [ 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', 'y' => ':count г.', @@ -60,7 +63,7 @@ return [ 'calendar' => [ 'sameDay' => '[данас у] LT', 'nextDay' => '[сутра у] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[у недељу у] LT'; @@ -73,7 +76,7 @@ return [ } }, 'lastDay' => '[јуче у] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[прошле недеље у] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php index 0643a414..492baf0c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Cyrl_BA.php', [ 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php index 8ae8c41a..99716747 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php index c25a5072..897c674a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Latn.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php index de20f21c..e2133ef1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php @@ -14,6 +14,9 @@ * - Glavić * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return array_replace_recursive(require __DIR__.'/sr.php', [ 'month' => ':count mjesec|:count mjeseca|:count mjeseci', 'week' => ':count nedjelja|:count nedjelje|:count nedjelja', @@ -27,7 +30,7 @@ return array_replace_recursive(require __DIR__.'/sr.php', [ 'diff_tomorrow' => 'sjutra', 'calendar' => [ 'nextDay' => '[sjutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[u nedjelju u] LT'; @@ -39,7 +42,7 @@ return array_replace_recursive(require __DIR__.'/sr.php', [ return '[u] dddd [u] LT'; } }, - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[prošle nedjelje u] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php index ba7cc097..d0b9d10b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Latn_BA.php', [ 'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php index b668ee1b..d7c65b91 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sr_Latn_ME.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php index 8ae8c41a..99716747 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php index 48d970ae..ba89527c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ss.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php index 56425b4e..70cc5585 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sv.php', [ 'formats' => [ 'L' => 'YYYY-MM-dd', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php index 1b73ecb2..d7182c83 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php index 1b73ecb2..d7182c83 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php b/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php index f6927f47..ec9117b5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sw.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php b/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php index f6927f47..ec9117b5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sw.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php b/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php index 291d6c81..a6cd8b51 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ta.php', [ 'formats' => [ 'LT' => 'a h:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php index fe1cc062..7dbedeee 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ta.php', [ 'formats' => [ 'LT' => 'a h:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php index 6f81c405..3963f8d5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/te.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/teo.php b/vendor/nesbot/carbon/src/Carbon/Lang/teo.php index 950235ea..ca30c37d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/teo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/teo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ta.php', [ 'meridiem' => ['Taparachu', 'Ebongi'], 'weekdays' => ['Nakaejuma', 'Nakaebarasa', 'Nakaare', 'Nakauni', 'Nakaung’on', 'Nakakany', 'Nakasabiti'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php index 024d2729..010a04f5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/teo.php', [ 'first_day_of_week' => 0, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php index c6591e34..badc7d1f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/tg.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php b/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php index f11dc1b6..b9f94b2d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/th.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php b/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php index 1937fec9..23f11449 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/tr.php', [ 'weekdays_short' => ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'], 'weekdays_min' => ['Pa', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php b/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php index dc8e9358..9e994824 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/tr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/twq.php b/vendor/nesbot/carbon/src/Carbon/Lang/twq.php index e8ff278c..5cbb46e0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/twq.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/twq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ses.php', [ 'meridiem' => ['Subbaahi', 'Zaarikay b'], ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uk.php b/vendor/nesbot/carbon/src/Carbon/Lang/uk.php index e1827845..b267b000 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uk.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/uk.php @@ -8,7 +8,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -$processHoursFunction = function (\Carbon\CarbonInterface $date, string $format) { + +use Carbon\CarbonInterface; + +$processHoursFunction = function (CarbonInterface $date, string $format) { return $format.'о'.($date->hour === 11 ? 'б' : '').'] LT'; }; @@ -127,19 +130,19 @@ return [ 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'sameDay' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[Сьогодні '); }, - 'nextDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'nextDay' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[Завтра '); }, - 'nextWeek' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'nextWeek' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[У] dddd ['); }, - 'lastDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'lastDay' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[Вчора '); }, - 'lastWeek' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'lastWeek' => function (CarbonInterface $date) use ($processHoursFunction) { switch ($date->dayOfWeek) { case 0: case 3: @@ -183,7 +186,7 @@ return [ 'months_standalone' => ['січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень'], 'months_short' => ['січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру'], 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => function (\Carbon\CarbonInterface $date, $format, $index) { + 'weekdays' => function (CarbonInterface $date, $format, $index) { static $words = [ 'nominative' => ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'], 'accusative' => ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php b/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php index 5fc43171..bd11d86e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/uk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ur.php b/vendor/nesbot/carbon/src/Carbon/Lang/ur.php index e55aff28..dc16c2c3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ur.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ur.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + $months = [ 'جنوری', 'فروری', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php index 68719114..ffb51319 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fa.php', [ 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], 'weekdays_short' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php index e8754699..89e99718 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/uz.php', [ 'formats' => [ 'L' => 'DD/MM/yy', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vai.php b/vendor/nesbot/carbon/src/Carbon/Lang/vai.php index 3e6fce2b..3c378dfb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vai.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vai.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], 'weekdays_short' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php index b76c4bcf..51e83cc5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], 'weekdays_short' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php b/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php index 7b029a8a..b4bb533f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/vai.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php b/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php index 77b2dce5..18d89876 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/vi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vo.php b/vendor/nesbot/carbon/src/Carbon/Lang/vo.php index a956a783..e273033f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vun.php b/vendor/nesbot/carbon/src/Carbon/Lang/vun.php index f8cc72c1..ed92e8e7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vun.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vun.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/xog.php b/vendor/nesbot/carbon/src/Carbon/Lang/xog.php index 063977c0..eb55b4ab 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/xog.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/xog.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Munkyo', 'Eigulo'], 'weekdays' => ['Sabiiti', 'Balaza', 'Owokubili', 'Owokusatu', 'Olokuna', 'Olokutaanu', 'Olomukaaga'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yav.php b/vendor/nesbot/carbon/src/Carbon/Lang/yav.php index e44cde62..225a20d8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yav.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/yav.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kiɛmɛ́ɛm', 'kisɛ́ndɛ'], 'weekdays' => ['sɔ́ndiɛ', 'móndie', 'muányáŋmóndie', 'metúkpíápɛ', 'kúpélimetúkpiapɛ', 'feléte', 'séselé'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php index f06bb99f..12b9e815 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/yo.php', [ 'meridiem' => ['Àárɔ̀', 'Ɔ̀sán'], 'weekdays' => ['Ɔjɔ́ Àìkú', 'Ɔjɔ́ Ajé', 'Ɔjɔ́ Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɔjɔ́ Ɛtì', 'Ɔjɔ́ Àbámɛ́ta'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php b/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php index 92934bcb..6860bc1a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/yo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php b/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php index 007d0716..db913caa 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php b/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php index 24797f96..e2526f13 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php index 007d0716..db913caa 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php index 007d0716..db913caa 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php index 007d0716..db913caa 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php index 24797f96..e2526f13 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php index 24797f96..e2526f13 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php index 24797f96..e2526f13 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Language.php b/vendor/nesbot/carbon/src/Carbon/Language.php index 37902854..1fb5bafd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Language.php +++ b/vendor/nesbot/carbon/src/Carbon/Language.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use JsonSerializable; diff --git a/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php b/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php index d71c888b..8be0569e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php +++ b/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\Laravel; use Carbon\Carbon; diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php index 7dab190c..baee2041 100644 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php +++ b/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\PHPStan; use Closure; @@ -72,9 +81,8 @@ final class Macro implements BuiltinMethodReflection if ($this->reflectionFunction->isClosure()) { try { - /** @var Closure $closure */ $closure = $this->reflectionFunction->getClosure(); - $boundClosure = Closure::bind($closure, new stdClass); + $boundClosure = Closure::bind($closure, new stdClass()); $this->static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null); } catch (Throwable $e) { $this->static = true; @@ -148,6 +156,8 @@ final class Macro implements BuiltinMethodReflection /** * {@inheritdoc} + * + * @return string|false */ public function getFileName() { @@ -180,6 +190,8 @@ final class Macro implements BuiltinMethodReflection /** * {@inheritdoc} + * + * @return int|false */ public function getStartLine() { @@ -188,6 +200,8 @@ final class Macro implements BuiltinMethodReflection /** * {@inheritdoc} + * + * @return int|false */ public function getEndLine() { diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php index 5a3d6941..8e2524c0 100644 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php +++ b/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\PHPStan; use PHPStan\Reflection\ClassReflection; diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php index 97cf0b8e..d169939d 100644 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php +++ b/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\PHPStan; use Carbon\CarbonInterface; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php b/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php index 7fbb1a3f..71bbb723 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Exceptions\UnknownUnitException; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php b/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php index 44caf0b3..5f7c7c01 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\Traits; use Carbon\Exceptions\InvalidCastException; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php b/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php index ee00666c..68240b7c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use BadMethodCallException; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php b/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php index 7ba62256..8fe008a5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php b/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php index ad190789..f90195a0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; @@ -338,7 +339,7 @@ trait Creator return $now(static::now($tz)); } - return $now; + return $now->avoidMutation()->tz($tz); } /** @@ -931,6 +932,8 @@ trait Creator /** * {@inheritdoc} + * + * @return array */ #[ReturnTypeWillChange] public static function getLastErrors() diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/vendor/nesbot/carbon/src/Carbon/Traits/Date.php index e7762fa3..fc180fe4 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Date.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Date.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use BadMethodCallException; @@ -1572,7 +1573,13 @@ trait Date #[ReturnTypeWillChange] public function setTimezone($value) { - return parent::setTimezone(static::safeCreateDateTimeZone($value)); + $tz = static::safeCreateDateTimeZone($value); + + if ($tz === false && !self::isStrictModeEnabled()) { + $tz = new CarbonTimeZone(); + } + + return parent::setTimezone($tz); } /** diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php b/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php index 6f39fcd6..eb560576 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; @@ -123,10 +124,10 @@ trait Difference { $other = $this->resolveCarbon($date); - // Can be removed if https://github.com/derickr/timelib/pull/110 - // is merged - // https://bugs.php.net/bug.php?id=80998 was announced fixed in PHP 8.1.0beta3 - // but created a reverse-regression when using UTC, so we still need this hack + // Work-around for https://bugs.php.net/bug.php?id=81458 + // It was initially introduced for https://bugs.php.net/bug.php?id=80998 + // The very specific case of 80998 was fixed in PHP 8.1beta3, but it introduced 81458 + // So we still need to keep this for now // @codeCoverageIgnoreStart if (version_compare(PHP_VERSION, '8.1.0-dev', '>=') && $other->tz !== $this->tz) { $other = $other->avoidMutation()->tz($this->tz); diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php b/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php index 6f6c9d1d..4cd66b67 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterval; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php b/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php index 4882eef6..82d7c326 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php b/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php index 9162dc94..d7ece2de 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; @@ -237,10 +238,11 @@ trait Localization /** * Translate using translation string or callback available. * - * @param string $key - * @param array $parameters - * @param string|int|float|null $number - * @param \Symfony\Component\Translation\TranslatorInterface $translator + * @param string $key + * @param array $parameters + * @param string|int|float|null $number + * @param \Symfony\Component\Translation\TranslatorInterface|null $translator + * @param bool $altNumbers * * @return string */ diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php b/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php index d4135264..92b6c9d8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; /** diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php b/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php index b9c868df..ac06084a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Closure; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php b/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php index 2fd64264..164dbbd1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; @@ -429,6 +430,8 @@ trait Modifiers * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. * * @see https://php.net/manual/en/datetime.modify.php + * + * @return static|false */ #[ReturnTypeWillChange] public function modify($modify) diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php b/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php index 66eaa124..561c867d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php b/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php index 252df3a5..c77a1024 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; trait ObjectInitialisation diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Options.php b/vendor/nesbot/carbon/src/Carbon/Traits/Options.php index 5a27d810..0ddee8dd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Options.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Options.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php b/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php index 03d3fe69..33062397 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php b/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php index a27e4e35..eebc69bd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Exceptions\InvalidFormatException; @@ -135,6 +136,8 @@ trait Serialization /** * Set locale if specified on unserialize() called. + * + * @return void */ #[ReturnTypeWillChange] public function __wakeup() diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Test.php b/vendor/nesbot/carbon/src/Carbon/Traits/Test.php index d9989749..1287ed84 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Test.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Test.php @@ -8,10 +8,13 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; +use Carbon\CarbonInterface; use Closure; use DateTimeImmutable; +use DateTimeInterface; trait Test { @@ -54,6 +57,21 @@ trait Test static::$testNow = \is_string($testNow) ? static::parse($testNow) : $testNow; } + public static function setTestNowAndTimezone($testNow = null, $tz = null) + { + $useDateInstanceTimezone = $testNow instanceof DateTimeInterface; + + if ($useDateInstanceTimezone) { + date_default_timezone_set($testNow->getTimezone()->getName()); + } + + static::setTestNow($testNow); + + if (!$useDateInstanceTimezone) { + date_default_timezone_set(static::getMockedTestNow(\func_num_args() === 1 ? null : $tz)->timezone); + } + } + /** * Temporarily sets a static date to be used within the callback. * Using setTestNow to set the date, executing the callback, then @@ -61,8 +79,8 @@ trait Test * * /!\ Use this method for unit tests only. * - * @param Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback + * @param Closure|static|string|false|null $testNow real or mock Carbon instance + * @param Closure|null $callback * * @return mixed */ @@ -97,27 +115,6 @@ trait Test return static::getTestNow() !== null; } - /** - * Return the given timezone and set it to the test instance if not null. - * If null, get the timezone from the test instance and return it. - * - * @param string|\DateTimeZone $tz - * @param \Carbon\CarbonInterface $testInstance - * - * @return string|\DateTimeZone - */ - protected static function handleMockTimezone($tz, &$testInstance) - { - //shift the time according to the given time zone - if ($tz !== null && $tz !== static::getMockedTestNow($tz)->getTimezone()) { - $testInstance = $testInstance->setTimezone($tz); - - return $tz; - } - - return $testInstance->getTimezone(); - } - /** * Get the mocked date passed in setTestNow() and if it's a Closure, execute it. * @@ -138,20 +135,22 @@ trait Test } /* @var \Carbon\CarbonImmutable|\Carbon\Carbon|null $testNow */ - return $testNow; + return $testNow instanceof CarbonInterface + ? $testNow->avoidMutation()->tz($tz) + : $testNow; } - protected static function mockConstructorParameters(&$time, &$tz) + protected static function mockConstructorParameters(&$time, $tz) { /** @var \Carbon\CarbonImmutable|\Carbon\Carbon $testInstance */ $testInstance = clone static::getMockedTestNow($tz); - $tz = static::handleMockTimezone($tz, $testInstance); - if (static::hasRelativeKeywords($time)) { $testInstance = $testInstance->modify($time); } - $time = $testInstance instanceof self ? $testInstance->rawFormat(static::MOCK_DATETIME_FORMAT) : $testInstance->format(static::MOCK_DATETIME_FORMAT); + $time = $testInstance instanceof self + ? $testInstance->rawFormat(static::MOCK_DATETIME_FORMAT) + : $testInstance->format(static::MOCK_DATETIME_FORMAT); } } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php b/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php index 35d45aa5..2cb5c48d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; /** diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Units.php b/vendor/nesbot/carbon/src/Carbon/Traits/Units.php index 92eaef89..2902a8b1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Units.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Units.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonConverterInterface; @@ -306,11 +307,13 @@ trait Units $date = $date->modify("$value $unit"); if (isset($timeString)) { - return $date->setTimeFromTimeString($timeString); + $date = $date->setTimeFromTimeString($timeString); + } elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) { + $date = $date->modify('last day of previous month'); } - if (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) { - $date = $date->modify('last day of previous month'); + if (!$date) { + throw new UnitException('Unable to add unit '.var_export(\func_get_args(), true)); } return $date; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Week.php b/vendor/nesbot/carbon/src/Carbon/Traits/Week.php index 64cece7a..6f148145 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Week.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Week.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; /** diff --git a/vendor/nesbot/carbon/src/Carbon/Translator.php b/vendor/nesbot/carbon/src/Carbon/Translator.php index fb443171..99537d1c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Translator.php +++ b/vendor/nesbot/carbon/src/Carbon/Translator.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Closure; diff --git a/vendor/nette/utils/composer.json b/vendor/nette/utils/composer.json index f9875211..fa164d85 100644 --- a/vendor/nette/utils/composer.json +++ b/vendor/nette/utils/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=7.2 <8.1" + "php": ">=7.2 <8.2" }, "require-dev": { "nette/tester": "~2.0", diff --git a/vendor/nette/utils/readme.md b/vendor/nette/utils/readme.md index e1c85043..81ed0e91 100644 --- a/vendor/nette/utils/readme.md +++ b/vendor/nette/utils/readme.md @@ -27,6 +27,7 @@ In package nette/utils you will find a set of [useful classes](https://doc.nette - [Strings](https://doc.nette.org/strings) - useful text functions - [SmartObject](https://doc.nette.org/smartobject) - PHP object enhancements - [Validation](https://doc.nette.org/validators) - validate inputs +- [Type](https://doc.nette.org/type) - PHP data type Installation @@ -38,7 +39,7 @@ The recommended way to install is via Composer: composer require nette/utils ``` -- Nette Utils 3.2 is compatible with PHP 7.2 to 8.0 +- Nette Utils 3.2 is compatible with PHP 7.2 to 8.1 - Nette Utils 3.1 is compatible with PHP 7.1 to 8.0 - Nette Utils 3.0 is compatible with PHP 7.1 to 8.0 - Nette Utils 2.5 is compatible with PHP 5.6 to 8.0 diff --git a/vendor/nette/utils/src/Iterators/Mapper.php b/vendor/nette/utils/src/Iterators/Mapper.php index fec8086d..1a8647c6 100644 --- a/vendor/nette/utils/src/Iterators/Mapper.php +++ b/vendor/nette/utils/src/Iterators/Mapper.php @@ -27,6 +27,7 @@ class Mapper extends \IteratorIterator } + #[\ReturnTypeWillChange] public function current() { return ($this->callback)(parent::current(), parent::key()); diff --git a/vendor/nette/utils/src/Translator.php b/vendor/nette/utils/src/Translator.php index 8296a032..0f343a27 100644 --- a/vendor/nette/utils/src/Translator.php +++ b/vendor/nette/utils/src/Translator.php @@ -24,4 +24,4 @@ interface Translator } -interface_exists(Nette\Localization\ITranslator::class); +interface_exists(ITranslator::class); diff --git a/vendor/nette/utils/src/Utils/ArrayHash.php b/vendor/nette/utils/src/Utils/ArrayHash.php index b2aeb4cb..5de178e2 100644 --- a/vendor/nette/utils/src/Utils/ArrayHash.php +++ b/vendor/nette/utils/src/Utils/ArrayHash.php @@ -14,11 +14,13 @@ use Nette; /** * Provides objects to work as array. + * @template T */ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \IteratorAggregate { /** * Transforms array to ArrayHash. + * @param array $array * @return static */ public static function from(array $array, bool $recursive = true) @@ -35,6 +37,7 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator /** * Returns an iterator over all items. + * @return \RecursiveArrayIterator */ public function getIterator(): \RecursiveArrayIterator { @@ -54,7 +57,7 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator /** * Replaces or appends a item. * @param string|int $key - * @param mixed $value + * @param T $value */ public function offsetSet($key, $value): void { @@ -68,8 +71,9 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator /** * Returns a item. * @param string|int $key - * @return mixed + * @return T */ + #[\ReturnTypeWillChange] public function offsetGet($key) { return $this->$key; diff --git a/vendor/nette/utils/src/Utils/ArrayList.php b/vendor/nette/utils/src/Utils/ArrayList.php index dd009036..0a694652 100644 --- a/vendor/nette/utils/src/Utils/ArrayList.php +++ b/vendor/nette/utils/src/Utils/ArrayList.php @@ -14,6 +14,7 @@ use Nette; /** * Provides the base class for a generic list (items can be accessed by index). + * @template T */ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate { @@ -23,8 +24,25 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate private $list = []; + /** + * Transforms array to ArrayList. + * @param array $array + * @return static + */ + public static function from(array $array) + { + if (!Arrays::isList($array)) { + throw new Nette\InvalidArgumentException('Array is not valid list.'); + } + $obj = new static; + $obj->list = $array; + return $obj; + } + + /** * Returns an iterator over all items. + * @return \ArrayIterator */ public function getIterator(): \ArrayIterator { @@ -44,7 +62,7 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate /** * Replaces or appends a item. * @param int|null $index - * @param mixed $value + * @param T $value * @throws Nette\OutOfRangeException */ public function offsetSet($index, $value): void @@ -64,9 +82,10 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate /** * Returns a item. * @param int $index - * @return mixed + * @return T * @throws Nette\OutOfRangeException */ + #[\ReturnTypeWillChange] public function offsetGet($index) { if (!is_int($index) || $index < 0 || $index >= count($this->list)) { @@ -102,7 +121,7 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate /** * Prepends a item. - * @param mixed $value + * @param T $value */ public function prepend($value): void { diff --git a/vendor/nette/utils/src/Utils/Arrays.php b/vendor/nette/utils/src/Utils/Arrays.php index b5bcb477..775b6517 100644 --- a/vendor/nette/utils/src/Utils/Arrays.php +++ b/vendor/nette/utils/src/Utils/Arrays.php @@ -22,9 +22,11 @@ class Arrays /** * Returns item from array. If it does not exist, it throws an exception, unless a default value is set. - * @param string|int|array $key one or more keys - * @param mixed $default - * @return mixed + * @template T + * @param array $array + * @param array-key|array-key[] $key + * @param ?T $default + * @return ?T * @throws Nette\InvalidArgumentException if item does not exist and default value is not provided */ public static function get(array $array, $key, $default = null) @@ -45,8 +47,10 @@ class Arrays /** * Returns reference to array item. If the index does not exist, new one is created with value null. - * @param string|int|array $key one or more keys - * @return mixed + * @template T + * @param array $array + * @param array-key|array-key[] $key + * @return ?T * @throws Nette\InvalidArgumentException if traversed item is not an array */ public static function &getRef(array &$array, $key) @@ -66,6 +70,11 @@ class Arrays * Recursively merges two fields. It is useful, for example, for merging tree structures. It behaves as * the + operator for array, ie. it adds a key/value pair from the second array to the first one and retains * the value from the first array in the case of a key collision. + * @template T1 + * @template T2 + * @param array $array1 + * @param array $array2 + * @return array */ public static function mergeTree(array $array1, array $array2): array { @@ -81,7 +90,7 @@ class Arrays /** * Returns zero-indexed position of given array key. Returns null if key is not found. - * @param string|int $key + * @param array-key $key * @return int|null offset if it is found, null otherwise */ public static function getKeyOffset(array $array, $key): ?int @@ -111,7 +120,9 @@ class Arrays /** * Returns the first item from the array or null if array is empty. - * @return mixed + * @template T + * @param array $array + * @return ?T */ public static function first(array $array) { @@ -121,7 +132,9 @@ class Arrays /** * Returns the last item from the array or null if array is empty. - * @return mixed + * @template T + * @param array $array + * @return ?T */ public static function last(array $array) { @@ -132,7 +145,7 @@ class Arrays /** * Inserts the contents of the $inserted array into the $array immediately after the $key. * If $key is null (or does not exist), it is inserted at the beginning. - * @param string|int|null $key + * @param array-key|null $key */ public static function insertBefore(array &$array, $key, array $inserted): void { @@ -146,7 +159,7 @@ class Arrays /** * Inserts the contents of the $inserted array into the $array before the $key. * If $key is null (or does not exist), it is inserted at the end. - * @param string|int|null $key + * @param array-key|null $key */ public static function insertAfter(array &$array, $key, array $inserted): void { @@ -161,8 +174,8 @@ class Arrays /** * Renames key in array. - * @param string|int $oldKey - * @param string|int $newKey + * @param array-key $oldKey + * @param array-key $newKey */ public static function renameKey(array &$array, $oldKey, $newKey): bool { @@ -181,7 +194,8 @@ class Arrays /** * Returns only those array items, which matches a regular expression $pattern. - * @throws Nette\RegexpException on compilation or runtime error + * @param string[] $array + * @return string[] */ public static function grep(array $array, string $pattern, int $flags = 0): array { @@ -286,9 +300,11 @@ class Arrays /** * Returns and removes the value of an item from an array. If it does not exist, it throws an exception, * or returns $default, if provided. - * @param string|int $key - * @param mixed $default - * @return mixed + * @template T + * @param array $array + * @param array-key $key + * @param ?T $default + * @return ?T * @throws Nette\InvalidArgumentException if item does not exist and default value is not provided */ public static function pick(array &$array, $key, $default = null) @@ -381,8 +397,9 @@ class Arrays /** * Copies the elements of the $array array to the $object object and then returns it. - * @param object $object - * @return object + * @template T of object + * @param T $object + * @return T */ public static function toObject(iterable $array, $object) { @@ -396,7 +413,7 @@ class Arrays /** * Converts value to array key. * @param mixed $value - * @return int|string + * @return array-key */ public static function toKey($value) { @@ -407,6 +424,7 @@ class Arrays /** * Returns copy of the $array where every item is converted to string * and prefixed by $prefix and suffixed by $suffix. + * @param string[] $array * @return string[] */ public static function wrap(array $array, string $prefix = '', string $suffix = ''): array diff --git a/vendor/nette/utils/src/Utils/DateTime.php b/vendor/nette/utils/src/Utils/DateTime.php index 74aaafae..320ccc77 100644 --- a/vendor/nette/utils/src/Utils/DateTime.php +++ b/vendor/nette/utils/src/Utils/DateTime.php @@ -97,6 +97,7 @@ class DateTime extends \DateTime implements \JsonSerializable * @param string|\DateTimeZone $timezone (default timezone is used if null is passed) * @return static|false */ + #[\ReturnTypeWillChange] public static function createFromFormat($format, $time, $timezone = null) { if ($timezone === null) { diff --git a/vendor/nette/utils/src/Utils/FileSystem.php b/vendor/nette/utils/src/Utils/FileSystem.php index 6753d195..16d5ffd1 100644 --- a/vendor/nette/utils/src/Utils/FileSystem.php +++ b/vendor/nette/utils/src/Utils/FileSystem.php @@ -148,6 +148,29 @@ final class FileSystem } + /** + * Fixes permissions to a specific file or directory. Directories can be fixed recursively. + * @throws Nette\IOException on error occurred + */ + public static function makeWritable(string $path, int $dirMode = 0777, int $fileMode = 0666): void + { + if (is_file($path)) { + if (!@chmod($path, $fileMode)) { // @ is escalated to exception + throw new Nette\IOException("Unable to chmod file '$path' to mode " . decoct($fileMode) . '. ' . Helpers::getLastError()); + } + } elseif (is_dir($path)) { + foreach (new \FilesystemIterator($path) as $item) { + static::makeWritable($item->getPathname(), $dirMode, $fileMode); + } + if (!@chmod($path, $dirMode)) { // @ is escalated to exception + throw new Nette\IOException("Unable to chmod directory '$path' to mode " . decoct($dirMode) . '. ' . Helpers::getLastError()); + } + } else { + throw new Nette\IOException("File or directory '$path' not found."); + } + } + + /** * Determines if the path is absolute. */ diff --git a/vendor/nette/utils/src/Utils/Html.php b/vendor/nette/utils/src/Utils/Html.php index 1d421765..cf628933 100644 --- a/vendor/nette/utils/src/Utils/Html.php +++ b/vendor/nette/utils/src/Utils/Html.php @@ -248,7 +248,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab 'isindex' => 1, 'wbr' => 1, 'command' => 1, 'track' => 1, ]; - /** @var array nodes */ + /** @var array nodes */ protected $children = []; /** @var string element's name */ @@ -662,8 +662,9 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Returns child node (\ArrayAccess implementation). * @param int $index - * @return static|string + * @return HtmlStringable|string */ + #[\ReturnTypeWillChange] final public function offsetGet($index) { return $this->children[$index]; @@ -712,6 +713,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Iterates over elements. + * @return \ArrayIterator */ final public function getIterator(): \ArrayIterator { diff --git a/vendor/nette/utils/src/Utils/ObjectHelpers.php b/vendor/nette/utils/src/Utils/ObjectHelpers.php index 676c2176..4be86534 100644 --- a/vendor/nette/utils/src/Utils/ObjectHelpers.php +++ b/vendor/nette/utils/src/Utils/ObjectHelpers.php @@ -47,27 +47,59 @@ final class ObjectHelpers /** @throws MemberAccessException */ public static function strictCall(string $class, string $method, array $additionalMethods = []): void { - $hint = self::getSuggestion(array_merge( - get_class_methods($class), - self::parseFullDoc(new \ReflectionClass($class), '~^[ \t*]*@method[ \t]+(?:\S+[ \t]+)??(\w+)\(~m'), - $additionalMethods - ), $method); + $trace = debug_backtrace(0, 3); // suppose this method is called from __call() + $context = ($trace[1]['function'] ?? null) === '__call' + ? ($trace[2]['class'] ?? null) + : null; - if (method_exists($class, $method)) { // called parent::$method() - $class = 'parent'; + if ($context && is_a($class, $context, true) && method_exists($context, $method)) { // called parent::$method() + $class = get_parent_class($context); + } + + if (method_exists($class, $method)) { // insufficient visibility + $rm = new \ReflectionMethod($class, $method); + $visibility = $rm->isPrivate() + ? 'private ' + : ($rm->isProtected() ? 'protected ' : ''); + throw new MemberAccessException("Call to {$visibility}method $class::$method() from " . ($context ? "scope $context." : 'global scope.')); + + } else { + $hint = self::getSuggestion(array_merge( + get_class_methods($class), + self::parseFullDoc(new \ReflectionClass($class), '~^[ \t*]*@method[ \t]+(?:\S+[ \t]+)??(\w+)\(~m'), + $additionalMethods + ), $method); + throw new MemberAccessException("Call to undefined method $class::$method()" . ($hint ? ", did you mean $hint()?" : '.')); } - throw new MemberAccessException("Call to undefined method $class::$method()" . ($hint ? ", did you mean $hint()?" : '.')); } /** @throws MemberAccessException */ public static function strictStaticCall(string $class, string $method): void { - $hint = self::getSuggestion( - array_filter((new \ReflectionClass($class))->getMethods(\ReflectionMethod::IS_PUBLIC), function ($m) { return $m->isStatic(); }), - $method - ); - throw new MemberAccessException("Call to undefined static method $class::$method()" . ($hint ? ", did you mean $hint()?" : '.')); + $trace = debug_backtrace(0, 3); // suppose this method is called from __callStatic() + $context = ($trace[1]['function'] ?? null) === '__callStatic' + ? ($trace[2]['class'] ?? null) + : null; + + if ($context && is_a($class, $context, true) && method_exists($context, $method)) { // called parent::$method() + $class = get_parent_class($context); + } + + if (method_exists($class, $method)) { // insufficient visibility + $rm = new \ReflectionMethod($class, $method); + $visibility = $rm->isPrivate() + ? 'private ' + : ($rm->isProtected() ? 'protected ' : ''); + throw new MemberAccessException("Call to {$visibility}method $class::$method() from " . ($context ? "scope $context." : 'global scope.')); + + } else { + $hint = self::getSuggestion( + array_filter((new \ReflectionClass($class))->getMethods(\ReflectionMethod::IS_PUBLIC), function ($m) { return $m->isStatic(); }), + $method + ); + throw new MemberAccessException("Call to undefined static method $class::$method()" . ($hint ? ", did you mean $hint()?" : '.')); + } } diff --git a/vendor/nette/utils/src/Utils/Paginator.php b/vendor/nette/utils/src/Utils/Paginator.php index 5b37ee3d..57733bce 100644 --- a/vendor/nette/utils/src/Utils/Paginator.php +++ b/vendor/nette/utils/src/Utils/Paginator.php @@ -18,6 +18,8 @@ use Nette; * @property int $page * @property-read int $firstPage * @property-read int|null $lastPage + * @property-read int $firstItemOnPage + * @property-read int $lastItemOnPage * @property int $base * @property-read bool $first * @property-read bool $last @@ -85,6 +87,26 @@ class Paginator } + /** + * Returns the sequence number of the first element on the page + */ + public function getFirstItemOnPage(): int + { + return $this->itemCount !== 0 + ? $this->offset + 1 + : 0; + } + + + /** + * Returns the sequence number of the last element on the page + */ + public function getLastItemOnPage(): int + { + return $this->offset + $this->length; + } + + /** * Sets first page (base) number. * @return static diff --git a/vendor/nette/utils/src/Utils/Reflection.php b/vendor/nette/utils/src/Utils/Reflection.php index cf62121e..0106a95e 100644 --- a/vendor/nette/utils/src/Utils/Reflection.php +++ b/vendor/nette/utils/src/Utils/Reflection.php @@ -22,6 +22,7 @@ final class Reflection private const BUILTIN_TYPES = [ 'string' => 1, 'int' => 1, 'float' => 1, 'bool' => 1, 'array' => 1, 'object' => 1, 'callable' => 1, 'iterable' => 1, 'void' => 1, 'null' => 1, 'mixed' => 1, 'false' => 1, + 'never' => 1, ]; @@ -37,27 +38,29 @@ final class Reflection /** * Returns the type of return value of given function or method and normalizes `self`, `static`, and `parent` to actual class names. * If the function does not have a return type, it returns null. - * If the function has union type, it throws Nette\InvalidStateException. + * If the function has union or intersection type, it throws Nette\InvalidStateException. */ public static function getReturnType(\ReflectionFunctionAbstract $func): ?string { - return self::getType($func, $func->getReturnType()); + $type = $func->getReturnType() ?? (PHP_VERSION_ID >= 80100 && $func instanceof \ReflectionMethod ? $func->getTentativeReturnType() : null); + return self::getType($func, $type); } /** - * Returns the types of return value of given function or method and normalizes `self`, `static`, and `parent` to actual class names. + * @deprecated */ public static function getReturnTypes(\ReflectionFunctionAbstract $func): array { - return self::getType($func, $func->getReturnType(), true); + $type = Type::fromReflection($func); + return $type ? $type->getNames() : []; } /** * Returns the type of given parameter and normalizes `self` and `parent` to the actual class names. * If the parameter does not have a type, it returns null. - * If the parameter has union type, it throws Nette\InvalidStateException. + * If the parameter has union or intersection type, it throws Nette\InvalidStateException. */ public static function getParameterType(\ReflectionParameter $param): ?string { @@ -66,18 +69,19 @@ final class Reflection /** - * Returns the types of given parameter and normalizes `self` and `parent` to the actual class names. + * @deprecated */ public static function getParameterTypes(\ReflectionParameter $param): array { - return self::getType($param, $param->getType(), true); + $type = Type::fromReflection($param); + return $type ? $type->getNames() : []; } /** * Returns the type of given property and normalizes `self` and `parent` to the actual class names. * If the property does not have a type, it returns null. - * If the property has union type, it throws Nette\InvalidStateException. + * If the property has union or intersection type, it throws Nette\InvalidStateException. */ public static function getPropertyType(\ReflectionProperty $prop): ?string { @@ -86,41 +90,28 @@ final class Reflection /** - * Returns the types of given property and normalizes `self` and `parent` to the actual class names. + * @deprecated */ public static function getPropertyTypes(\ReflectionProperty $prop): array { - return self::getType($prop, PHP_VERSION_ID >= 70400 ? $prop->getType() : null, true); + $type = Type::fromReflection($prop); + return $type ? $type->getNames() : []; } /** * @param \ReflectionFunction|\ReflectionMethod|\ReflectionParameter|\ReflectionProperty $reflection - * @return string|array|null */ - private static function getType($reflection, ?\ReflectionType $type, bool $asArray = false) + private static function getType($reflection, ?\ReflectionType $type): ?string { if ($type === null) { - return $asArray ? [] : null; + return null; } elseif ($type instanceof \ReflectionNamedType) { - $name = self::normalizeType($type->getName(), $reflection); - if ($asArray) { - return $type->allowsNull() && $type->getName() !== 'mixed' - ? [$name, 'null'] - : [$name]; - } - return $name; + return Type::resolve($type->getName(), $reflection); - } elseif ($type instanceof \ReflectionUnionType) { - if ($asArray) { - $types = []; - foreach ($type->getTypes() as $type) { - $types[] = self::normalizeType($type->getName(), $reflection); - } - return $types; - } - throw new Nette\InvalidStateException('The ' . self::toString($reflection) . ' is not expected to have a union type.'); + } elseif ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) { + throw new Nette\InvalidStateException('The ' . self::toString($reflection) . ' is not expected to have a union or intersection type.'); } else { throw new Nette\InvalidStateException('Unexpected type of ' . self::toString($reflection)); @@ -128,24 +119,6 @@ final class Reflection } - /** - * @param \ReflectionFunction|\ReflectionMethod|\ReflectionParameter|\ReflectionProperty $reflection - */ - private static function normalizeType(string $type, $reflection): string - { - $lower = strtolower($type); - if ($reflection instanceof \ReflectionFunction) { - return $type; - } elseif ($lower === 'self' || $lower === 'static') { - return $reflection->getDeclaringClass()->name; - } elseif ($lower === 'parent' && $reflection->getDeclaringClass()->getParentClass()) { - return $reflection->getDeclaringClass()->getParentClass()->name; - } else { - return $type; - } - } - - /** * Returns the default value of parameter. If it is a constant, it returns its value. * @return mixed @@ -157,7 +130,7 @@ final class Reflection $const = $orig = $param->getDefaultValueConstantName(); $pair = explode('::', $const); if (isset($pair[1])) { - $pair[0] = self::normalizeType($pair[0], $param); + $pair[0] = Type::resolve($pair[0], $param); try { $rcc = new \ReflectionClassConstant($pair[0], $pair[1]); } catch (\ReflectionException $e) { @@ -343,6 +316,9 @@ final class Reflection case T_CLASS: case T_INTERFACE: case T_TRAIT: + case PHP_VERSION_ID < 80100 + ? T_CLASS + : T_ENUM: if ($name = self::fetch($tokens, T_STRING)) { $class = $namespace . $name; $classLevel = $level + 1; diff --git a/vendor/nette/utils/src/Utils/Strings.php b/vendor/nette/utils/src/Utils/Strings.php index c7fb74d7..e5e626b4 100644 --- a/vendor/nette/utils/src/Utils/Strings.php +++ b/vendor/nette/utils/src/Utils/Strings.php @@ -425,7 +425,7 @@ class Strings /** - * Returns position in bytes of $nth occurence of $needle in $haystack or null if the $needle was not found. + * Returns position in characters of $nth occurence of $needle in $haystack or null if the $needle was not found. * Negative value of `$nth` means searching from the end. */ public static function indexOf(string $haystack, string $needle, int $nth = 1): ?int @@ -438,7 +438,7 @@ class Strings /** - * Returns position in bytes of $nth occurence of $needle in $haystack or null if the needle was not found. + * Returns position in characters of $nth occurence of $needle in $haystack or null if the needle was not found. */ private static function pos(string $haystack, string $needle, int $nth = 1): ?int { diff --git a/vendor/nette/utils/src/Utils/Type.php b/vendor/nette/utils/src/Utils/Type.php new file mode 100644 index 00000000..49d5adbf --- /dev/null +++ b/vendor/nette/utils/src/Utils/Type.php @@ -0,0 +1,240 @@ +getReturnType() ?? (PHP_VERSION_ID >= 80100 ? $reflection->getTentativeReturnType() : null); + } else { + $type = $reflection instanceof \ReflectionFunctionAbstract + ? $reflection->getReturnType() + : $reflection->getType(); + } + + if ($type === null) { + return null; + + } elseif ($type instanceof \ReflectionNamedType) { + $name = self::resolve($type->getName(), $reflection); + return new self($type->allowsNull() && $type->getName() !== 'mixed' ? [$name, 'null'] : [$name]); + + } elseif ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) { + return new self( + array_map( + function ($t) use ($reflection) { return self::resolve($t->getName(), $reflection); }, + $type->getTypes() + ), + $type instanceof \ReflectionUnionType ? '|' : '&' + ); + + } else { + throw new Nette\InvalidStateException('Unexpected type of ' . Reflection::toString($reflection)); + } + } + + + /** + * Creates the Type object according to the text notation. + */ + public static function fromString(string $type): self + { + if (!preg_match('#(?: + \?([\w\\\\]+)| + [\w\\\\]+ (?: (&[\w\\\\]+)* | (\|[\w\\\\]+)* ) + )()$#xAD', $type, $m)) { + throw new Nette\InvalidArgumentException("Invalid type '$type'."); + } + [, $nType, $iType] = $m; + if ($nType) { + return new self([$nType, 'null']); + } elseif ($iType) { + return new self(explode('&', $type), '&'); + } else { + return new self(explode('|', $type)); + } + } + + + /** + * Resolves 'self', 'static' and 'parent' to the actual class name. + * @param \ReflectionFunctionAbstract|\ReflectionParameter|\ReflectionProperty $reflection + */ + public static function resolve(string $type, $reflection): string + { + $lower = strtolower($type); + if ($reflection instanceof \ReflectionFunction) { + return $type; + } elseif ($lower === 'self' || $lower === 'static') { + return $reflection->getDeclaringClass()->name; + } elseif ($lower === 'parent' && $reflection->getDeclaringClass()->getParentClass()) { + return $reflection->getDeclaringClass()->getParentClass()->name; + } else { + return $type; + } + } + + + private function __construct(array $types, string $kind = '|') + { + if ($types[0] === 'null') { // null as last + array_push($types, array_shift($types)); + } + $this->types = $types; + $this->single = ($types[1] ?? 'null') === 'null'; + $this->kind = count($types) > 1 ? $kind : ''; + } + + + public function __toString(): string + { + return $this->single + ? (count($this->types) > 1 ? '?' : '') . $this->types[0] + : implode($this->kind, $this->types); + } + + + /** + * Returns the array of subtypes that make up the compound type as strings. + * @return string[] + */ + public function getNames(): array + { + return $this->types; + } + + + /** + * Returns the array of subtypes that make up the compound type as Type objects: + * @return self[] + */ + public function getTypes(): array + { + return array_map(function ($name) { return self::fromString($name); }, $this->types); + } + + + /** + * Returns the type name for single types, otherwise null. + */ + public function getSingleName(): ?string + { + return $this->single + ? $this->types[0] + : null; + } + + + /** + * Returns true whether it is a union type. + */ + public function isUnion(): bool + { + return $this->kind === '|'; + } + + + /** + * Returns true whether it is an intersection type. + */ + public function isIntersection(): bool + { + return $this->kind === '&'; + } + + + /** + * Returns true whether it is a single type. Simple nullable types are also considered to be single types. + */ + public function isSingle(): bool + { + return $this->single; + } + + + /** + * Returns true whether the type is both a single and a PHP built-in type. + */ + public function isBuiltin(): bool + { + return $this->single && Reflection::isBuiltinType($this->types[0]); + } + + + /** + * Returns true whether the type is both a single and a class name. + */ + public function isClass(): bool + { + return $this->single && !Reflection::isBuiltinType($this->types[0]); + } + + + /** + * Verifies type compatibility. For example, it checks if a value of a certain type could be passed as a parameter. + */ + public function allows(string $type): bool + { + if ($this->types === ['mixed']) { + return true; + } + + $type = self::fromString($type); + + if ($this->isIntersection()) { + if (!$type->isIntersection()) { + return false; + } + return Arrays::every($this->types, function ($currentType) use ($type) { + $builtin = Reflection::isBuiltinType($currentType); + return Arrays::some($type->types, function ($testedType) use ($currentType, $builtin) { + return $builtin + ? strcasecmp($currentType, $testedType) === 0 + : is_a($testedType, $currentType, true); + }); + }); + } + + $method = $type->isIntersection() ? 'some' : 'every'; + return Arrays::$method($type->types, function ($testedType) { + $builtin = Reflection::isBuiltinType($testedType); + return Arrays::some($this->types, function ($currentType) use ($testedType, $builtin) { + return $builtin + ? strcasecmp($currentType, $testedType) === 0 + : is_a($testedType, $currentType, true); + }); + }); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/composer.json b/vendor/phpdocumentor/reflection-docblock/composer.json index 7038f48a..d9076302 100644 --- a/vendor/phpdocumentor/reflection-docblock/composer.json +++ b/vendor/phpdocumentor/reflection-docblock/composer.json @@ -21,7 +21,8 @@ "ext-filter": "*" }, "require-dev": { - "mockery/mockery": "~1.3.2" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "autoload": { "psr-4": { @@ -30,7 +31,7 @@ }, "autoload-dev": { "psr-4": { - "phpDocumentor\\Reflection\\": "tests/unit" + "phpDocumentor\\Reflection\\": ["tests/unit", "tests/integration"] } }, "extra": { diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php index f3403d6e..cc33e60e 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php @@ -14,6 +14,7 @@ declare(strict_types=1); namespace phpDocumentor\Reflection; use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\Tags\TagWithType; use Webmozart\Assert\Assert; final class DocBlock @@ -68,12 +69,12 @@ final class DocBlock $this->isTemplateStart = $isTemplateStart; } - public function getSummary() : string + public function getSummary(): string { return $this->summary; } - public function getDescription() : DocBlock\Description + public function getDescription(): DocBlock\Description { return $this->description; } @@ -81,7 +82,7 @@ final class DocBlock /** * Returns the current context. */ - public function getContext() : ?Types\Context + public function getContext(): ?Types\Context { return $this->context; } @@ -89,7 +90,7 @@ final class DocBlock /** * Returns the current location. */ - public function getLocation() : ?Location + public function getLocation(): ?Location { return $this->location; } @@ -113,7 +114,7 @@ final class DocBlock * * @see self::isTemplateEnd() for the check whether a closing marker was provided. */ - public function isTemplateStart() : bool + public function isTemplateStart(): bool { return $this->isTemplateStart; } @@ -123,7 +124,7 @@ final class DocBlock * * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality. */ - public function isTemplateEnd() : bool + public function isTemplateEnd(): bool { return $this->isTemplateEnd; } @@ -133,7 +134,7 @@ final class DocBlock * * @return Tag[] */ - public function getTags() : array + public function getTags(): array { return $this->tags; } @@ -146,7 +147,7 @@ final class DocBlock * * @return Tag[] */ - public function getTagsByName(string $name) : array + public function getTagsByName(string $name): array { $result = []; @@ -161,12 +162,35 @@ final class DocBlock return $result; } + /** + * Returns an array of tags with type matching the given name. If no tags are found + * an empty array is returned. + * + * @param string $name String to search by. + * + * @return TagWithType[] + */ + public function getTagsWithTypeByName(string $name): array + { + $result = []; + + foreach ($this->getTagsByName($name) as $tag) { + if (!$tag instanceof TagWithType) { + continue; + } + + $result[] = $tag; + } + + return $result; + } + /** * Checks if a tag of a certain type is present in this DocBlock. * * @param string $name Tag name to check for. */ - public function hasTag(string $name) : bool + public function hasTag(string $name): bool { foreach ($this->getTags() as $tag) { if ($tag->getName() === $name) { @@ -182,7 +206,7 @@ final class DocBlock * * @param Tag $tagToRemove The tag to remove. */ - public function removeTag(Tag $tagToRemove) : void + public function removeTag(Tag $tagToRemove): void { foreach ($this->tags as $key => $tag) { if ($tag === $tagToRemove) { @@ -197,7 +221,7 @@ final class DocBlock * * @param Tag $tag The tag to add. */ - private function addTag(Tag $tag) : void + private function addTag(Tag $tag): void { $this->tags[] = $tag; } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php index 7b11b808..a31b2892 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php @@ -15,6 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock; use phpDocumentor\Reflection\DocBlock\Tags\Formatter; use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter; + use function vsprintf; /** @@ -71,7 +72,7 @@ class Description /** * Returns the body template. */ - public function getBodyTemplate() : string + public function getBodyTemplate(): string { return $this->bodyTemplate; } @@ -81,7 +82,7 @@ class Description * * @return Tag[] */ - public function getTags() : array + public function getTags(): array { return $this->tags; } @@ -90,7 +91,7 @@ class Description * Renders this description as a string where the provided formatter will format the tags in the expected string * format. */ - public function render(?Formatter $formatter = null) : string + public function render(?Formatter $formatter = null): string { if ($formatter === null) { $formatter = new PassthroughFormatter(); @@ -107,7 +108,7 @@ class Description /** * Returns a plain string representation of this description. */ - public function __toString() : string + public function __toString(): string { return $this->render(); } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php index c27d2a01..1a519ec4 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php @@ -15,8 +15,8 @@ namespace phpDocumentor\Reflection\DocBlock; use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Utils; + use function count; -use function explode; use function implode; use function ltrim; use function min; @@ -25,6 +25,7 @@ use function strlen; use function strpos; use function substr; use function trim; + use const PREG_SPLIT_DELIM_CAPTURE; /** @@ -60,7 +61,7 @@ class DescriptionFactory /** * Returns the parsed text of this description. */ - public function create(string $contents, ?TypeContext $context = null) : Description + public function create(string $contents, ?TypeContext $context = null): Description { $tokens = $this->lex($contents); $count = count($tokens); @@ -88,7 +89,7 @@ class DescriptionFactory * * @return string[] A series of tokens of which the description text is composed. */ - private function lex(string $contents) : array + private function lex(string $contents): array { $contents = $this->removeSuperfluousStartingWhitespace($contents); @@ -142,9 +143,9 @@ class DescriptionFactory * If we do not normalize the indentation then we have superfluous whitespace on the second and subsequent * lines and this may cause rendering issues when, for example, using a Markdown converter. */ - private function removeSuperfluousStartingWhitespace(string $contents) : string + private function removeSuperfluousStartingWhitespace(string $contents): string { - $lines = explode("\n", $contents); + $lines = Utils::pregSplit("/\r\n?|\n/", $contents); // if there is only one line then we don't have lines with superfluous whitespace and // can use the contents as-is diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php index 7249efb0..6a6b4729 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php @@ -14,6 +14,7 @@ declare(strict_types=1); namespace phpDocumentor\Reflection\DocBlock; use phpDocumentor\Reflection\DocBlock\Tags\Example; + use function array_slice; use function file; use function getcwd; @@ -22,6 +23,7 @@ use function is_readable; use function rtrim; use function sprintf; use function trim; + use const DIRECTORY_SEPARATOR; /** @@ -38,7 +40,7 @@ class ExampleFinder /** * Attempts to find the example contents for the given descriptor. */ - public function find(Example $example) : string + public function find(Example $example): string { $filename = $example->getFilePath(); @@ -53,7 +55,7 @@ class ExampleFinder /** * Registers the project's root directory where an 'examples' folder can be expected. */ - public function setSourceDirectory(string $directory = '') : void + public function setSourceDirectory(string $directory = ''): void { $this->sourceDirectory = $directory; } @@ -61,7 +63,7 @@ class ExampleFinder /** * Returns the project's root directory where an 'examples' folder can be expected. */ - public function getSourceDirectory() : string + public function getSourceDirectory(): string { return $this->sourceDirectory; } @@ -71,7 +73,7 @@ class ExampleFinder * * @param string[] $directories */ - public function setExampleDirectories(array $directories) : void + public function setExampleDirectories(array $directories): void { $this->exampleDirectories = $directories; } @@ -81,7 +83,7 @@ class ExampleFinder * * @return string[] */ - public function getExampleDirectories() : array + public function getExampleDirectories(): array { return $this->exampleDirectories; } @@ -99,7 +101,7 @@ class ExampleFinder * * @return string[] all lines of the example file */ - private function getExampleFileContents(string $filename) : ?array + private function getExampleFileContents(string $filename): ?array { $normalizedPath = null; @@ -129,7 +131,7 @@ class ExampleFinder /** * Get example filepath based on the example directory inside your project. */ - private function getExamplePathFromExampleDirectory(string $file) : string + private function getExamplePathFromExampleDirectory(string $file): string { return getcwd() . DIRECTORY_SEPARATOR . 'examples' . DIRECTORY_SEPARATOR . $file; } @@ -137,7 +139,7 @@ class ExampleFinder /** * Returns a path to the example file in the given directory.. */ - private function constructExamplePath(string $directory, string $file) : string + private function constructExamplePath(string $directory, string $file): string { return rtrim($directory, '\\/') . DIRECTORY_SEPARATOR . $file; } @@ -145,7 +147,7 @@ class ExampleFinder /** * Get example filepath based on sourcecode. */ - private function getExamplePathFromSource(string $file) : string + private function getExamplePathFromSource(string $file): string { return sprintf( '%s%s%s', diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php index 531970b9..77e5fb5f 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php @@ -16,6 +16,7 @@ namespace phpDocumentor\Reflection\DocBlock; use phpDocumentor\Reflection\DocBlock; use phpDocumentor\Reflection\DocBlock\Tags\Formatter; use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter; + use function sprintf; use function str_repeat; use function str_replace; @@ -41,6 +42,8 @@ class Serializer /** @var Formatter A custom tag formatter. */ protected $tagFormatter; + /** @var string */ + private $lineEnding; /** * Create a Serializer instance. @@ -50,19 +53,22 @@ class Serializer * @param bool $indentFirstLine Whether to indent the first line. * @param int|null $lineLength The max length of a line or NULL to disable line wrapping. * @param Formatter $tagFormatter A custom tag formatter, defaults to PassthroughFormatter. + * @param string $lineEnding Line ending used in the output, by default \n is used. */ public function __construct( int $indent = 0, string $indentString = ' ', bool $indentFirstLine = true, ?int $lineLength = null, - ?Formatter $tagFormatter = null + ?Formatter $tagFormatter = null, + string $lineEnding = "\n" ) { $this->indent = $indent; $this->indentString = $indentString; $this->isFirstLineIndented = $indentFirstLine; $this->lineLength = $lineLength; $this->tagFormatter = $tagFormatter ?: new PassthroughFormatter(); + $this->lineEnding = $lineEnding; } /** @@ -72,7 +78,7 @@ class Serializer * * @return string The serialized doc block. */ - public function getDocComment(DocBlock $docblock) : string + public function getDocComment(DocBlock $docblock): string { $indent = str_repeat($this->indentString, $this->indent); $firstIndent = $this->isFirstLineIndented ? $indent : ''; @@ -95,10 +101,10 @@ class Serializer $comment = $this->addTagBlock($docblock, $wrapLength, $indent, $comment); - return $comment . $indent . ' */'; + return str_replace("\n", $this->lineEnding, $comment . $indent . ' */'); } - private function removeTrailingSpaces(string $indent, string $text) : string + private function removeTrailingSpaces(string $indent, string $text): string { return str_replace( sprintf("\n%s * \n", $indent), @@ -107,7 +113,7 @@ class Serializer ); } - private function addAsterisksForEachLine(string $indent, string $text) : string + private function addAsterisksForEachLine(string $indent, string $text): string { return str_replace( "\n", @@ -116,7 +122,7 @@ class Serializer ); } - private function getSummaryAndDescriptionTextBlock(DocBlock $docblock, ?int $wrapLength) : string + private function getSummaryAndDescriptionTextBlock(DocBlock $docblock, ?int $wrapLength): string { $text = $docblock->getSummary() . ((string) $docblock->getDescription() ? "\n\n" . $docblock->getDescription() : ''); @@ -129,7 +135,7 @@ class Serializer return $text; } - private function addTagBlock(DocBlock $docblock, ?int $wrapLength, string $indent, string $comment) : string + private function addTagBlock(DocBlock $docblock, ?int $wrapLength, string $indent, string $comment): string { foreach ($docblock->getTags() as $tag) { $tagText = $this->tagFormatter->format($tag); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php index e64b587e..8d765951 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php @@ -39,6 +39,7 @@ use ReflectionMethod; use ReflectionNamedType; use ReflectionParameter; use Webmozart\Assert\Assert; + use function array_merge; use function array_slice; use function call_user_func_array; @@ -137,7 +138,7 @@ final class StandardTagFactory implements TagFactory $this->addService($fqsenResolver, FqsenResolver::class); } - public function create(string $tagLine, ?TypeContext $context = null) : Tag + public function create(string $tagLine, ?TypeContext $context = null): Tag { if (!$context) { $context = new TypeContext(''); @@ -151,17 +152,17 @@ final class StandardTagFactory implements TagFactory /** * @param mixed $value */ - public function addParameter(string $name, $value) : void + public function addParameter(string $name, $value): void { $this->serviceLocator[$name] = $value; } - public function addService(object $service, ?string $alias = null) : void + public function addService(object $service, ?string $alias = null): void { $this->serviceLocator[$alias ?: get_class($service)] = $service; } - public function registerTagHandler(string $tagName, string $handler) : void + public function registerTagHandler(string $tagName, string $handler): void { Assert::stringNotEmpty($tagName); Assert::classExists($handler); @@ -181,7 +182,7 @@ final class StandardTagFactory implements TagFactory * * @return string[] */ - private function extractTagParts(string $tagLine) : array + private function extractTagParts(string $tagLine): array { $matches = []; if (!preg_match('/^@(' . self::REGEX_TAGNAME . ')((?:[\s\(\{])\s*([^\s].*)|$)/us', $tagLine, $matches)) { @@ -201,7 +202,7 @@ final class StandardTagFactory implements TagFactory * Creates a new tag object with the given name and body or returns null if the tag name was recognized but the * body was invalid. */ - private function createTag(string $body, string $name, TypeContext $context) : Tag + private function createTag(string $body, string $name, TypeContext $context): Tag { $handlerClassName = $this->findHandlerClassName($name, $context); $arguments = $this->getArgumentsForParametersFromWiring( @@ -226,7 +227,7 @@ final class StandardTagFactory implements TagFactory * * @return class-string */ - private function findHandlerClassName(string $tagName, TypeContext $context) : string + private function findHandlerClassName(string $tagName, TypeContext $context): string { $handlerClassName = Generic::class; if (isset($this->tagHandlerMappings[$tagName])) { @@ -251,7 +252,7 @@ final class StandardTagFactory implements TagFactory * @return mixed[] A series of values that can be passed to the Factory Method of the tag whose parameters * is provided with this method. */ - private function getArgumentsForParametersFromWiring(array $parameters, array $locator) : array + private function getArgumentsForParametersFromWiring(array $parameters, array $locator): array { $arguments = []; foreach ($parameters as $parameter) { @@ -292,7 +293,7 @@ final class StandardTagFactory implements TagFactory * * @return ReflectionParameter[] */ - private function fetchParametersForHandlerFactoryMethod(string $handlerClassName) : array + private function fetchParametersForHandlerFactoryMethod(string $handlerClassName): array { if (!isset($this->tagHandlerParameterCache[$handlerClassName])) { $methodReflection = new ReflectionMethod($handlerClassName, 'create'); @@ -319,7 +320,7 @@ final class StandardTagFactory implements TagFactory TypeContext $context, string $tagName, string $tagBody - ) : array { + ): array { return array_merge( $this->serviceLocator, [ @@ -335,7 +336,7 @@ final class StandardTagFactory implements TagFactory * * @todo this method should be populated once we implement Annotation notation support. */ - private function isAnnotation(string $tagContent) : bool + private function isAnnotation(string $tagContent): bool { // 1. Contains a namespace separator // 2. Contains parenthesis diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php index f55de916..7cf07b4d 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php @@ -17,16 +17,15 @@ use phpDocumentor\Reflection\DocBlock\Tags\Formatter; interface Tag { - public function getName() : string; + public function getName(): string; /** * @return Tag|mixed Class that implements Tag - * * @phpstan-return ?Tag */ public static function create(string $body); - public function render(?Formatter $formatter = null) : string; + public function render(?Formatter $formatter = null): string; - public function __toString() : string; + public function __toString(): string; } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/TagFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/TagFactory.php index 0d318d1b..c0868dcb 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/TagFactory.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/TagFactory.php @@ -38,7 +38,7 @@ interface TagFactory * * @param mixed $value */ - public function addParameter(string $name, $value) : void; + public function addParameter(string $name, $value): void; /** * Factory method responsible for instantiating the correct sub type. @@ -49,7 +49,7 @@ interface TagFactory * * @throws InvalidArgumentException If an invalid tag line was presented. */ - public function create(string $tagLine, ?TypeContext $context = null) : Tag; + public function create(string $tagLine, ?TypeContext $context = null): Tag; /** * Registers a service with the Service Locator using the FQCN of the class or the alias, if provided. @@ -60,7 +60,7 @@ interface TagFactory * Because interfaces are regularly used as type-hints this method provides an alias parameter; if the FQCN of the * interface is passed as alias then every time that interface is requested the provided service will be returned. */ - public function addService(object $service) : void; + public function addService(object $service): void; /** * Registers a handler for tags. @@ -80,5 +80,5 @@ interface TagFactory * @throws InvalidArgumentException If the handler is not an existing class. * @throws InvalidArgumentException If the handler does not implement the {@see Tag} interface. */ - public function registerTagHandler(string $tagName, string $handler) : void; + public function registerTagHandler(string $tagName, string $handler): void; } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php index d1207571..ae09ecf4 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php @@ -14,9 +14,11 @@ declare(strict_types=1); namespace phpDocumentor\Reflection\DocBlock\Tags; use InvalidArgumentException; + use function filter_var; use function preg_match; use function trim; + use const FILTER_VALIDATE_EMAIL; /** @@ -51,7 +53,7 @@ final class Author extends BaseTag implements Factory\StaticMethod * * @return string The author's name. */ - public function getAuthorName() : string + public function getAuthorName(): string { return $this->authorName; } @@ -61,7 +63,7 @@ final class Author extends BaseTag implements Factory\StaticMethod * * @return string The author's email. */ - public function getEmail() : string + public function getEmail(): string { return $this->authorEmail; } @@ -69,7 +71,7 @@ final class Author extends BaseTag implements Factory\StaticMethod /** * Returns this tag in string form. */ - public function __toString() : string + public function __toString(): string { if ($this->authorEmail) { $authorEmail = '<' . $this->authorEmail . '>'; @@ -77,15 +79,15 @@ final class Author extends BaseTag implements Factory\StaticMethod $authorEmail = ''; } - $authorName = (string) $this->authorName; + $authorName = $this->authorName; return $authorName . ($authorEmail !== '' ? ($authorName !== '' ? ' ' : '') . $authorEmail : ''); } /** - * Attempts to create a new Author object based on †he tag body. + * Attempts to create a new Author object based on the tag body. */ - public static function create(string $body) : ?self + public static function create(string $body): ?self { $splitTagContent = preg_match('/^([^\<]*)(?:\<([^\>]*)\>)?$/u', $body, $matches); if (!$splitTagContent) { diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php index fbcd4022..a28d5bf9 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php @@ -32,17 +32,17 @@ abstract class BaseTag implements DocBlock\Tag * * @return string The name of this tag. */ - public function getName() : string + public function getName(): string { return $this->name; } - public function getDescription() : ?Description + public function getDescription(): ?Description { return $this->description; } - public function render(?Formatter $formatter = null) : string + public function render(?Formatter $formatter = null): string { if ($formatter === null) { $formatter = new Formatter\PassthroughFormatter(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php index 9e52e5e4..3eff9d8b 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php @@ -20,6 +20,7 @@ use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; + use function array_key_exists; use function explode; @@ -48,7 +49,7 @@ final class Covers extends BaseTag implements Factory\StaticMethod ?DescriptionFactory $descriptionFactory = null, ?FqsenResolver $resolver = null, ?TypeContext $context = null - ) : self { + ): self { Assert::stringNotEmpty($body); Assert::notNull($descriptionFactory); Assert::notNull($resolver); @@ -61,7 +62,7 @@ final class Covers extends BaseTag implements Factory\StaticMethod ); } - private static function resolveFqsen(string $parts, ?FqsenResolver $fqsenResolver, ?TypeContext $context) : Fqsen + private static function resolveFqsen(string $parts, ?FqsenResolver $fqsenResolver, ?TypeContext $context): Fqsen { Assert::notNull($fqsenResolver); $fqsenParts = explode('::', $parts); @@ -77,7 +78,7 @@ final class Covers extends BaseTag implements Factory\StaticMethod /** * Returns the structural element this tag refers to. */ - public function getReference() : Fqsen + public function getReference(): Fqsen { return $this->refers; } @@ -85,7 +86,7 @@ final class Covers extends BaseTag implements Factory\StaticMethod /** * Returns a string representation of this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php index 68e8f036..dbcad28c 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php @@ -17,6 +17,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; + use function preg_match; /** @@ -61,7 +62,7 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod ?string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { if (empty($body)) { return new static(); } @@ -85,7 +86,7 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod /** * Gets the version section of the tag. */ - public function getVersion() : ?string + public function getVersion(): ?string { return $this->version; } @@ -93,7 +94,7 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod /** * Returns a string representation for this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php index 3face1ef..825355aa 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php @@ -15,6 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; use phpDocumentor\Reflection\DocBlock\Tag; use Webmozart\Assert\Assert; + use function array_key_exists; use function preg_match; use function rawurlencode; @@ -66,7 +67,7 @@ final class Example implements Tag, Factory\StaticMethod $this->isURI = $isURI; } - public function getContent() : string + public function getContent(): string { if ($this->content === null || $this->content === '') { $filePath = $this->filePath; @@ -82,12 +83,12 @@ final class Example implements Tag, Factory\StaticMethod return $this->content; } - public function getDescription() : ?string + public function getDescription(): ?string { return $this->content; } - public static function create(string $body) : ?Tag + public static function create(string $body): ?Tag { // File component: File path in quotes or File URI / Source information if (!preg_match('/^\s*(?:(\"[^\"]+\")|(\S+))(?:\s+(.*))?$/sux', $body, $matches)) { @@ -137,7 +138,7 @@ final class Example implements Tag, Factory\StaticMethod * @return string Path to a file to use as an example. * May also be an absolute URI. */ - public function getFilePath() : string + public function getFilePath(): string { return trim($this->filePath, '"'); } @@ -145,9 +146,9 @@ final class Example implements Tag, Factory\StaticMethod /** * Returns a string representation for this tag. */ - public function __toString() : string + public function __toString(): string { - $filePath = (string) $this->filePath; + $filePath = $this->filePath; $isDefaultLine = $this->startingLine === 1 && $this->lineCount === 0; $startingLine = !$isDefaultLine ? (string) $this->startingLine : ''; $lineCount = !$isDefaultLine ? (string) $this->lineCount : ''; @@ -168,27 +169,27 @@ final class Example implements Tag, Factory\StaticMethod /** * Returns true if the provided URI is relative or contains a complete scheme (and thus is absolute). */ - private function isUriRelative(string $uri) : bool + private function isUriRelative(string $uri): bool { return strpos($uri, ':') === false; } - public function getStartingLine() : int + public function getStartingLine(): int { return $this->startingLine; } - public function getLineCount() : int + public function getLineCount(): int { return $this->lineCount; } - public function getName() : string + public function getName(): string { return 'example'; } - public function render(?Formatter $formatter = null) : string + public function render(?Formatter $formatter = null): string { if ($formatter === null) { $formatter = new Formatter\PassthroughFormatter(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter.php index 92fb9e6c..36b9983e 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter.php @@ -20,5 +20,5 @@ interface Formatter /** * Formats a tag into a string representation according to a specific format, such as Markdown. */ - public function format(Tag $tag) : string; + public function format(Tag $tag): string; } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/AlignFormatter.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/AlignFormatter.php index b1a406c0..94644343 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/AlignFormatter.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/AlignFormatter.php @@ -15,6 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags\Formatter; use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\DocBlock\Tags\Formatter; + use function max; use function str_repeat; use function strlen; @@ -37,7 +38,7 @@ class AlignFormatter implements Formatter /** * Formats the given tag to return a simple plain text version. */ - public function format(Tag $tag) : string + public function format(Tag $tag): string { return '@' . $tag->getName() . str_repeat( diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php index f26d22fb..2afdfe55 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php @@ -15,6 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags\Formatter; use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\DocBlock\Tags\Formatter; + use function trim; class PassthroughFormatter implements Formatter @@ -22,7 +23,7 @@ class PassthroughFormatter implements Formatter /** * Formats the given tag to return a simple plain text version. */ - public function format(Tag $tag) : string + public function format(Tag $tag): string { return trim('@' . $tag->getName() . ' ' . $tag); } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php index a7b423f5..bc1ab10c 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php @@ -19,6 +19,7 @@ use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\StandardTagFactory; use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; + use function preg_match; /** @@ -50,7 +51,7 @@ final class Generic extends BaseTag implements Factory\StaticMethod string $name = '', ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::stringNotEmpty($name); Assert::notNull($descriptionFactory); @@ -62,7 +63,7 @@ final class Generic extends BaseTag implements Factory\StaticMethod /** * Returns the tag as a serialized string */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); @@ -76,7 +77,7 @@ final class Generic extends BaseTag implements Factory\StaticMethod /** * Validates if the tag name matches the expected format, otherwise throws an exception. */ - private function validateTagName(string $name) : void + private function validateTagName(string $name): void { if (!preg_match('/^' . StandardTagFactory::REGEX_TAGNAME . '$/u', $name)) { throw new InvalidArgumentException( diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/InvalidTag.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/InvalidTag.php index e3deb5a8..4e6abb8c 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/InvalidTag.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/InvalidTag.php @@ -11,6 +11,7 @@ use ReflectionClass; use ReflectionException; use ReflectionFunction; use Throwable; + use function array_map; use function get_class; use function get_resource_type; @@ -46,22 +47,22 @@ final class InvalidTag implements Tag $this->body = $body; } - public function getException() : ?Throwable + public function getException(): ?Throwable { return $this->throwable; } - public function getName() : string + public function getName(): string { return $this->name; } - public static function create(string $body, string $name = '') : self + public static function create(string $body, string $name = ''): self { return new self($name, $body); } - public function withError(Throwable $exception) : self + public function withError(Throwable $exception): self { $this->flattenExceptionBacktrace($exception); $tag = new self($this->name, $this->body); @@ -76,7 +77,7 @@ final class InvalidTag implements Tag * Not all objects are serializable. So we need to remove them from the * stored exception to be sure that we do not break existing library usage. */ - private function flattenExceptionBacktrace(Throwable $exception) : void + private function flattenExceptionBacktrace(Throwable $exception): void { $traceProperty = (new ReflectionClass(Exception::class))->getProperty('trace'); $traceProperty->setAccessible(true); @@ -85,8 +86,8 @@ final class InvalidTag implements Tag $trace = $exception->getTrace(); if (isset($trace[0]['args'])) { $trace = array_map( - function (array $call) : array { - $call['args'] = array_map([$this, 'flattenArguments'], $call['args']); + function (array $call): array { + $call['args'] = array_map([$this, 'flattenArguments'], $call['args'] ?? []); return $call; }, @@ -128,7 +129,7 @@ final class InvalidTag implements Tag return $value; } - public function render(?Formatter $formatter = null) : string + public function render(?Formatter $formatter = null): string { if ($formatter === null) { $formatter = new Formatter\PassthroughFormatter(); @@ -137,7 +138,7 @@ final class InvalidTag implements Tag return $formatter->format($this); } - public function __toString() : string + public function __toString(): string { return $this->body; } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php index 226bbe0f..ee242e3b 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php @@ -43,7 +43,7 @@ final class Link extends BaseTag implements Factory\StaticMethod string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::notNull($descriptionFactory); $parts = Utils::pregSplit('/\s+/Su', $body, 2); @@ -55,7 +55,7 @@ final class Link extends BaseTag implements Factory\StaticMethod /** * Gets the link */ - public function getLink() : string + public function getLink(): string { return $this->link; } @@ -63,7 +63,7 @@ final class Link extends BaseTag implements Factory\StaticMethod /** * Returns a string representation for this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); @@ -71,7 +71,7 @@ final class Link extends BaseTag implements Factory\StaticMethod $description = ''; } - $link = (string) $this->link; + $link = $this->link; return $link . ($description !== '' ? ($link !== '' ? ' ' : '') . $description : ''); } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php index 08c0407e..f08bfffd 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php @@ -22,6 +22,7 @@ use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Types\Mixed_; use phpDocumentor\Reflection\Types\Void_; use Webmozart\Assert\Assert; + use function array_keys; use function explode; use function implode; @@ -58,7 +59,6 @@ final class Method extends BaseTag implements Factory\StaticMethod /** * @param array> $arguments - * * @phpstan-param array $arguments */ public function __construct( @@ -86,7 +86,7 @@ final class Method extends BaseTag implements Factory\StaticMethod ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : ?self { + ): ?self { Assert::stringNotEmpty($body); Assert::notNull($typeResolver); Assert::notNull($descriptionFactory); @@ -100,8 +100,9 @@ final class Method extends BaseTag implements Factory\StaticMethod // 5. then a word with underscores, followed by ( and any character // until a ) and whitespace : as method name with signature // 6. any remaining text : as description - if (!preg_match( - '/^ + if ( + !preg_match( + '/^ # Static keyword # Declares a static method ONLY if type is also present (?: @@ -131,9 +132,10 @@ final class Method extends BaseTag implements Factory\StaticMethod # Description (.*) $/sux', - $body, - $matches - )) { + $body, + $matches + ) + ) { return null; } @@ -176,17 +178,16 @@ final class Method extends BaseTag implements Factory\StaticMethod /** * Retrieves the method name. */ - public function getMethodName() : string + public function getMethodName(): string { return $this->methodName; } /** * @return array> - * * @phpstan-return array */ - public function getArguments() : array + public function getArguments(): array { return $this->arguments; } @@ -196,17 +197,17 @@ final class Method extends BaseTag implements Factory\StaticMethod * * @return bool TRUE if the method declaration is for a static method, FALSE otherwise. */ - public function isStatic() : bool + public function isStatic(): bool { return $this->isStatic; } - public function getReturnType() : Type + public function getReturnType(): Type { return $this->returnType; } - public function __toString() : string + public function __toString(): string { $arguments = []; foreach ($this->arguments as $argument) { @@ -225,7 +226,7 @@ final class Method extends BaseTag implements Factory\StaticMethod $returnType = (string) $this->returnType; - $methodName = (string) $this->methodName; + $methodName = $this->methodName; return $static . ($returnType !== '' ? ($static !== '' ? ' ' : '') . $returnType : '') @@ -236,13 +237,12 @@ final class Method extends BaseTag implements Factory\StaticMethod /** * @param mixed[][]|string[] $arguments + * @phpstan-param array $arguments * * @return mixed[][] - * - * @phpstan-param array $arguments * @phpstan-return array */ - private function filterArguments(array $arguments = []) : array + private function filterArguments(array $arguments = []): array { $result = []; foreach ($arguments as $argument) { @@ -268,7 +268,7 @@ final class Method extends BaseTag implements Factory\StaticMethod return $result; } - private static function stripRestArg(string $argument) : string + private static function stripRestArg(string $argument): string { if (strpos($argument, '...') === 0) { $argument = trim(substr($argument, 3)); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php index 83419e9c..3399649b 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php @@ -20,11 +20,13 @@ use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; + use function array_shift; use function array_unshift; use function implode; use function strpos; use function substr; + use const PREG_SPLIT_DELIM_CAPTURE; /** @@ -61,7 +63,7 @@ final class Param extends TagWithType implements Factory\StaticMethod ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::stringNotEmpty($body); Assert::notNull($typeResolver); Assert::notNull($descriptionFactory); @@ -114,7 +116,7 @@ final class Param extends TagWithType implements Factory\StaticMethod /** * Returns the variable's name. */ - public function getVariableName() : ?string + public function getVariableName(): ?string { return $this->variableName; } @@ -122,7 +124,7 @@ final class Param extends TagWithType implements Factory\StaticMethod /** * Returns whether this tag is variadic. */ - public function isVariadic() : bool + public function isVariadic(): bool { return $this->isVariadic; } @@ -130,7 +132,7 @@ final class Param extends TagWithType implements Factory\StaticMethod /** * Returns whether this tag is passed by reference. */ - public function isReference() : bool + public function isReference(): bool { return $this->isReference; } @@ -138,7 +140,7 @@ final class Param extends TagWithType implements Factory\StaticMethod /** * Returns a string representation for this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); @@ -159,7 +161,7 @@ final class Param extends TagWithType implements Factory\StaticMethod . ($description !== '' ? ($type !== '' || $variableName !== '' ? ' ' : '') . $description : ''); } - private static function strStartsWithVariable(string $str) : bool + private static function strStartsWithVariable(string $str): bool { return strpos($str, '$') === 0 || diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php index 03897578..2521fb3f 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php @@ -20,11 +20,13 @@ use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; + use function array_shift; use function array_unshift; use function implode; use function strpos; use function substr; + use const PREG_SPLIT_DELIM_CAPTURE; /** @@ -50,7 +52,7 @@ final class Property extends TagWithType implements Factory\StaticMethod ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::stringNotEmpty($body); Assert::notNull($typeResolver); Assert::notNull($descriptionFactory); @@ -88,7 +90,7 @@ final class Property extends TagWithType implements Factory\StaticMethod /** * Returns the variable's name. */ - public function getVariableName() : ?string + public function getVariableName(): ?string { return $this->variableName; } @@ -96,7 +98,7 @@ final class Property extends TagWithType implements Factory\StaticMethod /** * Returns a string representation for this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php index 7ff55d50..9491b39c 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php @@ -20,11 +20,13 @@ use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; + use function array_shift; use function array_unshift; use function implode; use function strpos; use function substr; + use const PREG_SPLIT_DELIM_CAPTURE; /** @@ -50,7 +52,7 @@ final class PropertyRead extends TagWithType implements Factory\StaticMethod ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::stringNotEmpty($body); Assert::notNull($typeResolver); Assert::notNull($descriptionFactory); @@ -88,7 +90,7 @@ final class PropertyRead extends TagWithType implements Factory\StaticMethod /** * Returns the variable's name. */ - public function getVariableName() : ?string + public function getVariableName(): ?string { return $this->variableName; } @@ -96,7 +98,7 @@ final class PropertyRead extends TagWithType implements Factory\StaticMethod /** * Returns a string representation for this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php index cc1e4b61..2bfdac6a 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php @@ -20,11 +20,13 @@ use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; + use function array_shift; use function array_unshift; use function implode; use function strpos; use function substr; + use const PREG_SPLIT_DELIM_CAPTURE; /** @@ -50,7 +52,7 @@ final class PropertyWrite extends TagWithType implements Factory\StaticMethod ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::stringNotEmpty($body); Assert::notNull($typeResolver); Assert::notNull($descriptionFactory); @@ -88,7 +90,7 @@ final class PropertyWrite extends TagWithType implements Factory\StaticMethod /** * Returns the variable's name. */ - public function getVariableName() : ?string + public function getVariableName(): ?string { return $this->variableName; } @@ -96,7 +98,7 @@ final class PropertyWrite extends TagWithType implements Factory\StaticMethod /** * Returns a string representation for this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Fqsen.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Fqsen.php index cede74c1..532003dd 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Fqsen.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Fqsen.php @@ -31,7 +31,7 @@ final class Fqsen implements Reference /** * @return string string representation of the referenced fqsen */ - public function __toString() : string + public function __toString(): string { return (string) $this->fqsen; } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Reference.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Reference.php index 5eedcbc3..e7dea868 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Reference.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Reference.php @@ -18,5 +18,5 @@ namespace phpDocumentor\Reflection\DocBlock\Tags\Reference; */ interface Reference { - public function __toString() : string; + public function __toString(): string; } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Url.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Url.php index 1b2374b9..edfba3fd 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Url.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Reference/Url.php @@ -29,7 +29,7 @@ final class Url implements Reference $this->uri = $uri; } - public function __toString() : string + public function __toString(): string { return $this->uri; } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php index 546a0eaa..f021b609 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php @@ -37,7 +37,7 @@ final class Return_ extends TagWithType implements Factory\StaticMethod ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::notNull($typeResolver); Assert::notNull($descriptionFactory); @@ -49,7 +49,7 @@ final class Return_ extends TagWithType implements Factory\StaticMethod return new static($type, $description); } - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); @@ -59,6 +59,6 @@ final class Return_ extends TagWithType implements Factory\StaticMethod $type = $this->type ? '' . $this->type : 'mixed'; - return $type . ($description !== '' ? ($type !== '' ? ' ' : '') . $description : ''); + return $type . ($description !== '' ? ' ' . $description : ''); } } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php index 73311df7..a194c7de 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php @@ -23,6 +23,7 @@ use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; + use function array_key_exists; use function explode; use function preg_match; @@ -52,21 +53,21 @@ final class See extends BaseTag implements Factory\StaticMethod ?FqsenResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::notNull($descriptionFactory); $parts = Utils::pregSplit('/\s+/Su', $body, 2); $description = isset($parts[1]) ? $descriptionFactory->create($parts[1], $context) : null; // https://tools.ietf.org/html/rfc2396#section-3 - if (preg_match('/\w:\/\/\w/i', $parts[0])) { + if (preg_match('#\w://\w#', $parts[0])) { return new static(new Url($parts[0]), $description); } return new static(new FqsenRef(self::resolveFqsen($parts[0], $typeResolver, $context)), $description); } - private static function resolveFqsen(string $parts, ?FqsenResolver $fqsenResolver, ?TypeContext $context) : Fqsen + private static function resolveFqsen(string $parts, ?FqsenResolver $fqsenResolver, ?TypeContext $context): Fqsen { Assert::notNull($fqsenResolver); $fqsenParts = explode('::', $parts); @@ -82,7 +83,7 @@ final class See extends BaseTag implements Factory\StaticMethod /** * Returns the ref of this tag. */ - public function getReference() : Reference + public function getReference(): Reference { return $this->refers; } @@ -90,7 +91,7 @@ final class See extends BaseTag implements Factory\StaticMethod /** * Returns a string representation of this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php index 32de527b..54af43cd 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php @@ -17,6 +17,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; + use function preg_match; /** @@ -58,7 +59,7 @@ final class Since extends BaseTag implements Factory\StaticMethod ?string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : ?self { + ): ?self { if (empty($body)) { return new static(); } @@ -79,7 +80,7 @@ final class Since extends BaseTag implements Factory\StaticMethod /** * Gets the version section of the tag. */ - public function getVersion() : ?string + public function getVersion(): ?string { return $this->version; } @@ -87,7 +88,7 @@ final class Since extends BaseTag implements Factory\StaticMethod /** * Returns a string representation for this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php index f0c31014..8b8c0fb4 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php @@ -17,6 +17,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; + use function preg_match; /** @@ -51,7 +52,7 @@ final class Source extends BaseTag implements Factory\StaticMethod string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::stringNotEmpty($body); Assert::notNull($descriptionFactory); @@ -69,7 +70,7 @@ final class Source extends BaseTag implements Factory\StaticMethod $description = $matches[3]; } - return new static($startingLine, $lineCount, $descriptionFactory->create($description??'', $context)); + return new static($startingLine, $lineCount, $descriptionFactory->create($description ?? '', $context)); } /** @@ -78,7 +79,7 @@ final class Source extends BaseTag implements Factory\StaticMethod * @return int The starting line, relative to the structural element's * location. */ - public function getStartingLine() : int + public function getStartingLine(): int { return $this->startingLine; } @@ -89,12 +90,12 @@ final class Source extends BaseTag implements Factory\StaticMethod * @return int|null The number of lines, relative to the starting line. NULL * means "to the end". */ - public function getLineCount() : ?int + public function getLineCount(): ?int { return $this->lineCount; } - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); @@ -104,14 +105,12 @@ final class Source extends BaseTag implements Factory\StaticMethod $startingLine = (string) $this->startingLine; - $lineCount = $this->lineCount !== null ? '' . $this->lineCount : ''; + $lineCount = $this->lineCount !== null ? ' ' . $this->lineCount : ''; return $startingLine - . ($lineCount !== '' - ? ($startingLine || $startingLine === '0' ? ' ' : '') . $lineCount - : '') + . $lineCount . ($description !== '' - ? ($startingLine || $startingLine === '0' || $lineCount !== '' ? ' ' : '') . $description + ? ' ' . $description : ''); } } diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/TagWithType.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/TagWithType.php index 0083d34b..158578bd 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/TagWithType.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/TagWithType.php @@ -14,6 +14,7 @@ declare(strict_types=1); namespace phpDocumentor\Reflection\DocBlock\Tags; use phpDocumentor\Reflection\Type; + use function in_array; use function strlen; use function substr; @@ -27,7 +28,7 @@ abstract class TagWithType extends BaseTag /** * Returns the type section of the variable. */ - public function getType() : ?Type + public function getType(): ?Type { return $this->type; } @@ -35,7 +36,7 @@ abstract class TagWithType extends BaseTag /** * @return string[] */ - protected static function extractTypeFromBody(string $body) : array + protected static function extractTypeFromBody(string $body): array { $type = ''; $nestingLevel = 0; diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php index d4dc9472..f21c9101 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php @@ -37,7 +37,7 @@ final class Throws extends TagWithType implements Factory\StaticMethod ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::notNull($typeResolver); Assert::notNull($descriptionFactory); @@ -49,7 +49,7 @@ final class Throws extends TagWithType implements Factory\StaticMethod return new static($type, $description); } - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php index 4d52afcc..b72f4034 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php @@ -20,6 +20,7 @@ use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; + use function array_key_exists; use function explode; @@ -48,7 +49,7 @@ final class Uses extends BaseTag implements Factory\StaticMethod ?FqsenResolver $resolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::notNull($resolver); Assert::notNull($descriptionFactory); @@ -60,7 +61,7 @@ final class Uses extends BaseTag implements Factory\StaticMethod ); } - private static function resolveFqsen(string $parts, ?FqsenResolver $fqsenResolver, ?TypeContext $context) : Fqsen + private static function resolveFqsen(string $parts, ?FqsenResolver $fqsenResolver, ?TypeContext $context): Fqsen { Assert::notNull($fqsenResolver); $fqsenParts = explode('::', $parts); @@ -76,7 +77,7 @@ final class Uses extends BaseTag implements Factory\StaticMethod /** * Returns the structural element this tag refers to. */ - public function getReference() : Fqsen + public function getReference(): Fqsen { return $this->refers; } @@ -84,7 +85,7 @@ final class Uses extends BaseTag implements Factory\StaticMethod /** * Returns a string representation of this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php index 762c262f..fa1f9dbf 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php @@ -20,11 +20,13 @@ use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; + use function array_shift; use function array_unshift; use function implode; use function strpos; use function substr; + use const PREG_SPLIT_DELIM_CAPTURE; /** @@ -50,7 +52,7 @@ final class Var_ extends TagWithType implements Factory\StaticMethod ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : self { + ): self { Assert::stringNotEmpty($body); Assert::notNull($typeResolver); Assert::notNull($descriptionFactory); @@ -89,7 +91,7 @@ final class Var_ extends TagWithType implements Factory\StaticMethod /** * Returns the variable's name. */ - public function getVariableName() : ?string + public function getVariableName(): ?string { return $this->variableName; } @@ -97,7 +99,7 @@ final class Var_ extends TagWithType implements Factory\StaticMethod /** * Returns a string representation for this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php index 460c86d7..f46e4b8c 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php @@ -17,6 +17,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; + use function preg_match; /** @@ -58,7 +59,7 @@ final class Version extends BaseTag implements Factory\StaticMethod ?string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null - ) : ?self { + ): ?self { if (empty($body)) { return new static(); } @@ -82,7 +83,7 @@ final class Version extends BaseTag implements Factory\StaticMethod /** * Gets the version section of the tag. */ - public function getVersion() : ?string + public function getVersion(): ?string { return $this->version; } @@ -90,7 +91,7 @@ final class Version extends BaseTag implements Factory\StaticMethod /** * Returns a string representation for this tag. */ - public function __toString() : string + public function __toString(): string { if ($this->description) { $description = $this->description->render(); diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php index cf04e5a5..37f72dd2 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php @@ -20,6 +20,7 @@ use phpDocumentor\Reflection\DocBlock\StandardTagFactory; use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\DocBlock\TagFactory; use Webmozart\Assert\Assert; + use function array_shift; use function count; use function explode; @@ -54,7 +55,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface * * @param array> $additionalTags */ - public static function createInstance(array $additionalTags = []) : self + public static function createInstance(array $additionalTags = []): self { $fqsenResolver = new FqsenResolver(); $tagFactory = new StandardTagFactory($fqsenResolver); @@ -75,7 +76,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface * @param object|string $docblock A string containing the DocBlock to parse or an object supporting the * getDocComment method (such as a ReflectionClass object). */ - public function create($docblock, ?Types\Context $context = null, ?Location $location = null) : DocBlock + public function create($docblock, ?Types\Context $context = null, ?Location $location = null): DocBlock { if (is_object($docblock)) { if (!method_exists($docblock, 'getDocComment')) { @@ -112,7 +113,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface /** * @param class-string $handler */ - public function registerTagHandler(string $tagName, string $handler) : void + public function registerTagHandler(string $tagName, string $handler): void { $this->tagFactory->registerTagHandler($tagName, $handler); } @@ -122,7 +123,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface * * @param string $comment String containing the comment text. */ - private function stripDocComment(string $comment) : string + private function stripDocComment(string $comment): string { $comment = preg_replace('#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]?(.*)?#u', '$1', $comment); Assert::string($comment); @@ -231,7 +232,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface * * @return DocBlock\Tag[] */ - private function parseTagBlock(string $tags, Types\Context $context) : array + private function parseTagBlock(string $tags, Types\Context $context): array { $tags = $this->filterTagBlock($tags); if ($tags === null) { @@ -250,7 +251,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface /** * @return string[] */ - private function splitTagBlockIntoTagLines(string $tags) : array + private function splitTagBlockIntoTagLines(string $tags): array { $result = []; foreach (explode("\n", $tags) as $tagLine) { @@ -264,7 +265,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface return $result; } - private function filterTagBlock(string $tags) : ?string + private function filterTagBlock(string $tags): ?string { $tags = trim($tags); if (!$tags) { diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php index ef039a4d..9995c0c0 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php @@ -14,10 +14,10 @@ interface DocBlockFactoryInterface * * @param array> $additionalTags */ - public static function createInstance(array $additionalTags = []) : DocBlockFactory; + public static function createInstance(array $additionalTags = []): DocBlockFactory; /** * @param string|object $docblock */ - public function create($docblock, ?Types\Context $context = null, ?Location $location = null) : DocBlock; + public function create($docblock, ?Types\Context $context = null, ?Location $location = null): DocBlock; } diff --git a/vendor/phpdocumentor/reflection-docblock/src/Exception/PcreException.php b/vendor/phpdocumentor/reflection-docblock/src/Exception/PcreException.php index 77aa40e1..b8b6da8c 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/Exception/PcreException.php +++ b/vendor/phpdocumentor/reflection-docblock/src/Exception/PcreException.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace phpDocumentor\Reflection\Exception; use InvalidArgumentException; + use const PREG_BACKTRACK_LIMIT_ERROR; use const PREG_BAD_UTF8_ERROR; use const PREG_BAD_UTF8_OFFSET_ERROR; @@ -15,19 +16,24 @@ use const PREG_RECURSION_LIMIT_ERROR; final class PcreException extends InvalidArgumentException { - public static function createFromPhpError(int $errorCode) : self + public static function createFromPhpError(int $errorCode): self { switch ($errorCode) { case PREG_BACKTRACK_LIMIT_ERROR: return new self('Backtrack limit error'); + case PREG_RECURSION_LIMIT_ERROR: return new self('Recursion limit error'); + case PREG_BAD_UTF8_ERROR: return new self('Bad UTF8 error'); + case PREG_BAD_UTF8_OFFSET_ERROR: return new self('Bad UTF8 offset error'); + case PREG_JIT_STACKLIMIT_ERROR: return new self('Jit stacklimit error'); + case PREG_NO_ERROR: case PREG_INTERNAL_ERROR: default: diff --git a/vendor/phpdocumentor/reflection-docblock/src/Utils.php b/vendor/phpdocumentor/reflection-docblock/src/Utils.php index d9b790b8..ddd0f61d 100644 --- a/vendor/phpdocumentor/reflection-docblock/src/Utils.php +++ b/vendor/phpdocumentor/reflection-docblock/src/Utils.php @@ -14,6 +14,8 @@ declare(strict_types=1); namespace phpDocumentor\Reflection; use phpDocumentor\Reflection\Exception\PcreException; +use Webmozart\Assert\Assert; + use function preg_last_error; use function preg_split as php_preg_split; @@ -28,7 +30,7 @@ abstract class Utils * * @param string $pattern The pattern to search for, as a string. * @param string $subject The input string. - * @param int|null $limit If specified, then only substrings up to limit are returned with the + * @param int $limit If specified, then only substrings up to limit are returned with the * rest of the string being placed in the last substring. A limit of -1 or 0 means "no limit". * @param int $flags flags can be any combination of the following flags (combined with the | bitwise operator): * *PREG_SPLIT_NO_EMPTY* @@ -41,17 +43,20 @@ abstract class Utils * Note that this changes the return value in an array where every element is an array consisting of the * matched string at offset 0 and its string offset into subject at offset 1. * - * @return string[] Returns an array containing substrings of subject split along boundaries matched by pattern + * @return string[] Returns an array containing substrings of subject + * split along boundaries matched by pattern * * @throws PcreException */ - public static function pregSplit(string $pattern, string $subject, ?int $limit = -1, int $flags = 0) : array + public static function pregSplit(string $pattern, string $subject, int $limit = -1, int $flags = 0): array { $parts = php_preg_split($pattern, $subject, $limit, $flags); if ($parts === false) { throw PcreException::createFromPhpError(preg_last_error()); } + Assert::allString($parts); + return $parts; } } diff --git a/vendor/phpdocumentor/type-resolver/composer.json b/vendor/phpdocumentor/type-resolver/composer.json index 242ecbe3..4dbf6237 100644 --- a/vendor/phpdocumentor/type-resolver/composer.json +++ b/vendor/phpdocumentor/type-resolver/composer.json @@ -14,7 +14,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "autoload": { "psr-4": { diff --git a/vendor/phpdocumentor/type-resolver/composer.lock b/vendor/phpdocumentor/type-resolver/composer.lock deleted file mode 100644 index 8fa8b874..00000000 --- a/vendor/phpdocumentor/type-resolver/composer.lock +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "ee8aea1f755e1772266bc7e041d8ee5b", - "packages": [ - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2020-06-27T09:03:43+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.2 || ^8.0" - }, - "platform-dev": { - "ext-tokenizer": "*" - } -} diff --git a/vendor/phpdocumentor/type-resolver/phpbench.json b/vendor/phpdocumentor/type-resolver/phpbench.json deleted file mode 100644 index ced1ebab..00000000 --- a/vendor/phpdocumentor/type-resolver/phpbench.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "bootstrap": "vendor/autoload.php", - "path": "tests/benchmark", - "extensions": [ - "Jaapio\\Blackfire\\Extension" - ], - "blackfire" : { - "env": "c12030d0-c177-47e2-b466-4994c40dc993" - } -} diff --git a/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php b/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php index 6447a015..068fa208 100644 --- a/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php +++ b/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php @@ -15,6 +15,7 @@ namespace phpDocumentor\Reflection; use InvalidArgumentException; use phpDocumentor\Reflection\Types\Context; + use function explode; use function implode; use function strpos; @@ -29,7 +30,7 @@ class FqsenResolver /** @var string Definition of the NAMESPACE operator in PHP */ private const OPERATOR_NAMESPACE = '\\'; - public function resolve(string $fqsen, ?Context $context = null) : Fqsen + public function resolve(string $fqsen, ?Context $context = null): Fqsen { if ($context === null) { $context = new Context(''); @@ -45,7 +46,7 @@ class FqsenResolver /** * Tests whether the given type is a Fully Qualified Structural Element Name. */ - private function isFqsen(string $type) : bool + private function isFqsen(string $type): bool { return strpos($type, self::OPERATOR_NAMESPACE) === 0; } @@ -56,7 +57,7 @@ class FqsenResolver * * @throws InvalidArgumentException When type is not a valid FQSEN. */ - private function resolvePartialStructuralElementName(string $type, Context $context) : Fqsen + private function resolvePartialStructuralElementName(string $type, Context $context): Fqsen { $typeParts = explode(self::OPERATOR_NAMESPACE, $type, 2); diff --git a/vendor/phpdocumentor/type-resolver/src/PseudoType.php b/vendor/phpdocumentor/type-resolver/src/PseudoType.php index f94cff5b..dd91ed79 100644 --- a/vendor/phpdocumentor/type-resolver/src/PseudoType.php +++ b/vendor/phpdocumentor/type-resolver/src/PseudoType.php @@ -15,5 +15,5 @@ namespace phpDocumentor\Reflection; interface PseudoType extends Type { - public function underlyingType() : Type; + public function underlyingType(): Type; } diff --git a/vendor/phpdocumentor/type-resolver/src/PseudoTypes/CallableString.php b/vendor/phpdocumentor/type-resolver/src/PseudoTypes/CallableString.php new file mode 100644 index 00000000..b6934561 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/PseudoTypes/CallableString.php @@ -0,0 +1,39 @@ + Types\String_::class, 'class-string' => Types\ClassString::class, + 'interface-string' => Types\InterfaceString::class, + 'html-escaped-string' => PseudoTypes\HtmlEscapedString::class, + 'lowercase-string' => PseudoTypes\LowercaseString::class, + 'non-empty-lowercase-string' => PseudoTypes\NonEmptyLowercaseString::class, + 'non-empty-string' => PseudoTypes\NonEmptyString::class, + 'numeric-string' => PseudoTypes\NumericString::class, + 'trait-string' => PseudoTypes\TraitString::class, 'int' => Types\Integer::class, 'integer' => Types\Integer::class, + 'positive-int' => PseudoTypes\PositiveInteger::class, 'bool' => Types\Boolean::class, 'boolean' => Types\Boolean::class, 'real' => Types\Float_::class, 'float' => Types\Float_::class, 'double' => Types\Float_::class, - 'object' => Object_::class, + 'object' => Types\Object_::class, 'mixed' => Types\Mixed_::class, - 'array' => Array_::class, + 'array' => Types\Array_::class, + 'array-key' => Types\ArrayKey::class, 'resource' => Types\Resource_::class, 'void' => Types\Void_::class, 'null' => Types\Null_::class, 'scalar' => Types\Scalar::class, 'callback' => Types\Callable_::class, 'callable' => Types\Callable_::class, + 'callable-string' => PseudoTypes\CallableString::class, 'false' => PseudoTypes\False_::class, 'true' => PseudoTypes\True_::class, + 'literal-string' => PseudoTypes\LiteralString::class, 'self' => Types\Self_::class, '$this' => Types\This::class, 'static' => Types\Static_::class, 'parent' => Types\Parent_::class, - 'iterable' => Iterable_::class, + 'iterable' => Types\Iterable_::class, + 'never' => Types\Never_::class, ]; /** @@ -126,7 +142,7 @@ final class TypeResolver * * @param string $type The relative or absolute type. */ - public function resolve(string $type, ?Context $context = null) : Type + public function resolve(string $type, ?Context $context = null): Type { $type = trim($type); if (!$type) { @@ -162,7 +178,7 @@ final class TypeResolver * @param int $parserContext on of self::PARSER_* constants, indicating * the context where we are in the parsing */ - private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext) : Type + private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext): Type { $types = []; $token = ''; @@ -182,11 +198,12 @@ final class TypeResolver ); } - if (!in_array($parserContext, [ - self::PARSER_IN_COMPOUND, - self::PARSER_IN_ARRAY_EXPRESSION, - self::PARSER_IN_COLLECTION_EXPRESSION, - ], true) + if ( + !in_array($parserContext, [ + self::PARSER_IN_COMPOUND, + self::PARSER_IN_ARRAY_EXPRESSION, + self::PARSER_IN_COLLECTION_EXPRESSION, + ], true) ) { throw new RuntimeException( 'Unexpected type separator' @@ -196,11 +213,12 @@ final class TypeResolver $compoundToken = $token; $tokens->next(); } elseif ($token === '?') { - if (!in_array($parserContext, [ - self::PARSER_IN_COMPOUND, - self::PARSER_IN_ARRAY_EXPRESSION, - self::PARSER_IN_COLLECTION_EXPRESSION, - ], true) + if ( + !in_array($parserContext, [ + self::PARSER_IN_COMPOUND, + self::PARSER_IN_ARRAY_EXPRESSION, + self::PARSER_IN_COLLECTION_EXPRESSION, + ], true) ) { throw new RuntimeException( 'Unexpected nullable character' @@ -224,7 +242,7 @@ final class TypeResolver $resolvedType = new Expression($type); $types[] = $resolvedType; - } elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && $token[0] === ')') { + } elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && isset($token[0]) && $token[0] === ')') { break; } elseif ($token === '<') { if (count($types) === 0) { @@ -237,13 +255,16 @@ final class TypeResolver if ($classType !== null) { if ((string) $classType === 'class-string') { $types[] = $this->resolveClassString($tokens, $context); + } elseif ((string) $classType === 'interface-string') { + $types[] = $this->resolveInterfaceString($tokens, $context); } else { $types[] = $this->resolveCollection($tokens, $classType, $context); } } $tokens->next(); - } elseif ($parserContext === self::PARSER_IN_COLLECTION_EXPRESSION + } elseif ( + $parserContext === self::PARSER_IN_COLLECTION_EXPRESSION && ($token === '>' || trim($token) === ',') ) { break; @@ -313,13 +334,15 @@ final class TypeResolver * * @psalm-mutation-free */ - private function resolveSingleType(string $type, Context $context) : object + private function resolveSingleType(string $type, Context $context): object { switch (true) { case $this->isKeyword($type): return $this->resolveKeyword($type); + case $this->isFqsen($type): return $this->resolveTypedObject($type); + case $this->isPartialStructuralElementName($type): return $this->resolveTypedObject($type, $context); @@ -339,7 +362,7 @@ final class TypeResolver * * @psalm-param class-string $typeClassName */ - public function addKeyword(string $keyword, string $typeClassName) : void + public function addKeyword(string $keyword, string $typeClassName): void { if (!class_exists($typeClassName)) { throw new InvalidArgumentException( @@ -348,7 +371,15 @@ final class TypeResolver ); } - if (!in_array(Type::class, class_implements($typeClassName), true)) { + $interfaces = class_implements($typeClassName); + if ($interfaces === false) { + throw new InvalidArgumentException( + 'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' + . ' but we could not find the class ' . $typeClassName + ); + } + + if (!in_array(Type::class, $interfaces, true)) { throw new InvalidArgumentException( 'The class "' . $typeClassName . '" must implement the interface "phpDocumentor\Reflection\Type"' ); @@ -364,7 +395,7 @@ final class TypeResolver * * @psalm-mutation-free */ - private function isKeyword(string $type) : bool + private function isKeyword(string $type): bool { return array_key_exists(strtolower($type), $this->keywords); } @@ -376,9 +407,9 @@ final class TypeResolver * * @psalm-mutation-free */ - private function isPartialStructuralElementName(string $type) : bool + private function isPartialStructuralElementName(string $type): bool { - return ($type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type); + return (isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type); } /** @@ -386,7 +417,7 @@ final class TypeResolver * * @psalm-mutation-free */ - private function isFqsen(string $type) : bool + private function isFqsen(string $type): bool { return strpos($type, self::OPERATOR_NAMESPACE) === 0; } @@ -396,7 +427,7 @@ final class TypeResolver * * @psalm-mutation-free */ - private function resolveKeyword(string $type) : Type + private function resolveKeyword(string $type): Type { $className = $this->keywords[strtolower($type)]; @@ -408,7 +439,7 @@ final class TypeResolver * * @psalm-mutation-free */ - private function resolveTypedObject(string $type, ?Context $context = null) : Object_ + private function resolveTypedObject(string $type, ?Context $context = null): Object_ { return new Object_($this->fqsenResolver->resolve($type, $context)); } @@ -418,7 +449,7 @@ final class TypeResolver * * @param ArrayIterator $tokens */ - private function resolveClassString(ArrayIterator $tokens, Context $context) : Type + private function resolveClassString(ArrayIterator $tokens, Context $context): Type { $tokens->next(); @@ -446,6 +477,39 @@ final class TypeResolver return new ClassString($classType->getFqsen()); } + /** + * Resolves class string + * + * @param ArrayIterator $tokens + */ + private function resolveInterfaceString(ArrayIterator $tokens, Context $context): Type + { + $tokens->next(); + + $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION); + + if (!$classType instanceof Object_ || $classType->getFqsen() === null) { + throw new RuntimeException( + $classType . ' is not a interface string' + ); + } + + $token = $tokens->current(); + if ($token !== '>') { + if (empty($token)) { + throw new RuntimeException( + 'interface-string: ">" is missing' + ); + } + + throw new RuntimeException( + 'Unexpected character "' . $token . '", ">" is missing' + ); + } + + return new InterfaceString($classType->getFqsen()); + } + /** * Resolves the collection values and keys * @@ -453,14 +517,16 @@ final class TypeResolver * * @return Array_|Iterable_|Collection */ - private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context) : Type + private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context): Type { $isArray = ((string) $classType === 'array'); $isIterable = ((string) $classType === 'iterable'); // allow only "array", "iterable" or class name before "<" - if (!$isArray && !$isIterable - && (!$classType instanceof Object_ || $classType->getFqsen() === null)) { + if ( + !$isArray && !$isIterable + && (!$classType instanceof Object_ || $classType->getFqsen() === null) + ) { throw new RuntimeException( $classType . ' is not a collection' ); @@ -478,7 +544,9 @@ final class TypeResolver if ($isArray) { // check the key type for an "array" collection. We allow only // strings or integers. - if (!$keyType instanceof String_ && + if ( + !$keyType instanceof ArrayKey && + !$keyType instanceof String_ && !$keyType instanceof Integer && !$keyType instanceof Compound ) { @@ -489,7 +557,9 @@ final class TypeResolver if ($keyType instanceof Compound) { foreach ($keyType->getIterator() as $item) { - if (!$item instanceof String_ && + if ( + !$item instanceof ArrayKey && + !$item instanceof String_ && !$item instanceof Integer ) { throw new RuntimeException( @@ -536,7 +606,7 @@ final class TypeResolver /** * @psalm-pure */ - private function makeCollectionFromObject(Object_ $object, Type $valueType, ?Type $keyType = null) : Collection + private function makeCollectionFromObject(Object_ $object, Type $valueType, ?Type $keyType = null): Collection { return new Collection($object->getFqsen(), $valueType, $keyType); } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php b/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php index bbea4f14..b674862a 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php @@ -48,7 +48,7 @@ abstract class AbstractList implements Type /** * Returns the type for the keys of this array. */ - public function getKeyType() : Type + public function getKeyType(): Type { return $this->keyType ?? $this->defaultKeyType; } @@ -56,7 +56,7 @@ abstract class AbstractList implements Type /** * Returns the value for the keys of this array. */ - public function getValueType() : Type + public function getValueType(): Type { return $this->valueType; } @@ -64,7 +64,7 @@ abstract class AbstractList implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { if ($this->keyType) { return 'array<' . $this->keyType . ',' . $this->valueType . '>'; diff --git a/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php b/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php index 95222958..472a1cdc 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php @@ -15,6 +15,7 @@ namespace phpDocumentor\Reflection\Types; use ArrayIterator; use IteratorAggregate; use phpDocumentor\Reflection\Type; + use function array_key_exists; use function implode; @@ -53,7 +54,7 @@ abstract class AggregatedType implements Type, IteratorAggregate /** * Returns the type at the given index. */ - public function get(int $index) : ?Type + public function get(int $index): ?Type { if (!$this->has($index)) { return null; @@ -65,7 +66,7 @@ abstract class AggregatedType implements Type, IteratorAggregate /** * Tests if this compound type has a type with the given index. */ - public function has(int $index) : bool + public function has(int $index): bool { return array_key_exists($index, $this->types); } @@ -73,7 +74,7 @@ abstract class AggregatedType implements Type, IteratorAggregate /** * Tests if this compound type contains the given type. */ - public function contains(Type $type) : bool + public function contains(Type $type): bool { foreach ($this->types as $typePart) { // if the type is duplicate; do not add it @@ -88,7 +89,7 @@ abstract class AggregatedType implements Type, IteratorAggregate /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return implode($this->token, $this->types); } @@ -96,7 +97,7 @@ abstract class AggregatedType implements Type, IteratorAggregate /** * @return ArrayIterator */ - public function getIterator() : ArrayIterator + public function getIterator(): ArrayIterator { return new ArrayIterator($this->types); } @@ -104,7 +105,7 @@ abstract class AggregatedType implements Type, IteratorAggregate /** * @psalm-suppress ImpureMethodCall */ - private function add(Type $type) : void + private function add(Type $type): void { if ($type instanceof self) { foreach ($type->getIterator() as $subType) { diff --git a/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php b/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php new file mode 100644 index 00000000..cf86df00 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php @@ -0,0 +1,42 @@ +fqsen = $fqsen; } + public function underlyingType(): Type + { + return new String_(); + } + /** * Returns the FQSEN associated with this object. */ - public function getFqsen() : ?Fqsen + public function getFqsen(): ?Fqsen { return $this->fqsen; } @@ -45,7 +51,7 @@ final class ClassString implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { if ($this->fqsen === null) { return 'class-string'; diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Collection.php b/vendor/phpdocumentor/type-resolver/src/Types/Collection.php index 84b4463a..943cc22e 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Collection.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Collection.php @@ -47,7 +47,7 @@ final class Collection extends AbstractList /** * Returns the FQSEN associated with this object. */ - public function getFqsen() : ?Fqsen + public function getFqsen(): ?Fqsen { return $this->fqsen; } @@ -55,7 +55,7 @@ final class Collection extends AbstractList /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { $objectType = (string) ($this->fqsen ?? 'object'); diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Context.php b/vendor/phpdocumentor/type-resolver/src/Types/Context.php index c134d7cf..79aadaf8 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Context.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Context.php @@ -50,7 +50,6 @@ final class Context * * @param string $namespace The namespace where this DocBlock resides in. * @param string[] $namespaceAliases List of namespace aliases => Fully Qualified Namespace. - * * @psalm-param array $namespaceAliases */ public function __construct(string $namespace, array $namespaceAliases = []) @@ -77,7 +76,7 @@ final class Context /** * Returns the Qualified Namespace Name (thus without `\` in front) where the associated element is in. */ - public function getNamespace() : string + public function getNamespace(): string { return $this->namespace; } @@ -87,10 +86,9 @@ final class Context * the alias for the imported Namespace. * * @return string[] - * * @psalm-return array */ - public function getNamespaceAliases() : array + public function getNamespaceAliases(): array { return $this->namespaceAliases; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php b/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php index 5d09d565..892ee0f9 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php @@ -23,6 +23,7 @@ use ReflectionProperty; use Reflector; use RuntimeException; use UnexpectedValueException; + use function define; use function defined; use function file_exists; @@ -34,10 +35,13 @@ use function strrpos; use function substr; use function token_get_all; use function trim; + use const T_AS; use const T_CLASS; use const T_CURLY_OPEN; use const T_DOLLAR_OPEN_CURLY_BRACES; +use const T_NAME_FULLY_QUALIFIED; +use const T_NAME_QUALIFIED; use const T_NAMESPACE; use const T_NS_SEPARATOR; use const T_STRING; @@ -73,7 +77,7 @@ final class ContextFactory * * @see Context for more information on Contexts. */ - public function createFromReflector(Reflector $reflector) : Context + public function createFromReflector(Reflector $reflector): Context { if ($reflector instanceof ReflectionClass) { //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable @@ -101,50 +105,43 @@ final class ContextFactory throw new UnexpectedValueException('Unhandled \Reflector instance given: ' . get_class($reflector)); } - private function createFromReflectionParameter(ReflectionParameter $parameter) : Context + private function createFromReflectionParameter(ReflectionParameter $parameter): Context { $class = $parameter->getDeclaringClass(); if (!$class) { throw new InvalidArgumentException('Unable to get class of ' . $parameter->getName()); } - //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable - /** @var ReflectionClass $class */ - return $this->createFromReflectionClass($class); } - private function createFromReflectionMethod(ReflectionMethod $method) : Context + private function createFromReflectionMethod(ReflectionMethod $method): Context { - //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable - /** @var ReflectionClass $class */ $class = $method->getDeclaringClass(); return $this->createFromReflectionClass($class); } - private function createFromReflectionProperty(ReflectionProperty $property) : Context + private function createFromReflectionProperty(ReflectionProperty $property): Context { - //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable - /** @var ReflectionClass $class */ $class = $property->getDeclaringClass(); return $this->createFromReflectionClass($class); } - private function createFromReflectionClassConstant(ReflectionClassConstant $constant) : Context + private function createFromReflectionClassConstant(ReflectionClassConstant $constant): Context { //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable - /** @var ReflectionClass $class */ + /** @phpstan-var ReflectionClass $class */ $class = $constant->getDeclaringClass(); return $this->createFromReflectionClass($class); } /** - * @param ReflectionClass $class + * @phpstan-param ReflectionClass $class */ - private function createFromReflectionClass(ReflectionClass $class) : Context + private function createFromReflectionClass(ReflectionClass $class): Context { $fileName = $class->getFileName(); $namespace = $class->getNamespaceName(); @@ -170,7 +167,7 @@ final class ContextFactory * this method first normalizes. * @param string $fileContents The file's contents to retrieve the aliases from with the given namespace. */ - public function createForNamespace(string $namespace, string $fileContents) : Context + public function createForNamespace(string $namespace, string $fileContents): Context { $namespace = trim($namespace, '\\'); $useStatements = []; @@ -191,8 +188,10 @@ final class ContextFactory $firstBraceFound = false; while ($tokens->valid() && ($braceLevel > 0 || !$firstBraceFound)) { $currentToken = $tokens->current(); - if ($currentToken === '{' - || in_array($currentToken[0], [T_CURLY_OPEN, T_DOLLAR_OPEN_CURLY_BRACES], true)) { + if ( + $currentToken === '{' + || in_array($currentToken[0], [T_CURLY_OPEN, T_DOLLAR_OPEN_CURLY_BRACES], true) + ) { if (!$firstBraceFound) { $firstBraceFound = true; } @@ -227,7 +226,7 @@ final class ContextFactory * * @param ArrayIterator $tokens */ - private function parseNamespace(ArrayIterator $tokens) : string + private function parseNamespace(ArrayIterator $tokens): string { // skip to the first string or namespace separator $this->skipToNextStringOrNamespaceSeparator($tokens); @@ -248,10 +247,9 @@ final class ContextFactory * @param ArrayIterator $tokens * * @return string[] - * * @psalm-return array */ - private function parseUseStatement(ArrayIterator $tokens) : array + private function parseUseStatement(ArrayIterator $tokens): array { $uses = []; @@ -273,7 +271,7 @@ final class ContextFactory * * @param ArrayIterator $tokens */ - private function skipToNextStringOrNamespaceSeparator(ArrayIterator $tokens) : void + private function skipToNextStringOrNamespaceSeparator(ArrayIterator $tokens): void { while ($tokens->valid()) { $currentToken = $tokens->current(); @@ -300,12 +298,11 @@ final class ContextFactory * @param ArrayIterator $tokens * * @return string[] + * @psalm-return array * * @psalm-suppress TypeDoesNotContainType - * - * @psalm-return array */ - private function extractUseStatements(ArrayIterator $tokens) : array + private function extractUseStatements(ArrayIterator $tokens): array { $extractedUseStatements = []; $groupedNs = ''; diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Expression.php b/vendor/phpdocumentor/type-resolver/src/Types/Expression.php index 4a8ae1fc..da5f65d5 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Expression.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Expression.php @@ -36,7 +36,7 @@ final class Expression implements Type /** * Returns the value for the keys of this array. */ - public function getValueType() : Type + public function getValueType(): Type { return $this->valueType; } @@ -44,7 +44,7 @@ final class Expression implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return '(' . $this->valueType . ')'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Float_.php b/vendor/phpdocumentor/type-resolver/src/Types/Float_.php index e70ce7dd..86138c0e 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Float_.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Float_.php @@ -25,7 +25,7 @@ final class Float_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'float'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Integer.php b/vendor/phpdocumentor/type-resolver/src/Types/Integer.php index 2cfd7e9e..10ce3c58 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Integer.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Integer.php @@ -20,12 +20,12 @@ use phpDocumentor\Reflection\Type; * * @psalm-immutable */ -final class Integer implements Type +class Integer implements Type { /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'int'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/InterfaceString.php b/vendor/phpdocumentor/type-resolver/src/Types/InterfaceString.php new file mode 100644 index 00000000..9836961f --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/InterfaceString.php @@ -0,0 +1,56 @@ +fqsen = $fqsen; + } + + /** + * Returns the FQSEN associated with this object. + */ + public function getFqsen(): ?Fqsen + { + return $this->fqsen; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + if ($this->fqsen === null) { + return 'interface-string'; + } + + return 'interface-string<' . (string) $this->fqsen . '>'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php b/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php index a03a7cd3..1ca069f2 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php @@ -23,7 +23,7 @@ final class Iterable_ extends AbstractList /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { if ($this->keyType) { return 'iterable<' . $this->keyType . ',' . $this->valueType . '>'; diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php b/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php index 2fedff40..56d1b6da 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php @@ -25,7 +25,7 @@ final class Mixed_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'mixed'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Never_.php b/vendor/phpdocumentor/type-resolver/src/Types/Never_.php new file mode 100644 index 00000000..40a99c9a --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Never_.php @@ -0,0 +1,35 @@ +realType; } @@ -44,7 +44,7 @@ final class Nullable implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return '?' . $this->realType->__toString(); } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Object_.php b/vendor/phpdocumentor/type-resolver/src/Types/Object_.php index 4cfe2a0c..90dee57a 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Object_.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Object_.php @@ -16,6 +16,7 @@ namespace phpDocumentor\Reflection\Types; use InvalidArgumentException; use phpDocumentor\Reflection\Fqsen; use phpDocumentor\Reflection\Type; + use function strpos; /** @@ -52,12 +53,12 @@ final class Object_ implements Type /** * Returns the FQSEN associated with this object. */ - public function getFqsen() : ?Fqsen + public function getFqsen(): ?Fqsen { return $this->fqsen; } - public function __toString() : string + public function __toString(): string { if ($this->fqsen) { return (string) $this->fqsen; diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php b/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php index 08900abc..34838599 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php @@ -27,7 +27,7 @@ final class Parent_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'parent'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php b/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php index 2d4a794c..1998ee0a 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php @@ -25,7 +25,7 @@ final class Resource_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'resource'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php b/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php index 00ac3691..80241c21 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php @@ -25,7 +25,7 @@ final class Scalar implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'scalar'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Self_.php b/vendor/phpdocumentor/type-resolver/src/Types/Self_.php index 7fa13fa5..5096126e 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Self_.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Self_.php @@ -27,7 +27,7 @@ final class Self_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'self'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Static_.php b/vendor/phpdocumentor/type-resolver/src/Types/Static_.php index 568400ce..6fe365ff 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Static_.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Static_.php @@ -32,7 +32,7 @@ final class Static_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'static'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/String_.php b/vendor/phpdocumentor/type-resolver/src/Types/String_.php index 6b92e413..a4bb47f1 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/String_.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/String_.php @@ -20,12 +20,12 @@ use phpDocumentor\Reflection\Type; * * @psalm-immutable */ -final class String_ implements Type +class String_ implements Type { /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'string'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/This.php b/vendor/phpdocumentor/type-resolver/src/Types/This.php index 58cb3af0..602fc698 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/This.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/This.php @@ -28,7 +28,7 @@ final class This implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return '$this'; } diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Void_.php b/vendor/phpdocumentor/type-resolver/src/Types/Void_.php index 5cabad50..23a601d4 100644 --- a/vendor/phpdocumentor/type-resolver/src/Types/Void_.php +++ b/vendor/phpdocumentor/type-resolver/src/Types/Void_.php @@ -16,7 +16,7 @@ namespace phpDocumentor\Reflection\Types; use phpDocumentor\Reflection\Type; /** - * Value Object representing the pseudo-type 'void'. + * Value Object representing the return-type 'void'. * * Void is generally only used when working with return types as it signifies that the method intentionally does not * return any value. @@ -28,7 +28,7 @@ final class Void_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'void'; } diff --git a/vendor/psr/container/composer.json b/vendor/psr/container/composer.json index 3797a253..017f41ea 100644 --- a/vendor/psr/container/composer.json +++ b/vendor/psr/container/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "autoload": { "psr-4": { diff --git a/vendor/psr/container/src/ContainerExceptionInterface.php b/vendor/psr/container/src/ContainerExceptionInterface.php index cf10b8b4..0f213f2f 100644 --- a/vendor/psr/container/src/ContainerExceptionInterface.php +++ b/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/vendor/sabre/event/.github/workflows/ci.yml b/vendor/sabre/event/.github/workflows/ci.yml new file mode 100644 index 00000000..3473cd2d --- /dev/null +++ b/vendor/sabre/event/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: continuous-integration +on: + push: + branches: + - master + - release/* + pull_request: +jobs: + unit-testing: + name: PHPUnit (PHP ${{ matrix.php-versions }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1'] + coverage: ['pcov'] + code-analysis: ['no'] + include: + - php-versions: '7.1' + coverage: 'none' + code-analysis: 'yes' + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, dom, fileinfo, mysql, redis, opcache + coverage: ${{ matrix.coverage }} + tools: composer + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + # Use composer.json for key, if composer.lock is not committed. + # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: Code Analysis (PHP CS-Fixer) + if: matrix.code-analysis == 'yes' + run: php vendor/bin/php-cs-fixer fix --dry-run --diff + + - name: Code Analysis (PHPStan) + if: matrix.code-analysis == 'yes' + run: composer phpstan + + - name: Test with phpunit + run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml + + - name: Code Coverage + uses: codecov/codecov-action@v2 + if: matrix.coverage != 'none' diff --git a/vendor/sabre/event/composer.json b/vendor/sabre/event/composer.json index 181afe19..42fb4aa2 100644 --- a/vendor/sabre/event/composer.json +++ b/vendor/sabre/event/composer.json @@ -46,7 +46,7 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.16.1", + "friendsofphp/php-cs-fixer": "~2.17.1", "phpstan/phpstan": "^0.12", "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0" }, diff --git a/vendor/sabre/event/lib/EventEmitter.php b/vendor/sabre/event/lib/EventEmitter.php index 18971e3e..865c99b5 100644 --- a/vendor/sabre/event/lib/EventEmitter.php +++ b/vendor/sabre/event/lib/EventEmitter.php @@ -7,7 +7,7 @@ namespace Sabre\Event; /** * This is the old name for the Emitter class. * - * Instead of of using EventEmitter, please use Emitter. They are identical + * Instead of using EventEmitter, please use Emitter. They are identical * otherwise. * * @copyright Copyright (C) fruux GmbH (https://fruux.com/) diff --git a/vendor/sabre/event/lib/Loop/Loop.php b/vendor/sabre/event/lib/Loop/Loop.php index ec09be92..b85a7a44 100644 --- a/vendor/sabre/event/lib/Loop/Loop.php +++ b/vendor/sabre/event/lib/Loop/Loop.php @@ -273,7 +273,9 @@ class Loop $read = $this->readStreams; $write = $this->writeStreams; $except = null; - if (stream_select($read, $write, $except, (null === $timeout) ? null : 0, $timeout ? (int) ($timeout * 1000000) : 0)) { + // stream_select changes behavior in 8.1 to forbid passing non-null microseconds when the seconds are null. + // Older versions of php don't allow passing null to microseconds. + if (null !== $timeout ? stream_select($read, $write, $except, 0, (int) ($timeout * 1000000)) : stream_select($read, $write, $except, null)) { // See PHP Bug https://bugs.php.net/bug.php?id=62452 // Fixed in PHP7 foreach ($read as $readStream) { diff --git a/vendor/sabre/event/lib/Promise.php b/vendor/sabre/event/lib/Promise.php index 1228561a..42969a55 100644 --- a/vendor/sabre/event/lib/Promise.php +++ b/vendor/sabre/event/lib/Promise.php @@ -144,7 +144,7 @@ class Promise } /** - * Marks this promise as rejected, and set it's rejection reason. + * Marks this promise as rejected, and set its rejection reason. */ public function reject(Throwable $reason) { diff --git a/vendor/sabre/event/lib/Promise/functions.php b/vendor/sabre/event/lib/Promise/functions.php index 986fe2b0..fbed6347 100644 --- a/vendor/sabre/event/lib/Promise/functions.php +++ b/vendor/sabre/event/lib/Promise/functions.php @@ -18,7 +18,7 @@ use Throwable; /** * This function takes an array of Promises, and returns a Promise that - * resolves when all of the given arguments have resolved. + * resolves when all the given arguments have resolved. * * The returned Promise will resolve with a value that's an array of all the * values the given promises have been resolved with. diff --git a/vendor/sabre/event/lib/Version.php b/vendor/sabre/event/lib/Version.php index 457aea9b..fe8f5c3b 100644 --- a/vendor/sabre/event/lib/Version.php +++ b/vendor/sabre/event/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '5.1.2'; + const VERSION = '5.1.4'; } diff --git a/vendor/sabre/event/lib/WildcardEmitter.php b/vendor/sabre/event/lib/WildcardEmitter.php index 1b7c248b..997709e8 100644 --- a/vendor/sabre/event/lib/WildcardEmitter.php +++ b/vendor/sabre/event/lib/WildcardEmitter.php @@ -22,9 +22,9 @@ namespace Sabre\Event; * - Using ":" as a separator is optional, but it's highly recommended to use * some kind of separator. * - * The WilcardEmitter is a bit slower than the regular Emitter. If you code + * The WildcardEmitter is a bit slower than the regular Emitter. If your code * must be very high performance, it might be better to try to use the other - * emitter. For must usage the difference is negligible though. + * emitter. For most usage the difference is negligible though. * * @copyright Copyright (C) fruux GmbH (https://fruux.com/) * @author Evert Pot (http://evertpot.com/) diff --git a/vendor/scssphp/scssphp/LICENSE.md b/vendor/scssphp/scssphp/LICENSE.md deleted file mode 100644 index afcfdfb2..00000000 --- a/vendor/scssphp/scssphp/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2015 Leaf Corcoran, http://scssphp.github.io/scssphp - -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/vendor/scssphp/scssphp/README.md b/vendor/scssphp/scssphp/README.md deleted file mode 100644 index 65bb93ea..00000000 --- a/vendor/scssphp/scssphp/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# scssphp -### - -![Build](https://github.com/scssphp/scssphp/workflows/CI/badge.svg) -[![License](https://poser.pugx.org/scssphp/scssphp/license)](https://packagist.org/packages/scssphp/scssphp) - -`scssphp` is a compiler for SCSS written in PHP. - -Checkout the homepage, , for directions on how to use. - -## Running Tests - -`scssphp` uses [PHPUnit](https://github.com/sebastianbergmann/phpunit) for testing. - -Run the following command from the root directory to run every test: - - vendor/bin/phpunit tests - -There are several tests in the `tests/` directory: - -* `ApiTest.php` contains various unit tests that test the PHP interface. -* `ExceptionTest.php` contains unit tests that test for exceptions thrown by the parser and compiler. -* `FailingTest.php` contains tests reported in Github issues that demonstrate compatibility bugs. -* `InputTest.php` compiles every `.scss` file in the `tests/inputs` directory - then compares to the respective `.css` file in the `tests/outputs` directory. -* `SassSpecTest.php` extracts tests from the `sass/sass-spec` repository. - -When changing any of the tests in `tests/inputs`, the tests will most likely -fail because the output has changed. Once you verify that the output is correct -you can run the following command to rebuild all the tests: - - BUILD=1 vendor/bin/phpunit tests - -This will compile all the tests, and save results into `tests/outputs`. It also -updates the list of excluded specs from sass-spec. - -To enable the full `sass-spec` compatibility tests: - - TEST_SASS_SPEC=1 vendor/bin/phpunit tests - -## Coding Standard - -`scssphp` source conforms to [PSR12](https://www.php-fig.org/psr/psr-12/). - -Run the following command from the root directory to check the code for "sniffs". - - vendor/bin/phpcs --standard=PSR12 --extensions=php bin src tests *.php - -## Static Analysis - -`scssphp` uses [phpstan](https://phpstan.org/) for static analysis. - -Run the following command from the root directory to analyse the codebase: - - make phpstan - -As most of the codebase is composed of legacy code which cannot be type-checked -fully, the setup contains a baseline file with all errors we want to ignore. In -particular, we ignore all errors related to not specifying the types inside arrays -when these arrays correspond to the representation of Sass values and Sass AST nodes -in the parser and compiler. -When contributing, the proper process to deal with static analysis is the following: - -1. Make your change in the codebase -2. Run `make phpstan` -3. Fix errors reported by phpstan when possible -4. Repeat step 2 and 3 until nothing gets fixed anymore at step 3 -5. Run `make phpstan-baseline` to regenerate the phpstan baseline - -Additions to the baseline will be reviewed to avoid ignoring errors that should have -been fixed. diff --git a/vendor/scssphp/scssphp/bin/pscss b/vendor/scssphp/scssphp/bin/pscss deleted file mode 100755 index 18c136ac..00000000 --- a/vendor/scssphp/scssphp/bin/pscss +++ /dev/null @@ -1,244 +0,0 @@ -#!/usr/bin/env php -parse($data)), true)); - - fwrite(STDERR, 'Warning: the --dump-tree option is deprecated. Use proper debugging tools instead.'); - - exit(); -} - -$scss = new Compiler(); - -if ($loadPaths) { - $scss->setImportPaths(explode(PATH_SEPARATOR, $loadPaths)); -} - -if ($style) { - if ($style === OutputStyle::COMPRESSED || $style === OutputStyle::EXPANDED) { - $scss->setOutputStyle($style); - } else { - fwrite(STDERR, "WARNING: the $style style is deprecated.\n"); - $scss->setFormatter('ScssPhp\\ScssPhp\\Formatter\\' . ucfirst($style)); - } -} - -$outputFile = isset($arguments[1]) ? $arguments[1] : null; -$sourceMapFile = null; - -if ($sourceMap) { - $sourceMapOptions = array( - 'outputSourceFiles' => $embedSources, - ); - if ($embedSourceMap || $outputFile === null) { - $scss->setSourceMap(Compiler::SOURCE_MAP_INLINE); - } else { - $sourceMapFile = $outputFile . '.map'; - $sourceMapOptions['sourceMapWriteTo'] = $sourceMapFile; - $sourceMapOptions['sourceMapURL'] = basename($sourceMapFile); - $sourceMapOptions['sourceMapBasepath'] = getcwd(); - $sourceMapOptions['sourceMapFilename'] = basename($outputFile); - - $scss->setSourceMap(Compiler::SOURCE_MAP_FILE); - } - - $scss->setSourceMapOptions($sourceMapOptions); -} - -if ($encoding) { - $scss->setEncoding($encoding); -} - -try { - $result = $scss->compileString($data, $inputFile); -} catch (SassException $e) { - fwrite(STDERR, 'Error: '.$e->getMessage()."\n"); - exit(1); -} - -if ($outputFile) { - file_put_contents($outputFile, $result->getCss()); - - if ($sourceMapFile !== null && $result->getSourceMap() !== null) { - file_put_contents($sourceMapFile, $result->getSourceMap()); - } -} else { - echo $result->getCss(); -} diff --git a/vendor/scssphp/scssphp/composer.json b/vendor/scssphp/scssphp/composer.json deleted file mode 100644 index 1c6d7625..00000000 --- a/vendor/scssphp/scssphp/composer.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "name": "scssphp/scssphp", - "type": "library", - "description": "scssphp is a compiler for SCSS written in PHP.", - "keywords": ["css", "stylesheet", "scss", "sass", "less"], - "homepage": "http://scssphp.github.io/scssphp/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthon Pang", - "email": "apang@softwaredevelopment.ca", - "homepage": "https://github.com/robocoder" - }, - { - "name": "Cédric Morin", - "email": "cedric@yterium.com", - "homepage": "https://github.com/Cerdic" - } - ], - "autoload": { - "psr-4": { "ScssPhp\\ScssPhp\\": "src/" } - }, - "autoload-dev": { - "psr-4": { "ScssPhp\\ScssPhp\\Tests\\": "tests/" } - }, - "require": { - "php": ">=5.6.0", - "ext-json": "*", - "ext-ctype": "*" - }, - "suggest": { - "ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv", - "ext-iconv": "Can be used as fallback when ext-mbstring is not available" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4", - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3 || ^9.4", - "sass/sass-spec": "*", - "squizlabs/php_codesniffer": "~3.5", - "symfony/phpunit-bridge": "^5.1", - "twbs/bootstrap": "~5.0", - "twbs/bootstrap4": "4.6.0", - "zurb/foundation": "~6.5" - }, - "repositories": [ - { - "type": "package", - "package": { - "name": "sass/sass-spec", - "version": "2021.06.30", - "source": { - "type": "git", - "url": "https://github.com/sass/sass-spec.git", - "reference": "e348959657f1e274cef658283436a311a925a673" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sass/sass-spec/zipball/e348959657f1e274cef658283436a311a925a673", - "reference": "e348959657f1e274cef658283436a311a925a673", - "shasum": "" - } - } - }, - { - "type": "package", - "package": { - "name": "twbs/bootstrap4", - "version": "v4.6.0", - "source": { - "type": "git", - "url": "https://github.com/twbs/bootstrap.git", - "reference": "6ffb0b48e455430f8a5359ed689ad64c1143fac2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twbs/bootstrap/zipball/6ffb0b48e455430f8a5359ed689ad64c1143fac2", - "reference": "6ffb0b48e455430f8a5359ed689ad64c1143fac2", - "shasum": "" - } - } - } - ], - "bin": ["bin/pscss"], - "config": { - "sort-packages": true - } -} diff --git a/vendor/scssphp/scssphp/phpcs.xml.dist b/vendor/scssphp/scssphp/phpcs.xml.dist deleted file mode 100644 index b162dbd6..00000000 --- a/vendor/scssphp/scssphp/phpcs.xml.dist +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/vendor/scssphp/scssphp/scss.inc.php b/vendor/scssphp/scssphp/scss.inc.php deleted file mode 100644 index 45983780..00000000 --- a/vendor/scssphp/scssphp/scss.inc.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * @internal - */ -class Range -{ - /** - * @var float|int - */ - public $first; - - /** - * @var float|int - */ - public $last; - - /** - * Initialize range - * - * @param integer|float $first - * @param integer|float $last - */ - public function __construct($first, $last) - { - $this->first = $first; - $this->last = $last; - } - - /** - * Test for inclusion in range - * - * @param integer|float $value - * - * @return boolean - */ - public function includes($value) - { - return $value >= $this->first && $value <= $this->last; - } -} diff --git a/vendor/scssphp/scssphp/src/Block.php b/vendor/scssphp/scssphp/src/Block.php deleted file mode 100644 index 3ae49d00..00000000 --- a/vendor/scssphp/scssphp/src/Block.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * @internal - */ -class Block -{ - /** - * @var string - */ - public $type; - - /** - * @var \ScssPhp\ScssPhp\Block - */ - public $parent; - - /** - * @var string - */ - public $sourceName; - - /** - * @var integer - */ - public $sourceIndex; - - /** - * @var integer - */ - public $sourceLine; - - /** - * @var integer - */ - public $sourceColumn; - - /** - * @var array|null - */ - public $selectors; - - /** - * @var array - */ - public $comments; - - /** - * @var array - */ - public $children; - - /** - * @var \ScssPhp\ScssPhp\Block|null - */ - public $selfParent; -} diff --git a/vendor/scssphp/scssphp/src/Cache.php b/vendor/scssphp/scssphp/src/Cache.php deleted file mode 100644 index 9731c60a..00000000 --- a/vendor/scssphp/scssphp/src/Cache.php +++ /dev/null @@ -1,272 +0,0 @@ - - * - * @internal - */ -class Cache -{ - const CACHE_VERSION = 1; - - /** - * directory used for storing data - * - * @var string|false - */ - public static $cacheDir = false; - - /** - * prefix for the storing data - * - * @var string - */ - public static $prefix = 'scssphp_'; - - /** - * force a refresh : 'once' for refreshing the first hit on a cache only, true to never use the cache in this hit - * - * @var bool|string - */ - public static $forceRefresh = false; - - /** - * specifies the number of seconds after which data cached will be seen as 'garbage' and potentially cleaned up - * - * @var int - */ - public static $gcLifetime = 604800; - - /** - * array of already refreshed cache if $forceRefresh==='once' - * - * @var array - */ - protected static $refreshed = []; - - /** - * Constructor - * - * @param array $options - * - * @phpstan-param array{cacheDir?: string, prefix?: string, forceRefresh?: string} $options - */ - public function __construct($options) - { - // check $cacheDir - if (isset($options['cacheDir'])) { - self::$cacheDir = $options['cacheDir']; - } - - if (empty(self::$cacheDir)) { - throw new Exception('cacheDir not set'); - } - - if (isset($options['prefix'])) { - self::$prefix = $options['prefix']; - } - - if (empty(self::$prefix)) { - throw new Exception('prefix not set'); - } - - if (isset($options['forceRefresh'])) { - self::$forceRefresh = $options['forceRefresh']; - } - - self::checkCacheDir(); - } - - /** - * Get the cached result of $operation on $what, - * which is known as dependant from the content of $options - * - * @param string $operation parse, compile... - * @param mixed $what content key (e.g., filename to be treated) - * @param array $options any option that affect the operation result on the content - * @param int|null $lastModified last modified timestamp - * - * @return mixed - * - * @throws \Exception - */ - public function getCache($operation, $what, $options = [], $lastModified = null) - { - $fileCache = self::$cacheDir . self::cacheName($operation, $what, $options); - - if ( - ((self::$forceRefresh === false) || (self::$forceRefresh === 'once' && - isset(self::$refreshed[$fileCache]))) && file_exists($fileCache) - ) { - $cacheTime = filemtime($fileCache); - - if ( - (\is_null($lastModified) || $cacheTime > $lastModified) && - $cacheTime + self::$gcLifetime > time() - ) { - $c = file_get_contents($fileCache); - $c = unserialize($c); - - if (\is_array($c) && isset($c['value'])) { - return $c['value']; - } - } - } - - return null; - } - - /** - * Put in cache the result of $operation on $what, - * which is known as dependant from the content of $options - * - * @param string $operation - * @param mixed $what - * @param mixed $value - * @param array $options - * - * @return void - */ - public function setCache($operation, $what, $value, $options = []) - { - $fileCache = self::$cacheDir . self::cacheName($operation, $what, $options); - - $c = ['value' => $value]; - $c = serialize($c); - - file_put_contents($fileCache, $c); - - if (self::$forceRefresh === 'once') { - self::$refreshed[$fileCache] = true; - } - } - - /** - * Get the cache name for the caching of $operation on $what, - * which is known as dependant from the content of $options - * - * @param string $operation - * @param mixed $what - * @param array $options - * - * @return string - */ - private static function cacheName($operation, $what, $options = []) - { - $t = [ - 'version' => self::CACHE_VERSION, - 'scssphpVersion' => Version::VERSION, - 'operation' => $operation, - 'what' => $what, - 'options' => $options - ]; - - $t = self::$prefix - . sha1(json_encode($t)) - . ".$operation" - . ".scsscache"; - - return $t; - } - - /** - * Check that the cache dir exists and is writeable - * - * @return void - * - * @throws \Exception - */ - public static function checkCacheDir() - { - self::$cacheDir = str_replace('\\', '/', self::$cacheDir); - self::$cacheDir = rtrim(self::$cacheDir, '/') . '/'; - - if (! is_dir(self::$cacheDir)) { - throw new Exception('Cache directory doesn\'t exist: ' . self::$cacheDir); - } - - if (! is_writable(self::$cacheDir)) { - throw new Exception('Cache directory isn\'t writable: ' . self::$cacheDir); - } - } - - /** - * Delete unused cached files - * - * @return void - */ - public static function cleanCache() - { - static $clean = false; - - if ($clean || empty(self::$cacheDir)) { - return; - } - - $clean = true; - - // only remove files with extensions created by SCSSPHP Cache - // css files removed based on the list files - $removeTypes = ['scsscache' => 1]; - - $files = scandir(self::$cacheDir); - - if (! $files) { - return; - } - - $checkTime = time() - self::$gcLifetime; - - foreach ($files as $file) { - // don't delete if the file wasn't created with SCSSPHP Cache - if (strpos($file, self::$prefix) !== 0) { - continue; - } - - $parts = explode('.', $file); - $type = array_pop($parts); - - if (! isset($removeTypes[$type])) { - continue; - } - - $fullPath = self::$cacheDir . $file; - $mtime = filemtime($fullPath); - - // don't delete if it's a relatively new file - if ($mtime > $checkTime) { - continue; - } - - unlink($fullPath); - } - } -} diff --git a/vendor/scssphp/scssphp/src/Colors.php b/vendor/scssphp/scssphp/src/Colors.php deleted file mode 100644 index e836e3f4..00000000 --- a/vendor/scssphp/scssphp/src/Colors.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * @internal - */ -class Colors -{ - /** - * CSS Colors - * - * @see http://www.w3.org/TR/css3-color - * - * @var array - */ - protected static $cssColors = [ - 'aliceblue' => '240,248,255', - 'antiquewhite' => '250,235,215', - 'aqua' => '0,255,255', - 'cyan' => '0,255,255', - 'aquamarine' => '127,255,212', - 'azure' => '240,255,255', - 'beige' => '245,245,220', - 'bisque' => '255,228,196', - 'black' => '0,0,0', - 'blanchedalmond' => '255,235,205', - 'blue' => '0,0,255', - 'blueviolet' => '138,43,226', - 'brown' => '165,42,42', - 'burlywood' => '222,184,135', - 'cadetblue' => '95,158,160', - 'chartreuse' => '127,255,0', - 'chocolate' => '210,105,30', - 'coral' => '255,127,80', - 'cornflowerblue' => '100,149,237', - 'cornsilk' => '255,248,220', - 'crimson' => '220,20,60', - 'darkblue' => '0,0,139', - 'darkcyan' => '0,139,139', - 'darkgoldenrod' => '184,134,11', - 'darkgray' => '169,169,169', - 'darkgrey' => '169,169,169', - 'darkgreen' => '0,100,0', - 'darkkhaki' => '189,183,107', - 'darkmagenta' => '139,0,139', - 'darkolivegreen' => '85,107,47', - 'darkorange' => '255,140,0', - 'darkorchid' => '153,50,204', - 'darkred' => '139,0,0', - 'darksalmon' => '233,150,122', - 'darkseagreen' => '143,188,143', - 'darkslateblue' => '72,61,139', - 'darkslategray' => '47,79,79', - 'darkslategrey' => '47,79,79', - 'darkturquoise' => '0,206,209', - 'darkviolet' => '148,0,211', - 'deeppink' => '255,20,147', - 'deepskyblue' => '0,191,255', - 'dimgray' => '105,105,105', - 'dimgrey' => '105,105,105', - 'dodgerblue' => '30,144,255', - 'firebrick' => '178,34,34', - 'floralwhite' => '255,250,240', - 'forestgreen' => '34,139,34', - 'fuchsia' => '255,0,255', - 'magenta' => '255,0,255', - 'gainsboro' => '220,220,220', - 'ghostwhite' => '248,248,255', - 'gold' => '255,215,0', - 'goldenrod' => '218,165,32', - 'gray' => '128,128,128', - 'grey' => '128,128,128', - 'green' => '0,128,0', - 'greenyellow' => '173,255,47', - 'honeydew' => '240,255,240', - 'hotpink' => '255,105,180', - 'indianred' => '205,92,92', - 'indigo' => '75,0,130', - 'ivory' => '255,255,240', - 'khaki' => '240,230,140', - 'lavender' => '230,230,250', - 'lavenderblush' => '255,240,245', - 'lawngreen' => '124,252,0', - 'lemonchiffon' => '255,250,205', - 'lightblue' => '173,216,230', - 'lightcoral' => '240,128,128', - 'lightcyan' => '224,255,255', - 'lightgoldenrodyellow' => '250,250,210', - 'lightgray' => '211,211,211', - 'lightgrey' => '211,211,211', - 'lightgreen' => '144,238,144', - 'lightpink' => '255,182,193', - 'lightsalmon' => '255,160,122', - 'lightseagreen' => '32,178,170', - 'lightskyblue' => '135,206,250', - 'lightslategray' => '119,136,153', - 'lightslategrey' => '119,136,153', - 'lightsteelblue' => '176,196,222', - 'lightyellow' => '255,255,224', - 'lime' => '0,255,0', - 'limegreen' => '50,205,50', - 'linen' => '250,240,230', - 'maroon' => '128,0,0', - 'mediumaquamarine' => '102,205,170', - 'mediumblue' => '0,0,205', - 'mediumorchid' => '186,85,211', - 'mediumpurple' => '147,112,219', - 'mediumseagreen' => '60,179,113', - 'mediumslateblue' => '123,104,238', - 'mediumspringgreen' => '0,250,154', - 'mediumturquoise' => '72,209,204', - 'mediumvioletred' => '199,21,133', - 'midnightblue' => '25,25,112', - 'mintcream' => '245,255,250', - 'mistyrose' => '255,228,225', - 'moccasin' => '255,228,181', - 'navajowhite' => '255,222,173', - 'navy' => '0,0,128', - 'oldlace' => '253,245,230', - 'olive' => '128,128,0', - 'olivedrab' => '107,142,35', - 'orange' => '255,165,0', - 'orangered' => '255,69,0', - 'orchid' => '218,112,214', - 'palegoldenrod' => '238,232,170', - 'palegreen' => '152,251,152', - 'paleturquoise' => '175,238,238', - 'palevioletred' => '219,112,147', - 'papayawhip' => '255,239,213', - 'peachpuff' => '255,218,185', - 'peru' => '205,133,63', - 'pink' => '255,192,203', - 'plum' => '221,160,221', - 'powderblue' => '176,224,230', - 'purple' => '128,0,128', - 'red' => '255,0,0', - 'rosybrown' => '188,143,143', - 'royalblue' => '65,105,225', - 'saddlebrown' => '139,69,19', - 'salmon' => '250,128,114', - 'sandybrown' => '244,164,96', - 'seagreen' => '46,139,87', - 'seashell' => '255,245,238', - 'sienna' => '160,82,45', - 'silver' => '192,192,192', - 'skyblue' => '135,206,235', - 'slateblue' => '106,90,205', - 'slategray' => '112,128,144', - 'slategrey' => '112,128,144', - 'snow' => '255,250,250', - 'springgreen' => '0,255,127', - 'steelblue' => '70,130,180', - 'tan' => '210,180,140', - 'teal' => '0,128,128', - 'thistle' => '216,191,216', - 'tomato' => '255,99,71', - 'turquoise' => '64,224,208', - 'violet' => '238,130,238', - 'wheat' => '245,222,179', - 'white' => '255,255,255', - 'whitesmoke' => '245,245,245', - 'yellow' => '255,255,0', - 'yellowgreen' => '154,205,50', - 'rebeccapurple' => '102,51,153', - 'transparent' => '0,0,0,0', - ]; - - /** - * Convert named color in a [r,g,b[,a]] array - * - * @param string $colorName - * - * @return int[]|null - */ - public static function colorNameToRGBa($colorName) - { - if (\is_string($colorName) && isset(static::$cssColors[$colorName])) { - $rgba = explode(',', static::$cssColors[$colorName]); - - // only case with opacity is transparent, with opacity=0, so we can intval on opacity also - $rgba = array_map('intval', $rgba); - - return $rgba; - } - - return null; - } - - /** - * Reverse conversion : from RGBA to a color name if possible - * - * @param integer $r - * @param integer $g - * @param integer $b - * @param integer|float $a - * - * @return string|null - */ - public static function RGBaToColorName($r, $g, $b, $a = 1) - { - static $reverseColorTable = null; - - if (! is_numeric($r) || ! is_numeric($g) || ! is_numeric($b) || ! is_numeric($a)) { - return null; - } - - if ($a < 1) { - return null; - } - - if (\is_null($reverseColorTable)) { - $reverseColorTable = []; - - foreach (static::$cssColors as $name => $rgb_str) { - $rgb_str = explode(',', $rgb_str); - - if ( - \count($rgb_str) == 3 && - ! isset($reverseColorTable[\intval($rgb_str[0])][\intval($rgb_str[1])][\intval($rgb_str[2])]) - ) { - $reverseColorTable[\intval($rgb_str[0])][\intval($rgb_str[1])][\intval($rgb_str[2])] = $name; - } - } - } - - if (isset($reverseColorTable[\intval($r)][\intval($g)][\intval($b)])) { - return $reverseColorTable[\intval($r)][\intval($g)][\intval($b)]; - } - - return null; - } -} diff --git a/vendor/scssphp/scssphp/src/CompilationResult.php b/vendor/scssphp/scssphp/src/CompilationResult.php deleted file mode 100644 index 36adb0da..00000000 --- a/vendor/scssphp/scssphp/src/CompilationResult.php +++ /dev/null @@ -1,69 +0,0 @@ -css = $css; - $this->sourceMap = $sourceMap; - $this->includedFiles = $includedFiles; - } - - /** - * @return string - */ - public function getCss() - { - return $this->css; - } - - /** - * @return string[] - */ - public function getIncludedFiles() - { - return $this->includedFiles; - } - - /** - * The sourceMap content, if it was generated - * - * @return null|string - */ - public function getSourceMap() - { - return $this->sourceMap; - } -} diff --git a/vendor/scssphp/scssphp/src/Compiler.php b/vendor/scssphp/scssphp/src/Compiler.php deleted file mode 100644 index b9d42bb1..00000000 --- a/vendor/scssphp/scssphp/src/Compiler.php +++ /dev/null @@ -1,10023 +0,0 @@ - - * - * @final Extending the Compiler is deprecated - */ -class Compiler -{ - /** - * @deprecated - */ - const LINE_COMMENTS = 1; - /** - * @deprecated - */ - const DEBUG_INFO = 2; - - /** - * @deprecated - */ - const WITH_RULE = 1; - /** - * @deprecated - */ - const WITH_MEDIA = 2; - /** - * @deprecated - */ - const WITH_SUPPORTS = 4; - /** - * @deprecated - */ - const WITH_ALL = 7; - - const SOURCE_MAP_NONE = 0; - const SOURCE_MAP_INLINE = 1; - const SOURCE_MAP_FILE = 2; - - /** - * @var array - */ - protected static $operatorNames = [ - '+' => 'add', - '-' => 'sub', - '*' => 'mul', - '/' => 'div', - '%' => 'mod', - - '==' => 'eq', - '!=' => 'neq', - '<' => 'lt', - '>' => 'gt', - - '<=' => 'lte', - '>=' => 'gte', - ]; - - /** - * @var array - */ - protected static $namespaces = [ - 'special' => '%', - 'mixin' => '@', - 'function' => '^', - ]; - - public static $true = [Type::T_KEYWORD, 'true']; - public static $false = [Type::T_KEYWORD, 'false']; - /** @deprecated */ - public static $NaN = [Type::T_KEYWORD, 'NaN']; - /** @deprecated */ - public static $Infinity = [Type::T_KEYWORD, 'Infinity']; - public static $null = [Type::T_NULL]; - public static $nullString = [Type::T_STRING, '', []]; - public static $defaultValue = [Type::T_KEYWORD, '']; - public static $selfSelector = [Type::T_SELF]; - public static $emptyList = [Type::T_LIST, '', []]; - public static $emptyMap = [Type::T_MAP, [], []]; - public static $emptyString = [Type::T_STRING, '"', []]; - public static $with = [Type::T_KEYWORD, 'with']; - public static $without = [Type::T_KEYWORD, 'without']; - - /** - * @var array - */ - protected $importPaths = []; - /** - * @var array - */ - protected $importCache = []; - - /** - * @var string[] - */ - protected $importedFiles = []; - - /** - * @var array - * @phpstan-var array - */ - protected $userFunctions = []; - /** - * @var array - */ - protected $registeredVars = []; - /** - * @var array - */ - protected $registeredFeatures = [ - 'extend-selector-pseudoclass' => false, - 'at-error' => true, - 'units-level-3' => true, - 'global-variable-shadowing' => false, - ]; - - /** - * @var string|null - */ - protected $encoding = null; - /** - * @var null - * @deprecated - */ - protected $lineNumberStyle = null; - - /** - * @var int|SourceMapGenerator - * @phpstan-var self::SOURCE_MAP_*|SourceMapGenerator - */ - protected $sourceMap = self::SOURCE_MAP_NONE; - - /** - * @var array - * @phpstan-var array{sourceRoot?: string, sourceMapFilename?: string|null, sourceMapURL?: string|null, sourceMapWriteTo?: string|null, outputSourceFiles?: bool, sourceMapRootpath?: string, sourceMapBasepath?: string} - */ - protected $sourceMapOptions = []; - - /** - * @var string|\ScssPhp\ScssPhp\Formatter - */ - protected $formatter = Expanded::class; - - /** - * @var Environment - */ - protected $rootEnv; - /** - * @var OutputBlock|null - */ - protected $rootBlock; - - /** - * @var \ScssPhp\ScssPhp\Compiler\Environment - */ - protected $env; - /** - * @var OutputBlock|null - */ - protected $scope; - /** - * @var Environment|null - */ - protected $storeEnv; - /** - * @var bool|null - */ - protected $charsetSeen; - /** - * @var array - */ - protected $sourceNames; - - /** - * @var Cache|null - */ - protected $cache; - - /** - * @var bool - */ - protected $cacheCheckImportResolutions = false; - - /** - * @var int - */ - protected $indentLevel; - /** - * @var array[] - */ - protected $extends; - /** - * @var array - */ - protected $extendsMap; - - /** - * @var array - */ - protected $parsedFiles = []; - - /** - * @var Parser|null - */ - protected $parser; - /** - * @var int|null - */ - protected $sourceIndex; - /** - * @var int|null - */ - protected $sourceLine; - /** - * @var int|null - */ - protected $sourceColumn; - /** - * @var bool|null - */ - protected $shouldEvaluate; - /** - * @var null - * @deprecated - */ - protected $ignoreErrors; - /** - * @var bool - */ - protected $ignoreCallStackMessage = false; - - /** - * @var array[] - */ - protected $callStack = []; - - /** - * @var array - * @phpstan-var list - */ - private $resolvedImports = []; - - /** - * The directory of the currently processed file - * - * @var string|null - */ - private $currentDirectory; - - /** - * The directory of the input file - * - * @var string - */ - private $rootDirectory; - - /** - * @var bool - */ - private $legacyCwdImportPath = true; - - /** - * @var LoggerInterface - */ - private $logger; - - /** - * @var array - */ - private $warnedChildFunctions = []; - - /** - * Constructor - * - * @param array|null $cacheOptions - * @phpstan-param array{cacheDir?: string, prefix?: string, forceRefresh?: string, checkImportResolutions?: bool}|null $cacheOptions - */ - public function __construct($cacheOptions = null) - { - $this->sourceNames = []; - - if ($cacheOptions) { - $this->cache = new Cache($cacheOptions); - if (!empty($cacheOptions['checkImportResolutions'])) { - $this->cacheCheckImportResolutions = true; - } - } - - $this->logger = new StreamLogger(fopen('php://stderr', 'w'), true); - } - - /** - * Get compiler options - * - * @return array - * - * @internal - */ - public function getCompileOptions() - { - $options = [ - 'importPaths' => $this->importPaths, - 'registeredVars' => $this->registeredVars, - 'registeredFeatures' => $this->registeredFeatures, - 'encoding' => $this->encoding, - 'sourceMap' => serialize($this->sourceMap), - 'sourceMapOptions' => $this->sourceMapOptions, - 'formatter' => $this->formatter, - 'legacyImportPath' => $this->legacyCwdImportPath, - ]; - - return $options; - } - - /** - * Sets an alternative logger. - * - * Changing the logger in the middle of the compilation is not - * supported and will result in an undefined behavior. - * - * @param LoggerInterface $logger - * - * @return void - */ - public function setLogger(LoggerInterface $logger) - { - $this->logger = $logger; - } - - /** - * Set an alternative error output stream, for testing purpose only - * - * @param resource $handle - * - * @return void - * - * @deprecated Use {@see setLogger} instead - */ - public function setErrorOuput($handle) - { - @trigger_error('The method "setErrorOuput" is deprecated. Use "setLogger" instead.', E_USER_DEPRECATED); - - $this->logger = new StreamLogger($handle); - } - - /** - * Compile scss - * - * @param string $code - * @param string|null $path - * - * @return string - * - * @throws SassException when the source fails to compile - * - * @deprecated Use {@see compileString} instead. - */ - public function compile($code, $path = null) - { - @trigger_error(sprintf('The "%s" method is deprecated. Use "compileString" instead.', __METHOD__), E_USER_DEPRECATED); - - $result = $this->compileString($code, $path); - - $sourceMap = $result->getSourceMap(); - - if ($sourceMap !== null) { - if ($this->sourceMap instanceof SourceMapGenerator) { - $this->sourceMap->saveMap($sourceMap); - } elseif ($this->sourceMap === self::SOURCE_MAP_FILE) { - $sourceMapGenerator = new SourceMapGenerator($this->sourceMapOptions); - $sourceMapGenerator->saveMap($sourceMap); - } - } - - return $result->getCss(); - } - - /** - * Compile scss - * - * @param string $source - * @param string|null $path - * - * @return CompilationResult - * - * @throws SassException when the source fails to compile - */ - public function compileString($source, $path = null) - { - if ($this->cache) { - $cacheKey = ($path ? $path : '(stdin)') . ':' . md5($source); - $compileOptions = $this->getCompileOptions(); - $cachedResult = $this->cache->getCache('compile', $cacheKey, $compileOptions); - - if ($cachedResult instanceof CachedResult && $this->isFreshCachedResult($cachedResult)) { - return $cachedResult->getResult(); - } - } - - $this->indentLevel = -1; - $this->extends = []; - $this->extendsMap = []; - $this->sourceIndex = null; - $this->sourceLine = null; - $this->sourceColumn = null; - $this->env = null; - $this->scope = null; - $this->storeEnv = null; - $this->charsetSeen = null; - $this->shouldEvaluate = null; - $this->ignoreCallStackMessage = false; - $this->parsedFiles = []; - $this->importedFiles = []; - $this->resolvedImports = []; - - if (!\is_null($path) && is_file($path)) { - $path = realpath($path) ?: $path; - $this->currentDirectory = dirname($path); - $this->rootDirectory = $this->currentDirectory; - } else { - $this->currentDirectory = null; - $this->rootDirectory = getcwd(); - } - - try { - $this->parser = $this->parserFactory($path); - $tree = $this->parser->parse($source); - $this->parser = null; - - $this->formatter = new $this->formatter(); - $this->rootBlock = null; - $this->rootEnv = $this->pushEnv($tree); - - $warnCallback = function ($message, $deprecation) { - $this->logger->warn($message, $deprecation); - }; - $previousWarnCallback = Warn::setCallback($warnCallback); - - try { - $this->injectVariables($this->registeredVars); - $this->compileRoot($tree); - $this->popEnv(); - } finally { - Warn::setCallback($previousWarnCallback); - } - - $sourceMapGenerator = null; - - if ($this->sourceMap) { - if (\is_object($this->sourceMap) && $this->sourceMap instanceof SourceMapGenerator) { - $sourceMapGenerator = $this->sourceMap; - $this->sourceMap = self::SOURCE_MAP_FILE; - } elseif ($this->sourceMap !== self::SOURCE_MAP_NONE) { - $sourceMapGenerator = new SourceMapGenerator($this->sourceMapOptions); - } - } - - $out = $this->formatter->format($this->scope, $sourceMapGenerator); - - $prefix = ''; - - if (!$this->charsetSeen) { - if (strlen($out) !== Util::mbStrlen($out)) { - $prefix = '@charset "UTF-8";' . "\n"; - $out = $prefix . $out; - } - } - - $sourceMap = null; - - if (! empty($out) && $this->sourceMap && $this->sourceMap !== self::SOURCE_MAP_NONE) { - $sourceMap = $sourceMapGenerator->generateJson($prefix); - $sourceMapUrl = null; - - switch ($this->sourceMap) { - case self::SOURCE_MAP_INLINE: - $sourceMapUrl = sprintf('data:application/json,%s', Util::encodeURIComponent($sourceMap)); - break; - - case self::SOURCE_MAP_FILE: - if (isset($this->sourceMapOptions['sourceMapURL'])) { - $sourceMapUrl = $this->sourceMapOptions['sourceMapURL']; - } - break; - } - - if ($sourceMapUrl !== null) { - $out .= sprintf('/*# sourceMappingURL=%s */', $sourceMapUrl); - } - } - } catch (SassScriptException $e) { - throw new CompilerException($this->addLocationToMessage($e->getMessage()), 0, $e); - } - - $includedFiles = []; - - foreach ($this->resolvedImports as $resolvedImport) { - $includedFiles[$resolvedImport['filePath']] = $resolvedImport['filePath']; - } - - $result = new CompilationResult($out, $sourceMap, array_values($includedFiles)); - - if ($this->cache && isset($cacheKey) && isset($compileOptions)) { - $this->cache->setCache('compile', $cacheKey, new CachedResult($result, $this->parsedFiles, $this->resolvedImports), $compileOptions); - } - - // Reset state to free memory - // TODO in 2.0, reset parsedFiles as well when the getter is removed. - $this->resolvedImports = []; - $this->importedFiles = []; - - return $result; - } - - /** - * @param CachedResult $result - * - * @return bool - */ - private function isFreshCachedResult(CachedResult $result) - { - // check if any dependency file changed since the result was compiled - foreach ($result->getParsedFiles() as $file => $mtime) { - if (! is_file($file) || filemtime($file) !== $mtime) { - return false; - } - } - - if ($this->cacheCheckImportResolutions) { - $resolvedImports = []; - - foreach ($result->getResolvedImports() as $import) { - $currentDir = $import['currentDir']; - $path = $import['path']; - // store the check across all the results in memory to avoid multiple findImport() on the same path - // with same context. - // this is happening in a same hit with multiple compilations (especially with big frameworks) - if (empty($resolvedImports[$currentDir][$path])) { - $resolvedImports[$currentDir][$path] = $this->findImport($path, $currentDir); - } - - if ($resolvedImports[$currentDir][$path] !== $import['filePath']) { - return false; - } - } - } - - return true; - } - - /** - * Instantiate parser - * - * @param string|null $path - * - * @return \ScssPhp\ScssPhp\Parser - */ - protected function parserFactory($path) - { - // https://sass-lang.com/documentation/at-rules/import - // CSS files imported by Sass don’t allow any special Sass features. - // In order to make sure authors don’t accidentally write Sass in their CSS, - // all Sass features that aren’t also valid CSS will produce errors. - // Otherwise, the CSS will be rendered as-is. It can even be extended! - $cssOnly = false; - - if ($path !== null && substr($path, -4) === '.css') { - $cssOnly = true; - } - - $parser = new Parser($path, \count($this->sourceNames), $this->encoding, $this->cache, $cssOnly, $this->logger); - - $this->sourceNames[] = $path; - $this->addParsedFile($path); - - return $parser; - } - - /** - * Is self extend? - * - * @param array $target - * @param array $origin - * - * @return boolean - */ - protected function isSelfExtend($target, $origin) - { - foreach ($origin as $sel) { - if (\in_array($target, $sel)) { - return true; - } - } - - return false; - } - - /** - * Push extends - * - * @param array $target - * @param array $origin - * @param array|null $block - * - * @return void - */ - protected function pushExtends($target, $origin, $block) - { - $i = \count($this->extends); - $this->extends[] = [$target, $origin, $block]; - - foreach ($target as $part) { - if (isset($this->extendsMap[$part])) { - $this->extendsMap[$part][] = $i; - } else { - $this->extendsMap[$part] = [$i]; - } - } - } - - /** - * Make output block - * - * @param string|null $type - * @param string[]|null $selectors - * - * @return \ScssPhp\ScssPhp\Formatter\OutputBlock - */ - protected function makeOutputBlock($type, $selectors = null) - { - $out = new OutputBlock(); - $out->type = $type; - $out->lines = []; - $out->children = []; - $out->parent = $this->scope; - $out->selectors = $selectors; - $out->depth = $this->env->depth; - - if ($this->env->block instanceof Block) { - $out->sourceName = $this->env->block->sourceName; - $out->sourceLine = $this->env->block->sourceLine; - $out->sourceColumn = $this->env->block->sourceColumn; - } else { - $out->sourceName = null; - $out->sourceLine = null; - $out->sourceColumn = null; - } - - return $out; - } - - /** - * Compile root - * - * @param \ScssPhp\ScssPhp\Block $rootBlock - * - * @return void - */ - protected function compileRoot(Block $rootBlock) - { - $this->rootBlock = $this->scope = $this->makeOutputBlock(Type::T_ROOT); - - $this->compileChildrenNoReturn($rootBlock->children, $this->scope); - $this->flattenSelectors($this->scope); - $this->missingSelectors(); - } - - /** - * Report missing selectors - * - * @return void - */ - protected function missingSelectors() - { - foreach ($this->extends as $extend) { - if (isset($extend[3])) { - continue; - } - - list($target, $origin, $block) = $extend; - - // ignore if !optional - if ($block[2]) { - continue; - } - - $target = implode(' ', $target); - $origin = $this->collapseSelectors($origin); - - $this->sourceLine = $block[Parser::SOURCE_LINE]; - throw $this->error("\"$origin\" failed to @extend \"$target\". The selector \"$target\" was not found."); - } - } - - /** - * Flatten selectors - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block - * @param string $parentKey - * - * @return void - */ - protected function flattenSelectors(OutputBlock $block, $parentKey = null) - { - if ($block->selectors) { - $selectors = []; - - foreach ($block->selectors as $s) { - $selectors[] = $s; - - if (! \is_array($s)) { - continue; - } - - // check extends - if (! empty($this->extendsMap)) { - $this->matchExtends($s, $selectors); - - // remove duplicates - array_walk($selectors, function (&$value) { - $value = serialize($value); - }); - - $selectors = array_unique($selectors); - - array_walk($selectors, function (&$value) { - $value = unserialize($value); - }); - } - } - - $block->selectors = []; - $placeholderSelector = false; - - foreach ($selectors as $selector) { - if ($this->hasSelectorPlaceholder($selector)) { - $placeholderSelector = true; - continue; - } - - $block->selectors[] = $this->compileSelector($selector); - } - - if ($placeholderSelector && 0 === \count($block->selectors) && null !== $parentKey) { - unset($block->parent->children[$parentKey]); - - return; - } - } - - foreach ($block->children as $key => $child) { - $this->flattenSelectors($child, $key); - } - } - - /** - * Glue parts of :not( or :nth-child( ... that are in general split in selectors parts - * - * @param array $parts - * - * @return array - */ - protected function glueFunctionSelectors($parts) - { - $new = []; - - foreach ($parts as $part) { - if (\is_array($part)) { - $part = $this->glueFunctionSelectors($part); - $new[] = $part; - } else { - // a selector part finishing with a ) is the last part of a :not( or :nth-child( - // and need to be joined to this - if ( - \count($new) && \is_string($new[\count($new) - 1]) && - \strlen($part) && substr($part, -1) === ')' && strpos($part, '(') === false - ) { - while (\count($new) > 1 && substr($new[\count($new) - 1], -1) !== '(') { - $part = array_pop($new) . $part; - } - $new[\count($new) - 1] .= $part; - } else { - $new[] = $part; - } - } - } - - return $new; - } - - /** - * Match extends - * - * @param array $selector - * @param array $out - * @param integer $from - * @param boolean $initial - * - * @return void - */ - protected function matchExtends($selector, &$out, $from = 0, $initial = true) - { - static $partsPile = []; - $selector = $this->glueFunctionSelectors($selector); - - if (\count($selector) == 1 && \in_array(reset($selector), $partsPile)) { - return; - } - - $outRecurs = []; - - foreach ($selector as $i => $part) { - if ($i < $from) { - continue; - } - - // check that we are not building an infinite loop of extensions - // if the new part is just including a previous part don't try to extend anymore - if (\count($part) > 1) { - foreach ($partsPile as $previousPart) { - if (! \count(array_diff($previousPart, $part))) { - continue 2; - } - } - } - - $partsPile[] = $part; - - if ($this->matchExtendsSingle($part, $origin, $initial)) { - $after = \array_slice($selector, $i + 1); - $before = \array_slice($selector, 0, $i); - list($before, $nonBreakableBefore) = $this->extractRelationshipFromFragment($before); - - foreach ($origin as $new) { - $k = 0; - - // remove shared parts - if (\count($new) > 1) { - while ($k < $i && isset($new[$k]) && $selector[$k] === $new[$k]) { - $k++; - } - } - - if (\count($nonBreakableBefore) && $k === \count($new)) { - $k--; - } - - $replacement = []; - $tempReplacement = $k > 0 ? \array_slice($new, $k) : $new; - - for ($l = \count($tempReplacement) - 1; $l >= 0; $l--) { - $slice = []; - - foreach ($tempReplacement[$l] as $chunk) { - if (! \in_array($chunk, $slice)) { - $slice[] = $chunk; - } - } - - array_unshift($replacement, $slice); - - if (! $this->isImmediateRelationshipCombinator(end($slice))) { - break; - } - } - - $afterBefore = $l != 0 ? \array_slice($tempReplacement, 0, $l) : []; - - // Merge shared direct relationships. - $mergedBefore = $this->mergeDirectRelationships($afterBefore, $nonBreakableBefore); - - $result = array_merge( - $before, - $mergedBefore, - $replacement, - $after - ); - - if ($result === $selector) { - continue; - } - - $this->pushOrMergeExtentedSelector($out, $result); - - // recursively check for more matches - $startRecurseFrom = \count($before) + min(\count($nonBreakableBefore), \count($mergedBefore)); - - if (\count($origin) > 1) { - $this->matchExtends($result, $out, $startRecurseFrom, false); - } else { - $this->matchExtends($result, $outRecurs, $startRecurseFrom, false); - } - - // selector sequence merging - if (! empty($before) && \count($new) > 1) { - $preSharedParts = $k > 0 ? \array_slice($before, 0, $k) : []; - $postSharedParts = $k > 0 ? \array_slice($before, $k) : $before; - - list($betweenSharedParts, $nonBreakabl2) = $this->extractRelationshipFromFragment($afterBefore); - - $result2 = array_merge( - $preSharedParts, - $betweenSharedParts, - $postSharedParts, - $nonBreakabl2, - $nonBreakableBefore, - $replacement, - $after - ); - - $this->pushOrMergeExtentedSelector($out, $result2); - } - } - } - array_pop($partsPile); - } - - while (\count($outRecurs)) { - $result = array_shift($outRecurs); - $this->pushOrMergeExtentedSelector($out, $result); - } - } - - /** - * Test a part for being a pseudo selector - * - * @param string $part - * @param array $matches - * - * @return boolean - */ - protected function isPseudoSelector($part, &$matches) - { - if ( - strpos($part, ':') === 0 && - preg_match(",^::?([\w-]+)\((.+)\)$,", $part, $matches) - ) { - return true; - } - - return false; - } - - /** - * Push extended selector except if - * - this is a pseudo selector - * - same as previous - * - in a white list - * in this case we merge the pseudo selector content - * - * @param array $out - * @param array $extended - * - * @return void - */ - protected function pushOrMergeExtentedSelector(&$out, $extended) - { - if (\count($out) && \count($extended) === 1 && \count(reset($extended)) === 1) { - $single = reset($extended); - $part = reset($single); - - if ( - $this->isPseudoSelector($part, $matchesExtended) && - \in_array($matchesExtended[1], [ 'slotted' ]) - ) { - $prev = end($out); - $prev = $this->glueFunctionSelectors($prev); - - if (\count($prev) === 1 && \count(reset($prev)) === 1) { - $single = reset($prev); - $part = reset($single); - - if ( - $this->isPseudoSelector($part, $matchesPrev) && - $matchesPrev[1] === $matchesExtended[1] - ) { - $extended = explode($matchesExtended[1] . '(', $matchesExtended[0], 2); - $extended[1] = $matchesPrev[2] . ', ' . $extended[1]; - $extended = implode($matchesExtended[1] . '(', $extended); - $extended = [ [ $extended ]]; - array_pop($out); - } - } - } - } - $out[] = $extended; - } - - /** - * Match extends single - * - * @param array $rawSingle - * @param array $outOrigin - * @param boolean $initial - * - * @return boolean - */ - protected function matchExtendsSingle($rawSingle, &$outOrigin, $initial = true) - { - $counts = []; - $single = []; - - // simple usual cases, no need to do the whole trick - if (\in_array($rawSingle, [['>'],['+'],['~']])) { - return false; - } - - foreach ($rawSingle as $part) { - // matches Number - if (! \is_string($part)) { - return false; - } - - if (! preg_match('/^[\[.:#%]/', $part) && \count($single)) { - $single[\count($single) - 1] .= $part; - } else { - $single[] = $part; - } - } - - $extendingDecoratedTag = false; - - if (\count($single) > 1) { - $matches = null; - $extendingDecoratedTag = preg_match('/^[a-z0-9]+$/i', $single[0], $matches) ? $matches[0] : false; - } - - $outOrigin = []; - $found = false; - - foreach ($single as $k => $part) { - if (isset($this->extendsMap[$part])) { - foreach ($this->extendsMap[$part] as $idx) { - $counts[$idx] = isset($counts[$idx]) ? $counts[$idx] + 1 : 1; - } - } - - if ( - $initial && - $this->isPseudoSelector($part, $matches) && - ! \in_array($matches[1], [ 'not' ]) - ) { - $buffer = $matches[2]; - $parser = $this->parserFactory(__METHOD__); - - if ($parser->parseSelector($buffer, $subSelectors, false)) { - foreach ($subSelectors as $ksub => $subSelector) { - $subExtended = []; - $this->matchExtends($subSelector, $subExtended, 0, false); - - if ($subExtended) { - $subSelectorsExtended = $subSelectors; - $subSelectorsExtended[$ksub] = $subExtended; - - foreach ($subSelectorsExtended as $ksse => $sse) { - $subSelectorsExtended[$ksse] = $this->collapseSelectors($sse); - } - - $subSelectorsExtended = implode(', ', $subSelectorsExtended); - $singleExtended = $single; - $singleExtended[$k] = str_replace('(' . $buffer . ')', "($subSelectorsExtended)", $part); - $outOrigin[] = [ $singleExtended ]; - $found = true; - } - } - } - } - } - - foreach ($counts as $idx => $count) { - list($target, $origin, /* $block */) = $this->extends[$idx]; - - $origin = $this->glueFunctionSelectors($origin); - - // check count - if ($count !== \count($target)) { - continue; - } - - $this->extends[$idx][3] = true; - - $rem = array_diff($single, $target); - - foreach ($origin as $j => $new) { - // prevent infinite loop when target extends itself - if ($this->isSelfExtend($single, $origin) && ! $initial) { - return false; - } - - $replacement = end($new); - - // Extending a decorated tag with another tag is not possible. - if ( - $extendingDecoratedTag && $replacement[0] != $extendingDecoratedTag && - preg_match('/^[a-z0-9]+$/i', $replacement[0]) - ) { - unset($origin[$j]); - continue; - } - - $combined = $this->combineSelectorSingle($replacement, $rem); - - if (\count(array_diff($combined, $origin[$j][\count($origin[$j]) - 1]))) { - $origin[$j][\count($origin[$j]) - 1] = $combined; - } - } - - $outOrigin = array_merge($outOrigin, $origin); - - $found = true; - } - - return $found; - } - - /** - * Extract a relationship from the fragment. - * - * When extracting the last portion of a selector we will be left with a - * fragment which may end with a direction relationship combinator. This - * method will extract the relationship fragment and return it along side - * the rest. - * - * @param array $fragment The selector fragment maybe ending with a direction relationship combinator. - * - * @return array The selector without the relationship fragment if any, the relationship fragment. - */ - protected function extractRelationshipFromFragment(array $fragment) - { - $parents = []; - $children = []; - - $j = $i = \count($fragment); - - for (;;) { - $children = $j != $i ? \array_slice($fragment, $j, $i - $j) : []; - $parents = \array_slice($fragment, 0, $j); - $slice = end($parents); - - if (empty($slice) || ! $this->isImmediateRelationshipCombinator($slice[0])) { - break; - } - - $j -= 2; - } - - return [$parents, $children]; - } - - /** - * Combine selector single - * - * @param array $base - * @param array $other - * - * @return array - */ - protected function combineSelectorSingle($base, $other) - { - $tag = []; - $out = []; - $wasTag = false; - $pseudo = []; - - while (\count($other) && strpos(end($other), ':') === 0) { - array_unshift($pseudo, array_pop($other)); - } - - foreach ([array_reverse($base), array_reverse($other)] as $single) { - $rang = count($single); - - foreach ($single as $part) { - if (preg_match('/^[\[:]/', $part)) { - $out[] = $part; - $wasTag = false; - } elseif (preg_match('/^[\.#]/', $part)) { - array_unshift($out, $part); - $wasTag = false; - } elseif (preg_match('/^[^_-]/', $part) && $rang === 1) { - $tag[] = $part; - $wasTag = true; - } elseif ($wasTag) { - $tag[\count($tag) - 1] .= $part; - } else { - array_unshift($out, $part); - } - $rang--; - } - } - - if (\count($tag)) { - array_unshift($out, $tag[0]); - } - - while (\count($pseudo)) { - $out[] = array_shift($pseudo); - } - - return $out; - } - - /** - * Compile media - * - * @param \ScssPhp\ScssPhp\Block $media - * - * @return void - */ - protected function compileMedia(Block $media) - { - $this->pushEnv($media); - - $mediaQueries = $this->compileMediaQuery($this->multiplyMedia($this->env)); - - if (! empty($mediaQueries)) { - $previousScope = $this->scope; - $parentScope = $this->mediaParent($this->scope); - - foreach ($mediaQueries as $mediaQuery) { - $this->scope = $this->makeOutputBlock(Type::T_MEDIA, [$mediaQuery]); - - $parentScope->children[] = $this->scope; - $parentScope = $this->scope; - } - - // top level properties in a media cause it to be wrapped - $needsWrap = false; - - foreach ($media->children as $child) { - $type = $child[0]; - - if ( - $type !== Type::T_BLOCK && - $type !== Type::T_MEDIA && - $type !== Type::T_DIRECTIVE && - $type !== Type::T_IMPORT - ) { - $needsWrap = true; - break; - } - } - - if ($needsWrap) { - $wrapped = new Block(); - $wrapped->sourceName = $media->sourceName; - $wrapped->sourceIndex = $media->sourceIndex; - $wrapped->sourceLine = $media->sourceLine; - $wrapped->sourceColumn = $media->sourceColumn; - $wrapped->selectors = []; - $wrapped->comments = []; - $wrapped->parent = $media; - $wrapped->children = $media->children; - - $media->children = [[Type::T_BLOCK, $wrapped]]; - } - - $this->compileChildrenNoReturn($media->children, $this->scope); - - $this->scope = $previousScope; - } - - $this->popEnv(); - } - - /** - * Media parent - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $scope - * - * @return \ScssPhp\ScssPhp\Formatter\OutputBlock - */ - protected function mediaParent(OutputBlock $scope) - { - while (! empty($scope->parent)) { - if (! empty($scope->type) && $scope->type !== Type::T_MEDIA) { - break; - } - - $scope = $scope->parent; - } - - return $scope; - } - - /** - * Compile directive - * - * @param \ScssPhp\ScssPhp\Block|array $directive - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out - * - * @return void - */ - protected function compileDirective($directive, OutputBlock $out) - { - if (\is_array($directive)) { - $directiveName = $this->compileDirectiveName($directive[0]); - $s = '@' . $directiveName; - - if (! empty($directive[1])) { - $s .= ' ' . $this->compileValue($directive[1]); - } - // sass-spec compliance on newline after directives, a bit tricky :/ - $appendNewLine = (! empty($directive[2]) || strpos($s, "\n")) ? "\n" : ""; - if (\is_array($directive[0]) && empty($directive[1])) { - $appendNewLine = "\n"; - } - - if (empty($directive[3])) { - $this->appendRootDirective($s . ';' . $appendNewLine, $out, [Type::T_COMMENT, Type::T_DIRECTIVE]); - } else { - $this->appendOutputLine($out, Type::T_DIRECTIVE, $s . ';'); - } - } else { - $directive->name = $this->compileDirectiveName($directive->name); - $s = '@' . $directive->name; - - if (! empty($directive->value)) { - $s .= ' ' . $this->compileValue($directive->value); - } - - if ($directive->name === 'keyframes' || substr($directive->name, -10) === '-keyframes') { - $this->compileKeyframeBlock($directive, [$s]); - } else { - $this->compileNestedBlock($directive, [$s]); - } - } - } - - /** - * directive names can include some interpolation - * - * @param string|array $directiveName - * @return string - * @throws CompilerException - */ - protected function compileDirectiveName($directiveName) - { - if (is_string($directiveName)) { - return $directiveName; - } - - return $this->compileValue($directiveName); - } - - /** - * Compile at-root - * - * @param \ScssPhp\ScssPhp\Block $block - * - * @return void - */ - protected function compileAtRoot(Block $block) - { - $env = $this->pushEnv($block); - $envs = $this->compactEnv($env); - list($with, $without) = $this->compileWith(isset($block->with) ? $block->with : null); - - // wrap inline selector - if ($block->selector) { - $wrapped = new Block(); - $wrapped->sourceName = $block->sourceName; - $wrapped->sourceIndex = $block->sourceIndex; - $wrapped->sourceLine = $block->sourceLine; - $wrapped->sourceColumn = $block->sourceColumn; - $wrapped->selectors = $block->selector; - $wrapped->comments = []; - $wrapped->parent = $block; - $wrapped->children = $block->children; - $wrapped->selfParent = $block->selfParent; - - $block->children = [[Type::T_BLOCK, $wrapped]]; - $block->selector = null; - } - - $selfParent = $block->selfParent; - assert($selfParent !== null, 'at-root blocks must have a selfParent set.'); - - if ( - ! $selfParent->selectors && - isset($block->parent) && $block->parent && - isset($block->parent->selectors) && $block->parent->selectors - ) { - $selfParent = $block->parent; - } - - $this->env = $this->filterWithWithout($envs, $with, $without); - - $saveScope = $this->scope; - $this->scope = $this->filterScopeWithWithout($saveScope, $with, $without); - - // propagate selfParent to the children where they still can be useful - $this->compileChildrenNoReturn($block->children, $this->scope, $selfParent); - - $this->scope = $this->completeScope($this->scope, $saveScope); - $this->scope = $saveScope; - $this->env = $this->extractEnv($envs); - - $this->popEnv(); - } - - /** - * Filter at-root scope depending of with/without option - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $scope - * @param array $with - * @param array $without - * - * @return OutputBlock - */ - protected function filterScopeWithWithout($scope, $with, $without) - { - $filteredScopes = []; - $childStash = []; - - if ($scope->type === Type::T_ROOT) { - return $scope; - } - - // start from the root - while ($scope->parent && $scope->parent->type !== Type::T_ROOT) { - array_unshift($childStash, $scope); - $scope = $scope->parent; - } - - for (;;) { - if (! $scope) { - break; - } - - if ($this->isWith($scope, $with, $without)) { - $s = clone $scope; - $s->children = []; - $s->lines = []; - $s->parent = null; - - if ($s->type !== Type::T_MEDIA && $s->type !== Type::T_DIRECTIVE) { - $s->selectors = []; - } - - $filteredScopes[] = $s; - } - - if (\count($childStash)) { - $scope = array_shift($childStash); - } elseif ($scope->children) { - $scope = end($scope->children); - } else { - $scope = null; - } - } - - if (! \count($filteredScopes)) { - return $this->rootBlock; - } - - $newScope = array_shift($filteredScopes); - $newScope->parent = $this->rootBlock; - - $this->rootBlock->children[] = $newScope; - - $p = &$newScope; - - while (\count($filteredScopes)) { - $s = array_shift($filteredScopes); - $s->parent = $p; - $p->children[] = $s; - $newScope = &$p->children[0]; - $p = &$p->children[0]; - } - - return $newScope; - } - - /** - * found missing selector from a at-root compilation in the previous scope - * (if at-root is just enclosing a property, the selector is in the parent tree) - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $scope - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $previousScope - * - * @return OutputBlock - */ - protected function completeScope($scope, $previousScope) - { - if (! $scope->type && (! $scope->selectors || ! \count($scope->selectors)) && \count($scope->lines)) { - $scope->selectors = $this->findScopeSelectors($previousScope, $scope->depth); - } - - if ($scope->children) { - foreach ($scope->children as $k => $c) { - $scope->children[$k] = $this->completeScope($c, $previousScope); - } - } - - return $scope; - } - - /** - * Find a selector by the depth node in the scope - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $scope - * @param integer $depth - * - * @return array - */ - protected function findScopeSelectors($scope, $depth) - { - if ($scope->depth === $depth && $scope->selectors) { - return $scope->selectors; - } - - if ($scope->children) { - foreach (array_reverse($scope->children) as $c) { - if ($s = $this->findScopeSelectors($c, $depth)) { - return $s; - } - } - } - - return []; - } - - /** - * Compile @at-root's with: inclusion / without: exclusion into 2 lists uses to filter scope/env later - * - * @param array $withCondition - * - * @return array - */ - protected function compileWith($withCondition) - { - // just compile what we have in 2 lists - $with = []; - $without = ['rule' => true]; - - if ($withCondition) { - if ($withCondition[0] === Type::T_INTERPOLATE) { - $w = $this->compileValue($withCondition); - - $buffer = "($w)"; - $parser = $this->parserFactory(__METHOD__); - - if ($parser->parseValue($buffer, $reParsedWith)) { - $withCondition = $reParsedWith; - } - } - - if ($this->mapHasKey($withCondition, static::$with)) { - $without = []; // cancel the default - $list = $this->coerceList($this->libMapGet([$withCondition, static::$with])); - - foreach ($list[2] as $item) { - $keyword = $this->compileStringContent($this->coerceString($item)); - - $with[$keyword] = true; - } - } - - if ($this->mapHasKey($withCondition, static::$without)) { - $without = []; // cancel the default - $list = $this->coerceList($this->libMapGet([$withCondition, static::$without])); - - foreach ($list[2] as $item) { - $keyword = $this->compileStringContent($this->coerceString($item)); - - $without[$keyword] = true; - } - } - } - - return [$with, $without]; - } - - /** - * Filter env stack - * - * @param Environment[] $envs - * @param array $with - * @param array $without - * - * @return Environment - * - * @phpstan-param non-empty-array $envs - */ - protected function filterWithWithout($envs, $with, $without) - { - $filtered = []; - - foreach ($envs as $e) { - if ($e->block && ! $this->isWith($e->block, $with, $without)) { - $ec = clone $e; - $ec->block = null; - $ec->selectors = []; - - $filtered[] = $ec; - } else { - $filtered[] = $e; - } - } - - return $this->extractEnv($filtered); - } - - /** - * Filter WITH rules - * - * @param \ScssPhp\ScssPhp\Block|\ScssPhp\ScssPhp\Formatter\OutputBlock $block - * @param array $with - * @param array $without - * - * @return boolean - */ - protected function isWith($block, $with, $without) - { - if (isset($block->type)) { - if ($block->type === Type::T_MEDIA) { - return $this->testWithWithout('media', $with, $without); - } - - if ($block->type === Type::T_DIRECTIVE) { - if (isset($block->name)) { - return $this->testWithWithout($this->compileDirectiveName($block->name), $with, $without); - } elseif (isset($block->selectors) && preg_match(',@(\w+),ims', json_encode($block->selectors), $m)) { - return $this->testWithWithout($m[1], $with, $without); - } else { - return $this->testWithWithout('???', $with, $without); - } - } - } elseif (isset($block->selectors)) { - // a selector starting with number is a keyframe rule - if (\count($block->selectors)) { - $s = reset($block->selectors); - - while (\is_array($s)) { - $s = reset($s); - } - - if (\is_object($s) && $s instanceof Number) { - return $this->testWithWithout('keyframes', $with, $without); - } - } - - return $this->testWithWithout('rule', $with, $without); - } - - return true; - } - - /** - * Test a single type of block against with/without lists - * - * @param string $what - * @param array $with - * @param array $without - * - * @return boolean - * true if the block should be kept, false to reject - */ - protected function testWithWithout($what, $with, $without) - { - // if without, reject only if in the list (or 'all' is in the list) - if (\count($without)) { - return (isset($without[$what]) || isset($without['all'])) ? false : true; - } - - // otherwise reject all what is not in the with list - return (isset($with[$what]) || isset($with['all'])) ? true : false; - } - - - /** - * Compile keyframe block - * - * @param \ScssPhp\ScssPhp\Block $block - * @param string[] $selectors - * - * @return void - */ - protected function compileKeyframeBlock(Block $block, $selectors) - { - $env = $this->pushEnv($block); - - $envs = $this->compactEnv($env); - - $this->env = $this->extractEnv(array_filter($envs, function (Environment $e) { - return ! isset($e->block->selectors); - })); - - $this->scope = $this->makeOutputBlock($block->type, $selectors); - $this->scope->depth = 1; - $this->scope->parent->children[] = $this->scope; - - $this->compileChildrenNoReturn($block->children, $this->scope); - - $this->scope = $this->scope->parent; - $this->env = $this->extractEnv($envs); - - $this->popEnv(); - } - - /** - * Compile nested properties lines - * - * @param \ScssPhp\ScssPhp\Block $block - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out - * - * @return void - */ - protected function compileNestedPropertiesBlock(Block $block, OutputBlock $out) - { - $prefix = $this->compileValue($block->prefix) . '-'; - - $nested = $this->makeOutputBlock($block->type); - $nested->parent = $out; - - if ($block->hasValue) { - $nested->depth = $out->depth + 1; - } - - $out->children[] = $nested; - - foreach ($block->children as $child) { - switch ($child[0]) { - case Type::T_ASSIGN: - array_unshift($child[1][2], $prefix); - break; - - case Type::T_NESTED_PROPERTY: - array_unshift($child[1]->prefix[2], $prefix); - break; - } - - $this->compileChild($child, $nested); - } - } - - /** - * Compile nested block - * - * @param \ScssPhp\ScssPhp\Block $block - * @param string[] $selectors - * - * @return void - */ - protected function compileNestedBlock(Block $block, $selectors) - { - $this->pushEnv($block); - - $this->scope = $this->makeOutputBlock($block->type, $selectors); - $this->scope->parent->children[] = $this->scope; - - // wrap assign children in a block - // except for @font-face - if ($block->type !== Type::T_DIRECTIVE || $this->compileDirectiveName($block->name) !== 'font-face') { - // need wrapping? - $needWrapping = false; - - foreach ($block->children as $child) { - if ($child[0] === Type::T_ASSIGN) { - $needWrapping = true; - break; - } - } - - if ($needWrapping) { - $wrapped = new Block(); - $wrapped->sourceName = $block->sourceName; - $wrapped->sourceIndex = $block->sourceIndex; - $wrapped->sourceLine = $block->sourceLine; - $wrapped->sourceColumn = $block->sourceColumn; - $wrapped->selectors = []; - $wrapped->comments = []; - $wrapped->parent = $block; - $wrapped->children = $block->children; - $wrapped->selfParent = $block->selfParent; - - $block->children = [[Type::T_BLOCK, $wrapped]]; - } - } - - $this->compileChildrenNoReturn($block->children, $this->scope); - - $this->scope = $this->scope->parent; - - $this->popEnv(); - } - - /** - * Recursively compiles a block. - * - * A block is analogous to a CSS block in most cases. A single SCSS document - * is encapsulated in a block when parsed, but it does not have parent tags - * so all of its children appear on the root level when compiled. - * - * Blocks are made up of selectors and children. - * - * The children of a block are just all the blocks that are defined within. - * - * Compiling the block involves pushing a fresh environment on the stack, - * and iterating through the props, compiling each one. - * - * @see Compiler::compileChild() - * - * @param \ScssPhp\ScssPhp\Block $block - * - * @return void - */ - protected function compileBlock(Block $block) - { - $env = $this->pushEnv($block); - $env->selectors = $this->evalSelectors($block->selectors); - - $out = $this->makeOutputBlock(null); - - $this->scope->children[] = $out; - - if (\count($block->children)) { - $out->selectors = $this->multiplySelectors($env, $block->selfParent); - - // propagate selfParent to the children where they still can be useful - $selfParentSelectors = null; - - if (isset($block->selfParent->selectors)) { - $selfParentSelectors = $block->selfParent->selectors; - $block->selfParent->selectors = $out->selectors; - } - - $this->compileChildrenNoReturn($block->children, $out, $block->selfParent); - - // and revert for the following children of the same block - if ($selfParentSelectors) { - $block->selfParent->selectors = $selfParentSelectors; - } - } - - $this->popEnv(); - } - - - /** - * Compile the value of a comment that can have interpolation - * - * @param array $value - * @param boolean $pushEnv - * - * @return string - */ - protected function compileCommentValue($value, $pushEnv = false) - { - $c = $value[1]; - - if (isset($value[2])) { - if ($pushEnv) { - $this->pushEnv(); - } - - try { - $c = $this->compileValue($value[2]); - } catch (SassScriptException $e) { - $this->logger->warn('Ignoring interpolation errors in multiline comments is deprecated and will be removed in ScssPhp 2.0. ' . $this->addLocationToMessage($e->getMessage()), true); - // ignore error in comment compilation which are only interpolation - } catch (SassException $e) { - $this->logger->warn('Ignoring interpolation errors in multiline comments is deprecated and will be removed in ScssPhp 2.0. ' . $e->getMessage(), true); - // ignore error in comment compilation which are only interpolation - } - - if ($pushEnv) { - $this->popEnv(); - } - } - - return $c; - } - - /** - * Compile root level comment - * - * @param array $block - * - * @return void - */ - protected function compileComment($block) - { - $out = $this->makeOutputBlock(Type::T_COMMENT); - $out->lines[] = $this->compileCommentValue($block, true); - - $this->scope->children[] = $out; - } - - /** - * Evaluate selectors - * - * @param array $selectors - * - * @return array - */ - protected function evalSelectors($selectors) - { - $this->shouldEvaluate = false; - - $selectors = array_map([$this, 'evalSelector'], $selectors); - - // after evaluating interpolates, we might need a second pass - if ($this->shouldEvaluate) { - $selectors = $this->replaceSelfSelector($selectors, '&'); - $buffer = $this->collapseSelectors($selectors); - $parser = $this->parserFactory(__METHOD__); - - try { - $isValid = $parser->parseSelector($buffer, $newSelectors, true); - } catch (ParserException $e) { - throw $this->error($e->getMessage()); - } - - if ($isValid) { - $selectors = array_map([$this, 'evalSelector'], $newSelectors); - } - } - - return $selectors; - } - - /** - * Evaluate selector - * - * @param array $selector - * - * @return array - */ - protected function evalSelector($selector) - { - return array_map([$this, 'evalSelectorPart'], $selector); - } - - /** - * Evaluate selector part; replaces all the interpolates, stripping quotes - * - * @param array $part - * - * @return array - */ - protected function evalSelectorPart($part) - { - foreach ($part as &$p) { - if (\is_array($p) && ($p[0] === Type::T_INTERPOLATE || $p[0] === Type::T_STRING)) { - $p = $this->compileValue($p); - - // force re-evaluation if self char or non standard char - if (preg_match(',[^\w-],', $p)) { - $this->shouldEvaluate = true; - } - } elseif ( - \is_string($p) && \strlen($p) >= 2 && - ($first = $p[0]) && ($first === '"' || $first === "'") && - substr($p, -1) === $first - ) { - $p = substr($p, 1, -1); - } - } - - return $this->flattenSelectorSingle($part); - } - - /** - * Collapse selectors - * - * @param array $selectors - * - * @return string - */ - protected function collapseSelectors($selectors) - { - $parts = []; - - foreach ($selectors as $selector) { - $output = []; - - foreach ($selector as $node) { - $compound = ''; - - array_walk_recursive( - $node, - function ($value, $key) use (&$compound) { - $compound .= $value; - } - ); - - $output[] = $compound; - } - - $parts[] = implode(' ', $output); - } - - return implode(', ', $parts); - } - - /** - * Collapse selectors - * - * @param array $selectors - * - * @return array - */ - private function collapseSelectorsAsList($selectors) - { - $parts = []; - - foreach ($selectors as $selector) { - $output = []; - $glueNext = false; - - foreach ($selector as $node) { - $compound = ''; - - array_walk_recursive( - $node, - function ($value, $key) use (&$compound) { - $compound .= $value; - } - ); - - if ($this->isImmediateRelationshipCombinator($compound)) { - if (\count($output)) { - $output[\count($output) - 1] .= ' ' . $compound; - } else { - $output[] = $compound; - } - - $glueNext = true; - } elseif ($glueNext) { - $output[\count($output) - 1] .= ' ' . $compound; - $glueNext = false; - } else { - $output[] = $compound; - } - } - - foreach ($output as &$o) { - $o = [Type::T_STRING, '', [$o]]; - } - - $parts[] = [Type::T_LIST, ' ', $output]; - } - - return [Type::T_LIST, ',', $parts]; - } - - /** - * Parse down the selector and revert [self] to "&" before a reparsing - * - * @param array $selectors - * @param string|null $replace - * - * @return array - */ - protected function replaceSelfSelector($selectors, $replace = null) - { - foreach ($selectors as &$part) { - if (\is_array($part)) { - if ($part === [Type::T_SELF]) { - if (\is_null($replace)) { - $replace = $this->reduce([Type::T_SELF]); - $replace = $this->compileValue($replace); - } - $part = $replace; - } else { - $part = $this->replaceSelfSelector($part, $replace); - } - } - } - - return $selectors; - } - - /** - * Flatten selector single; joins together .classes and #ids - * - * @param array $single - * - * @return array - */ - protected function flattenSelectorSingle($single) - { - $joined = []; - - foreach ($single as $part) { - if ( - empty($joined) || - ! \is_string($part) || - preg_match('/[\[.:#%]/', $part) - ) { - $joined[] = $part; - continue; - } - - if (\is_array(end($joined))) { - $joined[] = $part; - } else { - $joined[\count($joined) - 1] .= $part; - } - } - - return $joined; - } - - /** - * Compile selector to string; self(&) should have been replaced by now - * - * @param string|array $selector - * - * @return string - */ - protected function compileSelector($selector) - { - if (! \is_array($selector)) { - return $selector; // media and the like - } - - return implode( - ' ', - array_map( - [$this, 'compileSelectorPart'], - $selector - ) - ); - } - - /** - * Compile selector part - * - * @param array $piece - * - * @return string - */ - protected function compileSelectorPart($piece) - { - foreach ($piece as &$p) { - if (! \is_array($p)) { - continue; - } - - switch ($p[0]) { - case Type::T_SELF: - $p = '&'; - break; - - default: - $p = $this->compileValue($p); - break; - } - } - - return implode($piece); - } - - /** - * Has selector placeholder? - * - * @param array $selector - * - * @return boolean - */ - protected function hasSelectorPlaceholder($selector) - { - if (! \is_array($selector)) { - return false; - } - - foreach ($selector as $parts) { - foreach ($parts as $part) { - if (\strlen($part) && '%' === $part[0]) { - return true; - } - } - } - - return false; - } - - /** - * @param string $name - * - * @return void - */ - protected function pushCallStack($name = '') - { - $this->callStack[] = [ - 'n' => $name, - Parser::SOURCE_INDEX => $this->sourceIndex, - Parser::SOURCE_LINE => $this->sourceLine, - Parser::SOURCE_COLUMN => $this->sourceColumn - ]; - - // infinite calling loop - if (\count($this->callStack) > 25000) { - // not displayed but you can var_dump it to deep debug - $msg = $this->callStackMessage(true, 100); - $msg = 'Infinite calling loop'; - - throw $this->error($msg); - } - } - - /** - * @return void - */ - protected function popCallStack() - { - array_pop($this->callStack); - } - - /** - * Compile children and return result - * - * @param array $stms - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out - * @param string $traceName - * - * @return array|Number|null - */ - protected function compileChildren($stms, OutputBlock $out, $traceName = '') - { - $this->pushCallStack($traceName); - - foreach ($stms as $stm) { - $ret = $this->compileChild($stm, $out); - - if (isset($ret)) { - $this->popCallStack(); - - return $ret; - } - } - - $this->popCallStack(); - - return null; - } - - /** - * Compile children and throw exception if unexpected `@return` - * - * @param array $stms - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out - * @param \ScssPhp\ScssPhp\Block $selfParent - * @param string $traceName - * - * @return void - * - * @throws \Exception - */ - protected function compileChildrenNoReturn($stms, OutputBlock $out, $selfParent = null, $traceName = '') - { - $this->pushCallStack($traceName); - - foreach ($stms as $stm) { - if ($selfParent && isset($stm[1]) && \is_object($stm[1]) && $stm[1] instanceof Block) { - $stm[1]->selfParent = $selfParent; - $ret = $this->compileChild($stm, $out); - $stm[1]->selfParent = null; - } elseif ($selfParent && \in_array($stm[0], [Type::T_INCLUDE, Type::T_EXTEND])) { - $stm['selfParent'] = $selfParent; - $ret = $this->compileChild($stm, $out); - unset($stm['selfParent']); - } else { - $ret = $this->compileChild($stm, $out); - } - - if (isset($ret)) { - throw $this->error('@return may only be used within a function'); - } - } - - $this->popCallStack(); - } - - - /** - * evaluate media query : compile internal value keeping the structure unchanged - * - * @param array $queryList - * - * @return array - */ - protected function evaluateMediaQuery($queryList) - { - static $parser = null; - - $outQueryList = []; - - foreach ($queryList as $kql => $query) { - $shouldReparse = false; - - foreach ($query as $kq => $q) { - for ($i = 1; $i < \count($q); $i++) { - $value = $this->compileValue($q[$i]); - - // the parser had no mean to know if media type or expression if it was an interpolation - // so you need to reparse if the T_MEDIA_TYPE looks like anything else a media type - if ( - $q[0] == Type::T_MEDIA_TYPE && - (strpos($value, '(') !== false || - strpos($value, ')') !== false || - strpos($value, ':') !== false || - strpos($value, ',') !== false) - ) { - $shouldReparse = true; - } - - $queryList[$kql][$kq][$i] = [Type::T_KEYWORD, $value]; - } - } - - if ($shouldReparse) { - if (\is_null($parser)) { - $parser = $this->parserFactory(__METHOD__); - } - - $queryString = $this->compileMediaQuery([$queryList[$kql]]); - $queryString = reset($queryString); - - if (strpos($queryString, '@media ') === 0) { - $queryString = substr($queryString, 7); - $queries = []; - - if ($parser->parseMediaQueryList($queryString, $queries)) { - $queries = $this->evaluateMediaQuery($queries[2]); - - while (\count($queries)) { - $outQueryList[] = array_shift($queries); - } - - continue; - } - } - } - - $outQueryList[] = $queryList[$kql]; - } - - return $outQueryList; - } - - /** - * Compile media query - * - * @param array $queryList - * - * @return string[] - */ - protected function compileMediaQuery($queryList) - { - $start = '@media '; - $default = trim($start); - $out = []; - $current = ''; - - foreach ($queryList as $query) { - $type = null; - $parts = []; - - $mediaTypeOnly = true; - - foreach ($query as $q) { - if ($q[0] !== Type::T_MEDIA_TYPE) { - $mediaTypeOnly = false; - break; - } - } - - foreach ($query as $q) { - switch ($q[0]) { - case Type::T_MEDIA_TYPE: - $newType = array_map([$this, 'compileValue'], \array_slice($q, 1)); - - // combining not and anything else than media type is too risky and should be avoided - if (! $mediaTypeOnly) { - if (\in_array(Type::T_NOT, $newType) || ($type && \in_array(Type::T_NOT, $type) )) { - if ($type) { - array_unshift($parts, implode(' ', array_filter($type))); - } - - if (! empty($parts)) { - if (\strlen($current)) { - $current .= $this->formatter->tagSeparator; - } - - $current .= implode(' and ', $parts); - } - - if ($current) { - $out[] = $start . $current; - } - - $current = ''; - $type = null; - $parts = []; - } - } - - if ($newType === ['all'] && $default) { - $default = $start . 'all'; - } - - // all can be safely ignored and mixed with whatever else - if ($newType !== ['all']) { - if ($type) { - $type = $this->mergeMediaTypes($type, $newType); - - if (empty($type)) { - // merge failed : ignore this query that is not valid, skip to the next one - $parts = []; - $default = ''; // if everything fail, no @media at all - continue 3; - } - } else { - $type = $newType; - } - } - break; - - case Type::T_MEDIA_EXPRESSION: - if (isset($q[2])) { - $parts[] = '(' - . $this->compileValue($q[1]) - . $this->formatter->assignSeparator - . $this->compileValue($q[2]) - . ')'; - } else { - $parts[] = '(' - . $this->compileValue($q[1]) - . ')'; - } - break; - - case Type::T_MEDIA_VALUE: - $parts[] = $this->compileValue($q[1]); - break; - } - } - - if ($type) { - array_unshift($parts, implode(' ', array_filter($type))); - } - - if (! empty($parts)) { - if (\strlen($current)) { - $current .= $this->formatter->tagSeparator; - } - - $current .= implode(' and ', $parts); - } - } - - if ($current) { - $out[] = $start . $current; - } - - // no @media type except all, and no conflict? - if (! $out && $default) { - $out[] = $default; - } - - return $out; - } - - /** - * Merge direct relationships between selectors - * - * @param array $selectors1 - * @param array $selectors2 - * - * @return array - */ - protected function mergeDirectRelationships($selectors1, $selectors2) - { - if (empty($selectors1) || empty($selectors2)) { - return array_merge($selectors1, $selectors2); - } - - $part1 = end($selectors1); - $part2 = end($selectors2); - - if (! $this->isImmediateRelationshipCombinator($part1[0]) && $part1 !== $part2) { - return array_merge($selectors1, $selectors2); - } - - $merged = []; - - do { - $part1 = array_pop($selectors1); - $part2 = array_pop($selectors2); - - if (! $this->isImmediateRelationshipCombinator($part1[0]) && $part1 !== $part2) { - if ($this->isImmediateRelationshipCombinator(reset($merged)[0])) { - array_unshift($merged, [$part1[0] . $part2[0]]); - $merged = array_merge($selectors1, $selectors2, $merged); - } else { - $merged = array_merge($selectors1, [$part1], $selectors2, [$part2], $merged); - } - - break; - } - - array_unshift($merged, $part1); - } while (! empty($selectors1) && ! empty($selectors2)); - - return $merged; - } - - /** - * Merge media types - * - * @param array $type1 - * @param array $type2 - * - * @return array|null - */ - protected function mergeMediaTypes($type1, $type2) - { - if (empty($type1)) { - return $type2; - } - - if (empty($type2)) { - return $type1; - } - - if (\count($type1) > 1) { - $m1 = strtolower($type1[0]); - $t1 = strtolower($type1[1]); - } else { - $m1 = ''; - $t1 = strtolower($type1[0]); - } - - if (\count($type2) > 1) { - $m2 = strtolower($type2[0]); - $t2 = strtolower($type2[1]); - } else { - $m2 = ''; - $t2 = strtolower($type2[0]); - } - - if (($m1 === Type::T_NOT) ^ ($m2 === Type::T_NOT)) { - if ($t1 === $t2) { - return null; - } - - return [ - $m1 === Type::T_NOT ? $m2 : $m1, - $m1 === Type::T_NOT ? $t2 : $t1, - ]; - } - - if ($m1 === Type::T_NOT && $m2 === Type::T_NOT) { - // CSS has no way of representing "neither screen nor print" - if ($t1 !== $t2) { - return null; - } - - return [Type::T_NOT, $t1]; - } - - if ($t1 !== $t2) { - return null; - } - - // t1 == t2, neither m1 nor m2 are "not" - return [empty($m1) ? $m2 : $m1, $t1]; - } - - /** - * Compile import; returns true if the value was something that could be imported - * - * @param array $rawPath - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out - * @param boolean $once - * - * @return boolean - */ - protected function compileImport($rawPath, OutputBlock $out, $once = false) - { - if ($rawPath[0] === Type::T_STRING) { - $path = $this->compileStringContent($rawPath); - - if (strpos($path, 'url(') !== 0 && $filePath = $this->findImport($path, $this->currentDirectory)) { - $this->registerImport($this->currentDirectory, $path, $filePath); - - if (! $once || ! \in_array($filePath, $this->importedFiles)) { - $this->importFile($filePath, $out); - $this->importedFiles[] = $filePath; - } - - return true; - } - - $this->appendRootDirective('@import ' . $this->compileImportPath($rawPath) . ';', $out); - - return false; - } - - if ($rawPath[0] === Type::T_LIST) { - // handle a list of strings - if (\count($rawPath[2]) === 0) { - return false; - } - - foreach ($rawPath[2] as $path) { - if ($path[0] !== Type::T_STRING) { - $this->appendRootDirective('@import ' . $this->compileImportPath($rawPath) . ';', $out); - - return false; - } - } - - foreach ($rawPath[2] as $path) { - $this->compileImport($path, $out, $once); - } - - return true; - } - - $this->appendRootDirective('@import ' . $this->compileImportPath($rawPath) . ';', $out); - - return false; - } - - /** - * @param array $rawPath - * @return string - * @throws CompilerException - */ - protected function compileImportPath($rawPath) - { - $path = $this->compileValue($rawPath); - - // case url() without quotes : suppress \r \n remaining in the path - // if this is a real string there can not be CR or LF char - if (strpos($path, 'url(') === 0) { - $path = str_replace(array("\r", "\n"), array('', ' '), $path); - } else { - // if this is a file name in a string, spaces should be escaped - $path = $this->reduce($rawPath); - $path = $this->escapeImportPathString($path); - $path = $this->compileValue($path); - } - - return $path; - } - - /** - * @param array $path - * @return array - * @throws CompilerException - */ - protected function escapeImportPathString($path) - { - switch ($path[0]) { - case Type::T_LIST: - foreach ($path[2] as $k => $v) { - $path[2][$k] = $this->escapeImportPathString($v); - } - break; - case Type::T_STRING: - if ($path[1]) { - $path = $this->compileValue($path); - $path = str_replace(' ', '\\ ', $path); - $path = [Type::T_KEYWORD, $path]; - } - break; - } - - return $path; - } - - /** - * Append a root directive like @import or @charset as near as the possible from the source code - * (keeping before comments, @import and @charset coming before in the source code) - * - * @param string $line - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out - * @param array $allowed - * - * @return void - */ - protected function appendRootDirective($line, $out, $allowed = [Type::T_COMMENT]) - { - $root = $out; - - while ($root->parent) { - $root = $root->parent; - } - - $i = 0; - - while ($i < \count($root->children)) { - if (! isset($root->children[$i]->type) || ! \in_array($root->children[$i]->type, $allowed)) { - break; - } - - $i++; - } - - // remove incompatible children from the bottom of the list - $saveChildren = []; - - while ($i < \count($root->children)) { - $saveChildren[] = array_pop($root->children); - } - - // insert the directive as a comment - $child = $this->makeOutputBlock(Type::T_COMMENT); - $child->lines[] = $line; - $child->sourceName = $this->sourceNames[$this->sourceIndex]; - $child->sourceLine = $this->sourceLine; - $child->sourceColumn = $this->sourceColumn; - - $root->children[] = $child; - - // repush children - while (\count($saveChildren)) { - $root->children[] = array_pop($saveChildren); - } - } - - /** - * Append lines to the current output block: - * directly to the block or through a child if necessary - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out - * @param string $type - * @param string $line - * - * @return void - */ - protected function appendOutputLine(OutputBlock $out, $type, $line) - { - $outWrite = &$out; - - // check if it's a flat output or not - if (\count($out->children)) { - $lastChild = &$out->children[\count($out->children) - 1]; - - if ( - $lastChild->depth === $out->depth && - \is_null($lastChild->selectors) && - ! \count($lastChild->children) - ) { - $outWrite = $lastChild; - } else { - $nextLines = $this->makeOutputBlock($type); - $nextLines->parent = $out; - $nextLines->depth = $out->depth; - - $out->children[] = $nextLines; - $outWrite = &$nextLines; - } - } - - $outWrite->lines[] = $line; - } - - /** - * Compile child; returns a value to halt execution - * - * @param array $child - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out - * - * @return array|Number|null - */ - protected function compileChild($child, OutputBlock $out) - { - if (isset($child[Parser::SOURCE_LINE])) { - $this->sourceIndex = isset($child[Parser::SOURCE_INDEX]) ? $child[Parser::SOURCE_INDEX] : null; - $this->sourceLine = isset($child[Parser::SOURCE_LINE]) ? $child[Parser::SOURCE_LINE] : -1; - $this->sourceColumn = isset($child[Parser::SOURCE_COLUMN]) ? $child[Parser::SOURCE_COLUMN] : -1; - } elseif (\is_array($child) && isset($child[1]->sourceLine)) { - $this->sourceIndex = $child[1]->sourceIndex; - $this->sourceLine = $child[1]->sourceLine; - $this->sourceColumn = $child[1]->sourceColumn; - } elseif (! empty($out->sourceLine) && ! empty($out->sourceName)) { - $this->sourceLine = $out->sourceLine; - $sourceIndex = array_search($out->sourceName, $this->sourceNames); - $this->sourceColumn = $out->sourceColumn; - - if ($sourceIndex === false) { - $sourceIndex = null; - } - $this->sourceIndex = $sourceIndex; - } - - switch ($child[0]) { - case Type::T_SCSSPHP_IMPORT_ONCE: - $rawPath = $this->reduce($child[1]); - - $this->compileImport($rawPath, $out, true); - break; - - case Type::T_IMPORT: - $rawPath = $this->reduce($child[1]); - - $this->compileImport($rawPath, $out); - break; - - case Type::T_DIRECTIVE: - $this->compileDirective($child[1], $out); - break; - - case Type::T_AT_ROOT: - $this->compileAtRoot($child[1]); - break; - - case Type::T_MEDIA: - $this->compileMedia($child[1]); - break; - - case Type::T_BLOCK: - $this->compileBlock($child[1]); - break; - - case Type::T_CHARSET: - if (! $this->charsetSeen) { - $this->charsetSeen = true; - $this->appendRootDirective('@charset ' . $this->compileValue($child[1]) . ';', $out); - } - break; - - case Type::T_CUSTOM_PROPERTY: - list(, $name, $value) = $child; - $compiledName = $this->compileValue($name); - - // if the value reduces to null from something else then - // the property should be discarded - if ($value[0] !== Type::T_NULL) { - $value = $this->reduce($value); - - if ($value[0] === Type::T_NULL || $value === static::$nullString) { - break; - } - } - - $compiledValue = $this->compileValue($value); - - $line = $this->formatter->customProperty( - $compiledName, - $compiledValue - ); - - $this->appendOutputLine($out, Type::T_ASSIGN, $line); - break; - - case Type::T_ASSIGN: - list(, $name, $value) = $child; - - if ($name[0] === Type::T_VARIABLE) { - $flags = isset($child[3]) ? $child[3] : []; - $isDefault = \in_array('!default', $flags); - $isGlobal = \in_array('!global', $flags); - - if ($isGlobal) { - $this->set($name[1], $this->reduce($value), false, $this->rootEnv, $value); - break; - } - - $shouldSet = $isDefault && - (\is_null($result = $this->get($name[1], false)) || - $result === static::$null); - - if (! $isDefault || $shouldSet) { - $this->set($name[1], $this->reduce($value), true, null, $value); - } - break; - } - - $compiledName = $this->compileValue($name); - - // handle shorthand syntaxes : size / line-height... - if (\in_array($compiledName, ['font', 'grid-row', 'grid-column', 'border-radius'])) { - if ($value[0] === Type::T_VARIABLE) { - // if the font value comes from variable, the content is already reduced - // (i.e., formulas were already calculated), so we need the original unreduced value - $value = $this->get($value[1], true, null, true); - } - - $shorthandValue=&$value; - - $shorthandDividerNeedsUnit = false; - $maxListElements = null; - $maxShorthandDividers = 1; - - switch ($compiledName) { - case 'border-radius': - $maxListElements = 4; - $shorthandDividerNeedsUnit = true; - break; - } - - if ($compiledName === 'font' && $value[0] === Type::T_LIST && $value[1] === ',') { - // this is the case if more than one font is given: example: "font: 400 1em/1.3 arial,helvetica" - // we need to handle the first list element - $shorthandValue=&$value[2][0]; - } - - if ($shorthandValue[0] === Type::T_EXPRESSION && $shorthandValue[1] === '/') { - $revert = true; - - if ($shorthandDividerNeedsUnit) { - $divider = $shorthandValue[3]; - - if (\is_array($divider)) { - $divider = $this->reduce($divider, true); - } - - if ($divider instanceof Number && \intval($divider->getDimension()) && $divider->unitless()) { - $revert = false; - } - } - - if ($revert) { - $shorthandValue = $this->expToString($shorthandValue); - } - } elseif ($shorthandValue[0] === Type::T_LIST) { - foreach ($shorthandValue[2] as &$item) { - if ($item[0] === Type::T_EXPRESSION && $item[1] === '/') { - if ($maxShorthandDividers > 0) { - $revert = true; - - // if the list of values is too long, this has to be a shorthand, - // otherwise it could be a real division - if (\is_null($maxListElements) || \count($shorthandValue[2]) <= $maxListElements) { - if ($shorthandDividerNeedsUnit) { - $divider = $item[3]; - - if (\is_array($divider)) { - $divider = $this->reduce($divider, true); - } - - if ($divider instanceof Number && \intval($divider->getDimension()) && $divider->unitless()) { - $revert = false; - } - } - } - - if ($revert) { - $item = $this->expToString($item); - $maxShorthandDividers--; - } - } - } - } - } - } - - // if the value reduces to null from something else then - // the property should be discarded - if ($value[0] !== Type::T_NULL) { - $value = $this->reduce($value); - - if ($value[0] === Type::T_NULL || $value === static::$nullString) { - break; - } - } - - $compiledValue = $this->compileValue($value); - - // ignore empty value - if (\strlen($compiledValue)) { - $line = $this->formatter->property( - $compiledName, - $compiledValue - ); - $this->appendOutputLine($out, Type::T_ASSIGN, $line); - } - break; - - case Type::T_COMMENT: - if ($out->type === Type::T_ROOT) { - $this->compileComment($child); - break; - } - - $line = $this->compileCommentValue($child, true); - $this->appendOutputLine($out, Type::T_COMMENT, $line); - break; - - case Type::T_MIXIN: - case Type::T_FUNCTION: - list(, $block) = $child; - // the block need to be able to go up to it's parent env to resolve vars - $block->parentEnv = $this->getStoreEnv(); - $this->set(static::$namespaces[$block->type] . $block->name, $block, true); - break; - - case Type::T_EXTEND: - foreach ($child[1] as $sel) { - $replacedSel = $this->replaceSelfSelector($sel); - - if ($replacedSel !== $sel) { - throw $this->error('Parent selectors aren\'t allowed here.'); - } - - $results = $this->evalSelectors([$sel]); - - foreach ($results as $result) { - if (\count($result) !== 1) { - throw $this->error('complex selectors may not be extended.'); - } - - // only use the first one - $result = $result[0]; - $selectors = $out->selectors; - - if (! $selectors && isset($child['selfParent'])) { - $selectors = $this->multiplySelectors($this->env, $child['selfParent']); - } - - if (\count($result) > 1) { - $replacement = implode(', ', $result); - $fname = $this->getPrettyPath($this->sourceNames[$this->sourceIndex]); - $line = $this->sourceLine; - - $message = <<logger->warn($message); - } - - $this->pushExtends($result, $selectors, $child); - } - } - break; - - case Type::T_IF: - list(, $if) = $child; - - if ($this->isTruthy($this->reduce($if->cond, true))) { - return $this->compileChildren($if->children, $out); - } - - foreach ($if->cases as $case) { - if ( - $case->type === Type::T_ELSE || - $case->type === Type::T_ELSEIF && $this->isTruthy($this->reduce($case->cond)) - ) { - return $this->compileChildren($case->children, $out); - } - } - break; - - case Type::T_EACH: - list(, $each) = $child; - - $list = $this->coerceList($this->reduce($each->list), ',', true); - - $this->pushEnv(); - - foreach ($list[2] as $item) { - if (\count($each->vars) === 1) { - $this->set($each->vars[0], $item, true); - } else { - list(,, $values) = $this->coerceList($item); - - foreach ($each->vars as $i => $var) { - $this->set($var, isset($values[$i]) ? $values[$i] : static::$null, true); - } - } - - $ret = $this->compileChildren($each->children, $out); - - if ($ret) { - $store = $this->env->store; - $this->popEnv(); - $this->backPropagateEnv($store, $each->vars); - - return $ret; - } - } - $store = $this->env->store; - $this->popEnv(); - $this->backPropagateEnv($store, $each->vars); - - break; - - case Type::T_WHILE: - list(, $while) = $child; - - while ($this->isTruthy($this->reduce($while->cond, true))) { - $ret = $this->compileChildren($while->children, $out); - - if ($ret) { - return $ret; - } - } - break; - - case Type::T_FOR: - list(, $for) = $child; - - $startNumber = $this->assertNumber($this->reduce($for->start, true)); - $endNumber = $this->assertNumber($this->reduce($for->end, true)); - - $start = $this->assertInteger($startNumber); - - $numeratorUnits = $startNumber->getNumeratorUnits(); - $denominatorUnits = $startNumber->getDenominatorUnits(); - - $end = $this->assertInteger($endNumber->coerce($numeratorUnits, $denominatorUnits)); - - $d = $start < $end ? 1 : -1; - - $this->pushEnv(); - - for (;;) { - if ( - (! $for->until && $start - $d == $end) || - ($for->until && $start == $end) - ) { - break; - } - - $this->set($for->var, new Number($start, $numeratorUnits, $denominatorUnits)); - $start += $d; - - $ret = $this->compileChildren($for->children, $out); - - if ($ret) { - $store = $this->env->store; - $this->popEnv(); - $this->backPropagateEnv($store, [$for->var]); - - return $ret; - } - } - - $store = $this->env->store; - $this->popEnv(); - $this->backPropagateEnv($store, [$for->var]); - - break; - - case Type::T_RETURN: - return $this->reduce($child[1], true); - - case Type::T_NESTED_PROPERTY: - $this->compileNestedPropertiesBlock($child[1], $out); - break; - - case Type::T_INCLUDE: - // including a mixin - list(, $name, $argValues, $content, $argUsing) = $child; - - $mixin = $this->get(static::$namespaces['mixin'] . $name, false); - - if (! $mixin) { - throw $this->error("Undefined mixin $name"); - } - - $callingScope = $this->getStoreEnv(); - - // push scope, apply args - $this->pushEnv(); - $this->env->depth--; - - // Find the parent selectors in the env to be able to know what '&' refers to in the mixin - // and assign this fake parent to childs - $selfParent = null; - - if (isset($child['selfParent']) && isset($child['selfParent']->selectors)) { - $selfParent = $child['selfParent']; - } else { - $parentSelectors = $this->multiplySelectors($this->env); - - if ($parentSelectors) { - $parent = new Block(); - $parent->selectors = $parentSelectors; - - foreach ($mixin->children as $k => $child) { - if (isset($child[1]) && \is_object($child[1]) && $child[1] instanceof Block) { - $mixin->children[$k][1]->parent = $parent; - } - } - } - } - - // clone the stored content to not have its scope spoiled by a further call to the same mixin - // i.e., recursive @include of the same mixin - if (isset($content)) { - $copyContent = clone $content; - $copyContent->scope = clone $callingScope; - - $this->setRaw(static::$namespaces['special'] . 'content', $copyContent, $this->env); - } else { - $this->setRaw(static::$namespaces['special'] . 'content', null, $this->env); - } - - // save the "using" argument list for applying it to when "@content" is invoked - if (isset($argUsing)) { - $this->setRaw(static::$namespaces['special'] . 'using', $argUsing, $this->env); - } else { - $this->setRaw(static::$namespaces['special'] . 'using', null, $this->env); - } - - if (isset($mixin->args)) { - $this->applyArguments($mixin->args, $argValues); - } - - $this->env->marker = 'mixin'; - - if (! empty($mixin->parentEnv)) { - $this->env->declarationScopeParent = $mixin->parentEnv; - } else { - throw $this->error("@mixin $name() without parentEnv"); - } - - $this->compileChildrenNoReturn($mixin->children, $out, $selfParent, $this->env->marker . ' ' . $name); - - $this->popEnv(); - break; - - case Type::T_MIXIN_CONTENT: - $env = isset($this->storeEnv) ? $this->storeEnv : $this->env; - $content = $this->get(static::$namespaces['special'] . 'content', false, $env); - $argUsing = $this->get(static::$namespaces['special'] . 'using', false, $env); - $argContent = $child[1]; - - if (! $content) { - break; - } - - $storeEnv = $this->storeEnv; - $varsUsing = []; - - if (isset($argUsing) && isset($argContent)) { - // Get the arguments provided for the content with the names provided in the "using" argument list - $this->storeEnv = null; - $varsUsing = $this->applyArguments($argUsing, $argContent, false); - } - - // restore the scope from the @content - $this->storeEnv = $content->scope; - - // append the vars from using if any - foreach ($varsUsing as $name => $val) { - $this->set($name, $val, true, $this->storeEnv); - } - - $this->compileChildrenNoReturn($content->children, $out); - - $this->storeEnv = $storeEnv; - break; - - case Type::T_DEBUG: - list(, $value) = $child; - - $fname = $this->getPrettyPath($this->sourceNames[$this->sourceIndex]); - $line = $this->sourceLine; - $value = $this->compileDebugValue($value); - - $this->logger->debug("$fname:$line DEBUG: $value"); - break; - - case Type::T_WARN: - list(, $value) = $child; - - $fname = $this->getPrettyPath($this->sourceNames[$this->sourceIndex]); - $line = $this->sourceLine; - $value = $this->compileDebugValue($value); - - $this->logger->warn("$value\n on line $line of $fname"); - break; - - case Type::T_ERROR: - list(, $value) = $child; - - $fname = $this->getPrettyPath($this->sourceNames[$this->sourceIndex]); - $line = $this->sourceLine; - $value = $this->compileValue($this->reduce($value, true)); - - throw $this->error("File $fname on line $line ERROR: $value\n"); - - default: - throw $this->error("unknown child type: $child[0]"); - } - } - - /** - * Reduce expression to string - * - * @param array $exp - * @param bool $keepParens - * - * @return array - */ - protected function expToString($exp, $keepParens = false) - { - list(, $op, $left, $right, $inParens, $whiteLeft, $whiteRight) = $exp; - - $content = []; - - if ($keepParens && $inParens) { - $content[] = '('; - } - - $content[] = $this->reduce($left); - - if ($whiteLeft) { - $content[] = ' '; - } - - $content[] = $op; - - if ($whiteRight) { - $content[] = ' '; - } - - $content[] = $this->reduce($right); - - if ($keepParens && $inParens) { - $content[] = ')'; - } - - return [Type::T_STRING, '', $content]; - } - - /** - * Is truthy? - * - * @param array|Number $value - * - * @return boolean - */ - public function isTruthy($value) - { - return $value !== static::$false && $value !== static::$null; - } - - /** - * Is the value a direct relationship combinator? - * - * @param string $value - * - * @return boolean - */ - protected function isImmediateRelationshipCombinator($value) - { - return $value === '>' || $value === '+' || $value === '~'; - } - - /** - * Should $value cause its operand to eval - * - * @param array $value - * - * @return boolean - */ - protected function shouldEval($value) - { - switch ($value[0]) { - case Type::T_EXPRESSION: - if ($value[1] === '/') { - return $this->shouldEval($value[2]) || $this->shouldEval($value[3]); - } - - // fall-thru - case Type::T_VARIABLE: - case Type::T_FUNCTION_CALL: - return true; - } - - return false; - } - - /** - * Reduce value - * - * @param array|Number $value - * @param boolean $inExp - * - * @return array|Number - */ - protected function reduce($value, $inExp = false) - { - if ($value instanceof Number) { - return $value; - } - - switch ($value[0]) { - case Type::T_EXPRESSION: - list(, $op, $left, $right, $inParens) = $value; - - $opName = isset(static::$operatorNames[$op]) ? static::$operatorNames[$op] : $op; - $inExp = $inExp || $this->shouldEval($left) || $this->shouldEval($right); - - $left = $this->reduce($left, true); - - if ($op !== 'and' && $op !== 'or') { - $right = $this->reduce($right, true); - } - - // special case: looks like css shorthand - if ( - $opName == 'div' && ! $inParens && ! $inExp && - (($right[0] !== Type::T_NUMBER && isset($right[2]) && $right[2] != '') || - ($right[0] === Type::T_NUMBER && ! $right->unitless())) - ) { - return $this->expToString($value); - } - - $left = $this->coerceForExpression($left); - $right = $this->coerceForExpression($right); - $ltype = $left[0]; - $rtype = $right[0]; - - $ucOpName = ucfirst($opName); - $ucLType = ucfirst($ltype); - $ucRType = ucfirst($rtype); - - // this tries: - // 1. op[op name][left type][right type] - // 2. op[left type][right type] (passing the op as first arg - // 3. op[op name] - $fn = "op${ucOpName}${ucLType}${ucRType}"; - - if ( - \is_callable([$this, $fn]) || - (($fn = "op${ucLType}${ucRType}") && - \is_callable([$this, $fn]) && - $passOp = true) || - (($fn = "op${ucOpName}") && - \is_callable([$this, $fn]) && - $genOp = true) - ) { - $shouldEval = $inParens || $inExp; - - if (isset($passOp)) { - $out = $this->$fn($op, $left, $right, $shouldEval); - } else { - $out = $this->$fn($left, $right, $shouldEval); - } - - if (isset($out)) { - return $out; - } - } - - return $this->expToString($value); - - case Type::T_UNARY: - list(, $op, $exp, $inParens) = $value; - - $inExp = $inExp || $this->shouldEval($exp); - $exp = $this->reduce($exp); - - if ($exp instanceof Number) { - switch ($op) { - case '+': - return $exp; - - case '-': - return $exp->unaryMinus(); - } - } - - if ($op === 'not') { - if ($inExp || $inParens) { - if ($exp === static::$false || $exp === static::$null) { - return static::$true; - } - - return static::$false; - } - - $op = $op . ' '; - } - - return [Type::T_STRING, '', [$op, $exp]]; - - case Type::T_VARIABLE: - return $this->reduce($this->get($value[1])); - - case Type::T_LIST: - foreach ($value[2] as &$item) { - $item = $this->reduce($item); - } - unset($item); - - if (isset($value[3]) && \is_array($value[3])) { - foreach ($value[3] as &$item) { - $item = $this->reduce($item); - } - unset($item); - } - - return $value; - - case Type::T_MAP: - foreach ($value[1] as &$item) { - $item = $this->reduce($item); - } - - foreach ($value[2] as &$item) { - $item = $this->reduce($item); - } - - return $value; - - case Type::T_STRING: - foreach ($value[2] as &$item) { - if (\is_array($item) || $item instanceof Number) { - $item = $this->reduce($item); - } - } - - return $value; - - case Type::T_INTERPOLATE: - $value[1] = $this->reduce($value[1]); - - if ($inExp) { - return [Type::T_KEYWORD, $this->compileValue($value, false)]; - } - - return $value; - - case Type::T_FUNCTION_CALL: - return $this->fncall($value[1], $value[2]); - - case Type::T_SELF: - $selfParent = ! empty($this->env->block->selfParent) ? $this->env->block->selfParent : null; - $selfSelector = $this->multiplySelectors($this->env, $selfParent); - $selfSelector = $this->collapseSelectorsAsList($selfSelector); - - return $selfSelector; - - default: - return $value; - } - } - - /** - * Function caller - * - * @param string|array $functionReference - * @param array $argValues - * - * @return array|Number - */ - protected function fncall($functionReference, $argValues) - { - // a string means this is a static hard reference coming from the parsing - if (is_string($functionReference)) { - $name = $functionReference; - - $functionReference = $this->getFunctionReference($name); - if ($functionReference === static::$null || $functionReference[0] !== Type::T_FUNCTION_REFERENCE) { - $functionReference = [Type::T_FUNCTION, $name, [Type::T_LIST, ',', []]]; - } - } - - // a function type means we just want a plain css function call - if ($functionReference[0] === Type::T_FUNCTION) { - // for CSS functions, simply flatten the arguments into a list - $listArgs = []; - - foreach ((array) $argValues as $arg) { - if (empty($arg[0]) || count($argValues) === 1) { - $listArgs[] = $this->reduce($this->stringifyFncallArgs($arg[1])); - } - } - - return [Type::T_FUNCTION, $functionReference[1], [Type::T_LIST, ',', $listArgs]]; - } - - if ($functionReference === static::$null || $functionReference[0] !== Type::T_FUNCTION_REFERENCE) { - return static::$defaultValue; - } - - - switch ($functionReference[1]) { - // SCSS @function - case 'scss': - return $this->callScssFunction($functionReference[3], $argValues); - - // native PHP functions - case 'user': - case 'native': - list(,,$name, $fn, $prototype) = $functionReference; - - // special cases of css valid functions min/max - $name = strtolower($name); - if (\in_array($name, ['min', 'max']) && count($argValues) >= 1) { - $cssFunction = $this->cssValidArg( - [Type::T_FUNCTION_CALL, $name, $argValues], - ['min', 'max', 'calc', 'env', 'var'] - ); - if ($cssFunction !== false) { - return $cssFunction; - } - } - $returnValue = $this->callNativeFunction($name, $fn, $prototype, $argValues); - - if (! isset($returnValue)) { - return $this->fncall([Type::T_FUNCTION, $name, [Type::T_LIST, ',', []]], $argValues); - } - - return $returnValue; - - default: - return static::$defaultValue; - } - } - - /** - * @param array|Number $arg - * @param string[] $allowed_function - * @param bool $inFunction - * - * @return array|Number|false - */ - protected function cssValidArg($arg, $allowed_function = [], $inFunction = false) - { - if ($arg instanceof Number) { - return $this->stringifyFncallArgs($arg); - } - - switch ($arg[0]) { - case Type::T_INTERPOLATE: - return [Type::T_KEYWORD, $this->CompileValue($arg)]; - - case Type::T_FUNCTION: - if (! \in_array($arg[1], $allowed_function)) { - return false; - } - if ($arg[2][0] === Type::T_LIST) { - foreach ($arg[2][2] as $k => $subarg) { - $arg[2][2][$k] = $this->cssValidArg($subarg, $allowed_function, $arg[1]); - if ($arg[2][2][$k] === false) { - return false; - } - } - } - return $arg; - - case Type::T_FUNCTION_CALL: - if (! \in_array($arg[1], $allowed_function)) { - return false; - } - $cssArgs = []; - foreach ($arg[2] as $argValue) { - if ($argValue === static::$null) { - return false; - } - $cssArg = $this->cssValidArg($argValue[1], $allowed_function, $arg[1]); - if (empty($argValue[0]) && $cssArg !== false) { - $cssArgs[] = [$argValue[0], $cssArg]; - } else { - return false; - } - } - - return $this->fncall([Type::T_FUNCTION, $arg[1], [Type::T_LIST, ',', []]], $cssArgs); - - case Type::T_STRING: - case Type::T_KEYWORD: - if (!$inFunction or !\in_array($inFunction, ['calc', 'env', 'var'])) { - return false; - } - return $this->stringifyFncallArgs($arg); - - case Type::T_LIST: - if (!$inFunction) { - return false; - } - if (empty($arg['enclosing']) and $arg[1] === '') { - foreach ($arg[2] as $k => $subarg) { - $arg[2][$k] = $this->cssValidArg($subarg, $allowed_function, $inFunction); - if ($arg[2][$k] === false) { - return false; - } - } - $arg[0] = Type::T_STRING; - return $arg; - } - return false; - - case Type::T_EXPRESSION: - if (! \in_array($arg[1], ['+', '-', '/', '*'])) { - return false; - } - $arg[2] = $this->cssValidArg($arg[2], $allowed_function, $inFunction); - $arg[3] = $this->cssValidArg($arg[3], $allowed_function, $inFunction); - if ($arg[2] === false || $arg[3] === false) { - return false; - } - return $this->expToString($arg, true); - - case Type::T_VARIABLE: - case Type::T_SELF: - default: - return false; - } - } - - - /** - * Reformat fncall arguments to proper css function output - * - * @param array|Number $arg - * - * @return array|Number - */ - protected function stringifyFncallArgs($arg) - { - if ($arg instanceof Number) { - return $arg; - } - - switch ($arg[0]) { - case Type::T_LIST: - foreach ($arg[2] as $k => $v) { - $arg[2][$k] = $this->stringifyFncallArgs($v); - } - break; - - case Type::T_EXPRESSION: - if ($arg[1] === '/') { - $arg[2] = $this->stringifyFncallArgs($arg[2]); - $arg[3] = $this->stringifyFncallArgs($arg[3]); - $arg[5] = $arg[6] = false; // no space around / - $arg = $this->expToString($arg); - } - break; - - case Type::T_FUNCTION_CALL: - $name = strtolower($arg[1]); - - if (in_array($name, ['max', 'min', 'calc'])) { - $args = $arg[2]; - $arg = $this->fncall([Type::T_FUNCTION, $name, [Type::T_LIST, ',', []]], $args); - } - break; - } - - return $arg; - } - - /** - * Find a function reference - * @param string $name - * @param bool $safeCopy - * @return array - */ - protected function getFunctionReference($name, $safeCopy = false) - { - // SCSS @function - if ($func = $this->get(static::$namespaces['function'] . $name, false)) { - if ($safeCopy) { - $func = clone $func; - } - - return [Type::T_FUNCTION_REFERENCE, 'scss', $name, $func]; - } - - // native PHP functions - - // try to find a native lib function - $normalizedName = $this->normalizeName($name); - $libName = null; - - if (isset($this->userFunctions[$normalizedName])) { - // see if we can find a user function - list($f, $prototype) = $this->userFunctions[$normalizedName]; - - return [Type::T_FUNCTION_REFERENCE, 'user', $name, $f, $prototype]; - } - - if (($f = $this->getBuiltinFunction($normalizedName)) && \is_callable($f)) { - $libName = $f[1]; - $prototype = isset(static::$$libName) ? static::$$libName : null; - - if (\get_class($this) !== __CLASS__ && !isset($this->warnedChildFunctions[$libName])) { - $r = new \ReflectionMethod($this, $libName); - $declaringClass = $r->getDeclaringClass()->name; - - $needsWarning = $this->warnedChildFunctions[$libName] = $declaringClass !== __CLASS__; - - if ($needsWarning) { - if (method_exists(__CLASS__, $libName)) { - @trigger_error(sprintf('Overriding the "%s" core function by extending the Compiler is deprecated and will be unsupported in 2.0. Remove the "%s::%s" method.', $normalizedName, $declaringClass, $libName), E_USER_DEPRECATED); - } else { - @trigger_error(sprintf('Registering custom functions by extending the Compiler and using the lib* discovery mechanism is deprecated and will be removed in 2.0. Replace the "%s::%s" method with registering the "%s" function through "Compiler::registerFunction".', $declaringClass, $libName, $normalizedName), E_USER_DEPRECATED); - } - } - } - - return [Type::T_FUNCTION_REFERENCE, 'native', $name, $f, $prototype]; - } - - return static::$null; - } - - - /** - * Normalize name - * - * @param string $name - * - * @return string - */ - protected function normalizeName($name) - { - return str_replace('-', '_', $name); - } - - /** - * Normalize value - * - * @internal - * - * @param array|Number $value - * - * @return array|Number - */ - public function normalizeValue($value) - { - $value = $this->coerceForExpression($this->reduce($value)); - - if ($value instanceof Number) { - return $value; - } - - switch ($value[0]) { - case Type::T_LIST: - $value = $this->extractInterpolation($value); - - if ($value[0] !== Type::T_LIST) { - return [Type::T_KEYWORD, $this->compileValue($value)]; - } - - foreach ($value[2] as $key => $item) { - $value[2][$key] = $this->normalizeValue($item); - } - - if (! empty($value['enclosing'])) { - unset($value['enclosing']); - } - - return $value; - - case Type::T_STRING: - return [$value[0], '"', [$this->compileStringContent($value)]]; - - case Type::T_INTERPOLATE: - return [Type::T_KEYWORD, $this->compileValue($value)]; - - default: - return $value; - } - } - - /** - * Add numbers - * - * @param Number $left - * @param Number $right - * - * @return Number - */ - protected function opAddNumberNumber(Number $left, Number $right) - { - return $left->plus($right); - } - - /** - * Multiply numbers - * - * @param Number $left - * @param Number $right - * - * @return Number - */ - protected function opMulNumberNumber(Number $left, Number $right) - { - return $left->times($right); - } - - /** - * Subtract numbers - * - * @param Number $left - * @param Number $right - * - * @return Number - */ - protected function opSubNumberNumber(Number $left, Number $right) - { - return $left->minus($right); - } - - /** - * Divide numbers - * - * @param Number $left - * @param Number $right - * - * @return Number - */ - protected function opDivNumberNumber(Number $left, Number $right) - { - return $left->dividedBy($right); - } - - /** - * Mod numbers - * - * @param Number $left - * @param Number $right - * - * @return Number - */ - protected function opModNumberNumber(Number $left, Number $right) - { - return $left->modulo($right); - } - - /** - * Add strings - * - * @param array $left - * @param array $right - * - * @return array|null - */ - protected function opAdd($left, $right) - { - if ($strLeft = $this->coerceString($left)) { - if ($right[0] === Type::T_STRING) { - $right[1] = ''; - } - - $strLeft[2][] = $right; - - return $strLeft; - } - - if ($strRight = $this->coerceString($right)) { - if ($left[0] === Type::T_STRING) { - $left[1] = ''; - } - - array_unshift($strRight[2], $left); - - return $strRight; - } - - return null; - } - - /** - * Boolean and - * - * @param array|Number $left - * @param array|Number $right - * @param boolean $shouldEval - * - * @return array|Number|null - */ - protected function opAnd($left, $right, $shouldEval) - { - $truthy = ($left === static::$null || $right === static::$null) || - ($left === static::$false || $left === static::$true) && - ($right === static::$false || $right === static::$true); - - if (! $shouldEval) { - if (! $truthy) { - return null; - } - } - - if ($left !== static::$false && $left !== static::$null) { - return $this->reduce($right, true); - } - - return $left; - } - - /** - * Boolean or - * - * @param array|Number $left - * @param array|Number $right - * @param boolean $shouldEval - * - * @return array|Number|null - */ - protected function opOr($left, $right, $shouldEval) - { - $truthy = ($left === static::$null || $right === static::$null) || - ($left === static::$false || $left === static::$true) && - ($right === static::$false || $right === static::$true); - - if (! $shouldEval) { - if (! $truthy) { - return null; - } - } - - if ($left !== static::$false && $left !== static::$null) { - return $left; - } - - return $this->reduce($right, true); - } - - /** - * Compare colors - * - * @param string $op - * @param array $left - * @param array $right - * - * @return array - */ - protected function opColorColor($op, $left, $right) - { - if ($op !== '==' && $op !== '!=') { - $warning = "Color arithmetic is deprecated and will be an error in future versions.\n" - . "Consider using Sass's color functions instead."; - $fname = $this->getPrettyPath($this->sourceNames[$this->sourceIndex]); - $line = $this->sourceLine; - - Warn::deprecation("$warning\n on line $line of $fname"); - } - - $out = [Type::T_COLOR]; - - foreach ([1, 2, 3] as $i) { - $lval = isset($left[$i]) ? $left[$i] : 0; - $rval = isset($right[$i]) ? $right[$i] : 0; - - switch ($op) { - case '+': - $out[] = $lval + $rval; - break; - - case '-': - $out[] = $lval - $rval; - break; - - case '*': - $out[] = $lval * $rval; - break; - - case '%': - if ($rval == 0) { - throw $this->error("color: Can't take modulo by zero"); - } - - $out[] = $lval % $rval; - break; - - case '/': - if ($rval == 0) { - throw $this->error("color: Can't divide by zero"); - } - - $out[] = (int) ($lval / $rval); - break; - - case '==': - return $this->opEq($left, $right); - - case '!=': - return $this->opNeq($left, $right); - - default: - throw $this->error("color: unknown op $op"); - } - } - - if (isset($left[4])) { - $out[4] = $left[4]; - } elseif (isset($right[4])) { - $out[4] = $right[4]; - } - - return $this->fixColor($out); - } - - /** - * Compare color and number - * - * @param string $op - * @param array $left - * @param Number $right - * - * @return array - */ - protected function opColorNumber($op, $left, Number $right) - { - if ($op === '==') { - return static::$false; - } - - if ($op === '!=') { - return static::$true; - } - - $value = $right->getDimension(); - - return $this->opColorColor( - $op, - $left, - [Type::T_COLOR, $value, $value, $value] - ); - } - - /** - * Compare number and color - * - * @param string $op - * @param Number $left - * @param array $right - * - * @return array - */ - protected function opNumberColor($op, Number $left, $right) - { - if ($op === '==') { - return static::$false; - } - - if ($op === '!=') { - return static::$true; - } - - $value = $left->getDimension(); - - return $this->opColorColor( - $op, - [Type::T_COLOR, $value, $value, $value], - $right - ); - } - - /** - * Compare number1 == number2 - * - * @param array|Number $left - * @param array|Number $right - * - * @return array - */ - protected function opEq($left, $right) - { - if (($lStr = $this->coerceString($left)) && ($rStr = $this->coerceString($right))) { - $lStr[1] = ''; - $rStr[1] = ''; - - $left = $this->compileValue($lStr); - $right = $this->compileValue($rStr); - } - - return $this->toBool($left === $right); - } - - /** - * Compare number1 != number2 - * - * @param array|Number $left - * @param array|Number $right - * - * @return array - */ - protected function opNeq($left, $right) - { - if (($lStr = $this->coerceString($left)) && ($rStr = $this->coerceString($right))) { - $lStr[1] = ''; - $rStr[1] = ''; - - $left = $this->compileValue($lStr); - $right = $this->compileValue($rStr); - } - - return $this->toBool($left !== $right); - } - - /** - * Compare number1 == number2 - * - * @param Number $left - * @param Number $right - * - * @return array - */ - protected function opEqNumberNumber(Number $left, Number $right) - { - return $this->toBool($left->equals($right)); - } - - /** - * Compare number1 != number2 - * - * @param Number $left - * @param Number $right - * - * @return array - */ - protected function opNeqNumberNumber(Number $left, Number $right) - { - return $this->toBool(!$left->equals($right)); - } - - /** - * Compare number1 >= number2 - * - * @param Number $left - * @param Number $right - * - * @return array - */ - protected function opGteNumberNumber(Number $left, Number $right) - { - return $this->toBool($left->greaterThanOrEqual($right)); - } - - /** - * Compare number1 > number2 - * - * @param Number $left - * @param Number $right - * - * @return array - */ - protected function opGtNumberNumber(Number $left, Number $right) - { - return $this->toBool($left->greaterThan($right)); - } - - /** - * Compare number1 <= number2 - * - * @param Number $left - * @param Number $right - * - * @return array - */ - protected function opLteNumberNumber(Number $left, Number $right) - { - return $this->toBool($left->lessThanOrEqual($right)); - } - - /** - * Compare number1 < number2 - * - * @param Number $left - * @param Number $right - * - * @return array - */ - protected function opLtNumberNumber(Number $left, Number $right) - { - return $this->toBool($left->lessThan($right)); - } - - /** - * Cast to boolean - * - * @api - * - * @param bool $thing - * - * @return array - */ - public function toBool($thing) - { - return $thing ? static::$true : static::$false; - } - - /** - * Escape non printable chars in strings output as in dart-sass - * - * @internal - * - * @param string $string - * @param bool $inKeyword - * - * @return string - */ - public function escapeNonPrintableChars($string, $inKeyword = false) - { - static $replacement = []; - if (empty($replacement[$inKeyword])) { - for ($i = 0; $i < 32; $i++) { - if ($i !== 9 || $inKeyword) { - $replacement[$inKeyword][chr($i)] = '\\' . dechex($i) . ($inKeyword ? ' ' : chr(0)); - } - } - } - $string = str_replace(array_keys($replacement[$inKeyword]), array_values($replacement[$inKeyword]), $string); - // chr(0) is not a possible char from the input, so any chr(0) comes from our escaping replacement - if (strpos($string, chr(0)) !== false) { - if (substr($string, -1) === chr(0)) { - $string = substr($string, 0, -1); - } - $string = str_replace( - [chr(0) . '\\',chr(0) . ' '], - [ '\\', ' '], - $string - ); - if (strpos($string, chr(0)) !== false) { - $parts = explode(chr(0), $string); - $string = array_shift($parts); - while (count($parts)) { - $next = array_shift($parts); - if (strpos("0123456789abcdefABCDEF" . chr(9), $next[0]) !== false) { - $string .= " "; - } - $string .= $next; - } - } - } - - return $string; - } - - /** - * Compiles a primitive value into a CSS property value. - * - * Values in scssphp are typed by being wrapped in arrays, their format is - * typically: - * - * array(type, contents [, additional_contents]*) - * - * The input is expected to be reduced. This function will not work on - * things like expressions and variables. - * - * @api - * - * @param array|Number $value - * @param bool $quote - * - * @return string - */ - public function compileValue($value, $quote = true) - { - $value = $this->reduce($value); - - if ($value instanceof Number) { - return $value->output($this); - } - - switch ($value[0]) { - case Type::T_KEYWORD: - return $this->escapeNonPrintableChars($value[1], true); - - case Type::T_COLOR: - // [1] - red component (either number for a %) - // [2] - green component - // [3] - blue component - // [4] - optional alpha component - list(, $r, $g, $b) = $value; - - $r = $this->compileRGBAValue($r); - $g = $this->compileRGBAValue($g); - $b = $this->compileRGBAValue($b); - - if (\count($value) === 5) { - $alpha = $this->compileRGBAValue($value[4], true); - - if (! is_numeric($alpha) || $alpha < 1) { - $colorName = Colors::RGBaToColorName($r, $g, $b, $alpha); - - if (! \is_null($colorName)) { - return $colorName; - } - - if (is_numeric($alpha)) { - $a = new Number($alpha, ''); - } else { - $a = $alpha; - } - - return 'rgba(' . $r . ', ' . $g . ', ' . $b . ', ' . $a . ')'; - } - } - - if (! is_numeric($r) || ! is_numeric($g) || ! is_numeric($b)) { - return 'rgb(' . $r . ', ' . $g . ', ' . $b . ')'; - } - - $colorName = Colors::RGBaToColorName($r, $g, $b); - - if (! \is_null($colorName)) { - return $colorName; - } - - $h = sprintf('#%02x%02x%02x', $r, $g, $b); - - // Converting hex color to short notation (e.g. #003399 to #039) - if ($h[1] === $h[2] && $h[3] === $h[4] && $h[5] === $h[6]) { - $h = '#' . $h[1] . $h[3] . $h[5]; - } - - return $h; - - case Type::T_STRING: - $content = $this->compileStringContent($value, $quote); - - if ($value[1] && $quote) { - $content = str_replace('\\', '\\\\', $content); - - $content = $this->escapeNonPrintableChars($content); - - // force double quote as string quote for the output in certain cases - if ( - $value[1] === "'" && - (strpos($content, '"') === false or strpos($content, "'") !== false) && - strpbrk($content, '{}\\\'') !== false - ) { - $value[1] = '"'; - } elseif ( - $value[1] === '"' && - (strpos($content, '"') !== false and strpos($content, "'") === false) - ) { - $value[1] = "'"; - } - - $content = str_replace($value[1], '\\' . $value[1], $content); - } - - return $value[1] . $content . $value[1]; - - case Type::T_FUNCTION: - $args = ! empty($value[2]) ? $this->compileValue($value[2], $quote) : ''; - - return "$value[1]($args)"; - - case Type::T_FUNCTION_REFERENCE: - $name = ! empty($value[2]) ? $value[2] : ''; - - return "get-function(\"$name\")"; - - case Type::T_LIST: - $value = $this->extractInterpolation($value); - - if ($value[0] !== Type::T_LIST) { - return $this->compileValue($value, $quote); - } - - list(, $delim, $items) = $value; - $pre = $post = ''; - - if (! empty($value['enclosing'])) { - switch ($value['enclosing']) { - case 'parent': - //$pre = '('; - //$post = ')'; - break; - case 'forced_parent': - $pre = '('; - $post = ')'; - break; - case 'bracket': - case 'forced_bracket': - $pre = '['; - $post = ']'; - break; - } - } - - $prefix_value = ''; - - if ($delim !== ' ') { - $prefix_value = ' '; - } - - $filtered = []; - - $same_string_quote = null; - foreach ($items as $item) { - if (\is_null($same_string_quote)) { - $same_string_quote = false; - if ($item[0] === Type::T_STRING) { - $same_string_quote = $item[1]; - foreach ($items as $ii) { - if ($ii[0] !== Type::T_STRING) { - $same_string_quote = false; - break; - } - } - } - } - if ($item[0] === Type::T_NULL) { - continue; - } - if ($same_string_quote === '"' && $item[0] === Type::T_STRING && $item[1]) { - $item[1] = $same_string_quote; - } - - $compiled = $this->compileValue($item, $quote); - - if ($prefix_value && \strlen($compiled)) { - $compiled = $prefix_value . $compiled; - } - - $filtered[] = $compiled; - } - - return $pre . substr(implode("$delim", $filtered), \strlen($prefix_value)) . $post; - - case Type::T_MAP: - $keys = $value[1]; - $values = $value[2]; - $filtered = []; - - for ($i = 0, $s = \count($keys); $i < $s; $i++) { - $filtered[$this->compileValue($keys[$i], $quote)] = $this->compileValue($values[$i], $quote); - } - - array_walk($filtered, function (&$value, $key) { - $value = $key . ': ' . $value; - }); - - return '(' . implode(', ', $filtered) . ')'; - - case Type::T_INTERPOLATED: - // node created by extractInterpolation - list(, $interpolate, $left, $right) = $value; - list(,, $whiteLeft, $whiteRight) = $interpolate; - - $delim = $left[1]; - - if ($delim && $delim !== ' ' && ! $whiteLeft) { - $delim .= ' '; - } - - $left = \count($left[2]) > 0 - ? $this->compileValue($left, $quote) . $delim . $whiteLeft - : ''; - - $delim = $right[1]; - - if ($delim && $delim !== ' ') { - $delim .= ' '; - } - - $right = \count($right[2]) > 0 ? - $whiteRight . $delim . $this->compileValue($right, $quote) : ''; - - return $left . $this->compileValue($interpolate, $quote) . $right; - - case Type::T_INTERPOLATE: - // strip quotes if it's a string - $reduced = $this->reduce($value[1]); - - if ($reduced instanceof Number) { - return $this->compileValue($reduced, $quote); - } - - switch ($reduced[0]) { - case Type::T_LIST: - $reduced = $this->extractInterpolation($reduced); - - if ($reduced[0] !== Type::T_LIST) { - break; - } - - list(, $delim, $items) = $reduced; - - if ($delim !== ' ') { - $delim .= ' '; - } - - $filtered = []; - - foreach ($items as $item) { - if ($item[0] === Type::T_NULL) { - continue; - } - - if ($item[0] === Type::T_STRING) { - $filtered[] = $this->compileStringContent($item, $quote); - } elseif ($item[0] === Type::T_KEYWORD) { - $filtered[] = $item[1]; - } else { - $filtered[] = $this->compileValue($item, $quote); - } - } - - $reduced = [Type::T_KEYWORD, implode("$delim", $filtered)]; - break; - - case Type::T_STRING: - $reduced = [Type::T_STRING, '', [$this->compileStringContent($reduced)]]; - break; - - case Type::T_NULL: - $reduced = [Type::T_KEYWORD, '']; - } - - return $this->compileValue($reduced, $quote); - - case Type::T_NULL: - return 'null'; - - case Type::T_COMMENT: - return $this->compileCommentValue($value); - - default: - throw $this->error('unknown value type: ' . json_encode($value)); - } - } - - /** - * @param array|Number $value - * - * @return string - */ - protected function compileDebugValue($value) - { - $value = $this->reduce($value, true); - - if ($value instanceof Number) { - return $this->compileValue($value); - } - - switch ($value[0]) { - case Type::T_STRING: - return $this->compileStringContent($value); - - default: - return $this->compileValue($value); - } - } - - /** - * Flatten list - * - * @param array $list - * - * @return string - * - * @deprecated - */ - protected function flattenList($list) - { - @trigger_error(sprintf('The "%s" method is deprecated.', __METHOD__), E_USER_DEPRECATED); - - return $this->compileValue($list); - } - - /** - * Gets the text of a Sass string - * - * Calling this method on anything else than a SassString is unsupported. Use {@see assertString} first - * to ensure that the value is indeed a string. - * - * @param array $value - * - * @return string - */ - public function getStringText(array $value) - { - if ($value[0] !== Type::T_STRING) { - throw new \InvalidArgumentException('The argument is not a sass string. Did you forgot to use "assertString"?'); - } - - return $this->compileStringContent($value); - } - - /** - * Compile string content - * - * @param array $string - * @param bool $quote - * - * @return string - */ - protected function compileStringContent($string, $quote = true) - { - $parts = []; - - foreach ($string[2] as $part) { - if (\is_array($part) || $part instanceof Number) { - $parts[] = $this->compileValue($part, $quote); - } else { - $parts[] = $part; - } - } - - return implode($parts); - } - - /** - * Extract interpolation; it doesn't need to be recursive, compileValue will handle that - * - * @param array $list - * - * @return array - */ - protected function extractInterpolation($list) - { - $items = $list[2]; - - foreach ($items as $i => $item) { - if ($item[0] === Type::T_INTERPOLATE) { - $before = [Type::T_LIST, $list[1], \array_slice($items, 0, $i)]; - $after = [Type::T_LIST, $list[1], \array_slice($items, $i + 1)]; - - return [Type::T_INTERPOLATED, $item, $before, $after]; - } - } - - return $list; - } - - /** - * Find the final set of selectors - * - * @param \ScssPhp\ScssPhp\Compiler\Environment $env - * @param \ScssPhp\ScssPhp\Block $selfParent - * - * @return array - */ - protected function multiplySelectors(Environment $env, $selfParent = null) - { - $envs = $this->compactEnv($env); - $selectors = []; - $parentSelectors = [[]]; - - $selfParentSelectors = null; - - if (! \is_null($selfParent) && $selfParent->selectors) { - $selfParentSelectors = $this->evalSelectors($selfParent->selectors); - } - - while ($env = array_pop($envs)) { - if (empty($env->selectors)) { - continue; - } - - $selectors = $env->selectors; - - do { - $stillHasSelf = false; - $prevSelectors = $selectors; - $selectors = []; - - foreach ($parentSelectors as $parent) { - foreach ($prevSelectors as $selector) { - if ($selfParentSelectors) { - foreach ($selfParentSelectors as $selfParent) { - // if no '&' in the selector, each call will give same result, only add once - $s = $this->joinSelectors($parent, $selector, $stillHasSelf, $selfParent); - $selectors[serialize($s)] = $s; - } - } else { - $s = $this->joinSelectors($parent, $selector, $stillHasSelf); - $selectors[serialize($s)] = $s; - } - } - } - } while ($stillHasSelf); - - $parentSelectors = $selectors; - } - - $selectors = array_values($selectors); - - // case we are just starting a at-root : nothing to multiply but parentSelectors - if (! $selectors && $selfParentSelectors) { - $selectors = $selfParentSelectors; - } - - return $selectors; - } - - /** - * Join selectors; looks for & to replace, or append parent before child - * - * @param array $parent - * @param array $child - * @param boolean $stillHasSelf - * @param array $selfParentSelectors - - * @return array - */ - protected function joinSelectors($parent, $child, &$stillHasSelf, $selfParentSelectors = null) - { - $setSelf = false; - $out = []; - - foreach ($child as $part) { - $newPart = []; - - foreach ($part as $p) { - // only replace & once and should be recalled to be able to make combinations - if ($p === static::$selfSelector && $setSelf) { - $stillHasSelf = true; - } - - if ($p === static::$selfSelector && ! $setSelf) { - $setSelf = true; - - if (\is_null($selfParentSelectors)) { - $selfParentSelectors = $parent; - } - - foreach ($selfParentSelectors as $i => $parentPart) { - if ($i > 0) { - $out[] = $newPart; - $newPart = []; - } - - foreach ($parentPart as $pp) { - if (\is_array($pp)) { - $flatten = []; - - array_walk_recursive($pp, function ($a) use (&$flatten) { - $flatten[] = $a; - }); - - $pp = implode($flatten); - } - - $newPart[] = $pp; - } - } - } else { - $newPart[] = $p; - } - } - - $out[] = $newPart; - } - - return $setSelf ? $out : array_merge($parent, $child); - } - - /** - * Multiply media - * - * @param \ScssPhp\ScssPhp\Compiler\Environment $env - * @param array $childQueries - * - * @return array - */ - protected function multiplyMedia(Environment $env = null, $childQueries = null) - { - if ( - ! isset($env) || - ! empty($env->block->type) && $env->block->type !== Type::T_MEDIA - ) { - return $childQueries; - } - - // plain old block, skip - if (empty($env->block->type)) { - return $this->multiplyMedia($env->parent, $childQueries); - } - - $parentQueries = isset($env->block->queryList) - ? $env->block->queryList - : [[[Type::T_MEDIA_VALUE, $env->block->value]]]; - - $store = [$this->env, $this->storeEnv]; - - $this->env = $env; - $this->storeEnv = null; - $parentQueries = $this->evaluateMediaQuery($parentQueries); - - list($this->env, $this->storeEnv) = $store; - - if (\is_null($childQueries)) { - $childQueries = $parentQueries; - } else { - $originalQueries = $childQueries; - $childQueries = []; - - foreach ($parentQueries as $parentQuery) { - foreach ($originalQueries as $childQuery) { - $childQueries[] = array_merge( - $parentQuery, - [[Type::T_MEDIA_TYPE, [Type::T_KEYWORD, 'all']]], - $childQuery - ); - } - } - } - - return $this->multiplyMedia($env->parent, $childQueries); - } - - /** - * Convert env linked list to stack - * - * @param Environment $env - * - * @return Environment[] - * - * @phpstan-return non-empty-array - */ - protected function compactEnv(Environment $env) - { - for ($envs = []; $env; $env = $env->parent) { - $envs[] = $env; - } - - return $envs; - } - - /** - * Convert env stack to singly linked list - * - * @param Environment[] $envs - * - * @return Environment - * - * @phpstan-param non-empty-array $envs - */ - protected function extractEnv($envs) - { - for ($env = null; $e = array_pop($envs);) { - $e->parent = $env; - $env = $e; - } - - return $env; - } - - /** - * Push environment - * - * @param \ScssPhp\ScssPhp\Block $block - * - * @return \ScssPhp\ScssPhp\Compiler\Environment - */ - protected function pushEnv(Block $block = null) - { - $env = new Environment(); - $env->parent = $this->env; - $env->parentStore = $this->storeEnv; - $env->store = []; - $env->block = $block; - $env->depth = isset($this->env->depth) ? $this->env->depth + 1 : 0; - - $this->env = $env; - $this->storeEnv = null; - - return $env; - } - - /** - * Pop environment - * - * @return void - */ - protected function popEnv() - { - $this->storeEnv = $this->env->parentStore; - $this->env = $this->env->parent; - } - - /** - * Propagate vars from a just poped Env (used in @each and @for) - * - * @param array $store - * @param null|string[] $excludedVars - * - * @return void - */ - protected function backPropagateEnv($store, $excludedVars = null) - { - foreach ($store as $key => $value) { - if (empty($excludedVars) || ! \in_array($key, $excludedVars)) { - $this->set($key, $value, true); - } - } - } - - /** - * Get store environment - * - * @return \ScssPhp\ScssPhp\Compiler\Environment - */ - protected function getStoreEnv() - { - return isset($this->storeEnv) ? $this->storeEnv : $this->env; - } - - /** - * Set variable - * - * @param string $name - * @param mixed $value - * @param boolean $shadow - * @param \ScssPhp\ScssPhp\Compiler\Environment $env - * @param mixed $valueUnreduced - * - * @return void - */ - protected function set($name, $value, $shadow = false, Environment $env = null, $valueUnreduced = null) - { - $name = $this->normalizeName($name); - - if (! isset($env)) { - $env = $this->getStoreEnv(); - } - - if ($shadow) { - $this->setRaw($name, $value, $env, $valueUnreduced); - } else { - $this->setExisting($name, $value, $env, $valueUnreduced); - } - } - - /** - * Set existing variable - * - * @param string $name - * @param mixed $value - * @param \ScssPhp\ScssPhp\Compiler\Environment $env - * @param mixed $valueUnreduced - * - * @return void - */ - protected function setExisting($name, $value, Environment $env, $valueUnreduced = null) - { - $storeEnv = $env; - $specialContentKey = static::$namespaces['special'] . 'content'; - - $hasNamespace = $name[0] === '^' || $name[0] === '@' || $name[0] === '%'; - - $maxDepth = 10000; - - for (;;) { - if ($maxDepth-- <= 0) { - break; - } - - if (\array_key_exists($name, $env->store)) { - break; - } - - if (! $hasNamespace && isset($env->marker)) { - if (! empty($env->store[$specialContentKey])) { - $env = $env->store[$specialContentKey]->scope; - continue; - } - - if (! empty($env->declarationScopeParent)) { - $env = $env->declarationScopeParent; - continue; - } else { - $env = $storeEnv; - break; - } - } - - if (isset($env->parentStore)) { - $env = $env->parentStore; - } elseif (isset($env->parent)) { - $env = $env->parent; - } else { - $env = $storeEnv; - break; - } - } - - $env->store[$name] = $value; - - if ($valueUnreduced) { - $env->storeUnreduced[$name] = $valueUnreduced; - } - } - - /** - * Set raw variable - * - * @param string $name - * @param mixed $value - * @param \ScssPhp\ScssPhp\Compiler\Environment $env - * @param mixed $valueUnreduced - * - * @return void - */ - protected function setRaw($name, $value, Environment $env, $valueUnreduced = null) - { - $env->store[$name] = $value; - - if ($valueUnreduced) { - $env->storeUnreduced[$name] = $valueUnreduced; - } - } - - /** - * Get variable - * - * @internal - * - * @param string $name - * @param boolean $shouldThrow - * @param \ScssPhp\ScssPhp\Compiler\Environment $env - * @param boolean $unreduced - * - * @return mixed|null - */ - public function get($name, $shouldThrow = true, Environment $env = null, $unreduced = false) - { - $normalizedName = $this->normalizeName($name); - $specialContentKey = static::$namespaces['special'] . 'content'; - - if (! isset($env)) { - $env = $this->getStoreEnv(); - } - - $hasNamespace = $normalizedName[0] === '^' || $normalizedName[0] === '@' || $normalizedName[0] === '%'; - - $maxDepth = 10000; - - for (;;) { - if ($maxDepth-- <= 0) { - break; - } - - if (\array_key_exists($normalizedName, $env->store)) { - if ($unreduced && isset($env->storeUnreduced[$normalizedName])) { - return $env->storeUnreduced[$normalizedName]; - } - - return $env->store[$normalizedName]; - } - - if (! $hasNamespace && isset($env->marker)) { - if (! empty($env->store[$specialContentKey])) { - $env = $env->store[$specialContentKey]->scope; - continue; - } - - if (! empty($env->declarationScopeParent)) { - $env = $env->declarationScopeParent; - } else { - $env = $this->rootEnv; - } - continue; - } - - if (isset($env->parentStore)) { - $env = $env->parentStore; - } elseif (isset($env->parent)) { - $env = $env->parent; - } else { - break; - } - } - - if ($shouldThrow) { - throw $this->error("Undefined variable \$$name" . ($maxDepth <= 0 ? ' (infinite recursion)' : '')); - } - - // found nothing - return null; - } - - /** - * Has variable? - * - * @param string $name - * @param \ScssPhp\ScssPhp\Compiler\Environment $env - * - * @return boolean - */ - protected function has($name, Environment $env = null) - { - return ! \is_null($this->get($name, false, $env)); - } - - /** - * Inject variables - * - * @param array $args - * - * @return void - */ - protected function injectVariables(array $args) - { - if (empty($args)) { - return; - } - - $parser = $this->parserFactory(__METHOD__); - - foreach ($args as $name => $strValue) { - if ($name[0] === '$') { - $name = substr($name, 1); - } - - if (!\is_string($strValue) || ! $parser->parseValue($strValue, $value)) { - $value = $this->coerceValue($strValue); - } - - $this->set($name, $value); - } - } - - /** - * Replaces variables. - * - * @param array $variables - * - * @return void - */ - public function replaceVariables(array $variables) - { - $this->registeredVars = []; - $this->addVariables($variables); - } - - /** - * Replaces variables. - * - * @param array $variables - * - * @return void - */ - public function addVariables(array $variables) - { - $triggerWarning = false; - - foreach ($variables as $name => $value) { - if (!$value instanceof Number && !\is_array($value)) { - $triggerWarning = true; - } - - $this->registeredVars[$name] = $value; - } - - if ($triggerWarning) { - @trigger_error('Passing raw values to as custom variables to the Compiler is deprecated. Use "\ScssPhp\ScssPhp\ValueConverter::parseValue" or "\ScssPhp\ScssPhp\ValueConverter::fromPhp" to convert them instead.', E_USER_DEPRECATED); - } - } - - /** - * Set variables - * - * @api - * - * @param array $variables - * - * @return void - * - * @deprecated Use "addVariables" or "replaceVariables" instead. - */ - public function setVariables(array $variables) - { - @trigger_error('The method "setVariables" of the Compiler is deprecated. Use the "addVariables" method for the equivalent behavior or "replaceVariables" if merging with previous variables was not desired.'); - - $this->addVariables($variables); - } - - /** - * Unset variable - * - * @api - * - * @param string $name - * - * @return void - */ - public function unsetVariable($name) - { - unset($this->registeredVars[$name]); - } - - /** - * Returns list of variables - * - * @api - * - * @return array - */ - public function getVariables() - { - return $this->registeredVars; - } - - /** - * Adds to list of parsed files - * - * @internal - * - * @param string|null $path - * - * @return void - */ - public function addParsedFile($path) - { - if (! \is_null($path) && is_file($path)) { - $this->parsedFiles[realpath($path)] = filemtime($path); - } - } - - /** - * Returns list of parsed files - * - * @deprecated - * @return array - */ - public function getParsedFiles() - { - @trigger_error('The method "getParsedFiles" of the Compiler is deprecated. Use the "getIncludedFiles" method on the CompilationResult instance returned by compileString() instead. Be careful that the signature of the method is different.', E_USER_DEPRECATED); - return $this->parsedFiles; - } - - /** - * Add import path - * - * @api - * - * @param string|callable $path - * - * @return void - */ - public function addImportPath($path) - { - if (! \in_array($path, $this->importPaths)) { - $this->importPaths[] = $path; - } - } - - /** - * Set import paths - * - * @api - * - * @param string|array $path - * - * @return void - */ - public function setImportPaths($path) - { - $paths = (array) $path; - $actualImportPaths = array_filter($paths, function ($path) { - return $path !== ''; - }); - - $this->legacyCwdImportPath = \count($actualImportPaths) !== \count($paths); - - if ($this->legacyCwdImportPath) { - @trigger_error('Passing an empty string in the import paths to refer to the current working directory is deprecated. If that\'s the intended behavior, the value of "getcwd()" should be used directly instead. If this was used for resolving relative imports of the input alongside "chdir" with the source directory, the path of the input file should be passed to "compileString()" instead.', E_USER_DEPRECATED); - } - - $this->importPaths = $actualImportPaths; - } - - /** - * Set number precision - * - * @api - * - * @param integer $numberPrecision - * - * @return void - * - * @deprecated The number precision is not configurable anymore. The default is enough for all browsers. - */ - public function setNumberPrecision($numberPrecision) - { - @trigger_error('The number precision is not configurable anymore. ' - . 'The default is enough for all browsers.', E_USER_DEPRECATED); - } - - /** - * Sets the output style. - * - * @api - * - * @param string $style One of the OutputStyle constants - * - * @return void - * - * @phpstan-param OutputStyle::* $style - */ - public function setOutputStyle($style) - { - switch ($style) { - case OutputStyle::EXPANDED: - $this->formatter = Expanded::class; - break; - - case OutputStyle::COMPRESSED: - $this->formatter = Compressed::class; - break; - - default: - throw new \InvalidArgumentException(sprintf('Invalid output style "%s".', $style)); - } - } - - /** - * Set formatter - * - * @api - * - * @param string $formatterName - * - * @return void - * - * @deprecated Use {@see setOutputStyle} instead. - */ - public function setFormatter($formatterName) - { - if (!\in_array($formatterName, [Expanded::class, Compressed::class], true)) { - @trigger_error('Formatters other than Expanded and Compressed are deprecated.', E_USER_DEPRECATED); - } - @trigger_error('The method "setFormatter" is deprecated. Use "setOutputStyle" instead.', E_USER_DEPRECATED); - - $this->formatter = $formatterName; - } - - /** - * Set line number style - * - * @api - * - * @param string $lineNumberStyle - * - * @return void - * - * @deprecated The line number output is not supported anymore. Use source maps instead. - */ - public function setLineNumberStyle($lineNumberStyle) - { - @trigger_error('The line number output is not supported anymore. ' - . 'Use source maps instead.', E_USER_DEPRECATED); - } - - /** - * Enable/disable source maps - * - * @api - * - * @param integer $sourceMap - * - * @return void - * - * @phpstan-param self::SOURCE_MAP_* $sourceMap - */ - public function setSourceMap($sourceMap) - { - $this->sourceMap = $sourceMap; - } - - /** - * Set source map options - * - * @api - * - * @param array $sourceMapOptions - * - * @phpstan-param array{sourceRoot?: string, sourceMapFilename?: string|null, sourceMapURL?: string|null, sourceMapWriteTo?: string|null, outputSourceFiles?: bool, sourceMapRootpath?: string, sourceMapBasepath?: string} $sourceMapOptions - * - * @return void - */ - public function setSourceMapOptions($sourceMapOptions) - { - $this->sourceMapOptions = $sourceMapOptions; - } - - /** - * Register function - * - * @api - * - * @param string $name - * @param callable $callback - * @param string[]|null $argumentDeclaration - * - * @return void - */ - public function registerFunction($name, $callback, $argumentDeclaration = null) - { - if (self::isNativeFunction($name)) { - @trigger_error(sprintf('The "%s" function is a core sass function. Overriding it with a custom implementation through "%s" is deprecated and won\'t be supported in ScssPhp 2.0 anymore.', $name, __METHOD__), E_USER_DEPRECATED); - } - - if ($argumentDeclaration === null) { - @trigger_error('Omitting the argument declaration when registering custom function is deprecated and won\'t be supported in ScssPhp 2.0 anymore.', E_USER_DEPRECATED); - } - - $this->userFunctions[$this->normalizeName($name)] = [$callback, $argumentDeclaration]; - } - - /** - * Unregister function - * - * @api - * - * @param string $name - * - * @return void - */ - public function unregisterFunction($name) - { - unset($this->userFunctions[$this->normalizeName($name)]); - } - - /** - * Add feature - * - * @api - * - * @param string $name - * - * @return void - * - * @deprecated Registering additional features is deprecated. - */ - public function addFeature($name) - { - @trigger_error('Registering additional features is deprecated.', E_USER_DEPRECATED); - - $this->registeredFeatures[$name] = true; - } - - /** - * Import file - * - * @param string $path - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out - * - * @return void - */ - protected function importFile($path, OutputBlock $out) - { - $this->pushCallStack('import ' . $this->getPrettyPath($path)); - // see if tree is cached - $realPath = realpath($path); - - if (substr($path, -5) === '.sass') { - $this->sourceIndex = \count($this->sourceNames); - $this->sourceNames[] = $path; - $this->sourceLine = 1; - $this->sourceColumn = 1; - - throw $this->error('The Sass indented syntax is not implemented.'); - } - - if (isset($this->importCache[$realPath])) { - $this->handleImportLoop($realPath); - - $tree = $this->importCache[$realPath]; - } else { - $code = file_get_contents($path); - $parser = $this->parserFactory($path); - $tree = $parser->parse($code); - - $this->importCache[$realPath] = $tree; - } - - $currentDirectory = $this->currentDirectory; - $this->currentDirectory = dirname($path); - - $this->compileChildrenNoReturn($tree->children, $out); - $this->currentDirectory = $currentDirectory; - $this->popCallStack(); - } - - /** - * Save the imported files with their resolving path context - * - * @param string|null $currentDirectory - * @param string $path - * @param string $filePath - * - * @return void - */ - private function registerImport($currentDirectory, $path, $filePath) - { - $this->resolvedImports[] = ['currentDir' => $currentDirectory, 'path' => $path, 'filePath' => $filePath]; - } - - /** - * Detects whether the import is a CSS import. - * - * For legacy reasons, custom importers are called for those, allowing them - * to replace them with an actual Sass import. However this behavior is - * deprecated. Custom importers are expected to return null when they receive - * a CSS import. - * - * @param string $url - * - * @return bool - */ - public static function isCssImport($url) - { - return 1 === preg_match('~\.css$|^https?://|^//~', $url); - } - - /** - * Return the file path for an import url if it exists - * - * @internal - * - * @param string $url - * @param string|null $currentDir - * - * @return string|null - */ - public function findImport($url, $currentDir = null) - { - // Vanilla css and external requests. These are not meant to be Sass imports. - // Callback importers are still called for BC. - if (self::isCssImport($url)) { - foreach ($this->importPaths as $dir) { - if (\is_string($dir)) { - continue; - } - - if (\is_callable($dir)) { - // check custom callback for import path - $file = \call_user_func($dir, $url); - - if (! \is_null($file)) { - if (\is_array($dir)) { - $callableDescription = (\is_object($dir[0]) ? \get_class($dir[0]) : $dir[0]).'::'.$dir[1]; - } elseif ($dir instanceof \Closure) { - $r = new \ReflectionFunction($dir); - if (false !== strpos($r->name, '{closure}')) { - $callableDescription = sprintf('closure{%s:%s}', $r->getFileName(), $r->getStartLine()); - } elseif ($class = $r->getClosureScopeClass()) { - $callableDescription = $class->name.'::'.$r->name; - } else { - $callableDescription = $r->name; - } - } elseif (\is_object($dir)) { - $callableDescription = \get_class($dir) . '::__invoke'; - } else { - $callableDescription = 'callable'; // Fallback if we don't have a dedicated description - } - @trigger_error(sprintf('Returning a file to import for CSS or external references in custom importer callables is deprecated and will not be supported anymore in ScssPhp 2.0. This behavior is not compliant with the Sass specification. Update your "%s" importer.', $callableDescription), E_USER_DEPRECATED); - - return $file; - } - } - } - return null; - } - - if (!\is_null($currentDir)) { - $relativePath = $this->resolveImportPath($url, $currentDir); - - if (!\is_null($relativePath)) { - return $relativePath; - } - } - - foreach ($this->importPaths as $dir) { - if (\is_string($dir)) { - $path = $this->resolveImportPath($url, $dir); - - if (!\is_null($path)) { - return $path; - } - } elseif (\is_callable($dir)) { - // check custom callback for import path - $file = \call_user_func($dir, $url); - - if (! \is_null($file)) { - return $file; - } - } - } - - if ($this->legacyCwdImportPath) { - $path = $this->resolveImportPath($url, getcwd()); - - if (!\is_null($path)) { - @trigger_error('Resolving imports relatively to the current working directory is deprecated. If that\'s the intended behavior, the value of "getcwd()" should be added as an import path explicitly instead. If this was used for resolving relative imports of the input alongside "chdir" with the source directory, the path of the input file should be passed to "compileString()" instead.', E_USER_DEPRECATED); - - return $path; - } - } - - throw $this->error("`$url` file not found for @import"); - } - - /** - * @param string $url - * @param string $baseDir - * - * @return string|null - */ - private function resolveImportPath($url, $baseDir) - { - $path = Path::join($baseDir, $url); - - $hasExtension = preg_match('/.s[ac]ss$/', $url); - - if ($hasExtension) { - return $this->checkImportPathConflicts($this->tryImportPath($path)); - } - - $result = $this->checkImportPathConflicts($this->tryImportPathWithExtensions($path)); - - if (!\is_null($result)) { - return $result; - } - - return $this->tryImportPathAsDirectory($path); - } - - /** - * @param string[] $paths - * - * @return string|null - */ - private function checkImportPathConflicts(array $paths) - { - if (\count($paths) === 0) { - return null; - } - - if (\count($paths) === 1) { - return $paths[0]; - } - - $formattedPrettyPaths = []; - - foreach ($paths as $path) { - $formattedPrettyPaths[] = ' ' . $this->getPrettyPath($path); - } - - throw $this->error("It's not clear which file to import. Found:\n" . implode("\n", $formattedPrettyPaths)); - } - - /** - * @param string $path - * - * @return string[] - */ - private function tryImportPathWithExtensions($path) - { - $result = array_merge( - $this->tryImportPath($path.'.sass'), - $this->tryImportPath($path.'.scss') - ); - - if ($result) { - return $result; - } - - return $this->tryImportPath($path.'.css'); - } - - /** - * @param string $path - * - * @return string[] - */ - private function tryImportPath($path) - { - $partial = dirname($path).'/_'.basename($path); - - $candidates = []; - - if (is_file($partial)) { - $candidates[] = $partial; - } - - if (is_file($path)) { - $candidates[] = $path; - } - - return $candidates; - } - - /** - * @param string $path - * - * @return string|null - */ - private function tryImportPathAsDirectory($path) - { - if (!is_dir($path)) { - return null; - } - - return $this->checkImportPathConflicts($this->tryImportPathWithExtensions($path.'/index')); - } - - /** - * @param string|null $path - * - * @return string - */ - private function getPrettyPath($path) - { - if ($path === null) { - return '(unknown file)'; - } - - $normalizedPath = $path; - $normalizedRootDirectory = $this->rootDirectory.'/'; - - if (\DIRECTORY_SEPARATOR === '\\') { - $normalizedRootDirectory = str_replace('\\', '/', $normalizedRootDirectory); - $normalizedPath = str_replace('\\', '/', $path); - } - - if (0 === strpos($normalizedPath, $normalizedRootDirectory)) { - return substr($normalizedPath, \strlen($normalizedRootDirectory)); - } - - return $path; - } - - /** - * Set encoding - * - * @api - * - * @param string|null $encoding - * - * @return void - * - * @deprecated Non-compliant support for other encodings than UTF-8 is deprecated. - */ - public function setEncoding($encoding) - { - if (!$encoding || strtolower($encoding) === 'utf-8') { - @trigger_error(sprintf('The "%s" method is deprecated.', __METHOD__), E_USER_DEPRECATED); - } else { - @trigger_error(sprintf('The "%s" method is deprecated. Parsing will only support UTF-8 in ScssPhp 2.0. The non-UTF-8 parsing of ScssPhp 1.x is not spec compliant.', __METHOD__), E_USER_DEPRECATED); - } - - $this->encoding = $encoding; - } - - /** - * Ignore errors? - * - * @api - * - * @param boolean $ignoreErrors - * - * @return \ScssPhp\ScssPhp\Compiler - * - * @deprecated Ignoring Sass errors is not longer supported. - */ - public function setIgnoreErrors($ignoreErrors) - { - @trigger_error('Ignoring Sass errors is not longer supported.', E_USER_DEPRECATED); - - return $this; - } - - /** - * Get source position - * - * @api - * - * @return array - * - * @deprecated - */ - public function getSourcePosition() - { - @trigger_error(sprintf('The "%s" method is deprecated.', __METHOD__), E_USER_DEPRECATED); - - $sourceFile = isset($this->sourceNames[$this->sourceIndex]) ? $this->sourceNames[$this->sourceIndex] : ''; - - return [$sourceFile, $this->sourceLine, $this->sourceColumn]; - } - - /** - * Throw error (exception) - * - * @api - * - * @param string $msg Message with optional sprintf()-style vararg parameters - * - * @throws \ScssPhp\ScssPhp\Exception\CompilerException - * - * @deprecated use "error" and throw the exception in the caller instead. - */ - public function throwError($msg) - { - @trigger_error( - 'The method "throwError" is deprecated. Use "error" and throw the exception in the caller instead', - E_USER_DEPRECATED - ); - - throw $this->error(...func_get_args()); - } - - /** - * Build an error (exception) - * - * @internal - * - * @param string $msg Message with optional sprintf()-style vararg parameters - * - * @return CompilerException - */ - public function error($msg, ...$args) - { - if ($args) { - $msg = sprintf($msg, ...$args); - } - - if (! $this->ignoreCallStackMessage) { - $msg = $this->addLocationToMessage($msg); - } - - return new CompilerException($msg); - } - - /** - * @param string $msg - * - * @return string - */ - private function addLocationToMessage($msg) - { - $line = $this->sourceLine; - $column = $this->sourceColumn; - - $loc = isset($this->sourceNames[$this->sourceIndex]) - ? $this->getPrettyPath($this->sourceNames[$this->sourceIndex]) . " on line $line, at column $column" - : "line: $line, column: $column"; - - $msg = "$msg: $loc"; - - $callStackMsg = $this->callStackMessage(); - - if ($callStackMsg) { - $msg .= "\nCall Stack:\n" . $callStackMsg; - } - - return $msg; - } - - /** - * @param string $functionName - * @param array $ExpectedArgs - * @param int $nbActual - * @return CompilerException - * - * @deprecated - */ - public function errorArgsNumber($functionName, $ExpectedArgs, $nbActual) - { - @trigger_error(sprintf('The "%s" method is deprecated.', __METHOD__), E_USER_DEPRECATED); - - $nbExpected = \count($ExpectedArgs); - - if ($nbActual > $nbExpected) { - return $this->error( - 'Error: Only %d arguments allowed in %s(), but %d were passed.', - $nbExpected, - $functionName, - $nbActual - ); - } else { - $missing = []; - - while (count($ExpectedArgs) && count($ExpectedArgs) > $nbActual) { - array_unshift($missing, array_pop($ExpectedArgs)); - } - - return $this->error( - 'Error: %s() argument%s %s missing.', - $functionName, - count($missing) > 1 ? 's' : '', - implode(', ', $missing) - ); - } - } - - /** - * Beautify call stack for output - * - * @param boolean $all - * @param int|null $limit - * - * @return string - */ - protected function callStackMessage($all = false, $limit = null) - { - $callStackMsg = []; - $ncall = 0; - - if ($this->callStack) { - foreach (array_reverse($this->callStack) as $call) { - if ($all || (isset($call['n']) && $call['n'])) { - $msg = '#' . $ncall++ . ' ' . $call['n'] . ' '; - $msg .= (isset($this->sourceNames[$call[Parser::SOURCE_INDEX]]) - ? $this->getPrettyPath($this->sourceNames[$call[Parser::SOURCE_INDEX]]) - : '(unknown file)'); - $msg .= ' on line ' . $call[Parser::SOURCE_LINE]; - - $callStackMsg[] = $msg; - - if (! \is_null($limit) && $ncall > $limit) { - break; - } - } - } - } - - return implode("\n", $callStackMsg); - } - - /** - * Handle import loop - * - * @param string $name - * - * @throws \Exception - */ - protected function handleImportLoop($name) - { - for ($env = $this->env; $env; $env = $env->parent) { - if (! $env->block) { - continue; - } - - $file = $this->sourceNames[$env->block->sourceIndex]; - - if ($file === null) { - continue; - } - - if (realpath($file) === $name) { - throw $this->error('An @import loop has been found: %s imports %s', $file, basename($file)); - } - } - } - - /** - * Call SCSS @function - * - * @param Object $func - * @param array $argValues - * - * @return array|Number - */ - protected function callScssFunction($func, $argValues) - { - if (! $func) { - return static::$defaultValue; - } - $name = $func->name; - - $this->pushEnv(); - - // set the args - if (isset($func->args)) { - $this->applyArguments($func->args, $argValues); - } - - // throw away lines and children - $tmp = new OutputBlock(); - $tmp->lines = []; - $tmp->children = []; - - $this->env->marker = 'function'; - - if (! empty($func->parentEnv)) { - $this->env->declarationScopeParent = $func->parentEnv; - } else { - throw $this->error("@function $name() without parentEnv"); - } - - $ret = $this->compileChildren($func->children, $tmp, $this->env->marker . ' ' . $name); - - $this->popEnv(); - - return ! isset($ret) ? static::$defaultValue : $ret; - } - - /** - * Call built-in and registered (PHP) functions - * - * @param string $name - * @param callable $function - * @param array $prototype - * @param array $args - * - * @return array|Number|null - */ - protected function callNativeFunction($name, $function, $prototype, $args) - { - $libName = (is_array($function) ? end($function) : null); - $sorted_kwargs = $this->sortNativeFunctionArgs($libName, $prototype, $args); - - if (\is_null($sorted_kwargs)) { - return null; - } - @list($sorted, $kwargs) = $sorted_kwargs; - - if ($name !== 'if') { - foreach ($sorted as &$val) { - if ($val !== null) { - $val = $this->reduce($val, true); - } - } - } - - $returnValue = \call_user_func($function, $sorted, $kwargs); - - if (! isset($returnValue)) { - return null; - } - - if (\is_array($returnValue) || $returnValue instanceof Number) { - return $returnValue; - } - - @trigger_error(sprintf('Returning a PHP value from the "%s" custom function is deprecated. A sass value must be returned instead.', $name), E_USER_DEPRECATED); - - return $this->coerceValue($returnValue); - } - - /** - * Get built-in function - * - * @param string $name Normalized name - * - * @return array - */ - protected function getBuiltinFunction($name) - { - $libName = self::normalizeNativeFunctionName($name); - return [$this, $libName]; - } - - /** - * Normalize native function name - * - * @internal - * - * @param string $name - * - * @return string - */ - public static function normalizeNativeFunctionName($name) - { - $name = str_replace("-", "_", $name); - $libName = 'lib' . preg_replace_callback( - '/_(.)/', - function ($m) { - return ucfirst($m[1]); - }, - ucfirst($name) - ); - return $libName; - } - - /** - * Check if a function is a native built-in scss function, for css parsing - * - * @internal - * - * @param string $name - * - * @return bool - */ - public static function isNativeFunction($name) - { - return method_exists(Compiler::class, self::normalizeNativeFunctionName($name)); - } - - /** - * Sorts keyword arguments - * - * @param string $functionName - * @param array|null $prototypes - * @param array $args - * - * @return array|null - */ - protected function sortNativeFunctionArgs($functionName, $prototypes, $args) - { - static $parser = null; - - if (! isset($prototypes)) { - $keyArgs = []; - $posArgs = []; - - if (\is_array($args) && \count($args) && \end($args) === static::$null) { - array_pop($args); - } - - // separate positional and keyword arguments - foreach ($args as $arg) { - list($key, $value) = $arg; - - if (empty($key) or empty($key[1])) { - $posArgs[] = empty($arg[2]) ? $value : $arg; - } else { - $keyArgs[$key[1]] = $value; - } - } - - return [$posArgs, $keyArgs]; - } - - // specific cases ? - if (\in_array($functionName, ['libRgb', 'libRgba', 'libHsl', 'libHsla'])) { - // notation 100 127 255 / 0 is in fact a simple list of 4 values - foreach ($args as $k => $arg) { - if ($arg[1][0] === Type::T_LIST && \count($arg[1][2]) === 3) { - $args[$k][1][2] = $this->extractSlashAlphaInColorFunction($arg[1][2]); - } - } - } - - list($positionalArgs, $namedArgs, $names, $separator, $hasSplat) = $this->evaluateArguments($args, false); - - if (! \is_array(reset($prototypes))) { - $prototypes = [$prototypes]; - } - - $parsedPrototypes = array_map([$this, 'parseFunctionPrototype'], $prototypes); - assert(!empty($parsedPrototypes)); - $matchedPrototype = $this->selectFunctionPrototype($parsedPrototypes, \count($positionalArgs), $names); - - $this->verifyPrototype($matchedPrototype, \count($positionalArgs), $names, $hasSplat); - - $vars = $this->applyArgumentsToDeclaration($matchedPrototype, $positionalArgs, $namedArgs, $separator); - - $finalArgs = []; - $keyArgs = []; - - foreach ($matchedPrototype['arguments'] as $argument) { - list($normalizedName, $originalName, $default) = $argument; - - if (isset($vars[$normalizedName])) { - $value = $vars[$normalizedName]; - } else { - $value = $default; - } - - // special null value as default: translate to real null here - if ($value === [Type::T_KEYWORD, 'null']) { - $value = null; - } - - $finalArgs[] = $value; - $keyArgs[$originalName] = $value; - } - - if ($matchedPrototype['rest_argument'] !== null) { - $value = $vars[$matchedPrototype['rest_argument']]; - - $finalArgs[] = $value; - $keyArgs[$matchedPrototype['rest_argument']] = $value; - } - - return [$finalArgs, $keyArgs]; - } - - /** - * Parses a function prototype to the internal representation of arguments. - * - * The input is an array of strings describing each argument, as supported - * in {@see registerFunction}. Argument names don't include the `$`. - * The output contains the list of positional argument, with their normalized - * name (underscores are replaced by dashes), their original name (to be used - * in case of error reporting) and their default value. The output also contains - * the normalized name of the rest argument, or null if the function prototype - * is not variadic. - * - * @param string[] $prototype - * - * @return array - * @phpstan-return array{arguments: list, rest_argument: string|null} - */ - private function parseFunctionPrototype(array $prototype) - { - static $parser = null; - - $arguments = []; - $restArgument = null; - - foreach ($prototype as $p) { - if (null !== $restArgument) { - throw new \InvalidArgumentException('The argument declaration is invalid. The rest argument must be the last one.'); - } - - $default = null; - $p = explode(':', $p, 2); - $name = str_replace('_', '-', $p[0]); - - if (isset($p[1])) { - $defaultSource = trim($p[1]); - - if ($defaultSource === 'null') { - // differentiate this null from the static::$null - $default = [Type::T_KEYWORD, 'null']; - } else { - if (\is_null($parser)) { - $parser = $this->parserFactory(__METHOD__); - } - - $parser->parseValue($defaultSource, $default); - } - } - - if (substr($name, -3) === '...') { - $restArgument = substr($name, 0, -3); - } else { - $arguments[] = [$name, $p[0], $default]; - } - } - - return [ - 'arguments' => $arguments, - 'rest_argument' => $restArgument, - ]; - } - - /** - * Returns the function prototype for the given positional and named arguments. - * - * If no exact match is found, finds the closest approximation. Note that this - * doesn't guarantee that $positional and $names are valid for the returned - * prototype. - * - * @param array[] $prototypes - * @param int $positional - * @param array $names A set of names, as both keys and values - * - * @return array - * - * @phpstan-param non-empty-list, rest_argument: string|null}> $prototypes - * @phpstan-return array{arguments: list, rest_argument: string|null} - */ - private function selectFunctionPrototype(array $prototypes, $positional, array $names) - { - $fuzzyMatch = null; - $minMismatchDistance = null; - - foreach ($prototypes as $prototype) { - // Ideally, find an exact match. - if ($this->checkPrototypeMatches($prototype, $positional, $names)) { - return $prototype; - } - - $mismatchDistance = \count($prototype['arguments']) - $positional; - - if ($minMismatchDistance !== null) { - if (abs($mismatchDistance) > abs($minMismatchDistance)) { - continue; - } - - // If two overloads have the same mismatch distance, favor the overload - // that has more arguments. - if (abs($mismatchDistance) === abs($minMismatchDistance) && $mismatchDistance < 0) { - continue; - } - } - - $minMismatchDistance = $mismatchDistance; - $fuzzyMatch = $prototype; - } - - return $fuzzyMatch; - } - - /** - * Checks whether the argument invocation matches the callable prototype. - * - * The rules are similar to {@see verifyPrototype}. The boolean return value - * avoids the overhead of building and catching exceptions when the reason of - * not matching the prototype does not need to be known. - * - * @param array $prototype - * @param int $positional - * @param array $names - * - * @return bool - * - * @phpstan-param array{arguments: list, rest_argument: string|null} $prototype - */ - private function checkPrototypeMatches(array $prototype, $positional, array $names) - { - $nameUsed = 0; - - foreach ($prototype['arguments'] as $i => $argument) { - list ($name, $originalName, $default) = $argument; - - if ($i < $positional) { - if (isset($names[$name])) { - return false; - } - } elseif (isset($names[$name])) { - $nameUsed++; - } elseif ($default === null) { - return false; - } - } - - if ($prototype['rest_argument'] !== null) { - return true; - } - - if ($positional > \count($prototype['arguments'])) { - return false; - } - - if ($nameUsed < \count($names)) { - return false; - } - - return true; - } - - /** - * Verifies that the argument invocation is valid for the callable prototype. - * - * @param array $prototype - * @param int $positional - * @param array $names - * @param bool $hasSplat - * - * @return void - * - * @throws SassScriptException - * - * @phpstan-param array{arguments: list, rest_argument: string|null} $prototype - */ - private function verifyPrototype(array $prototype, $positional, array $names, $hasSplat) - { - $nameUsed = 0; - - foreach ($prototype['arguments'] as $i => $argument) { - list ($name, $originalName, $default) = $argument; - - if ($i < $positional) { - if (isset($names[$name])) { - throw new SassScriptException(sprintf('Argument $%s was passed both by position and by name.', $originalName)); - } - } elseif (isset($names[$name])) { - $nameUsed++; - } elseif ($default === null) { - throw new SassScriptException(sprintf('Missing argument $%s', $originalName)); - } - } - - if ($prototype['rest_argument'] !== null) { - return; - } - - if ($positional > \count($prototype['arguments'])) { - $message = sprintf( - 'Only %d %sargument%s allowed, but %d %s passed.', - \count($prototype['arguments']), - empty($names) ? '' : 'positional ', - \count($prototype['arguments']) === 1 ? '' : 's', - $positional, - $positional === 1 ? 'was' : 'were' - ); - if (!$hasSplat) { - throw new SassScriptException($message); - } - - $message = $this->addLocationToMessage($message); - $message .= "\nThis will be an error in future versions of Sass."; - $this->logger->warn($message, true); - } - - if ($nameUsed < \count($names)) { - $unknownNames = array_values(array_diff($names, array_column($prototype['arguments'], 0))); - $lastName = array_pop($unknownNames); - $message = sprintf( - 'No argument%s named $%s%s.', - $unknownNames ? 's' : '', - $unknownNames ? implode(', $', $unknownNames) . ' or $' : '', - $lastName - ); - throw new SassScriptException($message); - } - } - - /** - * Evaluates the argument from the invocation. - * - * This returns several things about this invocation: - * - the list of positional arguments - * - the map of named arguments, indexed by normalized names - * - the set of names used in the arguments (that's an array using the normalized names as keys for O(1) access) - * - the separator used by the list using the splat operator, if any - * - a boolean indicator whether any splat argument (list or map) was used, to support the incomplete error reporting. - * - * @param array[] $args - * @param bool $reduce Whether arguments should be reduced to their value - * - * @return array - * - * @throws SassScriptException - * - * @phpstan-return array{0: list, 1: array, 2: array, 3: string|null, 4: bool} - */ - private function evaluateArguments(array $args, $reduce = true) - { - // this represents trailing commas - if (\count($args) && end($args) === static::$null) { - array_pop($args); - } - - $splatSeparator = null; - $keywordArgs = []; - $names = []; - $positionalArgs = []; - $hasKeywordArgument = false; - $hasSplat = false; - - foreach ($args as $arg) { - if (!empty($arg[0])) { - $hasKeywordArgument = true; - - assert(\is_string($arg[0][1])); - $name = str_replace('_', '-', $arg[0][1]); - - if (isset($keywordArgs[$name])) { - throw new SassScriptException(sprintf('Duplicate named argument $%s.', $arg[0][1])); - } - - $keywordArgs[$name] = $this->maybeReduce($reduce, $arg[1]); - $names[$name] = $name; - } elseif (! empty($arg[2])) { - // $arg[2] means a var followed by ... in the arg ($list... ) - $val = $this->reduce($arg[1], true); - $hasSplat = true; - - if ($val[0] === Type::T_LIST) { - foreach ($val[2] as $item) { - if (\is_null($splatSeparator)) { - $splatSeparator = $val[1]; - } - - $positionalArgs[] = $this->maybeReduce($reduce, $item); - } - - if (isset($val[3]) && \is_array($val[3])) { - foreach ($val[3] as $name => $item) { - assert(\is_string($name)); - - $normalizedName = str_replace('_', '-', $name); - - if (isset($keywordArgs[$normalizedName])) { - throw new SassScriptException(sprintf('Duplicate named argument $%s.', $name)); - } - - $keywordArgs[$normalizedName] = $this->maybeReduce($reduce, $item); - $names[$normalizedName] = $normalizedName; - $hasKeywordArgument = true; - } - } - } elseif ($val[0] === Type::T_MAP) { - foreach ($val[1] as $i => $name) { - $name = $this->compileStringContent($this->coerceString($name)); - $item = $val[2][$i]; - - if (! is_numeric($name)) { - $normalizedName = str_replace('_', '-', $name); - - if (isset($keywordArgs[$normalizedName])) { - throw new SassScriptException(sprintf('Duplicate named argument $%s.', $name)); - } - - $keywordArgs[$normalizedName] = $this->maybeReduce($reduce, $item); - $names[$normalizedName] = $normalizedName; - $hasKeywordArgument = true; - } else { - if (\is_null($splatSeparator)) { - $splatSeparator = $val[1]; - } - - $positionalArgs[] = $this->maybeReduce($reduce, $item); - } - } - } elseif ($val[0] !== Type::T_NULL) { // values other than null are treated a single-element lists, while null is the empty list - $positionalArgs[] = $this->maybeReduce($reduce, $val); - } - } elseif ($hasKeywordArgument) { - throw new SassScriptException('Positional arguments must come before keyword arguments.'); - } else { - $positionalArgs[] = $this->maybeReduce($reduce, $arg[1]); - } - } - - return [$positionalArgs, $keywordArgs, $names, $splatSeparator, $hasSplat]; - } - - /** - * @param bool $reduce - * @param array|Number $value - * - * @return array|Number - */ - private function maybeReduce($reduce, $value) - { - if ($reduce) { - return $this->reduce($value, true); - } - - return $value; - } - - /** - * Apply argument values per definition - * - * @param array[] $argDef - * @param array|null $argValues - * @param boolean $storeInEnv - * @param boolean $reduce - * only used if $storeInEnv = false - * - * @return array - * - * @phpstan-param list $argDef - * - * @throws \Exception - */ - protected function applyArguments($argDef, $argValues, $storeInEnv = true, $reduce = true) - { - $output = []; - - if (\is_null($argValues)) { - $argValues = []; - } - - if ($storeInEnv) { - $storeEnv = $this->getStoreEnv(); - - $env = new Environment(); - $env->store = $storeEnv->store; - } - - $prototype = ['arguments' => [], 'rest_argument' => null]; - $originalRestArgumentName = null; - - foreach ($argDef as $i => $arg) { - list($name, $default, $isVariable) = $arg; - $normalizedName = str_replace('_', '-', $name); - - if ($isVariable) { - $originalRestArgumentName = $name; - $prototype['rest_argument'] = $normalizedName; - } else { - $prototype['arguments'][] = [$normalizedName, $name, !empty($default) ? $default : null]; - } - } - - list($positionalArgs, $namedArgs, $names, $splatSeparator, $hasSplat) = $this->evaluateArguments($argValues, $reduce); - - $this->verifyPrototype($prototype, \count($positionalArgs), $names, $hasSplat); - - $vars = $this->applyArgumentsToDeclaration($prototype, $positionalArgs, $namedArgs, $splatSeparator); - - foreach ($prototype['arguments'] as $argument) { - list($normalizedName, $name) = $argument; - - if (!isset($vars[$normalizedName])) { - continue; - } - - $val = $vars[$normalizedName]; - - if ($storeInEnv) { - $this->set($name, $this->reduce($val, true), true, $env); - } else { - $output[$name] = ($reduce ? $this->reduce($val, true) : $val); - } - } - - if ($prototype['rest_argument'] !== null) { - assert($originalRestArgumentName !== null); - $name = $originalRestArgumentName; - $val = $vars[$prototype['rest_argument']]; - - if ($storeInEnv) { - $this->set($name, $this->reduce($val, true), true, $env); - } else { - $output[$name] = ($reduce ? $this->reduce($val, true) : $val); - } - } - - if ($storeInEnv) { - $storeEnv->store = $env->store; - } - - foreach ($prototype['arguments'] as $argument) { - list($normalizedName, $name, $default) = $argument; - - if (isset($vars[$normalizedName])) { - continue; - } - assert($default !== null); - - if ($storeInEnv) { - $this->set($name, $this->reduce($default, true), true); - } else { - $output[$name] = ($reduce ? $this->reduce($default, true) : $default); - } - } - - return $output; - } - - /** - * Apply argument values per definition. - * - * This method assumes that the arguments are valid for the provided prototype. - * The validation with {@see verifyPrototype} must have been run before calling - * it. - * Arguments are returned as a map from the normalized argument names to the - * value. Additional arguments are collected in a sass argument list available - * under the name of the rest argument in the result. - * - * Defaults are not applied as they are resolved in a different environment. - * - * @param array $prototype - * @param array $positionalArgs - * @param array $namedArgs - * @param string|null $splatSeparator - * - * @return array - * - * @phpstan-param array{arguments: list, rest_argument: string|null} $prototype - */ - private function applyArgumentsToDeclaration(array $prototype, array $positionalArgs, array $namedArgs, $splatSeparator) - { - $output = []; - $minLength = min(\count($positionalArgs), \count($prototype['arguments'])); - - for ($i = 0; $i < $minLength; $i++) { - list($name) = $prototype['arguments'][$i]; - $val = $positionalArgs[$i]; - - $output[$name] = $val; - } - - $restNamed = $namedArgs; - - for ($i = \count($positionalArgs); $i < \count($prototype['arguments']); $i++) { - $argument = $prototype['arguments'][$i]; - list($name) = $argument; - - if (isset($namedArgs[$name])) { - $val = $namedArgs[$name]; - unset($restNamed[$name]); - } else { - continue; - } - - $output[$name] = $val; - } - - if ($prototype['rest_argument'] !== null) { - $name = $prototype['rest_argument']; - $rest = array_values(array_slice($positionalArgs, \count($prototype['arguments']))); - - $val = [Type::T_LIST, \is_null($splatSeparator) ? ',' : $splatSeparator , $rest, $restNamed]; - - $output[$name] = $val; - } - - return $output; - } - - /** - * Coerce a php value into a scss one - * - * @param mixed $value - * - * @return array|Number - */ - protected function coerceValue($value) - { - if (\is_array($value) || $value instanceof Number) { - return $value; - } - - if (\is_bool($value)) { - return $this->toBool($value); - } - - if (\is_null($value)) { - return static::$null; - } - - if (is_numeric($value)) { - return new Number($value, ''); - } - - if ($value === '') { - return static::$emptyString; - } - - $value = [Type::T_KEYWORD, $value]; - $color = $this->coerceColor($value); - - if ($color) { - return $color; - } - - return $value; - } - - /** - * Coerce something to map - * - * @param array|Number $item - * - * @return array|Number - */ - protected function coerceMap($item) - { - if ($item[0] === Type::T_MAP) { - return $item; - } - - if ( - $item[0] === Type::T_LIST && - $item[2] === [] - ) { - return static::$emptyMap; - } - - return $item; - } - - /** - * Coerce something to list - * - * @param array|Number $item - * @param string $delim - * @param boolean $removeTrailingNull - * - * @return array - */ - protected function coerceList($item, $delim = ',', $removeTrailingNull = false) - { - if ($item instanceof Number) { - return [Type::T_LIST, $delim, [$item]]; - } - - if ($item[0] === Type::T_LIST) { - // remove trailing null from the list - if ($removeTrailingNull && end($item[2]) === static::$null) { - array_pop($item[2]); - } - - return $item; - } - - if ($item[0] === Type::T_MAP) { - $keys = $item[1]; - $values = $item[2]; - $list = []; - - for ($i = 0, $s = \count($keys); $i < $s; $i++) { - $key = $keys[$i]; - $value = $values[$i]; - - switch ($key[0]) { - case Type::T_LIST: - case Type::T_MAP: - case Type::T_STRING: - case Type::T_NULL: - break; - - default: - $key = [Type::T_KEYWORD, $this->compileStringContent($this->coerceString($key))]; - break; - } - - $list[] = [ - Type::T_LIST, - '', - [$key, $value] - ]; - } - - return [Type::T_LIST, ',', $list]; - } - - return [Type::T_LIST, $delim, [$item]]; - } - - /** - * Coerce color for expression - * - * @param array|Number $value - * - * @return array|Number - */ - protected function coerceForExpression($value) - { - if ($color = $this->coerceColor($value)) { - return $color; - } - - return $value; - } - - /** - * Coerce value to color - * - * @param array|Number $value - * @param bool $inRGBFunction - * - * @return array|null - */ - protected function coerceColor($value, $inRGBFunction = false) - { - if ($value instanceof Number) { - return null; - } - - switch ($value[0]) { - case Type::T_COLOR: - for ($i = 1; $i <= 3; $i++) { - if (! is_numeric($value[$i])) { - $cv = $this->compileRGBAValue($value[$i]); - - if (! is_numeric($cv)) { - return null; - } - - $value[$i] = $cv; - } - - if (isset($value[4])) { - if (! is_numeric($value[4])) { - $cv = $this->compileRGBAValue($value[4], true); - - if (! is_numeric($cv)) { - return null; - } - - $value[4] = $cv; - } - } - } - - return $value; - - case Type::T_LIST: - if ($inRGBFunction) { - if (\count($value[2]) == 3 || \count($value[2]) == 4) { - $color = $value[2]; - array_unshift($color, Type::T_COLOR); - - return $this->coerceColor($color); - } - } - - return null; - - case Type::T_KEYWORD: - if (! \is_string($value[1])) { - return null; - } - - $name = strtolower($value[1]); - - // hexa color? - if (preg_match('/^#([0-9a-f]+)$/i', $name, $m)) { - $nofValues = \strlen($m[1]); - - if (\in_array($nofValues, [3, 4, 6, 8])) { - $nbChannels = 3; - $color = []; - $num = hexdec($m[1]); - - switch ($nofValues) { - case 4: - $nbChannels = 4; - // then continuing with the case 3: - case 3: - for ($i = 0; $i < $nbChannels; $i++) { - $t = $num & 0xf; - array_unshift($color, $t << 4 | $t); - $num >>= 4; - } - - break; - - case 8: - $nbChannels = 4; - // then continuing with the case 6: - case 6: - for ($i = 0; $i < $nbChannels; $i++) { - array_unshift($color, $num & 0xff); - $num >>= 8; - } - - break; - } - - if ($nbChannels === 4) { - if ($color[3] === 255) { - $color[3] = 1; // fully opaque - } else { - $color[3] = round($color[3] / 255, Number::PRECISION); - } - } - - array_unshift($color, Type::T_COLOR); - - return $color; - } - } - - if ($rgba = Colors::colorNameToRGBa($name)) { - return isset($rgba[3]) - ? [Type::T_COLOR, $rgba[0], $rgba[1], $rgba[2], $rgba[3]] - : [Type::T_COLOR, $rgba[0], $rgba[1], $rgba[2]]; - } - - return null; - } - - return null; - } - - /** - * @param integer|Number $value - * @param boolean $isAlpha - * - * @return integer|mixed - */ - protected function compileRGBAValue($value, $isAlpha = false) - { - if ($isAlpha) { - return $this->compileColorPartValue($value, 0, 1, false); - } - - return $this->compileColorPartValue($value, 0, 255, true); - } - - /** - * @param mixed $value - * @param integer|float $min - * @param integer|float $max - * @param boolean $isInt - * - * @return integer|mixed - */ - protected function compileColorPartValue($value, $min, $max, $isInt = true) - { - if (! is_numeric($value)) { - if (\is_array($value)) { - $reduced = $this->reduce($value); - - if ($reduced instanceof Number) { - $value = $reduced; - } - } - - if ($value instanceof Number) { - if ($value->unitless()) { - $num = $value->getDimension(); - } elseif ($value->hasUnit('%')) { - $num = $max * $value->getDimension() / 100; - } else { - throw $this->error('Expected %s to have no units or "%%".', $value); - } - - $value = $num; - } elseif (\is_array($value)) { - $value = $this->compileValue($value); - } - } - - if (is_numeric($value)) { - if ($isInt) { - $value = round($value); - } - - $value = min($max, max($min, $value)); - - return $value; - } - - return $value; - } - - /** - * Coerce value to string - * - * @param array|Number $value - * - * @return array - */ - protected function coerceString($value) - { - if ($value[0] === Type::T_STRING) { - return $value; - } - - return [Type::T_STRING, '', [$this->compileValue($value)]]; - } - - /** - * Assert value is a string - * - * This method deals with internal implementation details of the value - * representation where unquoted strings can sometimes be stored under - * other types. - * The returned value is always using the T_STRING type. - * - * @api - * - * @param array|Number $value - * @param string|null $varName - * - * @return array - * - * @throws SassScriptException - */ - public function assertString($value, $varName = null) - { - // case of url(...) parsed a a function - if ($value[0] === Type::T_FUNCTION) { - $value = $this->coerceString($value); - } - - if (! \in_array($value[0], [Type::T_STRING, Type::T_KEYWORD])) { - $value = $this->compileValue($value); - throw SassScriptException::forArgument("$value is not a string.", $varName); - } - - return $this->coerceString($value); - } - - /** - * Coerce value to a percentage - * - * @param array|Number $value - * - * @return integer|float - */ - protected function coercePercent($value) - { - if ($value instanceof Number) { - if ($value->hasUnit('%')) { - return $value->getDimension() / 100; - } - - return $value->getDimension(); - } - - return 0; - } - - /** - * Assert value is a map - * - * @api - * - * @param array|Number $value - * @param string|null $varName - * - * @return array - * - * @throws SassScriptException - */ - public function assertMap($value, $varName = null) - { - $value = $this->coerceMap($value); - - if ($value[0] !== Type::T_MAP) { - $value = $this->compileValue($value); - - throw SassScriptException::forArgument("$value is not a map.", $varName); - } - - return $value; - } - - /** - * Assert value is a list - * - * @api - * - * @param array|Number $value - * - * @return array - * - * @throws \Exception - */ - public function assertList($value) - { - if ($value[0] !== Type::T_LIST) { - throw $this->error('expecting list, %s received', $value[0]); - } - - return $value; - } - - /** - * Gets the keywords of an argument list. - * - * Keys in the returned array are normalized names (underscores are replaced with dashes) - * without the leading `$`. - * Calling this helper with anything that an argument list received for a rest argument - * of the function argument declaration is not supported. - * - * @param array|Number $value - * - * @return array - */ - public function getArgumentListKeywords($value) - { - if ($value[0] !== Type::T_LIST || !isset($value[3]) || !\is_array($value[3])) { - throw new \InvalidArgumentException('The argument is not a sass argument list.'); - } - - return $value[3]; - } - - /** - * Assert value is a color - * - * @api - * - * @param array|Number $value - * @param string|null $varName - * - * @return array - * - * @throws SassScriptException - */ - public function assertColor($value, $varName = null) - { - if ($color = $this->coerceColor($value)) { - return $color; - } - - $value = $this->compileValue($value); - - throw SassScriptException::forArgument("$value is not a color.", $varName); - } - - /** - * Assert value is a number - * - * @api - * - * @param array|Number $value - * @param string|null $varName - * - * @return Number - * - * @throws SassScriptException - */ - public function assertNumber($value, $varName = null) - { - if (!$value instanceof Number) { - $value = $this->compileValue($value); - throw SassScriptException::forArgument("$value is not a number.", $varName); - } - - return $value; - } - - /** - * Assert value is a integer - * - * @api - * - * @param array|Number $value - * @param string|null $varName - * - * @return integer - * - * @throws SassScriptException - */ - public function assertInteger($value, $varName = null) - { - $value = $this->assertNumber($value, $varName)->getDimension(); - if (round($value - \intval($value), Number::PRECISION) > 0) { - throw SassScriptException::forArgument("$value is not an integer.", $varName); - } - - return intval($value); - } - - /** - * Extract the ... / alpha on the last argument of channel arg - * in color functions - * - * @param array $args - * @return array - */ - private function extractSlashAlphaInColorFunction($args) - { - $last = end($args); - if (\count($args) === 3 && $last[0] === Type::T_EXPRESSION && $last[1] === '/') { - array_pop($args); - $args[] = $last[2]; - $args[] = $last[3]; - } - return $args; - } - - - /** - * Make sure a color's components don't go out of bounds - * - * @param array $c - * - * @return array - */ - protected function fixColor($c) - { - foreach ([1, 2, 3] as $i) { - if ($c[$i] < 0) { - $c[$i] = 0; - } - - if ($c[$i] > 255) { - $c[$i] = 255; - } - - if (!\is_int($c[$i])) { - $c[$i] = round($c[$i]); - } - } - - return $c; - } - - /** - * Convert RGB to HSL - * - * @internal - * - * @param integer $red - * @param integer $green - * @param integer $blue - * - * @return array - */ - public function toHSL($red, $green, $blue) - { - $min = min($red, $green, $blue); - $max = max($red, $green, $blue); - - $l = $min + $max; - $d = $max - $min; - - if ((int) $d === 0) { - $h = $s = 0; - } else { - if ($l < 255) { - $s = $d / $l; - } else { - $s = $d / (510 - $l); - } - - if ($red == $max) { - $h = 60 * ($green - $blue) / $d; - } elseif ($green == $max) { - $h = 60 * ($blue - $red) / $d + 120; - } elseif ($blue == $max) { - $h = 60 * ($red - $green) / $d + 240; - } - } - - return [Type::T_HSL, fmod($h, 360), $s * 100, $l / 5.1]; - } - - /** - * Hue to RGB helper - * - * @param float $m1 - * @param float $m2 - * @param float $h - * - * @return float - */ - protected function hueToRGB($m1, $m2, $h) - { - if ($h < 0) { - $h += 1; - } elseif ($h > 1) { - $h -= 1; - } - - if ($h * 6 < 1) { - return $m1 + ($m2 - $m1) * $h * 6; - } - - if ($h * 2 < 1) { - return $m2; - } - - if ($h * 3 < 2) { - return $m1 + ($m2 - $m1) * (2 / 3 - $h) * 6; - } - - return $m1; - } - - /** - * Convert HSL to RGB - * - * @internal - * - * @param int|float $hue H from 0 to 360 - * @param int|float $saturation S from 0 to 100 - * @param int|float $lightness L from 0 to 100 - * - * @return array - */ - public function toRGB($hue, $saturation, $lightness) - { - if ($hue < 0) { - $hue += 360; - } - - $h = $hue / 360; - $s = min(100, max(0, $saturation)) / 100; - $l = min(100, max(0, $lightness)) / 100; - - $m2 = $l <= 0.5 ? $l * ($s + 1) : $l + $s - $l * $s; - $m1 = $l * 2 - $m2; - - $r = $this->hueToRGB($m1, $m2, $h + 1 / 3) * 255; - $g = $this->hueToRGB($m1, $m2, $h) * 255; - $b = $this->hueToRGB($m1, $m2, $h - 1 / 3) * 255; - - $out = [Type::T_COLOR, $r, $g, $b]; - - return $out; - } - - /** - * Convert HWB to RGB - * https://www.w3.org/TR/css-color-4/#hwb-to-rgb - * - * @api - * - * @param integer $hue H from 0 to 360 - * @param integer $whiteness W from 0 to 100 - * @param integer $blackness B from 0 to 100 - * - * @return array - */ - private function HWBtoRGB($hue, $whiteness, $blackness) - { - $w = min(100, max(0, $whiteness)) / 100; - $b = min(100, max(0, $blackness)) / 100; - - $sum = $w + $b; - if ($sum > 1.0) { - $w = $w / $sum; - $b = $b / $sum; - } - $b = min(1.0 - $w, $b); - - $rgb = $this->toRGB($hue, 100, 50); - for($i = 1; $i < 4; $i++) { - $rgb[$i] *= (1.0 - $w - $b); - $rgb[$i] = round($rgb[$i] + 255 * $w + 0.0001); - } - - return $rgb; - } - - /** - * Convert RGB to HWB - * - * @api - * - * @param integer $red - * @param integer $green - * @param integer $blue - * - * @return array - */ - private function RGBtoHWB($red, $green, $blue) - { - $min = min($red, $green, $blue); - $max = max($red, $green, $blue); - - $d = $max - $min; - - if ((int) $d === 0) { - $h = 0; - } else { - - if ($red == $max) { - $h = 60 * ($green - $blue) / $d; - } elseif ($green == $max) { - $h = 60 * ($blue - $red) / $d + 120; - } elseif ($blue == $max) { - $h = 60 * ($red - $green) / $d + 240; - } - } - - return [Type::T_HWB, fmod($h, 360), $min / 255 * 100, 100 - $max / 255 *100]; - } - - - // Built in functions - - protected static $libCall = ['function', 'args...']; - protected function libCall($args) - { - $functionReference = $args[0]; - - if (in_array($functionReference[0], [Type::T_STRING, Type::T_KEYWORD])) { - $name = $this->compileStringContent($this->coerceString($functionReference)); - $warning = "Passing a string to call() is deprecated and will be illegal\n" - . "in Sass 4.0. Use call(function-reference($name)) instead."; - Warn::deprecation($warning); - $functionReference = $this->libGetFunction([$this->assertString($functionReference, 'function')]); - } - - if ($functionReference === static::$null) { - return static::$null; - } - - if (! in_array($functionReference[0], [Type::T_FUNCTION_REFERENCE, Type::T_FUNCTION])) { - throw $this->error('Function reference expected, got ' . $functionReference[0]); - } - - $callArgs = [ - [null, $args[1], true] - ]; - - return $this->reduce([Type::T_FUNCTION_CALL, $functionReference, $callArgs]); - } - - - protected static $libGetFunction = [ - ['name'], - ['name', 'css'] - ]; - protected function libGetFunction($args) - { - $name = $this->compileStringContent($this->assertString(array_shift($args), 'name')); - $isCss = false; - - if (count($args)) { - $isCss = array_shift($args); - $isCss = (($isCss === static::$true) ? true : false); - } - - if ($isCss) { - return [Type::T_FUNCTION, $name, [Type::T_LIST, ',', []]]; - } - - return $this->getFunctionReference($name, true); - } - - protected static $libIf = ['condition', 'if-true', 'if-false:']; - protected function libIf($args) - { - list($cond, $t, $f) = $args; - - if (! $this->isTruthy($this->reduce($cond, true))) { - return $this->reduce($f, true); - } - - return $this->reduce($t, true); - } - - protected static $libIndex = ['list', 'value']; - protected function libIndex($args) - { - list($list, $value) = $args; - - if ( - $list[0] === Type::T_MAP || - $list[0] === Type::T_STRING || - $list[0] === Type::T_KEYWORD || - $list[0] === Type::T_INTERPOLATE - ) { - $list = $this->coerceList($list, ' '); - } - - if ($list[0] !== Type::T_LIST) { - return static::$null; - } - - // Numbers are represented with value objects, for which the PHP equality operator does not - // match the Sass rules (and we cannot overload it). As they are the only type of values - // represented with a value object for now, they require a special case. - if ($value instanceof Number) { - $key = 0; - foreach ($list[2] as $item) { - $key++; - $itemValue = $this->normalizeValue($item); - - if ($itemValue instanceof Number && $value->equals($itemValue)) { - return new Number($key, ''); - } - } - return static::$null; - } - - $values = []; - - - foreach ($list[2] as $item) { - $values[] = $this->normalizeValue($item); - } - - $key = array_search($this->normalizeValue($value), $values); - - return false === $key ? static::$null : new Number($key + 1, ''); - } - - protected static $libRgb = [ - ['color'], - ['color', 'alpha'], - ['channels'], - ['red', 'green', 'blue'], - ['red', 'green', 'blue', 'alpha'] ]; - protected function libRgb($args, $kwargs, $funcName = 'rgb') - { - switch (\count($args)) { - case 1: - if (! $color = $this->coerceColor($args[0], true)) { - $color = [Type::T_STRING, '', [$funcName . '(', $args[0], ')']]; - } - break; - - case 3: - $color = [Type::T_COLOR, $args[0], $args[1], $args[2]]; - - if (! $color = $this->coerceColor($color)) { - $color = [Type::T_STRING, '', [$funcName . '(', $args[0], ', ', $args[1], ', ', $args[2], ')']]; - } - - return $color; - - case 2: - if ($color = $this->coerceColor($args[0], true)) { - $alpha = $this->compileRGBAValue($args[1], true); - - if (is_numeric($alpha)) { - $color[4] = $alpha; - } else { - $color = [Type::T_STRING, '', - [$funcName . '(', $color[1], ', ', $color[2], ', ', $color[3], ', ', $alpha, ')']]; - } - } else { - $color = [Type::T_STRING, '', [$funcName . '(', $args[0], ')']]; - } - break; - - case 4: - default: - $color = [Type::T_COLOR, $args[0], $args[1], $args[2], $args[3]]; - - if (! $color = $this->coerceColor($color)) { - $color = [Type::T_STRING, '', - [$funcName . '(', $args[0], ', ', $args[1], ', ', $args[2], ', ', $args[3], ')']]; - } - break; - } - - return $color; - } - - protected static $libRgba = [ - ['color'], - ['color', 'alpha'], - ['channels'], - ['red', 'green', 'blue'], - ['red', 'green', 'blue', 'alpha'] ]; - protected function libRgba($args, $kwargs) - { - return $this->libRgb($args, $kwargs, 'rgba'); - } - - /** - * Helper function for adjust_color, change_color, and scale_color - * - * @param array $args - * @param string $operation - * @param callable $fn - * - * @return array - * - * @phpstan-param callable(float|int, float|int|null, float|int): (float|int) $fn - */ - protected function alterColor(array $args, $operation, $fn) - { - $color = $this->assertColor($args[0], 'color'); - - if ($args[1][2]) { - throw new SassScriptException('Only one positional argument is allowed. All other arguments must be passed by name.'); - } - - $kwargs = $this->getArgumentListKeywords($args[1]); - - $scale = $operation === 'scale'; - $change = $operation === 'change'; - - /** - * @param string $name - * @param float|int $max - * @param bool $checkPercent - * @param bool $assertPercent - * - * @return float|int|null - */ - $getParam = function ($name, $max, $checkPercent = false, $assertPercent = false) use (&$kwargs, $scale, $change) { - if (!isset($kwargs[$name])) { - return null; - } - - $number = $this->assertNumber($kwargs[$name], $name); - unset($kwargs[$name]); - - if (!$scale && $checkPercent) { - if (!$number->hasUnit('%')) { - $warning = $this->error("{$name} Passing a number `$number` without unit % is deprecated."); - $this->logger->warn($warning->getMessage(), true); - } - } - - if ($scale || $assertPercent) { - $number->assertUnit('%', $name); - } - - if ($scale) { - $max = 100; - } - - return $number->valueInRange($change ? 0 : -$max, $max, $name); - }; - - $alpha = $getParam('alpha', 1); - $red = $getParam('red', 255); - $green = $getParam('green', 255); - $blue = $getParam('blue', 255); - - if ($scale || !isset($kwargs['hue'])) { - $hue = null; - } else { - $hueNumber = $this->assertNumber($kwargs['hue'], 'hue'); - unset($kwargs['hue']); - $hue = $hueNumber->getDimension(); - } - $saturation = $getParam('saturation', 100, true); - $lightness = $getParam('lightness', 100, true); - $whiteness = $getParam('whiteness', 100, false, true); - $blackness = $getParam('blackness', 100, false, true); - - if (!empty($kwargs)) { - $unknownNames = array_keys($kwargs); - $lastName = array_pop($unknownNames); - $message = sprintf( - 'No argument%s named $%s%s.', - $unknownNames ? 's' : '', - $unknownNames ? implode(', $', $unknownNames) . ' or $' : '', - $lastName - ); - throw new SassScriptException($message); - } - - $hasRgb = $red !== null || $green !== null || $blue !== null; - $hasSL = $saturation !== null || $lightness !== null; - $hasWB = $whiteness !== null || $blackness !== null; - $found = false; - - if ($hasRgb && ($hasSL || $hasWB || $hue !== null)) { - throw new SassScriptException(sprintf('RGB parameters may not be passed along with %s parameters.', $hasWB ? 'HWB' : 'HSL')); - } - - if ($hasWB && $hasSL) { - throw new SassScriptException('HSL parameters may not be passed along with HWB parameters.'); - } - - if ($hasRgb) { - $color[1] = round($fn($color[1], $red, 255)); - $color[2] = round($fn($color[2], $green, 255)); - $color[3] = round($fn($color[3], $blue, 255)); - } elseif ($hasWB) { - $hwb = $this->RGBtoHWB($color[1], $color[2], $color[3]); - if ($hue !== null) { - $hwb[1] = $change ? $hue : $hwb[1] + $hue; - } - $hwb[2] = $fn($hwb[2], $whiteness, 100); - $hwb[3] = $fn($hwb[3], $blackness, 100); - - $rgb = $this->HWBtoRGB($hwb[1], $hwb[2], $hwb[3]); - - if (isset($color[4])) { - $rgb[4] = $color[4]; - } - - $color = $rgb; - } elseif ($hue !== null || $hasSL) { - $hsl = $this->toHSL($color[1], $color[2], $color[3]); - - if ($hue !== null) { - $hsl[1] = $change ? $hue : $hsl[1] + $hue; - } - $hsl[2] = $fn($hsl[2], $saturation, 100); - $hsl[3] = $fn($hsl[3], $lightness, 100); - - $rgb = $this->toRGB($hsl[1], $hsl[2], $hsl[3]); - - if (isset($color[4])) { - $rgb[4] = $color[4]; - } - - $color = $rgb; - } - - if ($alpha !== null) { - $existingAlpha = isset($color[4]) ? $color[4] : 1; - $color[4] = $fn($existingAlpha, $alpha, 1); - } - - return $color; - } - - protected static $libAdjustColor = ['color', 'kwargs...']; - protected function libAdjustColor($args) - { - return $this->alterColor($args, 'adjust', function ($base, $alter, $max) { - if ($alter === null) { - return $base; - } - - $new = $base + $alter; - - if ($new < 0) { - return 0; - } - - if ($new > $max) { - return $max; - } - - return $new; - }); - } - - protected static $libChangeColor = ['color', 'kwargs...']; - protected function libChangeColor($args) - { - return $this->alterColor($args,'change', function ($base, $alter, $max) { - if ($alter === null) { - return $base; - } - - return $alter; - }); - } - - protected static $libScaleColor = ['color', 'kwargs...']; - protected function libScaleColor($args) - { - return $this->alterColor($args, 'scale', function ($base, $scale, $max) { - if ($scale === null) { - return $base; - } - - $scale = $scale / 100; - - if ($scale < 0) { - return $base * $scale + $base; - } - - return ($max - $base) * $scale + $base; - }); - } - - protected static $libIeHexStr = ['color']; - protected function libIeHexStr($args) - { - $color = $this->coerceColor($args[0]); - - if (\is_null($color)) { - throw $this->error('Error: argument `$color` of `ie-hex-str($color)` must be a color'); - } - - $color[4] = isset($color[4]) ? round(255 * $color[4]) : 255; - - return [Type::T_STRING, '', [sprintf('#%02X%02X%02X%02X', $color[4], $color[1], $color[2], $color[3])]]; - } - - protected static $libRed = ['color']; - protected function libRed($args) - { - $color = $this->coerceColor($args[0]); - - if (\is_null($color)) { - throw $this->error('Error: argument `$color` of `red($color)` must be a color'); - } - - return new Number((int) $color[1], ''); - } - - protected static $libGreen = ['color']; - protected function libGreen($args) - { - $color = $this->coerceColor($args[0]); - - if (\is_null($color)) { - throw $this->error('Error: argument `$color` of `green($color)` must be a color'); - } - - return new Number((int) $color[2], ''); - } - - protected static $libBlue = ['color']; - protected function libBlue($args) - { - $color = $this->coerceColor($args[0]); - - if (\is_null($color)) { - throw $this->error('Error: argument `$color` of `blue($color)` must be a color'); - } - - return new Number((int) $color[3], ''); - } - - protected static $libAlpha = ['color']; - protected function libAlpha($args) - { - if ($color = $this->coerceColor($args[0])) { - return new Number(isset($color[4]) ? $color[4] : 1, ''); - } - - // this might be the IE function, so return value unchanged - return null; - } - - protected static $libOpacity = ['color']; - protected function libOpacity($args) - { - $value = $args[0]; - - if ($value instanceof Number) { - return null; - } - - return $this->libAlpha($args); - } - - // mix two colors - protected static $libMix = [ - ['color1', 'color2', 'weight:0.5'], - ['color-1', 'color-2', 'weight:0.5'] - ]; - protected function libMix($args) - { - list($first, $second, $weight) = $args; - - $first = $this->assertColor($first, 'color1'); - $second = $this->assertColor($second, 'color2'); - $weight = $this->coercePercent($this->assertNumber($weight, 'weight')); - - $firstAlpha = isset($first[4]) ? $first[4] : 1; - $secondAlpha = isset($second[4]) ? $second[4] : 1; - - $w = $weight * 2 - 1; - $a = $firstAlpha - $secondAlpha; - - $w1 = (($w * $a === -1 ? $w : ($w + $a) / (1 + $w * $a)) + 1) / 2.0; - $w2 = 1.0 - $w1; - - $new = [Type::T_COLOR, - $w1 * $first[1] + $w2 * $second[1], - $w1 * $first[2] + $w2 * $second[2], - $w1 * $first[3] + $w2 * $second[3], - ]; - - if ($firstAlpha != 1.0 || $secondAlpha != 1.0) { - $new[] = $firstAlpha * $weight + $secondAlpha * (1 - $weight); - } - - return $this->fixColor($new); - } - - protected static $libHsl = [ - ['channels'], - ['hue', 'saturation'], - ['hue', 'saturation', 'lightness'], - ['hue', 'saturation', 'lightness', 'alpha'] ]; - protected function libHsl($args, $kwargs, $funcName = 'hsl') - { - $args_to_check = $args; - - if (\count($args) == 1) { - if ($args[0][0] !== Type::T_LIST || \count($args[0][2]) < 3 || \count($args[0][2]) > 4) { - return [Type::T_STRING, '', [$funcName . '(', $args[0], ')']]; - } - - $args = $args[0][2]; - $args_to_check = $kwargs['channels'][2]; - } - - if (\count($args) === 2) { - // if var() is used as an argument, return as a css function - foreach ($args as $arg) { - if ($arg[0] === Type::T_FUNCTION && in_array($arg[1], ['var'])) { - return null; - } - } - - throw new SassScriptException('Missing argument $lightness.'); - } - - foreach ($kwargs as $k => $arg) { - if (in_array($arg[0], [Type::T_FUNCTION_CALL, Type::T_FUNCTION]) && in_array($arg[1], ['min', 'max'])) { - return null; - } - } - - foreach ($args_to_check as $k => $arg) { - if (in_array($arg[0], [Type::T_FUNCTION_CALL, Type::T_FUNCTION]) && in_array($arg[1], ['min', 'max'])) { - if (count($kwargs) > 1 || ($k >= 2 && count($args) === 4)) { - return null; - } - - $args[$k] = $this->stringifyFncallArgs($arg); - } - - if ( - $k >= 2 && count($args) === 4 && - in_array($arg[0], [Type::T_FUNCTION_CALL, Type::T_FUNCTION]) && - in_array($arg[1], ['calc','env']) - ) { - return null; - } - } - - $hue = $this->reduce($args[0]); - $saturation = $this->reduce($args[1]); - $lightness = $this->reduce($args[2]); - $alpha = null; - - if (\count($args) === 4) { - $alpha = $this->compileColorPartValue($args[3], 0, 100, false); - - if (!$hue instanceof Number || !$saturation instanceof Number || ! $lightness instanceof Number || ! is_numeric($alpha)) { - return [Type::T_STRING, '', - [$funcName . '(', $args[0], ', ', $args[1], ', ', $args[2], ', ', $args[3], ')']]; - } - } else { - if (!$hue instanceof Number || !$saturation instanceof Number || ! $lightness instanceof Number) { - return [Type::T_STRING, '', [$funcName . '(', $args[0], ', ', $args[1], ', ', $args[2], ')']]; - } - } - - $hueValue = $hue->getDimension() % 360; - - while ($hueValue < 0) { - $hueValue += 360; - } - - $color = $this->toRGB($hueValue, max(0, min($saturation->getDimension(), 100)), max(0, min($lightness->getDimension(), 100))); - - if (! \is_null($alpha)) { - $color[4] = $alpha; - } - - return $color; - } - - protected static $libHsla = [ - ['channels'], - ['hue', 'saturation'], - ['hue', 'saturation', 'lightness'], - ['hue', 'saturation', 'lightness', 'alpha']]; - protected function libHsla($args, $kwargs) - { - return $this->libHsl($args, $kwargs, 'hsla'); - } - - protected static $libHue = ['color']; - protected function libHue($args) - { - $color = $this->assertColor($args[0], 'color'); - $hsl = $this->toHSL($color[1], $color[2], $color[3]); - - return new Number($hsl[1], 'deg'); - } - - protected static $libSaturation = ['color']; - protected function libSaturation($args) - { - $color = $this->assertColor($args[0], 'color'); - $hsl = $this->toHSL($color[1], $color[2], $color[3]); - - return new Number($hsl[2], '%'); - } - - protected static $libLightness = ['color']; - protected function libLightness($args) - { - $color = $this->assertColor($args[0], 'color'); - $hsl = $this->toHSL($color[1], $color[2], $color[3]); - - return new Number($hsl[3], '%'); - } - - /* - * Todo : a integrer dans le futur module color - protected static $libHwb = [ - ['channels'], - ['hue', 'whiteness', 'blackness'], - ['hue', 'whiteness', 'blackness', 'alpha'] ]; - protected function libHwb($args, $kwargs, $funcName = 'hwb') - { - $args_to_check = $args; - - if (\count($args) == 1) { - if ($args[0][0] !== Type::T_LIST) { - throw $this->error("Missing elements \$whiteness and \$blackness"); - } - - if (\trim($args[0][1])) { - throw $this->error("\$channels must be a space-separated list."); - } - - if (! empty($args[0]['enclosing'])) { - throw $this->error("\$channels must be an unbracketed list."); - } - - $args = $args[0][2]; - if (\count($args) > 3) { - throw $this->error("hwb() : Only 3 elements are allowed but ". \count($args) . "were passed"); - } - - $args_to_check = $this->extractSlashAlphaInColorFunction($kwargs['channels'][2]); - if (\count($args_to_check) !== \count($kwargs['channels'][2])) { - $args = $args_to_check; - } - } - - if (\count($args_to_check) < 2) { - throw $this->error("Missing elements \$whiteness and \$blackness"); - } - if (\count($args_to_check) < 3) { - throw $this->error("Missing element \$blackness"); - } - if (\count($args_to_check) > 4) { - throw $this->error("hwb() : Only 4 elements are allowed but ". \count($args) . "were passed"); - } - - foreach ($kwargs as $k => $arg) { - if (in_array($arg[0], [Type::T_FUNCTION_CALL]) && in_array($arg[1], ['min', 'max'])) { - return null; - } - } - - foreach ($args_to_check as $k => $arg) { - if (in_array($arg[0], [Type::T_FUNCTION_CALL]) && in_array($arg[1], ['min', 'max'])) { - if (count($kwargs) > 1 || ($k >= 2 && count($args) === 4)) { - return null; - } - - $args[$k] = $this->stringifyFncallArgs($arg); - } - - if ( - $k >= 2 && count($args) === 4 && - in_array($arg[0], [Type::T_FUNCTION_CALL, Type::T_FUNCTION]) && - in_array($arg[1], ['calc','env']) - ) { - return null; - } - } - - $hue = $this->reduce($args[0]); - $whiteness = $this->reduce($args[1]); - $blackness = $this->reduce($args[2]); - $alpha = null; - - if (\count($args) === 4) { - $alpha = $this->compileColorPartValue($args[3], 0, 1, false); - - if (! \is_numeric($alpha)) { - $val = $this->compileValue($args[3]); - throw $this->error("\$alpha: $val is not a number"); - } - } - - $this->assertNumber($hue, 'hue'); - $this->assertUnit($whiteness, ['%'], 'whiteness'); - $this->assertUnit($blackness, ['%'], 'blackness'); - - $this->assertRange($whiteness, 0, 100, "0% and 100%", "whiteness"); - $this->assertRange($blackness, 0, 100, "0% and 100%", "blackness"); - - $w = $whiteness->getDimension(); - $b = $blackness->getDimension(); - - $hueValue = $hue->getDimension() % 360; - - while ($hueValue < 0) { - $hueValue += 360; - } - - $color = $this->HWBtoRGB($hueValue, $w, $b); - - if (! \is_null($alpha)) { - $color[4] = $alpha; - } - - return $color; - } - - protected static $libWhiteness = ['color']; - protected function libWhiteness($args, $kwargs, $funcName = 'whiteness') { - - $color = $this->assertColor($args[0]); - $hwb = $this->RGBtoHWB($color[1], $color[2], $color[3]); - - return new Number($hwb[2], '%'); - } - - protected static $libBlackness = ['color']; - protected function libBlackness($args, $kwargs, $funcName = 'blackness') { - - $color = $this->assertColor($args[0]); - $hwb = $this->RGBtoHWB($color[1], $color[2], $color[3]); - - return new Number($hwb[3], '%'); - } - */ - - protected function adjustHsl($color, $idx, $amount) - { - $hsl = $this->toHSL($color[1], $color[2], $color[3]); - $hsl[$idx] += $amount; - $out = $this->toRGB($hsl[1], $hsl[2], $hsl[3]); - - if (isset($color[4])) { - $out[4] = $color[4]; - } - - return $out; - } - - protected static $libAdjustHue = ['color', 'degrees']; - protected function libAdjustHue($args) - { - $color = $this->assertColor($args[0], 'color'); - $degrees = $this->assertNumber($args[1], 'degrees')->getDimension(); - - return $this->adjustHsl($color, 1, $degrees); - } - - protected static $libLighten = ['color', 'amount']; - protected function libLighten($args) - { - $color = $this->assertColor($args[0], 'color'); - $amount = Util::checkRange('amount', new Range(0, 100), $args[1], '%'); - - return $this->adjustHsl($color, 3, $amount); - } - - protected static $libDarken = ['color', 'amount']; - protected function libDarken($args) - { - $color = $this->assertColor($args[0], 'color'); - $amount = Util::checkRange('amount', new Range(0, 100), $args[1], '%'); - - return $this->adjustHsl($color, 3, -$amount); - } - - protected static $libSaturate = [['color', 'amount'], ['amount']]; - protected function libSaturate($args) - { - $value = $args[0]; - - if (count($args) === 1) { - $this->assertNumber($args[0], 'amount'); - - return null; - } - - $color = $this->assertColor($value, 'color'); - $amount = 100 * $this->coercePercent($this->assertNumber($args[1], 'amount')); - - return $this->adjustHsl($color, 2, $amount); - } - - protected static $libDesaturate = ['color', 'amount']; - protected function libDesaturate($args) - { - $color = $this->assertColor($args[0], 'color'); - $amount = 100 * $this->coercePercent($this->assertNumber($args[1], 'amount')); - - return $this->adjustHsl($color, 2, -$amount); - } - - protected static $libGrayscale = ['color']; - protected function libGrayscale($args) - { - $value = $args[0]; - - if ($value instanceof Number) { - return null; - } - - return $this->adjustHsl($this->assertColor($value, 'color'), 2, -100); - } - - protected static $libComplement = ['color']; - protected function libComplement($args) - { - return $this->adjustHsl($this->assertColor($args[0], 'color'), 1, 180); - } - - protected static $libInvert = ['color', 'weight:1']; - protected function libInvert($args) - { - $value = $args[0]; - - if ($value instanceof Number) { - return null; - } - - $weight = $this->coercePercent($this->assertNumber($args[1], 'weight')); - - $color = $this->assertColor($value, 'color'); - $inverted = $color; - $inverted[1] = 255 - $inverted[1]; - $inverted[2] = 255 - $inverted[2]; - $inverted[3] = 255 - $inverted[3]; - - if ($weight < 1) { - return $this->libMix([$inverted, $color, new Number($weight, '')]); - } - - return $inverted; - } - - // increases opacity by amount - protected static $libOpacify = ['color', 'amount']; - protected function libOpacify($args) - { - $color = $this->assertColor($args[0], 'color'); - $amount = $this->coercePercent($this->assertNumber($args[1], 'amount')); - - $color[4] = (isset($color[4]) ? $color[4] : 1) + $amount; - $color[4] = min(1, max(0, $color[4])); - - return $color; - } - - protected static $libFadeIn = ['color', 'amount']; - protected function libFadeIn($args) - { - return $this->libOpacify($args); - } - - // decreases opacity by amount - protected static $libTransparentize = ['color', 'amount']; - protected function libTransparentize($args) - { - $color = $this->assertColor($args[0], 'color'); - $amount = $this->coercePercent($this->assertNumber($args[1], 'amount')); - - $color[4] = (isset($color[4]) ? $color[4] : 1) - $amount; - $color[4] = min(1, max(0, $color[4])); - - return $color; - } - - protected static $libFadeOut = ['color', 'amount']; - protected function libFadeOut($args) - { - return $this->libTransparentize($args); - } - - protected static $libUnquote = ['string']; - protected function libUnquote($args) - { - try { - $str = $this->assertString($args[0], 'string'); - } catch (SassScriptException $e) { - $value = $this->compileValue($args[0]); - $fname = $this->getPrettyPath($this->sourceNames[$this->sourceIndex]); - $line = $this->sourceLine; - - $message = "Passing $value, a non-string value, to unquote() -will be an error in future versions of Sass.\n on line $line of $fname"; - - $this->logger->warn($message, true); - - return $args[0]; - } - - $str[1] = ''; - - return $str; - } - - protected static $libQuote = ['string']; - protected function libQuote($args) - { - $value = $this->assertString($args[0], 'string'); - - $value[1] = '"'; - - return $value; - } - - protected static $libPercentage = ['number']; - protected function libPercentage($args) - { - $num = $this->assertNumber($args[0], 'number'); - $num->assertNoUnits('number'); - - return new Number($num->getDimension() * 100, '%'); - } - - protected static $libRound = ['number']; - protected function libRound($args) - { - $num = $this->assertNumber($args[0], 'number'); - - return new Number(round($num->getDimension()), $num->getNumeratorUnits(), $num->getDenominatorUnits()); - } - - protected static $libFloor = ['number']; - protected function libFloor($args) - { - $num = $this->assertNumber($args[0], 'number'); - - return new Number(floor($num->getDimension()), $num->getNumeratorUnits(), $num->getDenominatorUnits()); - } - - protected static $libCeil = ['number']; - protected function libCeil($args) - { - $num = $this->assertNumber($args[0], 'number'); - - return new Number(ceil($num->getDimension()), $num->getNumeratorUnits(), $num->getDenominatorUnits()); - } - - protected static $libAbs = ['number']; - protected function libAbs($args) - { - $num = $this->assertNumber($args[0], 'number'); - - return new Number(abs($num->getDimension()), $num->getNumeratorUnits(), $num->getDenominatorUnits()); - } - - protected static $libMin = ['numbers...']; - protected function libMin($args) - { - /** - * @var Number|null - */ - $min = null; - - foreach ($args[0][2] as $arg) { - $number = $this->assertNumber($arg); - - if (\is_null($min) || $min->greaterThan($number)) { - $min = $number; - } - } - - if (!\is_null($min)) { - return $min; - } - - throw $this->error('At least one argument must be passed.'); - } - - protected static $libMax = ['numbers...']; - protected function libMax($args) - { - /** - * @var Number|null - */ - $max = null; - - foreach ($args[0][2] as $arg) { - $number = $this->assertNumber($arg); - - if (\is_null($max) || $max->lessThan($number)) { - $max = $number; - } - } - - if (!\is_null($max)) { - return $max; - } - - throw $this->error('At least one argument must be passed.'); - } - - protected static $libLength = ['list']; - protected function libLength($args) - { - $list = $this->coerceList($args[0], ',', true); - - return new Number(\count($list[2]), ''); - } - - protected static $libListSeparator = ['list']; - protected function libListSeparator($args) - { - if (! \in_array($args[0][0], [Type::T_LIST, Type::T_MAP])) { - return [Type::T_KEYWORD, 'space']; - } - - $list = $this->coerceList($args[0]); - - if (\count($list[2]) <= 1 && empty($list['enclosing'])) { - return [Type::T_KEYWORD, 'space']; - } - - if ($list[1] === ',') { - return [Type::T_KEYWORD, 'comma']; - } - - return [Type::T_KEYWORD, 'space']; - } - - protected static $libNth = ['list', 'n']; - protected function libNth($args) - { - $list = $this->coerceList($args[0], ',', false); - $n = $this->assertNumber($args[1])->getDimension(); - - if ($n > 0) { - $n--; - } elseif ($n < 0) { - $n += \count($list[2]); - } - - return isset($list[2][$n]) ? $list[2][$n] : static::$defaultValue; - } - - protected static $libSetNth = ['list', 'n', 'value']; - protected function libSetNth($args) - { - $list = $this->coerceList($args[0]); - $n = $this->assertNumber($args[1])->getDimension(); - - if ($n > 0) { - $n--; - } elseif ($n < 0) { - $n += \count($list[2]); - } - - if (! isset($list[2][$n])) { - throw $this->error('Invalid argument for "n"'); - } - - $list[2][$n] = $args[2]; - - return $list; - } - - protected static $libMapGet = ['map', 'key']; - protected function libMapGet($args) - { - $map = $this->assertMap($args[0], 'map'); - $key = $args[1]; - - if (! \is_null($key)) { - $key = $this->compileStringContent($this->coerceString($key)); - - for ($i = \count($map[1]) - 1; $i >= 0; $i--) { - if ($key === $this->compileStringContent($this->coerceString($map[1][$i]))) { - return $map[2][$i]; - } - } - } - - return static::$null; - } - - protected static $libMapKeys = ['map']; - protected function libMapKeys($args) - { - $map = $this->assertMap($args[0], 'map'); - $keys = $map[1]; - - return [Type::T_LIST, ',', $keys]; - } - - protected static $libMapValues = ['map']; - protected function libMapValues($args) - { - $map = $this->assertMap($args[0], 'map'); - $values = $map[2]; - - return [Type::T_LIST, ',', $values]; - } - - protected static $libMapRemove = [ - ['map'], - ['map', 'key', 'keys...'], - ]; - protected function libMapRemove($args) - { - $map = $this->assertMap($args[0], 'map'); - - if (\count($args) === 1) { - return $map; - } - - $keys = []; - $keys[] = $this->compileStringContent($this->coerceString($args[1])); - - foreach ($args[2][2] as $key) { - $keys[] = $this->compileStringContent($this->coerceString($key)); - } - - for ($i = \count($map[1]) - 1; $i >= 0; $i--) { - if (in_array($this->compileStringContent($this->coerceString($map[1][$i])), $keys)) { - array_splice($map[1], $i, 1); - array_splice($map[2], $i, 1); - } - } - - return $map; - } - - protected static $libMapHasKey = ['map', 'key']; - protected function libMapHasKey($args) - { - $map = $this->assertMap($args[0], 'map'); - - return $this->toBool($this->mapHasKey($map, $args[1])); - } - - /** - * @param array|Number $keyValue - * - * @return bool - */ - private function mapHasKey(array $map, $keyValue) - { - $key = $this->compileStringContent($this->coerceString($keyValue)); - - for ($i = \count($map[1]) - 1; $i >= 0; $i--) { - if ($key === $this->compileStringContent($this->coerceString($map[1][$i]))) { - return true; - } - } - - return false; - } - - protected static $libMapMerge = [ - ['map1', 'map2'], - ['map-1', 'map-2'] - ]; - protected function libMapMerge($args) - { - $map1 = $this->assertMap($args[0], 'map1'); - $map2 = $this->assertMap($args[1], 'map2'); - - foreach ($map2[1] as $i2 => $key2) { - $key = $this->compileStringContent($this->coerceString($key2)); - - foreach ($map1[1] as $i1 => $key1) { - if ($key === $this->compileStringContent($this->coerceString($key1))) { - $map1[2][$i1] = $map2[2][$i2]; - continue 2; - } - } - - $map1[1][] = $map2[1][$i2]; - $map1[2][] = $map2[2][$i2]; - } - - return $map1; - } - - protected static $libKeywords = ['args']; - protected function libKeywords($args) - { - $value = $args[0]; - - if ($value[0] !== Type::T_LIST || !isset($value[3]) || !\is_array($value[3])) { - $compiledValue = $this->compileValue($value); - - throw SassScriptException::forArgument($compiledValue . ' is not an argument list.', 'args'); - } - - $keys = []; - $values = []; - - foreach ($this->getArgumentListKeywords($value) as $name => $arg) { - $keys[] = [Type::T_KEYWORD, $name]; - $values[] = $arg; - } - - return [Type::T_MAP, $keys, $values]; - } - - protected static $libIsBracketed = ['list']; - protected function libIsBracketed($args) - { - $list = $args[0]; - $this->coerceList($list, ' '); - - if (! empty($list['enclosing']) && $list['enclosing'] === 'bracket') { - return self::$true; - } - - return self::$false; - } - - /** - * @param array $list1 - * @param array|Number|null $sep - * - * @return string - * @throws CompilerException - */ - protected function listSeparatorForJoin($list1, $sep) - { - if (! isset($sep)) { - return $list1[1]; - } - - switch ($this->compileValue($sep)) { - case 'comma': - return ','; - - case 'space': - return ' '; - - default: - return $list1[1]; - } - } - - protected static $libJoin = ['list1', 'list2', 'separator:null', 'bracketed:auto']; - protected function libJoin($args) - { - list($list1, $list2, $sep, $bracketed) = $args; - - $list1 = $this->coerceList($list1, ' ', true); - $list2 = $this->coerceList($list2, ' ', true); - $sep = $this->listSeparatorForJoin($list1, $sep); - - if ($bracketed === static::$true) { - $bracketed = true; - } elseif ($bracketed === static::$false) { - $bracketed = false; - } elseif ($bracketed === [Type::T_KEYWORD, 'auto']) { - $bracketed = 'auto'; - } elseif ($bracketed === static::$null) { - $bracketed = false; - } else { - $bracketed = $this->compileValue($bracketed); - $bracketed = ! ! $bracketed; - - if ($bracketed === true) { - $bracketed = true; - } - } - - if ($bracketed === 'auto') { - $bracketed = false; - - if (! empty($list1['enclosing']) && $list1['enclosing'] === 'bracket') { - $bracketed = true; - } - } - - $res = [Type::T_LIST, $sep, array_merge($list1[2], $list2[2])]; - - if (isset($list1['enclosing'])) { - $res['enlcosing'] = $list1['enclosing']; - } - - if ($bracketed) { - $res['enclosing'] = 'bracket'; - } - - return $res; - } - - protected static $libAppend = ['list', 'val', 'separator:null']; - protected function libAppend($args) - { - list($list1, $value, $sep) = $args; - - $list1 = $this->coerceList($list1, ' ', true); - $sep = $this->listSeparatorForJoin($list1, $sep); - $res = [Type::T_LIST, $sep, array_merge($list1[2], [$value])]; - - if (isset($list1['enclosing'])) { - $res['enclosing'] = $list1['enclosing']; - } - - return $res; - } - - protected static $libZip = ['lists...']; - protected function libZip($args) - { - $argLists = []; - foreach ($args[0][2] as $arg) { - $argLists[] = $this->coerceList($arg); - } - - $lists = []; - $firstList = array_shift($argLists); - - $result = [Type::T_LIST, ',', $lists]; - if (! \is_null($firstList)) { - foreach ($firstList[2] as $key => $item) { - $list = [Type::T_LIST, '', [$item]]; - - foreach ($argLists as $arg) { - if (isset($arg[2][$key])) { - $list[2][] = $arg[2][$key]; - } else { - break 2; - } - } - - $lists[] = $list; - } - - $result[2] = $lists; - } else { - $result['enclosing'] = 'parent'; - } - - return $result; - } - - protected static $libTypeOf = ['value']; - protected function libTypeOf($args) - { - $value = $args[0]; - - return [Type::T_KEYWORD, $this->getTypeOf($value)]; - } - - /** - * @param array|Number $value - * - * @return string - */ - private function getTypeOf($value) - { - switch ($value[0]) { - case Type::T_KEYWORD: - if ($value === static::$true || $value === static::$false) { - return 'bool'; - } - - if ($this->coerceColor($value)) { - return 'color'; - } - - // fall-thru - case Type::T_FUNCTION: - return 'string'; - - case Type::T_FUNCTION_REFERENCE: - return 'function'; - - case Type::T_LIST: - if (isset($value[3]) && \is_array($value[3])) { - return 'arglist'; - } - - // fall-thru - default: - return $value[0]; - } - } - - protected static $libUnit = ['number']; - protected function libUnit($args) - { - $num = $this->assertNumber($args[0], 'number'); - - return [Type::T_STRING, '"', [$num->unitStr()]]; - } - - protected static $libUnitless = ['number']; - protected function libUnitless($args) - { - $value = $this->assertNumber($args[0], 'number'); - - return $this->toBool($value->unitless()); - } - - protected static $libComparable = [ - ['number1', 'number2'], - ['number-1', 'number-2'] - ]; - protected function libComparable($args) - { - list($number1, $number2) = $args; - - if ( - ! $number1 instanceof Number || - ! $number2 instanceof Number - ) { - throw $this->error('Invalid argument(s) for "comparable"'); - } - - return $this->toBool($number1->isComparableTo($number2)); - } - - protected static $libStrIndex = ['string', 'substring']; - protected function libStrIndex($args) - { - $string = $this->assertString($args[0], 'string'); - $stringContent = $this->compileStringContent($string); - - $substring = $this->assertString($args[1], 'substring'); - $substringContent = $this->compileStringContent($substring); - - if (! \strlen($substringContent)) { - $result = 0; - } else { - $result = Util::mbStrpos($stringContent, $substringContent); - } - - return $result === false ? static::$null : new Number($result + 1, ''); - } - - protected static $libStrInsert = ['string', 'insert', 'index']; - protected function libStrInsert($args) - { - $string = $this->assertString($args[0], 'string'); - $stringContent = $this->compileStringContent($string); - - $insert = $this->assertString($args[1], 'insert'); - $insertContent = $this->compileStringContent($insert); - - $index = $this->assertInteger($args[2], 'index'); - if ($index > 0) { - $index = $index - 1; - } - if ($index < 0) { - $index = Util::mbStrlen($stringContent) + 1 + $index; - } - - $string[2] = [ - Util::mbSubstr($stringContent, 0, $index), - $insertContent, - Util::mbSubstr($stringContent, $index) - ]; - - return $string; - } - - protected static $libStrLength = ['string']; - protected function libStrLength($args) - { - $string = $this->assertString($args[0], 'string'); - $stringContent = $this->compileStringContent($string); - - return new Number(Util::mbStrlen($stringContent), ''); - } - - protected static $libStrSlice = ['string', 'start-at', 'end-at:-1']; - protected function libStrSlice($args) - { - $string = $this->assertString($args[0], 'string'); - $stringContent = $this->compileStringContent($string); - - $start = $this->assertNumber($args[1], 'start-at'); - $start->assertNoUnits('start-at'); - $startInt = $this->assertInteger($start, 'start-at'); - $end = $this->assertNumber($args[2], 'end-at'); - $end->assertNoUnits('end-at'); - $endInt = $this->assertInteger($end, 'end-at'); - - if ($endInt === 0) { - return [Type::T_STRING, $string[1], []]; - } - - if ($startInt > 0) { - $startInt--; - } - - if ($endInt < 0) { - $endInt = Util::mbStrlen($stringContent) + $endInt; - } else { - $endInt--; - } - - if ($endInt < $startInt) { - return [Type::T_STRING, $string[1], []]; - } - - $length = $endInt - $startInt + 1; // The end of the slice is inclusive - - $string[2] = [Util::mbSubstr($stringContent, $startInt, $length)]; - - return $string; - } - - protected static $libToLowerCase = ['string']; - protected function libToLowerCase($args) - { - $string = $this->assertString($args[0], 'string'); - $stringContent = $this->compileStringContent($string); - - $string[2] = [$this->stringTransformAsciiOnly($stringContent, 'strtolower')]; - - return $string; - } - - protected static $libToUpperCase = ['string']; - protected function libToUpperCase($args) - { - $string = $this->assertString($args[0], 'string'); - $stringContent = $this->compileStringContent($string); - - $string[2] = [$this->stringTransformAsciiOnly($stringContent, 'strtoupper')]; - - return $string; - } - - /** - * Apply a filter on a string content, only on ascii chars - * let extended chars untouched - * - * @param string $stringContent - * @param callable $filter - * @return string - */ - protected function stringTransformAsciiOnly($stringContent, $filter) - { - $mblength = Util::mbStrlen($stringContent); - if ($mblength === strlen($stringContent)) { - return $filter($stringContent); - } - $filteredString = ""; - for ($i = 0; $i < $mblength; $i++) { - $char = Util::mbSubstr($stringContent, $i, 1); - if (strlen($char) > 1) { - $filteredString .= $char; - } else { - $filteredString .= $filter($char); - } - } - - return $filteredString; - } - - protected static $libFeatureExists = ['feature']; - protected function libFeatureExists($args) - { - $string = $this->assertString($args[0], 'feature'); - $name = $this->compileStringContent($string); - - return $this->toBool( - \array_key_exists($name, $this->registeredFeatures) ? $this->registeredFeatures[$name] : false - ); - } - - protected static $libFunctionExists = ['name']; - protected function libFunctionExists($args) - { - $string = $this->assertString($args[0], 'name'); - $name = $this->compileStringContent($string); - - // user defined functions - if ($this->has(static::$namespaces['function'] . $name)) { - return self::$true; - } - - $name = $this->normalizeName($name); - - if (isset($this->userFunctions[$name])) { - return self::$true; - } - - // built-in functions - $f = $this->getBuiltinFunction($name); - - return $this->toBool(\is_callable($f)); - } - - protected static $libGlobalVariableExists = ['name']; - protected function libGlobalVariableExists($args) - { - $string = $this->assertString($args[0], 'name'); - $name = $this->compileStringContent($string); - - return $this->toBool($this->has($name, $this->rootEnv)); - } - - protected static $libMixinExists = ['name']; - protected function libMixinExists($args) - { - $string = $this->assertString($args[0], 'name'); - $name = $this->compileStringContent($string); - - return $this->toBool($this->has(static::$namespaces['mixin'] . $name)); - } - - protected static $libVariableExists = ['name']; - protected function libVariableExists($args) - { - $string = $this->assertString($args[0], 'name'); - $name = $this->compileStringContent($string); - - return $this->toBool($this->has($name)); - } - - protected static $libCounter = ['args...']; - /** - * Workaround IE7's content counter bug. - * - * @param array $args - * - * @return array - */ - protected function libCounter($args) - { - $list = array_map([$this, 'compileValue'], $args[0][2]); - - return [Type::T_STRING, '', ['counter(' . implode(',', $list) . ')']]; - } - - protected static $libRandom = ['limit:null']; - protected function libRandom($args) - { - if (isset($args[0]) && $args[0] !== static::$null) { - $n = $this->assertInteger($args[0], 'limit'); - - if ($n < 1) { - throw new SassScriptException("\$limit: Must be greater than 0, was $n."); - } - - return new Number(mt_rand(1, $n), ''); - } - - $max = mt_getrandmax(); - return new Number(mt_rand(0, $max - 1) / $max, ''); - } - - protected static $libUniqueId = []; - protected function libUniqueId() - { - static $id; - - if (! isset($id)) { - $id = PHP_INT_SIZE === 4 - ? mt_rand(0, pow(36, 5)) . str_pad(mt_rand(0, pow(36, 5)) % 10000000, 7, '0', STR_PAD_LEFT) - : mt_rand(0, pow(36, 8)); - } - - $id += mt_rand(0, 10) + 1; - - return [Type::T_STRING, '', ['u' . str_pad(base_convert($id, 10, 36), 8, '0', STR_PAD_LEFT)]]; - } - - /** - * @param array|Number $value - * @param bool $force_enclosing_display - * - * @return array - */ - protected function inspectFormatValue($value, $force_enclosing_display = false) - { - if ($value === static::$null) { - $value = [Type::T_KEYWORD, 'null']; - } - - $stringValue = [$value]; - - if ($value instanceof Number) { - return [Type::T_STRING, '', $stringValue]; - } - - if ($value[0] === Type::T_LIST) { - if (end($value[2]) === static::$null) { - array_pop($value[2]); - $value[2][] = [Type::T_STRING, '', ['']]; - $force_enclosing_display = true; - } - - if ( - ! empty($value['enclosing']) && - ($force_enclosing_display || - ($value['enclosing'] === 'bracket') || - ! \count($value[2])) - ) { - $value['enclosing'] = 'forced_' . $value['enclosing']; - $force_enclosing_display = true; - } - - foreach ($value[2] as $k => $listelement) { - $value[2][$k] = $this->inspectFormatValue($listelement, $force_enclosing_display); - } - - $stringValue = [$value]; - } - - return [Type::T_STRING, '', $stringValue]; - } - - protected static $libInspect = ['value']; - protected function libInspect($args) - { - $value = $args[0]; - - return $this->inspectFormatValue($value); - } - - /** - * Preprocess selector args - * - * @param array $arg - * @param string|null $varname - * @param bool $allowParent - * - * @return array - */ - protected function getSelectorArg($arg, $varname = null, $allowParent = false) - { - static $parser = null; - - if (\is_null($parser)) { - $parser = $this->parserFactory(__METHOD__); - } - - if (! $this->checkSelectorArgType($arg)) { - $var_value = $this->compileValue($arg); - throw SassScriptException::forArgument("$var_value is not a valid selector: it must be a string, a list of strings, or a list of lists of strings", $varname); - } - - - if ($arg[0] === Type::T_STRING) { - $arg[1] = ''; - } - $arg = $this->compileValue($arg); - - $parsedSelector = []; - - if ($parser->parseSelector($arg, $parsedSelector, true)) { - $selector = $this->evalSelectors($parsedSelector); - $gluedSelector = $this->glueFunctionSelectors($selector); - - if (! $allowParent) { - foreach ($gluedSelector as $selector) { - foreach ($selector as $s) { - if (in_array(static::$selfSelector, $s)) { - throw SassScriptException::forArgument("Parent selectors aren't allowed here.", $varname); - } - } - } - } - - return $gluedSelector; - } - - throw SassScriptException::forArgument("expected more input, invalid selector.", $varname); - } - - /** - * Check variable type for getSelectorArg() function - * @param array $arg - * @param int $maxDepth - * @return bool - */ - protected function checkSelectorArgType($arg, $maxDepth = 2) - { - if ($arg[0] === Type::T_LIST && $maxDepth > 0) { - foreach ($arg[2] as $elt) { - if (! $this->checkSelectorArgType($elt, $maxDepth - 1)) { - return false; - } - } - return true; - } - if (!in_array($arg[0], [Type::T_STRING, Type::T_KEYWORD])) { - return false; - } - return true; - } - - /** - * Postprocess selector to output in right format - * - * @param array $selectors - * - * @return array - */ - protected function formatOutputSelector($selectors) - { - $selectors = $this->collapseSelectorsAsList($selectors); - - return $selectors; - } - - protected static $libIsSuperselector = ['super', 'sub']; - protected function libIsSuperselector($args) - { - list($super, $sub) = $args; - - $super = $this->getSelectorArg($super, 'super'); - $sub = $this->getSelectorArg($sub, 'sub'); - - return $this->toBool($this->isSuperSelector($super, $sub)); - } - - /** - * Test a $super selector again $sub - * - * @param array $super - * @param array $sub - * - * @return boolean - */ - protected function isSuperSelector($super, $sub) - { - // one and only one selector for each arg - if (! $super) { - throw $this->error('Invalid super selector for isSuperSelector()'); - } - - if (! $sub) { - throw $this->error('Invalid sub selector for isSuperSelector()'); - } - - if (count($sub) > 1) { - foreach ($sub as $s) { - if (! $this->isSuperSelector($super, [$s])) { - return false; - } - } - return true; - } - - if (count($super) > 1) { - foreach ($super as $s) { - if ($this->isSuperSelector([$s], $sub)) { - return true; - } - } - return false; - } - - $super = reset($super); - $sub = reset($sub); - - $i = 0; - $nextMustMatch = false; - - foreach ($super as $node) { - $compound = ''; - - array_walk_recursive( - $node, - function ($value, $key) use (&$compound) { - $compound .= $value; - } - ); - - if ($this->isImmediateRelationshipCombinator($compound)) { - if ($node !== $sub[$i]) { - return false; - } - - $nextMustMatch = true; - $i++; - } else { - while ($i < \count($sub) && ! $this->isSuperPart($node, $sub[$i])) { - if ($nextMustMatch) { - return false; - } - - $i++; - } - - if ($i >= \count($sub)) { - return false; - } - - $nextMustMatch = false; - $i++; - } - } - - return true; - } - - /** - * Test a part of super selector again a part of sub selector - * - * @param array $superParts - * @param array $subParts - * - * @return boolean - */ - protected function isSuperPart($superParts, $subParts) - { - $i = 0; - - foreach ($superParts as $superPart) { - while ($i < \count($subParts) && $subParts[$i] !== $superPart) { - $i++; - } - - if ($i >= \count($subParts)) { - return false; - } - - $i++; - } - - return true; - } - - protected static $libSelectorAppend = ['selector...']; - protected function libSelectorAppend($args) - { - // get the selector... list - $args = reset($args); - $args = $args[2]; - - if (\count($args) < 1) { - throw $this->error('selector-append() needs at least 1 argument'); - } - - $selectors = []; - foreach ($args as $arg) { - $selectors[] = $this->getSelectorArg($arg, 'selector'); - } - - return $this->formatOutputSelector($this->selectorAppend($selectors)); - } - - /** - * Append parts of the last selector in the list to the previous, recursively - * - * @param array $selectors - * - * @return array - * - * @throws \ScssPhp\ScssPhp\Exception\CompilerException - */ - protected function selectorAppend($selectors) - { - $lastSelectors = array_pop($selectors); - - if (! $lastSelectors) { - throw $this->error('Invalid selector list in selector-append()'); - } - - while (\count($selectors)) { - $previousSelectors = array_pop($selectors); - - if (! $previousSelectors) { - throw $this->error('Invalid selector list in selector-append()'); - } - - // do the trick, happening $lastSelector to $previousSelector - $appended = []; - - foreach ($lastSelectors as $lastSelector) { - $previous = $previousSelectors; - - foreach ($lastSelector as $lastSelectorParts) { - foreach ($lastSelectorParts as $lastSelectorPart) { - foreach ($previous as $i => $previousSelector) { - foreach ($previousSelector as $j => $previousSelectorParts) { - $previous[$i][$j][] = $lastSelectorPart; - } - } - } - } - - foreach ($previous as $ps) { - $appended[] = $ps; - } - } - - $lastSelectors = $appended; - } - - return $lastSelectors; - } - - protected static $libSelectorExtend = [ - ['selector', 'extendee', 'extender'], - ['selectors', 'extendee', 'extender'] - ]; - protected function libSelectorExtend($args) - { - list($selectors, $extendee, $extender) = $args; - - $selectors = $this->getSelectorArg($selectors, 'selector'); - $extendee = $this->getSelectorArg($extendee, 'extendee'); - $extender = $this->getSelectorArg($extender, 'extender'); - - if (! $selectors || ! $extendee || ! $extender) { - throw $this->error('selector-extend() invalid arguments'); - } - - $extended = $this->extendOrReplaceSelectors($selectors, $extendee, $extender); - - return $this->formatOutputSelector($extended); - } - - protected static $libSelectorReplace = [ - ['selector', 'original', 'replacement'], - ['selectors', 'original', 'replacement'] - ]; - protected function libSelectorReplace($args) - { - list($selectors, $original, $replacement) = $args; - - $selectors = $this->getSelectorArg($selectors, 'selector'); - $original = $this->getSelectorArg($original, 'original'); - $replacement = $this->getSelectorArg($replacement, 'replacement'); - - if (! $selectors || ! $original || ! $replacement) { - throw $this->error('selector-replace() invalid arguments'); - } - - $replaced = $this->extendOrReplaceSelectors($selectors, $original, $replacement, true); - - return $this->formatOutputSelector($replaced); - } - - /** - * Extend/replace in selectors - * used by selector-extend and selector-replace that use the same logic - * - * @param array $selectors - * @param array $extendee - * @param array $extender - * @param boolean $replace - * - * @return array - */ - protected function extendOrReplaceSelectors($selectors, $extendee, $extender, $replace = false) - { - $saveExtends = $this->extends; - $saveExtendsMap = $this->extendsMap; - - $this->extends = []; - $this->extendsMap = []; - - foreach ($extendee as $es) { - if (\count($es) !== 1) { - throw $this->error('Can\'t extend complex selector.'); - } - - // only use the first one - $this->pushExtends(reset($es), $extender, null); - } - - $extended = []; - - foreach ($selectors as $selector) { - if (! $replace) { - $extended[] = $selector; - } - - $n = \count($extended); - - $this->matchExtends($selector, $extended); - - // if didnt match, keep the original selector if we are in a replace operation - if ($replace && \count($extended) === $n) { - $extended[] = $selector; - } - } - - $this->extends = $saveExtends; - $this->extendsMap = $saveExtendsMap; - - return $extended; - } - - protected static $libSelectorNest = ['selector...']; - protected function libSelectorNest($args) - { - // get the selector... list - $args = reset($args); - $args = $args[2]; - - if (\count($args) < 1) { - throw $this->error('selector-nest() needs at least 1 argument'); - } - - $selectorsMap = []; - foreach ($args as $arg) { - $selectorsMap[] = $this->getSelectorArg($arg, 'selector', true); - } - - $envs = []; - - foreach ($selectorsMap as $selectors) { - $env = new Environment(); - $env->selectors = $selectors; - - $envs[] = $env; - } - - $envs = array_reverse($envs); - $env = $this->extractEnv($envs); - $outputSelectors = $this->multiplySelectors($env); - - return $this->formatOutputSelector($outputSelectors); - } - - protected static $libSelectorParse = [ - ['selector'], - ['selectors'] - ]; - protected function libSelectorParse($args) - { - $selectors = reset($args); - $selectors = $this->getSelectorArg($selectors, 'selector'); - - return $this->formatOutputSelector($selectors); - } - - protected static $libSelectorUnify = ['selectors1', 'selectors2']; - protected function libSelectorUnify($args) - { - list($selectors1, $selectors2) = $args; - - $selectors1 = $this->getSelectorArg($selectors1, 'selectors1'); - $selectors2 = $this->getSelectorArg($selectors2, 'selectors2'); - - if (! $selectors1 || ! $selectors2) { - throw $this->error('selector-unify() invalid arguments'); - } - - // only consider the first compound of each - $compound1 = reset($selectors1); - $compound2 = reset($selectors2); - - // unify them and that's it - $unified = $this->unifyCompoundSelectors($compound1, $compound2); - - return $this->formatOutputSelector($unified); - } - - /** - * The selector-unify magic as its best - * (at least works as expected on test cases) - * - * @param array $compound1 - * @param array $compound2 - * - * @return array - */ - protected function unifyCompoundSelectors($compound1, $compound2) - { - if (! \count($compound1)) { - return $compound2; - } - - if (! \count($compound2)) { - return $compound1; - } - - // check that last part are compatible - $lastPart1 = array_pop($compound1); - $lastPart2 = array_pop($compound2); - $last = $this->mergeParts($lastPart1, $lastPart2); - - if (! $last) { - return [[]]; - } - - $unifiedCompound = [$last]; - $unifiedSelectors = [$unifiedCompound]; - - // do the rest - while (\count($compound1) || \count($compound2)) { - $part1 = end($compound1); - $part2 = end($compound2); - - if ($part1 && ($match2 = $this->matchPartInCompound($part1, $compound2))) { - list($compound2, $part2, $after2) = $match2; - - if ($after2) { - $unifiedSelectors = $this->prependSelectors($unifiedSelectors, $after2); - } - - $c = $this->mergeParts($part1, $part2); - $unifiedSelectors = $this->prependSelectors($unifiedSelectors, [$c]); - - $part1 = $part2 = null; - - array_pop($compound1); - } - - if ($part2 && ($match1 = $this->matchPartInCompound($part2, $compound1))) { - list($compound1, $part1, $after1) = $match1; - - if ($after1) { - $unifiedSelectors = $this->prependSelectors($unifiedSelectors, $after1); - } - - $c = $this->mergeParts($part2, $part1); - $unifiedSelectors = $this->prependSelectors($unifiedSelectors, [$c]); - - $part1 = $part2 = null; - - array_pop($compound2); - } - - $new = []; - - if ($part1 && $part2) { - array_pop($compound1); - array_pop($compound2); - - $s = $this->prependSelectors($unifiedSelectors, [$part2]); - $new = array_merge($new, $this->prependSelectors($s, [$part1])); - $s = $this->prependSelectors($unifiedSelectors, [$part1]); - $new = array_merge($new, $this->prependSelectors($s, [$part2])); - } elseif ($part1) { - array_pop($compound1); - - $new = array_merge($new, $this->prependSelectors($unifiedSelectors, [$part1])); - } elseif ($part2) { - array_pop($compound2); - - $new = array_merge($new, $this->prependSelectors($unifiedSelectors, [$part2])); - } - - if ($new) { - $unifiedSelectors = $new; - } - } - - return $unifiedSelectors; - } - - /** - * Prepend each selector from $selectors with $parts - * - * @param array $selectors - * @param array $parts - * - * @return array - */ - protected function prependSelectors($selectors, $parts) - { - $new = []; - - foreach ($selectors as $compoundSelector) { - array_unshift($compoundSelector, $parts); - - $new[] = $compoundSelector; - } - - return $new; - } - - /** - * Try to find a matching part in a compound: - * - with same html tag name - * - with some class or id or something in common - * - * @param array $part - * @param array $compound - * - * @return array|false - */ - protected function matchPartInCompound($part, $compound) - { - $partTag = $this->findTagName($part); - $before = $compound; - $after = []; - - // try to find a match by tag name first - while (\count($before)) { - $p = array_pop($before); - - if ($partTag && $partTag !== '*' && $partTag == $this->findTagName($p)) { - return [$before, $p, $after]; - } - - $after[] = $p; - } - - // try again matching a non empty intersection and a compatible tagname - $before = $compound; - $after = []; - - while (\count($before)) { - $p = array_pop($before); - - if ($this->checkCompatibleTags($partTag, $this->findTagName($p))) { - if (\count(array_intersect($part, $p))) { - return [$before, $p, $after]; - } - } - - $after[] = $p; - } - - return false; - } - - /** - * Merge two part list taking care that - * - the html tag is coming first - if any - * - the :something are coming last - * - * @param array $parts1 - * @param array $parts2 - * - * @return array - */ - protected function mergeParts($parts1, $parts2) - { - $tag1 = $this->findTagName($parts1); - $tag2 = $this->findTagName($parts2); - $tag = $this->checkCompatibleTags($tag1, $tag2); - - // not compatible tags - if ($tag === false) { - return []; - } - - if ($tag) { - if ($tag1) { - $parts1 = array_diff($parts1, [$tag1]); - } - - if ($tag2) { - $parts2 = array_diff($parts2, [$tag2]); - } - } - - $mergedParts = array_merge($parts1, $parts2); - $mergedOrderedParts = []; - - foreach ($mergedParts as $part) { - if (strpos($part, ':') === 0) { - $mergedOrderedParts[] = $part; - } - } - - $mergedParts = array_diff($mergedParts, $mergedOrderedParts); - $mergedParts = array_merge($mergedParts, $mergedOrderedParts); - - if ($tag) { - array_unshift($mergedParts, $tag); - } - - return $mergedParts; - } - - /** - * Check the compatibility between two tag names: - * if both are defined they should be identical or one has to be '*' - * - * @param string $tag1 - * @param string $tag2 - * - * @return array|false - */ - protected function checkCompatibleTags($tag1, $tag2) - { - $tags = [$tag1, $tag2]; - $tags = array_unique($tags); - $tags = array_filter($tags); - - if (\count($tags) > 1) { - $tags = array_diff($tags, ['*']); - } - - // not compatible nodes - if (\count($tags) > 1) { - return false; - } - - return $tags; - } - - /** - * Find the html tag name in a selector parts list - * - * @param string[] $parts - * - * @return string - */ - protected function findTagName($parts) - { - foreach ($parts as $part) { - if (! preg_match('/^[\[.:#%_-]/', $part)) { - return $part; - } - } - - return ''; - } - - protected static $libSimpleSelectors = ['selector']; - protected function libSimpleSelectors($args) - { - $selector = reset($args); - $selector = $this->getSelectorArg($selector, 'selector'); - - // remove selectors list layer, keeping the first one - $selector = reset($selector); - - // remove parts list layer, keeping the first part - $part = reset($selector); - - $listParts = []; - - foreach ($part as $p) { - $listParts[] = [Type::T_STRING, '', [$p]]; - } - - return [Type::T_LIST, ',', $listParts]; - } - - protected static $libScssphpGlob = ['pattern']; - protected function libScssphpGlob($args) - { - @trigger_error(sprintf('The "scssphp-glob" function is deprecated an will be removed in ScssPhp 2.0. Register your own alternative through "%s::registerFunction', __CLASS__), E_USER_DEPRECATED); - - $this->logger->warn('The "scssphp-glob" function is deprecated an will be removed in ScssPhp 2.0.', true); - - $string = $this->assertString($args[0], 'pattern'); - $pattern = $this->compileStringContent($string); - $matches = glob($pattern); - $listParts = []; - - foreach ($matches as $match) { - if (! is_file($match)) { - continue; - } - - $listParts[] = [Type::T_STRING, '"', [$match]]; - } - - return [Type::T_LIST, ',', $listParts]; - } -} diff --git a/vendor/scssphp/scssphp/src/Compiler/CachedResult.php b/vendor/scssphp/scssphp/src/Compiler/CachedResult.php deleted file mode 100644 index a6629199..00000000 --- a/vendor/scssphp/scssphp/src/Compiler/CachedResult.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ - private $parsedFiles; - - /** - * @var array - * @phpstan-var list - */ - private $resolvedImports; - - /** - * @param CompilationResult $result - * @param array $parsedFiles - * @param array $resolvedImports - * - * @phpstan-param list $resolvedImports - */ - public function __construct(CompilationResult $result, array $parsedFiles, array $resolvedImports) - { - $this->result = $result; - $this->parsedFiles = $parsedFiles; - $this->resolvedImports = $resolvedImports; - } - - /** - * @return CompilationResult - */ - public function getResult() - { - return $this->result; - } - - /** - * @return array - */ - public function getParsedFiles() - { - return $this->parsedFiles; - } - - /** - * @return array - * - * @phpstan-return list - */ - public function getResolvedImports() - { - return $this->resolvedImports; - } -} diff --git a/vendor/scssphp/scssphp/src/Compiler/Environment.php b/vendor/scssphp/scssphp/src/Compiler/Environment.php deleted file mode 100644 index 306b15a6..00000000 --- a/vendor/scssphp/scssphp/src/Compiler/Environment.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @internal - */ -class Environment -{ - /** - * @var \ScssPhp\ScssPhp\Block|null - */ - public $block; - - /** - * @var \ScssPhp\ScssPhp\Compiler\Environment|null - */ - public $parent; - - /** - * @var array - */ - public $store; - - /** - * @var array - */ - public $storeUnreduced; - - /** - * @var integer - */ - public $depth; -} diff --git a/vendor/scssphp/scssphp/src/Exception/CompilerException.php b/vendor/scssphp/scssphp/src/Exception/CompilerException.php deleted file mode 100644 index 0b00cf52..00000000 --- a/vendor/scssphp/scssphp/src/Exception/CompilerException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * @internal - */ -class CompilerException extends \Exception implements SassException -{ -} diff --git a/vendor/scssphp/scssphp/src/Exception/ParserException.php b/vendor/scssphp/scssphp/src/Exception/ParserException.php deleted file mode 100644 index 00d77ec9..00000000 --- a/vendor/scssphp/scssphp/src/Exception/ParserException.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * @internal - */ -class ParserException extends \Exception implements SassException -{ - /** - * @var array - */ - private $sourcePosition; - - /** - * Get source position - * - * @api - */ - public function getSourcePosition() - { - return $this->sourcePosition; - } - - /** - * Set source position - * - * @api - * - * @param array $sourcePosition - */ - public function setSourcePosition($sourcePosition) - { - $this->sourcePosition = $sourcePosition; - } -} diff --git a/vendor/scssphp/scssphp/src/Exception/RangeException.php b/vendor/scssphp/scssphp/src/Exception/RangeException.php deleted file mode 100644 index 4be4dee7..00000000 --- a/vendor/scssphp/scssphp/src/Exception/RangeException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * @internal - */ -class RangeException extends \Exception implements SassException -{ -} diff --git a/vendor/scssphp/scssphp/src/Exception/SassException.php b/vendor/scssphp/scssphp/src/Exception/SassException.php deleted file mode 100644 index 9f62b3cd..00000000 --- a/vendor/scssphp/scssphp/src/Exception/SassException.php +++ /dev/null @@ -1,7 +0,0 @@ - - * - * @deprecated The Scssphp server should define its own exception instead. - */ -class ServerException extends \Exception implements SassException -{ -} diff --git a/vendor/scssphp/scssphp/src/Formatter.php b/vendor/scssphp/scssphp/src/Formatter.php deleted file mode 100644 index cc42ae80..00000000 --- a/vendor/scssphp/scssphp/src/Formatter.php +++ /dev/null @@ -1,364 +0,0 @@ - - * - * @internal - */ -abstract class Formatter -{ - /** - * @var integer - */ - public $indentLevel; - - /** - * @var string - */ - public $indentChar; - - /** - * @var string - */ - public $break; - - /** - * @var string - */ - public $open; - - /** - * @var string - */ - public $close; - - /** - * @var string - */ - public $tagSeparator; - - /** - * @var string - */ - public $assignSeparator; - - /** - * @var boolean - */ - public $keepSemicolons; - - /** - * @var \ScssPhp\ScssPhp\Formatter\OutputBlock - */ - protected $currentBlock; - - /** - * @var integer - */ - protected $currentLine; - - /** - * @var integer - */ - protected $currentColumn; - - /** - * @var \ScssPhp\ScssPhp\SourceMap\SourceMapGenerator|null - */ - protected $sourceMapGenerator; - - /** - * @var string - */ - protected $strippedSemicolon; - - /** - * Initialize formatter - * - * @api - */ - abstract public function __construct(); - - /** - * Return indentation (whitespace) - * - * @return string - */ - protected function indentStr() - { - return ''; - } - - /** - * Return property assignment - * - * @api - * - * @param string $name - * @param mixed $value - * - * @return string - */ - public function property($name, $value) - { - return rtrim($name) . $this->assignSeparator . $value . ';'; - } - - /** - * Return custom property assignment - * differs in that you have to keep spaces in the value as is - * - * @api - * - * @param string $name - * @param mixed $value - * - * @return string - */ - public function customProperty($name, $value) - { - return rtrim($name) . trim($this->assignSeparator) . $value . ';'; - } - - /** - * Output lines inside a block - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block - * - * @return void - */ - protected function blockLines(OutputBlock $block) - { - $inner = $this->indentStr(); - $glue = $this->break . $inner; - - $this->write($inner . implode($glue, $block->lines)); - - if (! empty($block->children)) { - $this->write($this->break); - } - } - - /** - * Output block selectors - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block - * - * @return void - */ - protected function blockSelectors(OutputBlock $block) - { - assert(! empty($block->selectors)); - - $inner = $this->indentStr(); - - $this->write($inner - . implode($this->tagSeparator, $block->selectors) - . $this->open . $this->break); - } - - /** - * Output block children - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block - * - * @return void - */ - protected function blockChildren(OutputBlock $block) - { - foreach ($block->children as $child) { - $this->block($child); - } - } - - /** - * Output non-empty block - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block - * - * @return void - */ - protected function block(OutputBlock $block) - { - if (empty($block->lines) && empty($block->children)) { - return; - } - - $this->currentBlock = $block; - - $pre = $this->indentStr(); - - if (! empty($block->selectors)) { - $this->blockSelectors($block); - - $this->indentLevel++; - } - - if (! empty($block->lines)) { - $this->blockLines($block); - } - - if (! empty($block->children)) { - $this->blockChildren($block); - } - - if (! empty($block->selectors)) { - $this->indentLevel--; - - if (! $this->keepSemicolons) { - $this->strippedSemicolon = ''; - } - - if (empty($block->children)) { - $this->write($this->break); - } - - $this->write($pre . $this->close . $this->break); - } - } - - /** - * Test and clean safely empty children - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block - * - * @return boolean - */ - protected function testEmptyChildren($block) - { - $isEmpty = empty($block->lines); - - if ($block->children) { - foreach ($block->children as $k => &$child) { - if (! $this->testEmptyChildren($child)) { - $isEmpty = false; - continue; - } - - if ($child->type === Type::T_MEDIA || $child->type === Type::T_DIRECTIVE) { - $child->children = []; - $child->selectors = null; - } - } - } - - return $isEmpty; - } - - /** - * Entry point to formatting a block - * - * @api - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block An abstract syntax tree - * @param \ScssPhp\ScssPhp\SourceMap\SourceMapGenerator|null $sourceMapGenerator Optional source map generator - * - * @return string - */ - public function format(OutputBlock $block, SourceMapGenerator $sourceMapGenerator = null) - { - $this->sourceMapGenerator = null; - - if ($sourceMapGenerator) { - $this->currentLine = 1; - $this->currentColumn = 0; - $this->sourceMapGenerator = $sourceMapGenerator; - } - - $this->testEmptyChildren($block); - - ob_start(); - - $this->block($block); - - $out = ob_get_clean(); - - return $out; - } - - /** - * Output content - * - * @param string $str - * - * @return void - */ - protected function write($str) - { - if (! empty($this->strippedSemicolon)) { - echo $this->strippedSemicolon; - - $this->strippedSemicolon = ''; - } - - /* - * Maybe Strip semi-colon appended by property(); it's a separator, not a terminator - * will be striped for real before a closing, otherwise displayed unchanged starting the next write - */ - if ( - ! $this->keepSemicolons && - $str && - (strpos($str, ';') !== false) && - (substr($str, -1) === ';') - ) { - $str = substr($str, 0, -1); - - $this->strippedSemicolon = ';'; - } - - if ($this->sourceMapGenerator) { - $lines = explode("\n", $str); - $lastLine = array_pop($lines); - - foreach ($lines as $line) { - // If the written line starts is empty, adding a mapping would add it for - // a non-existent column as we are at the end of the line - if ($line !== '') { - $this->sourceMapGenerator->addMapping( - $this->currentLine, - $this->currentColumn, - $this->currentBlock->sourceLine, - //columns from parser are off by one - $this->currentBlock->sourceColumn > 0 ? $this->currentBlock->sourceColumn - 1 : 0, - $this->currentBlock->sourceName - ); - } - - $this->currentLine++; - $this->currentColumn = 0; - } - - if ($lastLine !== '') { - $this->sourceMapGenerator->addMapping( - $this->currentLine, - $this->currentColumn, - $this->currentBlock->sourceLine, - //columns from parser are off by one - $this->currentBlock->sourceColumn > 0 ? $this->currentBlock->sourceColumn - 1 : 0, - $this->currentBlock->sourceName - ); - } - - $this->currentColumn += \strlen($lastLine); - } - - echo $str; - } -} diff --git a/vendor/scssphp/scssphp/src/Formatter/Compact.php b/vendor/scssphp/scssphp/src/Formatter/Compact.php deleted file mode 100644 index 22f22688..00000000 --- a/vendor/scssphp/scssphp/src/Formatter/Compact.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * @deprecated since 1.4.0. Use the Compressed formatter instead. - * - * @internal - */ -class Compact extends Formatter -{ - /** - * {@inheritdoc} - */ - public function __construct() - { - @trigger_error('The Compact formatter is deprecated since 1.4.0. Use the Compressed formatter instead.', E_USER_DEPRECATED); - - $this->indentLevel = 0; - $this->indentChar = ''; - $this->break = ''; - $this->open = ' {'; - $this->close = "}\n\n"; - $this->tagSeparator = ','; - $this->assignSeparator = ':'; - $this->keepSemicolons = true; - } - - /** - * {@inheritdoc} - */ - public function indentStr() - { - return ' '; - } -} diff --git a/vendor/scssphp/scssphp/src/Formatter/Compressed.php b/vendor/scssphp/scssphp/src/Formatter/Compressed.php deleted file mode 100644 index de13c188..00000000 --- a/vendor/scssphp/scssphp/src/Formatter/Compressed.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * @internal - */ -class Compressed extends Formatter -{ - /** - * {@inheritdoc} - */ - public function __construct() - { - $this->indentLevel = 0; - $this->indentChar = ' '; - $this->break = ''; - $this->open = '{'; - $this->close = '}'; - $this->tagSeparator = ','; - $this->assignSeparator = ':'; - $this->keepSemicolons = false; - } - - /** - * {@inheritdoc} - */ - public function blockLines(OutputBlock $block) - { - $inner = $this->indentStr(); - - $glue = $this->break . $inner; - - foreach ($block->lines as $index => $line) { - if (substr($line, 0, 2) === '/*' && substr($line, 2, 1) !== '!') { - unset($block->lines[$index]); - } elseif (substr($line, 0, 3) === '/*!') { - $block->lines[$index] = '/*' . substr($line, 3); - } - } - - $this->write($inner . implode($glue, $block->lines)); - - if (! empty($block->children)) { - $this->write($this->break); - } - } - - /** - * Output block selectors - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block - */ - protected function blockSelectors(OutputBlock $block) - { - assert(! empty($block->selectors)); - - $inner = $this->indentStr(); - - $this->write( - $inner - . implode( - $this->tagSeparator, - str_replace([' > ', ' + ', ' ~ '], ['>', '+', '~'], $block->selectors) - ) - . $this->open . $this->break - ); - } -} diff --git a/vendor/scssphp/scssphp/src/Formatter/Crunched.php b/vendor/scssphp/scssphp/src/Formatter/Crunched.php deleted file mode 100644 index 2bc1e929..00000000 --- a/vendor/scssphp/scssphp/src/Formatter/Crunched.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * @deprecated since 1.4.0. Use the Compressed formatter instead. - * - * @internal - */ -class Crunched extends Formatter -{ - /** - * {@inheritdoc} - */ - public function __construct() - { - @trigger_error('The Crunched formatter is deprecated since 1.4.0. Use the Compressed formatter instead.', E_USER_DEPRECATED); - - $this->indentLevel = 0; - $this->indentChar = ' '; - $this->break = ''; - $this->open = '{'; - $this->close = '}'; - $this->tagSeparator = ','; - $this->assignSeparator = ':'; - $this->keepSemicolons = false; - } - - /** - * {@inheritdoc} - */ - public function blockLines(OutputBlock $block) - { - $inner = $this->indentStr(); - - $glue = $this->break . $inner; - - foreach ($block->lines as $index => $line) { - if (substr($line, 0, 2) === '/*') { - unset($block->lines[$index]); - } - } - - $this->write($inner . implode($glue, $block->lines)); - - if (! empty($block->children)) { - $this->write($this->break); - } - } - - /** - * Output block selectors - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block - */ - protected function blockSelectors(OutputBlock $block) - { - assert(! empty($block->selectors)); - - $inner = $this->indentStr(); - - $this->write( - $inner - . implode( - $this->tagSeparator, - str_replace([' > ', ' + ', ' ~ '], ['>', '+', '~'], $block->selectors) - ) - . $this->open . $this->break - ); - } -} diff --git a/vendor/scssphp/scssphp/src/Formatter/Debug.php b/vendor/scssphp/scssphp/src/Formatter/Debug.php deleted file mode 100644 index b3f44225..00000000 --- a/vendor/scssphp/scssphp/src/Formatter/Debug.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * @deprecated since 1.4.0. - * - * @internal - */ -class Debug extends Formatter -{ - /** - * {@inheritdoc} - */ - public function __construct() - { - @trigger_error('The Debug formatter is deprecated since 1.4.0.', E_USER_DEPRECATED); - - $this->indentLevel = 0; - $this->indentChar = ''; - $this->break = "\n"; - $this->open = ' {'; - $this->close = ' }'; - $this->tagSeparator = ', '; - $this->assignSeparator = ': '; - $this->keepSemicolons = true; - } - - /** - * {@inheritdoc} - */ - protected function indentStr() - { - return str_repeat(' ', $this->indentLevel); - } - - /** - * {@inheritdoc} - */ - protected function blockLines(OutputBlock $block) - { - $indent = $this->indentStr(); - - if (empty($block->lines)) { - $this->write("{$indent}block->lines: []\n"); - - return; - } - - foreach ($block->lines as $index => $line) { - $this->write("{$indent}block->lines[{$index}]: $line\n"); - } - } - - /** - * {@inheritdoc} - */ - protected function blockSelectors(OutputBlock $block) - { - $indent = $this->indentStr(); - - if (empty($block->selectors)) { - $this->write("{$indent}block->selectors: []\n"); - - return; - } - - foreach ($block->selectors as $index => $selector) { - $this->write("{$indent}block->selectors[{$index}]: $selector\n"); - } - } - - /** - * {@inheritdoc} - */ - protected function blockChildren(OutputBlock $block) - { - $indent = $this->indentStr(); - - if (empty($block->children)) { - $this->write("{$indent}block->children: []\n"); - - return; - } - - $this->indentLevel++; - - foreach ($block->children as $i => $child) { - $this->block($child); - } - - $this->indentLevel--; - } - - /** - * {@inheritdoc} - */ - protected function block(OutputBlock $block) - { - $indent = $this->indentStr(); - - $this->write("{$indent}block->type: {$block->type}\n" . - "{$indent}block->depth: {$block->depth}\n"); - - $this->currentBlock = $block; - - $this->blockSelectors($block); - $this->blockLines($block); - $this->blockChildren($block); - } -} diff --git a/vendor/scssphp/scssphp/src/Formatter/Expanded.php b/vendor/scssphp/scssphp/src/Formatter/Expanded.php deleted file mode 100644 index a280416d..00000000 --- a/vendor/scssphp/scssphp/src/Formatter/Expanded.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * @internal - */ -class Expanded extends Formatter -{ - /** - * {@inheritdoc} - */ - public function __construct() - { - $this->indentLevel = 0; - $this->indentChar = ' '; - $this->break = "\n"; - $this->open = ' {'; - $this->close = '}'; - $this->tagSeparator = ', '; - $this->assignSeparator = ': '; - $this->keepSemicolons = true; - } - - /** - * {@inheritdoc} - */ - protected function indentStr() - { - return str_repeat($this->indentChar, $this->indentLevel); - } - - /** - * {@inheritdoc} - */ - protected function blockLines(OutputBlock $block) - { - $inner = $this->indentStr(); - - $glue = $this->break . $inner; - - foreach ($block->lines as $index => $line) { - if (substr($line, 0, 2) === '/*') { - $block->lines[$index] = preg_replace('/\r\n?|\n|\f/', $this->break, $line); - } - } - - $this->write($inner . implode($glue, $block->lines)); - - if (empty($block->selectors) || ! empty($block->children)) { - $this->write($this->break); - } - } -} diff --git a/vendor/scssphp/scssphp/src/Formatter/Nested.php b/vendor/scssphp/scssphp/src/Formatter/Nested.php deleted file mode 100644 index 9e729568..00000000 --- a/vendor/scssphp/scssphp/src/Formatter/Nested.php +++ /dev/null @@ -1,236 +0,0 @@ - - * - * @deprecated since 1.4.0. Use the Expanded formatter instead. - * - * @internal - */ -class Nested extends Formatter -{ - /** - * @var integer - */ - private $depth; - - /** - * {@inheritdoc} - */ - public function __construct() - { - @trigger_error('The Nested formatter is deprecated since 1.4.0. Use the Expanded formatter instead.', E_USER_DEPRECATED); - - $this->indentLevel = 0; - $this->indentChar = ' '; - $this->break = "\n"; - $this->open = ' {'; - $this->close = ' }'; - $this->tagSeparator = ', '; - $this->assignSeparator = ': '; - $this->keepSemicolons = true; - } - - /** - * {@inheritdoc} - */ - protected function indentStr() - { - $n = $this->depth - 1; - - return str_repeat($this->indentChar, max($this->indentLevel + $n, 0)); - } - - /** - * {@inheritdoc} - */ - protected function blockLines(OutputBlock $block) - { - $inner = $this->indentStr(); - $glue = $this->break . $inner; - - foreach ($block->lines as $index => $line) { - if (substr($line, 0, 2) === '/*') { - $block->lines[$index] = preg_replace('/\r\n?|\n|\f/', $this->break, $line); - } - } - - $this->write($inner . implode($glue, $block->lines)); - } - - /** - * {@inheritdoc} - */ - protected function block(OutputBlock $block) - { - static $depths; - static $downLevel; - static $closeBlock; - static $previousEmpty; - static $previousHasSelector; - - if ($block->type === 'root') { - $depths = [ 0 ]; - $downLevel = ''; - $closeBlock = ''; - $this->depth = 0; - $previousEmpty = false; - $previousHasSelector = false; - } - - $isMediaOrDirective = \in_array($block->type, [Type::T_DIRECTIVE, Type::T_MEDIA]); - $isSupport = ($block->type === Type::T_DIRECTIVE - && $block->selectors && strpos(implode('', $block->selectors), '@supports') !== false); - - while ($block->depth < end($depths) || ($block->depth == 1 && end($depths) == 1)) { - array_pop($depths); - $this->depth--; - - if ( - ! $this->depth && ($block->depth <= 1 || (! $this->indentLevel && $block->type === Type::T_COMMENT)) && - (($block->selectors && ! $isMediaOrDirective) || $previousHasSelector) - ) { - $downLevel = $this->break; - } - - if (empty($block->lines) && empty($block->children)) { - $previousEmpty = true; - } - } - - if (empty($block->lines) && empty($block->children)) { - return; - } - - $this->currentBlock = $block; - - if (! empty($block->lines) || (! empty($block->children) && ($this->depth < 1 || $isSupport))) { - if ($block->depth > end($depths)) { - if (! $previousEmpty || $this->depth < 1) { - $this->depth++; - - $depths[] = $block->depth; - } else { - // keep the current depth unchanged but take the block depth as a new reference for following blocks - array_pop($depths); - - $depths[] = $block->depth; - } - } - } - - $previousEmpty = ($block->type === Type::T_COMMENT); - $previousHasSelector = false; - - if (! empty($block->selectors)) { - if ($closeBlock) { - $this->write($closeBlock); - $closeBlock = ''; - } - - if ($downLevel) { - $this->write($downLevel); - $downLevel = ''; - } - - $this->blockSelectors($block); - - $this->indentLevel++; - } - - if (! empty($block->lines)) { - if ($closeBlock) { - $this->write($closeBlock); - $closeBlock = ''; - } - - if ($downLevel) { - $this->write($downLevel); - $downLevel = ''; - } - - $this->blockLines($block); - - $closeBlock = $this->break; - } - - if (! empty($block->children)) { - if ($this->depth > 0 && ($isMediaOrDirective || ! $this->hasFlatChild($block))) { - array_pop($depths); - - $this->depth--; - $this->blockChildren($block); - $this->depth++; - - $depths[] = $block->depth; - } else { - $this->blockChildren($block); - } - } - - // reclear to not be spoiled by children if T_DIRECTIVE - if ($block->type === Type::T_DIRECTIVE) { - $previousHasSelector = false; - } - - if (! empty($block->selectors)) { - $this->indentLevel--; - - if (! $this->keepSemicolons) { - $this->strippedSemicolon = ''; - } - - $this->write($this->close); - - $closeBlock = $this->break; - - if ($this->depth > 1 && ! empty($block->children)) { - array_pop($depths); - $this->depth--; - } - - if (! $isMediaOrDirective) { - $previousHasSelector = true; - } - } - - if ($block->type === 'root') { - $this->write($this->break); - } - } - - /** - * Block has flat child - * - * @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block - * - * @return boolean - */ - private function hasFlatChild($block) - { - foreach ($block->children as $child) { - if (empty($child->selectors)) { - return true; - } - } - - return false; - } -} diff --git a/vendor/scssphp/scssphp/src/Formatter/OutputBlock.php b/vendor/scssphp/scssphp/src/Formatter/OutputBlock.php deleted file mode 100644 index 88deb2d3..00000000 --- a/vendor/scssphp/scssphp/src/Formatter/OutputBlock.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * @internal - */ -class OutputBlock -{ - /** - * @var string - */ - public $type; - - /** - * @var integer - */ - public $depth; - - /** - * @var array|null - */ - public $selectors; - - /** - * @var string[] - */ - public $lines; - - /** - * @var OutputBlock[] - */ - public $children; - - /** - * @var OutputBlock|null - */ - public $parent; - - /** - * @var string|null - */ - public $sourceName; - - /** - * @var integer|null - */ - public $sourceLine; - - /** - * @var integer|null - */ - public $sourceColumn; -} diff --git a/vendor/scssphp/scssphp/src/Logger/LoggerInterface.php b/vendor/scssphp/scssphp/src/Logger/LoggerInterface.php deleted file mode 100644 index 7c0a2f76..00000000 --- a/vendor/scssphp/scssphp/src/Logger/LoggerInterface.php +++ /dev/null @@ -1,48 +0,0 @@ -stream = $stream; - $this->closeOnDestruct = $closeOnDestruct; - } - - /** - * @internal - */ - public function __destruct() - { - if ($this->closeOnDestruct) { - fclose($this->stream); - } - } - - /** - * @inheritDoc - */ - public function warn($message, $deprecation = false) - { - $prefix = ($deprecation ? 'DEPRECATION ' : '') . 'WARNING: '; - - fwrite($this->stream, $prefix . $message . "\n\n"); - } - - /** - * @inheritDoc - */ - public function debug($message) - { - fwrite($this->stream, $message . "\n"); - } -} diff --git a/vendor/scssphp/scssphp/src/Node.php b/vendor/scssphp/scssphp/src/Node.php deleted file mode 100644 index 53019375..00000000 --- a/vendor/scssphp/scssphp/src/Node.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * @internal - */ -abstract class Node -{ - /** - * @var string - */ - public $type; - - /** - * @var integer - */ - public $sourceIndex; - - /** - * @var int|null - */ - public $sourceLine; - - /** - * @var int|null - */ - public $sourceColumn; -} diff --git a/vendor/scssphp/scssphp/src/Node/Number.php b/vendor/scssphp/scssphp/src/Node/Number.php deleted file mode 100644 index 78f86bac..00000000 --- a/vendor/scssphp/scssphp/src/Node/Number.php +++ /dev/null @@ -1,800 +0,0 @@ - - * - * @template-implements \ArrayAccess - */ -class Number extends Node implements \ArrayAccess -{ - const PRECISION = 10; - - /** - * @var integer - * @deprecated use {Number::PRECISION} instead to read the precision. Configuring it is not supported anymore. - */ - public static $precision = self::PRECISION; - - /** - * @see http://www.w3.org/TR/2012/WD-css3-values-20120308/ - * - * @var array - * @phpstan-var array> - */ - protected static $unitTable = [ - 'in' => [ - 'in' => 1, - 'pc' => 6, - 'pt' => 72, - 'px' => 96, - 'cm' => 2.54, - 'mm' => 25.4, - 'q' => 101.6, - ], - 'turn' => [ - 'deg' => 360, - 'grad' => 400, - 'rad' => 6.28318530717958647692528676, // 2 * M_PI - 'turn' => 1, - ], - 's' => [ - 's' => 1, - 'ms' => 1000, - ], - 'Hz' => [ - 'Hz' => 1, - 'kHz' => 0.001, - ], - 'dpi' => [ - 'dpi' => 1, - 'dpcm' => 1 / 2.54, - 'dppx' => 1 / 96, - ], - ]; - - /** - * @var integer|float - */ - private $dimension; - - /** - * @var string[] - * @phpstan-var list - */ - private $numeratorUnits; - - /** - * @var string[] - * @phpstan-var list - */ - private $denominatorUnits; - - /** - * Initialize number - * - * @param integer|float $dimension - * @param string[]|string $numeratorUnits - * @param string[] $denominatorUnits - * - * @phpstan-param list|string $numeratorUnits - * @phpstan-param list $denominatorUnits - */ - public function __construct($dimension, $numeratorUnits, array $denominatorUnits = []) - { - if (is_string($numeratorUnits)) { - $numeratorUnits = $numeratorUnits ? [$numeratorUnits] : []; - } elseif (isset($numeratorUnits['numerator_units'], $numeratorUnits['denominator_units'])) { - // TODO get rid of this once `$number[2]` is not used anymore - $denominatorUnits = $numeratorUnits['denominator_units']; - $numeratorUnits = $numeratorUnits['numerator_units']; - } - - $this->dimension = $dimension; - $this->numeratorUnits = $numeratorUnits; - $this->denominatorUnits = $denominatorUnits; - } - - /** - * @return float|int - */ - public function getDimension() - { - return $this->dimension; - } - - /** - * @return string[] - */ - public function getNumeratorUnits() - { - return $this->numeratorUnits; - } - - /** - * @return string[] - */ - public function getDenominatorUnits() - { - return $this->denominatorUnits; - } - - /** - * {@inheritdoc} - */ - public function offsetExists($offset) - { - if ($offset === -3) { - return ! \is_null($this->sourceColumn); - } - - if ($offset === -2) { - return ! \is_null($this->sourceLine); - } - - if ( - $offset === -1 || - $offset === 0 || - $offset === 1 || - $offset === 2 - ) { - return true; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function offsetGet($offset) - { - switch ($offset) { - case -3: - return $this->sourceColumn; - - case -2: - return $this->sourceLine; - - case -1: - return $this->sourceIndex; - - case 0: - return Type::T_NUMBER; - - case 1: - return $this->dimension; - - case 2: - return array('numerator_units' => $this->numeratorUnits, 'denominator_units' => $this->denominatorUnits); - } - } - - /** - * {@inheritdoc} - */ - public function offsetSet($offset, $value) - { - throw new \BadMethodCallException('Number is immutable'); - } - - /** - * {@inheritdoc} - */ - public function offsetUnset($offset) - { - throw new \BadMethodCallException('Number is immutable'); - } - - /** - * Returns true if the number is unitless - * - * @return boolean - */ - public function unitless() - { - return \count($this->numeratorUnits) === 0 && \count($this->denominatorUnits) === 0; - } - - /** - * Checks whether the number has exactly this unit - * - * @param string $unit - * - * @return bool - */ - public function hasUnit($unit) - { - return \count($this->numeratorUnits) === 1 && \count($this->denominatorUnits) === 0 && $this->numeratorUnits[0] === $unit; - } - - /** - * Returns unit(s) as the product of numerator units divided by the product of denominator units - * - * @return string - */ - public function unitStr() - { - if ($this->unitless()) { - return ''; - } - - return self::getUnitString($this->numeratorUnits, $this->denominatorUnits); - } - - /** - * @param float|int $min - * @param float|int $max - * @param string|null $name - * - * @return float|int - * @throws SassScriptException - */ - public function valueInRange($min, $max, $name = null) - { - try { - return Util::checkRange('', new Range($min, $max), $this); - } catch (RangeException $e) { - throw SassScriptException::forArgument(sprintf('Expected %s to be within %s%s and %s%3$s', $this, $min, $this->unitStr(), $max), $name); - } - } - - /** - * @param string|null $varName - * - * @return void - */ - public function assertNoUnits($varName = null) - { - if ($this->unitless()) { - return; - } - - throw SassScriptException::forArgument(sprintf('Expected %s to have no units.', $this), $varName); - } - - /** - * @param string $unit - * @param string|null $varName - * - * @return void - */ - public function assertUnit($unit, $varName = null) - { - if ($this->hasUnit($unit)) { - return; - } - - throw SassScriptException::forArgument(sprintf('Expected %s to have unit "%s".', $this, $unit), $varName); - } - - /** - * @param Number $other - * - * @return void - */ - public function assertSameUnitOrUnitless(Number $other) - { - if ($other->unitless()) { - return; - } - - if ($this->numeratorUnits === $other->numeratorUnits && $this->denominatorUnits === $other->denominatorUnits) { - return; - } - - throw new SassScriptException(sprintf( - 'Incompatible units %s and %s.', - self::getUnitString($this->numeratorUnits, $this->denominatorUnits), - self::getUnitString($other->numeratorUnits, $other->denominatorUnits) - )); - } - - /** - * Returns a copy of this number, converted to the units represented by $newNumeratorUnits and $newDenominatorUnits. - * - * This does not throw an error if this number is unitless and - * $newNumeratorUnits/$newDenominatorUnits are not empty, or vice versa. Instead, - * it treats all unitless numbers as convertible to and from all units without - * changing the value. - * - * @param string[] $newNumeratorUnits - * @param string[] $newDenominatorUnits - * - * @return Number - * - * @phpstan-param list $newNumeratorUnits - * @phpstan-param list $newDenominatorUnits - * - * @throws SassScriptException if this number's units are not compatible with $newNumeratorUnits and $newDenominatorUnits - */ - public function coerce(array $newNumeratorUnits, array $newDenominatorUnits) - { - return new Number($this->valueInUnits($newNumeratorUnits, $newDenominatorUnits), $newNumeratorUnits, $newDenominatorUnits); - } - - /** - * @param Number $other - * - * @return bool - */ - public function isComparableTo(Number $other) - { - if ($this->unitless() || $other->unitless()) { - return true; - } - - try { - $this->greaterThan($other); - return true; - } catch (SassScriptException $e) { - return false; - } - } - - /** - * @param Number $other - * - * @return bool - */ - public function lessThan(Number $other) - { - return $this->coerceUnits($other, function ($num1, $num2) { - return $num1 < $num2; - }); - } - - /** - * @param Number $other - * - * @return bool - */ - public function lessThanOrEqual(Number $other) - { - return $this->coerceUnits($other, function ($num1, $num2) { - return $num1 <= $num2; - }); - } - - /** - * @param Number $other - * - * @return bool - */ - public function greaterThan(Number $other) - { - return $this->coerceUnits($other, function ($num1, $num2) { - return $num1 > $num2; - }); - } - - /** - * @param Number $other - * - * @return bool - */ - public function greaterThanOrEqual(Number $other) - { - return $this->coerceUnits($other, function ($num1, $num2) { - return $num1 >= $num2; - }); - } - - /** - * @param Number $other - * - * @return Number - */ - public function plus(Number $other) - { - return $this->coerceNumber($other, function ($num1, $num2) { - return $num1 + $num2; - }); - } - - /** - * @param Number $other - * - * @return Number - */ - public function minus(Number $other) - { - return $this->coerceNumber($other, function ($num1, $num2) { - return $num1 - $num2; - }); - } - - /** - * @return Number - */ - public function unaryMinus() - { - return new Number(-$this->dimension, $this->numeratorUnits, $this->denominatorUnits); - } - - /** - * @param Number $other - * - * @return Number - */ - public function modulo(Number $other) - { - return $this->coerceNumber($other, function ($num1, $num2) { - if ($num2 == 0) { - return NAN; - } - - $result = fmod($num1, $num2); - - if ($result == 0) { - return 0; - } - - if ($num2 < 0 xor $num1 < 0) { - $result += $num2; - } - - return $result; - }); - } - - /** - * @param Number $other - * - * @return Number - */ - public function times(Number $other) - { - return $this->multiplyUnits($this->dimension * $other->dimension, $this->numeratorUnits, $this->denominatorUnits, $other->numeratorUnits, $other->denominatorUnits); - } - - /** - * @param Number $other - * - * @return Number - */ - public function dividedBy(Number $other) - { - if ($other->dimension == 0) { - if ($this->dimension == 0) { - $value = NAN; - } elseif ($this->dimension > 0) { - $value = INF; - } else { - $value = -INF; - } - } else { - $value = $this->dimension / $other->dimension; - } - - return $this->multiplyUnits($value, $this->numeratorUnits, $this->denominatorUnits, $other->denominatorUnits, $other->numeratorUnits); - } - - /** - * @param Number $other - * - * @return bool - */ - public function equals(Number $other) - { - // Unitless numbers are convertable to unit numbers, but not equal, so we special-case unitless here. - if ($this->unitless() !== $other->unitless()) { - return false; - } - - // In Sass, neither NaN nor Infinity are equal to themselves, while PHP defines INF==INF - if (is_nan($this->dimension) || is_nan($other->dimension) || !is_finite($this->dimension) || !is_finite($other->dimension)) { - return false; - } - - if ($this->unitless()) { - return round($this->dimension, self::PRECISION) == round($other->dimension, self::PRECISION); - } - - try { - return $this->coerceUnits($other, function ($num1, $num2) { - return round($num1,self::PRECISION) == round($num2, self::PRECISION); - }); - } catch (SassScriptException $e) { - return false; - } - } - - /** - * Output number - * - * @param \ScssPhp\ScssPhp\Compiler $compiler - * - * @return string - */ - public function output(Compiler $compiler = null) - { - $dimension = round($this->dimension, self::PRECISION); - - if (is_nan($dimension)) { - return 'NaN'; - } - - if ($dimension === INF) { - return 'Infinity'; - } - - if ($dimension === -INF) { - return '-Infinity'; - } - - if ($compiler) { - $unit = $this->unitStr(); - } elseif (isset($this->numeratorUnits[0])) { - $unit = $this->numeratorUnits[0]; - } else { - $unit = ''; - } - - $dimension = number_format($dimension, self::PRECISION, '.', ''); - - return rtrim(rtrim($dimension, '0'), '.') . $unit; - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return $this->output(); - } - - /** - * @param Number $other - * @param callable $operation - * - * @return Number - * - * @phpstan-param callable(int|float, int|float): (int|float) $operation - */ - private function coerceNumber(Number $other, $operation) - { - $result = $this->coerceUnits($other, $operation); - - if (!$this->unitless()) { - return new Number($result, $this->numeratorUnits, $this->denominatorUnits); - } - - return new Number($result, $other->numeratorUnits, $other->denominatorUnits); - } - - /** - * @param Number $other - * @param callable $operation - * - * @return mixed - * - * @phpstan-template T - * @phpstan-param callable(int|float, int|float): T $operation - * @phpstan-return T - */ - private function coerceUnits(Number $other, $operation) - { - if (!$this->unitless()) { - $num1 = $this->dimension; - $num2 = $other->valueInUnits($this->numeratorUnits, $this->denominatorUnits); - } else { - $num1 = $this->valueInUnits($other->numeratorUnits, $other->denominatorUnits); - $num2 = $other->dimension; - } - - return \call_user_func($operation, $num1, $num2); - } - - /** - * @param string[] $numeratorUnits - * @param string[] $denominatorUnits - * - * @return int|float - * - * @phpstan-param list $numeratorUnits - * @phpstan-param list $denominatorUnits - * - * @throws SassScriptException if this number's units are not compatible with $numeratorUnits and $denominatorUnits - */ - private function valueInUnits(array $numeratorUnits, array $denominatorUnits) - { - if ( - $this->unitless() - || (\count($numeratorUnits) === 0 && \count($denominatorUnits) === 0) - || ($this->numeratorUnits === $numeratorUnits && $this->denominatorUnits === $denominatorUnits) - ) { - return $this->dimension; - } - - $value = $this->dimension; - $oldNumerators = $this->numeratorUnits; - - foreach ($numeratorUnits as $newNumerator) { - foreach ($oldNumerators as $key => $oldNumerator) { - $conversionFactor = self::getConversionFactor($newNumerator, $oldNumerator); - - if (\is_null($conversionFactor)) { - continue; - } - - $value *= $conversionFactor; - unset($oldNumerators[$key]); - continue 2; - } - - throw new SassScriptException(sprintf( - 'Incompatible units %s and %s.', - self::getUnitString($this->numeratorUnits, $this->denominatorUnits), - self::getUnitString($numeratorUnits, $denominatorUnits) - )); - } - - $oldDenominators = $this->denominatorUnits; - - foreach ($denominatorUnits as $newDenominator) { - foreach ($oldDenominators as $key => $oldDenominator) { - $conversionFactor = self::getConversionFactor($newDenominator, $oldDenominator); - - if (\is_null($conversionFactor)) { - continue; - } - - $value /= $conversionFactor; - unset($oldDenominators[$key]); - continue 2; - } - - throw new SassScriptException(sprintf( - 'Incompatible units %s and %s.', - self::getUnitString($this->numeratorUnits, $this->denominatorUnits), - self::getUnitString($numeratorUnits, $denominatorUnits) - )); - } - - if (\count($oldNumerators) || \count($oldDenominators)) { - throw new SassScriptException(sprintf( - 'Incompatible units %s and %s.', - self::getUnitString($this->numeratorUnits, $this->denominatorUnits), - self::getUnitString($numeratorUnits, $denominatorUnits) - )); - } - - return $value; - } - - /** - * @param int|float $value - * @param string[] $numerators1 - * @param string[] $denominators1 - * @param string[] $numerators2 - * @param string[] $denominators2 - * - * @return Number - * - * @phpstan-param list $numerators1 - * @phpstan-param list $denominators1 - * @phpstan-param list $numerators2 - * @phpstan-param list $denominators2 - */ - private function multiplyUnits($value, array $numerators1, array $denominators1, array $numerators2, array $denominators2) - { - $newNumerators = array(); - - foreach ($numerators1 as $numerator) { - foreach ($denominators2 as $key => $denominator) { - $conversionFactor = self::getConversionFactor($numerator, $denominator); - - if (\is_null($conversionFactor)) { - continue; - } - - $value /= $conversionFactor; - unset($denominators2[$key]); - continue 2; - } - - $newNumerators[] = $numerator; - } - - foreach ($numerators2 as $numerator) { - foreach ($denominators1 as $key => $denominator) { - $conversionFactor = self::getConversionFactor($numerator, $denominator); - - if (\is_null($conversionFactor)) { - continue; - } - - $value /= $conversionFactor; - unset($denominators1[$key]); - continue 2; - } - - $newNumerators[] = $numerator; - } - - $newDenominators = array_values(array_merge($denominators1, $denominators2)); - - return new Number($value, $newNumerators, $newDenominators); - } - - /** - * Returns the number of [unit1]s per [unit2]. - * - * Equivalently, `1unit1 * conversionFactor(unit1, unit2) = 1unit2`. - * - * @param string $unit1 - * @param string $unit2 - * - * @return float|int|null - */ - private static function getConversionFactor($unit1, $unit2) - { - if ($unit1 === $unit2) { - return 1; - } - - foreach (static::$unitTable as $unitVariants) { - if (isset($unitVariants[$unit1]) && isset($unitVariants[$unit2])) { - return $unitVariants[$unit1] / $unitVariants[$unit2]; - } - } - - return null; - } - - /** - * Returns unit(s) as the product of numerator units divided by the product of denominator units - * - * @param string[] $numerators - * @param string[] $denominators - * - * @phpstan-param list $numerators - * @phpstan-param list $denominators - * - * @return string - */ - private static function getUnitString(array $numerators, array $denominators) - { - if (!\count($numerators)) { - if (\count($denominators) === 0) { - return 'no units'; - } - - if (\count($denominators) === 1) { - return $denominators[0] . '^-1'; - } - - return '(' . implode('*', $denominators) . ')^-1'; - } - - return implode('*', $numerators) . (\count($denominators) ? '/' . implode('*', $denominators) : ''); - } -} diff --git a/vendor/scssphp/scssphp/src/OutputStyle.php b/vendor/scssphp/scssphp/src/OutputStyle.php deleted file mode 100644 index c284639c..00000000 --- a/vendor/scssphp/scssphp/src/OutputStyle.php +++ /dev/null @@ -1,9 +0,0 @@ - - * - * @internal - */ -class Parser -{ - const SOURCE_INDEX = -1; - const SOURCE_LINE = -2; - const SOURCE_COLUMN = -3; - - /** - * @var array - */ - protected static $precedence = [ - '=' => 0, - 'or' => 1, - 'and' => 2, - '==' => 3, - '!=' => 3, - '<=' => 4, - '>=' => 4, - '<' => 4, - '>' => 4, - '+' => 5, - '-' => 5, - '*' => 6, - '/' => 6, - '%' => 6, - ]; - - /** - * @var string - */ - protected static $commentPattern; - /** - * @var string - */ - protected static $operatorPattern; - /** - * @var string - */ - protected static $whitePattern; - - /** - * @var Cache|null - */ - protected $cache; - - private $sourceName; - private $sourceIndex; - /** - * @var array - */ - private $sourcePositions; - /** - * @var array|null - */ - private $charset; - /** - * The current offset in the buffer - * - * @var int - */ - private $count; - /** - * @var Block|null - */ - private $env; - /** - * @var bool - */ - private $inParens; - /** - * @var bool - */ - private $eatWhiteDefault; - /** - * @var bool - */ - private $discardComments; - private $allowVars; - /** - * @var string - */ - private $buffer; - private $utf8; - /** - * @var string|null - */ - private $encoding; - private $patternModifiers; - private $commentsSeen; - - private $cssOnly; - - /** - * @var LoggerInterface - */ - private $logger; - - /** - * Constructor - * - * @api - * - * @param string|null $sourceName - * @param integer $sourceIndex - * @param string|null $encoding - * @param Cache|null $cache - * @param bool $cssOnly - * @param LoggerInterface|null $logger - */ - public function __construct($sourceName, $sourceIndex = 0, $encoding = 'utf-8', Cache $cache = null, $cssOnly = false, LoggerInterface $logger = null) - { - $this->sourceName = $sourceName ?: '(stdin)'; - $this->sourceIndex = $sourceIndex; - $this->charset = null; - $this->utf8 = ! $encoding || strtolower($encoding) === 'utf-8'; - $this->patternModifiers = $this->utf8 ? 'Aisu' : 'Ais'; - $this->commentsSeen = []; - $this->commentsSeen = []; - $this->allowVars = true; - $this->cssOnly = $cssOnly; - $this->logger = $logger ?: new QuietLogger(); - - if (empty(static::$operatorPattern)) { - static::$operatorPattern = '([*\/%+-]|[!=]\=|\>\=?|\<\=?|and|or)'; - - $commentSingle = '\/\/'; - $commentMultiLeft = '\/\*'; - $commentMultiRight = '\*\/'; - - static::$commentPattern = $commentMultiLeft . '.*?' . $commentMultiRight; - static::$whitePattern = $this->utf8 - ? '/' . $commentSingle . '[^\n]*\s*|(' . static::$commentPattern . ')\s*|\s+/AisuS' - : '/' . $commentSingle . '[^\n]*\s*|(' . static::$commentPattern . ')\s*|\s+/AisS'; - } - - $this->cache = $cache; - } - - /** - * Get source file name - * - * @api - * - * @return string - */ - public function getSourceName() - { - return $this->sourceName; - } - - /** - * Throw parser error - * - * @api - * - * @param string $msg - * - * @phpstan-return never-return - * - * @throws ParserException - * - * @deprecated use "parseError" and throw the exception in the caller instead. - */ - public function throwParseError($msg = 'parse error') - { - @trigger_error( - 'The method "throwParseError" is deprecated. Use "parseError" and throw the exception in the caller instead', - E_USER_DEPRECATED - ); - - throw $this->parseError($msg); - } - - /** - * Creates a parser error - * - * @api - * - * @param string $msg - * - * @return ParserException - */ - public function parseError($msg = 'parse error') - { - list($line, $column) = $this->getSourcePosition($this->count); - - $loc = empty($this->sourceName) - ? "line: $line, column: $column" - : "$this->sourceName on line $line, at column $column"; - - if ($this->peek('(.*?)(\n|$)', $m, $this->count)) { - $this->restoreEncoding(); - - $e = new ParserException("$msg: failed at `$m[1]` $loc"); - $e->setSourcePosition([$this->sourceName, $line, $column]); - - return $e; - } - - $this->restoreEncoding(); - - $e = new ParserException("$msg: $loc"); - $e->setSourcePosition([$this->sourceName, $line, $column]); - - return $e; - } - - /** - * Parser buffer - * - * @api - * - * @param string $buffer - * - * @return Block - */ - public function parse($buffer) - { - if ($this->cache) { - $cacheKey = $this->sourceName . ':' . md5($buffer); - $parseOptions = [ - 'charset' => $this->charset, - 'utf8' => $this->utf8, - ]; - $v = $this->cache->getCache('parse', $cacheKey, $parseOptions); - - if (! \is_null($v)) { - return $v; - } - } - - // strip BOM (byte order marker) - if (substr($buffer, 0, 3) === "\xef\xbb\xbf") { - $buffer = substr($buffer, 3); - } - - $this->buffer = rtrim($buffer, "\x00..\x1f"); - $this->count = 0; - $this->env = null; - $this->inParens = false; - $this->eatWhiteDefault = true; - - $this->saveEncoding(); - $this->extractLineNumbers($buffer); - - $this->pushBlock(null); // root block - $this->whitespace(); - $this->pushBlock(null); - $this->popBlock(); - - while ($this->parseChunk()) { - ; - } - - if ($this->count !== \strlen($this->buffer)) { - throw $this->parseError(); - } - - if (! empty($this->env->parent)) { - throw $this->parseError('unclosed block'); - } - - if ($this->charset) { - array_unshift($this->env->children, $this->charset); - } - - $this->restoreEncoding(); - - if ($this->cache) { - $this->cache->setCache('parse', $cacheKey, $this->env, $parseOptions); - } - - return $this->env; - } - - /** - * Parse a value or value list - * - * @api - * - * @param string $buffer - * @param string|array $out - * - * @return boolean - */ - public function parseValue($buffer, &$out) - { - $this->count = 0; - $this->env = null; - $this->inParens = false; - $this->eatWhiteDefault = true; - $this->buffer = (string) $buffer; - - $this->saveEncoding(); - $this->extractLineNumbers($this->buffer); - - $list = $this->valueList($out); - - $this->restoreEncoding(); - - return $list; - } - - /** - * Parse a selector or selector list - * - * @api - * - * @param string $buffer - * @param string|array $out - * @param bool $shouldValidate - * - * @return boolean - */ - public function parseSelector($buffer, &$out, $shouldValidate = true) - { - $this->count = 0; - $this->env = null; - $this->inParens = false; - $this->eatWhiteDefault = true; - $this->buffer = (string) $buffer; - - $this->saveEncoding(); - $this->extractLineNumbers($this->buffer); - - // discard space/comments at the start - $this->discardComments = true; - $this->whitespace(); - $this->discardComments = false; - - $selector = $this->selectors($out); - - $this->restoreEncoding(); - - if ($shouldValidate && $this->count !== strlen($buffer)) { - throw $this->parseError("`" . substr($buffer, $this->count) . "` is not a valid Selector in `$buffer`"); - } - - return $selector; - } - - /** - * Parse a media Query - * - * @api - * - * @param string $buffer - * @param string|array $out - * - * @return boolean - */ - public function parseMediaQueryList($buffer, &$out) - { - $this->count = 0; - $this->env = null; - $this->inParens = false; - $this->eatWhiteDefault = true; - $this->buffer = (string) $buffer; - - $this->saveEncoding(); - $this->extractLineNumbers($this->buffer); - - $isMediaQuery = $this->mediaQueryList($out); - - $this->restoreEncoding(); - - return $isMediaQuery; - } - - /** - * Parse a single chunk off the head of the buffer and append it to the - * current parse environment. - * - * Returns false when the buffer is empty, or when there is an error. - * - * This function is called repeatedly until the entire document is - * parsed. - * - * This parser is most similar to a recursive descent parser. Single - * functions represent discrete grammatical rules for the language, and - * they are able to capture the text that represents those rules. - * - * Consider the function Compiler::keyword(). (All parse functions are - * structured the same.) - * - * The function takes a single reference argument. When calling the - * function it will attempt to match a keyword on the head of the buffer. - * If it is successful, it will place the keyword in the referenced - * argument, advance the position in the buffer, and return true. If it - * fails then it won't advance the buffer and it will return false. - * - * All of these parse functions are powered by Compiler::match(), which behaves - * the same way, but takes a literal regular expression. Sometimes it is - * more convenient to use match instead of creating a new function. - * - * Because of the format of the functions, to parse an entire string of - * grammatical rules, you can chain them together using &&. - * - * But, if some of the rules in the chain succeed before one fails, then - * the buffer position will be left at an invalid state. In order to - * avoid this, Compiler::seek() is used to remember and set buffer positions. - * - * Before parsing a chain, use $s = $this->count to remember the current - * position into $s. Then if a chain fails, use $this->seek($s) to - * go back where we started. - * - * @return boolean - */ - protected function parseChunk() - { - $s = $this->count; - - // the directives - if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] === '@') { - if ( - $this->literal('@at-root', 8) && - ($this->selectors($selector) || true) && - ($this->map($with) || true) && - (($this->matchChar('(') && - $this->interpolation($with) && - $this->matchChar(')')) || true) && - $this->matchChar('{', false) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $atRoot = $this->pushSpecialBlock(Type::T_AT_ROOT, $s); - $atRoot->selector = $selector; - $atRoot->with = $with; - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@media', 6) && - $this->mediaQueryList($mediaQueryList) && - $this->matchChar('{', false) - ) { - $media = $this->pushSpecialBlock(Type::T_MEDIA, $s); - $media->queryList = $mediaQueryList[2]; - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@mixin', 6) && - $this->keyword($mixinName) && - ($this->argumentDef($args) || true) && - $this->matchChar('{', false) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $mixin = $this->pushSpecialBlock(Type::T_MIXIN, $s); - $mixin->name = $mixinName; - $mixin->args = $args; - - return true; - } - - $this->seek($s); - - if ( - ($this->literal('@include', 8) && - $this->keyword($mixinName) && - ($this->matchChar('(') && - ($this->argValues($argValues) || true) && - $this->matchChar(')') || true) && - ($this->end()) || - ($this->literal('using', 5) && - $this->argumentDef($argUsing) && - ($this->end() || $this->matchChar('{') && $hasBlock = true)) || - $this->matchChar('{') && $hasBlock = true) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $child = [ - Type::T_INCLUDE, - $mixinName, - isset($argValues) ? $argValues : null, - null, - isset($argUsing) ? $argUsing : null - ]; - - if (! empty($hasBlock)) { - $include = $this->pushSpecialBlock(Type::T_INCLUDE, $s); - $include->child = $child; - } else { - $this->append($child, $s); - } - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@scssphp-import-once', 20) && - $this->valueList($importPath) && - $this->end() - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - list($line, $column) = $this->getSourcePosition($s); - $file = $this->sourceName; - $this->logger->warn("The \"@scssphp-import-once\" directive is deprecated and will be removed in ScssPhp 2.0, in \"$file\", line $line, column $column.", true); - - $this->append([Type::T_SCSSPHP_IMPORT_ONCE, $importPath], $s); - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@import', 7) && - $this->valueList($importPath) && - $importPath[0] !== Type::T_FUNCTION_CALL && - $this->end() - ) { - if ($this->cssOnly) { - $this->assertPlainCssValid([Type::T_IMPORT, $importPath], $s); - $this->append([Type::T_COMMENT, rtrim(substr($this->buffer, $s, $this->count - $s))]); - return true; - } - - $this->append([Type::T_IMPORT, $importPath], $s); - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@import', 7) && - $this->url($importPath) && - $this->end() - ) { - if ($this->cssOnly) { - $this->assertPlainCssValid([Type::T_IMPORT, $importPath], $s); - $this->append([Type::T_COMMENT, rtrim(substr($this->buffer, $s, $this->count - $s))]); - return true; - } - - $this->append([Type::T_IMPORT, $importPath], $s); - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@extend', 7) && - $this->selectors($selectors) && - $this->end() - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - // check for '!flag' - $optional = $this->stripOptionalFlag($selectors); - $this->append([Type::T_EXTEND, $selectors, $optional], $s); - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@function', 9) && - $this->keyword($fnName) && - $this->argumentDef($args) && - $this->matchChar('{', false) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $func = $this->pushSpecialBlock(Type::T_FUNCTION, $s); - $func->name = $fnName; - $func->args = $args; - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@return', 7) && - ($this->valueList($retVal) || true) && - $this->end() - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $this->append([Type::T_RETURN, isset($retVal) ? $retVal : [Type::T_NULL]], $s); - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@each', 5) && - $this->genericList($varNames, 'variable', ',', false) && - $this->literal('in', 2) && - $this->valueList($list) && - $this->matchChar('{', false) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $each = $this->pushSpecialBlock(Type::T_EACH, $s); - - foreach ($varNames[2] as $varName) { - $each->vars[] = $varName[1]; - } - - $each->list = $list; - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@while', 6) && - $this->expression($cond) && - $this->matchChar('{', false) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - while ( - $cond[0] === Type::T_LIST && - ! empty($cond['enclosing']) && - $cond['enclosing'] === 'parent' && - \count($cond[2]) == 1 - ) { - $cond = reset($cond[2]); - } - - $while = $this->pushSpecialBlock(Type::T_WHILE, $s); - $while->cond = $cond; - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@for', 4) && - $this->variable($varName) && - $this->literal('from', 4) && - $this->expression($start) && - ($this->literal('through', 7) || - ($forUntil = true && $this->literal('to', 2))) && - $this->expression($end) && - $this->matchChar('{', false) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $for = $this->pushSpecialBlock(Type::T_FOR, $s); - $for->var = $varName[1]; - $for->start = $start; - $for->end = $end; - $for->until = isset($forUntil); - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@if', 3) && - $this->functionCallArgumentsList($cond, false, '{', false) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $if = $this->pushSpecialBlock(Type::T_IF, $s); - - while ( - $cond[0] === Type::T_LIST && - ! empty($cond['enclosing']) && - $cond['enclosing'] === 'parent' && - \count($cond[2]) == 1 - ) { - $cond = reset($cond[2]); - } - - $if->cond = $cond; - $if->cases = []; - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@debug', 6) && - $this->functionCallArgumentsList($value, false) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $this->append([Type::T_DEBUG, $value], $s); - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@warn', 5) && - $this->functionCallArgumentsList($value, false) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $this->append([Type::T_WARN, $value], $s); - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@error', 6) && - $this->functionCallArgumentsList($value, false) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $this->append([Type::T_ERROR, $value], $s); - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@content', 8) && - ($this->end() || - $this->matchChar('(') && - $this->argValues($argContent) && - $this->matchChar(')') && - $this->end()) - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - $this->append([Type::T_MIXIN_CONTENT, isset($argContent) ? $argContent : null], $s); - - return true; - } - - $this->seek($s); - - $last = $this->last(); - - if (isset($last) && $last[0] === Type::T_IF) { - list(, $if) = $last; - - if ($this->literal('@else', 5)) { - if ($this->matchChar('{', false)) { - $else = $this->pushSpecialBlock(Type::T_ELSE, $s); - } elseif ( - $this->literal('if', 2) && - $this->functionCallArgumentsList($cond, false, '{', false) - ) { - $else = $this->pushSpecialBlock(Type::T_ELSEIF, $s); - $else->cond = $cond; - } - - if (isset($else)) { - $else->dontAppend = true; - $if->cases[] = $else; - - return true; - } - } - - $this->seek($s); - } - - // only retain the first @charset directive encountered - if ( - $this->literal('@charset', 8) && - $this->valueList($charset) && - $this->end() - ) { - if (! isset($this->charset)) { - $statement = [Type::T_CHARSET, $charset]; - - list($line, $column) = $this->getSourcePosition($s); - - $statement[static::SOURCE_LINE] = $line; - $statement[static::SOURCE_COLUMN] = $column; - $statement[static::SOURCE_INDEX] = $this->sourceIndex; - - $this->charset = $statement; - } - - return true; - } - - $this->seek($s); - - if ( - $this->literal('@supports', 9) && - ($t1 = $this->supportsQuery($supportQuery)) && - ($t2 = $this->matchChar('{', false)) - ) { - $directive = $this->pushSpecialBlock(Type::T_DIRECTIVE, $s); - $directive->name = 'supports'; - $directive->value = $supportQuery; - - return true; - } - - $this->seek($s); - - // doesn't match built in directive, do generic one - if ( - $this->matchChar('@', false) && - $this->mixedKeyword($dirName) && - $this->directiveValue($dirValue, '{') - ) { - if (count($dirName) === 1 && is_string(reset($dirName))) { - $dirName = reset($dirName); - } else { - $dirName = [Type::T_STRING, '', $dirName]; - } - if ($dirName === 'media') { - $directive = $this->pushSpecialBlock(Type::T_MEDIA, $s); - } else { - $directive = $this->pushSpecialBlock(Type::T_DIRECTIVE, $s); - $directive->name = $dirName; - } - - if (isset($dirValue)) { - ! $this->cssOnly || ($dirValue = $this->assertPlainCssValid($dirValue)); - $directive->value = $dirValue; - } - - return true; - } - - $this->seek($s); - - // maybe it's a generic blockless directive - if ( - $this->matchChar('@', false) && - $this->mixedKeyword($dirName) && - ! $this->isKnownGenericDirective($dirName) && - ($this->end(false) || ($this->directiveValue($dirValue, '') && $this->end(false))) - ) { - if (\count($dirName) === 1 && \is_string(\reset($dirName))) { - $dirName = \reset($dirName); - } else { - $dirName = [Type::T_STRING, '', $dirName]; - } - if ( - ! empty($this->env->parent) && - $this->env->type && - ! \in_array($this->env->type, [Type::T_DIRECTIVE, Type::T_MEDIA]) - ) { - $plain = \trim(\substr($this->buffer, $s, $this->count - $s)); - throw $this->parseError( - "Unknown directive `{$plain}` not allowed in `" . $this->env->type . "` block" - ); - } - // blockless directives with a blank line after keeps their blank lines after - // sass-spec compliance purpose - $s = $this->count; - $hasBlankLine = false; - if ($this->match('\s*?\n\s*\n', $out, false)) { - $hasBlankLine = true; - $this->seek($s); - } - $isNotRoot = ! empty($this->env->parent); - $this->append([Type::T_DIRECTIVE, [$dirName, $dirValue, $hasBlankLine, $isNotRoot]], $s); - $this->whitespace(); - - return true; - } - - $this->seek($s); - - return false; - } - - $inCssSelector = null; - if ($this->cssOnly) { - $inCssSelector = (! empty($this->env->parent) && - ! in_array($this->env->type, [Type::T_DIRECTIVE, Type::T_MEDIA])); - } - // custom properties : right part is static - if (($this->customProperty($name) ) && $this->matchChar(':', false)) { - $start = $this->count; - - // but can be complex and finish with ; or } - foreach ([';','}'] as $ending) { - if ( - $this->openString($ending, $stringValue, '(', ')', false) && - $this->end() - ) { - $end = $this->count; - $value = $stringValue; - - // check if we have only a partial value due to nested [] or { } to take in account - $nestingPairs = [['[', ']'], ['{', '}']]; - - foreach ($nestingPairs as $nestingPair) { - $p = strpos($this->buffer, $nestingPair[0], $start); - - if ($p && $p < $end) { - $this->seek($start); - - if ( - $this->openString($ending, $stringValue, $nestingPair[0], $nestingPair[1], false) && - $this->end() && - $this->count > $end - ) { - $end = $this->count; - $value = $stringValue; - } - } - } - - $this->seek($end); - $this->append([Type::T_CUSTOM_PROPERTY, $name, $value], $s); - - return true; - } - } - - // TODO: output an error here if nothing found according to sass spec - } - - $this->seek($s); - - // property shortcut - // captures most properties before having to parse a selector - if ( - $this->keyword($name, false) && - $this->literal(': ', 2) && - $this->valueList($value) && - $this->end() - ) { - $name = [Type::T_STRING, '', [$name]]; - $this->append([Type::T_ASSIGN, $name, $value], $s); - - return true; - } - - $this->seek($s); - - // variable assigns - if ( - $this->variable($name) && - $this->matchChar(':') && - $this->valueList($value) && - $this->end() - ) { - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - - // check for '!flag' - $assignmentFlags = $this->stripAssignmentFlags($value); - $this->append([Type::T_ASSIGN, $name, $value, $assignmentFlags], $s); - - return true; - } - - $this->seek($s); - - // opening css block - if ( - $this->selectors($selectors) && - $this->matchChar('{', false) - ) { - ! $this->cssOnly || ! $inCssSelector || $this->assertPlainCssValid(false); - - $this->pushBlock($selectors, $s); - - if ($this->eatWhiteDefault) { - $this->whitespace(); - $this->append(null); // collect comments at the beginning if needed - } - - return true; - } - - $this->seek($s); - - // property assign, or nested assign - if ( - $this->propertyName($name) && - $this->matchChar(':') - ) { - $foundSomething = false; - - if ($this->valueList($value)) { - if (empty($this->env->parent)) { - throw $this->parseError('expected "{"'); - } - - $this->append([Type::T_ASSIGN, $name, $value], $s); - $foundSomething = true; - } - - if ($this->matchChar('{', false)) { - ! $this->cssOnly || $this->assertPlainCssValid(false); - - $propBlock = $this->pushSpecialBlock(Type::T_NESTED_PROPERTY, $s); - $propBlock->prefix = $name; - $propBlock->hasValue = $foundSomething; - - $foundSomething = true; - } elseif ($foundSomething) { - $foundSomething = $this->end(); - } - - if ($foundSomething) { - return true; - } - } - - $this->seek($s); - - // closing a block - if ($this->matchChar('}', false)) { - $block = $this->popBlock(); - - if (! isset($block->type) || $block->type !== Type::T_IF) { - if ($this->env->parent) { - $this->append(null); // collect comments before next statement if needed - } - } - - if (isset($block->type) && $block->type === Type::T_INCLUDE) { - $include = $block->child; - unset($block->child); - $include[3] = $block; - $this->append($include, $s); - } elseif (empty($block->dontAppend)) { - $type = isset($block->type) ? $block->type : Type::T_BLOCK; - $this->append([$type, $block], $s); - } - - // collect comments just after the block closing if needed - if ($this->eatWhiteDefault) { - $this->whitespace(); - - if ($this->env->comments) { - $this->append(null); - } - } - - return true; - } - - // extra stuff - if ($this->matchChar(';')) { - return true; - } - - return false; - } - - /** - * Push block onto parse tree - * - * @param array|null $selectors - * @param integer $pos - * - * @return Block - */ - protected function pushBlock($selectors, $pos = 0) - { - list($line, $column) = $this->getSourcePosition($pos); - - $b = new Block(); - $b->sourceName = $this->sourceName; - $b->sourceLine = $line; - $b->sourceColumn = $column; - $b->sourceIndex = $this->sourceIndex; - $b->selectors = $selectors; - $b->comments = []; - $b->parent = $this->env; - - if (! $this->env) { - $b->children = []; - } elseif (empty($this->env->children)) { - $this->env->children = $this->env->comments; - $b->children = []; - $this->env->comments = []; - } else { - $b->children = $this->env->comments; - $this->env->comments = []; - } - - $this->env = $b; - - // collect comments at the beginning of a block if needed - if ($this->eatWhiteDefault) { - $this->whitespace(); - - if ($this->env->comments) { - $this->append(null); - } - } - - return $b; - } - - /** - * Push special (named) block onto parse tree - * - * @param string $type - * @param integer $pos - * - * @return Block - */ - protected function pushSpecialBlock($type, $pos) - { - $block = $this->pushBlock(null, $pos); - $block->type = $type; - - return $block; - } - - /** - * Pop scope and return last block - * - * @return Block - * - * @throws \Exception - */ - protected function popBlock() - { - - // collect comments ending just before of a block closing - if ($this->env->comments) { - $this->append(null); - } - - // pop the block - $block = $this->env; - - if (empty($block->parent)) { - throw $this->parseError('unexpected }'); - } - - if ($block->type == Type::T_AT_ROOT) { - // keeps the parent in case of self selector & - $block->selfParent = $block->parent; - } - - $this->env = $block->parent; - - unset($block->parent); - - return $block; - } - - /** - * Peek input stream - * - * @param string $regex - * @param array $out - * @param integer $from - * - * @return integer - */ - protected function peek($regex, &$out, $from = null) - { - if (! isset($from)) { - $from = $this->count; - } - - $r = '/' . $regex . '/' . $this->patternModifiers; - $result = preg_match($r, $this->buffer, $out, 0, $from); - - return $result; - } - - /** - * Seek to position in input stream (or return current position in input stream) - * - * @param integer $where - */ - protected function seek($where) - { - $this->count = $where; - } - - /** - * Assert a parsed part is plain CSS Valid - * - * @param array|false $parsed - * @param int $startPos - * @throws ParserException - */ - protected function assertPlainCssValid($parsed, $startPos = null) - { - $type = ''; - if ($parsed) { - $type = $parsed[0]; - $parsed = $this->isPlainCssValidElement($parsed); - } - if (! $parsed) { - if (! \is_null($startPos)) { - $plain = rtrim(substr($this->buffer, $startPos, $this->count - $startPos)); - $message = "Error : `{$plain}` isn't allowed in plain CSS"; - } else { - $message = 'Error: SCSS syntax not allowed in CSS file'; - } - if ($type) { - $message .= " ($type)"; - } - throw $this->parseError($message); - } - - return $parsed; - } - - /** - * Check a parsed element is plain CSS Valid - * @param array $parsed - * @return bool|array - */ - protected function isPlainCssValidElement($parsed, $allowExpression = false) - { - // keep string as is - if (is_string($parsed)) { - return $parsed; - } - - if ( - \in_array($parsed[0], [Type::T_FUNCTION, Type::T_FUNCTION_CALL]) && - !\in_array($parsed[1], [ - 'alpha', - 'attr', - 'calc', - 'cubic-bezier', - 'env', - 'grayscale', - 'hsl', - 'hsla', - 'hwb', - 'invert', - 'linear-gradient', - 'min', - 'max', - 'radial-gradient', - 'repeating-linear-gradient', - 'repeating-radial-gradient', - 'rgb', - 'rgba', - 'rotate', - 'saturate', - 'var', - ]) && - Compiler::isNativeFunction($parsed[1]) - ) { - return false; - } - - switch ($parsed[0]) { - case Type::T_BLOCK: - case Type::T_KEYWORD: - case Type::T_NULL: - case Type::T_NUMBER: - case Type::T_MEDIA: - return $parsed; - - case Type::T_COMMENT: - if (isset($parsed[2])) { - return false; - } - return $parsed; - - case Type::T_DIRECTIVE: - if (\is_array($parsed[1])) { - $parsed[1][1] = $this->isPlainCssValidElement($parsed[1][1]); - if (! $parsed[1][1]) { - return false; - } - } - - return $parsed; - - case Type::T_IMPORT: - if ($parsed[1][0] === Type::T_LIST) { - return false; - } - $parsed[1] = $this->isPlainCssValidElement($parsed[1]); - if ($parsed[1] === false) { - return false; - } - return $parsed; - - case Type::T_STRING: - foreach ($parsed[2] as $k => $substr) { - if (\is_array($substr)) { - $parsed[2][$k] = $this->isPlainCssValidElement($substr); - if (! $parsed[2][$k]) { - return false; - } - } - } - return $parsed; - - case Type::T_LIST: - if (!empty($parsed['enclosing'])) { - return false; - } - foreach ($parsed[2] as $k => $listElement) { - $parsed[2][$k] = $this->isPlainCssValidElement($listElement); - if (! $parsed[2][$k]) { - return false; - } - } - return $parsed; - - case Type::T_ASSIGN: - foreach ([1, 2, 3] as $k) { - if (! empty($parsed[$k])) { - $parsed[$k] = $this->isPlainCssValidElement($parsed[$k]); - if (! $parsed[$k]) { - return false; - } - } - } - return $parsed; - - case Type::T_EXPRESSION: - list( ,$op, $lhs, $rhs, $inParens, $whiteBefore, $whiteAfter) = $parsed; - if (! $allowExpression && ! \in_array($op, ['and', 'or', '/'])) { - return false; - } - $lhs = $this->isPlainCssValidElement($lhs, true); - if (! $lhs) { - return false; - } - $rhs = $this->isPlainCssValidElement($rhs, true); - if (! $rhs) { - return false; - } - - return [ - Type::T_STRING, - '', [ - $this->inParens ? '(' : '', - $lhs, - ($whiteBefore ? ' ' : '') . $op . ($whiteAfter ? ' ' : ''), - $rhs, - $this->inParens ? ')' : '' - ] - ]; - - case Type::T_CUSTOM_PROPERTY: - case Type::T_UNARY: - $parsed[2] = $this->isPlainCssValidElement($parsed[2]); - if (! $parsed[2]) { - return false; - } - return $parsed; - - case Type::T_FUNCTION: - $argsList = $parsed[2]; - foreach ($argsList[2] as $argElement) { - if (! $this->isPlainCssValidElement($argElement)) { - return false; - } - } - return $parsed; - - case Type::T_FUNCTION_CALL: - $parsed[0] = Type::T_FUNCTION; - $argsList = [Type::T_LIST, ',', []]; - foreach ($parsed[2] as $arg) { - if ($arg[0] || ! empty($arg[2])) { - // no named arguments possible in a css function call - // nor ... argument - return false; - } - $arg = $this->isPlainCssValidElement($arg[1], $parsed[1] === 'calc'); - if (! $arg) { - return false; - } - $argsList[2][] = $arg; - } - $parsed[2] = $argsList; - return $parsed; - } - - return false; - } - - /** - * Match string looking for either ending delim, escape, or string interpolation - * - * {@internal This is a workaround for preg_match's 250K string match limit. }} - * - * @param array $m Matches (passed by reference) - * @param string $delim Delimiter - * - * @return boolean True if match; false otherwise - */ - protected function matchString(&$m, $delim) - { - $token = null; - - $end = \strlen($this->buffer); - - // look for either ending delim, escape, or string interpolation - foreach (['#{', '\\', "\r", $delim] as $lookahead) { - $pos = strpos($this->buffer, $lookahead, $this->count); - - if ($pos !== false && $pos < $end) { - $end = $pos; - $token = $lookahead; - } - } - - if (! isset($token)) { - return false; - } - - $match = substr($this->buffer, $this->count, $end - $this->count); - $m = [ - $match . $token, - $match, - $token - ]; - $this->count = $end + \strlen($token); - - return true; - } - - /** - * Try to match something on head of buffer - * - * @param string $regex - * @param array $out - * @param boolean $eatWhitespace - * - * @return boolean - */ - protected function match($regex, &$out, $eatWhitespace = null) - { - $r = '/' . $regex . '/' . $this->patternModifiers; - - if (! preg_match($r, $this->buffer, $out, 0, $this->count)) { - return false; - } - - $this->count += \strlen($out[0]); - - if (! isset($eatWhitespace)) { - $eatWhitespace = $this->eatWhiteDefault; - } - - if ($eatWhitespace) { - $this->whitespace(); - } - - return true; - } - - /** - * Match a single string - * - * @param string $char - * @param boolean $eatWhitespace - * - * @return boolean - */ - protected function matchChar($char, $eatWhitespace = null) - { - if (! isset($this->buffer[$this->count]) || $this->buffer[$this->count] !== $char) { - return false; - } - - $this->count++; - - if (! isset($eatWhitespace)) { - $eatWhitespace = $this->eatWhiteDefault; - } - - if ($eatWhitespace) { - $this->whitespace(); - } - - return true; - } - - /** - * Match literal string - * - * @param string $what - * @param integer $len - * @param boolean $eatWhitespace - * - * @return boolean - */ - protected function literal($what, $len, $eatWhitespace = null) - { - if (strcasecmp(substr($this->buffer, $this->count, $len), $what) !== 0) { - return false; - } - - $this->count += $len; - - if (! isset($eatWhitespace)) { - $eatWhitespace = $this->eatWhiteDefault; - } - - if ($eatWhitespace) { - $this->whitespace(); - } - - return true; - } - - /** - * Match some whitespace - * - * @return boolean - */ - protected function whitespace() - { - $gotWhite = false; - - while (preg_match(static::$whitePattern, $this->buffer, $m, 0, $this->count)) { - if (isset($m[1]) && empty($this->commentsSeen[$this->count])) { - // comment that are kept in the output CSS - $comment = []; - $startCommentCount = $this->count; - $endCommentCount = $this->count + \strlen($m[1]); - - // find interpolations in comment - $p = strpos($this->buffer, '#{', $this->count); - - while ($p !== false && $p < $endCommentCount) { - $c = substr($this->buffer, $this->count, $p - $this->count); - $comment[] = $c; - $this->count = $p; - $out = null; - - if ($this->interpolation($out)) { - // keep right spaces in the following string part - if ($out[3]) { - while ($this->buffer[$this->count - 1] !== '}') { - $this->count--; - } - - $out[3] = ''; - } - - $comment[] = [Type::T_COMMENT, substr($this->buffer, $p, $this->count - $p), $out]; - } else { - list($line, $column) = $this->getSourcePosition($this->count); - $file = $this->sourceName; - $this->logger->warn("Unterminated interpolations in multiline comments are deprecated and will be removed in ScssPhp 2.0, in \"$file\", line $line, column $column.", true); - $comment[] = substr($this->buffer, $this->count, 2); - - $this->count += 2; - } - - $p = strpos($this->buffer, '#{', $this->count); - } - - // remaining part - $c = substr($this->buffer, $this->count, $endCommentCount - $this->count); - - if (! $comment) { - // single part static comment - $this->appendComment([Type::T_COMMENT, $c]); - } else { - $comment[] = $c; - $staticComment = substr($this->buffer, $startCommentCount, $endCommentCount - $startCommentCount); - $commentStatement = [Type::T_COMMENT, $staticComment, [Type::T_STRING, '', $comment]]; - - list($line, $column) = $this->getSourcePosition($startCommentCount); - $commentStatement[self::SOURCE_LINE] = $line; - $commentStatement[self::SOURCE_COLUMN] = $column; - $commentStatement[self::SOURCE_INDEX] = $this->sourceIndex; - - $this->appendComment($commentStatement); - } - - $this->commentsSeen[$startCommentCount] = true; - $this->count = $endCommentCount; - } else { - // comment that are ignored and not kept in the output css - $this->count += \strlen($m[0]); - // silent comments are not allowed in plain CSS files - ! $this->cssOnly - || ! \strlen(trim($m[0])) - || $this->assertPlainCssValid(false, $this->count - \strlen($m[0])); - } - - $gotWhite = true; - } - - return $gotWhite; - } - - /** - * Append comment to current block - * - * @param array $comment - */ - protected function appendComment($comment) - { - if (! $this->discardComments) { - $this->env->comments[] = $comment; - } - } - - /** - * Append statement to current block - * - * @param array|null $statement - * @param integer $pos - */ - protected function append($statement, $pos = null) - { - if (! \is_null($statement)) { - ! $this->cssOnly || ($statement = $this->assertPlainCssValid($statement, $pos)); - - if (! \is_null($pos)) { - list($line, $column) = $this->getSourcePosition($pos); - - $statement[static::SOURCE_LINE] = $line; - $statement[static::SOURCE_COLUMN] = $column; - $statement[static::SOURCE_INDEX] = $this->sourceIndex; - } - - $this->env->children[] = $statement; - } - - $comments = $this->env->comments; - - if ($comments) { - $this->env->children = array_merge($this->env->children, $comments); - $this->env->comments = []; - } - } - - /** - * Returns last child was appended - * - * @return array|null - */ - protected function last() - { - $i = \count($this->env->children) - 1; - - if (isset($this->env->children[$i])) { - return $this->env->children[$i]; - } - } - - /** - * Parse media query list - * - * @param array $out - * - * @return boolean - */ - protected function mediaQueryList(&$out) - { - return $this->genericList($out, 'mediaQuery', ',', false); - } - - /** - * Parse media query - * - * @param array $out - * - * @return boolean - */ - protected function mediaQuery(&$out) - { - $expressions = null; - $parts = []; - - if ( - ($this->literal('only', 4) && ($only = true) || - $this->literal('not', 3) && ($not = true) || true) && - $this->mixedKeyword($mediaType) - ) { - $prop = [Type::T_MEDIA_TYPE]; - - if (isset($only)) { - $prop[] = [Type::T_KEYWORD, 'only']; - } - - if (isset($not)) { - $prop[] = [Type::T_KEYWORD, 'not']; - } - - $media = [Type::T_LIST, '', []]; - - foreach ((array) $mediaType as $type) { - if (\is_array($type)) { - $media[2][] = $type; - } else { - $media[2][] = [Type::T_KEYWORD, $type]; - } - } - - $prop[] = $media; - $parts[] = $prop; - } - - if (empty($parts) || $this->literal('and', 3)) { - $this->genericList($expressions, 'mediaExpression', 'and', false); - - if (\is_array($expressions)) { - $parts = array_merge($parts, $expressions[2]); - } - } - - $out = $parts; - - return true; - } - - /** - * Parse supports query - * - * @param array $out - * - * @return boolean - */ - protected function supportsQuery(&$out) - { - $expressions = null; - $parts = []; - - $s = $this->count; - - $not = false; - - if ( - ($this->literal('not', 3) && ($not = true) || true) && - $this->matchChar('(') && - ($this->expression($property)) && - $this->literal(': ', 2) && - $this->valueList($value) && - $this->matchChar(')') - ) { - $support = [Type::T_STRING, '', [[Type::T_KEYWORD, ($not ? 'not ' : '') . '(']]]; - $support[2][] = $property; - $support[2][] = [Type::T_KEYWORD, ': ']; - $support[2][] = $value; - $support[2][] = [Type::T_KEYWORD, ')']; - - $parts[] = $support; - $s = $this->count; - } else { - $this->seek($s); - } - - if ( - $this->matchChar('(') && - $this->supportsQuery($subQuery) && - $this->matchChar(')') - ) { - $parts[] = [Type::T_STRING, '', [[Type::T_KEYWORD, '('], $subQuery, [Type::T_KEYWORD, ')']]]; - $s = $this->count; - } else { - $this->seek($s); - } - - if ( - $this->literal('not', 3) && - $this->supportsQuery($subQuery) - ) { - $parts[] = [Type::T_STRING, '', [[Type::T_KEYWORD, 'not '], $subQuery]]; - $s = $this->count; - } else { - $this->seek($s); - } - - if ( - $this->literal('selector(', 9) && - $this->selector($selector) && - $this->matchChar(')') - ) { - $support = [Type::T_STRING, '', [[Type::T_KEYWORD, 'selector(']]]; - - $selectorList = [Type::T_LIST, '', []]; - - foreach ($selector as $sc) { - $compound = [Type::T_STRING, '', []]; - - foreach ($sc as $scp) { - if (\is_array($scp)) { - $compound[2][] = $scp; - } else { - $compound[2][] = [Type::T_KEYWORD, $scp]; - } - } - - $selectorList[2][] = $compound; - } - - $support[2][] = $selectorList; - $support[2][] = [Type::T_KEYWORD, ')']; - $parts[] = $support; - $s = $this->count; - } else { - $this->seek($s); - } - - if ($this->variable($var) or $this->interpolation($var)) { - $parts[] = $var; - $s = $this->count; - } else { - $this->seek($s); - } - - if ( - $this->literal('and', 3) && - $this->genericList($expressions, 'supportsQuery', ' and', false) - ) { - array_unshift($expressions[2], [Type::T_STRING, '', $parts]); - - $parts = [$expressions]; - $s = $this->count; - } else { - $this->seek($s); - } - - if ( - $this->literal('or', 2) && - $this->genericList($expressions, 'supportsQuery', ' or', false) - ) { - array_unshift($expressions[2], [Type::T_STRING, '', $parts]); - - $parts = [$expressions]; - $s = $this->count; - } else { - $this->seek($s); - } - - if (\count($parts)) { - if ($this->eatWhiteDefault) { - $this->whitespace(); - } - - $out = [Type::T_STRING, '', $parts]; - - return true; - } - - return false; - } - - - /** - * Parse media expression - * - * @param array $out - * - * @return boolean - */ - protected function mediaExpression(&$out) - { - $s = $this->count; - $value = null; - - if ( - $this->matchChar('(') && - $this->expression($feature) && - ($this->matchChar(':') && - $this->expression($value) || true) && - $this->matchChar(')') - ) { - $out = [Type::T_MEDIA_EXPRESSION, $feature]; - - if ($value) { - $out[] = $value; - } - - return true; - } - - $this->seek($s); - - return false; - } - - /** - * Parse argument values - * - * @param array $out - * - * @return boolean - */ - protected function argValues(&$out) - { - $discardComments = $this->discardComments; - $this->discardComments = true; - - if ($this->genericList($list, 'argValue', ',', false)) { - $out = $list[2]; - - $this->discardComments = $discardComments; - - return true; - } - - $this->discardComments = $discardComments; - - return false; - } - - /** - * Parse argument value - * - * @param array $out - * - * @return boolean - */ - protected function argValue(&$out) - { - $s = $this->count; - - $keyword = null; - - if (! $this->variable($keyword) || ! $this->matchChar(':')) { - $this->seek($s); - - $keyword = null; - } - - if ($this->genericList($value, 'expression', '', true)) { - $out = [$keyword, $value, false]; - $s = $this->count; - - if ($this->literal('...', 3)) { - $out[2] = true; - } else { - $this->seek($s); - } - - return true; - } - - return false; - } - - /** - * Check if a generic directive is known to be able to allow almost any syntax or not - * @param mixed $directiveName - * @return bool - */ - protected function isKnownGenericDirective($directiveName) - { - if (\is_array($directiveName) && \is_string(reset($directiveName))) { - $directiveName = reset($directiveName); - } - if (! \is_string($directiveName)) { - return false; - } - if ( - \in_array($directiveName, [ - 'at-root', - 'media', - 'mixin', - 'include', - 'scssphp-import-once', - 'import', - 'extend', - 'function', - 'break', - 'continue', - 'return', - 'each', - 'while', - 'for', - 'if', - 'debug', - 'warn', - 'error', - 'content', - 'else', - 'charset', - 'supports', - // Todo - 'use', - 'forward', - ]) - ) { - return true; - } - return false; - } - - /** - * Parse directive value list that considers $vars as keyword - * - * @param array $out - * @param boolean|string $endChar - * - * @return boolean - */ - protected function directiveValue(&$out, $endChar = false) - { - $s = $this->count; - - if ($this->variable($out)) { - if ($endChar && $this->matchChar($endChar, false)) { - return true; - } - - if (! $endChar && $this->end()) { - return true; - } - } - - $this->seek($s); - - if (\is_string($endChar) && $this->openString($endChar ? $endChar : ';', $out, null, null, true, ";}{")) { - if ($endChar && $this->matchChar($endChar, false)) { - return true; - } - $ss = $this->count; - if (!$endChar && $this->end()) { - $this->seek($ss); - return true; - } - } - - $this->seek($s); - - $allowVars = $this->allowVars; - $this->allowVars = false; - - $res = $this->genericList($out, 'spaceList', ','); - $this->allowVars = $allowVars; - - if ($res) { - if ($endChar && $this->matchChar($endChar, false)) { - return true; - } - - if (! $endChar && $this->end()) { - return true; - } - } - - $this->seek($s); - - if ($endChar && $this->matchChar($endChar, false)) { - return true; - } - - return false; - } - - /** - * Parse comma separated value list - * - * @param array $out - * - * @return boolean - */ - protected function valueList(&$out) - { - $discardComments = $this->discardComments; - $this->discardComments = true; - $res = $this->genericList($out, 'spaceList', ','); - $this->discardComments = $discardComments; - - return $res; - } - - /** - * Parse a function call, where externals () are part of the call - * and not of the value list - * - * @param $out - * @param bool $mandatoryEnclos - * @param null|string $charAfter - * @param null|bool $eatWhiteSp - * @return bool - */ - protected function functionCallArgumentsList(&$out, $mandatoryEnclos = true, $charAfter = null, $eatWhiteSp = null) - { - $s = $this->count; - - if ( - $this->matchChar('(') && - $this->valueList($out) && - $this->matchChar(')') && - ($charAfter ? $this->matchChar($charAfter, $eatWhiteSp) : $this->end()) - ) { - return true; - } - - if (! $mandatoryEnclos) { - $this->seek($s); - - if ( - $this->valueList($out) && - ($charAfter ? $this->matchChar($charAfter, $eatWhiteSp) : $this->end()) - ) { - return true; - } - } - - $this->seek($s); - - return false; - } - - /** - * Parse space separated value list - * - * @param array $out - * - * @return boolean - */ - protected function spaceList(&$out) - { - return $this->genericList($out, 'expression'); - } - - /** - * Parse generic list - * - * @param array $out - * @param string $parseItem The name of the method used to parse items - * @param string $delim - * @param boolean $flatten - * - * @return boolean - */ - protected function genericList(&$out, $parseItem, $delim = '', $flatten = true) - { - $s = $this->count; - $items = []; - $value = null; - - while ($this->$parseItem($value)) { - $trailing_delim = false; - $items[] = $value; - - if ($delim) { - if (! $this->literal($delim, \strlen($delim))) { - break; - } - - $trailing_delim = true; - } else { - // if no delim watch that a keyword didn't eat the single/double quote - // from the following starting string - if ($value[0] === Type::T_KEYWORD) { - $word = $value[1]; - - $last_char = substr($word, -1); - - if ( - strlen($word) > 1 && - in_array($last_char, [ "'", '"']) && - substr($word, -2, 1) !== '\\' - ) { - // if there is a non escaped opening quote in the keyword, this seems unlikely a mistake - $word = str_replace('\\' . $last_char, '\\\\', $word); - if (strpos($word, $last_char) < strlen($word) - 1) { - continue; - } - - $currentCount = $this->count; - - // let's try to rewind to previous char and try a parse - $this->count--; - // in case the keyword also eat spaces - while (substr($this->buffer, $this->count, 1) !== $last_char) { - $this->count--; - } - - $nextValue = null; - if ($this->$parseItem($nextValue)) { - if ($nextValue[0] === Type::T_KEYWORD && $nextValue[1] === $last_char) { - // bad try, forget it - $this->seek($currentCount); - continue; - } - if ($nextValue[0] !== Type::T_STRING) { - // bad try, forget it - $this->seek($currentCount); - continue; - } - - // OK it was a good idea - $value[1] = substr($value[1], 0, -1); - array_pop($items); - $items[] = $value; - $items[] = $nextValue; - } else { - // bad try, forget it - $this->seek($currentCount); - continue; - } - } - } - } - } - - if (! $items) { - $this->seek($s); - - return false; - } - - if ($trailing_delim) { - $items[] = [Type::T_NULL]; - } - - if ($flatten && \count($items) === 1) { - $out = $items[0]; - } else { - $out = [Type::T_LIST, $delim, $items]; - } - - return true; - } - - /** - * Parse expression - * - * @param array $out - * @param boolean $listOnly - * @param boolean $lookForExp - * - * @return boolean - */ - protected function expression(&$out, $listOnly = false, $lookForExp = true) - { - $s = $this->count; - $discard = $this->discardComments; - $this->discardComments = true; - $allowedTypes = ($listOnly ? [Type::T_LIST] : [Type::T_LIST, Type::T_MAP]); - - if ($this->matchChar('(')) { - if ($this->enclosedExpression($lhs, $s, ')', $allowedTypes)) { - if ($lookForExp) { - $out = $this->expHelper($lhs, 0); - } else { - $out = $lhs; - } - - $this->discardComments = $discard; - - return true; - } - - $this->seek($s); - } - - if (\in_array(Type::T_LIST, $allowedTypes) && $this->matchChar('[')) { - if ($this->enclosedExpression($lhs, $s, ']', [Type::T_LIST])) { - if ($lookForExp) { - $out = $this->expHelper($lhs, 0); - } else { - $out = $lhs; - } - - $this->discardComments = $discard; - - return true; - } - - $this->seek($s); - } - - if (! $listOnly && $this->value($lhs)) { - if ($lookForExp) { - $out = $this->expHelper($lhs, 0); - } else { - $out = $lhs; - } - - $this->discardComments = $discard; - - return true; - } - - $this->discardComments = $discard; - - return false; - } - - /** - * Parse expression specifically checking for lists in parenthesis or brackets - * - * @param array $out - * @param integer $s - * @param string $closingParen - * @param array $allowedTypes - * - * @return boolean - */ - protected function enclosedExpression(&$out, $s, $closingParen = ')', $allowedTypes = [Type::T_LIST, Type::T_MAP]) - { - if ($this->matchChar($closingParen) && \in_array(Type::T_LIST, $allowedTypes)) { - $out = [Type::T_LIST, '', []]; - - switch ($closingParen) { - case ')': - $out['enclosing'] = 'parent'; // parenthesis list - break; - - case ']': - $out['enclosing'] = 'bracket'; // bracketed list - break; - } - - return true; - } - - if ( - $this->valueList($out) && - $this->matchChar($closingParen) && ! ($closingParen === ')' && - \in_array($out[0], [Type::T_EXPRESSION, Type::T_UNARY])) && - \in_array(Type::T_LIST, $allowedTypes) - ) { - if ($out[0] !== Type::T_LIST || ! empty($out['enclosing'])) { - $out = [Type::T_LIST, '', [$out]]; - } - - switch ($closingParen) { - case ')': - $out['enclosing'] = 'parent'; // parenthesis list - break; - - case ']': - $out['enclosing'] = 'bracket'; // bracketed list - break; - } - - return true; - } - - $this->seek($s); - - if (\in_array(Type::T_MAP, $allowedTypes) && $this->map($out)) { - return true; - } - - return false; - } - - /** - * Parse left-hand side of subexpression - * - * @param array $lhs - * @param integer $minP - * - * @return array - */ - protected function expHelper($lhs, $minP) - { - $operators = static::$operatorPattern; - - $ss = $this->count; - $whiteBefore = isset($this->buffer[$this->count - 1]) && - ctype_space($this->buffer[$this->count - 1]); - - while ($this->match($operators, $m, false) && static::$precedence[$m[1]] >= $minP) { - $whiteAfter = isset($this->buffer[$this->count]) && - ctype_space($this->buffer[$this->count]); - $varAfter = isset($this->buffer[$this->count]) && - $this->buffer[$this->count] === '$'; - - $this->whitespace(); - - $op = $m[1]; - - // don't turn negative numbers into expressions - if ($op === '-' && $whiteBefore && ! $whiteAfter && ! $varAfter) { - break; - } - - if (! $this->value($rhs) && ! $this->expression($rhs, true, false)) { - break; - } - - if ($op === '-' && ! $whiteAfter && $rhs[0] === Type::T_KEYWORD) { - break; - } - - // consume higher-precedence operators on the right-hand side - $rhs = $this->expHelper($rhs, static::$precedence[$op] + 1); - - $lhs = [Type::T_EXPRESSION, $op, $lhs, $rhs, $this->inParens, $whiteBefore, $whiteAfter]; - - $ss = $this->count; - $whiteBefore = isset($this->buffer[$this->count - 1]) && - ctype_space($this->buffer[$this->count - 1]); - } - - $this->seek($ss); - - return $lhs; - } - - /** - * Parse value - * - * @param array $out - * - * @return boolean - */ - protected function value(&$out) - { - if (! isset($this->buffer[$this->count])) { - return false; - } - - $s = $this->count; - $char = $this->buffer[$this->count]; - - if ( - $this->literal('url(', 4) && - $this->match('data:([a-z]+)\/([a-z0-9.+-]+);base64,', $m, false) - ) { - $len = strspn( - $this->buffer, - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyxz0123456789+/=', - $this->count - ); - - $this->count += $len; - - if ($this->matchChar(')')) { - $content = substr($this->buffer, $s, $this->count - $s); - $out = [Type::T_KEYWORD, $content]; - - return true; - } - } - - $this->seek($s); - - if ( - $this->literal('url(', 4, false) && - $this->match('\s*(\/\/[^\s\)]+)\s*', $m) - ) { - $content = 'url(' . $m[1]; - - if ($this->matchChar(')')) { - $content .= ')'; - $out = [Type::T_KEYWORD, $content]; - - return true; - } - } - - $this->seek($s); - - // not - if ($char === 'n' && $this->literal('not', 3, false)) { - if ( - $this->whitespace() && - $this->value($inner) - ) { - $out = [Type::T_UNARY, 'not', $inner, $this->inParens]; - - return true; - } - - $this->seek($s); - - if ($this->parenValue($inner)) { - $out = [Type::T_UNARY, 'not', $inner, $this->inParens]; - - return true; - } - - $this->seek($s); - } - - // addition - if ($char === '+') { - $this->count++; - - $follow_white = $this->whitespace(); - - if ($this->value($inner)) { - $out = [Type::T_UNARY, '+', $inner, $this->inParens]; - - return true; - } - - if ($follow_white) { - $out = [Type::T_KEYWORD, $char]; - return true; - } - - $this->seek($s); - - return false; - } - - // negation - if ($char === '-') { - if ($this->customProperty($out)) { - return true; - } - - $this->count++; - - $follow_white = $this->whitespace(); - - if ($this->variable($inner) || $this->unit($inner) || $this->parenValue($inner)) { - $out = [Type::T_UNARY, '-', $inner, $this->inParens]; - - return true; - } - - if ( - $this->keyword($inner) && - ! $this->func($inner, $out) - ) { - $out = [Type::T_UNARY, '-', $inner, $this->inParens]; - - return true; - } - - if ($follow_white) { - $out = [Type::T_KEYWORD, $char]; - - return true; - } - - $this->seek($s); - } - - // paren - if ($char === '(' && $this->parenValue($out)) { - return true; - } - - if ($char === '#') { - if ($this->interpolation($out) || $this->color($out)) { - return true; - } - - $this->count++; - - if ($this->keyword($keyword)) { - $out = [Type::T_KEYWORD, '#' . $keyword]; - - return true; - } - - $this->count--; - } - - if ($this->matchChar('&', true)) { - $out = [Type::T_SELF]; - - return true; - } - - if ($char === '$' && $this->variable($out)) { - return true; - } - - if ($char === 'p' && $this->progid($out)) { - return true; - } - - if (($char === '"' || $char === "'") && $this->string($out)) { - return true; - } - - if ($this->unit($out)) { - return true; - } - - // unicode range with wildcards - if ( - $this->literal('U+', 2) && - $this->match('\?+|([0-9A-F]+(\?+|(-[0-9A-F]+))?)', $m, false) - ) { - $unicode = explode('-', $m[0]); - if (strlen(reset($unicode)) <= 6 && strlen(end($unicode)) <= 6) { - $out = [Type::T_KEYWORD, 'U+' . $m[0]]; - - return true; - } - $this->count -= strlen($m[0]) + 2; - } - - if ($this->keyword($keyword, false)) { - if ($this->func($keyword, $out)) { - return true; - } - - $this->whitespace(); - - if ($keyword === 'null') { - $out = [Type::T_NULL]; - } else { - $out = [Type::T_KEYWORD, $keyword]; - } - - return true; - } - - return false; - } - - /** - * Parse parenthesized value - * - * @param array $out - * - * @return boolean - */ - protected function parenValue(&$out) - { - $s = $this->count; - - $inParens = $this->inParens; - - if ($this->matchChar('(')) { - if ($this->matchChar(')')) { - $out = [Type::T_LIST, '', []]; - - return true; - } - - $this->inParens = true; - - if ( - $this->expression($exp) && - $this->matchChar(')') - ) { - $out = $exp; - $this->inParens = $inParens; - - return true; - } - } - - $this->inParens = $inParens; - $this->seek($s); - - return false; - } - - /** - * Parse "progid:" - * - * @param array $out - * - * @return boolean - */ - protected function progid(&$out) - { - $s = $this->count; - - if ( - $this->literal('progid:', 7, false) && - $this->openString('(', $fn) && - $this->matchChar('(') - ) { - $this->openString(')', $args, '('); - - if ($this->matchChar(')')) { - $out = [Type::T_STRING, '', [ - 'progid:', $fn, '(', $args, ')' - ]]; - - return true; - } - } - - $this->seek($s); - - return false; - } - - /** - * Parse function call - * - * @param string $name - * @param array $func - * - * @return boolean - */ - protected function func($name, &$func) - { - $s = $this->count; - - if ($this->matchChar('(')) { - if ($name === 'alpha' && $this->argumentList($args)) { - $func = [Type::T_FUNCTION, $name, [Type::T_STRING, '', $args]]; - - return true; - } - - if ($name !== 'expression' && ! preg_match('/^(-[a-z]+-)?calc$/', $name)) { - $ss = $this->count; - - if ( - $this->argValues($args) && - $this->matchChar(')') - ) { - $func = [Type::T_FUNCTION_CALL, $name, $args]; - - return true; - } - - $this->seek($ss); - } - - if ( - ($this->openString(')', $str, '(') || true) && - $this->matchChar(')') - ) { - $args = []; - - if (! empty($str)) { - $args[] = [null, [Type::T_STRING, '', [$str]]]; - } - - $func = [Type::T_FUNCTION_CALL, $name, $args]; - - return true; - } - } - - $this->seek($s); - - return false; - } - - /** - * Parse function call argument list - * - * @param array $out - * - * @return boolean - */ - protected function argumentList(&$out) - { - $s = $this->count; - $this->matchChar('('); - - $args = []; - - while ($this->keyword($var)) { - if ( - $this->matchChar('=') && - $this->expression($exp) - ) { - $args[] = [Type::T_STRING, '', [$var . '=']]; - $arg = $exp; - } else { - break; - } - - $args[] = $arg; - - if (! $this->matchChar(',')) { - break; - } - - $args[] = [Type::T_STRING, '', [', ']]; - } - - if (! $this->matchChar(')') || ! $args) { - $this->seek($s); - - return false; - } - - $out = $args; - - return true; - } - - /** - * Parse mixin/function definition argument list - * - * @param array $out - * - * @return boolean - */ - protected function argumentDef(&$out) - { - $s = $this->count; - $this->matchChar('('); - - $args = []; - - while ($this->variable($var)) { - $arg = [$var[1], null, false]; - - $ss = $this->count; - - if ( - $this->matchChar(':') && - $this->genericList($defaultVal, 'expression', '', true) - ) { - $arg[1] = $defaultVal; - } else { - $this->seek($ss); - } - - $ss = $this->count; - - if ($this->literal('...', 3)) { - $sss = $this->count; - - if (! $this->matchChar(')')) { - throw $this->parseError('... has to be after the final argument'); - } - - $arg[2] = true; - - $this->seek($sss); - } else { - $this->seek($ss); - } - - $args[] = $arg; - - if (! $this->matchChar(',')) { - break; - } - } - - if (! $this->matchChar(')')) { - $this->seek($s); - - return false; - } - - $out = $args; - - return true; - } - - /** - * Parse map - * - * @param array $out - * - * @return boolean - */ - protected function map(&$out) - { - $s = $this->count; - - if (! $this->matchChar('(')) { - return false; - } - - $keys = []; - $values = []; - - while ( - $this->genericList($key, 'expression', '', true) && - $this->matchChar(':') && - $this->genericList($value, 'expression', '', true) - ) { - $keys[] = $key; - $values[] = $value; - - if (! $this->matchChar(',')) { - break; - } - } - - if (! $keys || ! $this->matchChar(')')) { - $this->seek($s); - - return false; - } - - $out = [Type::T_MAP, $keys, $values]; - - return true; - } - - /** - * Parse color - * - * @param array $out - * - * @return boolean - */ - protected function color(&$out) - { - $s = $this->count; - - if ($this->match('(#([0-9a-f]+)\b)', $m)) { - if (\in_array(\strlen($m[2]), [3,4,6,8])) { - $out = [Type::T_KEYWORD, $m[0]]; - - return true; - } - - $this->seek($s); - - return false; - } - - return false; - } - - /** - * Parse number with unit - * - * @param array $unit - * - * @return boolean - */ - protected function unit(&$unit) - { - $s = $this->count; - - if ($this->match('([0-9]*(\.)?[0-9]+)([%a-zA-Z]+)?', $m, false)) { - if (\strlen($this->buffer) === $this->count || ! ctype_digit($this->buffer[$this->count])) { - $this->whitespace(); - - $unit = new Node\Number($m[1], empty($m[3]) ? '' : $m[3]); - - return true; - } - - $this->seek($s); - } - - return false; - } - - /** - * Parse string - * - * @param array $out - * - * @return boolean - */ - protected function string(&$out, $keepDelimWithInterpolation = false) - { - $s = $this->count; - - if ($this->matchChar('"', false)) { - $delim = '"'; - } elseif ($this->matchChar("'", false)) { - $delim = "'"; - } else { - return false; - } - - $content = []; - $oldWhite = $this->eatWhiteDefault; - $this->eatWhiteDefault = false; - $hasInterpolation = false; - - while ($this->matchString($m, $delim)) { - if ($m[1] !== '') { - $content[] = $m[1]; - } - - if ($m[2] === '#{') { - $this->count -= \strlen($m[2]); - - if ($this->interpolation($inter, false)) { - $content[] = $inter; - $hasInterpolation = true; - } else { - $this->count += \strlen($m[2]); - $content[] = '#{'; // ignore it - } - } elseif ($m[2] === "\r") { - $content[] = chr(10); - // TODO : warning - # DEPRECATION WARNING on line x, column y of zzz: - # Unescaped multiline strings are deprecated and will be removed in a future version of Sass. - # To include a newline in a string, use "\a" or "\a " as in CSS. - if ($this->matchChar("\n", false)) { - $content[] = ' '; - } - } elseif ($m[2] === '\\') { - if ( - $this->literal("\r\n", 2, false) || - $this->matchChar("\r", false) || - $this->matchChar("\n", false) || - $this->matchChar("\f", false) - ) { - // this is a continuation escaping, to be ignored - } elseif ($this->matchEscapeCharacter($c)) { - $content[] = $c; - } else { - throw $this->parseError('Unterminated escape sequence'); - } - } else { - $this->count -= \strlen($delim); - break; // delim - } - } - - $this->eatWhiteDefault = $oldWhite; - - if ($this->literal($delim, \strlen($delim))) { - if ($hasInterpolation && ! $keepDelimWithInterpolation) { - $delim = '"'; - } - - $out = [Type::T_STRING, $delim, $content]; - - return true; - } - - $this->seek($s); - - return false; - } - - /** - * @param string $out - * @param bool $inKeywords - * @return bool - */ - protected function matchEscapeCharacter(&$out, $inKeywords = false) - { - $s = $this->count; - if ($this->match('[a-f0-9]', $m, false)) { - $hex = $m[0]; - - for ($i = 5; $i--;) { - if ($this->match('[a-f0-9]', $m, false)) { - $hex .= $m[0]; - } else { - break; - } - } - - // CSS allows Unicode escape sequences to be followed by a delimiter space - // (necessary in some cases for shorter sequences to disambiguate their end) - $this->matchChar(' ', false); - - $value = hexdec($hex); - - if (!$inKeywords && ($value == 0 || ($value >= 0xD800 && $value <= 0xDFFF) || $value >= 0x10FFFF)) { - $out = "\xEF\xBF\xBD"; // "\u{FFFD}" but with a syntax supported on PHP 5 - } elseif ($value < 0x20) { - $out = Util::mbChr($value); - } else { - $out = Util::mbChr($value); - } - - return true; - } - - if ($this->match('.', $m, false)) { - if ($inKeywords && in_array($m[0], ["'",'"','@','&',' ','\\',':','/','%'])) { - $this->seek($s); - return false; - } - $out = $m[0]; - - return true; - } - - return false; - } - - /** - * Parse keyword or interpolation - * - * @param array $out - * @param boolean $restricted - * - * @return boolean - */ - protected function mixedKeyword(&$out, $restricted = false) - { - $parts = []; - - $oldWhite = $this->eatWhiteDefault; - $this->eatWhiteDefault = false; - - for (;;) { - if ($restricted ? $this->restrictedKeyword($key) : $this->keyword($key)) { - $parts[] = $key; - continue; - } - - if ($this->interpolation($inter)) { - $parts[] = $inter; - continue; - } - - break; - } - - $this->eatWhiteDefault = $oldWhite; - - if (! $parts) { - return false; - } - - if ($this->eatWhiteDefault) { - $this->whitespace(); - } - - $out = $parts; - - return true; - } - - /** - * Parse an unbounded string stopped by $end - * - * @param string $end - * @param array $out - * @param string $nestOpen - * @param string $nestClose - * @param boolean $rtrim - * @param string $disallow - * - * @return boolean - */ - protected function openString($end, &$out, $nestOpen = null, $nestClose = null, $rtrim = true, $disallow = null) - { - $oldWhite = $this->eatWhiteDefault; - $this->eatWhiteDefault = false; - - if ($nestOpen && ! $nestClose) { - $nestClose = $end; - } - - $patt = ($disallow ? '[^' . $this->pregQuote($disallow) . ']' : '.'); - $patt = '(' . $patt . '*?)([\'"]|#\{|' - . $this->pregQuote($end) . '|' - . (($nestClose && $nestClose !== $end) ? $this->pregQuote($nestClose) . '|' : '') - . static::$commentPattern . ')'; - - $nestingLevel = 0; - - $content = []; - - while ($this->match($patt, $m, false)) { - if (isset($m[1]) && $m[1] !== '') { - $content[] = $m[1]; - - if ($nestOpen) { - $nestingLevel += substr_count($m[1], $nestOpen); - } - } - - $tok = $m[2]; - - $this->count -= \strlen($tok); - - if ($tok === $end && ! $nestingLevel) { - break; - } - - if ($tok === $nestClose) { - $nestingLevel--; - } - - if (($tok === "'" || $tok === '"') && $this->string($str, true)) { - $content[] = $str; - continue; - } - - if ($tok === '#{' && $this->interpolation($inter)) { - $content[] = $inter; - continue; - } - - $content[] = $tok; - $this->count += \strlen($tok); - } - - $this->eatWhiteDefault = $oldWhite; - - if (! $content || $tok !== $end) { - return false; - } - - // trim the end - if ($rtrim && \is_string(end($content))) { - $content[\count($content) - 1] = rtrim(end($content)); - } - - $out = [Type::T_STRING, '', $content]; - - return true; - } - - /** - * Parser interpolation - * - * @param string|array $out - * @param boolean $lookWhite save information about whitespace before and after - * - * @return boolean - */ - protected function interpolation(&$out, $lookWhite = true) - { - $oldWhite = $this->eatWhiteDefault; - $allowVars = $this->allowVars; - $this->allowVars = true; - $this->eatWhiteDefault = true; - - $s = $this->count; - - if ( - $this->literal('#{', 2) && - $this->valueList($value) && - $this->matchChar('}', false) - ) { - if ($value === [Type::T_SELF]) { - $out = $value; - } else { - if ($lookWhite) { - $left = ($s > 0 && preg_match('/\s/', $this->buffer[$s - 1])) ? ' ' : ''; - $right = ( - ! empty($this->buffer[$this->count]) && - preg_match('/\s/', $this->buffer[$this->count]) - ) ? ' ' : ''; - } else { - $left = $right = false; - } - - $out = [Type::T_INTERPOLATE, $value, $left, $right]; - } - - $this->eatWhiteDefault = $oldWhite; - $this->allowVars = $allowVars; - - if ($this->eatWhiteDefault) { - $this->whitespace(); - } - - return true; - } - - $this->seek($s); - - $this->eatWhiteDefault = $oldWhite; - $this->allowVars = $allowVars; - - return false; - } - - /** - * Parse property name (as an array of parts or a string) - * - * @param array $out - * - * @return boolean - */ - protected function propertyName(&$out) - { - $parts = []; - - $oldWhite = $this->eatWhiteDefault; - $this->eatWhiteDefault = false; - - for (;;) { - if ($this->interpolation($inter)) { - $parts[] = $inter; - continue; - } - - if ($this->keyword($text)) { - $parts[] = $text; - continue; - } - - if (! $parts && $this->match('[:.#]', $m, false)) { - // css hacks - $parts[] = $m[0]; - continue; - } - - break; - } - - $this->eatWhiteDefault = $oldWhite; - - if (! $parts) { - return false; - } - - // match comment hack - if (preg_match(static::$whitePattern, $this->buffer, $m, 0, $this->count)) { - if (! empty($m[0])) { - $parts[] = $m[0]; - $this->count += \strlen($m[0]); - } - } - - $this->whitespace(); // get any extra whitespace - - $out = [Type::T_STRING, '', $parts]; - - return true; - } - - /** - * Parse custom property name (as an array of parts or a string) - * - * @param array $out - * - * @return boolean - */ - protected function customProperty(&$out) - { - $s = $this->count; - - if (! $this->literal('--', 2, false)) { - return false; - } - - $parts = ['--']; - - $oldWhite = $this->eatWhiteDefault; - $this->eatWhiteDefault = false; - - for (;;) { - if ($this->interpolation($inter)) { - $parts[] = $inter; - continue; - } - - if ($this->matchChar('&', false)) { - $parts[] = [Type::T_SELF]; - continue; - } - - if ($this->variable($var)) { - $parts[] = $var; - continue; - } - - if ($this->keyword($text)) { - $parts[] = $text; - continue; - } - - break; - } - - $this->eatWhiteDefault = $oldWhite; - - if (\count($parts) == 1) { - $this->seek($s); - - return false; - } - - $this->whitespace(); // get any extra whitespace - - $out = [Type::T_STRING, '', $parts]; - - return true; - } - - /** - * Parse comma separated selector list - * - * @param array $out - * @param string|boolean $subSelector - * - * @return boolean - */ - protected function selectors(&$out, $subSelector = false) - { - $s = $this->count; - $selectors = []; - - while ($this->selector($sel, $subSelector)) { - $selectors[] = $sel; - - if (! $this->matchChar(',', true)) { - break; - } - - while ($this->matchChar(',', true)) { - ; // ignore extra - } - } - - if (! $selectors) { - $this->seek($s); - - return false; - } - - $out = $selectors; - - return true; - } - - /** - * Parse whitespace separated selector list - * - * @param array $out - * @param string|boolean $subSelector - * - * @return boolean - */ - protected function selector(&$out, $subSelector = false) - { - $selector = []; - - $discardComments = $this->discardComments; - $this->discardComments = true; - - for (;;) { - $s = $this->count; - - if ($this->match('[>+~]+', $m, true)) { - if ( - $subSelector && \is_string($subSelector) && strpos($subSelector, 'nth-') === 0 && - $m[0] === '+' && $this->match("(\d+|n\b)", $counter) - ) { - $this->seek($s); - } else { - $selector[] = [$m[0]]; - continue; - } - } - - if ($this->selectorSingle($part, $subSelector)) { - $selector[] = $part; - $this->whitespace(); - continue; - } - - break; - } - - $this->discardComments = $discardComments; - - if (! $selector) { - return false; - } - - $out = $selector; - - return true; - } - - /** - * parsing escaped chars in selectors: - * - escaped single chars are kept escaped in the selector but in a normalized form - * (if not in 0-9a-f range as this would be ambigous) - * - other escaped sequences (multibyte chars or 0-9a-f) are kept in their initial escaped form, - * normalized to lowercase - * - * TODO: this is a fallback solution. Ideally escaped chars in selectors should be encoded as the genuine chars, - * and escaping added when printing in the Compiler, where/if it's mandatory - * - but this require a better formal selector representation instead of the array we have now - * - * @param string $out - * @param bool $keepEscapedNumber - * @return bool - */ - protected function matchEscapeCharacterInSelector(&$out, $keepEscapedNumber = false) - { - $s_escape = $this->count; - if ($this->match('\\\\', $m)) { - $out = '\\' . $m[0]; - return true; - } - - if ($this->matchEscapeCharacter($escapedout, true)) { - if (strlen($escapedout) === 1) { - if (!preg_match(",\w,", $escapedout)) { - $out = '\\' . $escapedout; - return true; - } elseif (! $keepEscapedNumber || ! \is_numeric($escapedout)) { - $out = $escapedout; - return true; - } - } - $escape_sequence = rtrim(substr($this->buffer, $s_escape, $this->count - $s_escape)); - if (strlen($escape_sequence) < 6) { - $escape_sequence .= ' '; - } - $out = '\\' . strtolower($escape_sequence); - return true; - } - if ($this->match('\\S', $m)) { - $out = '\\' . $m[0]; - return true; - } - - - return false; - } - - /** - * Parse the parts that make up a selector - * - * {@internal - * div[yes=no]#something.hello.world:nth-child(-2n+1)%placeholder - * }} - * - * @param array $out - * @param string|boolean $subSelector - * - * @return boolean - */ - protected function selectorSingle(&$out, $subSelector = false) - { - $oldWhite = $this->eatWhiteDefault; - $this->eatWhiteDefault = false; - - $parts = []; - - if ($this->matchChar('*', false)) { - $parts[] = '*'; - } - - for (;;) { - if (! isset($this->buffer[$this->count])) { - break; - } - - $s = $this->count; - $char = $this->buffer[$this->count]; - - // see if we can stop early - if ($char === '{' || $char === ',' || $char === ';' || $char === '}' || $char === '@') { - break; - } - - // parsing a sub selector in () stop with the closing ) - if ($subSelector && $char === ')') { - break; - } - - //self - switch ($char) { - case '&': - $parts[] = Compiler::$selfSelector; - $this->count++; - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - continue 2; - - case '.': - $parts[] = '.'; - $this->count++; - continue 2; - - case '|': - $parts[] = '|'; - $this->count++; - continue 2; - } - - // handling of escaping in selectors : get the escaped char - if ($char === '\\') { - $this->count++; - if ($this->matchEscapeCharacterInSelector($escaped, true)) { - $parts[] = $escaped; - continue; - } - $this->count--; - } - - if ($char === '%') { - $this->count++; - - if ($this->placeholder($placeholder)) { - $parts[] = '%'; - $parts[] = $placeholder; - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - continue; - } - - break; - } - - if ($char === '#') { - if ($this->interpolation($inter)) { - $parts[] = $inter; - ! $this->cssOnly || $this->assertPlainCssValid(false, $s); - continue; - } - - $parts[] = '#'; - $this->count++; - continue; - } - - // a pseudo selector - if ($char === ':') { - if ($this->buffer[$this->count + 1] === ':') { - $this->count += 2; - $part = '::'; - } else { - $this->count++; - $part = ':'; - } - - if ($this->mixedKeyword($nameParts, true)) { - $parts[] = $part; - - foreach ($nameParts as $sub) { - $parts[] = $sub; - } - - $ss = $this->count; - - if ( - $nameParts === ['not'] || - $nameParts === ['is'] || - $nameParts === ['has'] || - $nameParts === ['where'] || - $nameParts === ['slotted'] || - $nameParts === ['nth-child'] || - $nameParts === ['nth-last-child'] || - $nameParts === ['nth-of-type'] || - $nameParts === ['nth-last-of-type'] - ) { - if ( - $this->matchChar('(', true) && - ($this->selectors($subs, reset($nameParts)) || true) && - $this->matchChar(')') - ) { - $parts[] = '('; - - while ($sub = array_shift($subs)) { - while ($ps = array_shift($sub)) { - foreach ($ps as &$p) { - $parts[] = $p; - } - - if (\count($sub) && reset($sub)) { - $parts[] = ' '; - } - } - - if (\count($subs) && reset($subs)) { - $parts[] = ', '; - } - } - - $parts[] = ')'; - } else { - $this->seek($ss); - } - } elseif ( - $this->matchChar('(', true) && - ($this->openString(')', $str, '(') || true) && - $this->matchChar(')') - ) { - $parts[] = '('; - - if (! empty($str)) { - $parts[] = $str; - } - - $parts[] = ')'; - } else { - $this->seek($ss); - } - - continue; - } - } - - $this->seek($s); - - // 2n+1 - if ($subSelector && \is_string($subSelector) && strpos($subSelector, 'nth-') === 0) { - if ($this->match("(\s*(\+\s*|\-\s*)?(\d+|n|\d+n))+", $counter)) { - $parts[] = $counter[0]; - //$parts[] = str_replace(' ', '', $counter[0]); - continue; - } - } - - $this->seek($s); - - // attribute selector - if ( - $char === '[' && - $this->matchChar('[') && - ($this->openString(']', $str, '[') || true) && - $this->matchChar(']') - ) { - $parts[] = '['; - - if (! empty($str)) { - $parts[] = $str; - } - - $parts[] = ']'; - continue; - } - - $this->seek($s); - - // for keyframes - if ($this->unit($unit)) { - $parts[] = $unit; - continue; - } - - if ($this->restrictedKeyword($name, false, true)) { - $parts[] = $name; - continue; - } - - break; - } - - $this->eatWhiteDefault = $oldWhite; - - if (! $parts) { - return false; - } - - $out = $parts; - - return true; - } - - /** - * Parse a variable - * - * @param array $out - * - * @return boolean - */ - protected function variable(&$out) - { - $s = $this->count; - - if ( - $this->matchChar('$', false) && - $this->keyword($name) - ) { - if ($this->allowVars) { - $out = [Type::T_VARIABLE, $name]; - } else { - $out = [Type::T_KEYWORD, '$' . $name]; - } - - return true; - } - - $this->seek($s); - - return false; - } - - /** - * Parse a keyword - * - * @param string $word - * @param boolean $eatWhitespace - * @param boolean $inSelector - * - * @return boolean - */ - protected function keyword(&$word, $eatWhitespace = null, $inSelector = false) - { - $s = $this->count; - $match = $this->match( - $this->utf8 - ? '(([\pL\w\x{00A0}-\x{10FFFF}_\-\*!"\']|\\\\[a-f0-9]{6} ?|\\\\[a-f0-9]{1,5}(?![a-f0-9]) ?|[\\\\].)([\pL\w\x{00A0}-\x{10FFFF}\-_"\']|\\\\[a-f0-9]{6} ?|\\\\[a-f0-9]{1,5}(?![a-f0-9]) ?|[\\\\].)*)' - : '(([\w_\-\*!"\']|\\\\[a-f0-9]{6} ?|\\\\[a-f0-9]{1,5}(?![a-f0-9]) ?|[\\\\].)([\w\-_"\']|\\\\[a-f0-9]{6} ?|\\\\[a-f0-9]{1,5}(?![a-f0-9]) ?|[\\\\].)*)', - $m, - false - ); - - if ($match) { - $word = $m[1]; - - // handling of escaping in keyword : get the escaped char - if (strpos($word, '\\') !== false) { - $send = $this->count; - $escapedWord = []; - $this->seek($s); - $previousEscape = false; - while ($this->count < $send) { - $char = $this->buffer[$this->count]; - $this->count++; - if ( - $this->count < $send - && $char === '\\' - && !$previousEscape - && ( - $inSelector ? - $this->matchEscapeCharacterInSelector($out) - : - $this->matchEscapeCharacter($out, true) - ) - ) { - $escapedWord[] = $out; - } else { - if ($previousEscape) { - $previousEscape = false; - } elseif ($char === '\\') { - $previousEscape = true; - } - $escapedWord[] = $char; - } - } - - $word = implode('', $escapedWord); - } - - if (is_null($eatWhitespace) ? $this->eatWhiteDefault : $eatWhitespace) { - $this->whitespace(); - } - - return true; - } - - return false; - } - - /** - * Parse a keyword that should not start with a number - * - * @param string $word - * @param boolean $eatWhitespace - * @param boolean $inSelector - * - * @return boolean - */ - protected function restrictedKeyword(&$word, $eatWhitespace = null, $inSelector = false) - { - $s = $this->count; - - if ($this->keyword($word, $eatWhitespace, $inSelector) && (\ord($word[0]) > 57 || \ord($word[0]) < 48)) { - return true; - } - - $this->seek($s); - - return false; - } - - /** - * Parse a placeholder - * - * @param string|array $placeholder - * - * @return boolean - */ - protected function placeholder(&$placeholder) - { - $match = $this->match( - $this->utf8 - ? '([\pL\w\-_]+)' - : '([\w\-_]+)', - $m - ); - - if ($match) { - $placeholder = $m[1]; - - return true; - } - - if ($this->interpolation($placeholder)) { - return true; - } - - return false; - } - - /** - * Parse a url - * - * @param array $out - * - * @return boolean - */ - protected function url(&$out) - { - if ($this->literal('url(', 4)) { - $s = $this->count; - - if ( - ($this->string($out) || $this->spaceList($out)) && - $this->matchChar(')') - ) { - $out = [Type::T_STRING, '', ['url(', $out, ')']]; - - return true; - } - - $this->seek($s); - - if ( - $this->openString(')', $out) && - $this->matchChar(')') - ) { - $out = [Type::T_STRING, '', ['url(', $out, ')']]; - - return true; - } - } - - return false; - } - - /** - * Consume an end of statement delimiter - * @param bool $eatWhitespace - * - * @return boolean - */ - protected function end($eatWhitespace = null) - { - if ($this->matchChar(';', $eatWhitespace)) { - return true; - } - - if ($this->count === \strlen($this->buffer) || $this->buffer[$this->count] === '}') { - // if there is end of file or a closing block next then we don't need a ; - return true; - } - - return false; - } - - /** - * Strip assignment flag from the list - * - * @param array $value - * - * @return array - */ - protected function stripAssignmentFlags(&$value) - { - $flags = []; - - for ($token = &$value; $token[0] === Type::T_LIST && ($s = \count($token[2])); $token = &$lastNode) { - $lastNode = &$token[2][$s - 1]; - - while ($lastNode[0] === Type::T_KEYWORD && \in_array($lastNode[1], ['!default', '!global'])) { - array_pop($token[2]); - - $node = end($token[2]); - $token = $this->flattenList($token); - $flags[] = $lastNode[1]; - $lastNode = $node; - } - } - - return $flags; - } - - /** - * Strip optional flag from selector list - * - * @param array $selectors - * - * @return string - */ - protected function stripOptionalFlag(&$selectors) - { - $optional = false; - $selector = end($selectors); - $part = end($selector); - - if ($part === ['!optional']) { - array_pop($selectors[\count($selectors) - 1]); - - $optional = true; - } - - return $optional; - } - - /** - * Turn list of length 1 into value type - * - * @param array $value - * - * @return array - */ - protected function flattenList($value) - { - if ($value[0] === Type::T_LIST && \count($value[2]) === 1) { - return $this->flattenList($value[2][0]); - } - - return $value; - } - - /** - * Quote regular expression - * - * @param string $what - * - * @return string - */ - private function pregQuote($what) - { - return preg_quote($what, '/'); - } - - /** - * Extract line numbers from buffer - * - * @param string $buffer - */ - private function extractLineNumbers($buffer) - { - $this->sourcePositions = [0 => 0]; - $prev = 0; - - while (($pos = strpos($buffer, "\n", $prev)) !== false) { - $this->sourcePositions[] = $pos; - $prev = $pos + 1; - } - - $this->sourcePositions[] = \strlen($buffer); - - if (substr($buffer, -1) !== "\n") { - $this->sourcePositions[] = \strlen($buffer) + 1; - } - } - - /** - * Get source line number and column (given character position in the buffer) - * - * @param integer $pos - * - * @return array - */ - private function getSourcePosition($pos) - { - $low = 0; - $high = \count($this->sourcePositions); - - while ($low < $high) { - $mid = (int) (($high + $low) / 2); - - if ($pos < $this->sourcePositions[$mid]) { - $high = $mid - 1; - continue; - } - - if ($pos >= $this->sourcePositions[$mid + 1]) { - $low = $mid + 1; - continue; - } - - return [$mid + 1, $pos - $this->sourcePositions[$mid]]; - } - - return [$low + 1, $pos - $this->sourcePositions[$low]]; - } - - /** - * Save internal encoding of mbstring - * - * When mbstring.func_overload is used to replace the standard PHP string functions, - * this method configures the internal encoding to a single-byte one so that the - * behavior matches the normal behavior of PHP string functions while using the parser. - * The existing internal encoding is saved and will be restored when calling {@see restoreEncoding}. - * - * If mbstring.func_overload is not used (or does not override string functions), this method is a no-op. - * - * @return void - */ - private function saveEncoding() - { - if (\PHP_VERSION_ID < 80000 && \extension_loaded('mbstring') && (2 & (int) ini_get('mbstring.func_overload')) > 0) { - $this->encoding = mb_internal_encoding(); - - mb_internal_encoding('iso-8859-1'); - } - } - - /** - * Restore internal encoding - * - * @return void - */ - private function restoreEncoding() - { - if (\extension_loaded('mbstring') && $this->encoding) { - mb_internal_encoding($this->encoding); - } - } -} diff --git a/vendor/scssphp/scssphp/src/SourceMap/Base64.php b/vendor/scssphp/scssphp/src/SourceMap/Base64.php deleted file mode 100644 index 4a5ed8bb..00000000 --- a/vendor/scssphp/scssphp/src/SourceMap/Base64.php +++ /dev/null @@ -1,187 +0,0 @@ - - * - * @internal - */ -class Base64 -{ - /** - * @var array - */ - private static $encodingMap = [ - 0 => 'A', - 1 => 'B', - 2 => 'C', - 3 => 'D', - 4 => 'E', - 5 => 'F', - 6 => 'G', - 7 => 'H', - 8 => 'I', - 9 => 'J', - 10 => 'K', - 11 => 'L', - 12 => 'M', - 13 => 'N', - 14 => 'O', - 15 => 'P', - 16 => 'Q', - 17 => 'R', - 18 => 'S', - 19 => 'T', - 20 => 'U', - 21 => 'V', - 22 => 'W', - 23 => 'X', - 24 => 'Y', - 25 => 'Z', - 26 => 'a', - 27 => 'b', - 28 => 'c', - 29 => 'd', - 30 => 'e', - 31 => 'f', - 32 => 'g', - 33 => 'h', - 34 => 'i', - 35 => 'j', - 36 => 'k', - 37 => 'l', - 38 => 'm', - 39 => 'n', - 40 => 'o', - 41 => 'p', - 42 => 'q', - 43 => 'r', - 44 => 's', - 45 => 't', - 46 => 'u', - 47 => 'v', - 48 => 'w', - 49 => 'x', - 50 => 'y', - 51 => 'z', - 52 => '0', - 53 => '1', - 54 => '2', - 55 => '3', - 56 => '4', - 57 => '5', - 58 => '6', - 59 => '7', - 60 => '8', - 61 => '9', - 62 => '+', - 63 => '/', - ]; - - /** - * @var array - */ - private static $decodingMap = [ - 'A' => 0, - 'B' => 1, - 'C' => 2, - 'D' => 3, - 'E' => 4, - 'F' => 5, - 'G' => 6, - 'H' => 7, - 'I' => 8, - 'J' => 9, - 'K' => 10, - 'L' => 11, - 'M' => 12, - 'N' => 13, - 'O' => 14, - 'P' => 15, - 'Q' => 16, - 'R' => 17, - 'S' => 18, - 'T' => 19, - 'U' => 20, - 'V' => 21, - 'W' => 22, - 'X' => 23, - 'Y' => 24, - 'Z' => 25, - 'a' => 26, - 'b' => 27, - 'c' => 28, - 'd' => 29, - 'e' => 30, - 'f' => 31, - 'g' => 32, - 'h' => 33, - 'i' => 34, - 'j' => 35, - 'k' => 36, - 'l' => 37, - 'm' => 38, - 'n' => 39, - 'o' => 40, - 'p' => 41, - 'q' => 42, - 'r' => 43, - 's' => 44, - 't' => 45, - 'u' => 46, - 'v' => 47, - 'w' => 48, - 'x' => 49, - 'y' => 50, - 'z' => 51, - 0 => 52, - 1 => 53, - 2 => 54, - 3 => 55, - 4 => 56, - 5 => 57, - 6 => 58, - 7 => 59, - 8 => 60, - 9 => 61, - '+' => 62, - '/' => 63, - ]; - - /** - * Convert to base64 - * - * @param integer $value - * - * @return string - */ - public static function encode($value) - { - return self::$encodingMap[$value]; - } - - /** - * Convert from base64 - * - * @param string $value - * - * @return integer - */ - public static function decode($value) - { - return self::$decodingMap[$value]; - } -} diff --git a/vendor/scssphp/scssphp/src/SourceMap/Base64VLQ.php b/vendor/scssphp/scssphp/src/SourceMap/Base64VLQ.php deleted file mode 100644 index d47b96a1..00000000 --- a/vendor/scssphp/scssphp/src/SourceMap/Base64VLQ.php +++ /dev/null @@ -1,151 +0,0 @@ - - * @author Anthon Pang - * - * @internal - */ -class Base64VLQ -{ - // A Base64 VLQ digit can represent 5 bits, so it is base-32. - const VLQ_BASE_SHIFT = 5; - - // A mask of bits for a VLQ digit (11111), 31 decimal. - const VLQ_BASE_MASK = 31; - - // The continuation bit is the 6th bit. - const VLQ_CONTINUATION_BIT = 32; - - /** - * Returns the VLQ encoded value. - * - * @param integer $value - * - * @return string - */ - public static function encode($value) - { - $encoded = ''; - $vlq = self::toVLQSigned($value); - - do { - $digit = $vlq & self::VLQ_BASE_MASK; - - //$vlq >>>= self::VLQ_BASE_SHIFT; // unsigned right shift - $vlq = (($vlq >> 1) & PHP_INT_MAX) >> (self::VLQ_BASE_SHIFT - 1); - - if ($vlq > 0) { - $digit |= self::VLQ_CONTINUATION_BIT; - } - - $encoded .= Base64::encode($digit); - } while ($vlq > 0); - - return $encoded; - } - - /** - * Decodes VLQValue. - * - * @param string $str - * @param integer $index - * - * @return integer - */ - public static function decode($str, &$index) - { - $result = 0; - $shift = 0; - - do { - $c = $str[$index++]; - $digit = Base64::decode($c); - $continuation = ($digit & self::VLQ_CONTINUATION_BIT) != 0; - $digit &= self::VLQ_BASE_MASK; - $result = $result + ($digit << $shift); - $shift = $shift + self::VLQ_BASE_SHIFT; - } while ($continuation); - - return self::fromVLQSigned($result); - } - - /** - * Converts from a two-complement value to a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - * - * @param integer $value - * - * @return integer - */ - private static function toVLQSigned($value) - { - if ($value < 0) { - return ((-$value) << 1) + 1; - } - - return ($value << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - * - * @param integer $value - * - * @return integer - */ - private static function fromVLQSigned($value) - { - $negate = ($value & 1) === 1; - - //$value >>>= 1; // unsigned right shift - $value = ($value >> 1) & PHP_INT_MAX; - - if (! $negate) { - return $value; - } - - // We need to OR 0x80000000 here to ensure the 32nd bit (the sign bit) is - // always set for negative numbers. If `value` were 1, (meaning `negate` is - // true and all other bits were zeros), `value` would now be 0. -0 is just - // 0, and doesn't flip the 32nd bit as intended. All positive numbers will - // successfully flip the 32nd bit without issue, so it's a noop for them. - return -$value | 0x80000000; - } -} diff --git a/vendor/scssphp/scssphp/src/SourceMap/SourceMapGenerator.php b/vendor/scssphp/scssphp/src/SourceMap/SourceMapGenerator.php deleted file mode 100644 index 4f14bdce..00000000 --- a/vendor/scssphp/scssphp/src/SourceMap/SourceMapGenerator.php +++ /dev/null @@ -1,381 +0,0 @@ - - * @author Nicolas FRANÇOIS - * - * @internal - */ -class SourceMapGenerator -{ - /** - * What version of source map does the generator generate? - */ - const VERSION = 3; - - /** - * Array of default options - * - * @var array - * @phpstan-var array{sourceRoot: string, sourceMapFilename: string|null, sourceMapURL: string|null, sourceMapWriteTo: string|null, outputSourceFiles: bool, sourceMapRootpath: string, sourceMapBasepath: string} - */ - protected $defaultOptions = [ - // an optional source root, useful for relocating source files - // on a server or removing repeated values in the 'sources' entry. - // This value is prepended to the individual entries in the 'source' field. - 'sourceRoot' => '', - - // an optional name of the generated code that this source map is associated with. - 'sourceMapFilename' => null, - - // url of the map - 'sourceMapURL' => null, - - // absolute path to a file to write the map to - 'sourceMapWriteTo' => null, - - // output source contents? - 'outputSourceFiles' => false, - - // base path for filename normalization - 'sourceMapRootpath' => '', - - // base path for filename normalization - 'sourceMapBasepath' => '' - ]; - - /** - * The base64 VLQ encoder - * - * @var \ScssPhp\ScssPhp\SourceMap\Base64VLQ - */ - protected $encoder; - - /** - * Array of mappings - * - * @var array - * @phpstan-var list - */ - protected $mappings = []; - - /** - * Array of contents map - * - * @var array - */ - protected $contentsMap = []; - - /** - * File to content map - * - * @var array - */ - protected $sources = []; - - /** - * @var array - */ - protected $sourceKeys = []; - - /** - * @var array - * @phpstan-var array{sourceRoot: string, sourceMapFilename: string|null, sourceMapURL: string|null, sourceMapWriteTo: string|null, outputSourceFiles: bool, sourceMapRootpath: string, sourceMapBasepath: string} - */ - private $options; - - /** - * @phpstan-param array{sourceRoot?: string, sourceMapFilename?: string|null, sourceMapURL?: string|null, sourceMapWriteTo?: string|null, outputSourceFiles?: bool, sourceMapRootpath?: string, sourceMapBasepath?: string} $options - */ - public function __construct(array $options = []) - { - $this->options = array_merge($this->defaultOptions, $options); - $this->encoder = new Base64VLQ(); - } - - /** - * Adds a mapping - * - * @param integer $generatedLine The line number in generated file - * @param integer $generatedColumn The column number in generated file - * @param integer $originalLine The line number in original file - * @param integer $originalColumn The column number in original file - * @param string $sourceFile The original source file - * - * @return void - */ - public function addMapping($generatedLine, $generatedColumn, $originalLine, $originalColumn, $sourceFile) - { - $this->mappings[] = [ - 'generated_line' => $generatedLine, - 'generated_column' => $generatedColumn, - 'original_line' => $originalLine, - 'original_column' => $originalColumn, - 'source_file' => $sourceFile - ]; - - $this->sources[$sourceFile] = $sourceFile; - } - - /** - * Saves the source map to a file - * - * @param string $content The content to write - * - * @return string - * - * @throws \ScssPhp\ScssPhp\Exception\CompilerException If the file could not be saved - * @deprecated - */ - public function saveMap($content) - { - $file = $this->options['sourceMapWriteTo']; - $dir = \dirname($file); - - // directory does not exist - if (! is_dir($dir)) { - // FIXME: create the dir automatically? - throw new CompilerException( - sprintf('The directory "%s" does not exist. Cannot save the source map.', $dir) - ); - } - - // FIXME: proper saving, with dir write check! - if (file_put_contents($file, $content) === false) { - throw new CompilerException(sprintf('Cannot save the source map to "%s"', $file)); - } - - return $this->options['sourceMapURL']; - } - - /** - * Generates the JSON source map - * - * @param string $prefix A prefix added in the output file, which needs to shift mappings - * - * @return string - * - * @see https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit# - */ - public function generateJson($prefix = '') - { - $sourceMap = []; - $mappings = $this->generateMappings($prefix); - - // File version (always the first entry in the object) and must be a positive integer. - $sourceMap['version'] = self::VERSION; - - // An optional name of the generated code that this source map is associated with. - $file = $this->options['sourceMapFilename']; - - if ($file) { - $sourceMap['file'] = $file; - } - - // An optional source root, useful for relocating source files on a server or removing repeated values in the - // 'sources' entry. This value is prepended to the individual entries in the 'source' field. - $root = $this->options['sourceRoot']; - - if ($root) { - $sourceMap['sourceRoot'] = $root; - } - - // A list of original sources used by the 'mappings' entry. - $sourceMap['sources'] = []; - - foreach ($this->sources as $sourceUri => $sourceFilename) { - $sourceMap['sources'][] = $this->normalizeFilename($sourceFilename); - } - - // A list of symbol names used by the 'mappings' entry. - $sourceMap['names'] = []; - - // A string with the encoded mapping data. - $sourceMap['mappings'] = $mappings; - - if ($this->options['outputSourceFiles']) { - // An optional list of source content, useful when the 'source' can't be hosted. - // The contents are listed in the same order as the sources above. - // 'null' may be used if some original sources should be retrieved by name. - $sourceMap['sourcesContent'] = $this->getSourcesContent(); - } - - // less.js compat fixes - if (\count($sourceMap['sources']) && empty($sourceMap['sourceRoot'])) { - unset($sourceMap['sourceRoot']); - } - - return json_encode($sourceMap, JSON_UNESCAPED_SLASHES); - } - - /** - * Returns the sources contents - * - * @return string[]|null - */ - protected function getSourcesContent() - { - if (empty($this->sources)) { - return null; - } - - $content = []; - - foreach ($this->sources as $sourceFile) { - $content[] = file_get_contents($sourceFile); - } - - return $content; - } - - /** - * Generates the mappings string - * - * @param string $prefix A prefix added in the output file, which needs to shift mappings - * - * @return string - */ - public function generateMappings($prefix = '') - { - if (! \count($this->mappings)) { - return ''; - } - - $prefixLines = substr_count($prefix, "\n"); - $lastPrefixNewLine = strrpos($prefix, "\n"); - $lastPrefixLineStart = false === $lastPrefixNewLine ? 0 : $lastPrefixNewLine + 1; - $prefixColumn = strlen($prefix) - $lastPrefixLineStart; - - $this->sourceKeys = array_flip(array_keys($this->sources)); - - // group mappings by generated line number. - $groupedMap = $groupedMapEncoded = []; - - foreach ($this->mappings as $m) { - $groupedMap[$m['generated_line']][] = $m; - } - - ksort($groupedMap); - - $lastGeneratedLine = $lastOriginalIndex = $lastOriginalLine = $lastOriginalColumn = 0; - - foreach ($groupedMap as $lineNumber => $lineMap) { - if ($lineNumber > 1) { - // The prefix only impacts the column for the first line of the original output - $prefixColumn = 0; - } - $lineNumber += $prefixLines; - - while (++$lastGeneratedLine < $lineNumber) { - $groupedMapEncoded[] = ';'; - } - - $lineMapEncoded = []; - $lastGeneratedColumn = 0; - - foreach ($lineMap as $m) { - $generatedColumn = $m['generated_column'] + $prefixColumn; - - $mapEncoded = $this->encoder->encode($generatedColumn - $lastGeneratedColumn); - $lastGeneratedColumn = $generatedColumn; - - // find the index - if ($m['source_file']) { - $index = $this->findFileIndex($m['source_file']); - - if ($index !== false) { - $mapEncoded .= $this->encoder->encode($index - $lastOriginalIndex); - $lastOriginalIndex = $index; - // lines are stored 0-based in SourceMap spec version 3 - $mapEncoded .= $this->encoder->encode($m['original_line'] - 1 - $lastOriginalLine); - $lastOriginalLine = $m['original_line'] - 1; - $mapEncoded .= $this->encoder->encode($m['original_column'] - $lastOriginalColumn); - $lastOriginalColumn = $m['original_column']; - } - } - - $lineMapEncoded[] = $mapEncoded; - } - - $groupedMapEncoded[] = implode(',', $lineMapEncoded) . ';'; - } - - return rtrim(implode($groupedMapEncoded), ';'); - } - - /** - * Finds the index for the filename - * - * @param string $filename - * - * @return integer|false - */ - protected function findFileIndex($filename) - { - return $this->sourceKeys[$filename]; - } - - /** - * Normalize filename - * - * @param string $filename - * - * @return string - */ - protected function normalizeFilename($filename) - { - $filename = $this->fixWindowsPath($filename); - $rootpath = $this->options['sourceMapRootpath']; - $basePath = $this->options['sourceMapBasepath']; - - // "Trim" the 'sourceMapBasepath' from the output filename. - if (\strlen($basePath) && strpos($filename, $basePath) === 0) { - $filename = substr($filename, \strlen($basePath)); - } - - // Remove extra leading path separators. - if (strpos($filename, '\\') === 0 || strpos($filename, '/') === 0) { - $filename = substr($filename, 1); - } - - return $rootpath . $filename; - } - - /** - * Fix windows paths - * - * @param string $path - * @param boolean $addEndSlash - * - * @return string - */ - public function fixWindowsPath($path, $addEndSlash = false) - { - $slash = ($addEndSlash) ? '/' : ''; - - if (! empty($path)) { - $path = str_replace('\\', '/', $path); - $path = rtrim($path, '/') . $slash; - } - - return $path; - } -} diff --git a/vendor/scssphp/scssphp/src/Type.php b/vendor/scssphp/scssphp/src/Type.php deleted file mode 100644 index fb2a1d7f..00000000 --- a/vendor/scssphp/scssphp/src/Type.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ -class Type -{ - const T_ASSIGN = 'assign'; - const T_AT_ROOT = 'at-root'; - const T_BLOCK = 'block'; - /** @deprecated */ - const T_BREAK = 'break'; - const T_CHARSET = 'charset'; - const T_COLOR = 'color'; - const T_COMMENT = 'comment'; - /** @deprecated */ - const T_CONTINUE = 'continue'; - /** @deprecated */ - const T_CONTROL = 'control'; - const T_CUSTOM_PROPERTY = 'custom'; - const T_DEBUG = 'debug'; - const T_DIRECTIVE = 'directive'; - const T_EACH = 'each'; - const T_ELSE = 'else'; - const T_ELSEIF = 'elseif'; - const T_ERROR = 'error'; - const T_EXPRESSION = 'exp'; - const T_EXTEND = 'extend'; - const T_FOR = 'for'; - const T_FUNCTION = 'function'; - const T_FUNCTION_REFERENCE = 'function-reference'; - const T_FUNCTION_CALL = 'fncall'; - const T_HSL = 'hsl'; - const T_HWB = 'hwb'; - const T_IF = 'if'; - const T_IMPORT = 'import'; - const T_INCLUDE = 'include'; - const T_INTERPOLATE = 'interpolate'; - const T_INTERPOLATED = 'interpolated'; - const T_KEYWORD = 'keyword'; - const T_LIST = 'list'; - const T_MAP = 'map'; - const T_MEDIA = 'media'; - const T_MEDIA_EXPRESSION = 'mediaExp'; - const T_MEDIA_TYPE = 'mediaType'; - const T_MEDIA_VALUE = 'mediaValue'; - const T_MIXIN = 'mixin'; - const T_MIXIN_CONTENT = 'mixin_content'; - const T_NESTED_PROPERTY = 'nestedprop'; - const T_NOT = 'not'; - const T_NULL = 'null'; - const T_NUMBER = 'number'; - const T_RETURN = 'return'; - const T_ROOT = 'root'; - const T_SCSSPHP_IMPORT_ONCE = 'scssphp-import-once'; - const T_SELF = 'self'; - const T_STRING = 'string'; - const T_UNARY = 'unary'; - const T_VARIABLE = 'var'; - const T_WARN = 'warn'; - const T_WHILE = 'while'; -} diff --git a/vendor/scssphp/scssphp/src/Util.php b/vendor/scssphp/scssphp/src/Util.php deleted file mode 100644 index 62cd2a20..00000000 --- a/vendor/scssphp/scssphp/src/Util.php +++ /dev/null @@ -1,184 +0,0 @@ - - * - * @internal - */ -class Util -{ - /** - * Asserts that `value` falls within `range` (inclusive), leaving - * room for slight floating-point errors. - * - * @param string $name The name of the value. Used in the error message. - * @param Range $range Range of values. - * @param array|Number $value The value to check. - * @param string $unit The unit of the value. Used in error reporting. - * - * @return mixed `value` adjusted to fall within range, if it was outside by a floating-point margin. - * - * @throws \ScssPhp\ScssPhp\Exception\RangeException - */ - public static function checkRange($name, Range $range, $value, $unit = '') - { - $val = $value[1]; - $grace = new Range(-0.00001, 0.00001); - - if (! \is_numeric($val)) { - throw new RangeException("$name {$val} is not a number."); - } - - if ($range->includes($val)) { - return $val; - } - - if ($grace->includes($val - $range->first)) { - return $range->first; - } - - if ($grace->includes($val - $range->last)) { - return $range->last; - } - - throw new RangeException("$name {$val} must be between {$range->first} and {$range->last}$unit"); - } - - /** - * Encode URI component - * - * @param string $string - * - * @return string - */ - public static function encodeURIComponent($string) - { - $revert = ['%21' => '!', '%2A' => '*', '%27' => "'", '%28' => '(', '%29' => ')']; - - return strtr(rawurlencode($string), $revert); - } - - /** - * mb_chr() wrapper - * - * @param integer $code - * - * @return string - */ - public static function mbChr($code) - { - // Use the native implementation if available, but not on PHP 7.2 as mb_chr(0) is buggy there - if (\PHP_VERSION_ID > 70300 && \function_exists('mb_chr')) { - return mb_chr($code, 'UTF-8'); - } - - 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); - } - - return $s; - } - - /** - * mb_strlen() wrapper - * - * @param string $string - * @return int - */ - public static function mbStrlen($string) - { - // Use the native implementation if available. - if (\function_exists('mb_strlen')) { - return mb_strlen($string, 'UTF-8'); - } - - if (\function_exists('iconv_strlen')) { - return (int) @iconv_strlen($string, 'UTF-8'); - } - - throw new \LogicException('Either mbstring (recommended) or iconv is necessary to use Scssphp.'); - } - - /** - * mb_substr() wrapper - * @param string $string - * @param int $start - * @param null|int $length - * @return string - */ - public static function mbSubstr($string, $start, $length = null) - { - // Use the native implementation if available. - if (\function_exists('mb_substr')) { - return mb_substr($string, $start, $length, 'UTF-8'); - } - - if (\function_exists('iconv_substr')) { - if ($start < 0) { - $start = static::mbStrlen($string) + $start; - if ($start < 0) { - $start = 0; - } - } - - if (null === $length) { - $length = 2147483647; - } elseif ($length < 0) { - $length = static::mbStrlen($string) + $length - $start; - if ($length < 0) { - return ''; - } - } - - return (string)iconv_substr($string, $start, $length, 'UTF-8'); - } - - throw new \LogicException('Either mbstring (recommended) or iconv is necessary to use Scssphp.'); - } - - /** - * mb_strpos wrapper - * @param string $haystack - * @param string $needle - * @param int $offset - * - * @return int|false - */ - public static function mbStrpos($haystack, $needle, $offset = 0) - { - if (\function_exists('mb_strpos')) { - return mb_strpos($haystack, $needle, $offset, 'UTF-8'); - } - - if (\function_exists('iconv_strpos')) { - return iconv_strpos($haystack, $needle, $offset, 'UTF-8'); - } - - throw new \LogicException('Either mbstring (recommended) or iconv is necessary to use Scssphp.'); - } -} diff --git a/vendor/scssphp/scssphp/src/Util/Path.php b/vendor/scssphp/scssphp/src/Util/Path.php deleted file mode 100644 index f399e41a..00000000 --- a/vendor/scssphp/scssphp/src/Util/Path.php +++ /dev/null @@ -1,77 +0,0 @@ -parseValue($source, $value)) { - throw new \InvalidArgumentException(sprintf('Invalid value source "%s".', $source)); - } - - return $value; - } - - /** - * Converts a PHP value to a Sass value - * - * The returned value is guaranteed to be supported by the - * Compiler methods for registering custom variables. No other - * guarantee about it is provided. It should be considered - * opaque values by the caller. - * - * @param mixed $value - * - * @return mixed - */ - public static function fromPhp($value) - { - if ($value instanceof Number) { - return $value; - } - - if (is_array($value) && isset($value[0]) && \in_array($value[0], [Type::T_NULL, Type::T_COLOR, Type::T_KEYWORD, Type::T_LIST, Type::T_MAP, Type::T_STRING])) { - return $value; - } - - if ($value === null) { - return Compiler::$null; - } - - if ($value === true) { - return Compiler::$true; - } - - if ($value === false) { - return Compiler::$false; - } - - if ($value === '') { - return Compiler::$emptyString; - } - - if (\is_int($value) || \is_float($value)) { - return new Number($value, ''); - } - - if (\is_string($value)) { - return [Type::T_STRING, '"', [$value]]; - } - - throw new \InvalidArgumentException(sprintf('Cannot convert the value of type "%s" to a Sass value.', gettype($value))); - } -} diff --git a/vendor/scssphp/scssphp/src/Version.php b/vendor/scssphp/scssphp/src/Version.php deleted file mode 100644 index b103b4bf..00000000 --- a/vendor/scssphp/scssphp/src/Version.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class Version -{ - const VERSION = '1.6.0'; -} diff --git a/vendor/scssphp/scssphp/src/Warn.php b/vendor/scssphp/scssphp/src/Warn.php deleted file mode 100644 index 592b44c7..00000000 --- a/vendor/scssphp/scssphp/src/Warn.php +++ /dev/null @@ -1,84 +0,0 @@ -command = $command; $this->input = $input; diff --git a/vendor/symfony/console/Helper/Helper.php b/vendor/symfony/console/Helper/Helper.php index 881b4dc4..cfcbbd9a 100644 --- a/vendor/symfony/console/Helper/Helper.php +++ b/vendor/symfony/console/Helper/Helper.php @@ -42,7 +42,7 @@ abstract class Helper implements HelperInterface /** * Returns the length of a string, using mb_strwidth if it is available. * - * @deprecated since 5.3 + * @deprecated since Symfony 5.3 * * @return int The length of the string */ @@ -154,7 +154,7 @@ abstract class Helper implements HelperInterface } /** - * @deprecated since 5.3 + * @deprecated since Symfony 5.3 */ public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, ?string $string) { @@ -170,7 +170,7 @@ abstract class Helper implements HelperInterface // remove <...> formatting $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/vendor/symfony/console/Helper/HelperSet.php b/vendor/symfony/console/Helper/HelperSet.php index 5c08a760..679dceab 100644 --- a/vendor/symfony/console/Helper/HelperSet.php +++ b/vendor/symfony/console/Helper/HelperSet.php @@ -89,8 +89,9 @@ class HelperSet implements \IteratorAggregate } /** - * @return Helper[] + * @return \Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->helpers); diff --git a/vendor/symfony/console/Helper/ProgressBar.php b/vendor/symfony/console/Helper/ProgressBar.php index 91fba2b5..1c03a1d9 100644 --- a/vendor/symfony/console/Helper/ProgressBar.php +++ b/vendor/symfony/console/Helper/ProgressBar.php @@ -482,8 +482,10 @@ final class ProgressBar } $this->output->clear($lineCount); } else { - if ($this->formatLineCount > 0) { - $this->cursor->moveUp($this->formatLineCount); + for ($i = 0; $i < $this->formatLineCount; ++$i) { + $this->cursor->moveToColumn(1); + $this->cursor->clearLine(); + $this->cursor->moveUp(); } $this->cursor->moveToColumn(1); diff --git a/vendor/symfony/console/Helper/QuestionHelper.php b/vendor/symfony/console/Helper/QuestionHelper.php index fd909592..28931358 100644 --- a/vendor/symfony/console/Helper/QuestionHelper.php +++ b/vendor/symfony/console/Helper/QuestionHelper.php @@ -205,7 +205,7 @@ class QuestionHelper extends Helper { $messages = []; - $maxWidth = max(array_map('self::width', array_keys($choices = $question->getChoices()))); + $maxWidth = max(array_map([__CLASS__, 'width'], array_keys($choices = $question->getChoices()))); foreach ($choices as $key => $value) { $padding = str_repeat(' ', $maxWidth - self::width($key)); diff --git a/vendor/symfony/lock/Store/PdoStore.php b/vendor/symfony/lock/Store/PdoStore.php index 98c6454e..cd24c4de 100644 --- a/vendor/symfony/lock/Store/PdoStore.php +++ b/vendor/symfony/lock/Store/PdoStore.php @@ -268,7 +268,7 @@ class PdoStore implements StoreInterface $table->setPrimaryKey([$this->idCol]); foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) { - if (method_exists($conn, 'executeStatement')) { + if ($conn instanceof Connection && method_exists($conn, 'executeStatement')) { $conn->executeStatement($sql); } else { $conn->exec($sql); @@ -298,7 +298,7 @@ class PdoStore implements StoreInterface throw new \DomainException(sprintf('Creating the lock table is currently not implemented for PDO driver "%s".', $driver)); } - if (method_exists($conn, 'executeStatement')) { + if ($conn instanceof Connection && method_exists($conn, 'executeStatement')) { $conn->executeStatement($sql); } else { $conn->exec($sql); @@ -313,7 +313,7 @@ class PdoStore implements StoreInterface $sql = "DELETE FROM $this->table WHERE $this->expirationCol <= {$this->getCurrentTimestampStatement()}"; $conn = $this->getConnection(); - if (method_exists($conn, 'executeStatement')) { + if ($conn instanceof Connection && method_exists($conn, 'executeStatement')) { $conn->executeStatement($sql); } else { $conn->exec($sql); diff --git a/vendor/symfony/string/Inflector/EnglishInflector.php b/vendor/symfony/string/Inflector/EnglishInflector.php index 39b8e9a6..9f2fac67 100644 --- a/vendor/symfony/string/Inflector/EnglishInflector.php +++ b/vendor/symfony/string/Inflector/EnglishInflector.php @@ -58,6 +58,9 @@ final class EnglishInflector implements InflectorInterface // selfies (selfie) ['seifles', 7, true, true, 'selfie'], + // zombies (zombie) + ['seibmoz', 7, true, true, 'zombie'], + // movies (movie) ['seivom', 6, true, true, 'movie'], diff --git a/vendor/symfony/translation/Command/TranslationPullCommand.php b/vendor/symfony/translation/Command/TranslationPullCommand.php index 0ec02ca7..511c7cae 100644 --- a/vendor/symfony/translation/Command/TranslationPullCommand.php +++ b/vendor/symfony/translation/Command/TranslationPullCommand.php @@ -119,6 +119,7 @@ EOF $writeOptions = [ 'path' => end($this->transPaths), 'xliff_version' => $xliffVersion, + 'default_locale' => $this->defaultLocale, ]; if (!$domains) { diff --git a/vendor/tysonandre/var_representation_polyfill/README.md b/vendor/tysonandre/var_representation_polyfill/README.md index 5c05e2ec..f219cd8f 100644 --- a/vendor/tysonandre/var_representation_polyfill/README.md +++ b/vendor/tysonandre/var_representation_polyfill/README.md @@ -3,13 +3,14 @@ var_representation_polyfill [![Build Status](https://github.com/TysonAndre/var_representation_polyfill/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/TysonAndre/var_representation_polyfill/actions/workflows/main.yml?query=branch%3Amain) [![License](https://img.shields.io/github/license/TysonAndre/var_representation_polyfill.svg)](https://github.com/TysonAndre/var_representation_polyfill/blob/main/LICENSE) +[![Latest Stable Version](https://img.shields.io/github/v/release/TysonAndre/var_representation_polyfill.svg)](https://packagist.org/packages/TysonAndre/var_representation_polyfill) [var_representation_polyfill](https://github.com/TysonAndre/var_representation_polyfill) is a polyfill for https://pecl.php.net/var_representation This provides a polyfill for the function `var_representation(mixed $value, int $flags = 0): string`, which converts a variable to a string in a way that fixes the shortcomings of `var_export()` -See [var_representation](https://github.com/TysonAndre/var_representation) documentation for more details +See [the var_representation PECL documentation](https://github.com/TysonAndre/var_representation) for more details Installation ------------ @@ -28,9 +29,22 @@ php > echo var_representation(['a','b']); 'a', 'b', ] + // can dump everything on one line. php > echo var_representation(['a', 'b', 'c'], VAR_REPRESENTATION_SINGLE_LINE); ['a', 'b', 'c'] + php > echo var_representation("uses double quotes: \$\"'\\\n"); "uses double quotes: \$\"'\\\n" + +// Can disable the escaping of control characters as of polyfill version 0.1.0 +// (e.g. if the return value needs to be escaped again) +php > echo var_representation("has\nnewlines", VAR_REPRESENTATION_UNESCAPED); +'has +newlines' +php > echo json_encode("uses single quotes:\0\r\n\$\"'\\"); +"uses single quotes:\u0000\r\n$\"'\\" +php > echo json_encode(var_representation("uses single quotes:\0\r\n\$\"'\\", + VAR_REPRESENTATION_UNESCAPED)); +"'uses single quotes:\u0000\r\n$\"\\'\\\\'" ``` diff --git a/vendor/tysonandre/var_representation_polyfill/ci/Dockerfile b/vendor/tysonandre/var_representation_polyfill/ci/Dockerfile index 101588ac..cfac5820 100644 --- a/vendor/tysonandre/var_representation_polyfill/ci/Dockerfile +++ b/vendor/tysonandre/var_representation_polyfill/ci/Dockerfile @@ -6,6 +6,7 @@ RUN apt-get update && \ apt-get install -y zlib1g-dev libzip-dev && \ docker-php-ext-configure zip && \ docker-php-ext-install -j$(nproc) zip +# Install php-ast to analyze this project with phan RUN pecl install ast && \ docker-php-ext-enable ast diff --git a/vendor/tysonandre/var_representation_polyfill/ci/test_dockerized.sh b/vendor/tysonandre/var_representation_polyfill/ci/test_dockerized.sh old mode 100644 new mode 100755 index f6eaae63..8b90d383 --- a/vendor/tysonandre/var_representation_polyfill/ci/test_dockerized.sh +++ b/vendor/tysonandre/var_representation_polyfill/ci/test_dockerized.sh @@ -11,7 +11,7 @@ fi set -xeu PHP_VERSION=$1 -DOCKER_IMAGE=igbinary-$PHP_VERSION-test-runner +DOCKER_IMAGE=var_representation-$PHP_VERSION-test-runner docker build --build-arg="PHP_VERSION=$PHP_VERSION" --tag="$DOCKER_IMAGE" -f ci/Dockerfile . docker run --rm $DOCKER_IMAGE vendor/bin/phpunit docker run --rm $DOCKER_IMAGE vendor/bin/phan diff --git a/vendor/tysonandre/var_representation_polyfill/composer.json b/vendor/tysonandre/var_representation_polyfill/composer.json index 206e6603..f9ad2659 100644 --- a/vendor/tysonandre/var_representation_polyfill/composer.json +++ b/vendor/tysonandre/var_representation_polyfill/composer.json @@ -1,6 +1,6 @@ { "name": "tysonandre/var_representation_polyfill", - "description": "Polyfill for var_representation", + "description": "Polyfill for var_representation: convert a variable to a string in a way that fixes the shortcomings of var_export", "keywords": ["var_export", "var_representation"], "type": "library", "license": "MIT", @@ -23,6 +23,9 @@ "phan/phan": "^4.0", "phpunit/phpunit": "^8.5.0" }, + "suggest": { + "ext-var_representation": "*" + }, "autoload": { "psr-4": {"VarRepresentation\\": "src/VarRepresentation"}, "files": ["src/var_representation.php"] diff --git a/vendor/tysonandre/var_representation_polyfill/composer.lock b/vendor/tysonandre/var_representation_polyfill/composer.lock index b3f3da7d..48cff3cb 100644 --- a/vendor/tysonandre/var_representation_polyfill/composer.lock +++ b/vendor/tysonandre/var_representation_polyfill/composer.lock @@ -90,21 +90,21 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496" + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", - "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "phpstan/phpstan": "^0.12.55", @@ -134,7 +134,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.1" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" }, "funding": [ { @@ -150,7 +150,7 @@ "type": "tidelift" } ], - "time": "2021-05-05T19:37:51+00:00" + "time": "2021-07-31T17:03:58+00:00" }, { "name": "doctrine/instantiator", @@ -268,23 +268,23 @@ }, { "name": "microsoft/tolerant-php-parser", - "version": "v0.0.23", + "version": "v0.1.1", "source": { "type": "git", "url": "https://github.com/microsoft/tolerant-php-parser.git", - "reference": "1d76657e3271754515ace52501d3e427eca42ad0" + "reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/microsoft/tolerant-php-parser/zipball/1d76657e3271754515ace52501d3e427eca42ad0", - "reference": "1d76657e3271754515ace52501d3e427eca42ad0", + "url": "https://api.github.com/repos/microsoft/tolerant-php-parser/zipball/6a965617cf484355048ac6d2d3de7b6ec93abb16", + "reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16", "shasum": "" }, "require": { - "php": ">=7.0" + "php": ">=7.2" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^8.5.15" }, "type": "library", "autoload": { @@ -307,9 +307,9 @@ "description": "Tolerant PHP-to-AST parser designed for IDE usage scenarios", "support": { "issues": "https://github.com/microsoft/tolerant-php-parser/issues", - "source": "https://github.com/microsoft/tolerant-php-parser/tree/v0.0.23" + "source": "https://github.com/microsoft/tolerant-php-parser/tree/v0.1.1" }, - "time": "2020-09-13T17:29:12+00:00" + "time": "2021-07-16T21:28:12+00:00" }, { "name": "myclabs/deep-copy", @@ -371,16 +371,16 @@ }, { "name": "netresearch/jsonmapper", - "version": "v3.1.1", + "version": "v4.0.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "ba09f0e456d4f00cef84e012da5715625594407c" + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/ba09f0e456d4f00cef84e012da5715625594407c", - "reference": "ba09f0e456d4f00cef84e012da5715625594407c", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", "shasum": "" }, "require": { @@ -388,10 +388,10 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", - "php": ">=5.6" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0", + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", "squizlabs/php_codesniffer": "~3.5" }, "type": "library", @@ -416,22 +416,22 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v3.1.1" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" }, - "time": "2020-11-02T19:19:54+00:00" + "time": "2020-12-01T19:48:11+00:00" }, { "name": "phan/phan", - "version": "4.0.6", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/phan/phan.git", - "reference": "4caaa97195dcea549021cb773a5dc30bb46d1fab" + "reference": "71f0a341fd9ed3bf88d57e3bc380f3e941a5df14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phan/phan/zipball/4caaa97195dcea549021cb773a5dc30bb46d1fab", - "reference": "4caaa97195dcea549021cb773a5dc30bb46d1fab", + "url": "https://api.github.com/repos/phan/phan/zipball/71f0a341fd9ed3bf88d57e3bc380f3e941a5df14", + "reference": "71f0a341fd9ed3bf88d57e3bc380f3e941a5df14", "shasum": "" }, "require": { @@ -441,8 +441,8 @@ "ext-json": "*", "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.0.4", - "microsoft/tolerant-php-parser": "0.0.23", - "netresearch/jsonmapper": "^1.6.0|^2.0|^3.0", + "microsoft/tolerant-php-parser": "0.1.1", + "netresearch/jsonmapper": "^1.6.0|^2.0|^3.0|^4.0", "php": "^7.2.0|^8.0.0", "sabre/event": "^5.0.3", "symfony/console": "^3.2|^4.0|^5.0", @@ -493,22 +493,22 @@ ], "support": { "issues": "https://github.com/phan/phan/issues", - "source": "https://github.com/phan/phan/tree/4.0.6" + "source": "https://github.com/phan/phan/tree/4.1.0" }, - "time": "2021-05-19T23:27:16+00:00" + "time": "2021-08-10T14:01:13+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { @@ -553,9 +553,9 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" + "source": "https://github.com/phar-io/manifest/tree/2.0.3" }, - "time": "2020-06-27T14:33:11+00:00" + "time": "2021-07-20T11:28:43+00:00" }, { "name": "phar-io/version", @@ -835,16 +835,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "7.0.14", + "version": "7.0.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "bb7c9a210c72e4709cdde67f8b7362f672f2225c" + "reference": "819f92bba8b001d4363065928088de22f25a3a48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bb7c9a210c72e4709cdde67f8b7362f672f2225c", - "reference": "bb7c9a210c72e4709cdde67f8b7362f672f2225c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", + "reference": "819f92bba8b001d4363065928088de22f25a3a48", "shasum": "" }, "require": { @@ -853,7 +853,7 @@ "php": ">=7.2", "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.1 || ^4.0", + "phpunit/php-token-stream": "^3.1.3 || ^4.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", "sebastian/environment": "^4.2.2", "sebastian/version": "^2.0.1", @@ -896,7 +896,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.14" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" }, "funding": [ { @@ -904,20 +904,20 @@ "type": "github" } ], - "time": "2020-12-02T13:39:03+00:00" + "time": "2021-07-26T12:20:09+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357" + "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4b49fb70f067272b659ef0174ff9ca40fdaa6357", - "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/28af674ff175d0768a5a978e6de83f697d4a7f05", + "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05", "shasum": "" }, "require": { @@ -956,7 +956,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.3" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.4" }, "funding": [ { @@ -964,7 +964,7 @@ "type": "github" } ], - "time": "2020-11-30T08:25:21+00:00" + "time": "2021-07-19T06:46:01+00:00" }, { "name": "phpunit/php-text-template", @@ -1072,16 +1072,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "3.1.2", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "472b687829041c24b25f475e14c2f38a09edf1c2" + "reference": "9c1da83261628cb24b6a6df371b6e312b3954768" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/472b687829041c24b25f475e14c2f38a09edf1c2", - "reference": "472b687829041c24b25f475e14c2f38a09edf1c2", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768", + "reference": "9c1da83261628cb24b6a6df371b6e312b3954768", "shasum": "" }, "require": { @@ -1119,7 +1119,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.2" + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.3" }, "funding": [ { @@ -1128,20 +1128,20 @@ } ], "abandoned": true, - "time": "2020-11-30T08:38:46+00:00" + "time": "2021-07-26T12:15:06+00:00" }, { "name": "phpunit/phpunit", - "version": "8.5.17", + "version": "8.5.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "79067856d85421c56d413bd238d4e2cd6b0e54da" + "reference": "496281b64ec781856ed0a583483b5923b4033722" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/79067856d85421c56d413bd238d4e2cd6b0e54da", - "reference": "79067856d85421c56d413bd238d4e2cd6b0e54da", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/496281b64ec781856ed0a583483b5923b4033722", + "reference": "496281b64ec781856ed0a583483b5923b4033722", "shasum": "" }, "require": { @@ -1153,12 +1153,12 @@ "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.1", + "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.2", "phpspec/prophecy": "^1.10.3", "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-file-iterator": "^2.0.4", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.1.2", "sebastian/comparator": "^3.0.2", @@ -1213,7 +1213,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.17" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.19" }, "funding": [ { @@ -1225,7 +1225,7 @@ "type": "github" } ], - "time": "2021-06-23T05:12:43+00:00" + "time": "2021-07-31T15:15:06+00:00" }, { "name": "psr/container", @@ -2122,16 +2122,16 @@ }, { "name": "symfony/console", - "version": "v5.3.2", + "version": "v5.3.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1" + "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1", - "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1", + "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", "shasum": "" }, "require": { @@ -2139,11 +2139,12 @@ "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2", "symfony/string": "^5.1" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<4.4", "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", @@ -2151,10 +2152,10 @@ "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/event-dispatcher": "^4.4|^5.0", @@ -2200,7 +2201,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.2" + "source": "https://github.com/symfony/console/tree/v5.3.6" }, "funding": [ { @@ -2216,7 +2217,7 @@ "type": "tidelift" } ], - "time": "2021-06-12T09:42:48+00:00" + "time": "2021-07-27T19:10:22+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2366,16 +2367,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab" + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/24b72c6baa32c746a4d0840147c9715e42bb68ab", - "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", "shasum": "" }, "require": { @@ -2427,7 +2428,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" }, "funding": [ { @@ -2443,7 +2444,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:17:38+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -2531,16 +2532,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { @@ -2591,7 +2592,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -2607,7 +2608,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:27:20+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-php73", @@ -2690,16 +2691,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { @@ -2753,7 +2754,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -2769,7 +2770,7 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-07-28T13:41:28+00:00" }, { "name": "symfony/service-contracts", @@ -2852,16 +2853,16 @@ }, { "name": "symfony/string", - "version": "v5.3.2", + "version": "v5.3.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "0732e97e41c0a590f77e231afc16a327375d50b0" + "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/0732e97e41c0a590f77e231afc16a327375d50b0", - "reference": "0732e97e41c0a590f77e231afc16a327375d50b0", + "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", "shasum": "" }, "require": { @@ -2915,7 +2916,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.2" + "source": "https://github.com/symfony/string/tree/v5.3.3" }, "funding": [ { @@ -2931,20 +2932,20 @@ "type": "tidelift" } ], - "time": "2021-06-06T09:51:56+00:00" + "time": "2021-06-27T11:44:38+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { @@ -2973,7 +2974,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" }, "funding": [ { @@ -2981,7 +2982,7 @@ "type": "github" } ], - "time": "2020-07-12T23:59:07+00:00" + "time": "2021-07-28T10:34:58+00:00" }, { "name": "webmozart/assert", @@ -3055,5 +3056,5 @@ "platform-overrides": { "php": "7.2.24" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Encoder.php b/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Encoder.php index 31c6dde8..92745e55 100644 --- a/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Encoder.php +++ b/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Encoder.php @@ -23,6 +23,8 @@ class Encoder protected $raw; /** @var int the current offset */ protected $i = 1; + /** @var bool whether the flags for the most recent call are VAR_REPRESENTATION_UNESCAPED */ + protected $unescaped = false; protected function __construct(string $raw) { @@ -68,6 +70,7 @@ class Encoder */ protected function encode(int $flags): string { + $this->unescaped = ($flags & \VAR_REPRESENTATION_UNESCAPED) !== 0; $result = $this->encodeValue(); if ($this->i !== \count($this->tokens) + 1) { throw new RuntimeException("Failed to read token #$this->i of $this->raw: " . \var_export($this->tokens[$this->i] ?? null, true)); @@ -145,6 +148,10 @@ class Encoder } $values[] = $this->encodeArray(); break; + case \T_OBJECT_CAST: + $values[] = $token[1]; + $values[] = ' '; + break; case \T_STRING: switch ($token[1]) { case 'NULL'; @@ -204,11 +211,16 @@ class Encoder } $unescaped_str .= self::unescapeStringRepresentation($token[1]); } - if (!\preg_match('/[\\x00-\\x1f\\x7f-\xff]/', $unescaped_str)) { + if (!\preg_match('/[\\x00-\\x1f\\x7f]/', $unescaped_str)) { // This does not have '"\0"', so it is already a single quoted string return new Group([$prefix]); } - return new Group([self::encodeRawStringDoubleQuoted($unescaped_str)]); + if ($this->unescaped) { + $repr = self::encodeRawStringUnescapedSingleQuoted($unescaped_str); + } else { + $repr = self::encodeRawStringDoubleQuoted($unescaped_str); + } + return new Group([$repr]); } /** @@ -218,7 +230,7 @@ class Encoder */ public static function encodeRawString(string $raw): string { - if (!\preg_match('/[\\x00-\\x1f\\x7f-\xff]/', $raw)) { + if (!\preg_match('/[\\x00-\\x1f\\x7f]/', $raw)) { // This does not have '"\0"', so var_export will return a single quoted string return \var_export($raw, true); } @@ -232,7 +244,7 @@ class Encoder public static function encodeRawStringDoubleQuoted(string $raw): string { return '"' . \preg_replace_callback( - '/[\\x00-\\x1f\\x7f-\xff\\\\"$]/', + '/[\\x00-\\x1f\\x7f\\\\"$]/', /** @param array{0:string} $match */ static function (array $match): string { $char = $match[0]; @@ -242,6 +254,16 @@ class Encoder ) . '"'; } + /** + * Returns the representation of $raw in an unescaped single quoted string + * (only escaping \\ and \', not escaping other control characters) + * @api + */ + public static function encodeRawStringUnescapedSingleQuoted(string $raw): string + { + return "'" . \preg_replace('/[\'\\\\]/', '\\\0', $raw) . "'"; + } + /** * Encode an array */ diff --git a/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Node/Array_.php b/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Node/Array_.php index 249906e3..97a9885e 100644 --- a/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Node/Array_.php +++ b/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Node/Array_.php @@ -54,8 +54,8 @@ class Array_ extends Node } $representation = "[\n"; foreach ($parts as $part) { - $representation .= \str_repeat(' ', $depth + 1) . $part->toIndentedString($depth + 1) . ",\n"; + $representation .= \str_repeat(' ', $depth + 1) . $part->toIndentedString($depth + 1) . ",\n"; } - return $representation . \str_repeat(' ', $depth) . "]"; + return $representation . \str_repeat(' ', $depth) . "]"; } } diff --git a/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Node/Object_.php b/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Node/Object_.php index 4e48e769..d9eb665c 100644 --- a/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Node/Object_.php +++ b/vendor/tysonandre/var_representation_polyfill/src/VarRepresentation/Node/Object_.php @@ -21,7 +21,7 @@ class Object_ extends Node public function __construct(string $prefix, Array_ $array, string $suffix) { if ($prefix === 'stdClass::__set_state(') { - $this->prefix = '(object)'; + $this->prefix = '(object) '; $this->suffix = ''; } else { $this->prefix = '\\' . $prefix; @@ -33,7 +33,7 @@ class Object_ extends Node public function __toString(): string { if ($this->prefix === 'stdClass::__set_state(') { - return '(object)' . $this->array; + return '(object) ' . $this->array; } return $this->prefix . $this->array->__toString() . $this->suffix; } diff --git a/vendor/tysonandre/var_representation_polyfill/src/var_representation.php b/vendor/tysonandre/var_representation_polyfill/src/var_representation.php index 27ffbbf1..657c4fe4 100644 --- a/vendor/tysonandre/var_representation_polyfill/src/var_representation.php +++ b/vendor/tysonandre/var_representation_polyfill/src/var_representation.php @@ -33,7 +33,8 @@ if (!function_exists('var_representation')) { * Convert a variable to a string in a way that fixes the shortcomings of `var_export()`. * * @param mixed $value - * @param int $flags bitmask of flags (VAR_REPRESENTATION_SINGLE_LINE) + * @param int $flags bitmask of flags (VAR_REPRESENTATION_SINGLE_LINE, VAR_REPRESENTATION_UNESCAPED) + * @suppress PhanRedefineFunctionInternal this is a polyfill */ function var_representation($value, int $flags = 0): string { @@ -43,3 +44,6 @@ if (!function_exists('var_representation')) { if (!defined('VAR_REPRESENTATION_SINGLE_LINE')) { define('VAR_REPRESENTATION_SINGLE_LINE', 1); } +if (!defined('VAR_REPRESENTATION_UNESCAPED')) { + define('VAR_REPRESENTATION_UNESCAPED', 2); +}