-
Couldn't load subscription status.
- Fork 17
[WiP] IBX-9727: Fixed strict types of SPI field type layer #626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
alongosz
wants to merge
78
commits into
ibx-9727-strict-types-core-imagine
Choose a base branch
from
ibx-9727-strict-types-field-types
base: ibx-9727-strict-types-core-imagine
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[WiP] IBX-9727: Fixed strict types of SPI field type layer #626
alongosz
wants to merge
78
commits into
ibx-9727-strict-types-core-imagine
from
ibx-9727-strict-types-field-types
Conversation
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
* 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 <[email protected]>
…ntType\FieldType
|
dd6f888 to
5a1342f
Compare
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.