Doctrine Common
  1. Doctrine Common
  2. DCOM-192

[GH-274] Improve code on loadMetadata() to verify if class exists

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of entering:

      Url: https://github.com/doctrine/common/pull/274

      Message:

      Improve code on loadMetadata() to verify if class exists, avoid a later warning when calling class_parents()

      Instead throws a \RuntimeException if class doesn't exists.

      Before changing code, just after add test:
      ```
      1) Doctrine\Tests\Common\Persistence\Mapping\ClassMetadataFactoryTest::testGetMetadataForAbsentClass
      class_parents(): Class Doctrine\Tests\Common\Persistence\Mapping\AbsentClass does not exist and could not be loaded

      /home/www/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php:38
      /home/www/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:257
      /home/www/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:281
      /home/www/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:212
      /home/www/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php:44
      ```

        Activity

        Hide
        Marco Pivetta added a comment -

        Merged

        Show
        Marco Pivetta added a comment - Merged
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-274] was closed:
        https://github.com/doctrine/common/pull/274

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-274] was closed: https://github.com/doctrine/common/pull/274

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: