@@ -57,7 +57,7 @@ |
||
57 | 57 | $values = array(); |
58 | 58 | $i = 0; |
59 | 59 | foreach ($uniqueFieldsPerDocument as $fieldRow) { |
60 | - $values[] = 'UPDATE term_frequency SET termNorm = 1/sqrt(' . (int)$fieldRow->termCount . ') WHERE documentPath = ' . $db->quote($fieldRow->documentPath) . ' AND field = ' . $db->quote($fieldRow->field) . ';'; |
|
60 | + $values[] = 'UPDATE term_frequency SET termNorm = 1/sqrt(' . (int) $fieldRow->termCount . ') WHERE documentPath = ' . $db->quote($fieldRow->documentPath) . ' AND field = ' . $db->quote($fieldRow->field) . ';'; |
|
61 | 61 | $i += 1; |
62 | 62 | if ($i >= Indexer::SQLITE_MAX_COMPOUND_SELECT) { |
63 | 63 | $this->executeUpdateTermNorm($values, $db); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $documentObj->documentTypeSlug = $documentType->slug; |
54 | 54 | $documentObj->state = isset($postValues['state']) ? 'published' : 'unpublished'; |
55 | 55 | $documentObj->lastModificationDate = time(); |
56 | - $documentObj->creationDate = isset($postValues['creationDate']) ? (int)$postValues['creationDate'] : time(); |
|
56 | + $documentObj->creationDate = isset($postValues['creationDate']) ? (int) $postValues['creationDate'] : time(); |
|
57 | 57 | $documentObj->lastModifiedBy = $_SESSION['cloudcontrol']->username; |
58 | 58 | |
59 | 59 | return $documentObj; |
@@ -240,7 +240,7 @@ |
||
240 | 240 | if (!is_array($result)) { |
241 | 241 | return 0; |
242 | 242 | } |
243 | - return (int)current($result); |
|
243 | + return (int) current($result); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
@@ -61,7 +61,7 @@ |
||
61 | 61 | } elseif ($mimeTypeConstantValue == IMAGETYPE_JPEG) { |
62 | 62 | return imagejpeg($imageResource, $path, $quality); |
63 | 63 | } elseif ($mimeTypeConstantValue == IMAGETYPE_PNG) { |
64 | - return imagepng($imageResource, $path, ((int)($quality / 10) - 1)); |
|
64 | + return imagepng($imageResource, $path, ((int) ($quality / 10) - 1)); |
|
65 | 65 | } else { |
66 | 66 | throw new \Exception('Not a valid mimetypeconstant given see function documentation'); |
67 | 67 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function SetTransparency($transparency) |
39 | 39 | { |
40 | - $this->_transparency = (int)$transparency; |
|
40 | + $this->_transparency = (int) $transparency; |
|
41 | 41 | return $this; |
42 | 42 | } |
43 | 43 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected function calculateX($imageResource) |
65 | 65 | { |
66 | - if ((int)$this->_x === $this->_x) return $this->_x; |
|
66 | + if ((int) $this->_x === $this->_x) return $this->_x; |
|
67 | 67 | |
68 | 68 | $x = strtolower($this->_x); |
69 | 69 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | } elseif ($x == 'right') { |
78 | 78 | $x = $imageWidth - $watermarkWidth; |
79 | 79 | } |
80 | - return (int)$x; |
|
80 | + return (int) $x; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function calculateY($imageResource) |
90 | 90 | { |
91 | - if ((int)$this->_y === $this->_y) return $this->_y; |
|
91 | + if ((int) $this->_y === $this->_y) return $this->_y; |
|
92 | 92 | |
93 | 93 | $y = strtolower($this->_y); |
94 | 94 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } elseif ($y == 'bottom') { |
103 | 103 | $y = $imageHeight - $watermarkHeight; |
104 | 104 | } |
105 | - return (int)$y; |
|
105 | + return (int) $y; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -63,7 +63,9 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected function calculateX($imageResource) |
65 | 65 | { |
66 | - if ((int)$this->_x === $this->_x) return $this->_x; |
|
66 | + if ((int)$this->_x === $this->_x) { |
|
67 | + return $this->_x; |
|
68 | + } |
|
67 | 69 | |
68 | 70 | $x = strtolower($this->_x); |
69 | 71 | |
@@ -88,7 +90,9 @@ discard block |
||
88 | 90 | */ |
89 | 91 | public function calculateY($imageResource) |
90 | 92 | { |
91 | - if ((int)$this->_y === $this->_y) return $this->_y; |
|
93 | + if ((int)$this->_y === $this->_y) { |
|
94 | + return $this->_y; |
|
95 | + } |
|
92 | 96 | |
93 | 97 | $y = strtolower($this->_y); |
94 | 98 | |
@@ -125,7 +129,9 @@ discard block |
||
125 | 129 | */ |
126 | 130 | public function GetWatermark() |
127 | 131 | { |
128 | - if ($this->_watermark == null) throw new \Exception('A watermark is not set. Please supply a \CloudControl\Cms\image\Image using $this->SetWatermark'); |
|
132 | + if ($this->_watermark == null) { |
|
133 | + throw new \Exception('A watermark is not set. Please supply a \CloudControl\Cms\image\Image using $this->SetWatermark'); |
|
134 | + } |
|
129 | 135 | return $this->_watermark; |
130 | 136 | } |
131 | 137 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function SetWidth($width) |
28 | 28 | { |
29 | - $this->_width = (int)$width; |
|
29 | + $this->_width = (int) $width; |
|
30 | 30 | return $this; |
31 | 31 | } |
32 | 32 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function SetHeight($height) |
40 | 40 | { |
41 | - $this->_height = (int)$height; |
|
41 | + $this->_height = (int) $height; |
|
42 | 42 | return $this; |
43 | 43 | } |
44 | 44 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function SetPreserveAspectRatio($bool) |
53 | 53 | { |
54 | - $this->_preserveAspectRatio = (bool)$bool; |
|
54 | + $this->_preserveAspectRatio = (bool) $bool; |
|
55 | 55 | return $this; |
56 | 56 | } |
57 | 57 |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function SetWidth($width) |
43 | 43 | { |
44 | - $this->_width = (int)$width; |
|
45 | - $this->_destWidth = (int)$width; |
|
44 | + $this->_width = (int) $width; |
|
45 | + $this->_destWidth = (int) $width; |
|
46 | 46 | return $this; |
47 | 47 | } |
48 | 48 | |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function SetHeight($height) |
56 | 56 | { |
57 | - $this->_height = (int)$height; |
|
58 | - $this->_destHeight = (int)$height; |
|
57 | + $this->_height = (int) $height; |
|
58 | + $this->_destHeight = (int) $height; |
|
59 | 59 | return $this; |
60 | 60 | } |
61 | 61 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function FillBackground($r, $g, $b) |
97 | 97 | { |
98 | - $this->_backgroundColor = array((int)$r, (int)$g, (int)$b); |
|
98 | + $this->_backgroundColor = array((int) $r, (int) $g, (int) $b); |
|
99 | 99 | return $this; |
100 | 100 | } |
101 | 101 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | - * @param $path |
|
42 | + * @param string $path |
|
43 | 43 | * @return \stdClass |
44 | 44 | */ |
45 | 45 | public function getCacheForPath($path) |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
117 | - * @param $requestUri |
|
117 | + * @param string $requestUri |
|
118 | 118 | * @param $renderedContent |
119 | 119 | */ |
120 | 120 | public function setCacheForPath($requestUri, $renderedContent) |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | - * @param $request |
|
59 | + * @param Request $request |
|
60 | 60 | * @param CmsComponent $cmsComponent |
61 | 61 | * |
62 | 62 | * @throws \Exception |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * @param $request |
|
94 | + * @param Request $request |
|
95 | 95 | * @param CmsComponent $cmsComponent |
96 | 96 | * @throws \Exception |
97 | 97 | */ |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
129 | - * @param $request |
|
129 | + * @param Request $request |
|
130 | 130 | * @param CmsComponent $cmsComponent |
131 | 131 | * @throws \Exception |
132 | 132 | */ |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
151 | - * @param $request |
|
151 | + * @param Request $request |
|
152 | 152 | * @param CmsComponent $cmsComponent |
153 | 153 | */ |
154 | 154 | private function deleteDocumentRoute($request, $cmsComponent) |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
163 | - * @param $request |
|
163 | + * @param Request $request |
|
164 | 164 | * @param CmsComponent $cmsComponent |
165 | 165 | */ |
166 | 166 | private function publishDocumentRoute($request, $cmsComponent) |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
174 | - * @param $request |
|
174 | + * @param Request $request |
|
175 | 175 | * @param CmsComponent $cmsComponent |
176 | 176 | */ |
177 | 177 | private function unpublishDocumentRoute($request, $cmsComponent) |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | |
226 | 226 | /** |
227 | 227 | * @param $request |
228 | - * @param $cmsComponent |
|
228 | + * @param CmsComponent $cmsComponent |
|
229 | 229 | * @param string $param |
230 | 230 | */ |
231 | 231 | private function doAfterPublishRedirect($request, $cmsComponent, $param = 'published') |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | /** |
242 | 242 | * @param $request |
243 | - * @param $cmsComponent |
|
243 | + * @param CmsComponent $cmsComponent |
|
244 | 244 | * @param string $icon |
245 | 245 | * @param string $activity |
246 | 246 | */ |
@@ -249,6 +249,6 @@ |
||
249 | 249 | Cache::getInstance()->clearCache(); |
250 | 250 | $path = $request::$get[CmsConstants::GET_PARAMETER_SLUG]; |
251 | 251 | $docLink = $request::$subfolders . $cmsComponent->getParameter(CmsConstants::PARAMETER_CMS_PREFIX) . '/documents/edit-document?slug=' . $path; |
252 | - $cmsComponent->storage->getActivityLog()->add($activity. ' document <a href="' . $docLink . '">' . $request::$get[CmsConstants::GET_PARAMETER_SLUG] . '</a>', $icon); |
|
252 | + $cmsComponent->storage->getActivityLog()->add($activity . ' document <a href="' . $docLink . '">' . $request::$get[CmsConstants::GET_PARAMETER_SLUG] . '</a>', $icon); |
|
253 | 253 | } |
254 | 254 | } |
255 | 255 | \ No newline at end of file |