Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Cli/Console/Command.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -587,11 +587,12 @@ final public function justify(string $first, ?string $second = '', array $option
'sep' => (string) ($options['sep'] ?? '.'),
];

if (preg_match('/(\\x1b(?:.+)m)/U', $first, $matches)) {
while (preg_match('/(\\x1b(?:.+)m)/U', $first, $matches)) {
$first = str_replace($matches[1], '', $first);
$first = preg_replace('/\\x1b\[0m/', '', $first);
}
if (preg_match('/(\\x1b(?:.+)m)/U', $second, $matches)) {

while (preg_match('/(\\x1b(?:.+)m)/U', $second, $matches)) {
$second = str_replace($matches[1], '', $second);
$second = preg_replace('/\\x1b\[0m/', '', $second);
}
Expand Down
35 changes: 20 additions & 15 deletions src/Config/Providers.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,6 +17,8 @@
use BlitzPHP\Cache\ResponseCache;
use BlitzPHP\Container\AbstractProvider;
use BlitzPHP\Contracts\Autoloader\LocatorInterface;
use BlitzPHP\Contracts\Cache\CacheInterface;
use BlitzPHP\Contracts\Cache\RepositoryInterface;
use BlitzPHP\Contracts\Container\ContainerInterface;
use BlitzPHP\Contracts\Event\EventManagerInterface;
use BlitzPHP\Contracts\Mail\MailerInterface;
Expand All@@ -36,10 +38,11 @@
use BlitzPHP\Session\Cookie\CookieManager;
use BlitzPHP\Session\Store;
use BlitzPHP\Translator\Translate;
use Psr\Container\ContainerInterface as PsrContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Log\LoggerInterface;
use Psr\SimpleCache\CacheInterface;
use Psr\SimpleCache\CacheInterface as PsrCacheInterface;

class Providers extends AbstractProvider
{
Expand All@@ -57,20 +60,22 @@ public static function definitions(): array
private static function interfaces(): array
{
return [
LocatorInterface::class => static fn () => service('locator'),
ContainerInterface::class => static fn () => service('container'),
EventManagerInterface::class => static fn () => service('event'),
MailerInterface::class => static fn () => service('mail'),
RouteCollectionInterface::class => static fn () => service('routes'),
EncrypterInterface::class => static fn () => service('encrypter'),
CookieManagerInterface::class => static fn () => service('cookie'),
SessionInterface::class => static fn () => service('session'),
RendererInterface::class => static fn () => service('viewer')->getAdapter(),
\Psr\Container\ContainerInterface::class => static fn () => service('container'),
ResponseInterface::class => static fn () => service('response'),
ServerRequestInterface::class => static fn () => service('request'),
LoggerInterface::class => static fn () => service('logger'),
CacheInterface::class => static fn () => service('cache'),
CacheInterface::class => static fn () => service('cache'),
PsrCacheInterface::class => static fn () => service('cache'),
ContainerInterface::class => static fn () => service('container'),
PsrContainerInterface::class => static fn () => service('container'),
CookieManagerInterface::class => static fn () => service('cookie'),
EncrypterInterface::class => static fn () => service('encrypter'),
EventManagerInterface::class => static fn () => service('event'),
LocatorInterface::class => static fn () => service('locator'),
LoggerInterface::class => static fn () => service('logger'),
MailerInterface::class => static fn () => service('mail'),
RendererInterface::class => static fn () => service('viewer')->getAdapter(),
RepositoryInterface::class => static fn () => service('cache'),
ResponseInterface::class => static fn () => service('response'),
RouteCollectionInterface::class => static fn () => service('routes'),
ServerRequestInterface::class => static fn () => service('request'),
SessionInterface::class => static fn () => service('session'),
];
}

Expand Down