Skip to content

Latest commit

 

History

History
1208 lines (900 loc) · 36.4 KB

ClassEntityCollection.md

File metadata and controls

1208 lines (900 loc) · 36.4 KB

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


namespace BumbleDocGen\LanguageHandler\Php\Parser\Entity;

final class ClassEntityCollection extends \BumbleDocGen\Core\Parser\Entity\LoggableRootEntityCollection implements \IteratorAggregate, \Traversable
Collection of PHP class entities

Initialization methods:

  1. __construct

Methods:

  1. add
  2. clearOperationsLogCollection
  3. filterByInterfaces
  4. filterByNameRegularExpression
  5. filterByParentClassNames
  6. filterByPaths
  7. findEntity
  8. get
  9. getEntityByClassName
  10. getEntityCollectionName
  11. getEntityLinkData
  12. getIterator - Retrieve an external iterator
  13. getLoadedOrCreateNew
  14. getOnlyAbstractClasses
  15. getOnlyInstantiable
  16. getOnlyInterfaces
  17. getOnlyTraits
  18. getOperationsLogCollection
  19. getPluginEventDispatcher
  20. has
  21. internalFindEntity
  22. internalGetLoadedOrCreateNew
  23. isEmpty
  24. loadClassEntities
  25. remove
  26. updateEntitiesCache

Constants:

Method details:

public function __construct(\BumbleDocGen\Core\Configuration\Configuration $configuration, \BumbleDocGen\LanguageHandler\Php\PhpHandlerSettings $phpHandlerSettings, \BumbleDocGen\LanguageHandler\Php\Parser\ParserHelper $parserHelper, \BumbleDocGen\Core\Plugin\PluginEventDispatcher $pluginEventDispatcher, \BumbleDocGen\LanguageHandler\Php\Parser\Entity\Cache\CacheablePhpEntityFactory $cacheablePhpEntityFactory, \BumbleDocGen\LanguageHandler\Php\Renderer\EntityDocRenderer\EntityDocRendererHelper $docRendererHelper, \BumbleDocGen\Core\Cache\LocalCache\LocalObjectCache $localObjectCache, \BumbleDocGen\Console\ProgressBar\ProgressBarFactory $progressBarFactory, \Symfony\Component\Console\Style\OutputStyle $io, \Psr\Log\LoggerInterface $logger);

Parameters:

Name Type Description
$configuration \BumbleDocGen\Core\Configuration\Configuration -
$phpHandlerSettings \BumbleDocGen\LanguageHandler\Php\PhpHandlerSettings -
$parserHelper \BumbleDocGen\LanguageHandler\Php\Parser\ParserHelper -
$pluginEventDispatcher \BumbleDocGen\Core\Plugin\PluginEventDispatcher -
$cacheablePhpEntityFactory \BumbleDocGen\LanguageHandler\Php\Parser\Entity\Cache\CacheablePhpEntityFactory -
$docRendererHelper \BumbleDocGen\LanguageHandler\Php\Renderer\EntityDocRenderer\EntityDocRendererHelper -
$localObjectCache \BumbleDocGen\Core\Cache\LocalCache\LocalObjectCache -
$progressBarFactory \BumbleDocGen\Console\ProgressBar\ProgressBarFactory -
$io \Symfony\Component\Console\Style\OutputStyle -
$logger \Psr\Log\LoggerInterface -

public function add(\BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntity $classEntity, bool $reload = false): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;

Parameters:

Name Type Description
$classEntity \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntity -
$reload bool -

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

Throws:


// Implemented in BumbleDocGen\Core\Parser\Entity\LoggableRootEntityCollection

public function clearOperationsLogCollection(): void;

Parameters: not specified

Return value: void


public function filterByInterfaces(array $interfaces): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;

Parameters:

Name Type Description
$interfaces string[] -

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

Throws:


public function filterByNameRegularExpression(string $regexPattern): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;

Parameters:

Name Type Description
$regexPattern string -

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


public function filterByParentClassNames(array $parentClassNames): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;

Parameters:

Name Type Description
$parentClassNames array -

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

Throws:


public function filterByPaths(array $paths): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;

Parameters:

Name Type Description
$paths array -

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

Throws:


// Implemented in BumbleDocGen\Core\Parser\Entity\LoggableRootEntityCollection

public function findEntity(string $search, bool $useUnsafeKeys = true): \BumbleDocGen\Core\Parser\Entity\RootEntityInterface|null;

Parameters:

Name Type Description
$search string -
$useUnsafeKeys bool -

Return value: \BumbleDocGen\Core\Parser\Entity\RootEntityInterface | null


// Implemented in BumbleDocGen\Core\Parser\Entity\LoggableRootEntityCollection

public function get(string $objectName): \BumbleDocGen\Core\Parser\Entity\RootEntityInterface|null;

Parameters:

Name Type Description
$objectName string -

Return value: \BumbleDocGen\Core\Parser\Entity\RootEntityInterface | null


public function getEntityByClassName(string $className, bool $createIfNotExists = true): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntity|null;

Parameters:

Name Type Description
$className string -
$createIfNotExists bool -

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


public function getEntityCollectionName(): string;

Parameters: not specified

Return value: string


public function getEntityLinkData(string $rawLink, string|null $defaultEntityName = null, bool $useUnsafeKeys = true): array;

Parameters:

Name Type Description
$rawLink string Raw link to an entity or entity element
$defaultEntityName string | null Entity name to use if the link does not contain a valid or existing entity name, but only a cursor on an entity element
$useUnsafeKeys bool -

Return value: array


// Implemented in BumbleDocGen\Core\Parser\Entity\LoggableRootEntityCollection

public function getIterator(): \Generator;
Retrieve an external iterator

Parameters: not specified

Return value: \Generator

Throws:

See:


// Implemented in BumbleDocGen\Core\Parser\Entity\LoggableRootEntityCollection

public function getLoadedOrCreateNew(string $objectName, bool $withAddClassEntityToCollectionEvent = false): \BumbleDocGen\Core\Parser\Entity\RootEntityInterface;

Parameters:

Name Type Description
$objectName string -
$withAddClassEntityToCollectionEvent bool -

Return value: \BumbleDocGen\Core\Parser\Entity\RootEntityInterface

See:


public function getOnlyAbstractClasses(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;

Parameters: not specified

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

Throws:


public function getOnlyInstantiable(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;

Parameters: not specified

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

Throws:


public function getOnlyInterfaces(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;

Parameters: not specified

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

Throws:


public function getOnlyTraits(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;

Parameters: not specified

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

Throws:


// Implemented in BumbleDocGen\Core\Parser\Entity\LoggableRootEntityCollection

public function getOperationsLogCollection(): \BumbleDocGen\Core\Parser\Entity\CollectionLogOperation\OperationsCollection;

Parameters: not specified

Return value: \BumbleDocGen\Core\Parser\Entity\CollectionLogOperation\OperationsCollection


public function getPluginEventDispatcher(): \BumbleDocGen\Core\Plugin\PluginEventDispatcher;

Parameters: not specified

Return value: \BumbleDocGen\Core\Plugin\PluginEventDispatcher


// Implemented in BumbleDocGen\Core\Parser\Entity\BaseEntityCollection

public function has(string $objectName): bool;

Parameters:

Name Type Description
$objectName string -

Return value: bool


public function internalFindEntity(string $search, bool $useUnsafeKeys = true): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntity|null;

Parameters:

Name Type Description
$search string Search query. For the search, only the main part is taken, up to the characters: `::`, `->`, `#`. If the request refers to multiple existing entities and if unsafe keys are allowed, a warning will be shown and the first entity found will be used.
$useUnsafeKeys bool Whether to use search keys that can be used to find several entities

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

Examples of using:

$classEntityCollection->findEntity('App'); // class name
$classEntityCollection->findEntity('BumbleDocGen\Console\App'); // class with namespace
$classEntityCollection->findEntity('\BumbleDocGen\Console\App'); // class with namespace
$classEntityCollection->findEntity('\BumbleDocGen\Console\App::test()'); // class with namespace and optional part
$classEntityCollection->findEntity('App.php'); // filename
$classEntityCollection->findEntity('/BumbleDocGen/Console/App.php'); // relative path
$classEntityCollection->findEntity('/Users/someuser/Desktop/projects/bumble-doc-gen/BumbleDocGen/Console/App.php'); // absolute path
$classEntityCollection->findEntity('https://github.com/bumble-tech/bumble-doc-gen/blob/master/BumbleDocGen/Console/App.php'); // source link

public function internalGetLoadedOrCreateNew(string $objectName, bool $withAddClassEntityToCollectionEvent = false): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntity;

Parameters:

Name Type Description
$objectName string -
$withAddClassEntityToCollectionEvent bool -

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

Throws:


// Implemented in BumbleDocGen\Core\Parser\Entity\BaseEntityCollection

public function isEmpty(): bool;

Parameters: not specified

Return value: bool



// Implemented in BumbleDocGen\Core\Parser\Entity\BaseEntityCollection

public function remove(string $objectName): void;

Parameters:

Name Type Description
$objectName string -

Return value: void


// Implemented in BumbleDocGen\Core\Parser\Entity\RootEntityCollection

public function updateEntitiesCache(): void;

Parameters: not specified

Return value: void

Throws: