Skip to content

Commit 67a2a9b

Browse files
authored
Upgrade phpcs-tool to 9.0.0 (#71)
1 parent 46bd5e3 commit 67a2a9b

19 files changed

Lines changed: 102 additions & 284 deletions

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"require-dev": {
2121
"composer/composer": "^2.0.0",
22-
"hostnet/phpcs-tool": "^8.3.21",
22+
"hostnet/phpcs-tool": "^9.0.0",
2323
"phpunit/phpunit": "^8.5.0"
2424
},
2525
"conflict": {

src/Annotation/Generate.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,21 @@ class Generate
2323
{
2424
/**
2525
* No method should be generated.
26-
*
27-
* @var string
2826
*/
2927
public const VISIBILITY_NONE = 'none';
3028

3129
/**
3230
* A public method should be generated.
33-
*
34-
* @var string
3531
*/
3632
public const VISIBILITY_PUBLIC = 'public';
3733

3834
/**
3935
* A protected method should be generated.
40-
*
41-
* @var string
4236
*/
4337
public const VISIBILITY_PROTECTED = 'protected';
4438

4539
/**
4640
* A private method should be generated.
47-
*
48-
* @var string
4941
*/
5042
public const VISIBILITY_PRIVATE = 'private';
5143

@@ -218,8 +210,6 @@ public function getEnumerators(): array
218210
* - public
219211
*
220212
* @param array ...$requirements
221-
*
222-
* @return string
223213
*/
224214
public static function getMostLimitedVisibility(...$requirements): string
225215
{

src/AnnotationProcessor/AnnotationProcessorInterface.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ interface AnnotationProcessorInterface
2121
* @param object $annotation class annotated with @annotation
2222
* @param PropertyInformation $information location to store new
2323
* information about the property
24-
* @return void
2524
*/
2625
public function processAnnotation($annotation, PropertyInformation $information): void;
2726

@@ -31,8 +30,6 @@ public function processAnnotation($annotation, PropertyInformation $information)
3130
*
3231
* This value can be used to feed it into a doc parser to only parse
3332
* the annotations that will actually be used.
34-
*
35-
* @return string
3633
*/
3734
public function getProcessableAnnotationNamespace(): string;
3835
}

src/AnnotationProcessor/DoctrineAnnotationProcessor.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ class DoctrineAnnotationProcessor implements AnnotationProcessorInterface
5151
*
5252
* @param mixed $annotation object of a class annotated with @annotation
5353
* @param PropertyInformation $information
54-
*
55-
* @return void
5654
*/
5755

5856
public function processAnnotation($annotation, PropertyInformation $information): void
@@ -98,9 +96,6 @@ public function processAnnotation($annotation, PropertyInformation $information)
9896
// Do nothing for other types
9997
}
10098

101-
/**
102-
* {@inheritdoc}
103-
*/
10499
public function getProcessableAnnotationNamespace(): string
105100
{
106101
return 'Doctrine\ORM\Mapping';
@@ -214,6 +209,8 @@ private function processJoinColumn(JoinColumn $join_column, PropertyInformation
214209
*
215210
* @param mixed $type
216211
*
212+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint
213+
*
217214
* @return mixed A valid PHP type
218215
*/
219216
private function transformType($type)
@@ -279,8 +276,6 @@ private function transformType($type)
279276
* is in the current namespace and is left as-is.
280277
*
281278
* @param string $type
282-
*
283-
* @return string
284279
*/
285280
private function transformComplexType($type): string
286281
{
@@ -303,8 +298,6 @@ private function transformComplexType($type): string
303298
* @see http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html
304299
*
305300
* @param string $type
306-
*
307-
* @return int
308301
*/
309302
private function getIntegerSizeForType(string $type): int
310303
{

src/AnnotationProcessor/GenerateAnnotationProcessor.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ public function processAnnotation($annotation, PropertyInformation $info): void
7878
$info->setIsGenerator(true);
7979
}
8080

81-
/**
82-
* {@inheritdoc}
83-
*/
8481
public function getProcessableAnnotationNamespace(): string
8582
{
8683
return 'Hostnet\Component\AccessorGenerator\Annotation';

src/AnnotationProcessor/PropertyInformation.php

Lines changed: 27 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -22,133 +22,133 @@ class PropertyInformation implements PropertyInformationInterface
2222
{
2323
/**
2424
* {@inheritdoc}
25-
25+
*
2626
* @var string|null
2727
*/
2828
private $type;
2929

3030
/**
3131
* {@inheritdoc}
32-
32+
*
3333
* @var string
3434
*/
3535
private $type_hint = '';
3636

3737
/**
3838
* {@inheritdoc}
39-
39+
*
4040
* @var string
4141
*/
4242
private $fully_qualified_type = '';
4343

4444
/**
4545
* {@inheritdoc}
46-
46+
*
4747
* @var string
4848
*/
4949
private $encryption_alias;
5050

5151
/**
5252
* {@inheritdoc}
53-
53+
*
5454
* @var int
5555
*/
5656
private $integer_size = 32; // Be on the safe side for database interaction.
5757

5858
/**
5959
* {@inheritdoc}
60-
60+
*
6161
* @var int
6262
*/
6363
private $length = 0;
6464

6565
/**
6666
* {@inheritdoc}
67-
67+
*
6868
* @var int
6969
*/
7070
private $precision = 0;
7171

7272
/**
7373
* {@inheritdoc}
74-
74+
*
7575
* @var int
7676
*/
7777
private $scale = 0;
7878

7979
/**
8080
* {@inheritdoc}
81-
81+
*
8282
* @var bool|null
8383
*/
8484
private $nullable;
8585

8686
/**
8787
* {@inheritdoc}
88-
88+
*
8989
* @var bool|null
9090
*/
9191
private $unique;
9292

9393
/**
9494
* {@inheritdoc}
95-
95+
*
9696
* @var bool
9797
*/
9898
private $is_generator = false;
9999

100100
/**
101101
* {@inheritdoc}
102-
102+
*
103103
* @var bool
104104
*/
105105
private $is_fixed_point_number = false;
106106

107107
/**
108108
* {@inheritdoc}
109-
109+
*
110110
* @var string
111111
*/
112112
private $referenced_property = '';
113113

114114
/**
115115
* {@inheritdoc}
116-
116+
*
117117
* @var bool
118118
*/
119119
private $is_collection = false;
120120

121121
/**
122122
* {@inheritdoc}
123-
123+
*
124124
* @var bool
125125
*/
126126
private $is_referencing_collection = false;
127127

128128
/**
129129
* {@inheritdoc}
130-
130+
*
131131
* @var bool
132132
*/
133133
private $generate_strict = true;
134134

135135
/**
136136
* {@inheritdoc}
137-
137+
*
138138
* @var string|null
139139
*/
140140
private $generate_get;
141141

142142
/**
143143
* {@inheritdoc}
144-
144+
*
145145
* @var string|null
146146
*/
147147
private $generate_set;
148148

149149
/**
150150
* {@inheritdoc}
151-
151+
*
152152
* @var string|null
153153
*/
154154
private $generate_add;
@@ -162,14 +162,14 @@ class PropertyInformation implements PropertyInformationInterface
162162

163163
/**
164164
* {@inheritdoc}
165-
165+
*
166166
* @var string|null
167167
*/
168168
private $index;
169169

170170
/**
171171
* {@inheritdoc}
172-
172+
*
173173
* @var string|null
174174
*/
175175
private $generate_remove;
@@ -230,7 +230,6 @@ public function registerAnnotationProcessor(AnnotationProcessorInterface $proces
230230
/**
231231
* Start the processing of processAnnotations
232232
*
233-
* @return void
234233
* @throws \OutOfBoundsException
235234
* @throws \Hostnet\Component\AccessorGenerator\Reflection\Exception\ClassDefinitionNotFoundException
236235
* @throws \RuntimeException
@@ -399,7 +398,6 @@ public function getFullyQualifiedType(): string
399398
*
400399
* @throws \DomainException
401400
* @throws \InvalidArgumentException
402-
* @return string
403401
*/
404402
private function validateType(string $type): string
405403
{
@@ -613,9 +611,6 @@ public function setIsGenerator($bool): void
613611
$this->is_generator = $bool;
614612
}
615613

616-
/**
617-
* {@inheritdoc}
618-
*/
619614
public function isGenerator(): bool
620615
{
621616
return $this->is_generator;
@@ -782,7 +777,7 @@ public function setPrecision(?int $precision): self
782777
*
783778
* @return number
784779
*/
785-
public function getScale()
780+
public function getScale(): int
786781
{
787782
return $this->scale;
788783
}
@@ -813,12 +808,7 @@ public function setScale(?int $scale): self
813808
return $this;
814809
}
815810

816-
/**
817-
* {@inheritdoc}
818-
*
819-
* @return bool|null
820-
*/
821-
public function isNullable()
811+
public function isNullable(): ?bool
822812
{
823813
if (null === $this->nullable) {
824814
return null;
@@ -1022,42 +1012,22 @@ private static function getValidTypes(): array
10221012
];
10231013
}
10241014

1025-
/**
1026-
* {@inheritdoc}
1027-
*
1028-
* @return string|null
1029-
*/
1030-
public function getGetVisibility()
1015+
public function getGetVisibility(): ?string
10311016
{
10321017
return $this->generate_get;
10331018
}
10341019

1035-
/**
1036-
* {@inheritdoc}
1037-
*
1038-
* @return string|null
1039-
*/
1040-
public function getSetVisibility()
1020+
public function getSetVisibility(): ?string
10411021
{
10421022
return $this->generate_set;
10431023
}
10441024

1045-
/**
1046-
* {@inheritdoc}
1047-
*
1048-
* @return string|null
1049-
*/
1050-
public function getAddVisibility()
1025+
public function getAddVisibility(): ?string
10511026
{
10521027
return $this->generate_add;
10531028
}
10541029

1055-
/**
1056-
* {@inheritdoc}
1057-
*
1058-
* @return string|null
1059-
*/
1060-
public function getRemoveVisibility()
1030+
public function getRemoveVisibility(): ?string
10611031
{
10621032
return $this->generate_remove;
10631033
}
@@ -1082,8 +1052,6 @@ public function addEnumeratorToGenerate(Enumerator $enumerator): void
10821052

10831053
/**
10841054
* Returns true if an enumerator accessor will be generated for this property.
1085-
*
1086-
* @return bool
10871055
*/
10881056
public function willGenerateEnumeratorAccessors(): bool
10891057
{

0 commit comments

Comments
 (0)