Fase 1: Estructura Base y DI Container - Clean Architecture

COMPLETADO: Fase 1 de la migración a Clean Architecture + POO

## Estructura de Carpetas
- ✓ Estructura completa de 4 capas (Domain, Application, Infrastructure, Presentation)
- ✓ Carpetas de Use Cases (SaveComponent, GetComponent, DeleteComponent, SyncSchema)
- ✓ Estructura de tests (Unit, Integration, E2E)
- ✓ Carpetas de schemas y templates

## Composer y Autoloading
- ✓ PSR-4 autoloading configurado para ROITheme namespace
- ✓ Autoloader optimizado regenerado

## DI Container
- ✓ DIContainer implementado con patrón Singleton
- ✓ Métodos set(), get(), has() para gestión de servicios
- ✓ Getters específicos para ComponentRepository, ValidationService, CacheService
- ✓ Placeholders que serán implementados en Fase 5
- ✓ Prevención de clonación y deserialización

## Interfaces
- ✓ ComponentRepositoryInterface (Domain)
- ✓ ValidationServiceInterface (Application)
- ✓ CacheServiceInterface (Application)
- ✓ Component entity placeholder (Domain)

## Bootstrap
- ✓ functions.php actualizado con carga de Composer autoloader
- ✓ Inicialización del DIContainer
- ✓ Helper function roi_container() disponible globalmente

## Tests
- ✓ 10 tests unitarios para DIContainer (100% cobertura)
- ✓ Total: 13 tests unitarios, 28 assertions
- ✓ Suite de tests pasando correctamente

## Validación
- ✓ Script de validación automatizado (48/48 checks pasados)
- ✓ 100% de validaciones exitosas

La arquitectura base está lista para la Fase 2.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
FrankZamora
2025-11-17 13:48:24 -06:00
parent b782ebceee
commit de5fff4f5c
149 changed files with 3187 additions and 9554 deletions

View File

@@ -21,7 +21,7 @@ if (!defined('ABSPATH')) {
* @param string $content El contenido del post
* @return string El contenido procesado
*/
function apus_process_apu_tables($content) {
function roi_process_apu_tables($content) {
// Verificar que haya contenido
if (empty($content)) {
return $content;
@@ -45,7 +45,7 @@ function apus_process_apu_tables($content) {
return $content;
}
add_filter('the_content', 'apus_process_apu_tables', 20);
add_filter('the_content', 'roi_process_apu_tables', 20);
/**
* Shortcode: [apu_table]
@@ -63,7 +63,7 @@ add_filter('the_content', 'apus_process_apu_tables', 20);
* @param string $content Contenido del shortcode
* @return string HTML procesado
*/
function apus_apu_table_shortcode($atts, $content = null) {
function roi_apu_table_shortcode($atts, $content = null) {
// Verificar que haya contenido
if (empty($content)) {
return '';
@@ -75,7 +75,7 @@ function apus_apu_table_shortcode($atts, $content = null) {
// Envolver con la clase .analisis
return '<div class="analisis">' . $content . '</div>';
}
add_shortcode('apu_table', 'apus_apu_table_shortcode');
add_shortcode('apu_table', 'roi_apu_table_shortcode');
/**
* Shortcode: [apu_row type="tipo"]
@@ -100,7 +100,7 @@ add_shortcode('apu_table', 'apus_apu_table_shortcode');
* @param string $content Contenido del shortcode
* @return string HTML procesado
*/
function apus_apu_row_shortcode($atts, $content = null) {
function roi_apu_row_shortcode($atts, $content = null) {
// Atributos por defecto
$atts = shortcode_atts(
array(
@@ -141,7 +141,7 @@ function apus_apu_row_shortcode($atts, $content = null) {
return '<tr>' . $content . '</tr>';
}
}
add_shortcode('apu_row', 'apus_apu_row_shortcode');
add_shortcode('apu_row', 'roi_apu_row_shortcode');
/**
* Función helper para generar una tabla APU completa
@@ -175,7 +175,7 @@ add_shortcode('apu_row', 'apus_apu_row_shortcode');
* 'total' => '$3,283.52'
* )
*/
function apus_generate_apu_table($data) {
function roi_generate_apu_table($data) {
// Validar datos mínimos
if (empty($data) || !isset($data['sections'])) {
return '';
@@ -268,7 +268,7 @@ function apus_generate_apu_table($data) {
* @param array $classes Array de clases del body
* @return array Array modificado de clases
*/
function apus_add_apu_body_class($classes) {
function roi_add_apu_body_class($classes) {
// Solo en posts individuales
if (is_single()) {
global $post;
@@ -283,7 +283,7 @@ function apus_add_apu_body_class($classes) {
return $classes;
}
add_filter('body_class', 'apus_add_apu_body_class');
add_filter('body_class', 'roi_add_apu_body_class');
/**
* Permitir ciertos atributos HTML en tablas para el editor
@@ -295,7 +295,7 @@ add_filter('body_class', 'apus_add_apu_body_class');
* @param string $context Contexto de uso
* @return array Array modificado de tags permitidos
*/
function apus_allow_apu_table_attributes($allowed_tags, $context) {
function roi_allow_apu_table_attributes($allowed_tags, $context) {
if ($context === 'post') {
// Permitir atributo data-apu en tablas
if (isset($allowed_tags['table'])) {
@@ -313,4 +313,4 @@ function apus_allow_apu_table_attributes($allowed_tags, $context) {
return $allowed_tags;
}
add_filter('wp_kses_allowed_html', 'apus_allow_apu_table_attributes', 10, 2);
add_filter('wp_kses_allowed_html', 'roi_allow_apu_table_attributes', 10, 2);