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: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [6.2.0] - 2026-02-12
[6.2.0]: https://github.com/eureka-framework/component-validation/compare/6.1.0...6.2.0
### Changed
- GenericEntity data now accept mixed rather than limited types


## [6.1.0] - 2026-01-05
[6.1.0]: https://github.com/eureka-framework/component-validation/compare/6.0.0...6.1.0
### Added
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
},

"require-dev": {
"friendsofphp/php-cs-fixer": "^3.92.4",
"phpstan/phpstan": "^2.1.33",
"phpstan/phpstan-phpunit": "^2.0.11",
"phpstan/phpstan-strict-rules": "^2.0.7",
"phpunit/phpcov": "^11.0.3",
"phpunit/phpunit": "^12.5.4",
"friendsofphp/php-cs-fixer": "^3.94.0",
"phpstan/phpstan": "^2.1.39",
"phpstan/phpstan-phpunit": "^2.0.15",
"phpstan/phpstan-strict-rules": "^2.0.10",
"phpunit/phpcov": "^11.0.4",
"phpunit/phpunit": "^12.5.11",
"shipmonk/composer-dependency-analyser": "^1.8.4"
}
}
14 changes: 7 additions & 7 deletions src/Entity/GenericEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GenericEntity
/** @var string[] $errors */
private array $errors = [];

/** @var array<string, int|float|bool|string|null> $data */
/** @var array<string, mixed> $data */
protected array $data = [];

/** @var array<string, array<string, array<string, int|float|bool|string|null>|int|float|bool|string|null>> $validatorConfig Validator config
Expand All @@ -39,7 +39,7 @@ class GenericEntity
*
* @param ValidatorFactoryInterface $validatorFactory
* @param array<string, array<string, array<string, int|float|bool|string|null>|int|float|bool|string|null>> $validatorConfig
* @param array<string, int|float|bool|string|null> $data
* @param array<string, mixed> $data
*/
public function __construct(ValidatorFactoryInterface $validatorFactory, array $validatorConfig, array $data = [])
{
Expand Down Expand Up @@ -83,7 +83,7 @@ public function getErrors(): array
}

/**
* @param array<string, int|float|bool|string|null> $data
* @param array<string, mixed> $data
* @return $this
*/
public function setFromArray(array $data): self
Expand All @@ -102,10 +102,10 @@ public function setFromArray(array $data): self
/**
* Magic method to have getters & setters for generic entity.
*
* @param array<int, int|float|bool|string|null> $arguments
* @param array<int, mixed> $arguments
* @throws \LogicException
*/
public function __call(string $name, array $arguments): self|int|float|bool|string|null
public function __call(string $name, array $arguments): mixed
{
$prefix3Chars = \substr($name, 0, 3);
$prefix2Chars = \substr($name, 0, 2);
Expand All @@ -118,7 +118,7 @@ public function __call(string $name, array $arguments): self|int|float|bool|stri
};
}

protected function set(string $name, int|float|bool|string|null $value): self
protected function set(string $name, mixed $value): self
{
$name = self::toPascalCase($name);

Expand All @@ -137,7 +137,7 @@ protected function set(string $name, int|float|bool|string|null $value): self
return $this;
}

protected function get(string $name): int|float|bool|string|null
protected function get(string $name): mixed
{
$name = self::toPascalCase($name);

Expand Down