Skip to content

Commit a17f60a

Browse files
committed
Add missing param doc blocks to avoid code sniffer errors - close #30
1 parent 2dd550a commit a17f60a

19 files changed

+559
-393
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"require": {
3535
"php": "^7.4 || ^8.0",
3636
"open-code-modeling/json-schema-to-php": "^0.3.0 || 0.4.x-dev",
37-
"open-code-modeling/php-code-ast": "^0.12.0 || 0.13.x-dev"
37+
"open-code-modeling/php-code-ast": "^0.13.0 || 0.13.x-dev"
3838
},
3939
"require-dev": {
4040
"laminas/laminas-filter": "^2.9",

composer.lock

Lines changed: 504 additions & 380 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ValueObject/Bcp47Factory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,12 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
170170
$method = new MethodGenerator(
171171
'equals',
172172
[
173-
new ParameterGenerator($argumentName),
173+
(new ParameterGenerator($argumentName))->setTypeDocBlockHint('mixed'),
174174
],
175175
MethodGenerator::FLAG_PUBLIC,
176176
new BodyGenerator($this->parser, $body)
177177
);
178+
$method->setDocBlockComment('');
178179
$method->setTyped($this->typed);
179180
$method->setReturnType('bool');
180181

src/ValueObject/BooleanFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,12 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
188188
$method = new MethodGenerator(
189189
'equals',
190190
[
191-
new ParameterGenerator($argumentName),
191+
(new ParameterGenerator($argumentName))->setTypeDocBlockHint('mixed'),
192192
],
193193
MethodGenerator::FLAG_PUBLIC,
194194
new BodyGenerator($this->parser, $body)
195195
);
196+
$method->setDocBlockComment('');
196197
$method->setTyped($this->typed);
197198
$method->setReturnType('bool');
198199

src/ValueObject/EnumFactory.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
360360
return \$this->$propertyName === \$$argumentName->$propertyName;
361361
PHP;
362362

363-
$parameter = new ParameterGenerator($argumentName);
363+
$parameter = (new ParameterGenerator($argumentName))->setTypeDocBlockHint('mixed');
364364

365365
$method = new MethodGenerator(
366366
'equals',
@@ -370,6 +370,7 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
370370
MethodGenerator::FLAG_PUBLIC,
371371
new BodyGenerator($this->parser, $body)
372372
);
373+
$method->setDocBlockComment('');
373374
$method->setTyped($this->typed);
374375
$method->setReturnType('bool');
375376

@@ -420,7 +421,7 @@ public function methodIsOneOf(string $argumentName, ?string $className): MethodG
420421
}
421422
return false;
422423
PHP;
423-
$parameter = (new ParameterGenerator($argumentName))->setVariadic(true);
424+
$parameter = (new ParameterGenerator($argumentName))->setVariadic(true)->setTypeDocBlockHint('mixed');
424425

425426
if ($className !== null) {
426427
$parameter->setType($className);
@@ -434,6 +435,7 @@ public function methodIsOneOf(string $argumentName, ?string $className): MethodG
434435
MethodGenerator::FLAG_PUBLIC,
435436
new BodyGenerator($this->parser, $body)
436437
);
438+
$method->setDocBlockComment('');
437439
$method->setTyped($this->typed);
438440
$method->setReturnType('bool');
439441

src/ValueObject/IntegerFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,12 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
188188
$method = new MethodGenerator(
189189
'equals',
190190
[
191-
new ParameterGenerator($argumentName),
191+
(new ParameterGenerator($argumentName))->setTypeDocBlockHint('mixed'),
192192
],
193193
MethodGenerator::FLAG_PUBLIC,
194194
new BodyGenerator($this->parser, $body)
195195
);
196+
$method->setDocBlockComment('');
196197
$method->setTyped($this->typed);
197198
$method->setReturnType('bool');
198199

src/ValueObject/NumberFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,12 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
188188
$method = new MethodGenerator(
189189
'equals',
190190
[
191-
new ParameterGenerator($argumentName),
191+
(new ParameterGenerator($argumentName))->setTypeDocBlockHint('mixed'),
192192
],
193193
MethodGenerator::FLAG_PUBLIC,
194194
new BodyGenerator($this->parser, $body)
195195
);
196+
$method->setDocBlockComment('');
196197
$method->setTyped($this->typed);
197198
$method->setReturnType('bool');
198199

src/ValueObject/StringFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,12 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
188188
$method = new MethodGenerator(
189189
'equals',
190190
[
191-
new ParameterGenerator($argumentName),
191+
(new ParameterGenerator($argumentName))->setTypeDocBlockHint('mixed'),
192192
],
193193
MethodGenerator::FLAG_PUBLIC,
194194
new BodyGenerator($this->parser, $body)
195195
);
196+
$method->setDocBlockComment('');
196197
$method->setTyped($this->typed);
197198
$method->setReturnType('bool');
198199

src/ValueObject/UuidFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,12 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
192192
$method = new MethodGenerator(
193193
'equals',
194194
[
195-
new ParameterGenerator($argumentName),
195+
(new ParameterGenerator($argumentName))->setTypeDocBlockHint('mixed'),
196196
],
197197
MethodGenerator::FLAG_PUBLIC,
198198
new BodyGenerator($this->parser, $body)
199199
);
200+
$method->setDocBlockComment('');
200201
$method->setTyped($this->typed);
201202
$method->setReturnType('bool');
202203

src/ValueObjectFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
use OpenCodeModeling\CodeAst\Builder\ClassBuilder;
1414
use OpenCodeModeling\CodeAst\Builder\ClassPropertyBuilder;
15-
use OpenCodeModeling\CodeAst\Builder\File;
1615
use OpenCodeModeling\CodeAst\Builder\FileCollection;
16+
use OpenCodeModeling\CodeAst\Builder\PhpFile;
1717
use OpenCodeModeling\CodeAst\Code\ClassConstGenerator;
1818
use OpenCodeModeling\CodeAst\FileCodeGenerator;
1919
use OpenCodeModeling\CodeAst\Package\ClassInfo;
@@ -141,7 +141,7 @@ public function __construct(
141141
|| $classBuilder->hasMethod('toBool');
142142
};
143143

144-
$this->currentFileAst = static function (File $classBuilder, ClassInfo $classInfo) use ($parser): array {
144+
$this->currentFileAst = static function (PhpFile $classBuilder, ClassInfo $classInfo) use ($parser): array {
145145
$path = $classInfo->getPath($classBuilder->getNamespace() . '\\' . $classBuilder->getName());
146146
$filename = $classInfo->getFilenameFromPathAndName($path, $classBuilder->getName());
147147

0 commit comments

Comments
 (0)