Passed
Push — master ( 5e595f...1c6317 )
by refat
03:54
created
App/Models/LoginModel.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@  discard block
 block discarded – undo
6 6
 
7 7
 class LoginModel extends Model
8 8
 {
9
-  protected $table = 'users';
9
+    protected $table = 'users';
10 10
 
11
-  private $user;
11
+    private $user;
12 12
 
13
-  public function isValidLogin($email, $password)
14
-  {
13
+    public function isValidLogin($email, $password)
14
+    {
15 15
     $user = $this->where('email=?' , $email)->fetch($this->table);
16 16
 
17 17
     if (! $user) return false;
@@ -19,15 +19,15 @@  discard block
 block discarded – undo
19 19
     $this->user = $user;
20 20
 
21 21
     return password_verify($password, $user->password);
22
-  }
22
+    }
23 23
 
24
-  public function user()
25
-  {
24
+    public function user()
25
+    {
26 26
     return $this->user;
27
-  }
27
+    }
28 28
 
29
-  public function isLogged()
30
-  {
29
+    public function isLogged()
30
+    {
31 31
     if ($this->cookie->has('login')) {
32 32
 
33 33
     $code = $this->cookie->get('login');
@@ -48,5 +48,5 @@  discard block
 block discarded – undo
48 48
     $this->user = $user;
49 49
 
50 50
     return true;
51
-  }
51
+    }
52 52
 }
53 53
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
   public function isValidLogin($email, $password)
14 14
   {
15
-    $user = $this->where('email=?' , $email)->fetch($this->table);
15
+    $user = $this->where('email=?', $email)->fetch($this->table);
16 16
 
17
-    if (! $user) return false;
17
+    if (!$user) return false;
18 18
 
19 19
     $this->user = $user;
20 20
 
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
     return false;
42 42
     }
43 43
 
44
-    $user = $this->where('code=?' , $code)->fetch($this->table);
44
+    $user = $this->where('code=?', $code)->fetch($this->table);
45 45
 
46
-    if (! $user) return false;
46
+    if (!$user) return false;
47 47
 
48 48
     $this->user = $user;
49 49
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@  discard block
 block discarded – undo
14 14
   {
15 15
     $user = $this->where('email=?' , $email)->fetch($this->table);
16 16
 
17
-    if (! $user) return false;
17
+    if (! $user) {
18
+        return false;
19
+    }
18 20
 
19 21
     $this->user = $user;
20 22
 
@@ -43,7 +45,9 @@  discard block
 block discarded – undo
43 45
 
44 46
     $user = $this->where('code=?' , $code)->fetch($this->table);
45 47
 
46
-    if (! $user) return false;
48
+    if (! $user) {
49
+        return false;
50
+    }
47 51
 
48 52
     $this->user = $user;
49 53
 
Please login to merge, or discard this patch.
App/Models/UsersGroupsModel.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,24 +6,24 @@
 block discarded – undo
6 6
 
7 7
 class UsersGroupsModel extends Model
8 8
 {
9
-  protected $table = 'users_groups';
9
+    protected $table = 'users_groups';
10 10
 
11
-  public function get($id)
12
-  {
11
+    public function get($id)
12
+    {
13 13
     $userGroup = parent::get($id);
14 14
 
15 15
     if ($userGroup) {
16 16
 
17
-      $userGroupInfos = $this->hasMany('UsersGroupPermissionsModel', $id);
17
+        $userGroupInfos = $this->hasMany('UsersGroupPermissionsModel', $id);
18 18
 
19
-      $userGroup->pages = [];
19
+        $userGroup->pages = [];
20 20
 
21
-      foreach($userGroupInfos as $userGroupInfo) {
21
+        foreach($userGroupInfos as $userGroupInfo) {
22 22
 
23 23
         $userGroup->pages[] = $userGroupInfo->page;
24
-      }
24
+        }
25 25
 
26
-      return $userGroup;
26
+        return $userGroup;
27
+    }
27 28
     }
28
-  }
29 29
 }
30 30
\ 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
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 
19 19
       $userGroup->pages = [];
20 20
 
21
-      foreach($userGroupInfos as $userGroupInfo) {
21
+      foreach ($userGroupInfos as $userGroupInfo) {
22 22
 
23 23
         $userGroup->pages[] = $userGroupInfo->page;
24 24
       }
Please login to merge, or discard this patch.
App/Models/UsersGroupPermissionsModel.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 
7 7
 class UsersGroupPermissionsModel extends Model
8 8
 {
9
-  protected $table = 'users_group_permissions';
9
+    protected $table = 'users_group_permissions';
10 10
 }
11 11
\ No newline at end of file
Please login to merge, or discard this patch.
App/Models/SettingsModel.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -6,25 +6,25 @@
 block discarded – undo
6 6
 
7 7
 class SettingsModel extends Model
8 8
 {
9
-  protected $table = 'settings';
9
+    protected $table = 'settings';
10 10
 
11
-  private $settings;
11
+    private $settings;
12 12
 
13
-  public function loadAll()
14
-  {
13
+    public function loadAll()
14
+    {
15 15
     foreach($this->all() as $setting) {
16 16
 
17
-      $this->settings[$setting->key] = $setting->value;
17
+        $this->settings[$setting->key] = $setting->value;
18
+    }
18 19
     }
19
-  }
20 20
 
21
-  public function get($key)
22
-  {
21
+    public function get($key)
22
+    {
23 23
     return array_get($this->settings, $key);
24
-  }
24
+    }
25 25
 
26
-  public function updateSettings()
27
-  {
26
+    public function updateSettings()
27
+    {
28 28
 
29
-  }
29
+    }
30 30
 }
31 31
\ 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
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
   public function loadAll()
14 14
   {
15
-    foreach($this->all() as $setting) {
15
+    foreach ($this->all() as $setting) {
16 16
 
17 17
       $this->settings[$setting->key] = $setting->value;
18 18
     }
Please login to merge, or discard this patch.
App/Models/UserModel.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 class UserModel extends Model
8 8
 {
9
-  protected $table = 'users';
9
+    protected $table = 'users';
10 10
 
11
-  public function permissions($id)
12
-  {
11
+    public function permissions($id)
12
+    {
13 13
     return $this->hasMany('UsersGroupPermissions', $id, 'id', 'users_group_id');
14
-  }
14
+    }
15 15
 
16
-  public function comments($id)
17
-  {
16
+    public function comments($id)
17
+    {
18 18
     return $this->hasMany('Comment', $id);
19
-  }
19
+    }
20 20
 }
21 21
\ No newline at end of file
Please login to merge, or discard this patch.