@@ -52,7 +52,7 @@ |
||
| 52 | 52 | public function save() |
| 53 | 53 | { |
| 54 | 54 | // check if target is myself or always exist in block list |
| 55 | - if ($this->_user->getId() === (int)$this->id || Blacklist::have($this->_user->getId(), $this->id)) { |
|
| 55 | + if ($this->_user->getId() === (int) $this->id || Blacklist::have($this->_user->getId(), $this->id)) { |
|
| 56 | 56 | return false; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return array ( |
|
| 3 | +return array( |
|
| 4 | 4 | 0 => 'global/write', |
| 5 | 5 | 1 => 'global/modify', |
| 6 | 6 | 2 => 'global/file', |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | public function before() |
| 34 | 34 | { |
| 35 | 35 | // get full name of update object |
| 36 | - $class = 'Apps\Controller\Admin\\' . $this->_record->sys_name; |
|
| 36 | + $class = 'Apps\Controller\Admin\\'.$this->_record->sys_name; |
|
| 37 | 37 | if (class_exists($class)) { |
| 38 | 38 | $this->_callback = $class; |
| 39 | 39 | } else { |
@@ -62,8 +62,8 @@ |
||
| 62 | 62 | ]; |
| 63 | 63 | |
| 64 | 64 | foreach (App::$Properties->get('languages') as $lang) { |
| 65 | - $rules[] = ['name.' . $lang, 'required']; |
|
| 66 | - $rules[] = ['name.' . $lang, 'length_max', 50]; |
|
| 65 | + $rules[] = ['name.'.$lang, 'required']; |
|
| 66 | + $rules[] = ['name.'.$lang, 'length_max', 50]; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | return $rules; |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | $configData = [ |
| 59 | 59 | ucfirst(Str::lowerCase($this->type)) => [ |
| 60 | 60 | ucfirst(Str::lowerCase($this->loader)) => [ |
| 61 | - '/' . trim($this->source, '/') => '/' . trim($this->target, '/') |
|
| 61 | + '/'.trim($this->source, '/') => '/'.trim($this->target, '/') |
|
| 62 | 62 | ] |
| 63 | 63 | ] |
| 64 | 64 | ]; |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | // prepare source path |
| 50 | 50 | if ($this->type === 'Alias') { |
| 51 | - $this->source = '/' . trim($this->source, '/'); |
|
| 51 | + $this->source = '/'.trim($this->source, '/'); |
|
| 52 | 52 | } else { |
| 53 | 53 | $this->source = ucfirst($this->source); |
| 54 | 54 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | public function copyFile(iUser $user) |
| 48 | 48 | { |
| 49 | 49 | // move file to original folder |
| 50 | - $upload = $this->file->move(root . '/upload/user/avatar/original/', $user->id . '.' . $this->file->guessExtension()); |
|
| 50 | + $upload = $this->file->move(root.'/upload/user/avatar/original/', $user->id.'.'.$this->file->guessExtension()); |
|
| 51 | 51 | |
| 52 | 52 | try { |
| 53 | 53 | // big image |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $image = new Image(); |
| 85 | - $image->setCacheDir(root . '/Private/Cache/images'); |
|
| 85 | + $image->setCacheDir(root.'/Private/Cache/images'); |
|
| 86 | 86 | |
| 87 | 87 | $image->open($original->getPathname()) |
| 88 | 88 | ->cropResize($sizeConvert[$size][0], $sizeConvert[$size][1]) |
| 89 | - ->save(root . '/upload/user/avatar/' . $size . '/' . $user_id . '.jpg', 'jpg', static::COMPRESS_QUALITY); |
|
| 89 | + ->save(root.'/upload/user/avatar/'.$size.'/'.$user_id.'.jpg', 'jpg', static::COMPRESS_QUALITY); |
|
| 90 | 90 | |
| 91 | 91 | return null; |
| 92 | 92 | } |
@@ -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 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | // build path and check is file exists on disk |
| 98 | - $path = '/upload/gallery/' . $this->id . '/orig/' . $pName; |
|
| 98 | + $path = '/upload/gallery/'.$this->id.'/orig/'.$pName; |
|
| 99 | 99 | if (!File::exist($path)) { |
| 100 | 100 | return null; |
| 101 | 101 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | // remove extension, thumbs always in jpeg ;D |
| 118 | 118 | $pName = Str::cleanExtension($pName); |
| 119 | - $path = '/upload/gallery/' . $this->id . '/thumb/' . $pName . '.jpg'; |
|
| 119 | + $path = '/upload/gallery/'.$this->id.'/thumb/'.$pName.'.jpg'; |
|
| 120 | 120 | |
| 121 | 121 | if (!File::exist($path)) { |
| 122 | 122 | return null; |