Skip to content

Commit

Permalink
update phpstan to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and hrach committed Dec 18, 2024
1 parent 891819a commit 689d224
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
"nette/tester": "~2.5",
"mockery/mockery": ">=1.5.1",
"phpstan/extension-installer": "1.4.3",
"phpstan/phpstan": "1.12.12",
"phpstan/phpstan-deprecation-rules": "1.2.1",
"phpstan/phpstan-nette": "1.3.8",
"phpstan/phpstan-mockery": "1.1.3",
"phpstan/phpstan-strict-rules": "1.6.1",
"phpstan/phpstan": "2.0.4",
"phpstan/phpstan-deprecation-rules": "2.0.1",
"phpstan/phpstan-nette": "2.0.1",
"phpstan/phpstan-mockery": "2.0.0",
"phpstan/phpstan-strict-rules": "2.0.1",
"nextras/multi-query-parser": "~1.0",
"nextras/orm-phpstan": "^1.0.1",
"nextras/orm-phpstan": "^2.0.0",
"tracy/tracy": "~2.3"
},
"autoload": {
Expand Down
6 changes: 3 additions & 3 deletions tests/cases/unit/Collection/ArrayCollectionTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class ArrayCollectionTest extends TestCase
$this->e(Book::class, ['title' => 'd', 'printedAt' => new DateTime('2017-01-01 10:00:00')]),
];

/** @var Book[]|ArrayCollection<Book> */
/** @var ArrayCollection<Book> */
$collection = new ArrayCollection($books, $this->orm->books);
$collection = $collection->orderBy('printedAt', ICollection::DESC_NULLS_LAST);

Expand Down Expand Up @@ -208,7 +208,7 @@ class ArrayCollectionTest extends TestCase


/**
* @return array{ICollection<Author>|Author[], Author[], Book[]}
* @return array{ICollection<Author>, Author[], Book[]}
*/
private function createCollection(): array
{
Expand All @@ -225,7 +225,7 @@ class ArrayCollectionTest extends TestCase
$this->e(Book::class, ['title' => 'Valyria 3', 'author' => $authors[2]]),
];

/** @var ICollection<Author>|Author[] $collection */
/** @var ICollection<Author> $collection */
$collection = new ArrayCollection($authors, $this->orm->authors);
return [$collection, $authors, $books];
}
Expand Down
7 changes: 6 additions & 1 deletion tests/cases/unit/Entity/AbstractEntity.is_modified.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ use Tester\Assert;
require_once __DIR__ . '/../../../bootstrap.php';


/**
* @property int $id {primary}
* @property string $name
* @property int $age
*/
class DataEntityFragmentIsModifiedTest extends AbstractEntity
{
public function __construct(EntityMetadata $metadata)
Expand Down Expand Up @@ -88,7 +93,7 @@ class AbstractEntityIsModifiedTest extends TestCase
Assert::false($entity->isModified());
Assert::false($entity->isModified('age'));

$entity->setValue('age', 20);
$entity->setValue('age', 20); // @phpstan-ignore nextrasOrm.propertyNotFound

Assert::true($entity->isModified());
Assert::true($entity->isModified('age'));
Expand Down
3 changes: 1 addition & 2 deletions tests/inc/model/book/BooksMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
*/
final class BooksMapper extends DbalMapper
{
/** @return Book[]|ICollection<Book> */
/** @return ICollection<Book> */
public function findBooksWithEvenId(): ICollection
{
return $this->toCollection($this->builder()->where('id % 2 = 0'));
}


/** @return Book|null */
public function findFirstBook(): ?Book
{
return $this->toEntity($this->builder()->where('id = 1'));
Expand Down
2 changes: 1 addition & 1 deletion tests/inc/model/timeSeries/TimeSeriesRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


/**
* @extends Repository<Log>
* @extends Repository<TimeSeries>
*/
final class TimeSeriesRepository extends Repository
{
Expand Down

0 comments on commit 689d224

Please sign in to comment.