Skip to content

Commit

Permalink
Remove FQCN type hints on properties
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Dec 8, 2021
1 parent 6309807 commit 99e42b5
Show file tree
Hide file tree
Showing 27 changed files with 48 additions and 51 deletions.
2 changes: 1 addition & 1 deletion AmpHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class AmpHttpClient implements HttpClientInterface, LoggerAwareInterface,
use LoggerAwareTrait;

private array $defaultOptions = self::OPTIONS_DEFAULTS;
private AmpClientState $multi;
private $multi;

/**
* @param array $defaultOptions Default requests' options
Expand Down
4 changes: 2 additions & 2 deletions CachingHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class CachingHttpClient implements HttpClientInterface, ResetInterface
{
use HttpClientTrait;

private HttpClientInterface $client;
private HttpCache $cache;
private $client;
private $cache;
private array $defaultOptions = self::OPTIONS_DEFAULTS;

public function __construct(HttpClientInterface $client, StoreInterface $store, array $defaultOptions = [])
Expand Down
2 changes: 1 addition & 1 deletion CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface,
/**
* An internal object to share state between the client and its responses.
*/
private CurlClientState $multi;
private $multi;

private static array $curlVersion;

Expand Down
2 changes: 1 addition & 1 deletion DecoratorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
trait DecoratorTrait
{
private HttpClientInterface $client;
private $client;

public function __construct(HttpClientInterface $client = null)
{
Expand Down
2 changes: 1 addition & 1 deletion Exception/HttpExceptionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
trait HttpExceptionTrait
{
private ResponseInterface $response;
private $response;

public function __construct(ResponseInterface $response)
{
Expand Down
8 changes: 4 additions & 4 deletions HttplugClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@
*/
final class HttplugClient implements HttplugInterface, HttpAsyncClient, RequestFactory, StreamFactory, UriFactory, ResetInterface
{
private HttpClientInterface $client;
private ResponseFactoryInterface $responseFactory;
private StreamFactoryInterface $streamFactory;
private $client;
private $responseFactory;
private $streamFactory;

/**
* @var \SplObjectStorage<ResponseInterface, array{RequestInterface, Promise}>|null
*/
private ?\SplObjectStorage $promisePool;

private HttplugWaitLoop $waitLoop;
private $waitLoop;

public function __construct(HttpClientInterface $client = null, ResponseFactoryInterface $responseFactory = null, StreamFactoryInterface $streamFactory = null)
{
Expand Down
2 changes: 1 addition & 1 deletion Internal/AmpBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
class AmpBody implements RequestBody, InputStream
{
private ResourceInputStream|\Closure|string $body;
private $body;
private array $info;
private \Closure $onProgress;
private ?int $offset = 0;
Expand Down
2 changes: 1 addition & 1 deletion Internal/AmpClientState.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ final class AmpClientState extends ClientState
private \Closure $clientConfigurator;
private int $maxHostConnections;
private int $maxPendingPushes;
private ?LoggerInterface $logger;
private $logger;

public function __construct(?callable $clientConfigurator, int $maxHostConnections, int $maxPendingPushes, ?LoggerInterface &$logger)
{
Expand Down
5 changes: 2 additions & 3 deletions Internal/CurlClientState.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Component\HttpClient\Internal;

use Psr\Log\LoggerInterface;

/**
* Internal representation of the cURL client's state.
Expand All @@ -25,11 +24,11 @@ final class CurlClientState extends ClientState
public \CurlMultiHandle $handle;
/** @var PushedResponse[] */
public array $pushedResponses = [];
public DnsCache $dnsCache;
public $dnsCache;
/** @var float[] */
public array $pauseExpiries = [];
public int $execCounter = \PHP_INT_MIN;
public ?LoggerInterface $logger = null;
public $logger = null;

public function __construct()
{
Expand Down
6 changes: 3 additions & 3 deletions Internal/HttplugWaitLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
*/
final class HttplugWaitLoop
{
private HttpClientInterface $client;
private $client;
private ?\SplObjectStorage $promisePool;
private ResponseFactoryInterface $responseFactory;
private StreamFactoryInterface $streamFactory;
private $responseFactory;
private $streamFactory;

/**
* @param \SplObjectStorage<ResponseInterface, array{Psr7RequestInterface, Promise}>|null $promisePool
Expand Down
2 changes: 1 addition & 1 deletion Internal/PushedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
final class PushedResponse
{
public CurlResponse $response;
public $response;

/** @var string[] */
public array $requestHeaders;
Expand Down
2 changes: 1 addition & 1 deletion MockHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MockHttpClient implements HttpClientInterface, ResetInterface
{
use HttpClientTrait;

private ResponseInterface|\Closure|iterable|null $responseFactory;
private $responseFactory;
private int $requestsCount = 0;
private array $defaultOptions = [];

Expand Down
2 changes: 1 addition & 1 deletion NativeHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class NativeHttpClient implements HttpClientInterface, LoggerAwareInterfac
use LoggerAwareTrait;

private array $defaultOptions = self::OPTIONS_DEFAULTS;
private NativeClientState $multi;
private $multi;

/**
* @param array $defaultOptions Default request's options
Expand Down
2 changes: 1 addition & 1 deletion NoPrivateNetworkHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ final class NoPrivateNetworkHttpClient implements HttpClientInterface, LoggerAwa
'::/128',
];

private HttpClientInterface $client;
private $client;
private string|array|null $subnets;

/**
Expand Down
10 changes: 5 additions & 5 deletions Psr18Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
*/
final class Psr18Client implements ClientInterface, RequestFactoryInterface, StreamFactoryInterface, UriFactoryInterface, ResetInterface
{
private HttpClientInterface $client;
private ResponseFactoryInterface $responseFactory;
private StreamFactoryInterface $streamFactory;
private $client;
private $responseFactory;
private $streamFactory;

public function __construct(HttpClientInterface $client = null, ResponseFactoryInterface $responseFactory = null, StreamFactoryInterface $streamFactory = null)
{
Expand Down Expand Up @@ -205,7 +205,7 @@ public function reset()
*/
class Psr18NetworkException extends \RuntimeException implements NetworkExceptionInterface
{
private RequestInterface $request;
private $request;

public function __construct(TransportExceptionInterface $e, RequestInterface $request)
{
Expand All @@ -224,7 +224,7 @@ public function getRequest(): RequestInterface
*/
class Psr18RequestException extends \InvalidArgumentException implements RequestExceptionInterface
{
private RequestInterface $request;
private $request;

public function __construct(TransportExceptionInterface $e, RequestInterface $request)
{
Expand Down
4 changes: 2 additions & 2 deletions Response/AmpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ final class AmpResponse implements ResponseInterface, StreamableInterface

private static string $nextId = 'a';

private AmpClientState $multi;
private $multi;
private ?array $options;
private CancellationTokenSource $canceller;
private $canceller;
private \Closure $onProgress;

private static ?string $delay = null;
Expand Down
4 changes: 2 additions & 2 deletions Response/AsyncContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
final class AsyncContext
{
private $passthru;
private HttpClientInterface $client;
private ResponseInterface $response;
private $client;
private $response;
private array $info = [];
private $content;
private int $offset;
Expand Down
4 changes: 2 additions & 2 deletions Response/AsyncResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ final class AsyncResponse implements ResponseInterface, StreamableInterface
private const FIRST_CHUNK_YIELDED = 1;
private const LAST_CHUNK_YIELDED = 2;

private ?HttpClientInterface $client;
private ResponseInterface $response;
private $client;
private $response;
private array $info = ['canceled' => false];
private $passthru;
private $stream;
Expand Down
2 changes: 1 addition & 1 deletion Response/CurlResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class CurlResponse implements ResponseInterface, StreamableInterface
use TransportResponseTrait;

private static bool $performing = false;
private CurlClientState $multi;
private $multi;

/**
* @var resource
Expand Down
2 changes: 1 addition & 1 deletion Response/HttplugPromise.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
final class HttplugPromise implements HttplugPromiseInterface
{
private GuzzlePromiseInterface $promise;
private $promise;

public function __construct(GuzzlePromiseInterface $promise)
{
Expand Down
2 changes: 1 addition & 1 deletion Response/NativeResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class NativeResponse implements ResponseInterface, StreamableInterface
*/
private $buffer;

private NativeClientState $multi;
private $multi;
private float $pauseExpiry = 0.0;

/**
Expand Down
4 changes: 2 additions & 2 deletions Response/StreamWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class StreamWrapper
/** @var resource|string|null */
public $context;

private HttpClientInterface|ResponseInterface $client;
private $client;

private ResponseInterface $response;
private $response;

/** @var resource|null */
private $content;
Expand Down
6 changes: 3 additions & 3 deletions Response/TraceableResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
*/
class TraceableResponse implements ResponseInterface, StreamableInterface
{
private HttpClientInterface $client;
private ResponseInterface $response;
private $client;
private $response;
private mixed $content;
private ?StopwatchEvent $event;
private $event;

public function __construct(HttpClientInterface $client, ResponseInterface $response, &$content, StopwatchEvent $event = null)
{
Expand Down
8 changes: 3 additions & 5 deletions Response/TransportResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@

namespace Symfony\Component\HttpClient\Response;

use Psr\Log\LoggerInterface;
use Symfony\Component\HttpClient\Chunk\DataChunk;
use Symfony\Component\HttpClient\Chunk\ErrorChunk;
use Symfony\Component\HttpClient\Chunk\FirstChunk;
use Symfony\Component\HttpClient\Chunk\LastChunk;
use Symfony\Component\HttpClient\Exception\TransportException;
use Symfony\Component\HttpClient\Internal\Canary;
use Symfony\Component\HttpClient\Internal\ClientState;

/**
Expand All @@ -41,10 +39,10 @@ trait TransportResponseTrait
private $handle;
private int|string $id;
private ?float $timeout = 0;
private \InflateContext|bool|null $inflate = null;
private $inflate = null;
private ?array $finalInfo = null;
private Canary $canary;
private ?LoggerInterface $logger = null;
private $canary;
private $logger = null;

/**
* {@inheritdoc}
Expand Down
4 changes: 2 additions & 2 deletions RetryableHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class RetryableHttpClient implements HttpClientInterface, ResetInterface
{
use AsyncDecoratorTrait;

private RetryStrategyInterface $strategy;
private $strategy;
private int $maxRetries;
private LoggerInterface $logger;
private $logger;

/**
* @param int $maxRetries The maximum number of times to retry
Expand Down
2 changes: 1 addition & 1 deletion ScopingHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ScopingHttpClient implements HttpClientInterface, ResetInterface, LoggerAw
{
use HttpClientTrait;

private HttpClientInterface $client;
private $client;
private array $defaultOptionsByRegexp;
private ?string $defaultRegexp;

Expand Down
4 changes: 2 additions & 2 deletions TraceableHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
*/
final class TraceableHttpClient implements HttpClientInterface, ResetInterface, LoggerAwareInterface
{
private HttpClientInterface $client;
private $client;
private array $tracedRequests = [];
private ?Stopwatch $stopwatch;
private $stopwatch;

public function __construct(HttpClientInterface $client, Stopwatch $stopwatch = null)
{
Expand Down

0 comments on commit 99e42b5

Please sign in to comment.