Skip to content

Commit 3460e2c

Browse files
committed
Fix CS
1 parent 65fc460 commit 3460e2c

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

src/Type/ClosureTypeFactory.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -74,51 +74,51 @@ public function fromClosureObject(Closure $closure): ClosureType
7474

7575
$parameters = array_map(fn (BetterReflectionParameter $parameter) => new class($parameter, $this->initializerExprTypeResolver) implements ParameterReflection {
7676

77-
public function __construct(private BetterReflectionParameter $reflection, private InitializerExprTypeResolver $initializerExprTypeResolver)
78-
{
79-
}
80-
81-
public function getName(): string
82-
{
83-
return $this->reflection->getName();
84-
}
77+
public function __construct(private BetterReflectionParameter $reflection, private InitializerExprTypeResolver $initializerExprTypeResolver)
78+
{
79+
}
8580

86-
public function isOptional(): bool
87-
{
88-
return $this->reflection->isOptional();
89-
}
81+
public function getName(): string
82+
{
83+
return $this->reflection->getName();
84+
}
9085

91-
public function getType(): Type
92-
{
93-
return TypehintHelper::decideTypeFromReflection(ReflectionType::fromTypeOrNull($this->reflection->getType()), isVariadic: $this->reflection->isVariadic());
94-
}
86+
public function isOptional(): bool
87+
{
88+
return $this->reflection->isOptional();
89+
}
9590

96-
public function passedByReference(): PassedByReference
97-
{
98-
return $this->reflection->isPassedByReference()
99-
? PassedByReference::createCreatesNewVariable()
100-
: PassedByReference::createNo();
101-
}
91+
public function getType(): Type
92+
{
93+
return TypehintHelper::decideTypeFromReflection(ReflectionType::fromTypeOrNull($this->reflection->getType()), isVariadic: $this->reflection->isVariadic());
94+
}
10295

103-
public function isVariadic(): bool
104-
{
105-
return $this->reflection->isVariadic();
106-
}
96+
public function passedByReference(): PassedByReference
97+
{
98+
return $this->reflection->isPassedByReference()
99+
? PassedByReference::createCreatesNewVariable()
100+
: PassedByReference::createNo();
101+
}
107102

108-
public function getDefaultValue(): ?Type
109-
{
110-
if (! $this->reflection->isDefaultValueAvailable()) {
111-
return null;
112-
}
103+
public function isVariadic(): bool
104+
{
105+
return $this->reflection->isVariadic();
106+
}
113107

114-
$defaultExpr = $this->reflection->getDefaultValueExpression();
115-
if ($defaultExpr === null) {
116-
return null;
117-
}
108+
public function getDefaultValue(): ?Type
109+
{
110+
if (! $this->reflection->isDefaultValueAvailable()) {
111+
return null;
112+
}
118113

119-
return $this->initializerExprTypeResolver->getType($defaultExpr, InitializerExprContext::fromReflectionParameter(new ReflectionParameter($this->reflection)));
114+
$defaultExpr = $this->reflection->getDefaultValueExpression();
115+
if ($defaultExpr === null) {
116+
return null;
120117
}
121118

119+
return $this->initializerExprTypeResolver->getType($defaultExpr, InitializerExprContext::fromReflectionParameter(new ReflectionParameter($this->reflection)));
120+
}
121+
122122
}, $betterReflectionFunction->getParameters());
123123

124124
$selfClass = null;

0 commit comments

Comments
 (0)