Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
cklei-carly authored and github-actions[bot] committed Sep 4, 2024
1 parent b1927d5 commit d9416f6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 31 deletions.
17 changes: 8 additions & 9 deletions src/Base/Manifests/ModelManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ protected static function getDefaultModels(): array
/**
* Bind a model to the interface in the container.
*
* @param string $interfaceClass The interface class to bind.
* @param string $modelClass The model class to bind.
* @return void
* @param string $interfaceClass The interface class to bind.
* @param string $modelClass The model class to bind.
*/
protected function bindModel(string $interfaceClass, string $modelClass): void
{
Expand All @@ -83,7 +82,7 @@ protected function bindModel(string $interfaceClass, string $modelClass): void
/**
* Guess the contract class for a given model class.
*
* @param string $modelClass The model class to guess the contract for.
* @param string $modelClass The model class to guess the contract for.
* @return string The guessed contract class name.
*/
protected function guessContractClass(string $modelClass): string
Expand All @@ -99,22 +98,22 @@ protected function guessContractClass(string $modelClass): string
/**
* Guess the model class for a given contract.
*
* @param string $modelContract The model contract to guess the class for.
* @param string $modelContract The model contract to guess the class for.
* @return string The guessed model class name.
*/
protected function guessModelClass(string $modelContract): string
{
$shortName = (new \ReflectionClass($modelContract))->getShortName();

return 'SolutionForest\\FilamentFieldGroup\\Models\\'.$shortName;
return 'SolutionForest\\FilamentFieldGroup\\Models\\' . $shortName;
}

/**
* Validate that a class is an Eloquent model.
*
* @param string $class The class to validate.
* @param string $class The class to validate.
*
* @throws \InvalidArgumentException If the class is not a subclass of Model.
* @return void
*/
private function validateClassIsEloquentModel(string $class): void
{
Expand All @@ -123,4 +122,4 @@ private function validateClassIsEloquentModel(string $class): void
}
}
//endregion Helper methods
}
}
17 changes: 7 additions & 10 deletions src/Base/Manifests/ModelManifestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,31 @@ interface ModelManifestInterface
{
/**
* Bind initial models to the container and establish explicit model bindings.
* @return void
*/
public function register(): void;

/**
* Register models.
*
* @param string $interfaceClass The interface class to register.
* @param string $modelClass The model class to register.
* @return void
* @param string $interfaceClass The interface class to register.
* @param string $modelClass The model class to register.
*/
public function add(string $interfaceClass, string $modelClass): void;

/**
* Replace a model with a different implementation.
*
* @param string $interfaceClass The interface class to replace.
* @param string $modelClass The new model class to use.
* @return void
* @param string $interfaceClass The interface class to replace.
* @param string $modelClass The new model class to use.
*/
public function replace(string $interfaceClass, string $modelClass): void;

/**
* Gets the registered class for the interface.
*
* @param string $interfaceClass The interface class to retrieve.
* @param string|null $fallback Optional fallback class if not found.
* @param string $interfaceClass The interface class to retrieve.
* @param string|null $fallback Optional fallback class if not found.
* @return string|null The registered model class or fallback.
*/
public function get(string $interfaceClass, ?string $fallback = null): ?string;
}
}
4 changes: 2 additions & 2 deletions src/Facades/ModelManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @method static void add(string $interfaceClass, string $modelClass)
* @method static void replace(string $interfaceClass, string $modelClass)
* @method static ?string get(string $interfaceClass, ?string $fallback = null)
*
*
* @see \SolutionForest\FilamentFieldGroup\Base\Manifests\ModelManifest
*/
class ModelManifest extends Facade
Expand All @@ -22,4 +22,4 @@ protected static function getFacadeAccessor()
{
return ModelManifestInterface::class;
}
}
}
4 changes: 2 additions & 2 deletions src/FilamentFieldGroupServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use Filament\Support\Facades\FilamentIcon;
use Illuminate\Filesystem\Filesystem;
use Livewire\Features\SupportTesting\Testable;
use SolutionForest\FilamentFieldGroup\Testing\TestsFilamentFieldGroup;
use SolutionForest\FilamentFieldGroup\Base\Manifests\ModelManifest;
use SolutionForest\FilamentFieldGroup\Base\Manifests\ModelManifestInterface;
use SolutionForest\FilamentFieldGroup\Testing\TestsFilamentFieldGroup;
use Spatie\LaravelPackageTools\Commands\InstallCommand;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
Expand Down Expand Up @@ -56,7 +56,7 @@ public function configurePackage(Package $package): void
}
}

public function registeringPackage(): void
public function registeringPackage(): void
{
$this->app->singleton(ModelManifestInterface::class, fn () => $this->app->make(ModelManifest::class));

Expand Down
4 changes: 1 addition & 3 deletions src/Models/Contracts/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Spatie\EloquentSortable\Sortable;

interface Field extends Sortable
{
}
interface Field extends Sortable {}
4 changes: 1 addition & 3 deletions src/Models/Contracts/FieldGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Spatie\EloquentSortable\Sortable;

interface FieldGroup extends Sortable
{
}
interface FieldGroup extends Sortable {}
4 changes: 2 additions & 2 deletions src/Supports/FieldGroupConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace SolutionForest\FilamentFieldGroup\Supports;

use SolutionForest\FilamentFieldGroup\Facades\ModelManifest;
use SolutionForest\FilamentFieldGroup\Models\Field;
use SolutionForest\FilamentFieldGroup\Models\FieldGroup;
use SolutionForest\FilamentFieldGroup\Models\Contracts\Field as FieldContract;
use SolutionForest\FilamentFieldGroup\Models\Contracts\FieldGroup as FieldGroupContract;
use SolutionForest\FilamentFieldGroup\Models\Field;
use SolutionForest\FilamentFieldGroup\Models\FieldGroup;

class FieldGroupConfig
{
Expand Down

0 comments on commit d9416f6

Please sign in to comment.