Passed
Push — master ( 4ffd78...d89730 )
by Afshin
02:19
created
core/Functions/general_helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,5 +5,5 @@
 block discarded – undo
5 5
     $dir = scandir($path);
6 6
     $ex_folders = array('..', '.');
7 7
 
8
-    return array_diff($dir,$ex_folders);
8
+    return array_diff($dir, $ex_folders);
9 9
 }
Please login to merge, or discard this patch.
core/Helpers/Url.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
     {
20 20
         $this->container = $container;
21 21
     }
22
-    public function get( $name, $params = array() )
22
+    public function get($name, $params = array())
23 23
     {
24
-            $route = $this->container->get('router')->pathFor($name,$params);
24
+            $route = $this->container->get('router')->pathFor($name, $params);
25 25
 
26 26
 
27 27
             return $route;
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
         $protocol = $request->getUri()->getScheme();
48 48
         $baseHost = $request->getUri()->getHost();
49 49
         $path = $request->getUri()->getPath();
50
-        $pathArr = explode('/',$path);
51
-        unset($pathArr[count($pathArr)-1]);
52
-        $path = implode('/',$pathArr);
50
+        $pathArr = explode('/', $path);
51
+        unset($pathArr[count($pathArr) - 1]);
52
+        $path = implode('/', $pathArr);
53 53
         $port = $request->getUri()->getPort() ? ':' . $request->getUri()->getPort() : '';
54 54
         $baseUrl = $protocol . '://' . $baseHost . $port . $path;
55 55
         return $baseUrl;
Please login to merge, or discard this patch.
config/settings.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
         'displayErrorDetails' => true,
13 13
         'addContentLengthHeader' => false,
14 14
         'determineRouteBeforeAppMiddleware' => true,
15
-        'debug'=>true ,
15
+        'debug'=>true,
16 16
         'translation' => [
17 17
             'default_lang' => 'en',
18 18
             'translations_path' => $APPROOT . 'translations/',
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
             'path' => __DIR__ . '/../storage/logs/app.log',
27 27
         ],
28 28
         'db' => [
29
-            'driver'    => $env($APPROOT,'DB_DRIVER', 'mysql'),
30
-            'host'      => $env($APPROOT,'DB_HOST', 'localhost'),
31
-            'database'  => $env($APPROOT,'DB_NAME', 'cafesaba'),
32
-            'username'  => $env($APPROOT,'DB_USERNAME', 'root'),
33
-            'password'  => $env($APPROOT,'DB_PASS', 'root'),
34
-            'charset'   => $env($APPROOT,'DB_CHARSET', 'utf8'),
35
-            'collation' => $env($APPROOT,'DB_COLLATION', 'utf8_unicode_ci'),
36
-            'prefix'    => $env($APPROOT,'DB_PREFIX', ''),
37
-            'port'      => $env($APPROOT,'DB_PORT', 3306),
29
+            'driver'    => $env($APPROOT, 'DB_DRIVER', 'mysql'),
30
+            'host'      => $env($APPROOT, 'DB_HOST', 'localhost'),
31
+            'database'  => $env($APPROOT, 'DB_NAME', 'cafesaba'),
32
+            'username'  => $env($APPROOT, 'DB_USERNAME', 'root'),
33
+            'password'  => $env($APPROOT, 'DB_PASS', 'root'),
34
+            'charset'   => $env($APPROOT, 'DB_CHARSET', 'utf8'),
35
+            'collation' => $env($APPROOT, 'DB_COLLATION', 'utf8_unicode_ci'),
36
+            'prefix'    => $env($APPROOT, 'DB_PREFIX', ''),
37
+            'port'      => $env($APPROOT, 'DB_PORT', 3306),
38 38
         ],
39 39
         'view' => [
40 40
             'path' 	 => '../app/View',
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
             'showSlimEnvironmentPanel' => 1,
55 55
             'showSlimRequestPanel' => 1,
56 56
             'showSlimResponsePanel' => 1,
57
-            'showSlimContainer' =>1 ,
57
+            'showSlimContainer' =>1,
58 58
             'showEloquentORMPanel' => 1,
59
-            'showIdiormPanel' => 0,// > 0 mean you enable logging
59
+            'showIdiormPanel' => 0, // > 0 mean you enable logging
60 60
             // but show or not panel you decide in browser in panel selector
61
-            'showDoctrinePanel' => 'em',// here also enable logging and you must enter your Doctrine container name
61
+            'showDoctrinePanel' => 'em', // here also enable logging and you must enter your Doctrine container name
62 62
             // and also as above show or not panel you decide in browser in panel selector
63 63
             'showProfilerPanel' => 1,
64 64
             'showVendorVersionsPanel' => 1,
Please login to merge, or discard this patch.
bootstrap/middlewares.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if($config['settings']['debug'] && $config['settings']['tracy']['active']) {
2
+if ($config['settings']['debug'] && $config['settings']['tracy']['active']) {
3 3
     $app->add(new RunTracy\Middlewares\TracyMiddleware($app));
4 4
 }
5 5
 
Please login to merge, or discard this patch.
bootstrap/app.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2
-define('__APP_ROOT__',__DIR__ . '/../') ;
3
-require  __APP_ROOT__.'bootstrap/bootstrap.php';
4
-require __APP_ROOT__.'vendor/autoload.php';
5
-require __APP_ROOT__.'config/settings.php';
2
+define('__APP_ROOT__', __DIR__ . '/../');
3
+require  __APP_ROOT__ . 'bootstrap/bootstrap.php';
4
+require __APP_ROOT__ . 'vendor/autoload.php';
5
+require __APP_ROOT__ . 'config/settings.php';
6 6
 
7
-require  __APP_ROOT__.'core/Functions/general_helpers.php';
7
+require  __APP_ROOT__ . 'core/Functions/general_helpers.php';
8 8
 
9 9
 
10 10
 $app = new \Core\App($config);
11 11
 
12
-if($config['settings']['debug'] && !$config['settings']['tracy']['active']){
12
+if ($config['settings']['debug'] && !$config['settings']['tracy']['active']) {
13 13
     ini_set('display_errors', 1);
14 14
     ini_set('display_startup_errors', 1);
15 15
     error_reporting(E_ALL);
@@ -18,18 +18,18 @@  discard block
 block discarded – undo
18 18
 
19 19
 use SlimFacades\Facade;
20 20
 // get container app
21
-require __APP_ROOT__.'bootstrap/dependencies.php';
21
+require __APP_ROOT__ . 'bootstrap/dependencies.php';
22 22
 
23
-require  __APP_ROOT__.'bootstrap/routes.php';
24
-require  __APP_ROOT__.'core/Functions/helpers.php';
23
+require  __APP_ROOT__ . 'bootstrap/routes.php';
24
+require  __APP_ROOT__ . 'core/Functions/helpers.php';
25 25
 
26
-if(php_sapi_name() != 'cli') {
27
-    if($config['settings']['debug'] && $config['settings']['tracy']['active']){
26
+if (php_sapi_name() != 'cli') {
27
+    if ($config['settings']['debug'] && $config['settings']['tracy']['active']) {
28 28
         Tracy\Debugger::enable(Tracy\Debugger::DEVELOPMENT, $config['settings']['tracy']['path']);
29 29
     }
30 30
     Facade::setFacadeApplication($app);
31 31
 
32
-    require  __APP_ROOT__.'bootstrap/middlewares.php';
32
+    require  __APP_ROOT__ . 'bootstrap/middlewares.php';
33 33
 
34 34
     $app->run();
35 35
 
Please login to merge, or discard this patch.
core/Facades/Auth.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 'AuthService';
Please login to merge, or discard this patch.
core/Functions/helpers.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,22 +2,22 @@  discard block
 block discarded – undo
2 2
 
3 3
 
4 4
 
5
-function route(string $name ,array $params = [])
5
+function route(string $name, array $params = [])
6 6
 {
7 7
     $url = new \Core\Helpers\Url($GLOBALS['container']);
8
-    return $url->get($name , $params);
8
+    return $url->get($name, $params);
9 9
 }
10 10
 
11
-function url(string $name ,array $params = [])
11
+function url(string $name, array $params = [])
12 12
 {
13 13
     $url = new \Core\Helpers\Url($GLOBALS['container']);
14
-    return $url->get($name , $params);
14
+    return $url->get($name, $params);
15 15
 }
16 16
 
17 17
 // translate
18
-function trans($key , $replace = []){
18
+function trans($key, $replace = []) {
19 19
     $container = $GLOBALS['container'];
20
-    return $container->translator->trans($key,$replace);
20
+    return $container->translator->trans($key, $replace);
21 21
 }
22 22
 
23 23
 function public_path(string $uri = '') {
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 
28 28
     $url = new \Core\Helpers\Url($container);
29 29
 
30
-    $url_asset = $url->getBasePath($request) .'/'. $uri;
30
+    $url_asset = $url->getBasePath($request) . '/' . $uri;
31 31
     return $url_asset;
32 32
 }
33 33
 
34 34
 function asset(string $uri = '') {
35 35
     $url = public_path();
36
-    $url_asset = $url.'assets/'.$uri;
36
+    $url_asset = $url . 'assets/' . $uri;
37 37
     return $url_asset;
38 38
 }
39 39
 
Please login to merge, or discard this patch.
core/Handlers/Session/SessionHandler.php 3 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,11 +15,13 @@
 block discarded – undo
15 15
 {
16 16
     public function get($key = null)
17 17
     {
18
-        if(!isset($_SESSION)) return [];
18
+        if(!isset($_SESSION)) {
19
+            return [];
20
+        }
19 21
 
20 22
         if(!$key){
21 23
             return $_SESSION;
22
-        }else{
24
+        } else{
23 25
             $keys = explode('.',$key);
24 26
             $sessionVal = $this->getRecursiveSessionKey($_SESSION,$keys);
25 27
             return $sessionVal;
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@
 block discarded – undo
34 34
 
35 35
     public function exists($key,$val)
36 36
     {
37
-       $keySession = $this->get($key);
37
+        $keySession = $this->get($key);
38 38
 
39
-       if($keySession){
40
-          return true;
41
-       }
42
-       return false;
39
+        if($keySession){
40
+            return true;
41
+        }
42
+        return false;
43 43
     }
44 44
 
45 45
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,28 +15,28 @@
 block discarded – undo
15 15
 {
16 16
     public function get($key = null)
17 17
     {
18
-        if(!isset($_SESSION)) return [];
18
+        if (!isset($_SESSION)) return [];
19 19
 
20
-        if(!$key){
20
+        if (!$key) {
21 21
             return $_SESSION;
22
-        }else{
23
-            $keys = explode('.',$key);
24
-            $sessionVal = $this->getRecursiveSessionKey($_SESSION,$keys);
22
+        }else {
23
+            $keys = explode('.', $key);
24
+            $sessionVal = $this->getRecursiveSessionKey($_SESSION, $keys);
25 25
             return $sessionVal;
26 26
         }
27 27
     }
28 28
 
29
-    public function set($key,$val)
29
+    public function set($key, $val)
30 30
     {
31
-        $_SESSION = $this->setArr($key,$val);
31
+        $_SESSION = $this->setArr($key, $val);
32 32
     }
33 33
 
34 34
 
35
-    public function exists($key,$val)
35
+    public function exists($key, $val)
36 36
     {
37 37
        $keySession = $this->get($key);
38 38
 
39
-       if($keySession){
39
+       if ($keySession) {
40 40
           return true;
41 41
        }
42 42
        return false;
Please login to merge, or discard this patch.
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.