GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Branch master (3eac19)
by Gabriel
05:37 queued 18s
created
src/Records/_Abstract/Table.php 2 patches
Doc Comments   +18 added lines, -3 removed lines patch added patch discarded remove patch
@@ -129,6 +129,9 @@  discard block
 block discarded – undo
129 129
         }
130 130
     }
131 131
 
132
+    /**
133
+     * @param string $class
134
+     */
132 135
     public function generateModelClass($class = null)
133 136
     {
134 137
         $class = $class ? $class : get_class($this);
@@ -192,6 +195,9 @@  discard block
 block discarded – undo
192 195
         $this->setUpDB();
193 196
     }
194 197
 
198
+    /**
199
+     * @param string $name
200
+     */
195 201
     public function getHelper($name)
196 202
     {
197 203
         return HelperBroker::get($name);
@@ -402,6 +408,9 @@  discard block
 block discarded – undo
402 408
         return $this->getDB()->lastInsertID();
403 409
     }
404 410
 
411
+    /**
412
+     * @param Record $model
413
+     */
405 414
     public function insertQuery($model, $onDuplicate)
406 415
     {
407 416
         $inserts = $this->getQueryModelData($model);
@@ -507,7 +516,7 @@  discard block
 block discarded – undo
507 516
     /**
508 517
      * Delete a Record's database entry
509 518
      *
510
-     * @param mixed $input
519
+     * @param Row $input
511 520
      */
512 521
     public function delete($input)
513 522
     {
@@ -564,7 +573,7 @@  discard block
 block discarded – undo
564 573
      * Returns paginated results
565 574
      * @param Paginator $paginator
566 575
      * @param array $params
567
-     * @return mixed
576
+     * @return RecordCollection
568 577
      */
569 578
     public function paginate(Paginator $paginator, $params = array())
570 579
     {
@@ -633,7 +642,7 @@  discard block
 block discarded – undo
633 642
      * Finds Records using params array
634 643
      *
635 644
      * @param array $params
636
-     * @return mixed
645
+     * @return RecordCollection
637 646
      */
638 647
     public function findByParams($params = array())
639 648
     {
@@ -666,6 +675,9 @@  discard block
 block discarded – undo
666 675
         return false;
667 676
     }
668 677
 
678
+    /**
679
+     * @param Query $query
680
+     */
669 681
     public function findByQuery($query, $params = array())
670 682
     {
671 683
         $class = $this->getCollectionClass();
@@ -903,6 +915,9 @@  discard block
 block discarded – undo
903 915
         $this->initRelationsFromArray($type, $array);
904 916
     }
905 917
 
918
+    /**
919
+     * @param string $type
920
+     */
906 921
     public function initRelationsFromArray($type, $array)
907 922
     {
908 923
         foreach ($array as $key => $item) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
         if (isset($where)) {
541 541
             if (is_array($where)) {
542 542
                 foreach ($where as $condition) {
543
-                    $condition = (array)$condition;
543
+                    $condition = (array) $condition;
544 544
                     $query->where($condition[0], $condition[1]);
545 545
                 }
546 546
             } else {
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
 
723 723
         if ($result->numRows()) {
724 724
             $row = $result->fetchResult();
725
-            return (int)$row['count'];
725
+            return (int) $row['count'];
726 726
         }
727 727
 
728 728
         return false;
Please login to merge, or discard this patch.
src/Records/Relations/HasAndBelongsToMany.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
      * When the $specific is false, it returns the generic query that applies
20 20
      * to any item, not just this collection's item
21 21
      *
22
-     * @return Nip_DB_Query_Select
22
+     * @return \Nip\Database\Query\_Abstract
23 23
      */
24 24
     public function getQuery($specific = true)
25 25
     {
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     /**
63 63
      * Simple select query from the link table
64
-     * @return Nip_DB_Query_Select
64
+     * @return \Nip\Database\Query\_Abstract
65 65
      */
66 66
     public function getLinkQuery($specific = true)
67 67
     {
Please login to merge, or discard this patch.
src/Records/Relations/HasOneOrMany.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -37,6 +37,9 @@
 block discarded – undo
37 37
         $this->setResults($collection);
38 38
     }
39 39
 
40
+    /**
41
+     * @param \Nip_RecordCollection $items
42
+     */
40 43
     public function populateCollection($collection, $items)
41 44
     {
42 45
         foreach ($items as $item) {
Please login to merge, or discard this patch.
src/Records/Relations/Relation.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     }
53 53
 
54 54
     /**
55
-     * @param mixed $name
55
+     * @param string $name
56 56
      */
57 57
     public function setName($name)
58 58
     {
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     }
216 216
 
217 217
     /**
218
-     * @param Record $object
218
+     * @param Records $object
219 219
      * @return $this
220 220
      */
221 221
     public function setWith(Records $object)
Please login to merge, or discard this patch.
src/Request.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -523,7 +523,7 @@
 block discarded – undo
523 523
     /**
524 524
      * Singleton
525 525
      *
526
-     * @return Nip_Request
526
+     * @return Request
527 527
      */
528 528
     static public function instance()
529 529
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
      */
397 397
     public function setModuleKey($key)
398 398
     {
399
-        $this->_moduleKey = (string)$key;
399
+        $this->_moduleKey = (string) $key;
400 400
         return $this;
401 401
     }
402 402
 
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
      */
419 419
     public function setControllerKey($key)
420 420
     {
421
-        $this->_controllerKey = (string)$key;
421
+        $this->_controllerKey = (string) $key;
422 422
         return $this;
423 423
     }
424 424
 
@@ -440,14 +440,14 @@  discard block
 block discarded – undo
440 440
      */
441 441
     public function setActionKey($key)
442 442
     {
443
-        $this->_actionKey = (string)$key;
443
+        $this->_actionKey = (string) $key;
444 444
         return $this;
445 445
     }
446 446
 
447 447
 
448 448
     public function getMCA()
449 449
     {
450
-        return $this->getModuleName().'.'.$this->getControllerName().'.'.$this->getActionName();
450
+        return $this->getModuleName() . '.' . $this->getControllerName() . '.' . $this->getActionName();
451 451
     }
452 452
 
453 453
 
Please login to merge, or discard this patch.
src/router/route/Abstract.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -31,6 +31,9 @@
 block discarded – undo
31 31
     {
32 32
     }
33 33
 
34
+    /**
35
+     * @param boolean $map
36
+     */
34 37
     public function setMap($map)
35 38
     {
36 39
         $this->_map = $map;
Please login to merge, or discard this patch.
src/router/Router.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
     }
82 82
 
83 83
     /**
84
-     * @return mixed
84
+     * @return Nip\Request
85 85
      */
86 86
     public function getRequest()
87 87
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@
 block discarded – undo
29 29
 
30 30
         foreach ($this->_routes as $name => $route) {
31 31
             $route->setRequest($request);
32
-            Nip_Profiler::instance()->start('route [' . $name . '] ['.$uri.']');
32
+            Nip_Profiler::instance()->start('route [' . $name . '] [' . $uri . ']');
33 33
             if ($route->match($uri)) {
34 34
                 $this->_route = $route;
35
-                Nip_Profiler::instance()->end('route [' . $name . '] ['.$uri.']');
35
+                Nip_Profiler::instance()->end('route [' . $name . '] [' . $uri . ']');
36 36
                 break;
37 37
             }
38 38
 
39
-            Nip_Profiler::instance()->end('route [' . $name . '] ['.$uri.']');
39
+            Nip_Profiler::instance()->end('route [' . $name . '] [' . $uri . ']');
40 40
         }
41 41
 
42 42
         if ($this->_route) {
Please login to merge, or discard this patch.
src/service/maps/objects/Abstract.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -18,6 +18,9 @@
 block discarded – undo
18 18
 
19 19
     }
20 20
 
21
+    /**
22
+     * @param string $key
23
+     */
21 24
     public function setParam($key, $value) {
22 25
         $this->_params[$key] = $value;
23 26
         return $this;
Please login to merge, or discard this patch.
src/Session.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	/**
83 83
 	 * Public method to return the session id
84 84
 	 * @todo implement a verification method ( ex: adding another validation string in the sessionID )
85
-	 * @return int
85
+	 * @return string
86 86
 	 */
87 87
 	public function getId()
88 88
 	{
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	 * Fetches session entry from database
107 107
 	 *
108 108
 	 * @param string $id
109
-	 * @return mixed
109
+	 * @return string|false
110 110
 	 */
111 111
 	public function read($id)
112 112
 	{
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
 	/**
183 183
 	 * @param Nip_DB_Wrapper $db
184
-	 * @return Nip_Session
184
+	 * @return Session
185 185
 	 */
186 186
 	public function setDB($db)
187 187
 	{
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
 	/**
193 193
 	 * @param int $lifetime
194
-	 * @return Nip_Session
194
+	 * @return Session
195 195
 	 */
196 196
 	public function setLifetime($lifetime)
197 197
 	{
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 * Decodes data to be used
217 217
 	 *
218 218
 	 * @param string $data
219
-	 * @return mixed
219
+	 * @return string
220 220
 	 */
221 221
 	protected function decodeData($data)
222 222
 	{
Please login to merge, or discard this patch.
Indentation   +206 added lines, -206 removed lines patch added patch discarded remove patch
@@ -5,222 +5,222 @@
 block discarded – undo
5 5
 class Session
6 6
 {
7 7
 
8
-	protected $id;
9
-	protected $_lifetime;
10
-	protected $db;
11
-	protected $table = 'session';
8
+    protected $id;
9
+    protected $_lifetime;
10
+    protected $db;
11
+    protected $table = 'session';
12 12
 
13
-	public function __construct()
14
-	{
15
-		$this->db = db();
16
-		$this->_lifetime = get_cfg_var("session.gc_maxlifetime");
13
+    public function __construct()
14
+    {
15
+        $this->db = db();
16
+        $this->_lifetime = get_cfg_var("session.gc_maxlifetime");
17 17
 
18 18
 //		ini_set('session.save_handler', 'user');
19
-		register_shutdown_function('session_write_close');
20
-	}
19
+        register_shutdown_function('session_write_close');
20
+    }
21 21
 
22
-	public function init()
23
-	{
24
-		$id = $this->checkRequestId();
22
+    public function init()
23
+    {
24
+        $id = $this->checkRequestId();
25 25
 //		$this->setHandlers();
26
-		$this->start($id);
27
-	}
28
-
29
-	/**
30
-	 * Restarts the session, with new optional session id
31
-	 *
32
-	 * @param string $id
33
-	 */
34
-	public function reinitialize($id = false)
35
-	{
36
-		session_write_close();
37
-		$this->setHandlers()->start($id);
38
-	}
39
-
40
-	/**
41
-	 * Starts the session, with optional session id
42
-	 * @param string $id
43
-	 */
44
-	protected function start($id = false)
45
-	{
46
-		if ($id) {
47
-			session_id($id);
48
-		}
26
+        $this->start($id);
27
+    }
28
+
29
+    /**
30
+     * Restarts the session, with new optional session id
31
+     *
32
+     * @param string $id
33
+     */
34
+    public function reinitialize($id = false)
35
+    {
36
+        session_write_close();
37
+        $this->setHandlers()->start($id);
38
+    }
39
+
40
+    /**
41
+     * Starts the session, with optional session id
42
+     * @param string $id
43
+     */
44
+    protected function start($id = false)
45
+    {
46
+        if ($id) {
47
+            session_id($id);
48
+        }
49 49
         \Nip\AutoLoader::instance()->isFatal(false);
50
-		session_start();
50
+        session_start();
51 51
         \Nip\AutoLoader::instance()->isFatal(true);
52
-	}
53
-
54
-	/**
55
-	 * Overrides default session handling functions
56
-	 * @return Session
57
-	 */
58
-	protected function setHandlers()
59
-	{
60
-		session_set_save_handler(
61
-			array($this, 'open'),
62
-			array($this, 'close'),
63
-			array($this, 'read'),
64
-			array($this, 'write'),
65
-			array($this, 'destroy'),
66
-			array($this, 'gc')
67
-		);
52
+    }
53
+
54
+    /**
55
+     * Overrides default session handling functions
56
+     * @return Session
57
+     */
58
+    protected function setHandlers()
59
+    {
60
+        session_set_save_handler(
61
+            array($this, 'open'),
62
+            array($this, 'close'),
63
+            array($this, 'read'),
64
+            array($this, 'write'),
65
+            array($this, 'destroy'),
66
+            array($this, 'gc')
67
+        );
68 68
 		
69
-		return $this;
70
-	}
71
-
72
-	public function open()
73
-	{
74
-		return true;
75
-	}
76
-
77
-	public function close()
78
-	{
79
-		return true;
80
-	}
81
-
82
-	/**
83
-	 * Public method to return the session id
84
-	 * @todo implement a verification method ( ex: adding another validation string in the sessionID )
85
-	 * @return int
86
-	 */
87
-	public function getId()
88
-	{
89
-		return session_id();
90
-	}
91
-
92
-	/**
93
-	 * Gets the session ID from REQUEST
94
-	 * @return int
95
-	 */
96
-	public function checkRequestId()
97
-	{
98
-		if (isset($_REQUEST['session_id'])) {
99
-			return $_REQUEST['session_id'];
100
-		}
101
-
102
-		return false;
103
-	}
104
-
105
-	/**
106
-	 * Fetches session entry from database
107
-	 *
108
-	 * @param string $id
109
-	 * @return mixed
110
-	 */
111
-	public function read($id)
112
-	{
113
-		/* @var $result Nip_DBResult */
114
-		$query = $this->db->newQuery('select');
115
-		$query->from($this->table)
116
-			  ->where('id = ?', $id)
117
-			  ->where('expires > ?', time())
118
-			  ->limit(1);
119
-		$result = $this->db->execute($query);
120
-
121
-		$return = false;
122
-		if ($result->numRows()) {
123
-			$row = $result->fetchResult();
124
-			$return = $this->decodeData($row['data']);
125
-		}
126
-		return $return;
127
-	}
128
-
129
-	/**
130
-	 * Stores the surrent session in the database
131
-	 *
132
-	 * @param string $id
133
-	 * @param mixed $data
134
-	 * @return int
135
-	 */
136
-	public function write($id, $data)
137
-	{
138
-		$replace = array();
139
-		$replace['id'] = $id;
140
-		$replace['data'] = $this->encodeData($data);
141
-		$replace['expires'] = time() + $this->_lifetime;
69
+        return $this;
70
+    }
71
+
72
+    public function open()
73
+    {
74
+        return true;
75
+    }
76
+
77
+    public function close()
78
+    {
79
+        return true;
80
+    }
81
+
82
+    /**
83
+     * Public method to return the session id
84
+     * @todo implement a verification method ( ex: adding another validation string in the sessionID )
85
+     * @return int
86
+     */
87
+    public function getId()
88
+    {
89
+        return session_id();
90
+    }
91
+
92
+    /**
93
+     * Gets the session ID from REQUEST
94
+     * @return int
95
+     */
96
+    public function checkRequestId()
97
+    {
98
+        if (isset($_REQUEST['session_id'])) {
99
+            return $_REQUEST['session_id'];
100
+        }
101
+
102
+        return false;
103
+    }
104
+
105
+    /**
106
+     * Fetches session entry from database
107
+     *
108
+     * @param string $id
109
+     * @return mixed
110
+     */
111
+    public function read($id)
112
+    {
113
+        /* @var $result Nip_DBResult */
114
+        $query = $this->db->newQuery('select');
115
+        $query->from($this->table)
116
+                ->where('id = ?', $id)
117
+                ->where('expires > ?', time())
118
+                ->limit(1);
119
+        $result = $this->db->execute($query);
120
+
121
+        $return = false;
122
+        if ($result->numRows()) {
123
+            $row = $result->fetchResult();
124
+            $return = $this->decodeData($row['data']);
125
+        }
126
+        return $return;
127
+    }
128
+
129
+    /**
130
+     * Stores the surrent session in the database
131
+     *
132
+     * @param string $id
133
+     * @param mixed $data
134
+     * @return int
135
+     */
136
+    public function write($id, $data)
137
+    {
138
+        $replace = array();
139
+        $replace['id'] = $id;
140
+        $replace['data'] = $this->encodeData($data);
141
+        $replace['expires'] = time() + $this->_lifetime;
142 142
 		
143
-		$query = $this->db->newQuery('replace');
144
-		$query->table($this->table)
145
-			  ->data($replace);
146
-		$result = $this->db->execute($query);
147
-
148
-		return $this->db->affectedRows();
149
-	}
150
-
151
-	/**
152
-	 * Destroys current session and deletes it's entry from the database
153
-	 *
154
-	 * @param string $id
155
-	 * @return int
156
-	 */
157
-	public function destroy($id)
158
-	{
159
-		$query = $this->db->newQuery("delete");
160
-		$query->table($this->table);
161
-		$query->where('id = ?', $id);
162
-		$query->limit(1);
163
-		$query->execute();
164
-
165
-		return $this->db->affectedRows();
166
-	}
167
-
168
-	/**
169
-	 * Garbage control. Called by PHP to remove expired entries from the database
170
-	 * @return int
171
-	 */
172
-	public function gc()
173
-	{
174
-		$query = $this->db->newQuery("delete");
175
-		$query->table($this->table);
176
-		$query->where('expires <= ?', time());
177
-		$query->execute();
178
-
179
-		return $this->db->affectedRows();
180
-	}
181
-
182
-	/**
183
-	 * @param Nip_DB_Wrapper $db
184
-	 * @return Nip_Session
185
-	 */
186
-	public function setDB($db)
187
-	{
188
-		$this->db = $db;
189
-		return $this;
190
-	}
191
-
192
-	/**
193
-	 * @param int $lifetime
194
-	 * @return Nip_Session
195
-	 */
196
-	public function setLifetime($lifetime)
197
-	{
143
+        $query = $this->db->newQuery('replace');
144
+        $query->table($this->table)
145
+                ->data($replace);
146
+        $result = $this->db->execute($query);
147
+
148
+        return $this->db->affectedRows();
149
+    }
150
+
151
+    /**
152
+     * Destroys current session and deletes it's entry from the database
153
+     *
154
+     * @param string $id
155
+     * @return int
156
+     */
157
+    public function destroy($id)
158
+    {
159
+        $query = $this->db->newQuery("delete");
160
+        $query->table($this->table);
161
+        $query->where('id = ?', $id);
162
+        $query->limit(1);
163
+        $query->execute();
164
+
165
+        return $this->db->affectedRows();
166
+    }
167
+
168
+    /**
169
+     * Garbage control. Called by PHP to remove expired entries from the database
170
+     * @return int
171
+     */
172
+    public function gc()
173
+    {
174
+        $query = $this->db->newQuery("delete");
175
+        $query->table($this->table);
176
+        $query->where('expires <= ?', time());
177
+        $query->execute();
178
+
179
+        return $this->db->affectedRows();
180
+    }
181
+
182
+    /**
183
+     * @param Nip_DB_Wrapper $db
184
+     * @return Nip_Session
185
+     */
186
+    public function setDB($db)
187
+    {
188
+        $this->db = $db;
189
+        return $this;
190
+    }
191
+
192
+    /**
193
+     * @param int $lifetime
194
+     * @return Nip_Session
195
+     */
196
+    public function setLifetime($lifetime)
197
+    {
198 198
         if ($lifetime && is_numeric($lifetime)) {
199
-    		$this->_lifetime = $lifetime;
199
+            $this->_lifetime = $lifetime;
200 200
         }
201
-		return $this;
202
-	}
203
-
204
-	/**
205
-	 * Encodes data to be stored
206
-	 *
207
-	 * @param mixed $data
208
-	 * @return string
209
-	 */
210
-	protected function encodeData($data)
211
-	{
212
-		return base64_encode($data);
213
-	}
214
-
215
-	/**
216
-	 * Decodes data to be used
217
-	 *
218
-	 * @param string $data
219
-	 * @return mixed
220
-	 */
221
-	protected function decodeData($data)
222
-	{
223
-		return base64_decode($data);
224
-	}
201
+        return $this;
202
+    }
203
+
204
+    /**
205
+     * Encodes data to be stored
206
+     *
207
+     * @param mixed $data
208
+     * @return string
209
+     */
210
+    protected function encodeData($data)
211
+    {
212
+        return base64_encode($data);
213
+    }
214
+
215
+    /**
216
+     * Decodes data to be used
217
+     *
218
+     * @param string $data
219
+     * @return mixed
220
+     */
221
+    protected function decodeData($data)
222
+    {
223
+        return base64_decode($data);
224
+    }
225 225
 
226 226
 }
227 227
\ No newline at end of file
Please login to merge, or discard this patch.