diff --git a/.travis.yml b/.travis.yml
index 7446f32..2ce0907 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,15 +8,11 @@ cache:
matrix:
include:
- - php: 5.5
- - php: 5.6
- - php: 7
- allow_failures:
- - php: 7
+ - php: 7.1
fast_finish: true
install:
- composer install --prefer-dist
script:
- - phpunit
+ - ./vendor/bin/phpunit
diff --git a/composer.json b/composer.json
index a1747d2..660ce73 100644
--- a/composer.json
+++ b/composer.json
@@ -14,8 +14,8 @@
}
],
"require": {
- "php": ">=5.5.9 || ^7.0",
- "nikic/php-parser": "~3.0",
+ "php": "^7.1",
+ "nikic/php-parser": "~4.0",
"symfony/console": "^2.6 || ^3.0",
"symfony/finder": "^2.6 || ^3.0",
"phpdocumentor/reflection-docblock": "~2.0 || ~3.0 || ~4.0",
diff --git a/composer.lock b/composer.lock
index 213dd42..a183f57 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,28 +4,28 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "f46285c4b1590606da3d20ada6fb75ab",
+ "content-hash": "ffba43b2fa5cc2664c01e2e660662e7a",
"packages": [
{
"name": "nikic/php-parser",
- "version": "v3.0.5",
+ "version": "v4.0.1",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "2b9e2f71b722f7c53918ab0c25f7646c2013f17d"
+ "reference": "e4a54fa90a5cd8e8dd3fb4099942681731c5cdd3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2b9e2f71b722f7c53918ab0c25f7646c2013f17d",
- "reference": "2b9e2f71b722f7c53918ab0c25f7646c2013f17d",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e4a54fa90a5cd8e8dd3fb4099942681731c5cdd3",
+ "reference": "e4a54fa90a5cd8e8dd3fb4099942681731c5cdd3",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
- "php": ">=5.5"
+ "php": ">=7.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.0|~5.0"
+ "phpunit/phpunit": "^6.5 || ^7.0"
},
"bin": [
"bin/php-parse"
@@ -33,7 +33,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -55,41 +55,144 @@
"parser",
"php"
],
- "time": "2017-03-05T18:23:57+00:00"
+ "time": "2018-03-25T17:35:16+00:00"
+ },
+ {
+ "name": "phpdocumentor/reflection-common",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
+ "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+ "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jaap van Otterdijk",
+ "email": "opensource@ijaap.nl"
+ }
+ ],
+ "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
+ "homepage": "http://www.phpdoc.org",
+ "keywords": [
+ "FQSEN",
+ "phpDocumentor",
+ "phpdoc",
+ "reflection",
+ "static analysis"
+ ],
+ "time": "2017-09-11T18:02:19+00:00"
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "2.0.4",
+ "version": "4.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
+ "reference": "94fd0001232e47129dd3504189fa1c7225010d08"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
- "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
+ "reference": "94fd0001232e47129dd3504189fa1c7225010d08",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^7.0",
+ "phpdocumentor/reflection-common": "^1.0.0",
+ "phpdocumentor/type-resolver": "^0.4.0",
+ "webmozart/assert": "^1.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.0"
+ "doctrine/instantiator": "~1.0.5",
+ "mockery/mockery": "^1.0",
+ "phpunit/phpunit": "^6.4"
},
- "suggest": {
- "dflydev/markdown": "~1.0",
- "erusev/parsedown": "~1.0"
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ }
+ ],
+ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
+ "time": "2017-11-30T07:14:17+00:00"
+ },
+ {
+ "name": "phpdocumentor/type-resolver",
+ "version": "0.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/TypeResolver.git",
+ "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
+ "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5 || ^7.0",
+ "phpdocumentor/reflection-common": "^1.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^0.9.4",
+ "phpunit/phpunit": "^5.2||^4.8.24"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "1.0.x-dev"
}
},
"autoload": {
- "psr-0": {
- "phpDocumentor": [
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
"src/"
]
}
@@ -101,10 +204,10 @@
"authors": [
{
"name": "Mike van Riel",
- "email": "mike.vanriel@naenius.com"
+ "email": "me@mikevanriel.com"
}
],
- "time": "2015-02-03T12:10:50+00:00"
+ "time": "2017-07-14T14:27:02+00:00"
},
{
"name": "psr/cache",
@@ -152,6 +255,55 @@
],
"time": "2016-08-06T20:24:11+00:00"
},
+ {
+ "name": "psr/container",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
+ "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
+ "keywords": [
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
+ ],
+ "time": "2017-02-14T16:28:37+00:00"
+ },
{
"name": "psr/log",
"version": "1.0.2",
@@ -199,27 +351,80 @@
],
"time": "2016-10-10T12:19:37+00:00"
},
+ {
+ "name": "psr/simple-cache",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/simple-cache.git",
+ "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+ "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\SimpleCache\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interfaces for simple caching",
+ "keywords": [
+ "cache",
+ "caching",
+ "psr",
+ "psr-16",
+ "simple-cache"
+ ],
+ "time": "2017-10-23T01:57:42+00:00"
+ },
{
"name": "symfony/cache",
- "version": "v3.2.7",
+ "version": "v4.0.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache.git",
- "reference": "1b4131944572027384977f89c0196828e3112646"
+ "reference": "ff96ef34437ccc2c0737677c1bf14904a2b9482d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/cache/zipball/1b4131944572027384977f89c0196828e3112646",
- "reference": "1b4131944572027384977f89c0196828e3112646",
+ "url": "https://api.github.com/repos/symfony/cache/zipball/ff96ef34437ccc2c0737677c1bf14904a2b9482d",
+ "reference": "ff96ef34437ccc2c0737677c1bf14904a2b9482d",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
+ "php": "^7.1.3",
"psr/cache": "~1.0",
- "psr/log": "~1.0"
+ "psr/log": "~1.0",
+ "psr/simple-cache": "^1.0"
+ },
+ "conflict": {
+ "symfony/var-dumper": "<3.4"
},
"provide": {
- "psr/cache-implementation": "1.0"
+ "psr/cache-implementation": "1.0",
+ "psr/simple-cache-implementation": "1.0"
},
"require-dev": {
"cache/integration-tests": "dev-master",
@@ -227,13 +432,10 @@
"doctrine/dbal": "~2.4",
"predis/predis": "~1.0"
},
- "suggest": {
- "symfony/polyfill-apcu": "For using ApcuAdapter on HHVM"
- },
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -258,34 +460,41 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony implementation of PSR-6",
+ "description": "Symfony Cache component with PSR-6, PSR-16, and tags",
"homepage": "https://symfony.com",
"keywords": [
"caching",
"psr6"
],
- "time": "2017-03-28T21:38:24+00:00"
+ "time": "2018-04-30T01:05:59+00:00"
},
{
"name": "symfony/config",
- "version": "v3.2.7",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "8444bde28e3c2a33e571e6f180c2d78bfdc4480d"
+ "reference": "7c2a9d44f4433863e9bca682e7f03609234657f9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/8444bde28e3c2a33e571e6f180c2d78bfdc4480d",
- "reference": "8444bde28e3c2a33e571e6f180c2d78bfdc4480d",
+ "url": "https://api.github.com/repos/symfony/config/zipball/7c2a9d44f4433863e9bca682e7f03609234657f9",
+ "reference": "7c2a9d44f4433863e9bca682e7f03609234657f9",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
- "symfony/filesystem": "~2.8|~3.0"
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/filesystem": "~2.8|~3.0|~4.0"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<3.3",
+ "symfony/finder": "<3.3"
},
"require-dev": {
- "symfony/yaml": "~3.0"
+ "symfony/dependency-injection": "~3.3|~4.0",
+ "symfony/event-dispatcher": "~3.3|~4.0",
+ "symfony/finder": "~3.3|~4.0",
+ "symfony/yaml": "~3.0|~4.0"
},
"suggest": {
"symfony/yaml": "To use the yaml reference dumper"
@@ -293,7 +502,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -320,43 +529,49 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
- "time": "2017-04-04T15:30:56+00:00"
+ "time": "2018-03-19T22:32:39+00:00"
},
{
"name": "symfony/console",
- "version": "v3.2.7",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "c30243cc51f726812be3551316b109a2f5deaf8d"
+ "reference": "5b1fdfa8eb93464bcc36c34da39cedffef822cdf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/c30243cc51f726812be3551316b109a2f5deaf8d",
- "reference": "c30243cc51f726812be3551316b109a2f5deaf8d",
+ "url": "https://api.github.com/repos/symfony/console/zipball/5b1fdfa8eb93464bcc36c34da39cedffef822cdf",
+ "reference": "5b1fdfa8eb93464bcc36c34da39cedffef822cdf",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
- "symfony/debug": "~2.8|~3.0",
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/debug": "~2.8|~3.0|~4.0",
"symfony/polyfill-mbstring": "~1.0"
},
+ "conflict": {
+ "symfony/dependency-injection": "<3.4",
+ "symfony/process": "<3.3"
+ },
"require-dev": {
"psr/log": "~1.0",
- "symfony/event-dispatcher": "~2.8|~3.0",
- "symfony/filesystem": "~2.8|~3.0",
- "symfony/process": "~2.8|~3.0"
+ "symfony/config": "~3.3|~4.0",
+ "symfony/dependency-injection": "~3.4|~4.0",
+ "symfony/event-dispatcher": "~2.8|~3.0|~4.0",
+ "symfony/lock": "~3.4|~4.0",
+ "symfony/process": "~3.3|~4.0"
},
"suggest": {
- "psr/log": "For using the console logger",
+ "psr/log-implementation": "For using the console logger",
"symfony/event-dispatcher": "",
- "symfony/filesystem": "",
+ "symfony/lock": "",
"symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -383,37 +598,36 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2017-04-04T14:33:42+00:00"
+ "time": "2018-04-30T01:22:56+00:00"
},
{
"name": "symfony/debug",
- "version": "v3.2.7",
+ "version": "v4.0.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "56f613406446a4a0a031475cfd0a01751de22659"
+ "reference": "e1d57cdb357e5b10f5fdacbb0b86689c0a435e6e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/56f613406446a4a0a031475cfd0a01751de22659",
- "reference": "56f613406446a4a0a031475cfd0a01751de22659",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/e1d57cdb357e5b10f5fdacbb0b86689c0a435e6e",
+ "reference": "e1d57cdb357e5b10f5fdacbb0b86689c0a435e6e",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
+ "php": "^7.1.3",
"psr/log": "~1.0"
},
"conflict": {
- "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ "symfony/http-kernel": "<3.4"
},
"require-dev": {
- "symfony/class-loader": "~2.8|~3.0",
- "symfony/http-kernel": "~2.8|~3.0"
+ "symfony/http-kernel": "~3.4|~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -440,43 +654,51 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
- "time": "2017-03-28T21:38:24+00:00"
+ "time": "2018-04-30T16:59:37+00:00"
},
{
"name": "symfony/dependency-injection",
- "version": "v3.2.7",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
- "reference": "923bb014708b666e4092c9ba39993895c9c8fcd7"
+ "reference": "54ff9d78b56429f9a1ac12e60bfb6d169c0468e3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/923bb014708b666e4092c9ba39993895c9c8fcd7",
- "reference": "923bb014708b666e4092c9ba39993895c9c8fcd7",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/54ff9d78b56429f9a1ac12e60bfb6d169c0468e3",
+ "reference": "54ff9d78b56429f9a1ac12e60bfb6d169c0468e3",
"shasum": ""
},
"require": {
- "php": ">=5.5.9"
+ "php": "^5.5.9|>=7.0.8",
+ "psr/container": "^1.0"
},
"conflict": {
- "symfony/yaml": "<3.2"
+ "symfony/config": "<3.3.7",
+ "symfony/finder": "<3.3",
+ "symfony/proxy-manager-bridge": "<3.4",
+ "symfony/yaml": "<3.4"
+ },
+ "provide": {
+ "psr/container-implementation": "1.0"
},
"require-dev": {
- "symfony/config": "~2.8|~3.0",
- "symfony/expression-language": "~2.8|~3.0",
- "symfony/yaml": "~3.2"
+ "symfony/config": "~3.3|~4.0",
+ "symfony/expression-language": "~2.8|~3.0|~4.0",
+ "symfony/yaml": "~3.4|~4.0"
},
"suggest": {
"symfony/config": "",
"symfony/expression-language": "For using expressions in service container configuration",
+ "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required",
"symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -503,30 +725,30 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
- "time": "2017-04-04T07:26:27+00:00"
+ "time": "2018-04-29T14:04:08+00:00"
},
{
"name": "symfony/expression-language",
- "version": "v3.2.7",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/expression-language.git",
- "reference": "01655cd1e0989243371587e1f9b2fc6b080f430f"
+ "reference": "867e4d1f5d4e52435a8ffff6b24fd6a801582241"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/expression-language/zipball/01655cd1e0989243371587e1f9b2fc6b080f430f",
- "reference": "01655cd1e0989243371587e1f9b2fc6b080f430f",
+ "url": "https://api.github.com/repos/symfony/expression-language/zipball/867e4d1f5d4e52435a8ffff6b24fd6a801582241",
+ "reference": "867e4d1f5d4e52435a8ffff6b24fd6a801582241",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
- "symfony/cache": "~3.1"
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/cache": "~3.1|~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -553,29 +775,29 @@
],
"description": "Symfony ExpressionLanguage Component",
"homepage": "https://symfony.com",
- "time": "2017-04-04T07:26:27+00:00"
+ "time": "2018-01-03T07:37:34+00:00"
},
{
"name": "symfony/filesystem",
- "version": "v3.2.7",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "64421e6479c4a8e60d790fb666bd520992861b66"
+ "reference": "253a4490b528597aa14d2bf5aeded6f5e5e4a541"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/64421e6479c4a8e60d790fb666bd520992861b66",
- "reference": "64421e6479c4a8e60d790fb666bd520992861b66",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/253a4490b528597aa14d2bf5aeded6f5e5e4a541",
+ "reference": "253a4490b528597aa14d2bf5aeded6f5e5e4a541",
"shasum": ""
},
"require": {
- "php": ">=5.5.9"
+ "php": "^5.5.9|>=7.0.8"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -602,29 +824,29 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2017-03-26T15:47:15+00:00"
+ "time": "2018-02-22T10:48:49+00:00"
},
{
"name": "symfony/finder",
- "version": "v3.2.7",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "b20900ce5ea164cd9314af52725b0bb5a758217a"
+ "reference": "bd14efe8b1fabc4de82bf50dce62f05f9a102433"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/b20900ce5ea164cd9314af52725b0bb5a758217a",
- "reference": "b20900ce5ea164cd9314af52725b0bb5a758217a",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/bd14efe8b1fabc4de82bf50dce62f05f9a102433",
+ "reference": "bd14efe8b1fabc4de82bf50dce62f05f9a102433",
"shasum": ""
},
"require": {
- "php": ">=5.5.9"
+ "php": "^5.5.9|>=7.0.8"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -651,20 +873,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2017-03-20T09:32:19+00:00"
+ "time": "2018-04-04T05:07:11+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.3.0",
+ "version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
+ "reference": "3296adf6a6454a050679cde90f95350ad604b171"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
- "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
+ "reference": "3296adf6a6454a050679cde90f95350ad604b171",
"shasum": ""
},
"require": {
@@ -676,7 +898,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.3-dev"
+ "dev-master": "1.8-dev"
}
},
"autoload": {
@@ -710,29 +932,29 @@
"portable",
"shim"
],
- "time": "2016-11-14T01:06:16+00:00"
+ "time": "2018-04-26T10:06:28+00:00"
},
{
"name": "symfony/stopwatch",
- "version": "v3.2.7",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
- "reference": "c5ee0f8650c84b4d36a5f76b3b504233feaabf75"
+ "reference": "eb17cfa072cab26537ac37e9c4ece6c0361369af"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/stopwatch/zipball/c5ee0f8650c84b4d36a5f76b3b504233feaabf75",
- "reference": "c5ee0f8650c84b4d36a5f76b3b504233feaabf75",
+ "url": "https://api.github.com/repos/symfony/stopwatch/zipball/eb17cfa072cab26537ac37e9c4ece6c0361369af",
+ "reference": "eb17cfa072cab26537ac37e9c4ece6c0361369af",
"shasum": ""
},
"require": {
- "php": ">=5.5.9"
+ "php": "^5.5.9|>=7.0.8"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -759,38 +981,88 @@
],
"description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com",
- "time": "2017-02-18T17:28:00+00:00"
+ "time": "2018-02-17T14:55:25+00:00"
+ },
+ {
+ "name": "webmozart/assert",
+ "version": "1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/webmozart/assert.git",
+ "reference": "0df1908962e7a3071564e857d86874dad1ef204a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a",
+ "reference": "0df1908962e7a3071564e857d86874dad1ef204a",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.6",
+ "sebastian/version": "^1.0.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Webmozart\\Assert\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Assertions to validate method input/output with nice error messages.",
+ "keywords": [
+ "assert",
+ "check",
+ "validate"
+ ],
+ "time": "2018-01-29T19:49:41+00:00"
}
],
"packages-dev": [
{
"name": "doctrine/instantiator",
- "version": "1.0.5",
+ "version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
- "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
+ "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
- "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+ "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
"shasum": ""
},
"require": {
- "php": ">=5.3,<8.0-DEV"
+ "php": "^7.1"
},
"require-dev": {
"athletic/athletic": "~0.1.8",
"ext-pdo": "*",
"ext-phar": "*",
- "phpunit/phpunit": "~4.0",
- "squizlabs/php_codesniffer": "~2.0"
+ "phpunit/phpunit": "^6.2.3",
+ "squizlabs/php_codesniffer": "^3.0.2"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.2.x-dev"
}
},
"autoload": {
@@ -815,20 +1087,20 @@
"constructor",
"instantiate"
],
- "time": "2015-06-14T21:17:01+00:00"
+ "time": "2017-07-22T11:58:36+00:00"
},
{
"name": "mikey179/vfsStream",
- "version": "v1.6.4",
+ "version": "v1.6.5",
"source": {
"type": "git",
"url": "https://github.com/mikey179/vfsStream.git",
- "reference": "0247f57b2245e8ad2e689d7cee754b45fbabd592"
+ "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/0247f57b2245e8ad2e689d7cee754b45fbabd592",
- "reference": "0247f57b2245e8ad2e689d7cee754b45fbabd592",
+ "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145",
+ "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145",
"shasum": ""
},
"require": {
@@ -861,37 +1133,37 @@
],
"description": "Virtual file system to mock the real file system in unit tests.",
"homepage": "http://vfs.bovigo.org/",
- "time": "2016-07-18T14:02:57+00:00"
+ "time": "2017-08-01T08:02:14+00:00"
},
{
"name": "phpspec/prophecy",
- "version": "v1.7.0",
+ "version": "1.7.6",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "93d39f1f7f9326d746203c7c056f300f7f126073"
+ "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073",
- "reference": "93d39f1f7f9326d746203c7c056f300f7f126073",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
+ "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
- "phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
- "sebastian/comparator": "^1.1|^2.0",
+ "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
+ "sebastian/comparator": "^1.1|^2.0|^3.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0"
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
- "phpunit/phpunit": "^4.8 || ^5.6.5"
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.6.x-dev"
+ "dev-master": "1.7.x-dev"
}
},
"autoload": {
@@ -924,7 +1196,7 @@
"spy",
"stub"
],
- "time": "2017-03-02T20:05:34+00:00"
+ "time": "2018-04-18T13:57:24+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -990,16 +1262,16 @@
},
{
"name": "phpunit/php-file-iterator",
- "version": "1.4.2",
+ "version": "1.4.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5"
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
- "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
"shasum": ""
},
"require": {
@@ -1033,7 +1305,7 @@
"filesystem",
"iterator"
],
- "time": "2016-10-03T07:40:28+00:00"
+ "time": "2017-11-27T13:52:08+00:00"
},
{
"name": "phpunit/php-text-template",
@@ -1127,16 +1399,16 @@
},
{
"name": "phpunit/php-token-stream",
- "version": "1.4.11",
+ "version": "1.4.12",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7"
+ "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7",
- "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
+ "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
"shasum": ""
},
"require": {
@@ -1172,20 +1444,20 @@
"keywords": [
"tokenizer"
],
- "time": "2017-02-27T10:12:30+00:00"
+ "time": "2017-12-04T08:55:13+00:00"
},
{
"name": "phpunit/phpunit",
- "version": "4.8.35",
+ "version": "4.8.36",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87"
+ "reference": "46023de9a91eec7dfb06cc56cb4e260017298517"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87",
- "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517",
+ "reference": "46023de9a91eec7dfb06cc56cb4e260017298517",
"shasum": ""
},
"require": {
@@ -1244,7 +1516,7 @@
"testing",
"xunit"
],
- "time": "2017-02-06T05:18:07+00:00"
+ "time": "2017-06-21T08:07:12+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
@@ -1368,23 +1640,23 @@
},
{
"name": "sebastian/diff",
- "version": "1.4.1",
+ "version": "1.4.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
- "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^5.3.3 || ^7.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.8"
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
"extra": {
@@ -1416,7 +1688,7 @@
"keywords": [
"diff"
],
- "time": "2015-12-08T07:14:41+00:00"
+ "time": "2017-05-22T07:24:03+00:00"
},
{
"name": "sebastian/environment",
@@ -1676,23 +1948,26 @@
},
{
"name": "symfony/yaml",
- "version": "v3.2.7",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621"
+ "reference": "033cfa61ef06ee0847e056e530201842b6e926c3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/62b4cdb99d52cb1ff253c465eb1532a80cebb621",
- "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/033cfa61ef06ee0847e056e530201842b6e926c3",
+ "reference": "033cfa61ef06ee0847e056e530201842b6e926c3",
"shasum": ""
},
"require": {
- "php": ">=5.5.9"
+ "php": "^5.5.9|>=7.0.8"
+ },
+ "conflict": {
+ "symfony/console": "<3.4"
},
"require-dev": {
- "symfony/console": "~2.8|~3.0"
+ "symfony/console": "~3.4|~4.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
@@ -1700,7 +1975,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "3.4-dev"
}
},
"autoload": {
@@ -1727,7 +2002,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2017-03-20T09:45:15+00:00"
+ "time": "2018-04-08T08:21:29+00:00"
}
],
"aliases": [],
diff --git a/src/TypeGuessing/ConstructorResolver/ConstructorResolver.php b/src/TypeGuessing/ConstructorResolver/ConstructorResolver.php
index 9c5683a..27cfcf9 100644
--- a/src/TypeGuessing/ConstructorResolver/ConstructorResolver.php
+++ b/src/TypeGuessing/ConstructorResolver/ConstructorResolver.php
@@ -46,7 +46,7 @@ public function addVisitor(VisitorInterface $visitor)
public function resolveConstructor(Node\Stmt\Class_ $node)
{
foreach ($node->stmts as $key => $stmt) {
- if ($stmt instanceof Node\Stmt\ClassMethod && $stmt->name === '__construct') {
+ if ($stmt instanceof Node\Stmt\ClassMethod && $stmt->name->toString() === '__construct') {
// this will make problems we need an layer above which chains the variable resolvers
// because we need may need more than this resolver
diff --git a/src/TypeGuessing/SymbolTable/Resolver/ArgumentResolver.php b/src/TypeGuessing/SymbolTable/Resolver/ArgumentResolver.php
index 4250a4b..e0b018e 100644
--- a/src/TypeGuessing/SymbolTable/Resolver/ArgumentResolver.php
+++ b/src/TypeGuessing/SymbolTable/Resolver/ArgumentResolver.php
@@ -26,7 +26,7 @@ public function __construct(SymbolTable $table)
public function resolveVariableType(Node $node)
{
if ($node instanceof Node\Param && $node->type instanceof Node\Name) {
- $this->table->setSymbol($node->name, $node->type->toString());
+ $this->table->setSymbol($node->var->name, $node->type->toString());
}
}
}
diff --git a/src/TypeGuessing/SymbolTable/Resolver/PropertyAssignResolver.php b/src/TypeGuessing/SymbolTable/Resolver/PropertyAssignResolver.php
index ba83f7c..5d2b5ba 100644
--- a/src/TypeGuessing/SymbolTable/Resolver/PropertyAssignResolver.php
+++ b/src/TypeGuessing/SymbolTable/Resolver/PropertyAssignResolver.php
@@ -49,7 +49,10 @@ public function resolveVariableType(Node $node)
}
// @TODO change to be able to use all types of properties like $x->x = 10
- if ($node->var->var->name !== 'this' || !is_string($node->var->name)) {
+ if ($node->var->var->name !== 'this' ||
+ $node->var->name instanceof Node\Expr\Variable ||
+ $node->var->name instanceof Node\Identifier && !is_string($node->var->name->toString())
+ ) {
return;
}
@@ -58,7 +61,7 @@ public function resolveVariableType(Node $node)
if ($node->expr->class instanceof Node\Name) {
$type = $node->expr->class->toString();
$node->var->setAttribute('guessedType', $type);
- $this->table->setClassProperty($node->var->name, $type);
+ $this->table->setClassProperty($node->var->name->toString(), $type);
}
}
@@ -66,14 +69,14 @@ public function resolveVariableType(Node $node)
if ($node->expr instanceof Node\Expr\Variable) {
$type = $this->table->lookUp($node->expr->name)->type();
$node->var->setAttribute('guessedType', $type);
- $this->table->setClassProperty($node->var->name, $type);
+ $this->table->setClassProperty($node->var->name->toString(), $type);
}
// $this->x = $this->y;
if ($node->expr instanceof Node\Expr\PropertyFetch) {
$type = $this->table->lookUpClassProperty($node->expr->name)->type();
$node->var->setAttribute('guessedType', $type);
- $this->table->setClassProperty($node->var->name, $type);
+ $this->table->setClassProperty($node->var->name->toString(), $type);
}
}
}
diff --git a/src/TypeGuessing/SymbolTable/Resolver/ReattachStateToProperty.php b/src/TypeGuessing/SymbolTable/Resolver/ReattachStateToProperty.php
index 72b5da2..e126a66 100644
--- a/src/TypeGuessing/SymbolTable/Resolver/ReattachStateToProperty.php
+++ b/src/TypeGuessing/SymbolTable/Resolver/ReattachStateToProperty.php
@@ -38,7 +38,7 @@ public function resolveVariableType(Node $node)
if ($node instanceof Node\Expr\PropertyFetch) {
// $this->someProperty
if ($node->var instanceof Node\Expr\Variable && $node->var->name === 'this') {
- $node->setAttribute('guessedType', $this->table->lookUpClassProperty($node->name)->type());
+ $node->setAttribute('guessedType', $this->table->lookUpClassProperty($node->name->toString())->type());
}
// $x->someProperty
diff --git a/src/TypeGuessing/SymbolTable/Resolver/SymfonyResolver.php b/src/TypeGuessing/SymbolTable/Resolver/SymfonyResolver.php
index 20eb937..862c5bf 100644
--- a/src/TypeGuessing/SymbolTable/Resolver/SymfonyResolver.php
+++ b/src/TypeGuessing/SymbolTable/Resolver/SymfonyResolver.php
@@ -45,7 +45,8 @@ public function resolveVariableType(Node $node)
} else {
$context = $this->table->lookUp($node->var->name)->type();
}
- $type = $this->getType($context, $node->name, $node);
+
+ $type = $this->getType($context, $node->name->toString(), $node);
if (null !== $type) {
$node->setAttribute('guessedType', $type);
@@ -64,7 +65,7 @@ public function resolveVariableType(Node $node)
} else {
$context = $this->table->lookUp($node->expr->var->name)->type();
}
- $type = $this->getType($context, $node->expr->name, $node->expr);
+ $type = $this->getType($context, $node->expr->name->toString(), $node->expr);
if (null !== $type) {
$node->var->setAttribute('guessedType', $type);
@@ -73,6 +74,12 @@ public function resolveVariableType(Node $node)
}
}
+ private static $helper = [
+ 'getDoctrine' => 'Doctrine\Bundle\DoctrineBundle\Registry',
+ 'createForm' => 'Symfony\Component\Form\Form',
+ 'createFormBuilder' => 'Symfony\Component\Form\FormBuilder'
+ ];
+
/**
* @param $context
* @param $methodName
@@ -83,19 +90,16 @@ public function resolveVariableType(Node $node)
protected function getType($context, $methodName, Node $node = null)
{
if ($this->isController($context)) {
- switch ($methodName) {
- case 'getDoctrine':
- return 'Doctrine\Bundle\DoctrineBundle\Registry';
- case 'createForm':
- return 'Symfony\Component\Form\Form';
- case 'createFormBuilder':
- return 'Symfony\Component\Form\FormBuilder';
+
+ if (isset(self::$helper[$methodName])) {
+ return self::$helper[$methodName];
}
}
- if ('get' === $methodName && ($this->isController($context) || self::CONTAINER == $context)) {
- if ($node instanceof Node && isset($node->var)
- && ($node->var->name == 'this' || $node->var->name == 'container')
+ if ('get' === $methodName || self::CONTAINER == $context) {
+ if ($node instanceof Node &&
+ isset($node->var) &&
+ ($node->var->name == 'this' || $node->var->name == 'container')
) {
if ($node->args[0]->value instanceof Node\Scalar\String_) {
$serviceId = $node->args[0]->value->value;
diff --git a/src/Visitor/Deprecation/FindDeprecatedTagsVisitor.php b/src/Visitor/Deprecation/FindDeprecatedTagsVisitor.php
index 313dd82..3bc66ee 100644
--- a/src/Visitor/Deprecation/FindDeprecatedTagsVisitor.php
+++ b/src/Visitor/Deprecation/FindDeprecatedTagsVisitor.php
@@ -3,6 +3,7 @@
namespace SensioLabs\DeprecationDetector\Visitor\Deprecation;
use phpDocumentor\Reflection\DocBlock;
+use phpDocumentor\Reflection\DocBlockFactory;
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
use SensioLabs\DeprecationDetector\FileInfo\Deprecation\ClassDeprecation;
@@ -55,7 +56,7 @@ public function enterNode(Node $node)
if ($node instanceof Node\Stmt\Function_) {
$this->phpFileInfo->addFunctionDeprecation(
- new FunctionDeprecation($node->name, $this->getDeprecatedDocComment($node))
+ new FunctionDeprecation($node->name->toString(), $this->getDeprecatedDocComment($node))
);
return;
@@ -79,7 +80,11 @@ public function enterNode(Node $node)
if ($node instanceof Node\Stmt\ClassMethod) {
$this->phpFileInfo->addMethodDeprecation(
- new MethodDeprecation($this->parentName, $node->name, $this->getDeprecatedDocComment($node))
+ new MethodDeprecation(
+ $this->parentName,
+ $node->name->toString(),
+ $this->getDeprecatedDocComment($node)
+ )
);
return;
@@ -104,7 +109,8 @@ public function leaveNode(Node $node)
protected function hasDeprecatedDocComment(Node $node)
{
try {
- $docBlock = new DocBlock((string) $node->getDocComment());
+ $factory = DocBlockFactory::createInstance();
+ $docBlock = $factory->create((string) $node->getDocComment());
return count($docBlock->getTagsByName('deprecated')) > 0;
} catch (\Exception $e) {
@@ -120,15 +126,15 @@ protected function hasDeprecatedDocComment(Node $node)
protected function getDeprecatedDocComment(Node $node)
{
try {
- $docBlock = new DocBlock((string) $node->getDocComment());
- /** @var DocBlock\Tag\DeprecatedTag[] $deprecatedTag */
- $deprecatedTag = $docBlock->getTagsByName('deprecated');
+ $factory = DocBlockFactory::createInstance();
+ $docBlock = $factory->create((string) $node->getDocComment());
+ $deprecatedTags = $docBlock->getTagsByName('deprecated');
- if (0 === count($deprecatedTag)) {
+ if (0 === count($deprecatedTags)) {
return;
}
- $comment = $deprecatedTag[0]->getContent();
+ $comment = (string) $deprecatedTags[0];
return preg_replace('/[[:blank:]]+/', ' ', $comment);
} catch (\Exception $e) {
diff --git a/src/Visitor/Usage/FindMethodCalls.php b/src/Visitor/Usage/FindMethodCalls.php
index bb6f439..6ef8587 100644
--- a/src/Visitor/Usage/FindMethodCalls.php
+++ b/src/Visitor/Usage/FindMethodCalls.php
@@ -52,14 +52,14 @@ public function enterNode(Node $node)
}
// skips variable methods like $definition->$method
- if (!is_string($node->name)) {
+ if (!$node->name instanceof Node\Identifier) {
return;
}
$type = $node->var->getAttribute('guessedType', null);
if (null !== $type) {
- $methodUsage = new MethodUsage($node->name, $type, $node->getLine(), false);
+ $methodUsage = new MethodUsage($node->name->toString(), $type, $node->getLine(), false);
$this->phpFileInfo->addMethodUsage($methodUsage);
}
}
diff --git a/src/Visitor/Usage/FindMethodDefinitions.php b/src/Visitor/Usage/FindMethodDefinitions.php
index 5518d73..4dff45a 100644
--- a/src/Visitor/Usage/FindMethodDefinitions.php
+++ b/src/Visitor/Usage/FindMethodDefinitions.php
@@ -41,12 +41,12 @@ public function enterNode(Node $node)
if (isset($node->namespacedName)) {
$this->parentName = $node->namespacedName->toString();
} else {
- $this->parentName = $node->name;
+ $this->parentName = $node->name->toString();
}
}
if ($node instanceof Node\Stmt\ClassMethod) {
- $methodDefinition = new MethodDefinition($node->name, $this->parentName, $node->getLine());
+ $methodDefinition = new MethodDefinition($node->name->toString(), $this->parentName, $node->getLine());
$this->phpFileInfo->addMethodDefinition($methodDefinition);
}
}
diff --git a/src/Visitor/Usage/FindStaticMethodCalls.php b/src/Visitor/Usage/FindStaticMethodCalls.php
index 0fbf7a7..49fa60f 100644
--- a/src/Visitor/Usage/FindStaticMethodCalls.php
+++ b/src/Visitor/Usage/FindStaticMethodCalls.php
@@ -41,7 +41,7 @@ public function enterNode(Node $node)
if (isset($node->namespacedName)) {
$this->parentName = $node->namespacedName->toString();
} else {
- $this->parentName = $node->name;
+ $this->parentName = $node->name->toString();
}
}
@@ -52,7 +52,7 @@ public function enterNode(Node $node)
}
// skips variable methods like $definition->$method
- if (!is_string($node->name)) {
+ if (!$node->name instanceof Node\Identifier) {
return;
}
@@ -69,7 +69,7 @@ public function enterNode(Node $node)
}
}
- $methodUsage = new MethodUsage($node->name, $className, $node->getLine(), true);
+ $methodUsage = new MethodUsage($node->name->toString(), $className, $node->getLine(), true);
$this->phpFileInfo->addMethodUsage($methodUsage);
}
}
diff --git a/tests/Console/Output/VerboseProgressOutputTest.php b/tests/Console/Output/VerboseProgressOutputTest.php
deleted file mode 100644
index 7c4711f..0000000
--- a/tests/Console/Output/VerboseProgressOutputTest.php
+++ /dev/null
@@ -1,130 +0,0 @@
-prophesize('Symfony\Component\Console\Helper\ProgressBar');
-
- $verboseProgressOutput = new VerboseProgressOutput(
- $progressBar->reveal(),
- false,
- 'a progress bar label'
- );
-
- $this->assertInstanceOf(
- 'SensioLabs\DeprecationDetector\Console\Output\VerboseProgressOutput',
- $verboseProgressOutput
- );
- }
-
- public function testStart()
- {
- $progressBar = $this->prophesize('Symfony\Component\Console\Helper\ProgressBar');
- $progressBar->setFormat(Argument::any())->shouldBeCalled();
- $progressBar->start(Argument::any())->shouldBeCalled();
-
- $verboseProgressOutput = new VerboseProgressOutput(
- $progressBar->reveal(),
- true,
- 'a progress bar label'
- );
-
- $verboseProgressOutput->start(10);
- }
-
- public function testStartGeneratedOutputOnlyInVerboseMode()
- {
- $progressBar = $this->prophesize('Symfony\Component\Console\Helper\ProgressBar');
- $progressBar->setFormat(Argument::any())->shouldNotBeCalled();
- $progressBar->start(Argument::any())->shouldNotBeCalled();
-
- $verboseProgressOutput = new VerboseProgressOutput(
- $progressBar->reveal(),
- false,
- 'a progress bar label'
- );
-
- $verboseProgressOutput->start(10);
- }
-
- public function testAdvanceSetsFormatIfIsFirstFileProcessed()
- {
- $label = 'a progress bar label';
- $format = '%message%'."\n".$label.': %current%/%max%';
-
- $progressBar = $this->prophesize('Symfony\Component\Console\Helper\ProgressBar');
- $progressBar->clear()->shouldBeCalled();
- $progressBar->advance()->shouldBeCalled();
- $progressBar->display()->shouldBeCalled();
- $progressBar->setFormat($format)->shouldBeCalled();
-
- $phpFileInfo = $this->prophesize('SensioLabs\DeprecationDetector\FileInfo\PhpFileInfo');
- $phpFileInfo->getRelativePathname()->willReturn($message = 'Path/To/The/Parsed/File');
- $progressBar->setMessage($message)->shouldBeCalled();
-
- $verboseProgressOutput = new VerboseProgressOutput(
- $progressBar->reveal(),
- true,
- $label
- );
-
- $verboseProgressOutput->advance(1, $phpFileInfo->reveal());
- }
-
- public function testAdvanceGeneratedOutputOnlyInVerboseMode()
- {
- $progressBar = $this->prophesize('Symfony\Component\Console\Helper\ProgressBar');
- $progressBar->clear()->shouldNotBeCalled();
- $progressBar->setFormat(Argument::any())->shouldNotBeCalled();
- $progressBar->setMessage(Argument::any())->shouldNotBeCalled();
- $progressBar->clear()->shouldNotBeCalled();
- $progressBar->advance()->shouldNotBeCalled();
- $progressBar->display()->shouldNotBeCalled();
-
- $phpFileInfo = $this->prophesize('SensioLabs\DeprecationDetector\FileInfo\PhpFileInfo');
-
- $verboseProgressOutput = new VerboseProgressOutput(
- $progressBar->reveal(),
- false,
- 'a progress bar label'
- );
-
- $verboseProgressOutput->advance(100, $phpFileInfo->reveal());
- }
-
- public function testEnd()
- {
- $progressBar = $this->prophesize('Symfony\Component\Console\Helper\ProgressBar');
- $progressBar->clear()->shouldBeCalled();
- $progressBar->finish()->shouldBeCalled();
-
- $verboseProgressOutput = new VerboseProgressOutput(
- $progressBar->reveal(),
- true,
- 'a progress bar label'
- );
-
- $verboseProgressOutput->end();
- }
-
- public function testEndGeneratedOutputOnlyInVerboseMode()
- {
- $progressBar = $this->prophesize('Symfony\Component\Console\Helper\ProgressBar');
- $progressBar->clear()->shouldNotBeCalled();
- $progressBar->finish()->shouldNotBeCalled();
-
- $verboseProgressOutput = new VerboseProgressOutput(
- $progressBar->reveal(),
- false,
- 'a progress bar label'
- );
-
- $verboseProgressOutput->end();
- }
-}
diff --git a/tests/Parser/DeprecationParserTest.php b/tests/Parser/DeprecationParserTest.php
index 80f3ffb..fdc2a8c 100644
--- a/tests/Parser/DeprecationParserTest.php
+++ b/tests/Parser/DeprecationParserTest.php
@@ -28,7 +28,9 @@ public function testAddDeprecationVisitor()
public function testParseFile()
{
- $phpFileInfo = $this->prophesize('SensioLabs\DeprecationDetector\FileInfo\PhpFileInfo')->reveal();
+ $phpFileInfo = $this->prophesize('SensioLabs\DeprecationDetector\FileInfo\PhpFileInfo');
+ $phpFileInfo->getContents()->willReturn('')->shouldBeCalled();
+ $phpFileInfo = $phpFileInfo->reveal();
$visitor = $this->prophesize('SensioLabs\DeprecationDetector\Visitor\DeprecationVisitorInterface');
$visitor->setPhpFileInfo($phpFileInfo)->shouldBeCalled();
@@ -44,6 +46,7 @@ public function testParseFile()
array($visitor->reveal(), $anotherVisitor->reveal()),
$baseTraverser->reveal()
);
+
$deprecationParser->parseFile($phpFileInfo);
}
}
diff --git a/tests/RuleSet/CacheTest.php b/tests/RuleSet/CacheTest.php
index 484f3db..5264875 100644
--- a/tests/RuleSet/CacheTest.php
+++ b/tests/RuleSet/CacheTest.php
@@ -2,7 +2,9 @@
namespace SensioLabs\DeprecationDetector\Tests\RuleSet;
+use Prophecy\Argument;
use SensioLabs\DeprecationDetector\RuleSet\Cache;
+use SensioLabs\DeprecationDetector\RuleSet\RuleSet;
class CacheTest extends \PHPUnit_Framework_TestCase
{
@@ -40,9 +42,10 @@ public function testHasKey()
public function testSaveCacheIfEnabled()
{
- $ruleset = $this->prophesize('SensioLabs\DeprecationDetector\RuleSet\RuleSet')->reveal();
+ $ruleset = new RuleSet();
+
$filesystem = $this->prophesize('Symfony\Component\Filesystem\Filesystem');
- $filesystem->dumpFile('.rules/id', serialize($ruleset))->shouldBeCalled();
+ $filesystem->dumpFile(Argument::exact('.rules/id'), Argument::exact(serialize($ruleset)))->shouldBeCalled();
$cache = new Cache($filesystem->reveal());
$cache->cacheRuleSet('id', $ruleset);
diff --git a/tests/TypeGuessing/SymbolTable/Resolver/ArgumentResolverTest.php b/tests/TypeGuessing/SymbolTable/Resolver/ArgumentResolverTest.php
index 8f4440c..2a601f8 100644
--- a/tests/TypeGuessing/SymbolTable/Resolver/ArgumentResolverTest.php
+++ b/tests/TypeGuessing/SymbolTable/Resolver/ArgumentResolverTest.php
@@ -2,6 +2,7 @@
namespace SensioLabs\DeprecationDetector\Tests\TypeGuessing\SymbolTable\Resolver;
+use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Name;
use PhpParser\Node\Param;
use SensioLabs\DeprecationDetector\TypeGuessing\SymbolTable\Resolver\ArgumentResolver;
@@ -25,7 +26,8 @@ public function testResolveTypedArgument()
$table->setSymbol('var', 'SomeClass')->shouldBeCalled();
$resolver = new ArgumentResolver($table->reveal());
- $param = new Param('var', null, new Name('SomeClass'));
+ $param = new Param(new Variable('var'), null, new Name('SomeClass'));
+
$resolver->resolveVariableType($param);
}
@@ -35,7 +37,7 @@ public function testSkipsUntypedArgument()
$table->setSymbol('var', 'SomeClass')->shouldNotBeCalled();
$resolver = new ArgumentResolver($table->reveal());
- $param = new Param('var');
+ $param = new Param(new Variable('var'));
$resolver->resolveVariableType($param);
}
}
diff --git a/tests/TypeGuessing/SymbolTable/Resolver/SymfonyResolverTest.php b/tests/TypeGuessing/SymbolTable/Resolver/SymfonyResolverTest.php
index e3d7adf..db227e1 100644
--- a/tests/TypeGuessing/SymbolTable/Resolver/SymfonyResolverTest.php
+++ b/tests/TypeGuessing/SymbolTable/Resolver/SymfonyResolverTest.php
@@ -89,6 +89,7 @@ public function testAssignmentCall()
$resolver->resolveVariableType($assign1);
$this->assertEquals('Doctrine\Bundle\DoctrineBundle\Registry', $assign1->var->getAttribute('guessedType'));
+
$resolver->resolveVariableType($assign2);
$this->assertEquals('Symfony\Component\Form\Form', $assign2->var->getAttribute('guessedType'));
$resolver->resolveVariableType($assign3);
diff --git a/tests/Visitor/Usage/FindStaticMethodCallsTest.php b/tests/Visitor/Usage/FindStaticMethodCallsTest.php
index ef03b5a..ca84dd5 100644
--- a/tests/Visitor/Usage/FindStaticMethodCallsTest.php
+++ b/tests/Visitor/Usage/FindStaticMethodCallsTest.php
@@ -32,6 +32,7 @@ public function testNoNewStatement()
);
$usages = $phpFileInfo->methodUsages();
+
$this->assertEquals(
new MethodUsage('bazinga', 'Bar', 3, true),
$usages[0]