@@ -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 | { |
@@ -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' => $this->settings['content_dir'], |
170 | - 'content_url' => $this->settings['base_url'] . '/' . basename($this->settings['content_dir']), |
|
170 | + 'content_url' => $this->settings['base_url'].'/'.basename($this->settings['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 | /** |
@@ -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); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $pageId .= 'index'; |
66 | 66 | } |
67 | 67 | |
68 | - $file = $folder . $pageId . $this->settings['content_ext']; |
|
68 | + $file = $folder.$pageId.$this->settings['content_ext']; |
|
69 | 69 | if (!file_exists($file)) { |
70 | 70 | if (substr($pageId, -6) === '/index') { |
71 | 71 | // try to resolve sub-directory 'sub/' to page 'sub' |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | // try to resolve page 'sub' to sub-directory 'sub/' |
75 | 75 | $pageId .= '/index'; |
76 | 76 | } |
77 | - $file = $folder . $pageId . $this->settings['content_ext']; |
|
77 | + $file = $folder.$pageId.$this->settings['content_ext']; |
|
78 | 78 | } |
79 | 79 | if (!file_exists($file)) { |
80 | 80 | return null; |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | { |
95 | 95 | $folder = $folder ?: $this->settings['content_dir']; |
96 | 96 | return new PageCollection( |
97 | - function () use ($options, $folder) { |
|
97 | + function() use ($options, $folder) { |
|
98 | 98 | $options += $this->settings; |
99 | 99 | // ignore files with a leading '.' in its filename |
100 | 100 | $files = Utility::getFiles($folder, '\Phile\FilterIterator\ContentFileFilterIterator'); |
101 | 101 | $pages = array(); |
102 | 102 | foreach ($files as $file) { |
103 | - if (str_replace($folder, '', $file) == '404' . $this->settings['content_ext']) { |
|
103 | + if (str_replace($folder, '', $file) == '404'.$this->settings['content_ext']) { |
|
104 | 104 | // jump to next page if file is the 404 page |
105 | 105 | continue; |
106 | 106 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | $meta = $page->getMeta(); |
139 | 139 | if ($sort['type'] === 'page') { |
140 | - $method = 'get' . ucfirst($key); |
|
140 | + $method = 'get'.ucfirst($key); |
|
141 | 141 | $value = $page->$method(); |
142 | 142 | } elseif ($sort['type'] === 'meta') { |
143 | 143 | $value = $meta->get($key); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $column[] = $value; |
152 | 152 | } |
153 | 153 | $sortHelper[] = $column; |
154 | - $sortHelper[] = constant('SORT_' . strtoupper($sort['order'])); |
|
154 | + $sortHelper[] = constant('SORT_'.strtoupper($sort['order'])); |
|
155 | 155 | } |
156 | 156 | $sortHelper[] = &$pages; |
157 | 157 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | protected function getPage($filePath, $folder = null) |
195 | 195 | { |
196 | 196 | $folder = $folder ?: $this->settings['content_dir']; |
197 | - $key = 'Phile_Model_Page_' . md5($filePath); |
|
197 | + $key = 'Phile_Model_Page_'.md5($filePath); |
|
198 | 198 | if (isset($this->storage[$key])) { |
199 | 199 | return $this->storage[$key]; |
200 | 200 | } |
@@ -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 | } |
@@ -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 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | class SimpleFileDataPersistence implements PersistenceInterface |
18 | 18 | { |
19 | 19 | /** |
20 | - * @var string $dataDirectory the data storage directory |
|
20 | + * @var string $dataDirectory the data storage directory |
|
21 | 21 | */ |
22 | 22 | protected $dataDirectory; |
23 | 23 |
@@ -109,6 +109,6 @@ |
||
109 | 109 | */ |
110 | 110 | protected function getStorageFile($key) |
111 | 111 | { |
112 | - return $this->dataDirectory . $this->getInternalKey($key) . '.ds'; |
|
112 | + return $this->dataDirectory.$this->getInternalKey($key).'.ds'; |
|
113 | 113 | } |
114 | 114 | } |
@@ -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 |