BumbleDocGen / Technical description of the project / Class map / ClassEntityCollection
ClassEntityCollection class:
namespace BumbleDocGen\LanguageHandler\Php\Parser\Entity;
final class ClassEntityCollection extends \BumbleDocGen\Core\Parser\Entity\LoggableRootEntityCollection implements \IteratorAggregate, \Traversable
Collection of PHP class entities
- add
- clearOperationsLogCollection
- filterByInterfaces
- filterByNameRegularExpression
- filterByParentClassNames
- filterByPaths
- findEntity
- get
- getEntityByClassName
- getEntityCollectionName
- getEntityLinkData
- getIterator - Retrieve an external iterator
- getLoadedOrCreateNew
- getOnlyAbstractClasses
- getOnlyInstantiable
- getOnlyInterfaces
- getOnlyTraits
- getOperationsLogCollection
- getPluginEventDispatcher
- has
- internalFindEntity
- internalGetLoadedOrCreateNew
- isEmpty
- loadClassEntities
- remove
- updateEntitiesCache
- #
NAME
| source code
- # __construct | source code
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 | - |
- # add | source code
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:
- # clearOperationsLogCollection | source code
// Implemented in BumbleDocGen\Core\Parser\Entity\LoggableRootEntityCollection
public function clearOperationsLogCollection(): void;
Parameters: not specified
Return value: void
- # filterByInterfaces | source code
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:
- # filterByNameRegularExpression | source code
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
- # filterByParentClassNames | source code
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:
- # filterByPaths | source code
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:
- # findEntity | source code
// 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
- # get | source code
// 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
- # getEntityByClassName | source code
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
- # getEntityCollectionName | source code
public function getEntityCollectionName(): string;
Parameters: not specified
Return value: string
- # getEntityLinkData | source code
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
- # getIterator | source code
// Implemented in BumbleDocGen\Core\Parser\Entity\LoggableRootEntityCollection
public function getIterator(): \Generator;
Retrieve an external iterator
Parameters: not specified
Return value: \Generator
Throws:
- \Exception - on failure.
See:
- # getLoadedOrCreateNew | source code
// 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:
- # getOnlyAbstractClasses | source code
public function getOnlyAbstractClasses(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;
Parameters: not specified
Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection
Throws:
- # getOnlyInstantiable | source code
public function getOnlyInstantiable(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;
Parameters: not specified
Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection
Throws:
- # getOnlyInterfaces | source code
public function getOnlyInterfaces(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;
Parameters: not specified
Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection
Throws:
- # getOnlyTraits | source code
public function getOnlyTraits(): \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection;
Parameters: not specified
Return value: \BumbleDocGen\LanguageHandler\Php\Parser\Entity\ClassEntityCollection
Throws:
- # getOperationsLogCollection | source code
// 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
- # getPluginEventDispatcher | source code
public function getPluginEventDispatcher(): \BumbleDocGen\Core\Plugin\PluginEventDispatcher;
Parameters: not specified
Return value: \BumbleDocGen\Core\Plugin\PluginEventDispatcher
- # has | source code
// Implemented in BumbleDocGen\Core\Parser\Entity\BaseEntityCollection
public function has(string $objectName): bool;
Parameters:
Name | Type | Description |
---|---|---|
$objectName | string | - |
Return value: bool
- # internalFindEntity | source code
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
- # internalGetLoadedOrCreateNew | source code
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:
- # isEmpty | source code
// Implemented in BumbleDocGen\Core\Parser\Entity\BaseEntityCollection
public function isEmpty(): bool;
Parameters: not specified
Return value: bool
- # loadClassEntities | source code
public function loadClassEntities(): void;
Parameters: not specified
Return value: void
Throws:
- # remove | source code
// Implemented in BumbleDocGen\Core\Parser\Entity\BaseEntityCollection
public function remove(string $objectName): void;
Parameters:
Name | Type | Description |
---|---|---|
$objectName | string | - |
Return value: void
- # updateEntitiesCache | source code
// Implemented in BumbleDocGen\Core\Parser\Entity\RootEntityCollection
public function updateEntitiesCache(): void;
Parameters: not specified
Return value: void
Throws: