@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * resolve a file path by replace the mod: prefix |
| 57 | 57 | * |
| 58 | - * @param $path |
|
| 58 | + * @param string $path |
|
| 59 | 59 | * |
| 60 | 60 | * @return string|null the full filepath or null if file does not exists |
| 61 | 61 | */ |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * load files e.g. config files |
| 78 | 78 | * |
| 79 | - * @param $file |
|
| 79 | + * @param string $file |
|
| 80 | 80 | * |
| 81 | 81 | * @return mixed|null |
| 82 | 82 | */ |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | /** |
| 111 | 111 | * static method to get files by directory and file filter |
| 112 | 112 | * |
| 113 | - * @param $directory |
|
| 113 | + * @param string $directory |
|
| 114 | 114 | * @param string $filter |
| 115 | 115 | * |
| 116 | 116 | * @return array |
@@ -202,6 +202,11 @@ discard block |
||
| 202 | 202 | * @return mixed |
| 203 | 203 | */ |
| 204 | 204 | // @codingStandardsIgnoreStart |
| 205 | + |
|
| 206 | + /** |
|
| 207 | + * @param integer $min |
|
| 208 | + * @param integer $max |
|
| 209 | + */ |
|
| 205 | 210 | public static function crypto_rand_secure($min, $max) |
| 206 | 211 | { |
| 207 | 212 | // @codingStandardsIgnoreEnd |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | $result = array(); |
| 129 | 129 | foreach ($files as $file) { |
| 130 | 130 | /** |
| 131 | - * @var \SplFileInfo $file |
|
| 131 | + * @var \SplFileInfo $file |
|
| 132 | 132 | */ |
| 133 | 133 | $result[] = $file->getPathname(); |
| 134 | 134 | } |
@@ -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 | /** |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | /** |
| 134 | 134 | * set content of page |
| 135 | 135 | * |
| 136 | - * @param $content |
|
| 136 | + * @param string $content |
|
| 137 | 137 | */ |
| 138 | 138 | public function setContent($content) |
| 139 | 139 | { |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | * get file path to plugin root (trailing slash) or to a sub-item |
| 129 | 129 | * |
| 130 | 130 | * @param string $subPath |
| 131 | - * @return null|string null if item does not exist |
|
| 131 | + * @return string null if item does not exist |
|
| 132 | 132 | */ |
| 133 | 133 | protected function getPluginPath($subPath = '') |
| 134 | 134 | { |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | if (!is_callable([$this, $method])) { |
| 118 | 118 | $class = get_class($this); |
| 119 | 119 | throw new \RuntimeException( |
| 120 | - "Event $eventKey can't invoke $class::$method(). Not callable.", |
|
| 120 | + "event $eventKey can't invoke $class::$method(). Not callable.", |
|
| 121 | 121 | 1428564865 |
| 122 | 122 | ); |
| 123 | 123 | } |
@@ -21,17 +21,17 @@ |
||
| 21 | 21 | { |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * @var string plugin attributes |
|
| 24 | + * @var string plugin attributes |
|
| 25 | 25 | */ |
| 26 | 26 | protected $plugin = []; |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * @var array subscribed Phile events ['eventName' => 'classMethodToCall'] |
|
| 29 | + * @var array subscribed Phile events ['eventName' => 'classMethodToCall'] |
|
| 30 | 30 | */ |
| 31 | 31 | protected $events = []; |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | - * @var array the plugin settings |
|
| 34 | + * @var array the plugin settings |
|
| 35 | 35 | */ |
| 36 | 36 | protected $settings = []; |
| 37 | 37 | |
@@ -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 | } |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | /** |
| 80 | 80 | * wrapper to call the render engine |
| 81 | 81 | * |
| 82 | - * @param $engine |
|
| 82 | + * @param \Twig_Environment $engine |
|
| 83 | 83 | * @param $vars |
| 84 | 84 | * @return mixed |
| 85 | 85 | */ |
@@ -175,7 +175,7 @@ |
||
| 175 | 175 | ]; |
| 176 | 176 | |
| 177 | 177 | /** |
| 178 | - * @var array $templateVars |
|
| 178 | + * @var array $templateVars |
|
| 179 | 179 | */ |
| 180 | 180 | $templateVars = Registry::get('templateVars'); |
| 181 | 181 | $templateVars += $defaults; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $template = 'index'; |
| 124 | 124 | } |
| 125 | 125 | if (!empty($this->config['template-extension'])) { |
| 126 | - $template .= '.' . $this->config['template-extension']; |
|
| 126 | + $template .= '.'.$this->config['template-extension']; |
|
| 127 | 127 | } |
| 128 | 128 | $templatePath = $this->getTemplatePath($template); |
| 129 | 129 | if (!file_exists($templatePath)) { |
@@ -143,9 +143,9 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | protected function getTemplatePath($sub = '') |
| 145 | 145 | { |
| 146 | - $themePath = THEMES_DIR . $this->settings['theme']; |
|
| 146 | + $themePath = THEMES_DIR.$this->settings['theme']; |
|
| 147 | 147 | if (!empty($sub)) { |
| 148 | - $themePath .= '/' . ltrim($sub, DIRECTORY_SEPARATOR); |
|
| 148 | + $themePath .= '/'.ltrim($sub, DIRECTORY_SEPARATOR); |
|
| 149 | 149 | } |
| 150 | 150 | return $themePath; |
| 151 | 151 | } |
@@ -167,11 +167,11 @@ discard block |
||
| 167 | 167 | 'base_url' => $this->settings['base_url'], |
| 168 | 168 | 'config' => $this->settings, |
| 169 | 169 | 'content_dir' => CONTENT_DIR, |
| 170 | - 'content_url' => $this->settings['base_url'] . '/' . basename(CONTENT_DIR), |
|
| 170 | + 'content_url' => $this->settings['base_url'].'/'.basename(CONTENT_DIR), |
|
| 171 | 171 | 'pages' => $repository->findAll(), |
| 172 | 172 | 'site_title' => $this->settings['site_title'], |
| 173 | - 'theme_dir' => THEMES_DIR . $this->settings['theme'], |
|
| 174 | - 'theme_url' => $this->settings['base_url'] . '/' . basename(THEMES_DIR) . '/' . $this->settings['theme'], |
|
| 173 | + 'theme_dir' => THEMES_DIR.$this->settings['theme'], |
|
| 174 | + 'theme_url' => $this->settings['base_url'].'/'.basename(THEMES_DIR).'/'.$this->settings['theme'], |
|
| 175 | 175 | ]; |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public function accept() |
| 19 | 19 | { |
| 20 | 20 | /** |
| 21 | - * @var \SplFileInfo $this |
|
| 21 | + * @var \SplFileInfo $this |
|
| 22 | 22 | */ |
| 23 | 23 | return (preg_match('/^[^\.]{1}.*'.CONTENT_EXT.'/', $this->getFilename()) > 0); |
| 24 | 24 | } |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | protected function parseRawData($rawData) |
| 82 | 82 | { |
| 83 | 83 | /** |
| 84 | - * @var \Phile\ServiceLocator\MetaInterface $metaParser |
|
| 84 | + * @var \Phile\ServiceLocator\MetaInterface $metaParser |
|
| 85 | 85 | */ |
| 86 | 86 | $metaParser = ServiceLocator::getService('Phile_Parser_Meta'); |
| 87 | 87 | $data = $metaParser->parse($rawData); |
@@ -128,8 +128,8 @@ |
||
| 128 | 128 | $column = array(); |
| 129 | 129 | foreach ($pages as $page) { |
| 130 | 130 | /** |
| 131 | - * @var \Phile\Model\Page $page |
|
| 132 | - */ |
|
| 131 | + * @var \Phile\Model\Page $page |
|
| 132 | + */ |
|
| 133 | 133 | $meta = $page->getMeta(); |
| 134 | 134 | if ($sort['type'] === 'page') { |
| 135 | 135 | $method = 'get' . ucfirst($key); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $pageId .= 'index'; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $file = $folder . $pageId . CONTENT_EXT; |
|
| 67 | + $file = $folder.$pageId.CONTENT_EXT; |
|
| 68 | 68 | if (!file_exists($file)) { |
| 69 | 69 | if (substr($pageId, -6) === '/index') { |
| 70 | 70 | // try to resolve sub-directory 'sub/' to page 'sub' |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // try to resolve page 'sub' to sub-directory 'sub/' |
| 74 | 74 | $pageId .= '/index'; |
| 75 | 75 | } |
| 76 | - $file = $folder . $pageId . CONTENT_EXT; |
|
| 76 | + $file = $folder.$pageId.CONTENT_EXT; |
|
| 77 | 77 | } |
| 78 | 78 | if (!file_exists($file)) { |
| 79 | 79 | return null; |
@@ -92,13 +92,13 @@ discard block |
||
| 92 | 92 | public function findAll(array $options = array(), $folder = CONTENT_DIR) |
| 93 | 93 | { |
| 94 | 94 | return new PageCollection( |
| 95 | - function () use ($options, $folder) { |
|
| 95 | + function() use ($options, $folder) { |
|
| 96 | 96 | $options += $this->settings; |
| 97 | 97 | // ignore files with a leading '.' in its filename |
| 98 | 98 | $files = Utility::getFiles($folder, '\Phile\FilterIterator\ContentFileFilterIterator'); |
| 99 | 99 | $pages = array(); |
| 100 | 100 | foreach ($files as $file) { |
| 101 | - if (str_replace($folder, '', $file) == '404' . CONTENT_EXT) { |
|
| 101 | + if (str_replace($folder, '', $file) == '404'.CONTENT_EXT) { |
|
| 102 | 102 | // jump to next page if file is the 404 page |
| 103 | 103 | continue; |
| 104 | 104 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | $meta = $page->getMeta(); |
| 137 | 137 | if ($sort['type'] === 'page') { |
| 138 | - $method = 'get' . ucfirst($key); |
|
| 138 | + $method = 'get'.ucfirst($key); |
|
| 139 | 139 | $value = $page->$method(); |
| 140 | 140 | } elseif ($sort['type'] === 'meta') { |
| 141 | 141 | $value = $meta->get($key); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $column[] = $value; |
| 150 | 150 | } |
| 151 | 151 | $sortHelper[] = $column; |
| 152 | - $sortHelper[] = constant('SORT_' . strtoupper($sort['order'])); |
|
| 152 | + $sortHelper[] = constant('SORT_'.strtoupper($sort['order'])); |
|
| 153 | 153 | } |
| 154 | 154 | $sortHelper[] = &$pages; |
| 155 | 155 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | protected function getPage($filePath, $folder = CONTENT_DIR) |
| 193 | 193 | { |
| 194 | - $key = 'Phile_Model_Page_' . md5($filePath); |
|
| 194 | + $key = 'Phile_Model_Page_'.md5($filePath); |
|
| 195 | 195 | if (isset($this->storage[$key])) { |
| 196 | 196 | return $this->storage[$key]; |
| 197 | 197 | } |
@@ -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) |
@@ -16,12 +16,12 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | - * @var array of AbstractPlugin |
|
| 19 | + * @var array of AbstractPlugin |
|
| 20 | 20 | */ |
| 21 | 21 | protected $plugins = []; |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * @var array errors during load; keys: 'message' and 'code' |
|
| 24 | + * @var array errors during load; keys: 'message' and 'code' |
|
| 25 | 25 | */ |
| 26 | 26 | protected $loadErrors = []; |
| 27 | 27 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | - * @var \Phile\Plugin\AbstractPlugin $plugin |
|
| 85 | + * @var \Phile\Plugin\AbstractPlugin $plugin |
|
| 86 | 86 | */ |
| 87 | 87 | $plugin = new $pluginClassName; |
| 88 | 88 | if (($plugin instanceof AbstractPlugin) === false) { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | list($vendor, $pluginName) = explode('\\', $pluginKey); |
| 74 | 74 | // uppercase first letter convention |
| 75 | - $pluginClassName = '\\Phile\\Plugin\\' . ucfirst($vendor) . '\\' . ucfirst($pluginName) . '\\Plugin'; |
|
| 75 | + $pluginClassName = '\\Phile\\Plugin\\'.ucfirst($vendor).'\\'.ucfirst($pluginName).'\\Plugin'; |
|
| 76 | 76 | |
| 77 | 77 | if (!class_exists($pluginClassName)) { |
| 78 | 78 | throw new PluginException( |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $classNameParts |
| 126 | 126 | ); |
| 127 | 127 | |
| 128 | - $fileName = PLUGINS_DIR . implode(DIRECTORY_SEPARATOR, $classPath) . '.php'; |
|
| 128 | + $fileName = PLUGINS_DIR.implode(DIRECTORY_SEPARATOR, $classPath).'.php'; |
|
| 129 | 129 | if (file_exists($fileName)) { |
| 130 | 130 | include_once $fileName; |
| 131 | 131 | } |