Skip to content

Commit

Permalink
@var class-string
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Oct 8, 2024
1 parent 3aa9f75 commit 0b492e2
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Builder
*/
private ClassMetadata $class;

/** @phpstan-var class-string */
/** @var class-string */
private ?string $hydrationClass = null;

/**
Expand Down
8 changes: 4 additions & 4 deletions lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@
* READ-ONLY: The name of the document class.
*
* @var string
* @phpstan-var class-string<T>
* @var class-string<T>
*/
public $name;

Expand All @@ -567,7 +567,7 @@
* as {@link $documentName}.
*
* @var string
* @phpstan-var class-string
* @var class-string
*/
public $rootDocumentName;

Expand All @@ -576,7 +576,7 @@
* (Optional).
*
* @var string|null
* @phpstan-var class-string|null
* @var class-string|null
*/
public $customRepositoryClassName;

Expand Down Expand Up @@ -681,7 +681,7 @@
* @see discriminatorField
*
* @var string|null
* @phpstan-var class-string|null
* @var class-string|null
*/
public $discriminatorValue;

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Query/ReferencePrimer.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function primeReferences(ClassMetadata $class, $documents, string $fieldN
}
}

/** @phpstan-var class-string $className */
/** @var class-string $className */
foreach ($groupedIds as $className => $ids) {
$refClass = $this->dm->getClassMetadata($className);
call_user_func($primer, $this->dm, $refClass, array_values($ids), $hints);
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Repository/DocumentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DocumentRepository implements ObjectRepository, Selectable
{
/**
* @var string
* @phpstan-var class-string<T>
* @var class-string<T>
*/
protected $documentName;

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,7 @@ public function getOrCreateDocument(string $className, array $data, array &$hint
}

if ($discriminatorValue !== null) {
/** @phpstan-var class-string<T> $className */
/** @var class-string<T> $className */
$className = $class->discriminatorMap[$discriminatorValue] ?? $discriminatorValue;

$class = $this->dm->getClassMetadata($className);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function testPostCollectionLoad(): void

class MyEventListener
{
/** @phpstan-var array<string, list<class-string>> */
/** @var array<string, list<class-string>> */
public array $called = [];

/** @param array{LifecycleEventArgs} $args */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class GH1152Parent
#[ODM\EmbeddedDocument]
class GH1152Child
{
/** @phpstan-var array{0: AssociationFieldMapping, 1: object|null, 2: string}|null */
/** @var array{0: AssociationFieldMapping, 1: object|null, 2: string}|null */
public $parentAssociation;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ private function getRepository(string $className = File::class): GridFSRepositor

assert($repository instanceof GridFSRepository);

/** @phpstan-var GridFSRepository<T> */
/** @var GridFSRepository<T> */

Check failure on line 310 in tests/Doctrine/ODM/MongoDB/Tests/Repository/DefaultGridFSRepositoryTest.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (8.3)

Invalid inline documentation comment format "@var GridFSRepository<T>", expected "@var type $variableName Optional description".
return $repository;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Doctrine/ODM/MongoDB/Tests/SchemaManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*/
class SchemaManagerTest extends BaseTestCase
{
/** @phpstan-var list<class-string> */
/** @var list<class-string> */
private array $indexedClasses = [
CmsAddress::class,
CmsArticle::class,
Expand All @@ -63,13 +63,13 @@ class SchemaManagerTest extends BaseTestCase
ShardedOneWithDifferentKey::class,
];

/** @phpstan-var list<class-string> */
/** @var list<class-string> */
private array $searchIndexedClasses = [
CmsAddress::class,
CmsArticle::class,
];

/** @phpstan-var list<class-string> */
/** @var list<class-string> */
private array $views = [
UserName::class,
];
Expand Down

0 comments on commit 0b492e2

Please sign in to comment.