Skip to content

[2.6] CS Fixes And Removed An Unused Import #12872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ protected function getDriver(ContainerBuilder $container)
* @return string a service definition name
*
* @throws ParameterNotFoundException if none of the managerParameters has a
* non-empty value.
* non-empty value.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks weird?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that's now it's meant to look? Either that, or we shunt it all onto one line?

*/
private function getConfigurationServiceName(ContainerBuilder $container)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ protected function setUp()
public function testFixManagersAutoMappingsWithTwoAutomappings()
{
$emConfigs = array(
'em1'=> array(
'auto_mapping' => true
'em1' => array(
'auto_mapping' => true,
),
'em2'=> array(
'auto_mapping' => true
'em2' => array(
'auto_mapping' => true,
),
);

$bundles = array(
'FristBundle'=> 'My\FristBundle',
'SecondBundle'=> 'My\SecondBundle',
'FristBundle' => 'My\FristBundle',
'SecondBundle' => 'My\SecondBundle',
);

$reflection = new \ReflectionClass(get_class($this->extension));
Expand All @@ -79,65 +79,65 @@ public function getAutomappingData()
return array(
array(
array( // no auto mapping on em1
'auto_mapping' => false
'auto_mapping' => false,
),
array( // no auto mapping on em2
'auto_mapping' => false
'auto_mapping' => false,
),
array(),
array()
array(),
),
array(
array( // no auto mapping on em1
'auto_mapping' => false
'auto_mapping' => false,
),
array( // auto mapping enabled on em2
'auto_mapping' => true
'auto_mapping' => true,
),
array(),
array(
'mappings' => array(
'FristBundle' => array(
'mapping' => true,
'is_bundle' => true
'is_bundle' => true,
),
'SecondBundle' => array(
'mapping' => true,
'is_bundle' => true
)
)
)
'is_bundle' => true,
),
),
),
),
array(
array( // no auto mapping on em1, but it defines SecondBundle as own
'auto_mapping' => false,
'mappings' => array(
'SecondBundle' => array(
'mapping' => true,
'is_bundle' => true
)
)
'is_bundle' => true,
),
),
),
array( // auto mapping enabled on em2
'auto_mapping' => true
'auto_mapping' => true,
),
array(
'mappings' => array(
'SecondBundle' => array(
'mapping' => true,
'is_bundle' => true
)
)
'is_bundle' => true,
),
),
),
array(
'mappings' => array(
'FristBundle' => array(
'mapping' => true,
'is_bundle' => true
)
)
)
)
'is_bundle' => true,
),
),
),
),
);
}

Expand All @@ -147,13 +147,13 @@ public function getAutomappingData()
public function testFixManagersAutoMappings(array $originalEm1, array $originalEm2, array $expectedEm1, array $expectedEm2)
{
$emConfigs = array(
'em1'=> $originalEm1,
'em2'=> $originalEm2,
'em1' => $originalEm1,
'em2' => $originalEm2,
);

$bundles = array(
'FristBundle'=> 'My\FristBundle',
'SecondBundle'=> 'My\SecondBundle',
'FristBundle' => 'My\FristBundle',
'SecondBundle' => 'My\SecondBundle',
);

$reflection = new \ReflectionClass(get_class($this->extension));
Expand All @@ -163,10 +163,10 @@ public function testFixManagersAutoMappings(array $originalEm1, array $originalE
$newEmConfigs = $method->invoke($this->extension, $emConfigs, $bundles);

$this->assertEquals($newEmConfigs["em1"], array_merge(array(
'auto_mapping' => false
'auto_mapping' => false,
), $expectedEm1));
$this->assertEquals($newEmConfigs["em2"], array_merge(array(
'auto_mapping' => false
'auto_mapping' => false,
), $expectedEm2));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,4 @@ private function hardCopy($originDir, $targetDir)
// We use a custom iterator to ignore VCS files
$filesystem->mirror($originDir, $targetDir, Finder::create()->ignoreDotFiles(false)->in($originDir));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,16 @@ abstract protected function describeContainerParameter($parameter, array $option
* Common options are:
* * name: name of listened event
*
* @param EventDispatcherInterface $eventDispatcher
* @param array $options
* @param EventDispatcherInterface $eventDispatcher
* @param array $options
*/
abstract protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = array());

/**
* Describes a callable.
*
* @param callable $callable
* @param array $options
* @param callable $callable
* @param array $options
*/
abstract protected function describeCallable($callable, array $options = array());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private function getContainerAliasData(Alias $alias)

/**
* @param EventDispatcherInterface $eventDispatcher
* @param string|null $event
* @param string|null $event
*
* @return array
*/
Expand Down Expand Up @@ -270,7 +270,7 @@ private function getEventDispatcherListenersData(EventDispatcherInterface $event

/**
* @param callable $callable
* @param array $options
* @param array $options
*
* @return array
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ private function getContainerParameterDocument($parameter, $options = array())
}

/**
* @param EventDispatcherInterface $eventDispatcher
* @param string|null $event
* @param EventDispatcherInterface $eventDispatcher
* @param string|null $event
*
* @return \DOMDocument
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public function build($controller)
* Attempts to find a bundle that is *similar* to the given bundle name
*
* @param string $nonExistentBundleName
*
* @return string
*/
private function findAlternative($nonExistentBundleName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;

use Symfony\Component\Config\Definition\Builder\NodeDefinition;

use Symfony\Component\DependencyInjection\DefinitionDecorator;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ public function __construct($resource, $sourceResource = null, $code = null, $pr
if (null === $sourceResource) {
$message .= sprintf('(which is loaded in resource "%s")', $this->varToString($resource));
} else {
$message .= sprintf('(which is being imported from "%s")',$this->varToString($sourceResource));
$message .= sprintf('(which is being imported from "%s")', $this->varToString($sourceResource));
}
$message .= '.';

// if there's no previous message, present it the default way
} elseif (null === $sourceResource) {
$message .= sprintf('Cannot load resource "%s".', $this->varToString($resource));
} else {
$message .= sprintf('Cannot import resource "%s" from "%s".',$this->varToString($resource),$this->varToString($sourceResource));
$message .= sprintf('Cannot import resource "%s" from "%s".', $this->varToString($resource), $this->varToString($sourceResource));
}

// Is the resource located inside a bundle?
if ('@' === $resource[0]) {
$parts = explode(DIRECTORY_SEPARATOR, $resource);
$bundle = substr($parts[0], 1);
$message .= ' '.sprintf('Make sure the "%s" bundle is correctly registered and loaded in the application kernel class.',$bundle);
$message .= ' '.sprintf('Make sure the "%s" bundle is correctly registered and loaded in the application kernel class.', $bundle);
}

parent::__construct($message, $code, $previous);
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Helper/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public function setOverwrite($overwrite)
/**
* Sets the current progress.
*
* @param int $step The current progress
* @param int $step The current progress
*
* @throws \LogicException
*/
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/CssSelector/Node/Specificity.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public function getValue()
* 0 if they are equal, and 1 if the argument is lower
*
* @param Specificity $specificity
*
* @return int
*/
public function compareTo(Specificity $specificity)
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Debug/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ private function reRegister($prev)
/**
* Handles errors by filtering then logging them according to the configured bit fields.
*
* @param int $type One of the E_* constants
* @param int $type One of the E_* constants
* @param string $file
* @param int $line
* @param array $context
Expand Down Expand Up @@ -584,7 +584,7 @@ protected function getFatalErrorHandlers()
/**
* Sets the level at which the conversion to Exception is done.
*
* @param int|null $level The level (null to use the error_reporting() value and 0 to disable)
* @param int|null $level The level (null to use the error_reporting() value and 0 to disable)
*
* @deprecated since 2.6, to be removed in 3.0. Use throwAt() instead.
*/
Expand All @@ -597,7 +597,7 @@ public function setLevel($level)
/**
* Sets the display_errors flag value.
*
* @param int $displayErrors The display_errors flag value
* @param int $displayErrors The display_errors flag value
*
* @deprecated since 2.6, to be removed in 3.0. Use throwAt() instead.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest
protected function createEventDispatcher()
{
$container = new Container();

return new ContainerAwareEventDispatcher($container);
}

Expand Down
36 changes: 18 additions & 18 deletions src/Symfony/Component/ExpressionLanguage/ExpressionFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@ class ExpressionFunction
* @param callable $compiler A callable able to compile the function
* @param callable $evaluator A callable able to evaluate the function
*/
public function __construct($name, $compiler, $evaluator)
{
$this->name = $name;
$this->compiler = $compiler;
$this->evaluator = $evaluator;
}
public function __construct($name, $compiler, $evaluator)
{
$this->name = $name;
$this->compiler = $compiler;
$this->evaluator = $evaluator;
}

public function getName()
{
return $this->name;
}
public function getName()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to be applied to the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's odd. I'll report this bug to the php-cs-fixer repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually fixed this. Thanks for pointing this out @xabbuh.

See PHP-CS-Fixer/PHP-CS-Fixer#797.

{
return $this->name;
}

public function getCompiler()
{
return $this->compiler;
}
public function getCompiler()
{
return $this->compiler;
}

public function getEvaluator()
{
return $this->evaluator;
}
public function getEvaluator()
{
return $this->evaluator;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ExpressionLanguage
protected $functions = array();

/**
* @param ParserCacheInterface $cache
* @param ParserCacheInterface $cache
* @param ExpressionFunctionProviderInterface[] $providers
*/
public function __construct(ParserCacheInterface $cache = null, array $providers = array())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testConstantFunction()

public function testProviders()
{
$expressionLanguage = new ExpressionLanguage(null, array(new TestProvider));
$expressionLanguage = new ExpressionLanguage(null, array(new TestProvider()));
$this->assertEquals('foo', $expressionLanguage->evaluate('identity("foo")'));
$this->assertEquals('"foo"', $expressionLanguage->compile('identity("foo")'));
}
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ public function symlink($originDir, $targetDir, $copyOnWindows = false)

if ($onWindows && $copyOnWindows) {
$this->mirror($originDir, $targetDir);

return;
}

Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/HttpFoundation/ParameterBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@ public function getInt($key, $default = 0, $deep = false)
/**
* Returns the parameter value converted to boolean.
*
* @param string $key The parameter key
* @param mixed $default The default value if the parameter key does not exist
* @param bool $deep If true, a path like foo[bar] will find deeper items
* @param string $key The parameter key
* @param mixed $default The default value if the parameter key does not exist
* @param bool $deep If true, a path like foo[bar] will find deeper items
*
* @return bool The filtered value
* @return bool The filtered value
*/
public function getBoolean($key, $default = false, $deep = false)
{
Expand Down
Loading