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