Skip to content

Latest commit

 

History

History
3174 lines (2246 loc) · 88 KB

ClassEntity.md

File metadata and controls

3174 lines (2246 loc) · 88 KB

BumbleDocGen / Technical description of the project / Class map / ClassEntity


ClassEntity class:

namespace BumbleDocGen\LanguageHandler\Php\Parser\Entity;

class ClassEntity extends \BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity implements \BumbleDocGen\Core\Renderer\Context\DocumentTransformableEntityInterface, \BumbleDocGen\Core\Parser\Entity\RootEntityInterface, \BumbleDocGen\Core\Parser\Entity\EntityInterface, \BumbleDocGen\Core\Parser\Entity\Cache\CacheableEntityInterface
Class entity

Initialization methods:

  1. __construct

Methods:

  1. cursorToDocAttributeLinkFragment
  2. documentCreationAllowed
  3. entityCacheIsOutdated
  4. entityDataCanBeLoaded
  5. getAbsoluteFileName - Returns the absolute path to a file if it can be retrieved and if the file is in the project directory
  6. getCacheKey
  7. getCachedEntityDependencies
  8. getCasesNames
  9. getConstant
  10. getConstantEntity
  11. getConstantEntityCollection
  12. getConstants
  13. getConstantsData
  14. getDescription
  15. getDescriptionLinks - Get parsed links from description and doc blocks `see` and `link`
  16. getDocBlock
  17. getDocComment - Get the doc comment of an entity
  18. getDocCommentEntity
  19. getDocNote
  20. getDocRender
  21. getEndLine
  22. getEntityDependencies
  23. getExamples - Get parsed examples from `examples` doc block
  24. getExtends
  25. getFileContent
  26. getFileName - Returns the relative path to a file if it can be retrieved and if the file is in the project directory
  27. getFileSourceLink
  28. getFirstExample - Get first example from @examples doc block
  29. getFullFileName
  30. getImplementingReflectionClass
  31. getInterfaceNames
  32. getInterfacesEntities
  33. getInterfacesString
  34. getMethodEntity
  35. getMethodEntityCollection
  36. getMethodsData
  37. getModifiersString
  38. getName
  39. getNamespaceName
  40. getObjectId - Get entity unique ID
  41. getParentClass
  42. getParentClassName
  43. getParentClassNames
  44. getPhpHandlerSettings
  45. getPluginData
  46. getPropertiesData
  47. getPropertyEntity
  48. getPropertyEntityCollection
  49. getReflector
  50. getRelativeFileName
  51. getRootEntityCollection - Get parent collection of entities
  52. getShortName
  53. getStartLine
  54. getThrows - Get parsed throws from `throws` doc block
  55. getTraitsNames
  56. hasAnnotationKey
  57. hasConstant
  58. hasDescriptionLinks
  59. hasExamples
  60. hasMethod
  61. hasParentClass
  62. hasProperty
  63. hasThrows
  64. hasTraits
  65. implementsInterface
  66. isAbstract
  67. isClassLoad
  68. isDeprecated
  69. isEntityDataCacheOutdated
  70. isEntityFileCanBeLoad
  71. isEntityNameValid - Check if entity name is valid
  72. isEnum
  73. isExternalLibraryEntity - The entity is loaded from a third party library and should not be treated the same as a standard one
  74. isInGit - Checking if class file is in git repository
  75. isInstantiable
  76. isInterface
  77. isInternal
  78. isSubclassOf
  79. isTrait
  80. loadPluginData
  81. reloadEntityDependenciesCache
  82. removeEntityValueFromCache
  83. removeNotUsedEntityDataCache
  84. setReflectionClass

Method details:

public function __construct(\BumbleDocGen\Core\Configuration\Configuration $configuration, \BumbleDocGen\LanguageHandler\Php\PhpHandlerSettings $phpHandlerSettings, \BumbleDocGen\LanguageHandler\Php\Parser\Entity\Reflection\ReflectorWrapper $reflector, \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection $classEntityCollection, \BumbleDocGen\LanguageHandler\Php\Parser\ParserHelper $parserHelper, \BumbleDocGen\LanguageHandler\Php\Parser\ComposerParser $composerParser, \BumbleDocGen\Core\Cache\LocalCache\LocalObjectCache $localObjectCache, \Psr\Log\LoggerInterface $logger, string $className, string|null $relativeFileName);

Parameters:

Name Type Description
$configuration \BumbleDocGen\Core\Configuration\Configuration -
$phpHandlerSettings \BumbleDocGen\LanguageHandler\Php\PhpHandlerSettings -
$reflector \BumbleDocGen\LanguageHandler\Php\Parser\Entity\Reflection\ReflectorWrapper -
$classEntityCollection \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection -
$parserHelper \BumbleDocGen\LanguageHandler\Php\Parser\ParserHelper -
$composerParser \BumbleDocGen\LanguageHandler\Php\Parser\ComposerParser -
$localObjectCache \BumbleDocGen\Core\Cache\LocalCache\LocalObjectCache -
$logger \Psr\Log\LoggerInterface -
$className string -
$relativeFileName string | null -

public function cursorToDocAttributeLinkFragment(string $cursor, bool $isForDocument = true): string;

Parameters:

Name Type Description
$cursor string -
$isForDocument bool -

Return value: string

Throws:


public function documentCreationAllowed(): bool;

Parameters: not specified

Return value: bool

Throws:


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function entityCacheIsOutdated(): bool;

Parameters: not specified

Return value: bool

Throws:


public function entityDataCanBeLoaded(): bool;

Parameters: not specified

Return value: bool

Throws:


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function getAbsoluteFileName(): string|null;
Returns the absolute path to a file if it can be retrieved and if the file is in the project directory

Parameters: not specified

Return value: string | null

Throws:


// Implemented in BumbleDocGen\Core\Parser\Entity\Cache\CacheableEntityTrait

public function getCacheKey(): string;

Parameters: not specified

Return value: string


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function getCachedEntityDependencies(): array;

Parameters: not specified

Return value: array

Throws:



public function getConstant(string $name): string|array|int|bool|null|float;

Parameters:

Name Type Description
$name string -

Return value: string | array | int | bool | null | float

Throws:


public function getConstantEntity(string $constantName, bool $unsafe = true): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ConstantEntity|null;

Parameters:

Name Type Description
$constantName string -
$unsafe bool -

Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ConstantEntity | null

Throws:


public function getConstantEntityCollection(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ConstantEntityCollection;

Parameters: not specified

Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ConstantEntityCollection

Throws:





// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function getDescriptionLinks(): array;
Get parsed links from description and doc blocks `see` and `link`

Parameters: not specified

Return value: array

Throws:



// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function getDocComment(): string;
Get the doc comment of an entity

Parameters: not specified

Return value: string

Throws:



// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function getDocNote(): string;

Parameters: not specified

Return value: string


public function getDocRender(): \BumbleDocGen\Core\Renderer\EntityDocRenderer\EntityDocRendererInterface;

Parameters: not specified

Return value: \BumbleDocGen\Core\Renderer\EntityDocRenderer\EntityDocRendererInterface

Throws:



public function getEntityDependencies(): array;

Parameters: not specified

Return value: array


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function getExamples(): array;
Get parsed examples from `examples` doc block

Parameters: not specified

Return value: array



public function getFileContent(): string;

Parameters: not specified

Return value: string

Throws:


public function getFileName(): string|null;
Returns the relative path to a file if it can be retrieved and if the file is in the project directory

Parameters: not specified

Return value: string | null


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function getFileSourceLink(bool $withLine = true): string|null;

Parameters:

Name Type Description
$withLine bool -

Return value: string | null

Throws:


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function getFirstExample(): string;
Get first example from @examples doc block

Parameters: not specified

Return value: string


public function getFullFileName(): string|null;

Parameters: not specified

Return value: string | null

Throws:


public function getImplementingReflectionClass(): \Roave\BetterReflection\Reflection\ReflectionClass;

Parameters: not specified

Return value: \Roave\BetterReflection\Reflection\ReflectionClass

Throws:


public function getInterfaceNames(): array;

Parameters: not specified

Return value: array

Throws:


public function getInterfacesEntities(): array;

Parameters: not specified

Return value: array

Throws:


public function getInterfacesString(): string;

Parameters: not specified

Return value: string

Throws:


public function getMethodEntity(string $methodName, bool $unsafe = true): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\MethodEntity|null;

Parameters:

Name Type Description
$methodName string -
$unsafe bool -

Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\MethodEntity | null

Throws:


public function getMethodEntityCollection(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\MethodEntityCollection;

Parameters: not specified

Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\MethodEntityCollection

Throws:



public function getModifiersString(): string;

Parameters: not specified

Return value: string

Throws:


public function getName(): string;

Parameters: not specified

Return value: string



public function getObjectId(): string;
Get entity unique ID

Parameters: not specified

Return value: string


public function getParentClass(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntity|null;

Parameters: not specified

Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntity | null

Throws:


public function getParentClassName(): string|null;

Parameters: not specified

Return value: string | null

Throws:


public function getParentClassNames(): array;

Parameters: not specified

Return value: array

Throws:


public function getPhpHandlerSettings(): \BumbleDocGen\LanguageHandler\Php\PhpHandlerSettings;

Parameters: not specified

Return value: \BumbleDocGen\LanguageHandler\Php\PhpHandlerSettings


public function getPluginData(string $pluginKey): array|null;

Parameters:

Name Type Description
$pluginKey string -

Return value: array | null


public function getPropertiesData(): array;

Parameters: not specified

Return value: array

Throws:


public function getPropertyEntity(string $propertyName, bool $unsafe = true): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\PropertyEntity|null;

Parameters:

Name Type Description
$propertyName string -
$unsafe bool -

Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\PropertyEntity | null

Throws:


public function getPropertyEntityCollection(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\PropertyEntityCollection;

Parameters: not specified

Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\PropertyEntityCollection

Throws:


public function getReflector(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\Reflection\ReflectorWrapper;

Parameters: not specified

Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\Reflection\ReflectorWrapper


public function getRelativeFileName(bool $loadIfEmpty = true): string|null;

Parameters:

Name Type Description
$loadIfEmpty bool -

Return value: string | null

Throws:


public function getRootEntityCollection(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;
Get parent collection of entities

Parameters: not specified

Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection


public function getShortName(): string;

Parameters: not specified

Return value: string



// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function getThrows(): array;
Get parsed throws from `throws` doc block

Parameters: not specified

Return value: array

Throws:



public function hasAnnotationKey(string $annotationKey): bool;

Parameters:

Name Type Description
$annotationKey string -

Return value: bool


public function hasConstant(string $constant): bool;

Parameters:

Name Type Description
$constant string -

Return value: bool

Throws:


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function hasDescriptionLinks(): bool;

Parameters: not specified

Return value: bool

Throws:


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function hasExamples(): bool;

Parameters: not specified

Return value: bool


public function hasMethod(string $method): bool;

Parameters:

Name Type Description
$method string -

Return value: bool

Throws:


public function hasParentClass(string $parentClassName): bool;

Parameters:

Name Type Description
$parentClassName string -

Return value: bool

Throws:


public function hasProperty(string $property): bool;

Parameters:

Name Type Description
$property string -

Return value: bool

Throws:


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function hasThrows(): bool;

Parameters: not specified

Return value: bool



public function implementsInterface(string $interfaceName): bool;

Parameters:

Name Type Description
$interfaceName string -

Return value: bool

Throws:



public function isClassLoad(): bool;

Parameters: not specified

Return value: bool


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function isDeprecated(): bool;

Parameters: not specified

Return value: bool


// Implemented in BumbleDocGen\Core\Parser\Entity\Cache\CacheableEntityTrait

public function isEntityDataCacheOutdated(): bool;

Parameters: not specified

Return value: bool

Throws:


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function isEntityFileCanBeLoad(): bool;

Parameters: not specified

Return value: bool

Throws:


public static function isEntityNameValid(string $entityName): bool;
Check if entity name is valid

Parameters:

Name Type Description
$entityName string -

Return value: bool



public function isExternalLibraryEntity(): bool;
The entity is loaded from a third party library and should not be treated the same as a standard one

Parameters: not specified

Return value: bool


public function isInGit(): bool;
Checking if class file is in git repository

Parameters: not specified

Return value: bool

Throws:




// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function isInternal(): bool;

Parameters: not specified

Return value: bool


public function isSubclassOf(string $className): bool;

Parameters:

Name Type Description
$className string -

Return value: bool

Throws:



public function loadPluginData(string $pluginKey, array $data): void;

Parameters:

Name Type Description
$pluginKey string -
$data array -

Return value: void


// Implemented in BumbleDocGen\LanguageHandler\Php\Parser\Entity\BaseEntity

public function reloadEntityDependenciesCache(): array;

Parameters: not specified

Return value: array

Throws:


// Implemented in BumbleDocGen\Core\Parser\Entity\Cache\CacheableEntityTrait

public function removeEntityValueFromCache(string $key): void;

Parameters:

Name Type Description
$key string -

Return value: void


// Implemented in BumbleDocGen\Core\Parser\Entity\Cache\CacheableEntityTrait

public function removeNotUsedEntityDataCache(): void;

Parameters: not specified

Return value: void

Throws:


public function setReflectionClass(\Roave\BetterReflection\Reflection\ReflectionClass $reflectionClass): void;

Parameters:

Name Type Description
$reflectionClass \Roave\BetterReflection\Reflection\ReflectionClass -

Return value: void