Skip to content

Commit 0ec2c99

Browse files
committed
Removed dead code and various cleaning
1 parent 0021010 commit 0ec2c99

File tree

32 files changed

+19
-70
lines changed

32 files changed

+19
-70
lines changed

src/Symfony/Bridge/Twig/NodeVisitor/Scope.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ class Scope
2121
*/
2222
private $parent;
2323

24-
/**
25-
* @var Scope[]
26-
*/
27-
private $children;
28-
2924
/**
3025
* @var array
3126
*/

src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private function writeNode(NodeInterface $node, $depth = 0, $root = false, $name
5959
});
6060

6161
if (count($remapping)) {
62-
list($singular, $plural) = current($remapping);
62+
list($singular) = current($remapping);
6363
$rootName = $singular;
6464
}
6565
}

src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Config\Definition\ConfigurationInterface;
1515
use Symfony\Component\Config\Definition\NodeInterface;
1616
use Symfony\Component\Config\Definition\ArrayNode;
17-
use Symfony\Component\Config\Definition\ScalarNode;
1817
use Symfony\Component\Config\Definition\EnumNode;
1918
use Symfony\Component\Config\Definition\PrototypedArrayNode;
2019
use Symfony\Component\Yaml\Inline;

src/Symfony/Component/Console/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,8 @@ public function renderException($e, $output)
712712
$trace = $e->getTrace();
713713
array_unshift($trace, array(
714714
'function' => '',
715-
'file' => $e->getFile() != null ? $e->getFile() : 'n/a',
716-
'line' => $e->getLine() != null ? $e->getLine() : 'n/a',
715+
'file' => $e->getFile() !== null ? $e->getFile() : 'n/a',
716+
'line' => $e->getLine() !== null ? $e->getLine() : 'n/a',
717717
'args' => array(),
718718
));
719719

src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function describeCommand(Command $command, array $options = array())
105105
$this->write($help);
106106
}
107107

108-
if ($definition = $command->getNativeDefinition()) {
108+
if ($command->getNativeDefinition()) {
109109
$this->write("\n\n");
110110
$this->describeInputDefinition($command->getNativeDefinition());
111111
}

src/Symfony/Component/CssSelector/Parser/TokenStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,4 @@ public function skipWhitespace()
179179
$this->getNext();
180180
}
181181
}
182-
}
182+
}

src/Symfony/Component/Debug/ExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct($debug = true, $fileLinkFormat = null)
5050
*/
5151
public static function register($debug = true, $fileLinkFormat = null)
5252
{
53-
$handler = new static($debug, $fileLinkFormat = null);
53+
$handler = new static($debug, $fileLinkFormat);
5454

5555
$prev = set_exception_handler(array($handler, 'handle'));
5656
if (is_array($prev) && $prev[0] instanceof ErrorHandler) {

src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
*/
2727
class CheckCircularReferencesPass implements CompilerPassInterface
2828
{
29-
private $currentId;
3029
private $currentPath;
3130
private $checkedNodes;
3231

@@ -41,7 +40,6 @@ public function process(ContainerBuilder $container)
4140

4241
$this->checkedNodes = array();
4342
foreach ($graph->getNodes() as $id => $node) {
44-
$this->currentId = $id;
4543
$this->currentPath = array($id);
4644

4745
$this->checkOutEdges($node->getOutEdges());

src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class CheckReferenceValidityPass implements CompilerPassInterface
3333
{
3434
private $container;
3535
private $currentId;
36-
private $currentDefinition;
3736
private $currentScope;
3837
private $currentScopeAncestors;
3938
private $currentScopeChildren;

src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Form\DataTransformerInterface;
1515
use Symfony\Component\Form\Exception\TransformationFailedException;
16-
use Symfony\Component\Form\Deprecated\NumberToLocalizedStringTransformer as Deprecated;
1716

1817
/**
1918
* Transforms between a number type and a localized number with grouping

src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Form\Extension\Validator\Constraints;
1313

14-
use Symfony\Component\Form\Extension\Validator\Constraints\Deprecated\Form as Deprecated;
1514
use Symfony\Component\Validator\Constraint;
1615

1716
/**

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public function duplicate(array $query = null, array $request = null, array $att
480480
}
481481

482482
if (!$dup->getRequestFormat(null)) {
483-
$dup->setRequestFormat($format = $this->getRequestFormat(null));
483+
$dup->setRequestFormat($this->getRequestFormat(null));
484484
}
485485

486486
return $dup;

src/Symfony/Component/HttpKernel/EventListener/DumpListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class DumpListener implements EventSubscriberInterface
2626
{
27-
private $container;
27+
private $cloner;
2828
private $dumper;
2929

3030
/**

src/Symfony/Component/Intl/Intl.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -264,20 +264,6 @@ private static function getEntryReader()
264264
return self::$entryReader;
265265
}
266266

267-
/**
268-
* Resets the internal state.
269-
*/
270-
private static function reset()
271-
{
272-
self::$currencyBundle = null;
273-
self::$languageBundle = null;
274-
self::$localeBundle = null;
275-
self::$regionBundle = null;
276-
self::$icuVersion = false;
277-
self::$icuDataVersion = false;
278-
self::$entryReader = null;
279-
}
280-
281267
/**
282268
* This class must not be instantiated.
283269
*/

src/Symfony/Component/Process/Pipes/UnixPipes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function readAndWrite($blocking, $close = false)
172172
}
173173

174174
if (null !== $w && 0 < count($w)) {
175-
while ($len = strlen($this->inputBuffer)) {
175+
while (strlen($this->inputBuffer)) {
176176
$written = fwrite($w[0], $this->inputBuffer, 2 << 18); // write 512k
177177
if ($written > 0) {
178178
$this->inputBuffer = (string) substr($this->inputBuffer, $written);

src/Symfony/Component/Process/Pipes/WindowsPipes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ private function write($blocking, $close)
235235
}
236236

237237
if (null !== $w && 0 < count($w)) {
238-
while ($len = strlen($this->inputBuffer)) {
238+
while (strlen($this->inputBuffer)) {
239239
$written = fwrite($w[0], $this->inputBuffer, 2 << 18);
240240
if ($written > 0) {
241241
$this->inputBuffer = (string) substr($this->inputBuffer, $written);

src/Symfony/Component/Process/Process.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,8 +1295,7 @@ protected function buildCallback($callback)
12951295
{
12961296
$that = $this;
12971297
$out = self::OUT;
1298-
$err = self::ERR;
1299-
$callback = function ($type, $data) use ($that, $callback, $out, $err) {
1298+
$callback = function ($type, $data) use ($that, $callback, $out) {
13001299
if ($out == $type) {
13011300
$that->addOutput($data);
13021301
} else {

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,6 @@ private function camelize($string)
579579
*/
580580
private function findAdderAndRemover(\ReflectionClass $reflClass, array $singulars)
581581
{
582-
$exception = null;
583-
584582
foreach ($singulars as $singular) {
585583
$addMethod = 'add'.$singular;
586584
$removeMethod = 'remove'.$singular;

src/Symfony/Component/PropertyAccess/PropertyPath.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ public function __construct($propertyPath)
109109
$element = $matches[3];
110110
$this->isIndex[] = true;
111111
}
112-
// Disabled this behaviour as the syntax is not yet final
113-
//$pos = strpos($element, self::SINGULAR_SEPARATOR);
112+
114113
$pos = false;
115114
$singular = null;
116115

src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,6 @@ private function updateNewFieldAceProperty($name, array $changes)
853853
{
854854
$sids = new \SplObjectStorage();
855855
$classIds = new \SplObjectStorage();
856-
$currentIds = array();
857856
foreach ($changes[1] as $field => $new) {
858857
for ($i = 0, $c = count($new); $i<$c; $i++) {
859858
$ace = $new[$i];
@@ -881,8 +880,6 @@ private function updateNewFieldAceProperty($name, array $changes)
881880
$aceIdProperty = new \ReflectionProperty('Symfony\Component\Security\Acl\Domain\Entry', 'id');
882881
$aceIdProperty->setAccessible(true);
883882
$aceIdProperty->setValue($ace, intval($aceId));
884-
} else {
885-
$currentIds[$ace->getId()] = true;
886883
}
887884
}
888885
}
@@ -931,7 +928,6 @@ private function updateNewAceProperty($name, array $changes)
931928

932929
$sids = new \SplObjectStorage();
933930
$classIds = new \SplObjectStorage();
934-
$currentIds = array();
935931
for ($i = 0, $c = count($new); $i<$c; $i++) {
936932
$ace = $new[$i];
937933

@@ -958,8 +954,6 @@ private function updateNewAceProperty($name, array $changes)
958954
$aceIdProperty = new \ReflectionProperty($ace, 'id');
959955
$aceIdProperty->setAccessible(true);
960956
$aceIdProperty->setValue($ace, intval($aceId));
961-
} else {
962-
$currentIds[$ace->getId()] = true;
963957
}
964958
}
965959
}

src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ public function authenticate(TokenInterface $token)
5959
if (!$user = $token->getUser()) {
6060
throw new BadCredentialsException('No pre-authenticated principal found in request.');
6161
}
62-
/*
63-
if (null === $token->getCredentials()) {
64-
throw new BadCredentialsException('No pre-authenticated credentials found in request.');
65-
}
66-
*/
62+
6763
$user = $this->userProvider->loadUserByUsername($user);
6864

6965
$this->userChecker->checkPostAuth($user);

src/Symfony/Component/Security/Core/Validator/Constraints/UserPasswordValidator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Security\Core\User\UserInterface;
1515
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
1616
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
17-
use Symfony\Component\Validator\Context\ExecutionContextInterface;
1817
use Symfony\Component\Validator\Constraint;
1918
use Symfony\Component\Validator\ConstraintValidator;
2019
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;

src/Symfony/Component/Security/Http/Firewall/AccessListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function handle(GetResponseEvent $event)
5555

5656
$request = $event->getRequest();
5757

58-
list($attributes, $channel) = $this->map->getPatterns($request);
58+
list($attributes) = $this->map->getPatterns($request);
5959

6060
if (null === $attributes) {
6161
return;

src/Symfony/Component/Security/Http/Firewall/ContextListener.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
class ContextListener implements ListenerInterface
3434
{
3535
private $tokenStorage;
36-
private $contextKey;
3736
private $sessionKey;
3837
private $logger;
3938
private $userProviders;
@@ -54,7 +53,6 @@ public function __construct(TokenStorageInterface $tokenStorage, array $userProv
5453

5554
$this->tokenStorage = $tokenStorage;
5655
$this->userProviders = $userProviders;
57-
$this->contextKey = $contextKey;
5856
$this->sessionKey = '_security_'.$contextKey;
5957
$this->logger = $logger;
6058
$this->dispatcher = $dispatcher;

src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function onKernelException(GetResponseForExceptionEvent $event)
9494
} elseif ($exception instanceof AccessDeniedException) {
9595
return $this->handleAccessDeniedException($event, $exception);
9696
} elseif ($exception instanceof LogoutException) {
97-
return $this->handleLogoutException($event, $exception);
97+
return $this->handleLogoutException($exception);
9898
}
9999
} while (null !== $exception = $exception->getPrevious());
100100
}
@@ -160,7 +160,7 @@ private function handleAccessDeniedException(GetResponseForExceptionEvent $event
160160
}
161161
}
162162

163-
private function handleLogoutException(GetResponseForExceptionEvent $event, LogoutException $exception)
163+
private function handleLogoutException(LogoutException $exception)
164164
{
165165
if (null !== $this->logger) {
166166
$this->logger->info('A LogoutException was thrown.', array('exception' => $exception));

src/Symfony/Component/Security/Http/RememberMe/PersistentTokenBasedRememberMeServices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected function cancelCookie(Request $request)
7373
if (null !== ($cookie = $request->cookies->get($this->options['name']))
7474
&& count($parts = $this->decodeCookie($cookie)) === 2
7575
) {
76-
list($series, $tokenValue) = $parts;
76+
list($series) = $parts;
7777
$this->tokenProvider->deleteTokenBySeries($series);
7878
}
7979
}

src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\Serializer\Exception\CircularReferenceException;
1515
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
16+
use Symfony\Component\Serializer\Exception\RuntimeException;
1617
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
1718

1819
/**

src/Symfony/Component/Validator/Constraints/CallbackValidator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14-
use Symfony\Component\Validator\Context\ExecutionContextInterface;
1514
use Symfony\Component\Validator\Constraint;
1615
use Symfony\Component\Validator\ConstraintValidator;
1716
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;

src/Symfony/Component/Validator/Constraints/IsbnValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function validate($value, Constraint $constraint)
4747
$value = (string) $value;
4848
$canonical = str_replace('-', '', $value);
4949

50-
if (null == $constraint->type) {
50+
if (null === $constraint->type) {
5151
if ($constraint->isbn10 && !$constraint->isbn13) {
5252
trigger_error('The "isbn10" option of the Isbn constraint is deprecated since version 2.5 and will be removed in 3.0. Use the "type" option instead.', E_USER_DEPRECATED);
5353
$constraint->type = 'isbn10';

src/Symfony/Component/Validator/Constraints/NotNullValidator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14-
use Symfony\Component\Validator\Context\ExecutionContextInterface;
1514
use Symfony\Component\Validator\Constraint;
1615
use Symfony\Component\Validator\ConstraintValidator;
1716
use Symfony\Component\Validator\Exception\UnexpectedTypeException;

src/Symfony/Component/Validator/Violation/LegacyConstraintViolationBuilder.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ class LegacyConstraintViolationBuilder implements ConstraintViolationBuilderInte
4242
*/
4343
private $parameters;
4444

45-
/**
46-
* @var mixed
47-
*/
48-
private $root;
49-
5045
/**
5146
* @var mixed
5247
*/
@@ -72,7 +67,6 @@ public function __construct(ExecutionContextInterface $context, $message, array
7267
$this->context = $context;
7368
$this->message = $message;
7469
$this->parameters = $parameters;
75-
$this->root = $context->getRoot();
7670
$this->invalidValue = $context->getValue();
7771
}
7872

src/Symfony/Component/VarDumper/Caster/DOMCaster.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ public static function castNode(\DOMNode $dom, array $a, Stub $stub, $isNested)
115115

116116
public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, $isNested)
117117
{
118-
// Commented lines denote properties that exist but are better not dumped for clarity.
119-
120118
$a += array(
121119
'nodeName' => $dom->nodeName,
122120
'nodeValue' => new CutStub($dom->nodeValue),

0 commit comments

Comments
 (0)