Skip to content

Commit 48b8c53

Browse files
committed
cs
1 parent 742b2b0 commit 48b8c53

File tree

12 files changed

+75
-157
lines changed

12 files changed

+75
-157
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 18 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,14 @@ public function __toString(): string
9797
}
9898

9999

100-
/**
101-
* Deprecated: an object can be in multiple namespaces.
102-
* @deprecated
103-
*/
100+
/** @deprecated an object can be in multiple namespaces */
104101
public function getNamespace(): ?PhpNamespace
105102
{
106103
return $this->namespace;
107104
}
108105

109106

110-
/**
111-
* @return static
112-
*/
107+
/** @return static */
113108
public function setName(?string $name): self
114109
{
115110
if ($name !== null && !Helpers::isIdentifier($name)) {
@@ -126,9 +121,7 @@ public function getName(): ?string
126121
}
127122

128123

129-
/**
130-
* @return static
131-
*/
124+
/** @return static */
132125
public function setType(string $type): self
133126
{
134127
if (!in_array($type, [self::TYPE_CLASS, self::TYPE_INTERFACE, self::TYPE_TRAIT], true)) {
@@ -145,9 +138,7 @@ public function getType(): string
145138
}
146139

147140

148-
/**
149-
* @return static
150-
*/
141+
/** @return static */
151142
public function setFinal(bool $state = true): self
152143
{
153144
$this->final = $state;
@@ -161,9 +152,7 @@ public function isFinal(): bool
161152
}
162153

163154

164-
/**
165-
* @return static
166-
*/
155+
/** @return static */
167156
public function setAbstract(bool $state = true): self
168157
{
169158
$this->abstract = $state;
@@ -192,18 +181,14 @@ public function setExtends($names): self
192181
}
193182

194183

195-
/**
196-
* @return string|string[]
197-
*/
184+
/** @return string|string[] */
198185
public function getExtends()
199186
{
200187
return $this->extends;
201188
}
202189

203190

204-
/**
205-
* @return static
206-
*/
191+
/** @return static */
207192
public function addExtend(string $name): self
208193
{
209194
$this->validateNames([$name]);
@@ -225,18 +210,14 @@ public function setImplements(array $names): self
225210
}
226211

227212

228-
/**
229-
* @return string[]
230-
*/
213+
/** @return string[] */
231214
public function getImplements(): array
232215
{
233216
return $this->implements;
234217
}
235218

236219

237-
/**
238-
* @return static
239-
*/
220+
/** @return static */
240221
public function addImplement(string $name): self
241222
{
242223
$this->validateNames([$name]);
@@ -257,27 +238,21 @@ public function setTraits(array $names): self
257238
}
258239

259240

260-
/**
261-
* @return string[]
262-
*/
241+
/** @return string[] */
263242
public function getTraits(): array
264243
{
265244
return array_keys($this->traits);
266245
}
267246

268247

269-
/**
270-
* @internal
271-
*/
248+
/** @internal */
272249
public function getTraitResolutions(): array
273250
{
274251
return $this->traits;
275252
}
276253

277254

278-
/**
279-
* @return static
280-
*/
255+
/** @return static */
281256
public function addTrait(string $name, array $resolutions = []): self
282257
{
283258
$this->validateNames([$name]);
@@ -327,9 +302,7 @@ public function setConstants(array $consts): self
327302
}
328303

329304

330-
/**
331-
* @return Constant[]
332-
*/
305+
/** @return Constant[] */
333306
public function getConstants(): array
334307
{
335308
return $this->consts;
@@ -342,9 +315,7 @@ public function addConstant(string $name, $value): Constant
342315
}
343316

344317

345-
/**
346-
* @return static
347-
*/
318+
/** @return static */
348319
public function removeConstant(string $name): self
349320
{
350321
unset($this->consts[$name]);
@@ -369,9 +340,7 @@ public function setProperties(array $props): self
369340
}
370341

371342

372-
/**
373-
* @return Property[]
374-
*/
343+
/** @return Property[] */
375344
public function getProperties(): array
376345
{
377346
return $this->properties;
@@ -430,9 +399,7 @@ public function setMethods(array $methods): self
430399
}
431400

432401

433-
/**
434-
* @return Method[]
435-
*/
402+
/** @return Method[] */
436403
public function getMethods(): array
437404
{
438405
return $this->methods;
@@ -460,9 +427,7 @@ public function addMethod(string $name): Method
460427
}
461428

462429

463-
/**
464-
* @return static
465-
*/
430+
/** @return static */
466431
public function removeMethod(string $name): self
467432
{
468433
unset($this->methods[$name]);
@@ -476,9 +441,7 @@ public function hasMethod(string $name): bool
476441
}
477442

478443

479-
/**
480-
* @throws Nette\InvalidStateException
481-
*/
444+
/** @throws Nette\InvalidStateException */
482445
public function validate(): void
483446
{
484447
if ($this->abstract && $this->final) {

src/PhpGenerator/Constant.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ final class Constant
2626
private $value;
2727

2828

29-
/**
30-
* @return static
31-
*/
29+
/** @return static */
3230
public function setValue($val): self
3331
{
3432
$this->value = $val;

src/PhpGenerator/Factory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ public function fromMethodReflection(\ReflectionMethod $from): Method
8383
}
8484

8585

86-
/**
87-
* @return GlobalFunction|Closure
88-
*/
86+
/** @return GlobalFunction|Closure */
8987
public function fromFunctionReflection(\ReflectionFunction $from)
9088
{
9189
$function = $from->isClosure() ? new Closure : new GlobalFunction($from->getName());

src/PhpGenerator/Method.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ public function __toString(): string
6161
}
6262

6363

64-
/**
65-
* @return static
66-
*/
64+
/** @return static */
6765
public function setBody(?string $code, array $args = null): self
6866
{
6967
$this->body = $args === null || $code === null ? $code : (new Dumper)->format($code, ...$args);
@@ -77,9 +75,7 @@ public function getBody(): ?string
7775
}
7876

7977

80-
/**
81-
* @return static
82-
*/
78+
/** @return static */
8379
public function setStatic(bool $state = true): self
8480
{
8581
$this->static = $state;
@@ -93,9 +89,7 @@ public function isStatic(): bool
9389
}
9490

9591

96-
/**
97-
* @return static
98-
*/
92+
/** @return static */
9993
public function setFinal(bool $state = true): self
10094
{
10195
$this->final = $state;
@@ -109,9 +103,7 @@ public function isFinal(): bool
109103
}
110104

111105

112-
/**
113-
* @return static
114-
*/
106+
/** @return static */
115107
public function setAbstract(bool $state = true): self
116108
{
117109
$this->abstract = $state;
@@ -125,9 +117,7 @@ public function isAbstract(): bool
125117
}
126118

127119

128-
/**
129-
* @throws Nette\InvalidStateException
130-
*/
120+
/** @throws Nette\InvalidStateException */
131121
public function validate(): void
132122
{
133123
if ($this->abstract && ($this->final || $this->visibility === ClassType::VISIBILITY_PRIVATE)) {

src/PhpGenerator/Parameter.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ final class Parameter
3838
private $defaultValue;
3939

4040

41-
/**
42-
* @return static
43-
*/
41+
/** @return static */
4442
public function setReference(bool $state = true): self
4543
{
4644
$this->reference = $state;
@@ -54,9 +52,7 @@ public function isReference(): bool
5452
}
5553

5654

57-
/**
58-
* @return static
59-
*/
55+
/** @return static */
6056
public function setType(?string $type): self
6157
{
6258
$this->type = $type;
@@ -97,9 +93,7 @@ public function setOptional(bool $state = true): self
9793
}
9894

9995

100-
/**
101-
* @return static
102-
*/
96+
/** @return static */
10397
public function setNullable(bool $state = true): self
10498
{
10599
$this->nullable = $state;
@@ -113,9 +107,7 @@ public function isNullable(): bool
113107
}
114108

115109

116-
/**
117-
* @return static
118-
*/
110+
/** @return static */
119111
public function setDefaultValue($val): self
120112
{
121113
$this->defaultValue = $val;

src/PhpGenerator/PhpFile.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,14 @@ public function addNamespace(string $name): PhpNamespace
6868
}
6969

7070

71-
/**
72-
* @return PhpNamespace[]
73-
*/
71+
/** @return PhpNamespace[] */
7472
public function getNamespaces(): array
7573
{
7674
return $this->namespaces;
7775
}
7876

7977

80-
/**
81-
* @return static
82-
*/
78+
/** @return static */
8379
public function addUse(string $name, string $alias = null): self
8480
{
8581
$this->addNamespace('')->addUse($name, $alias);

src/PhpGenerator/PhpNamespace.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ public function addUse(string $name, string $alias = null, string &$aliasOut = n
118118
}
119119

120120

121-
/**
122-
* @return string[]
123-
*/
121+
/** @return string[] */
124122
public function getUses(): array
125123
{
126124
return $this->uses;
@@ -152,9 +150,7 @@ public function unresolveName(string $name): string
152150
}
153151

154152

155-
/**
156-
* @return static
157-
*/
153+
/** @return static */
158154
public function add(ClassType $class): self
159155
{
160156
$name = $class->getName();
@@ -186,9 +182,7 @@ public function addTrait(string $name): ClassType
186182
}
187183

188184

189-
/**
190-
* @return ClassType[]
191-
*/
185+
/** @return ClassType[] */
192186
public function getClasses(): array
193187
{
194188
return $this->classes;

src/PhpGenerator/Printer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,7 @@ public function printFile(PhpFile $file): string
200200
}
201201

202202

203-
/**
204-
* @return static
205-
*/
203+
/** @return static */
206204
public function setTypeResolving(bool $state = true): self
207205
{
208206
$this->resolveTypes = $state;

0 commit comments

Comments
 (0)