Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-31674

As a developer, I want proper PHPDoc types defined in field value objects

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Medium Medium
    • 3.1.0, 2.5.12, 3.0.6
    • None
    • None
    • None

    Description

      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;
      

      PR: https://github.com/ezsystems/ezpublish-kernel/pull/3042

      Attachments

        Activity

          People

            Unassigned Unassigned
            9617ee47-cb27-4291-b8b8-676aa93a5338@accounts.ibexa.co Ivan Ternovtsiy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: