Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

EZP-31674: Make content fields value properties nullable in phpdoc #3042

Merged
merged 1 commit into from
Jun 19, 2020
Merged

EZP-31674: Make content fields value properties nullable in phpdoc #3042

merged 1 commit into from
Jun 19, 2020

Conversation

ITernovtsii
Copy link
Contributor

@ITernovtsii ITernovtsii commented Jun 8, 2020

Question Answer
JIRA issue EZP-31674
Bug/Improvement yes
New feature no
Target version 7.5
BC breaks no
Tests pass yes
Doc needed no

Currently, incorrect property types defined in PHPDoc.
For example, in "eZ\Publish\Core\FieldType\Integer\Value"

/**
 * Content of the value.
 *
 * @var int
 */
public $value;

So, it's not clear for developer if this value will be 0 when not set.
And, if the developer created app-level value object following the same type, it will throw error.

class MyValueObject {
    public int $count;
}
// error here:
$objInstance->count = $content->getFieldValue('some_integer')->value;

TODO:

  • Implement feature / fix a bug.
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

@lserwatka lserwatka merged commit 5ae6a97 into ezsystems:7.5 Jun 19, 2020
@lserwatka
Copy link
Member

@adamwojs could you merge it up?

@lserwatka
Copy link
Member

@ITernovtsiy thank you! 👍

@adamwojs
Copy link
Member

@lserwatka done

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants