Skip to content

Commit

Permalink
Add readonly modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
ElisDN committed Jan 13, 2025
1 parent c1e87f1 commit 1582074
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/components/AuthIdentity.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use yii\base\NotSupportedException;
use yii\web\IdentityInterface;

final class AuthIdentity implements IdentityInterface
final readonly class AuthIdentity implements IdentityInterface
{
private int $id;

Expand Down
2 changes: 1 addition & 1 deletion src/components/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* @template T
*/
final class DataProvider
final readonly class DataProvider
{
private DataProviderInterface $origin;

Expand Down
2 changes: 1 addition & 1 deletion src/components/SimpleCacheAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Psr\SimpleCache\CacheInterface;
use yii\caching\CacheInterface as YiiCacheInterface;

final class SimpleCacheAdapter implements CacheInterface
final readonly class SimpleCacheAdapter implements CacheInterface
{
private YiiCacheInterface $cache;

Expand Down
2 changes: 1 addition & 1 deletion src/components/module/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @psalm-type ModuleDefinition = array{class?: string}
* @psalm-type ModuleDefinitions = array<string, ModuleDefinition>
*/
final class Modules
final readonly class Modules
{
private Application $app;

Expand Down
2 changes: 1 addition & 1 deletion src/components/module/admin/AdminAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use yii\web\User;

final class AdminAccess
final readonly class AdminAccess
{
private User $user;

Expand Down
2 changes: 1 addition & 1 deletion src/components/module/admin/AdminDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use app\components\module\Modules;

final class AdminDashboard
final readonly class AdminDashboard
{
private AdminAccess $access;
private Modules $modules;
Expand Down
2 changes: 1 addition & 1 deletion src/components/module/admin/AdminMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use app\components\module\Modules;

final class AdminMenu
final readonly class AdminMenu
{
private Modules $modules;

Expand Down
2 changes: 1 addition & 1 deletion src/components/module/admin/AdminNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use app\components\module\Modules;

final class AdminNotifications
final readonly class AdminNotifications
{
private Modules $modules;

Expand Down
5 changes: 1 addition & 4 deletions src/components/module/routes/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

namespace app\components\module\routes;

/**
* @psalm-immutable
*/
final class Group
final readonly class Group
{
public array $rules;
public int $priority;
Expand Down
2 changes: 1 addition & 1 deletion src/components/module/routes/RoutesFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use app\components\module\Modules;
use RuntimeException;

final class RoutesFetcher
final readonly class RoutesFetcher
{
private Modules $modules;

Expand Down
5 changes: 1 addition & 4 deletions src/components/module/sitemap/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@

use Webmozart\Assert\Assert;

/**
* @psalm-immutable
*/
final class Group
final readonly class Group
{
public string $name;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/module/sitemap/GroupsFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use app\components\module\Modules;
use RuntimeException;

final class GroupsFetcher
final readonly class GroupsFetcher
{
private Modules $modules;

Expand Down
5 changes: 1 addition & 4 deletions src/components/module/sitemap/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@

use Webmozart\Assert\Assert;

/**
* @psalm-immutable
*/
final class Item
final readonly class Item
{
public string $url;
public ?string $label;
Expand Down
5 changes: 1 addition & 4 deletions src/components/module/sitemap/Set.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

namespace app\components\module\sitemap;

/**
* @psalm-immutable
*/
final class Set
final readonly class Set
{
/**
* @var Group[]
Expand Down
2 changes: 1 addition & 1 deletion src/components/module/sitemap/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use DateTimeImmutable;
use Webmozart\Assert\Assert;

final class Xml
final readonly class Xml
{
public const string ALWAYS = 'always';
public const string HOURLY = 'hourly';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/edu/components/api/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestFactoryInterface;

final class Api
final readonly class Api
{
private ClientInterface $client;
private RequestFactoryInterface $factory;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/edu/components/api/client/Cached.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Psr\Http\Message\ResponseInterface;
use Psr\SimpleCache\CacheInterface;

final class Cached implements ClientInterface
final readonly class Cached implements ClientInterface
{
private ClientInterface $next;
private CacheInterface $cache;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/edu/components/api/client/Muted.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Psr\Http\Message\ResponseInterface;
use yii\base\ErrorHandler;

final class Muted implements ClientInterface
final readonly class Muted implements ClientInterface
{
private ClientInterface $next;
private ErrorHandler $handler;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/partner/model/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace app\modules\partner\model;

final class Item
final readonly class Item
{
public string $title;
public string $url;
Expand Down

0 comments on commit 1582074

Please sign in to comment.