@@ -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 | { |
@@ -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) |
@@ -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 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | $this->plugin['key'] = $pluginKey; |
| 54 | 54 | $reflection = new \ReflectionClass($this); |
| 55 | - $this->plugin['dir'] = realpath(dirname($reflection->getFileName()) . DS . '..' . DS) . DS; |
|
| 55 | + $this->plugin['dir'] = realpath(dirname($reflection->getFileName()).DS.'..'.DS).DS; |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * init events |
@@ -134,6 +134,6 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | protected function getPluginPath($subPath = '') |
| 136 | 136 | { |
| 137 | - return $this->plugin['dir'] . ltrim($subPath, DIRECTORY_SEPARATOR); |
|
| 137 | + return $this->plugin['dir'].ltrim($subPath, DIRECTORY_SEPARATOR); |
|
| 138 | 138 | } |
| 139 | 139 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | class AbstractModel implements \ArrayAccess |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * @var array the storage |
|
| 18 | + * @var array the storage |
|
| 19 | 19 | */ |
| 20 | 20 | protected $data = array(); |
| 21 | 21 | |
@@ -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 | /** |
@@ -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|null $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 |
@@ -15,12 +15,12 @@ |
||
| 15 | 15 | class Session |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * @var bool mark if session is started |
|
| 18 | + * @var bool mark if session is started |
|
| 19 | 19 | */ |
| 20 | 20 | static public $isStarted = false; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * @var string the session id |
|
| 23 | + * @var string the session id |
|
| 24 | 24 | */ |
| 25 | 25 | static public $sessionId = ''; |
| 26 | 26 | |