Skip to content

Commit

Permalink
Update the comments of the method createQueryTo in ActiveRecordFactor…
Browse files Browse the repository at this point in the history
…y so that the IDE can automatically identify the specific class of ActiveRecord
  • Loading branch information
niqingyang committed Jan 2, 2024
1 parent 491e8f2 commit 6ce2ce3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/ActiveQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ class ActiveQuery extends Query implements ActiveQueryInterface
private array $joinWith = [];
private ActiveRecordInterface|null $arInstance = null;

/**
* @param string $arClass
* @param ConnectionInterface $db
* @param ActiveRecordFactory|null $arFactory
* @param string $tableName
*
* @psalm-template T of ActiveRecordInterface
* @psalm-param class-string<T> $arClass
*/
final public function __construct(
protected string $arClass,
protected ConnectionInterface $db,
Expand Down
3 changes: 0 additions & 3 deletions src/ActiveRecordFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ public function __construct(private Factory $factory)
* @throws NotInstantiableException
* @return ActiveRecordInterface
*
* @template T of ActiveRecordInterface
* @template-typeof T $arClass
* @psalm-template T of ActiveRecordInterface
* @psalm-param class-string<T> $arClass
* @psalm-assert class-string<T> $arClass
* @psalm-return T
*/
public function createAR(
Expand Down

0 comments on commit 6ce2ce3

Please sign in to comment.