[WiP] IBX-9727: Fixed strict types of SPI field type layer#626
Draft
alongosz wants to merge 78 commits intoibx-9727-strict-types-core-imaginefrom
Draft
[WiP] IBX-9727: Fixed strict types of SPI field type layer#626alongosz wants to merge 78 commits intoibx-9727-strict-types-core-imaginefrom
alongosz wants to merge 78 commits intoibx-9727-strict-types-core-imaginefrom
Conversation
* Added missing strict type hints to \Ibexa\Core\IO\IOServiceInterface, aligned and fixed related codebase.
* Added missing strict type hints and improved \Ibexa\Bundle\IO\EventListener\StreamFileListener
Co-Authored-By: Adam Wójs <adamwojs@users.noreply.github.com>
|
dd6f888 to
5a1342f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Caution
ATM depends on #619
Related PRs:
Description:
Added strict type hints to field type layer (contracts and implementation).
For now this is just a preview as it's not finished yet. Targeting #619 to have better clarity overall what has been done regarding IBX-9727 and what's still missing.
For QA:
Sanity checks, regression build.
Documentation:
Breaking changes
\Ibexa\Contracts\Core\FieldType\FieldType::validateFieldSettingscontract now expects its first argument to beof an
array<string, mixed>type.\Ibexa\Contracts\Core\FieldType\FieldType::getValidatorConfigurationSchemacontract returns now strictarrayandhints a hash map (
array<string, mixed>) as its shape.\Ibexa\Contracts\Core\FieldType\FieldType::getSettingsSchemacontract returns now strictarrayand hits a hashmap (
array<string, mixed>) as its shape.\Ibexa\Contracts\Core\FieldType\FieldType::applyDefaultSettingscontract now expects its first argument to be of anarray<string, mixed>type.\Ibexa\Contracts\Core\FieldType\FieldType::isSearchablecontract returns now strictbool.\Ibexa\Contracts\Core\FieldType\FieldType::isSingularcontract returns now strictbool.\Ibexa\Contracts\Core\FieldType\FieldType::onlyEmptyInstancecontract returns now strictbool.\Ibexa\Contracts\Core\FieldType\FieldType::getEmptyValuecontract returns now strict\Ibexa\Contracts\Core\FieldType\Value. Implementations can return covariant types of\Ibexa\Contracts\Core\FieldType\Value.\Ibexa\Contracts\Core\FieldType\FieldType::isEmptyValuecontract returns now strictbool.\Ibexa\Contracts\Core\FieldType\FieldType::fromHashcontract returns now strict\Ibexa\Contracts\Core\FieldType\Value. Implementations can return covariant types of\Ibexa\Contracts\Core\FieldType\Value.\Ibexa\Contracts\Core\FieldType\FieldType::toHashcontract returns now strictmixedtype. Implementations notdefining a strict return type at all need to be updated.
\Ibexa\Contracts\Core\FieldType\Value::__toStringcontract returns now strictstringtype. Make sure your customfield type values implementations return the same. The interface itself declares strict types.
\Ibexa\Core\FieldType\*\Value) members (properties) are now strictly typed andreadonly(except for Binary File-based field types). Instead of overriding their properties, instantiate a newValue.
\Ibexa\Core\FieldType\FieldType::getSortInfomethod accepts now a strict\Ibexa\Contracts\Core\FieldType\Valuetype and returns a strict
mixedtype. Implementation return type can be covariant.