Skip to content

Commit

Permalink
Rename ScopeName to Spiral and mark it internal
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Feb 29, 2024
1 parent 49cbd81 commit 428b1d9
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/Core/tests/Attribute/ScopeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Spiral\Core\Attribute\Scope;
use Spiral\Framework\ScopeName;
use Spiral\Framework\Spiral;
use Spiral\Tests\Core\Fixtures\ScopeEnum;

final class ScopeTest extends TestCase
Expand All @@ -23,7 +23,7 @@ public function testScope(string|\BackedEnum $name, string $expected): void
public static function scopeNameDataProvider(): \Traversable
{
yield ['foo', 'foo'];
yield [ScopeName::HttpRequest, 'http.request'];
yield [Spiral::HttpRequest, 'http.request'];
yield [ScopeEnum::A, 'a'];
}
}
4 changes: 2 additions & 2 deletions src/Core/tests/Scope/UseCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Spiral\Core\Config\Shared;
use Spiral\Core\Container;
use Spiral\Core\Scope;
use Spiral\Framework\ScopeName;
use Spiral\Framework\Spiral;
use Spiral\Tests\Core\Fixtures\Bucket;
use Spiral\Tests\Core\Fixtures\Factory;
use Spiral\Tests\Core\Fixtures\SampleClass;
Expand Down Expand Up @@ -406,7 +406,7 @@ public function testHasInParentScopeWithScopeAttribute(): void

public static function scopeEnumDataProvider(): \Traversable
{
yield [ScopeName::HttpRequest, 'http.request'];
yield [Spiral::HttpRequest, 'http.request'];
yield [ScopeEnum::A, 'a'];
}
}
4 changes: 2 additions & 2 deletions src/Framework/Console/ConsoleDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Spiral\Console\Logger\DebugListener;
use Spiral\Exceptions\ExceptionHandlerInterface;
use Spiral\Exceptions\Verbosity;
use Spiral\Framework\ScopeName;
use Spiral\Framework\Spiral;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\ConsoleOutput;
Expand All @@ -22,7 +22,7 @@
/**
* Manages Console commands and exception. Lazy loads console service.
*/
#[DispatcherScope(scope: ScopeName::Console)]
#[DispatcherScope(scope: Spiral::Console)]
final class ConsoleDispatcher implements DispatcherInterface
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace Spiral\Framework;

enum ScopeName: string
/**
* @internal
*/
enum Spiral: string
{
case Http = 'http';
case HttpRequest = 'http.request';
Expand Down
4 changes: 2 additions & 2 deletions tests/Framework/Attribute/DispatcherScopeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Spiral\App\Dispatcher\Scope;
use Spiral\Boot\AbstractKernel;
use Spiral\Core\Container;
use Spiral\Framework\ScopeName;
use Spiral\Framework\Spiral;
use Spiral\Tests\Framework\BaseTestCase;

final class DispatcherScopeTest extends BaseTestCase
Expand All @@ -33,7 +33,7 @@ public function testDispatcherScope(string $dispatcher, string|\BackedEnum $scop

public static function dispatchersDataProvider(): \Traversable
{
yield [DispatcherWithScopeName::class, ScopeName::Console];
yield [DispatcherWithScopeName::class, Spiral::Console];
yield [DispatcherWithCustomEnum::class, Scope::Custom];
yield [DispatcherWithStringScope::class, 'test'];
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Framework/KernelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Spiral\Boot\Exception\BootException;
use Spiral\App\TestApp;
use Spiral\Core\Container;
use Spiral\Framework\ScopeName;
use Spiral\Framework\Spiral;
use stdClass;

class KernelTest extends BaseTestCase
Expand Down Expand Up @@ -136,7 +136,7 @@ public function testDispatchersShouldBeBoundInCorrectScope(string $dispatcher, s

public static function dispatchersDataProvider(): \Traversable
{
yield [DispatcherWithScopeName::class, ScopeName::Console->value];
yield [DispatcherWithScopeName::class, Spiral::Console->value];
yield [DispatcherWithCustomEnum::class, Scope::Custom->value];
yield [DispatcherWithStringScope::class, 'test'];
}
Expand Down
4 changes: 2 additions & 2 deletions tests/app/src/Dispatcher/DispatcherWithScopeName.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Spiral\App\Dispatcher;

use Spiral\Attribute\DispatcherScope;
use Spiral\Framework\ScopeName;
use Spiral\Framework\Spiral;

#[DispatcherScope(scope: ScopeName::Console)]
#[DispatcherScope(scope: Spiral::Console)]
final class DispatcherWithScopeName extends AbstractDispatcher
{
}

0 comments on commit 428b1d9

Please sign in to comment.