Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
"nette/tester": "dev-master",
"mockery/mockery": ">=1.5.1",
"phpstan/extension-installer": "1.4.3",
"phpstan/phpstan": "2.1.46",
"phpstan/phpstan": "2.2.5",
"phpstan/phpstan-deprecation-rules": "2.0.4",
"phpstan/phpstan-nette": "2.0.9",
"phpstan/phpstan-nette": "2.0.12",
"phpstan/phpstan-mockery": "2.0.0",
"phpstan/phpstan-strict-rules": "2.0.10",
"phpstan/phpstan-strict-rules": "2.0.11",
"nextras/multi-query-parser": "~2.0",
"nextras/orm-phpstan": "^2.0.0",
"tracy/tracy": "~2.3"
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/NetteDI/RepositoryLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function hasRepository(string $className): bool

/**
* Returns instance of repository.
* @template R of IRepository<IEntity>
* @template R of IRepository<*>
* @param class-string<R> $className
* @return R
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Helpers/ArrayCollectionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class ArrayCollectionHelper
{
/**
* @param IRepository<IEntity> $repository
* @param IRepository<*> $repository
*/
public function __construct(
private readonly IRepository $repository,
Expand Down
1 change: 1 addition & 0 deletions src/Entity/AbstractEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ protected function initProperty(PropertyMetadata $metadata, string $name, bool $
private function createPropertyWrapper(PropertyMetadata $metadata): IProperty
{
$class = $metadata->wrapper;
assert($class !== null);
$wrapper = new $class($metadata);
assert($wrapper instanceof IProperty);

Expand Down
1 change: 1 addition & 0 deletions src/Entity/Embeddable/Embeddable.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ protected function initProperty(PropertyMetadata $metadata, string $name, bool $
private function createPropertyWrapper(PropertyMetadata $metadata): IProperty
{
$class = $metadata->wrapper;
assert($class !== null);
$wrapper = new $class($metadata);
assert($wrapper instanceof IProperty);

Expand Down
1 change: 0 additions & 1 deletion src/Entity/Reflection/ModifierParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ private function processArgs(
} elseif ($nextTokenType === Token::STRING || $nextTokenType === Token::KEYWORD) {
$value = $this->processValue($currentToken, $reflectionClass);
assert(!is_array($value));
assert($nextToken !== null);
$result[$value] = $this->processValue($nextToken, $reflectionClass);
} elseif ($nextTokenType !== null) {
throw new InvalidModifierDefinitionException("Modifier {{$modifierName}} has invalid token after =.");
Expand Down
8 changes: 4 additions & 4 deletions src/Mapper/IMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@ public function findAll(): ICollection;

/**
* Creates collection with HasOne mapper.
* @return ICollection<IEntity>
* @return ICollection<E>
*/
public function createCollectionManyHasOne(PropertyMetadata $metadata): ICollection;


/**
* Creates a collection with OneHasOneDirected mapper.
* @return ICollection<IEntity>
* @return ICollection<E>
*/
public function createCollectionOneHasOne(PropertyMetadata $metadata): ICollection;


/**
* Creates collection with ManyHasMany mapper.
* @param IMapper<IEntity> $sourceMapper
* @return ICollection<IEntity>
* @return ICollection<E>
*/
public function createCollectionManyHasMany(IMapper $sourceMapper, PropertyMetadata $metadata): ICollection;


/**
* Creates collection with OneHasMany mapper.
* @return ICollection<IEntity>
* @return ICollection<E>
*/
public function createCollectionOneHasMany(PropertyMetadata $metadata): ICollection;

Expand Down
2 changes: 1 addition & 1 deletion src/Mapper/Memory/ArrayMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class ArrayMapper implements IMapper

protected IConventions|null $conventions = null;

/** @var IRepository<IEntity>|null */
/** @var IRepository<E>|null */
private IRepository|null $repository = null;

/** @var resource|null */
Expand Down
2 changes: 1 addition & 1 deletion src/Model/IRepositoryLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function hasRepository(string $className): bool;

/**
* Returns instance of repository.
* @template T of IRepository<IEntity>
* @template T of IRepository<*>
* @param class-string<T> $className
* @return T
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Model implements IModel

/**
* Creates repository list configuration.
* @param array<string, class-string<IRepository<IEntity>>|IRepository<IEntity>> $repositories
* @param array<string, class-string<IRepository<*>>|IRepository<*>> $repositories
* @return array{
* array<class-string<IRepository<IEntity>>, true>,
* array<string, class-string<IRepository<IEntity>>>,
Expand Down
6 changes: 3 additions & 3 deletions src/Model/SimpleRepositoryLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

class SimpleRepositoryLoader implements IRepositoryLoader
{
/** @var array<class-string<IRepository<IEntity>>, IRepository<IEntity>> */
/** @var array<class-string<IRepository<*>>, IRepository<*>> */
private array $repositories = [];


/**
* @param list<IRepository<IEntity>> $repositories
* @param list<IRepository<*>> $repositories
*/
public function __construct(array $repositories)
{
Expand All @@ -33,7 +33,7 @@ public function hasRepository(string $className): bool

/**
* Returns instance of repository.
* @template T of IRepository<IEntity>
* @template T of IRepository<*>
* @param class-string<T> $className
* @return T
*/
Expand Down