Add PHPStan

This commit is contained in:
Phan An 2018-08-30 10:30:34 +07:00
parent b75d924e22
commit a475454b5f
2 changed files with 742 additions and 2 deletions

View file

@ -34,7 +34,8 @@
"barryvdh/laravel-ide-helper": "^2.1",
"laravel/tinker": "^1.0",
"laravel/browser-kit-testing": "^2.0",
"mikey179/vfsStream": "^1.6"
"mikey179/vfsStream": "^1.6",
"phpstan/phpstan": "^0.10.3"
},
"autoload": {
"classmap": [
@ -75,6 +76,9 @@
],
"test": [
"@phpunit --colors=always"
],
"analyze": [
"phpstan analyse app tests"
]
},
"config": {

738
composer.lock generated
View file

@ -4,7 +4,7 @@
"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": "6a60d98d33aca16675ba28fe3b3adfb9",
"content-hash": "85f650d77535301c67a4dc4a0fa378ee",
"packages": [
{
"name": "asm89/stack-cors",
@ -3420,6 +3420,50 @@
],
"time": "2016-06-13T19:28:20+00:00"
},
{
"name": "composer/xdebug-handler",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
"reference": "e37cbd80da64afe314c72de8d2d2fec0e40d9373"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/e37cbd80da64afe314c72de8d2d2fec0e40d9373",
"reference": "e37cbd80da64afe314c72de8d2d2fec0e40d9373",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0",
"psr/log": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Composer\\XdebugHandler\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "John Stevenson",
"email": "john-stevenson@blueyonder.co.uk"
}
],
"description": "Restarts a process without xdebug.",
"keywords": [
"Xdebug",
"performance"
],
"time": "2018-08-23T12:00:19+00:00"
},
{
"name": "dnoegel/php-xdg-base-dir",
"version": "0.1",
@ -3813,6 +3857,57 @@
],
"time": "2015-04-20T18:58:01+00:00"
},
{
"name": "jean85/pretty-package-versions",
"version": "1.2",
"source": {
"type": "git",
"url": "https://github.com/Jean85/pretty-package-versions.git",
"reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48",
"reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48",
"shasum": ""
},
"require": {
"ocramius/package-versions": "^1.2.0",
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Jean85\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alessandro Lai",
"email": "alessandro.lai85@gmail.com"
}
],
"description": "A wrapper for ocramius/package-versions to get pretty versions strings",
"keywords": [
"composer",
"package",
"release",
"versions"
],
"time": "2018-06-13T13:22:40+00:00"
},
{
"name": "laravel/browser-kit-testing",
"version": "v2.0.0",
@ -4083,6 +4178,483 @@
],
"time": "2018-06-11T23:09:50+00:00"
},
{
"name": "nette/bootstrap",
"version": "v2.4.6",
"source": {
"type": "git",
"url": "https://github.com/nette/bootstrap.git",
"reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/bootstrap/zipball/268816e3f1bb7426c3a4ceec2bd38a036b532543",
"reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543",
"shasum": ""
},
"require": {
"nette/di": "~2.4.7",
"nette/utils": "~2.4",
"php": ">=5.6.0"
},
"conflict": {
"nette/nette": "<2.2"
},
"require-dev": {
"latte/latte": "~2.2",
"nette/application": "~2.3",
"nette/caching": "~2.3",
"nette/database": "~2.3",
"nette/forms": "~2.3",
"nette/http": "~2.4.0",
"nette/mail": "~2.3",
"nette/robot-loader": "^2.4.2 || ^3.0",
"nette/safe-stream": "~2.2",
"nette/security": "~2.3",
"nette/tester": "~2.0",
"tracy/tracy": "^2.4.1"
},
"suggest": {
"nette/robot-loader": "to use Configurator::createRobotLoader()",
"tracy/tracy": "to use Configurator::enableTracy()"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
],
"authors": [
{
"name": "David Grudl",
"homepage": "https://davidgrudl.com"
},
{
"name": "Nette Community",
"homepage": "https://nette.org/contributors"
}
],
"description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.",
"homepage": "https://nette.org",
"keywords": [
"bootstrapping",
"configurator",
"nette"
],
"time": "2018-05-17T12:52:20+00:00"
},
{
"name": "nette/di",
"version": "v2.4.13",
"source": {
"type": "git",
"url": "https://github.com/nette/di.git",
"reference": "3f8f212b02d5c17feb97a7e0a39ab306f40c06ca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/di/zipball/3f8f212b02d5c17feb97a7e0a39ab306f40c06ca",
"reference": "3f8f212b02d5c17feb97a7e0a39ab306f40c06ca",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"nette/neon": "^2.3.3 || ~3.0.0",
"nette/php-generator": "^2.6.1 || ~3.0.0",
"nette/utils": "^2.4.3 || ~3.0.0",
"php": ">=5.6.0"
},
"conflict": {
"nette/bootstrap": "<2.4",
"nette/nette": "<2.2"
},
"require-dev": {
"nette/tester": "^2.0",
"tracy/tracy": "^2.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
],
"authors": [
{
"name": "David Grudl",
"homepage": "https://davidgrudl.com"
},
{
"name": "Nette Community",
"homepage": "https://nette.org/contributors"
}
],
"description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.",
"homepage": "https://nette.org",
"keywords": [
"compiled",
"di",
"dic",
"factory",
"ioc",
"nette",
"static"
],
"time": "2018-06-11T08:46:01+00:00"
},
{
"name": "nette/finder",
"version": "v2.4.2",
"source": {
"type": "git",
"url": "https://github.com/nette/finder.git",
"reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/finder/zipball/ee951a656cb8ac622e5dd33474a01fd2470505a0",
"reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0",
"shasum": ""
},
"require": {
"nette/utils": "~2.4",
"php": ">=5.6.0"
},
"conflict": {
"nette/nette": "<2.2"
},
"require-dev": {
"nette/tester": "~2.0",
"tracy/tracy": "^2.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
],
"authors": [
{
"name": "David Grudl",
"homepage": "https://davidgrudl.com"
},
{
"name": "Nette Community",
"homepage": "https://nette.org/contributors"
}
],
"description": "🔍 Nette Finder: find files and directories with an intuitive API.",
"homepage": "https://nette.org",
"keywords": [
"filesystem",
"glob",
"iterator",
"nette"
],
"time": "2018-06-28T11:49:23+00:00"
},
{
"name": "nette/neon",
"version": "v2.4.3",
"source": {
"type": "git",
"url": "https://github.com/nette/neon.git",
"reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/neon/zipball/5e72b1dd3e2d34f0863c5561139a19df6a1ef398",
"reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398",
"shasum": ""
},
"require": {
"ext-iconv": "*",
"ext-json": "*",
"php": ">=5.6.0"
},
"require-dev": {
"nette/tester": "~2.0",
"tracy/tracy": "^2.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
],
"authors": [
{
"name": "David Grudl",
"homepage": "https://davidgrudl.com"
},
{
"name": "Nette Community",
"homepage": "https://nette.org/contributors"
}
],
"description": "🍸 Nette NEON: encodes and decodes NEON file format.",
"homepage": "http://ne-on.org",
"keywords": [
"export",
"import",
"neon",
"nette",
"yaml"
],
"time": "2018-03-21T12:12:21+00:00"
},
{
"name": "nette/php-generator",
"version": "v3.0.5",
"source": {
"type": "git",
"url": "https://github.com/nette/php-generator.git",
"reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/php-generator/zipball/ea90209c2e8a7cd087b2742ca553c047a8df5eff",
"reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff",
"shasum": ""
},
"require": {
"nette/utils": "^2.4.2 || ~3.0.0",
"php": ">=7.0"
},
"conflict": {
"nette/nette": "<2.2"
},
"require-dev": {
"nette/tester": "^2.0",
"tracy/tracy": "^2.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
],
"authors": [
{
"name": "David Grudl",
"homepage": "https://davidgrudl.com"
},
{
"name": "Nette Community",
"homepage": "https://nette.org/contributors"
}
],
"description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.2 features.",
"homepage": "https://nette.org",
"keywords": [
"code",
"nette",
"php",
"scaffolding"
],
"time": "2018-08-09T14:32:27+00:00"
},
{
"name": "nette/robot-loader",
"version": "v3.1.0",
"source": {
"type": "git",
"url": "https://github.com/nette/robot-loader.git",
"reference": "fc76c70e740b10f091e502b2e393d0be912f38d4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/robot-loader/zipball/fc76c70e740b10f091e502b2e393d0be912f38d4",
"reference": "fc76c70e740b10f091e502b2e393d0be912f38d4",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"nette/finder": "^2.3 || ^3.0",
"nette/utils": "^2.4 || ^3.0",
"php": ">=5.6.0"
},
"conflict": {
"nette/nette": "<2.2"
},
"require-dev": {
"nette/tester": "^2.0",
"tracy/tracy": "^2.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
],
"authors": [
{
"name": "David Grudl",
"homepage": "https://davidgrudl.com"
},
{
"name": "Nette Community",
"homepage": "https://nette.org/contributors"
}
],
"description": "🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.",
"homepage": "https://nette.org",
"keywords": [
"autoload",
"class",
"interface",
"nette",
"trait"
],
"time": "2018-08-13T14:19:06+00:00"
},
{
"name": "nette/utils",
"version": "v2.5.2",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
"reference": "183069866dc477fcfbac393ed486aaa6d93d19a5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/183069866dc477fcfbac393ed486aaa6d93d19a5",
"reference": "183069866dc477fcfbac393ed486aaa6d93d19a5",
"shasum": ""
},
"require": {
"php": ">=5.6.0"
},
"conflict": {
"nette/nette": "<2.2"
},
"require-dev": {
"nette/tester": "~2.0",
"tracy/tracy": "^2.3"
},
"suggest": {
"ext-gd": "to use Image",
"ext-iconv": "to use Strings::webalize() and toAscii()",
"ext-intl": "for script transliteration in Strings::webalize() and toAscii()",
"ext-json": "to use Nette\\Utils\\Json",
"ext-mbstring": "to use Strings::lower() etc...",
"ext-xml": "to use Strings::length() etc. when mbstring is not available"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
}
},
"autoload": {
"classmap": [
"src/"
],
"files": [
"src/loader.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
],
"authors": [
{
"name": "David Grudl",
"homepage": "https://davidgrudl.com"
},
{
"name": "Nette Community",
"homepage": "https://nette.org/contributors"
}
],
"description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.",
"homepage": "https://nette.org",
"keywords": [
"array",
"core",
"datetime",
"images",
"json",
"nette",
"paginator",
"password",
"slugify",
"string",
"unicode",
"utf-8",
"utility",
"validation"
],
"time": "2018-05-02T17:16:08+00:00"
},
{
"name": "nikic/php-parser",
"version": "v4.0.3",
@ -4134,6 +4706,55 @@
],
"time": "2018-07-15T17:25:16+00:00"
},
{
"name": "ocramius/package-versions",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/Ocramius/PackageVersions.git",
"reference": "4489d5002c49d55576fa0ba786f42dbb009be46f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/4489d5002c49d55576fa0ba786f42dbb009be46f",
"reference": "4489d5002c49d55576fa0ba786f42dbb009be46f",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0.0",
"php": "^7.1.0"
},
"require-dev": {
"composer/composer": "^1.6.3",
"ext-zip": "*",
"infection/infection": "^0.7.1",
"phpunit/phpunit": "^7.0.0"
},
"type": "composer-plugin",
"extra": {
"class": "PackageVersions\\Installer",
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"PackageVersions\\": "src/PackageVersions"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
}
],
"description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
"time": "2018-02-05T13:05:30+00:00"
},
{
"name": "phar-io/manifest",
"version": "1.0.3",
@ -4451,6 +5072,121 @@
],
"time": "2018-08-05T17:53:17+00:00"
},
{
"name": "phpstan/phpdoc-parser",
"version": "0.3",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "ed3223362174b8067729930439e139794e9e514a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ed3223362174b8067729930439e139794e9e514a",
"reference": "ed3223362174b8067729930439e139794e9e514a",
"shasum": ""
},
"require": {
"php": "~7.1"
},
"require-dev": {
"consistence/coding-standard": "^2.0.0",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"phing/phing": "^2.16.0",
"phpstan/phpstan": "^0.10@dev",
"phpunit/phpunit": "^6.3",
"slevomat/coding-standard": "^3.3.0",
"symfony/process": "^3.4 || ^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.3-dev"
}
},
"autoload": {
"psr-4": {
"PHPStan\\PhpDocParser\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"time": "2018-06-20T17:48:01+00:00"
},
{
"name": "phpstan/phpstan",
"version": "0.10.3",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "dc62f78c9aa6e9f7c44e8d6518f1123cd1e1b1c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc62f78c9aa6e9f7c44e8d6518f1123cd1e1b1c0",
"reference": "dc62f78c9aa6e9f7c44e8d6518f1123cd1e1b1c0",
"shasum": ""
},
"require": {
"composer/xdebug-handler": "^1.0",
"jean85/pretty-package-versions": "^1.0.3",
"nette/bootstrap": "^2.4 || ^3.0",
"nette/di": "^2.4.7 || ^3.0",
"nette/robot-loader": "^3.0.1",
"nette/utils": "^2.4.5 || ^3.0",
"nikic/php-parser": "^4.0.2",
"php": "~7.1",
"phpstan/phpdoc-parser": "^0.3",
"symfony/console": "~3.2 || ~4.0",
"symfony/finder": "~3.2 || ~4.0"
},
"require-dev": {
"brianium/paratest": "^2.0",
"consistence/coding-standard": "^3.3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
"ext-gd": "*",
"ext-intl": "*",
"ext-mysqli": "*",
"ext-zip": "*",
"jakub-onderka/php-parallel-lint": "^1.0",
"localheinz/composer-normalize": "~0.8.0",
"phing/phing": "^2.16.0",
"phpstan/phpstan-deprecation-rules": "^0.10.2",
"phpstan/phpstan-php-parser": "^0.10",
"phpstan/phpstan-phpunit": "^0.10",
"phpstan/phpstan-strict-rules": "^0.10",
"phpunit/phpunit": "^7.0",
"slevomat/coding-standard": "^4.6.2"
},
"bin": [
"bin/phpstan"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.10-dev"
}
},
"autoload": {
"psr-4": {
"PHPStan\\": [
"src/",
"build/PHPStan"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"time": "2018-08-12T15:14:21+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "6.0.7",