Skip to content

Commit a05f5a2

Browse files
committed
simplify
1 parent 29c50ad commit a05f5a2

2 files changed

Lines changed: 1 addition & 32 deletions

File tree

src/Type/ClosureType.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -280,37 +280,6 @@ public function describe(VerbosityLevel $level): string
280280
{
281281
return $level->handle(
282282
static fn (): string => 'Closure',
283-
function (): string {
284-
if ($this->isCommonCallable) {
285-
return $this->isPure()->yes() ? 'pure-Closure' : 'Closure';
286-
}
287-
288-
$printer = new Printer();
289-
$selfWithoutParameterNames = new self(
290-
array_map(static fn (ParameterReflection $p): ParameterReflection => new DummyParameter(
291-
'',
292-
$p->getType(),
293-
optional: $p->isOptional() && !$p->isVariadic(),
294-
passedByReference: PassedByReference::createNo(),
295-
variadic: $p->isVariadic(),
296-
defaultValue: $p->getDefaultValue(),
297-
), $this->parameters),
298-
$this->returnType,
299-
$this->variadic,
300-
$this->templateTypeMap,
301-
$this->resolvedTemplateTypeMap,
302-
$this->callSiteVarianceMap,
303-
$this->templateTags,
304-
$this->throwPoints,
305-
$this->impurePoints,
306-
$this->invalidateExpressions,
307-
$this->usedVariables,
308-
$this->acceptsNamedArguments,
309-
$this->mustUseReturnValue,
310-
);
311-
312-
return $printer->print($selfWithoutParameterNames->toPhpDocNode());
313-
},
314283
function (): string {
315284
if ($this->isCommonCallable) {
316285
$prefix = $this->isStatic->yes() ? 'static-' : '';

tests/PHPStan/Type/ClosureTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public static function dataDescribe(): array
254254
'static pure common closure at value' => [
255255
new ClosureType(impurePoints: [], isStatic: TrinaryLogic::createYes()),
256256
VerbosityLevel::value(),
257-
'pure-Closure',
257+
'static-pure-Closure',
258258
],
259259
];
260260
}

0 commit comments

Comments
 (0)