Skip to content

Commit 3bec43e

Browse files
authored
Merge pull request #441 from FriendsOfSymfony/dead-code
some code inspection cleanups
2 parents 1d2d2bf + 576bb7a commit 3bec43e

File tree

8 files changed

+3
-32
lines changed

8 files changed

+3
-32
lines changed

src/CacheInvalidator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ public function supports($operation)
115115
*
116116
* @param EventDispatcherInterface $eventDispatcher
117117
*
118-
* @return $this
119-
*
120118
* @throws \Exception when trying to override the event dispatcher
121119
*/
122120
public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)

src/Exception/InvalidUrlException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* Thrown during setup if the configuration for a proxy client is invalid.
1616
*/
17-
class InvalidUrlException extends InvalidArgumentException implements HttpCacheException
17+
class InvalidUrlException extends InvalidArgumentException
1818
{
1919
/**
2020
* @param string $url the invalid URL

src/Exception/ProxyResponseException.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
namespace FOS\HttpCache\Exception;
1313

1414
use Http\Client\Exception\HttpException;
15-
use Psr\Http\Message\ResponseInterface;
1615

1716
/**
1817
* Wrapping an error response from the caching proxy.
1918
*/
2019
class ProxyResponseException extends \RuntimeException implements HttpCacheException
2120
{
2221
/**
23-
* @param ResponseInterface $response HTTP response
24-
*
2522
* @return ProxyResponseException
2623
*/
2724
public static function proxyResponse(HttpException $exception)

src/ProxyClient/MultiplexerClient.php

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

1414
use FOS\HttpCache\Exception\ExceptionCollection;
1515
use FOS\HttpCache\Exception\InvalidArgumentException;
16-
use FOS\HttpCache\Exception\UnsupportedProxyOperationException;
1716
use FOS\HttpCache\ProxyClient\Invalidation\BanCapable;
1817
use FOS\HttpCache\ProxyClient\Invalidation\PurgeCapable;
1918
use FOS\HttpCache\ProxyClient\Invalidation\RefreshCapable;
@@ -159,27 +158,6 @@ private function invoke($interface, $method, array $arguments)
159158
}
160159
}
161160

162-
/**
163-
* Invoke the given $method on the first available ProxyClient implementing
164-
* the given $interface.
165-
*
166-
* @param string $interface The FQN of the interface
167-
* @param string $method The method to invoke
168-
* @param array $arguments The arguments to be passed to the method
169-
*
170-
* @return mixed Return value of ProxyClient method call
171-
*
172-
* @throws UnsupportedProxyOperationException
173-
*/
174-
private function invokeFirst($interface, $method, array $arguments)
175-
{
176-
foreach ($this->getProxyClients($interface) as $proxyClient) {
177-
return call_user_func_array([$proxyClient, $method], $arguments);
178-
}
179-
180-
throw UnsupportedProxyOperationException::cacheDoesNotImplement($interface);
181-
}
182-
183161
/**
184162
* Get proxy clients that implement a feature interface.
185163
*

src/SymfonyCache/CacheEvent.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\EventDispatcher\Event;
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\HttpFoundation\Response;
17-
use Symfony\Component\HttpKernel\HttpCache\HttpCache;
1817

1918
/**
2019
* Event raised by the HttpCache kernel.

src/SymfonyCache/DebugListener.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace FOS\HttpCache\SymfonyCache;
1313

1414
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
15-
use Symfony\Component\HttpFoundation\Response;
1615

1716
/**
1817
* Debug handler for the symfony built-in HttpCache.

src/Test/Proxy/SymfonyProxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function clear()
6363
}
6464

6565
$path = $this->getCacheDir();
66-
if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
66+
if (0 === stripos(PHP_OS, 'WIN')) {
6767
// @codeCoverageIgnoreStart
6868
system('DEL /S '.$path);
6969
} else {

src/Test/WebServerListenerTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function startTestSuite($suite)
3535
return;
3636
}
3737

38-
if (!in_array('webserver', $suite->getGroups()) || null !== $this->pid) {
38+
if (null !== $this->pid || !in_array('webserver', $suite->getGroups())) {
3939
return;
4040
}
4141

0 commit comments

Comments
 (0)