8000 Merge branch '2.7' into 2.8 · symfony/symfony@8c5fe44 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8c5fe44

Browse files
Merge branch '2.7' into 2.8
* 2.7: [minor] SCA
2 parents 733e813 + b97a4ae commit 8c5fe44

File tree

7 files changed

+8
-13
lines changed

7 files changed

+8
-13
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,10 @@ private function findTemplatesInFolder($dir)
9797
private function findTemplatesInBundle(BundleInterface $bundle)
9898
{
9999
$name = $bundle->getName();
100-
$templates = array_merge(
100+
$templates = array_unique(array_merge(
101101
$this->findTemplatesInFolder($bundle->getPath().'/Resources/views'),
102102
$this->findTemplatesInFolder($this->rootDir.'/'.$name.'/views')
103-
);
104-
$templates = array_unique($templates);
103+
));
105104

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

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

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

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function getDescription()
195195
*
196196
* @return bool
197197
*/
198-
public function equals(InputOption $option)
198+
public function equals(self $option)
199199
{
200200
return $option->getName() === $this->getName()
201201
&& $option->getShortcut() === $this->getShortcut()

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

Lines changed: 1 addition & 5 deletions
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)
0