@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | /** |
63 | 63 | * Register a shared binding in the container. |
64 | 64 | * |
65 | - * @param string|array $abstract |
|
65 | + * @param string $abstract |
|
66 | 66 | * @param \Closure|string|null $concrete |
67 | 67 | * @return void |
68 | 68 | */ |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | /** |
129 | 129 | * @param string $id |
130 | 130 | * @param array $args |
131 | - * @return bool|mixed|object |
|
131 | + * @return \Swift_Transport |
|
132 | 132 | */ |
133 | 133 | public function get($id, array $args = []) |
134 | 134 | { |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
152 | - * @param $id |
|
152 | + * @param string $id |
|
153 | 153 | * @param array $args |
154 | - * @return bool|mixed |
|
154 | + * @return string |
|
155 | 155 | */ |
156 | 156 | protected function getFromThisContainer($id, array $args = []) |
157 | 157 | { |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
236 | - * @param $id |
|
236 | + * @param string $id |
|
237 | 237 | * @param null $concrete |
238 | 238 | */ |
239 | 239 | public function set($id, $concrete = null) |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * Determine if a given offset exists. |
246 | 246 | * |
247 | 247 | * @param string $key |
248 | - * @return bool |
|
248 | + * @return boolean|null |
|
249 | 249 | */ |
250 | 250 | public function offsetExists($key) |
251 | 251 | { |
@@ -67,6 +67,9 @@ discard block |
||
67 | 67 | $this->_profiler = $profiler; |
68 | 68 | } |
69 | 69 | |
70 | + /** |
|
71 | + * @param string $sql |
|
72 | + */ |
|
70 | 73 | abstract public function query($sql); |
71 | 74 | |
72 | 75 | abstract public function error(); |
@@ -90,6 +93,9 @@ discard block |
||
90 | 93 | $newLink = false |
91 | 94 | ); |
92 | 95 | |
96 | + /** |
|
97 | + * @param string $table |
|
98 | + */ |
|
93 | 99 | abstract public function describeTable($table); |
94 | 100 | |
95 | 101 | abstract public function disconnect(); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | if ($result !== false) { |
41 | 41 | return $result; |
42 | 42 | } else { |
43 | - trigger_error($this->error()." [$sql]", E_USER_WARNING); |
|
43 | + trigger_error($this->error() . " [$sql]", E_USER_WARNING); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return false; |
@@ -54,6 +54,9 @@ discard block |
||
54 | 54 | return $this->_adapter; |
55 | 55 | } |
56 | 56 | |
57 | + /** |
|
58 | + * @param AbstractAdapter $adapter |
|
59 | + */ |
|
57 | 60 | public function setAdapter($adapter) |
58 | 61 | { |
59 | 62 | $this->_adapter = $adapter; |
@@ -64,6 +67,9 @@ discard block |
||
64 | 67 | $this->setAdapterName('MySQLi'); |
65 | 68 | } |
66 | 69 | |
70 | + /** |
|
71 | + * @param string $name |
|
72 | + */ |
|
67 | 73 | public function setAdapterName($name) |
68 | 74 | { |
69 | 75 | $this->setAdapter($this->newAdapter($name)); |
@@ -91,7 +97,7 @@ discard block |
||
91 | 97 | } |
92 | 98 | |
93 | 99 | /** |
94 | - * @param mixed $database |
|
100 | + * @param string $database |
|
95 | 101 | */ |
96 | 102 | public function setDatabase($database) |
97 | 103 | { |
@@ -123,7 +129,6 @@ discard block |
||
123 | 129 | } |
124 | 130 | |
125 | 131 | /** |
126 | - * @param string $type optional |
|
127 | 132 | * @return SelectQuery |
128 | 133 | */ |
129 | 134 | public function newSelect() |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | public static function getAdapterClass($name) |
84 | 84 | { |
85 | - return '\Nip\Database\Adapters\\'.$name; |
|
85 | + return '\Nip\Database\Adapters\\' . $name; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | public function getDatabase() |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function newQuery($type = "select") |
139 | 139 | { |
140 | - $className = '\Nip\Database\Query\\'.inflector()->camelize($type); |
|
140 | + $className = '\Nip\Database\Query\\' . inflector()->camelize($type); |
|
141 | 141 | $query = new $className(); |
142 | 142 | /** @var AbstractQuery $query */ |
143 | 143 | $query->setManager($this); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function protect($input) |
211 | 211 | { |
212 | - return str_replace("`*`", "*", '`'.str_replace('.', '`.`', $input).'`'); |
|
212 | + return str_replace("`*`", "*", '`' . str_replace('.', '`.`', $input) . '`'); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | public function getQueries() |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * @param null $generated |
|
71 | + * @param boolean $generated |
|
72 | 72 | * @return bool |
73 | 73 | */ |
74 | 74 | public function isGenerated($generated = null) |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
134 | - * @param $start |
|
134 | + * @param integer $start |
|
135 | 135 | * @param bool $offset |
136 | 136 | * @return $this |
137 | 137 | */ |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
247 | - * @param $name |
|
247 | + * @param string $name |
|
248 | 248 | * @return mixed|null |
249 | 249 | */ |
250 | 250 | public function getPart($name) |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | } |
413 | 413 | |
414 | 414 | /** |
415 | - * @return mixed |
|
415 | + * @return string |
|
416 | 416 | */ |
417 | 417 | protected function getTable() |
418 | 418 | { |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | $this->parts['limit'] = $start; |
141 | 141 | if ($offset) { |
142 | - $this->parts['limit'] .= ','.$offset; |
|
142 | + $this->parts['limit'] .= ',' . $offset; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | return $this; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | public function getString() |
225 | 225 | { |
226 | 226 | if ($this->string === null) { |
227 | - $this->string = (string)$this->assemble(); |
|
227 | + $this->string = (string) $this->assemble(); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | return $this->string; |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | { |
318 | 318 | if (isset($params['where']) && is_array($params['where'])) { |
319 | 319 | foreach ($params['where'] as $condition) { |
320 | - $condition = (array)$condition; |
|
320 | + $condition = (array) $condition; |
|
321 | 321 | $this->where($condition[0], $condition[1]); |
322 | 322 | } |
323 | 323 | } |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | */ |
383 | 383 | protected function parseWhere() |
384 | 384 | { |
385 | - return is_object($this->parts['where']) ? (string)$this->parts['where'] : ''; |
|
385 | + return is_object($this->parts['where']) ? (string) $this->parts['where'] : ''; |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | /** |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | protected function parseHaving() |
430 | 430 | { |
431 | 431 | if (isset($this->parts['having'])) { |
432 | - return (string)$this->parts['having']; |
|
432 | + return (string) $this->parts['having']; |
|
433 | 433 | } |
434 | 434 | |
435 | 435 | return ''; |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | $type = isset($itemOrder[1]) ? $itemOrder[1] : ''; |
459 | 459 | $protected = isset($itemOrder[2]) ? $itemOrder[2] : true; |
460 | 460 | |
461 | - $column = ($protected ? $this->protect($column) : $column).' '.strtoupper($type); |
|
461 | + $column = ($protected ? $this->protect($column) : $column) . ' ' . strtoupper($type); |
|
462 | 462 | |
463 | 463 | $orderParts[] = trim($column); |
464 | 464 | } |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | protected function protect($input) |
477 | 477 | { |
478 | 478 | return strpos($input, '(') !== false ? $input : str_replace("`*`", "*", |
479 | - '`'.str_replace('.', '`.`', $input).'`'); |
|
479 | + '`' . str_replace('.', '`.`', $input) . '`'); |
|
480 | 480 | } |
481 | 481 | |
482 | 482 | /** |
@@ -12,6 +12,9 @@ discard block |
||
12 | 12 | protected $_values; |
13 | 13 | protected $_query; |
14 | 14 | |
15 | + /** |
|
16 | + * @param string $string |
|
17 | + */ |
|
15 | 18 | public function __construct($string, $values = array()) |
16 | 19 | { |
17 | 20 | $this->_string = $string; |
@@ -75,6 +78,9 @@ discard block |
||
75 | 78 | return $string; |
76 | 79 | } |
77 | 80 | |
81 | + /** |
|
82 | + * @param Query $value |
|
83 | + */ |
|
78 | 84 | protected function parseValueQuery($value) |
79 | 85 | { |
80 | 86 | return "(".$value->assemble().")"; |
@@ -99,11 +105,17 @@ discard block |
||
99 | 105 | return $this; |
100 | 106 | } |
101 | 107 | |
108 | + /** |
|
109 | + * @param Condition $condition |
|
110 | + */ |
|
102 | 111 | public function and_($condition) |
103 | 112 | { |
104 | 113 | return new AndCondition($this, $condition); |
105 | 114 | } |
106 | 115 | |
116 | + /** |
|
117 | + * @param Condition $condition |
|
118 | + */ |
|
107 | 119 | public function or_($condition) |
108 | 120 | { |
109 | 121 | return new OrCondition($this, $condition); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | protected function parseValueQuery($value) |
79 | 79 | { |
80 | - return "(".$value->assemble().")"; |
|
80 | + return "(" . $value->assemble() . ")"; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | public function protectCondition($condition) |
113 | 113 | { |
114 | - return strpos($condition, ' AND ') || strpos($condition, ' OR ') ? '('.$condition.')' : $condition; |
|
114 | + return strpos($condition, ' AND ') || strpos($condition, ' OR ') ? '(' . $condition . ')' : $condition; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | } |
118 | 118 | \ No newline at end of file |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | - * @param $name |
|
39 | + * @param boolean $name |
|
40 | 40 | * @return mixed |
41 | 41 | */ |
42 | 42 | public static function formatActionName($name) |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
131 | - * @param $name |
|
131 | + * @param string $name |
|
132 | 132 | * @return mixed |
133 | 133 | */ |
134 | 134 | public function formatModuleName($name) |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
142 | - * @param $name |
|
142 | + * @param string $name |
|
143 | 143 | * @return mixed |
144 | 144 | */ |
145 | 145 | public function formatControllerName($name) |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
162 | - * @param $class |
|
162 | + * @param string $class |
|
163 | 163 | * @return Controller |
164 | 164 | */ |
165 | 165 | public function newController($class) |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
247 | - * @param $namespaceClass |
|
247 | + * @param string $namespaceClass |
|
248 | 248 | * @return bool |
249 | 249 | */ |
250 | 250 | protected function isValidControllerNamespace($namespaceClass) |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | if ($this->hops <= $this->maxHops) { |
65 | 65 | if ($request->getControllerName() == null) { |
66 | - throw new Exception('No valid controller name in request ['.$request->getMCA().']'); |
|
66 | + throw new Exception('No valid controller name in request [' . $request->getMCA() . ']'); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | $controller = $this->generateController($request); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | return $return; |
81 | 81 | } |
82 | 82 | } else { |
83 | - throw new Exception('Error finding a valid controller for ['.$request->getMCA().']'); |
|
83 | + throw new Exception('Error finding a valid controller for [' . $request->getMCA() . ']'); |
|
84 | 84 | } |
85 | 85 | } else { |
86 | 86 | throw new Exception("Maximum number of hops ($this->maxHops) has been reached for {$request->getMCA()}"); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | } |
125 | 125 | throw new Exception( |
126 | - 'Error finding a valid controller ['.$namespaceClass.']['.$classicClass.'] for ['.$request->getMCA().']' |
|
126 | + 'Error finding a valid controller [' . $namespaceClass . '][' . $classicClass . '] for [' . $request->getMCA() . ']' |
|
127 | 127 | ); |
128 | 128 | } |
129 | 129 | |
@@ -235,10 +235,10 @@ discard block |
||
235 | 235 | */ |
236 | 236 | protected function generateFullControllerNameNamespace($module, $controller) |
237 | 237 | { |
238 | - $name = app()->get('kernel')->getRootNamespace().'Modules\\'; |
|
238 | + $name = app()->get('kernel')->getRootNamespace() . 'Modules\\'; |
|
239 | 239 | $module = $module == 'Default' ? 'Frontend' : $module; |
240 | - $name .= $module.'\Controllers\\'; |
|
241 | - $name .= str_replace('_', '\\', $controller)."Controller"; |
|
240 | + $name .= $module . '\Controllers\\'; |
|
241 | + $name .= str_replace('_', '\\', $controller) . "Controller"; |
|
242 | 242 | |
243 | 243 | return $name; |
244 | 244 | } |
@@ -273,6 +273,6 @@ discard block |
||
273 | 273 | */ |
274 | 274 | protected function generateFullControllerNameString($module, $controller) |
275 | 275 | { |
276 | - return $module."_".$controller."Controller"; |
|
276 | + return $module . "_" . $controller . "Controller"; |
|
277 | 277 | } |
278 | 278 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | - * @param bool|Dispatcher $dispatcher |
|
41 | + * @param Dispatcher $dispatcher |
|
42 | 42 | * @return $this |
43 | 43 | */ |
44 | 44 | public function setDispatcher($dispatcher = false) |
@@ -75,7 +75,7 @@ |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
78 | - * @return $this |
|
78 | + * @return Nip_File_System |
|
79 | 79 | */ |
80 | 80 | public function delete() |
81 | 81 | { |
@@ -289,8 +289,8 @@ discard block |
||
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
292 | - * @param $x |
|
293 | - * @param $y |
|
292 | + * @param double $x |
|
293 | + * @param double $y |
|
294 | 294 | * @param $dwidth |
295 | 295 | * @param $dheight |
296 | 296 | * @param $swidth |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | } |
456 | 456 | |
457 | 457 | /** |
458 | - * @return mixed |
|
458 | + * @return string |
|
459 | 459 | */ |
460 | 460 | public function getFile() |
461 | 461 | { |
@@ -269,10 +269,10 @@ |
||
269 | 269 | |
270 | 270 | if ($sourceRatio > $target_ratio) { |
271 | 271 | $new_height = $max_height; |
272 | - $new_width = ( int )($max_height * $sourceRatio); |
|
272 | + $new_width = (int) ($max_height * $sourceRatio); |
|
273 | 273 | } else { |
274 | 274 | $new_width = $max_width; |
275 | - $new_height = ( int )($max_width / $sourceRatio); |
|
275 | + $new_height = (int) ($max_width / $sourceRatio); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | $image = imagecreatetruecolor($new_width, $new_height); |