Releases: Happyr/Doctrine-Specification
v2.1.0
Release 2.0.2
Changelog (since 2.0.1...2.0.2
)
- feature #305 Correct PHPStan generic annotation (@peter-gribanov)
- bug #306 Use
AbstractQuery::toIterable()
to compatible with Doctrine ORM 3.0 (@peter-gribanov) - bug #307 Revert "Correct PHPStan generic annotation" (@peter-gribanov)
- feature #308 Use
yield from
for iterate fromAbstractQuery::toIterable()
(@peter-gribanov) - bug #313 Fix tests (@peter-gribanov)
- bug #312 Fix documentation on context usage in specifications (@peter-gribanov)
- feature #315 Allow Symfony 6 (@KDederichs)
Release 2.0.1
Changelog (since 2.0.0...2.0.1
)
- bug #303 Allow always use a unique DQL alias in
DQLContextResolver
(@peter-gribanov) - bug #301 Fix problems with PHP-CS-Fixer (@peter-gribanov)
- bug #298 Prefer to use
default_repository_class
instead ofrepository_factory
(@peter-gribanov) - bug #296 Not use
BaseSpecification::getNestedContext()
method (@peter-gribanov)
Release 2.0.0
Changelog (since 1.1.3...2.0.0
)
- bug #295 Define
JOIN
before using the new alias from it (@peter-gribanov) - bug #294 Correct resolve context in
BaseSpecification
methods fromSatisfiable
interface (@peter-gribanov) - feature #29 Create
IsEmpty
filter (@peter-gribanov) - feature #292 Сreate
SelectNew
query modifier for use NEW Operator Syntax (@peter-gribanov) - bug #291 Allow use context in
Satisfiable
methods (@peter-gribanov) - bug #290 The context in
Operands
is optional and may not be specified (@peter-gribanov) - bug #289 Correct use custom context (@peter-gribanov)
- bug #288 Correct resolve DQL alias in context in
SelectEntity
(@peter-gribanov) - bug #287 Сorrect annotate
$context
argument intBaseSpecification::__construct()
(@peter-gribanov) - feature #286 Allow use
DISTINCT
in aggregate functions (@peter-gribanov) - feature #285 Сhange
CountDistinct
toCount
platform function (@peter-gribanov) - bug #284 Fix the
CONCAT
function declaration (@peter-gribanov) - feature #283 Iterate repository by specification with a real key from original query (@peter-gribanov)
- feature #282 Сorrect location of
BaseSpecification
class (@peter-gribanov) - feature #281 Group repository classes in
Repository
folder (@peter-gribanov) - feature #278 Allow use options in
TRIM()
platform functions (@peter-gribanov) - feature #273 Check single entity satisfiability (@peter-gribanov)
- bug #277 PHP Code Style Fixer does not check the code (@peter-gribanov)
- bug #272 Remove not used
Arithmetic::MOD
constant (@peter-gribanov) - bug #271 Remove deprecated
Modulo
arithmetic operand (@peter-gribanov) - feature #269 Update PHPStan 12 (@peter-gribanov)
- feature #268 Prefer composition over inheritance (@peter-gribanov)
- feature #267 Pedantic fixes (@peter-gribanov)
- feature #266 Add type hinting (@peter-gribanov)
- feature #265 Change access for exception classes (@peter-gribanov)
- bug #264 Mark the
BaseSpecification::getSpec()
method asabstract
(@peter-gribanov) - feature #263 Use variable-length argument lists (@peter-gribanov)
- bug #262 Remove
Happyr\DoctrineSpecification\Specification\Having
class (@peter-gribanov) - feature #260 Optimize build query in
AbstractJoin
query modifiers (@peter-gribanov) - feature #259 Update PHPSpec to 6.3 and PHP to 7.2 (@peter-gribanov)
- bug #258 Require Doctrine ORM 2.5 (@peter-gribanov)
- feature #251 Change access of
protected
properties toprivate
(@peter-gribanov) - bug #253 Build from GitHub CI fixes (@peter-gribanov)
- feature #250 Build from GitHub CI (@peter-gribanov)
- bug #247 Mark
LogicX
class asabstract
(@peter-gribanov) - bug #249 Remove deprecated
Bitwise
operands (@peter-gribanov) - bug #248 Mark
Comparison
class as abstract (@peter-gribanov) - feature #245 Declare strict types (@peter-gribanov)
- feature #246 Update Travis CI config and run CS test by PHP CS Fixer (@peter-gribanov)
Upgrade from 1.1 to 2.0
-
The
AbstractJoin::getJoinType()
method was removed. UseAbstractJoin::modifyJoin()
method inside. -
The
Comparison
class marked asabstract
. -
The
LogicX
class marked asabstract
. -
The
protected
properties inComparison
class marked asprivate
. -
The
protected
properties inIn
class marked asprivate
. -
The
protected
properties inGroupBy
class marked asprivate
. -
The
protected
properties inOrderBy
class marked asprivate
. -
The
protected
properties inLimit
class marked asprivate
. -
The
protected
properties inOffset
class marked asprivate
. -
The
Bitwise
operands was removed. -
The
Happyr\DoctrineSpecification\Specification\Having
class was removed, use
Happyr\DoctrineSpecification\Query\Having
instead. -
The
Happyr\DoctrineSpecification\EntitySpecificationRepository
class was removed, use
Happyr\DoctrineSpecification\Repository\EntitySpecificationRepository
instead. -
The
Happyr\DoctrineSpecification\EntitySpecificationRepositoryInterface
class was removed, use
Happyr\DoctrineSpecification\Repository\EntitySpecificationRepositoryInterface
instead. -
The
Happyr\DoctrineSpecification\EntitySpecificationRepositoryTrait
class was removed, use
Happyr\DoctrineSpecification\Repository\EntitySpecificationRepositoryTrait
instead. -
The
Happyr\DoctrineSpecification\RepositoryFactory
class was removed, use
Happyr\DoctrineSpecification\Repository\RepositoryFactory
instead. -
The
Happyr\DoctrineSpecification\BaseSpecification
class was removed, use
Happyr\DoctrineSpecification\Specification\BaseSpecification
instead. -
Removes the ability to use
array
as argument for thePlatformFunction
operand.Before:
$arguments = ['create_at', new \DateTimeImmutable()]; Spec::DATE_DIFF($arguments); Spec::fun('DATE_DIFF', $arguments); new PlatformFunction('DATE_DIFF', $arguments);
After:
$arguments = ['create_at', new \DateTimeImmutable()]; Spec::DATE_DIFF(...$arguments); Spec::fun('DATE_DIFF', ...$arguments); new PlatformFunction('DATE_DIFF', ...$arguments);
-
Removes the ability to use
array
as argument for theSelect
query modifier.Before:
$fields = ['title', 'cover']; Spec::select($fields); new Select($fields);
After:
$fields = ['title', 'cover']; Spec::select(...$fields); new Select(...$fields);
-
Removes the ability to use
array
as argument for theAddSelect
query modifier.Before:
$fields = ['title', 'cover']; Spec::addSelect($fields); new AddSelect($fields);
After:
$fields = ['title', 'cover']; Spec::addSelect(...$fields); new AddSelect(...$fields);
-
The
BaseSpecification::getSpec()
method marked asabstract
. -
The
InvalidArgumentException
class marked asfinal
. -
The
LogicException
class marked asfinal
. -
The
NonUniqueResultException
class marked asfinal
. -
The
NoResultException
class marked asfinal
. -
The
UnexpectedResultException
class marked asabstract
. -
All the filter classes marked as
final
. -
All the logic classes marked as
final
. -
All the operand classes marked as
final
. -
All the query modifier classes marked as
final
. -
All the result modifier classes marked as
final
. -
The
CountOf
class marked asfinal
. -
The
DBALTypesResolver
class marked asfinal
. -
The
ValueConverter
class marked asfinal
. -
The
EntitySpecificationRepositoryTrait::getAlias()
method returns nothing else. -
The
Operand::execute()
method was added. This method performs the necessary actions on the operand and returns the
result. It is desirable to return a scalar value so that it is compatible with other operands. -
The custom platform functions also need to be made executable and register the executor in the registry.
PlatformFunction::getExecutorRegistry()->register('POW', fn ($base, $exp) => pow($base, $exp));
-
The use of DQL aliases has been replaced with descriptions of contexts.
Before:
Spec::andX( Spec::innerJoin('contestant', 'ct'), Spec::innerJoin('contest', 'c', 'ct'), Spec::innerJoin('user', 'u', 'ct'), Spec::eq('state', State::active()->value(), 'u'), Spec::eq('enabled', true, 'c') );
After:
Spec::andX( Spec::eq('contestant.user.state', State::active()->value()), Spec::eq('contestant.contest.enabled', true) );
-
Changed behavior of DQL aliases to use context.
Before:
final class PublishedQuestionnaires extends BaseSpecification { private string $contest_alias; private string $contestant_alias; private string $user_alias; public function __construct( string $contest_alias = 'c', string $contestant_alias = 'ct', string $user_alias = 'u', ?string $dql_alias = null ) { $this->contest_alias = $contest_alias; $this->contestant_alias = $contestant_alias; $this->user_alias = $user_alias; parent::__construct($dql_alias); } /** * @return Filter|QueryModifier */ protected function getSpec() { return Spec::andX( Spec::innerJoin('contestant', $this->contestant_alias), new ContestantPublished($this->contest_alias, $this->user_alias, $this->contestant_alias) ); } } final class ContestantPublished extends BaseSpecification { private string $contest_alias; private string $user_alias; public function __construct(string $contest_alias = 'c', string $user_alias = 'u', ?string $dql_alias = null) { $this->contest_alias = $contest_alias; $this->user_alias = $user_alias; parent::__construct($dql_alias); } /** * @return Filter|QueryModifier */ protected function getSpec() { return Spec::andX( new JoinedContestant($this->contest_alias, $this->user_alias), new ContestantApproved($this->contest_alias) ); } } final class ContestantApproved extends BaseSpecification implements Satisfiable { private string $contest_alias; public function __construct(string $contest_alias = 'c', ?string $dql_alias = null) { $this->contest_alias = $contest_alias; parent::__construct($dql_alias); } /** * @return Filter|QueryModifier */ protected function getSpec()
...
Release 1.1.3
Changelog (since 1.1.2...1.1.3
)
- feature #280 Сorrect location of
BaseSpecification
class (@peter-gribanov) - feature #279 Group repository classes in
Repository
folder (@peter-gribanov) - bug #270 Modulo arithmetic operand was deprecated and will be removed in 2.0 (@peter-gribanov)
- feature #255 Build from GitHub CI (@peter-gribanov)
- bug #257 Fix BC with Doctrine ORM 2.2 (@peter-gribanov)
Release 1.1.2
Changelog (since 1.1.1...1.1.2
)
- bug #241
MemberOfX::getFilter()
andLogicX::getFilter()
should return astring
(@peter-gribanov) - bug #243 Disable
no_superfluous_phpdoc_tags_symfony
in Style CI config (@peter-gribanov) - bug #242 Remove
short_array_syntax
CS fixer (@peter-gribanov)
Release 1.1.1
Changelog (since 1.1.0...1.1.1
)
- bug #239 Convert all arguments to operands (@peter-gribanov)
- bug #240 Remove build badge of SensioLabsInsight linked to different project (@peter-gribanov)
Release 1.1.0
Changelog (since 1.0.6...1.1.0
)
- feature #214 Add a deprecated comments and log messages for next major release (@peter-gribanov)
- bug #236 Disable
single_line_throw
andno_superfluous_phpdoc_tags
rules (@peter-gribanov) - bug #235 Update
master
from1.0
(@peter-gribanov) - feature #229 Add header comment in all project files (@peter-gribanov)
- feature #230 Run PHPStan for low version of PHP (@peter-gribanov)
- feature #228 Allow customize PHP-CS-Fixer configuration (@peter-gribanov)
- bug #227 Optimize convert several arguments to
Operand
(@peter-gribanov) - bug #224 Remove not used vars in
RoundDateTimeSpec
(@peter-gribanov) - bug #222
RoundDateTimeSpec
must extendsObjectBehavior
(@peter-gribanov) - bug #221 Change
branch-alias
formaster
to1.1-dev
(@peter-gribanov) - feature #220 Use short array syntax recommended by PSR-2 (@peter-gribanov)
- feature #218 Add
php-cs-fixer
to control the code style during development (@peter-gribanov) - bug #217 Fix PHPStan errors for level 7 (@peter-gribanov)
- bug #216 Fix PHPStan errors for level 6 (@peter-gribanov)
- bug #215 Fix PHPStan errors for level 5 (@peter-gribanov)
- bug #213 Fix PHPStan errors for level 3 (@peter-gribanov)
- bug #212 Call to an undefined method
DateTimeInterface::setTimestamp()
. (@peter-gribanov) - feature #211 Test project by PHPStan (@peter-gribanov)
Release 1.0.6
Changelog (since 1.0.5...1.0.6
)
- bug #234 Empty filter (@peter-gribanov)
- feature #231 Add a note on the repository trait (@kix)
Release 1.0.5
Changelog (since 1.0.4...1.0.5
)
- feature #209 Add
Distinct
query modifier andCountDistinct
operand (@peter-gribanov)