Starting with a simple entity class in a symfony 3.4 bundle AppBundle, php-cs-fixer seems to strip imports used by docstrings but ONLY when referring to AppBundle/ – namespaces in vendor/ seem to be safe
Starting with the following, simple entity class
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\EntityManager;
use AppBundle\Entity\AclObjectIdentities; // will be removed
use AppBundle\Entity\AclSecurityIdentities; // will be removed
class AclEntries
{
/** @var AclObjectIdentities Object identity */
private $objectIdentity;
/** @var EntityManager Doctrine entity manager */
private $em;
}
I run the php-cs-fixer command with some reasonable defaults
php-cs-fixer fix src/AppBundle/Entity/AclEntriesDEBUG.php --rules=@PSR2,@Symfony
The file gets cleaned up nicely, however all phpdoc imports to AppBundle are removed as unused
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\EntityManager;
class AclEntries
{
/** @var AclObjectIdentities Object identity */
private $objectIdentity;
/** @var EntityManager Doctrine entity manager */
private $em;
}
The expected behavior to me should be that "all imports are equal" and the "use AppBundle..." doesn't get stripped.