Skip to content

Commit

Permalink
merged branch stephpy/cs_fixes (PR #4198)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fabpot committed May 4, 2012
2 parents b49d611 + bc63fb2 commit cb905c5
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 14 deletions.
Expand Up @@ -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
*/
Expand Down
Expand Up @@ -46,6 +46,7 @@ public function process(ContainerBuilder $container)
* 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)
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
Expand Up @@ -87,7 +87,8 @@ public function getDefaultOptions()
* 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);
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
Expand Up @@ -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)
Expand Down
Expand Up @@ -127,7 +127,7 @@ private function outputLine($text, $indent = 0)

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)) {
Expand All @@ -136,7 +136,7 @@ private function outputArray(array $array, $depth)
$val = $value;
}

if ($is_indexed) {
if ($isIndexed) {
$this->outputLine('- '.$val, $depth * 4);
} else {
$this->outputLine(sprintf('%-20s %s', $key.':', $val), $depth * 4);
Expand Down
Expand Up @@ -116,17 +116,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
$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));
}
Expand Down
Expand Up @@ -56,7 +56,7 @@ public function load($resource, $type = null)
{
$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);
Expand Down
Expand Up @@ -100,7 +100,7 @@ protected function parseTokens($tokens, MessageCatalogue $catalog)
$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]);
Expand Down
Expand Up @@ -47,7 +47,7 @@ public function addLoader($format, LoaderInterface $loader)
*/
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;
Expand Down
Expand Up @@ -51,8 +51,8 @@ public function __construct(\Iterator $iterator, array $matchPatterns, array $no
*
* @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);
Expand Down

0 comments on commit cb905c5

Please sign in to comment.