removed dead code and fixed CS

This commit is contained in:
Fabien Potencier 2013-07-25 07:46:36 +02:00
parent 9538efaf40
commit 7d581471ce
17 changed files with 18 additions and 31 deletions

View File

@ -153,8 +153,6 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface
{
$ret = $this->getMetadata($class);
if ($ret && $ret[0]->hasField($property) && !$ret[0]->hasAssociation($property)) {
$mapping = $ret[0]->getFieldMapping($property);
if (in_array($ret[0]->getTypeOfField($property), array('decimal', 'float'))) {
return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\Monolog\Processor;
use Monolog\Processor\WebProcessor as BaseWebProcessor;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\DependencyInjection\ContainerAware;

View File

@ -240,7 +240,6 @@ class SecurityExtension extends Extension
private function createFirewall(ContainerBuilder $container, $id, $firewall, &$authenticationProviders, $providerIds)
{
// Matcher
$i = 0;
$matcher = null;
if (isset($firewall['request_matcher'])) {
$matcher = new Reference($firewall['request_matcher']);

View File

@ -35,9 +35,7 @@ class RenderTokenParser extends \Twig_TokenParser
// @deprecated in 2.2 and will be removed in 2.3
if ($this->parser->getStream()->test(\Twig_Token::NAME_TYPE, 'with')) {
$this->parser->getStream()->next();
$attributes = $this->parser->getExpressionParser()->parseExpression();
} else {
$attributes = new \Twig_Node_Expression_Array(array(), $token->getLine());
$this->parser->getExpressionParser()->parseExpression();
}
// options

View File

@ -12,7 +12,6 @@
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\BadMethodCallException;
use Symfony\Component\Form\Exception\Exception;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\PropertyAccess\PropertyPath;
use Symfony\Component\PropertyAccess\PropertyPathInterface;

View File

@ -29,11 +29,6 @@ class MockFileSessionStorage extends MockArraySessionStorage
*/
private $savePath;
/**
* @var array
*/
private $sessionData;
/**
* Constructor.
*

View File

@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\DependencyInjection;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\HttpKernel\EventListener;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\HttpKernel\Fragment;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpKernel\Controller\ControllerReference;

View File

@ -77,4 +77,4 @@ class HIncludeFragmentRendererTest extends \PHPUnit_Framework_TestCase
$strategy = new HIncludeFragmentRenderer($engine);
$this->assertEquals('<hx:include src="/foo">default</hx:include>', $strategy->render('/foo', Request::create('/'), array('default' => 'default'))->getContent());
}
}
}

View File

@ -77,7 +77,7 @@ class StringUtil
// moves (move)
array('sevom', 5, true, true, 'move'),
// hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf)
array('sev', 3, true, true, 'f'),

View File

@ -151,7 +151,7 @@ class ApacheMatcherDumper extends MatcherDumper
$allow[] = 'E=_ROUTING_allow_'.$method.':1';
}
if ($hostRegex = $compiledRoute->getHostRegex()) {
if ($compiledRoute->getHostRegex()) {
$rule[] = sprintf("RewriteCond %%{ENV:__ROUTING_host_%s} =1", $hostRegexUnique);
}
@ -162,8 +162,7 @@ class ApacheMatcherDumper extends MatcherDumper
// redirect with trailing slash appended
if ($hasTrailingSlash) {
if ($hostRegex = $compiledRoute->getHostRegex()) {
if ($compiledRoute->getHostRegex()) {
$rule[] = sprintf("RewriteCond %%{ENV:__ROUTING_host_%s} =1", $hostRegexUnique);
}
@ -173,7 +172,7 @@ class ApacheMatcherDumper extends MatcherDumper
// the main rule
if ($hostRegex = $compiledRoute->getHostRegex()) {
if ($compiledRoute->getHostRegex()) {
$rule[] = sprintf("RewriteCond %%{ENV:__ROUTING_host_%s} =1", $hostRegexUnique);
}

View File

@ -64,6 +64,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface
list($user, $credentials) = $this->getPreAuthenticatedData($request);
} catch (BadCredentialsException $exception) {
$this->clearToken();
return;
}

View File

@ -100,12 +100,15 @@ class MoFileLoader extends ArrayLoader implements LoaderInterface
throw new InvalidResourceException("MO stream content has an invalid format.");
}
$formatRevision = $this->readLong($stream, $isBigEndian);
// formatRevision
$this->readLong($stream, $isBigEndian);
$count = $this->readLong($stream, $isBigEndian);
$offsetId = $this->readLong($stream, $isBigEndian);
$offsetTranslated = $this->readLong($stream, $isBigEndian);
$sizeHashes = $this->readLong($stream, $isBigEndian);
$offsetHashes = $this->readLong($stream, $isBigEndian);
// sizeHashes
$this->readLong($stream, $isBigEndian);
// offsetHashes
$this->readLong($stream, $isBigEndian);
$messages = array();

View File

@ -414,7 +414,7 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('bam.baz', $this->context->getPropertyPath('bam.baz'));
}
public function testGetPropertyPathWithNestedCollectionsMixed()
{
$constraints = new Collection(array(
@ -424,13 +424,13 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase
)),
'name' => new ConstraintA()
));
$visitor = new ValidationVisitor('Root', $this->metadataFactory, new ConstraintValidatorFactory(), $this->translator);
$context = new ExecutionContext($visitor, $this->translator, self::TRANS_DOMAIN);
$context->validateValue(array('foo' => array('foo' => 'VALID')), $constraints);
$violations = $context->getViolations();
$this->assertEquals('[name]', $violations[1]->getPropertyPath());
$this->assertEquals('[name]', $violations[1]->getPropertyPath());
}
}

View File

@ -581,7 +581,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase
$violations = $this->walker->getViolations();
$this->assertEquals('collection[foo][bar]', $violations[0]->getPropertyPath());
}
public function testWalkObjectUsesCorrectPropertyPathInViolationsWhenUsingNestedMixedCollections()
{
$constraint = new Collection(array(