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

Appearance settings

Commit 8d3757f

Browse filesBrowse files
pborrelitidal
authored andcommitted
[OutputEscaper] fixed coding standard: removed useless else statements
1 parent 1115c47 commit 8d3757f
Copy full SHA for 8d3757f

File tree

Expand file treeCollapse file tree

1 file changed

+13
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-9
lines changed

‎src/Symfony/Components/OutputEscaper/Escaper.php

Copy file name to clipboardExpand all lines: src/Symfony/Components/OutputEscaper/Escaper.php
+13-9Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,26 +127,28 @@ static public function escape($escaper, $value)
127127

128128
return $copy;
129129
}
130-
elseif (self::isClassMarkedAsSafe(get_class($value)))
130+
131+
if (self::isClassMarkedAsSafe(get_class($value)))
131132
{
132133
// the class or one of its children is marked as safe
133134
// return the unescaped object
134135
return $value;
135136
}
136-
elseif ($value instanceof SafeDecorator)
137+
138+
if ($value instanceof SafeDecorator)
137139
{
138140
// do not escape objects marked as safe
139141
// return the original object
140142
return $value->getValue();
141143
}
142-
elseif ($value instanceof \Traversable)
144+
145+
if ($value instanceof \Traversable)
143146
{
144147
return new IteratorDecorator($escaper, $value);
145148
}
146-
else
147-
{
148-
return new ObjectDecorator($escaper, $value);
149-
}
149+
150+
return new ObjectDecorator($escaper, $value);
151+
150152
}
151153

152154
// it must be a resource; cannot escape that.
@@ -173,7 +175,8 @@ static public function unescape($value)
173175
{
174176
return html_entity_decode($value, ENT_QUOTES, self::$charset);
175177
}
176-
elseif (is_array($value))
178+
179+
if (is_array($value))
177180
{
178181
foreach ($value as $name => $v)
179182
{
@@ -182,7 +185,8 @@ static public function unescape($value)
182185

183186
return $value;
184187
}
185-
elseif (is_object($value))
188+
189+
if (is_object($value))
186190
{
187191
return $value instanceof Escaper ? $value->getRawValue() : $value;
188192
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.