Passed
Push — master ( 81f334...c86e8c )
by Mihail
03:35
created
Extend/Core/Arch/ApiController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Extend\Core\Arch;
4 4
 
5
-use Ffcms\Core\App;
6 5
 use Ffcms\Core\Arch\Controller;
7 6
 
8 7
 /**
Please login to merge, or discard this patch.
Extend/Core/Arch/FrontAppController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
 use Ffcms\Core\Arch\Controller;
8 8
 use Ffcms\Core\Exception\ForbiddenException;
9 9
 use Ffcms\Core\Helper\Type\Any;
10
-use Ffcms\Core\Helper\Type\Obj;
11 10
 use Ffcms\Core\Helper\Type\Str;
12 11
 
13 12
 /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         }
34 34
 
35 35
         // add localizations
36
-        App::$Translate->append(App::$Alias->currentViewPath . '/I18n/' . App::$Request->getLanguage() . '.php');
36
+        App::$Translate->append(App::$Alias->currentViewPath.'/I18n/'.App::$Request->getLanguage().'.php');
37 37
         parent::__construct();
38 38
     }
39 39
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         // check if disabled (0 = enabled, anything else = on)
59
-        return !(bool)$this->application->disabled;
59
+        return !(bool) $this->application->disabled;
60 60
     }
61 61
 
62 62
     /**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             return $this->configs;
70 70
         }
71 71
 
72
-        $configs = (array)$this->application->configs;
72
+        $configs = (array) $this->application->configs;
73 73
         foreach ($configs as $cfg => $value) {
74 74
             if (Any::isInt($value)) {
75 75
                 $configs[$cfg] = $value;
Please login to merge, or discard this patch.
Extend/Core/Captcha/Recaptcha.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Ffcms\Core\App;
6 6
 use Ffcms\Core\Helper\FileSystem\File;
7
-use Ffcms\Core\Helper\Url;
8 7
 use Ffcms\Core\Interfaces\iCaptcha;
9 8
 use Symfony\Component\HttpFoundation\Request;
10 9
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
     public function get()
41 41
     {
42 42
         // build google captcha ;)
43
-        $html = '<div class="g-recaptcha" data-sitekey="' . self::$siteKey . '"></div>
43
+        $html = '<div class="g-recaptcha" data-sitekey="'.self::$siteKey.'"></div>
44 44
             <script type="text/javascript"
45
-                    src="https://www.google.com/recaptcha/api.js?hl=' . App::$Request->getLanguage() . '">
45
+                    src="https://www.google.com/recaptcha/api.js?hl=' . App::$Request->getLanguage().'">
46 46
             </script>';
47 47
         return $html;
48 48
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         ]);
66 66
 
67 67
         // make request and parse response
68
-        $url = $request->getSchemeAndHttpHost() . $request->getRequestUri();
68
+        $url = $request->getSchemeAndHttpHost().$request->getRequestUri();
69 69
         $response = File::getFromUrl($url);
70 70
         $object = json_decode($response);
71 71
 
Please login to merge, or discard this patch.
Private/Config/Object.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,6 @@
 block discarded – undo
7 7
 use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
8 8
 use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler;
9 9
 use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;
10
-use phpFastCache\CacheManager;
11
-use phpFastCache\Core\phpFastCache;
12 10
 
13 11
 // define timezone
14 12
 date_default_timezone_set(App::$Properties->get('timezone'));
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 date_default_timezone_set(App::$Properties->get('timezone'));
15 15
 
16 16
 return [
17
-    'Database' => function () {
17
+    'Database' => function() {
18 18
         $capsule = new Capsule;
19 19
         if (env_name !== 'Install') {
20 20
             try {
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             try {
36 36
                 $capsule->connection()->getPdo();
37 37
             } catch (\Exception $e) {
38
-                $instUri = \App::$Alias->scriptUrl . '/install';
38
+                $instUri = \App::$Alias->scriptUrl.'/install';
39 39
                 \App::$Response->redirect($instUri, true);
40 40
             }
41 41
         }
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
         try {
48 48
             $pdo = \App::$Database->connection()->getPdo();
49 49
             $handler = new PdoSessionHandler($pdo, [
50
-                'db_table' => App::$Properties->get('database')['prefix'] . 'sessions'
50
+                'db_table' => App::$Properties->get('database')['prefix'].'sessions'
51 51
             ]);
52 52
         } catch (Exception $e) {
53
-            $handler = new NativeFileSessionHandler(root . '/Private/Sessions');
53
+            $handler = new NativeFileSessionHandler(root.'/Private/Sessions');
54 54
         }
55 55
 
56 56
         $storage = new NativeSessionStorage([
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 
62 62
         return new Session($storage);
63 63
     },
64
-    'User' => function () {
64
+    'User' => function() {
65 65
         return new Apps\ActiveRecord\User();
66 66
     },
67
-    'Mailer' => function () {
67
+    'Mailer' => function() {
68 68
         $mCfg = App::$Properties->get('mail');
69 69
         // initialize swiftmailer transporter
70 70
         $transport = (new Swift_SmtpTransport($mCfg['host'], $mCfg['port']))
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
         $swift = (new Swift_Mailer($transport));
83 83
         return \Ffcms\Core\Helper\Mailer::factory($swift, $mCfg['user']);
84 84
     },
85
-    'Captcha' => function () {
85
+    'Captcha' => function() {
86 86
         return new Extend\Core\Captcha\Gregwar();
87 87
     },
88
-    'Cache' => function () {
88
+    'Cache' => function() {
89 89
         // initialize symfony cache manager
90
-        $cache = new \Symfony\Component\Cache\Adapter\FilesystemAdapter('web', 3600, root . '/Private/Cache');
90
+        $cache = new \Symfony\Component\Cache\Adapter\FilesystemAdapter('web', 3600, root.'/Private/Cache');
91 91
         return $cache;
92 92
     },
93 93
     '_hybridauth' => function() {
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,12 +71,14 @@
 block discarded – undo
71 71
             ->setUsername($mCfg['user']);
72 72
 
73 73
         // set auth password if exist
74
-        if ($mCfg['password'] !== null && strlen($mCfg['password']) > 0)
75
-            $transport->setPassword($mCfg['password']);
74
+        if ($mCfg['password'] !== null && strlen($mCfg['password']) > 0) {
75
+                    $transport->setPassword($mCfg['password']);
76
+        }
76 77
 
77 78
         // set encryption method
78
-        if (\Ffcms\Core\Helper\Type\Arr::in($mCfg['encrypt'], ['tls', 'ssl']))
79
-            $transport->setEncryption($mCfg['encrypt']);
79
+        if (\Ffcms\Core\Helper\Type\Arr::in($mCfg['encrypt'], ['tls', 'ssl'])) {
80
+                    $transport->setEncryption($mCfg['encrypt']);
81
+        }
80 82
 
81 83
         // initialize mailer instance
82 84
         $swift = (new Swift_Mailer($transport));
Please login to merge, or discard this patch.
Widgets/Basic/LanguageSwitcher.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Ffcms\Core\Arch\Widget;
7 7
 use Ffcms\Core\Helper\HTML\Listing;
8 8
 use Ffcms\Core\Helper\Type\Any;
9
-use Ffcms\Core\Helper\Type\Obj;
10 9
 
11 10
 /**
12 11
  * Class LanguageSwitcher. Show language switched as listing html object
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
         foreach ($this->langs as $lang) {
55 55
             $items[] = [
56 56
                 'type' => 'link',
57
-                'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(),
57
+                'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(),
58 58
                 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" alt="'.$lang.'"/>',
59 59
                 'html' => true,
60 60
                 '!secure' => true
Please login to merge, or discard this patch.
Widgets/Front/Contenttag/Contenttag.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Extend\Core\Arch\FrontWidget as AbstractWidget;
7 7
 use Ffcms\Core\Helper\Type\Any;
8 8
 use Ffcms\Core\Traits\ClassTools;
9
-use Ffcms\Core\Helper\Type\Obj;
10 9
 use Apps\ActiveRecord\ContentTag as TagRecord;
11 10
 
12 11
 class Contenttag extends AbstractWidget
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     {
31 31
         $cfg = $this->getConfigs();
32 32
         // check cache is defined
33
-        if (!$this->cache|| !Any::isInt($this->cache)) {
33
+        if (!$this->cache || !Any::isInt($this->cache)) {
34 34
             $this->cache = $cfg['cache'];
35 35
         }
36 36
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         }
41 41
 
42 42
         $this->_lang = App::$Request->getLanguage();
43
-        $this->_cacheName = 'widget.contenttag.' . $this->createStringClassSnapshotHash();
43
+        $this->_cacheName = 'widget.contenttag.'.$this->createStringClassSnapshotHash();
44 44
     }
45 45
 
46 46
     /**
Please login to merge, or discard this patch.
Widgets/Front/Newcontent/Newcontent.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 use Ffcms\Core\App;
5 5
 use Extend\Core\Arch\FrontWidget as Widget;
6 6
 use Ffcms\Core\Helper\Type\Any;
7
-use Ffcms\Core\Helper\Type\Obj;
8 7
 use Ffcms\Core\Traits\ClassTools;
9 8
 use Apps\ActiveRecord\Content;
10 9
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
         
77 77
         // render view
78 78
         return App::$View->render($this->tpl, [
79
-           'records' => $query
79
+            'records' => $query
80 80
         ]);
81 81
     }
82 82
     
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,15 +35,15 @@
 block discarded – undo
35 35
 
36 36
         // check cache is defined
37 37
         if (!$this->cache || !Any::isInt($this->cache)) {
38
-            $this->cache = (int)$cfg['cache'];
38
+            $this->cache = (int) $cfg['cache'];
39 39
         }
40 40
 
41 41
         // check item count is defined
42
-        if (!$this->count|| !Any::isInt($this->count)) {
43
-            $this->count = (int)$cfg['count'];
42
+        if (!$this->count || !Any::isInt($this->count)) {
43
+            $this->count = (int) $cfg['count'];
44 44
         }
45 45
 
46
-        $this->_cacheName = 'widget.newcontent.' . $this->createStringClassSnapshotHash();
46
+        $this->_cacheName = 'widget.newcontent.'.$this->createStringClassSnapshotHash();
47 47
     }
48 48
 
49 49
     /**
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 // check if SAPI client == cli (php built-in dev server)
15 15
 if (php_sapi_name() === 'cli-server') {
16
-    $path = root . DIRECTORY_SEPARATOR . ltrim($uriRequest, '/');
16
+    $path = root.DIRECTORY_SEPARATOR.ltrim($uriRequest, '/');
17 17
     // if static file exist
18 18
     if (is_file($path)) {
19 19
         // check if it looks like standalone php script
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 
29 29
 // get configs to prepare posible route to switch environment
30
-$configs = require(root . '/Private/Config/Default.php');
30
+$configs = require(root.'/Private/Config/Default.php');
31 31
 // remove base path
32 32
 $uriRequest = substr($uriRequest, strlen($configs['basePath']));
33 33
 $uriArray = explode('/', $uriRequest);
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 $uriLoader = ucfirst(strtolower(str_replace('.', '', $uriLoader)));
39 39
 
40 40
 // if loader of interface is available - require it
41
-if (in_array($uriLoader, $loaderList, true) && file_exists(root . '/Loader/' . $uriLoader . '/index.php')) {
42
-    require_once (root . '/Loader/' . $uriLoader . '/index.php');
41
+if (in_array($uriLoader, $loaderList, true) && file_exists(root.'/Loader/'.$uriLoader.'/index.php')) {
42
+    require_once (root.'/Loader/'.$uriLoader.'/index.php');
43 43
 } else { // else - try to load default interface
44
-    require_once (root . '/Loader/Front/index.php');
44
+    require_once (root.'/Loader/Front/index.php');
45 45
 }
46 46
\ No newline at end of file
Please login to merge, or discard this patch.
Apps/ActiveRecord/Blacklist.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@
 block discarded – undo
45 45
      */
46 46
     public static function check($user1, $user2)
47 47
     {
48
-        $query = self::where(function ($query) use ($user1, $user2) {
48
+        $query = self::where(function($query) use ($user1, $user2) {
49 49
             $query->where('user_id', '=', $user1)
50 50
                 ->where('target_id', '=', $user2);
51
-        })->orWhere(function ($query) use ($user1, $user2) {
51
+        })->orWhere(function($query) use ($user1, $user2) {
52 52
             $query->where('user_id', '=', $user2)
53 53
                 ->where('target_id', '=', $user1);
54 54
         });
Please login to merge, or discard this patch.