Skip to content

[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
wants to merge 78 commits into
base: ibx-9727-strict-types-core-imagine
Choose a base branch
from

Conversation

alongosz
Copy link
Member

Caution

ATM depends on #619

🎫 Issue IBX-9727
🎯 DXP version target TBD

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 be
    of an array<string, mixed> type.
  • \Ibexa\Contracts\Core\FieldType\FieldType::getValidatorConfigurationSchema contract returns now strict array and
    hints a hash map (array<string, mixed>) as its shape.
  • \Ibexa\Contracts\Core\FieldType\FieldType::getSettingsSchema contract returns now strict array and hits a hash
    map (array<string, mixed>) as its shape.
  • \Ibexa\Contracts\Core\FieldType\FieldType::applyDefaultSettings contract now expects its first argument to be of an
    array<string, mixed> type.
  • \Ibexa\Contracts\Core\FieldType\FieldType::isSearchable contract returns now strict bool.
  • \Ibexa\Contracts\Core\FieldType\FieldType::isSingular contract returns now strict bool.
  • \Ibexa\Contracts\Core\FieldType\FieldType::onlyEmptyInstance contract returns now strict bool.
  • \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 strict bool.
  • \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 strict mixed type. Implementations not
    defining a strict return type at all need to be updated.
  • \Ibexa\Contracts\Core\FieldType\Value::__toString contract returns now strict string type. Make sure your custom
    field type values implementations return the same. The interface itself declares strict types.
  • Core field type Value classes' (\Ibexa\Core\FieldType\*\Value) members (properties) are now strictly typed and
    readonly (except for Binary File-based field types). Instead of overriding their properties, instantiate a new
    Value.
  • \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.

alongosz and others added 30 commits July 25, 2025 09:56
* 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
alongosz added 24 commits July 25, 2025 09:58
@alongosz alongosz changed the title [WiP] IBX-9727: Fixed strict types of field type layer [WiP] IBX-9727: Fixed strict types of SPI field type layer Jul 25, 2025
Copy link

@alongosz alongosz force-pushed the ibx-9727-strict-types-core-imagine branch from dd6f888 to 5a1342f Compare August 6, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants