diff --git a/.travis.yml b/.travis.yml index f777d98..7ccf910 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,10 +7,11 @@ php: - 5.5 - 5.6 - 7.0 - - hhvm matrix: fast_finish: true + allow_failures: + - php: 5.4 before_install: - phpenv config-rm xdebug.ini || true diff --git a/README.md b/README.md index 72d76cd..8ac0c22 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Based on data from these sources the Refactoring Browser consists of two distinc ## Install & Basic Usage -[Download PHAR](https://github.com/QafooLabs/php-refactoring-browser/releases) +[Download PHAR](https://github.com/AJenbo/php-refactoring-browser/releases) The refactoring browser is used with: diff --git a/composer.json b/composer.json index 52bcc2c..1f792fe 100644 --- a/composer.json +++ b/composer.json @@ -7,10 +7,17 @@ {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"} ], + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/AJenbo/PHP-Token-Reflection" + } + ], + "require": { "nikic/php-parser": "~2.1", "beberlei/assert": "~2.3", - "andrewsville/php-token-reflection": "~1.4", + "POPSuL/php-token-reflection": "dev-develop", "symfony/finder": "~2.4", "symfony/console": "~2.4", "tomphp/patch-builder": "~0.1" diff --git a/composer.lock b/composer.lock index 30257ec..e1cabe9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,68 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "65e64a201ab092fabc9d1d854154d30f", - "content-hash": "e3d9aa5afaf15f0d99d52dc2d228fbf1", + "content-hash": "69f1d3096260391b5c482defdfa591c4", "packages": [ - { - "name": "andrewsville/php-token-reflection", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/Andrewsville/PHP-Token-Reflection.git", - "reference": "e6d0ac2baf66cdf154be34c3d2a2aa1bd4b426ee" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Andrewsville/PHP-Token-Reflection/zipball/e6d0ac2baf66cdf154be34c3d2a2aa1bd4b426ee", - "reference": "e6d0ac2baf66cdf154be34c3d2a2aa1bd4b426ee", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "TokenReflection": "./" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3" - ], - "authors": [ - { - "name": "Ondřej Nešpor", - "homepage": "https://github.com/andrewsville" - }, - { - "name": "Jaroslav Hanslík", - "homepage": "https://github.com/kukulich" - } - ], - "description": "Library emulating the PHP internal reflection using just the tokenized source code.", - "homepage": "http://andrewsville.github.com/PHP-Token-Reflection/", - "keywords": [ - "library", - "reflection", - "tokenizer" - ], - "time": "2014-08-06 16:37:08" - }, { "name": "beberlei/assert", - "version": "v2.5", + "version": "v2.7.6", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "91e2690c4ecc8a4e3e2d333430069f6a0c694a7a" + "reference": "8726e183ebbb0169cb6cb4832e22ebd355524563" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/91e2690c4ecc8a4e3e2d333430069f6a0c694a7a", - "reference": "91e2690c4ecc8a4e3e2d333430069f6a0c694a7a", + "url": "https://api.github.com/repos/beberlei/assert/zipball/8726e183ebbb0169cb6cb4832e22ebd355524563", + "reference": "8726e183ebbb0169cb6cb4832e22ebd355524563", "shasum": "" }, "require": { @@ -73,17 +25,13 @@ "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "@stable" + "friendsofphp/php-cs-fixer": "^2.1.1", + "phpunit/phpunit": "^4|^5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, "autoload": { - "psr-0": { - "Assert": "lib/" + "psr-4": { + "Assert\\": "lib/Assert" }, "files": [ "lib/Assert/functions.php" @@ -96,7 +44,13 @@ "authors": [ { "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" + "email": "kontakt@beberlei.de", + "role": "Lead Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Collaborator" } ], "description": "Thin assertion library for input validation in business models.", @@ -105,20 +59,20 @@ "assertion", "validation" ], - "time": "2016-03-22 14:34:51" + "time": "2017-05-04 02:00:24" }, { "name": "nikic/php-parser", - "version": "v2.1.0", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "47b254ea51f1d6d5dc04b9b299e88346bf2369e3" + "reference": "4dd659edadffdc2143e4753df655d866dbfeedf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/47b254ea51f1d6d5dc04b9b299e88346bf2369e3", - "reference": "47b254ea51f1d6d5dc04b9b299e88346bf2369e3", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4dd659edadffdc2143e4753df655d866dbfeedf0", + "reference": "4dd659edadffdc2143e4753df655d866dbfeedf0", "shasum": "" }, "require": { @@ -156,7 +110,7 @@ "parser", "php" ], - "time": "2016-04-19 13:41:41" + "time": "2016-09-16 12:04:44" }, { "name": "phpspec/php-diff", @@ -185,28 +139,139 @@ "authors": [ { "name": "Chris Boulton", - "homepage": "http://github.com/chrisboulton" + "homepage": "http://github.com/chrisboulton", + "role": "Original developer" } ], "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", "time": "2013-11-01 13:02:21" }, + { + "name": "popsul/php-token-reflection", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/AJenbo/PHP-Token-Reflection.git", + "reference": "21b9a442e62be8c1ba063a89f0f785807c98c96f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/AJenbo/PHP-Token-Reflection/zipball/21b9a442e62be8c1ba063a89f0f785807c98c96f", + "reference": "21b9a442e62be8c1ba063a89f0f785807c98c96f", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.0" + }, + "replace": { + "andrewsville/php-token-reflection": "*" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "autoload": { + "psr-0": { + "TokenReflection": "./" + } + }, + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ondřej Nešpor", + "homepage": "https://github.com/Andrewsville" + }, + { + "name": "Jaroslav Hanslík", + "homepage": "https://github.com/kukulich" + }, + { + "name": "Boris Momčilović", + "homepage": "https://github.com/kornrunner" + }, + { + "name": "Viktor Suprun", + "homepage": "https://github.com/POPSuL" + } + ], + "description": "Library emulating the PHP internal reflection using just the tokenized source code.", + "keywords": [ + "library", + "reflection", + "tokenizer" + ], + "support": { + "source": "https://github.com/AJenbo/PHP-Token-Reflection/tree/develop" + }, + "time": "2017-06-04 16:08:02" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10 12:19:37" + }, { "name": "symfony/console", - "version": "v2.8.6", + "version": "v2.8.21", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "48221d3de4dc22d2cd57c97e8b9361821da86609" + "reference": "efa4d466b67c2fc9bf9419a981e683e1f99fa029" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/48221d3de4dc22d2cd57c97e8b9361821da86609", - "reference": "48221d3de4dc22d2cd57c97e8b9361821da86609", + "url": "https://api.github.com/repos/symfony/console/zipball/efa4d466b67c2fc9bf9419a981e683e1f99fa029", + "reference": "efa4d466b67c2fc9bf9419a981e683e1f99fa029", "shasum": "" }, "require": { "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { @@ -249,20 +314,77 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com/", - "time": "2016-04-26 12:00:47" + "time": "2017-05-28 14:07:33" + }, + { + "name": "symfony/debug", + "version": "v3.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "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" + }, + "require-dev": { + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com/", + "time": "2016-07-30 07:22:48" }, { "name": "symfony/finder", - "version": "v2.8.6", + "version": "v2.8.21", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ca24cf2cd4e3826f571e0067e535758e73807aa1" + "reference": "b058a6f0cb6ee9b6b727aae03d5a62474a308528" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ca24cf2cd4e3826f571e0067e535758e73807aa1", - "reference": "ca24cf2cd4e3826f571e0067e535758e73807aa1", + "url": "https://api.github.com/repos/symfony/finder/zipball/b058a6f0cb6ee9b6b727aae03d5a62474a308528", + "reference": "b058a6f0cb6ee9b6b727aae03d5a62474a308528", "shasum": "" }, "require": { @@ -298,20 +420,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com/", - "time": "2016-03-10 10:53:53" + "time": "2017-05-25 22:57:22" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.1.1", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "1289d16209491b584839022f29257ad859b8532d" + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", - "reference": "1289d16209491b584839022f29257ad859b8532d", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", "shasum": "" }, "require": { @@ -323,7 +445,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -357,7 +479,7 @@ "portable", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-11-14 01:06:16" }, { "name": "tomphp/patch-builder", @@ -575,16 +697,16 @@ }, { "name": "mikey179/vfsStream", - "version": "v1.6.3", + "version": "v1.6.4", "source": { "type": "git", "url": "https://github.com/mikey179/vfsStream.git", - "reference": "c19925cd0390d3c436a0203ae859afa460d0474b" + "reference": "0247f57b2245e8ad2e689d7cee754b45fbabd592" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/c19925cd0390d3c436a0203ae859afa460d0474b", - "reference": "c19925cd0390d3c436a0203ae859afa460d0474b", + "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/0247f57b2245e8ad2e689d7cee754b45fbabd592", + "reference": "0247f57b2245e8ad2e689d7cee754b45fbabd592", "shasum": "" }, "require": { @@ -617,20 +739,20 @@ ], "description": "Virtual file system to mock the real file system in unit tests.", "homepage": "http://vfs.bovigo.org/", - "time": "2016-04-09 09:42:01" + "time": "2016-07-18 14:02:57" }, { "name": "phake/phake", - "version": "v2.3.0", + "version": "v2.3.2", "source": { "type": "git", "url": "https://github.com/mlively/Phake.git", - "reference": "2202d361d34f2712dcc257afdedc6c30060dc9bd" + "reference": "d5832f1a0dd2370e14d38bcbaeb6770e8546cff2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mlively/Phake/zipball/2202d361d34f2712dcc257afdedc6c30060dc9bd", - "reference": "2202d361d34f2712dcc257afdedc6c30060dc9bd", + "url": "https://api.github.com/repos/mlively/Phake/zipball/d5832f1a0dd2370e14d38bcbaeb6770e8546cff2", + "reference": "d5832f1a0dd2370e14d38bcbaeb6770e8546cff2", "shasum": "" }, "require": { @@ -675,41 +797,138 @@ "mock", "testing" ], - "time": "2016-03-04 18:49:33" + "time": "2017-03-20 05:16:34" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "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": "2015-12-27 11:43:31" }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "type": "library", + "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": "2016-09-30 07:12:33" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "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/" ] } @@ -721,39 +940,40 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" } ], - "time": "2015-02-03 12:10:50" + "time": "2016-11-25 06:54:22" }, { "name": "phpspec/prophecy", - "version": "v1.6.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -786,7 +1006,7 @@ "spy", "stub" ], - "time": "2016-02-15 07:46:21" + "time": "2017-03-02 20:05:34" }, { "name": "phpunit/php-code-coverage", @@ -852,16 +1072,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", "shasum": "" }, "require": { @@ -895,7 +1115,7 @@ "filesystem", "iterator" ], - "time": "2015-06-21 13:08:43" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -940,25 +1160,30 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.8", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4|~5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -980,20 +1205,20 @@ "keywords": [ "timer" ], - "time": "2016-05-12 18:03:57" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", - "version": "1.4.8", + "version": "1.4.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", "shasum": "" }, "require": { @@ -1029,20 +1254,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15 10:49:45" + "time": "2017-02-27 10:12:30" }, { "name": "phpunit/phpunit", - "version": "4.8.24", + "version": "4.8.35", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e" + "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", + "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", "shasum": "" }, "require": { @@ -1056,9 +1281,9 @@ "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", + "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", + "sebastian/comparator": "~1.2.2", "sebastian/diff": "~1.2", "sebastian/environment": "~1.3", "sebastian/exporter": "~1.2", @@ -1101,7 +1326,7 @@ "testing", "xunit" ], - "time": "2016-03-14 06:16:08" + "time": "2017-02-06 05:18:07" }, { "name": "phpunit/phpunit-mock-objects", @@ -1161,22 +1386,22 @@ }, { "name": "sebastian/comparator", - "version": "1.2.0", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { "php": ">=5.3.3", "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -1221,27 +1446,27 @@ "compare", "equality" ], - "time": "2015-07-26 15:48:44" + "time": "2017-01-29 09:50:25" }, { "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": { @@ -1273,27 +1498,27 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2017-05-22 07:24:03" }, { "name": "sebastian/environment", - "version": "1.3.6", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "2292b116f43c272ff4328083096114f84ea46a56" + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/2292b116f43c272ff4328083096114f84ea46a56", - "reference": "2292b116f43c272ff4328083096114f84ea46a56", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { @@ -1323,20 +1548,20 @@ "environment", "hhvm" ], - "time": "2016-05-04 07:59:13" + "time": "2016-08-18 05:49:44" }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -1344,12 +1569,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -1389,7 +1615,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -1444,16 +1670,16 @@ }, { "name": "sebastian/recursion-context", - "version": "1.0.2", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", "shasum": "" }, "require": { @@ -1493,7 +1719,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11 19:50:13" + "time": "2016-10-03 07:41:43" }, { "name": "sebastian/version", @@ -1532,22 +1758,25 @@ }, { "name": "symfony/config", - "version": "v2.8.6", + "version": "v2.8.21", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb" + "reference": "0b8541d18507d10204a08384640ff6df3c739ebe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/edbbcf33cffa2a85104fc80de8dc052cc51596bb", - "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb", + "url": "https://api.github.com/repos/symfony/config/zipball/0b8541d18507d10204a08384640ff6df3c739ebe", + "reference": "0b8541d18507d10204a08384640ff6df3c739ebe", "shasum": "" }, "require": { "php": ">=5.3.9", "symfony/filesystem": "~2.3|~3.0.0" }, + "require-dev": { + "symfony/yaml": "~2.7|~3.0.0" + }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" }, @@ -1581,20 +1810,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com/", - "time": "2016-04-20 18:52:26" + "time": "2017-04-12 14:07:15" }, { "name": "symfony/dependency-injection", - "version": "v2.8.6", + "version": "v2.8.21", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "bd04588c087651ceffdc45d40dc4de05af9c7c52" + "reference": "155b770e68150139779295864d6b6cb3172cd821" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/bd04588c087651ceffdc45d40dc4de05af9c7c52", - "reference": "bd04588c087651ceffdc45d40dc4de05af9c7c52", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/155b770e68150139779295864d6b6cb3172cd821", + "reference": "155b770e68150139779295864d6b6cb3172cd821", "shasum": "" }, "require": { @@ -1606,7 +1835,7 @@ "require-dev": { "symfony/config": "~2.2|~3.0.0", "symfony/expression-language": "~2.6|~3.0.0", - "symfony/yaml": "~2.1|~3.0.0" + "symfony/yaml": "~2.3.42|~2.7.14|~2.8.7|~3.0.7" }, "suggest": { "symfony/config": "", @@ -1644,20 +1873,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com/", - "time": "2016-05-09 18:12:35" + "time": "2017-05-25 22:57:22" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.6", + "version": "v2.8.21", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8" + "reference": "7fc8e2b4118ff316550596357325dfd92a51f531" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a158f13992a3147d466af7a23b564ac719a4ddd8", - "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7fc8e2b4118ff316550596357325dfd92a51f531", + "reference": "7fc8e2b4118ff316550596357325dfd92a51f531", "shasum": "" }, "require": { @@ -1665,7 +1894,7 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/config": "^2.0.5|~3.0.0", "symfony/dependency-injection": "~2.6|~3.0.0", "symfony/expression-language": "~2.6|~3.0.0", "symfony/stopwatch": "~2.3|~3.0.0" @@ -1704,20 +1933,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com/", - "time": "2016-05-03 18:59:18" + "time": "2017-04-26 16:56:54" }, { "name": "symfony/filesystem", - "version": "v3.0.6", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "74fec3511b62cb934b64bce1d96f06fffa4beafd" + "reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/74fec3511b62cb934b64bce1d96f06fffa4beafd", - "reference": "74fec3511b62cb934b64bce1d96f06fffa4beafd", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2da5009d9bacbd91d83486aa1f44c793a8c380d", + "reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d", "shasum": "" }, "require": { @@ -1753,20 +1982,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com/", - "time": "2016-04-12 18:09:53" + "time": "2016-07-20 05:43:46" }, { "name": "symfony/process", - "version": "v2.8.6", + "version": "v2.8.21", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1276bd9be89be039748cf753a2137f4ef149cd74" + "reference": "d54232f5682fda2f8bbebff7c81b864646867ab9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1276bd9be89be039748cf753a2137f4ef149cd74", - "reference": "1276bd9be89be039748cf753a2137f4ef149cd74", + "url": "https://api.github.com/repos/symfony/process/zipball/d54232f5682fda2f8bbebff7c81b864646867ab9", + "reference": "d54232f5682fda2f8bbebff7c81b864646867ab9", "shasum": "" }, "require": { @@ -1802,20 +2031,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com/", - "time": "2016-04-14 15:22:22" + "time": "2017-05-08 01:19:21" }, { "name": "symfony/translation", - "version": "v2.8.6", + "version": "v2.8.21", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "d60b8e076d22953aabebeebda53bf334438e7aca" + "reference": "32b7c0bffc07772cf1a902e3464ef77117fa07c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/d60b8e076d22953aabebeebda53bf334438e7aca", - "reference": "d60b8e076d22953aabebeebda53bf334438e7aca", + "url": "https://api.github.com/repos/symfony/translation/zipball/32b7c0bffc07772cf1a902e3464ef77117fa07c7", + "reference": "32b7c0bffc07772cf1a902e3464ef77117fa07c7", "shasum": "" }, "require": { @@ -1828,7 +2057,7 @@ "require-dev": { "psr/log": "~1.0", "symfony/config": "~2.8", - "symfony/intl": "~2.4|~3.0.0", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", "symfony/yaml": "~2.2|~3.0.0" }, "suggest": { @@ -1866,20 +2095,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com/", - "time": "2016-03-25 01:40:30" + "time": "2017-04-12 14:07:15" }, { "name": "symfony/yaml", - "version": "v2.8.6", + "version": "v2.8.21", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940" + "reference": "93ccdde79f4b079c7558da4656a3cb1c50c68e02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e4fbcc65f90909c999ac3b4dfa699ee6563a9940", - "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940", + "url": "https://api.github.com/repos/symfony/yaml/zipball/93ccdde79f4b079c7558da4656a3cb1c50c68e02", + "reference": "93ccdde79f4b079c7558da4656a3cb1c50c68e02", "shasum": "" }, "require": { @@ -1915,12 +2144,64 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com/", - "time": "2016-03-29 19:00:15" + "time": "2017-05-01 14:31:55" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "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": "2016-11-23 20:04:58" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "popsul/php-token-reflection": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": [], diff --git a/src/main/QafooLabs/Refactoring/Adapters/PHPParser/Visitor/LocalVariableClassifier.php b/src/main/QafooLabs/Refactoring/Adapters/PHPParser/Visitor/LocalVariableClassifier.php index e75ea2a..59e6ffd 100644 --- a/src/main/QafooLabs/Refactoring/Adapters/PHPParser/Visitor/LocalVariableClassifier.php +++ b/src/main/QafooLabs/Refactoring/Adapters/PHPParser/Visitor/LocalVariableClassifier.php @@ -59,10 +59,15 @@ private function enterAssignment(Node\Expr\Assign $node) $this->assignments[$node->var->name][] = $node->getLine(); $this->seenAssignmentVariables->attach($node->var); } else if ($node->var instanceof Node\Expr\ArrayDimFetch) { + // unfold $array[$var][$var] + $var = $node->var->var; + while (!isset($var->name)) { + $var = $var->var; + } // $foo[] = "baz" is both a read and a write access to $foo - $this->localVariables[$node->var->var->name][] = $node->getLine(); - $this->assignments[$node->var->var->name][] = $node->getLine(); - $this->seenAssignmentVariables->attach($node->var->var); + $this->localVariables[$var->name][] = $node->getLine(); + $this->assignments[$var->name][] = $node->getLine(); + $this->seenAssignmentVariables->attach($var); } } diff --git a/src/main/QafooLabs/Refactoring/Application/OptimizeUse.php b/src/main/QafooLabs/Refactoring/Application/OptimizeUse.php index fe29623..c416c42 100644 --- a/src/main/QafooLabs/Refactoring/Application/OptimizeUse.php +++ b/src/main/QafooLabs/Refactoring/Application/OptimizeUse.php @@ -33,15 +33,19 @@ public function __construct($codeAnalysis, $editor, $phpNameScanner) public function refactor(File $file) { + $appendNewLine = false; $classes = $this->codeAnalysis->findClasses($file); - $occurances = $this->phpNameScanner->findNames($file); - $class = $classes[0]; + $lastUseStatementLine = 2; + if ($classes) { + $class = $classes[0]; - $appendNewLine = 0 === $class->namespaceDeclarationLine(); - $lastUseStatementLine = $class->namespaceDeclarationLine() + 2; + $appendNewLine = 0 === $class->namespaceDeclarationLine(); + $lastUseStatementLine = $class->namespaceDeclarationLine() + 2; + } $usedNames = array(); $fqcns = array(); + $occurances = $this->phpNameScanner->findNames($file); foreach ($occurances as $occurance) { $name = $occurance->name();