@@ -76,7 +76,7 @@ |
||
| 76 | 76 | public function offsetSet($offset, $value) |
| 77 | 77 | { |
| 78 | 78 | $this->load(); |
| 79 | - $this->pages[$offset] = $value; |
|
| 79 | + $this->pages[$offset] = $value; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | public function offsetUnset($offset) |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class Plugin extends AbstractPlugin |
| 23 | 23 | { |
| 24 | - const HANDLER_ERROR_LOG = 'error_log'; |
|
| 25 | - const HANDLER_DEVELOPMENT = 'development'; |
|
| 24 | + const HANDLER_ERROR_LOG = 'error_log'; |
|
| 25 | + const HANDLER_DEVELOPMENT = 'development'; |
|
| 26 | 26 | |
| 27 | 27 | protected $events = ['plugins_loaded' => 'onPluginsLoaded']; |
| 28 | 28 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $this->plugin['key'] = $pluginKey; |
| 53 | 53 | list($vendor, $name) = explode('\\', $this->plugin['key']); |
| 54 | 54 | $DS = DIRECTORY_SEPARATOR; |
| 55 | - $this->plugin['dir'] = PLUGINS_DIR . $vendor . $DS . $name . $DS; |
|
| 55 | + $this->plugin['dir'] = PLUGINS_DIR.$vendor.$DS.$name.$DS; |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * init events |
@@ -132,6 +132,6 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | protected function getPluginPath($subPath = '') |
| 134 | 134 | { |
| 135 | - return $this->plugin['dir'] . ltrim($subPath, DIRECTORY_SEPARATOR); |
|
| 135 | + return $this->plugin['dir'].ltrim($subPath, DIRECTORY_SEPARATOR); |
|
| 136 | 136 | } |
| 137 | 137 | } |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | { |
| 160 | 160 | $config = Registry::get('Phile_Settings'); |
| 161 | 161 | |
| 162 | - return md5($config['encryptionKey'] . $value); |
|
| 162 | + return md5($config['encryptionKey'].$value); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | public function send() |
| 120 | 120 | { |
| 121 | 121 | if (!isset($this->headers['Content-Type'])) { |
| 122 | - $this->setHeader('Content-Type', 'text/html; charset=' . $this->charset); |
|
| 122 | + $this->setHeader('Content-Type', 'text/html; charset='.$this->charset); |
|
| 123 | 123 | } |
| 124 | 124 | $this->outputHeader(); |
| 125 | 125 | http_response_code($this->statusCode); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | if (isset($this->server['HTTP_HOST'])) { |
| 84 | 84 | $host = $this->server['HTTP_HOST']; |
| 85 | 85 | $protocol = $this->getProtocol(); |
| 86 | - $url = $protocol . '://' . $host . $url; |
|
| 86 | + $url = $protocol.'://'.$host.$url; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $url = rtrim($url, '/'); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function url($url) |
| 120 | 120 | { |
| 121 | - return $this->getBaseUrl() . '/' . ltrim($url, '/'); |
|
| 121 | + return $this->getBaseUrl().'/'.ltrim($url, '/'); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $settings = $this->settings; |
| 52 | 52 | |
| 53 | 53 | $content = $data['content']; |
| 54 | - $content = $this->printPhpAsMarkdown($settings) . $content; |
|
| 54 | + $content = $this->printPhpAsMarkdown($settings).$content; |
|
| 55 | 55 | |
| 56 | 56 | $page = $data['page']; |
| 57 | 57 | $page->setContent($content); |
@@ -62,6 +62,6 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | protected function printPhpAsMarkdown($input) |
| 64 | 64 | { |
| 65 | - return "\n```php\n" . trim(print_r($input, true), "\n") . "\n```\n"; |
|
| 65 | + return "\n```php\n".trim(print_r($input, true), "\n")."\n```\n"; |
|
| 66 | 66 | } |
| 67 | 67 | } |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | { |
| 90 | 90 | $content = $page->getRawContent(); |
| 91 | 91 | foreach ($vars as $key => $value) { |
| 92 | - $regex = '/\{\{(\s*?)' . $key . '(\s*?)\}\}/'; |
|
| 92 | + $regex = '/\{\{(\s*?)'.$key.'(\s*?)\}\}/'; |
|
| 93 | 93 | $content = preg_replace($regex, $value, $content); |
| 94 | 94 | } |
| 95 | 95 | $page->setContent($content); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | 'a', |
| 139 | 139 | 'Exception-Wiki', |
| 140 | 140 | [ |
| 141 | - 'href' => 'https://github.com/PhileCMS/Phile/wiki/Exception_' . $code, |
|
| 141 | + 'href' => 'https://github.com/PhileCMS/Phile/wiki/Exception_'.$code, |
|
| 142 | 142 | 'target_' => 'blank' |
| 143 | 143 | ] |
| 144 | 144 | ); |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | $DS = DIRECTORY_SEPARATOR; |
| 156 | - $pluginPath = realpath(dirname(__FILE__) . $DS . '..') . $DS; |
|
| 157 | - $tplPath = $pluginPath . 'template.php'; |
|
| 156 | + $pluginPath = realpath(dirname(__FILE__).$DS.'..').$DS; |
|
| 157 | + $tplPath = $pluginPath.'template.php'; |
|
| 158 | 158 | |
| 159 | 159 | ob_start(); |
| 160 | 160 | extract($marker); |
@@ -181,8 +181,8 @@ discard block |
||
| 181 | 181 | $backtrace .= ' '; |
| 182 | 182 | |
| 183 | 183 | if (isset($step['class'])) { |
| 184 | - $class = $this->linkClass($step['class']) . '<span class="divider">::</span>'; |
|
| 185 | - $backtrace .= $class . $this->linkClass($step['class'], $step['function']); |
|
| 184 | + $class = $this->linkClass($step['class']).'<span class="divider">::</span>'; |
|
| 185 | + $backtrace .= $class.$this->linkClass($step['class'], $step['function']); |
|
| 186 | 186 | } elseif (isset($step['function'])) { |
| 187 | 187 | $backtrace .= $this->tag('span', $step['function'], ['class' => 'function']); |
| 188 | 188 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | if (!file_exists($filename)) { |
| 252 | 252 | return ''; |
| 253 | 253 | } |
| 254 | - $html = $this->tag('span', $filename . ':<br/>', ['class' => 'filename']); |
|
| 254 | + $html = $this->tag('span', $filename.':<br/>', ['class' => 'filename']); |
|
| 255 | 255 | |
| 256 | 256 | $code = file_get_contents($filename); |
| 257 | 257 | $lines = explode("\n", $code); |
@@ -302,14 +302,14 @@ discard block |
||
| 302 | 302 | return $title; |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | - $filename = 'docs/classes/' . str_replace('\\', '.', $class) . '.html'; |
|
| 305 | + $filename = 'docs/classes/'.str_replace('\\', '.', $class).'.html'; |
|
| 306 | 306 | if (file_exists(Utility::resolveFilePath($filename))) { |
| 307 | 307 | return $title; |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - $href = $this->settings['base_url'] . '/' . $filename; |
|
| 310 | + $href = $this->settings['base_url'].'/'.$filename; |
|
| 311 | 311 | if ($method) { |
| 312 | - $href .= '#method_' . $method; |
|
| 312 | + $href .= '#method_'.$method; |
|
| 313 | 313 | } |
| 314 | 314 | return $this->tag('a', $title, ['href' => $href, 'target' => '_blank']); |
| 315 | 315 | } |
@@ -324,11 +324,11 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | protected function tag($tag, $content = '', array $attributes = []) |
| 326 | 326 | { |
| 327 | - $html = '<' . $tag; |
|
| 327 | + $html = '<'.$tag; |
|
| 328 | 328 | foreach ($attributes as $key => $value) { |
| 329 | - $html .= ' ' . $key . '="' . htmlspecialchars($value) . '"'; |
|
| 329 | + $html .= ' '.$key.'="'.htmlspecialchars($value).'"'; |
|
| 330 | 330 | } |
| 331 | - $html .= '>' . $content . '</' . $tag . '>'; |
|
| 331 | + $html .= '>'.$content.'</'.$tag.'>'; |
|
| 332 | 332 | return $html; |
| 333 | 333 | } |
| 334 | 334 | } |