NGSTACK-999 upgrade bundle to ibexa version 5#8
Conversation
…structor promotion
| * @param DateTimeImmutable|string|null $date Date as a DateTime object or string in Y-m-d format | ||
| */ | ||
| public function __construct($date = null) | ||
| public function __construct(public DateTimeImmutable|string|null $date = null) |
There was a problem hiding this comment.
This is a change in behaviour. Previously $date property didn't allow strings and now it does due to constructor promotion.
We should revert back to the old way, since Value::$date still needs to be only DateTimeImmutable|null
There was a problem hiding this comment.
How didn't the $date property allow strings before? The PHPDoc contained string as one of the allowed types - that's the reason why I put that $date property can be string.
If you want, I can remove the string type both from the constructor and from the PHPDoc.
There was a problem hiding this comment.
I'm not talking about the constructor argument, but class property Value::$date, which was previously declared as public ?DateTimeImmutable $date = null;. Constructor promotion makes this property now accept strings.
There was a problem hiding this comment.
Ah okay, I get it now. I changed the $date property to not be promoted by constructor (like it was before): 3e07eaa
composer.json
Outdated
| "phpunit/phpunit": "^9.0", | ||
| "netgen/ibexa-forms-bundle": "^4.0" | ||
| "phpunit/phpunit": "^12.0", | ||
| "symfony/form": "^7.3" |
There was a problem hiding this comment.
symfony/form should go to require section, since it is not a dev dependency, right?
There was a problem hiding this comment.
Well, I would leave it in require-dev section. The Form/FieldTypeHandler/Birthday class is the only one that uses the symfony/form bundle and the only one that uses netgen/ibexa-forms-bundle. If netgen/ibexa-forms-bundle was in require-dev section, then I would put the symfony/form bundle in the same section as well.
There was a problem hiding this comment.
If that's the case, I wouldn't add symfony/form at all, since it is required implicitly by ezforms, once we upgrade it. Same goes for the other repo.
There was a problem hiding this comment.
255bc99 Removed symfony/form bundle from composer.json file
…on of 'composer.json' file and fix one test
|
Thanks @AntePrkacin ! |
Upgraded bundle to use Ibexa version 5. Also added
symfony/formbundle in 'require-dev' section because it is used byBirthdayclass. For now, I've removed thenetgen/ibexa-forms-bundlebundle because it is not yet upgraded to IbexaV5.In code, I've added a few missing return types for some methods and types for constants. Also used constructor promotion in one class.
Upgraded tests to be compatible with PHP8 and PHPUnit12 - this mainly involved upgrading the
@coversannotations to#[Covers]attributes.