Completed
Push — master ( 51582e...254118 )
by Alexander
04:28
created
src/Entity.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 
58 58
     /**
59 59
      * @param string[] ...$relation_names any list of relations to return
60
-     * @return instance of Entity object
60
+     * @return Entity of Entity object
61 61
      */
62 62
     public function with(string ...$relation_names)
63 63
     {
Please login to merge, or discard this patch.
src/internals/debug/adapters/Html.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -129,6 +129,9 @@
 block discarded – undo
129 129
         return $ret;
130 130
     }
131 131
 
132
+    /**
133
+     * @param integer $key
134
+     */
132 135
     public static function top(array $outputs, ?string $key = null) : void
133 136
     {
134 137
             if (empty($outputs)) return;
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
             $debug->current_depth--;
53 53
             return $ret . '<li><span class="empty"> -- Blacklisted Object Avoided -- </span></li></ul>';
54 54
         }
55
-        if (isset($debug->object_references[$hash]))  {
55
+        if (isset($debug->object_references[$hash])) {
56 56
             $debug->current_depth--;
57 57
             return $ret . '<li><span class="empty"> -- Object Recursion Avoided -- </span></li></ul>';
58 58
         }
59
-        if (in_array('object', $debug->options['avoid']))  {
59
+        if (in_array('object', $debug->options['avoid'])) {
60 60
             $debug->current_depth--;
61 61
             return $ret . '<li><span class="empty"> -- Object Type Avoided -- </span></li></ul>';
62 62
         }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         }
77 77
         $debug->current_depth--;
78 78
         if ($props == '') return $ret .= '<li><span class="empty"> -- No properties -- </span></li></ul>';
79
-        else  $ret .=  $props;
79
+        else  $ret .= $props;
80 80
         $ret .= '</ul>';
81 81
         return  $ret;
82 82
     }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             case 'string' : $length = strlen($var); $var = '\'' . htmlentities($var) . '\''; break;
110 110
             case 'NULL' : return '<span class="empty">NULL</span>'; break;
111 111
         }
112
-		$ret = '<span class="value ' . $type .'">' . $var . '</span> ';
112
+		$ret = '<span class="value ' . $type . '">' . $var . '</span> ';
113 113
 
114 114
 		if ($type == 'string') {
115 115
 			$ret .= '<span class="type">string[' . $length . ']</span>';
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
     public static function locationString(array $location) : string
123 123
     {
124 124
         extract($location);
125
-        $ret = "line: <span>$line</span> &nbsp;".
125
+        $ret = "line: <span>$line</span> &nbsp;" .
126 126
                "file: <span>$file</span> &nbsp;";
127
-        $ret .= isset($class) ? "class: <span>$class</span> &nbsp;" :'';
128
-        $ret .= isset($function) && $function != 'include' ? "function: <span>$function</span> &nbsp;" :'';
127
+        $ret .= isset($class) ? "class: <span>$class</span> &nbsp;" : '';
128
+        $ret .= isset($function) && $function != 'include' ? "function: <span>$function</span> &nbsp;" : '';
129 129
         return $ret;
130 130
     }
131 131
 
132
-    public static function top(array $outputs, ?string $key = null) : void
132
+    public static function top(array $outputs, ? string $key = null) : void
133 133
     {
134 134
             if (empty($outputs)) return;
135 135
             echo '<div id="debugger">';
Please login to merge, or discard this patch.
src/internals/debug/Debug.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	/**
31 31
 	 * Get the singleton instance
32 32
 	 *
33
-	 * @return alkemann\hl\debug\util\Debug
33
+	 * @return Debug
34 34
 	 */
35 35
     public static function get_instance() : Debug
36 36
     {
@@ -112,6 +112,9 @@  discard block
 block discarded – undo
112 112
 		$this->__out($key);
113 113
 	}
114 114
 
115
+	/**
116
+	 * @param integer $key
117
+	 */
115 118
 	private function __out($key = null) : void
116 119
     {
117 120
 		if ($key !== null) {
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         switch ($mode) {
72 72
 			default :
73 73
 				$locString = \alkemann\h2l\internals\debug\adapters\Html::locationString($location);
74
-				$this->output[] = '<div class="debug-dump"><div class="debug-location">' . $locString . '</div>'.
74
+				$this->output[] = '<div class="debug-dump"><div class="debug-location">' . $locString . '</div>' .
75 75
 					'<div class="debug-content"> ' . implode("<br>\n", $dump) . '</div></div>';
76 76
 				break;
77 77
 		}
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
         while ($def = array_slice($defines, $offset--, 1)) {
140 140
             $key = key($def);
141 141
             $value = current($def);
142
-            if ($key  == 'FIRST_APP_CONSTANT') break;
143
-            $ret[$key ] = $value;
142
+            if ($key == 'FIRST_APP_CONSTANT') break;
143
+            $ret[$key] = $value;
144 144
         }
145 145
         return $ret;
146 146
     }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
     public function dump_it($var) : string
155 155
     {
156
-		$adapter = '\alkemann\h2l\internals\debug\adapters\\'. $this->options['mode'];
156
+		$adapter = '\alkemann\h2l\internals\debug\adapters\\' . $this->options['mode'];
157 157
         if (is_array($var))
158 158
             return $adapter::dump_array($var, $this);
159 159
         elseif (is_object($var))
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	 */
171 171
     public function location($trace) : array
172 172
     {
173
-        $root = substr($_SERVER['DOCUMENT_ROOT'], 0 , strlen(static::$defaults['docroot']) * -1);
173
+        $root = substr($_SERVER['DOCUMENT_ROOT'], 0, strlen(static::$defaults['docroot']) * -1);
174 174
         $file = implode('/', array_diff(explode('/', $trace[0]['file']), explode('/', $root)));
175 175
         $ret = array(
176 176
             'file' => $file,
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
     public function trace() : array
185 185
     {
186
-        $root = substr($_SERVER['DOCUMENT_ROOT'], 0 , strlen(static::$defaults['docroot']) * -1);
186
+        $root = substr($_SERVER['DOCUMENT_ROOT'], 0, strlen(static::$defaults['docroot']) * -1);
187 187
         $trace = debug_backtrace();
188 188
         array_unshift($trace, array());
189 189
         $arr = array();
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
                 $arr[$k]['file'] = $file;
195 195
             }
196 196
             if (isset($one['line'])) $arr[$k]['line'] = $one['line'];
197
-            if (isset($one['class'])) $arr[$k-1]['class'] = $one['class'];
198
-            if (isset($one['function'])) $arr[$k-1]['function'] = $one['function'];
197
+            if (isset($one['class'])) $arr[$k - 1]['class'] = $one['class'];
198
+            if (isset($one['function'])) $arr[$k - 1]['function'] = $one['function'];
199 199
         }
200 200
         array_shift($arr);
201 201
         array_shift($arr);
@@ -209,13 +209,13 @@  discard block
 block discarded – undo
209 209
             $obj = $var;
210 210
         } else {
211 211
             if (!class_exists($var)) {
212
-                throw new \Exception('Class ['.$var.'] doesn\'t exist');
212
+                throw new \Exception('Class [' . $var . '] doesn\'t exist');
213 213
             }
214 214
             $class = $var;
215 215
             try {
216 216
                 $obj = new $class();
217 217
             } catch (\Exception $e) {
218
-                throw new \Exception('Debug::api could not instantiate ['.$var.'], send it an object.');
218
+                throw new \Exception('Debug::api could not instantiate [' . $var . '], send it an object.');
219 219
             }
220 220
         }
221 221
         $reflection = new \ReflectionObject($obj);
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                     if (is_object($value)) {
235 235
                         $value = get_class($value);
236 236
                     } elseif (is_array($value)) {
237
-                        $value = 'array['.count($value).']';
237
+                        $value = 'array[' . count($value) . ']';
238 238
                     }
239 239
 
240 240
                     $properties[$access][$property] = compact('value', 'type');
@@ -263,12 +263,12 @@  discard block
 block discarded – undo
263 263
                     }*/
264 264
                     $method_name = $refMethod->getName();
265 265
 
266
-                    $string = $access .' function '.$method_name.'(';
266
+                    $string = $access . ' function ' . $method_name . '(';
267 267
                     $paramString = '';
268 268
                     foreach ($params as $p) {
269
-                        $paramString .= '$'.$p.', ';
269
+                        $paramString .= '$' . $p . ', ';
270 270
                     }
271
-                    $paramString  = substr($paramString,0,-2);
271
+                    $paramString = substr($paramString, 0, -2);
272 272
                     $string .= $paramString;
273 273
                     $string .= ')';
274 274
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
                             $info = implode(' ', $paramArr);
289 289
                             $tags['param'][$name] = compact('type', 'info');
290 290
                         } else {
291
-                            $tags[$tagArr[0]] = isset($tagArr[1])?$tagArr[1]:'';
291
+                            $tags[$tagArr[0]] = isset($tagArr[1]) ? $tagArr[1] : '';
292 292
                         }
293 293
                     }
294 294
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                 }
298 298
         }
299 299
 
300
-        return compact('properties', 'constants' ,'methods');
300
+        return compact('properties', 'constants', 'methods');
301 301
     }
302 302
 
303 303
 }
Please login to merge, or discard this patch.
src/internals/functions.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 /**
139 139
  * Extra short way of adding a blacklisted object property
140 140
  * 
141
- * @param mixed $value Name of object property to blacklist, or array of
141
+ * @param string $value Name of object property to blacklist, or array of
142 142
  */
143 143
 function dbp($value)
144 144
 {
@@ -161,7 +161,6 @@  discard block
 block discarded – undo
161 161
  * Convenient wrapper for other \util\Debug methods
162 162
  * 
163 163
  * @param string $method Name of method to call on the Debug obect
164
- * @param boolean $echo True will echo, false will return result
165 164
  */
166 165
 function dw($method)
167 166
 {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     @ob_end_clean();
42 42
     $debug_trace = $debug->trace();
43 43
     foreach ($debug_trace as $t) {
44
-        @$traced[] = (empty($t['class'])?$t['file']:$t['class']).'::'.$t['function'].'::'.$t['line'];
44
+        @$traced[] = (empty($t['class']) ? $t['file'] : $t['class']) . '::' . $t['function'] . '::' . $t['line'];
45 45
     }
46 46
     $args[] = $traced;
47 47
     $debug->dump($args, compact('trace', 'split'));
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     @ob_end_clean();
78 78
     $debug_trace = $debug->trace();
79 79
     foreach ($debug_trace as $t) {
80
-        @$traced[] = (empty($t['class'])?$t['file']:$t['class']).'::'.$t['function'].'::'.$t['line'];
80
+        @$traced[] = (empty($t['class']) ? $t['file'] : $t['class']) . '::' . $t['function'] . '::' . $t['line'];
81 81
     }
82 82
     $args[] = $traced;
83 83
     $debug->dump($args, compact('trace', 'split', 'echo'));
Please login to merge, or discard this patch.
src/response/Page.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -157,6 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
     /**
159 159
      * @throws InvalidUrl
160
+     * @param string $view
160 161
      */
161 162
     public function view($view): string
162 163
     {
@@ -203,6 +204,9 @@  discard block
 block discarded – undo
203 204
         $this->template = "{$template}.{$this->type}";
204 205
     }
205 206
 
207
+    /**
208
+     * @param string $url
209
+     */
206 210
     private function templateFromUrl(?string $url = null): string
207 211
     {
208 212
         $parts = \explode('/', $url);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         try {
95 95
             $headfile = $this->getLayoutFile('head');
96 96
             if (file_exists($headfile)) {
97
-                (function ($sldkfjlksejflskjflskdjflskdfj) {
97
+                (function($sldkfjlksejflskjflskdjflskdfj) {
98 98
                     extract($this->data);
99 99
                     include $sldkfjlksejflskjflskdjflskdfj;
100 100
                 })($headfile);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
             $neckfile = $this->getLayoutFile('neck');
104 104
             if (file_exists($neckfile)) {
105
-                (function ($lidsinqjhsdfytqkwjkasjdksadsdg) {
105
+                (function($lidsinqjhsdfytqkwjkasjdksadsdg) {
106 106
                     extract($this->data);
107 107
                     include $lidsinqjhsdfytqkwjkasjdksadsdg;
108 108
                 })($neckfile);
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
         ob_start();
144 144
         try {
145
-            (function ($ldkfoskdfosjicyvutwehkshfskjdf) {
145
+            (function($ldkfoskdfosjicyvutwehkshfskjdf) {
146 146
                 extract($this->data);
147 147
                 include $ldkfoskdfosjicyvutwehkshfskjdf;
148 148
             })($footfile);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         ob_start();
168 168
         try {
169 169
             // or another way to hide the file variable?
170
-            (function ($dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd) {
170
+            (function($dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd) {
171 171
                 extract($this->data);
172 172
                 include $dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd;
173 173
             })($file);
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         $this->template = "{$template}.{$this->type}";
204 204
     }
205 205
 
206
-    private function templateFromUrl(?string $url = null): string
206
+    private function templateFromUrl(? string $url = null) : string
207 207
     {
208 208
         $parts = \explode('/', $url);
209 209
         $last = \array_slice($parts, -1, 1, true);
Please login to merge, or discard this patch.
src/Route.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      * @param Closure|null $cb
33 33
      * @param array $parameters
34 34
      */
35
-    public function __construct(string $url, ?Closure $cb = null, array $parameters = [])
35
+    public function __construct(string $url, ? Closure $cb = null, array $parameters = [])
36 36
     {
37 37
         $this->url = $url;
38 38
         $this->callback = $cb;
Please login to merge, or discard this patch.
src/data/Source.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
     public function query($query, array $params = []);
10 10
 
11
-    public function one(string $table, array $conditions, array $options = []):?array;
11
+    public function one(string $table, array $conditions, array $options = []): ? array;
12 12
 
13 13
     public function find(string $table, array $conditions, array $options = []);
14 14
 
Please login to merge, or discard this patch.
src/data/MongoDB.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         throw new \Exception("Query method is not implemented for MongDB");
79 79
     }
80 80
 
81
-    public function one(string $collection_name, array $conditions, array $options = []): ?array
81
+    public function one(string $collection_name, array $conditions, array $options = []): ? array
82 82
     {
83 83
         $collection = $this->collection($collection_name);
84 84
         $conditions = $this->idReplaceConditions($conditions);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         return $result->getModifiedCount();
130 130
     }
131 131
 
132
-    public function insert(string $collection, array $data, array $options = []): ?ObjectID
132
+    public function insert(string $collection, array $data, array $options = []): ? ObjectID
133 133
     {
134 134
         $collection = $this->collection($collection);
135 135
         $result = $collection->insertOne($data, $options);
Please login to merge, or discard this patch.
src/data/Mysql.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         return $result->fetchAll(PDO::FETCH_ASSOC);
62 62
     }
63 63
 
64
-    public function one(string $table, array $conditions, array $options = []): ?array
64
+    public function one(string $table, array $conditions, array $options = []): ? array
65 65
     {
66 66
         $result = $this->find($table, $conditions, $options);
67 67
         $result = iterator_to_array($result);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         if (empty($conditions)) {
124 124
             return "";
125 125
         }
126
-        $fun = function ($o, $v) {
126
+        $fun = function($o, $v) {
127 127
             return "{$o}{$v} = :c_{$v}";
128 128
         };
129 129
         $where = array_reduce(array_keys($conditions), $fun, "");
@@ -170,13 +170,13 @@  discard block
 block discarded – undo
170 170
 
171 171
     private function data(array $data): string
172 172
     {
173
-        $fun = function ($o, $v) {
173
+        $fun = function($o, $v) {
174 174
             return "{$o}{$v} = :d_{$v}";
175 175
         };
176 176
         return array_reduce(array_keys($data), $fun, "");
177 177
     }
178 178
 
179
-    public function insert(string $table, array $data, array $options = []): ?int
179
+    public function insert(string $table, array $data, array $options = []): ? int
180 180
     {
181 181
         $keys = implode(', ', array_keys($data));
182 182
         $data_phs = ':d_' . implode(', :d_', array_keys($data));
Please login to merge, or discard this patch.