Static code analysis
This commit is contained in:
parent
b81cac880e
commit
8db691ab94
@ -153,7 +153,7 @@ abstract class AbstractDoctrineExtension extends Extension
|
||||
*/
|
||||
protected function getMappingDriverBundleConfigDefaults(array $bundleConfig, \ReflectionClass $bundle, ContainerBuilder $container)
|
||||
{
|
||||
$bundleDir = dirname($bundle->getFilename());
|
||||
$bundleDir = dirname($bundle->getFileName());
|
||||
|
||||
if (!$bundleConfig['type']) {
|
||||
$bundleConfig['type'] = $this->detectMetadataDriver($bundleDir, $container);
|
||||
|
@ -60,7 +60,7 @@ class DoctrineValidationPass implements CompilerPassInterface
|
||||
|
||||
foreach ($container->getParameter('kernel.bundles') as $bundle) {
|
||||
$reflection = new \ReflectionClass($bundle);
|
||||
if (is_file($file = dirname($reflection->getFilename()).'/'.$validationPath)) {
|
||||
if (is_file($file = dirname($reflection->getFileName()).'/'.$validationPath)) {
|
||||
$files[] = realpath($file);
|
||||
$container->addResource(new FileResource($file));
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ EOF
|
||||
$extractor = $this->getContainer()->get('translation.extractor');
|
||||
$extractor->setPrefix($input->getOption('prefix'));
|
||||
foreach ($bundleTransPaths as $path) {
|
||||
$path = $path.'views';
|
||||
$path .= 'views';
|
||||
if (is_dir($path)) {
|
||||
$extractor->extract($path, $extractedCatalogue);
|
||||
}
|
||||
@ -106,7 +106,7 @@ EOF
|
||||
$output->writeln('Loading translation files');
|
||||
$loader = $this->getContainer()->get('translation.loader');
|
||||
foreach ($bundleTransPaths as $path) {
|
||||
$path = $path.'translations';
|
||||
$path .= 'translations';
|
||||
if (is_dir($path)) {
|
||||
$loader->loadMessages($path, $currentCatalogue);
|
||||
}
|
||||
@ -151,7 +151,7 @@ EOF
|
||||
$output->writeln('Writing files');
|
||||
$bundleTransPath = false;
|
||||
foreach ($bundleTransPaths as $path) {
|
||||
$path = $path.'translations';
|
||||
$path .= 'translations';
|
||||
if (is_dir($path)) {
|
||||
$bundleTransPath = $path;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ build: 56
|
||||
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAcCAYAAACtQ6WLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAR1JREFUeNpiPHnyZCMDA8MNID5gZmb2nAEJMH7//v3N169fX969e/cYkL8WqGAHXPLv37//QYzfv39/fvPmzbUnT56sAXInmJub/2H5/x8sx8DCwsIrISFhDmQyPX78+CmQXs70798/BmQsKipqBNTgdvz4cWkmkE5kDATMioqKZkCFdiwg1eiAi4tLGqhQF24nMmBmZuYEigth1QkEbEBxTlySYPvJkwSJ00AnjYylgU6gxB8g/oFVEphkvgLF32KNMmCCewYUv4qhEyj47+HDhyeBzIMYOoEp8CxQw56wsLAncJ1//vz5/P79+2svX74EJc2V4BT58+fPd8CE/QKYHMGJOiIiAp6oWW7evDkNSF8DZYfIyEiU7AAQYACJ2vxVdJW4eQAAAABJRU5ErkJggg==) right top no-repeat;
|
||||
}
|
||||
.sf-button .btn-bg {
|
||||
padding: 0px 14px;
|
||||
padding: 0 14px;
|
||||
color: #636363;
|
||||
line-height: 28px;
|
||||
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAcCAYAAACgXdXMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAClJREFUeNpiPnny5EKGf//+/Wf6//8/A4QAcrGzKCZwGc9sa2urBBBgAIbDUoYVp9lmAAAAAElFTkSuQmCC) repeat-x top left;
|
||||
|
@ -75,7 +75,7 @@ class TwigExtension extends Extension
|
||||
}
|
||||
|
||||
$reflection = new \ReflectionClass($class);
|
||||
if (is_dir($dir = dirname($reflection->getFilename()).'/Resources/views')) {
|
||||
if (is_dir($dir = dirname($reflection->getFileName()).'/Resources/views')) {
|
||||
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ build: 56
|
||||
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAcCAYAAACtQ6WLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAR1JREFUeNpiPHnyZCMDA8MNID5gZmb2nAEJMH7//v3N169fX969e/cYkL8WqGAHXPLv37//QYzfv39/fvPmzbUnT56sAXInmJub/2H5/x8sx8DCwsIrISFhDmQyPX78+CmQXs70798/BmQsKipqBNTgdvz4cWkmkE5kDATMioqKZkCFdiwg1eiAi4tLGqhQF24nMmBmZuYEigth1QkEbEBxTlySYPvJkwSJ00AnjYylgU6gxB8g/oFVEphkvgLF32KNMmCCewYUv4qhEyj47+HDhyeBzIMYOoEp8CxQw56wsLAncJ1//vz5/P79+2svX74EJc2V4BT58+fPd8CE/QKYHMGJOiIiAp6oWW7evDkNSF8DZYfIyEiU7AAQYACJ2vxVdJW4eQAAAABJRU5ErkJggg==) right top no-repeat;
|
||||
}
|
||||
.sf-button .btn-bg {
|
||||
padding: 0px 14px;
|
||||
padding: 0 14px;
|
||||
color: #636363;
|
||||
line-height: 28px;
|
||||
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAcCAYAAACgXdXMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAClJREFUeNpiPnny5EKGf//+/Wf6//8/A4QAcrGzKCZwGc9sa2urBBBgAIbDUoYVp9lmAAAAAElFTkSuQmCC) repeat-x top left;
|
||||
|
@ -66,7 +66,7 @@
|
||||
var leftIconPath = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAhCAYAAADOHBvaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4tJREFUeNrkl19IU1Ecx7fZJN2arhq2JUWJlEZL1MAm1B582GBErMJqtabzRRAqFAYa9OfFFx+KQEG3MkYRZkkEJUUwctVSKCJWJoj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SVSh/A0BzfkWC3hpxv6Ojo0NbV1a2lCgW/eru6ulBRmQKt4TYCoIMg2ejo6EWdTpcXDodJQ5uamr62t7ffgSHy63tQgEjrkwkqBp0wGo2NWq32MNgMIsCioqJN6DRN5eXl43D6AsUNaJ1Ml7kXFRvQUVDtzMzMMYPBsB/EcjgcVEx7E66oqFivrKx0gFBKvkYuA6FY+b6d9hbVVTboAKgkKtTmcqHgM6G/TuNwOBvRFPmMmg3QJ5Alvlik0tCng1Bu50TznRV9Iuj4iaoeKkDRAPIlA6b67UTBlFvSi+zaR9svAQYA6+V18DvfH/8AAAAASUVORK5CYII=",
|
||||
menu = document.getElementById('navigation'), savedState = Sfjs.getPreference('menu/displayState'),
|
||||
displayState, elem, className;
|
||||
displayState;
|
||||
|
||||
if (null === savedState) {
|
||||
savedState = 'block';
|
||||
|
@ -128,7 +128,7 @@ abbr {
|
||||
}
|
||||
#menu-profiler li a span.label {
|
||||
display: block;
|
||||
padding: 20px 0px 16px 65px;
|
||||
padding: 20px 0 16px 65px;
|
||||
min-height: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
@ -199,7 +199,7 @@ li {
|
||||
#resume {
|
||||
background-color: #f6f6f6;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
padding: 18px 10px 0px;
|
||||
padding: 18px 10px 0;
|
||||
margin-left: 250px;
|
||||
height: 34px;
|
||||
color: #313131;
|
||||
@ -266,7 +266,6 @@ ul.alt li.warning {
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
ul.sf-call-stack li {
|
||||
text-size: small;
|
||||
padding: 0 0 0 20px;
|
||||
}
|
||||
td.main, td.menu {
|
||||
@ -366,13 +365,12 @@ td.main, td.menu {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
.sf-profiler-timeline .legends span {
|
||||
border-left-width: 10px;
|
||||
border-left-style: solid;
|
||||
border-left: 10px solid;
|
||||
padding: 0 10px 0 5px;
|
||||
}
|
||||
.sf-profiler-timeline canvas {
|
||||
border: 1px solid #999;
|
||||
border-width: 1px 0;
|
||||
border: 1px #999;
|
||||
border-style: solid none;
|
||||
}
|
||||
.collapsed-menu-parents #resume,
|
||||
.collapsed-menu-parents #collector-content {
|
||||
|
@ -93,9 +93,9 @@
|
||||
}
|
||||
|
||||
.sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status {
|
||||
padding: 0px 5px;
|
||||
padding: 0 5px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 0px;
|
||||
margin-bottom: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
@ -129,13 +129,11 @@
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
border: 1px solid #bbb;
|
||||
padding: 9px 0;
|
||||
margin-left: -1px;
|
||||
|
||||
bottom: 38px;
|
||||
border-bottom-width: 0;
|
||||
border-bottom: 1px solid #bbb;
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 4px 4px 0 0;
|
||||
}
|
||||
|
||||
@ -198,7 +196,7 @@
|
||||
}
|
||||
|
||||
.sf-toolbar-block .sf-toolbar-icon > a,
|
||||
.sf-toolbar-block .sf-toolbar-icon > a:link
|
||||
.sf-toolbar-block .sf-toolbar-icon > a:link,
|
||||
.sf-toolbar-block .sf-toolbar-icon > a:hover {
|
||||
color: black !important;
|
||||
}
|
||||
|
@ -62,8 +62,6 @@ class ProfilerControllerTest extends \PHPUnit_Framework_TestCase
|
||||
if ('found' == $token) {
|
||||
return new Profile($token);
|
||||
}
|
||||
|
||||
return;
|
||||
}))
|
||||
;
|
||||
|
||||
|
@ -74,7 +74,7 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
||||
$document = simplexml_import_dom($document);
|
||||
$bodies = $document->xpath('//body');
|
||||
$elements = $bodies[0]->xpath($translator->cssToXPath($css));
|
||||
$this->assertEquals($count, count($elements));
|
||||
$this->assertCount($count, $elements);
|
||||
}
|
||||
|
||||
public function getXpathLiteralTestData()
|
||||
|
@ -11,15 +11,3 @@ $definition = new Definition('%cla%o%ss%');
|
||||
$container->setDefinition('foo', $definition);
|
||||
|
||||
return $container;
|
||||
|
||||
if (!class_exists('FooClass')) {
|
||||
class FooClass
|
||||
{
|
||||
public $bar;
|
||||
|
||||
public function setBar($bar)
|
||||
{
|
||||
$this->bar = $bar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,6 +52,18 @@ class ContainerAwareEventDispatcherTest extends \PHPUnit_Framework_TestCase
|
||||
->with($event)
|
||||
;
|
||||
|
||||
$service
|
||||
->expects($this->once())
|
||||
->method('onEventWithPriority')
|
||||
->with($event)
|
||||
;
|
||||
|
||||
$service
|
||||
->expects($this->once())
|
||||
->method('onEventNested')
|
||||
->with($event)
|
||||
;
|
||||
|
||||
$container = new Container();
|
||||
$container->set('service.subscriber', $service);
|
||||
|
||||
@ -59,6 +71,8 @@ class ContainerAwareEventDispatcherTest extends \PHPUnit_Framework_TestCase
|
||||
$dispatcher->addSubscriberService('service.subscriber', 'Symfony\Component\EventDispatcher\Tests\SubscriberService');
|
||||
|
||||
$dispatcher->dispatch('onEvent', $event);
|
||||
$dispatcher->dispatch('onEventWithPriority', $event);
|
||||
$dispatcher->dispatch('onEventNested', $event);
|
||||
}
|
||||
|
||||
public function testPreventDuplicateListenerService()
|
||||
@ -233,12 +247,20 @@ class SubscriberService implements EventSubscriberInterface
|
||||
{
|
||||
return array(
|
||||
'onEvent' => 'onEvent',
|
||||
'onEvent' => array('onEvent', 10),
|
||||
'onEvent' => array('onEvent'),
|
||||
'onEventWithPriority' => array('onEventWithPriority', 10),
|
||||
'onEventNested' => array(array('onEventNested')),
|
||||
);
|
||||
}
|
||||
|
||||
public function onEvent(Event $e)
|
||||
{
|
||||
}
|
||||
|
||||
public function onEventWithPriority(Event $e)
|
||||
{
|
||||
}
|
||||
|
||||
public function onEventNested(Event $e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ abstract class AbstractFindAdapter extends AbstractAdapter
|
||||
$command->setErrorHandler(
|
||||
$this->ignoreUnreadableDirs
|
||||
// If directory is unreadable and finder is set to ignore it, `stderr` is ignored.
|
||||
? function ($stderr) { return; }
|
||||
? function ($stderr) { }
|
||||
: function ($stderr) { throw new AccessDeniedException($stderr); }
|
||||
);
|
||||
|
||||
|
@ -71,10 +71,10 @@ class ChoiceType extends AbstractType
|
||||
|
||||
if ($options['multiple']) {
|
||||
$builder->addViewTransformer(new ChoicesToBooleanArrayTransformer($options['choice_list']));
|
||||
$builder->addEventSubscriber(new FixCheckboxInputListener($options['choice_list']), 10);
|
||||
$builder->addEventSubscriber(new FixCheckboxInputListener($options['choice_list']));
|
||||
} else {
|
||||
$builder->addViewTransformer(new ChoiceToBooleanArrayTransformer($options['choice_list'], $builder->has('placeholder')));
|
||||
$builder->addEventSubscriber(new FixRadioInputListener($options['choice_list'], $builder->has('placeholder')), 10);
|
||||
$builder->addEventSubscriber(new FixRadioInputListener($options['choice_list'], $builder->has('placeholder')));
|
||||
}
|
||||
} else {
|
||||
if ($options['multiple']) {
|
||||
|
@ -558,11 +558,6 @@ class FormValidatorTest extends AbstractConstraintValidatorTest
|
||||
return array('group1', 'group2');
|
||||
}
|
||||
|
||||
private function getMockExecutionContext()
|
||||
{
|
||||
return $this->getMock('Symfony\Component\Validator\ExecutionContextInterface');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $dataClass
|
||||
|
@ -64,7 +64,7 @@ abstract class BaseValidatorExtensionTest extends TypeTestCase
|
||||
public function testValidationGroupsCanBeSetToClosure()
|
||||
{
|
||||
$form = $this->createForm(array(
|
||||
'validation_groups' => function (FormInterface $form) { return; },
|
||||
'validation_groups' => function (FormInterface $form) { },
|
||||
));
|
||||
|
||||
$this->assertTrue(is_callable($form->getConfig()->getOption('validation_groups')));
|
||||
|
@ -482,6 +482,6 @@ class OrderedHashMapTest extends \PHPUnit_Framework_TestCase
|
||||
unset($map[0]);
|
||||
$map[] = 3;
|
||||
|
||||
$this->assertSame(2, count($map));
|
||||
$this->assertCount(2, $map);
|
||||
}
|
||||
}
|
||||
|
@ -1707,8 +1707,6 @@ class Request
|
||||
return '/';
|
||||
}
|
||||
|
||||
$pathInfo = '/';
|
||||
|
||||
// Remove the query string from REQUEST_URI
|
||||
if ($pos = strpos($requestUri, '?')) {
|
||||
$requestUri = substr($requestUri, 0, $pos);
|
||||
|
@ -57,7 +57,7 @@ class PdoSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$storage = new PdoSessionHandler($this->pdo, array('db_table' => 'bad_name'));
|
||||
$this->setExpectedException('RuntimeException');
|
||||
$storage->read('foo', 'bar');
|
||||
$storage->read('foo');
|
||||
}
|
||||
|
||||
public function testWriteRead()
|
||||
|
@ -255,7 +255,7 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
|
||||
// invalidate only when the response is successful
|
||||
if ($response->isSuccessful() || $response->isRedirect()) {
|
||||
try {
|
||||
$this->store->invalidate($request, $catch);
|
||||
$this->store->invalidate($request);
|
||||
|
||||
// As per the RFC, invalidate Location and Content-Location URLs if present
|
||||
foreach (array('Location', 'Content-Location') as $header) {
|
||||
@ -481,7 +481,7 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
|
||||
$this->processResponseBody($request, $response);
|
||||
|
||||
if ($this->isPrivateRequest($request) && !$response->headers->hasCacheControlDirective('public')) {
|
||||
$response->setPrivate(true);
|
||||
$response->setPrivate();
|
||||
} elseif ($this->options['default_ttl'] > 0 && null === $response->getTtl() && !$response->headers->getCacheControlDirective('must-revalidate')) {
|
||||
$response->setTtl($this->options['default_ttl']);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ class SqliteProfilerStorage extends PdoProfilerStorage
|
||||
$return = array();
|
||||
|
||||
if ($db instanceof \SQLite3) {
|
||||
$stmt = $this->prepareStatement($db, $query, true);
|
||||
$stmt = $this->prepareStatement($db, $query);
|
||||
foreach ($args as $arg => $val) {
|
||||
$stmt->bindValue($arg, $val, is_int($val) ? \SQLITE3_INTEGER : \SQLITE3_TEXT);
|
||||
}
|
||||
|
@ -121,8 +121,6 @@ class CurrencyDataGenerator extends AbstractDataGenerator
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -133,8 +133,6 @@ class LanguageDataGenerator extends AbstractDataGenerator
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,7 +140,6 @@ class LanguageDataGenerator extends AbstractDataGenerator
|
||||
*/
|
||||
protected function generateDataForRoot(BundleReaderInterface $reader, $tempDir)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,7 +67,7 @@ class LocaleScanner
|
||||
*/
|
||||
public function scanAliases($sourceDir)
|
||||
{
|
||||
$locales = $this->scanLocales($sourceDir, '.txt');
|
||||
$locales = $this->scanLocales($sourceDir);
|
||||
$aliases = array();
|
||||
|
||||
// Delete locales that are no aliases
|
||||
|
@ -647,8 +647,7 @@ class IntlDateFormatter
|
||||
if (self::NONE !== $this->timetype) {
|
||||
$patternParts[] = $this->defaultTimeFormats[$this->timetype];
|
||||
}
|
||||
$pattern = implode(', ', $patternParts);
|
||||
|
||||
return $pattern;
|
||||
return implode(', ', $patternParts);
|
||||
}
|
||||
}
|
||||
|
@ -709,11 +709,9 @@ class NumberFormatter
|
||||
private function round($value, $precision)
|
||||
{
|
||||
$precision = $this->getUnitializedPrecision($value, $precision);
|
||||
|
||||
$roundingMode = self::$phpRoundingMap[$this->getAttribute(self::ROUNDING_MODE)];
|
||||
$value = round($value, $precision, $roundingMode);
|
||||
|
||||
return $value;
|
||||
return round($value, $precision, $roundingMode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,7 +12,6 @@
|
||||
namespace Symfony\Component\Intl\Tests\Data\Bundle\Reader;
|
||||
|
||||
use Symfony\Component\Intl\Data\Bundle\Reader\IntlBundleReader;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
|
||||
/**
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
|
@ -13,7 +13,6 @@ namespace Symfony\Component\Intl\Tests\Data\Bundle\Writer;
|
||||
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Intl\Data\Bundle\Writer\JsonBundleWriter;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
|
||||
/**
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
|
@ -13,7 +13,6 @@ namespace Symfony\Component\Intl\Tests\Data\Bundle\Writer;
|
||||
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Intl\Data\Bundle\Writer\PhpBundleWriter;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
|
||||
/**
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
|
@ -64,13 +64,13 @@ class LocaleScannerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$sortedLocales = array('de', 'de_alias', 'en', 'en_alias', 'fr', 'fr_alias');
|
||||
|
||||
$this->assertSame($sortedLocales, $this->scanner->scanLocales($this->directory, '.txt'));
|
||||
$this->assertSame($sortedLocales, $this->scanner->scanLocales($this->directory));
|
||||
}
|
||||
|
||||
public function testScanAliases()
|
||||
{
|
||||
$sortedAliases = array('de_alias' => 'de', 'en_alias' => 'en', 'fr_alias' => 'fr');
|
||||
|
||||
$this->assertSame($sortedAliases, $this->scanner->scanAliases($this->directory, '.txt'));
|
||||
$this->assertSame($sortedAliases, $this->scanner->scanAliases($this->directory));
|
||||
}
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ class PropertyAccessorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$value = new MagicianCall();
|
||||
|
||||
$this->propertyAccessor->getValue($value, 'foobar', 'bam');
|
||||
$this->propertyAccessor->getValue($value, 'foobar');
|
||||
}
|
||||
|
||||
public function testGetValueReadsMagicCall()
|
||||
|
@ -623,9 +623,8 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase
|
||||
$method = 'set'.$key;
|
||||
$context->$method($value);
|
||||
}
|
||||
$generator = new UrlGenerator($routes, $context, $logger);
|
||||
|
||||
return $generator;
|
||||
return new UrlGenerator($routes, $context, $logger);
|
||||
}
|
||||
|
||||
protected function getRoutes($name, Route $route)
|
||||
|
@ -856,7 +856,7 @@ QUERY;
|
||||
*/
|
||||
private function updateNewAceProperty($name, array $changes)
|
||||
{
|
||||
list($old, $new) = $changes;
|
||||
list(, $new) = $changes;
|
||||
|
||||
$sids = new \SplObjectStorage();
|
||||
$classIds = new \SplObjectStorage();
|
||||
|
@ -140,7 +140,7 @@ class RememberMeListenerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testSessionStrategy()
|
||||
{
|
||||
list($listener, $tokenStorage, $service, $manager) = $this->getListener(false, true, true);
|
||||
list($listener, $tokenStorage, $service, $manager) = $this->getListener();
|
||||
|
||||
$tokenStorage
|
||||
->expects($this->once())
|
||||
|
@ -172,9 +172,8 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$service = $this->getService(null, array('name' => 'foo', 'path' => '/foo', 'domain' => 'foodomain.foo'));
|
||||
$request = new Request();
|
||||
$response = new Response();
|
||||
|
||||
$service->loginFail($request, $response);
|
||||
$service->loginFail($request);
|
||||
|
||||
$cookie = $request->attributes->get(RememberMeServicesInterface::COOKIE_ATTR_NAME);
|
||||
$this->assertTrue($cookie->isCleared());
|
||||
|
@ -208,7 +208,6 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
|
||||
array(
|
||||
array(
|
||||
'bar' => function ($bar) {
|
||||
return;
|
||||
},
|
||||
),
|
||||
'baz',
|
||||
|
@ -25,9 +25,7 @@ class PhpFileDumper extends FileDumper
|
||||
*/
|
||||
protected function format(MessageCatalogue $messages, $domain)
|
||||
{
|
||||
$output = "<?php\n\nreturn ".var_export($messages->all($domain), true).";\n";
|
||||
|
||||
return $output;
|
||||
return "<?php\n\nreturn ".var_export($messages->all($domain), true).";\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -255,7 +255,6 @@ class InlineTest extends \PHPUnit_Framework_TestCase
|
||||
'12.30e+02' => 12.30e+02,
|
||||
'1234' => 0x4D2,
|
||||
'1243' => 02333,
|
||||
'.Inf' => -log(0),
|
||||
'-.Inf' => log(0),
|
||||
"'686e444'" => '686e444',
|
||||
'.Inf' => 646e444,
|
||||
|
Reference in New Issue
Block a user