8000 Ensure all properties have a type by nicolas-grekas · Pull Request #51129 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\Cache\CacheItemPoolInterface;
use Relay\Relay;
use Symfony\Component\Cache\Adapter\RedisAdapter;

abstract class AbstractRedisAdapterTestCase extends AdapterTestCase
Expand All @@ -23,7 +24,7 @@ abstract class AbstractRedisAdapterTestCase extends AdapterTestCase
'testDefaultLifeTime' => 'Testing expiration slows down the test suite',
];

protected static $redis;
protected static \Redis|Relay|\RedisArray|\RedisCluster|\Predis\ClientInterface $redis;

public function createCachePool(int $defaultLifetime = 0, string $testMethod = null): CacheItemPoolInterface
{
Expand All @@ -42,11 +43,6 @@ public static function setUpBeforeClass(): void
}
}

public static function tearDownAfterClass(): void
{
self::$redis = null;
}

/**
* @runInSeparateProcess
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function testStoredFile()

class PhpArrayAdapterWrapper extends PhpArrayAdapter
{
protected $data = [];
protected array $data = [];

public function save(CacheItemInterface $item): bool
{
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Console/Cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
final class Cursor
{
private OutputInterface $output;
/** @var resource */
private $input;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Console/Input/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
abstract class Input implements InputInterface, StreamableInputInterface
{
protected $definition;
/** @var resource */
protected $stream;
protected $options = [];
protected $arguments = [];
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Console/Output/StreamOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
class StreamOutput extends Output
{
/** @var resource */
private $stream;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Tests/CursorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

class CursorTest extends TestCase
{
/** @var resource */
protected $stream;

protected function setUp(): void
Expand All @@ -26,8 +27,7 @@ protected function setUp(): void

protected function tearDown(): void
{
fclose($this->stream);
$this->stream = null;
unset($this->stream);
}

public function testMoveUpOneLine()
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Tests/Helper/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

class TableTest extends TestCase
{
/** @var resource */
protected $stream;

protected function setUp(): void
Expand All @@ -34,8 +35,7 @@ protected function setUp(): void

protected function tearDown(): void
{
fclose($this->stream);
$this->stream = null;
unset($this->stream);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

class ConsoleSectionOutputTest extends TestCase
{
/** @var resource */
private $stream;

protected function setUp(): void
Expand All @@ -31,7 +32,7 @@ protected function setUp(): void

protected function tearDown(): void
{
$this->stream = null;
unset($this->stream);
}

public function testClearAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

class StreamOutputTest extends TestCase
{
/** @var resource */
protected $stream;

protected function setUp(): void
Expand All @@ -26,7 +27,7 @@ protected function setUp(): void

protected function tearDown(): void
{
$this->stream = null;
unset($this->stream);
}

public function testConstructor()
Expand Down
18 changes: 8 additions & 10 deletions src/Symfony/Component/Form/Console/Descriptor/Descriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@
*/
abstract class Descriptor implements DescriptorInterface
{
/** @var OutputStyle */
protected $output;
protected $type;
protected $ownOptions = [];
protected $overriddenOptions = [];
protected $parentOptions = [];
protected $extensionOptions = [];
protected $requiredOptions = [];
protected $parents = [];
protected $extensions = [];
protected OutputStyle $output;
protected array $ownOptions = [];
protected array $overriddenOptions = [];
protected array $parentOptions = [];
protected array $extensionOptions = [];
protected array $requiredOptions = [];
protected array $parents = [];
protected array $extensions = [];

public function describe(OutputInterface $output, ?object $object, array $options = []): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class AbstractRequestHandlerTestCase extends TestCase
{
protected RequestHandlerInterface $requestHandler;
protected FormFactory $factory;
protected $request;
protected mixed $request = null;
protected ServerParams $serverParams;

protected function setUp(): void
Expand Down
7 changes: 4 additions & 3 deletions src/Symfony/Component/HttpClient/Internal/AmpClientState.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,16 @@ private function getClient(array $options): array
$options['crypto_method'] && $context = $context->withMinimumVersion($options['crypto_method']);

$connector = $handleConnector = new class() implements Connector {
public $connector;
public $uri;
public DnsConnector $connector;
public string $uri;
/** @var resource|null */
public $handle;

public function connect(string $uri, ConnectContext $context = null, CancellationToken $token = null): Promise
{
$result = $this->connector->connect($this->uri ?? $uri, $context, $token);
$result->onResolve(function ($e, $socket) {
$this->handle = null !== $socket ? $socket->getResource() : false;
$this->handle = $socket?->getResource();
});

return $result;
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpClient/Internal/AmpListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class AmpListener implements EventListener
private array $info;
private array $pinSha256;
private \Closure $onProgress;
/** @var resource|null */
private $handle;

public function __construct(array &$info, array $pinSha256, \Closure $onProgress, &$handle)
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpClient/Response/AsyncContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
*/
final class AsyncContext
{
/** @var callable|null */
private $passthru;
private HttpClientInterface $client;
private ResponseInterface $response;
private array $info = [];
/** @var resource|null */
private $content;
private int $offset;

Expand Down