Passed
Push — master ( d76fa6...94f384 )
by Alain
02:42
created
src/Shortcode.php 1 patch
Braces   +14 added lines, -14 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,11 +163,11 @@  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
 
170
-		if ( $this->dependencies ) {
170
+		if ( $this->dependencies ) {
171 171
 			$this->dependencies->enqueue( $atts );
172 172
 		}
173 173
 
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 	 * @param mixed  $context The context to pass through to the view.
184 184
 	 * @return string HTML rendering of the view.
185 185
 	 */
186
-	protected function render_view( $view, $context ) {
187
-		if ( empty( $view ) ) {
186
+	protected function render_view( $view, $context ) {
187
+		if ( empty( $view ) ) {
188 188
 			return '';
189 189
 		}
190 190
 
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 	 *
201 201
 	 * @return string Name of the view to render.
202 202
 	 */
203
-	protected function get_view() {
204
-		if ( ! $this->hasConfigKey( 'view' ) ) {
203
+	protected function get_view() {
204
+		if ( ! $this->hasConfigKey( 'view' ) ) {
205 205
 			return '';
206 206
 		}
207 207
 		$view = $this->getConfigKey( 'view' );
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	 * @param string|null $content Inner content to pass to the shortcode.
221 221
 	 * @return string|false Rendered HTML.
222 222
 	 */
223
-	public function do_this( array $atts = [ ], $content = null ) {
223
+	public function do_this( array $atts = [ ], $content = null ) {
224 224
 		\BrightNucleus\Shortcode\do_tag( $this->get_tag(), $atts, $content );
225 225
 	}
226 226
 }
Please login to merge, or discard this patch.