From 17aba015132bef9ff6c7da230bbfc9a42a311d18 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Wed, 11 Sep 2019 12:07:48 +0200 Subject: [PATCH] Various small improvements --- config/config.yml.template | 6 +++--- lib/AbstractPicoPlugin.php | 4 ++-- lib/Pico.php | 8 ++++---- lib/PicoPluginInterface.php | 4 ++-- plugins/DummyPlugin.php | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config/config.yml.template b/config/config.yml.template index 174c610..d36a5fa 100644 --- a/config/config.yml.template +++ b/config/config.yml.template @@ -14,9 +14,9 @@ timezone: ~ # Your PHP installation might require you to theme: default # The name of your custom theme themes_url: ~ # Pico will try to guess the URL to the themes dir of your installation; # If this fails, override it here. Example: https://example.com/pico/themes/ -theme_config: +theme_config: # Additional theme-specific config widescreen: false # Default theme: Use more horicontal space (i.e. make the site container wider) -twig_config: +twig_config: # Twig template engine config autoescape: false # Let Twig escape variables by default strict_variables: false # If set to true, Twig will bail out when unset variables are being used debug: ~ # Enable Twig's debug mode @@ -33,7 +33,7 @@ pages_order_by: alpha # Change how Pico sorts pages ("alpha" for a pages_order: asc # Sort pages in ascending ("asc") or descending ("desc") order content_dir: ~ # The path to Pico's content directory content_ext: .md # The file extension of your Markdown files -content_config: +content_config: # Parsedown Markdown parser config extra: true # Use the Parsedown Extra parser to support extended markup; # See https://michelf.ca/projects/php-markdown/extra/ for more info breaks: false # A boolean indicating whether breaks in the markup should be reflected in the diff --git a/lib/AbstractPicoPlugin.php b/lib/AbstractPicoPlugin.php index 5246e15..17bf483 100644 --- a/lib/AbstractPicoPlugin.php +++ b/lib/AbstractPicoPlugin.php @@ -74,7 +74,7 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface * @see PicoPluginInterface::getDependants() * @var object[]|null */ - private $dependants; + protected $dependants; /** * Constructs a new instance of a Pico plugin @@ -330,7 +330,7 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface * * Pico automatically adds a dependency to {@see PicoDeprecated} when the * plugin's API is older than Pico's API. {@see PicoDeprecated} furthermore - * throws a exception when it can't provide compatibility in such cases. + * throws a exception if it can't provide compatibility in such cases. * However, we still have to decide whether this plugin is compatible to * newer API versions, what requires some special (version specific) * precaution and is therefore usually not the case. diff --git a/lib/Pico.php b/lib/Pico.php index 6fead44..aa23f0c 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -212,7 +212,7 @@ class Pico * List of known meta headers * * @see Pico::getMetaHeaders() - * @var string[]|null + * @var array|null */ protected $metaHeaders; @@ -710,7 +710,7 @@ class Pico if (class_exists($className)) { $plugin = new $className($this); } else { - throw new RuntimeException("Unable to load plugin '" . $className . "': Class not found"); + throw new RuntimeException("Unable to load plugin '" . $className . "': Class not found"); } } @@ -858,7 +858,7 @@ class Pico } /** - * Loads the config.yml and any other *.yml from Pico::$configDir + * Loads config.yml and any other *.yml from Pico::$configDir * * After loading {@path "config/config.yml"}, Pico proceeds with any other * existing `config/*.yml` file in alphabetical order. The file order is @@ -1641,7 +1641,7 @@ class Pico 'time' => &$meta['time'], 'date' => &$meta['date'], 'date_formatted' => &$meta['date_formatted'], - 'hidden' => (preg_match('/(?:^|\/)_/', $id) || $meta['hidden']), + 'hidden' => ($meta['hidden'] || preg_match('/(?:^|\/)_/', $id)), 'raw_content' => &$rawContent, 'meta' => &$meta ); diff --git a/lib/PicoPluginInterface.php b/lib/PicoPluginInterface.php index 7716275..6add326 100644 --- a/lib/PicoPluginInterface.php +++ b/lib/PicoPluginInterface.php @@ -95,11 +95,11 @@ interface PicoPluginInterface public function getDependants(); /** - * Returns the plugins instance of Pico + * Returns the plugin's instance of Pico * * @see Pico * - * @return Pico the plugins instance of Pico + * @return Pico the plugin's instance of Pico */ public function getPico(); } diff --git a/plugins/DummyPlugin.php b/plugins/DummyPlugin.php index 94727fb..5198a24 100644 --- a/plugins/DummyPlugin.php +++ b/plugins/DummyPlugin.php @@ -36,8 +36,8 @@ class DummyPlugin extends AbstractPicoPlugin * Usually you should remove this class property (or set it to NULL) to * leave the decision whether this plugin should be enabled or disabled by * default up to Pico. If all the plugin's dependenies are fulfilled (see - * {@see self::$dependsOn}), Pico enables the plugin by default. Otherwise - * the plugin is silently disabled. + * {@see DummyPlugin::$dependsOn}), Pico enables the plugin by default. + * Otherwise the plugin is silently disabled. * * If this plugin should never be disabled *silently* (e.g. when dealing * with security-relevant stuff like access control, or similar), set this