Rename folders to match PHP PSR-4 autoloading conventions: - schemas → Schemas - shared → Shared - Wordpress → WordPress (in all locations) Fixes deployment issues on Linux servers where filesystem is case-sensitive. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace ROITheme\Shared\Application\UseCases\GetComponentSettings;
|
|
|
|
use ROITheme\Shared\Domain\Contracts\ComponentSettingsRepositoryInterface;
|
|
|
|
/**
|
|
* Caso de uso para obtener las configuraciones de un componente
|
|
*
|
|
* Application Layer - Orquesta la lógica de negocio
|
|
*
|
|
* @package ROITheme\Shared\Application\UseCases\GetComponentSettings
|
|
*/
|
|
final class GetComponentSettingsUseCase
|
|
{
|
|
public function __construct(
|
|
private ComponentSettingsRepositoryInterface $repository
|
|
) {
|
|
}
|
|
|
|
/**
|
|
* Ejecuta el caso de uso
|
|
*
|
|
* @param string $componentName Nombre del componente
|
|
* @return array<string, array<string, mixed>> Configuraciones agrupadas por grupo
|
|
*/
|
|
public function execute(string $componentName): array
|
|
{
|
|
// Validar entrada
|
|
if (empty($componentName)) {
|
|
return [];
|
|
}
|
|
|
|
// Obtener configuraciones del repositorio
|
|
$settings = $this->repository->getComponentSettings($componentName);
|
|
|
|
// Si no hay configuraciones, devolver array vacío
|
|
if (empty($settings)) {
|
|
return [];
|
|
}
|
|
|
|
return $settings;
|
|
}
|
|
}
|