Remove some unused variables and properties

This commit is contained in:
Titouan Galopin 2017-12-08 14:17:14 +01:00
parent 5cb35fe959
commit 8bc2fbb934
7 changed files with 8 additions and 14 deletions

View File

@ -112,7 +112,7 @@ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface
} }
$instance['event'] = array($instance['event']); $instance['event'] = array($instance['event']);
if ($lazy = !empty($instance['lazy'])) { if (!empty($instance['lazy'])) {
$this->container->getDefinition($id)->setPublic(true); $this->container->getDefinition($id)->setPublic(true);
} }
} }

View File

@ -112,7 +112,7 @@ final class Dotenv
$this->end = strlen($this->data); $this->end = strlen($this->data);
$this->state = self::STATE_VARNAME; $this->state = self::STATE_VARNAME;
$this->values = array(); $this->values = array();
$name = $value = ''; $name = '';
$this->skipEmptyLines(); $this->skipEmptyLines();

View File

@ -23,20 +23,17 @@ use Symfony\Component\Form\Exception\UnexpectedTypeException;
class DateIntervalToStringTransformer implements DataTransformerInterface class DateIntervalToStringTransformer implements DataTransformerInterface
{ {
private $format; private $format;
private $parseSigned;
/** /**
* Transforms a \DateInterval instance to a string. * Transforms a \DateInterval instance to a string.
* *
* @see \DateInterval::format() for supported formats * @see \DateInterval::format() for supported formats
* *
* @param string $format The date format * @param string $format The date format
* @param bool $parseSigned Whether to parse as a signed interval
*/ */
public function __construct($format = 'P%yY%mM%dDT%hH%iM%sS', $parseSigned = false) public function __construct($format = 'P%yY%mM%dDT%hH%iM%sS')
{ {
$this->format = $format; $this->format = $format;
$this->parseSigned = $parseSigned;
} }
/** /**

View File

@ -50,7 +50,7 @@ class RemoveEmptyControllerArgumentLocatorsPass implements CompilerPassInterface
$action = substr(strrchr($controller, ':'), 1); $action = substr(strrchr($controller, ':'), 1);
$id = substr($controller, 0, -1 - strlen($action)); $id = substr($controller, 0, -1 - strlen($action));
$controllerDef = $container->getDefinition($id); $controllerDef = $container->getDefinition($id);
foreach ($controllerDef->getMethodCalls() as list($method, $args)) { foreach ($controllerDef->getMethodCalls() as list($method)) {
if (0 === strcasecmp($action, $method)) { if (0 === strcasecmp($action, $method)) {
$reason = sprintf('Removing method "%s" of service "%s" from controller candidates: the method is called at instantiation, thus cannot be an action.', $action, $id); $reason = sprintf('Removing method "%s" of service "%s" from controller candidates: the method is called at instantiation, thus cannot be an action.', $action, $id);
break; break;

View File

@ -24,7 +24,6 @@ class JsonDecode implements DecoderInterface
private $associative; private $associative;
private $recursionDepth; private $recursionDepth;
private $lastError = JSON_ERROR_NONE;
/** /**
* Constructs a new JsonDecode instance. * Constructs a new JsonDecode instance.
@ -75,7 +74,7 @@ class JsonDecode implements DecoderInterface
$decodedData = json_decode($data, $associative, $recursionDepth, $options); $decodedData = json_decode($data, $associative, $recursionDepth, $options);
if (JSON_ERROR_NONE !== $this->lastError = json_last_error()) { if (JSON_ERROR_NONE !== json_last_error()) {
throw new UnexpectedValueException(json_last_error_msg()); throw new UnexpectedValueException(json_last_error_msg());
} }

View File

@ -21,7 +21,6 @@ use Symfony\Component\Serializer\Exception\UnexpectedValueException;
class JsonEncode implements EncoderInterface class JsonEncode implements EncoderInterface
{ {
private $options; private $options;
private $lastError = JSON_ERROR_NONE;
public function __construct($bitmask = 0) public function __construct($bitmask = 0)
{ {
@ -39,7 +38,7 @@ class JsonEncode implements EncoderInterface
$encodedJson = json_encode($data, $context['json_encode_options']); $encodedJson = json_encode($data, $context['json_encode_options']);
if (JSON_ERROR_NONE !== $this->lastError = json_last_error()) { if (JSON_ERROR_NONE !== json_last_error()) {
throw new UnexpectedValueException(json_last_error_msg()); throw new UnexpectedValueException(json_last_error_msg());
} }

View File

@ -227,7 +227,6 @@ class ConstraintViolationAssertion
private $parameters = array(); private $parameters = array();
private $invalidValue = 'InvalidValue'; private $invalidValue = 'InvalidValue';
private $propertyPath = 'property.path'; private $propertyPath = 'property.path';
private $translationDomain;
private $plural; private $plural;
private $code; private $code;
private $constraint; private $constraint;
@ -264,7 +263,7 @@ class ConstraintViolationAssertion
public function setTranslationDomain($translationDomain) public function setTranslationDomain($translationDomain)
{ {
$this->translationDomain = $translationDomain; // no-op for BC
return $this; return $this;
} }