Passed
Push — master ( a49b57...63fa33 )
by Alain
03:51
created
src/Shortcode.php 2 patches
Unused Use Statements   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@
 block discarded – undo
11 11
 
12 12
 namespace BrightNucleus\Shortcode;
13 13
 
14
-use Assert;
15
-use BrightNucleus\Config\ConfigInterface;
16
-use BrightNucleus\Config\ConfigTrait;
17
-use BrightNucleus\Dependency\DependencyManagerInterface as DependencyManager;
18
-use BrightNucleus\Exception\DomainException;
14
+use Assert;
15
+use BrightNucleus\Config\ConfigInterface;
16
+use BrightNucleus\Config\ConfigTrait;
17
+use BrightNucleus\Dependency\DependencyManagerInterface as DependencyManager;
18
+use BrightNucleus\Exception\DomainException;
19 19
 use BrightNucleus\Exception\RuntimeException;
20 20
 
21 21
 /**
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 		DependencyManager $dependencies = null
82 82
 	) {
83 83
 
84
-		Assert\that( $shortcode_tag )->string()->notEmpty();
84
+		Assert\that($shortcode_tag)->string()->notEmpty();
85 85
 
86
-		$this->processConfig( $config );
86
+		$this->processConfig($config);
87 87
 
88 88
 		$this->shortcode_tag = $shortcode_tag;
89 89
 		$this->atts_parser   = $atts_parser;
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 	 *                    (Not used with Shortcode class)
100 100
 	 * @return void
101 101
 	 */
102
-	public function register( $args = null ) {
103
-		if ( ! $this->is_needed( $args ) ) {
102
+	public function register($args = null) {
103
+		if ( ! $this->is_needed($args)) {
104 104
 			return;
105 105
 		}
106
-		\add_shortcode( $this->get_tag(), [ $this, 'render' ] );
106
+		\add_shortcode($this->get_tag(), [$this, 'render']);
107 107
 	}
108 108
 
109 109
 	/**
@@ -114,14 +114,14 @@  discard block
 block discarded – undo
114 114
 	 * @param mixed $context Data about the context in which the call is made.
115 115
 	 * @return boolean Whether the shortcode is needed or not.
116 116
 	 */
117
-	protected function is_needed( $context = null ) {
117
+	protected function is_needed($context = null) {
118 118
 
119
-		$is_needed = $this->hasConfigKey( 'is_needed' )
120
-			? $this->getConfigKey( 'is_needed' )
119
+		$is_needed = $this->hasConfigKey('is_needed')
120
+			? $this->getConfigKey('is_needed')
121 121
 			: false;
122 122
 
123
-		if ( is_callable( $is_needed ) ) {
124
-			return $is_needed( $context );
123
+		if (is_callable($is_needed)) {
124
+			return $is_needed($context);
125 125
 		}
126 126
 
127 127
 		return (bool) $is_needed;
@@ -153,22 +153,22 @@  discard block
 block discarded – undo
153 153
 	 *                              render.
154 154
 	 * @return string               The shortcode's HTML output.
155 155
 	 */
156
-	public function render( $atts, $content = null, $tag = null ) {
157
-		$atts = $this->atts_parser->parse_atts( $atts, $this->get_tag() );
156
+	public function render($atts, $content = null, $tag = null) {
157
+		$atts = $this->atts_parser->parse_atts($atts, $this->get_tag());
158 158
 
159
-		if ( $this->dependencies ) {
160
-			$this->dependencies->enqueue( $atts );
159
+		if ($this->dependencies) {
160
+			$this->dependencies->enqueue($atts);
161 161
 		}
162 162
 
163
-		if ( ! $this->hasConfigKey( 'view' ) ) {
163
+		if ( ! $this->hasConfigKey('view')) {
164 164
 			return '';
165 165
 		}
166
-		$view = $this->getConfigKey( 'view' );
166
+		$view = $this->getConfigKey('view');
167 167
 
168
-		Assert\that( $view )->string()->notEmpty()->file();
168
+		Assert\that($view)->string()->notEmpty()->file();
169 169
 
170 170
 		ob_start();
171
-		include( $this->config['view'] );
171
+		include($this->config['view']);
172 172
 
173 173
 		return ob_get_clean();
174 174
 	}
Please login to merge, or discard this patch.
src/ShortcodeManager.php 1 patch
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 
12 12
 namespace BrightNucleus\Shortcode;
13 13
 
14
-use BrightNucleus\Config\ConfigInterface;
15
-use BrightNucleus\Config\ConfigTrait;
16
-use BrightNucleus\Dependency\DependencyManagerInterface as DependencyManager;
14
+use BrightNucleus\Config\ConfigInterface;
15
+use BrightNucleus\Config\ConfigTrait;
16
+use BrightNucleus\Dependency\DependencyManagerInterface as DependencyManager;
17 17
 use BrightNucleus\Exception\RuntimeException;
18 18
 
19 19
 /**
Please login to merge, or discard this patch.