Skip to content

Commit 3076e44

Browse files
committed
Open 0.12-dev
1 parent 7759286 commit 3076e44

File tree

6 files changed

+18
-26
lines changed

6 files changed

+18
-26
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"prefer-stable": true,
88
"extra": {
99
"branch-alias": {
10-
"dev-master": "0.11-dev"
10+
"dev-master": "0.12-dev"
1111
},
1212
"phpstan": {
1313
"includes": [
@@ -18,17 +18,17 @@
1818
},
1919
"require": {
2020
"php": "~7.1",
21-
"phpstan/phpstan": "^0.11.7",
22-
"phpstan/phpdoc-parser": "^0.3",
21+
"phpstan/phpstan": "^0.12",
22+
"phpstan/phpdoc-parser": "^0.4",
2323
"nikic/php-parser": "^4.0"
2424
},
2525
"require-dev": {
2626
"consistence/coding-standard": "^3.8",
2727
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
2828
"jakub-onderka/php-parallel-lint": "^1.0",
2929
"phing/phing": "^2.16.0",
30-
"phpstan/phpstan-phpunit": "^0.11",
31-
"phpstan/phpstan-strict-rules": "^0.11",
30+
"phpstan/phpstan-phpunit": "^0.12",
31+
"phpstan/phpstan-strict-rules": "^0.12",
3232
"phpunit/phpunit": "^7.0",
3333
"slevomat/coding-standard": "^5.0.4",
3434
"doctrine/common": "^2.7",

phpstan.neon

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ includes:
88

99
parameters:
1010
excludes_analyse:
11-
- */tests/*/data/*
11+
- tests/*/data/*
1212

1313
ignoreErrors:
1414
- '~^Parameter \#1 \$node \(.*\) of method .*Rule::processNode\(\) should be contravariant with parameter \$node \(PhpParser\\Node\) of method PHPStan\\Rules\\Rule::processNode\(\)$~'
1515
-
1616
message: '~^Variable method call on Doctrine\\ORM\\QueryBuilder~'
17-
path: */src/Type/Doctrine/QueryBuilder/QueryBuilderGetQueryDynamicReturnTypeExtension.php
17+
path: src/Type/Doctrine/QueryBuilder/QueryBuilderGetQueryDynamicReturnTypeExtension.php
1818
-
1919
message: '~^Variable method call on object\.$~'
20-
path: */src/Type/Doctrine/QueryBuilder/Expr/ExpressionBuilderDynamicReturnTypeExtension.php
20+
path: src/Type/Doctrine/QueryBuilder/Expr/ExpressionBuilderDynamicReturnTypeExtension.php
2121
-
2222
message: '~^Variable property access on PhpParser\\Node\\Stmt\\Declare_\|PhpParser\\Node\\Stmt\\Namespace_\.$~'
23-
path: */src/Type/Doctrine/QueryBuilder/QueryBuilderMethodDynamicReturnTypeExtension.php
23+
path: src/Type/Doctrine/QueryBuilder/QueryBuilderMethodDynamicReturnTypeExtension.php

src/Type/Doctrine/QueryBuilder/QueryBuilderMethodDynamicReturnTypeExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use PHPStan\Reflection\MethodReflection;
2222
use PHPStan\Reflection\ParametersAcceptorSelector;
2323
use PHPStan\Type\Doctrine\DoctrineTypeUtils;
24+
use PHPStan\Type\Generic\TemplateTypeMap;
2425
use PHPStan\Type\MixedType;
2526
use PHPStan\Type\ObjectType;
2627
use PHPStan\Type\Type;
@@ -177,7 +178,7 @@ private function findQueryBuilderTypesInCalledMethod(Scope $scope, MethodCall $m
177178
$scope->isDeclareStrictTypes(),
178179
$methodReflection,
179180
$scope->getNamespace()
180-
)->enterClass($methodReflection->getDeclaringClass())->enterClassMethod($methodNode, [], null, null, null, false, false, false);
181+
)->enterClass($methodReflection->getDeclaringClass())->enterClassMethod($methodNode, TemplateTypeMap::createEmpty(), [], null, null, null, false, false, false);
181182

182183
$queryBuilderTypes = [];
183184

tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleTest.php

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Doctrine\ORM\Query\Expr\OrderBy;
88
use PHPStan\DependencyInjection\Container;
99
use PHPStan\DependencyInjection\ContainerFactory;
10-
use PHPStan\DependencyInjection\Nette\NetteContainer;
1110
use PHPStan\Rules\Rule;
1211
use PHPStan\Testing\RuleTestCase;
1312
use PHPStan\Type\Doctrine\ArgumentsProcessor;
@@ -135,26 +134,18 @@ public function testRuleBranches(bool $fasterVersion): void
135134
45,
136135
],
137136
[
137+
'QueryBuilder: [Semantical Error] line 0, col 58 near \'p.id = 1\': Error: \'p\' is not defined.',
138+
59,
139+
],
140+
/*[
138141
'QueryBuilder: [Semantical Error] line 0, col 93 near \'t.id = 1\': Error: \'t\' is not defined.',
139142
90,
140-
],
143+
],*/
141144
[
142145
'QueryBuilder: [Semantical Error] line 0, col 95 near \'foo = 1\': Error: Class PHPStan\Rules\Doctrine\ORM\MyEntity has no field or association named foo',
143146
107,
144147
],
145148
];
146-
if (!$fasterVersion) {
147-
array_splice($errors, 2, 0, [
148-
[
149-
'QueryBuilder: [Semantical Error] line 0, col 58 near \'p.id = 1\': Error: \'p\' is not defined.',
150-
59,
151-
],
152-
]);
153-
$errors[] = [
154-
'QueryBuilder: [Semantical Error] line 0, col 93 near \'t.id = 1\': Error: \'t\' is not defined.',
155-
107,
156-
];
157-
}
158149
$this->analyse([__DIR__ . '/data/query-builder-branches-dql.php'], $errors);
159150
}
160151

@@ -190,10 +181,10 @@ private function getContainerWithDoctrineExtensions(): Container
190181
{
191182
$rootDir = __DIR__ . '/../../../../vendor/phpstan/phpstan';
192183
$containerFactory = new ContainerFactory($rootDir);
193-
return new NetteContainer($containerFactory->create($rootDir . '/tmp', [
184+
return $containerFactory->create($rootDir . '/tmp', [
194185
$containerFactory->getConfigDirectory() . '/config.level7.neon',
195186
__DIR__ . '/../../../../extension.neon',
196-
], []));
187+
], []);
197188
}
198189

199190
/**

0 commit comments

Comments
 (0)