diff --git a/composer.json b/composer.json index 3a7038c..b427824 100644 --- a/composer.json +++ b/composer.json @@ -21,9 +21,9 @@ "require": { "php": ">=7.3.0", "ext-json": "*", - "picocms/pico": "^2.1", - "picocms/pico-theme": "^2.1", - "picocms/pico-deprecated": "^2.1", + "picocms/pico": "dev-pico-3.0#a5fefa4", + "picocms/pico-theme": "dev-pico-3.0#f322a0b", + "picocms/pico-deprecated": "dev-pico-3.0#ccf1194", "picocms/composer-installer": "^1.0", "xemlock/htmlpurifier-html5": "~0.1.11", "symfony/yaml" : "^2.8|^3.4|^4.4|^5.1" @@ -31,8 +31,7 @@ "require-dev": { "phpunit/phpunit": "^8", "phrozenbyte/phpunit-throwable-asserts": "^1.1", - "phrozenbyte/phpunit-array-asserts": "^v1.1", - "incompass/coverage": "^1.0" + "phrozenbyte/phpunit-array-asserts": "^v1.1" }, "extra": { "pico-theme-dir": "appdata/themes/", diff --git a/lib/Model/Plugin.php b/lib/Model/Plugin.php index aa39896..a5b2afb 100644 --- a/lib/Model/Plugin.php +++ b/lib/Model/Plugin.php @@ -46,6 +46,7 @@ class Plugin implements \JsonSerializable Pico::API_VERSION_1, Pico::API_VERSION_2, Pico::API_VERSION_3, + Pico::API_VERSION_4, ]; /** @var MiscService */ diff --git a/lib/Pico.php b/lib/Pico.php index a426554..8a66e03 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -71,6 +71,13 @@ class Pico extends \Pico */ public const API_VERSION_3 = 3; + /** + * API version 4, used by Pico 3.0 + * + * @var int + */ + public const API_VERSION_4 = 4; + /** @var PicoService */ private $picoService; @@ -104,7 +111,7 @@ class Pico extends \Pico * @throws NotFoundException * @throws NotPermittedException */ - public function run() + public function run() : string { return parent::run(); } @@ -141,7 +148,7 @@ class Pico extends \Pico * * @return void */ - protected function evaluateRequestUrl() + protected function evaluateRequestUrl() : void { // do nothing } @@ -157,7 +164,7 @@ class Pico extends \Pico * @throws NotFoundException * @throws NotPermittedException */ - public function loadFileContent($absolutePath) + public function loadFileContent($absolutePath) : string { /** @var FolderInterface $folder */ /** @var string $basePath */ @@ -177,7 +184,7 @@ class Pico extends \Pico * @return array * @throws ParseException */ - public function parseFileMeta($rawContent, array $headers) + public function parseFileMeta($rawContent, array $headers) : array { $meta = parent::parseFileMeta($rawContent, $headers); return $this->purifyFileMeta($meta); @@ -212,7 +219,7 @@ class Pico extends \Pico * * @return string */ - public function parseFileContent($markdown, $singleLine = false) + public function parseFileContent($markdown, $singleLine = false) : string { $content = parent::parseFileContent($markdown, $singleLine); return $this->purifyFileContent($content); @@ -275,7 +282,7 @@ class Pico extends \Pico * @throws WebsiteInvalidFilesystemException * @throws InvalidPathException */ - public function getFiles($absolutePath, $fileExtension = '', $order = \Pico::SORT_ASC) + public function getFiles($absolutePath, $fileExtension = '', $order = \Pico::SORT_ASC) : array { /** @var FolderInterface $folder */ /** @var string $basePath */ @@ -327,7 +334,7 @@ class Pico extends \Pico * @throws WebsiteInvalidFilesystemException * @throws InvalidPathException */ - public function getFilesGlob($absolutePathPattern, $order = \Pico::SORT_ASC) + public function getFilesGlob($absolutePathPattern, $order = \Pico::SORT_ASC) : array { /** @var FolderInterface $folder */ /** @var string $basePath */