Skip to content

Commit e9387f9

Browse files
committed
cs
1 parent ef01c62 commit e9387f9

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/PhpGenerator/Factory.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function fromClassReflection(
6363
}
6464

6565
$class->setComment(Helpers::unformatDocComment((string) $from->getDocComment()));
66-
$class->setAttributes(self::getAttributes($from));
66+
$class->setAttributes($this->getAttributes($from));
6767
if ($from->getParentClass()) {
6868
$class->setExtends($from->getParentClass()->name);
6969
$class->setImplements(array_diff($class->getImplements(), $from->getParentClass()->getInterfaceNames()));
@@ -153,7 +153,7 @@ public function fromMethodReflection(\ReflectionMethod $from): Method
153153
$method->setReturnReference($from->returnsReference());
154154
$method->setVariadic($from->isVariadic());
155155
$method->setComment(Helpers::unformatDocComment((string) $from->getDocComment()));
156-
$method->setAttributes(self::getAttributes($from));
156+
$method->setAttributes($this->getAttributes($from));
157157
if ($from->getReturnType() instanceof \ReflectionNamedType) {
158158
$method->setReturnType($from->getReturnType()->getName());
159159
$method->setReturnNullable($from->getReturnType()->allowsNull());
@@ -179,7 +179,7 @@ public function fromFunctionReflection(\ReflectionFunction $from, bool $withBody
179179
$function->setComment(Helpers::unformatDocComment((string) $from->getDocComment()));
180180
}
181181

182-
$function->setAttributes(self::getAttributes($from));
182+
$function->setAttributes($this->getAttributes($from));
183183
if ($from->getReturnType() instanceof \ReflectionNamedType) {
184184
$function->setReturnType($from->getReturnType()->getName());
185185
$function->setReturnNullable($from->getReturnType()->allowsNull());
@@ -207,8 +207,8 @@ public function fromCallable(callable $from)
207207
{
208208
$ref = Nette\Utils\Callback::toReflection($from);
209209
return $ref instanceof \ReflectionMethod
210-
? self::fromMethodReflection($ref)
211-
: self::fromFunctionReflection($ref);
210+
? $this->fromMethodReflection($ref)
211+
: $this->fromFunctionReflection($ref);
212212
}
213213

214214

@@ -245,7 +245,7 @@ public function fromParameterReflection(\ReflectionParameter $from): Parameter
245245
$param->setNullable($param->isNullable() && $param->getDefaultValue() !== null);
246246
}
247247

248-
$param->setAttributes(self::getAttributes($from));
248+
$param->setAttributes($this->getAttributes($from));
249249
return $param;
250250
}
251251

@@ -257,7 +257,7 @@ public function fromConstantReflection(\ReflectionClassConstant $from): Constant
257257
$const->setVisibility($this->getVisibility($from));
258258
$const->setFinal(PHP_VERSION_ID >= 80100 ? $from->isFinal() : false);
259259
$const->setComment(Helpers::unformatDocComment((string) $from->getDocComment()));
260-
$const->setAttributes(self::getAttributes($from));
260+
$const->setAttributes($this->getAttributes($from));
261261
return $const;
262262
}
263263

@@ -267,7 +267,7 @@ public function fromCaseReflection(\ReflectionClassConstant $from): EnumCase
267267
$const = new EnumCase($from->name);
268268
$const->setValue($from->getValue()->value ?? null);
269269
$const->setComment(Helpers::unformatDocComment((string) $from->getDocComment()));
270-
$const->setAttributes(self::getAttributes($from));
270+
$const->setAttributes($this->getAttributes($from));
271271
return $const;
272272
}
273273

@@ -297,7 +297,7 @@ public function fromPropertyReflection(\ReflectionProperty $from): Property
297297
}
298298

299299
$prop->setComment(Helpers::unformatDocComment((string) $from->getDocComment()));
300-
$prop->setAttributes(self::getAttributes($from));
300+
$prop->setAttributes($this->getAttributes($from));
301301
return $prop;
302302
}
303303

src/PhpGenerator/Printer.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function printFunction(GlobalFunction $function, ?PhpNamespace $namespace
6161
$body = Helpers::simplifyTaggedNames($function->getBody(), $this->namespace);
6262

6363
return Helpers::formatDocComment($function->getComment() . "\n")
64-
. self::printAttributes($function->getAttributes())
64+
. $this->printAttributes($function->getAttributes())
6565
. $line
6666
. $this->printParameters($function, strlen($line) + strlen($returnType) + 2) // 2 = parentheses
6767
. $returnType
@@ -82,7 +82,7 @@ public function printClosure(Closure $closure, ?PhpNamespace $namespace = null):
8282
: $tmp;
8383
$body = Helpers::simplifyTaggedNames($closure->getBody(), $this->namespace);
8484

85-
return self::printAttributes($closure->getAttributes(), true)
85+
return $this->printAttributes($closure->getAttributes(), true)
8686
. 'function '
8787
. ($closure->getReturnReference() ? '&' : '')
8888
. $this->printParameters($closure)
@@ -103,7 +103,7 @@ public function printArrowFunction(Closure $closure, ?PhpNamespace $namespace =
103103

104104
$body = Helpers::simplifyTaggedNames($closure->getBody(), $this->namespace);
105105

106-
return self::printAttributes($closure->getAttributes())
106+
return $this->printAttributes($closure->getAttributes())
107107
. 'fn'
108108
. ($closure->getReturnReference() ? '&' : '')
109109
. $this->printParameters($closure)
@@ -128,7 +128,7 @@ public function printMethod(Method $method, ?PhpNamespace $namespace = null): st
128128
$body = Helpers::simplifyTaggedNames((string) $method->getBody(), $this->namespace);
129129

130130
return Helpers::formatDocComment($method->getComment() . "\n")
131-
. self::printAttributes($method->getAttributes())
131+
. $this->printAttributes($method->getAttributes())
132132
. $line
133133
. $params
134134
. $returnType
@@ -162,7 +162,7 @@ public function printClass(ClassType $class, ?PhpNamespace $namespace = null): s
162162
$cases = [];
163163
foreach ($class->getCases() as $case) {
164164
$cases[] = Helpers::formatDocComment((string) $case->getComment())
165-
. self::printAttributes($case->getAttributes())
165+
. $this->printAttributes($case->getAttributes())
166166
. 'case ' . $case->getName()
167167
. ($case->getValue() === null ? '' : ' = ' . $this->dump($case->getValue()))
168168
. ";\n";
@@ -179,7 +179,7 @@ public function printClass(ClassType $class, ?PhpNamespace $namespace = null): s
179179
. 'const ' . $const->getName() . ' = ';
180180

181181
$consts[] = Helpers::formatDocComment((string) $const->getComment())
182-
. self::printAttributes($const->getAttributes())
182+
. $this->printAttributes($const->getAttributes())
183183
. $def
184184
. $this->dump($const->getValue(), strlen($def)) . ";\n";
185185
}
@@ -196,7 +196,7 @@ public function printClass(ClassType $class, ?PhpNamespace $namespace = null): s
196196
. '$' . $property->getName());
197197

198198
$properties[] = Helpers::formatDocComment((string) $property->getComment())
199-
. self::printAttributes($property->getAttributes())
199+
. $this->printAttributes($property->getAttributes())
200200
. $def
201201
. ($property->getValue() === null && !$property->isInitialized()
202202
? ''
@@ -220,7 +220,7 @@ public function printClass(ClassType $class, ?PhpNamespace $namespace = null): s
220220

221221
return Strings::normalize(
222222
Helpers::formatDocComment($class->getComment() . "\n")
223-
. self::printAttributes($class->getAttributes())
223+
. $this->printAttributes($class->getAttributes())
224224
. ($class->isAbstract() ? 'abstract ' : '')
225225
. ($class->isFinal() ? 'final ' : '')
226226
. ($class->getName() ? $class->getType() . ' ' . $class->getName() . $enumType . ' ' : '')
@@ -317,7 +317,7 @@ protected function printParameters($function, int $column = 0): string
317317
$promoted = $param instanceof PromotedParameter ? $param : null;
318318
$params[] =
319319
($promoted ? Helpers::formatDocComment((string) $promoted->getComment()) : '')
320-
. ($attrs = self::printAttributes($param->getAttributes(), true))
320+
. ($attrs = $this->printAttributes($param->getAttributes(), true))
321321
. ($promoted ?
322322
($promoted->getVisibility() ?: 'public')
323323
. ($promoted->isReadOnly() && $type ? ' readonly' : '')

0 commit comments

Comments
 (0)