@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | |
90 | 90 | private function tokenizeBrick($brick, $brickSlug) |
91 | 91 | { |
92 | - $fields = $brick->fields; |
|
92 | + $fields = $brick->fields; |
|
93 | 93 | $brickDefinition = $this->storage->getBricks()->getBrickBySlug($brick->type); |
94 | 94 | foreach ($fields as $fieldName => $field) { |
95 | 95 | $fieldType = $this->getFieldType($fieldName, $brickDefinition); |
96 | - $this->tokenizeField($field, $brickSlug . '__' . $fieldName, $fieldType); |
|
96 | + $this->tokenizeField($field, $brickSlug.'__'.$fieldName, $fieldType); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | { |
102 | 102 | $dynamicBricks = $this->document->dynamicBricks; |
103 | 103 | foreach ($dynamicBricks as $key => $brick) { |
104 | - $this->tokenizeBrick($brick, 'dynamicBricks__' . $brick->type . $key); |
|
104 | + $this->tokenizeBrick($brick, 'dynamicBricks__'.$brick->type.$key); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
157 | - throw new \Exception('Unknown field type for field' . $fieldName . ' in document ' . $this->document->path); |
|
157 | + throw new \Exception('Unknown field type for field'.$fieldName.' in document '.$this->document->path); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION); |
56 | 56 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
57 | 57 | $cmsComponent->storage->getApplicationComponents()->addApplicationComponent($request::$post); |
58 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/application-components'); |
|
58 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/application-components'); |
|
59 | 59 | exit; |
60 | 60 | } |
61 | 61 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $applicationComponent = $cmsComponent->storage->getApplicationComponents()->getApplicationComponentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
72 | 72 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
73 | 73 | $cmsComponent->storage->getApplicationComponents()->saveApplicationComponent($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post); |
74 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/application-components'); |
|
74 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/application-components'); |
|
75 | 75 | exit; |
76 | 76 | } |
77 | 77 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | private function deleteRoute($request, $cmsComponent) |
86 | 86 | { |
87 | 87 | $cmsComponent->storage->getApplicationComponents()->deleteApplicationComponentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
88 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/application-components'); |
|
88 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/application-components'); |
|
89 | 89 | exit; |
90 | 90 | } |
91 | 91 | } |
92 | 92 | \ No newline at end of file |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | if (isset($this->parameters['document'])) { |
86 | 86 | $this->runByDocumentParameter(); |
87 | 87 | } else { |
88 | - throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: ' . $this->matchedSitemapItem->title); |
|
88 | + throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: '.$this->matchedSitemapItem->title); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | $relativeDocumentUri = current($this->matchedSitemapItem->matches[1]); |
103 | 103 | if (isset($this->parameters['folder'])) { |
104 | 104 | if (substr($this->parameters['folder'], -1) !== '/') { |
105 | - $this->parameters['folder'] = $this->parameters['folder'] . '/'; |
|
105 | + $this->parameters['folder'] = $this->parameters['folder'].'/'; |
|
106 | 106 | } |
107 | - $relativeDocumentUri = $this->parameters['folder'] . $relativeDocumentUri; |
|
107 | + $relativeDocumentUri = $this->parameters['folder'].$relativeDocumentUri; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | $document = $this->storage->getDocuments()->getDocumentBySlug($relativeDocumentUri); |
@@ -38,19 +38,19 @@ |
||
38 | 38 | array_pop($fileParts); |
39 | 39 | $fileNameWithoutExtension = implode('-', $fileParts); |
40 | 40 | $fileNameWithoutExtension = StringUtil::slugify($fileNameWithoutExtension); |
41 | - $filename = $fileNameWithoutExtension . '.' . $extension; |
|
41 | + $filename = $fileNameWithoutExtension.'.'.$extension; |
|
42 | 42 | } else { |
43 | 43 | $filename = StringUtil::slugify($filename); |
44 | 44 | } |
45 | 45 | |
46 | - if (file_exists($path . '/' . $filename)) { |
|
46 | + if (file_exists($path.'/'.$filename)) { |
|
47 | 47 | $fileParts = explode('.', $filename); |
48 | 48 | if (count($fileParts) > 1) { |
49 | 49 | $extension = end($fileParts); |
50 | 50 | array_pop($fileParts); |
51 | 51 | $fileNameWithoutExtension = implode('-', $fileParts); |
52 | 52 | $fileNameWithoutExtension .= '-copy'; |
53 | - $filename = $fileNameWithoutExtension . '.' . $extension; |
|
53 | + $filename = $fileNameWithoutExtension.'.'.$extension; |
|
54 | 54 | } else { |
55 | 55 | $filename .= '-copy'; |
56 | 56 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | return $returnFileNames; |
47 | 47 | } else { |
48 | - throw new \Exception('Image doesnt exist: ' . $imagePath); |
|
48 | + throw new \Exception('Image doesnt exist: '.$imagePath); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | * @return string |
57 | 57 | * @throws \Exception |
58 | 58 | */ |
59 | - public function resize($imagePath='', $width='',$height='') |
|
59 | + public function resize($imagePath = '', $width = '', $height = '') |
|
60 | 60 | { |
61 | - $modifier = '-r' . $width . 'x' . $height; |
|
62 | - return $this->applyMethod('Resize', $imagePath, $width,$height, $modifier); |
|
61 | + $modifier = '-r'.$width.'x'.$height; |
|
62 | + return $this->applyMethod('Resize', $imagePath, $width, $height, $modifier); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | * @return string |
70 | 70 | * @throws \Exception |
71 | 71 | */ |
72 | - public function smartcrop($imagePath='', $width='',$height='') |
|
72 | + public function smartcrop($imagePath = '', $width = '', $height = '') |
|
73 | 73 | { |
74 | - $modifier = '-s' . $width . 'x' . $height; |
|
75 | - return $this->applyMethod('SmartCrop', $imagePath, $width,$height, $modifier); |
|
74 | + $modifier = '-s'.$width.'x'.$height; |
|
75 | + return $this->applyMethod('SmartCrop', $imagePath, $width, $height, $modifier); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | * @return string |
83 | 83 | * @throws \Exception |
84 | 84 | */ |
85 | - public function boxcrop($imagePath='', $width='',$height='') |
|
85 | + public function boxcrop($imagePath = '', $width = '', $height = '') |
|
86 | 86 | { |
87 | - $modifier = '-b' . $width . 'x' . $height; |
|
88 | - return $this->applyMethod('BoxCrop', $imagePath, $width,$height, $modifier); |
|
87 | + $modifier = '-b'.$width.'x'.$height; |
|
88 | + return $this->applyMethod('BoxCrop', $imagePath, $width, $height, $modifier); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @return string |
96 | 96 | */ |
97 | - private function modifyName($imagePath, $modifier='') |
|
97 | + private function modifyName($imagePath, $modifier = '') |
|
98 | 98 | { |
99 | 99 | $filename = basename($imagePath); |
100 | 100 | $path = dirname($imagePath); |
@@ -104,30 +104,30 @@ discard block |
||
104 | 104 | array_pop($fileParts); |
105 | 105 | $fileNameWithoutExtension = implode('-', $fileParts); |
106 | 106 | $fileNameWithoutExtension = StringUtil::slugify($fileNameWithoutExtension); |
107 | - $filename = $fileNameWithoutExtension . $modifier . '.' . $extension; |
|
107 | + $filename = $fileNameWithoutExtension.$modifier.'.'.$extension; |
|
108 | 108 | } else { |
109 | 109 | $filename = StringUtil::slugify($filename); |
110 | 110 | } |
111 | 111 | |
112 | - if (file_exists($path . '/' . $filename)) { |
|
112 | + if (file_exists($path.'/'.$filename)) { |
|
113 | 113 | $fileParts = explode('.', $filename); |
114 | 114 | if (count($fileParts) > 1) { |
115 | 115 | $extension = end($fileParts); |
116 | 116 | array_pop($fileParts); |
117 | 117 | $fileNameWithoutExtension = implode('-', $fileParts); |
118 | 118 | $fileNameWithoutExtension .= '-copy'; |
119 | - $filename = $fileNameWithoutExtension . '.' . $extension; |
|
119 | + $filename = $fileNameWithoutExtension.'.'.$extension; |
|
120 | 120 | } else { |
121 | 121 | $filename .= '-copy'; |
122 | 122 | } |
123 | - return $this->modifyName($path . '/' . $filename); |
|
123 | + return $this->modifyName($path.'/'.$filename); |
|
124 | 124 | } |
125 | - return $path . '/' . $filename; |
|
125 | + return $path.'/'.$filename; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | private function applyMethod($method, $imagePath, $width, $height, $modifier) |
129 | 129 | { |
130 | - $method = 'library\\images\\methods\\' . $method; |
|
130 | + $method = 'library\\images\\methods\\'.$method; |
|
131 | 131 | $destination = $this->modifyName($imagePath, $modifier); |
132 | 132 | if (file_exists($imagePath)) { |
133 | 133 | $image = new Image(); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $resizedImage->saveImage($destination, $resizedImage->getImageMimeType($imagePath), 80); |
142 | 142 | return basename($destination); |
143 | 143 | } else { |
144 | - throw new \Exception('Image doesnt exist: ' . $imagePath); |
|
144 | + throw new \Exception('Image doesnt exist: '.$imagePath); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | } |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | { |
38 | 38 | $debug_backtrace = current(debug_backtrace()); |
39 | 39 | if (PHP_SAPI == 'cli') { |
40 | - echo 'Dump: ' . $debug_backtrace['file'] . ':' . $debug_backtrace['line'] . "\n"; |
|
40 | + echo 'Dump: '.$debug_backtrace['file'].':'.$debug_backtrace['line']."\n"; |
|
41 | 41 | foreach (func_get_args() as $data) { |
42 | 42 | var_dump($data); |
43 | 43 | } |
44 | 44 | } else { |
45 | 45 | ob_clean(); |
46 | - echo '<div>Dump: ' . $debug_backtrace['file'] . ':<b>' . $debug_backtrace['line'] . "</b></div>"; |
|
46 | + echo '<div>Dump: '.$debug_backtrace['file'].':<b>'.$debug_backtrace['line']."</b></div>"; |
|
47 | 47 | echo '<pre>'; |
48 | 48 | foreach (func_get_args() as $data) { |
49 | 49 | echo "<code>"; |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | */ |
92 | 92 | function utf8Convert($array) |
93 | 93 | { |
94 | - array_walk_recursive($array, function(&$item){ |
|
95 | - if(!mb_detect_encoding($item, 'utf-8', true)){ |
|
94 | + array_walk_recursive($array, function(&$item) { |
|
95 | + if (!mb_detect_encoding($item, 'utf-8', true)) { |
|
96 | 96 | $item = utf8_encode($item); |
97 | 97 | } |
98 | 98 | }); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | public static function slugify($str, $replace = array(), $delimiter = '-') |
21 | 21 | { |
22 | 22 | if (!empty($replace)) { |
23 | - $str = str_replace((array)$replace, ' ', $str); |
|
23 | + $str = str_replace((array) $replace, ' ', $str); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); |
@@ -79,13 +79,13 @@ discard block |
||
79 | 79 | public static function humanFileSize($size, $unit = "") |
80 | 80 | { |
81 | 81 | if ((!$unit && $size >= 1 << 30) || $unit == "GB") |
82 | - return number_format($size / (1 << 30), 2) . "GB"; |
|
82 | + return number_format($size / (1 << 30), 2)."GB"; |
|
83 | 83 | if ((!$unit && $size >= 1 << 20) || $unit == "MB") |
84 | - return number_format($size / (1 << 20), 2) . "MB"; |
|
84 | + return number_format($size / (1 << 20), 2)."MB"; |
|
85 | 85 | if ((!$unit && $size >= 1 << 10) || $unit == "KB") |
86 | - return number_format($size / (1 << 10), 2) . "KB"; |
|
86 | + return number_format($size / (1 << 10), 2)."KB"; |
|
87 | 87 | |
88 | - return number_format($size) . " bytes"; |
|
88 | + return number_format($size)." bytes"; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if ($d >= 1) { |
122 | 122 | $r = round($d); |
123 | 123 | |
124 | - return $r . ' ' . ($r > 1 ? $a_plural[$str] : $str) . ' ago'; |
|
124 | + return $r.' '.($r > 1 ? $a_plural[$str] : $str).' ago'; |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 |
@@ -78,12 +78,15 @@ |
||
78 | 78 | */ |
79 | 79 | public static function humanFileSize($size, $unit = "") |
80 | 80 | { |
81 | - if ((!$unit && $size >= 1 << 30) || $unit == "GB") |
|
82 | - return number_format($size / (1 << 30), 2) . "GB"; |
|
83 | - if ((!$unit && $size >= 1 << 20) || $unit == "MB") |
|
84 | - return number_format($size / (1 << 20), 2) . "MB"; |
|
85 | - if ((!$unit && $size >= 1 << 10) || $unit == "KB") |
|
86 | - return number_format($size / (1 << 10), 2) . "KB"; |
|
81 | + if ((!$unit && $size >= 1 << 30) || $unit == "GB") { |
|
82 | + return number_format($size / (1 << 30), 2) . "GB"; |
|
83 | + } |
|
84 | + if ((!$unit && $size >= 1 << 20) || $unit == "MB") { |
|
85 | + return number_format($size / (1 << 20), 2) . "MB"; |
|
86 | + } |
|
87 | + if ((!$unit && $size >= 1 << 10) || $unit == "KB") { |
|
88 | + return number_format($size / (1 << 10), 2) . "KB"; |
|
89 | + } |
|
87 | 90 | |
88 | 91 | return number_format($size) . " bytes"; |
89 | 92 | } |
@@ -10,22 +10,22 @@ |
||
10 | 10 | <div class="show-image"> |
11 | 11 | <label>File</label> |
12 | 12 | <div class="value"> |
13 | - <?=isset($image)? $image->file : '' ?> |
|
13 | + <?=isset($image) ? $image->file : '' ?> |
|
14 | 14 | </div> |
15 | 15 | <label>Type</label> |
16 | 16 | <div class="value"> |
17 | - <?=isset($image)? $image->type : '' ?> |
|
17 | + <?=isset($image) ? $image->type : '' ?> |
|
18 | 18 | </div> |
19 | 19 | <label>Size</label> |
20 | 20 | <div class="value"> |
21 | - <?=isset($image)? \library\cc\StringUtil::humanFileSize($image->size) : '' ?> |
|
21 | + <?=isset($image) ? \library\cc\StringUtil::humanFileSize($image->size) : '' ?> |
|
22 | 22 | </div> |
23 | 23 | <label>Set</label> |
24 | 24 | <? if (isset($image)) : ?> |
25 | 25 | <? foreach ($image->set as $key => $set) : ?> |
26 | 26 | <div class="sets"> |
27 | 27 | <label><?=$key?></label> |
28 | - <img src="<?=\library\cc\Request::$subfolders . 'images/' . $set?>" /> |
|
28 | + <img src="<?=\library\cc\Request::$subfolders.'images/'.$set?>" /> |
|
29 | 29 | </div> |
30 | 30 | <? endforeach ?> |
31 | 31 | <? endif ?> |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | protected function applyFilters($tokens) |
47 | 47 | { |
48 | 48 | foreach ($this->filters as $filterName) { |
49 | - $filterClassName = '\library\search\filters\\' . $filterName; |
|
49 | + $filterClassName = '\library\search\filters\\'.$filterName; |
|
50 | 50 | $filter = new $filterClassName($tokens); |
51 | 51 | $tokens = $filter->getFilterResults(); |
52 | 52 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | foreach ($documentTermCount as $field => $countArray) { |
67 | 67 | $quotedField = $db->quote($field); |
68 | 68 | foreach ($countArray as $term => $count) { |
69 | - $values[] = $quotedDocumentPath . ', ' . $db->quote($term) . ', ' . $db->quote($count) . ', ' . $quotedField; |
|
69 | + $values[] = $quotedDocumentPath.', '.$db->quote($term).', '.$db->quote($count).', '.$quotedField; |
|
70 | 70 | $i += 1; |
71 | 71 | if ($i >= Indexer::SQLITE_MAX_COMPOUND_SELECT) { |
72 | 72 | $this->executeStoreDocumentTermCount($values, $sql, $db); |
@@ -90,13 +90,13 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function executeStoreDocumentTermCount($values, $sql, $db) |
92 | 92 | { |
93 | - $sql .= '(' . implode('),' . PHP_EOL . '(', $values) . ');'; |
|
93 | + $sql .= '('.implode('),'.PHP_EOL.'(', $values).');'; |
|
94 | 94 | |
95 | 95 | $stmt = $db->prepare($sql); |
96 | 96 | if ($stmt === false || !$stmt->execute()) { |
97 | 97 | $errorInfo = $db->errorInfo(); |
98 | 98 | $errorMsg = $errorInfo[2]; |
99 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
99 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 |