Composer data update

This commit is contained in:
Clemens Schwaighofer
2022-01-06 10:01:52 +09:00
parent 4bac10bb42
commit 5452bffdb4
57 changed files with 1409 additions and 680 deletions

107
www/composer.lock generated
View File

@@ -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": "882616c31a4323dbd288cabb055ae0ef",
"content-hash": "fb2235a66a37d89e7941a863843d2e15",
"packages": [],
"packages-dev": [
{
@@ -136,16 +136,16 @@
},
{
"name": "nikic/php-parser",
"version": "v4.13.0",
"version": "v4.13.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "50953a2691a922aa1769461637869a0a2faa3f53"
"reference": "210577fe3cf7badcc5814d99455df46564f3c077"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53",
"reference": "50953a2691a922aa1769461637869a0a2faa3f53",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077",
"reference": "210577fe3cf7badcc5814d99455df46564f3c077",
"shasum": ""
},
"require": {
@@ -186,9 +186,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0"
"source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2"
},
"time": "2021-09-20T12:20:58+00:00"
"time": "2021-11-30T19:35:32+00:00"
},
{
"name": "phar-io/manifest",
@@ -413,16 +413,16 @@
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.5.1",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae"
"reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae",
"reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706",
"reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706",
"shasum": ""
},
"require": {
@@ -457,22 +457,22 @@
"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.5.1"
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0"
},
"time": "2021-10-02T14:08:47+00:00"
"time": "2022-01-04T19:58:01+00:00"
},
{
"name": "phpspec/prophecy",
"version": "1.14.0",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e"
"reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
"reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
"reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
"shasum": ""
},
"require": {
@@ -524,29 +524,29 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
"source": "https://github.com/phpspec/prophecy/tree/1.14.0"
"source": "https://github.com/phpspec/prophecy/tree/v1.15.0"
},
"time": "2021-09-10T09:02:12+00:00"
"time": "2021-12-08T12:19:24+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "9.2.7",
"version": "9.2.10",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218"
"reference": "d5850aaf931743067f4bfc1ae4cbd06468400687"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218",
"reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687",
"reference": "d5850aaf931743067f4bfc1ae4cbd06468400687",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
"nikic/php-parser": "^4.12.0",
"nikic/php-parser": "^4.13.0",
"php": ">=7.3",
"phpunit/php-file-iterator": "^3.0.3",
"phpunit/php-text-template": "^2.0.2",
@@ -595,7 +595,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10"
},
"funding": [
{
@@ -603,20 +603,20 @@
"type": "github"
}
],
"time": "2021-09-17T05:39:03+00:00"
"time": "2021-12-05T09:12:13+00:00"
},
{
"name": "phpunit/php-file-iterator",
"version": "3.0.5",
"version": "3.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "aa4be8575f26070b100fccb67faabb28f21f66f8"
"reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8",
"reference": "aa4be8575f26070b100fccb67faabb28f21f66f8",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
"reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
"shasum": ""
},
"require": {
@@ -655,7 +655,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5"
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
},
"funding": [
{
@@ -663,7 +663,7 @@
"type": "github"
}
],
"time": "2020-09-28T05:57:25+00:00"
"time": "2021-12-02T12:48:52+00:00"
},
{
"name": "phpunit/php-invoker",
@@ -848,16 +848,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.10",
"version": "9.5.11",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a"
"reference": "2406855036db1102126125537adb1406f7242fdd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
"reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd",
"reference": "2406855036db1102126125537adb1406f7242fdd",
"shasum": ""
},
"require": {
@@ -935,11 +935,11 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11"
},
"funding": [
{
"url": "https://phpunit.de/donate.html",
"url": "https://phpunit.de/sponsors.html",
"type": "custom"
},
{
@@ -947,7 +947,7 @@
"type": "github"
}
],
"time": "2021-09-25T07:38:51+00:00"
"time": "2021-12-25T07:07:57+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -1378,16 +1378,16 @@
},
{
"name": "sebastian/exporter",
"version": "4.0.3",
"version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65"
"reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65",
"reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9",
"reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9",
"shasum": ""
},
"require": {
@@ -1436,14 +1436,14 @@
}
],
"description": "Provides the functionality to export PHP variables for visualization",
"homepage": "http://www.github.com/sebastianbergmann/exporter",
"homepage": "https://www.github.com/sebastianbergmann/exporter",
"keywords": [
"export",
"exporter"
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3"
"source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4"
},
"funding": [
{
@@ -1451,7 +1451,7 @@
"type": "github"
}
],
"time": "2020-09-28T05:24:23+00:00"
"time": "2021-11-11T14:18:36+00:00"
},
{
"name": "sebastian/global-state",
@@ -1915,21 +1915,24 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.23.0",
"version": "v1.24.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce"
"reference": "30885182c981ab175d4d034db0f6f469898070ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
"reference": "30885182c981ab175d4d034db0f6f469898070ab",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"provide": {
"ext-ctype": "*"
},
"suggest": {
"ext-ctype": "For best performance"
},
@@ -1974,7 +1977,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0"
},
"funding": [
{
@@ -1990,7 +1993,7 @@
"type": "tidelift"
}
],
"time": "2021-02-19T12:13:01+00:00"
"time": "2021-10-20T20:35:02+00:00"
},
{
"name": "theseer/tokenizer",

View File

@@ -24,8 +24,21 @@ use Composer\Semver\VersionParser;
*/
class InstalledVersions
{
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
*/
private static $installed;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
private static $installedByVendor = array();
/**

View File

@@ -846,19 +846,4 @@ return array(
'TheSeer\\Tokenizer\\TokenCollectionException' => $vendorDir . '/theseer/tokenizer/src/TokenCollectionException.php',
'TheSeer\\Tokenizer\\Tokenizer' => $vendorDir . '/theseer/tokenizer/src/Tokenizer.php',
'TheSeer\\Tokenizer\\XMLSerializer' => $vendorDir . '/theseer/tokenizer/src/XMLSerializer.php',
'pBarcode128' => $baseDir . '/lib/pChart2.1.4/class/pBarcode128.class.php',
'pBarcode39' => $baseDir . '/lib/pChart2.1.4/class/pBarcode39.class.php',
'pBubble' => $baseDir . '/lib/pChart2.1.4/class/pBubble.class.php',
'pCache' => $baseDir . '/lib/pChart2.1.4/class/pCache.class.php',
'pData' => $baseDir . '/lib/pChart2.1.4/class/pData.class.php',
'pDraw' => $baseDir . '/lib/pChart2.1.4/class/pDraw.class.php',
'pImage' => $baseDir . '/lib/pChart2.1.4/class/pImage.class.php',
'pIndicator' => $baseDir . '/lib/pChart2.1.4/class/pIndicator.class.php',
'pPie' => $baseDir . '/lib/pChart2.1.4/class/pPie.class.php',
'pRadar' => $baseDir . '/lib/pChart2.1.4/class/pRadar.class.php',
'pScatter' => $baseDir . '/lib/pChart2.1.4/class/pScatter.class.php',
'pSplit' => $baseDir . '/lib/pChart2.1.4/class/pSplit.class.php',
'pSpring' => $baseDir . '/lib/pChart2.1.4/class/pSpring.class.php',
'pStock' => $baseDir . '/lib/pChart2.1.4/class/pStock.class.php',
'pSurface' => $baseDir . '/lib/pChart2.1.4/class/pSurface.class.php',
);

View File

@@ -911,21 +911,6 @@ class ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9
'TheSeer\\Tokenizer\\TokenCollectionException' => __DIR__ . '/..' . '/theseer/tokenizer/src/TokenCollectionException.php',
'TheSeer\\Tokenizer\\Tokenizer' => __DIR__ . '/..' . '/theseer/tokenizer/src/Tokenizer.php',
'TheSeer\\Tokenizer\\XMLSerializer' => __DIR__ . '/..' . '/theseer/tokenizer/src/XMLSerializer.php',
'pBarcode128' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pBarcode128.class.php',
'pBarcode39' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pBarcode39.class.php',
'pBubble' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pBubble.class.php',
'pCache' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pCache.class.php',
'pData' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pData.class.php',
'pDraw' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pDraw.class.php',
'pImage' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pImage.class.php',
'pIndicator' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pIndicator.class.php',
'pPie' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pPie.class.php',
'pRadar' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pRadar.class.php',
'pScatter' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pScatter.class.php',
'pSplit' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pSplit.class.php',
'pSpring' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pSpring.class.php',
'pStock' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pStock.class.php',
'pSurface' => __DIR__ . '/../..' . '/lib/pChart2.1.4/class/pSurface.class.php',
);
public static function getInitializer(ClassLoader $loader)

View File

@@ -135,17 +135,17 @@
},
{
"name": "nikic/php-parser",
"version": "v4.13.0",
"version_normalized": "4.13.0.0",
"version": "v4.13.2",
"version_normalized": "4.13.2.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "50953a2691a922aa1769461637869a0a2faa3f53"
"reference": "210577fe3cf7badcc5814d99455df46564f3c077"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53",
"reference": "50953a2691a922aa1769461637869a0a2faa3f53",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077",
"reference": "210577fe3cf7badcc5814d99455df46564f3c077",
"shasum": ""
},
"require": {
@@ -156,7 +156,7 @@
"ircmaxell/php-yacc": "^0.0.7",
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
},
"time": "2021-09-20T12:20:58+00:00",
"time": "2021-11-30T19:35:32+00:00",
"bin": [
"bin/php-parse"
],
@@ -188,7 +188,7 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0"
"source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2"
},
"install-path": "../nikic/php-parser"
},
@@ -427,17 +427,17 @@
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.5.1",
"version_normalized": "1.5.1.0",
"version": "1.6.0",
"version_normalized": "1.6.0.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae"
"reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae",
"reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706",
"reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706",
"shasum": ""
},
"require": {
@@ -448,7 +448,7 @@
"ext-tokenizer": "*",
"psalm/phar": "^4.8"
},
"time": "2021-10-02T14:08:47+00:00",
"time": "2022-01-04T19:58:01+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -474,23 +474,23 @@
"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.5.1"
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0"
},
"install-path": "../phpdocumentor/type-resolver"
},
{
"name": "phpspec/prophecy",
"version": "1.14.0",
"version_normalized": "1.14.0.0",
"version": "v1.15.0",
"version_normalized": "1.15.0.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e"
"reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
"reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
"reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
"shasum": ""
},
"require": {
@@ -504,7 +504,7 @@
"phpspec/phpspec": "^6.0 || ^7.0",
"phpunit/phpunit": "^8.0 || ^9.0"
},
"time": "2021-09-10T09:02:12+00:00",
"time": "2021-12-08T12:19:24+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -544,30 +544,30 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
"source": "https://github.com/phpspec/prophecy/tree/1.14.0"
"source": "https://github.com/phpspec/prophecy/tree/v1.15.0"
},
"install-path": "../phpspec/prophecy"
},
{
"name": "phpunit/php-code-coverage",
"version": "9.2.7",
"version_normalized": "9.2.7.0",
"version": "9.2.10",
"version_normalized": "9.2.10.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218"
"reference": "d5850aaf931743067f4bfc1ae4cbd06468400687"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218",
"reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687",
"reference": "d5850aaf931743067f4bfc1ae4cbd06468400687",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
"nikic/php-parser": "^4.12.0",
"nikic/php-parser": "^4.13.0",
"php": ">=7.3",
"phpunit/php-file-iterator": "^3.0.3",
"phpunit/php-text-template": "^2.0.2",
@@ -585,7 +585,7 @@
"ext-pcov": "*",
"ext-xdebug": "*"
},
"time": "2021-09-17T05:39:03+00:00",
"time": "2021-12-05T09:12:13+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -618,7 +618,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10"
},
"funding": [
{
@@ -630,17 +630,17 @@
},
{
"name": "phpunit/php-file-iterator",
"version": "3.0.5",
"version_normalized": "3.0.5.0",
"version": "3.0.6",
"version_normalized": "3.0.6.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "aa4be8575f26070b100fccb67faabb28f21f66f8"
"reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8",
"reference": "aa4be8575f26070b100fccb67faabb28f21f66f8",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
"reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
"shasum": ""
},
"require": {
@@ -649,7 +649,7 @@
"require-dev": {
"phpunit/phpunit": "^9.3"
},
"time": "2020-09-28T05:57:25+00:00",
"time": "2021-12-02T12:48:52+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -681,7 +681,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5"
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
},
"funding": [
{
@@ -883,17 +883,17 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.10",
"version_normalized": "9.5.10.0",
"version": "9.5.11",
"version_normalized": "9.5.11.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a"
"reference": "2406855036db1102126125537adb1406f7242fdd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
"reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd",
"reference": "2406855036db1102126125537adb1406f7242fdd",
"shasum": ""
},
"require": {
@@ -934,7 +934,7 @@
"ext-soap": "*",
"ext-xdebug": "*"
},
"time": "2021-09-25T07:38:51+00:00",
"time": "2021-12-25T07:07:57+00:00",
"bin": [
"phpunit"
],
@@ -973,11 +973,11 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11"
},
"funding": [
{
"url": "https://phpunit.de/donate.html",
"url": "https://phpunit.de/sponsors.html",
"type": "custom"
},
{
@@ -1437,17 +1437,17 @@
},
{
"name": "sebastian/exporter",
"version": "4.0.3",
"version_normalized": "4.0.3.0",
"version": "4.0.4",
"version_normalized": "4.0.4.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65"
"reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65",
"reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9",
"reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9",
"shasum": ""
},
"require": {
@@ -1458,7 +1458,7 @@
"ext-mbstring": "*",
"phpunit/phpunit": "^9.3"
},
"time": "2020-09-28T05:24:23+00:00",
"time": "2021-11-11T14:18:36+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -1498,14 +1498,14 @@
}
],
"description": "Provides the functionality to export PHP variables for visualization",
"homepage": "http://www.github.com/sebastianbergmann/exporter",
"homepage": "https://www.github.com/sebastianbergmann/exporter",
"keywords": [
"export",
"exporter"
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3"
"source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4"
},
"funding": [
{
@@ -2001,26 +2001,29 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.23.0",
"version_normalized": "1.23.0.0",
"version": "v1.24.0",
"version_normalized": "1.24.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce"
"reference": "30885182c981ab175d4d034db0f6f469898070ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
"reference": "30885182c981ab175d4d034db0f6f469898070ab",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"provide": {
"ext-ctype": "*"
},
"suggest": {
"ext-ctype": "For best performance"
},
"time": "2021-02-19T12:13:01+00:00",
"time": "2021-10-20T20:35:02+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -2063,7 +2066,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0"
},
"funding": [
{

View File

@@ -5,8 +5,8 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '0b7dba5e2fa7012c1f01655ab27e6ae9d07f4afe',
'name' => 'gullevek/www',
'reference' => '4bac10bb428149dbadcaafbdd97431b1bf11d987',
'name' => 'gullevek/corelibs',
'dev' => true,
),
'versions' => array(
@@ -19,13 +19,13 @@
'reference' => 'd56bf6102915de5702778fe20f2de3b2fe570b5b',
'dev_requirement' => true,
),
'gullevek/www' => array(
'gullevek/corelibs' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '0b7dba5e2fa7012c1f01655ab27e6ae9d07f4afe',
'reference' => '4bac10bb428149dbadcaafbdd97431b1bf11d987',
'dev_requirement' => false,
),
'myclabs/deep-copy' => array(
@@ -41,12 +41,12 @@
),
),
'nikic/php-parser' => array(
'pretty_version' => 'v4.13.0',
'version' => '4.13.0.0',
'pretty_version' => 'v4.13.2',
'version' => '4.13.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../nikic/php-parser',
'aliases' => array(),
'reference' => '50953a2691a922aa1769461637869a0a2faa3f53',
'reference' => '210577fe3cf7badcc5814d99455df46564f3c077',
'dev_requirement' => true,
),
'phar-io/manifest' => array(
@@ -86,39 +86,39 @@
'dev_requirement' => true,
),
'phpdocumentor/type-resolver' => array(
'pretty_version' => '1.5.1',
'version' => '1.5.1.0',
'pretty_version' => '1.6.0',
'version' => '1.6.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpdocumentor/type-resolver',
'aliases' => array(),
'reference' => 'a12f7e301eb7258bb68acd89d4aefa05c2906cae',
'reference' => '93ebd0014cab80c4ea9f5e297ea48672f1b87706',
'dev_requirement' => true,
),
'phpspec/prophecy' => array(
'pretty_version' => '1.14.0',
'version' => '1.14.0.0',
'pretty_version' => 'v1.15.0',
'version' => '1.15.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpspec/prophecy',
'aliases' => array(),
'reference' => 'd86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e',
'reference' => 'bbcd7380b0ebf3961ee21409db7b38bc31d69a13',
'dev_requirement' => true,
),
'phpunit/php-code-coverage' => array(
'pretty_version' => '9.2.7',
'version' => '9.2.7.0',
'pretty_version' => '9.2.10',
'version' => '9.2.10.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-code-coverage',
'aliases' => array(),
'reference' => 'd4c798ed8d51506800b441f7a13ecb0f76f12218',
'reference' => 'd5850aaf931743067f4bfc1ae4cbd06468400687',
'dev_requirement' => true,
),
'phpunit/php-file-iterator' => array(
'pretty_version' => '3.0.5',
'version' => '3.0.5.0',
'pretty_version' => '3.0.6',
'version' => '3.0.6.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-file-iterator',
'aliases' => array(),
'reference' => 'aa4be8575f26070b100fccb67faabb28f21f66f8',
'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf',
'dev_requirement' => true,
),
'phpunit/php-invoker' => array(
@@ -149,12 +149,12 @@
'dev_requirement' => true,
),
'phpunit/phpunit' => array(
'pretty_version' => '9.5.10',
'version' => '9.5.10.0',
'pretty_version' => '9.5.11',
'version' => '9.5.11.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/phpunit',
'aliases' => array(),
'reference' => 'c814a05837f2edb0d1471d6e3f4ab3501ca3899a',
'reference' => '2406855036db1102126125537adb1406f7242fdd',
'dev_requirement' => true,
),
'sebastian/cli-parser' => array(
@@ -221,12 +221,12 @@
'dev_requirement' => true,
),
'sebastian/exporter' => array(
'pretty_version' => '4.0.3',
'version' => '4.0.3.0',
'pretty_version' => '4.0.4',
'version' => '4.0.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/exporter',
'aliases' => array(),
'reference' => 'd89cc98761b8cb5a1a235a6b703ae50d34080e65',
'reference' => '65e8b7db476c5dd267e65eea9cab77584d3cfff9',
'dev_requirement' => true,
),
'sebastian/global-state' => array(
@@ -302,12 +302,12 @@
'dev_requirement' => true,
),
'symfony/polyfill-ctype' => array(
'pretty_version' => 'v1.23.0',
'version' => '1.23.0.0',
'pretty_version' => 'v1.24.0',
'version' => '1.24.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
'aliases' => array(),
'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce',
'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
'dev_requirement' => true,
),
'theseer/tokenizer' => array(

View File

@@ -1,9 +0,0 @@
root = true
[*.y]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

View File

@@ -41,12 +41,12 @@ semi_reserved:
| T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC | T_READONLY
;
identifier_ex:
identifier_maybe_reserved:
T_STRING { $$ = Node\Identifier[$1]; }
| semi_reserved { $$ = Node\Identifier[$1]; }
;
identifier:
identifier_not_reserved:
T_STRING { $$ = Node\Identifier[$1]; }
;
@@ -181,14 +181,14 @@ non_empty_inline_use_declarations:
unprefixed_use_declaration:
namespace_name
{ $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); }
| namespace_name T_AS identifier
| namespace_name T_AS identifier_not_reserved
{ $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); }
;
use_declaration:
legacy_namespace_name
{ $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); }
| legacy_namespace_name T_AS identifier
| legacy_namespace_name T_AS identifier_not_reserved
{ $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); }
;
@@ -208,7 +208,7 @@ non_empty_constant_declaration_list:
;
constant_declaration:
identifier '=' expr { $$ = Node\Const_[$1, $3]; }
identifier_not_reserved '=' expr { $$ = Node\Const_[$1, $3]; }
;
class_const_list:
@@ -221,7 +221,7 @@ non_empty_class_const_list:
;
class_const:
identifier_ex '=' expr { $$ = Node\Const_[$1, $3]; }
identifier_maybe_reserved '=' expr { $$ = Node\Const_[$1, $3]; }
;
inner_statement_list_ex:
@@ -289,8 +289,8 @@ non_empty_statement:
| T_DECLARE '(' declare_list ')' declare_statement { $$ = Stmt\Declare_[$3, $5]; }
| T_TRY '{' inner_statement_list '}' catches optional_finally
{ $$ = Stmt\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); }
| T_GOTO identifier semi { $$ = Stmt\Goto_[$2]; }
| identifier ':' { $$ = Stmt\Label[$1]; }
| T_GOTO identifier_not_reserved semi { $$ = Stmt\Goto_[$2]; }
| identifier_not_reserved ':' { $$ = Stmt\Label[$1]; }
| error { $$ = array(); /* means: no statement */ }
;
@@ -351,22 +351,22 @@ block_or_error:
;
function_declaration_statement:
T_FUNCTION optional_ref identifier '(' parameter_list ')' optional_return_type block_or_error
T_FUNCTION optional_ref identifier_not_reserved '(' parameter_list ')' optional_return_type block_or_error
{ $$ = Stmt\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; }
| attributes T_FUNCTION optional_ref identifier '(' parameter_list ')' optional_return_type block_or_error
| attributes T_FUNCTION optional_ref identifier_not_reserved '(' parameter_list ')' optional_return_type block_or_error
{ $$ = Stmt\Function_[$4, ['byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; }
;
class_declaration_statement:
optional_attributes class_entry_type identifier extends_from implements_list '{' class_statement_list '}'
optional_attributes class_entry_type identifier_not_reserved extends_from implements_list '{' class_statement_list '}'
{ $$ = Stmt\Class_[$3, ['type' => $2, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]];
$this->checkClass($$, #3); }
| optional_attributes T_INTERFACE identifier interface_extends_list '{' class_statement_list '}'
| optional_attributes T_INTERFACE identifier_not_reserved interface_extends_list '{' class_statement_list '}'
{ $$ = Stmt\Interface_[$3, ['extends' => $4, 'stmts' => $6, 'attrGroups' => $1]];
$this->checkInterface($$, #3); }
| optional_attributes T_TRAIT identifier '{' class_statement_list '}'
| optional_attributes T_TRAIT identifier_not_reserved '{' class_statement_list '}'
{ $$ = Stmt\Trait_[$3, ['stmts' => $5, 'attrGroups' => $1]]; }
| optional_attributes T_ENUM identifier enum_scalar_type implements_list '{' class_statement_list '}'
| optional_attributes T_ENUM identifier_not_reserved enum_scalar_type implements_list '{' class_statement_list '}'
{ $$ = Stmt\Enum_[$3, ['scalarType' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]];
$this->checkEnum($$, #3); }
;
@@ -436,7 +436,7 @@ non_empty_declare_list:
;
declare_list_element:
identifier '=' expr { $$ = Stmt\DeclareDeclare[$1, $3]; }
identifier_not_reserved '=' expr { $$ = Stmt\DeclareDeclare[$1, $3]; }
;
switch_case_list:
@@ -635,7 +635,7 @@ argument:
expr { $$ = Node\Arg[$1, false, false]; }
| ampersand variable { $$ = Node\Arg[$2, true, false]; }
| T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; }
| identifier_ex ':' expr
| identifier_maybe_reserved ':' expr
{ $$ = new Node\Arg($3, false, false, attributes(), $1); }
;
@@ -684,11 +684,12 @@ class_statement:
| optional_attributes method_modifiers T_CONST class_const_list semi
{ $$ = new Stmt\ClassConst($4, $2, attributes(), $1);
$this->checkClassConst($$, #2); }
| optional_attributes method_modifiers T_FUNCTION optional_ref identifier_ex '(' parameter_list ')' optional_return_type method_body
| optional_attributes method_modifiers T_FUNCTION optional_ref identifier_maybe_reserved '(' parameter_list ')'
optional_return_type method_body
{ $$ = Stmt\ClassMethod[$5, ['type' => $2, 'byRef' => $4, 'params' => $7, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]];
$this->checkClassMethod($$, #2); }
| T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; }
| optional_attributes T_CASE identifier enum_case_expr semi
| optional_attributes T_CASE identifier_maybe_reserved enum_case_expr semi
{ $$ = Stmt\EnumCase[$3, $4, $1]; }
| error { $$ = null; /* will be skipped */ }
;
@@ -706,22 +707,22 @@ trait_adaptation_list:
trait_adaptation:
trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';'
{ $$ = Stmt\TraitUseAdaptation\Precedence[$1[0], $1[1], $3]; }
| trait_method_reference T_AS member_modifier identifier_ex ';'
| trait_method_reference T_AS member_modifier identifier_maybe_reserved ';'
{ $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, $4]; }
| trait_method_reference T_AS member_modifier ';'
{ $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, null]; }
| trait_method_reference T_AS identifier ';'
| trait_method_reference T_AS identifier_not_reserved ';'
{ $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; }
| trait_method_reference T_AS reserved_non_modifiers_identifier ';'
{ $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; }
;
trait_method_reference_fully_qualified:
name T_PAAMAYIM_NEKUDOTAYIM identifier_ex { $$ = array($1, $3); }
name T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved { $$ = array($1, $3); }
;
trait_method_reference:
trait_method_reference_fully_qualified { $$ = $1; }
| identifier_ex { $$ = array(null, $1); }
| identifier_maybe_reserved { $$ = array(null, $1); }
;
method_body:
@@ -994,7 +995,7 @@ constant:
;
class_constant:
class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex
class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved
{ $$ = Expr\ClassConstFetch[$1, $3]; }
/* We interpret an isolated FOO:: as an unfinished class constant fetch. It could also be
an unfinished static property fetch or unfinished scoped call. */
@@ -1113,13 +1114,13 @@ new_variable:
;
member_name:
identifier_ex { $$ = $1; }
identifier_maybe_reserved { $$ = $1; }
| '{' expr '}' { $$ = $2; }
| simple_variable { $$ = $1; }
;
property_name:
identifier { $$ = $1; }
identifier_not_reserved { $$ = $1; }
| '{' expr '}' { $$ = $2; }
| simple_variable { $$ = $1; }
| error { $$ = Expr\Error[]; $this->errorState = 2; }
@@ -1174,8 +1175,10 @@ encaps_str_varname:
encaps_var:
plain_variable { $$ = $1; }
| plain_variable '[' encaps_var_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; }
| plain_variable T_OBJECT_OPERATOR identifier { $$ = Expr\PropertyFetch[$1, $3]; }
| plain_variable T_NULLSAFE_OBJECT_OPERATOR identifier { $$ = Expr\NullsafePropertyFetch[$1, $3]; }
| plain_variable T_OBJECT_OPERATOR identifier_not_reserved
{ $$ = Expr\PropertyFetch[$1, $3]; }
| plain_variable T_NULLSAFE_OBJECT_OPERATOR identifier_not_reserved
{ $$ = Expr\NullsafePropertyFetch[$1, $3]; }
| T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Expr\Variable[$2]; }
| T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = Expr\Variable[$2]; }
| T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}'

View File

@@ -0,0 +1,85 @@
<?php
declare(strict_types=1);
namespace PhpParser\Builder;
use PhpParser;
use PhpParser\BuilderHelpers;
use PhpParser\Node;
use PhpParser\Node\Identifier;
use PhpParser\Node\Stmt;
class EnumCase implements PhpParser\Builder
{
protected $name;
protected $value = null;
protected $attributes = [];
/** @var Node\AttributeGroup[] */
protected $attributeGroups = [];
/**
* Creates an enum case builder.
*
* @param string|Identifier $name Name
*/
public function __construct($name) {
$this->name = $name;
}
/**
* Sets the value.
*
* @param Node\Expr|string|int $value
*
* @return $this
*/
public function setValue($value) {
$this->value = BuilderHelpers::normalizeValue($value);
return $this;
}
/**
* Sets doc comment for the constant.
*
* @param PhpParser\Comment\Doc|string $docComment Doc comment to set
*
* @return $this The builder instance (for fluid interface)
*/
public function setDocComment($docComment) {
$this->attributes = [
'comments' => [BuilderHelpers::normalizeDocComment($docComment)]
];
return $this;
}
/**
* Adds an attribute group.
*
* @param Node\Attribute|Node\AttributeGroup $attribute
*
* @return $this The builder instance (for fluid interface)
*/
public function addAttribute($attribute) {
$this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
return $this;
}
/**
* Returns the built enum case node.
*
* @return Stmt\EnumCase The built constant node
*/
public function getNode(): PhpParser\Node {
return new Stmt\EnumCase(
$this->name,
$this->value,
$this->attributes,
$this->attributeGroups
);
}
}

View File

@@ -0,0 +1,117 @@
<?php declare(strict_types=1);
namespace PhpParser\Builder;
use PhpParser;
use PhpParser\BuilderHelpers;
use PhpParser\Node;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\Stmt;
class Enum_ extends Declaration
{
protected $name;
protected $scalarType = null;
protected $implements = [];
protected $uses = [];
protected $enumCases = [];
protected $constants = [];
protected $methods = [];
/** @var Node\AttributeGroup[] */
protected $attributeGroups = [];
/**
* Creates an enum builder.
*
* @param string $name Name of the enum
*/
public function __construct(string $name) {
$this->name = $name;
}
/**
* Sets the scalar type.
*
* @param string|Identifier $type
*
* @return $this
*/
public function setScalarType($scalarType) {
$this->scalarType = BuilderHelpers::normalizeType($scalarType);
return $this;
}
/**
* Implements one or more interfaces.
*
* @param Name|string ...$interfaces Names of interfaces to implement
*
* @return $this The builder instance (for fluid interface)
*/
public function implement(...$interfaces) {
foreach ($interfaces as $interface) {
$this->implements[] = BuilderHelpers::normalizeName($interface);
}
return $this;
}
/**
* Adds a statement.
*
* @param Stmt|PhpParser\Builder $stmt The statement to add
*
* @return $this The builder instance (for fluid interface)
*/
public function addStmt($stmt) {
$stmt = BuilderHelpers::normalizeNode($stmt);
$targets = [
Stmt\TraitUse::class => &$this->uses,
Stmt\EnumCase::class => &$this->enumCases,
Stmt\ClassConst::class => &$this->constants,
Stmt\ClassMethod::class => &$this->methods,
];
$class = \get_class($stmt);
if (!isset($targets[$class])) {
throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType()));
}
$targets[$class][] = $stmt;
return $this;
}
/**
* Adds an attribute group.
*
* @param Node\Attribute|Node\AttributeGroup $attribute
*
* @return $this The builder instance (for fluid interface)
*/
public function addAttribute($attribute) {
$this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
return $this;
}
/**
* Returns the built class node.
*
* @return Stmt\Enum_ The built enum node
*/
public function getNode() : PhpParser\Node {
return new Stmt\Enum_($this->name, [
'scalarType' => $this->scalarType,
'implements' => $this->implements,
'stmts' => array_merge($this->uses, $this->enumCases, $this->constants, $this->methods),
'attrGroups' => $this->attributeGroups,
], $this->attributes);
}
}

View File

@@ -71,6 +71,17 @@ class BuilderFactory
return new Builder\Trait_($name);
}
/**
* Creates an enum builder.
*
* @param string $name Name of the enum
*
* @return Builder\Enum_ The created enum builder
*/
public function enum(string $name) : Builder\Enum_ {
return new Builder\Enum_($name);
}
/**
* Creates a trait use builder.
*
@@ -188,6 +199,17 @@ class BuilderFactory
return new Builder\ClassConst($name, $value);
}
/**
* Creates an enum case builder.
*
* @param string|Identifier $name Name
*
* @return Builder\EnumCase The created use const builder
*/
public function enumCase($name) : Builder\EnumCase {
return new Builder\EnumCase($name);
}
/**
* Creates node a for a literal value.
*
@@ -311,7 +333,7 @@ class BuilderFactory
public function constFetch($name) : Expr\ConstFetch {
return new Expr\ConstFetch(BuilderHelpers::normalizeName($name));
}
/**
* Creates a property fetch node.
*

View File

@@ -2,6 +2,7 @@
namespace PhpParser;
use function array_merge;
use PhpParser\Node\Expr;
use PhpParser\Node\Scalar;
@@ -150,6 +151,8 @@ class ConstExprEvaluator
foreach ($expr->items as $item) {
if (null !== $item->key) {
$array[$this->evaluate($item->key)] = $this->evaluate($item->value);
} elseif ($item->unpack) {
$array = array_merge($array, $this->evaluate($item->value));
} else {
$array[] = $this->evaluate($item->value);
}

View File

@@ -37,7 +37,7 @@ class Emulative extends Lexer
/**
* @param mixed[] $options Lexer options. In addition to the usual options,
* accepts a 'phpVersion' string that specifies the
* version to emulated. Defaults to newest supported.
* version to emulate. Defaults to newest supported.
*/
public function __construct(array $options = [])
{

View File

@@ -4,9 +4,6 @@ namespace PhpParser\Node;
use PhpParser\NodeAbstract;
/**
* @property Name $namespacedName Namespaced name (for global constants, if using NameResolver)
*/
class Const_ extends NodeAbstract
{
/** @var Identifier Name */
@@ -14,6 +11,9 @@ class Const_ extends NodeAbstract
/** @var Expr Value */
public $value;
/** @var Name Namespaced name (if using NameResolver) */
public $namespacedName;
/**
* Constructs a const node for use in class const and const statements.
*

View File

@@ -42,7 +42,7 @@ class ArrowFunction extends Expr implements FunctionLike
$this->params = $subNodes['params'] ?? [];
$returnType = $subNodes['returnType'] ?? null;
$this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
$this->expr = $subNodes['expr'] ?? null;
$this->expr = $subNodes['expr'];
$this->attrGroups = $subNodes['attrGroups'] ?? [];
}

View File

@@ -5,23 +5,24 @@ namespace PhpParser\Node\Expr;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
use PhpParser\Node\VariadicPlaceholder;
class NullsafeMethodCall extends Expr
class NullsafeMethodCall extends CallLike
{
/** @var Expr Variable holding object */
public $var;
/** @var Identifier|Expr Method name */
public $name;
/** @var Arg[] Arguments */
/** @var array<Arg|VariadicPlaceholder> Arguments */
public $args;
/**
* Constructs a nullsafe method call node.
*
* @param Expr $var Variable holding object
* @param string|Identifier|Expr $name Method name
* @param Arg[] $args Arguments
* @param array $attributes Additional attributes
* @param Expr $var Variable holding object
* @param string|Identifier|Expr $name Method name
* @param array<Arg|VariadicPlaceholder> $args Arguments
* @param array $attributes Additional attributes
*/
public function __construct(Expr $var, $name, array $args = [], array $attributes = []) {
$this->attributes = $attributes;
@@ -37,4 +38,8 @@ class NullsafeMethodCall extends Expr
public function getType() : string {
return 'Expr_NullsafeMethodCall';
}
public function getRawArgs(): array {
return $this->args;
}
}

View File

@@ -4,9 +4,6 @@ namespace PhpParser\Node\Stmt;
use PhpParser\Node;
/**
* @property Node\Name $namespacedName Namespaced name (if using NameResolver)
*/
abstract class ClassLike extends Node\Stmt
{
/** @var Node\Identifier|null Name */
@@ -16,6 +13,9 @@ abstract class ClassLike extends Node\Stmt
/** @var Node\AttributeGroup[] PHP attribute groups */
public $attrGroups;
/** @var Node\Name Namespaced name (if using NameResolver) */
public $namespacedName;
/**
* @return TraitUse[]
*/

View File

@@ -5,9 +5,6 @@ namespace PhpParser\Node\Stmt;
use PhpParser\Node;
use PhpParser\Node\FunctionLike;
/**
* @property Node\Name $namespacedName Namespaced name (if using NameResolver)
*/
class Function_ extends Node\Stmt implements FunctionLike
{
/** @var bool Whether function returns by reference */
@@ -23,6 +20,9 @@ class Function_ extends Node\Stmt implements FunctionLike
/** @var Node\AttributeGroup[] PHP attribute groups */
public $attrGroups;
/** @var Node\Name Namespaced name (if using NameResolver) */
public $namespacedName;
/**
* Constructs a function node.
*

View File

@@ -19,14 +19,14 @@ class Php7 extends \PhpParser\ParserAbstract
{
protected $tokenToSymbolMapSize = 396;
protected $actionTableSize = 1196;
protected $gotoTableSize = 585;
protected $gotoTableSize = 545;
protected $invalidSymbol = 168;
protected $errorSymbol = 1;
protected $defaultAction = -32766;
protected $unexpectedTokenRule = 32767;
protected $YY2TBLSTATE = 419;
protected $YY2TBLSTATE = 420;
protected $numNonLeafStates = 710;
protected $symbolToName = array(
@@ -244,125 +244,125 @@ class Php7 extends \PhpParser\ParserAbstract
);
protected $action = array(
131, 132, 133, 569, 134, 135, 0, 722, 723, 724,
136, 36, 834, 911, 835, 468,-32766,-32766,-32766,-32767,
-32767,-32767,-32767, 100, 101, 102, 103, 104, 1068, 1069,
132, 133, 134, 569, 135, 136, 0, 722, 723, 724,
137, 37, 834, 911, 835, 469,-32766,-32766,-32766,-32767,
-32767,-32767,-32767, 101, 102, 103, 104, 105, 1068, 1069,
1070, 1067, 1066, 1065, 1071, 716, 715,-32766,-32766,-32766,
-32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767,
-32767, 545, 546,-32766,-32766, 725,-32766,-32766,-32766, 998,
999, 806, 922, 446, 447, 448, 369, 370, 2, 266,
137, 395, 729, 730, 731, 732, 413,-32766, 419,-32766,
999, 806, 922, 447, 448, 449, 370, 371, 2, 267,
138, 396, 729, 730, 731, 732, 414,-32766, 420,-32766,
-32766,-32766,-32766,-32766, 990, 733, 734, 735, 736, 737,
738, 739, 740, 741, 742, 743, 763, 570, 764, 765,
766, 767, 755, 756, 335, 336, 758, 759, 744, 745,
746, 748, 749, 750, 345, 790, 791, 792, 793, 794,
766, 767, 755, 756, 336, 337, 758, 759, 744, 745,
746, 748, 749, 750, 346, 790, 791, 792, 793, 794,
795, 751, 752, 571, 572, 784, 775, 773, 774, 787,
770, 771, 282, 419, 573, 574, 769, 575, 576, 577,
578, 579, 580, 598, -575, 469, 491, 798, 772, 581,
582, -575, 138,-32766,-32766,-32766, 131, 132, 133, 569,
134, 135, 1017, 722, 723, 724, 136, 36, 1060,-32766,
770, 771, 283, 420, 573, 574, 769, 575, 576, 577,
578, 579, 580, 598, -575, 470, 14, 798, 772, 581,
582, -575, 139,-32766,-32766,-32766, 132, 133, 134, 569,
135, 136, 1017, 722, 723, 724, 137, 37, 1060,-32766,
-32766,-32766, 1303, 696,-32766, 1304,-32766,-32766,-32766,-32766,
-32766,-32766,-32766, 1068, 1069, 1070, 1067, 1066, 1065, 1071,
-32766, 716, 715, 371, 370, 1258,-32766,-32766,-32766, -572,
105, 106, 107, 413, 269, 891, -572, 239, 1193, 1192,
1194, 725,-32766,-32766,-32766, 1046, 108,-32766,-32766,-32766,
-32766, 986, 985, 984, 987, 266, 137, 395, 729, 730,
731, 732, 12,-32766, 419,-32766,-32766,-32766,-32766, 998,
-32766, 716, 715, 372, 371, 1258,-32766,-32766,-32766, -572,
106, 107, 108, 414, 270, 891, -572, 240, 1193, 1192,
1194, 725,-32766,-32766,-32766, 1046, 109,-32766,-32766,-32766,
-32766, 986, 985, 984, 987, 267, 138, 396, 729, 730,
731, 732, 12,-32766, 420,-32766,-32766,-32766,-32766, 998,
999, 733, 734, 735, 736, 737, 738, 739, 740, 741,
742, 743, 763, 570, 764, 765, 766, 767, 755, 756,
335, 336, 758, 759, 744, 745, 746, 748, 749, 750,
345, 790, 791, 792, 793, 794, 795, 751, 752, 571,
572, 784, 775, 773, 774, 787, 770, 771, 881, 320,
336, 337, 758, 759, 744, 745, 746, 748, 749, 750,
346, 790, 791, 792, 793, 794, 795, 751, 752, 571,
572, 784, 775, 773, 774, 787, 770, 771, 881, 321,
573, 574, 769, 575, 576, 577, 578, 579, 580,-32766,
81, 82, 83, -575, 772, 581, 582, -575, 147, 747,
82, 83, 84, -575, 772, 581, 582, -575, 148, 747,
717, 718, 719, 720, 721, 1278, 722, 723, 724, 760,
761, 35, 1277, 84, 85, 86, 87, 88, 89, 90,
91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
101, 102, 103, 104, 105, 106, 107, 996, 269, 149,
-32766,-32766,-32766, 454, 455, 80, 33, -264, -572, 1016,
108, 319, -572, 893, 725, 682, 803, 127, 998, 999,
592,-32766, 1044,-32766,-32766,-32766, 809, 150, 726, 727,
728, 729, 730, 731, 732, -88, 1198, 796, 277, -526,
282,-32766,-32766,-32766, 733, 734, 735, 736, 737, 738,
761, 36, 1277, 85, 86, 87, 88, 89, 90, 91,
92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
102, 103, 104, 105, 106, 107, 108, 996, 270, 150,
-32766,-32766,-32766, 455, 456, 81, 34, -264, -572, 1016,
109, 320, -572, 893, 725, 682, 803, 128, 998, 999,
592,-32766, 1044,-32766,-32766,-32766, 809, 151, 726, 727,
728, 729, 730, 731, 732, -88, 1198, 796, 278, -526,
283,-32766,-32766,-32766, 733, 734, 735, 736, 737, 738,
739, 740, 741, 742, 743, 763, 786, 764, 765, 766,
767, 755, 756, 757, 785, 758, 759, 744, 745, 746,
748, 749, 750, 789, 790, 791, 792, 793, 794, 795,
751, 752, 753, 754, 784, 775, 773, 774, 787, 770,
771, 143, 804, 762, 768, 769, 776, 777, 779, 778,
771, 144, 804, 762, 768, 769, 776, 777, 779, 778,
780, 781, -314, -526, -526, -193, -192, 772, 783, 782,
48, 49, 50, 500, 51, 52, 238, 807, -526, -86,
53, 54, -111, 55, 996, 252,-32766, -111, 800, -111,
-526, 541, -532, -352, 299, -352, 303, -111, -111, -111,
-111, -111, -111, -111, -111, 998, 999, 998, 999, 152,
-32766,-32766,-32766, 1191, 807, 125, 305, 1293, 56, 57,
102, 103, 104, -111, 58, 1218, 59, 245, 246, 60,
61, 62, 63, 64, 65, 66, 67, -525, 26, 267,
68, 435, 501, -328, 808, -86, 1224, 1225, 502, 1189,
807, 1198, 1230, 292, 1222, 40, 23, 503, 73, 504,
953, 505, 319, 506, 802, 153, 507, 508, 278, 684,
279, 42, 43, 436, 366, 365, 891, 44, 509, 34,
248, -16, -566, 357, 331, 317, -566, 1198, 1193, 1192,
1194, -527, 510, 511, 512, 332, -524, 1274, 47, 716,
715, -525, -525, 333, 513, 514, 807, 1212, 1213, 1214,
1215, 1209, 1210, 291, 359, 283, -525, 284, -314, 1216,
1211, -193, -192, 1193, 1192, 1194, 292, 891, -525, 363,
-531, 69, 807, 315, 316, 319, 30, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
-153, -153, -153, 638, 24, -527, -527, 687, 378, 881,
-524, -524, 295, 296, 891, -153, 431, -153, 807, -153,
-527, -153, 716, 715, 432, -524, 798, 362, -111, 1105,
1107, 364, -527, 433, 891, 139, 434, -524, 954, 126,
-524, 319, -111, -111, 688, 813, 380, -529, 11, 834,
154, 835, 867, -111, -111, -111, -111, 46, 292,-32766,
881, 654, 655, 73, 689, 1191, 1045, 319, 708, 148,
398, 156,-32766,-32766,-32766, 31,-32766, -79,-32766, 122,
49, 50, 51, 500, 52, 53, 239, 807, -526, -86,
54, 55, -111, 56, 996, 253,-32766, -111, 800, -111,
-526, 541, -532, -352, 300, -352, 304, -111, -111, -111,
-111, -111, -111, -111, -111, 998, 999, 998, 999, 153,
-32766,-32766,-32766, 1191, 807, 126, 306, 1293, 57, 58,
103, 104, 105, -111, 59, 1218, 60, 246, 247, 61,
62, 63, 64, 65, 66, 67, 68, -525, 27, 268,
69, 436, 501, -328, 808, -86, 1224, 1225, 502, 1189,
807, 1198, 1230, 293, 1222, 41, 24, 503, 74, 504,
953, 505, 320, 506, 802, 154, 507, 508, 279, 684,
280, 43, 44, 437, 367, 366, 891, 45, 509, 35,
249, -16, -566, 358, 332, 318, -566, 1198, 1193, 1192,
1194, -527, 510, 511, 512, 333, -524, 1274, 48, 716,
715, -525, -525, 334, 513, 514, 807, 1212, 1213, 1214,
1215, 1209, 1210, 292, 360, 284, -525, 285, -314, 1216,
1211, -193, -192, 1193, 1192, 1194, 293, 891, -525, 364,
-531, 70, 807, 316, 317, 320, 31, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
-153, -153, -153, 638, 25, -527, -527, 687, 379, 881,
-524, -524, 296, 297, 891, -153, 432, -153, 807, -153,
-527, -153, 716, 715, 433, -524, 798, 363, -111, 1105,
1107, 365, -527, 434, 891, 140, 435, -524, 954, 127,
-524, 320, -111, -111, 688, 813, 381, -529, 11, 834,
155, 835, 867, -111, -111, -111, -111, 47, 293,-32766,
881, 654, 655, 74, 689, 1191, 1045, 320, 708, 149,
399, 157,-32766,-32766,-32766, 32,-32766, -79,-32766, 123,
-32766, 716, 715,-32766, 893, 891, 682, -153,-32766,-32766,
-32766, 716, 715, 891,-32766,-32766, 123, 881, 128, 73,
-32766, 410, 129, 319, -524, -524, 142, 140, -75,-32766,
157, -529, -529, 319, 26, 691, 158, 881, 159, -524,
160, 293, 294, 698, 367, 368, 807, -73,-32766, -72,
1222, -524, 372, 373, 1191, 893, -71, 682, -529, 72,
-70,-32766,-32766,-32766, -69,-32766, -68,-32766, 124,-32766,
-32766, 716, 715, 891,-32766,-32766, 124, 881, 129, 74,
-32766, 411, 130, 320, -524, -524, 143, 141, -75,-32766,
158, -529, -529, 320, 27, 691, 159, 881, 160, -524,
161, 294, 295, 698, 368, 369, 807, -73,-32766, -72,
1222, -524, 373, 374, 1191, 893, -71, 682, -529, 73,
-70,-32766,-32766,-32766, -69,-32766, -68,-32766, 125,-32766,
630, 631,-32766, -67, -66, -47, -51,-32766,-32766,-32766,
-18, 146, 270,-32766,-32766, 276, 697, 700, 881,-32766,
410, 890, 893, 145, 682, 281, 881, 907,-32766, 280,
513, 514, 285, 1212, 1213, 1214, 1215, 1209, 1210, 325,
130, 144, 939, 286, 682, 1216, 1211, 108, 269,-32766,
798, 807,-32766, 662, 639, 1191, 657, 71, 675, 1075,
316, 319,-32766,-32766,-32766, 1305,-32766, 300,-32766, 628,
-32766, 430, 543,-32766,-32766, 923, 555, 924,-32766,-32766,
-18, 147, 271,-32766,-32766, 277, 697, 700, 881,-32766,
411, 890, 893, 146, 682, 282, 881, 907,-32766, 281,
513, 514, 286, 1212, 1213, 1214, 1215, 1209, 1210, 326,
131, 145, 939, 287, 682, 1216, 1211, 109, 270,-32766,
798, 807,-32766, 662, 639, 1191, 657, 72, 675, 1075,
317, 320,-32766,-32766,-32766, 1305,-32766, 301,-32766, 628,
-32766, 431, 543,-32766,-32766, 923, 555, 924,-32766,-32766,
-32766, 1229, 549,-32766,-32766,-32766, -4, 891, -490, 1191,
-32766, 410, 644, 893, 298, 682,-32766,-32766,-32766,-32766,
-32766, 893,-32766, 682,-32766, 13, 1231,-32766, 451, 479,
-32766, 411, 644, 893, 299, 682,-32766,-32766,-32766,-32766,
-32766, 893,-32766, 682,-32766, 13, 1231,-32766, 452, 480,
645, 909,-32766,-32766,-32766,-32766, 658, -480,-32766,-32766,
0, 1191, 0, 0,-32766, 410, 0, 297,-32766,-32766,
-32766, 304,-32766,-32766,-32766, 0,-32766, 0, 806,-32766,
0, 0, 0, 474,-32766,-32766,-32766,-32766, 0, 7,
-32766,-32766, 15, 1191, 561, 596,-32766, 410, 1219, 891,
-32766,-32766,-32766, 361,-32766,-32766,-32766, 818,-32766, -267,
881,-32766, 38, 292, 0, 0,-32766,-32766,-32766, 39,
705, 706,-32766,-32766, 872, 963, 940, 947,-32766, 410,
937, 948, 364, 870, 426, 891, 935,-32766, 1049, 290,
0, 1191, 0, 0,-32766, 411, 0, 298,-32766,-32766,
-32766, 305,-32766,-32766,-32766, 0,-32766, 0, 806,-32766,
0, 0, 0, 475,-32766,-32766,-32766,-32766, 0, 7,
-32766,-32766, 16, 1191, 561, 596,-32766, 411, 1219, 891,
-32766,-32766,-32766, 362,-32766,-32766,-32766, 818,-32766, -267,
881,-32766, 39, 293, 0, 0,-32766,-32766,-32766, 40,
705, 706,-32766,-32766, 872, 963, 940, 947,-32766, 411,
937, 948, 365, 870, 427, 891, 935,-32766, 1049, 291,
1244, 1052, 1053, -111, -111, 1050, 1051, 1057, -560, 1262,
1296, 633, 0, 826, -111, -111, -111, -111, 32, 314,
-32766, 360, 683, 686, 690, 692, 1191, 693, 694, 695,
699, 685, 319,-32766,-32766,-32766, 9,-32766, 702,-32766,
1296, 633, 0, 826, -111, -111, -111, -111, 33, 315,
-32766, 361, 683, 686, 690, 692, 1191, 693, 694, 695,
699, 685, 320,-32766,-32766,-32766, 9,-32766, 702,-32766,
868,-32766, 881, 1300,-32766, 893, 1302, 682, -4,-32766,
-32766,-32766, 829, 828, 837,-32766,-32766, 916, -242, -242,
-242,-32766, 410, 955, 364, 26, 836, 1301, 915, 917,
-242,-32766, 411, 955, 365, 27, 836, 1301, 915, 917,
-32766, 914, 1177, 900, 910, -111, -111, 807, 881, 898,
945, 1222, 946, 1299, 1256, 867, -111, -111, -111, -111,
1245, 1263, 1269, 1272, -241, -241, -241, -558, -532, -531,
364, -530, 1, 27, 28, 37, 41, 45, 70, 0,
74, -111, -111, 75, 76, 77, 78, 893, 79, 682,
-242, 867, -111, -111, -111, -111, 141, 151, 155, 244,
321, 346, 514, 347, 1212, 1213, 1214, 1215, 1209, 1210,
348, 349, 350, 351, 352, 353, 1216, 1211, 354, 355,
356, 358, 427, 893, -265, 682, -241, -264, 71, 0,
17, 316, 319, 18, 19, 20, 22, 397, 470, 471,
478, 481, 482, 483, 484, 488, 489, 490, 498, 669,
1202, 1145, 1220, 1019, 1018, 1181, -269, -103, 16, 21,
25, 289, 396, 589, 593, 620, 674, 1149, 1197, 1146,
365, -530, 1, 28, 29, 38, 42, 46, 71, 0,
75, -111, -111, 76, 77, 78, 79, 893, 80, 682,
-242, 867, -111, -111, -111, -111, 142, 152, 156, 245,
322, 347, 514, 348, 1212, 1213, 1214, 1215, 1209, 1210,
349, 350, 351, 352, 353, 354, 1216, 1211, 355, 356,
357, 359, 428, 893, -265, 682, -241, -264, 72, 0,
18, 317, 320, 19, 20, 21, 23, 398, 471, 472,
479, 482, 483, 484, 485, 489, 490, 491, 498, 669,
1202, 1145, 1220, 1019, 1018, 1181, -269, -103, 17, 22,
26, 290, 397, 589, 593, 620, 674, 1149, 1197, 1146,
1275, 0, -494, 1162, 0, 1223
);
@@ -491,9 +491,9 @@ class Php7 extends \PhpParser\ParserAbstract
protected $actionBase = array(
0, -2, 154, 565, 876, 948, 984, 514, 53, 398,
837, 307, 307, 67, 307, 307, 653, 724, 724, 732,
724, 616, 673, 204, 204, 204, 625, 625, 625, 625,
694, 694, 831, 831, 863, 799, 765, 936, 936, 936,
837, 307, 307, 67, 307, 307, 307, 653, 724, 724,
732, 724, 616, 673, 204, 204, 204, 625, 625, 625,
625, 694, 694, 831, 831, 863, 799, 765, 936, 936,
936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
@@ -506,40 +506,40 @@ class Php7 extends \PhpParser\ParserAbstract
936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
936, 375, 519, 369, 701, 1017, 1023, 1019, 1024, 1015,
1014, 1018, 1020, 1025, 911, 912, 782, 918, 919, 920,
921, 1021, 841, 1016, 1022, 291, 291, 291, 291, 291,
936, 936, 375, 519, 369, 701, 1017, 1023, 1019, 1024,
1015, 1014, 1018, 1020, 1025, 911, 912, 782, 918, 919,
920, 921, 1021, 841, 1016, 1022, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 290, 491, 44, 382, 382, 382, 382, 382, 382,
291, 291, 290, 491, 44, 382, 382, 382, 382, 382,
382, 382, 382, 382, 382, 382, 382, 382, 382, 382,
382, 382, 382, 382, 160, 160, 160, 187, 684, 684,
341, 203, 610, 47, 985, 985, 985, 985, 985, 985,
985, 985, 985, 985, 144, 144, 7, 7, 7, 7,
7, 371, -25, -25, -25, -25, 540, 385, 102, 576,
358, 45, 377, 460, 460, 360, 231, 231, 231, 231,
231, 231, -78, -78, -78, -78, -78, -66, 319, 457,
-94, 396, 423, 586, 586, 586, 586, 423, 423, 423,
423, 750, 1029, 423, 423, 423, 511, 516, 516, 518,
147, 147, 147, 516, 583, 777, 422, 583, 422, 194,
92, 748, -40, 87, 412, 748, 617, 627, 198, 143,
773, 658, 773, 1013, 757, 764, 717, 838, 860, 1026,
800, 908, 806, 910, 219, 686, 1012, 1012, 1012, 1012,
1012, 1012, 1012, 1012, 1012, 1012, 1012, 855, 552, 1013,
286, 855, 855, 855, 552, 552, 552, 552, 552, 552,
552, 552, 552, 552, 679, 286, 568, 626, 286, 794,
552, 375, 758, 375, 375, 375, 375, 958, 375, 375,
375, 375, 375, 375, 970, 769, -16, 375, 519, 12,
12, 547, 83, 12, 12, 12, 12, 375, 375, 375,
658, 781, 713, 666, 792, 448, 781, 781, 781, 438,
444, 193, 447, 570, 523, 580, 760, 760, 767, 929,
929, 760, 759, 760, 767, 934, 760, 929, 805, 359,
648, 577, 611, 656, 929, 478, 760, 760, 760, 760,
665, 760, 467, 433, 760, 760, 785, 774, 789, 60,
929, 929, 929, 789, 596, 751, 751, 751, 811, 812,
746, 771, 567, 498, 677, 348, 779, 771, 771, 760,
640, 746, 771, 746, 771, 747, 771, 771, 771, 746,
771, 760, 759, 585, 771, 734, 668, 224, 771, 6,
382, 382, 382, 382, 382, 160, 160, 160, 187, 684,
684, 341, 203, 610, 47, 985, 985, 985, 985, 985,
985, 985, 985, 985, 985, 144, 144, 7, 7, 7,
7, 7, 371, -25, -25, -25, -25, 540, 385, 102,
576, 358, 45, 377, 460, 460, 360, 231, 231, 231,
231, 231, 231, -78, -78, -78, -78, -78, -66, 319,
457, -94, 396, 423, 586, 586, 586, 586, 423, 423,
423, 423, 750, 1029, 423, 423, 423, 511, 516, 516,
518, 147, 147, 147, 516, 583, 777, 422, 583, 422,
194, 92, 748, -40, 87, 412, 748, 617, 627, 198,
143, 773, 658, 773, 1013, 757, 764, 717, 838, 860,
1026, 800, 908, 806, 910, 219, 686, 1012, 1012, 1012,
1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 855, 552,
1013, 286, 855, 855, 855, 552, 552, 552, 552, 552,
552, 552, 552, 552, 552, 679, 286, 568, 626, 286,
794, 552, 375, 758, 375, 375, 375, 375, 958, 375,
375, 375, 375, 375, 375, 970, 769, -16, 375, 519,
12, 12, 547, 83, 12, 12, 12, 12, 375, 375,
375, 658, 781, 713, 666, 792, 448, 781, 781, 781,
438, 444, 193, 447, 570, 523, 580, 760, 760, 767,
929, 929, 760, 759, 760, 767, 934, 760, 929, 805,
359, 648, 577, 611, 656, 929, 478, 760, 760, 760,
760, 665, 760, 467, 433, 760, 760, 785, 774, 789,
60, 929, 929, 929, 789, 596, 751, 751, 751, 811,
812, 746, 771, 567, 498, 677, 348, 779, 771, 771,
760, 640, 746, 771, 746, 771, 747, 771, 771, 771,
746, 771, 759, 585, 771, 734, 668, 224, 771, 6,
935, 937, 354, 940, 932, 941, 979, 942, 943, 851,
956, 933, 945, 931, 930, 780, 703, 720, 790, 729,
928, 768, 768, 768, 925, 768, 768, 768, 768, 768,
@@ -562,7 +562,7 @@ class Php7 extends \PhpParser\ParserAbstract
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 458, 458, 458, 458, 458, 458, 307, 307, 307,
307, 0, 0, 307, 0, 0, 458, 458, 458, 458,
307, 0, 0, 307, 0, 0, 0, 458, 458, 458,
458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
@@ -577,85 +577,85 @@ class Php7 extends \PhpParser\ParserAbstract
458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
458, 291, 291, 291, 291, 291, 291, 291, 291, 291,
458, 458, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 0, 0, 0, 0, 0,
291, 291, 291, 291, 291, 291, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 291, 291, 291, 291, 291, 291, 291, 291, 291,
0, 0, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 423, 423,
291, 291, 0, 291, 423, 423, 423, 423, 423, 423,
423, 423, 423, 423, 291, 291, 291, 291, 291, 291,
291, 805, 147, 147, 147, 147, 423, 423, 423, 423,
423, -88, -88, 147, 147, 423, 423, 423, 423, 423,
423, 423, 423, 423, 423, 423, 423, 0, 0, 0,
286, 422, 0, 759, 759, 759, 759, 0, 0, 0,
0, 422, 422, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 286, 422, 0, 286, 0, 759,
759, 423, 805, 805, 314, 423, 0, 0, 0, 0,
286, 759, 286, 552, 422, 552, 552, 12, 375, 314,
608, 608, 608, 608, 0, 658, 805, 805, 805, 805,
805, 805, 805, 805, 805, 805, 805, 759, 0, 805,
0, 759, 759, 759, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 759,
0, 0, 929, 0, 0, 0, 0, 760, 0, 0,
0, 0, 0, 0, 760, 934, 0, 0, 0, 0,
0, 0, 759, 0, 0, 0, 0, 0, 0, 0,
0, 768, 801, 0, 801, 0, 768, 768, 768
291, 291, 291, 291, 291, 291, 291, 291, 291, 423,
423, 291, 291, 0, 291, 423, 423, 423, 423, 423,
423, 423, 423, 423, 423, 291, 291, 291, 291, 291,
291, 291, 805, 147, 147, 147, 147, 423, 423, 423,
423, 423, -88, -88, 147, 147, 423, 423, 423, 423,
423, 423, 423, 423, 423, 423, 423, 423, 0, 0,
0, 286, 422, 0, 759, 759, 759, 759, 0, 0,
0, 0, 422, 422, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 286, 422, 0, 286, 0,
759, 759, 423, 805, 805, 314, 423, 0, 0, 0,
0, 286, 759, 286, 552, 422, 552, 552, 12, 375,
314, 608, 608, 608, 608, 0, 658, 805, 805, 805,
805, 805, 805, 805, 805, 805, 805, 805, 759, 0,
805, 0, 759, 759, 759, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
759, 0, 0, 929, 0, 0, 0, 0, 760, 0,
0, 0, 0, 0, 0, 760, 934, 0, 0, 0,
0, 0, 0, 759, 0, 0, 0, 0, 0, 0,
0, 0, 768, 801, 0, 801, 0, 768, 768, 768
);
protected $actionDefault = array(
3,32767, 103,32767,32767,32767,32767,32767,32767,32767,
32767,32767, 101,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767, 578, 578, 578, 578,
32767,32767, 246, 103,32767,32767, 454, 372, 372, 372,
32767,32767, 522, 522, 522, 522, 522, 522,32767,32767,
32767,32767,32767,32767, 454,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767, 578, 578, 578,
578,32767,32767, 246, 103,32767,32767, 454, 372, 372,
372,32767,32767, 522, 522, 522, 522, 522, 522,32767,
32767,32767,32767,32767,32767, 454,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767, 101,32767,32767,
32767, 37, 7, 8, 10, 11, 50, 17, 310,32767,
32767,32767,32767, 103,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767, 101,32767,
32767,32767, 37, 7, 8, 10, 11, 50, 17, 310,
32767,32767,32767,32767, 103,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767, 571,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767, 571,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767, 458, 437, 438, 440, 441,
371, 523, 577, 313, 574, 370, 146, 325, 315, 234,
316, 250, 459, 251, 460, 463, 464, 211, 279, 367,
150, 401, 455, 403, 453, 457, 402, 377, 382, 383,
384, 385, 386, 387, 388, 389, 390, 391, 392, 393,
394, 375, 376, 456, 434, 433, 432, 399,32767,32767,
400, 404, 374, 407,32767,32767,32767,32767,32767,32767,
32767,32767, 103,32767, 405, 406, 423, 424, 421, 422,
425,32767, 426, 427, 428, 429,32767,32767, 302,32767,
32767, 351, 349, 414, 415, 302,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767, 516, 431,
32767,32767,32767,32767,32767,32767, 458, 437, 438, 440,
441, 371, 523, 577, 313, 574, 370, 146, 325, 315,
234, 316, 250, 459, 251, 460, 463, 464, 211, 279,
367, 150, 401, 455, 403, 453, 457, 402, 377, 382,
383, 384, 385, 386, 387, 388, 389, 390, 391, 392,
393, 394, 375, 376, 456, 434, 433, 432, 399,32767,
32767, 400, 404, 374, 407,32767,32767,32767,32767,32767,
32767,32767,32767, 103,32767, 405, 406, 423, 424, 421,
422, 425,32767, 426, 427, 428, 429,32767,32767, 302,
32767,32767, 351, 349, 414, 415, 302,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767, 516,
431,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767, 103,32767, 101, 518, 396, 398,
486, 409, 410, 408, 378,32767, 493,32767, 103, 495,
32767,32767,32767, 112,32767,32767,32767, 517,32767, 524,
524,32767, 479, 101, 194,32767, 194, 194,32767,32767,
32767,32767,32767,32767,32767, 585, 479, 111, 111, 111,
111, 111, 111, 111, 111, 111, 111, 111,32767, 194,
111,32767,32767,32767, 101, 194, 194, 194, 194, 194,
194, 194, 194, 194, 194, 189,32767, 260, 262, 103,
539, 194,32767, 498,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767, 491,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767, 103,32767, 101, 518, 396, 398, 486,
409, 410, 408, 378,32767, 493,32767, 103, 495,32767,
32767,32767, 112,32767,32767,32767, 517,32767, 524, 524,
32767, 479, 101, 194,32767, 194, 194,32767,32767,32767,
32767,32767,32767,32767, 585, 479, 111, 111, 111, 111,
111, 111, 111, 111, 111, 111, 111,32767, 194, 111,
32767,32767,32767, 101, 194, 194, 194, 194, 194, 194,
194, 194, 194, 194, 189,32767, 260, 262, 103, 539,
194,32767, 498,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767, 491,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
479, 419, 139,32767, 139, 524, 411, 412, 413, 481,
524, 524, 524, 298, 281,32767,32767,32767,32767, 496,
496, 101, 101, 101, 101, 491,32767,32767, 112, 100,
100, 100, 100, 100, 104, 102,32767,32767,32767,32767,
100,32767, 102, 102,32767,32767, 217, 208, 215, 102,
32767, 543, 544, 215, 102, 219, 219, 219, 239, 239,
470, 304, 102, 100, 102, 102, 196, 304, 304,32767,
102, 470, 304, 470, 304, 198, 304, 304, 304, 470,
304,32767,32767, 102, 304, 210, 100, 100, 304,32767,
32767, 479, 419, 139,32767, 139, 524, 411, 412, 413,
481, 524, 524, 524, 298, 281,32767,32767,32767,32767,
496, 496, 101, 101, 101, 101, 491,32767,32767, 112,
100, 100, 100, 100, 100, 104, 102,32767,32767,32767,
32767, 100,32767, 102, 102,32767,32767, 217, 208, 215,
102,32767, 543, 544, 215, 102, 219, 219, 219, 239,
239, 470, 304, 102, 100, 102, 102, 196, 304, 304,
32767, 102, 470, 304, 470, 304, 198, 304, 304, 304,
470, 304,32767, 102, 304, 210, 100, 100, 304,32767,
32767,32767, 481,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767, 511,32767, 528,
541, 417, 418, 420, 526, 442, 443, 444, 445, 446,
@@ -680,71 +680,67 @@ class Php7 extends \PhpParser\ParserAbstract
);
protected $goto = array(
193, 193, 670, 421, 643, 1022, 1290, 1290, 824, 415,
307, 308, 328, 563, 313, 420, 329, 422, 622, 801,
678, 341, 586, 1290, 825, 164, 164, 164, 164, 217,
194, 190, 190, 174, 176, 212, 190, 190, 190, 190,
190, 191, 191, 191, 191, 191, 191, 185, 186, 187,
188, 189, 214, 212, 215, 521, 522, 411, 523, 525,
526, 527, 528, 529, 530, 531, 532, 1091, 165, 166,
167, 192, 168, 169, 170, 163, 171, 172, 173, 175,
211, 213, 216, 234, 237, 240, 241, 243, 254, 255,
256, 257, 258, 259, 260, 262, 263, 264, 265, 273,
274, 310, 311, 312, 416, 417, 418, 568, 218, 219,
194, 194, 670, 422, 643, 463, 1264, 1265, 1022, 416,
308, 309, 329, 563, 314, 421, 330, 423, 622, 801,
678, 637, 586, 651, 652, 653, 165, 165, 165, 165,
218, 195, 191, 191, 175, 177, 213, 191, 191, 191,
191, 191, 192, 192, 192, 192, 192, 192, 186, 187,
188, 189, 190, 215, 213, 216, 521, 522, 412, 523,
525, 526, 527, 528, 529, 530, 531, 532, 1091, 166,
167, 168, 193, 169, 170, 171, 164, 172, 173, 174,
176, 212, 214, 217, 235, 238, 241, 242, 244, 255,
256, 257, 258, 259, 260, 261, 263, 264, 265, 266,
274, 275, 311, 312, 313, 417, 418, 419, 568, 219,
220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
230, 231, 232, 177, 233, 178, 195, 196, 197, 235,
185, 186, 187, 188, 189, 214, 1091, 198, 179, 180,
181, 199, 195, 182, 236, 200, 198, 162, 201, 202,
183, 203, 204, 205, 184, 206, 207, 208, 209, 210,
322, 322, 322, 322, 827, 608, 608, 858, 547, 538,
1186, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221,
1221, 1239, 1239, 462, 1264, 1265, 799, 1239, 1239, 1239,
1239, 1239, 1239, 1239, 1239, 1239, 1239, 387, 538, 547,
556, 557, 394, 566, 588, 602, 603, 832, 938, 880,
875, 876, 889, 14, 833, 877, 830, 878, 879, 831,
453, 453, 884, 883, 885, 1187, 250, 250, 560, 453,
1237, 1237, 815, 1043, 1039, 1040, 1237, 1237, 1237, 1237,
1237, 1237, 1237, 1237, 1237, 1237, 820, 820, 1188, 1247,
1248, 247, 247, 247, 247, 249, 251, 342, 343, 339,
1190, 1190, 997, 1190, 997, 1279, 930, 401, 677, 997,
230, 231, 232, 233, 178, 234, 179, 196, 197, 198,
236, 186, 187, 188, 189, 190, 215, 1091, 199, 180,
181, 182, 200, 196, 183, 237, 201, 199, 163, 202,
203, 184, 204, 205, 206, 185, 207, 208, 209, 210,
211, 323, 323, 323, 323, 827, 608, 608, 824, 547,
538, 342, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221,
1221, 1221, 1239, 1239, 288, 288, 288, 288, 1239, 1239,
1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 388, 538,
547, 556, 557, 395, 566, 588, 602, 603, 832, 825,
880, 875, 876, 889, 15, 833, 877, 830, 878, 879,
831, 799, 251, 251, 883, 919, 992, 1000, 1004, 1001,
1005, 1237, 1237, 938, 1043, 1039, 1040, 1237, 1237, 1237,
1237, 1237, 1237, 1237, 1237, 1237, 1237, 858, 248, 248,
248, 248, 250, 252, 533, 533, 533, 533, 487, 590,
488, 1190, 1190, 997, 1190, 997, 494, 1290, 1290, 560,
997, 997, 997, 997, 997, 997, 997, 997, 997, 997,
997, 1261, 1261, 414, 1261, 597, 1190, 287, 287, 287,
287, 1190, 1190, 1190, 1190, 959, 344, 1190, 1190, 1190,
1271, 1271, 1271, 1271, 606, 640, 344, 344, 1273, 1273,
1273, 1273, 1063, 1064, 637, 896, 651, 652, 653, 897,
344, 344, 383, 344, 486, 1306, 487, 535, 535, 5,
535, 6, 494, 559, 1257, 1140, 540, 524, 524, 344,
318, 302, 642, 524, 524, 524, 524, 524, 524, 524,
524, 524, 524, 444, 1266, 1267, 618, 619, 932, 932,
932, 932, 820, 428, 444, 926, 933, 330, 533, 533,
533, 533, 1030, 590, 817, 554, 1259, 1259, 1030, 704,
621, 623, 845, 641, 1250, 805, 393, 660, 664, 973,
668, 676, 969, 1183, 553, 842, 823, 1289, 1289, 564,
600, 601, 385, 389, 548, 587, 591, 663, 962, 936,
936, 934, 936, 703, 1289, 537, 971, 966, 438, 901,
1079, 981, 1028, 438, 438, 805, 605, 805, 707, 854,
1292, 978, 463, 539, 551, 1074, 467, 540, 539, 844,
551, 646, 957, 386, 1171, 912, 1032, 838, 1172, 1175,
913, 1176, 943, 567, 456, 457, 458, 0, 850, 0,
1182, 1297, 1298, 253, 253, 0, 399, 400, 0, 0,
0, 649, 0, 650, 423, 403, 404, 405, 840, 661,
0, 423, 0, 406, 0, 0, 848, 337, 1009, 1002,
1006, 1003, 1007, 852, 0, 0, 839, 1185, 495, 0,
0, 0, 0, 438, 438, 438, 438, 438, 438, 438,
438, 438, 438, 438, 0, 0, 438, 595, 609, 612,
613, 614, 615, 634, 635, 636, 680, 853, 841, 1027,
1031, 585, 1056, 0, 681, 667, 667, 941, 673, 1054,
0, 0, 0, 0, 0, 271, 0, 0, 0, 0,
536, 536, 919, 992, 1000, 1004, 1001, 1005, 0, 0,
931, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
976, 976, 0, 1072, 857
997, 997, 1261, 1261, 1290, 1261, 340, 1190, 930, 402,
677, 1279, 1190, 1190, 1190, 1190, 959, 345, 1190, 1190,
1190, 1271, 1271, 1271, 1271, 606, 640, 345, 345, 1273,
1273, 1273, 1273, 820, 820, 805, 896, 884, 840, 885,
897, 345, 345, 5, 345, 6, 1306, 384, 535, 535,
559, 535, 415, 852, 597, 1257, 839, 540, 524, 524,
345, 1289, 1289, 642, 524, 524, 524, 524, 524, 524,
524, 524, 524, 524, 445, 805, 1140, 805, 1289, 932,
932, 932, 932, 1063, 1064, 445, 926, 933, 386, 390,
548, 587, 591, 1030, 1292, 331, 554, 1259, 1259, 1030,
704, 621, 623, 823, 641, 1250, 319, 303, 660, 664,
973, 668, 676, 969, 429, 553, 962, 936, 936, 934,
936, 703, 601, 537, 971, 966, 343, 344, 663, 817,
595, 609, 612, 613, 614, 615, 634, 635, 636, 680,
439, 1186, 845, 454, 454, 439, 439, 1266, 1267, 820,
901, 1079, 454, 394, 539, 551, 1183, 605, 540, 539,
842, 551, 978, 272, 387, 618, 619, 981, 536, 536,
844, 707, 646, 957, 567, 457, 458, 459, 838, 850,
254, 254, 1297, 1298, 400, 401, 976, 976, 464, 649,
1182, 650, 1028, 404, 405, 406, 1187, 661, 424, 1032,
407, 564, 600, 815, 338, 424, 854, 848, 853, 841,
1027, 1031, 1009, 1002, 1006, 1003, 1007, 1185, 941, 1188,
1247, 1248, 943, 0, 1074, 439, 439, 439, 439, 439,
439, 439, 439, 439, 439, 439, 0, 468, 439, 585,
1056, 931, 681, 667, 667, 0, 495, 673, 1054, 1171,
912, 0, 0, 1172, 1175, 913, 1176, 0, 0, 0,
0, 0, 0, 1072, 857
);
protected $gotoCheck = array(
42, 42, 72, 65, 65, 119, 173, 173, 26, 65,
42, 42, 72, 65, 65, 166, 166, 166, 119, 65,
65, 65, 65, 65, 65, 65, 65, 65, 65, 7,
9, 93, 122, 173, 27, 42, 42, 42, 42, 42,
9, 84, 122, 84, 84, 84, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
@@ -758,91 +754,87 @@ class Php7 extends \PhpParser\ParserAbstract
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
23, 23, 23, 23, 15, 104, 104, 45, 75, 75,
20, 104, 104, 104, 104, 104, 104, 104, 104, 104,
104, 160, 160, 166, 166, 166, 6, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 15, 49, 15,
15, 15, 15, 75, 15, 15, 15, 15, 15, 15,
141, 141, 64, 15, 64, 20, 5, 5, 162, 141,
161, 161, 20, 15, 15, 15, 161, 161, 161, 161,
161, 161, 161, 161, 161, 161, 22, 22, 20, 20,
20, 5, 5, 5, 5, 5, 5, 93, 93, 169,
72, 72, 72, 72, 72, 171, 89, 89, 89, 72,
42, 23, 23, 23, 23, 15, 104, 104, 26, 75,
75, 93, 104, 104, 104, 104, 104, 104, 104, 104,
104, 104, 160, 160, 24, 24, 24, 24, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 15, 27,
15, 15, 15, 15, 75, 15, 15, 15, 15, 15,
15, 6, 5, 5, 15, 87, 87, 87, 87, 87,
87, 161, 161, 49, 15, 15, 15, 161, 161, 161,
161, 161, 161, 161, 161, 161, 161, 45, 5, 5,
5, 5, 5, 5, 103, 103, 103, 103, 147, 103,
147, 72, 72, 72, 72, 72, 147, 173, 173, 162,
72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
72, 122, 122, 13, 122, 13, 72, 24, 24, 24,
24, 72, 72, 72, 72, 99, 14, 72, 72, 72,
9, 9, 9, 9, 55, 55, 14, 14, 122, 122,
122, 122, 136, 136, 84, 72, 84, 84, 84, 72,
14, 14, 61, 14, 147, 14, 147, 19, 19, 46,
19, 46, 147, 100, 122, 143, 14, 163, 163, 14,
159, 159, 63, 163, 163, 163, 163, 163, 163, 163,
163, 163, 163, 19, 168, 168, 83, 83, 19, 19,
19, 19, 22, 109, 19, 19, 19, 29, 103, 103,
103, 103, 122, 103, 18, 48, 122, 122, 122, 48,
48, 48, 39, 48, 14, 12, 28, 48, 48, 48,
48, 48, 48, 152, 9, 37, 25, 172, 172, 2,
2, 9, 58, 58, 58, 58, 58, 14, 25, 25,
25, 25, 25, 25, 172, 25, 25, 25, 23, 17,
17, 106, 121, 23, 23, 12, 17, 12, 95, 41,
172, 17, 149, 9, 9, 139, 82, 14, 9, 17,
9, 17, 17, 9, 78, 78, 124, 17, 78, 78,
78, 78, 92, 9, 9, 9, 9, -1, 9, -1,
17, 9, 9, 5, 5, -1, 80, 80, -1, -1,
-1, 80, -1, 80, 113, 80, 80, 80, 35, 80,
-1, 113, -1, 80, -1, -1, 9, 80, 113, 113,
113, 113, 113, 35, -1, -1, 35, 14, 9, -1,
-1, -1, -1, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, -1, -1, 23, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 16, 16, 16,
16, 8, 8, -1, 8, 8, 8, 16, 8, 8,
-1, -1, -1, -1, -1, 24, -1, -1, -1, -1,
24, 24, 87, 87, 87, 87, 87, 87, -1, -1,
16, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
103, 103, -1, 16, 16
72, 72, 122, 122, 173, 122, 169, 72, 89, 89,
89, 171, 72, 72, 72, 72, 99, 14, 72, 72,
72, 9, 9, 9, 9, 55, 55, 14, 14, 122,
122, 122, 122, 22, 22, 12, 72, 64, 35, 64,
72, 14, 14, 46, 14, 46, 14, 61, 19, 19,
100, 19, 13, 35, 13, 122, 35, 14, 163, 163,
14, 172, 172, 63, 163, 163, 163, 163, 163, 163,
163, 163, 163, 163, 19, 12, 143, 12, 172, 19,
19, 19, 19, 136, 136, 19, 19, 19, 58, 58,
58, 58, 58, 122, 172, 29, 48, 122, 122, 122,
48, 48, 48, 25, 48, 14, 159, 159, 48, 48,
48, 48, 48, 48, 109, 9, 25, 25, 25, 25,
25, 25, 9, 25, 25, 25, 93, 93, 14, 18,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
23, 20, 39, 141, 141, 23, 23, 168, 168, 22,
17, 17, 141, 28, 9, 9, 152, 17, 14, 9,
37, 9, 17, 24, 9, 83, 83, 106, 24, 24,
17, 95, 17, 17, 9, 9, 9, 9, 17, 9,
5, 5, 9, 9, 80, 80, 103, 103, 149, 80,
17, 80, 121, 80, 80, 80, 20, 80, 113, 124,
80, 2, 2, 20, 80, 113, 41, 9, 16, 16,
16, 16, 113, 113, 113, 113, 113, 14, 16, 20,
20, 20, 92, -1, 139, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, -1, 82, 23, 8,
8, 16, 8, 8, 8, -1, 8, 8, 8, 78,
78, -1, -1, 78, 78, 78, 78, -1, -1, -1,
-1, -1, -1, 16, 16
);
protected $gotoBase = array(
0, 0, -285, 0, 0, 225, 173, 10, 524, 7,
0, 0, 95, -47, 5, -174, 87, -33, 71, 61,
-212, 0, -76, 157, 284, 392, 4, 20, 56, 77,
0, 0, 0, 0, 0, 118, 0, 63, 0, 65,
0, -2, -1, 0, 0, 155, -378, 0, -308, 186,
0, 0, 0, 0, 0, 266, 0, 0, 359, 0,
0, 282, 0, 103, 204, -235, 0, 0, 0, 0,
0, 0, -6, 0, 0, -167, 0, 0, 45, 170,
-11, 0, -27, -110, -376, 0, 0, 276, 0, -32,
0, 0, 19, -448, 0, 30, 0, 0, 0, 262,
292, 0, 0, 342, -73, 0, 62, 0, 0, 88,
0, 0, 0, 206, 0, 0, 0, 0, 0, 3,
0, 59, 15, 0, 14, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 41, 0, 0, 1,
0, 188, 0, 66, 0, 0, 0, -157, 0, 2,
0, 0, 35, 0, 0, 0, 0, 0, 0, 25,
-57, -8, 201, 99, 0, 0, -111, 0, -7, 231,
0, 236, 96, -295, 0, 0
0, 0, -203, 0, 0, 221, 208, 10, 512, 7,
0, 0, 24, 1, 5, -174, 47, -23, 105, 61,
38, 0, -10, 158, 181, 379, 164, 205, 102, 84,
0, 0, 0, 0, 0, -43, 0, 107, 0, 104,
0, 54, -1, 0, 0, 235, -384, 0, -307, 210,
0, 0, 0, 0, 0, 266, 0, 0, 324, 0,
0, 286, 0, 103, 298, -236, 0, 0, 0, 0,
0, 0, -6, 0, 0, -167, 0, 0, 129, 62,
-14, 0, 53, -22, -669, 0, 0, -52, 0, -11,
0, 0, 68, -299, 0, 52, 0, 0, 0, 262,
288, 0, 0, 227, -73, 0, 87, 0, 0, 118,
0, 0, 0, 209, 0, 0, 0, 0, 0, 6,
0, 108, 15, 0, 46, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 91, 0, 0, 69,
0, 390, 0, 86, 0, 0, 0, -224, 0, 37,
0, 0, 77, 0, 0, 0, 0, 0, 0, 70,
-57, -8, 241, 99, 0, 0, -290, 0, 65, 257,
0, 261, 39, -35, 0, 0
);
protected $gotoDefault = array(
-32768, 499, 711, 4, 712, 905, 788, 797, 583, 515,
679, 338, 610, 412, 1255, 882, 1078, 565, 816, 1199,
1207, 445, 819, 323, 701, 864, 865, 866, 390, 375,
381, 388, 632, 611, 480, 851, 441, 843, 472, 846,
440, 855, 161, 409, 497, 859, 3, 861, 542, 892,
376, 869, 377, 656, 871, 550, 873, 874, 384, 391,
392, 1083, 558, 607, 886, 242, 552, 887, 374, 888,
895, 379, 382, 665, 452, 492, 485, 402, 1058, 594,
629, 449, 466, 617, 616, 604, 465, 424, 407, 928,
473, 450, 942, 340, 950, 709, 1090, 624, 475, 958,
625, 965, 968, 516, 517, 464, 980, 268, 983, 476,
1015, 647, 648, 995, 626, 627, 1013, 459, 584, 1021,
442, 1029, 1243, 443, 1033, 261, 1036, 275, 408, 425,
1041, 1042, 8, 1048, 671, 672, 10, 272, 496, 1073,
666, 439, 1089, 429, 1159, 1161, 544, 477, 1179, 1178,
659, 493, 1184, 1246, 437, 518, 460, 309, 519, 301,
326, 306, 534, 288, 327, 520, 461, 1252, 1260, 324,
29, 1280, 1291, 334, 562, 599
679, 339, 610, 413, 1255, 882, 1078, 565, 816, 1199,
1207, 446, 819, 324, 701, 864, 865, 866, 391, 376,
382, 389, 632, 611, 481, 851, 442, 843, 473, 846,
441, 855, 162, 410, 497, 859, 3, 861, 542, 892,
377, 869, 378, 656, 871, 550, 873, 874, 385, 392,
393, 1083, 558, 607, 886, 243, 552, 887, 375, 888,
895, 380, 383, 665, 453, 492, 486, 403, 1058, 594,
629, 450, 467, 617, 616, 604, 466, 425, 408, 928,
474, 451, 942, 341, 950, 709, 1090, 624, 476, 958,
625, 965, 968, 516, 517, 465, 980, 269, 983, 477,
1015, 647, 648, 995, 626, 627, 1013, 460, 584, 1021,
443, 1029, 1243, 444, 1033, 262, 1036, 276, 409, 426,
1041, 1042, 8, 1048, 671, 672, 10, 273, 496, 1073,
666, 440, 1089, 430, 1159, 1161, 544, 478, 1179, 1178,
659, 493, 1184, 1246, 438, 518, 461, 310, 519, 302,
327, 307, 534, 289, 328, 520, 462, 1252, 1260, 325,
30, 1280, 1291, 335, 562, 599
);
protected $ruleToNonTerminal = array(

View File

@@ -0,0 +1,61 @@
<?php
declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection\PseudoTypes;
use phpDocumentor\Reflection\PseudoType;
use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\Types\Integer;
/**
* Value Object representing the type 'int'.
*
* @psalm-immutable
*/
final class IntegerRange extends Integer implements PseudoType
{
/** @var string */
private $minValue;
/** @var string */
private $maxValue;
public function __construct(string $minValue, string $maxValue)
{
$this->minValue = $minValue;
$this->maxValue = $maxValue;
}
public function underlyingType(): Type
{
return new Integer();
}
public function getMinValue(): string
{
return $this->minValue;
}
public function getMaxValue(): string
{
return $this->maxValue;
}
/**
* Returns a rendered output of the Type as it would be used in a DocBlock.
*/
public function __toString(): string
{
return 'int<' . $this->minValue . ', ' . $this->maxValue . '>';
}
}

View File

@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection\PseudoTypes;
use phpDocumentor\Reflection\PseudoType;
use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\Types\Array_;
use phpDocumentor\Reflection\Types\Integer;
use phpDocumentor\Reflection\Types\Mixed_;
/**
* Value Object representing the type 'list'.
*
* @psalm-immutable
*/
final class List_ extends Array_ implements PseudoType
{
public function underlyingType(): Type
{
return new Array_();
}
public function __construct(?Type $valueType = null)
{
parent::__construct($valueType, new Integer());
}
/**
* Returns a rendered output of the Type as it would be used in a DocBlock.
*/
public function __toString(): string
{
if ($this->valueType instanceof Mixed_) {
return 'list';
}
return 'list<' . $this->valueType . '>';
}
}

View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection\PseudoTypes;
use phpDocumentor\Reflection\PseudoType;
use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\Types\Integer;
/**
* Value Object representing the type 'int'.
*
* @psalm-immutable
*/
final class NegativeInteger extends Integer implements PseudoType
{
public function underlyingType(): Type
{
return new Integer();
}
/**
* Returns a rendered output of the Type as it would be used in a DocBlock.
*/
public function __toString(): string
{
return 'negative-int';
}
}

View File

@@ -0,0 +1,47 @@
<?php
declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection\PseudoTypes;
use phpDocumentor\Reflection\PseudoType;
use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\Types\AggregatedType;
use phpDocumentor\Reflection\Types\Compound;
use phpDocumentor\Reflection\Types\Float_;
use phpDocumentor\Reflection\Types\Integer;
/**
* Value Object representing the 'numeric' pseudo-type, which is either a numeric-string, integer or float.
*
* @psalm-immutable
*/
final class Numeric_ extends AggregatedType implements PseudoType
{
public function __construct()
{
AggregatedType::__construct([new NumericString(), new Integer(), new Float_()], '|');
}
public function underlyingType(): Type
{
return new Compound([new NumericString(), new Integer(), new Float_()]);
}
/**
* Returns a rendered output of the Type as it would be used in a DocBlock.
*/
public function __toString(): string
{
return 'numeric';
}
}

View File

@@ -18,7 +18,7 @@ use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\Types\Integer;
/**
* Value Object representing the type 'string'.
* Value Object representing the type 'int'.
*
* @psalm-immutable
*/

View File

@@ -15,6 +15,8 @@ namespace phpDocumentor\Reflection;
use ArrayIterator;
use InvalidArgumentException;
use phpDocumentor\Reflection\PseudoTypes\IntegerRange;
use phpDocumentor\Reflection\PseudoTypes\List_;
use phpDocumentor\Reflection\Types\Array_;
use phpDocumentor\Reflection\Types\ArrayKey;
use phpDocumentor\Reflection\Types\ClassString;
@@ -37,8 +39,10 @@ use function array_values;
use function class_exists;
use function class_implements;
use function count;
use function current;
use function end;
use function in_array;
use function is_numeric;
use function key;
use function preg_split;
use function strpos;
@@ -81,10 +85,12 @@ final class TypeResolver
'non-empty-lowercase-string' => PseudoTypes\NonEmptyLowercaseString::class,
'non-empty-string' => PseudoTypes\NonEmptyString::class,
'numeric-string' => PseudoTypes\NumericString::class,
'numeric' => PseudoTypes\Numeric_::class,
'trait-string' => PseudoTypes\TraitString::class,
'int' => Types\Integer::class,
'integer' => Types\Integer::class,
'positive-int' => PseudoTypes\PositiveInteger::class,
'negative-int' => PseudoTypes\NegativeInteger::class,
'bool' => Types\Boolean::class,
'boolean' => Types\Boolean::class,
'real' => Types\Float_::class,
@@ -110,6 +116,7 @@ final class TypeResolver
'parent' => Types\Parent_::class,
'iterable' => Types\Iterable_::class,
'never' => Types\Never_::class,
'list' => PseudoTypes\List_::class,
];
/**
@@ -255,6 +262,8 @@ final class TypeResolver
if ($classType !== null) {
if ((string) $classType === 'class-string') {
$types[] = $this->resolveClassString($tokens, $context);
} elseif ((string) $classType === 'int') {
$types[] = $this->resolveIntRange($tokens);
} elseif ((string) $classType === 'interface-string') {
$types[] = $this->resolveInterfaceString($tokens, $context);
} else {
@@ -271,6 +280,10 @@ final class TypeResolver
} elseif ($token === self::OPERATOR_ARRAY) {
end($types);
$last = key($types);
if ($last === null) {
throw new InvalidArgumentException('Unexpected array operator');
}
$lastItem = $types[$last];
if ($lastItem instanceof Expression) {
$lastItem = $lastItem->getValueType();
@@ -315,7 +328,7 @@ final class TypeResolver
);
}
} elseif (count($types) === 1) {
return $types[0];
return current($types);
}
if ($compoundToken === '|') {
@@ -477,6 +490,75 @@ final class TypeResolver
return new ClassString($classType->getFqsen());
}
/**
* Resolves integer ranges
*
* @param ArrayIterator<int, (string|null)> $tokens
*/
private function resolveIntRange(ArrayIterator $tokens): Type
{
$tokens->next();
$token = '';
$minValue = null;
$maxValue = null;
$commaFound = false;
$tokenCounter = 0;
while ($tokens->valid()) {
$tokenCounter++;
$token = $tokens->current();
if ($token === null) {
throw new RuntimeException(
'Unexpected nullable character'
);
}
$token = trim($token);
if ($token === '>') {
break;
}
if ($token === ',') {
$commaFound = true;
}
if ($commaFound === false && $minValue === null) {
if (is_numeric($token) || $token === 'max' || $token === 'min') {
$minValue = $token;
}
}
if ($commaFound === true && $maxValue === null) {
if (is_numeric($token) || $token === 'max' || $token === 'min') {
$maxValue = $token;
}
}
$tokens->next();
}
if ($token !== '>') {
if (empty($token)) {
throw new RuntimeException(
'interface-string: ">" is missing'
);
}
throw new RuntimeException(
'Unexpected character "' . $token . '", ">" is missing'
);
}
if (!$minValue || !$maxValue || $tokenCounter > 4) {
throw new RuntimeException(
'int<min,max> has not the correct format'
);
}
return new IntegerRange($minValue, $maxValue);
}
/**
* Resolves class string
*
@@ -521,10 +603,11 @@ final class TypeResolver
{
$isArray = ((string) $classType === 'array');
$isIterable = ((string) $classType === 'iterable');
$isList = ((string) $classType === 'list');
// allow only "array", "iterable" or class name before "<"
if (
!$isArray && !$isIterable
!$isArray && !$isIterable && !$isList
&& (!$classType instanceof Object_ || $classType->getFqsen() === null)
) {
throw new RuntimeException(
@@ -538,7 +621,7 @@ final class TypeResolver
$keyType = null;
$token = $tokens->current();
if ($token !== null && trim($token) === ',') {
if ($token !== null && trim($token) === ',' && !$isList) {
// if we have a comma, then we just parsed the key type, not the value type
$keyType = $valueType;
if ($isArray) {
@@ -596,6 +679,10 @@ final class TypeResolver
return new Iterable_($valueType, $keyType);
}
if ($isList) {
return new List_($valueType);
}
if ($classType instanceof Object_) {
return $this->makeCollectionFromObject($classType, $valueType, $keyType);
}

View File

@@ -24,6 +24,6 @@ namespace phpDocumentor\Reflection\Types;
*
* @psalm-immutable
*/
final class Array_ extends AbstractList
class Array_ extends AbstractList
{
}

View File

@@ -1,3 +1,9 @@
1.15.0 / 2021/12/08
===================
* [added] Support for the `static` return type [@denis-rolling-scopes]
* [fixed] Add return types for Comparator implementations to avoid deprecation warnings from Symfony's DebugClassLoader [@stof]
1.14.0 / 2021/09/16
===================

View File

@@ -402,3 +402,10 @@ $em->flush()->shouldHaveBeenCalled();
```
Such manipulation with doubles is called spying. And with Prophecy it just works.
## FAQ
### Can I call the original methods on a prophesized class?
Prophecy does not support calling the original methods on a phrophesized class. If you find yourself needing to mock some methods of a class while calling the original version of other methods, it's likely a sign that your class violates the [single-responsibility principle](https://en.wikipedia.org/wiki/Single-responsibility_principle) and should be refactored.

View File

@@ -21,13 +21,13 @@ use SebastianBergmann\Comparator\ComparisonFailure;
*/
final class ClosureComparator extends Comparator
{
public function accepts($expected, $actual)
public function accepts($expected, $actual): bool
{
return is_object($expected) && $expected instanceof \Closure
&& is_object($actual) && $actual instanceof \Closure;
}
public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array())
public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array()): void
{
if ($expected !== $actual) {
throw new ComparisonFailure(

View File

@@ -14,14 +14,17 @@ namespace Prophecy\Comparator;
use Prophecy\Prophecy\ProphecyInterface;
use SebastianBergmann\Comparator\ObjectComparator;
/**
* @final
*/
class ProphecyComparator extends ObjectComparator
{
public function accepts($expected, $actual)
public function accepts($expected, $actual): bool
{
return is_object($expected) && is_object($actual) && $actual instanceof ProphecyInterface;
}
public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array())
public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array()): void
{
parent::assertEquals($expected, $actual->reveal(), $delta, $canonicalize, $ignoreCase, $processed);
}

View File

@@ -56,6 +56,7 @@ abstract class TypeNodeAbstract
// built in types
case 'self':
case 'static':
case 'array':
case 'callable':
case 'bool':

View File

@@ -2,6 +2,26 @@
All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [9.2.10] - 2021-12-05
### Fixed
* [#887](https://github.com/sebastianbergmann/php-code-coverage/issues/887): Document return type of `CodeUnitFindingVisitor::enterNode()` so that Symfony's DebugClassLoader does not trigger a deprecation warning
## [9.2.9] - 2021-11-19
### Fixed
* [#882](https://github.com/sebastianbergmann/php-code-coverage/issues/882): PHPUnit 9.2.8 has wrong version number
## [9.2.8] - 2021-10-30
### Fixed
* [#866](https://github.com/sebastianbergmann/php-code-coverage/issues/866): `CodeUnitFindingVisitor` does not handle `enum` type introduced in PHP 8.1
* [#868](https://github.com/sebastianbergmann/php-code-coverage/pull/868): Uncovered files should be ignored unless requested
* [#876](https://github.com/sebastianbergmann/php-code-coverage/issues/876): PCOV driver causes 2x slowdown after upgrade to PHPUnit 9.5
## [9.2.7] - 2021-09-17
### Fixed
@@ -329,6 +349,9 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
* This component is no longer supported on PHP 7.1
[9.2.10]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.9...9.2.10
[9.2.9]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.8...9.2.9
[9.2.8]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.7...9.2.8
[9.2.7]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.6...9.2.7
[9.2.6]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.5...9.2.6
[9.2.5]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.4...9.2.5

View File

@@ -32,7 +32,7 @@
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
"nikic/php-parser": "^4.12.0",
"nikic/php-parser": "^4.13.0",
"phpunit/php-file-iterator": "^3.0.3",
"phpunit/php-text-template": "^2.0.2",
"sebastian/code-unit-reverse-lookup": "^2.0.2",

View File

@@ -167,6 +167,8 @@ final class CodeCoverage
$this->processUncoveredFilesFromFilter();
} elseif ($this->includeUncoveredFiles) {
$this->addUncoveredFilesFromFilter();
} else {
$this->data->removeFilesWithNoCoverage();
}
}

View File

@@ -9,7 +9,14 @@
*/
namespace SebastianBergmann\CodeCoverage\Driver;
use const pcov\inclusive;
use function array_intersect;
use function extension_loaded;
use function pcov\clear;
use function pcov\collect;
use function pcov\start;
use function pcov\stop;
use function pcov\waiting;
use function phpversion;
use SebastianBergmann\CodeCoverage\Filter;
use SebastianBergmann\CodeCoverage\RawCodeCoverageData;
@@ -38,21 +45,27 @@ final class PcovDriver extends Driver
public function start(): void
{
\pcov\start();
start();
}
public function stop(): RawCodeCoverageData
{
\pcov\stop();
stop();
$collect = \pcov\collect(
\pcov\inclusive,
!$this->filter->isEmpty() ? $this->filter->files() : \pcov\waiting()
);
$filesToCollectCoverageFor = waiting();
$collected = [];
\pcov\clear();
if ($filesToCollectCoverageFor) {
if (!$this->filter->isEmpty()) {
$filesToCollectCoverageFor = array_intersect($filesToCollectCoverageFor, $this->filter->files());
}
return RawCodeCoverageData::fromXdebugWithoutPathCoverage($collect);
$collected = collect(inclusive, $filesToCollectCoverageFor);
clear();
}
return RawCodeCoverageData::fromXdebugWithoutPathCoverage($collected);
}
public function nameAndVersion(): string

View File

@@ -132,6 +132,18 @@ final class ProcessedCodeCoverageData
unset($this->lineCoverage[$oldFile], $this->functionCoverage[$oldFile]);
}
public function removeFilesWithNoCoverage(): void
{
foreach ($this->lineCoverage as $file => $lines) {
foreach ($lines as $line) {
if (is_array($line) && !empty($line)) {
continue 2;
}
}
unset($file);
}
}
public function merge(self $newData): void
{
foreach ($newData->lineCoverage as $file => $lines) {

View File

@@ -13,11 +13,14 @@ use function implode;
use function rtrim;
use function trim;
use PhpParser\Node;
use PhpParser\Node\ComplexType;
use PhpParser\Node\Identifier;
use PhpParser\Node\IntersectionType;
use PhpParser\Node\Name;
use PhpParser\Node\NullableType;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Enum_;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\Interface_;
use PhpParser\Node\Stmt\Trait_;
@@ -32,21 +35,21 @@ use SebastianBergmann\Complexity\CyclomaticComplexityCalculatingVisitor;
final class CodeUnitFindingVisitor extends NodeVisitorAbstract
{
/**
* @var array
* @psalm-var array<string,array{name: string, namespacedName: string, namespace: string, startLine: int, endLine: int, methods: array<string,array{methodName: string, signature: string, visibility: string, startLine: int, endLine: int, ccn: int}>}>
*/
private $classes = [];
/**
* @var array
* @psalm-var array<string,array{name: string, namespacedName: string, namespace: string, startLine: int, endLine: int, methods: array<string,array{methodName: string, signature: string, visibility: string, startLine: int, endLine: int, ccn: int}>}>
*/
private $traits = [];
/**
* @var array
* @psalm-var array<string,array{name: string, namespacedName: string, namespace: string, signature: string, startLine: int, endLine: int, ccn: int}>
*/
private $functions = [];
public function enterNode(Node $node)
public function enterNode(Node $node): void
{
if ($node instanceof Class_) {
if ($node->isAnonymous()) {
@@ -61,7 +64,7 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract
}
if (!$node instanceof ClassMethod && !$node instanceof Function_) {
return null;
return;
}
if ($node instanceof ClassMethod) {
@@ -79,16 +82,25 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract
$this->processFunction($node);
}
/**
* @psalm-return array<string,array{name: string, namespacedName: string, namespace: string, startLine: int, endLine: int, methods: array<string,array{methodName: string, signature: string, visibility: string, startLine: int, endLine: int, ccn: int}>}>
*/
public function classes(): array
{
return $this->classes;
}
/**
* @psalm-return array<string,array{name: string, namespacedName: string, namespace: string, startLine: int, endLine: int, methods: array<string,array{methodName: string, signature: string, visibility: string, startLine: int, endLine: int, ccn: int}>}>
*/
public function traits(): array
{
return $this->traits;
}
/**
* @psalm-return array<string,array{name: string, namespacedName: string, namespace: string, signature: string, startLine: int, endLine: int, ccn: int}>
*/
public function functions(): array
{
return $this->functions;
@@ -157,24 +169,18 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract
}
/**
* @psalm-param Identifier|Name|NullableType|UnionType $type
* @psalm-param Identifier|Name|ComplexType $type
*/
private function type(Node $type): string
{
assert($type instanceof Identifier || $type instanceof Name || $type instanceof NullableType || $type instanceof UnionType);
assert($type instanceof Identifier || $type instanceof Name || $type instanceof ComplexType);
if ($type instanceof NullableType) {
return '?' . $type->type;
}
if ($type instanceof UnionType) {
$types = [];
foreach ($type->types as $_type) {
$types[] = $_type->toString();
}
return implode('|', $types);
if ($type instanceof UnionType || $type instanceof IntersectionType) {
return $this->unionOrIntersectionAsString($type);
}
return $type->toString();
@@ -200,7 +206,7 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract
$this->classes[$namespacedName] = [
'name' => $name,
'namespacedName' => $namespacedName,
'namespacedName' => (string) $namespacedName,
'namespace' => $this->namespace($namespacedName, $name),
'startLine' => $node->getStartLine(),
'endLine' => $node->getEndLine(),
@@ -215,7 +221,7 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract
$this->traits[$namespacedName] = [
'name' => $name,
'namespacedName' => $namespacedName,
'namespacedName' => (string) $namespacedName,
'namespace' => $this->namespace($namespacedName, $name),
'startLine' => $node->getStartLine(),
'endLine' => $node->getEndLine(),
@@ -231,7 +237,7 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract
return;
}
assert($parentNode instanceof Class_ || $parentNode instanceof Trait_);
assert($parentNode instanceof Class_ || $parentNode instanceof Trait_ || $parentNode instanceof Enum_);
assert(isset($parentNode->name));
assert(isset($parentNode->namespacedName));
assert($parentNode->namespacedName instanceof Name);
@@ -290,4 +296,28 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract
{
return trim(rtrim($namespacedName, $name), '\\');
}
/**
* @psalm-param UnionType|IntersectionType $type
*/
private function unionOrIntersectionAsString(ComplexType $type): string
{
if ($type instanceof UnionType) {
$separator = '|';
} else {
$separator = '&';
}
$types = [];
foreach ($type->types as $_type) {
if ($_type instanceof Name) {
$types[] = $_type->toCodeString();
} else {
$types[] = $_type->toString();
}
}
return implode($separator, $types);
}
}

View File

@@ -22,7 +22,7 @@ final class Version
public static function id(): string
{
if (self::$version === null) {
self::$version = (new VersionId('9.2.7', dirname(__DIR__)))->getVersion();
self::$version = (new VersionId('9.2.10', dirname(__DIR__)))->getVersion();
}
return self::$version;

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.x-dev@">
<file src="src/Iterator.php">
<UndefinedInterfaceMethod occurrences="1">
<code>current</code>
</UndefinedInterfaceMethod>
</file>
</files>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<psalm
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
resolveFromConfigFile="false"
totallyTyped="false"
errorBaseline=".psalm/baseline.xml"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>

View File

@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
## [3.0.6] - 2021-12-02
### Changed
* [#73](https://github.com/sebastianbergmann/php-file-iterator/pull/73): Micro performance improvements on parsing paths
## [3.0.5] - 2020-09-28
### Changed
@@ -38,6 +44,28 @@ All notable changes to this project will be documented in this file. This projec
* This component is no longer supported on PHP 7.1 and PHP 7.2
## [2.0.5] - 2021-12-02
### Changed
* [#73](https://github.com/sebastianbergmann/php-file-iterator/pull/73): Micro performance improvements on parsing paths
### Fixed
* [#74](https://github.com/sebastianbergmann/php-file-iterator/pull/74): Document return type of `SebastianBergmann\FileIterator\Iterator::accept()` so that Symfony's `DebugClassLoader` does not trigger a deprecation warning
## [2.0.4] - 2021-07-19
### Changed
* Added `ReturnTypeWillChange` attribute to `SebastianBergmann\FileIterator\Iterator::accept()` because the return type of `\FilterIterator::accept()` will change in PHP 8.1
## [2.0.3] - 2020-11-30
### Changed
* Changed PHP version constraint in `composer.json` from `^7.1` to `>=7.1`
## [2.0.2] - 2018-09-13
### Fixed
@@ -96,15 +124,19 @@ No changes
* [#23](https://github.com/sebastianbergmann/php-file-iterator/pull/23): Added support for wildcards (glob) in exclude
[3.0.6]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.5...3.0.6
[3.0.5]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.4...3.0.5
[3.0.4]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.3...3.0.4
[3.0.3]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.2...3.0.3
[3.0.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.1...3.0.2
[3.0.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.2...3.0.0
[3.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.5...3.0.0
[2.0.5]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.4...2.0.5
[2.0.4]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.3...2.0.4
[2.0.3]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.2...2.0.3
[2.0.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.1...2.0.2
[2.0.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4...2.0.0
[2.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.5...2.0.0
[1.4.5]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.4...1.4.5
[1.4.4]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.3...1.4.4
[1.4.3]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.2...1.4.3

View File

@@ -1,6 +1,6 @@
php-file-iterator
Copyright (c) 2009-2020, Sebastian Bergmann <sebastian@phpunit.de>.
Copyright (c) 2009-2021, Sebastian Bergmann <sebastian@phpunit.de>.
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@@ -76,16 +76,16 @@ class Factory
protected function getPathsAfterResolvingWildcards(array $paths): array
{
$_paths = [];
$_paths = [[]];
foreach ($paths as $path) {
if ($locals = glob($path, GLOB_ONLYDIR)) {
$_paths = array_merge($_paths, array_map('\realpath', $locals));
$_paths[] = array_map('\realpath', $locals);
} else {
$_paths[] = realpath($path);
$_paths[] = [realpath($path)];
}
}
return array_filter($_paths);
return array_filter(array_merge(...$_paths));
}
}

View File

@@ -2,6 +2,18 @@
All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [8.5.22] - 2021-12-25
### Changed
* [#4812](https://github.com/sebastianbergmann/phpunit/issues/4812): Do not enforce time limits when a debugging session through DBGp is active
* [#4835](https://github.com/sebastianbergmann/phpunit/issues/4835): Support for `$GLOBALS['_composer_autoload_path']` introduced in Composer 2.2
### Fixed
* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics
* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored
## [8.5.21] - 2021-09-25
### Changed
@@ -178,6 +190,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable`
* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside
[8.5.22]: https://github.com/sebastianbergmann/phpunit/compare/8.5.21...8.5.22
[8.5.21]: https://github.com/sebastianbergmann/phpunit/compare/8.5.20...8.5.21
[8.5.20]: https://github.com/sebastianbergmann/phpunit/compare/8.5.19...8.5.20
[8.5.19]: https://github.com/sebastianbergmann/phpunit/compare/8.5.18...8.5.19

View File

@@ -2,6 +2,18 @@
All notable changes of the PHPUnit 9.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [9.5.11] - 2021-12-25
### Changed
* [#4812](https://github.com/sebastianbergmann/phpunit/issues/4812): Do not enforce time limits when a debugging session through DBGp is active
* [#4835](https://github.com/sebastianbergmann/phpunit/issues/4835): Support for `$GLOBALS['_composer_autoload_path']` introduced in Composer 2.2
### Fixed
* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics
* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored
## [9.5.10] - 2021-09-25
### Changed
@@ -91,6 +103,7 @@ All notable changes of the PHPUnit 9.5 release series are documented in this fil
* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly
[9.5.11]: https://github.com/sebastianbergmann/phpunit/compare/9.5.10...9.5.11
[9.5.10]: https://github.com/sebastianbergmann/phpunit/compare/9.5.9...9.5.10
[9.5.9]: https://github.com/sebastianbergmann/phpunit/compare/9.5.8...9.5.9
[9.5.8]: https://github.com/sebastianbergmann/phpunit/compare/9.5.7...9.5.8

View File

@@ -58,15 +58,21 @@ if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}
foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
if (file_exists($file)) {
define('PHPUNIT_COMPOSER_INSTALL', $file);
if (isset($GLOBALS['_composer_autoload_path'])) {
define('PHPUNIT_COMPOSER_INSTALL', $GLOBALS['_composer_autoload_path']);
break;
unset($GLOBALS['_composer_autoload_path']);
} else {
foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
if (file_exists($file)) {
define('PHPUNIT_COMPOSER_INSTALL', $file);
break;
}
}
}
unset($file);
unset($file);
}
if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
fwrite(

View File

@@ -514,6 +514,24 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T
{
}
/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between setUp() and test.
*/
protected function assertPreConditions(): void
{
}
/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between test and tearDown().
*/
protected function assertPostConditions(): void
{
}
/**
* This method is called after each test.
*/
@@ -1955,24 +1973,6 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T
return new TestResult;
}
/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between setUp() and test.
*/
protected function assertPreConditions(): void
{
}
/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between test and tearDown().
*/
protected function assertPostConditions(): void
{
}
/**
* This method is called when a test method did not execute successfully.
*

View File

@@ -14,6 +14,10 @@ use function count;
use function function_exists;
use function get_class;
use function sprintf;
use function xdebug_get_monitored_functions;
use function xdebug_is_debugger_active;
use function xdebug_start_function_monitor;
use function xdebug_stop_function_monitor;
use AssertionError;
use Countable;
use Error;
@@ -452,7 +456,7 @@ final class TestResult implements Countable
$this->passed[$key] = [
'result' => $test->getResult(),
'size' => \PHPUnit\Util\Test::getSize(
'size' => TestUtil::getSize(
$class,
$test->getName(false)
),
@@ -636,12 +640,15 @@ final class TestResult implements Countable
{
Assert::resetCount();
$size = TestUtil::UNKNOWN;
if ($test instanceof TestCase) {
$test->setRegisterMockObjectsFromTestArgumentsRecursively(
$this->registerMockObjectsFromTestArgumentsRecursively
);
$isAnyCoverageRequired = TestUtil::requiresCodeCoverageDataCollection($test);
$size = $test->getSize();
}
$error = false;
@@ -676,7 +683,7 @@ final class TestResult implements Countable
$monitorFunctions = $this->beStrictAboutResourceUsageDuringSmallTests &&
!$test instanceof ErrorTestCase &&
!$test instanceof WarningTestCase &&
$test->getSize() === \PHPUnit\Util\Test::SMALL &&
$size === TestUtil::SMALL &&
function_exists('xdebug_start_function_monitor');
if ($monitorFunctions) {
@@ -692,29 +699,26 @@ final class TestResult implements Countable
if (!$test instanceof ErrorTestCase &&
!$test instanceof WarningTestCase &&
$this->enforceTimeLimit &&
($this->defaultTimeLimit || $test->getSize() != \PHPUnit\Util\Test::UNKNOWN) &&
$this->shouldTimeLimitBeEnforced($size) &&
$invoker->canInvokeWithTimeout()) {
switch ($test->getSize()) {
case \PHPUnit\Util\Test::SMALL:
switch ($size) {
case TestUtil::SMALL:
$_timeout = $this->timeoutForSmallTests;
break;
case \PHPUnit\Util\Test::MEDIUM:
case TestUtil::MEDIUM:
$_timeout = $this->timeoutForMediumTests;
break;
case \PHPUnit\Util\Test::LARGE:
case TestUtil::LARGE:
$_timeout = $this->timeoutForLargeTests;
break;
case \PHPUnit\Util\Test::UNKNOWN:
default:
$_timeout = $this->defaultTimeLimit;
break;
}
$invoker->invoke([$test, 'runBare'], [], $_timeout);
@@ -829,12 +833,12 @@ final class TestResult implements Countable
if ($append && $test instanceof TestCase) {
try {
$linesToBeCovered = \PHPUnit\Util\Test::getLinesToBeCovered(
$linesToBeCovered = TestUtil::getLinesToBeCovered(
get_class($test),
$test->getName(false)
);
$linesToBeUsed = \PHPUnit\Util\Test::getLinesToBeUsed(
$linesToBeUsed = TestUtil::getLinesToBeUsed(
get_class($test),
$test->getName(false)
);
@@ -1286,4 +1290,29 @@ final class TestResult implements Countable
{
$this->warnings[] = new TestFailure($test, $t);
}
private function shouldTimeLimitBeEnforced(int $size): bool
{
if (!$this->enforceTimeLimit) {
return false;
}
if (!(($this->defaultTimeLimit || $size !== TestUtil::UNKNOWN))) {
return false;
}
if (!extension_loaded('pcntl')) {
return false;
}
if (!class_exists(Invoker::class)) {
return false;
}
if (extension_loaded('xdebug') && xdebug_is_debugger_active()) {
return false;
}
return true;
}
}

View File

@@ -41,7 +41,7 @@ final class Version
}
if (self::$version === '') {
self::$version = (new VersionId('9.5.10', dirname(__DIR__, 2)))->getVersion();
self::$version = (new VersionId('9.5.11', dirname(__DIR__, 2)))->getVersion();
}
return self::$version;

View File

@@ -11,6 +11,7 @@ namespace PHPUnit\Util;
use function array_keys;
use function array_reverse;
use function array_shift;
use function defined;
use function get_defined_constants;
use function get_included_files;
@@ -23,6 +24,8 @@ use function preg_match;
use function serialize;
use function sprintf;
use function strpos;
use function strtr;
use function substr;
use function var_export;
use Closure;
@@ -68,7 +71,12 @@ final class GlobalState
}
// Do not process bootstrap script
unset($files[0]);
array_shift($files);
// If bootstrap script was a Composer bin proxy, skip the second entry as well
if (substr(strtr($files[0], '\\', '/'), -24) === '/phpunit/phpunit/phpunit') {
array_shift($files);
}
foreach (array_reverse($files) as $file) {
if (!empty($GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST']) &&

View File

@@ -26,7 +26,6 @@ use function is_numeric;
use function is_object;
use function is_scalar;
use function is_string;
use function mb_strtolower;
use function ord;
use function preg_quote;
use function preg_replace;
@@ -109,24 +108,7 @@ final class NamePrettifier
$fullyQualifiedName = $className;
}
$result = '';
$wasLowerCase = false;
foreach (range(0, strlen($className) - 1) as $i) {
$isLowerCase = mb_strtolower($className[$i], 'UTF-8') === $className[$i];
if ($wasLowerCase && !$isLowerCase) {
$result .= ' ';
}
$result .= $className[$i];
if ($isLowerCase) {
$wasLowerCase = true;
} else {
$wasLowerCase = false;
}
}
$result = preg_replace('/(?<=[[:lower:]])(?=[[:upper:]])/u', ' ', $className);
if ($fullyQualifiedName !== $className) {
return $result . ' (' . $fullyQualifiedName . ')';

View File

@@ -2,6 +2,12 @@
All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [4.0.4] - 2021-11-11
### Changed
* [#37](https://github.com/sebastianbergmann/exporter/pull/37): Improve export of closed resources
## [4.0.3] - 2020-09-28
### Changed
@@ -26,18 +32,33 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
* This component is no longer supported on PHP 7.0, PHP 7.1, and PHP 7.2
## [3.1.4] - 2021-11-11
### Changed
* [#38](https://github.com/sebastianbergmann/exporter/pull/38): Improve export of closed resources
## [3.1.3] - 2020-11-30
### Changed
* Changed PHP version constraint in `composer.json` from `^7.0` to `>=7.0`
## [3.1.2] - 2019-09-14
### Fixed
* Fixed [#29](https://github.com/sebastianbergmann/exporter/pull/29): Second parameter for `str_repeat()` must be an integer
* [#29](https://github.com/sebastianbergmann/exporter/pull/29): Second parameter for `str_repeat()` must be an integer
### Removed
* Remove HHVM-specific code that is no longer needed
[4.0.4]: https://github.com/sebastianbergmann/exporter/compare/4.0.3...4.0.4
[4.0.3]: https://github.com/sebastianbergmann/exporter/compare/4.0.2...4.0.3
[4.0.2]: https://github.com/sebastianbergmann/exporter/compare/4.0.1...4.0.2
[4.0.1]: https://github.com/sebastianbergmann/exporter/compare/4.0.0...4.0.1
[4.0.0]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...4.0.0
[3.1.4]: https://github.com/sebastianbergmann/exporter/compare/3.1.3...3.1.4
[3.1.3]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...3.1.3
[3.1.2]: https://github.com/sebastianbergmann/exporter/compare/3.1.1...3.1.2

View File

@@ -1,6 +1,6 @@
Exporter
Copyright (c) 2002-2020, Sebastian Bergmann <sebastian@phpunit.de>.
Copyright (c) 2002-2021, Sebastian Bergmann <sebastian@phpunit.de>.
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@@ -2,7 +2,7 @@
"name": "sebastian/exporter",
"description": "Provides the functionality to export PHP variables for visualization",
"keywords": ["exporter","export"],
"homepage": "http://www.github.com/sebastianbergmann/exporter",
"homepage": "https://www.github.com/sebastianbergmann/exporter",
"license": "BSD-3-Clause",
"authors": [
{

View File

@@ -14,6 +14,7 @@ use function count;
use function function_exists;
use function get_class;
use function get_resource_type;
use function gettype;
use function implode;
use function is_array;
use function is_float;
@@ -232,7 +233,11 @@ class Exporter
}
if (is_float($value) && (float) ((int) $value) === $value) {
return "$value.0";
return "{$value}.0";
}
if (gettype($value) === 'resource (closed)') {
return 'resource (closed)';
}
if (is_resource($value)) {
@@ -262,7 +267,7 @@ class Exporter
"'";
}
$whitespace = str_repeat(' ', (int) (4 * $indentation));
$whitespace = str_repeat(' ', 4 * $indentation);
if (!$processed) {
$processed = new Context;

View File

@@ -25,13 +25,13 @@ final class Ctype
*
* @see https://php.net/ctype-alnum
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_alnum($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text);
}
@@ -41,13 +41,13 @@ final class Ctype
*
* @see https://php.net/ctype-alpha
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_alpha($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text);
}
@@ -57,13 +57,13 @@ final class Ctype
*
* @see https://php.net/ctype-cntrl
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_cntrl($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text);
}
@@ -73,13 +73,13 @@ final class Ctype
*
* @see https://php.net/ctype-digit
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_digit($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text);
}
@@ -89,13 +89,13 @@ final class Ctype
*
* @see https://php.net/ctype-graph
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_graph($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text);
}
@@ -105,13 +105,13 @@ final class Ctype
*
* @see https://php.net/ctype-lower
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_lower($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text);
}
@@ -121,13 +121,13 @@ final class Ctype
*
* @see https://php.net/ctype-print
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_print($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text);
}
@@ -137,13 +137,13 @@ final class Ctype
*
* @see https://php.net/ctype-punct
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_punct($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text);
}
@@ -153,13 +153,13 @@ final class Ctype
*
* @see https://php.net/ctype-space
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_space($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text);
}
@@ -169,13 +169,13 @@ final class Ctype
*
* @see https://php.net/ctype-upper
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_upper($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text);
}
@@ -185,13 +185,13 @@ final class Ctype
*
* @see https://php.net/ctype-xdigit
*
* @param string|int $text
* @param mixed $text
*
* @return bool
*/
public static function ctype_xdigit($text)
{
$text = self::convert_int_to_char_for_ctype($text);
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text);
}
@@ -204,11 +204,12 @@ final class Ctype
* (negative values have 256 added in order to allow characters in the Extended ASCII range).
* Any other integer is interpreted as a string containing the decimal digits of the integer.
*
* @param string|int $int
* @param mixed $int
* @param string $function
*
* @return mixed
*/
private static function convert_int_to_char_for_ctype($int)
private static function convert_int_to_char_for_ctype($int, $function)
{
if (!\is_int($int)) {
return $int;
@@ -218,6 +219,10 @@ final class Ctype
return (string) $int;
}
if (\PHP_VERSION_ID >= 80100) {
@trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED);
}
if ($int < 0) {
$int += 256;
}

View File

@@ -18,6 +18,9 @@
"require": {
"php": ">=7.1"
},
"provide": {
"ext-ctype": "*"
},
"autoload": {
"psr-4": { "Symfony\\Polyfill\\Ctype\\": "" },
"files": [ "bootstrap.php" ]