[minor] SCA
This commit is contained in:
parent
10674688da
commit
877e67883c
@ -96,11 +96,10 @@ class TemplateFinder implements TemplateFinderInterface
|
||||
private function findTemplatesInBundle(BundleInterface $bundle)
|
||||
{
|
||||
$name = $bundle->getName();
|
||||
$templates = array_merge(
|
||||
$templates = array_unique(array_merge(
|
||||
$this->findTemplatesInFolder($bundle->getPath().'/Resources/views'),
|
||||
$this->findTemplatesInFolder($this->rootDir.'/'.$name.'/views')
|
||||
);
|
||||
$templates = array_unique($templates);
|
||||
));
|
||||
|
||||
foreach ($templates as $i => $template) {
|
||||
$templates[$i] = $template->set('bundle', $name);
|
||||
|
@ -160,7 +160,7 @@ class CodeHelper extends Helper
|
||||
$file = trim($file);
|
||||
$fileStr = $file;
|
||||
if (0 === strpos($fileStr, $this->rootDir)) {
|
||||
$fileStr = str_replace($this->rootDir, '', str_replace('\\', '/', $fileStr));
|
||||
$fileStr = str_replace(array('\\', $this->rootDir), array('/', ''), $fileStr);
|
||||
$fileStr = htmlspecialchars($fileStr, $flags, $this->charset);
|
||||
$fileStr = sprintf('<abbr title="%s">kernel.root_dir</abbr>/%s', htmlspecialchars($this->rootDir, $flags, $this->charset), $fileStr);
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ class JsonDescriptor extends Descriptor
|
||||
{
|
||||
return array(
|
||||
'name' => '--'.$option->getName(),
|
||||
'shortcut' => $option->getShortcut() ? '-'.implode('|-', explode('|', $option->getShortcut())) : '',
|
||||
'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '',
|
||||
'accept_value' => $option->acceptValue(),
|
||||
'is_value_required' => $option->isValueRequired(),
|
||||
'is_multiple' => $option->isArray(),
|
||||
|
@ -50,7 +50,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
$this->write(
|
||||
'**'.$option->getName().':**'."\n\n"
|
||||
.'* Name: `--'.$option->getName().'`'."\n"
|
||||
.'* Shortcut: '.($option->getShortcut() ? '`-'.implode('|-', explode('|', $option->getShortcut())).'`' : '<none>')."\n"
|
||||
.'* Shortcut: '.($option->getShortcut() ? '`-'.str_replace('|', '|-', $option->getShortcut()).'`' : '<none>')."\n"
|
||||
.'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n"
|
||||
.'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n"
|
||||
.'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n"
|
||||
|
@ -223,7 +223,7 @@ class XmlDescriptor extends Descriptor
|
||||
$pos = strpos($option->getShortcut(), '|');
|
||||
if (false !== $pos) {
|
||||
$objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos));
|
||||
$objectXML->setAttribute('shortcuts', '-'.implode('|-', explode('|', $option->getShortcut())));
|
||||
$objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut()));
|
||||
} else {
|
||||
$objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : '');
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ class InputOption
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function equals(InputOption $option)
|
||||
public function equals(self $option)
|
||||
{
|
||||
return $option->getName() === $this->getName()
|
||||
&& $option->getShortcut() === $this->getShortcut()
|
||||
|
@ -162,10 +162,6 @@ class LazyLoadingMetadataFactory implements MetadataFactoryInterface
|
||||
|
||||
$class = ltrim(is_object($value) ? get_class($value) : $value, '\\');
|
||||
|
||||
if (class_exists($class) || interface_exists($class)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return class_exists($class) || interface_exists($class, false);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user