Skip to content

Commit b97a4ae

Browse files
minor #26938 [minor] SCA (kalessil)
This PR was squashed before being merged into the 2.7 branch (closes #26938). Discussion ---------- [minor] SCA | Q | A | ------------- | --- | Branch? | 2.7 | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a - Control flow tweaks Commits ------- 877e678 [minor] SCA
2 parents f981f7a + 877e678 commit b97a4ae

File tree

7 files changed

+8
-13
lines changed

7 files changed

+8
-13
lines changed

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ private function findTemplatesInFolder($dir)
9696
private function findTemplatesInBundle(BundleInterface $bundle)
9797
{
9898
$name = $bundle->getName();
99-
$templates = array_merge(
99+
$templates = array_unique(array_merge(
100100
$this->findTemplatesInFolder($bundle->getPath().'/Resources/views'),
101101
$this->findTemplatesInFolder($this->rootDir.'/'.$name.'/views')
102-
);
103-
$templates = array_unique($templates);
102+
));
104103

105104
foreach ($templates as $i => $template) {
106105
$templates[$i] = $template->set('bundle', $name);

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function formatFile($file, $line, $text = null)
160160
$file = trim($file);
161161
$fileStr = $file;
162162
if (0 === strpos($fileStr, $this->rootDir)) {
163-
$fileStr = str_replace($this->rootDir, '', str_replace('\\', '/', $fileStr));
163+
$fileStr = str_replace(array('\\', $this->rootDir), array('/', ''), $fileStr);
164164
$fileStr = htmlspecialchars($fileStr, $flags, $this->charset);
165165
$fileStr = sprintf('<abbr title="%s">kernel.root_dir</abbr>/%s', htmlspecialchars($this->rootDir, $flags, $this->charset), $fileStr);
166166
}

src/Symfony/Component/Console/Descriptor/JsonDescriptor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private function getInputOptionData(InputOption $option)
109109
{
110110
return array(
111111
'name' => '--'.$option->getName(),
112-
'shortcut' => $option->getShortcut() ? '-'.implode('|-', explode('|', $option->getShortcut())) : '',
112+
'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '',
113113
'accept_value' => $option->acceptValue(),
114114
'is_value_required' => $option->isValueRequired(),
115115
'is_multiple' => $option->isArray(),

src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function describeInputOption(InputOption $option, array $options = arr
5050
$this->write(
5151
'**'.$option->getName().':**'."\n\n"
5252
.'* Name: `--'.$option->getName().'`'."\n"
53-
.'* Shortcut: '.($option->getShortcut() ? '`-'.implode('|-', explode('|', $option->getShortcut())).'`' : '<none>')."\n"
53+
.'* Shortcut: '.($option->getShortcut() ? '`-'.str_replace('|', '|-', $option->getShortcut()).'`' : '<none>')."\n"
5454
.'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n"
5555
.'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n"
5656
.'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n"

src/Symfony/Component/Console/Descriptor/XmlDescriptor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private function getInputOptionDocument(InputOption $option)
223223
$pos = strpos($option->getShortcut(), '|');
224224
if (false !== $pos) {
225225
$objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos));
226-
$objectXML->setAttribute('shortcuts', '-'.implode('|-', explode('|', $option->getShortcut())));
226+
$objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut()));
227227
} else {
228228
$objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : '');
229229
}

src/Symfony/Component/Console/Input/InputOption.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function getDescription()
192192
*
193193
* @return bool
194194
*/
195-
public function equals(InputOption $option)
195+
public function equals(self $option)
196196
{
197197
return $option->getName() === $this->getName()
198198
&& $option->getShortcut() === $this->getShortcut()

src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ public function hasMetadataFor($value)
162162

163163
$class = ltrim(is_object($value) ? get_class($value) : $value, '\\');
164164

165-
if (class_exists($class) || interface_exists($class)) {
166-
return true;
167-
}
168-
169-
return false;
165+
return class_exists($class) || interface_exists($class, false);
170166
}
171167
}

0 commit comments

Comments
 (0)