@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function addPrefix($prefix, $baseDir) |
21 | 21 | { |
22 | - $prefix = trim($prefix, '\\').'\\'; |
|
23 | - $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
22 | + $prefix = trim($prefix, '\\') . '\\'; |
|
23 | + $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
24 | 24 | $this->prefixes[] = [$prefix, $baseDir]; |
25 | 25 | } |
26 | 26 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | foreach ($this->prefixes as list($currentPrefix, $currentBaseDir)) { |
45 | 45 | if (0 === strpos($class, $currentPrefix)) { |
46 | 46 | $classWithoutPrefix = substr($class, strlen($currentPrefix)); |
47 | - $file = $currentBaseDir.str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php'; |
|
47 | + $file = $currentBaseDir . str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix) . '.php'; |
|
48 | 48 | if (file_exists($file)) { |
49 | 49 | return $file; |
50 | 50 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public static function dump($dirs, $file) |
19 | 19 | { |
20 | - $dirs = (array)$dirs; |
|
20 | + $dirs = (array) $dirs; |
|
21 | 21 | $maps = []; |
22 | 22 | foreach ($dirs as $dir) { |
23 | 23 | $maps = array_merge($maps, static::createMap($dir)); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | break; |
117 | 117 | } |
118 | 118 | } |
119 | - $classes[] = ltrim($namespace.$class, '\\'); |
|
119 | + $classes[] = ltrim($namespace . $class, '\\'); |
|
120 | 120 | break; |
121 | 121 | default: |
122 | 122 | break; |
@@ -136,7 +136,7 @@ |
||
136 | 136 | */ |
137 | 137 | public function getLoaderClass($name) |
138 | 138 | { |
139 | - return 'Nip\AutoLoader\Loaders\\'.$name; |
|
139 | + return 'Nip\AutoLoader\Loaders\\' . $name; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | - * @param $name |
|
91 | + * @param string $name |
|
92 | 92 | * @return AbstractLoader |
93 | 93 | */ |
94 | 94 | public function getLoader($name) |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
181 | - * @return array |
|
181 | + * @return string[] |
|
182 | 182 | */ |
183 | 183 | public function getLoaderOrder() |
184 | 184 | { |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
189 | - * @return mixed |
|
189 | + * @return string |
|
190 | 190 | */ |
191 | 191 | public function getCachePath() |
192 | 192 | { |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
197 | - * @param $path |
|
197 | + * @param string $path |
|
198 | 198 | * @return $this |
199 | 199 | */ |
200 | 200 | public function setCachePath($path) |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
208 | - * @param $class |
|
208 | + * @param string $class |
|
209 | 209 | * @return bool |
210 | 210 | */ |
211 | 211 | public function isClass($class) |
@@ -100,6 +100,6 @@ |
||
100 | 100 | */ |
101 | 101 | public function getHelperClass($name) |
102 | 102 | { |
103 | - return 'Nip_Helper_'.ucfirst($name); |
|
103 | + return 'Nip_Helper_' . ucfirst($name); |
|
104 | 104 | } |
105 | 105 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | $this->_mail->CharSet = "UTF-8"; |
12 | 12 | // $this->_mail->SMTPDebug = true; |
13 | 13 | |
14 | - $config = Nip_Config::instance()->parse(CONFIG_PATH.'smtp.ini'); |
|
14 | + $config = Nip_Config::instance()->parse(CONFIG_PATH . 'smtp.ini'); |
|
15 | 15 | if ($config->SMTP->host) { |
16 | 16 | $this->_mail->IsSMTP(); |
17 | 17 | if ($config->SMTP->username) { |
@@ -19,7 +19,7 @@ |
||
19 | 19 | public function populateQuerySpecific(AbstractQuery $query) |
20 | 20 | { |
21 | 21 | $pk = $this->getManager()->getPrimaryKey(); |
22 | - $query->where('`'.$this->getFK().'` = ?', $this->getItem()->{$pk}); |
|
22 | + $query->where('`' . $this->getFK() . '` = ?', $this->getItem()->{$pk}); |
|
23 | 23 | |
24 | 24 | return $query; |
25 | 25 | } |
@@ -3,67 +3,67 @@ |
||
3 | 3 | class Nip_Record_Sorter |
4 | 4 | { |
5 | 5 | |
6 | - protected $_query; |
|
7 | - protected $_field; |
|
8 | - protected $_type = "asc"; |
|
6 | + protected $_query; |
|
7 | + protected $_field; |
|
8 | + protected $_type = "asc"; |
|
9 | 9 | |
10 | - public function __construct($field = false, $type = false) |
|
11 | - { |
|
12 | - $this->_field = $field; |
|
10 | + public function __construct($field = false, $type = false) |
|
11 | + { |
|
12 | + $this->_field = $field; |
|
13 | 13 | |
14 | - if ($type) { |
|
15 | - $this->_type = $type; |
|
16 | - } |
|
17 | - } |
|
14 | + if ($type) { |
|
15 | + $this->_type = $type; |
|
16 | + } |
|
17 | + } |
|
18 | 18 | |
19 | - public function sort($query, $request = array()) |
|
20 | - { |
|
21 | - $this->setQuery($query); |
|
22 | - $this->setParams($request); |
|
19 | + public function sort($query, $request = array()) |
|
20 | + { |
|
21 | + $this->setQuery($query); |
|
22 | + $this->setParams($request); |
|
23 | 23 | |
24 | - if ($this->getField()) { |
|
25 | - $query->order(array($this->getField(), $this->getType())); |
|
26 | - } |
|
27 | - return $query; |
|
28 | - } |
|
24 | + if ($this->getField()) { |
|
25 | + $query->order(array($this->getField(), $this->getType())); |
|
26 | + } |
|
27 | + return $query; |
|
28 | + } |
|
29 | 29 | |
30 | - public function setParams($request = array()) |
|
31 | - { |
|
32 | - if ($request['order'] && preg_match("/[a-z0-9_-]/i", $request['order'])) { |
|
33 | - $this->_field = $request['order']; |
|
34 | - if (in_array($request['order_type'], array("asc", "desc"))) { |
|
35 | - $this->_type = $request['order_type']; |
|
36 | - } |
|
37 | - } |
|
38 | - return $this; |
|
39 | - } |
|
30 | + public function setParams($request = array()) |
|
31 | + { |
|
32 | + if ($request['order'] && preg_match("/[a-z0-9_-]/i", $request['order'])) { |
|
33 | + $this->_field = $request['order']; |
|
34 | + if (in_array($request['order_type'], array("asc", "desc"))) { |
|
35 | + $this->_type = $request['order_type']; |
|
36 | + } |
|
37 | + } |
|
38 | + return $this; |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * @param \Nip\Database\Query\Select $query |
|
43 | - * @return Nip_Record_Sorter |
|
44 | - */ |
|
45 | - public function setQuery($query) |
|
46 | - { |
|
47 | - $this->_query = $query; |
|
48 | - return $this; |
|
49 | - } |
|
41 | + /** |
|
42 | + * @param \Nip\Database\Query\Select $query |
|
43 | + * @return Nip_Record_Sorter |
|
44 | + */ |
|
45 | + public function setQuery($query) |
|
46 | + { |
|
47 | + $this->_query = $query; |
|
48 | + return $this; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * @return \Nip\Database\Query\Select |
|
53 | - */ |
|
54 | - public function getQuery() |
|
55 | - { |
|
56 | - return $this->_query; |
|
57 | - } |
|
51 | + /** |
|
52 | + * @return \Nip\Database\Query\Select |
|
53 | + */ |
|
54 | + public function getQuery() |
|
55 | + { |
|
56 | + return $this->_query; |
|
57 | + } |
|
58 | 58 | |
59 | - public function getField() |
|
60 | - { |
|
61 | - return $this->_field; |
|
62 | - } |
|
59 | + public function getField() |
|
60 | + { |
|
61 | + return $this->_field; |
|
62 | + } |
|
63 | 63 | |
64 | - public function getType() |
|
65 | - { |
|
66 | - return $this->_type; |
|
67 | - } |
|
64 | + public function getType() |
|
65 | + { |
|
66 | + return $this->_type; |
|
67 | + } |
|
68 | 68 | |
69 | 69 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $cacheId = $this->getCacheId($cacheId); |
34 | 34 | |
35 | - return $this->cachePath().$cacheId.'.php'; |
|
35 | + return $this->cachePath() . $cacheId . '.php'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function getCacheId($type = false) |
43 | 43 | { |
44 | - $cacheId = $this->getManager()->getController().'-'.$type; |
|
44 | + $cacheId = $this->getManager()->getController() . '-' . $type; |
|
45 | 45 | |
46 | 46 | return $cacheId; |
47 | 47 | } |
@@ -70,6 +70,6 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function cachePath() |
72 | 72 | { |
73 | - return parent::cachePath().'/records/'; |
|
73 | + return parent::cachePath() . '/records/'; |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | \ No newline at end of file |
@@ -49,7 +49,7 @@ |
||
49 | 49 | { |
50 | 50 | $table = $this->getManager()->getRecordManager()->getTable(); |
51 | 51 | |
52 | - return '`'.$table.'`.`'.$this->getField().'`'; |
|
52 | + return '`' . $table . '`.`' . $this->getField() . '`'; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | } |
56 | 56 | \ No newline at end of file |