feat(compat): sweep of components against the real core with strict diagnostics
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
// Router de compatibilidad del paquete text (inyectado en src/Routers/Compat.php
|
||||
// por scripts/compat-sweep). Ejercita Filter y Replacement sobre el arranque
|
||||
// real del core (Loader -> Router::apply()).
|
||||
|
||||
use Libs\Filter;
|
||||
use Libs\Replacement;
|
||||
use Libs\Router;
|
||||
|
||||
Router::get('/compat/text/filter', function () {
|
||||
Filter::add(
|
||||
fn (string $content): string => str_replace('mundo', 'MUNDIN', $content),
|
||||
'compat',
|
||||
5
|
||||
);
|
||||
Filter::add(
|
||||
fn (string $content): string => strtoupper($content) . '|',
|
||||
'compat',
|
||||
20
|
||||
);
|
||||
echo 'FILTER_OK:' . Filter::apply('hola mundo', 'compat');
|
||||
});
|
||||
|
||||
Router::get('/compat/text/replacement', function () {
|
||||
Replacement::add('/\bfoo\b/', 'bar');
|
||||
echo 'REPL_OK:' . Replacement::apply('foo y food y foo');
|
||||
});
|
||||
Reference in New Issue
Block a user