Skip to content

Commit

Permalink
CS fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aguingand authored and github-actions[bot] committed Nov 5, 2024
1 parent 45a03fc commit 777b22d
Show file tree
Hide file tree
Showing 257 changed files with 783 additions and 944 deletions.
1 change: 0 additions & 1 deletion demo/app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
Expand Down
1 change: 0 additions & 1 deletion demo/app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class RedirectIfAuthenticated
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @param string|null ...$guards
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
Expand Down
2 changes: 2 additions & 0 deletions demo/app/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class Post extends Model
'title',
'content',
];

protected $guarded = [];

protected $casts = [
'published_at' => 'datetime',
'state' => PostState::class,
Expand Down
2 changes: 1 addition & 1 deletion demo/app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AppServiceProvider extends ServiceProvider
public function register()
{
$this->app->register(SharpServiceProvider::class);
// $this->app->bind(SharpUploadModel::class, Media::class)
// $this->app->bind(SharpUploadModel::class, Media::class)

$this->app->bind(SharpViteComponent::class, function () {
return new SharpViteComponent(hotFile: base_path('../resources/assets/dist/hot'));
Expand Down
2 changes: 1 addition & 1 deletion demo/app/Sharp/Categories/CategoryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function update($id, array $data)
{
$category = $id
? Category::findOrFail($id)
: new Category();
: new Category;

$this->save($category, $data);

Expand Down
3 changes: 2 additions & 1 deletion demo/app/Sharp/Dashboard/DemoDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class DemoDashboard extends SharpDashboard
'#78350F',
'#9CA3AF',
];

private static int $colorsIndex = 0;

protected function buildWidgets(WidgetsContainer $widgetsContainer): void
Expand Down Expand Up @@ -213,7 +214,7 @@ protected function setPieGraphDataSet(): void

private static function nextColor(): string
{
if (static::$colorsIndex >= sizeof(static::$colors)) {
if (static::$colorsIndex >= count(static::$colors)) {
static::$colorsIndex = 0;
}

Expand Down
1 change: 1 addition & 0 deletions demo/app/Sharp/Entities/AuthorEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
class AuthorEntity extends SharpEntity
{
protected ?string $list = AuthorList::class;

protected array $prohibitedActions = ['view', 'update', 'delete', 'create'];
}
2 changes: 2 additions & 0 deletions demo/app/Sharp/Entities/CategoryEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
class CategoryEntity extends SharpEntity
{
protected ?string $list = CategoryList::class;

protected ?string $show = CategoryShow::class;

protected ?string $form = CategoryForm::class;
}
2 changes: 2 additions & 0 deletions demo/app/Sharp/Entities/PostBlockEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
class PostBlockEntity extends SharpEntity
{
protected ?string $list = PostBlockList::class;

protected ?string $policy = PostBlockPolicy::class;

protected string $label = 'Block';

public function getMultiforms(): array
Expand Down
3 changes: 3 additions & 0 deletions demo/app/Sharp/Entities/PostEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
class PostEntity extends SharpEntity
{
protected ?string $list = PostList::class;

protected ?string $show = PostShow::class;

protected ?string $form = PostForm::class;

protected ?string $policy = PostPolicy::class;
}
3 changes: 3 additions & 0 deletions demo/app/Sharp/Entities/ProfileEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
class ProfileEntity extends SharpEntity
{
protected bool $isSingle = true;

protected ?string $show = ProfileSingleShow::class;

protected ?string $form = ProfileSingleForm::class;

protected string $label = 'My profile';
}
4 changes: 4 additions & 0 deletions demo/app/Sharp/Entities/TestEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
class TestEntity extends SharpEntity
{
protected bool $isSingle = true;

protected ?string $show = \App\Sharp\TestForm\TestShow::class;

protected ?string $form = \App\Sharp\TestForm\TestForm::class;

protected ?string $policy = \App\Sharp\TestForm\TestPolicy::class;

protected string $label = 'Test';
}
13 changes: 4 additions & 9 deletions demo/app/Sharp/Posts/Blocks/AbstractPostBlockForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ abstract class AbstractPostBlockForm extends SharpForm
use WithSharpFormEloquentUpdater;

protected static string $postBlockType = 'none';

protected static string $postBlockHelpText = '';

public function buildFormFields(FieldsContainer $formFields): void
Expand Down Expand Up @@ -46,9 +47,7 @@ public function buildFormLayout(FormLayout $formLayout): void
});
}

public function buildFormConfig(): void
{
}
public function buildFormConfig(): void {}

public function find($id): array
{
Expand Down Expand Up @@ -100,11 +99,7 @@ protected function getContentField(): ?SharpFormField
->setRowCount(6);
}

protected function buildAdditionalFields(FieldsContainer $formFields): void
{
}
protected function buildAdditionalFields(FieldsContainer $formFields): void {}

protected function addAdditionalFieldsToLayout(FormLayoutColumn $column): void
{
}
protected function addAdditionalFieldsToLayout(FormLayoutColumn $column): void {}
}
1 change: 1 addition & 0 deletions demo/app/Sharp/Posts/Blocks/PostBlockTextForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class PostBlockTextForm extends AbstractPostBlockForm
{
protected static string $postBlockType = 'text';

protected ?string $formValidatorClass = PostBlockTextValidator::class;

protected function getContentField(): ?SharpFormField
Expand Down
2 changes: 2 additions & 0 deletions demo/app/Sharp/Posts/Blocks/PostBlockVideoForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
class PostBlockVideoForm extends AbstractPostBlockForm
{
protected static string $postBlockType = 'video';

protected static string $postBlockHelpText = 'Please provide a valid Youtube embed text';

protected ?string $formValidatorClass = PostBlockVideoValidator::class;
}
3 changes: 2 additions & 1 deletion demo/app/Sharp/Posts/Blocks/PostBlockVisualsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class PostBlockVisualsForm extends AbstractPostBlockForm
{
protected static string $postBlockType = 'visuals';

protected ?string $formValidatorClass = PostBlockVisualsValidator::class;

protected function getContentField(): ?SharpFormField
Expand Down Expand Up @@ -60,6 +61,6 @@ protected function addAdditionalFieldsToLayout(FormLayoutColumn $column): void

protected function addCustomTransformers(): self
{
return $this->setCustomTransformer('files', new SharpUploadModelFormAttributeTransformer());
return $this->setCustomTransformer('files', new SharpUploadModelFormAttributeTransformer);
}
}
4 changes: 2 additions & 2 deletions demo/app/Sharp/Posts/PostForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ public function find($id): array
->setCustomTransformer('author_id', function ($value, Post $instance) {
return $instance->author;
})
->setCustomTransformer('cover', new SharpUploadModelFormAttributeTransformer())
->setCustomTransformer('attachments[document]', new SharpUploadModelFormAttributeTransformer())
->setCustomTransformer('cover', new SharpUploadModelFormAttributeTransformer)
->setCustomTransformer('attachments[document]', new SharpUploadModelFormAttributeTransformer)
->transform(Post::with('cover', 'attachments', 'categories')->findOrFail($id));
}

Expand Down
2 changes: 1 addition & 1 deletion demo/app/Sharp/Profile/ProfileSingleForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function buildFormLayout(FormLayout $formLayout): void
public function findSingle(): array
{
return $this
->setCustomTransformer('avatar', new SharpUploadModelFormAttributeTransformer())
->setCustomTransformer('avatar', new SharpUploadModelFormAttributeTransformer)
->transform(auth()->user());
}

Expand Down
4 changes: 2 additions & 2 deletions demo/app/Sharp/Utils/Embeds/AuthorEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function transformDataForTemplate(array $data, bool $isForm): array

return $user?->name;
})
->setCustomTransformer('picture', (new SharpUploadModelFormAttributeTransformer())->dynamicInstance())
->setCustomTransformer('picture', (new SharpUploadModelFormAttributeTransformer)->dynamicInstance())
->transformForTemplate($data);
}

Expand All @@ -69,7 +69,7 @@ public function transformDataForFormFields(array $data): array
? Arr::only($user, ['id', 'name', 'email'])
: null;
})
->setCustomTransformer('picture', (new SharpUploadModelFormAttributeTransformer())->dynamicInstance())
->setCustomTransformer('picture', (new SharpUploadModelFormAttributeTransformer)->dynamicInstance())
->transform($data);
}

Expand Down
8 changes: 2 additions & 6 deletions demo/app/Sharp/Utils/Embeds/TableOfContentsEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ public function buildEmbedConfig(): void
->configureFormInlineTemplate('<em>- Table of contents -</em>');
}

public function buildFormFields(FieldsContainer $formFields): void
{
}
public function buildFormFields(FieldsContainer $formFields): void {}

public function updateContent(array $data = []): array
{
}
public function updateContent(array $data = []): array {}
}
4 changes: 1 addition & 3 deletions src/Auth/SharpAuthorizationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class SharpAuthorizationManager
{
private array $cachedPolicies = [];

public function __construct(protected SharpEntityManager $entityManager, protected Gate $gate)
{
}
public function __construct(protected SharpEntityManager $entityManager, protected Gate $gate) {}

public function isAllowed(string $ability, string $entityKey, ?string $instanceId = null): bool
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected function initialDataForStepConfirm(): array
new SvgImageBackEnd
)
))
->writeString($this->get2faHandler()->setUser(auth()->user())->getQRCodeUrl());
->writeString($this->get2faHandler()->setUser(auth()->user())->getQRCodeUrl());

return [
'qr' => [
Expand Down
4 changes: 1 addition & 3 deletions src/Auth/TwoFactor/Engines/GoogleTotpEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

class GoogleTotpEngine implements Sharp2faTotpEngine
{
public function __construct(protected Google2FA $google2fa)
{
}
public function __construct(protected Google2FA $google2fa) {}

public function verify(string $code, string $secret): bool
{
Expand Down
4 changes: 1 addition & 3 deletions src/Auth/TwoFactor/Sharp2faDefaultNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ class Sharp2faDefaultNotification extends Notification implements ShouldQueue
{
use \Illuminate\Bus\Queueable;

public function __construct(public string $code)
{
}
public function __construct(public string $code) {}

public function via($notifiable)
{
Expand Down
4 changes: 1 addition & 3 deletions src/Auth/TwoFactor/Sharp2faTotpHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ abstract class Sharp2faTotpHandler implements Sharp2faHandler
{
protected $user = null;

public function __construct(protected Sharp2faTotpEngine $engine)
{
}
public function __construct(protected Sharp2faTotpEngine $engine) {}

public function generateCode(bool $remember = false): void
{
Expand Down
2 changes: 2 additions & 0 deletions src/Console/DashboardMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
class DashboardMakeCommand extends GeneratorCommand
{
protected $name = 'sharp:make:dashboard';

protected $description = 'Create a new Dashboard';

protected $type = 'Dashboard';

protected function getStub()
Expand Down
2 changes: 2 additions & 0 deletions src/Console/EntityCommandMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
class EntityCommandMakeCommand extends GeneratorCommand
{
protected $name = 'sharp:make:entity-command';

protected $description = 'Create a new Entity List Command class';

protected $type = 'EntityCommand';

protected function getStub()
Expand Down
2 changes: 2 additions & 0 deletions src/Console/EntityListFilterMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
class EntityListFilterMakeCommand extends GeneratorCommand
{
protected $name = 'sharp:make:entity-list-filter';

protected $description = 'Create a new Entity List Filter class';

protected $type = 'EntityListFilter';

protected function getStub()
Expand Down
2 changes: 2 additions & 0 deletions src/Console/EntityListMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class EntityListMakeCommand extends GeneratorCommand
use WithModel;

protected $name = 'sharp:make:entity-list';

protected $description = 'Create a new Entity List class';

protected $type = 'SharpEntityList';

protected function buildClass($name)
Expand Down
2 changes: 2 additions & 0 deletions src/Console/FormMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class FormMakeCommand extends GeneratorCommand
use WithModel;

protected $name = 'sharp:make:form';

protected $description = 'Create a new Form class';

protected $type = 'SharpForm';

protected function buildClass($name)
Expand Down
2 changes: 2 additions & 0 deletions src/Console/InstanceCommandMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
class InstanceCommandMakeCommand extends GeneratorCommand
{
protected $name = 'sharp:make:instance-command';

protected $description = 'Create a new instance Command class';

protected $type = 'InstanceCommand';

protected function getStub()
Expand Down
2 changes: 2 additions & 0 deletions src/Console/MediaMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
class MediaMakeCommand extends GeneratorCommand
{
protected $name = 'sharp:make:media';

protected $description = 'Create the media model for sharp uploads';

protected $type = 'Media model';

protected function getStub()
Expand Down
2 changes: 2 additions & 0 deletions src/Console/ReorderHandlerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
class ReorderHandlerMakeCommand extends GeneratorCommand
{
protected $name = 'sharp:make:reorder-handler';

protected $description = 'Create a new Reorder Handler class';

protected $type = 'ReorderHandler';

protected function buildClass($name)
Expand Down
2 changes: 2 additions & 0 deletions src/Console/ShowPageMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class ShowPageMakeCommand extends GeneratorCommand
use WithModel;

protected $name = 'sharp:make:show-page';

protected $description = 'Create a new Show Page class';

protected $type = 'SharpShow';

protected function buildClass($name)
Expand Down
2 changes: 2 additions & 0 deletions src/Console/StateMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
class StateMakeCommand extends GeneratorCommand
{
protected $name = 'sharp:make:entity-state';

protected $description = 'Create a new Entity State class';

protected $type = 'EntityState';

protected function buildClass($name)
Expand Down
Loading

0 comments on commit 777b22d

Please sign in to comment.