Skip to content

Commit d5b047a

Browse files
committed
Updated for PHPStan 0.7
1 parent 598ed43 commit d5b047a

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
>
9393
<arg value="analyse"/>
9494
<arg value="-l"/>
95-
<arg value="4"/>
95+
<arg value="7"/>
9696
<arg value="-c"/>
9797
<arg path="phpstan.neon"/>
9898
<arg path="src"/>

composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
"license": ["MIT"],
55
"minimum-stability": "dev",
66
"prefer-stable": true,
7+
"extra": {
8+
"branch-alias": {
9+
"dev-master": "0.7-dev"
10+
}
11+
},
712
"require": {
813
"php": "~7.0",
9-
"phpstan/phpstan": "^0.6",
14+
"phpstan/phpstan": "^0.7",
1015
"dibi/dibi": "~3.0"
1116
},
1217
"require-dev": {
13-
"consistence/coding-standard": "~0.12.0",
18+
"consistence/coding-standard": "~0.13.0",
19+
"jakub-onderka/php-parallel-lint": "^0.9.2",
1420
"phing/phing": "^2.13.0",
1521
"phpunit/phpunit": "^5.3",
1622
"satooshi/php-coveralls": "^1.0",
17-
"slevomat/coding-standard": "dev-php7#961090ac32"
23+
"slevomat/coding-standard": "^2.0"
1824
},
1925
"autoload": {
2026
"psr-4": {

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
parameters:
22
ignoreErrors:
3-
- '#Call to an undefined method PHPUnit_Framework_MockObject_MockObject::[a-zA-Z0-9_]+\(\)#'
3+
- '#PHPUnit_Framework_MockObject_MockObject given#'

ruleset.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@
77
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces"/>
88
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
99
</rule>
10-
<rule ref="SlevomatCodingStandard.Typehints.TypeHintDeclaration">
10+
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
1111
<properties>
1212
<property name="usefulAnnotations" type="array" value="
1313
@dataProvider
1414
"/>
15+
<property name="enableNullableTypeHints" type="false" />
16+
<property name="enableVoidTypeHint" type="false" />
1517
</properties>
1618
</rule>
19+
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification">
20+
<exclude-pattern>tests/</exclude-pattern><!-- it's useless to add "@return mixed[]" to all data providers -->
21+
</rule>
1722
</ruleset>

src/Reflection/Dibi/DibiFluentMethodReflection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function isPublic(): bool
6767

6868
public function getReturnType(): Type
6969
{
70-
return new ObjectType(\Dibi\Fluent::class, false);
70+
return new ObjectType(\Dibi\Fluent::class);
7171
}
7272

7373
}

tests/Reflection/Dibi/DibiFluentClassReflectionExtensionTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace PHPStan\Reflection\Dibi;
44

55
use PHPStan\Reflection\ClassReflection;
6-
use PHPStan\Type\ObjectType;
76

87
class DibiFluentClassReflectionExtensionTest extends \PHPUnit_Framework_TestCase
98
{
@@ -54,9 +53,7 @@ public function testGetMethod()
5453
$this->assertTrue($methodReflection->isVariadic());
5554
$this->assertFalse($methodReflection->isPrivate());
5655
$this->assertTrue($methodReflection->isPublic());
57-
$this->assertInstanceOf(ObjectType::class, $methodReflection->getReturnType());
58-
$this->assertSame(\Dibi\Fluent::class, $methodReflection->getReturnType()->getClass());
59-
$this->assertFalse($methodReflection->getReturnType()->isNullable());
56+
$this->assertSame(\Dibi\Fluent::class, $methodReflection->getReturnType()->describe());
6057
}
6158

6259
}

0 commit comments

Comments
 (0)