Permalink
Browse files

merged branch fabpot/dead-code (PR #8572)

This PR was merged into the 2.2 branch.

Discussion
----------

removed dead code and fixed CS

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

7d58147 removed dead code and fixed CS
  • Loading branch information...
2 parents bf260d7 + 7d58147 commit b970d172cb969e83c62670d1dbe9a2fa9f4c7195 @fabpot fabpot committed Jul 28, 2013
@@ -153,8 +153,6 @@ public function guessPattern($class, $property)
{
$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);
}
@@ -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;
@@ -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;
@@ -240,7 +240,6 @@ private function createFirewalls($config, ContainerBuilder $container)
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']);
@@ -35,9 +35,7 @@ public function parse(\Twig_Token $token)
// @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
@@ -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;
@@ -30,11 +30,6 @@ class MockFileSessionStorage extends MockArraySessionStorage
private $savePath;
/**
- * @var array
- */
- private $sessionData;
-
- /**
* Constructor.
*
* @param string $savePath Path of directory to save session files.
@@ -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;
@@ -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;
@@ -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;
@@ -77,4 +77,4 @@ public function testRenderWithDefaultText()
$strategy = new HIncludeFragmentRenderer($engine);
$this->assertEquals('<hx:include src="/foo">default</hx:include>', $strategy->render('/foo', Request::create('/'), array('default' => 'default'))->getContent());
}
-}
+}
@@ -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'),
@@ -151,7 +151,7 @@ private function dumpRoute($name, $route, array $options, $hostRegexUnique)
$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 @@ private function dumpRoute($name, $route, array $options, $hostRegexUnique)
// 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 @@ private function dumpRoute($name, $route, array $options, $hostRegexUnique)
// the main rule
- if ($hostRegex = $compiledRoute->getHostRegex()) {
+ if ($compiledRoute->getHostRegex()) {
$rule[] = sprintf("RewriteCond %%{ENV:__ROUTING_host_%s} =1", $hostRegexUnique);
}
@@ -64,6 +64,7 @@ public function __construct(SecurityContextInterface $securityContext, Authentic
list($user, $credentials) = $this->getPreAuthenticatedData($request);
} catch (BadCredentialsException $exception) {
$this->clearToken();
+
return;
}
@@ -100,12 +100,15 @@ private function parse($resource)
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();
@@ -414,7 +414,7 @@ public function testGetPropertyPathWithEmptyCurrentPropertyPath()
$this->assertEquals('bam.baz', $this->context->getPropertyPath('bam.baz'));
}
-
+
public function testGetPropertyPathWithNestedCollectionsMixed()
{
$constraints = new Collection(array(
@@ -424,13 +424,13 @@ public function testGetPropertyPathWithNestedCollectionsMixed()
)),
'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());
}
}
@@ -581,7 +581,7 @@ public function testWalkObjectUsesCorrectPropertyPathInViolationsWhenUsingNested
$violations = $this->walker->getViolations();
$this->assertEquals('collection[foo][bar]', $violations[0]->getPropertyPath());
}
-
+
public function testWalkObjectUsesCorrectPropertyPathInViolationsWhenUsingNestedMixedCollections()
{
$constraint = new Collection(array(

0 comments on commit b970d17

Please sign in to comment.