8000 minor #25391 [2.7] Remove some unused variables, properties and metho… · symfony/symfony@40ced3a · GitHub
[go: up one dir, main page]

Skip to content

Commit 40ced3a

Browse files
minor #25391 [2.7] Remove some unused variables, properties and methods (tgalopin)
This PR was merged into the 2.7 branch. Discussion ---------- [2.7] Remove some unused variables, properties and methods | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | kind of | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT Analyzing symfony/symfony using https://insight.sensiolabs.com, I found several chunks of dead code. This PR removes them in the 2.7 branch. fabbot failure is unrelated. Commits ------- 30e2273 Remove some unused variables, properties and methods
2 parents 87c5c2c + 30e2273 commit 40ced3a

File tree

12 files changed

+9
-31
lines changed

12 files changed

+9
-31
lines changed

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/AssetsHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(Packages $packages)
4343
public function getUrl($path, $packageName = null, $version = null)
4444
{
4545
// BC layer to be removed in 3.0
46-
if (3 === $count = func_num_args()) {
46+
if (3 === func_num_args()) {
4747
@trigger_error('Forcing a version for an asset was deprecated in 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
4848

4949
$args = func_get_args();

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ class TokenStream
2929
*/
3030
private $tokens = array();
3131

32-
/**
33-
* @var bool
34-
*/
35-
private $frozen = false;
36-
3732
/**
3833
* @var Token[]
3934
*/
@@ -47,7 +42,7 @@ class TokenStream
4742
/**
4843
* @var Token|null
4944
*/
50-
private $peeked = null;
45+
private $peeked;
5146

5247
/**
5348
* @var bool
@@ -73,8 +68,6 @@ public function push(Token $token)
7368
*/
7469
public function freeze()
7570
{
76-
$this->frozen = true;
77-
7871
return $this;
7972
}
8073

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface
3030
private $container;
3131
private $currentId;
3232
private $currentDefinition;
33-
private $repeatedPass;
3433
private $onlyConstructorArguments;
3534

3635
/**
@@ -46,7 +45,7 @@ public function __construct($onlyConstructorArguments = false)
4645
*/
4746
public function setRepeatedPass(RepeatedPass $repeatedPass)
4847
{
49-
$this->repeatedPass = $repeatedPass;
48+
// no-op for BC
5049
}
5150

5251
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*/
2424
class InlineServiceDefinitionsPass implements RepeatablePassInterface
2525
{
26-
private $repeatedPass;
2726
private $graph;
2827
private $compiler;
2928
private $formatter;
@@ -34,7 +33,7 @@ class InlineServiceDefinitionsPass implements RepeatablePassInterface
3433
*/
3534
public function setRepeatedPass(RepeatedPass $repeatedPass)
3635
{
37-
$this->repeatedPass = $repeatedPass;
36+
// no-op for BC
3837
}
3938

4039
/**

src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function removeListener($eventName, $listener)
6767

6868
if (isset($this->listenerIds[$eventName])) {
6969
foreach ($this->listenerIds[$eventName] as $i => $args) {
70-
list($serviceId, $method, $priority) = $args;
70+
list($serviceId, $method) = $args;
7171
$key = $serviceId.'.'.$method;
7272
if (isset($this->listeners[$eventName][$key]) && $listener === array($this->listeners[$eventName][$key], $method)) {
7373
unset($this->listeners[$eventName][$key]);

src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ class TimezoneType extends AbstractType
2323
*/
2424
private static $timezones;
2525

26-
/**
27-
* Stores the available timezone choices.
28-
*
29-
* @var array
30-
*/
31-
private static $flippedTimezones;
32-
3326
/**
3427
* {@inheritdoc}
3528
*/

src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class ConfigDataCollector extends DataCollector
2727
private $kernel;
2828
private $name;
2929
private $version;
30-
private $cacheVersionInfo = true;
3130

3231
/**
3332
* @param string $name The name of the application using the web profiler
@@ -123,7 +122,7 @@ public function getSymfonyState()
123122

124123
public function setCacheVersionInfo($cacheVersionInfo)
125124
{
126-
$this->cacheVersionInfo = $cacheVersionInfo;
125+
// no-op for BC
127126
}
128127

129128
/**

src/Symfony/Component/HttpKernel/HttpCache/Store.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function lookup(Request $request)
151151
return;
152152
}
153153

154-
list($req, $headers) = $match;
154+
$headers = $match[1];
155155
if (file_exists($body = $this->getPath($headers['x-content-digest'][0]))) {
156156
return $this->restoreResponse($headers, $body);
157157
}

src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public function testCollect()
2424
{
2525
$kernel = new KernelForTest('test', true);
2626
$c = new ConfigDataCollector();
27-
$c->setCacheVersionInfo(false);
2827
$c->setKernel($kernel);
2928
$c->collect(new Request(), new Response());
3029

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected function write()
9494
$w = array($this->pipes[0]);
9595

9696
// let's have a look if something changed in streams
97-
if (false === $n = @stream_select($r, $w, $e, 0, 0)) {
97+
if (false === @stream_select($r, $w, $e, 0, 0)) {
9898
return;
9999
}
100100

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function readAndWrite($blocking, $close = false)
9999
unset($r[0]);
100100

101101
// let's have a look if something changed in streams
102-
if (($r || $w) && false === $n = @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
102+
if (($r || $w) && false === @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
103103
// if a system call has been interrupted, forget about it, let's try again
104104
// otherwise, an error occurred, let's reset pipes
105105
if (!$this->hasSystemCallBeenInterrupted()) {

src/Symfony/Component/Validator/Context/LegacyExecutionContext.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
*/
2727
class LegacyExecutionContext extends ExecutionContext
2828
{
29-
private $metadataFactory;
30-
3129
/**
3230
* Creates a new context.
3331
*
@@ -44,7 +42,5 @@ public function __construct(ValidatorInterface $validator, $root, MetadataFactor
4442
$translator,
4543
$translationDomain
4644
);
47-
48-
$this->metadataFactory = $metadataFactory;
4945
}
5046
}

0 commit comments

Comments
 (0)
0