@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } elseif (null === $baseUrl) { |
227 | 227 | return $requestUri; |
228 | 228 | } |
229 | - return (string)$pathInfo; |
|
229 | + return (string) $pathInfo; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
@@ -377,8 +377,7 @@ discard block |
||
377 | 377 | // PHP also converts "+" to spaces when filling the global _GET or when using the function parse_str. This is why we use urldecode and then normalize to |
378 | 378 | // RFC 3986 with rawurlencode. |
379 | 379 | $parts[] = isset($keyValuePair[1]) ? |
380 | - rawurlencode(urldecode($keyValuePair[0])) . '=' . rawurlencode(urldecode($keyValuePair[1])) : |
|
381 | - rawurlencode(urldecode($keyValuePair[0])); |
|
380 | + rawurlencode(urldecode($keyValuePair[0])) . '=' . rawurlencode(urldecode($keyValuePair[1])) : rawurlencode(urldecode($keyValuePair[0])); |
|
382 | 381 | $order[] = urldecode($keyValuePair[0]); |
383 | 382 | } |
384 | 383 | array_multisort($order, SORT_ASC, $parts); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | $minutes = false; |
8 | 8 | if (strpos($time, ':')) { |
9 | 9 | list($hours, $minutes) = explode(':', $time); |
10 | - $minutes += $hours*60; |
|
10 | + $minutes += $hours * 60; |
|
11 | 11 | } |
12 | 12 | return $minutes; |
13 | 13 | } |
@@ -15,21 +15,21 @@ discard block |
||
15 | 15 | public function secondsInStringTime($seconds) |
16 | 16 | { |
17 | 17 | if ($days = intval((floor($seconds / 86400)))) { |
18 | - $seconds = $seconds - $days*86400; |
|
19 | - $return .= ($return ? ' ' : '') . str_pad($days, 2, 0,STR_PAD_LEFT).'d'; |
|
18 | + $seconds = $seconds - $days * 86400; |
|
19 | + $return .= ($return ? ' ' : '') . str_pad($days, 2, 0, STR_PAD_LEFT) . 'd'; |
|
20 | 20 | } |
21 | 21 | if ($hours = intval((floor($seconds / 3600))) OR $return) { |
22 | - $seconds = $seconds - $hours*3600; |
|
23 | - $return .= ($return ? ' ' : '') . str_pad($hours, 2, 0,STR_PAD_LEFT).'h'; |
|
22 | + $seconds = $seconds - $hours * 3600; |
|
23 | + $return .= ($return ? ' ' : '') . str_pad($hours, 2, 0, STR_PAD_LEFT) . 'h'; |
|
24 | 24 | } |
25 | 25 | if ($minutes = intval((floor($seconds / 60))) OR $return) { |
26 | - $seconds = $seconds - $minutes*60; |
|
27 | - $return .= ($return ? ' ' : '') . str_pad($minutes, 2, 0, STR_PAD_LEFT).'m'; |
|
26 | + $seconds = $seconds - $minutes * 60; |
|
27 | + $return .= ($return ? ' ' : '') . str_pad($minutes, 2, 0, STR_PAD_LEFT) . 'm'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | $seconds = round($seconds, 2); |
31 | 31 | if ($seconds) { |
32 | - $return .= ($return ? ' ' : '') . str_pad($seconds, 2, 0, STR_PAD_LEFT).'s'; |
|
32 | + $return .= ($return ? ' ' : '') . str_pad($seconds, 2, 0, STR_PAD_LEFT) . 's'; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | return $return; |
@@ -22,9 +22,9 @@ |
||
22 | 22 | |
23 | 23 | $dDiff = $dStart->diff($dEnd); |
24 | 24 | |
25 | - $years = (int)$dDiff->format("%y"); |
|
26 | - $months = (int)$dDiff->format("%m"); |
|
27 | - $days = (int)$dDiff->format("%d"); |
|
25 | + $years = (int) $dDiff->format("%y"); |
|
26 | + $months = (int) $dDiff->format("%m"); |
|
27 | + $days = (int) $dDiff->format("%d"); |
|
28 | 28 | |
29 | 29 | return array($years, $months, $days); |
30 | 30 | } |
@@ -19,25 +19,25 @@ |
||
19 | 19 | switch ($mode) { |
20 | 20 | case "any": |
21 | 21 | foreach ($keywords as $item) { |
22 | - $return .= $this->matchNumbers($item).'* '; |
|
22 | + $return .= $this->matchNumbers($item) . '* '; |
|
23 | 23 | } |
24 | 24 | break; |
25 | 25 | |
26 | 26 | case "all": |
27 | 27 | if (count($keywords) == 1) { |
28 | - $return .= $this->matchNumbers(reset($keywords)).'* '; |
|
28 | + $return .= $this->matchNumbers(reset($keywords)) . '* '; |
|
29 | 29 | } else { |
30 | 30 | foreach ($keywords as $item) { |
31 | - $return .= '+'. $this->matchNumbers($item).'* '; |
|
31 | + $return .= '+' . $this->matchNumbers($item) . '* '; |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | 35 | break; |
36 | 36 | case "exact": |
37 | 37 | foreach ($keywords as $item) { |
38 | - $return .= $this->matchNumbers($item).' '; |
|
38 | + $return .= $this->matchNumbers($item) . ' '; |
|
39 | 39 | } |
40 | - $return = '+"'.$return.'"'; |
|
40 | + $return = '+"' . $return . '"'; |
|
41 | 41 | break; |
42 | 42 | } |
43 | 43 |
@@ -2,7 +2,7 @@ |
||
2 | 2 | class Nip_Helper_Async extends Nip\Helpers\AbstractHelper |
3 | 3 | { |
4 | 4 | |
5 | - public function sendMessage($message, $type = 'success', $format ='json') |
|
5 | + public function sendMessage($message, $type = 'success', $format = 'json') |
|
6 | 6 | { |
7 | 7 | $data = array( |
8 | 8 | 'type' => $type, |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | public function parseTransactions($prefix = '') { |
82 | 82 | $transactions = $this->getTransactions(); |
83 | 83 | |
84 | - $prefix = $prefix ? $prefix.'.' : ''; |
|
84 | + $prefix = $prefix ? $prefix . '.' : ''; |
|
85 | 85 | |
86 | 86 | if ($this->transactions) { |
87 | 87 | foreach ($this->transactions as $transaction) { |
88 | - $this->addOperation($prefix.'_addTrans', array( |
|
88 | + $this->addOperation($prefix . '_addTrans', array( |
|
89 | 89 | $transaction->orderId, |
90 | 90 | $transaction->affiliation, |
91 | 91 | $transaction->total, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | if ($transaction->items) { |
100 | 100 | foreach ($transaction->items as $item) { |
101 | - $this->addOperation($prefix.'_addItem', array( |
|
101 | + $this->addOperation($prefix . '_addItem', array( |
|
102 | 102 | $item->orderId, |
103 | 103 | $item->sku, |
104 | 104 | $item->name, |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
112 | - $this->addOperation($prefix.'_trackTrans'); //submits transaction to the Analytics servers |
|
112 | + $this->addOperation($prefix . '_trackTrans'); //submits transaction to the Analytics servers |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | public function renderOperationParam($param) |
169 | 169 | { |
170 | 170 | if (is_bool($param)) { |
171 | - return $param=== true ? 'true' : 'false'; |
|
171 | + return $param === true ? 'true' : 'false'; |
|
172 | 172 | } |
173 | 173 | return "'{$param}'"; |
174 | 174 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | foreach ($matches as &$match) { |
76 | 76 | if (preg_match('/<(a|img)\b/', $match) && !preg_match('/(?:http|#|mailto)/', $match)) { |
77 | - $match = preg_replace('/^([^"]+")([^"]+)/', '$1'.$base.'$2', $match); |
|
77 | + $match = preg_replace('/^([^"]+")([^"]+)/', '$1' . $base . '$2', $match); |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
@@ -95,21 +95,21 @@ discard block |
||
95 | 95 | $hours = array_pop($parts); |
96 | 96 | $days = array_pop($parts); |
97 | 97 | |
98 | - return (($days*24 + $hours)*60 + $minutes)*60 + $seconds; |
|
98 | + return (($days * 24 + $hours) * 60 + $minutes) * 60 + $seconds; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | public function secondsInCronoTime($seconds) |
102 | 102 | { |
103 | 103 | if ($days = intval((floor($seconds / 86400)))) { |
104 | - $seconds = $seconds - $days*86400; |
|
105 | - $return .= ($return ? ':' : '') . str_pad($days, 2, 0,STR_PAD_LEFT); |
|
104 | + $seconds = $seconds - $days * 86400; |
|
105 | + $return .= ($return ? ':' : '') . str_pad($days, 2, 0, STR_PAD_LEFT); |
|
106 | 106 | } |
107 | 107 | if ($hours = intval((floor($seconds / 3600))) OR $return) { |
108 | - $seconds = $seconds - $hours*3600; |
|
109 | - $return .= ($return ? ':' : '') . str_pad($hours, 2, 0,STR_PAD_LEFT); |
|
108 | + $seconds = $seconds - $hours * 3600; |
|
109 | + $return .= ($return ? ':' : '') . str_pad($hours, 2, 0, STR_PAD_LEFT); |
|
110 | 110 | } |
111 | 111 | if ($minutes = intval((floor($seconds / 60))) OR $return) { |
112 | - $seconds = $seconds - $minutes*60; |
|
112 | + $seconds = $seconds - $minutes * 60; |
|
113 | 113 | $return .= ($return ? ':' : '') . str_pad($minutes, 2, 0, STR_PAD_LEFT); |
114 | 114 | } |
115 | 115 | $seconds = round($seconds, 2); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | if (count($items)) { |
40 | 40 | if ($wrap) { |
41 | - $return .= '<div class="'.($type ? $this->_cssClass[$type] : '' ).'">'; |
|
41 | + $return .= '<div class="' . ($type ? $this->_cssClass[$type] : '') . '">'; |
|
42 | 42 | if (count($items) > 1) { |
43 | 43 | $return .= "<ul>"; |
44 | 44 | } |
@@ -59,19 +59,19 @@ discard block |
||
59 | 59 | if ($files) { |
60 | 60 | $lastUpdated = 0; |
61 | 61 | foreach ($files as $file) { |
62 | - $path = STYLESHEETS_PATH.$file.".css"; |
|
62 | + $path = STYLESHEETS_PATH . $file . ".css"; |
|
63 | 63 | if (file_exists($path)) { |
64 | 64 | $lastUpdated = max($lastUpdated, filemtime($path)); |
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
68 | - $hash = md5(implode("", $files)).".".$lastUpdated; |
|
68 | + $hash = md5(implode("", $files)) . "." . $lastUpdated; |
|
69 | 69 | |
70 | - $path = CACHE_PATH."stylesheets/".$hash; |
|
71 | - if (!file_exists($path.".css")) { |
|
70 | + $path = CACHE_PATH . "stylesheets/" . $hash; |
|
71 | + if (!file_exists($path . ".css")) { |
|
72 | 72 | $content = ""; |
73 | 73 | foreach ($files as $file) { |
74 | - $content .= file_get_contents(STYLESHEETS_PATH.$file.".css")."\r\n"; |
|
74 | + $content .= file_get_contents(STYLESHEETS_PATH . $file . ".css") . "\r\n"; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $css = new csstidy(); |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | // Parse content to remove all but one ../ instance |
86 | 86 | $content = preg_replace("`url\((\.\.\/){1,}`i", "url(../", $content); |
87 | 87 | |
88 | - $file = new Nip_File_Handler(array("path" => $path.".css")); |
|
88 | + $file = new Nip_File_Handler(array("path" => $path . ".css")); |
|
89 | 89 | $file->write($content); |
90 | 90 | |
91 | 91 | if ($file->gzip()) { |
92 | - $file->setPath($path.".gz")->write(); |
|
92 | + $file->setPath($path . ".gz")->write(); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | if (preg_match('/https?:\/\//', $source)) { |
105 | 105 | return $source; |
106 | 106 | } else { |
107 | - return STYLESHEETS_URL.$source.'.css'; |
|
107 | + return STYLESHEETS_URL . $source . '.css'; |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
111 | 111 | public function buildTag($path, $condition) |
112 | 112 | { |
113 | - $return = '<link rel="stylesheet" type="text/css" media="screen" href="'.$this->buildURL($path).'" />'; |
|
113 | + $return = '<link rel="stylesheet" type="text/css" media="screen" href="' . $this->buildURL($path) . '" />'; |
|
114 | 114 | if ($condition) { |
115 | - $return = '<!--[if '.$condition.']>'.$return.'<![endif]-->'; |
|
115 | + $return = '<!--[if ' . $condition . ']>' . $return . '<![endif]-->'; |
|
116 | 116 | } |
117 | 117 | $return .= "\r\n"; |
118 | 118 |