8000 fixed CS · symfony/symfony@1489021 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1489021

Browse files
fabpotarnaud-lb
authored andcommitted
fixed CS
1 parent a270458 commit 1489021

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php

+10-12
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function add($child)
4545
}
4646

4747
/**
48-
* Sets children
48+
* Sets children.
4949
*
5050
* @param array $children The children
5151
*/
@@ -100,9 +100,10 @@ protected function setParent(DumperCollection $parent)
100100
}
101101

102102
/**
103-
* Returns true if the attribute is defined
103+
* Returns true if the attribute is defined.
104104
*
105105
* @param string $name The attribute name
106+
*
106107
* @return Boolean true if the attribute is defined, false otherwise
107108
*/
108109
public function hasAttribute($name)
@@ -111,23 +112,20 @@ public function hasAttribute($name)
111112
}
112113

113114
/**
114-
* Returns an attribute by name
115+
* Returns an attribute by name.
116+
*
117+
* @param string $name The attribute name
118+
* @param mixed $default Default value is the attribute doesn't exist
115119
*
116-
* @param string $name The attribute name
117-
* @param mixed $default Default value is the attribute doesn't exist
118120
* @return mixed The attribute value
119121
*/
120122
public function getAttribute($name, $default = null)
121123
{
122-
if ($this->hasAttribute($name)) {
123-
return $this->attributes[$name];
124-
} else {
125-
return $default;
126-
}
124+
return $this->hasAttribute($name) ? $this->attributes[$name] : $default;
127125
}
128126

129127
/**
130-
* Sets an attribute by name
128+
* Sets an attribute by name.
131129
*
132130
* @param string $name The attribute name
133131
* @param mixed $value The attribute value
@@ -138,7 +136,7 @@ public function setAttribute($name, $value)
138136
}
139137

140138
/**
141-
* Sets multiple attributes
139+
* Sets multiple attributes.
142140
*
143141
* @param array $attributes The attributes
144142
*/

src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ private function compileRoutes(RouteCollection $routes, $supportsRedirections)
117117

118118
foreach ($groups as $collection) {
119119
if (null !== $regex = $collection->getAttribute('hostname_regex')) {
120-
121120
if (!$fetchedHostname) {
122121
$code .= " \$hostname = \$this->context->getHost();\n\n";
123122
$fetchedHostname = true;
@@ -296,7 +295,6 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren
296295

297296
// optimize parameters array
298297
if (($matches || $hostnameMatches) && $route->getDefaults()) {
299-
300298
$vars = array();
301299
if ($matches) {
302300
$vars[] = '$matches';
@@ -336,7 +334,7 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren
336334
}
337335

338336
/**
339-
* Flattens a tree of routes to a single collection
337+
* Flattens a tree of routes to a single collection.
340338
*
341339
* @param RouteCollection $routes Collection of routes
342340
* @param DumperCollection $to A DumperCollection to add routes to
@@ -361,10 +359,9 @@ private function flattenRouteCollection(RouteCollection $routes, DumperCollectio
361359
}
362360

363361
/**
364-
* Groups consecutive routes having the same hostname regex
362+
* Groups consecutive routes having the same hostname regex.
365363
*
366-
* The results is a collection of collections of routes having the same
367-
* hostnameRegex
364+
* The results is a collection of collections of routes having the same hostname regex.
368365
*
369366
* @param DumperCollection $routes Flat collection of DumperRoutes
370367
*

src/Symfony/Component/Routing/RouteCompiler.php

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public function compile(Route $route)
4747
$hostnameTokens = array();
4848

4949
if (null !== $hostnamePattern = $route->getHostnamePattern()) {
50-
5150
$result = $this->compilePattern($route, $hostnamePattern, true);
5251

5352
$hostnameVariables = $result['variables'];

src/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\Routing\Route;
1616
use Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper;
1717
use Symfony\Component\Routing\RequestContext;
18-
use Symfony\Component\Routing\Matcher\Dumper\DumperCollection;
1918

2019
class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
2120
{

0 commit comments

Comments
 (0)
0