Skip to content

Commit 02e98a4

Browse files
committed
iupdate php-cs-fixer package version, apply php-cs-fixer
1 parent 2bf8be8 commit 02e98a4

File tree

6 files changed

+39
-33
lines changed

6 files changed

+39
-33
lines changed

.php_cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
<?php
22

3-
$finder = Symfony\CS\Finder\DefaultFinder::create()
3+
$finder = PhpCsFixer\Finder::create()
44
->exclude('vendor')
55
->exclude('tests')
66
->in(__DIR__);
77

8-
return Symfony\CS\Config\Config::create()
9-
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
10-
->finder($finder);
8+
return PhpCsFixer\Config::create()
9+
->setUsingCache(false)
10+
->setRules(array(
11+
'@PSR2' => true,
12+
'binary_operator_spaces' => true,
13+
'no_whitespace_in_blank_line' => true,
14+
'ternary_operator_spaces' => true,
15+
'cast_spaces' => true,
16+
'trailing_comma_in_multiline_array' => true
17+
))
18+
->setFinder($finder);

composer.json

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
{
2-
"name": "wsdltophp/phpgenerator",
3-
"description": "Generate php source file",
4-
"type": "library",
5-
"keywords" : ["php","generator"],
6-
"homepage" : "https://github.com/WsdlToPhp/PhpGenerator",
7-
"license" : "MIT",
8-
"authors" : [
9-
{
10-
"name": "Mikaël DELSOL",
11-
"email": "[email protected]",
12-
"role": "Owner"
13-
}
14-
],
15-
"support" : {
16-
"email" : "[email protected]"
17-
},
18-
"require": {
2+
"name" : "wsdltophp/phpgenerator",
3+
"description" : "Generate php source file",
4+
"require" : {
195
"php" : ">=5.3.3"
206
},
217
"require-dev": {
22-
"fabpot/php-cs-fixer": "~1.8"
8+
"friendsofphp/php-cs-fixer": "~2.0"
239
},
24-
"autoload": {
25-
"psr-4": {
26-
"WsdlToPhp\\PhpGenerator\\": "src",
27-
"WsdlToPhp\\PhpGenerator\\Tests\\": "tests"
10+
"license" : "MIT",
11+
"keywords" : [ "php", "generator" ],
12+
"autoload" : {
13+
"psr-4" : {
14+
"WsdlToPhp\\PhpGenerator\\" : "src",
15+
"WsdlToPhp\\PhpGenerator\\Tests\\" : "tests"
2816
}
29-
}
30-
}
17+
},
18+
"type" : "library",
19+
"support" : {
20+
"email" : "[email protected]"
21+
},
22+
"homepage" : "https://github.com/WsdlToPhp/PhpGenerator",
23+
"authors" : [ {
24+
"name" : "Mikaël DELSOL",
25+
"email" : "[email protected]",
26+
"role" : "Owner"
27+
} ]
28+
}

src/Element/AbstractElement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ protected function childIsValid($child)
196196
$valid |= (gettype($child) === $authorizedType) || self::objectIsValid($child, $authorizedType);
197197
}
198198
}
199-
return (bool)$valid;
199+
return (bool) $valid;
200200
}
201201
/**
202202
* @return AbstractElement[]|mixed[]
@@ -324,7 +324,7 @@ public function getIndentationString($indentation = null)
324324
public function getIndentedString($string, $indentation = null)
325325
{
326326
$strings = explode(self::BREAK_LINE_CHAR, $string);
327-
foreach ($strings as $i=>$s) {
327+
foreach ($strings as $i => $s) {
328328
$strings[$i] = sprintf('%s%s', $this->getIndentationString($indentation), $s);
329329
}
330330
return implode(self::BREAK_LINE_CHAR, $strings);

src/Element/PhpAnnotationBlock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected static function annotationsAreValid(array $annotations)
6464
foreach ($annotations as $annotation) {
6565
$valid &= self::annotationIsValid($annotation);
6666
}
67-
return (bool)$valid;
67+
return (bool) $valid;
6868
}
6969
/**
7070
* @param string|array|PhpAnnotation $annotation

src/Element/PhpClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static function interfacesAreValid(array $interfaces = array())
131131
foreach ($interfaces as $interface) {
132132
$valid &= self::interfaceIsValid($interface);
133133
}
134-
return (bool)$valid;
134+
return (bool) $valid;
135135
}
136136
/**
137137
* @param string|PhpClass $interface

src/Element/PhpFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static function parametersAreValid(array $parameters)
6565
foreach ($parameters as $parameter) {
6666
$valid &= self::parameterIsValid($parameter);
6767
}
68-
return (bool)$valid;
68+
return (bool) $valid;
6969
}
7070
/**
7171
* @param string|array|PhpFunctionParameter $parameter

0 commit comments

Comments
 (0)