Skip to content

Commit

Permalink
Updated for PHPStan 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed May 8, 2017
1 parent 598ed43 commit d5b047a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
>
<arg value="analyse"/>
<arg value="-l"/>
<arg value="4"/>
<arg value="7"/>
<arg value="-c"/>
<arg path="phpstan.neon"/>
<arg path="src"/>
Expand Down
12 changes: 9 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@
"license": ["MIT"],
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"branch-alias": {
"dev-master": "0.7-dev"
}
},
"require": {
"php": "~7.0",
"phpstan/phpstan": "^0.6",
"phpstan/phpstan": "^0.7",
"dibi/dibi": "~3.0"
},
"require-dev": {
"consistence/coding-standard": "~0.12.0",
"consistence/coding-standard": "~0.13.0",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"phing/phing": "^2.13.0",
"phpunit/phpunit": "^5.3",
"satooshi/php-coveralls": "^1.0",
"slevomat/coding-standard": "dev-php7#961090ac32"
"slevomat/coding-standard": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
parameters:
ignoreErrors:
- '#Call to an undefined method PHPUnit_Framework_MockObject_MockObject::[a-zA-Z0-9_]+\(\)#'
- '#PHPUnit_Framework_MockObject_MockObject given#'
7 changes: 6 additions & 1 deletion ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces"/>
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
</rule>
<rule ref="SlevomatCodingStandard.Typehints.TypeHintDeclaration">
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
<properties>
<property name="usefulAnnotations" type="array" value="
@dataProvider
"/>
<property name="enableNullableTypeHints" type="false" />
<property name="enableVoidTypeHint" type="false" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification">
<exclude-pattern>tests/</exclude-pattern><!-- it's useless to add "@return mixed[]" to all data providers -->
</rule>
</ruleset>
2 changes: 1 addition & 1 deletion src/Reflection/Dibi/DibiFluentMethodReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function isPublic(): bool

public function getReturnType(): Type
{
return new ObjectType(\Dibi\Fluent::class, false);
return new ObjectType(\Dibi\Fluent::class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace PHPStan\Reflection\Dibi;

use PHPStan\Reflection\ClassReflection;
use PHPStan\Type\ObjectType;

class DibiFluentClassReflectionExtensionTest extends \PHPUnit_Framework_TestCase
{
Expand Down Expand Up @@ -54,9 +53,7 @@ public function testGetMethod()
$this->assertTrue($methodReflection->isVariadic());
$this->assertFalse($methodReflection->isPrivate());
$this->assertTrue($methodReflection->isPublic());
$this->assertInstanceOf(ObjectType::class, $methodReflection->getReturnType());
$this->assertSame(\Dibi\Fluent::class, $methodReflection->getReturnType()->getClass());
$this->assertFalse($methodReflection->getReturnType()->isNullable());
$this->assertSame(\Dibi\Fluent::class, $methodReflection->getReturnType()->describe());
}

}

0 comments on commit d5b047a

Please sign in to comment.