-
Notifications
You must be signed in to change notification settings - Fork 15
[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]>
|
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::validateFieldSettings
contract now expects its first argument to beof an
array<string, mixed>
type.\Ibexa\Contracts\Core\FieldType\FieldType::getValidatorConfigurationSchema
contract returns now strictarray
andhints a hash map (
array<string, mixed>
) as its shape.\Ibexa\Contracts\Core\FieldType\FieldType::getSettingsSchema
contract returns now strictarray
and hits a hashmap (
array<string, mixed>
) as its shape.\Ibexa\Contracts\Core\FieldType\FieldType::applyDefaultSettings
contract now expects its first argument to be of anarray<string, mixed>
type.\Ibexa\Contracts\Core\FieldType\FieldType::isSearchable
contract returns now strictbool
.\Ibexa\Contracts\Core\FieldType\FieldType::isSingular
contract returns now strictbool
.\Ibexa\Contracts\Core\FieldType\FieldType::onlyEmptyInstance
contract returns now strictbool
.\Ibexa\Contracts\Core\FieldType\FieldType::getEmptyValue
contract returns now strict\Ibexa\Contracts\Core\FieldType\Value
. Implementations can return covariant types of\Ibexa\Contracts\Core\FieldType\Value
.\Ibexa\Contracts\Core\FieldType\FieldType::isEmptyValue
contract returns now strictbool
.\Ibexa\Contracts\Core\FieldType\FieldType::fromHash
contract returns now strict\Ibexa\Contracts\Core\FieldType\Value
. Implementations can return covariant types of\Ibexa\Contracts\Core\FieldType\Value
.\Ibexa\Contracts\Core\FieldType\FieldType::toHash
contract returns now strictmixed
type. Implementations notdefining a strict return type at all need to be updated.
\Ibexa\Contracts\Core\FieldType\Value::__toString
contract returns now strictstring
type. 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::getSortInfo
method accepts now a strict\Ibexa\Contracts\Core\FieldType\Value
type and returns a strict
mixed
type. Implementation return type can be covariant.