From 1bdec262018ea4cb10e6f85e922046382c89cfd8 Mon Sep 17 00:00:00 2001 From: codepuncher Date: Wed, 19 Jun 2024 09:11:18 +0100 Subject: [PATCH] run `c style:fix --- src/AbstractBladeBlock.php | 4 +-- src/AbstractBlock.php | 2 +- src/Block.php | 53 ++++++++++---------------------------- src/Plugin.php | 4 +-- 4 files changed, 18 insertions(+), 45 deletions(-) diff --git a/src/AbstractBladeBlock.php b/src/AbstractBladeBlock.php index 4cfedc6..42a6835 100755 --- a/src/AbstractBladeBlock.php +++ b/src/AbstractBladeBlock.php @@ -17,7 +17,7 @@ public function getBladeEngineCallable(): string 'acf_gutenblocks/blade_engine_callable', '\App\template', "{$this->dir}/views/frontend{$this->fileExtension()}", - $this + $this, ); } @@ -31,7 +31,7 @@ public function renderBlockCallback(array $block): void $frontend = apply_filters( 'acf_gutenblocks/render_block_frontend_path', "{$this->dir}/views/frontend{$this->fileExtension()}", - $this + $this, ); $block['slug'] = str_replace('acf/', '', $block['name']); diff --git a/src/AbstractBlock.php b/src/AbstractBlock.php index df07c32..a5661f2 100644 --- a/src/AbstractBlock.php +++ b/src/AbstractBlock.php @@ -21,7 +21,7 @@ public function renderBlockCallback(array $block): void $frontend = apply_filters( 'acf_gutenblocks/render_block_frontend_path', "{$this->dir}/views/frontend{$this->fileExtension()}", - $this + $this, ); if (file_exists($frontend)) { diff --git a/src/Block.php b/src/Block.php index 68e0ad5..be181e2 100644 --- a/src/Block.php +++ b/src/Block.php @@ -10,105 +10,92 @@ class Block * The directory name of the block. * * @since 0.1.0 - * @var string $name */ - protected $name = ''; + protected string $name = ''; /** * The display name of the block. * * @since 0.1.0 - * @var string $title */ - protected $title = ''; + protected string $title = ''; /** * The description of the block. * * @since 0.1.0 - * @var string $description */ - protected $description; + protected string $description; /** * The category this block belongs to. * * @since 0.1.0 - * @var string $category */ - protected $category; + protected string $category; /** * The icon of this block. * * @since 0.1.0 - * @var string $icon */ - protected $icon = ''; + protected string $icon = ''; /** * An array of keywords the block will be found under. * * @since 0.1.0 - * @var array $keywords */ - protected $keywords = []; + protected array $keywords = []; /** * An array of Post Types the block will be available to. * * @since 0.1.0 - * @var array $post_types */ - protected $post_types = ['post', 'page']; + protected array $post_types = ['post', 'page']; /** * The default display mode of the block that is shown to the user. * * @since 0.1.0 - * @var string $mode */ - protected $mode = 'preview'; + protected string $mode = 'preview'; /** * The block alignment class. * * @since 0.1.0 - * @var string $align */ - protected $align = ''; + protected string $align = ''; /** * Features supported by the block. * * @since 0.1.0 - * @var array $supports */ - protected $supports = []; + protected array $supports = []; /** * The blocks directory path. * * @since 0.1.0 - * @var string $dir */ - public $dir; + public string $dir; /** * The blocks accessibility. * * @since 0.1.0 - * @var boolean $enabled */ - protected $enabled = true; + protected bool $enabled = true; /** * The blocks fields. * * @since 0.6.0 - * @var array $fields */ - protected $fields = []; + protected array $fields = []; /** * Begin block construction! @@ -153,7 +140,6 @@ public function __construct(array $settings) * Is the block enabled? * * @since 0.1.0 - * @return boolean */ public function isEnabled(): bool { @@ -164,7 +150,6 @@ public function isEnabled(): bool * User defined ACF fields * * @since 0.1.0 - * @return array */ protected function registerFields(): array { @@ -175,7 +160,6 @@ protected function registerFields(): array * Get the block ACF fields * * @since 0.1.0 - * @return array */ public function getFields(): array { @@ -186,7 +170,6 @@ public function getFields(): array * Get the block name * * @since 0.1.0 - * @return string */ public function getName(): string { @@ -197,7 +180,6 @@ public function getName(): string * Get the block title * * @since 0.1.0 - * @return string */ public function getTitle(): string { @@ -208,7 +190,6 @@ public function getTitle(): string * Get the block description * * @since 0.1.0 - * @return string */ public function getDescription(): string { @@ -219,7 +200,6 @@ public function getDescription(): string * Get the block category * * @since 0.1.0 - * @return string */ public function getCategory(): string { @@ -230,7 +210,6 @@ public function getCategory(): string * Get the block icon * * @since 0.1.0 - * @return string */ public function getIcon(): string { @@ -241,7 +220,6 @@ public function getIcon(): string * Get the block keywords * * @since 0.1.0 - * @return array */ public function getKeywords(): array { @@ -252,7 +230,6 @@ public function getKeywords(): array * Get the block post types * * @since 0.1.0 - * @return array */ public function getPostTypes(): array { @@ -263,7 +240,6 @@ public function getPostTypes(): array * Get the block mode * * @since 0.1.0 - * @return string */ public function getMode(): string { @@ -274,7 +250,6 @@ public function getMode(): string * Get the block alignment * * @since 0.1.0 - * @return string */ public function getAlignment(): string { @@ -285,7 +260,6 @@ public function getAlignment(): string * Get featured supported by the block * * @since 0.1.0 - * @return array */ public function getSupports(): array { @@ -296,7 +270,6 @@ public function getSupports(): array * Get the block registration data * * @since 0.1.0 - * @return array */ public function getBlockData(): array { diff --git a/src/Plugin.php b/src/Plugin.php index 06516f4..b8cd9a0 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -11,7 +11,7 @@ final class Plugin * * @var InitializableInterface[] */ - private $initializables = []; + private array $initializables = []; public function add(string ...$initializables): self { @@ -29,7 +29,7 @@ public function getInitializables(): array { return apply_filters( 'acf_gutenblocks/get_initializables', - $this->initializables + $this->initializables, ); }