Skip to content

Commit

Permalink
run `c style:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
codepuncher committed Jun 19, 2024
1 parent 3f9e5ab commit 1bdec26
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 45 deletions.
4 changes: 2 additions & 2 deletions src/AbstractBladeBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function getBladeEngineCallable(): string
'acf_gutenblocks/blade_engine_callable',
'\App\template',
"{$this->dir}/views/frontend{$this->fileExtension()}",
$this
$this,
);
}

Expand All @@ -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']);
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
53 changes: 13 additions & 40 deletions src/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -153,7 +140,6 @@ public function __construct(array $settings)
* Is the block enabled?
*
* @since 0.1.0
* @return boolean
*/
public function isEnabled(): bool
{
Expand All @@ -164,7 +150,6 @@ public function isEnabled(): bool
* User defined ACF fields
*
* @since 0.1.0
* @return array
*/
protected function registerFields(): array
{
Expand All @@ -175,7 +160,6 @@ protected function registerFields(): array
* Get the block ACF fields
*
* @since 0.1.0
* @return array
*/
public function getFields(): array
{
Expand All @@ -186,7 +170,6 @@ public function getFields(): array
* Get the block name
*
* @since 0.1.0
* @return string
*/
public function getName(): string
{
Expand All @@ -197,7 +180,6 @@ public function getName(): string
* Get the block title
*
* @since 0.1.0
* @return string
*/
public function getTitle(): string
{
Expand All @@ -208,7 +190,6 @@ public function getTitle(): string
* Get the block description
*
* @since 0.1.0
* @return string
*/
public function getDescription(): string
{
Expand All @@ -219,7 +200,6 @@ public function getDescription(): string
* Get the block category
*
* @since 0.1.0
* @return string
*/
public function getCategory(): string
{
Expand All @@ -230,7 +210,6 @@ public function getCategory(): string
* Get the block icon
*
* @since 0.1.0
* @return string
*/
public function getIcon(): string
{
Expand All @@ -241,7 +220,6 @@ public function getIcon(): string
* Get the block keywords
*
* @since 0.1.0
* @return array
*/
public function getKeywords(): array
{
Expand All @@ -252,7 +230,6 @@ public function getKeywords(): array
* Get the block post types
*
* @since 0.1.0
* @return array
*/
public function getPostTypes(): array
{
Expand All @@ -263,7 +240,6 @@ public function getPostTypes(): array
* Get the block mode
*
* @since 0.1.0
* @return string
*/
public function getMode(): string
{
Expand All @@ -274,7 +250,6 @@ public function getMode(): string
* Get the block alignment
*
* @since 0.1.0
* @return string
*/
public function getAlignment(): string
{
Expand All @@ -285,7 +260,6 @@ public function getAlignment(): string
* Get featured supported by the block
*
* @since 0.1.0
* @return array
*/
public function getSupports(): array
{
Expand All @@ -296,7 +270,6 @@ public function getSupports(): array
* Get the block registration data
*
* @since 0.1.0
* @return array
*/
public function getBlockData(): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class Plugin
*
* @var InitializableInterface[]
*/
private $initializables = [];
private array $initializables = [];

public function add(string ...$initializables): self
{
Expand All @@ -29,7 +29,7 @@ public function getInitializables(): array
{
return apply_filters(
'acf_gutenblocks/get_initializables',
$this->initializables
$this->initializables,
);
}

Expand Down

0 comments on commit 1bdec26

Please sign in to comment.