Passed
Push — master ( 5557a4...bb9878 )
by Alain
10:25 queued 03:22
created
src/Shortcode.php 1 patch
Braces   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  * @package BrightNucleus\Shortcode
30 30
  * @author  Alain Schlesser <[email protected]>
31 31
  */
32
-class Shortcode implements ShortcodeInterface {
32
+class Shortcode implements ShortcodeInterface {
33 33
 
34 34
 	use ConfigTrait;
35 35
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 		ConfigInterface $config,
89 89
 		ShortcodeAttsParser $atts_parser,
90 90
 		DependencyManager $dependencies = null
91
-	) {
91
+	) {
92 92
 
93 93
 		Assert\that( $shortcode_tag )->string()->notEmpty();
94 94
 
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
 	 * @param mixed $context Optional. Arguments to pass on to the Registrable.
108 108
 	 * @return void
109 109
 	 */
110
-	public function register( $context = null ) {
111
-		if ( ! $this->is_needed( $context ) ) {
110
+	public function register( $context = null ) {
111
+		if ( ! $this->is_needed( $context ) ) {
112 112
 			return;
113 113
 		}
114 114
 		$this->context = $context;
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
124 124
 	 * @param mixed $context Data about the context in which the call is made.
125 125
 	 * @return boolean Whether the shortcode is needed or not.
126 126
 	 */
127
-	protected function is_needed( $context = null ) {
127
+	protected function is_needed( $context = null ) {
128 128
 
129 129
 		$is_needed = $this->hasConfigKey( 'is_needed' )
130 130
 			? $this->getConfigKey( 'is_needed' )
131 131
 			: true;
132 132
 
133
-		if ( is_callable( $is_needed ) ) {
133
+		if ( is_callable( $is_needed ) ) {
134 134
 			return $is_needed( $context );
135 135
 		}
136 136
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 *
145 145
 	 * @return string Shortcode tag.
146 146
 	 */
147
-	public function get_tag() {
147
+	public function get_tag() {
148 148
 		return (string) $this->shortcode_tag;
149 149
 	}
150 150
 
@@ -163,13 +163,13 @@  discard block
 block discarded – undo
163 163
 	 *                              render.
164 164
 	 * @return string               The shortcode's HTML output.
165 165
 	 */
166
-	public function render( $atts, $content = null, $tag = null ) {
166
+	public function render( $atts, $content = null, $tag = null ) {
167 167
 		$context = $this->context;
168 168
 		$atts    = $this->atts_parser->parse_atts( $atts, $this->get_tag() );
169 169
 		$handles = $this->get_dependency_handles();
170 170
 
171
-		if ( $this->dependencies && count( $handles ) > 0 ) {
172
-			foreach ( $handles as $handle ) {
171
+		if ( $this->dependencies && count( $handles ) > 0 ) {
172
+			foreach ( $handles as $handle ) {
173 173
 				$this->dependencies->enqueue_handle( $handle, $atts );
174 174
 			}
175 175
 		}
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 	 *
185 185
 	 * @return array Array of strings that are registered dependency handles.
186 186
 	 */
187
-	protected function get_dependency_handles() {
188
-		if ( ! $this->hasConfigKey( 'dependencies' ) ) {
187
+	protected function get_dependency_handles() {
188
+		if ( ! $this->hasConfigKey( 'dependencies' ) ) {
189 189
 			return [ ];
190 190
 		}
191 191
 		return (array) $this->getConfigKey( 'dependencies' );
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 	 * @param mixed  $context The context to pass through to the view.
201 201
 	 * @return string HTML rendering of the view.
202 202
 	 */
203
-	protected function render_view( $view, $context ) {
204
-		if ( empty( $view ) ) {
203
+	protected function render_view( $view, $context ) {
204
+		if ( empty( $view ) ) {
205 205
 			return '';
206 206
 		}
207 207
 
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
 	 *
218 218
 	 * @return string Name of the view to render.
219 219
 	 */
220
-	protected function get_view() {
221
-		if ( ! $this->hasConfigKey( 'view' ) ) {
220
+	protected function get_view() {
221
+		if ( ! $this->hasConfigKey( 'view' ) ) {
222 222
 			return '';
223 223
 		}
224 224
 		$view = $this->getConfigKey( 'view' );
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 * @param string|null $content Inner content to pass to the shortcode.
238 238
 	 * @return string|false Rendered HTML.
239 239
 	 */
240
-	public function do_this( array $atts = [ ], $content = null ) {
240
+	public function do_this( array $atts = [ ], $content = null ) {
241 241
 		\BrightNucleus\Shortcode\do_tag( $this->get_tag(), $atts, $content );
242 242
 	}
243 243
 }
Please login to merge, or discard this patch.