Skip to content

Commit

Permalink
fixed CS
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Dec 11, 2012
1 parent 3c010db commit fdb11be
Show file tree
Hide file tree
Showing 34 changed files with 53 additions and 70 deletions.
Expand Up @@ -89,6 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$this->outputTags($output, $input->getOption('show-private'));

return;
}

Expand Down Expand Up @@ -146,8 +147,8 @@ protected function outputServices(OutputInterface $output, $serviceIds, $showPri

if (null !== $showTagAttributes) {
$tags = $definition->getTag($showTagAttributes);
foreach($tags as $tag) {
foreach($tag as $key => $value) {
foreach ($tags as $tag) {
foreach ($tag as $key => $value) {
if (!isset($maxTags[$key])) {
$maxTags[$key] = strlen($key);
}
Expand All @@ -173,7 +174,7 @@ protected function outputServices(OutputInterface $output, $serviceIds, $showPri
$format1 .= '%-'.($maxScope + 19).'s %s';

$tags = array();
foreach($maxTags as $tagName => $length) {
foreach ($maxTags as $tagName => $length) {
$tags[] = '<comment>'.$tagName.'</comment>';
}
$output->writeln(vsprintf($format1, $this->buildArgumentsArray('<comment>Service Id</comment>', '<comment>Scope</comment>', '<comment>Class Name</comment>', $tags)));
Expand All @@ -184,9 +185,9 @@ protected function outputServices(OutputInterface $output, $serviceIds, $showPri
if ($definition instanceof Definition) {
$lines = array();
if (null !== $showTagAttributes) {
foreach($definition->getTag($showTagAttributes) as $key => $tag) {
foreach ($definition->getTag($showTagAttributes) as $key => $tag) {
$tagValues = array();
foreach(array_keys($maxTags) as $tagName) {
foreach (array_keys($maxTags) as $tagName) {
$tagValues[] = isset($tag[$tagName]) ? $tag[$tagName] : "";
}
if (0 === $key) {
Expand All @@ -199,7 +200,7 @@ protected function outputServices(OutputInterface $output, $serviceIds, $showPri
$lines[] = $this->buildArgumentsArray($serviceId, $definition->getScope(), $definition->getClass());
}

foreach($lines as $arguments) {
foreach ($lines as $arguments) {
$output->writeln(vsprintf($format, $arguments));
}
} elseif ($definition instanceof Alias) {
Expand All @@ -216,7 +217,7 @@ protected function outputServices(OutputInterface $output, $serviceIds, $showPri
protected function buildArgumentsArray($serviceId, $scope, $className, array $tagAttributes = array())
{
$arguments = array($serviceId);
foreach($tagAttributes as $tagAttribute) {
foreach ($tagAttributes as $tagAttribute) {
$arguments[] = $tagAttribute;
}
$arguments[] = $scope;
Expand Down
Expand Up @@ -59,19 +59,8 @@
<label for="priority">Priority</label>
<select id="priority" name="priority" onchange="document.getElementById('priority-form').submit(); ">
{# values < 0 are custom levels #}
{% for value, text in {
100: 'DEBUG',
200: 'INFO',
250: 'NOTICE',
300: 'WARNING',
400: 'ERROR',
500: 'CRITICAL',
550: 'ALERT',
600: 'EMERGENCY',
'-100': 'DEPRECATION only'
}
%}
<option value="{{ value }}"{{ value == priority ? ' selected' : '' }}>{{ text }}</option>
{% for value, text in { 100: 'DEBUG', 200: 'INFO', 250: 'NOTICE', 300: 'WARNING', 400: 'ERROR', 500: 'CRITICAL', 550: 'ALERT', 600: 'EMERGENCY', '-100': 'DEPRECATION only' } %}
<option value="{{ value }}"{{ value == priority ? ' selected' : '' }}>{{ text }}</option>
{% endfor %}
</select>
<noscript>
Expand Down Expand Up @@ -122,11 +111,7 @@
{% set from = '-' %}
{% endif %}

<li>Called from {{ call.file is defined and call.line is defined
? call.file|format_file(call.line, from)
: from|raw
}}
</li>
<li>Called from {{ call.file is defined and call.line is defined ? call.file|format_file(call.line, from) : from|raw }}</li>

{{ index == log.context.stack|length - 1 ? '</ul>' : '' }}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/ClassLoader/UniversalClassLoader.php
Expand Up @@ -242,7 +242,7 @@ public function register($prepend = false)
* Loads the given class or interface.
*
* @param string $class The name of the class
*
*
* @return Boolean|null True, if loaded
*/
public function loadClass($class)
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Console/Tests/ApplicationTest.php
Expand Up @@ -610,15 +610,15 @@ public function testOverwritingDefaultInputDefinitionOverwritesDefaultValues()

$this->assertTrue($inputDefinition->hasOption('custom'));
}

public function testSettingCustomInputDefinitionOverwritesDefaultValues()
{
$application = new Application();
$application->setAutoExit(false);
$application->setCatchExceptions(false);

$application->setDefinition(new InputDefinition(array(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.'))));

$inputDefinition = $application->getDefinition();

// check whether the default arguments and options are not returned any more
Expand Down
Expand Up @@ -159,11 +159,11 @@ public function addResource(ResourceInterface $resource)

/**
* Sets the resources for this configuration.
*
*
* @param ResourceInterface[] $resources An array of resources
*
*
* @return ContainerBuilder The current instance
*
*
* @api
*/
public function setResources(array $resources)
Expand Down
Expand Up @@ -316,6 +316,7 @@ private function buildSorting(Command $command, $sort)
switch ($sort) {
case SortableIterator::SORT_BY_NAME:
$command->ins('sort')->add('| sort');

return;
case SortableIterator::SORT_BY_TYPE:
$format = '%y';
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Finder/Adapter/BsdFindAdapter.php
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Component\Finder\Adapter;

use Symfony\Component\Finder\Iterator;
use Symfony\Component\Finder\Shell\Shell;
use Symfony\Component\Finder\Shell\Command;

Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Finder/Adapter/GnuFindAdapter.php
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Component\Finder\Adapter;

use Symfony\Component\Finder\Iterator;
use Symfony\Component\Finder\Shell\Shell;
use Symfony\Component\Finder\Shell\Command;

Expand Down
Expand Up @@ -10,5 +10,5 @@ interface ExceptionInterface
/**
* @return \Symfony\Component\Finder\Adapter\AdapterInterface
*/
function getAdapter();
public function getAdapter();
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/Finder/Expression/Expression.php
Expand Up @@ -41,7 +41,7 @@ public function __construct($expr)
{
try {
$this->value = Regex::create($expr);
} catch(\InvalidArgumentException $e) {
} catch (\InvalidArgumentException $e) {
$this->value = new Glob($expr);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/Finder/Expression/ValueInterface.php
Expand Up @@ -21,28 +21,28 @@ interface ValueInterface
*
* @return string
*/
function render();
public function render();

/**
* Renders string representation of pattern.
*
* @return string
*/
function renderPattern();
public function renderPattern();

/**
* Returns value case sensitivity.
*
* @return bool
*/
function isCaseSensitive();
public function isCaseSensitive();

/**
* Returns expression type.
*
* @return int
*/
function getType();
public function getType();

/**
* @param string $expr
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Finder/Finder.php
Expand Up @@ -723,7 +723,7 @@ private function searchInDirectory($dir)
return $this
->buildAdapter($adapter['adapter'])
->searchInDirectory($dir);
} catch(ExceptionInterface $e) {}
} catch (ExceptionInterface $e) {}
}
}

Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Finder/Tests/FinderTest.php
Expand Up @@ -406,7 +406,6 @@ public function testAppendWithAFinder($adapter)

$finder = $finder->append($finder1);


$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'toto')), $finder->getIterator());
}

Expand Down
Expand Up @@ -83,4 +83,3 @@ public function getTestFilterData()
}

}

Expand Up @@ -482,6 +482,7 @@ public function testSubformCallsSettersIfReferenceIsScalar()
$builder->get('referenceCopy')->addViewTransformer(new CallbackTransformer(
function () {},
function ($value) { // reverseTransform

return 'foobar';
}
));
Expand All @@ -507,6 +508,7 @@ public function testSubformAlwaysInsertsIntoArrays()
$builder->get('referenceCopy')->addViewTransformer(new CallbackTransformer(
function () {},
function ($value) use ($ref2) { // reverseTransform

return $ref2;
}
));
Expand Down
Expand Up @@ -12,13 +12,11 @@
namespace Symfony\Component\Form\Tests\Extension\Validator\Constraints;

use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\Extension\Validator\Constraints\Form;
use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator;
use Symfony\Component\Form\Util\PropertyPath;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Constraints\NotNull;
use Symfony\Component\Validator\Constraints\NotBlank;
Expand Down
Expand Up @@ -102,7 +102,6 @@ public function testGetClientOriginalExtension()
$this->assertEquals('gif', $file->getClientOriginalExtension());
}


/**
* @expectedException Symfony\Component\HttpFoundation\File\Exception\FileException
*/
Expand Down
Expand Up @@ -179,7 +179,7 @@ public function testGc()

$collection->expects($this->once())
->method('remove')
->will($this->returnCallback(function($criteria) use($that) {
->will($this->returnCallback(function($criteria) use ($that) {
$that->assertInstanceOf('MongoDate', $criteria[$that->options['time_field']]['$lt']);
$that->assertGreaterThanOrEqual(time() - -1, $criteria[$that->options['time_field']]['$lt']->sec);
}));
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpKernel/HttpCache/Store.php
Expand Up @@ -84,6 +84,7 @@ public function lock(Request $request)

return true;
}

return !file_exists($path) ?: $path;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/Kernel.php
Expand Up @@ -208,7 +208,7 @@ protected function getHttpKernel()

/**
* {@inheritdoc}
*
*
* @api
*/
public function getBundles()
Expand Down
Expand Up @@ -111,7 +111,7 @@ protected function getMongo()

/**
* @param array $data
*
*
* @return Profile
*/
protected function createProfileFromData(array $data)
Expand All @@ -132,7 +132,7 @@ protected function createProfileFromData(array $data)

/**
* @param string $token
*
*
* @return Profile[] An array of Profile instances
*/
protected function readChildren($token)
Expand All @@ -156,7 +156,7 @@ protected function cleanup()
* @param string $ip
* @param string $url
* @param string $method
*
*
* @return array
*/
private function buildQuery($ip, $url, $method)
Expand All @@ -180,7 +180,7 @@ private function buildQuery($ip, $url, $method)

/**
* @param array $data
*
*
* @return array
*/
private function getData(array $data)
Expand All @@ -198,7 +198,7 @@ private function getData(array $data)

/**
* @param array $data
*
*
* @return Profile
*/
private function getProfile(array $data)
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/HttpKernel/Profiler/Profile.php
Expand Up @@ -114,7 +114,7 @@ public function getIp()

/**
* Sets the IP.
*
*
* @param string $ip
*/
public function setIp($ip)
Expand Down Expand Up @@ -179,7 +179,7 @@ public function getChildren()

/**
* Sets children profiler.
*
*
* @param Profile[] $children An array of Profile
*/
public function setChildren(array $children)
Expand Down Expand Up @@ -221,7 +221,7 @@ public function getCollector($name)

/**
* Gets the Collectors associated with this profile.
*
*
* @return DataCollectorInterface[]
*/
public function getCollectors()
Expand All @@ -231,7 +231,7 @@ public function getCollectors()

/**
* Sets the Collectors associated with this profile.
*
*
* @param DataCollectorInterface[] $collectors
*/
public function setCollectors(array $collectors)
Expand Down
Expand Up @@ -194,7 +194,7 @@ protected function getHttpKernel($dispatcher, $controller)

class EventSubscriber implements EventSubscriberInterface
{
static public function getSubscribedEvents()
public static function getSubscribedEvents()
{
return array('foo' => 'call');
}
Expand Down
Expand Up @@ -521,6 +521,7 @@ public function testNormalizerWithoutCorrespondingOption()

$this->options->setNormalizer('foo', function (Options $options, $previousValue) use ($test) {
$test->assertNull($previousValue);

return '';
});
$this->assertEquals(array('foo' => ''), $this->options->all());
Expand Down

0 comments on commit fdb11be

Please sign in to comment.