@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * resolve a file path by replace the mod: prefix |
| 53 | 53 | * |
| 54 | - * @param $path |
|
| 54 | + * @param string $path |
|
| 55 | 55 | * |
| 56 | 56 | * @return string|null the full filepath or null if file does not exists |
| 57 | 57 | */ |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | /** |
| 72 | 72 | * load files e.g. config files |
| 73 | 73 | * |
| 74 | - * @param $file |
|
| 74 | + * @param string $file |
|
| 75 | 75 | * |
| 76 | 76 | * @return mixed|null |
| 77 | 77 | */ |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * static method to get files by directory and file filter |
| 101 | 101 | * |
| 102 | - * @param $directory |
|
| 102 | + * @param string $directory |
|
| 103 | 103 | * @param string $filter |
| 104 | 104 | * |
| 105 | 105 | * @return array |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | * method to get a more secure random value |
| 180 | 180 | * code from http://stackoverflow.com/questions/1846202/php-how-to-generate-a-random-unique-alphanumeric-string/13733588#13733588 |
| 181 | 181 | * |
| 182 | - * @param $min |
|
| 183 | - * @param $max |
|
| 182 | + * @param integer $min |
|
| 183 | + * @param integer $max |
|
| 184 | 184 | * |
| 185 | 185 | * @return mixed |
| 186 | 186 | */ |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | /** |
| 124 | 124 | * set content of page |
| 125 | 125 | * |
| 126 | - * @param $content |
|
| 126 | + * @param string $content |
|
| 127 | 127 | */ |
| 128 | 128 | public function setContent($content) { |
| 129 | 129 | $this->content = $content; |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | * get file path to plugin root (trailing slash) or to a sub-item |
| 119 | 119 | * |
| 120 | 120 | * @param string $subPath |
| 121 | - * @return null|string null if item does not exist |
|
| 121 | + * @return string null if item does not exist |
|
| 122 | 122 | */ |
| 123 | 123 | protected function getPluginPath($subPath = '') { |
| 124 | 124 | return $this->plugin['dir'] . ltrim($subPath, DIRECTORY_SEPARATOR); |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | /** |
| 76 | 76 | * wrapper to call the render engine |
| 77 | 77 | * |
| 78 | - * @param $engine |
|
| 78 | + * @param \Twig_Environment $engine |
|
| 79 | 79 | * @param $vars |
| 80 | 80 | * @return mixed |
| 81 | 81 | */ |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | * @package Phile\Plugin\Phile\ParserMarkdown |
| 21 | 21 | */ |
| 22 | 22 | class Plugin extends AbstractPlugin { |
| 23 | - const HANDLER_ERROR_LOG = 'error_log'; |
|
| 24 | - const HANDLER_DEVELOPMENT = 'development'; |
|
| 23 | + const HANDLER_ERROR_LOG = 'error_log'; |
|
| 24 | + const HANDLER_DEVELOPMENT = 'development'; |
|
| 25 | 25 | |
| 26 | 26 | protected $events = ['plugins_loaded' => 'onPluginsLoaded']; |
| 27 | 27 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | // you can access this plugins' config in $this->settings |
| 48 | 48 | $settings = $this->settings; |
| 49 | 49 | |
| 50 | - $content = $data['content']; |
|
| 50 | + $content = $data['content']; |
|
| 51 | 51 | $content = $this->printPhpAsMarkdown($settings) . $content; |
| 52 | 52 | |
| 53 | 53 | $page = $data['page']; |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function accept() { |
| 18 | 18 | /** @var \SplFileInfo $this */ |
| 19 | - return (preg_match('/^[^\.]{1}.*'.CONTENT_EXT.'/', $this->getFilename()) > 0); |
|
| 19 | + return (preg_match('/^[^\.]{1}.*' . CONTENT_EXT . '/', $this->getFilename()) > 0); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | } |
| 23 | 23 | \ No newline at end of file |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | // for php unit testings, we need to check if constant is defined |
| 76 | 76 | // before setting them, because there is a bug in PHPUnit which |
| 77 | 77 | // init our bootstrap multiple times. |
| 78 | - defined('PHILE_VERSION') or define('PHILE_VERSION', '1.6.0'); |
|
| 79 | - defined('PHILE_CLI_MODE') or define('PHILE_CLI_MODE', (php_sapi_name() == "cli") ? true : false); |
|
| 80 | - defined('ROOT_DIR') or define('ROOT_DIR', realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR); |
|
| 81 | - defined('CONTENT_DIR') or define('CONTENT_DIR', ROOT_DIR . 'content' . DIRECTORY_SEPARATOR); |
|
| 82 | - defined('CONTENT_EXT') or define('CONTENT_EXT', '.md'); |
|
| 83 | - defined('LIB_DIR') or define('LIB_DIR', ROOT_DIR . 'lib' . DIRECTORY_SEPARATOR); |
|
| 84 | - defined('PLUGINS_DIR') or define('PLUGINS_DIR', ROOT_DIR . 'plugins' . DIRECTORY_SEPARATOR); |
|
| 85 | - defined('THEMES_DIR') or define('THEMES_DIR', ROOT_DIR . 'themes' . DIRECTORY_SEPARATOR); |
|
| 86 | - defined('CACHE_DIR') or define('CACHE_DIR', LIB_DIR . 'cache' . DIRECTORY_SEPARATOR); |
|
| 78 | + defined('PHILE_VERSION') or define('PHILE_VERSION', '1.6.0'); |
|
| 79 | + defined('PHILE_CLI_MODE') or define('PHILE_CLI_MODE', (php_sapi_name() == "cli") ? true : false); |
|
| 80 | + defined('ROOT_DIR') or define('ROOT_DIR', realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR); |
|
| 81 | + defined('CONTENT_DIR') or define('CONTENT_DIR', ROOT_DIR . 'content' . DIRECTORY_SEPARATOR); |
|
| 82 | + defined('CONTENT_EXT') or define('CONTENT_EXT', '.md'); |
|
| 83 | + defined('LIB_DIR') or define('LIB_DIR', ROOT_DIR . 'lib' . DIRECTORY_SEPARATOR); |
|
| 84 | + defined('PLUGINS_DIR') or define('PLUGINS_DIR', ROOT_DIR . 'plugins' . DIRECTORY_SEPARATOR); |
|
| 85 | + defined('THEMES_DIR') or define('THEMES_DIR', ROOT_DIR . 'themes' . DIRECTORY_SEPARATOR); |
|
| 86 | + defined('CACHE_DIR') or define('CACHE_DIR', LIB_DIR . 'cache' . DIRECTORY_SEPARATOR); |
|
| 87 | 87 | defined('STORAGE_DIR') or define('STORAGE_DIR', LIB_DIR . 'datastorage' . DIRECTORY_SEPARATOR); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | protected function initializeAutoloader() { |
| 94 | 94 | spl_autoload_extensions(".php"); |
| 95 | 95 | // load phile core |
| 96 | - spl_autoload_register(function ($className) { |
|
| 96 | + spl_autoload_register(function($className) { |
|
| 97 | 97 | $fileName = LIB_DIR . str_replace("\\", DIRECTORY_SEPARATOR, $className) . '.php'; |
| 98 | 98 | if (file_exists($fileName)) { |
| 99 | 99 | require_once $fileName; |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | |
| 69 | 69 | public function offsetSet($offset, $value) { |
| 70 | 70 | $this->load(); |
| 71 | - $this->pages[$offset] = $value; |
|
| 71 | + $this->pages[$offset] = $value; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function offsetUnset($offset) { |