fix: Corregir case de namespaces para compatibilidad Linux/PSR-4

Cambios realizados:
- \API\ → \Api\ (4 archivos)
- \WordPress → \Wordpress (12 archivos)
- \DI\ → \Di\ (4 archivos)

Los namespaces ahora coinciden exactamente con la estructura
de carpetas (Api/, Wordpress/, Di/) para garantizar
compatibilidad con sistemas case-sensitive (Linux/producción)
y cumplimiento de PSR-4.

Archivos corregidos: 16

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
FrankZamora
2025-11-26 18:12:05 -06:00
parent 4c807e1cf2
commit 71cfd54166
17 changed files with 29 additions and 45 deletions

View File

@@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace ROITheme\Admin\Infrastructure\API\WordPress; namespace ROITheme\Admin\Infrastructure\Api\Wordpress;
use ROITheme\Shared\Application\UseCases\SaveComponentSettings\SaveComponentSettingsUseCase; use ROITheme\Shared\Application\UseCases\SaveComponentSettings\SaveComponentSettingsUseCase;
@@ -126,7 +126,7 @@ final class AdminAjaxHandler
// Usar repositorio para restaurar valores // Usar repositorio para restaurar valores
if ($this->saveComponentSettingsUseCase !== null) { if ($this->saveComponentSettingsUseCase !== null) {
global $wpdb; global $wpdb;
$repository = new \ROITheme\Shared\Infrastructure\Persistence\WordPress\WordPressComponentSettingsRepository($wpdb); $repository = new \ROITheme\Shared\Infrastructure\Persistence\Wordpress\WordPressComponentSettingsRepository($wpdb);
$updated = $repository->resetToDefaults($component, $schemaPath); $updated = $repository->resetToDefaults($component, $schemaPath);
wp_send_json_success([ wp_send_json_success([

View File

@@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace ROITheme\Admin\Infrastructure\API\WordPress; namespace ROITheme\Admin\Infrastructure\Api\Wordpress;
use ROITheme\Admin\Domain\Contracts\MenuRegistrarInterface; use ROITheme\Admin\Domain\Contracts\MenuRegistrarInterface;
use ROITheme\Admin\Domain\ValueObjects\MenuItem; use ROITheme\Admin\Domain\ValueObjects\MenuItem;

View File

@@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace ROITheme\Public\ContactForm\Infrastructure\Api\WordPress; namespace ROITheme\Public\ContactForm\Infrastructure\Api\Wordpress;
use ROITheme\Shared\Domain\Contracts\ComponentSettingsRepositoryInterface; use ROITheme\Shared\Domain\Contracts\ComponentSettingsRepositoryInterface;

View File

@@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace ROITheme\Public\Footer\Infrastructure\Api\WordPress; namespace ROITheme\Public\Footer\Infrastructure\Api\Wordpress;
use ROITheme\Shared\Domain\Contracts\ComponentSettingsRepositoryInterface; use ROITheme\Shared\Domain\Contracts\ComponentSettingsRepositoryInterface;

View File

@@ -1,16 +0,0 @@
<?php
require_once 'D:/_Desarrollo/02AnalisisDePreciosUnitarios/dev.analisisdepreciosunitarios.com/wp-load.php';
global $wpdb;
$table = $wpdb->prefix . 'roi_theme_component_settings';
echo "=== CTA-BOX-SIDEBAR CONTENT (ACTUAL) ===\n";
$rows = $wpdb->get_results(
"SELECT attribute_name, attribute_value FROM {$table}
WHERE component_name = 'cta-box-sidebar'
AND group_name = 'content'
ORDER BY attribute_name"
);
foreach ($rows as $row) {
echo "{$row->attribute_name}: [{$row->attribute_value}]\n";
}

View File

@@ -62,7 +62,7 @@ require_once get_template_directory() . '/Inc/customizer-cta.php';
// 3. INICIALIZAR DI CONTAINER (Clean Architecture) // 3. INICIALIZAR DI CONTAINER (Clean Architecture)
// ============================================================================= // =============================================================================
use ROITheme\Shared\Infrastructure\DI\DIContainer; use ROITheme\Shared\Infrastructure\Di\DIContainer;
try { try {
global $wpdb; global $wpdb;
@@ -92,7 +92,7 @@ try {
use ROITheme\Admin\Domain\ValueObjects\MenuItem; use ROITheme\Admin\Domain\ValueObjects\MenuItem;
use ROITheme\Admin\Application\UseCases\RenderDashboardUseCase; use ROITheme\Admin\Application\UseCases\RenderDashboardUseCase;
use ROITheme\Admin\Infrastructure\Ui\AdminDashboardRenderer; use ROITheme\Admin\Infrastructure\Ui\AdminDashboardRenderer;
use ROITheme\Admin\Infrastructure\API\WordPress\AdminMenuRegistrar; use ROITheme\Admin\Infrastructure\Api\Wordpress\AdminMenuRegistrar;
use ROITheme\Admin\Infrastructure\Services\AdminAssetEnqueuer; use ROITheme\Admin\Infrastructure\Services\AdminAssetEnqueuer;
try { try {
@@ -127,17 +127,17 @@ try {
$saveComponentSettingsUseCase = $container?->getSaveComponentSettingsUseCase(); $saveComponentSettingsUseCase = $container?->getSaveComponentSettingsUseCase();
// Crear y registrar el handler AJAX con inyección del Use Case // Crear y registrar el handler AJAX con inyección del Use Case
$adminAjaxHandler = new \ROITheme\Admin\Infrastructure\API\WordPress\AdminAjaxHandler($saveComponentSettingsUseCase); $adminAjaxHandler = new \ROITheme\Admin\Infrastructure\Api\Wordpress\AdminAjaxHandler($saveComponentSettingsUseCase);
$adminAjaxHandler->register(); $adminAjaxHandler->register();
// Crear y registrar el handler AJAX para el Contact Form (público) // Crear y registrar el handler AJAX para el Contact Form (público)
$contactFormAjaxHandler = new \ROITheme\Public\ContactForm\Infrastructure\Api\WordPress\ContactFormAjaxHandler( $contactFormAjaxHandler = new \ROITheme\Public\ContactForm\Infrastructure\Api\Wordpress\ContactFormAjaxHandler(
$container->getComponentSettingsRepository() $container->getComponentSettingsRepository()
); );
$contactFormAjaxHandler->register(); $contactFormAjaxHandler->register();
// Crear y registrar el handler AJAX para Newsletter (público) // Crear y registrar el handler AJAX para Newsletter (público)
$newsletterAjaxHandler = new \ROITheme\Public\Footer\Infrastructure\Api\WordPress\NewsletterAjaxHandler( $newsletterAjaxHandler = new \ROITheme\Public\Footer\Infrastructure\Api\Wordpress\NewsletterAjaxHandler(
$container->getComponentSettingsRepository() $container->getComponentSettingsRepository()
); );
$newsletterAjaxHandler->register(); $newsletterAjaxHandler->register();

View File

@@ -3,7 +3,7 @@ declare(strict_types=1);
namespace ROITheme\Shared\Infrastructure\Adapters; namespace ROITheme\Shared\Infrastructure\Adapters;
use ROITheme\Component\Infrastructure\DI\DIContainer; use ROITheme\Component\Infrastructure\Di\DIContainer;
use ROITheme\Shared\Domain\ValueObjects\ComponentName; use ROITheme\Shared\Domain\ValueObjects\ComponentName;
use ROITheme\Shared\Domain\ValueObjects\ComponentConfiguration; use ROITheme\Shared\Domain\ValueObjects\ComponentConfiguration;
use ROITheme\Shared\Domain\Contracts\ComponentRepositoryInterface; use ROITheme\Shared\Domain\Contracts\ComponentRepositoryInterface;

View File

@@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace ROITheme\Shared\Infrastructure\API\WordPress; namespace ROITheme\Shared\Infrastructure\Api\Wordpress;
use ROITheme\Shared\Application\UseCases\SaveComponent\SaveComponentUseCase; use ROITheme\Shared\Application\UseCases\SaveComponent\SaveComponentUseCase;
use ROITheme\Shared\Application\UseCases\SaveComponent\SaveComponentRequest; use ROITheme\Shared\Application\UseCases\SaveComponent\SaveComponentRequest;
@@ -9,7 +9,7 @@ use ROITheme\Shared\Application\UseCases\GetComponent\GetComponentUseCase;
use ROITheme\Shared\Application\UseCases\GetComponent\GetComponentRequest; use ROITheme\Shared\Application\UseCases\GetComponent\GetComponentRequest;
use ROITheme\Shared\Application\UseCases\DeleteComponent\DeleteComponentUseCase; use ROITheme\Shared\Application\UseCases\DeleteComponent\DeleteComponentUseCase;
use ROITheme\Shared\Application\UseCases\DeleteComponent\DeleteComponentRequest; use ROITheme\Shared\Application\UseCases\DeleteComponent\DeleteComponentRequest;
use ROITheme\Shared\Infrastructure\DI\DIContainer; use ROITheme\Shared\Infrastructure\Di\DIContainer;
/** /**
* AjaxController - Endpoints AJAX de WordPress * AjaxController - Endpoints AJAX de WordPress
@@ -25,7 +25,7 @@ use ROITheme\Shared\Infrastructure\DI\DIContainer;
* - Verifica capabilities (manage_options) * - Verifica capabilities (manage_options)
* - Sanitiza inputs * - Sanitiza inputs
* *
* @package ROITheme\Infrastructure\API\WordPress * @package ROITheme\Infrastructure\Api\WordPress
*/ */
final class AjaxController final class AjaxController
{ {

View File

@@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace ROITheme\Shared\Infrastructure\API\WordPress; namespace ROITheme\Shared\Infrastructure\Api\Wordpress;
/** /**
* WP-CLI Command para Sincronización de Schemas * WP-CLI Command para Sincronización de Schemas

View File

@@ -9,9 +9,9 @@ use ROITheme\Shared\Domain\Contracts\ValidationServiceInterface;
use ROITheme\Shared\Domain\Contracts\CacheServiceInterface; use ROITheme\Shared\Domain\Contracts\CacheServiceInterface;
use ROITheme\Shared\Domain\Contracts\CSSGeneratorInterface; use ROITheme\Shared\Domain\Contracts\CSSGeneratorInterface;
use ROITheme\Shared\Domain\Contracts\ComponentSettingsRepositoryInterface; use ROITheme\Shared\Domain\Contracts\ComponentSettingsRepositoryInterface;
use ROITheme\Shared\Infrastructure\Persistence\WordPress\WordPressComponentRepository; use ROITheme\Shared\Infrastructure\Persistence\Wordpress\WordPressComponentRepository;
use ROITheme\Shared\Infrastructure\Persistence\WordPress\WordPressDefaultsRepository; use ROITheme\Shared\Infrastructure\Persistence\Wordpress\WordPressDefaultsRepository;
use ROITheme\Shared\Infrastructure\Persistence\WordPress\WordPressComponentSettingsRepository; use ROITheme\Shared\Infrastructure\Persistence\Wordpress\WordPressComponentSettingsRepository;
use ROITheme\Shared\Infrastructure\Services\WordPressValidationService; use ROITheme\Shared\Infrastructure\Services\WordPressValidationService;
use ROITheme\Shared\Infrastructure\Services\WordPressCacheService; use ROITheme\Shared\Infrastructure\Services\WordPressCacheService;
use ROITheme\Shared\Infrastructure\Services\SchemaSyncService; use ROITheme\Shared\Infrastructure\Services\SchemaSyncService;

View File

@@ -9,7 +9,7 @@ use ROITheme\Shared\Application\UseCases\GetComponent\GetComponentUseCase;
use ROITheme\Shared\Application\UseCases\GetComponent\GetComponentRequest; use ROITheme\Shared\Application\UseCases\GetComponent\GetComponentRequest;
use ROITheme\Shared\Application\UseCases\DeleteComponent\DeleteComponentUseCase; use ROITheme\Shared\Application\UseCases\DeleteComponent\DeleteComponentUseCase;
use ROITheme\Shared\Application\UseCases\DeleteComponent\DeleteComponentRequest; use ROITheme\Shared\Application\UseCases\DeleteComponent\DeleteComponentRequest;
use ROITheme\Shared\Infrastructure\DI\DIContainer; use ROITheme\Shared\Infrastructure\Di\DIContainer;
/** /**
* ComponentManager - Facade para el sistema * ComponentManager - Facade para el sistema

View File

@@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace ROITheme\Shared\Infrastructure\Persistence\WordPress; namespace ROITheme\Shared\Infrastructure\Persistence\Wordpress;
use ROITheme\Shared\Domain\Entities\Component; use ROITheme\Shared\Domain\Entities\Component;
use ROITheme\Shared\Domain\ValueObjects\ComponentName; use ROITheme\Shared\Domain\ValueObjects\ComponentName;

View File

@@ -2,12 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
namespace ROITheme\Shared\Infrastructure\Persistence\WordPress; namespace ROITheme\Shared\Infrastructure\Persistence\Wordpress;
use ROITheme\Shared\Domain\Contracts\ComponentSettingsRepositoryInterface; use ROITheme\Shared\Domain\Contracts\ComponentSettingsRepositoryInterface;
/** /**
* Implementaci<63>n de repositorio de configuraciones usando WordPress/MySQL * Implementaci<63>n de repositorio de configuraciones usando WordPress/MySQL
* *
* Infrastructure Layer - WordPress specific * Infrastructure Layer - WordPress specific
* Trabaja con la tabla wp_roi_theme_component_settings * Trabaja con la tabla wp_roi_theme_component_settings
@@ -50,7 +50,7 @@ final class WordPressComponentSettingsRepository implements ComponentSettingsRep
$attributeName = $row['attribute_name']; $attributeName = $row['attribute_name'];
$value = $row['attribute_value']; $value = $row['attribute_value'];
// Convertir valores seg<65>n tipo // Convertir valores seg<65>n tipo
$value = $this->unserializeValue($value); $value = $this->unserializeValue($value);
if (!isset($settings[$groupName])) { if (!isset($settings[$groupName])) {
@@ -202,7 +202,7 @@ final class WordPressComponentSettingsRepository implements ComponentSettingsRep
return $value === '1'; return $value === '1';
} }
// Devolver como est<73> // Devolver como est<73>
return $value; return $value;
} }
} }

View File

@@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace ROITheme\Shared\Infrastructure\Persistence\WordPress; namespace ROITheme\Shared\Infrastructure\Persistence\Wordpress;
use ROITheme\Shared\Domain\Contracts\ComponentDefaultsRepositoryInterface; use ROITheme\Shared\Domain\Contracts\ComponentDefaultsRepositoryInterface;
use ROITheme\Shared\Domain\ValueObjects\ComponentName; use ROITheme\Shared\Domain\ValueObjects\ComponentName;

View File

@@ -3,8 +3,8 @@ declare(strict_types=1);
namespace ROITheme\Shared\Infrastructure\Services; namespace ROITheme\Shared\Infrastructure\Services;
use ROITheme\Component\Infrastructure\Persistence\WordPress\WordPressComponentRepository; use ROITheme\Component\Infrastructure\Persistence\Wordpress\WordPressComponentRepository;
use ROITheme\Component\Infrastructure\Persistence\WordPress\WordPressDefaultsRepository; use ROITheme\Component\Infrastructure\Persistence\Wordpress\WordPressDefaultsRepository;
/** /**
* CleanupService - Limpieza de componentes obsoletos * CleanupService - Limpieza de componentes obsoletos

View File

@@ -3,7 +3,7 @@ declare(strict_types=1);
namespace ROITheme\Shared\Infrastructure\Services; namespace ROITheme\Shared\Infrastructure\Services;
use ROITheme\Shared\Infrastructure\Persistence\WordPress\WordPressDefaultsRepository; use ROITheme\Shared\Infrastructure\Persistence\Wordpress\WordPressDefaultsRepository;
/** /**
* SchemaSyncService - Sincronizar schemas JSON → BD * SchemaSyncService - Sincronizar schemas JSON → BD

View File

@@ -5,7 +5,7 @@ namespace ROITheme\Shared\Infrastructure\Services;
use ROITheme\Shared\Domain\Contracts\ValidationServiceInterface; use ROITheme\Shared\Domain\Contracts\ValidationServiceInterface;
use ROITheme\Shared\Domain\ValidationResult; use ROITheme\Shared\Domain\ValidationResult;
use ROITheme\Component\Infrastructure\Persistence\WordPress\WordPressDefaultsRepository; use ROITheme\Component\Infrastructure\Persistence\Wordpress\WordPressDefaultsRepository;
/** /**
* WordPressValidationService - Validación contra schemas * WordPressValidationService - Validación contra schemas