Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to authored and github-actions[bot] committed Dec 8, 2024
1 parent e2a563e commit 54c0155
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Core/src/Traits/HasResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getResource(): ?ResourceContract

protected function validateResource(): void
{
if(! $this->hasResource()) {
if (! $this->hasResource()) {
throw ResourceException::required();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Laravel/src/Applies/Fields/FileModelApply.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function store(File $field, UploadedFile $file): string
{
$extension = $file->extension();

if(! $field->isAllowedExtension($extension)) {
if (! $field->isAllowedExtension($extension)) {
throw FileFieldException::extensionNotAllowed($extension);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Laravel/src/Fields/Relationships/BelongsTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected function resolvePreview(): string
? $this->getResource()->getFormPage()
: $this->getResource()->getDetailPage();

if(\is_null($page)) {
if (\is_null($page)) {
throw PageException::required();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Laravel/src/Http/Controllers/HandlerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __invoke(string $resourceUri, string $handlerUri, MoonShineReque
{
$resource = $request->getResource();

if(! $resource) {
if (! $resource) {
throw ResourceException::required();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Laravel/src/Http/Controllers/UpdateFieldController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function throughRelation(RelationModelColumnUpdateRequest $request): Resp
->onlyFields()
->findByColumn($request->input('field'));

if(\is_null($field) || \is_null($resource)) {
if (\is_null($field) || \is_null($resource)) {
throw CrudResourceException::resourceOrFieldRequired();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function authorize(): bool
{
$resource = $this->getField()?->getResource();

if(\is_null($resource)) {
if (\is_null($resource)) {
throw ResourceException::notDeclared();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getFieldItemOrFail(): Model
{
$field = $this->getField();

if(\is_null($field)) {
if (\is_null($field)) {
throw FieldException::notFound();
}

Expand Down
4 changes: 2 additions & 2 deletions src/Laravel/src/MoonShineEndpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function toPage(
$params += ['_fragment-load' => $fragment];
}

if(\is_null($page) && \is_null($resource)) {
if (\is_null($page) && \is_null($resource)) {
throw EndpointException::pageOrResourceRequired();
}

Expand All @@ -136,7 +136,7 @@ public function toPage(
: moonshine()->getPages()->findByClass($page);
}

if(\is_null($targetPage)) {
if (\is_null($targetPage)) {
throw EndpointException::pageRequired();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Laravel/src/Traits/Fields/WithRelatedValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function resolveValuesQuery(): Builder
{
$relation = $this->getRelation();

if(is_null($relation)) {
if (\is_null($relation)) {
throw ModelRelationFieldException::relationRequired();
}

Expand Down
2 changes: 1 addition & 1 deletion src/UI/src/Components/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public function apply(

value($after, $values);
} catch (Throwable $e) {
if($throw) {
if ($throw) {
throw $e;
}

Expand Down
2 changes: 1 addition & 1 deletion src/UI/src/Components/Tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function getTabs(): ComponentsContract
return tap(
$this->getComponents(),
static function (ComponentsContract $tabs): void {
if($tabs->every(static fn ($tab): bool => ! $tab instanceof Tab)) {
if ($tabs->every(static fn ($tab): bool => ! $tab instanceof Tab)) {
throw MoonShineComponentException::onlyTabAllowed();
}
}
Expand Down

0 comments on commit 54c0155

Please sign in to comment.