You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a trait "Generics\Util\Interpolator" which is used in another trait "OrmConnection". This causes problems in documentation generation with the following trace:
[exec] phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
[exec]
[exec] [26.08.2015 - 13:07:54] Using config file './phpdox.xml'
[exec] [26.08.2015 - 13:07:54] Registered collector backend 'parser'
[exec] [26.08.2015 - 13:07:54] Registered enricher 'build'
[exec] [26.08.2015 - 13:07:54] Registered enricher 'git'
[exec] [26.08.2015 - 13:07:54] Registered enricher 'checkstyle'
[exec] [26.08.2015 - 13:07:54] Registered enricher 'phpcs'
[exec] [26.08.2015 - 13:07:54] Registered enricher 'pmd'
[exec] [26.08.2015 - 13:07:54] Registered enricher 'phpunit'
[exec] [26.08.2015 - 13:07:54] Registered enricher 'phploc'
[exec] [26.08.2015 - 13:07:54] Registered output engine 'xml'
[exec] [26.08.2015 - 13:07:54] Registered output engine 'html'
[exec] [26.08.2015 - 13:07:54] Loading bootstrap file 'D:/web/caribu/vendor/autoload.php'
[exec] [26.08.2015 - 13:07:54] Starting to process project 'Caribu API Documentation'
[exec] [26.08.2015 - 13:07:54] Starting collector
[exec] [26.08.2015 - 13:07:54] Scanning directory 'D:/web/caribu/src' for files to process
[exec]
[exec] ............. [13]
[exec]
[exec] [26.08.2015 - 13:07:55] Saving results to directory 'D:/web/caribu/build/api/xml'
[exec] [26.08.2015 - 13:07:56] Resolving inheritance
[exec]
[exec]
[exec]
[exec] Oups... phpDox encountered a problem and has terminated!
[exec]
[exec] It most likely means you've found a bug, so please file a report for this
[exec] and paste the following details and the stacktrace (if given) along:
[exec]
[exec] PHP Version: 5.6.6 (WINNT)
[exec] PHPDox Version: 0.8.2-dev
[exec] Exception: TheSeer\phpDox\Collector\UnitObjectException (Code: 7)
[exec] Location: D:\web\caribu\vendor\theseer\phpdox\src\collector\project\AbstractUnitObject.php (Line 347)
[exec]
[exec] No dependency "Generics\Util\Interpolator" found in unit Nkey\Caribu\Model\AbstractModel
[exec]
[exec] #0 D:\web\caribu\vendor\theseer\phpdox\src\Application.php(145): TheSeer\phpDox\Collector\InheritanceResolver->resolve()
[exec] #1 D:\web\caribu\vendor\theseer\phpdox\src\CLI.php(161): TheSeer\phpDox\Application->runCollector()
[exec] #2 D:\web\caribu\vendor\theseer\phpdox\phpdox(68): TheSeer\phpDox\CLI->run()
[exec]
[exec]
[exec]
[exec] Result: 5
The class Nkey\Caribu\Model\AbstractModel uses the trait indirectly by extending the class "Orm" which uses the trait "OrmTransaction", and this trait uses "OrmConnection". So we have this inheritance chain:
[abstract class] AbstractModel
EXTENDS [class] Orm
USE [trait] OrmTransaction
USE [trait] OrmConnection
USE [trait] Interpolator
No problems for PHPUnit and Eclipse but for phpdox. I can only solve the issue by removing the "use Interpolator" from OrmConnection trait and insert that code into Orm class. This is working but the wrong place for the use of trait.
The text was updated successfully, but these errors were encountered:
I finally found some time to debug this some more and it turns out, the bug description is wrong:
The bug is not about the fact a trait is used within a trait but rather the nested used trait cannot be found - as the error message sort of hints at.
This is true for both reported cases.
That is because the used "missing" trait is not part of the actually processed codebase but at least for the 2nd reported case comes from a dependency installed via composer.
The fact phpDox is crashing on that is of course still a bug.
theseer
changed the title
Trait in Trait causes UnitObjectException
Trait in Trait causes UnitObjectException if the nested trait is missing
Aug 11, 2016
I have a trait "Generics\Util\Interpolator" which is used in another trait "OrmConnection". This causes problems in documentation generation with the following trace:
The class Nkey\Caribu\Model\AbstractModel uses the trait indirectly by extending the class "Orm" which uses the trait "OrmTransaction", and this trait uses "OrmConnection". So we have this inheritance chain:
[abstract class] AbstractModel
EXTENDS [class] Orm
USE [trait] OrmTransaction
USE [trait] OrmConnection
USE [trait] Interpolator
No problems for PHPUnit and Eclipse but for phpdox. I can only solve the issue by removing the "use Interpolator" from OrmConnection trait and insert that code into Orm class. This is working but the wrong place for the use of trait.
The text was updated successfully, but these errors were encountered: