Moved config post-processors to their own sub-namespace

This commit is contained in:
Alejandro Celaya 2023-01-07 13:04:46 +01:00
parent 390bc59d99
commit a06957e9fa
6 changed files with 13 additions and 8 deletions

View File

@ -48,6 +48,6 @@ return (new ConfigAggregator\ConfigAggregator([
// Routes have to be loaded last
new ConfigAggregator\PhpFileProvider('config/autoload/routes.config.php'),
], 'data/cache/app_config.php', [
Core\Config\BasePathPrefixer::class,
Core\Config\MultiSegmentSlugProcessor::class,
Core\Config\PostProcessor\BasePathPrefixer::class,
Core\Config\PostProcessor\MultiSegmentSlugProcessor::class,
]))->getMergedConfig();

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Config;
namespace Shlinkio\Shlink\Core\Config\PostProcessor;
use function Functional\map;

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Config;
namespace Shlinkio\Shlink\Core\Config\PostProcessor;
use function Functional\map;
use function str_replace;

View File

@ -17,4 +17,9 @@ enum RedirectStatus: int
{
return contains([self::STATUS_301, self::STATUS_308], $this);
}
public function isLegacyStatus(): bool
{
return contains([self::STATUS_301, self::STATUS_302], $this);
}
}

View File

@ -2,10 +2,10 @@
declare(strict_types=1);
namespace ShlinkioTest\Shlink\Core\Config;
namespace ShlinkioTest\Shlink\Core\Config\PostProcessor;
use PHPUnit\Framework\TestCase;
use Shlinkio\Shlink\Core\Config\BasePathPrefixer;
use Shlinkio\Shlink\Core\Config\PostProcessor\BasePathPrefixer;
class BasePathPrefixerTest extends TestCase
{

View File

@ -2,10 +2,10 @@
declare(strict_types=1);
namespace ShlinkioTest\Shlink\Core\Config;
namespace ShlinkioTest\Shlink\Core\Config\PostProcessor;
use PHPUnit\Framework\TestCase;
use Shlinkio\Shlink\Core\Config\MultiSegmentSlugProcessor;
use Shlinkio\Shlink\Core\Config\PostProcessor\MultiSegmentSlugProcessor;
class MultiSegmentSlugProcessorTest extends TestCase
{