Skip to content
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

Added readonly #1128

Closed
wants to merge 1 commit into from
Closed
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: 1 addition & 1 deletion src/Column/Action/Confirmation/StringConfirmation.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
final class StringConfirmation implements IConfirmation
{

public function __construct(private string $question, private ?string $placeholderName = null)
public function __construct(private readonly string $question, private readonly ?string $placeholderName = null)
{
}

Expand Down
6 changes: 5 additions & 1 deletion src/Components/DatagridPaginator/DatagridPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ class DatagridPaginator extends Control

private ?string $templateFile = null;

public function __construct(private Translator $translator, private string $iconPrefix = 'fa fa-', private string $btnSecondaryClass = 'btn-default btn-secondary')
public function __construct(
private readonly Translator $translator,
private readonly string $iconPrefix = 'fa fa-',
private readonly string $btnSecondaryClass = 'btn-default btn-secondary'
)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/DataSource/ElasticsearchDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ElasticsearchDataSource extends FilterableDataSource implements IDataSourc
/** @var callable */
private $rowFactory;

public function __construct(private Client $client, string $indexName, ?callable $rowFactory = null)
public function __construct(private readonly Client $client, string $indexName, ?callable $rowFactory = null)
{
$this->searchParamsBuilder = new SearchParamsBuilder($indexName);

Expand Down
2 changes: 1 addition & 1 deletion src/DataSource/SearchParamsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class SearchParamsBuilder

private array $idsQueries = [];

public function __construct(private string $indexName)
public function __construct(private readonly string $indexName)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Status/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Option

protected ?IConfirmation $confirmation = null;

public function __construct(private Datagrid $grid, protected ColumnStatus $columnStatus, protected mixed $value, protected string $text)
public function __construct(private readonly Datagrid $grid, protected ColumnStatus $columnStatus, protected mixed $value, protected string $text)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Sorting.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class Sorting
/**
* @param mixed[]|string[] $sort
*/
public function __construct(private array $sort, ?callable $sortCallback = null)
public function __construct(private readonly array $sort, ?callable $sortCallback = null)
{
$this->sortCallback = $sortCallback;
}
Expand Down
Loading