Fix some cs
This commit is contained in:
parent
8eea5c3d5f
commit
bc63fb26be
@ -38,7 +38,7 @@ abstract class AbstractDoctrineExtension extends Extension
|
|||||||
*/
|
*/
|
||||||
protected $drivers = array();
|
protected $drivers = array();
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* @param array $objectManager A configured object manager.
|
* @param array $objectManager A configured object manager.
|
||||||
* @param ContainerBuilder $container A ContainerBuilder instance
|
* @param ContainerBuilder $container A ContainerBuilder instance
|
||||||
*/
|
*/
|
||||||
|
@ -46,6 +46,7 @@ class DoctrineValidationPass implements CompilerPassInterface
|
|||||||
* files matching a doctrine search pattern (Resources/config/validation.orm.xml)
|
* files matching a doctrine search pattern (Resources/config/validation.orm.xml)
|
||||||
*
|
*
|
||||||
* @param ContainerBuilder $container
|
* @param ContainerBuilder $container
|
||||||
|
* @param string $mapping
|
||||||
* @param type $extension
|
* @param type $extension
|
||||||
*/
|
*/
|
||||||
private function updateValidatorMappingFiles(ContainerBuilder $container, $mapping, $extension)
|
private function updateValidatorMappingFiles(ContainerBuilder $container, $mapping, $extension)
|
||||||
|
@ -87,7 +87,8 @@ abstract class DoctrineType extends AbstractType
|
|||||||
* Return the default loader object.
|
* Return the default loader object.
|
||||||
*
|
*
|
||||||
* @param ObjectManager $manager
|
* @param ObjectManager $manager
|
||||||
* @param array $options
|
* @param mixed $queryBuilder
|
||||||
|
* @param string $class
|
||||||
* @return EntityLoaderInterface
|
* @return EntityLoaderInterface
|
||||||
*/
|
*/
|
||||||
abstract public function getLoader(ObjectManager $manager, $queryBuilder, $class);
|
abstract public function getLoader(ObjectManager $manager, $queryBuilder, $class);
|
||||||
|
@ -20,7 +20,8 @@ class EntityType extends DoctrineType
|
|||||||
* Return the default loader object.
|
* Return the default loader object.
|
||||||
*
|
*
|
||||||
* @param ObjectManager $manager
|
* @param ObjectManager $manager
|
||||||
* @param array $options
|
* @param mixed $queryBuilder
|
||||||
|
* @param string $class
|
||||||
* @return ORMQueryBuilderLoader
|
* @return ORMQueryBuilderLoader
|
||||||
*/
|
*/
|
||||||
public function getLoader(ObjectManager $manager, $queryBuilder, $class)
|
public function getLoader(ObjectManager $manager, $queryBuilder, $class)
|
||||||
|
@ -127,7 +127,7 @@ EOF
|
|||||||
|
|
||||||
private function outputArray(array $array, $depth)
|
private function outputArray(array $array, $depth)
|
||||||
{
|
{
|
||||||
$is_indexed = array_values($array) === $array;
|
$isIndexed = array_values($array) === $array;
|
||||||
|
|
||||||
foreach ($array as $key => $value) {
|
foreach ($array as $key => $value) {
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
@ -136,7 +136,7 @@ EOF
|
|||||||
$val = $value;
|
$val = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($is_indexed) {
|
if ($isIndexed) {
|
||||||
$this->outputLine('- '.$val, $depth * 4);
|
$this->outputLine('- '.$val, $depth * 4);
|
||||||
} else {
|
} else {
|
||||||
$this->outputLine(sprintf('%-20s %s', $key.':', $val), $depth * 4);
|
$this->outputLine(sprintf('%-20s %s', $key.':', $val), $depth * 4);
|
||||||
|
@ -116,17 +116,18 @@ EOF
|
|||||||
$loader->loadMessages($bundleTransPath, $catalogue);
|
$loader->loadMessages($bundleTransPath, $catalogue);
|
||||||
|
|
||||||
// show compiled list of messages
|
// show compiled list of messages
|
||||||
if($input->getOption('dump-messages') === true){
|
if ($input->getOption('dump-messages') === true) {
|
||||||
foreach ($catalogue->getDomains() as $domain) {
|
foreach ($catalogue->getDomains() as $domain) {
|
||||||
$output->writeln(sprintf("\nDisplaying messages for domain <info>%s</info>:\n", $domain));
|
$output->writeln(sprintf("\nDisplaying messages for domain <info>%s</info>:\n", $domain));
|
||||||
$output->writeln(Yaml::dump($catalogue->all($domain),10));
|
$output->writeln(Yaml::dump($catalogue->all($domain), 10));
|
||||||
}
|
}
|
||||||
if($input->getOption('output-format') == 'xliff')
|
if ($input->getOption('output-format') == 'xliff') {
|
||||||
$output->writeln('Xliff output version is <info>1.2/info>');
|
$output->writeln('Xliff output version is <info>1.2/info>');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// save the files
|
// save the files
|
||||||
if($input->getOption('force') === true) {
|
if ($input->getOption('force') === true) {
|
||||||
$output->writeln('Writing files');
|
$output->writeln('Writing files');
|
||||||
$writer->writeTranslations($catalogue, $input->getOption('output-format'), array('path' => $bundleTransPath));
|
$writer->writeTranslations($catalogue, $input->getOption('output-format'), array('path' => $bundleTransPath));
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ class DelegatingLoader extends BaseDelegatingLoader
|
|||||||
{
|
{
|
||||||
$collection = parent::load($resource, $type);
|
$collection = parent::load($resource, $type);
|
||||||
|
|
||||||
foreach ($collection->all() as $name => $route) {
|
foreach ($collection->all() as $route) {
|
||||||
if ($controller = $route->getDefault('_controller')) {
|
if ($controller = $route->getDefault('_controller')) {
|
||||||
try {
|
try {
|
||||||
$controller = $this->parser->parse($controller);
|
$controller = $this->parser->parse($controller);
|
||||||
|
@ -100,7 +100,7 @@ class PhpExtractor implements ExtractorInterface
|
|||||||
$message = '';
|
$message = '';
|
||||||
|
|
||||||
foreach ($sequence as $id => $item) {
|
foreach ($sequence as $id => $item) {
|
||||||
if($this->normalizeToken($tokens[$key + $id]) == $item) {
|
if ($this->normalizeToken($tokens[$key + $id]) == $item) {
|
||||||
continue;
|
continue;
|
||||||
} elseif (self::MESSAGE_TOKEN == $item) {
|
} elseif (self::MESSAGE_TOKEN == $item) {
|
||||||
$message = $this->normalizeToken($tokens[$key + $id]);
|
$message = $this->normalizeToken($tokens[$key + $id]);
|
||||||
|
@ -47,7 +47,7 @@ class TranslationLoader
|
|||||||
*/
|
*/
|
||||||
public function loadMessages($directory, MessageCatalogue $catalogue)
|
public function loadMessages($directory, MessageCatalogue $catalogue)
|
||||||
{
|
{
|
||||||
foreach($this->loaders as $format => $loader) {
|
foreach ($this->loaders as $format => $loader) {
|
||||||
// load any existing translation files
|
// load any existing translation files
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$extension = $catalogue->getLocale().'.'.$format;
|
$extension = $catalogue->getLocale().'.'.$format;
|
||||||
|
@ -51,8 +51,8 @@ abstract class MultiplePcreFilterIterator extends \FilterIterator
|
|||||||
*
|
*
|
||||||
* @return Boolean Whether the given string is a regex
|
* @return Boolean Whether the given string is a regex
|
||||||
*/
|
*/
|
||||||
protected function isRegex($str) {
|
protected function isRegex($str)
|
||||||
|
{
|
||||||
if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) {
|
if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) {
|
||||||
$start = substr($m[1], 0, 1);
|
$start = substr($m[1], 0, 1);
|
||||||
$end = substr($m[1], -1);
|
$end = substr($m[1], -1);
|
||||||
|
Reference in New Issue
Block a user