Skip to content

Commit f2b6b29

Browse files
a1383nStyleCIBot
andauthored
Apply fixes from StyleCI (#7)
* Apply fixes from StyleCI * style: Fix code style issues * Delete .github/workflows/php-cs-fixer.yml * Revert "style: Fix code style issues" This reverts commit f972a09. --------- Co-authored-by: StyleCI Bot <bot@styleci.io> Co-authored-by: a1383n <a1383n@users.noreply.github.com>
1 parent f58580c commit f2b6b29

20 files changed

+69
-101
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/Contracts/EloquentSettingModelInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use LaravelEloquentSettings\Enums\SettingValueType;
66

77
/**
8-
* Interface EloquentSettingModelInterface
8+
* Interface EloquentSettingModelInterface.
99
*
1010
* This interface defines the contract that EloquentSetting models should adhere to.
1111
*/
@@ -26,7 +26,7 @@ public function getName(): string;
2626
public function getValue(): mixed;
2727

2828
/**
29-
* Set the value type
29+
* Set the value type.
3030
*
3131
* @param SettingValueType $type
3232
*

src/Contracts/HasSettingsInterface.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use LaravelEloquentSettings\SettingDefinition;
66

77
/**
8-
* Interface HasSettingsInterface
8+
* Interface HasSettingsInterface.
99
*
1010
* This interface defines the contract for models that have settings.
1111
*/
@@ -15,6 +15,7 @@ interface HasSettingsInterface
1515
* Define settings for the model.
1616
*
1717
* @param SettingDefinition $definition
18+
*
1819
* @return void
1920
*/
2021
public function defineSettings(SettingDefinition $definition): void;

src/Contracts/SettingHandlerInterface.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use LaravelEloquentSettings\SettingDefinitionEntity;
66

77
/**
8-
* Interface SettingHandlerInterface
8+
* Interface SettingHandlerInterface.
99
*
1010
* This interface defines the contract for handling settings.
1111
*/
@@ -15,7 +15,8 @@ interface SettingHandlerInterface
1515
* Create a new setting.
1616
*
1717
* @param SettingDefinitionEntity $entity
18-
* @param mixed $value
18+
* @param mixed $value
19+
*
1920
* @return void
2021
*/
2122
public function createSetting(SettingDefinitionEntity $entity, mixed $value): void;
@@ -24,7 +25,8 @@ public function createSetting(SettingDefinitionEntity $entity, mixed $value): vo
2425
* Update an existing setting.
2526
*
2627
* @param SettingDefinitionEntity $entity
27-
* @param mixed $value
28+
* @param mixed $value
29+
*
2830
* @return void
2931
*/
3032
public function updateSetting(SettingDefinitionEntity $entity, mixed $value): void;
@@ -33,6 +35,7 @@ public function updateSetting(SettingDefinitionEntity $entity, mixed $value): vo
3335
* Get the value of a setting.
3436
*
3537
* @param SettingDefinitionEntity $entity
38+
*
3639
* @return EloquentSettingModelInterface
3740
*/
3841
public function getSetting(SettingDefinitionEntity $entity): EloquentSettingModelInterface;

src/Contracts/SettingRepositoryInterface.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use LaravelEloquentSettings\Enums\SettingValueType;
77

88
/**
9-
* Interface SettingRepositoryInterface
9+
* Interface SettingRepositoryInterface.
1010
*
1111
* This interface defines the contract for interacting with the settings repository.
1212
*/
@@ -16,28 +16,31 @@ interface SettingRepositoryInterface
1616
* Get a setting by name.
1717
*
1818
* @param string $name The name of the setting.
19-
* @return EloquentSettingModelInterface The retrieved setting model.
2019
*
2120
* @throws ModelNotFoundException If the setting is not found.
21+
*
22+
* @return EloquentSettingModelInterface The retrieved setting model.
2223
*/
2324
public function getSettingByName(string $name): EloquentSettingModelInterface;
2425

2526
/**
2627
* Update a setting by name.
2728
*
28-
* @param string $name The name of the setting.
29-
* @param SettingValueType $type The type of the setting value.
30-
* @param mixed $value The new value for the setting.
29+
* @param string $name The name of the setting.
30+
* @param SettingValueType $type The type of the setting value.
31+
* @param mixed $value The new value for the setting.
32+
*
3133
* @return bool|EloquentSettingModelInterface If the update is successful, returns true; otherwise, creates a new setting and returns the model.
3234
*/
3335
public function updateSettingByName(string $name, SettingValueType $type, mixed $value): bool|EloquentSettingModelInterface;
3436

3537
/**
3638
* Create a new setting by name.
3739
*
38-
* @param string $name The name of the setting.
39-
* @param SettingValueType $type The type of the setting value.
40-
* @param mixed $value The value for the new setting.
40+
* @param string $name The name of the setting.
41+
* @param SettingValueType $type The type of the setting value.
42+
* @param mixed $value The value for the new setting.
43+
*
4144
* @return EloquentSettingModelInterface The created setting model.
4245
*/
4346
public function createSettingByName(string $name, SettingValueType $type, mixed $value): EloquentSettingModelInterface;

src/Contracts/SettingResolverInterface.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use LaravelEloquentSettings\SettingDefinitionEntity;
66

77
/**
8-
* Interface SettingResolverInterface
8+
* Interface SettingResolverInterface.
99
*
1010
* This interface defines the contract for resolving settings based on a given entity.
1111
*/
@@ -15,6 +15,7 @@ interface SettingResolverInterface
1515
* Resolve the setting value based on the provided entity.
1616
*
1717
* @param SettingDefinitionEntity $entity
18+
*
1819
* @return mixed
1920
*/
2021
public function __invoke(SettingDefinitionEntity $entity): mixed;

src/Contracts/SettingSetterInterface.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use LaravelEloquentSettings\SettingDefinitionEntity;
66

77
/**
8-
* Interface SettingSetterInterface
8+
* Interface SettingSetterInterface.
99
*
1010
* This interface defines the contract for setting values for a given setting entity.
1111
*/
@@ -15,7 +15,8 @@ interface SettingSetterInterface
1515
* Set the value for the provided setting entity.
1616
*
1717
* @param SettingDefinitionEntity $entity
18-
* @param mixed $value
18+
* @param mixed $value
19+
*
1920
* @return void
2021
*/
2122
public function __invoke(SettingDefinitionEntity $entity, mixed $value = null): void;

src/EloquentSettingManager.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
use LaravelEloquentSettings\Contracts\SettingRepositoryInterface;
1010

1111
/**
12-
* Class EloquentSettingManager
12+
* Class EloquentSettingManager.
1313
*
1414
* Manager for handling Eloquent model settings.
15-
*
16-
* @package LaravelEloquentSettings
1715
*/
1816
class EloquentSettingManager
1917
{
@@ -22,9 +20,9 @@ class EloquentSettingManager
2220
*
2321
* @param Model $model
2422
*
25-
* @return SettingHandlerInterface
26-
*
2723
* @throws BindingResolutionException
24+
*
25+
* @return SettingHandlerInterface
2826
*/
2927
public function getHandler(Model $model): SettingHandlerInterface
3028
{

src/EloquentSettings.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
use Illuminate\Support\Facades\Facade;
77

88
/**
9-
* Class EloquentSettings
9+
* Class EloquentSettings.
1010
*
1111
* Facade for accessing the EloquentSettings manager.
1212
*
1313
* @method static EloquentSettingManager getHandler(Model $model)
14-
*
15-
* @package LaravelEloquentSettings
1614
*/
1715
class EloquentSettings extends Facade
1816
{

src/EloquentSettingsServiceProvider.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
use LaravelEloquentSettings\Repositories\SettingRepository;
99

1010
/**
11-
* Class EloquentSettingsServiceProvider
11+
* Class EloquentSettingsServiceProvider.
1212
*
1313
* Laravel service provider for the EloquentSettings package.
14-
*
15-
* @package LaravelEloquentSettings
1614
*/
1715
class EloquentSettingsServiceProvider extends ServiceProvider
1816
{
@@ -23,7 +21,7 @@ class EloquentSettingsServiceProvider extends ServiceProvider
2321
*/
2422
public function register(): void
2523
{
26-
$this->mergeConfigFrom(__DIR__ . '/../config/eloquent_settings.php', 'eloquent_settings');
24+
$this->mergeConfigFrom(__DIR__.'/../config/eloquent_settings.php', 'eloquent_settings');
2725

2826
$this->app->bind('eloquent_settings', EloquentSettingManager::class);
2927

@@ -48,17 +46,17 @@ public function boot(): void
4846
*/
4947
protected function registerPublishables(): void
5048
{
51-
if (! $this->app->runningInConsole()) {
49+
if (!$this->app->runningInConsole()) {
5250
return;
5351
}
5452

5553
$this->publishes([
56-
__DIR__ . '/../config/eloquent_settings.php' => config_path('eloquent_settings.php'),
54+
__DIR__.'/../config/eloquent_settings.php' => config_path('eloquent_settings.php'),
5755
], 'config');
5856

5957
if (empty(glob(database_path('migrations/*_create_eloquent_settings_table.php')))) {
6058
$this->publishes([
61-
__DIR__ . '/../database/migrations/create_eloquent_settings_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_eloquent_settings_table.php'),
59+
__DIR__.'/../database/migrations/create_eloquent_settings_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_eloquent_settings_table.php'),
6260
], 'migrations');
6361
}
6462
}

0 commit comments

Comments
 (0)