src/CodeGeneration/Generator/RelationsGenerator.php
protected function getPathsForOwningTraitsAndInterfaces(
        string $hasType,
        string $ownedEntityFqn
    ): array {
        try {
            $ownedHasName        = $this->namespaceHelper->getOwnedHasName(
                $hasType,
                $ownedEntityFqn,
                $this->srcSubFolderName,
                $this->projectRootNamespace
            );
            $reciprocatedHasName = $this->namespaceHelper->getReciprocatedHasName(
                $ownedEntityFqn,
                $this->srcSubFolderName,
                $this->projectRootNamespace
            );
            $owningTraitFqn      = $this->getOwningTraitFqn($hasType, $ownedEntityFqn);
            list($traitName, , $traitSubDirsNoEntities) = $this->parseFullyQualifiedName($owningTraitFqn);
            $owningTraitPath = $this->pathHelper->getPathFromNameAndSubDirs(
                $this->pathToProjectRoot,
                $traitName,
                $traitSubDirsNoEntities
            );
            if (!\file_exists($owningTraitPath)) {
                $this->generateRelationCodeForEntity($ownedEntityFqn);
            }
            $owningInterfaceFqn = $this->getOwningInterfaceFqn($hasType, $ownedEntityFqn);
            list($interfaceName, , $interfaceSubDirsNoEntities) = $this->parseFullyQualifiedName($owningInterfaceFqn);
            $owningInterfacePath        = $this->pathHelper->getPathFromNameAndSubDirs(
                $this->pathToProjectRoot,
                $interfaceName,
                $interfaceSubDirsNoEntities
            );
            $reciprocatingInterfacePath = \preg_replace(
                '%Has(Required|)' . $ownedHasName . '%',
                'Reciprocates' . $reciprocatedHasName,
                $owningInterfacePath
            );

            return [
                $owningTraitPath,
                $owningInterfacePath,
                $reciprocatingInterfacePath,
            ];
        } catch (\Exception $e) {
            throw new DoctrineStaticMetaException(
                'Exception in ' . __METHOD__ . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
protected function getPathsForOwningTraitsAndInterfaces(
        string $hasType,
        string $ownedEntityFqn
    ): array {
        try {
            $ownedHasName        = $this->namespaceHelper->getOwnedHasName(
                $hasType,
                $ownedEntityFqn,
                $this->srcSubFolderName,
                $this->projectRootNamespace
            );
            $reciprocatedHasName = $this->namespaceHelper->getReciprocatedHasName(
                $ownedEntityFqn,
                $this->srcSubFolderName,
                $this->projectRootNamespace
            );
            $owningTraitFqn      = $this->getOwningTraitFqn($hasType, $ownedEntityFqn);
            list($traitName, , $traitSubDirsNoEntities) = $this->parseFullyQualifiedName($owningTraitFqn);
            $owningTraitPath = $this->pathHelper->getPathFromNameAndSubDirs(
                $this->pathToProjectRoot,
                $traitName,
                $traitSubDirsNoEntities
            );
            if (!\file_exists($owningTraitPath)) {
                $this->generateRelationCodeForEntity($ownedEntityFqn);
            }
            $owningInterfaceFqn = $this->getOwningInterfaceFqn($hasType, $ownedEntityFqn);
            list($interfaceName, , $interfaceSubDirsNoEntities) = $this->parseFullyQualifiedName($owningInterfaceFqn);
            $owningInterfacePath        = $this->pathHelper->getPathFromNameAndSubDirs(
                $this->pathToProjectRoot,
                $interfaceName,
                $interfaceSubDirsNoEntities
            );
            $reciprocatingInterfacePath = \preg_replace(
                '%Has(Required|)' . $ownedHasName . '%',
                'Reciprocates' . $reciprocatedHasName,
                $owningInterfacePath
            );

            return [
                $owningTraitPath,
                $owningInterfacePath,
                $reciprocatingInterfacePath,
            ];
        } catch (\Exception $e) {
            throw new DoctrineStaticMetaException(
                'Exception in ' . __METHOD__ . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
protected function getPathsForOwningTraitsAndInterfaces ( string $ hasType , string $ ownedEntityFqn ) : array { try { $ ownedHasName = $ this -> namespaceHelper -> getOwnedHasName ( $ hasType , $ ownedEntityFqn , $ this -> srcSubFolderName , $ this -> projectRootNamespace ) ; $ reciprocatedHasName = $ this -> namespaceHelper -> getReciprocatedHasName ( $ ownedEntityFqn , $ this -> srcSubFolderName , $ this -> projectRootNamespace ) ; $ owningTraitFqn = $ this -> getOwningTraitFqn ( $ hasType , $ ownedEntityFqn ) ; list ( $ traitName , , $ traitSubDirsNoEntities ) = $ this -> parseFullyQualifiedName ( $ owningTraitFqn ) ; $ owningTraitPath = $ this -> pathHelper -> getPathFromNameAndSubDirs ( $ this -> pathToProjectRoot , $ traitName , $ traitSubDirsNoEntities ) ; if ( ! \ file_exists ( $ owningTraitPath ) ) { $ this -> generateRelationCodeForEntity ( $ ownedEntityFqn ) ; } $ owningInterfaceFqn = $ this -> getOwningInterfaceFqn ( $ hasType , $ ownedEntityFqn ) ; list ( $ interfaceName , , $ interfaceSubDirsNoEntities ) = $ this -> parseFullyQualifiedName ( $ owningInterfaceFqn ) ; $ owningInterfacePath = $ this -> pathHelper -> getPathFromNameAndSubDirs ( $ this -> pathToProjectRoot , $ interfaceName , $ interfaceSubDirsNoEntities ) ; $ reciprocatingInterfacePath = \ preg_replace ( '%Has(Required|)' . $ ownedHasName . '%' , 'Reciprocates' . $ reciprocatedHasName , $ owningInterfacePath ) ; return [ $ owningTraitPath , $ owningInterfacePath , $ reciprocatingInterfacePath , ] ; } catch ( \ Exception $ e ) { throw new DoctrineStaticMetaException ( 'Exception in ' . __METHOD__ . ': ' . $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } }
Get the absolute paths for the owning traits and interfaces for the specified relation type
Will ensure that the files exists

@param string $hasType
@param string $ownedEntityFqn

@return array [
$owningTraitPath,
$owningInterfacePath,
$reciprocatingInterfacePath
]
@throws DoctrineStaticMetaException
@SuppressWarnings(PHPMD.StaticAccess)
@SuppressWarnings(PHPMD.BooleanArgumentFlag)
Get the absolute paths for the owning traits and interfaces for the specified relation type Will ensure that the files exists