Skip to content

some code inspection cleanups #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/CacheInvalidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ public function supports($operation)
*
* @param EventDispatcherInterface $eventDispatcher
*
* @return $this
*
* @throws \Exception when trying to override the event dispatcher
*/
public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidUrlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Thrown during setup if the configuration for a proxy client is invalid.
*/
class InvalidUrlException extends InvalidArgumentException implements HttpCacheException
class InvalidUrlException extends InvalidArgumentException
{
/**
* @param string $url the invalid URL
Expand Down
3 changes: 0 additions & 3 deletions src/Exception/ProxyResponseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@
namespace FOS\HttpCache\Exception;

use Http\Client\Exception\HttpException;
use Psr\Http\Message\ResponseInterface;

/**
* Wrapping an error response from the caching proxy.
*/
class ProxyResponseException extends \RuntimeException implements HttpCacheException
{
/**
* @param ResponseInterface $response HTTP response
*
* @return ProxyResponseException
*/
public static function proxyResponse(HttpException $exception)
Expand Down
22 changes: 0 additions & 22 deletions src/ProxyClient/MultiplexerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use FOS\HttpCache\Exception\ExceptionCollection;
use FOS\HttpCache\Exception\InvalidArgumentException;
use FOS\HttpCache\Exception\UnsupportedProxyOperationException;
use FOS\HttpCache\ProxyClient\Invalidation\BanCapable;
use FOS\HttpCache\ProxyClient\Invalidation\PurgeCapable;
use FOS\HttpCache\ProxyClient\Invalidation\RefreshCapable;
Expand Down Expand Up @@ -159,27 +158,6 @@ private function invoke($interface, $method, array $arguments)
}
}

/**
* Invoke the given $method on the first available ProxyClient implementing
* the given $interface.
*
* @param string $interface The FQN of the interface
* @param string $method The method to invoke
* @param array $arguments The arguments to be passed to the method
*
* @return mixed Return value of ProxyClient method call
*
* @throws UnsupportedProxyOperationException
*/
private function invokeFirst($interface, $method, array $arguments)
{
foreach ($this->getProxyClients($interface) as $proxyClient) {
return call_user_func_array([$proxyClient, $method], $arguments);
}

throw UnsupportedProxyOperationException::cacheDoesNotImplement($interface);
}

/**
* Get proxy clients that implement a feature interface.
*
Expand Down
1 change: 0 additions & 1 deletion src/SymfonyCache/CacheEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpCache\HttpCache;

/**
* Event raised by the HttpCache kernel.
Expand Down
1 change: 0 additions & 1 deletion src/SymfonyCache/DebugListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace FOS\HttpCache\SymfonyCache;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Response;

/**
* Debug handler for the symfony built-in HttpCache.
Expand Down
2 changes: 1 addition & 1 deletion src/Test/Proxy/SymfonyProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function clear()
}

$path = $this->getCacheDir();
if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
if (0 === stripos(PHP_OS, 'WIN')) {
// @codeCoverageIgnoreStart
system('DEL /S '.$path);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/Test/WebServerListenerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function startTestSuite($suite)
return;
}

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

Expand Down