From 9dbcb4f5c5ba3d41804137ae408f6ac280e3806d Mon Sep 17 00:00:00 2001 From: GitHub Date: Fri, 21 Oct 2022 08:41:38 +0000 Subject: [PATCH] Make strict typing --- src/Models/Channels/ChannelsRepository.php | 7 ++----- src/Models/Channels/Controls/ControlsRepository.php | 7 ++----- .../Channels/Properties/PropertiesRepository.php | 13 +++++-------- src/Models/Connectors/ConnectorsRepository.php | 13 +++++-------- .../Connectors/Controls/ControlsRepository.php | 7 ++----- .../Connectors/Properties/PropertiesRepository.php | 13 +++++-------- .../Devices/Attributes/AttributesRepository.php | 7 ++----- src/Models/Devices/Controls/ControlsRepository.php | 7 ++----- src/Models/Devices/DevicesRepository.php | 13 +++++-------- .../Devices/Properties/PropertiesRepository.php | 13 +++++-------- 10 files changed, 35 insertions(+), 65 deletions(-) diff --git a/src/Models/Channels/ChannelsRepository.php b/src/Models/Channels/ChannelsRepository.php index e147c348..07cf9422 100644 --- a/src/Models/Channels/ChannelsRepository.php +++ b/src/Models/Channels/ChannelsRepository.php @@ -91,17 +91,14 @@ public function getResultSet( } /** - * @param class-string $type + * @param class-string $type * * @return ORM\EntityRepository */ private function getRepository(string $type = Entities\Channels\Channel::class): ORM\EntityRepository { if ($this->repository === null) { - /** @var ORM\EntityRepository $repository */ - $repository = $this->managerRegistry->getRepository($type); - - $this->repository = $repository; + $this->repository = $this->managerRegistry->getRepository($type); } return $this->repository; diff --git a/src/Models/Channels/Controls/ControlsRepository.php b/src/Models/Channels/Controls/ControlsRepository.php index 4ebd8b16..f41a13be 100644 --- a/src/Models/Channels/Controls/ControlsRepository.php +++ b/src/Models/Channels/Controls/ControlsRepository.php @@ -91,17 +91,14 @@ public function getResultSet( } /** - * @param class-string $type + * @param class-string $type * * @return ORM\EntityRepository */ private function getRepository(string $type = Entities\Channels\Controls\Control::class): ORM\EntityRepository { if ($this->repository === null) { - /** @var ORM\EntityRepository $repository */ - $repository = $this->managerRegistry->getRepository($type); - - $this->repository = $repository; + $this->repository = $this->managerRegistry->getRepository($type); } return $this->repository; diff --git a/src/Models/Channels/Properties/PropertiesRepository.php b/src/Models/Channels/Properties/PropertiesRepository.php index be083a4d..d9ce2873 100644 --- a/src/Models/Channels/Properties/PropertiesRepository.php +++ b/src/Models/Channels/Properties/PropertiesRepository.php @@ -46,7 +46,7 @@ public function __construct(private readonly Persistence\ManagerRegistry $manage } /** - * @param class-string $type + * @phpstan-param class-string $type * * @throws DoctrineOrmQueryExceptions\InvalidStateException * @throws DoctrineOrmQueryExceptions\QueryException @@ -60,7 +60,7 @@ public function findOneBy( } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @phpstan-return Array * @@ -86,7 +86,7 @@ public function findAllBy( } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @phpstan-return DoctrineOrmQuery\ResultSet * @@ -104,17 +104,14 @@ public function getResultSet( } /** - * @param class-string $type + * @param class-string $type * * @return ORM\EntityRepository */ private function getRepository(string $type): ORM\EntityRepository { if (!isset($this->repository[$type])) { - /** @var ORM\EntityRepository $repository */ - $repository = $this->managerRegistry->getRepository($type); - - $this->repository[$type] = $repository; + $this->repository[$type] = $this->managerRegistry->getRepository($type); } return $this->repository[$type]; diff --git a/src/Models/Connectors/ConnectorsRepository.php b/src/Models/Connectors/ConnectorsRepository.php index 3fcd6a0c..06d56947 100644 --- a/src/Models/Connectors/ConnectorsRepository.php +++ b/src/Models/Connectors/ConnectorsRepository.php @@ -46,7 +46,7 @@ public function __construct(private readonly Persistence\ManagerRegistry $manage } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @throws DoctrineOrmQueryExceptions\InvalidStateException * @throws DoctrineOrmQueryExceptions\QueryException @@ -60,7 +60,7 @@ public function findOneBy( } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @phpstan-return Array * @@ -86,7 +86,7 @@ public function findAllBy( } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @phpstan-return DoctrineOrmQuery\ResultSet * @@ -104,17 +104,14 @@ public function getResultSet( } /** - * @param class-string $type + * @param class-string $type * * @return ORM\EntityRepository */ private function getRepository(string $type): ORM\EntityRepository { if (!isset($this->repository[$type])) { - /** @var ORM\EntityRepository $repository */ - $repository = $this->managerRegistry->getRepository($type); - - $this->repository[$type] = $repository; + $this->repository[$type] = $this->managerRegistry->getRepository($type); } return $this->repository[$type]; diff --git a/src/Models/Connectors/Controls/ControlsRepository.php b/src/Models/Connectors/Controls/ControlsRepository.php index de5da315..410aa296 100644 --- a/src/Models/Connectors/Controls/ControlsRepository.php +++ b/src/Models/Connectors/Controls/ControlsRepository.php @@ -91,17 +91,14 @@ public function getResultSet( } /** - * @param class-string $type + * @param class-string $type * * @return ORM\EntityRepository */ private function getRepository(string $type = Entities\Connectors\Controls\Control::class): ORM\EntityRepository { if ($this->repository === null) { - /** @var ORM\EntityRepository $repository */ - $repository = $this->managerRegistry->getRepository($type); - - $this->repository = $repository; + $this->repository = $this->managerRegistry->getRepository($type); } return $this->repository; diff --git a/src/Models/Connectors/Properties/PropertiesRepository.php b/src/Models/Connectors/Properties/PropertiesRepository.php index 5755147e..f793502a 100644 --- a/src/Models/Connectors/Properties/PropertiesRepository.php +++ b/src/Models/Connectors/Properties/PropertiesRepository.php @@ -46,7 +46,7 @@ public function __construct(private readonly Persistence\ManagerRegistry $manage } /** - * @param class-string $type + * @phpstan-param class-string $type * * @throws DoctrineOrmQueryExceptions\InvalidStateException * @throws DoctrineOrmQueryExceptions\QueryException @@ -60,7 +60,7 @@ public function findOneBy( } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @phpstan-return Array * @@ -86,7 +86,7 @@ public function findAllBy( } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @phpstan-return DoctrineOrmQuery\ResultSet * @@ -104,17 +104,14 @@ public function getResultSet( } /** - * @param class-string $type + * @param class-string $type * * @return ORM\EntityRepository */ private function getRepository(string $type): ORM\EntityRepository { if (!isset($this->repository[$type])) { - /** @var ORM\EntityRepository $repository */ - $repository = $this->managerRegistry->getRepository($type); - - $this->repository[$type] = $repository; + $this->repository[$type] = $this->managerRegistry->getRepository($type); } return $this->repository[$type]; diff --git a/src/Models/Devices/Attributes/AttributesRepository.php b/src/Models/Devices/Attributes/AttributesRepository.php index 20149011..ec1788ba 100644 --- a/src/Models/Devices/Attributes/AttributesRepository.php +++ b/src/Models/Devices/Attributes/AttributesRepository.php @@ -91,17 +91,14 @@ public function getResultSet( } /** - * @param class-string $type + * @param class-string $type * * @return ORM\EntityRepository */ private function getRepository(string $type = Entities\Devices\Attributes\Attribute::class): ORM\EntityRepository { if ($this->repository === null) { - /** @var ORM\EntityRepository $repository */ - $repository = $this->managerRegistry->getRepository($type); - - $this->repository = $repository; + $this->repository = $this->managerRegistry->getRepository($type); } return $this->repository; diff --git a/src/Models/Devices/Controls/ControlsRepository.php b/src/Models/Devices/Controls/ControlsRepository.php index 7f6e7c00..b3a4e811 100644 --- a/src/Models/Devices/Controls/ControlsRepository.php +++ b/src/Models/Devices/Controls/ControlsRepository.php @@ -91,17 +91,14 @@ public function getResultSet( } /** - * @param class-string $type + * @param class-string $type * * @return ORM\EntityRepository */ private function getRepository(string $type = Entities\Devices\Controls\Control::class): ORM\EntityRepository { if ($this->repository === null) { - /** @var ORM\EntityRepository $repository */ - $repository = $this->managerRegistry->getRepository($type); - - $this->repository = $repository; + $this->repository = $this->managerRegistry->getRepository($type); } return $this->repository; diff --git a/src/Models/Devices/DevicesRepository.php b/src/Models/Devices/DevicesRepository.php index 0d5114df..8c04717b 100644 --- a/src/Models/Devices/DevicesRepository.php +++ b/src/Models/Devices/DevicesRepository.php @@ -46,7 +46,7 @@ public function __construct(private readonly Persistence\ManagerRegistry $manage } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @throws DoctrineOrmQueryExceptions\InvalidStateException * @throws DoctrineOrmQueryExceptions\QueryException @@ -60,7 +60,7 @@ public function findOneBy( } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @phpstan-return Array * @@ -86,7 +86,7 @@ public function findAllBy( } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @phpstan-return DoctrineOrmQuery\ResultSet * @@ -104,17 +104,14 @@ public function getResultSet( } /** - * @param class-string $type + * @param class-string $type * * @return ORM\EntityRepository */ private function getRepository(string $type): ORM\EntityRepository { if (!isset($this->repository[$type])) { - /** @var ORM\EntityRepository $repository */ - $repository = $this->managerRegistry->getRepository($type); - - $this->repository[$type] = $repository; + $this->repository[$type] = $this->managerRegistry->getRepository($type); } return $this->repository[$type]; diff --git a/src/Models/Devices/Properties/PropertiesRepository.php b/src/Models/Devices/Properties/PropertiesRepository.php index 3a981043..baf7ceb2 100644 --- a/src/Models/Devices/Properties/PropertiesRepository.php +++ b/src/Models/Devices/Properties/PropertiesRepository.php @@ -46,7 +46,7 @@ public function __construct(private readonly Persistence\ManagerRegistry $manage } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @throws DoctrineOrmQueryExceptions\InvalidStateException * @throws DoctrineOrmQueryExceptions\QueryException @@ -60,7 +60,7 @@ public function findOneBy( } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @phpstan-return Array * @@ -86,7 +86,7 @@ public function findAllBy( } /** - * @phpstan-param class-string $type + * @phpstan-param class-string $type * * @phpstan-return DoctrineOrmQuery\ResultSet * @@ -104,17 +104,14 @@ public function getResultSet( } /** - * @param class-string $type + * @param class-string $type * * @return ORM\EntityRepository */ private function getRepository(string $type): ORM\EntityRepository { if (!isset($this->repository[$type])) { - /** @var ORM\EntityRepository $repository */ - $repository = $this->managerRegistry->getRepository($type); - - $this->repository[$type] = $repository; + $this->repository[$type] = $this->managerRegistry->getRepository($type); } return $this->repository[$type];