src/CodeGeneration/Generator/Field/FieldGenerator.php
protected function traitFqnLooksLikeField(string $traitFqn): bool
    {
        try {
            $reflection = new \ts\Reflection\ReflectionClass($traitFqn);
        } catch (\ReflectionException $e) {
            throw new \InvalidArgumentException(
                'invalid traitFqn ' . $traitFqn . ' does not seem to exist',
                $e->getCode(),
                $e
            );
        }
        if (true !== $reflection->isTrait()) {
            throw new \InvalidArgumentException('field type is not a trait FQN');
        }
        if ('FieldTrait' !== \substr($traitFqn, -\strlen('FieldTrait'))) {
            throw new \InvalidArgumentException('traitFqn does not end in FieldTrait');
        }

        return true;
    }
protected function traitFqnLooksLikeField(string $traitFqn): bool
    {
        try {
            $reflection = new \ts\Reflection\ReflectionClass($traitFqn);
        } catch (\ReflectionException $e) {
            throw new \InvalidArgumentException(
                'invalid traitFqn ' . $traitFqn . ' does not seem to exist',
                $e->getCode(),
                $e
            );
        }
        if (true !== $reflection->isTrait()) {
            throw new \InvalidArgumentException('field type is not a trait FQN');
        }
        if ('FieldTrait' !== \substr($traitFqn, -\strlen('FieldTrait'))) {
            throw new \InvalidArgumentException('traitFqn does not end in FieldTrait');
        }

        return true;
    }
protected function traitFqnLooksLikeField ( string $ traitFqn ) : bool { try { $ reflection = new \ ts \ Reflection \ ReflectionClass ( $ traitFqn ) ; } catch ( \ ReflectionException $ e ) { throw new \ InvalidArgumentException ( 'invalid traitFqn ' . $ traitFqn . ' does not seem to exist' , $ e -> getCode ( ) , $ e ) ; } if ( true !== $ reflection -> isTrait ( ) ) { throw new \ InvalidArgumentException ( 'field type is not a trait FQN' ) ; } if ( 'FieldTrait' !== \ substr ( $ traitFqn , - \ strlen ( 'FieldTrait' ) ) ) { throw new \ InvalidArgumentException ( 'traitFqn does not end in FieldTrait' ) ; } return true ; }
Does the specified trait FQN look like a field trait?

@param string $traitFqn

@return bool
@throws \ReflectionException
Does the specified trait FQN look like a field trait?