merged branch stephpy/cs_fixes (PR #4198)

Commits
-------

bc63fb2 Fix some cs

Discussion
----------

Fix some cs

---------------------------------------------------------------------------

by fabpot at 2012-05-03T21:13:33Z

Can you squash your commits? Thanks.

---------------------------------------------------------------------------

by stephpy at 2012-05-03T22:18:07Z

It's ok
This commit is contained in:
Fabien Potencier 2012-05-04 12:13:57 +02:00
commit cb905c5ff6
10 changed files with 18 additions and 14 deletions

View File

@ -38,7 +38,7 @@ abstract class AbstractDoctrineExtension extends Extension
*/
protected $drivers = array();
/*
/**
* @param array $objectManager A configured object manager.
* @param ContainerBuilder $container A ContainerBuilder instance
*/

View File

@ -46,6 +46,7 @@ class DoctrineValidationPass implements CompilerPassInterface
* files matching a doctrine search pattern (Resources/config/validation.orm.xml)
*
* @param ContainerBuilder $container
* @param string $mapping
* @param type $extension
*/
private function updateValidatorMappingFiles(ContainerBuilder $container, $mapping, $extension)

View File

@ -87,7 +87,8 @@ abstract class DoctrineType extends AbstractType
* Return the default loader object.
*
* @param ObjectManager $manager
* @param array $options
* @param mixed $queryBuilder
* @param string $class
* @return EntityLoaderInterface
*/
abstract public function getLoader(ObjectManager $manager, $queryBuilder, $class);

View File

@ -20,7 +20,8 @@ class EntityType extends DoctrineType
* Return the default loader object.
*
* @param ObjectManager $manager
* @param array $options
* @param mixed $queryBuilder
* @param string $class
* @return ORMQueryBuilderLoader
*/
public function getLoader(ObjectManager $manager, $queryBuilder, $class)

View File

@ -127,7 +127,7 @@ EOF
private function outputArray(array $array, $depth)
{
$is_indexed = array_values($array) === $array;
$isIndexed = array_values($array) === $array;
foreach ($array as $key => $value) {
if (is_array($value)) {
@ -136,7 +136,7 @@ EOF
$val = $value;
}
if ($is_indexed) {
if ($isIndexed) {
$this->outputLine('- '.$val, $depth * 4);
} else {
$this->outputLine(sprintf('%-20s %s', $key.':', $val), $depth * 4);

View File

@ -116,17 +116,18 @@ EOF
$loader->loadMessages($bundleTransPath, $catalogue);
// show compiled list of messages
if($input->getOption('dump-messages') === true){
if ($input->getOption('dump-messages') === true) {
foreach ($catalogue->getDomains() as $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>');
}
}
// save the files
if($input->getOption('force') === true) {
if ($input->getOption('force') === true) {
$output->writeln('Writing files');
$writer->writeTranslations($catalogue, $input->getOption('output-format'), array('path' => $bundleTransPath));
}

View File

@ -56,7 +56,7 @@ class DelegatingLoader extends BaseDelegatingLoader
{
$collection = parent::load($resource, $type);
foreach ($collection->all() as $name => $route) {
foreach ($collection->all() as $route) {
if ($controller = $route->getDefault('_controller')) {
try {
$controller = $this->parser->parse($controller);

View File

@ -100,7 +100,7 @@ class PhpExtractor implements ExtractorInterface
$message = '';
foreach ($sequence as $id => $item) {
if($this->normalizeToken($tokens[$key + $id]) == $item) {
if ($this->normalizeToken($tokens[$key + $id]) == $item) {
continue;
} elseif (self::MESSAGE_TOKEN == $item) {
$message = $this->normalizeToken($tokens[$key + $id]);

View File

@ -47,7 +47,7 @@ class TranslationLoader
*/
public function loadMessages($directory, MessageCatalogue $catalogue)
{
foreach($this->loaders as $format => $loader) {
foreach ($this->loaders as $format => $loader) {
// load any existing translation files
$finder = new Finder();
$extension = $catalogue->getLocale().'.'.$format;

View File

@ -51,8 +51,8 @@ abstract class MultiplePcreFilterIterator extends \FilterIterator
*
* @return Boolean Whether the given string is a regex
*/
protected function isRegex($str) {
protected function isRegex($str)
{
if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) {
$start = substr($m[1], 0, 1);
$end = substr($m[1], -1);