From dbbe1701680bfabb64568f2731e7098ffe2ebace Mon Sep 17 00:00:00 2001 From: sarah khalil Date: Tue, 20 Jan 2015 22:49:28 +0100 Subject: [PATCH] Removed dead code and various cleaning --- .../Config/Definition/Dumper/XmlReferenceDumper.php | 2 +- .../Config/Definition/Dumper/YamlReferenceDumper.php | 1 - .../Component/Console/Descriptor/MarkdownDescriptor.php | 2 +- src/Symfony/Component/Debug/ExceptionHandler.php | 2 +- .../Compiler/CheckReferenceValidityPass.php | 1 - .../Component/HttpKernel/EventListener/DumpListener.php | 2 +- src/Symfony/Component/Process/Pipes/UnixPipes.php | 2 +- src/Symfony/Component/Process/Pipes/WindowsPipes.php | 2 +- src/Symfony/Component/PropertyAccess/PropertyAccessor.php | 2 -- .../Component/Security/Acl/Dbal/MutableAclProvider.php | 3 --- .../Component/Validator/Constraints/IsbnValidator.php | 2 +- .../Violation/LegacyConstraintViolationBuilder.php | 6 ------ src/Symfony/Component/VarDumper/Caster/DOMCaster.php | 2 -- 13 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php b/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php index 10c4dd4f55..ab56a92838 100644 --- a/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php +++ b/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php @@ -59,7 +59,7 @@ class XmlReferenceDumper }); if (count($remapping)) { - list($singular, $plural) = current($remapping); + list($singular) = current($remapping); $rootName = $singular; } } diff --git a/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php b/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php index a722955730..a7cd4486f2 100644 --- a/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php +++ b/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php @@ -14,7 +14,6 @@ namespace Symfony\Component\Config\Definition\Dumper; use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\NodeInterface; use Symfony\Component\Config\Definition\ArrayNode; -use Symfony\Component\Config\Definition\ScalarNode; use Symfony\Component\Config\Definition\EnumNode; use Symfony\Component\Config\Definition\PrototypedArrayNode; use Symfony\Component\Yaml\Inline; diff --git a/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php b/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php index db8f7df00a..78d48b9508 100644 --- a/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php +++ b/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php @@ -105,7 +105,7 @@ class MarkdownDescriptor extends Descriptor $this->write($help); } - if ($definition = $command->getNativeDefinition()) { + if ($command->getNativeDefinition()) { $this->write("\n\n"); $this->describeInputDefinition($command->getNativeDefinition()); } diff --git a/src/Symfony/Component/Debug/ExceptionHandler.php b/src/Symfony/Component/Debug/ExceptionHandler.php index 8c4c5fd422..3e87587773 100644 --- a/src/Symfony/Component/Debug/ExceptionHandler.php +++ b/src/Symfony/Component/Debug/ExceptionHandler.php @@ -50,7 +50,7 @@ class ExceptionHandler */ public static function register($debug = true, $fileLinkFormat = null) { - $handler = new static($debug, $fileLinkFormat = null); + $handler = new static($debug, $fileLinkFormat); $prev = set_exception_handler(array($handler, 'handle')); if (is_array($prev) && $prev[0] instanceof ErrorHandler) { diff --git a/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php b/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php index e704443989..3d4988d2e6 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php @@ -33,7 +33,6 @@ class CheckReferenceValidityPass implements CompilerPassInterface { private $container; private $currentId; - private $currentDefinition; private $currentScope; private $currentScopeAncestors; private $currentScopeChildren; diff --git a/src/Symfony/Component/HttpKernel/EventListener/DumpListener.php b/src/Symfony/Component/HttpKernel/EventListener/DumpListener.php index 4ba9f58da2..bccde8eb95 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/DumpListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/DumpListener.php @@ -24,7 +24,7 @@ use Symfony\Component\VarDumper\VarDumper; */ class DumpListener implements EventSubscriberInterface { - private $container; + private $cloner; private $dumper; /** diff --git a/src/Symfony/Component/Process/Pipes/UnixPipes.php b/src/Symfony/Component/Process/Pipes/UnixPipes.php index 6150d4a709..b3841031c4 100644 --- a/src/Symfony/Component/Process/Pipes/UnixPipes.php +++ b/src/Symfony/Component/Process/Pipes/UnixPipes.php @@ -172,7 +172,7 @@ class UnixPipes extends AbstractPipes } if (null !== $w && 0 < count($w)) { - while ($len = strlen($this->inputBuffer)) { + while (strlen($this->inputBuffer)) { $written = fwrite($w[0], $this->inputBuffer, 2 << 18); // write 512k if ($written > 0) { $this->inputBuffer = (string) substr($this->inputBuffer, $written); diff --git a/src/Symfony/Component/Process/Pipes/WindowsPipes.php b/src/Symfony/Component/Process/Pipes/WindowsPipes.php index 86cde67d02..01dd5d0600 100644 --- a/src/Symfony/Component/Process/Pipes/WindowsPipes.php +++ b/src/Symfony/Component/Process/Pipes/WindowsPipes.php @@ -235,7 +235,7 @@ class WindowsPipes extends AbstractPipes } if (null !== $w && 0 < count($w)) { - while ($len = strlen($this->inputBuffer)) { + while (strlen($this->inputBuffer)) { $written = fwrite($w[0], $this->inputBuffer, 2 << 18); if ($written > 0) { $this->inputBuffer = (string) substr($this->inputBuffer, $written); diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php index e1fa7e0961..5514cb2ba6 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php @@ -579,8 +579,6 @@ class PropertyAccessor implements PropertyAccessorInterface */ private function findAdderAndRemover(\ReflectionClass $reflClass, array $singulars) { - $exception = null; - foreach ($singulars as $singular) { $addMethod = 'add'.$singular; $removeMethod = 'remove'.$singular; diff --git a/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php b/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php index 8e6b53644d..bd255022f0 100644 --- a/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php +++ b/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php @@ -853,7 +853,6 @@ QUERY; { $sids = new \SplObjectStorage(); $classIds = new \SplObjectStorage(); - $currentIds = array(); foreach ($changes[1] as $field => $new) { for ($i = 0, $c = count($new); $i<$c; $i++) { $ace = $new[$i]; @@ -881,8 +880,6 @@ QUERY; $aceIdProperty = new \ReflectionProperty('Symfony\Component\Security\Acl\Domain\Entry', 'id'); $aceIdProperty->setAccessible(true); $aceIdProperty->setValue($ace, intval($aceId)); - } else { - $currentIds[$ace->getId()] = true; } } } diff --git a/src/Symfony/Component/Validator/Constraints/IsbnValidator.php b/src/Symfony/Component/Validator/Constraints/IsbnValidator.php index 8a53fe7941..94d26d7b6e 100644 --- a/src/Symfony/Component/Validator/Constraints/IsbnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IsbnValidator.php @@ -46,7 +46,7 @@ class IsbnValidator extends ConstraintValidator $value = (string) $value; $canonical = str_replace('-', '', $value); - if (null == $constraint->type) { + if (null === $constraint->type) { if ($constraint->isbn10 && !$constraint->isbn13) { $constraint->type = 'isbn10'; } elseif ($constraint->isbn13 && !$constraint->isbn10) { diff --git a/src/Symfony/Component/Validator/Violation/LegacyConstraintViolationBuilder.php b/src/Symfony/Component/Validator/Violation/LegacyConstraintViolationBuilder.php index 0607552cfc..5519f42de9 100644 --- a/src/Symfony/Component/Validator/Violation/LegacyConstraintViolationBuilder.php +++ b/src/Symfony/Component/Validator/Violation/LegacyConstraintViolationBuilder.php @@ -40,11 +40,6 @@ class LegacyConstraintViolationBuilder implements ConstraintViolationBuilderInte */ private $parameters; - /** - * @var mixed - */ - private $root; - /** * @var mixed */ @@ -70,7 +65,6 @@ class LegacyConstraintViolationBuilder implements ConstraintViolationBuilderInte $this->context = $context; $this->message = $message; $this->parameters = $parameters; - $this->root = $context->getRoot(); $this->invalidValue = $context->getValue(); } diff --git a/src/Symfony/Component/VarDumper/Caster/DOMCaster.php b/src/Symfony/Component/VarDumper/Caster/DOMCaster.php index 39abce5db8..d5b3c87a73 100644 --- a/src/Symfony/Component/VarDumper/Caster/DOMCaster.php +++ b/src/Symfony/Component/VarDumper/Caster/DOMCaster.php @@ -115,8 +115,6 @@ class DOMCaster public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, $isNested) { - // Commented lines denote properties that exist but are better not dumped for clarity. - $a += array( 'nodeName' => $dom->nodeName, 'nodeValue' => new CutStub($dom->nodeValue),