Skip to content

Commit

Permalink
readonly properties
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 3, 2024
1 parent 62c4fc6 commit 632a776
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/Dibi/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
class DataSource implements IDataSource
{
private Connection $connection;
private string $sql;
private readonly Connection $connection;
private readonly string $sql;
private ?Result $result = null;
private ?int $count = null;
private ?int $totalCount = null;
Expand Down
6 changes: 3 additions & 3 deletions src/Dibi/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class Event
TRANSACTION = 448, // BEGIN | COMMIT | ROLLBACK
ALL = 1023;

public Connection $connection;
public readonly Connection $connection;
public int $type;
public string $sql;
public Result|DriverException|null $result;
public readonly string $sql;
public readonly Result|DriverException|null $result;
public float $time;
public ?int $count = null;
public ?array $source = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class Expression
{
private array $values;
private readonly array $values;


public function __construct(...$values)
Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Fluent.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Fluent implements IDataSource
'RIGHT JOIN' => 'FROM',
];

private Connection $connection;
private readonly Connection $connection;
private array $setups = [];
private ?string $command = null;
private array $clauses = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Literal.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class Literal
{
private string $value;
private readonly string $value;


public function __construct($value)
Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Reflection/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class Column
{
public function __construct(
private ?Dibi\Reflector $reflector,
private readonly ?Dibi\Reflector $reflector,
private array $info,
) {
}
Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Reflection/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Database


public function __construct(
private Dibi\Reflector $reflector,
private readonly Dibi\Reflector $reflector,
private ?string $name = null,
) {
}
Expand Down
4 changes: 2 additions & 2 deletions src/Dibi/Reflection/ForeignKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
class ForeignKey
{
public function __construct(
private string $name,
private array $references,
private readonly string $name,
private readonly array $references,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Reflection/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class Index
{
public function __construct(
private array $info,
private readonly array $info,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Reflection/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Result


public function __construct(
private Dibi\ResultDriver $driver,
private readonly Dibi\ResultDriver $driver,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Reflection/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
class Table
{
private Dibi\Reflector $reflector;
private readonly Dibi\Reflector $reflector;
private string $name;
private bool $view;

Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/ResultIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ResultIterator implements \Iterator, \Countable


public function __construct(
private Result $result,
private readonly Result $result,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Dibi/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
final class Translator
{
private Connection $connection;
private Driver $driver;
private readonly Connection $connection;
private readonly Driver $driver;
private int $cursor = 0;
private array $args;

Expand Down

0 comments on commit 632a776

Please sign in to comment.