Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1489021

Browse files
fabpotarnaud-lb
authored andcommitted
fixed CS
1 parenta270458 commit1489021

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

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

Lines changed: 10 additions & 12 deletions
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
publicfunctionhasAttribute($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
publicfunctiongetAttribute($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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ private function compileRoutes(RouteCollection $routes, $supportsRedirections)
117117

118118
foreach ($groupsas$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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
useSymfony\Component\Routing\Route;
1616
useSymfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper;
1717
useSymfony\Component\Routing\RequestContext;
18-
useSymfony\Component\Routing\Matcher\Dumper\DumperCollection;
1918

2019
class PhpGeneratorDumperTestextends \PHPUnit_Framework_TestCase
2120
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp