@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | $this->source = $this->_content->source; |
98 | - $this->views = $this->_content->views+1; |
|
98 | + $this->views = $this->_content->views + 1; |
|
99 | 99 | // check for dependence, add '' for general cat, ex: general/depend1/depend2/.../depend-n |
100 | 100 | $catNestingArray = Arr::merge([0 => ''], explode('/', $this->catPath)); |
101 | 101 | if ($catNestingArray > 1) { |
@@ -127,15 +127,15 @@ discard block |
||
127 | 127 | ]; |
128 | 128 | |
129 | 129 | // get gallery images and poster data |
130 | - $galleryPath = '/upload/gallery/' . $this->_content->id; |
|
130 | + $galleryPath = '/upload/gallery/'.$this->_content->id; |
|
131 | 131 | // check if gallery folder is exist |
132 | 132 | if (Directory::exist($galleryPath)) { |
133 | - $originImages = File::listFiles($galleryPath . '/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true); |
|
133 | + $originImages = File::listFiles($galleryPath.'/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true); |
|
134 | 134 | // generate poster data |
135 | 135 | if (Arr::in($this->_content->poster, $originImages)) { |
136 | 136 | // original poster |
137 | 137 | $posterName = $this->_content->poster; |
138 | - $this->posterFull = $galleryPath . '/orig/' . $posterName; |
|
138 | + $this->posterFull = $galleryPath.'/orig/'.$posterName; |
|
139 | 139 | if (!File::exist($this->posterFull)) { |
140 | 140 | $this->posterFull = null; |
141 | 141 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $posterSplit = explode('.', $posterName); |
144 | 144 | array_pop($posterSplit); |
145 | 145 | $posterCleanName = implode('.', $posterSplit); |
146 | - $this->posterThumb = $galleryPath . '/thumb/' . $posterCleanName . '.jpg'; |
|
146 | + $this->posterThumb = $galleryPath.'/thumb/'.$posterCleanName.'.jpg'; |
|
147 | 147 | if (!File::exist($this->posterThumb)) { |
148 | 148 | $this->posterThumb = null; |
149 | 149 | } |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | if (Str::startsWith($imageClearName, $this->_content->poster)) { |
159 | 159 | continue; |
160 | 160 | } |
161 | - $thumbPath = $galleryPath . '/thumb/' . $imageClearName . '.jpg'; |
|
161 | + $thumbPath = $galleryPath.'/thumb/'.$imageClearName.'.jpg'; |
|
162 | 162 | if (File::exist($thumbPath)) { |
163 | - $this->galleryItems[$thumbPath] = $galleryPath . '/orig/' . $image; |
|
163 | + $this->galleryItems[$thumbPath] = $galleryPath.'/orig/'.$image; |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $this->rating = $this->_content->rating; |
170 | 170 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
171 | 171 | $this->canRate = true; |
172 | - if (Obj::isArray($ignoredRate) && Arr::in((string)$this->id, $ignoredRate)) { |
|
172 | + if (Obj::isArray($ignoredRate) && Arr::in((string) $this->id, $ignoredRate)) { |
|
173 | 173 | $this->canRate = false; |
174 | 174 | } |
175 | 175 | if (!App::$User->isAuth()) { |
@@ -77,7 +77,7 @@ |
||
77 | 77 | $this->items[] = [ |
78 | 78 | 'title' => $item->getLocaled('title'), |
79 | 79 | 'snippet' => Text::snippet($text), |
80 | - 'uri' => '/content/read/' . $item->getPath(), |
|
80 | + 'uri' => '/content/read/'.$item->getPath(), |
|
81 | 81 | 'thumb' => $item->getPosterThumbUri() |
82 | 82 | ]; |
83 | 83 | } |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | $objectTemplate = null; |
30 | 30 | |
31 | 31 | if ($singleName) { |
32 | - $objectDirPath = root . '/Apps/' . $type . '/'; |
|
33 | - $objectNamespace = 'Apps\\' . $type; |
|
32 | + $objectDirPath = root.'/Apps/'.$type.'/'; |
|
33 | + $objectNamespace = 'Apps\\'.$type; |
|
34 | 34 | $objectName = ucfirst($name); |
35 | 35 | } else { |
36 | 36 | $split = explode('/', $name); |
@@ -47,46 +47,46 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | if ($type === 'Widget') { |
50 | - $objectDirPath = root . '/Widgets/' . $workground; |
|
51 | - $objectNamespace = 'Widgets\\' . $workground; |
|
50 | + $objectDirPath = root.'/Widgets/'.$workground; |
|
51 | + $objectNamespace = 'Widgets\\'.$workground; |
|
52 | 52 | } else { |
53 | - $objectDirPath = root . '/Apps/' . $type . '/' . $workground; |
|
54 | - $objectNamespace = 'Apps\\' . $type . '\\' . $workground; |
|
53 | + $objectDirPath = root.'/Apps/'.$type.'/'.$workground; |
|
54 | + $objectNamespace = 'Apps\\'.$type.'\\'.$workground; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | if (false !== $subName) { |
58 | - $objectDirPath .= '/' . implode('/', $subName); |
|
59 | - $objectNamespace .= '\\' . implode('\\', $subName); |
|
58 | + $objectDirPath .= '/'.implode('/', $subName); |
|
59 | + $objectNamespace .= '\\'.implode('\\', $subName); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | // try to find workground-based controller |
64 | - if (File::exist('/Private/Carcase/' . $workground . '/' . $type . '.tphp')) { |
|
65 | - $objectTemplate = File::read('/Private/Carcase/' . $workground . '/' . $type . '.tphp'); |
|
64 | + if (File::exist('/Private/Carcase/'.$workground.'/'.$type.'.tphp')) { |
|
65 | + $objectTemplate = File::read('/Private/Carcase/'.$workground.'/'.$type.'.tphp'); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | 69 | if (!Directory::exist($objectDirPath) && !Directory::create($objectDirPath)) { |
70 | - $this->message = 'Directory could not be created: ' . $objectDirPath; |
|
70 | + $this->message = 'Directory could not be created: '.$objectDirPath; |
|
71 | 71 | return false; |
72 | 72 | } |
73 | 73 | |
74 | 74 | if ($objectTemplate === null) { |
75 | - $objectTemplate = File::read('/Private/Carcase/' . $type . '.tphp'); |
|
75 | + $objectTemplate = File::read('/Private/Carcase/'.$type.'.tphp'); |
|
76 | 76 | if (false === $objectTemplate) { |
77 | - $this->message = 'Php template file is not founded: /Private/Carcase/' . $type . '.tphp'; |
|
77 | + $this->message = 'Php template file is not founded: /Private/Carcase/'.$type.'.tphp'; |
|
78 | 78 | return false; |
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | 82 | $objectContent = Str::replace(['%namespace%', '%name%'], [$objectNamespace, $objectName], $objectTemplate); |
83 | - $objectFullPath = $objectDirPath . '/' . $objectName . '.php'; |
|
83 | + $objectFullPath = $objectDirPath.'/'.$objectName.'.php'; |
|
84 | 84 | if (File::exist($objectFullPath)) { |
85 | - $this->message = $type . ' is always exist: ' . $objectFullPath; |
|
85 | + $this->message = $type.' is always exist: '.$objectFullPath; |
|
86 | 86 | return false; |
87 | 87 | } |
88 | 88 | File::write($objectFullPath, $objectContent); |
89 | - $this->message = $type . ' template was created: [' . $objectName . '] in path: ' . Str::replace(root, '', $objectDirPath); |
|
89 | + $this->message = $type.' template was created: ['.$objectName.'] in path: '.Str::replace(root, '', $objectDirPath); |
|
90 | 90 | return true; |
91 | 91 | } |
92 | 92 | } |
93 | 93 | \ No newline at end of file |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->beginTime = time(); |
34 | 34 | |
35 | 35 | $this->signatures = new \DOMDocument(); |
36 | - $this->signatures->load(root . '/Private/Antivirus/Signatures.xml'); |
|
36 | + $this->signatures->load(root.'/Private/Antivirus/Signatures.xml'); |
|
37 | 37 | |
38 | 38 | // list of files is not prepared, 1st iteration |
39 | 39 | if (!File::exist('/Private/Antivirus/ScanFiles.json')) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | $this->scanFiles = json_decode(File::read('/Private/Antivirus/ScanFiles.json')); |
48 | 48 | if (File::exist('/Private/Antivirus/Infected.json')) { |
49 | - $this->infected = (array)json_decode(File::read('/Private/Antivirus/Infected.json')); |
|
49 | + $this->infected = (array) json_decode(File::read('/Private/Antivirus/Infected.json')); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | |
109 | 109 | switch ($attrFormat) { |
110 | 110 | case 're': |
111 | - if ((preg_match('#(' . $sigContent . ')#smi', $content, $found, PREG_OFFSET_CAPTURE)) || |
|
112 | - (preg_match('#(' . $sigContent . ')#smi', $normalized, $found, PREG_OFFSET_CAPTURE)) |
|
111 | + if ((preg_match('#('.$sigContent.')#smi', $content, $found, PREG_OFFSET_CAPTURE)) || |
|
112 | + (preg_match('#('.$sigContent.')#smi', $normalized, $found, PREG_OFFSET_CAPTURE)) |
|
113 | 113 | ) { |
114 | 114 | $detected = true; |
115 | 115 | $pos = $found[0][1]; |
116 | 116 | $this->infected[$path][] = [ |
117 | - 'pos' => (int)$pos, |
|
117 | + 'pos' => (int) $pos, |
|
118 | 118 | 'sigId' => $attrId, |
119 | 119 | 'sigRule' => $sigContent, |
120 | 120 | 'sever' => $attrSever, |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | (($pos = strpos($normalized, $sigContent)) !== false) |
129 | 129 | ) { |
130 | 130 | $this->infected[$path][] = [ |
131 | - 'pos' => (int)$pos, |
|
131 | + 'pos' => (int) $pos, |
|
132 | 132 | 'sigId' => $attrId, |
133 | 133 | 'sigRule' => $sigContent, |
134 | 134 | 'sever' => $attrSever, |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | private function prepareScanlist() |
150 | 150 | { |
151 | - $files = (object)File::listFiles(root, $this->affectedExt); |
|
151 | + $files = (object) File::listFiles(root, $this->affectedExt); |
|
152 | 152 | File::write('/Private/Antivirus/ScanFiles.json', json_encode($files)); |
153 | 153 | } |
154 | 154 |
@@ -71,14 +71,14 @@ |
||
71 | 71 | $cfg['database'] = $this->db; |
72 | 72 | $cfg['adminEmail'] = $this->email; |
73 | 73 | $cfg['singleLanguage'] = $this->singleLanguage; |
74 | - $cfg['multiLanguage'] = (bool)$this->multiLanguage; |
|
75 | - $cfg['passwordSalt'] = '$2a$07$' . Str::randomLatinNumeric(mt_rand(21, 30)) . '$'; |
|
76 | - $cfg['debug']['cookie']['key'] = 'fdebug_' . Str::randomLatinNumeric(mt_rand(4, 16)); |
|
74 | + $cfg['multiLanguage'] = (bool) $this->multiLanguage; |
|
75 | + $cfg['passwordSalt'] = '$2a$07$'.Str::randomLatinNumeric(mt_rand(21, 30)).'$'; |
|
76 | + $cfg['debug']['cookie']['key'] = 'fdebug_'.Str::randomLatinNumeric(mt_rand(4, 16)); |
|
77 | 77 | $cfg['debug']['cookie']['value'] = Str::randomLatinNumeric(mt_rand(32, 128)); |
78 | 78 | |
79 | 79 | // import database tables |
80 | 80 | $connectName = 'install'; |
81 | - include(root . '/Private/Database/install.php'); |
|
81 | + include(root.'/Private/Database/install.php'); |
|
82 | 82 | |
83 | 83 | // insert admin user |
84 | 84 | $user = new User(); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function actionIndex() |
33 | 33 | { |
34 | 34 | // set current page and offset |
35 | - $page = (int)App::$Request->query->get('page'); |
|
35 | + $page = (int) App::$Request->query->get('page'); |
|
36 | 36 | $offset = $page * self::ITEM_PER_PAGE; |
37 | 37 | |
38 | 38 | // get feedback posts AR table |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | // initialize model with answer add if thread is not closed |
75 | 75 | $model = null; |
76 | - if ((int)$record->closed !== 1) { |
|
76 | + if ((int) $record->closed !== 1) { |
|
77 | 77 | $model = new FormAnswerAdd($record, App::$User->identity()->getId()); |
78 | 78 | if ($model->send()) { |
79 | 79 | if ($model->validate()) { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | case 'answer': |
105 | 105 | $record = FeedbackAnswer::find($id); |
106 | 106 | if ($record !== null && $record !== false) { |
107 | - $postId = (int)$record->getFeedbackPost()->id; |
|
107 | + $postId = (int) $record->getFeedbackPost()->id; |
|
108 | 108 | } |
109 | 109 | break; |
110 | 110 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | if ($model->validate()) { |
121 | 121 | $model->make(); |
122 | 122 | App::$Session->getFlashBag()->add('success', __('Feedback item are successful changed')); |
123 | - App::$Response->redirect('feedback/read/' . $postId); |
|
123 | + App::$Response->redirect('feedback/read/'.$postId); |
|
124 | 124 | } else { |
125 | 125 | App::$Session->getFlashBag()->add('danger', __('Updating is failed')); |
126 | 126 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | App::$Session->getFlashBag()->add('success', __('Feedback request is changed!')); |
171 | 171 | |
172 | 172 | // redirect to feedback post read |
173 | - App::$Response->redirect('feedback/read/' . $id); |
|
173 | + App::$Response->redirect('feedback/read/'.$id); |
|
174 | 174 | return null; |
175 | 175 | } |
176 | 176 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | // its a answer, lets remove it and redirect back in post |
215 | 215 | $postId = $record->feedback_id; |
216 | 216 | $record->delete(); |
217 | - App::$Response->redirect('feedback/read/' . $postId); |
|
217 | + App::$Response->redirect('feedback/read/'.$postId); |
|
218 | 218 | } |
219 | 219 | } |
220 | 220 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $query = new ProfileRecords(); |
33 | 33 | |
34 | 34 | // set current page and offset |
35 | - $page = (int)App::$Request->query->get('page'); |
|
35 | + $page = (int) App::$Request->query->get('page'); |
|
36 | 36 | $offset = $page * self::ITEM_PER_PAGE; |
37 | 37 | |
38 | 38 | // build pagination |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function actionDelete($id) |
61 | 61 | { |
62 | - App::$Response->redirect('user/delete/' . $id); |
|
62 | + App::$Response->redirect('user/delete/'.$id); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function actionIndex() |
39 | 39 | { |
40 | 40 | // set current page and offset |
41 | - $page = (int)App::$Request->query->get('page'); |
|
41 | + $page = (int) App::$Request->query->get('page'); |
|
42 | 42 | $offset = $page * self::ITEM_PER_PAGE; |
43 | 43 | |
44 | 44 | $query = null; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ($type === 'trash') { |
48 | 48 | $query = ContentEntity::onlyTrashed(); |
49 | 49 | } elseif (Obj::isLikeInt($type)) { // sounds like category id ;) |
50 | - $query = ContentEntity::where('category_id', '=', (int)$type); |
|
50 | + $query = ContentEntity::where('category_id', '=', (int) $type); |
|
51 | 51 | } else { |
52 | 52 | $query = new ContentEntity(); |
53 | 53 | $type = 'all'; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | if ($model->send() && $model->validate()) { |
194 | 194 | // remove all trashed items |
195 | 195 | foreach ($records->get() as $item) { |
196 | - $galleryPath = '/upload/gallery/' . (int)$item->id; |
|
196 | + $galleryPath = '/upload/gallery/'.(int) $item->id; |
|
197 | 197 | if (Directory::exist($galleryPath)) { |
198 | 198 | Directory::remove($galleryPath); |
199 | 199 | } |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | public function actionCategoryupdate($id = null) |
266 | 266 | { |
267 | 267 | // get owner id for new rows |
268 | - $parentId = (int)App::$Request->query->get('parent'); |
|
268 | + $parentId = (int) App::$Request->query->get('parent'); |
|
269 | 269 | |
270 | 270 | // get relation and pass to model |
271 | 271 | $record = ContentCategory::findOrNew($id); |
@@ -25,6 +25,6 @@ |
||
25 | 25 | |
26 | 26 | public function actionRead($id) |
27 | 27 | { |
28 | - echo "Action read called" . $id; |
|
28 | + echo "Action read called".$id; |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | \ No newline at end of file |