Skip to content

Commit 120a08c

Browse files
committed
added property typehints
1 parent d0d26a1 commit 120a08c

46 files changed

Lines changed: 165 additions & 265 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Dibi/Bridges/Nette/DibiExtension22.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919
*/
2020
class DibiExtension22 extends Nette\DI\CompilerExtension
2121
{
22-
/** @var bool|null */
23-
private $debugMode;
22+
private ?bool $debugMode;
2423

25-
/** @var bool|null */
26-
private $cliMode;
24+
private ?bool $cliMode;
2725

2826

2927
public function __construct(bool $debugMode = null, bool $cliMode = null)

src/Dibi/Bridges/Tracy/Panel.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@ class Panel implements Tracy\IBarPanel
2222
{
2323
use Dibi\Strict;
2424

25-
/** @var int maximum SQL length */
26-
public static $maxLength = 1000;
25+
/** maximum SQL length */
26+
public static int $maxLength = 1000;
2727

28-
/** @var bool|string explain queries? */
29-
public $explain;
28+
public bool|string $explain;
3029

31-
/** @var int */
32-
public $filter;
30+
public int $filter;
3331

34-
/** @var array */
35-
private $events = [];
32+
private array $events = [];
3633

3734

3835
public function __construct($explain = true, int $filter = null)

src/Dibi/Connection.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,22 @@ class Connection implements IConnection
2222
{
2323
use Strict;
2424

25-
/** @var array of function (Event $event); Occurs after query is executed */
26-
public $onEvent = [];
25+
/** function (Event $event); Occurs after query is executed */
26+
public array $onEvent = [];
2727

28-
/** @var array Current connection configuration */
29-
private $config;
28+
/** Current connection configuration */
29+
private array $config;
3030

3131
/** @var string[] resultset formats */
32-
private $formats;
32+
private array $formats;
3333

34-
/** @var Driver|null */
35-
private $driver;
34+
private ?Driver $driver = null;
3635

37-
/** @var Translator|null */
38-
private $translator;
36+
private ?Translator $translator = null;
3937

40-
/** @var HashMap Substitutes for identifiers */
41-
private $substitutes;
38+
private HashMap $substitutes;
4239

43-
private $transactionDepth = 0;
40+
private int $transactionDepth = 0;
4441

4542

4643
/**

src/Dibi/DataSource.php

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,25 @@ class DataSource implements IDataSource
1717
{
1818
use Strict;
1919

20-
/** @var Connection */
21-
private $connection;
20+
private Connection $connection;
2221

23-
/** @var string */
24-
private $sql;
22+
private string $sql;
2523

26-
/** @var Result|null */
27-
private $result;
24+
private ?Result $result = null;
2825

29-
/** @var int|null */
30-
private $count;
26+
private ?int $count = null;
3127

32-
/** @var int|null */
33-
private $totalCount;
28+
private ?int $totalCount = null;
3429

35-
/** @var array */
36-
private $cols = [];
30+
private array $cols = [];
3731

38-
/** @var array */
39-
private $sorting = [];
32+
private array $sorting = [];
4033

41-
/** @var array */
42-
private $conds = [];
34+
private array $conds = [];
4335

44-
/** @var int|null */
45-
private $offset;
36+
private ?int $offset = null;
4637

47-
/** @var int|null */
48-
private $limit;
38+
private ?int $limit = null;
4939

5040

5141
/**

src/Dibi/Drivers/FirebirdDriver.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ class FirebirdDriver implements Dibi\Driver
3333
/** @var resource */
3434
private $connection;
3535

36-
/** @var resource|null */
36+
/** @var ?resource */
3737
private $transaction;
3838

39-
/** @var bool */
40-
private $inTransaction = false;
39+
private bool $inTransaction = false;
4140

4241

4342
/** @throws Dibi\NotSupportedException */

src/Dibi/Drivers/FirebirdReflector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ class FirebirdReflector implements Dibi\Reflector
1919
{
2020
use Dibi\Strict;
2121

22-
/** @var Dibi\Driver */
23-
private $driver;
22+
private Dibi\Driver $driver;
2423

2524

2625
public function __construct(Dibi\Driver $driver)

src/Dibi/Drivers/FirebirdResult.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ class FirebirdResult implements Dibi\ResultDriver
2323
/** @var resource */
2424
private $resultSet;
2525

26-
/** @var bool */
27-
private $autoFree = true;
26+
private bool $autoFree = true;
2827

2928

3029
/**

src/Dibi/Drivers/MySqlReflector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class MySqlReflector implements Dibi\Reflector
2020
{
2121
use Dibi\Strict;
2222

23-
/** @var Dibi\Driver */
24-
private $driver;
23+
private Dibi\Driver $driver;
2524

2625

2726
public function __construct(Dibi\Driver $driver)

src/Dibi/Drivers/MySqliDriver.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ class MySqliDriver implements Dibi\Driver
4040

4141
public const ERROR_DATA_TRUNCATED = 1265;
4242

43-
/** @var \mysqli */
44-
private $connection;
43+
private \mysqli $connection;
4544

46-
/** @var bool Is buffered (seekable and countable)? */
47-
private $buffered;
45+
/** Is buffered (seekable and countable)? */
46+
private bool $buffered = false;
4847

4948

5049
/** @throws Dibi\NotSupportedException */

src/Dibi/Drivers/MySqliResult.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ class MySqliResult implements Dibi\ResultDriver
1919
{
2020
use Dibi\Strict;
2121

22-
/** @var \mysqli_result */
23-
private $resultSet;
22+
private \mysqli_result $resultSet;
2423

25-
/** @var bool */
26-
private $autoFree = true;
24+
private bool $autoFree = true;
2725

28-
/** @var bool Is buffered (seekable and countable)? */
29-
private $buffered;
26+
/** Is buffered (seekable and countable)? */
27+
private bool $buffered;
3028

3129

3230
public function __construct(\mysqli_result $resultSet, bool $buffered)

0 commit comments

Comments
 (0)