@@ -29,5 +29,5 @@ |
||
| 29 | 29 | * |
| 30 | 30 | * @return string Rendered HTML. |
| 31 | 31 | */ |
| 32 | - public function render( array $context = [] ); |
|
| 32 | + public function render( array $context = [ ] ); |
|
| 33 | 33 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @var array |
| 30 | 30 | */ |
| 31 | - private $namespaces = []; |
|
| 31 | + private $namespaces = [ ]; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Destructor for the Autoloader class. |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $lowercase = false, |
| 85 | 85 | $underscores = false |
| 86 | 86 | ) { |
| 87 | - $this->namespaces[] = [ |
|
| 87 | + $this->namespaces[ ] = [ |
|
| 88 | 88 | 'root' => $this->normalize_root( (string) $root ), |
| 89 | 89 | 'base_dir' => trailingslashit( (string) $base_dir ), |
| 90 | 90 | 'prefix' => (string) $prefix, |
@@ -110,12 +110,12 @@ discard block |
||
| 110 | 110 | foreach ( $this->namespaces as $namespace ) { |
| 111 | 111 | |
| 112 | 112 | // Move on if the object does not belong to the current namespace. |
| 113 | - if ( 0 !== strpos( $class, $namespace['root'] ) ) { |
|
| 113 | + if ( 0 !== strpos( $class, $namespace[ 'root' ] ) ) { |
|
| 114 | 114 | continue; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // Remove namespace root level to correspond with root filesystem. |
| 118 | - $filename = str_replace( $namespace['root'], '', $class ); |
|
| 118 | + $filename = str_replace( $namespace[ 'root' ], '', $class ); |
|
| 119 | 119 | |
| 120 | 120 | // Replace the namespace separator "\" by the system-dependent directory separator. |
| 121 | 121 | $filename = str_replace( '\\', DIRECTORY_SEPARATOR, $filename ); |
@@ -124,17 +124,17 @@ discard block |
||
| 124 | 124 | $filename = $this->remove_leading_backslash( $filename ); |
| 125 | 125 | |
| 126 | 126 | // Change to lower case if requested. |
| 127 | - if ( true === $namespace['lowercase'] ) { |
|
| 127 | + if ( true === $namespace[ 'lowercase' ] ) { |
|
| 128 | 128 | $filename = strtolower( $filename ); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | // Change underscores into hyphens if requested. |
| 132 | - if ( true === $namespace['underscores'] ) { |
|
| 132 | + if ( true === $namespace[ 'underscores' ] ) { |
|
| 133 | 133 | $filename = str_replace( '_', '-', $filename ); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | // Add base_dir, prefix and suffix. |
| 137 | - $filepath = "{$namespace['base_dir']}{$namespace['prefix']}{$filename}{$namespace['suffix']}"; |
|
| 137 | + $filepath = "{$namespace[ 'base_dir' ]}{$namespace[ 'prefix' ]}{$filename}{$namespace[ 'suffix' ]}"; |
|
| 138 | 138 | |
| 139 | 139 | // Require the file if it exists and is readable. |
| 140 | 140 | if ( is_readable( $filepath ) ) { |
@@ -23,15 +23,15 @@ |
||
| 23 | 23 | * @since %VERSION% |
| 24 | 24 | * @var array |
| 25 | 25 | */ |
| 26 | - protected $services = []; |
|
| 26 | + protected $services = [ ]; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Container constructor. |
| 30 | 30 | * |
| 31 | 31 | * @param array $services Services to register with the container. |
| 32 | 32 | */ |
| 33 | - public function __construct( array $services = [] ) { |
|
| 34 | - $this->services = $services ?: []; |
|
| 33 | + public function __construct( array $services = [ ] ) { |
|
| 34 | + $this->services = $services ? : [ ]; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @since %VERSION% |
| 37 | 37 | * @var Asset[] |
| 38 | 38 | */ |
| 39 | - protected $assets = []; |
|
| 39 | + protected $assets = [ ]; |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Get the array of known assets. |
@@ -107,6 +107,6 @@ discard block |
||
| 107 | 107 | * @since %VERSION% |
| 108 | 108 | */ |
| 109 | 109 | protected function load_assets() { |
| 110 | - $this->assets = []; |
|
| 110 | + $this->assets = [ ]; |
|
| 111 | 111 | } |
| 112 | 112 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | * @return Closure |
| 44 | 44 | */ |
| 45 | 45 | protected function get_enqueue_closure() { |
| 46 | - return function () { |
|
| 46 | + return function() { |
|
| 47 | 47 | call_user_func( parent::get_enqueue_closure() ); |
| 48 | 48 | wp_set_script_translations( $this->handle, 'yikes-inc-easy-mailchimp-extender' ); |
| 49 | 49 | }; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | const MEDIA_ALL = 'all'; |
| 27 | 27 | const MEDIA_PRINT = 'print'; |
| 28 | 28 | const MEDIA_SCREEN = 'screen'; |
| 29 | - const DEPENDENCIES = []; |
|
| 29 | + const DEPENDENCIES = [ ]; |
|
| 30 | 30 | const VERSION = Plugin::VERSION; |
| 31 | 31 | const DISABLEABLE = false; |
| 32 | 32 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @return Closure |
| 114 | 114 | */ |
| 115 | 115 | protected function get_register_closure() { |
| 116 | - return function () { |
|
| 116 | + return function() { |
|
| 117 | 117 | if ( wp_script_is( $this->handle, 'registered' ) ) { |
| 118 | 118 | return; |
| 119 | 119 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * @return Closure |
| 141 | 141 | */ |
| 142 | 142 | protected function get_enqueue_closure() { |
| 143 | - return function () { |
|
| 143 | + return function() { |
|
| 144 | 144 | wp_enqueue_style( $this->handle ); |
| 145 | 145 | }; |
| 146 | 146 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | * @return Closure |
| 154 | 154 | */ |
| 155 | 155 | protected function get_dequeue_closure() { |
| 156 | - return function () { |
|
| 156 | + return function() { |
|
| 157 | 157 | wp_dequeue_style( $this->handle ); |
| 158 | 158 | }; |
| 159 | 159 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | * |
| 30 | 30 | * @var Asset[] |
| 31 | 31 | */ |
| 32 | - private $assets = []; |
|
| 32 | + private $assets = [ ]; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Add a single asset to the asset handler. |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @since %VERSION% |
| 55 | 55 | * @var Service[] |
| 56 | 56 | */ |
| 57 | - private $services = []; |
|
| 57 | + private $services = [ ]; |
|
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * Instantiate a Plugin object. |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function __construct( Container $container, AssetsHandler $assets_handler = null ) { |
| 68 | 68 | $this->container = $container; |
| 69 | - $this->assets_handler = $assets_handler ?: new AssetsHandler(); |
|
| 69 | + $this->assets_handler = $assets_handler ? : new AssetsHandler(); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | ] ); |
| 78 | 78 | |
| 79 | 79 | // Ensure the plugin folder is always available. |
| 80 | - $locations[] = trailingslashit( $this->get_root_dir() ) . $uri; |
|
| 80 | + $locations[ ] = trailingslashit( $this->get_root_dir() ) . $uri; |
|
| 81 | 81 | |
| 82 | 82 | return $locations; |
| 83 | 83 | } |