Nono1971 / doctrine-yuml-bundle

Bundle to visualise doctrine mapping with yuml in Symfony3
41 stars 12 forks source link

Impossible class count value 0 #7

Closed jedi4z closed 6 years ago

jedi4z commented 6 years ago

Hi! I installed the bundle but I got the following error:

➜  dockerized git:(develop) ✗ php bin/console yuml:mappings -vv

In StringGeneratorHelper.php line 104:

  [Exception]
  Impossible class count value 0

Exception trace:
 Onurb\Doctrine\ORMMetadataGrapher\YumlMetadataGrapher\StringGenerator\StringGeneratorHelper->getCountSide() at /var/www/idinary-dockerized/vendor/onurb/doctrine-metadata-grapher/lib/Onurb/Doctrine/ORMMetadataGrapher/YumlMetadataGrapher/StringGenerator/StringGeneratorHelper.php:67
 Onurb\Doctrine\ORMMetadataGrapher\YumlMetadataGrapher\StringGenerator\StringGeneratorHelper->makeDoubleSidedLinkString() at /var/www/idinary-dockerized/vendor/onurb/doctrine-metadata-grapher/lib/Onurb/Doctrine/ORMMetadataGrapher/YumlMetadataGrapher/StringGenerator.php:172
 Onurb\Doctrine\ORMMetadataGrapher\YumlMetadataGrapher\StringGenerator->getAssociationString() at /var/www/idinary-dockerized/vendor/onurb/doctrine-metadata-grapher/lib/Onurb/Doctrine/ORMMetadataGrapher/YUMLMetadataGrapher.php:176
 Onurb\Doctrine\ORMMetadataGrapher\YUMLMetadataGrapher->writeAssociation() at /var/www/idinary-dockerized/vendor/onurb/doctrine-metadata-grapher/lib/Onurb/Doctrine/ORMMetadataGrapher/YUMLMetadataGrapher.php:163
 Onurb\Doctrine\ORMMetadataGrapher\YUMLMetadataGrapher->writeClassAssociations() at /var/www/idinary-dockerized/vendor/onurb/doctrine-metadata-grapher/lib/Onurb/Doctrine/ORMMetadataGrapher/YUMLMetadataGrapher.php:125
 Onurb\Doctrine\ORMMetadataGrapher\YUMLMetadataGrapher->dispatchStringWriter() at /var/www/idinary-dockerized/vendor/onurb/doctrine-metadata-grapher/lib/Onurb/Doctrine/ORMMetadataGrapher/YUMLMetadataGrapher.php:99
 Onurb\Doctrine\ORMMetadataGrapher\YUMLMetadataGrapher->generateFromMetadata() at /var/www/idinary-dockerized/vendor/onurb/doctrine-yuml-bundle/lib/Onurb/Bundle/YumlBundle/Yuml/YumlClient.php:65
 Onurb\Bundle\YumlBundle\Yuml\YumlClient->makeDslText() at /var/www/idinary-dockerized/vendor/onurb/doctrine-yuml-bundle/lib/Onurb/Bundle/YumlBundle/Command/YumlCommand.php:46
 Onurb\Bundle\YumlBundle\Command\YumlCommand->execute() at /var/www/idinary-dockerized/vendor/symfony/console/Command/Command.php:252
 Symfony\Component\Console\Command\Command->run() at /var/www/idinary-dockerized/vendor/symfony/console/Application.php:883
 Symfony\Component\Console\Application->doRunCommand() at /var/www/idinary-dockerized/vendor/symfony/framework-bundle/Console/Application.php:86
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/idinary-dockerized/vendor/symfony/console/Application.php:241
 Symfony\Component\Console\Application->doRun() at /var/www/idinary-dockerized/vendor/symfony/framework-bundle/Console/Application.php:74
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/idinary-dockerized/vendor/symfony/console/Application.php:143
 Symfony\Component\Console\Application->run() at /var/www/idinary-dockerized/bin/console:39

My system information

------------------------------- -------------------------------------------------------------------------------
  Symfony
 ------------------------------- -------------------------------------------------------------------------------
  Version                         4.0.9
  End of maintenance              07/2018
  End of life                     01/2019
 ------------------------------- -------------------------------------------------------------------------------
  Kernel
 ------------------------------- -------------------------------------------------------------------------------
  Type                            App\Kernel
  Name                            src
  Environment                     dev
  Debug                           true
  Charset                         UTF-8
  Root directory                  ./src
  Cache directory                 ./var/cache/dev (17.6 MiB)
  Log directory                   ./var/log (8.2 MiB)
 ------------------------------- -------------------------------------------------------------------------------
  PHP
 ------------------------------- -------------------------------------------------------------------------------
  Version                         7.2.5
  Architecture                    64 bits
  Intl locale                     en_US_POSIX
  Timezone                        UTC (2018-05-14T00:52:10+00:00)
  OPcache                         false
  APCu                            true
  Xdebug                          true

config/packages/dev/yum.yaml

parameters:
    onurb_yuml.extension: png
    onurb_yuml.style: scruffy
    onurb_yuml.direction: LR
    onurb_yuml.scale: small

config/routes/dev/yuml.yaml

doctrine_yuml:
    resource: "@OnurbYumlBundle/Resources/config/routing.yml"
    prefix:   /

Any idea?

Nono1971 commented 6 years ago

Hi ! Yes, I have a little idea, using it for all my projects :D

Infact, it is due to an inconsistency in your entities mapping : You probably forgot the mappedBy or the inversedBy in a bidirectional relation between two entities.

To fix this, you have all what you need in the profiler toolbar : the error should put a link in red ;)

I could make a more explicit message in this exception, indicating the classes involved... I'll think about it.

Hope that helps ^-^

jedi4z commented 6 years ago

Hi! Yes, you are right! I forgot a bidirectional relation annotation.

Thanks!!

Nono1971 commented 6 years ago

pleasure :)