19 declare(strict_types=1);
74 $tool->setCreationPrevented(
true);
75 $this->type_information_collection->add($tool);
78 $tool->setCreationPrevented(
true);
79 $this->type_information_collection->add($tool);
87 $called_contexts = $DIC->globalScreen()->tool()->context()->stack();
91 foreach ($this->providers as $provider) {
92 $context_collection = $provider->isInterestedInContexts();
93 if ($context_collection->hasMatch($called_contexts)) {
94 $tools_to_merge[] = $provider->getToolsForContextStack($called_contexts);
97 $this->tools = array_merge([], ...$tools_to_merge);
102 $this->tools = array_filter($this->tools, $this->
getVisibleFilter() ??
function ($v, $k) :
bool {
109 foreach ($this->tools as $tool) {
110 if ($tool->getProviderIdentification()->serialize() === $identification->serialize()) {
114 return new Tool($identification);
119 array_walk($this->tools,
function (
isToolItem $tool) :
void {
141 return count($this->tools) > 0;
170 $type = get_class($item);
172 return $this->type_information_collection->get(
$type);
177 return static function (
isToolItem $tool) :
bool {
178 return ($tool->isAvailable() && $tool->isVisible());
Interface IdentificationInterface.
Class AbstractBaseCollector.
setTypeInformation(TypeInformation $information)
$type_information_collection
getPosition()
Return the default position for installation, this will be overridden by the configuration later...
Class TypeInformationCollection.
cleanupItemsForUIRepresentation()
__construct(array $providers, ItemInformation $information=null)
MainToolCollector constructor.
filterItemsByVisibilty(bool $async_only=false)
getSingleItem(IdentificationInterface $identification)
sortItemsForUIRepresentation()
applyTypeInformation(isToolItem $item)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
prepareItemsForUIRepresentation()
getItemsForUIRepresentation()