From a8565c8cb8b09a9ad47f71b07287bf48335a0fe4 Mon Sep 17 00:00:00 2001 From: Robert Kujawa Date: Fri, 28 Jun 2024 09:11:35 -0600 Subject: [PATCH] Refactor `ServiceConfig::class` --- src/Console/Commands/OrchestrateProvider.php | 12 +- src/Console/Commands/OrchestrateService.php | 16 +-- src/Drivers/ConfigDriver.php | 4 +- src/Drivers/DatabaseDriver.php | 6 +- src/Fluent/Account.php | 4 +- src/Fluent/Provider.php | 3 +- src/Fluent/ServiceConfig.php | 81 ------------- src/Models/Account.php | 4 +- src/Models/Provider.php | 4 +- src/Service.php | 6 +- src/ServiceConfig.php | 107 ++++++++++++++++++ src/ServiceDriver.php | 8 +- tests/Contracts/CreatesServiceables.php | 10 +- .../Config/OrchestrateServiceCommandTest.php | 2 +- .../OrchestrateServiceCommandTest.php | 2 +- .../TestOrchestrateProviderCommand.php | 7 +- .../Console/TestOrchestrateServiceCommand.php | 2 +- tests/Traits/AssertsServiceExists.php | 2 +- tests/Traits/CreatesConfigServiceables.php | 6 +- tests/Traits/CreatesDatabaseServiceables.php | 6 +- tests/Traits/CreatesServices.php | 6 +- tests/Unit/ServiceConfigTest.php | 2 +- 22 files changed, 164 insertions(+), 136 deletions(-) delete mode 100644 src/Fluent/ServiceConfig.php create mode 100644 src/ServiceConfig.php diff --git a/src/Console/Commands/OrchestrateProvider.php b/src/Console/Commands/OrchestrateProvider.php index 9e3b49b..4cd95bf 100644 --- a/src/Console/Commands/OrchestrateProvider.php +++ b/src/Console/Commands/OrchestrateProvider.php @@ -4,7 +4,7 @@ use Illuminate\Console\Command; use Illuminate\Support\Str; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\Traits\AsksQuestions; use Payavel\Orchestration\Traits\GeneratesFiles; @@ -39,7 +39,7 @@ class OrchestrateProvider extends Command /** * The provider's service config. * - * @var \Payavel\Orchestration\Fluent\ServiceConfig + * @var \Payavel\Orchestration\ServiceConfig */ protected $serviceConfig; @@ -144,13 +144,13 @@ protected function setService() error("Service with id {$this->option('service')} does not exist."); return false; - } elseif (! isset($serviceConfig) && ($existingConfigs = ServiceConfig::all())->isNotEmpty()) { - $id = select( + } elseif (! isset($serviceConfig) && ($serviceConfigs = ServiceConfig::all())->isNotEmpty()) { + $index = select( label: 'Which service will the provider be offering?', - options: $existingConfigs->map(fn ($existingConfig) => $existingConfig->id)->all() + options: $serviceConfigs->map(fn ($serviceConfig) => $serviceConfig->id)->all() ); - $serviceConfig = $existingConfigs->all()[$id]; + $serviceConfig = $serviceConfigs->get($index); } if (! isset($serviceConfig)) { diff --git a/src/Console/Commands/OrchestrateService.php b/src/Console/Commands/OrchestrateService.php index 35a550b..5d408a1 100644 --- a/src/Console/Commands/OrchestrateService.php +++ b/src/Console/Commands/OrchestrateService.php @@ -5,7 +5,7 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\Config; use Illuminate\Support\Str; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\Traits\AsksQuestions; use Payavel\Orchestration\Traits\GeneratesFiles; @@ -39,7 +39,7 @@ class OrchestrateService extends Command /** * The service config. * - * @var \Payavel\Orchestration\Fluent\ServiceConfig + * @var \Payavel\Orchestration\ServiceConfig */ protected $serviceConfig; @@ -163,10 +163,12 @@ protected function generateProviders() */ protected function setServiceConfig() { - $this->serviceConfig = new ServiceConfig([ - 'name' => $name = trim($this->argument('service') ?? $this->askName('service')), - 'id' => $this->option('id') ?? $this->askId('service', $name), - ]); + $name = trim($this->argument('service') ?? $this->askName('service')); + $id = $this->option('id') ?? $this->askId('service', $name); + + Config::set("orchestration.services.{$id}", Str::slug($id)); + + $this->serviceConfig = tap(ServiceConfig::find($id), fn ($serviceConfig) => $serviceConfig->set('name', $name)); } /** @@ -251,8 +253,6 @@ protected function setAccounts() */ protected function makeSureOrchestraIsReady() { - Config::set("orchestration.services.{$this->serviceConfig->id}", Str::slug($this->serviceConfig->id)); - if (file_exists(config_path('orchestration.php'))) { return; } diff --git a/src/Drivers/ConfigDriver.php b/src/Drivers/ConfigDriver.php index a3e5736..cf089e6 100644 --- a/src/Drivers/ConfigDriver.php +++ b/src/Drivers/ConfigDriver.php @@ -10,7 +10,7 @@ use Payavel\Orchestration\Contracts\Providable; use Payavel\Orchestration\Fluent\Account; use Payavel\Orchestration\Fluent\Provider; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\ServiceDriver; use Payavel\Orchestration\Traits\GeneratesFiles; @@ -169,7 +169,7 @@ public function resolveGateway(Providable $provider, Accountable $account) /** * Generate the service skeleton based on the current driver. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param \Illuminate\Support\Collection $providers * @param \Illuminate\Support\Collection $accounts * @param array $defaults diff --git a/src/Drivers/DatabaseDriver.php b/src/Drivers/DatabaseDriver.php index 5dbe750..03c7e5b 100644 --- a/src/Drivers/DatabaseDriver.php +++ b/src/Drivers/DatabaseDriver.php @@ -10,9 +10,9 @@ use Illuminate\Support\Str; use Payavel\Orchestration\Contracts\Accountable; use Payavel\Orchestration\Contracts\Providable; -use Payavel\Orchestration\Fluent\ServiceConfig; use Payavel\Orchestration\Models\Account; use Payavel\Orchestration\Models\Provider; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\ServiceDriver; use Payavel\Orchestration\Traits\GeneratesFiles; @@ -123,7 +123,7 @@ public function resolveGateway(Providable $provider, Accountable $account) $this->check($provider, $account); $gateway = $this->serviceConfig->get('test_mode') - ? $this->serviceConfig->test_gateway + ? $this->serviceConfig->get('test_gateway') : $provider->gateway; if (! class_exists($gateway)) { @@ -140,7 +140,7 @@ public function resolveGateway(Providable $provider, Accountable $account) /** * Generate the service skeleton based on the current driver. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param \Illuminate\Support\Collection $providers * @param \Illuminate\Support\Collection $accounts * @param array $defaults diff --git a/src/Fluent/Account.php b/src/Fluent/Account.php index ef86fe8..9f0d733 100644 --- a/src/Fluent/Account.php +++ b/src/Fluent/Account.php @@ -2,16 +2,16 @@ namespace Payavel\Orchestration\Fluent; -use Illuminate\Support\Collection; use Illuminate\Support\Fluent; use Payavel\Orchestration\Contracts\Accountable; +use Payavel\Orchestration\ServiceConfig; class Account extends Fluent implements Accountable { /** * The service config. * - * @var \Payavel\Orchestration\Fluent\ServiceConfig + * @var \Payavel\Orchestration\ServiceConfig */ private ServiceConfig $serviceConfig; diff --git a/src/Fluent/Provider.php b/src/Fluent/Provider.php index b899510..fcb756c 100644 --- a/src/Fluent/Provider.php +++ b/src/Fluent/Provider.php @@ -4,13 +4,14 @@ use Illuminate\Support\Fluent; use Payavel\Orchestration\Contracts\Providable; +use Payavel\Orchestration\ServiceConfig; class Provider extends Fluent implements Providable { /** * The service config. * - * @var \Payavel\Orchestration\Fluent\ServiceConfig + * @var \Payavel\Orchestration\ServiceConfig */ public ServiceConfig $serviceConfig; diff --git a/src/Fluent/ServiceConfig.php b/src/Fluent/ServiceConfig.php deleted file mode 100644 index 09a7d51..0000000 --- a/src/Fluent/ServiceConfig.php +++ /dev/null @@ -1,81 +0,0 @@ -attributes, $key, fn () => Config::get('orchestration.'.$key, $default)); - } - - /** - * Set an attribute to the fluent instance using "dot" notation. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function set($key, $value) - { - data_set($this->attributes, $key, $value); - - $this->setConfig($key, $value); - } - - /** - * Update the service config with he provided key/value pair. - * - * @param string $key - * @param mixed $value - * @return void - */ - private function setConfig($key, $value) - { - $config = Config::get('orchestration.services.'.$this->id, Str::slug($this->id)); - - Config::set( - (is_array($config) ? 'orchestration.services.'.$this->id : $config).'.'.$key, - $value - ); - } - - /** - * Get all of the orchestration service configs. - * - * @return \Illuminate\Support\Collection - */ - public static function all() - { - return (new Collection(Config::get('orchestration.services', [])))->map( - fn ($value, $key) => new static(array_merge(['id' => $key], is_array($value) ? $value : Config::get($value))) - )->values(); - } - - /** - * Get the service's config by it's id. - * - * @param string $id - * @return static - */ - public static function find($id) - { - if (is_null($config = Config::get("orchestration.services.{$id}"))) { - return null; - } - - return new static(array_merge(['id' => $id], is_array($config) ? $config : Config::get($config, []))); - } -} diff --git a/src/Models/Account.php b/src/Models/Account.php index f1e1d32..b1545b6 100644 --- a/src/Models/Account.php +++ b/src/Models/Account.php @@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; use Payavel\Orchestration\Contracts\Accountable; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\Traits\HasFactory; class Account extends Model implements Accountable @@ -29,7 +29,7 @@ class Account extends Model implements Accountable /** * The service config. * - * @var \Payavel\Orchestration\Fluent\ServiceConfig + * @var \Payavel\Orchestration\ServiceConfig */ private ServiceConfig $serviceConfig; diff --git a/src/Models/Provider.php b/src/Models/Provider.php index 77d6a43..564ac7c 100644 --- a/src/Models/Provider.php +++ b/src/Models/Provider.php @@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; use Payavel\Orchestration\Contracts\Providable; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\Traits\HasFactory; class Provider extends Model implements Providable @@ -29,7 +29,7 @@ class Provider extends Model implements Providable /** * The service config. * - * @var \Payavel\Orchestration\Fluent\ServiceConfig + * @var \Payavel\Orchestration\ServiceConfig */ private ServiceConfig $serviceConfig; diff --git a/src/Service.php b/src/Service.php index 43b0113..30e9400 100644 --- a/src/Service.php +++ b/src/Service.php @@ -3,7 +3,7 @@ namespace Payavel\Orchestration; use Exception; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\Traits\SimulatesAttributes; class Service @@ -13,7 +13,7 @@ class Service /** * The service config. * - * @var \Payavel\Orchestration\Fluent\ServiceConfig + * @var \Payavel\Orchestration\ServiceConfig */ private $config; @@ -48,7 +48,7 @@ class Service /** * Sets the service config and the driver for it. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig|string|int $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig|string|int $serviceConfig * @return void * * @throws Exception diff --git a/src/ServiceConfig.php b/src/ServiceConfig.php new file mode 100644 index 0000000..e09ef25 --- /dev/null +++ b/src/ServiceConfig.php @@ -0,0 +1,107 @@ +id = $id; + + if (is_null($config = Config::get("orchestration.services.{$id}"))) { + throw new RuntimeException("Service with id {$id} does not exist."); + } + + $this->config = is_array($config) ? "orchestration.services.{$id}" : $config; + } + + /** + * Get an attribute from the fluent instance using "dot" notation. + * + * @param string $key + * @param string|int|mixed|null $default + * @return string|int|mixed|null + */ + public function get($key, $default = null) + { + return Config::get("{$this->config}.{$key}", fn () => Config::get('orchestration.'.$key, $default)); + } + + /** + * Set an attribute to the fluent instance using "dot" notation. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function set($key, $value) + { + Config::set("{$this->config}.{$key}", $value); + } + + /** + * Get the service id. + * + * @return string|int + */ + public function getId() + { + return $this->id; + } + + /** + * Get the service name. + * + * @return string + */ + public function getName() + { + return $this->get('name', $this->id); + } + + /** + * Get all of the orchestration service ids. + * + * @return \Illuminate\Support\Collection + */ + public static function all() + { + return Collection::make(Config::get('orchestration.services', []))->keys()->map(fn ($id) => new static($id)); + } + + /** + * Get the service's config by it's id. + * + * @param string|int $id + * @return static|null + */ + public static function find($id) + { + try { + return new static($id); + } catch (RuntimeException $e) { + return null; + } + } +} diff --git a/src/ServiceDriver.php b/src/ServiceDriver.php index 2601a74..c53e650 100644 --- a/src/ServiceDriver.php +++ b/src/ServiceDriver.php @@ -5,21 +5,21 @@ use Illuminate\Support\Collection; use Payavel\Orchestration\Contracts\Accountable; use Payavel\Orchestration\Contracts\Providable; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; abstract class ServiceDriver { /** * The service's config. * - * @var \Payavel\Orchestration\Fluent\ServiceConfig + * @var \Payavel\Orchestration\ServiceConfig */ protected ServiceConfig $serviceConfig; /** * Set's the service's config. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @return void */ public function __construct(ServiceConfig $serviceConfig) @@ -81,7 +81,7 @@ abstract public function resolveGateway(Providable $provider, Accountable $accou /** * Generate the service skeleton based on the current driver. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param \Illuminate\Support\Collection $providers * @param \Illuminate\Support\Collection $accounts * @param array $defaults diff --git a/tests/Contracts/CreatesServiceables.php b/tests/Contracts/CreatesServiceables.php index 98db9c1..8d43f22 100644 --- a/tests/Contracts/CreatesServiceables.php +++ b/tests/Contracts/CreatesServiceables.php @@ -4,7 +4,7 @@ use Payavel\Orchestration\Contracts\Accountable; use Payavel\Orchestration\Contracts\Providable; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; interface CreatesServiceables { @@ -12,14 +12,14 @@ interface CreatesServiceables * Creates a service config instance. * * @param array $data - * @return \Payavel\Orchestration\Fluent\ServiceConfig + * @return \Payavel\Orchestration\ServiceConfig */ public function createServiceConfig($data = []); /** * Creates a providable instance. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param array $data * @return \Payavel\Orchestration\Contracts\Providable */ @@ -28,7 +28,7 @@ public function createProvider(ServiceConfig $serviceConfig, $data = []); /** * Creates an accountable instance. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param array $data * @return \Payavel\Orchestration\Contracts\Accountable */ @@ -47,7 +47,7 @@ public function linkAccountToProvider(Accountable $account, Providable $provider /** * Sets the default configuration for a service. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param Accountable|null $account * @param Providable|null $provider * @return void diff --git a/tests/Feature/Console/Config/OrchestrateServiceCommandTest.php b/tests/Feature/Console/Config/OrchestrateServiceCommandTest.php index 51eaa9d..06598e7 100644 --- a/tests/Feature/Console/Config/OrchestrateServiceCommandTest.php +++ b/tests/Feature/Console/Config/OrchestrateServiceCommandTest.php @@ -5,7 +5,7 @@ use Illuminate\Support\Str; use Payavel\Orchestration\Contracts\Accountable; use Payavel\Orchestration\Contracts\Providable; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\Tests\Feature\Console\TestOrchestrateServiceCommand; use Payavel\Orchestration\Tests\Traits\CreatesConfigServiceables; use Payavel\Orchestration\Tests\Traits\SetsConfigDriver; diff --git a/tests/Feature/Console/Database/OrchestrateServiceCommandTest.php b/tests/Feature/Console/Database/OrchestrateServiceCommandTest.php index fa8b705..1b895a7 100644 --- a/tests/Feature/Console/Database/OrchestrateServiceCommandTest.php +++ b/tests/Feature/Console/Database/OrchestrateServiceCommandTest.php @@ -5,9 +5,9 @@ use Illuminate\Support\Str; use Payavel\Orchestration\Contracts\Accountable; use Payavel\Orchestration\Contracts\Providable; -use Payavel\Orchestration\Fluent\ServiceConfig; use Payavel\Orchestration\Models\Account; use Payavel\Orchestration\Models\Provider; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\Tests\Feature\Console\TestOrchestrateServiceCommand; use Payavel\Orchestration\Tests\Traits\CreatesDatabaseServiceables; use Payavel\Orchestration\Tests\Traits\SetsDatabaseDriver; diff --git a/tests/Feature/Console/TestOrchestrateProviderCommand.php b/tests/Feature/Console/TestOrchestrateProviderCommand.php index ce4d460..54ea851 100644 --- a/tests/Feature/Console/TestOrchestrateProviderCommand.php +++ b/tests/Feature/Console/TestOrchestrateProviderCommand.php @@ -2,7 +2,8 @@ namespace Payavel\Orchestration\Tests\Feature\Console; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Illuminate\Support\Collection; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\Tests\Contracts\CreatesServiceables; use Payavel\Orchestration\Tests\TestCase; use Payavel\Orchestration\Tests\Traits\AssertsServiceExists; @@ -20,13 +21,13 @@ public function orchestrate_provider_command_will_prompt_for_missing_arguments() $serviceConfig = $this->createServiceConfig(); $provider = $this->createProvider($serviceConfig); - $configs = ServiceConfig::all()->map(fn ($config) => $config->id); + $serviceConfigs = ServiceConfig::all()->map(fn ($serviceConfig) => $serviceConfig->id); $gateway = $this->gatewayPath($serviceConfig, $provider); $ds = DIRECTORY_SEPARATOR; $this->artisan('orchestrate:provider') - ->expectsQuestion('Which service will the provider be offering?', $configs->search($serviceConfig->getId())) + ->expectsQuestion('Which service will the provider be offering?', $serviceConfigs->search($serviceConfig->id)) ->expectsQuestion("How should the {$serviceConfig->name} provider be named?", $provider->getName()) ->expectsQuestion("How should the {$serviceConfig->name} provider be identified?", $provider->getId()) ->expectsOutputToContain("Gateway [app{$ds}{$gateway->request}] created successfully.") diff --git a/tests/Feature/Console/TestOrchestrateServiceCommand.php b/tests/Feature/Console/TestOrchestrateServiceCommand.php index a8bf121..e3885dc 100644 --- a/tests/Feature/Console/TestOrchestrateServiceCommand.php +++ b/tests/Feature/Console/TestOrchestrateServiceCommand.php @@ -5,7 +5,7 @@ use Illuminate\Support\Facades\Config; use Payavel\Orchestration\Contracts\Accountable; use Payavel\Orchestration\Contracts\Providable; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\Tests\Contracts\CreatesServiceables; use Payavel\Orchestration\Tests\TestCase; use Payavel\Orchestration\Tests\Traits\AssertsServiceExists; diff --git a/tests/Traits/AssertsServiceExists.php b/tests/Traits/AssertsServiceExists.php index 16f921a..67f615e 100644 --- a/tests/Traits/AssertsServiceExists.php +++ b/tests/Traits/AssertsServiceExists.php @@ -5,7 +5,7 @@ use Illuminate\Support\Fluent; use Illuminate\Support\Str; use Payavel\Orchestration\Contracts\Providable; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; trait AssertsServiceExists { diff --git a/tests/Traits/CreatesConfigServiceables.php b/tests/Traits/CreatesConfigServiceables.php index 0fd72a4..8b11c01 100644 --- a/tests/Traits/CreatesConfigServiceables.php +++ b/tests/Traits/CreatesConfigServiceables.php @@ -7,7 +7,7 @@ use Payavel\Orchestration\Contracts\Providable; use Payavel\Orchestration\Fluent\Account; use Payavel\Orchestration\Fluent\Provider; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; use RuntimeException; trait CreatesConfigServiceables @@ -15,7 +15,7 @@ trait CreatesConfigServiceables /** * Creates a providable instance. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param array $data * @return \Payavel\Orchestration\Contracts\Providable */ @@ -39,7 +39,7 @@ public function createProvider(ServiceConfig $serviceConfig, $data = []) /** * Creates a accountable instance. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param array $data * @return \Payavel\Orchestration\Contracts\Accountable */ diff --git a/tests/Traits/CreatesDatabaseServiceables.php b/tests/Traits/CreatesDatabaseServiceables.php index 7d5eab2..6f60e26 100644 --- a/tests/Traits/CreatesDatabaseServiceables.php +++ b/tests/Traits/CreatesDatabaseServiceables.php @@ -4,9 +4,9 @@ use Payavel\Orchestration\Contracts\Accountable; use Payavel\Orchestration\Contracts\Providable; -use Payavel\Orchestration\Fluent\ServiceConfig; use Payavel\Orchestration\Models\Account; use Payavel\Orchestration\Models\Provider; +use Payavel\Orchestration\ServiceConfig; use RuntimeException; trait CreatesDatabaseServiceables @@ -14,7 +14,7 @@ trait CreatesDatabaseServiceables /** * Creates a providable instance. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param array $data * @return \Payavel\Orchestration\Contracts\Providable */ @@ -28,7 +28,7 @@ public function createProvider(ServiceConfig $serviceConfig, $data = []) /** * Creates a accountable instance. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param array $data * @return \Payavel\Orchestration\Contracts\Accountable */ diff --git a/tests/Traits/CreatesServices.php b/tests/Traits/CreatesServices.php index 829f735..97439b8 100644 --- a/tests/Traits/CreatesServices.php +++ b/tests/Traits/CreatesServices.php @@ -7,7 +7,7 @@ use Illuminate\Support\Str; use Payavel\Orchestration\Contracts\Accountable; use Payavel\Orchestration\Contracts\Providable; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; trait CreatesServices { @@ -15,7 +15,7 @@ trait CreatesServices * Creates a service config instance. * * @param array $data - * @return \Payavel\Orchestration\Fluent\ServiceConfig + * @return \Payavel\Orchestration\ServiceConfig */ public function createServiceConfig($data = []) { @@ -36,7 +36,7 @@ public function createServiceConfig($data = []) /** * Sets the defaults for the service config. * - * @param \Payavel\Orchestration\Fluent\ServiceConfig $serviceConfig + * @param \Payavel\Orchestration\ServiceConfig $serviceConfig * @param Accountable|null $account * @param Providable|null $provider * @return void diff --git a/tests/Unit/ServiceConfigTest.php b/tests/Unit/ServiceConfigTest.php index de3704c..8ed9836 100644 --- a/tests/Unit/ServiceConfigTest.php +++ b/tests/Unit/ServiceConfigTest.php @@ -3,7 +3,7 @@ namespace Payavel\Orchestration\Tests\Unit; use Illuminate\Support\Facades\Config; -use Payavel\Orchestration\Fluent\ServiceConfig; +use Payavel\Orchestration\ServiceConfig; use Payavel\Orchestration\Tests\TestCase; use PHPUnit\Framework\Attributes\Test;