@@ -32,7 +32,7 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | public function templates($templates) |
| 34 | 34 | { |
| 35 | - return array_merge($templates, ['dummy-template' => 'DummyTemplate']); |
|
| 35 | + return array_merge($templates, [ 'dummy-template' => 'DummyTemplate' ]); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | public function wyswygToolbars() |
| 27 | 27 | { |
| 28 | 28 | return [ |
| 29 | - 'lin3s' => [1 => ['bold', 'italic', 'bullist', 'numlist', 'link', 'unlink']], |
|
| 29 | + 'lin3s' => [ 1 => [ 'bold', 'italic', 'bullist', 'numlist', 'link', 'unlink' ] ], |
|
| 30 | 30 | ]; |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -30,6 +30,6 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function components() |
| 32 | 32 | { |
| 33 | - return []; |
|
| 33 | + return [ ]; |
|
| 34 | 34 | } |
| 35 | 35 | } |
@@ -30,6 +30,6 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function components() |
| 32 | 32 | { |
| 33 | - return []; |
|
| 33 | + return [ ]; |
|
| 34 | 34 | } |
| 35 | 35 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function components() |
| 27 | 27 | { |
| 28 | - return []; |
|
| 28 | + return [ ]; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -42,13 +42,13 @@ |
||
| 42 | 42 | |
| 43 | 43 | function it_should_return_templates() |
| 44 | 44 | { |
| 45 | - $this->templates(['my-template' => 'MyTemplate'])->shouldReturn([ |
|
| 45 | + $this->templates([ 'my-template' => 'MyTemplate' ])->shouldReturn([ |
|
| 46 | 46 | 'my-template' => 'MyTemplate', 'dummy-template' => 'DummyTemplate', |
| 47 | 47 | ]); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | function it_should_return_context() |
| 51 | 51 | { |
| 52 | - $this->context(['heder-menu' => 'Header Menu'])->shouldReturn(['heder-menu' => 'Header Menu']); |
|
| 52 | + $this->context([ 'heder-menu' => 'Header Menu' ])->shouldReturn([ 'heder-menu' => 'Header Menu' ]); |
|
| 53 | 53 | } |
| 54 | 54 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -declare(strict_types=1); |
|
| 12 | +declare(strict_types = 1); |
|
| 13 | 13 | |
| 14 | 14 | namespace LIN3S\WPFoundation; |
| 15 | 15 | |
@@ -28,16 +28,16 @@ discard block |
||
| 28 | 28 | public function __construct() |
| 29 | 29 | { |
| 30 | 30 | defined('WP_DEBUG') && true === WP_DEBUG |
| 31 | - ? add_action('wp_enqueue_scripts', [$this, 'developmentAssets']) |
|
| 32 | - : add_action('wp_enqueue_scripts', [$this, 'productionAssets']); |
|
| 31 | + ? add_action('wp_enqueue_scripts', [ $this, 'developmentAssets' ]) |
|
| 32 | + : add_action('wp_enqueue_scripts', [ $this, 'productionAssets' ]); |
|
| 33 | 33 | |
| 34 | - add_action('admin_enqueue_scripts', [$this, 'adminAssets']); |
|
| 34 | + add_action('admin_enqueue_scripts', [ $this, 'adminAssets' ]); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | protected function addScript( |
| 38 | 38 | string $name, |
| 39 | 39 | string $from, |
| 40 | - array $dependencies = ['jquery'], |
|
| 40 | + array $dependencies = [ 'jquery' ], |
|
| 41 | 41 | string $version = '1.0.0', |
| 42 | 42 | bool $inFooter = true, |
| 43 | 43 | ?string $ajaxUrl = null |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | protected function addStylesheet( |
| 55 | 55 | string $name, |
| 56 | 56 | string $from, |
| 57 | - array $dependencies = [], |
|
| 57 | + array $dependencies = [ ], |
|
| 58 | 58 | string $version = '1.0.0', |
| 59 | 59 | string $media = 'all' |
| 60 | 60 | ) { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | protected function registerAjaxUrls(string $name, string $ajaxUrl) : void |
| 82 | 82 | { |
| 83 | 83 | if (false === is_array($ajaxUrl)) { |
| 84 | - $ajaxUrl = [$ajaxUrl]; |
|
| 84 | + $ajaxUrl = [ $ajaxUrl ]; |
|
| 85 | 85 | } |
| 86 | 86 | foreach ($ajaxUrl as $url) { |
| 87 | 87 | wp_localize_script($name, $url, [ |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -declare(strict_types=1); |
|
| 12 | +declare(strict_types = 1); |
|
| 13 | 13 | |
| 14 | 14 | namespace LIN3S\WPFoundation; |
| 15 | 15 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function __construct() |
| 26 | 26 | { |
| 27 | - add_action('wp_ajax_nopriv_' . $this->action(), [$this, 'ajax']); |
|
| 28 | - add_action('wp_ajax_' . $this->action(), [$this, 'ajax']); |
|
| 27 | + add_action('wp_ajax_nopriv_' . $this->action(), [ $this, 'ajax' ]); |
|
| 28 | + add_action('wp_ajax_' . $this->action(), [ $this, 'ajax' ]); |
|
| 29 | 29 | } |
| 30 | 30 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -declare(strict_types=1); |
|
| 12 | +declare(strict_types = 1); |
|
| 13 | 13 | |
| 14 | 14 | namespace LIN3S\WPFoundation; |
| 15 | 15 | |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | public function __construct() |
| 25 | 25 | { |
| 26 | 26 | $customToolbars = $this->wysiwygToolbars(); |
| 27 | - add_filter('acf/rest_api/post/get_fields', [$this, 'acfGetFields']); |
|
| 28 | - add_filter('acf/fields/wysiwyg/toolbars', function (array $toolbars) use ($customToolbars) { |
|
| 27 | + add_filter('acf/rest_api/post/get_fields', [ $this, 'acfGetFields' ]); |
|
| 28 | + add_filter('acf/fields/wysiwyg/toolbars', function(array $toolbars) use ($customToolbars) { |
|
| 29 | 29 | return array_merge($toolbars, $customToolbars); |
| 30 | 30 | }); |
| 31 | 31 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | public function acfGetFields(array $data) : array |
| 34 | 34 | { |
| 35 | 35 | if (!empty($data)) { |
| 36 | - array_walk_recursive($data, ['self', 'serializeFeaturedImage']); |
|
| 36 | + array_walk_recursive($data, [ 'self', 'serializeFeaturedImage' ]); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | return $data; |