Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit ebf86dd

Browse files
michalbundyraOcramius
authored andcommitted
Manual CS fixes
1 parent 185beaf commit ebf86dd

30 files changed

+182
-149
lines changed

phpcs.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
<?xml version="1.0"?>
22
<ruleset name="Zend Framework coding standard">
33
<rule ref="./vendor/zendframework/zend-coding-standard/ruleset.xml"/>
4+
5+
<rule ref="ZendCodingStandard.Commenting.FunctionComment.TypeHintMissing">
6+
<severity>0</severity>
7+
</rule>
8+
9+
<rule ref="ZendCodingStandard.NamingConventions.ValidVariableName.NotCamelCaps">
10+
<exclude-pattern>src/Scanner/AnnotationScanner.php</exclude-pattern>
11+
<exclude-pattern>src/Scanner/ClassScanner.php</exclude-pattern>
12+
<exclude-pattern>src/Scanner/DocBlockScanner.php</exclude-pattern>
13+
<exclude-pattern>src/Scanner/MethodScanner.php</exclude-pattern>
14+
<exclude-pattern>src/Scanner/TokenArrayScanner.php</exclude-pattern>
15+
</rule>
16+
417
<!-- Paths to check -->
518
<file>src</file>
619
<file>test</file>

src/Annotation/Parser/GenericAnnotationParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function onCreateAnnotation(EventInterface $e)
8080
*
8181
* @param string|AnnotationInterface $annotation String class name of an
8282
* AnnotationInterface implementation, or actual instance
83-
* @return GenericAnnotationParser
83+
* @return void
8484
* @throws Exception\InvalidArgumentException
8585
*/
8686
public function registerAnnotation($annotation)

src/Generator/ClassGenerator.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use Zend\Code\Reflection\ClassReflection;
1313

14-
class ClassGenerator extends AbstractGenerator
14+
class ClassGenerator extends AbstractGenerator implements TraitUsageInterface
1515
{
1616
const OBJECT_TYPE = 'class';
1717
const IMPLEMENTS_KEYWORD = 'implements';
@@ -479,7 +479,7 @@ public function hasImplementedInterface($implementedInterface)
479479
}
480480

481481
/**
482-
* @param $implementedInterface
482+
* @param string $implementedInterface
483483
* @return self
484484
*/
485485
public function removeImplementedInterface($implementedInterface)
@@ -563,8 +563,8 @@ public function addConstantFromGenerator(PropertyGenerator $constant)
563563
/**
564564
* Add Constant
565565
*
566-
* @param string $name non-empty string
567-
* @param string|int|null|float|array $value scalar
566+
* @param string $name Non-empty string
567+
* @param string|int|null|float|array $value Scalar
568568
*
569569
* @throws Exception\InvalidArgumentException
570570
*
@@ -748,7 +748,7 @@ public function hasUseAlias($use)
748748
}
749749

750750
/**
751-
* @param $use
751+
* @param string $use
752752
* @return self
753753
*/
754754
public function removeUseAlias($use)
@@ -897,7 +897,7 @@ public function hasMethod($methodName)
897897
}
898898

899899
/**
900-
* @inherit Zend\Code\Generator\TraitUsageInterface
900+
* @inheritDoc
901901
*/
902902
public function addTrait($trait)
903903
{
@@ -906,7 +906,7 @@ public function addTrait($trait)
906906
}
907907

908908
/**
909-
* @inherit Zend\Code\Generator\TraitUsageInterface
909+
* @inheritDoc
910910
*/
911911
public function addTraits(array $traits)
912912
{
@@ -915,31 +915,31 @@ public function addTraits(array $traits)
915915
}
916916

917917
/**
918-
* @inherit Zend\Code\Generator\TraitUsageInterface
918+
* @inheritDoc
919919
*/
920920
public function hasTrait($traitName)
921921
{
922922
return $this->traitUsageGenerator->hasTrait($traitName);
923923
}
924924

925925
/**
926-
* @inherit Zend\Code\Generator\TraitUsageInterface
926+
* @inheritDoc
927927
*/
928928
public function getTraits()
929929
{
930930
return $this->traitUsageGenerator->getTraits();
931931
}
932932

933933
/**
934-
* @inherit Zend\Code\Generator\TraitUsageInterface
934+
* @inheritDoc
935935
*/
936936
public function removeTrait($traitName)
937937
{
938938
return $this->traitUsageGenerator->removeTrait($traitName);
939939
}
940940

941941
/**
942-
* @inherit Zend\Code\Generator\TraitUsageInterface
942+
* @inheritDoc
943943
*/
944944
public function addTraitAlias($method, $alias, $visibility = null)
945945
{
@@ -948,15 +948,15 @@ public function addTraitAlias($method, $alias, $visibility = null)
948948
}
949949

950950
/**
951-
* @inherit Zend\Code\Generator\TraitUsageInterface
951+
* @inheritDoc
952952
*/
953953
public function getTraitAliases()
954954
{
955955
return $this->traitUsageGenerator->getTraitAliases();
956956
}
957957

958958
/**
959-
* @inherit Zend\Code\Generator\TraitUsageInterface
959+
* @inheritDoc
960960
*/
961961
public function addTraitOverride($method, $traitsToReplace)
962962
{
@@ -965,7 +965,7 @@ public function addTraitOverride($method, $traitsToReplace)
965965
}
966966

967967
/**
968-
* @inherit Zend\Code\Generator\TraitUsageInterface
968+
* @inheritDoc
969969
*/
970970
public function removeTraitOverride($method, $overridesToRemove = null)
971971
{
@@ -975,7 +975,7 @@ public function removeTraitOverride($method, $overridesToRemove = null)
975975
}
976976

977977
/**
978-
* @inherit Zend\Code\Generator\TraitUsageInterface
978+
* @inheritDoc
979979
*/
980980
public function getTraitOverrides()
981981
{
@@ -1007,7 +1007,7 @@ public function isSourceDirty()
10071007
}
10081008

10091009
/**
1010-
* @inherit Zend\Code\Generator\GeneratorInterface
1010+
* @inheritDoc
10111011
*/
10121012
public function generate()
10131013
{

src/Generator/DocBlockGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ protected function docCommentize($content)
263263
foreach ($lines as $line) {
264264
$output .= $indent . ' *';
265265
if ($line) {
266-
$output .= " $line";
266+
$output .= ' ' . $line;
267267
}
268268
$output .= self::LINE_FEED;
269269
}

src/Generator/MethodGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public function getBody()
274274
}
275275

276276
/**
277-
* @param string|null
277+
* @param string|null $returnType
278278
*
279279
* @return MethodGenerator
280280
*/

src/Generator/ParameterGenerator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,6 @@ private static function expandLiteralParameterType($literalParameterType, Reflec
387387
}
388388

389389
/**
390-
* @param string|null $type
391-
*
392390
* @return string
393391
*/
394392
private function generateTypeHint()

src/Generator/TraitUsageGenerator.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Reflection;
1313
use ReflectionMethod;
1414

15-
class TraitUsageGenerator extends AbstractGenerator
15+
class TraitUsageGenerator extends AbstractGenerator implements TraitUsageInterface
1616
{
1717
/**
1818
* @var ClassGenerator
@@ -45,7 +45,7 @@ public function __construct(ClassGenerator $classGenerator)
4545
}
4646

4747
/**
48-
* @inherit Zend\Code\Generator\TraitUsageInterface
48+
* @inheritDoc
4949
*/
5050
public function addUse($use, $useAlias = null)
5151
{
@@ -60,15 +60,15 @@ public function addUse($use, $useAlias = null)
6060
}
6161

6262
/**
63-
* @inherit Zend\Code\Generator\TraitUsageInterface
63+
* @inheritDoc
6464
*/
6565
public function getUses()
6666
{
6767
return array_values($this->uses);
6868
}
6969

7070
/**
71-
* @param $use
71+
* @param string $use
7272
* @return bool
7373
*/
7474
public function hasUse($use)
@@ -84,14 +84,14 @@ public function hasUse($use)
8484
}
8585

8686
/**
87-
* @param $use
87+
* @param string $use
8888
* @return bool
8989
*/
9090
public function hasUseAlias($use)
9191
{
9292
foreach ($this->uses as $key => $value) {
9393
$parts = explode(' as ', $value);
94-
if ($parts[0] === $use and count($parts) == 2) {
94+
if ($parts[0] === $use && count($parts) == 2) {
9595
return true;
9696
}
9797
}
@@ -100,7 +100,7 @@ public function hasUseAlias($use)
100100
}
101101

102102
/**
103-
* @param $use
103+
* @param string $use
104104
* @return TraitUsageGenerator
105105
*/
106106
public function removeUse($use)
@@ -116,14 +116,14 @@ public function removeUse($use)
116116
}
117117

118118
/**
119-
* @param $use
119+
* @param string $use
120120
* @return TraitUsageGenerator
121121
*/
122122
public function removeUseAlias($use)
123123
{
124124
foreach ($this->uses as $key => $value) {
125125
$parts = explode(' as ', $value);
126-
if ($parts[0] === $use and count($parts) == 2) {
126+
if ($parts[0] === $use && count($parts) == 2) {
127127
unset($this->uses[$value]);
128128
}
129129
}
@@ -132,7 +132,7 @@ public function removeUseAlias($use)
132132
}
133133

134134
/**
135-
* @inherit Zend\Code\Generator\TraitUsageInterface
135+
* @inheritDoc
136136
*/
137137
public function addTrait($trait)
138138
{
@@ -164,7 +164,7 @@ public function addTrait($trait)
164164
}
165165

166166
/**
167-
* @inherit Zend\Code\Generator\TraitUsageInterface
167+
* @inheritDoc
168168
*/
169169
public function addTraits(array $traits)
170170
{
@@ -176,23 +176,23 @@ public function addTraits(array $traits)
176176
}
177177

178178
/**
179-
* @inherit Zend\Code\Generator\TraitUsageInterface
179+
* @inheritDoc
180180
*/
181181
public function hasTrait($traitName)
182182
{
183183
return in_array($traitName, $this->traits);
184184
}
185185

186186
/**
187-
* @inherit Zend\Code\Generator\TraitUsageInterface
187+
* @inheritDoc
188188
*/
189189
public function getTraits()
190190
{
191191
return $this->traits;
192192
}
193193

194194
/**
195-
* @inherit Zend\Code\Generator\TraitUsageInterface
195+
* @inheritDoc
196196
*/
197197
public function removeTrait($traitName)
198198
{
@@ -205,7 +205,7 @@ public function removeTrait($traitName)
205205
}
206206

207207
/**
208-
* @inherit Zend\Code\Generator\TraitUsageInterface
208+
* @inheritDoc
209209
*/
210210
public function addTraitAlias($method, $alias, $visibility = null)
211211
{
@@ -259,15 +259,15 @@ public function addTraitAlias($method, $alias, $visibility = null)
259259
}
260260

261261
/**
262-
* @inherit Zend\Code\Generator\TraitUsageInterface
262+
* @inheritDoc
263263
*/
264264
public function getTraitAliases()
265265
{
266266
return $this->traitAliases;
267267
}
268268

269269
/**
270-
* @inherit Zend\Code\Generator\TraitUsageInterface
270+
* @inheritDoc
271271
*/
272272
public function addTraitOverride($method, $traitsToReplace)
273273
{
@@ -320,7 +320,7 @@ public function addTraitOverride($method, $traitsToReplace)
320320
}
321321

322322
/**
323-
* @inherit Zend\Code\Generator\TraitUsageInterface
323+
* @inheritDoc
324324
*/
325325
public function removeTraitOverride($method, $overridesToRemove = null)
326326
{
@@ -346,15 +346,15 @@ public function removeTraitOverride($method, $overridesToRemove = null)
346346
}
347347

348348
/**
349-
* @inherit Zend\Code\Generator\TraitUsageInterface
349+
* @inheritDoc
350350
*/
351351
public function getTraitOverrides()
352352
{
353353
return $this->traitOverrides;
354354
}
355355

356356
/**
357-
* @inherit Zend\Code\Generator\GeneratorInterface
357+
* @inheritDoc
358358
*/
359359
public function generate()
360360
{

0 commit comments

Comments
 (0)