Skip to content

Commit c775594

Browse files
committed
Deprecated PHPStan\Broker\Broker. Use PHPStan\Reflection\ReflectionProvider instead.
1 parent 1e5cf58 commit c775594

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

phpstan-baseline.neon

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,15 @@ parameters:
245245
count: 1
246246
path: src/Testing/PHPStanTestCase.php
247247

248+
-
249+
message:
250+
"""
251+
#^Call to deprecated method getUniversalObjectCratesClasses\\(\\) of class PHPStan\\\\Broker\\\\Broker\\:
252+
Inject %%universalObjectCratesClasses%% parameter instead\\.$#
253+
"""
254+
count: 1
255+
path: src/Type/ObjectType.php
256+
248257
-
249258
message: "#^Unreachable statement \\- code above always terminates\\.$#"
250259
count: 1
@@ -280,6 +289,33 @@ parameters:
280289
count: 1
281290
path: tests/PHPStan/Analyser/EvaluationOrderTest.php
282291

292+
-
293+
message:
294+
"""
295+
#^Call to deprecated method getClass\\(\\) of class PHPStan\\\\Broker\\\\Broker\\:
296+
Use PHPStan\\\\Reflection\\\\ReflectionProvider instead$#
297+
"""
298+
count: 1
299+
path: tests/PHPStan/Broker/BrokerTest.php
300+
301+
-
302+
message:
303+
"""
304+
#^Call to deprecated method getFunction\\(\\) of class PHPStan\\\\Broker\\\\Broker\\:
305+
Use PHPStan\\\\Reflection\\\\ReflectionProvider instead$#
306+
"""
307+
count: 1
308+
path: tests/PHPStan/Broker/BrokerTest.php
309+
310+
-
311+
message:
312+
"""
313+
#^Call to deprecated method hasClass\\(\\) of class PHPStan\\\\Broker\\\\Broker\\:
314+
Use PHPStan\\\\Reflection\\\\ReflectionProvider instead$#
315+
"""
316+
count: 1
317+
path: tests/PHPStan/Broker/BrokerTest.php
318+
283319
-
284320
message: "#^Constant SOME_CONSTANT_IN_AUTOLOAD_FILE not found\\.$#"
285321
count: 1

src/Broker/Broker.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,62 +45,97 @@ public static function getInstance(): Broker
4545
return self::$instance;
4646
}
4747

48+
/**
49+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
50+
*/
4851
public function hasClass(string $className): bool
4952
{
5053
return $this->reflectionProvider->hasClass($className);
5154
}
5255

56+
/**
57+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
58+
*/
5359
public function getClass(string $className): ClassReflection
5460
{
5561
return $this->reflectionProvider->getClass($className);
5662
}
5763

64+
/**
65+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
66+
*/
5867
public function getClassName(string $className): string
5968
{
6069
return $this->reflectionProvider->getClassName($className);
6170
}
6271

72+
/**
73+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
74+
*/
6375
public function supportsAnonymousClasses(): bool
6476
{
6577
return $this->reflectionProvider->supportsAnonymousClasses();
6678
}
6779

80+
/**
81+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
82+
*/
6883
public function getAnonymousClassReflection(\PhpParser\Node\Stmt\Class_ $classNode, Scope $scope): ClassReflection
6984
{
7085
return $this->reflectionProvider->getAnonymousClassReflection($classNode, $scope);
7186
}
7287

88+
/**
89+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
90+
*/
7391
public function hasFunction(\PhpParser\Node\Name $nameNode, ?Scope $scope): bool
7492
{
7593
return $this->reflectionProvider->hasFunction($nameNode, $scope);
7694
}
7795

96+
/**
97+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
98+
*/
7899
public function getFunction(\PhpParser\Node\Name $nameNode, ?Scope $scope): FunctionReflection
79100
{
80101
return $this->reflectionProvider->getFunction($nameNode, $scope);
81102
}
82103

104+
/**
105+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
106+
*/
83107
public function resolveFunctionName(\PhpParser\Node\Name $nameNode, ?Scope $scope): ?string
84108
{
85109
return $this->reflectionProvider->resolveFunctionName($nameNode, $scope);
86110
}
87111

112+
/**
113+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
114+
*/
88115
public function hasConstant(\PhpParser\Node\Name $nameNode, ?Scope $scope): bool
89116
{
90117
return $this->reflectionProvider->hasConstant($nameNode, $scope);
91118
}
92119

120+
/**
121+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
122+
*/
93123
public function getConstant(\PhpParser\Node\Name $nameNode, ?Scope $scope): GlobalConstantReflection
94124
{
95125
return $this->reflectionProvider->getConstant($nameNode, $scope);
96126
}
97127

128+
/**
129+
* @deprecated Use PHPStan\Reflection\ReflectionProvider instead
130+
*/
98131
public function resolveConstantName(\PhpParser\Node\Name $nameNode, ?Scope $scope): ?string
99132
{
100133
return $this->reflectionProvider->resolveConstantName($nameNode, $scope);
101134
}
102135

103136
/**
137+
* @deprecated Inject %universalObjectCratesClasses% parameter instead.
138+
*
104139
* @return string[]
105140
*/
106141
public function getUniversalObjectCratesClasses(): array

0 commit comments

Comments
 (0)