first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
namespace KupShop\ComponentsBundle\Utils;
class ComponentsLocator
{
public function __construct(
protected array $components,
protected array $unusedComponents,
) {
}
public function getComponents(): array
{
return $this->components;
}
public function getComponent(string $class): ?array
{
return $this->components[$class] ?? null;
}
public function findComponentByName($name): ?array
{
foreach ($this->components as $component) {
if ($component['name'] === $name) {
return $component;
}
}
return null;
}
public function getUnusedComponents(): array
{
return $this->unusedComponents;
}
public function findUnusedComponentByName($name): ?array
{
foreach ($this->unusedComponents as $component) {
if ($component['name'] === $name) {
return $component;
}
}
return null;
}
}