src/DoctrineStaticMeta.php
public function getSingular(): string
    {
        try {
            if (null === $this->singular) {
                $reflectionClass = $this->getReflectionClass();

                $shortName         = $reflectionClass->getShortName();
                $singularShortName = MappingHelper::singularize($shortName);

                $namespaceName   = $reflectionClass->getNamespaceName();
                $namespaceParts  = \explode(AbstractGenerator::ENTITIES_FOLDER_NAME, $namespaceName);
                $entityNamespace = \array_pop($namespaceParts);

                $namespacedShortName = \preg_replace(
                    '/\\\\/',
                    '',
                    $entityNamespace . $singularShortName
                );

                $this->singular = \lcfirst($namespacedShortName);
            }

            return $this->singular;
        } catch (\Exception $e) {
            throw new DoctrineStaticMetaException(
                'Exception in ' . __METHOD__ . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
public function getSingular(): string
    {
        try {
            if (null === $this->singular) {
                $reflectionClass = $this->getReflectionClass();

                $shortName         = $reflectionClass->getShortName();
                $singularShortName = MappingHelper::singularize($shortName);

                $namespaceName   = $reflectionClass->getNamespaceName();
                $namespaceParts  = \explode(AbstractGenerator::ENTITIES_FOLDER_NAME, $namespaceName);
                $entityNamespace = \array_pop($namespaceParts);

                $namespacedShortName = \preg_replace(
                    '/\\\\/',
                    '',
                    $entityNamespace . $singularShortName
                );

                $this->singular = \lcfirst($namespacedShortName);
            }

            return $this->singular;
        } catch (\Exception $e) {
            throw new DoctrineStaticMetaException(
                'Exception in ' . __METHOD__ . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
public function getSingular ( ) : string { try { if ( null === $ this -> singular ) { $ reflectionClass = $ this -> getReflectionClass ( ) ; $ shortName = $ reflectionClass -> getShortName ( ) ; $ singularShortName = MappingHelper :: singularize ( $ shortName ) ; $ namespaceName = $ reflectionClass -> getNamespaceName ( ) ; $ namespaceParts = \ explode ( AbstractGenerator :: ENTITIES_FOLDER_NAME , $ namespaceName ) ; $ entityNamespace = \ array_pop ( $ namespaceParts ) ; $ namespacedShortName = \ preg_replace ( '/\\\\/' , '' , $ entityNamespace . $ singularShortName ) ; $ this -> singular = \ lcfirst ( $ namespacedShortName ) ; } return $ this -> singular ; } catch ( \ Exception $ e ) { throw new DoctrineStaticMetaException ( 'Exception in ' . __METHOD__ . ': ' . $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } }
Get the property the name the Entity is mapped by when singular

@return string
@throws DoctrineStaticMetaException
@SuppressWarnings(PHPMD.StaticAccess)
Get the property the name the Entity is mapped by when singular