Passed
Push — 0.7.0 ( 8420c9...9eca06 )
by Alexander
03:11 queued 10s
created
src/components/View/ViewServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function registerView()
60 60
     {
61
-        $this->app->singleton('view', function ($app) {
61
+        $this->app->singleton('view', function($app) {
62 62
 
63 63
             // The resolver will be used by an environment to get each of the various 
64 64
             // engine implementations such as plain PHP or Plaze engine.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function registerViewFinder()
88 88
     {
89
-        $this->app->bind('view.finder', function ($app) {
89
+        $this->app->bind('view.finder', function($app) {
90 90
             return new FileViewFinder($app['files'], $app['config']['view.paths']);
91 91
         });
92 92
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function registerPlazeTranspiler()
100 100
     {
101
-        $this->app->singleton('plaze.transpiler', function ($app) {
101
+        $this->app->singleton('plaze.transpiler', function($app) {
102 102
 
103 103
             return new PlazeTranspiler(
104 104
                 $app['files'], $app['config']['view.transpiled']
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function registerEngineResolver()
116 116
     {
117
-        $this->app->singleton('view.engine.resolver', function () {
117
+        $this->app->singleton('view.engine.resolver', function() {
118 118
 
119 119
             $resolver = new EngineResolver;
120 120
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public function registerFileEngine($resolver)
139 139
     {
140
-        $resolver->register('file', function () {
140
+        $resolver->register('file', function() {
141 141
             return new FileEngine;
142 142
         });
143 143
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public function registerPhpEngine($resolver)
153 153
     {
154
-        $resolver->register('php', function () {
154
+        $resolver->register('php', function() {
155 155
             return new PhpEngine($this->app['files']);
156 156
         });
157 157
     }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public function registerPlazeEngine($resolver)
167 167
     {
168
-        $resolver->register('plaze', function () {
168
+        $resolver->register('plaze', function() {
169 169
             return new TranspilerEngine($this->app['plaze.transpiler'], $this->app['files']);
170 170
         });
171 171
     }
Please login to merge, or discard this patch.
src/components/View/ViewName.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@
 block discarded – undo
43 43
     {
44 44
         $delimiter = ViewFinder::HINT_PATH_DELIMITER;
45 45
 		
46
-		if (strpos($name, $delimiter) === false)
47
-		{
48
-			return str_replace('/', '.', $name);
49
-		}
46
+        if (strpos($name, $delimiter) === false)
47
+        {
48
+            return str_replace('/', '.', $name);
49
+        }
50 50
 		
51
-		[$namespace, $name] = explode($delimiter, $name);
51
+        [$namespace, $name] = explode($delimiter, $name);
52 52
 		
53
-		return $namespace.$delimiter.str_replace('/', '.', $name);
53
+        return $namespace.$delimiter.str_replace('/', '.', $name);
54 54
     }
55 55
 }
56 56
\ No newline at end of file
Please login to merge, or discard this patch.
src/components/View/Factory.php 3 patches
Indentation   +279 added lines, -279 removed lines patch added patch discarded remove patch
@@ -39,320 +39,320 @@
 block discarded – undo
39 39
  */
40 40
 class Factory implements FactoryContract
41 41
 {
42
-	use Extensions,
43
-		Concerns\ManagesLayouts,
44
-		Concerns\ManagesComponents,
45
-		Concerns\ManagesTranslations;
42
+    use Extensions,
43
+        Concerns\ManagesLayouts,
44
+        Concerns\ManagesComponents,
45
+        Concerns\ManagesTranslations;
46 46
 	
47
-	/**
48
-	 * The IoC container instance.
49
-	 * 
50
-	 * @var \Syscodes\Contracts\Container\Container $container
51
-	 */
52
-	protected $container;
47
+    /**
48
+     * The IoC container instance.
49
+     * 
50
+     * @var \Syscodes\Contracts\Container\Container $container
51
+     */
52
+    protected $container;
53 53
 
54
-	/**
55
-	 * The engine implementation.
56
-	 * 
57
-	 * @var \Syscodes\View\Engines\EngineResolver $engines
58
-	 */
59
-	protected $engines;
54
+    /**
55
+     * The engine implementation.
56
+     * 
57
+     * @var \Syscodes\View\Engines\EngineResolver $engines
58
+     */
59
+    protected $engines;
60 60
 
61
-	/**
62
-	 * The event dispatcher instance.
63
-	 * 
64
-	 * @var \Syscodes\Contracts\Events\Dispatcher $events
65
-	 */
66
-	protected $events;
61
+    /**
62
+     * The event dispatcher instance.
63
+     * 
64
+     * @var \Syscodes\Contracts\Events\Dispatcher $events
65
+     */
66
+    protected $events;
67 67
 
68
-	/**
69
-	 * The view finder implementation.
70
-	 * 
71
-	 * @var \Syscodes\View\FileViewFinder $finder
72
-	 */
73
-	protected $finder;
68
+    /**
69
+     * The view finder implementation.
70
+     * 
71
+     * @var \Syscodes\View\FileViewFinder $finder
72
+     */
73
+    protected $finder;
74 74
 
75
-	/**
76
-	 * The number of active rendering operations.
77
-	 * 
78
-	 * @var int $renderCount
79
-	 */
80
-	protected $renderCount = 0;
75
+    /**
76
+     * The number of active rendering operations.
77
+     * 
78
+     * @var int $renderCount
79
+     */
80
+    protected $renderCount = 0;
81 81
 
82
-	/**
83
-	 * Array of shared data.
84
-	 * 
85
-	 * @var array $shared
86
-	 */
87
-	protected $shared = [];
82
+    /**
83
+     * Array of shared data.
84
+     * 
85
+     * @var array $shared
86
+     */
87
+    protected $shared = [];
88 88
 
89
-	/**
90
-	 * Constructor: Create a new Parser class instance.
91
-	 * 
92
-	 * @param  \Syscodes\View\Engines\EngineResolver  $engine
93
-	 * @param  \Syscodes\Contracts\View\ViewFinder  $finder
94
-	 * @param  \Syscodes\Contracts\Events\Dispatcher  $events
95
-	 *
96
-	 * @return void
97
-	 */
98
-	public function __construct(EngineResolver $engines, ViewFinder $finder, Dispatcher $events)
99
-	{
100
-		$this->finder  = $finder;
101
-		$this->engines = $engines;
102
-		$this->events  = $events;
89
+    /**
90
+     * Constructor: Create a new Parser class instance.
91
+     * 
92
+     * @param  \Syscodes\View\Engines\EngineResolver  $engine
93
+     * @param  \Syscodes\Contracts\View\ViewFinder  $finder
94
+     * @param  \Syscodes\Contracts\Events\Dispatcher  $events
95
+     *
96
+     * @return void
97
+     */
98
+    public function __construct(EngineResolver $engines, ViewFinder $finder, Dispatcher $events)
99
+    {
100
+        $this->finder  = $finder;
101
+        $this->engines = $engines;
102
+        $this->events  = $events;
103 103
 
104
-		$this->share('__env', $this);
105
-	}
104
+        $this->share('__env', $this);
105
+    }
106 106
 	
107
-	/**
108
-	 * Check existance view file.
109
-	 * 
110
-	 * @param  string  $view
111
-	 *
112
-	 * @return bool
113
-	 */
114
-	public function viewExists($view)
115
-	{
116
-		try 
117
-		{
118
-			$this->finder->find($view);
119
-		}
120
-		catch(InvalidArgumentException $e)
121
-		{
122
-			return false;
123
-		}
107
+    /**
108
+     * Check existance view file.
109
+     * 
110
+     * @param  string  $view
111
+     *
112
+     * @return bool
113
+     */
114
+    public function viewExists($view)
115
+    {
116
+        try 
117
+        {
118
+            $this->finder->find($view);
119
+        }
120
+        catch(InvalidArgumentException $e)
121
+        {
122
+            return false;
123
+        }
124 124
 
125
-		return true;
126
-	}
125
+        return true;
126
+    }
127 127
 	
128
-	/**
129
-	 * Global and local data are merged and extracted to create local variables within the view file.
130
-	 * Renders the view object to a string.
131
-	 *
132
-	 * @example $output = $view->make();
133
-	 *
134
-	 * @param  string  $view  View filename
135
-	 * @param  array  $data  Array of values
136
-	 *
137
-	 * @return string
138
-	 */
139
-	public function make($view, $data = []) 
140
-	{
141
-		$path = $this->finder->find(
142
-			$view = $this->normalizeName($view)
143
-		);
128
+    /**
129
+     * Global and local data are merged and extracted to create local variables within the view file.
130
+     * Renders the view object to a string.
131
+     *
132
+     * @example $output = $view->make();
133
+     *
134
+     * @param  string  $view  View filename
135
+     * @param  array  $data  Array of values
136
+     *
137
+     * @return string
138
+     */
139
+    public function make($view, $data = []) 
140
+    {
141
+        $path = $this->finder->find(
142
+            $view = $this->normalizeName($view)
143
+        );
144 144
 		
145
-		// Loader class instance.
146
-		return take($this->viewInstance($view, $path, $data), function ($view) {
147
-			$this->callCreator($view);
148
-		});
149
-	}
145
+        // Loader class instance.
146
+        return take($this->viewInstance($view, $path, $data), function ($view) {
147
+            $this->callCreator($view);
148
+        });
149
+    }
150 150
 
151
-	/**
152
-	 * Normalize a view name.
153
-	 * 
154
-	 * @param  string  $name
155
-	 * 
156
-	 * @return string
157
-	 */
158
-	protected function normalizeName($name)
151
+    /**
152
+     * Normalize a view name.
153
+     * 
154
+     * @param  string  $name
155
+     * 
156
+     * @return string
157
+     */
158
+    protected function normalizeName($name)
159 159
     {
160
-		return ViewName::normalize($name);
160
+        return ViewName::normalize($name);
161 161
     }
162 162
 
163
-	/**
164
-	 * Create a new view instance from the given arguments.
165
-	 * 
166
-	 * @param  string  $file  View filename
167
-	 * * @param  string  $path  Path filename
168
-	 * @param  array  $data  Array of values
169
-	 * 
170
-	 * @return \Syscodes\Contracts\View\View
171
-	 */
172
-	protected function viewInstance($view, $path, $data)
173
-	{
174
-		return new View($this, $this->getEngineFromPath($path), $view, $path, $data);
175
-	}
163
+    /**
164
+     * Create a new view instance from the given arguments.
165
+     * 
166
+     * @param  string  $file  View filename
167
+     * * @param  string  $path  Path filename
168
+     * @param  array  $data  Array of values
169
+     * 
170
+     * @return \Syscodes\Contracts\View\View
171
+     */
172
+    protected function viewInstance($view, $path, $data)
173
+    {
174
+        return new View($this, $this->getEngineFromPath($path), $view, $path, $data);
175
+    }
176 176
 	
177
-	/**
178
-	 * Get the appropriate view engine for the given path.
179
-	 * 
180
-	 * @param  string  $path
181
-	 * 
182
-	 * @return \Illuminate\Contracts\View\Engine
183
-	 * 
184
-	 * @throws \InvalidArgumentException
185
-	 */
186
-	public function getEngineFromPath($path)
187
-	{
188
-		if ( ! $extension = $this->getExtension($path))
189
-		{
190
-			throw new InvalidArgumentException("Unrecognized extension in file: {$path}");
191
-		}
177
+    /**
178
+     * Get the appropriate view engine for the given path.
179
+     * 
180
+     * @param  string  $path
181
+     * 
182
+     * @return \Illuminate\Contracts\View\Engine
183
+     * 
184
+     * @throws \InvalidArgumentException
185
+     */
186
+    public function getEngineFromPath($path)
187
+    {
188
+        if ( ! $extension = $this->getExtension($path))
189
+        {
190
+            throw new InvalidArgumentException("Unrecognized extension in file: {$path}");
191
+        }
192 192
 		
193
-		$engine = $this->extensions[$extension];
193
+        $engine = $this->extensions[$extension];
194 194
 		
195
-		return $this->engines->resolve($engine);
196
-	}
195
+        return $this->engines->resolve($engine);
196
+    }
197 197
 	
198
-	/**
199
-	 * Get the extension used by the view file.
200
-	 * 
201
-	 * @param  string  $path
202
-	 * 
203
-	 * @return string
204
-	 */
205
-	protected function getExtension($path)
206
-	{
207
-		$extensions = array_keys($this->extensions);
198
+    /**
199
+     * Get the extension used by the view file.
200
+     * 
201
+     * @param  string  $path
202
+     * 
203
+     * @return string
204
+     */
205
+    protected function getExtension($path)
206
+    {
207
+        $extensions = array_keys($this->extensions);
208 208
 		
209
-		return Arr::first($extensions, function($key, $value) use ($path)
210
-		{
211
-			return Str::endsWith($path, '.'.$value);
212
-		});
213
-	}
209
+        return Arr::first($extensions, function($key, $value) use ($path)
210
+        {
211
+            return Str::endsWith($path, '.'.$value);
212
+        });
213
+    }
214 214
 	
215
-	/**
216
-	 * Call the creator for a given view.
217
-	 * 
218
-	 * @param  \Syscodes\View\View  $view
219
-	 * 
220
-	 * @return void
221
-	 */
222
-	public function callCreator(View $view)
223
-	{
224
-		$this->events->dispatch('creating: '.$view->getView(), [$view]);
225
-	}
215
+    /**
216
+     * Call the creator for a given view.
217
+     * 
218
+     * @param  \Syscodes\View\View  $view
219
+     * 
220
+     * @return void
221
+     */
222
+    public function callCreator(View $view)
223
+    {
224
+        $this->events->dispatch('creating: '.$view->getView(), [$view]);
225
+    }
226 226
 	
227
-	/**
228
-	 * Get the extension to engine bindings.
229
-	 * 
230
-	 * @return array
231
-	 */
232
-	public function getExtensions()
233
-	{
234
-		return $this->extensions;
235
-	}
227
+    /**
228
+     * Get the extension to engine bindings.
229
+     * 
230
+     * @return array
231
+     */
232
+    public function getExtensions()
233
+    {
234
+        return $this->extensions;
235
+    }
236 236
 	
237
-	/**
238
-	 * Add a piece of shared data to the environment.
239
-	 * 
240
-	 * @param  array|string  $key
241
-	 * @param  mixed|null  $value  (null by default)
242
-	 * 
243
-	 * @return mixed
244
-	 */
245
-	public function share($key, $value = null)
246
-	{
247
-		$keys = is_array($key) ? $key : [$key => $value];
237
+    /**
238
+     * Add a piece of shared data to the environment.
239
+     * 
240
+     * @param  array|string  $key
241
+     * @param  mixed|null  $value  (null by default)
242
+     * 
243
+     * @return mixed
244
+     */
245
+    public function share($key, $value = null)
246
+    {
247
+        $keys = is_array($key) ? $key : [$key => $value];
248 248
 		
249
-		foreach ($keys as $key => $value)
250
-		{
251
-			$this->shared[$key] = $value;
252
-		}
249
+        foreach ($keys as $key => $value)
250
+        {
251
+            $this->shared[$key] = $value;
252
+        }
253 253
 		
254
-		return $value;
255
-	}
254
+        return $value;
255
+    }
256 256
 
257
-	/**
258
-	 * Replace the namespace hints for the given namespace.
259
-	 * 
260
-	 * @param  string  $namespace
261
-	 * @param  string|array  $hints
262
-	 * 
263
-	 * @return $this
264
-	 */
265
-	public function replaceNamespace($namespace, $hints)
266
-	{
267
-		$this->finder->replaceNamespace($namespace, $hints);
257
+    /**
258
+     * Replace the namespace hints for the given namespace.
259
+     * 
260
+     * @param  string  $namespace
261
+     * @param  string|array  $hints
262
+     * 
263
+     * @return $this
264
+     */
265
+    public function replaceNamespace($namespace, $hints)
266
+    {
267
+        $this->finder->replaceNamespace($namespace, $hints);
268 268
 
269
-		return $this;
270
-	}
269
+        return $this;
270
+    }
271 271
 
272
-	/**
273
-	 * Increment the rendering counter.
274
-	 * 
275
-	 * @return void
276
-	 */
277
-	public function increment()
278
-	{
279
-		return $this->renderCount++;
280
-	}
272
+    /**
273
+     * Increment the rendering counter.
274
+     * 
275
+     * @return void
276
+     */
277
+    public function increment()
278
+    {
279
+        return $this->renderCount++;
280
+    }
281 281
 
282
-	/**
283
-	 * Decrement the rendering counter.
284
-	 * 
285
-	 * @return void
286
-	 */
287
-	public function decrement()
288
-	{
289
-		return $this->renderCount--;
290
-	}
282
+    /**
283
+     * Decrement the rendering counter.
284
+     * 
285
+     * @return void
286
+     */
287
+    public function decrement()
288
+    {
289
+        return $this->renderCount--;
290
+    }
291 291
 
292
-	/**
293
-	 * Check if there are no active render operations.
294
-	 * 
295
-	 * @return bool
296
-	 */
297
-	public function doneRendering()
298
-	{
299
-		return $this->renderCount == 0;
300
-	}
292
+    /**
293
+     * Check if there are no active render operations.
294
+     * 
295
+     * @return bool
296
+     */
297
+    public function doneRendering()
298
+    {
299
+        return $this->renderCount == 0;
300
+    }
301 301
 
302
-	/**
303
-	 * Flush all of the parser state like sections.
304
-	 * 
305
-	 * @return void
306
-	 */
307
-	public function flushState()
308
-	{
309
-		$this->renderCount = 0;
302
+    /**
303
+     * Flush all of the parser state like sections.
304
+     * 
305
+     * @return void
306
+     */
307
+    public function flushState()
308
+    {
309
+        $this->renderCount = 0;
310 310
 
311
-		$this->flushSections();
312
-	}
311
+        $this->flushSections();
312
+    }
313 313
 
314
-	/**
315
-	 * Flush all of the section contents if done rendering.
316
-	 * 
317
-	 * @return void
318
-	 */
319
-	public function flushStateIfDoneRendering()
320
-	{
321
-		if ($this->doneRendering())
322
-		{
323
-			$this->flushState();
324
-		}
325
-	}
314
+    /**
315
+     * Flush all of the section contents if done rendering.
316
+     * 
317
+     * @return void
318
+     */
319
+    public function flushStateIfDoneRendering()
320
+    {
321
+        if ($this->doneRendering())
322
+        {
323
+            $this->flushState();
324
+        }
325
+    }
326 326
 
327
-	/**
328
-	 * Get all of the shared data for the environment.
329
-	 * 
330
-	 * @return void
331
-	 */
332
-	public function getShared()
333
-	{
334
-		return $this->shared;
335
-	}
327
+    /**
328
+     * Get all of the shared data for the environment.
329
+     * 
330
+     * @return void
331
+     */
332
+    public function getShared()
333
+    {
334
+        return $this->shared;
335
+    }
336 336
 
337
-	/**
338
-	 * Get the IoC container instance.
339
-	 * 
340
-	 * @return \Syscodes\Contracts\Container\Container
341
-	 */
342
-	public function getContainer()
343
-	{
344
-		return $this->container;
345
-	}
337
+    /**
338
+     * Get the IoC container instance.
339
+     * 
340
+     * @return \Syscodes\Contracts\Container\Container
341
+     */
342
+    public function getContainer()
343
+    {
344
+        return $this->container;
345
+    }
346 346
 
347
-	/**
348
-	 * Set the IoC container instance.
349
-	 * 
350
-	 * @param  \Syscodes\Contracts\Container\Container  $container
351
-	 * 
352
-	 * @return void
353
-	 */
354
-	public function setContainer($container)
355
-	{
356
-		$this->container = $container;
357
-	}
347
+    /**
348
+     * Set the IoC container instance.
349
+     * 
350
+     * @param  \Syscodes\Contracts\Container\Container  $container
351
+     * 
352
+     * @return void
353
+     */
354
+    public function setContainer($container)
355
+    {
356
+        $this->container = $container;
357
+    }
358 358
 }
359 359
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		{
118 118
 			$this->finder->find($view);
119 119
 		}
120
-		catch(InvalidArgumentException $e)
120
+		catch (InvalidArgumentException $e)
121 121
 		{
122 122
 			return false;
123 123
 		}
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 		);
144 144
 		
145 145
 		// Loader class instance.
146
-		return take($this->viewInstance($view, $path, $data), function ($view) {
146
+		return take($this->viewInstance($view, $path, $data), function($view) {
147 147
 			$this->callCreator($view);
148 148
 		});
149 149
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,8 +116,7 @@
 block discarded – undo
116 116
 		try 
117 117
 		{
118 118
 			$this->finder->find($view);
119
-		}
120
-		catch(InvalidArgumentException $e)
119
+		} catch(InvalidArgumentException $e)
121 120
 		{
122 121
 			return false;
123 122
 		}
Please login to merge, or discard this patch.
src/components/View/FileViewFinder.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@
 block discarded – undo
170 170
             }
171 171
         }
172 172
         
173
-       throw new ViewException(__('view.notFound', ['file' => $name]));
173
+        throw new ViewException(__('view.notFound', ['file' => $name]));
174 174
     }
175 175
 
176 176
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@
 block discarded – undo
182 182
      */
183 183
     protected function getFindViewFiles($name)
184 184
     {
185
-        return array_map(function ($extension) use ($name) {
185
+        return array_map(function($extension) use ($name) {
186 186
             return str_replace('.', DIRECTORY_SEPARATOR, $name).'.'.$extension;   
187 187
         }, $this->getExtensions());
188 188
     }
Please login to merge, or discard this patch.
src/components/View/Transpilers/Transpiler.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
         }
98 98
 
99 99
         return $this->files->lastModified($path) >=
100
-               $this->files->lastModified($compiled);
100
+                $this->files->lastModified($compiled);
101 101
     }
102 102
 }
103 103
 
Please login to merge, or discard this patch.
src/components/View/Transpilers/Concerns/TranspilesTranslations.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,7 @@
 block discarded – undo
42 42
         if (is_null($expression))
43 43
         {
44 44
             return '<?php \$__env->beginTranslation(); ?>';
45
-        }
46
-        elseif ($expression[1] === '[')
45
+        } elseif ($expression[1] === '[')
47 46
         {
48 47
             return "<?php \$__env->beginTranslation{$expression}; ?>";
49 48
         }
Please login to merge, or discard this patch.
src/components/View/Transpilers/Concerns/TranspilesEchos.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->rawTags[0], $this->rawTags[1]);
74 74
         
75
-        $callback = function ($matches)
75
+        $callback = function($matches)
76 76
         {
77 77
             $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3];
78 78
             
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     {
94 94
         $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->contentTags[0], $this->contentTags[1]);
95 95
         
96
-        $callback = function ($matches)
96
+        $callback = function($matches)
97 97
         {
98 98
             $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3];
99 99
             
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     {
117 117
         $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->escapedTags[0], $this->escapedTags[1]);
118 118
         
119
-        $callback = function ($matches)
119
+        $callback = function($matches)
120 120
         {
121 121
             $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3];
122 122
             
Please login to merge, or discard this patch.
src/components/View/Concerns/ManagesIncludes.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,16 +30,16 @@
 block discarded – undo
30 30
  */
31 31
 trait ManagesIncludes
32 32
 {
33
-	/**
34
-	 * Include another view in a view.
35
-	 * 
36
-	 * @param  string  $file
37
-	 * @param  array  $data
38
-	 * 
39
-	 * @return string
40
-	 */
41
-	public function include($file, $data = [])
42
-	{
43
-		return $this->make($file, $data)->render();
44
-	}
33
+    /**
34
+     * Include another view in a view.
35
+     * 
36
+     * @param  string  $file
37
+     * @param  array  $data
38
+     * 
39
+     * @return string
40
+     */
41
+    public function include($file, $data = [])
42
+    {
43
+        return $this->make($file, $data)->render();
44
+    }
45 45
 }
46 46
\ No newline at end of file
Please login to merge, or discard this patch.
src/components/View/Concerns/ManagesLayouts.php 2 patches
Indentation   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -33,193 +33,193 @@
 block discarded – undo
33 33
  */
34 34
 trait ManagesLayouts
35 35
 {	
36
-	/**
37
-	 * Started blocks.
38
-	 * 
39
-	 * @var array $sections
40
-	 */
41
-	protected $sections = [];
36
+    /**
37
+     * Started blocks.
38
+     * 
39
+     * @var array $sections
40
+     */
41
+    protected $sections = [];
42 42
 	
43
-	/**
44
-	 * The stack of in-progress sections.
45
-	 * 
46
-	 * @var array $sectionStack
47
-	 */
48
-	protected $sectionStack = [];
43
+    /**
44
+     * The stack of in-progress sections.
45
+     * 
46
+     * @var array $sectionStack
47
+     */
48
+    protected $sectionStack = [];
49 49
 	
50
-	/**
51
-	 * Starting section.
52
-	 * 
53
-	 * @param  string  $section
54
-	 * @param  string|null  $content  (null by default)
55
-	 * 
56
-	 * @return array
57
-	 */
58
-	public function beginSection($section, $content = null)
59
-	{
60
-		if (null === $content)
61
-		{
62
-			if (ob_start())
63
-			{
64
-				$this->sectionStack[] = $section;
65
-			}
66
-		}
67
-		else
68
-		{
69
-			$this->extendSection($section, $content instanceof View ? $content : e($content));
70
-		}
71
-	}
50
+    /**
51
+     * Starting section.
52
+     * 
53
+     * @param  string  $section
54
+     * @param  string|null  $content  (null by default)
55
+     * 
56
+     * @return array
57
+     */
58
+    public function beginSection($section, $content = null)
59
+    {
60
+        if (null === $content)
61
+        {
62
+            if (ob_start())
63
+            {
64
+                $this->sectionStack[] = $section;
65
+            }
66
+        }
67
+        else
68
+        {
69
+            $this->extendSection($section, $content instanceof View ? $content : e($content));
70
+        }
71
+    }
72 72
 	
73
-	/**
74
-	 * Append content to a given section.
75
-	 * 
76
-	 * @param  string  $section
77
-	 * @param  string  $content
78
-	 * 
79
-	 * @return void
80
-	 */
81
-	protected function extendSection($section, $content)
82
-	{
83
-		if (isset($this->sections[$section]))
84
-		{
85
-			$content = str_replace(static::parent(), $content, $this->sections[$section]);
86
-		}
73
+    /**
74
+     * Append content to a given section.
75
+     * 
76
+     * @param  string  $section
77
+     * @param  string  $content
78
+     * 
79
+     * @return void
80
+     */
81
+    protected function extendSection($section, $content)
82
+    {
83
+        if (isset($this->sections[$section]))
84
+        {
85
+            $content = str_replace(static::parent(), $content, $this->sections[$section]);
86
+        }
87 87
 		
88
-		$this->sections[$section] = $content;
89
-	}
88
+        $this->sections[$section] = $content;
89
+    }
90 90
 	
91
-	/**
92
-	 * Close and printing section.
93
-	 * 
94
-	 * @return string
95
-	 */
96
-	public function showSection()
97
-	{
98
-		if (empty($this->sectionStack))
99
-		{
100
-			return '';
101
-		}
91
+    /**
92
+     * Close and printing section.
93
+     * 
94
+     * @return string
95
+     */
96
+    public function showSection()
97
+    {
98
+        if (empty($this->sectionStack))
99
+        {
100
+            return '';
101
+        }
102 102
 		
103
-		return $this->giveContent($this->stopSection());
104
-	}
103
+        return $this->giveContent($this->stopSection());
104
+    }
105 105
 	
106
-	/**
107
-	 * Give sections the page view from the master page.
108
-	 * 
109
-	 * @param  string  $name
110
-	 * 
111
-	 * @return string
112
-	 */
113
-	public function giveContent($name, $default = '')
114
-	{
115
-		$sectionContent = $default instanceof View ? $default : e($default);
106
+    /**
107
+     * Give sections the page view from the master page.
108
+     * 
109
+     * @param  string  $name
110
+     * 
111
+     * @return string
112
+     */
113
+    public function giveContent($name, $default = '')
114
+    {
115
+        $sectionContent = $default instanceof View ? $default : e($default);
116 116
 		
117
-		if (isset($this->sections[$name]))
118
-		{
119
-			$sectionContent = $this->sections[$name];
120
-		}
117
+        if (isset($this->sections[$name]))
118
+        {
119
+            $sectionContent = $this->sections[$name];
120
+        }
121 121
 		
122
-		return str_replace(static::parent(), '', $sectionContent);
123
-	}
122
+        return str_replace(static::parent(), '', $sectionContent);
123
+    }
124 124
 	
125
-	/**
126
-	 * Closing section.
127
-	 * 
128
-	 * @param  bool  $overwrite  (false by default)
129
-	 * 
130
-	 * @return mixed
131
-	 * 
132
-	 * @throws \InvalidArgumentException
133
-	 */
134
-	public function stopSection($overwrite = false)
135
-	{
136
-		if (empty($this->sectionStack))
137
-		{
138
-			throw new InvalidArgumentException('You cannot finish a section without first starting with one.');
139
-		}
125
+    /**
126
+     * Closing section.
127
+     * 
128
+     * @param  bool  $overwrite  (false by default)
129
+     * 
130
+     * @return mixed
131
+     * 
132
+     * @throws \InvalidArgumentException
133
+     */
134
+    public function stopSection($overwrite = false)
135
+    {
136
+        if (empty($this->sectionStack))
137
+        {
138
+            throw new InvalidArgumentException('You cannot finish a section without first starting with one.');
139
+        }
140 140
 		
141
-		$last = array_pop($this->sectionStack);
141
+        $last = array_pop($this->sectionStack);
142 142
 		
143
-		if ($overwrite)
144
-		{
145
-			$this->sections[$last] = ob_get_clean();
146
-		}
147
-		else
148
-		{
149
-			$this->extendSection($last, ob_get_clean());
150
-		}
143
+        if ($overwrite)
144
+        {
145
+            $this->sections[$last] = ob_get_clean();
146
+        }
147
+        else
148
+        {
149
+            $this->extendSection($last, ob_get_clean());
150
+        }
151 151
 		
152
-		return $last;
153
-	}
152
+        return $last;
153
+    }
154 154
 	
155
-	/**
156
-	 * Stop injecting content into a section and append it.
157
-	 * 
158
-	 * @return string
159
-	 * 
160
-	 * @throws \InvalidArgumentException
161
-	 */
162
-	public function appendSection()
163
-	{
164
-		if (empty($this->sectionStack))
165
-		{
166
-			throw new InvalidArgumentException('You cannot finish a section without first starting with one.');
167
-		}
155
+    /**
156
+     * Stop injecting content into a section and append it.
157
+     * 
158
+     * @return string
159
+     * 
160
+     * @throws \InvalidArgumentException
161
+     */
162
+    public function appendSection()
163
+    {
164
+        if (empty($this->sectionStack))
165
+        {
166
+            throw new InvalidArgumentException('You cannot finish a section without first starting with one.');
167
+        }
168 168
 		
169
-		$last = array_pop($this->sectionStack);
169
+        $last = array_pop($this->sectionStack);
170 170
 		
171
-		if (isset($this->sections[$last]))
172
-		{
173
-			$this->sections[$last] .= ob_get_clean();
174
-		}
175
-		else
176
-		{
177
-			$this->sections[$last] = ob_get_clean();
178
-		}
171
+        if (isset($this->sections[$last]))
172
+        {
173
+            $this->sections[$last] .= ob_get_clean();
174
+        }
175
+        else
176
+        {
177
+            $this->sections[$last] = ob_get_clean();
178
+        }
179 179
 		
180
-		return $last;
181
-	}
180
+        return $last;
181
+    }
182 182
 	
183
-	/**
184
-	 * Check if section exists.
185
-	 * 
186
-	 * @param  string  $name
187
-	 * 
188
-	 * @return bool
189
-	 */
190
-	public function hasSection($name)
191
-	{
192
-		return array_key_exists($name, $this->sections);
193
-	}
183
+    /**
184
+     * Check if section exists.
185
+     * 
186
+     * @param  string  $name
187
+     * 
188
+     * @return bool
189
+     */
190
+    public function hasSection($name)
191
+    {
192
+        return array_key_exists($name, $this->sections);
193
+    }
194 194
 	
195
-	/**
196
-	 * Get the entire array of sections.
197
-	 * 
198
-	 * @return array
199
-	 */
200
-	public function getSections()
201
-	{
202
-		return $this->sections;
203
-	}
195
+    /**
196
+     * Get the entire array of sections.
197
+     * 
198
+     * @return array
199
+     */
200
+    public function getSections()
201
+    {
202
+        return $this->sections;
203
+    }
204 204
 	
205
-	/**
206
-	 * Replace the @parent directive to a placeholder.
207
-	 * 
208
-	 * @return string
209
-	 */
210
-	public static function parent()
211
-	{
212
-		return '@parent';
213
-	}
205
+    /**
206
+     * Replace the @parent directive to a placeholder.
207
+     * 
208
+     * @return string
209
+     */
210
+    public static function parent()
211
+    {
212
+        return '@parent';
213
+    }
214 214
 	
215
-	/**
216
-	 * Flush all of the section contents.
217
-	 * 
218
-	 * @return void
219
-	 */
220
-	public function flushSections()
221
-	{
222
-		$this->sections     = [];
223
-		$this->sectionStack = [];
224
-	}
215
+    /**
216
+     * Flush all of the section contents.
217
+     * 
218
+     * @return void
219
+     */
220
+    public function flushSections()
221
+    {
222
+        $this->sections     = [];
223
+        $this->sectionStack = [];
224
+    }
225 225
 }
226 226
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
 			{
64 64
 				$this->sectionStack[] = $section;
65 65
 			}
66
-		}
67
-		else
66
+		} else
68 67
 		{
69 68
 			$this->extendSection($section, $content instanceof View ? $content : e($content));
70 69
 		}
@@ -143,8 +142,7 @@  discard block
 block discarded – undo
143 142
 		if ($overwrite)
144 143
 		{
145 144
 			$this->sections[$last] = ob_get_clean();
146
-		}
147
-		else
145
+		} else
148 146
 		{
149 147
 			$this->extendSection($last, ob_get_clean());
150 148
 		}
@@ -171,8 +169,7 @@  discard block
 block discarded – undo
171 169
 		if (isset($this->sections[$last]))
172 170
 		{
173 171
 			$this->sections[$last] .= ob_get_clean();
174
-		}
175
-		else
172
+		} else
176 173
 		{
177 174
 			$this->sections[$last] = ob_get_clean();
178 175
 		}
Please login to merge, or discard this patch.