Completed
Push — master ( 5c0675...554793 )
by Helmut
03:37
created
src/Fields/Search/Search.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,12 +25,16 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function setValuesFromDefaults($defaults)
27 27
     {
28
-        if (count($defaults)) $this->value = array_shift($defaults);
28
+        if (count($defaults)) {
29
+            $this->value = array_shift($defaults);
30
+        }
29 31
     }
30 32
 
31 33
     public function setValuesFromModel($model)
32 34
     {
33
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
35
+        if (property_exists($model, $this->name)) {
36
+            $this->value = $model->{$this->name};
37
+        }
34 38
     }
35 39
 
36 40
     public function setValuesFromRequest($request)
@@ -40,7 +44,9 @@  discard block
 block discarded – undo
40 44
 
41 45
     public function fillModelWithValues($model)
42 46
     {
43
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
47
+        if (property_exists($model, $this->name)) {
48
+            $model->{$this->name} = $this->value;
49
+        }
44 50
     }   
45 51
 
46 52
     public function validateRequired()
Please login to merge, or discard this patch.
src/Engines/Blade.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,18 +6,18 @@
 block discarded – undo
6 6
 
7 7
 class Blade implements Engine {
8 8
 
9
-	/**
9
+    /**
10 10
      * Render the template content.
11 11
      *
12
-	 * @param  string  $path
13
-	 * @param  array  $properties
12
+     * @param  string  $path
13
+     * @param  array  $properties
14 14
      * @return string
15 15
      */
16
-	public function render($path, $properties = []) 
17
-	{
18
-		if ( ! function_exists('app')) throw new \Exception('Laravel required for blade rendering engine.');
16
+    public function render($path, $properties = []) 
17
+    {
18
+        if ( ! function_exists('app')) throw new \Exception('Laravel required for blade rendering engine.');
19 19
 
20
-		return app()->make('view')->file($path, $properties);
21
-	}
20
+        return app()->make('view')->file($path, $properties);
21
+    }
22 22
 
23 23
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@
 block discarded – undo
15 15
      */
16 16
 	public function render($path, $properties = []) 
17 17
 	{
18
-		if ( ! function_exists('app')) throw new \Exception('Laravel required for blade rendering engine.');
18
+		if ( ! function_exists('app')) {
19
+		    throw new \Exception('Laravel required for blade rendering engine.');
20
+		}
19 21
 
20 22
 		return app()->make('view')->file($path, $properties);
21 23
 	}
Please login to merge, or discard this patch.
src/Engines/Mustache.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,32 +12,32 @@
 block discarded – undo
12 12
      *
13 13
      * @var \Mustache_Engine
14 14
      */	
15
-	protected $compiler;
15
+    protected $compiler;
16 16
 
17
-	/**
17
+    /**
18 18
      * Fetch the compiler.
19 19
      *
20 20
      * @return \Mustache_Engine
21 21
      */
22
-	public function compiler()
23
-	{
24
-		if ( ! $this->compiler) $this->compiler = new Mustache_Engine;
22
+    public function compiler()
23
+    {
24
+        if ( ! $this->compiler) $this->compiler = new Mustache_Engine;
25 25
 
26
-		return $this->compiler;
27
-	}
26
+        return $this->compiler;
27
+    }
28 28
 
29
-	/**
29
+    /**
30 30
      * Render the template content.
31 31
      *
32
-	 * @param  string  $path
33
-	 * @param  array  $properties
32
+     * @param  string  $path
33
+     * @param  array  $properties
34 34
      * @return string
35 35
      */
36
-	public function render($path, $properties = []) 
37
-	{
38
-		$content = file_get_contents($path);
36
+    public function render($path, $properties = []) 
37
+    {
38
+        $content = file_get_contents($path);
39 39
 
40
-		return $this->compiler()->render($content, $properties);
41
-	}
40
+        return $this->compiler()->render($content, $properties);
41
+    }
42 42
 
43 43
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@
 block discarded – undo
21 21
      */
22 22
 	public function compiler()
23 23
 	{
24
-		if ( ! $this->compiler) $this->compiler = new Mustache_Engine;
24
+		if ( ! $this->compiler) {
25
+		    $this->compiler = new Mustache_Engine;
26
+		}
25 27
 
26 28
 		return $this->compiler;
27 29
 	}
Please login to merge, or discard this patch.
src/Engine.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 
5 5
 interface Engine {
6 6
 	
7
-	/**
7
+    /**
8 8
      * Render the template content.
9 9
      *
10
-	 * @param  string  $path
11
-	 * @param  array  $properties
10
+     * @param  string  $path
11
+     * @param  array  $properties
12 12
      * @return string
13 13
      */
14
-	public function render($path, $properties = []);
14
+    public function render($path, $properties = []);
15 15
 
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
src/Requests/Symfony.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -7,26 +7,26 @@
 block discarded – undo
7 7
 
8 8
 class Symfony implements Request {
9 9
 	
10
-	protected $request;
11
-
12
-	public function __construct()
13
-	{
14
-		$this->request = SymfonyRequest::createFromGlobals();
15
-	}
16
-
17
-	public function all()
18
-	{
19
-		return $this->request->request->all();
20
-	}
21
-
22
-	public function get($key)
23
-	{
24
-		return $this->request->request->get($key);
25
-	}
26
-
27
-	public function csrf()
28
-	{
29
-		return ['name' => '_token', 'value' => csrf_token()];
30
-	}
10
+    protected $request;
11
+
12
+    public function __construct()
13
+    {
14
+        $this->request = SymfonyRequest::createFromGlobals();
15
+    }
16
+
17
+    public function all()
18
+    {
19
+        return $this->request->request->all();
20
+    }
21
+
22
+    public function get($key)
23
+    {
24
+        return $this->request->request->get($key);
25
+    }
26
+
27
+    public function csrf()
28
+    {
29
+        return ['name' => '_token', 'value' => csrf_token()];
30
+    }
31 31
 
32 32
 }
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
src/Requests/Laravel.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -7,26 +7,26 @@
 block discarded – undo
7 7
 
8 8
 class Laravel implements Request {
9 9
 	
10
-	protected $request;
11
-
12
-	public function __construct(IlluminateRequest $request)
13
-	{
14
-		$this->request = $request;
15
-	}
16
-
17
-	public function all()
18
-	{
19
-		return $this->request->all();
20
-	}
21
-
22
-	public function get($key)
23
-	{
24
-		return $this->request->get($key);
25
-	}
26
-
27
-	public function csrf()
28
-	{
29
-		return ['name' => '_token', 'value' => csrf_token()];
30
-	}
10
+    protected $request;
11
+
12
+    public function __construct(IlluminateRequest $request)
13
+    {
14
+        $this->request = $request;
15
+    }
16
+
17
+    public function all()
18
+    {
19
+        return $this->request->all();
20
+    }
21
+
22
+    public function get($key)
23
+    {
24
+        return $this->request->get($key);
25
+    }
26
+
27
+    public function csrf()
28
+    {
29
+        return ['name' => '_token', 'value' => csrf_token()];
30
+    }
31 31
 
32 32
 }
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
src/Form.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
      */
358 358
     public function completed($name = null)
359 359
     {
360
-        if($this->submitted($name) && $this->valid()) {
360
+        if ($this->submitted($name) && $this->valid()) {
361 361
             $this->broadcast('completed');
362 362
             return true;
363 363
         }
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
         $errors = [];
498 498
 
499 499
         foreach ($this->fields as $field) {
500
-            foreach($field->errors() as $error) {
500
+            foreach ($field->errors() as $error) {
501 501
                 $errors[] = $error;
502 502
             }
503 503
         }
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
     {
620 620
         $config = $this->templateConfig($template);
621 621
 
622
-        if ( isset($config['plugins']) && is_array($config['plugins'])) {
623
-            foreach($config['plugins'] as $plugin) {
622
+        if (isset($config['plugins']) && is_array($config['plugins'])) {
623
+            foreach ($config['plugins'] as $plugin) {
624 624
                 $this->addPlugin($plugin);
625 625
             }
626 626
         }
@@ -636,8 +636,8 @@  discard block
 block discarded – undo
636 636
     {
637 637
         $config = $this->templateConfig($template);
638 638
 
639
-        if ( isset($config['plugins']) && is_array($config['plugins'])) {
640
-            foreach($config['plugins'] as $plugin) {
639
+        if (isset($config['plugins']) && is_array($config['plugins'])) {
640
+            foreach ($config['plugins'] as $plugin) {
641 641
                 $this->removePlugin($plugin);
642 642
             }
643 643
         }
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
             foreach ($field->errors() as $error => $parameters) {
675 675
 
676 676
                 if ($error == 'userDefined') {
677
-                    foreach($parameters as $message) {
677
+                    foreach ($parameters as $message) {
678 678
                         $properties['errors'][] = ['error' => $message];
679 679
                     }
680 680
                 } else {
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 
684 684
                     $message = $this->translate($error, $field);
685 685
 
686
-                    foreach($parameters as $key => $value) {
686
+                    foreach ($parameters as $key => $value) {
687 687
                         if (is_object($value) && method_exists($value, '__toString')) $value = (string) $value;
688 688
                         if (is_array($value)) $value = implode(', ', $value);
689 689
                         $message = str_replace('['.$key.']', $value, $message);
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
      */
931 931
     private function broadcast($event, $params = []) 
932 932
     {
933
-        foreach($this->plugins as $plugin) {
933
+        foreach ($this->plugins as $plugin) {
934 934
             $plugin->event($this, $event, $params);
935 935
         }
936 936
     }
@@ -1078,7 +1078,7 @@  discard block
 block discarded – undo
1078 1078
     {
1079 1079
         if ( ! method_exists($this, $method))
1080 1080
         {
1081
-            if ( $this->typeExists($method)) {
1081
+            if ($this->typeExists($method)) {
1082 1082
                 return $this->addField($method, array_shift($parameters));
1083 1083
             }
1084 1084
         }
Please login to merge, or discard this patch.
Braces   +30 added lines, -10 removed lines patch added patch discarded remove patch
@@ -253,7 +253,9 @@  discard block
 block discarded – undo
253 253
      */
254 254
     public function fields($names = null)
255 255
     {
256
-        if (is_null($names)) return $this->fields;
256
+        if (is_null($names)) {
257
+            return $this->fields;
258
+        }
257 259
 
258 260
         return array_filter($this->fields, function($field) use ($names) {
259 261
             return array_key_exists($field->name, $names);
@@ -473,7 +475,9 @@  discard block
 block discarded – undo
473 475
         $class = '\\Fields\\'.ucwords($class).'\\'.ucwords($class);
474 476
 
475 477
         foreach ($this->namespaces as $namespace) {
476
-            if (class_exists($namespace.$class)) return $namespace.$class;
478
+            if (class_exists($namespace.$class)) {
479
+                return $namespace.$class;
480
+            }
477 481
         }
478 482
     }
479 483
 
@@ -486,9 +490,13 @@  discard block
 block discarded – undo
486 490
      */
487 491
     public function errors($name = null)
488 492
     {
489
-        if ($this->submitted()) $this->validate();
493
+        if ($this->submitted()) {
494
+            $this->validate();
495
+        }
490 496
 
491
-        if ( ! is_null($name)) return $this->field($name)->errors();
497
+        if ( ! is_null($name)) {
498
+            return $this->field($name)->errors();
499
+        }
492 500
 
493 501
         $errors = [];
494 502
 
@@ -680,8 +688,12 @@  discard block
 block discarded – undo
680 688
                     $message = $this->translate($error, $field);
681 689
 
682 690
                     foreach($parameters as $key => $value) {
683
-                        if (is_object($value) && method_exists($value, '__toString')) $value = (string) $value;
684
-                        if (is_array($value)) $value = implode(', ', $value);
691
+                        if (is_object($value) && method_exists($value, '__toString')) {
692
+                            $value = (string) $value;
693
+                        }
694
+                        if (is_array($value)) {
695
+                            $value = implode(', ', $value);
696
+                        }
685 697
                         $message = str_replace('['.$key.']', $value, $message);
686 698
                     }
687 699
                     $properties['errors'][] = ['error' => $message];
@@ -701,7 +713,9 @@  discard block
 block discarded – undo
701 713
      */
702 714
     public function renderField($field, $properties = null) 
703 715
     {   
704
-        if (is_null($properties)) $properties = $this->fieldProperties($field);
716
+        if (is_null($properties)) {
717
+            $properties = $this->fieldProperties($field);
718
+        }
705 719
 
706 720
         return $this->renderTemplate($field->type, $properties, $field);
707 721
     }
@@ -715,7 +729,9 @@  discard block
 block discarded – undo
715 729
      */
716 730
     public function renderFieldErrors($field, $properties = null) 
717 731
     {   
718
-        if (is_null($properties)) $properties = $this->fieldProperties($field);
732
+        if (is_null($properties)) {
733
+            $properties = $this->fieldProperties($field);
734
+        }
719 735
 
720 736
         return $this->renderTemplate('errors', $properties, $field);
721 737
     }   
@@ -732,9 +748,13 @@  discard block
 block discarded – undo
732 748
 
733 749
         $this->setValues();
734 750
 
735
-        if ($this->submitted()) $this->validate();
751
+        if ($this->submitted()) {
752
+            $this->validate();
753
+        }
736 754
 
737
-        if ( ! is_null($template)) $this->setTemplate($template);
755
+        if ( ! is_null($template)) {
756
+            $this->setTemplate($template);
757
+        }
738 758
 
739 759
         $properties = [];
740 760
         $properties['id'] = $this->id;
Please login to merge, or discard this patch.
src/Request.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,26 +4,26 @@
 block discarded – undo
4 4
 
5 5
 interface Request {
6 6
 	
7
-	/**
7
+    /**
8 8
      * Fetch all values from the request.
9 9
      *
10 10
      * @return array
11 11
      */
12
-	public function all();
12
+    public function all();
13 13
 
14
-	/**
14
+    /**
15 15
      * Fetch a value from the request matching provided key.
16 16
      *
17 17
      * @var string
18 18
      * @return mixed
19 19
      */
20
-	public function get($key);
20
+    public function get($key);
21 21
 
22
-	/**
22
+    /**
23 23
      * Return array of csrf template properties.
24 24
      *
25 25
      * @return array
26 26
      */
27
-	public function csrf();	
27
+    public function csrf();	
28 28
 
29 29
 }
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
src/templates/foundation/config.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php 
2 2
 
3 3
 return [
4
-	'plugins' => [
5
-		'feedback',
6
-	],
4
+    'plugins' => [
5
+        'feedback',
6
+    ],
7 7
 ];
8 8
\ No newline at end of file
Please login to merge, or discard this patch.