protected function useRelationTraitInClass(string $classPath, string $traitPath): void
    {
        try {
            $class = PhpClass::fromFile($classPath);
        } catch (Error $e) {
            throw new DoctrineStaticMetaException(
                'PHP parsing error when loading class ' . $classPath . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
        try {
            $trait = PhpTrait::fromFile($traitPath);
        } catch (Error $e) {
            throw new DoctrineStaticMetaException(
                'PHP parsing error when loading class ' . $classPath . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
        $class->addTrait($trait);
        $this->codeHelper->generate($class, $classPath);
    }