From bb7a44d2fb3de389ba5acf6c611343cfdffcf608 Mon Sep 17 00:00:00 2001 From: Tlapi Date: Mon, 16 Jul 2018 10:46:29 +0200 Subject: [PATCH 01/11] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b381106..3e5e470 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "laravel/framework": "5.5.* || 5.6.*", - "phpstan/phpstan": "^0.9" + "phpstan/phpstan": "^0.10" }, "require-dev": { "phpunit/phpunit": "^6.5.2" From ec01a71bc57f9d1bdfbd7a3e318b1aca6aca0f6d Mon Sep 17 00:00:00 2001 From: Tlapi Date: Mon, 16 Jul 2018 10:54:22 +0200 Subject: [PATCH 02/11] Update composer.json --- composer.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/composer.json b/composer.json index 3e5e470..28c044a 100644 --- a/composer.json +++ b/composer.json @@ -25,10 +25,5 @@ "psr-4": { "Tests\\Weebly\\PHPStan\\Laravel\\": "tests/" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } } } From 74f2cd6f8ee77c9a73047fd05a135a684c453941 Mon Sep 17 00:00:00 2001 From: Tlapi Date: Mon, 16 Jul 2018 11:18:33 +0200 Subject: [PATCH 03/11] Update BuilderMethodExtension.php --- src/BuilderMethodExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BuilderMethodExtension.php b/src/BuilderMethodExtension.php index 8b137fa..bfef299 100644 --- a/src/BuilderMethodExtension.php +++ b/src/BuilderMethodExtension.php @@ -49,7 +49,7 @@ public function __construct(MethodReflectionFactory $methodReflectionFactory, An /** * @inheritdoc */ - public function setBroker(Broker $broker) + public function setBroker(Broker $broker): void { $this->broker = $broker; } From 2fbd50c25904cbb1aad4cb8713c4a73245abf4b6 Mon Sep 17 00:00:00 2001 From: Tlapi Date: Mon, 16 Jul 2018 11:20:29 +0200 Subject: [PATCH 04/11] Update FacadeMethodExtension.php --- src/FacadeMethodExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FacadeMethodExtension.php b/src/FacadeMethodExtension.php index 5397a9d..0e36d37 100644 --- a/src/FacadeMethodExtension.php +++ b/src/FacadeMethodExtension.php @@ -58,7 +58,7 @@ public function __construct(MethodReflectionFactory $methodReflectionFactory, An /** * @inheritdoc */ - public function setBroker(Broker $broker) + public function setBroker(Broker $broker): void { $this->broker = $broker; } From 2eaefe7ee9e72ece2fb9b57d39a46422ab268d3c Mon Sep 17 00:00:00 2001 From: Tlapi Date: Mon, 16 Jul 2018 11:23:56 +0200 Subject: [PATCH 05/11] Update MacroMethodExtension.php --- src/MacroMethodExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MacroMethodExtension.php b/src/MacroMethodExtension.php index 4ec45a6..4e8b007 100644 --- a/src/MacroMethodExtension.php +++ b/src/MacroMethodExtension.php @@ -50,7 +50,7 @@ public function __construct(PhpMethodReflectionFactory $methodReflectionFactory, /** * @inheritdoc */ - public function setBroker(Broker $broker) + public function setBroker(Broker $broker): void { $this->broker = $broker; } From 8deb3321602cbb06f9b6dec74b8b0ae434abbd03 Mon Sep 17 00:00:00 2001 From: Tlapi Date: Mon, 16 Jul 2018 11:28:37 +0200 Subject: [PATCH 06/11] Update MethodReflectionFactory.php --- src/MethodReflectionFactory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MethodReflectionFactory.php b/src/MethodReflectionFactory.php index f946b67..24bebaa 100644 --- a/src/MethodReflectionFactory.php +++ b/src/MethodReflectionFactory.php @@ -60,6 +60,7 @@ public function create(ClassReflection $classReflection, \ReflectionMethod $meth $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc( $phpDocBlock->getFile(), $phpDocBlock->getClass(), + null, $phpDocBlock->getDocComment() ); $phpDocParameterTypes = array_map(function (ParamTag $tag): Type { From ab973a9b3162cd4b4b1ed345da7a6cb93a293a96 Mon Sep 17 00:00:00 2001 From: Tlapi Date: Mon, 16 Jul 2018 11:46:12 +0200 Subject: [PATCH 07/11] Update composer.json --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 28c044a..dce53ca 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,7 @@ } ], "require": { + "php": "~7.1", "laravel/framework": "5.5.* || 5.6.*", "phpstan/phpstan": "^0.10" }, From f68b09116b5cd84652bab297d8a515934fd95c68 Mon Sep 17 00:00:00 2001 From: Tlapi Date: Mon, 16 Jul 2018 11:50:50 +0200 Subject: [PATCH 08/11] Update .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1e403bf..8d7f0fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 7.0 - 7.1 - 7.2 From 309e77c138c920b65df037a6fbccdd467311e4eb Mon Sep 17 00:00:00 2001 From: Tlapi Date: Tue, 17 Jul 2018 16:50:22 +0200 Subject: [PATCH 09/11] Update MethodReflectionFactory.php --- src/MethodReflectionFactory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MethodReflectionFactory.php b/src/MethodReflectionFactory.php index 24bebaa..2e8c817 100644 --- a/src/MethodReflectionFactory.php +++ b/src/MethodReflectionFactory.php @@ -75,6 +75,7 @@ public function create(ClassReflection $classReflection, \ReflectionMethod $meth return $this->methodReflectionFactory->create( $classReflection, + null, $methodReflection, $phpDocParameterTypes, $phpDocReturnType From 8d5f459826e8dfcdc14455dde67756872d0e3064 Mon Sep 17 00:00:00 2001 From: Tlapi Date: Tue, 17 Jul 2018 17:04:15 +0200 Subject: [PATCH 10/11] fix src/MethodReflectionFactory.php --- src/MethodReflectionFactory.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/MethodReflectionFactory.php b/src/MethodReflectionFactory.php index 2e8c817..6081f46 100644 --- a/src/MethodReflectionFactory.php +++ b/src/MethodReflectionFactory.php @@ -48,6 +48,10 @@ public function create(ClassReflection $classReflection, \ReflectionMethod $meth { $phpDocParameterTypes = []; $phpDocReturnType = null; + $phpDocThrowType = null; + $phpDocIsDeprecated = false; + $phpDocIsInternal = false; + $phpDocIsFinal = false; if ($methodReflection->getDocComment() !== false) { $phpDocBlock = PhpDocBlock::resolvePhpDocBlockForMethod( Broker::getInstance(), @@ -63,10 +67,15 @@ public function create(ClassReflection $classReflection, \ReflectionMethod $meth null, $phpDocBlock->getDocComment() ); + $phpDocParameterTypes = array_map(function (ParamTag $tag): Type { return $tag->getType(); }, $resolvedPhpDoc->getParamTags()); $phpDocReturnType = $resolvedPhpDoc->getReturnTag() !== null ? $resolvedPhpDoc->getReturnTag()->getType() : null; + $phpDocThrowType = $resolvedPhpDoc->getThrowsTag() !== null ? $resolvedPhpDoc->getThrowsTag()->getType() : null; + $phpDocIsDeprecated = $resolvedPhpDoc->isDeprecated(); + $phpDocIsInternal = $resolvedPhpDoc->isInternal(); + $phpDocIsFinal = $resolvedPhpDoc->isFinal(); } if ($methodWrapper) { @@ -78,7 +87,11 @@ public function create(ClassReflection $classReflection, \ReflectionMethod $meth null, $methodReflection, $phpDocParameterTypes, - $phpDocReturnType + $phpDocReturnType, + $phpDocThrowType, + $phpDocIsDeprecated, + $phpDocIsInternal, + $phpDocIsFinal ); } } From 5f334b1c3fb8d1fe3140198e0f288b244e9c0b89 Mon Sep 17 00:00:00 2001 From: Tlapi Date: Tue, 17 Jul 2018 17:08:32 +0200 Subject: [PATCH 11/11] add constraint for phpstan ^0.10.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index dce53ca..faa6a62 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "php": "~7.1", "laravel/framework": "5.5.* || 5.6.*", - "phpstan/phpstan": "^0.10" + "phpstan/phpstan": "^0.10.1" }, "require-dev": { "phpunit/phpunit": "^6.5.2"