Completed
Push — master ( 71bab5...9e3424 )
by Afshin
02:36
created
core/Services/Session.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     {
18 18
         $namespace = 'Core\\Handlers\\Session\\';
19 19
 
20
-        $className = $namespace.ucfirst($driver).'Handler';
20
+        $className = $namespace . ucfirst($driver) . 'Handler';
21 21
         $this->handler = new $className();
22 22
 
23 23
         return $this->handler;
Please login to merge, or discard this patch.
core/Interfaces/AbstractSession.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 class AbstractSession
13 13
 {
14 14
 
15
-     public function getRecursiveSessionKey($data , $keyArr){
15
+        public function getRecursiveSessionKey($data , $keyArr){
16 16
         $arrayFound  = isset($data[$keyArr[0]]) ? $data[$keyArr[0]] : '';
17 17
         if($arrayFound){
18 18
             unset($keyArr[0]);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,16 +12,16 @@  discard block
 block discarded – undo
12 12
 class AbstractSession
13 13
 {
14 14
 
15
-     public function getRecursiveSessionKey($data , $keyArr){
16
-        $arrayFound  = isset($data[$keyArr[0]]) ? $data[$keyArr[0]] : '';
17
-        if($arrayFound){
15
+     public function getRecursiveSessionKey($data, $keyArr) {
16
+        $arrayFound = isset($data[$keyArr[0]]) ? $data[$keyArr[0]] : '';
17
+        if ($arrayFound) {
18 18
             unset($keyArr[0]);
19 19
             $keyArr = array_values($keyArr);
20
-            if(isset($keyArr[0])){
21
-                return $this->getRecursiveSessionKey($arrayFound,$keyArr);
20
+            if (isset($keyArr[0])) {
21
+                return $this->getRecursiveSessionKey($arrayFound, $keyArr);
22 22
             }
23 23
         }
24
-        return $arrayFound ;
24
+        return $arrayFound;
25 25
     }
26 26
 
27 27
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
                 $sourceRef = &$source;
34 34
             }
35 35
             $keyName = trim($keyName);
36
-            $sourceRef  = &$sourceRef[$keyName];
36
+            $sourceRef = &$sourceRef[$keyName];
37 37
         }
38 38
         $sourceRef = $value;
39 39
         unset($sourceRef);
Please login to merge, or discard this patch.
core/ModuleInitializer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     protected $moduleInstances = [];
33 33
 
34
-    public function __construct($app, $modules=array())
34
+    public function __construct($app, $modules = array())
35 35
     {
36 36
         $this->app = $app;
37 37
         // build an class map of [[module => moduleClassPath], ..]
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         }
93 93
 
94 94
         $allSettings['modules'] = array_merge_recursive($allSettings['modules'], $this->getModuleConfig());
95
-        $container['settings']->__construct( $allSettings );
95
+        $container['settings']->__construct($allSettings);
96 96
     }
97 97
 
98 98
     /**
Please login to merge, or discard this patch.
core/Config.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@
 block discarded – undo
10 10
 
11 11
 class Config {
12 12
 
13
-    public static function get($key,$default = null){
14
-        $path = __APP_ROOT__ . '/config/'.$key[0].'.php';
13
+    public static function get($key, $default = null) {
14
+        $path = __APP_ROOT__ . '/config/' . $key[0] . '.php';
15 15
         $result = include_once $path;
16
-        foreach (explode('.' , $key) as $segment) {
17
-            if(isset($result[$segment]))
16
+        foreach (explode('.', $key) as $segment) {
17
+            if (isset($result[$segment]))
18 18
                 $result = $result[$segment];
19 19
             else
20 20
                 $result = $default;
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,10 +14,11 @@
 block discarded – undo
14 14
         $path = __APP_ROOT__ . '/config/'.$key[0].'.php';
15 15
         $result = include_once $path;
16 16
         foreach (explode('.' , $key) as $segment) {
17
-            if(isset($result[$segment]))
18
-                $result = $result[$segment];
19
-            else
20
-                $result = $default;
17
+            if(isset($result[$segment])) {
18
+                            $result = $result[$segment];
19
+            } else {
20
+                            $result = $default;
21
+            }
21 22
         }
22 23
         return $result;
23 24
     }
Please login to merge, or discard this patch.
database/migrations/20171228211415_Add_Has_Pic_To_Users_Table_Migration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     {
13 13
         Capsule::schema()->table('users', function($table)
14 14
         {
15
-            $table->enum('has_pic',['no','yes'])->default('no');
15
+            $table->enum('has_pic', ['no', 'yes'])->default('no');
16 16
         });
17 17
     }
18 18
 
Please login to merge, or discard this patch.
core/Facades/Image.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
     /**
9 9
      * @param Core\Services\AuthService\AuthService
10 10
      * @return AuthService
11
-    */
11
+     */
12 12
     protected static function getFacadeAccessor()
13 13
     {
14 14
         return 'ImageService';
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Core\Facades;
3 3
 
4
-use Core\Services\ImageService  ;
4
+use Core\Services\ImageService;
5 5
 use SlimFacades\Facade;
6 6
 class Image extends Facade
7 7
 {
Please login to merge, or discard this patch.
core/Facades/File.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     /**
16 16
      * @param Core\Services\AuthService\AuthService
17 17
      * @return AuthService
18
-    */
18
+     */
19 19
     protected static function getFacadeAccessor()
20 20
     {
21 21
         return 'FileService';
Please login to merge, or discard this patch.
core/Services/FileService.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@
 block discarded – undo
6 6
 
7 7
 class FileService extends _Service
8 8
 {
9
-	public function moveUploadedFile($directory,$fileName, UploadedFile $uploadedFile)
10
-	{
11
-	    $extension = pathinfo($uploadedFile->getClientFilename(), PATHINFO_EXTENSION);
12
-	    $basename = bin2hex(random_bytes(8)); // see http://php.net/manual/en/function.random-bytes.php
13
-	    $filename = sprintf('%s.%0.8s', $fileName, $extension);
14
-	    $uploadedFile->moveTo($directory . DIRECTORY_SEPARATOR . $filename);
15
-	    return $directory . DIRECTORY_SEPARATOR . $filename;
16
-	}
17
-	public function delete($file)
18
-	{
19
-		@unlink($file);
20
-	}
9
+    public function moveUploadedFile($directory,$fileName, UploadedFile $uploadedFile)
10
+    {
11
+        $extension = pathinfo($uploadedFile->getClientFilename(), PATHINFO_EXTENSION);
12
+        $basename = bin2hex(random_bytes(8)); // see http://php.net/manual/en/function.random-bytes.php
13
+        $filename = sprintf('%s.%0.8s', $fileName, $extension);
14
+        $uploadedFile->moveTo($directory . DIRECTORY_SEPARATOR . $filename);
15
+        return $directory . DIRECTORY_SEPARATOR . $filename;
16
+    }
17
+    public function delete($file)
18
+    {
19
+        @unlink($file);
20
+    }
21 21
 
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 class FileService extends _Service
8 8
 {
9
-	public function moveUploadedFile($directory,$fileName, UploadedFile $uploadedFile)
9
+	public function moveUploadedFile($directory, $fileName, UploadedFile $uploadedFile)
10 10
 	{
11 11
 	    $extension = pathinfo($uploadedFile->getClientFilename(), PATHINFO_EXTENSION);
12 12
 	    $basename = bin2hex(random_bytes(8)); // see http://php.net/manual/en/function.random-bytes.php
Please login to merge, or discard this patch.
core/Functions/helpers.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,9 @@
 block discarded – undo
43 43
     $url .= "?s=$s&d=$d&r=$r";
44 44
     if ( $img ) {
45 45
         $url = '<img src="' . $url . '"';
46
-        foreach ( $atts as $key => $val )
47
-            $url .= ' ' . $key . '="' . $val . '"';
46
+        foreach ( $atts as $key => $val ) {
47
+                    $url .= ' ' . $key . '="' . $val . '"';
48
+        }
48 49
         $url .= ' />';
49 50
     }
50 51
     return $url;
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-function route(string $name ,array $params = [])
3
+function route(string $name, array $params = [])
4 4
 {
5 5
     $url = new \Core\Helpers\Url($GLOBALS['container']);
6
-    return $url->get($name , $params);
6
+    return $url->get($name, $params);
7 7
 }
8 8
 
9
-function url(string $name ,array $params = [])
9
+function url(string $name, array $params = [])
10 10
 {
11 11
     $url = new \Core\Helpers\Url($GLOBALS['container']);
12
-    return $url->get($name , $params);
12
+    return $url->get($name, $params);
13 13
 }
14 14
 
15 15
 // translate
16
-function trans($key , $replace = []){
16
+function trans($key, $replace = []) {
17 17
     $container = $GLOBALS['container'];
18
-    return $container->translator->trans($key,$replace);
18
+    return $container->translator->trans($key, $replace);
19 19
 }
20 20
 
21 21
 function public_path(string $uri = '') {
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
     $url = new \Core\Helpers\Url($container);
27 27
 
28
-    $url_asset = $url->getBasePath($request) .'/'. $uri;
28
+    $url_asset = $url->getBasePath($request) . '/' . $uri;
29 29
     return $url_asset;
30 30
 }
31 31
 
@@ -78,17 +78,17 @@  discard block
 block discarded – undo
78 78
 
79 79
 function asset(string $uri = '') {
80 80
     $url = public_path();
81
-    $url_asset = $url.'assets/'.$uri;
81
+    $url_asset = $url . 'assets/' . $uri;
82 82
     return $url_asset;
83 83
 }
84 84
 
85
-function get_gravatar( $email, $s = 380, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {
85
+function get_gravatar($email, $s = 380, $d = 'mm', $r = 'g', $img = false, $atts = array()) {
86 86
     $url = 'https://www.gravatar.com/avatar/';
87
-    $url .= md5( strtolower( trim( $email ) ) );
87
+    $url .= md5(strtolower(trim($email)));
88 88
     $url .= "?s=$s&d=$d&r=$r";
89
-    if ( $img ) {
89
+    if ($img) {
90 90
         $url = '<img src="' . $url . '"';
91
-        foreach ( $atts as $key => $val )
91
+        foreach ($atts as $key => $val)
92 92
             $url .= ' ' . $key . '="' . $val . '"';
93 93
         $url .= ' />';
94 94
     }
Please login to merge, or discard this patch.