diff --git a/system/src/Grav/Common/Assets/BaseAsset.php b/system/src/Grav/Common/Assets/BaseAsset.php index 7646a4c8b..3b0108602 100644 --- a/system/src/Grav/Common/Assets/BaseAsset.php +++ b/system/src/Grav/Common/Assets/BaseAsset.php @@ -224,6 +224,7 @@ abstract class BaseAsset extends PropertyObject * @param string $file * @param string $dir * @param bool $local + * @return string */ protected function cssRewrite($file, $dir, $local) { diff --git a/system/src/Grav/Common/Assets/Pipeline.php b/system/src/Grav/Common/Assets/Pipeline.php index 3f67dc35d..6fdc2cc1d 100644 --- a/system/src/Grav/Common/Assets/Pipeline.php +++ b/system/src/Grav/Common/Assets/Pipeline.php @@ -222,7 +222,7 @@ class Pipeline extends PropertyObject * @param string $file the css source file * @param string $dir , $local relative path to the css file * @param bool $local is this a local or remote asset - * @return mixed + * @return string */ protected function cssRewrite($file, $dir, $local) { diff --git a/system/src/Grav/Common/Backup/Backups.php b/system/src/Grav/Common/Backup/Backups.php index 524fed7f9..4ced4e5fd 100644 --- a/system/src/Grav/Common/Backup/Backups.php +++ b/system/src/Grav/Common/Backup/Backups.php @@ -151,7 +151,7 @@ class Backups /** * @param bool $force - * @return array|null + * @return array */ public static function getAvailableBackups($force = false) { diff --git a/system/src/Grav/Common/Config/CompiledBase.php b/system/src/Grav/Common/Config/CompiledBase.php index 94ddf9182..48990c101 100644 --- a/system/src/Grav/Common/Config/CompiledBase.php +++ b/system/src/Grav/Common/Config/CompiledBase.php @@ -160,6 +160,7 @@ abstract class CompiledBase * * @param string $name Name of the position. * @param string|string[] $filename File(s) to be loaded. + * @return void */ abstract protected function loadFile($name, $filename); @@ -223,6 +224,7 @@ abstract class CompiledBase * Save compiled file. * * @param string $filename + * @return void * @throws RuntimeException * @internal */ diff --git a/system/src/Grav/Common/Config/Languages.php b/system/src/Grav/Common/Config/Languages.php index 6978a664c..2b05136c0 100644 --- a/system/src/Grav/Common/Config/Languages.php +++ b/system/src/Grav/Common/Config/Languages.php @@ -29,7 +29,7 @@ class Languages extends Data /** * @param string|null $checksum - * @return string + * @return string|null */ public function checksum($checksum = null) { diff --git a/system/src/Grav/Common/Config/Setup.php b/system/src/Grav/Common/Config/Setup.php index fc82505f2..c7b0cb1a7 100644 --- a/system/src/Grav/Common/Config/Setup.php +++ b/system/src/Grav/Common/Config/Setup.php @@ -301,6 +301,7 @@ class Setup extends Data /** * @param UniformResourceLocator $locator + * @return void * @throws InvalidArgumentException * @throws BadMethodCallException * @throws RuntimeException diff --git a/system/src/Grav/Common/Data/Blueprint.php b/system/src/Grav/Common/Data/Blueprint.php index a2f08dac2..addc62a9e 100644 --- a/system/src/Grav/Common/Data/Blueprint.php +++ b/system/src/Grav/Common/Data/Blueprint.php @@ -36,7 +36,7 @@ class Blueprint extends BlueprintForm /** @var string|null */ protected $scope; - /** @var BlueprintSchema|null */ + /** @var BlueprintSchema */ protected $blueprintSchema; /** @var object|null */ @@ -60,6 +60,7 @@ class Blueprint extends BlueprintForm /** * @param string $scope + * @return void */ public function setScope($scope) { @@ -68,6 +69,7 @@ class Blueprint extends BlueprintForm /** * @param object $object + * @return void */ public function setObject($object) { @@ -511,7 +513,7 @@ class Blueprint extends BlueprintForm } /** - * @param UserInterface $user + * @param UserInterface|null $user * @param array $actions * @param string $op * @return bool @@ -562,6 +564,7 @@ class Blueprint extends BlueprintForm * @param array $field * @param string $property * @param mixed $value + * @return void */ protected function addPropertyRecursive(array &$field, $property, $value) { diff --git a/system/src/Grav/Common/Data/BlueprintSchema.php b/system/src/Grav/Common/Data/BlueprintSchema.php index dd06f8d69..9525d8490 100644 --- a/system/src/Grav/Common/Data/BlueprintSchema.php +++ b/system/src/Grav/Common/Data/BlueprintSchema.php @@ -61,6 +61,7 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface * * @param array $data * @param array $options + * @return void * @throws RuntimeException */ public function validate(array $data, array $options = []) @@ -197,7 +198,7 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface * @param string $parent * @param bool $missingValuesAsNull * @param bool $keepEmptyValues - * @return array + * @return array|null */ protected function filterArray(array $data, array $rules, string $parent, bool $missingValuesAsNull, bool $keepEmptyValues) { diff --git a/system/src/Grav/Common/Data/Data.php b/system/src/Grav/Common/Data/Data.php index 53e3d7066..65f7fceca 100644 --- a/system/src/Grav/Common/Data/Data.php +++ b/system/src/Grav/Common/Data/Data.php @@ -33,7 +33,7 @@ class Data implements DataInterface, \ArrayAccess, \Countable, \JsonSerializable protected $gettersVariable = 'items'; /** @var array */ protected $items; - /** @var Blueprint */ + /** @var Blueprint|callable|null */ protected $blueprints; /** @var FileInterface|null */ protected $storage; @@ -275,6 +275,8 @@ class Data implements DataInterface, \ArrayAccess, \Countable, \JsonSerializable /** * Save data if storage has been defined. + * + * @return void * @throws RuntimeException */ public function save() diff --git a/system/src/Grav/Common/Data/DataInterface.php b/system/src/Grav/Common/Data/DataInterface.php index 493b8be24..025a2f97d 100644 --- a/system/src/Grav/Common/Data/DataInterface.php +++ b/system/src/Grav/Common/Data/DataInterface.php @@ -40,28 +40,37 @@ interface DataInterface /** * Return blueprints. + * + * @return Blueprint */ public function blueprints(); /** * Validate by blueprints. * + * @return $this * @throws Exception */ public function validate(); /** * Filter all items by using blueprints. + * + * @return $this */ public function filter(); /** * Get extra items which haven't been defined in blueprints. + * + * @return array */ public function extra(); /** * Save data into the file. + * + * @return void */ public function save(); diff --git a/system/src/Grav/Common/Data/Validation.php b/system/src/Grav/Common/Data/Validation.php index 9f1d43940..6cfe35487 100644 --- a/system/src/Grav/Common/Data/Validation.php +++ b/system/src/Grav/Common/Data/Validation.php @@ -100,6 +100,7 @@ class Validation /** * @param mixed $value * @param array $field + * @return array */ public static function checkSafety($value, array $field) { @@ -617,7 +618,6 @@ class Validation * @param array $field Blueprint for the field. * @return bool True if validation succeeded. */ - public static function typeUrl($value, array $params, array $field) { return self::typeText($value, $params, $field) && filter_var($value, FILTER_VALIDATE_URL); diff --git a/system/src/Grav/Common/Debugger.php b/system/src/Grav/Common/Debugger.php index 63a796044..f4548eb6b 100644 --- a/system/src/Grav/Common/Debugger.php +++ b/system/src/Grav/Common/Debugger.php @@ -566,6 +566,7 @@ class Debugger if ($this->enabled && extension_loaded('tideways_xhprof')) { $this->profiling++; if ($this->profiling === 1) { + // @phpstan-ignore-next-line \tideways_xhprof_enable(TIDEWAYS_XHPROF_FLAGS_NO_BUILTINS); } } @@ -583,6 +584,7 @@ class Debugger if ($this->enabled && extension_loaded('tideways_xhprof')) { $profiling = $this->profiling - 1; if ($profiling === 0) { + // @phpstan-ignore-next-line $timings = \tideways_xhprof_disable(); $timings = $this->buildProfilerTimings($timings); diff --git a/system/src/Grav/Common/Errors/SimplePageHandler.php b/system/src/Grav/Common/Errors/SimplePageHandler.php index 80924c4a2..f0e8b51cf 100644 --- a/system/src/Grav/Common/Errors/SimplePageHandler.php +++ b/system/src/Grav/Common/Errors/SimplePageHandler.php @@ -97,6 +97,7 @@ class SimplePageHandler extends Handler /** * @param string $path + * @return void */ public function addResourcePath($path) { diff --git a/system/src/Grav/Common/Filesystem/Folder.php b/system/src/Grav/Common/Filesystem/Folder.php index 4f5416861..91a2e63bd 100644 --- a/system/src/Grav/Common/Filesystem/Folder.php +++ b/system/src/Grav/Common/Filesystem/Folder.php @@ -22,6 +22,10 @@ use function count; use function dirname; use function is_callable; +/** + * Class Folder + * @package Grav\Common\Filesystem + */ abstract class Folder { /** diff --git a/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php b/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php index 3646123bc..24a9a903b 100644 --- a/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php +++ b/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php @@ -690,7 +690,7 @@ class PageCollection extends FlexPageCollection implements PageCollectionInterfa /** * @param bool $bool - * @return FlexCollectionInterface|FlexPageCollection + * @return static */ public function withOrdered(bool $bool = true) { @@ -701,7 +701,7 @@ class PageCollection extends FlexPageCollection implements PageCollectionInterfa /** * @param bool $bool - * @return FlexCollectionInterface|FlexPageCollection + * @return static */ public function withModules(bool $bool = true) { @@ -712,7 +712,7 @@ class PageCollection extends FlexPageCollection implements PageCollectionInterfa /** * @param bool $bool - * @return FlexCollectionInterface|FlexPageCollection + * @return static */ public function withPages(bool $bool = true) { @@ -725,7 +725,7 @@ class PageCollection extends FlexPageCollection implements PageCollectionInterfa * @param bool $bool * @param string|null $languageCode * @param bool|null $fallback - * @return FlexCollectionInterface|FlexPageCollection + * @return static */ public function withTranslation(bool $bool = true, string $languageCode = null, bool $fallback = null) { @@ -748,7 +748,7 @@ class PageCollection extends FlexPageCollection implements PageCollectionInterfa * * @param array $filters * @param bool $recursive - * @return FlexCollectionInterface + * @return static */ public function filterBy(array $filters, bool $recursive = false) { diff --git a/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php b/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php index d97234067..4aedc87a5 100644 --- a/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php +++ b/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php @@ -302,7 +302,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface /** * @param array $entries * @param string|null $keyField - * @return $this|FlexPageIndex + * @return static */ protected function createFrom(array $entries, string $keyField = null) { @@ -742,11 +742,11 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface * @param string $path * @param int $direction either -1 or +1 * - * @return PageInterface|PageCollectionInterface|false The sibling item. + * @return PageInterface|false The sibling item. */ public function adjacentSibling($path, $direction = 1) { - /** @var PageInterface|PageCollectionInterface|false $result */ + /** @var PageInterface|false $result */ $result = $this->__call('adjacentSibling', [$path, $direction]); return $result; diff --git a/system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php b/system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php index bcb0533da..a619fb1df 100644 --- a/system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php +++ b/system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php @@ -641,6 +641,7 @@ class PageStorage extends FolderStorage $parentKey = ''; } + /** @phpstan-var array{'storage_key': string, 'storage_timestamp': int, 'children': array} $parent */ $parent = &$list[$parentKey]; $basename = basename($storage_key); diff --git a/system/src/Grav/Common/Flex/Types/Pages/Traits/PageTranslateTrait.php b/system/src/Grav/Common/Flex/Types/Pages/Traits/PageTranslateTrait.php index d2fd38a1e..8081d28c0 100644 --- a/system/src/Grav/Common/Flex/Types/Pages/Traits/PageTranslateTrait.php +++ b/system/src/Grav/Common/Flex/Types/Pages/Traits/PageTranslateTrait.php @@ -81,6 +81,7 @@ trait PageTranslateTrait } $header = $aPage->header(); + // @phpstan-ignore-next-line $routes = $header->routes ?? []; $route = $routes['default'] ?? $aPage->rawRoute(); if (!$route) { diff --git a/system/src/Grav/Common/Flex/Types/UserGroups/UserGroupCollection.php b/system/src/Grav/Common/Flex/Types/UserGroups/UserGroupCollection.php index 4faa46b56..9e43a1578 100644 --- a/system/src/Grav/Common/Flex/Types/UserGroups/UserGroupCollection.php +++ b/system/src/Grav/Common/Flex/Types/UserGroups/UserGroupCollection.php @@ -15,6 +15,10 @@ use Grav\Common\Flex\Traits\FlexCollectionTrait; use Grav\Common\Flex\Traits\FlexGravTrait; use Grav\Framework\Flex\FlexCollection; +/** + * Class UserGroupCollection + * @package Grav\Common\Flex\Types\UserGroups + */ class UserGroupCollection extends FlexCollection { use FlexGravTrait; diff --git a/system/src/Grav/Common/Flex/Types/Users/UserCollection.php b/system/src/Grav/Common/Flex/Types/Users/UserCollection.php index 53faa8a29..0fce6dd1b 100644 --- a/system/src/Grav/Common/Flex/Types/Users/UserCollection.php +++ b/system/src/Grav/Common/Flex/Types/Users/UserCollection.php @@ -18,6 +18,10 @@ use Grav\Common\User\Interfaces\UserInterface; use Grav\Framework\Flex\FlexCollection; use function is_string; +/** + * Class UserCollection + * @package Grav\Common\Flex\Types\Users + */ class UserCollection extends FlexCollection implements UserCollectionInterface { use FlexGravTrait; diff --git a/system/src/Grav/Common/Flex/Types/Users/UserIndex.php b/system/src/Grav/Common/Flex/Types/Users/UserIndex.php index 7711b192e..011437636 100644 --- a/system/src/Grav/Common/Flex/Types/Users/UserIndex.php +++ b/system/src/Grav/Common/Flex/Types/Users/UserIndex.php @@ -24,6 +24,10 @@ use function count; use function is_string; use function method_exists; +/** + * Class UserIndex + * @package Grav\Common\Flex\Types\Users + */ class UserIndex extends FlexIndex { public const VERSION = parent::VERSION . '.1'; diff --git a/system/src/Grav/Common/Grav.php b/system/src/Grav/Common/Grav.php index bd6ff9581..7808e2c3e 100644 --- a/system/src/Grav/Common/Grav.php +++ b/system/src/Grav/Common/Grav.php @@ -120,6 +120,7 @@ class Grav extends Container public static function resetInstance() { if (self::$instance) { + // @phpstan-ignore-next-line self::$instance = null; } } diff --git a/system/src/Grav/Common/Helpers/Excerpts.php b/system/src/Grav/Common/Helpers/Excerpts.php index ca65fac51..aa5e6d1b3 100644 --- a/system/src/Grav/Common/Helpers/Excerpts.php +++ b/system/src/Grav/Common/Helpers/Excerpts.php @@ -13,6 +13,7 @@ use DOMDocument; use DOMElement; use Grav\Common\Page\Interfaces\PageInterface; use Grav\Common\Page\Markdown\Excerpts as ExcerptsObject; +use Grav\Common\Page\Medium\Link; use Grav\Common\Page\Medium\Medium; use function is_array; @@ -179,7 +180,7 @@ class Excerpts * @param Medium $medium * @param string|array $url * @param PageInterface|null $page Page, defaults to the current page object - * @return Medium + * @return Medium|Link */ public static function processMediaActions($medium, $url, PageInterface $page = null) { diff --git a/system/src/Grav/Common/Language/Language.php b/system/src/Grav/Common/Language/Language.php index 49b1105c7..1d9e3e2d6 100644 --- a/system/src/Grav/Common/Language/Language.php +++ b/system/src/Grav/Common/Language/Language.php @@ -120,6 +120,7 @@ class Language * Sets the current supported languages manually * * @param array $langs + * @return void */ public function setLanguages($langs) { @@ -188,7 +189,7 @@ class Language /** * Gets current active language * - * @return string + * @return string|false */ public function getActive() { @@ -198,8 +199,8 @@ class Language /** * Sets active language manually * - * @param string $lang - * @return string|bool + * @param string|false $lang + * @return string|false */ public function setActive($lang) { @@ -382,6 +383,8 @@ class Language * $this->grav['language']->resetFallbackPageExtensions(); * $this->grav['pages']->init(); * ``` + * + * @return void */ public function resetFallbackPageExtensions() { @@ -607,7 +610,7 @@ class Language * * @param string $code * @param string $type - * @return bool + * @return string|false */ public function getLanguageCode($code, $type = 'name') { diff --git a/system/src/Grav/Common/Markdown/Parsedown.php b/system/src/Grav/Common/Markdown/Parsedown.php index a80bf34e1..6a6666f5e 100644 --- a/system/src/Grav/Common/Markdown/Parsedown.php +++ b/system/src/Grav/Common/Markdown/Parsedown.php @@ -23,7 +23,7 @@ class Parsedown extends \Parsedown /** * Parsedown constructor. * - * @param Excerpts|null $excerpts + * @param Excerpts|PageInterface|null $excerpts * @param array|null $defaults */ public function __construct($excerpts = null, $defaults = null) diff --git a/system/src/Grav/Common/Markdown/ParsedownExtra.php b/system/src/Grav/Common/Markdown/ParsedownExtra.php index eb90660fd..af4ee672b 100644 --- a/system/src/Grav/Common/Markdown/ParsedownExtra.php +++ b/system/src/Grav/Common/Markdown/ParsedownExtra.php @@ -24,7 +24,7 @@ class ParsedownExtra extends \ParsedownExtra /** * ParsedownExtra constructor. * - * @param Excerpts|null $excerpts + * @param Excerpts|PageInterface|null $excerpts * @param array|null $defaults * @throws Exception */ diff --git a/system/src/Grav/Common/Markdown/ParsedownGravTrait.php b/system/src/Grav/Common/Markdown/ParsedownGravTrait.php index b271303b2..28ececaf2 100644 --- a/system/src/Grav/Common/Markdown/ParsedownGravTrait.php +++ b/system/src/Grav/Common/Markdown/ParsedownGravTrait.php @@ -38,6 +38,7 @@ trait ParsedownGravTrait * * @param PageInterface|Excerpts|null $excerpts * @param array|null $defaults + * @return void */ protected function init($excerpts = null, $defaults = null) { @@ -89,6 +90,7 @@ trait ParsedownGravTrait * @param bool $continuable * @param bool $completable * @param int|null $index + * @return void */ public function addBlockType($type, $tag, $continuable = false, $completable = false, $index = null) { @@ -120,6 +122,7 @@ trait ParsedownGravTrait * @param string $type * @param string $tag * @param int|null $index + * @return void */ public function addInlineType($type, $tag, $index = null) { diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index 51c298b44..37e000b7b 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -249,12 +249,16 @@ class Pages /** * @param string $method + * @return void */ public function setCheckMethod($method): void { $this->check_method = strtolower($method); } + /** + * @return void + */ public function register(): void { $config = $this->grav['config']; diff --git a/system/src/Grav/Common/Uri.php b/system/src/Grav/Common/Uri.php index fdbcd8a95..47640973a 100644 --- a/system/src/Grav/Common/Uri.php +++ b/system/src/Grav/Common/Uri.php @@ -933,7 +933,7 @@ class Uri } /** - * @param $url + * @param string $url * @return array|false */ public static function parseUrl($url) diff --git a/system/src/Grav/Common/User/Access.php b/system/src/Grav/Common/User/Access.php index b2071e819..34766f4a4 100644 --- a/system/src/Grav/Common/User/Access.php +++ b/system/src/Grav/Common/User/Access.php @@ -17,6 +17,7 @@ use function is_bool; */ class Access extends \Grav\Framework\Acl\Access { + /** @var array[] */ private $aliases = [ 'admin.configuration.system' => ['admin.configuration_system'], 'admin.configuration.site' => ['admin.configuration_site', 'admin.settings'], diff --git a/system/src/Grav/Common/User/DataUser/User.php b/system/src/Grav/Common/User/DataUser/User.php index 0f328c801..690d7ce56 100644 --- a/system/src/Grav/Common/User/DataUser/User.php +++ b/system/src/Grav/Common/User/DataUser/User.php @@ -110,6 +110,8 @@ class User extends Data implements UserInterface /** * Save user without the username + * + * @return void */ public function save() { diff --git a/system/src/Grav/Common/User/Group.php b/system/src/Grav/Common/User/Group.php index 58299751c..404385762 100644 --- a/system/src/Grav/Common/User/Group.php +++ b/system/src/Grav/Common/User/Group.php @@ -91,6 +91,8 @@ class Group extends Data /** * Save a group + * + * @return void */ public function save() { diff --git a/system/src/Grav/Framework/Acl/Access.php b/system/src/Grav/Framework/Acl/Access.php index 7a8681528..ff2af3f34 100644 --- a/system/src/Grav/Framework/Acl/Access.php +++ b/system/src/Grav/Framework/Acl/Access.php @@ -11,6 +11,10 @@ namespace Grav\Framework\Acl; use Grav\Common\Utils; +/** + * Class Access + * @package Grav\Framework\Acl + */ class Access implements \JsonSerializable, \IteratorAggregate, \Countable { /** @var string */ @@ -53,6 +57,7 @@ class Access implements \JsonSerializable, \IteratorAggregate, \Countable /** * @param Access $parent * @param string|null $name + * @return void */ public function inherit(Access $parent, string $name = null) { diff --git a/system/src/Grav/Framework/Acl/Action.php b/system/src/Grav/Framework/Acl/Action.php index a288897ab..e37606ef8 100644 --- a/system/src/Grav/Framework/Acl/Action.php +++ b/system/src/Grav/Framework/Acl/Action.php @@ -95,12 +95,16 @@ class Action implements \IteratorAggregate, \Countable /** * @param Action|null $parent + * @return void */ public function setParent(?Action $parent): void { $this->parent = $parent; } + /** + * @return string + */ public function getScope(): string { $pos = strpos($this->name, '.'); @@ -111,6 +115,9 @@ class Action implements \IteratorAggregate, \Countable return $this->name; } + /** + * @return int + */ public function getLevels(): int { return substr_count($this->name, '.'); @@ -143,6 +150,7 @@ class Action implements \IteratorAggregate, \Countable /** * @param Action $child + * @return void */ public function addChild(Action $child): void { diff --git a/system/src/Grav/Framework/Acl/Permissions.php b/system/src/Grav/Framework/Acl/Permissions.php index de6286d3d..75499ce94 100644 --- a/system/src/Grav/Framework/Acl/Permissions.php +++ b/system/src/Grav/Framework/Acl/Permissions.php @@ -9,6 +9,10 @@ namespace Grav\Framework\Acl; +/** + * Class Permissions + * @package Grav\Framework\Acl + */ class Permissions implements \ArrayAccess, \Countable, \IteratorAggregate { /** @var Action[] */ @@ -51,6 +55,7 @@ class Permissions implements \ArrayAccess, \Countable, \IteratorAggregate /** * @param Action $action + * @return void */ public function addAction(Action $action): void { @@ -80,6 +85,7 @@ class Permissions implements \ArrayAccess, \Countable, \IteratorAggregate /** * @param Action[] $actions + * @return void */ public function addActions(array $actions): void { @@ -107,7 +113,9 @@ class Permissions implements \ArrayAccess, \Countable, \IteratorAggregate } /** + * @param string $name * @param array $type + * @return void */ public function addType(string $name, array $type): void { @@ -124,6 +132,7 @@ class Permissions implements \ArrayAccess, \Countable, \IteratorAggregate /** * @param array $types + * @return void */ public function addTypes(array $types): void { @@ -165,6 +174,7 @@ class Permissions implements \ArrayAccess, \Countable, \IteratorAggregate /** * @param int|string $offset * @param mixed $value + * @return void */ public function offsetSet($offset, $value): void { @@ -173,6 +183,7 @@ class Permissions implements \ArrayAccess, \Countable, \IteratorAggregate /** * @param int|string $offset + * @return void */ public function offsetUnset($offset): void { diff --git a/system/src/Grav/Framework/Acl/PermissionsReader.php b/system/src/Grav/Framework/Acl/PermissionsReader.php index 29b292f74..ae3538aa8 100644 --- a/system/src/Grav/Framework/Acl/PermissionsReader.php +++ b/system/src/Grav/Framework/Acl/PermissionsReader.php @@ -11,8 +11,13 @@ namespace Grav\Framework\Acl; use Grav\Common\File\CompiledYamlFile; +/** + * Class PermissionsReader + * @package Grav\Framework\Acl + */ class PermissionsReader { + /** @var array */ private static $types; /** @@ -21,7 +26,6 @@ class PermissionsReader */ public static function fromYaml(string $filename): array { - /** @var array $content */ $content = CompiledYamlFile::instance($filename)->content(); $actions = $content['actions'] ?? []; $types = $content['types'] ?? []; @@ -77,6 +81,7 @@ class PermissionsReader /** * @param array $types + * @return void */ protected static function initTypes(array $types) { diff --git a/system/src/Grav/Framework/Cache/Adapter/ChainCache.php b/system/src/Grav/Framework/Cache/Adapter/ChainCache.php index ce240b347..0c0e3ef81 100644 --- a/system/src/Grav/Framework/Cache/Adapter/ChainCache.php +++ b/system/src/Grav/Framework/Cache/Adapter/ChainCache.php @@ -117,6 +117,7 @@ class ChainCache extends AbstractCache while ($i--) { $success = $this->caches[$i]->doClear() && $success; } + return $success; } @@ -144,7 +145,7 @@ class ChainCache extends AbstractCache $values = []; /** * @var int $i - * @var CacheInterface $cache + * @var CacheInterface $items */ foreach (array_reverse($list) as $i => $items) { $values += $items; diff --git a/system/src/Grav/Framework/Cache/Adapter/DoctrineCache.php b/system/src/Grav/Framework/Cache/Adapter/DoctrineCache.php index 895b2eeca..933fd6ac3 100644 --- a/system/src/Grav/Framework/Cache/Adapter/DoctrineCache.php +++ b/system/src/Grav/Framework/Cache/Adapter/DoctrineCache.php @@ -97,7 +97,6 @@ class DoctrineCache extends AbstractCache /** * @inheritdoc - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException */ public function doDeleteMultiple($keys) { diff --git a/system/src/Grav/Framework/Cache/Adapter/FileCache.php b/system/src/Grav/Framework/Cache/Adapter/FileCache.php index 6e3c97bd7..3f11cd364 100644 --- a/system/src/Grav/Framework/Cache/Adapter/FileCache.php +++ b/system/src/Grav/Framework/Cache/Adapter/FileCache.php @@ -28,7 +28,11 @@ class FileCache extends AbstractCache private $tmp; /** - * @inheritdoc + * FileCache constructor. + * @param string $namespace + * @param int|null $defaultLifetime + * @param string|null $folder + * @throws InvalidArgumentException */ public function __construct($namespace = '', $defaultLifetime = null, $folder = null) { @@ -67,7 +71,7 @@ class FileCache extends AbstractCache /** * @inheritdoc - * @throws \Psr\SimpleCache\CacheException|InvalidArgumentException + * @throws CacheException */ public function doSet($key, $value, $ttl) { @@ -141,7 +145,8 @@ class FileCache extends AbstractCache /** * @param string $namespace * @param string $directory - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @return void + * @throws InvalidArgumentException */ protected function initFileCache($namespace, $directory) { @@ -197,6 +202,7 @@ class FileCache extends AbstractCache /** * @param string $dir + * @return void * @throws \RuntimeException */ private function mkdir($dir) @@ -218,6 +224,11 @@ class FileCache extends AbstractCache } /** + * @param int $type + * @param string $message + * @param string $file + * @param int $line + * @return bool * @internal * @throws \ErrorException */ diff --git a/system/src/Grav/Framework/Cache/Adapter/MemoryCache.php b/system/src/Grav/Framework/Cache/Adapter/MemoryCache.php index 2335e16c5..2f416e354 100644 --- a/system/src/Grav/Framework/Cache/Adapter/MemoryCache.php +++ b/system/src/Grav/Framework/Cache/Adapter/MemoryCache.php @@ -23,6 +23,11 @@ class MemoryCache extends AbstractCache /** @var array */ protected $cache = []; + /** + * @param string $key + * @param mixed $miss + * @return mixed + */ public function doGet($key, $miss) { if (!array_key_exists($key, $this->cache)) { @@ -32,6 +37,12 @@ class MemoryCache extends AbstractCache return $this->cache[$key]; } + /** + * @param string $key + * @param mixed $value + * @param int $ttl + * @return bool + */ public function doSet($key, $value, $ttl) { $this->cache[$key] = $value; @@ -39,6 +50,10 @@ class MemoryCache extends AbstractCache return true; } + /** + * @param string $key + * @return bool + */ public function doDelete($key) { unset($this->cache[$key]); @@ -46,6 +61,9 @@ class MemoryCache extends AbstractCache return true; } + /** + * @return bool + */ public function doClear() { $this->cache = []; @@ -53,6 +71,10 @@ class MemoryCache extends AbstractCache return true; } + /** + * @param string $key + * @return bool + */ public function doHas($key) { return array_key_exists($key, $this->cache); diff --git a/system/src/Grav/Framework/Cache/Adapter/SessionCache.php b/system/src/Grav/Framework/Cache/Adapter/SessionCache.php index 4f8c02774..96ceab5b6 100644 --- a/system/src/Grav/Framework/Cache/Adapter/SessionCache.php +++ b/system/src/Grav/Framework/Cache/Adapter/SessionCache.php @@ -21,6 +21,11 @@ class SessionCache extends AbstractCache public const VALUE = 0; public const LIFETIME = 1; + /** + * @param string $key + * @param mixed $miss + * @return mixed + */ public function doGet($key, $miss) { $stored = $this->doGetStored($key); @@ -28,6 +33,12 @@ class SessionCache extends AbstractCache return $stored ? $stored[self::VALUE] : $miss; } + /** + * @param string $key + * @param mixed $value + * @param int $ttl + * @return bool + */ public function doSet($key, $value, $ttl) { $stored = [self::VALUE => $value]; @@ -40,6 +51,10 @@ class SessionCache extends AbstractCache return true; } + /** + * @param string $key + * @return bool + */ public function doDelete($key) { unset($_SESSION[$this->getNamespace()][$key]); @@ -47,6 +62,9 @@ class SessionCache extends AbstractCache return true; } + /** + * @return bool + */ public function doClear() { unset($_SESSION[$this->getNamespace()]); @@ -54,16 +72,27 @@ class SessionCache extends AbstractCache return true; } + /** + * @param string $key + * @return bool + */ public function doHas($key) { return $this->doGetStored($key) !== null; } + /** + * @return string + */ public function getNamespace() { return 'cache-' . parent::getNamespace(); } + /** + * @param string $key + * @return mixed|null + */ protected function doGetStored($key) { $stored = $_SESSION[$this->getNamespace()][$key] ?? null; diff --git a/system/src/Grav/Framework/Cache/CacheInterface.php b/system/src/Grav/Framework/Cache/CacheInterface.php index 0ec2f797c..8b1936674 100644 --- a/system/src/Grav/Framework/Cache/CacheInterface.php +++ b/system/src/Grav/Framework/Cache/CacheInterface.php @@ -17,12 +17,55 @@ use Psr\SimpleCache\CacheInterface as SimpleCacheInterface; */ interface CacheInterface extends SimpleCacheInterface { + /** + * @param string $key + * @param mixed $miss + * @return mixed + */ public function doGet($key, $miss); + + /** + * @param string $key + * @param mixed $value + * @param int|null $ttl + * @return mixed + */ public function doSet($key, $value, $ttl); + + /** + * @param string $key + * @return mixed + */ public function doDelete($key); + + /** + * @return bool + */ public function doClear(); + + /** + * @param string[] $keys + * @param mixed $miss + * @return mixed + */ public function doGetMultiple($keys, $miss); + + /** + * @param array $values + * @param int|null $ttl + * @return mixed + */ public function doSetMultiple($values, $ttl); + + /** + * @param string[] $keys + * @return mixed + */ public function doDeleteMultiple($keys); + + /** + * @param string $key + * @return mixed + */ public function doHas($key); } diff --git a/system/src/Grav/Framework/Cache/CacheTrait.php b/system/src/Grav/Framework/Cache/CacheTrait.php index 2a3748182..8dd0407a0 100644 --- a/system/src/Grav/Framework/Cache/CacheTrait.php +++ b/system/src/Grav/Framework/Cache/CacheTrait.php @@ -19,13 +19,10 @@ trait CacheTrait { /** @var string */ private $namespace = ''; - /** @var int|null */ private $defaultLifetime = null; - /** @var \stdClass */ private $miss; - /** @var bool */ private $validation = true; @@ -34,7 +31,8 @@ trait CacheTrait * * @param string $namespace * @param null|int|\DateInterval $defaultLifetime - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @return void + * @throws InvalidArgumentException */ protected function init($namespace = '', $defaultLifetime = null) { @@ -45,6 +43,7 @@ trait CacheTrait /** * @param bool $validation + * @return void */ public function setValidation($validation) { @@ -68,8 +67,10 @@ trait CacheTrait } /** - * @inheritdoc - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @param string $key + * @param mixed|null $default + * @return mixed|null + * @throws InvalidArgumentException */ public function get($key, $default = null) { @@ -81,8 +82,11 @@ trait CacheTrait } /** - * @inheritdoc - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @param string $key + * @param mixed $value + * @param null|int|\DateInterval $ttl + * @return bool + * @throws InvalidArgumentException */ public function set($key, $value, $ttl = null) { @@ -95,8 +99,9 @@ trait CacheTrait } /** - * @inheritdoc - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @param string $key + * @return bool + * @throws InvalidArgumentException */ public function delete($key) { @@ -106,7 +111,7 @@ trait CacheTrait } /** - * @inheritdoc + * @return bool */ public function clear() { @@ -114,8 +119,10 @@ trait CacheTrait } /** - * @inheritdoc - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @param iterable $keys + * @param mixed|null $default + * @return iterable + * @throws InvalidArgumentException */ public function getMultiple($keys, $default = null) { @@ -158,8 +165,10 @@ trait CacheTrait } /** - * @inheritdoc - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @param iterable $values + * @param null|int|\DateInterval $ttl + * @return bool + * @throws InvalidArgumentException */ public function setMultiple($values, $ttl = null) { @@ -190,8 +199,9 @@ trait CacheTrait } /** - * @inheritdoc - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @param iterable $keys + * @return bool + * @throws InvalidArgumentException */ public function deleteMultiple($keys) { @@ -217,8 +227,9 @@ trait CacheTrait } /** - * @inheritdoc - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @param string $key + * @return bool + * @throws InvalidArgumentException */ public function has($key) { @@ -227,11 +238,6 @@ trait CacheTrait return $this->doHas($key); } - abstract public function doGet($key, $miss); - abstract public function doSet($key, $value, $ttl); - abstract public function doDelete($key); - abstract public function doClear(); - /** * @param array $keys * @param mixed $miss @@ -282,11 +288,10 @@ trait CacheTrait return $success; } - abstract public function doHas($key); - /** * @param string|mixed $key - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @return void + * @throws InvalidArgumentException */ protected function validateKey($key) { @@ -315,7 +320,8 @@ trait CacheTrait /** * @param array $keys - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @return void + * @throws InvalidArgumentException */ protected function validateKeys($keys) { @@ -331,7 +337,7 @@ trait CacheTrait /** * @param null|int|\DateInterval $ttl * @return int|null - * @throws \Psr\SimpleCache\InvalidArgumentException|InvalidArgumentException + * @throws InvalidArgumentException */ protected function convertTtl($ttl) { diff --git a/system/src/Grav/Framework/Collection/AbstractFileCollection.php b/system/src/Grav/Framework/Collection/AbstractFileCollection.php index eed315dc2..f21e04285 100644 --- a/system/src/Grav/Framework/Collection/AbstractFileCollection.php +++ b/system/src/Grav/Framework/Collection/AbstractFileCollection.php @@ -24,19 +24,14 @@ class AbstractFileCollection extends AbstractLazyCollection implements FileColle { /** @var string */ protected $path; - /** @var \RecursiveDirectoryIterator|RecursiveUniformResourceIterator */ protected $iterator; - /** @var callable */ protected $createObjectFunction; - /** @var callable|null */ protected $filterFunction; - /** @var int */ protected $flags; - /** @var int */ protected $nestingLimit; @@ -108,6 +103,9 @@ class AbstractFileCollection extends AbstractLazyCollection implements FileColle return new ArrayCollection($filtered); } + /** + * @return void + */ protected function setIterator() { $iteratorFlags = \RecursiveDirectoryIterator::SKIP_DOTS + \FilesystemIterator::UNIX_PATHS @@ -151,6 +149,11 @@ class AbstractFileCollection extends AbstractLazyCollection implements FileColle $this->collection = new ArrayCollection($filtered); } + /** + * @param \SeekableIterator $iterator + * @param int $nestingLimit + * @return array + */ protected function doInitializeByIterator(\SeekableIterator $iterator, $nestingLimit) { $children = []; @@ -193,6 +196,7 @@ class AbstractFileCollection extends AbstractLazyCollection implements FileColle /** * @param array $children + * @param int $nestingLimit * @return array */ protected function doInitializeChildren(array $children, $nestingLimit) diff --git a/system/src/Grav/Framework/Collection/AbstractIndexCollection.php b/system/src/Grav/Framework/Collection/AbstractIndexCollection.php index b82b0a8eb..872f2fb14 100644 --- a/system/src/Grav/Framework/Collection/AbstractIndexCollection.php +++ b/system/src/Grav/Framework/Collection/AbstractIndexCollection.php @@ -18,7 +18,9 @@ use Grav\Framework\Flex\Interfaces\FlexObjectInterface; */ abstract class AbstractIndexCollection implements CollectionInterface { - /** @var array */ + /** + * @var array + */ private $entries; /** @@ -416,6 +418,7 @@ abstract class AbstractIndexCollection implements CollectionInterface } /** + * @return string * @return string */ public function serialize() @@ -425,6 +428,7 @@ abstract class AbstractIndexCollection implements CollectionInterface /** * @param string $serialized + * @return void */ public function unserialize($serialized) { @@ -450,7 +454,6 @@ abstract class AbstractIndexCollection implements CollectionInterface * instance should be created when constructor semantics have changed. * * @param array $entries Elements. - * * @return static */ protected function createFrom(array $entries) @@ -468,6 +471,7 @@ abstract class AbstractIndexCollection implements CollectionInterface /** * @param array $entries + * @return void */ protected function setEntries(array $entries): void { diff --git a/system/src/Grav/Framework/Collection/ArrayCollection.php b/system/src/Grav/Framework/Collection/ArrayCollection.php index 44e33c6a6..43b70adf0 100644 --- a/system/src/Grav/Framework/Collection/ArrayCollection.php +++ b/system/src/Grav/Framework/Collection/ArrayCollection.php @@ -57,7 +57,7 @@ class ArrayCollection extends BaseArrayCollection implements CollectionInterface * * Collection is returned in the order of $keys given to the function. * - * @param array $keys + * @param array $keys * @return static */ public function select(array $keys) @@ -75,7 +75,7 @@ class ArrayCollection extends BaseArrayCollection implements CollectionInterface /** * Un-select items from collection. * - * @param array $keys + * @param array $keys * @return static */ public function unselect(array $keys) diff --git a/system/src/Grav/Framework/Collection/CollectionInterface.php b/system/src/Grav/Framework/Collection/CollectionInterface.php index be0b66c8a..52f017977 100644 --- a/system/src/Grav/Framework/Collection/CollectionInterface.php +++ b/system/src/Grav/Framework/Collection/CollectionInterface.php @@ -21,14 +21,14 @@ interface CollectionInterface extends Collection, \JsonSerializable /** * Reverse the order of the items. * - * @return static|CollectionInterface + * @return CollectionInterface */ public function reverse(); /** * Shuffle items. * - * @return static|CollectionInterface + * @return CollectionInterface */ public function shuffle(); @@ -45,16 +45,16 @@ interface CollectionInterface extends Collection, \JsonSerializable * * Collection is returned in the order of $keys given to the function. * - * @param array $keys - * @return static|CollectionInterface + * @param array $keys + * @return CollectionInterface */ public function select(array $keys); /** * Un-select items from collection. * - * @param array $keys - * @return static|CollectionInterface + * @param array $keys + * @return CollectionInterface */ public function unselect(array $keys); } diff --git a/system/src/Grav/Framework/ContentBlock/ContentBlock.php b/system/src/Grav/Framework/ContentBlock/ContentBlock.php index 38be0ef1a..4c24bdc12 100644 --- a/system/src/Grav/Framework/ContentBlock/ContentBlock.php +++ b/system/src/Grav/Framework/ContentBlock/ContentBlock.php @@ -39,7 +39,7 @@ class ContentBlock implements ContentBlockInterface protected $cached = true; /** - * @param string $id + * @param string|null $id * @return static */ public static function create($id = null) @@ -75,7 +75,7 @@ class ContentBlock implements ContentBlockInterface /** * Block constructor. * - * @param string $id + * @param string|null $id */ public function __construct($id = null) { diff --git a/system/src/Grav/Framework/ContentBlock/ContentBlockInterface.php b/system/src/Grav/Framework/ContentBlock/ContentBlockInterface.php index bc76bbadf..6eff141e6 100644 --- a/system/src/Grav/Framework/ContentBlock/ContentBlockInterface.php +++ b/system/src/Grav/Framework/ContentBlock/ContentBlockInterface.php @@ -16,7 +16,7 @@ namespace Grav\Framework\ContentBlock; interface ContentBlockInterface extends \Serializable { /** - * @param string $id + * @param string|null $id * @return static */ public static function create($id = null); @@ -28,7 +28,7 @@ interface ContentBlockInterface extends \Serializable public static function fromArray(array $serialized); /** - * @param string $id + * @param string|null $id */ public function __construct($id = null); diff --git a/system/src/Grav/Framework/ContentBlock/HtmlBlock.php b/system/src/Grav/Framework/ContentBlock/HtmlBlock.php index 2d3373347..3aaf80631 100644 --- a/system/src/Grav/Framework/ContentBlock/HtmlBlock.php +++ b/system/src/Grav/Framework/ContentBlock/HtmlBlock.php @@ -79,7 +79,7 @@ class HtmlBlock extends ContentBlock implements HtmlBlockInterface } /** - * @return array[] + * @return array */ public function toArray() { diff --git a/system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php b/system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php index 69077edc9..3e22c759d 100644 --- a/system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php +++ b/system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php @@ -20,6 +20,10 @@ use Grav\Framework\Route\Route; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; +/** + * Trait ControllerResponseTrait + * @package Grav\Framework\Controller\Traits + */ trait ControllerResponseTrait { /** diff --git a/system/src/Grav/Framework/DI/Container.php b/system/src/Grav/Framework/DI/Container.php index 0fa64d892..bd0c336a3 100644 --- a/system/src/Grav/Framework/DI/Container.php +++ b/system/src/Grav/Framework/DI/Container.php @@ -15,11 +15,19 @@ use Psr\Container\ContainerInterface; class Container extends \Pimple\Container implements ContainerInterface { + /** + * @param string $id + * @return mixed + */ public function get($id) { return $this->offsetGet($id); } + /** + * @param string $id + * @return bool + */ public function has($id): bool { return $this->offsetExists($id); diff --git a/system/src/Grav/Framework/File/AbstractFile.php b/system/src/Grav/Framework/File/AbstractFile.php index a2eda44c7..fe4b20332 100644 --- a/system/src/Grav/Framework/File/AbstractFile.php +++ b/system/src/Grav/Framework/File/AbstractFile.php @@ -14,29 +14,26 @@ namespace Grav\Framework\File; use Grav\Framework\File\Interfaces\FileInterface; use Grav\Framework\Filesystem\Filesystem; +/** + * Class AbstractFile + * @package Grav\Framework\File + */ class AbstractFile implements FileInterface { /** @var Filesystem */ private $filesystem; - /** @var string */ private $filepath; - /** @var string|null */ private $filename; - /** @var string|null */ private $path; - /** @var string|null */ private $basename; - /** @var string|null */ private $extension; - /** @var resource|null */ private $handle; - /** @var bool */ private $locked = false; @@ -60,6 +57,9 @@ class AbstractFile implements FileInterface } } + /** + * @return void + */ public function __clone() { $this->handle = null; @@ -76,6 +76,7 @@ class AbstractFile implements FileInterface /** * @param string $serialized + * @return void */ public function unserialize($serialized): void { @@ -368,6 +369,7 @@ class AbstractFile implements FileInterface /** * @param array $serialized + * @return void */ protected function doUnserialize(array $serialized): void { diff --git a/system/src/Grav/Framework/File/DataFile.php b/system/src/Grav/Framework/File/DataFile.php index 77671c56d..108e4da32 100644 --- a/system/src/Grav/Framework/File/DataFile.php +++ b/system/src/Grav/Framework/File/DataFile.php @@ -14,6 +14,10 @@ namespace Grav\Framework\File; use Grav\Framework\File\Interfaces\FileFormatterInterface; use RuntimeException; +/** + * Class DataFile + * @package Grav\Framework\File + */ class DataFile extends AbstractFile { /** @var FileFormatterInterface */ diff --git a/system/src/Grav/Framework/File/File.php b/system/src/Grav/Framework/File/File.php index acfc8aaee..d9417044f 100644 --- a/system/src/Grav/Framework/File/File.php +++ b/system/src/Grav/Framework/File/File.php @@ -11,6 +11,10 @@ declare(strict_types=1); namespace Grav\Framework\File; +/** + * Class File + * @package Grav\Framework\File + */ class File extends AbstractFile { /** diff --git a/system/src/Grav/Framework/File/Formatter/AbstractFormatter.php b/system/src/Grav/Framework/File/Formatter/AbstractFormatter.php index 890b23e2f..a47320e45 100644 --- a/system/src/Grav/Framework/File/Formatter/AbstractFormatter.php +++ b/system/src/Grav/Framework/File/Formatter/AbstractFormatter.php @@ -122,6 +122,7 @@ abstract class AbstractFormatter implements FileFormatterInterface * Note: if overridden, make sure you call parent::doUnserialize() * * @param array $serialized + * @return void */ protected function doUnserialize(array $serialized): void { diff --git a/system/src/Grav/Framework/File/Formatter/CsvFormatter.php b/system/src/Grav/Framework/File/Formatter/CsvFormatter.php index 29a5c2d30..ed104adc9 100644 --- a/system/src/Grav/Framework/File/Formatter/CsvFormatter.php +++ b/system/src/Grav/Framework/File/Formatter/CsvFormatter.php @@ -13,6 +13,10 @@ namespace Grav\Framework\File\Formatter; use Grav\Framework\File\Interfaces\FileFormatterInterface; +/** + * Class CsvFormatter + * @package Grav\Framework\File\Formatter + */ class CsvFormatter extends AbstractFormatter { /** diff --git a/system/src/Grav/Framework/File/Formatter/FormatterInterface.php b/system/src/Grav/Framework/File/Formatter/FormatterInterface.php index 7beeefb34..757e229d9 100644 --- a/system/src/Grav/Framework/File/Formatter/FormatterInterface.php +++ b/system/src/Grav/Framework/File/Formatter/FormatterInterface.php @@ -9,4 +9,4 @@ use Grav\Framework\File\Interfaces\FileFormatterInterface; */ interface FormatterInterface extends FileFormatterInterface { -}; +} diff --git a/system/src/Grav/Framework/File/Formatter/IniFormatter.php b/system/src/Grav/Framework/File/Formatter/IniFormatter.php index 0fe950e45..81b4f84e9 100644 --- a/system/src/Grav/Framework/File/Formatter/IniFormatter.php +++ b/system/src/Grav/Framework/File/Formatter/IniFormatter.php @@ -13,6 +13,10 @@ namespace Grav\Framework\File\Formatter; use Grav\Framework\File\Interfaces\FileFormatterInterface; +/** + * Class IniFormatter + * @package Grav\Framework\File\Formatter + */ class IniFormatter extends AbstractFormatter { /** diff --git a/system/src/Grav/Framework/File/Formatter/JsonFormatter.php b/system/src/Grav/Framework/File/Formatter/JsonFormatter.php index 16541131f..86df07c45 100644 --- a/system/src/Grav/Framework/File/Formatter/JsonFormatter.php +++ b/system/src/Grav/Framework/File/Formatter/JsonFormatter.php @@ -15,8 +15,13 @@ use Grav\Framework\File\Interfaces\FileFormatterInterface; use function is_int; use function is_string; +/** + * Class JsonFormatter + * @package Grav\Framework\File\Formatter + */ class JsonFormatter extends AbstractFormatter { + /** @var array */ protected $encodeOptions = [ 'JSON_FORCE_OBJECT' => JSON_FORCE_OBJECT, 'JSON_HEX_QUOT' => JSON_HEX_QUOT, @@ -35,6 +40,7 @@ class JsonFormatter extends AbstractFormatter //'JSON_THROW_ON_ERROR' => JSON_THROW_ON_ERROR // PHP 7.3 ]; + /** @var array */ protected $decodeOptions = [ 'JSON_BIGINT_AS_STRING' => JSON_BIGINT_AS_STRING, 'JSON_INVALID_UTF8_IGNORE' => JSON_INVALID_UTF8_IGNORE, diff --git a/system/src/Grav/Framework/File/Formatter/MarkdownFormatter.php b/system/src/Grav/Framework/File/Formatter/MarkdownFormatter.php index e7c424c4c..996f495e4 100644 --- a/system/src/Grav/Framework/File/Formatter/MarkdownFormatter.php +++ b/system/src/Grav/Framework/File/Formatter/MarkdownFormatter.php @@ -13,6 +13,10 @@ namespace Grav\Framework\File\Formatter; use Grav\Framework\File\Interfaces\FileFormatterInterface; +/** + * Class MarkdownFormatter + * @package Grav\Framework\File\Formatter + */ class MarkdownFormatter extends AbstractFormatter { /** @var FileFormatterInterface */ diff --git a/system/src/Grav/Framework/File/Formatter/SerializeFormatter.php b/system/src/Grav/Framework/File/Formatter/SerializeFormatter.php index 3aaba337d..28483aaa8 100644 --- a/system/src/Grav/Framework/File/Formatter/SerializeFormatter.php +++ b/system/src/Grav/Framework/File/Formatter/SerializeFormatter.php @@ -13,6 +13,10 @@ namespace Grav\Framework\File\Formatter; use Grav\Framework\File\Interfaces\FileFormatterInterface; +/** + * Class SerializeFormatter + * @package Grav\Framework\File\Formatter + */ class SerializeFormatter extends AbstractFormatter { /** diff --git a/system/src/Grav/Framework/File/Formatter/YamlFormatter.php b/system/src/Grav/Framework/File/Formatter/YamlFormatter.php index 61c3c9e2c..ad07a4bc5 100644 --- a/system/src/Grav/Framework/File/Formatter/YamlFormatter.php +++ b/system/src/Grav/Framework/File/Formatter/YamlFormatter.php @@ -17,8 +17,16 @@ use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Yaml as YamlParser; use RocketTheme\Toolbox\Compat\Yaml\Yaml as FallbackYamlParser; +/** + * Class YamlFormatter + * @package Grav\Framework\File\Formatter + */ class YamlFormatter extends AbstractFormatter { + /** + * YamlFormatter constructor. + * @param array $config + */ public function __construct(array $config = []) { $config += [ diff --git a/system/src/Grav/Framework/File/Interfaces/FileFormatterInterface.php b/system/src/Grav/Framework/File/Interfaces/FileFormatterInterface.php index 00c16d4e3..eba66a8bd 100644 --- a/system/src/Grav/Framework/File/Interfaces/FileFormatterInterface.php +++ b/system/src/Grav/Framework/File/Interfaces/FileFormatterInterface.php @@ -54,7 +54,6 @@ interface FileFormatterInterface extends \Serializable * Encode data into a string. * * @param mixed $data Data to be encoded. - * * @return string Returns encoded data as a string. * @api */ @@ -64,7 +63,6 @@ interface FileFormatterInterface extends \Serializable * Decode a string into data. * * @param string $data String to be decoded. - * * @return mixed Returns decoded data. * @api */ diff --git a/system/src/Grav/Framework/Filesystem/Filesystem.php b/system/src/Grav/Framework/Filesystem/Filesystem.php index a2b76d9b3..b272b9446 100644 --- a/system/src/Grav/Framework/Filesystem/Filesystem.php +++ b/system/src/Grav/Framework/Filesystem/Filesystem.php @@ -13,6 +13,10 @@ namespace Grav\Framework\Filesystem; use Grav\Framework\Filesystem\Interfaces\FilesystemInterface; +/** + * Class Filesystem + * @package Grav\Framework\Filesystem + */ class Filesystem implements FilesystemInterface { /** @var bool|null */ diff --git a/system/src/Grav/Framework/Flex/FlexIndex.php b/system/src/Grav/Framework/Flex/FlexIndex.php index f9ef00113..ccd1e5882 100644 --- a/system/src/Grav/Framework/Flex/FlexIndex.php +++ b/system/src/Grav/Framework/Flex/FlexIndex.php @@ -30,6 +30,10 @@ use function count; use function get_class; use function in_array; +/** + * Class FlexIndex + * @package Grav\Framework\Flex + */ class FlexIndex extends ObjectIndex implements FlexCollectionInterface, FlexIndexInterface { const VERSION = 1; diff --git a/system/src/Grav/Framework/Flex/Pages/FlexPageCollection.php b/system/src/Grav/Framework/Flex/Pages/FlexPageCollection.php index 04bb97b0a..d3c5b445a 100644 --- a/system/src/Grav/Framework/Flex/Pages/FlexPageCollection.php +++ b/system/src/Grav/Framework/Flex/Pages/FlexPageCollection.php @@ -49,7 +49,7 @@ class FlexPageCollection extends FlexCollection /** * @param bool $bool - * @return FlexCollectionInterface|FlexPageCollection + * @return static */ public function withPublished(bool $bool = true) { @@ -60,7 +60,7 @@ class FlexPageCollection extends FlexCollection /** * @param bool $bool - * @return FlexCollectionInterface|FlexPageCollection + * @return static */ public function withVisible(bool $bool = true) { @@ -71,7 +71,7 @@ class FlexPageCollection extends FlexCollection /** * @param bool $bool - * @return FlexCollectionInterface|FlexPageCollection + * @return static */ public function withRoutable(bool $bool = true) { diff --git a/system/src/Grav/Framework/Flex/Storage/AbstractFilesystemStorage.php b/system/src/Grav/Framework/Flex/Storage/AbstractFilesystemStorage.php index 785c99ab6..45b9a9e46 100644 --- a/system/src/Grav/Framework/Flex/Storage/AbstractFilesystemStorage.php +++ b/system/src/Grav/Framework/Flex/Storage/AbstractFilesystemStorage.php @@ -151,7 +151,7 @@ abstract class AbstractFilesystemStorage implements FlexStorageInterface /** * @param string $filename - * @return File + * @return CompiledJsonFile|CompiledYamlFile|CompiledMarkdownFile */ protected function getFile(string $filename) { diff --git a/system/src/Grav/Framework/Form/FormFlash.php b/system/src/Grav/Framework/Form/FormFlash.php index 744fb820b..b33e44ded 100644 --- a/system/src/Grav/Framework/Form/FormFlash.php +++ b/system/src/Grav/Framework/Form/FormFlash.php @@ -18,6 +18,10 @@ use Psr\Http\Message\UploadedFileInterface; use RocketTheme\Toolbox\File\YamlFile; use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator; +/** + * Class FormFlash + * @package Grav\Framework\Form + */ class FormFlash implements FormFlashInterface { /** @var bool */ diff --git a/system/src/Grav/Framework/Form/FormFlashFile.php b/system/src/Grav/Framework/Form/FormFlashFile.php index c604e6470..2a13be927 100644 --- a/system/src/Grav/Framework/Form/FormFlashFile.php +++ b/system/src/Grav/Framework/Form/FormFlashFile.php @@ -13,6 +13,10 @@ use Grav\Framework\Psr7\Stream; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UploadedFileInterface; +/** + * Class FormFlashFile + * @package Grav\Framework\Form + */ class FormFlashFile implements UploadedFileInterface, \JsonSerializable { /** @var string */ diff --git a/system/src/Grav/Framework/Form/Interfaces/FormFactoryInterface.php b/system/src/Grav/Framework/Form/Interfaces/FormFactoryInterface.php index fb57db19f..edf8e36cc 100644 --- a/system/src/Grav/Framework/Form/Interfaces/FormFactoryInterface.php +++ b/system/src/Grav/Framework/Form/Interfaces/FormFactoryInterface.php @@ -14,6 +14,10 @@ namespace Grav\Framework\Form\Interfaces; use Grav\Common\Page\Interfaces\PageInterface; use Grav\Common\Page\Page; +/** + * Interface FormFactoryInterface + * @package Grav\Framework\Form\Interfaces + */ interface FormFactoryInterface { /** diff --git a/system/src/Grav/Framework/Form/Interfaces/FormFlashInterface.php b/system/src/Grav/Framework/Form/Interfaces/FormFlashInterface.php index 72d13e2c5..61fd290ac 100644 --- a/system/src/Grav/Framework/Form/Interfaces/FormFlashInterface.php +++ b/system/src/Grav/Framework/Form/Interfaces/FormFlashInterface.php @@ -11,6 +11,10 @@ namespace Grav\Framework\Form\Interfaces; use Psr\Http\Message\UploadedFileInterface; +/** + * Interface FormFlashInterface + * @package Grav\Framework\Form\Interfaces + */ interface FormFlashInterface extends \JsonSerializable { /** diff --git a/system/src/Grav/Framework/Form/Traits/FormTrait.php b/system/src/Grav/Framework/Form/Traits/FormTrait.php index 8bfb8bf6f..81ae4add6 100644 --- a/system/src/Grav/Framework/Form/Traits/FormTrait.php +++ b/system/src/Grav/Framework/Form/Traits/FormTrait.php @@ -684,15 +684,6 @@ trait FormTrait ]; } - /** - * Form submit logic goes here. - * - * @param array $data - * @param array $files - * @return mixed - */ - abstract protected function doSubmit(array $data, array $files); - /** * Validate data and throw validation exceptions if validation fails. * diff --git a/system/src/Grav/Framework/Object/Access/ArrayAccessTrait.php b/system/src/Grav/Framework/Object/Access/ArrayAccessTrait.php index 691938b77..a76dcc21a 100644 --- a/system/src/Grav/Framework/Object/Access/ArrayAccessTrait.php +++ b/system/src/Grav/Framework/Object/Access/ArrayAccessTrait.php @@ -42,6 +42,7 @@ trait ArrayAccessTrait * * @param mixed $offset The offset to assign the value to. * @param mixed $value The value to set. + * @return void */ public function offsetSet($offset, $value) { @@ -52,14 +53,10 @@ trait ArrayAccessTrait * Unsets an offset. * * @param mixed $offset The offset to unset. + * @return void */ public function offsetUnset($offset) { $this->unsetProperty($offset); } - - abstract public function hasProperty($property); - abstract public function getProperty($property, $default = null); - abstract public function setProperty($property, $value); - abstract public function unsetProperty($property); } diff --git a/system/src/Grav/Framework/Object/Access/NestedArrayAccessTrait.php b/system/src/Grav/Framework/Object/Access/NestedArrayAccessTrait.php index 9e508a67e..c8056787c 100644 --- a/system/src/Grav/Framework/Object/Access/NestedArrayAccessTrait.php +++ b/system/src/Grav/Framework/Object/Access/NestedArrayAccessTrait.php @@ -42,6 +42,7 @@ trait NestedArrayAccessTrait * * @param mixed $offset The offset to assign the value to. * @param mixed $value The value to set. + * @return void */ public function offsetSet($offset, $value) { @@ -52,14 +53,10 @@ trait NestedArrayAccessTrait * Unsets an offset. * * @param mixed $offset The offset to unset. + * @return void */ public function offsetUnset($offset) { $this->unsetNestedProperty($offset); } - - abstract public function hasNestedProperty($property, $separator = null); - abstract public function getNestedProperty($property, $default = null, $separator = null); - abstract public function setNestedProperty($property, $value, $separator = null); - abstract public function unsetNestedProperty($property, $separator = null); } diff --git a/system/src/Grav/Framework/Object/Access/NestedPropertyCollectionTrait.php b/system/src/Grav/Framework/Object/Access/NestedPropertyCollectionTrait.php index 2558bf9b4..96b2811bc 100644 --- a/system/src/Grav/Framework/Object/Access/NestedPropertyCollectionTrait.php +++ b/system/src/Grav/Framework/Object/Access/NestedPropertyCollectionTrait.php @@ -19,7 +19,7 @@ trait NestedPropertyCollectionTrait { /** * @param string $property Object property to be matched. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return array Key/Value pairs of the properties. */ public function hasNestedProperty($property, $separator = null) @@ -37,7 +37,7 @@ trait NestedPropertyCollectionTrait /** * @param string $property Object property to be fetched. * @param mixed $default Default value if not set. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return array Key/Value pairs of the properties. */ public function getNestedProperty($property, $default = null, $separator = null) @@ -55,7 +55,7 @@ trait NestedPropertyCollectionTrait /** * @param string $property Object property to be updated. * @param mixed $value New value. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return $this */ public function setNestedProperty($property, $value, $separator = null) @@ -70,7 +70,7 @@ trait NestedPropertyCollectionTrait /** * @param string $property Object property to be updated. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return $this */ public function unsetNestedProperty($property, $separator = null) @@ -86,7 +86,7 @@ trait NestedPropertyCollectionTrait /** * @param string $property Object property to be updated. * @param string $default Default value. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return $this */ public function defNestedProperty($property, $default, $separator = null) @@ -103,7 +103,7 @@ trait NestedPropertyCollectionTrait * Group items in the collection by a field. * * @param string $property Object property to be used to make groups. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return array */ public function group($property, $separator = null) @@ -117,9 +117,4 @@ trait NestedPropertyCollectionTrait return $list; } - - /** - * @return \Traversable - */ - abstract public function getIterator(); } diff --git a/system/src/Grav/Framework/Object/Access/NestedPropertyTrait.php b/system/src/Grav/Framework/Object/Access/NestedPropertyTrait.php index 19d02444d..8f9860668 100644 --- a/system/src/Grav/Framework/Object/Access/NestedPropertyTrait.php +++ b/system/src/Grav/Framework/Object/Access/NestedPropertyTrait.php @@ -19,7 +19,7 @@ trait NestedPropertyTrait { /** * @param string $property Object property name. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return bool True if property has been defined (can be null). */ public function hasNestedProperty($property, $separator = null) @@ -74,7 +74,7 @@ trait NestedPropertyTrait /** * @param string $property Object property to be updated. * @param mixed $value New value. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return $this * @throws \RuntimeException */ @@ -116,7 +116,7 @@ trait NestedPropertyTrait /** * @param string $property Object property to be updated. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return $this * @throws \RuntimeException */ @@ -161,7 +161,7 @@ trait NestedPropertyTrait /** * @param string $property Object property to be updated. * @param mixed $default Default value. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return $this * @throws \RuntimeException */ @@ -173,11 +173,4 @@ trait NestedPropertyTrait return $this; } - - - abstract public function hasProperty($property); - abstract public function getProperty($property, $default = null); - abstract public function setProperty($property, $value); - abstract public function unsetProperty($property); - abstract protected function &doGetProperty($property, $default = null, $doCreate = false); } diff --git a/system/src/Grav/Framework/Object/Access/OverloadedPropertyTrait.php b/system/src/Grav/Framework/Object/Access/OverloadedPropertyTrait.php index 8ad0a9f24..c88591ef1 100644 --- a/system/src/Grav/Framework/Object/Access/OverloadedPropertyTrait.php +++ b/system/src/Grav/Framework/Object/Access/OverloadedPropertyTrait.php @@ -42,6 +42,7 @@ trait OverloadedPropertyTrait * * @param mixed $offset The offset to assign the value to. * @param mixed $value The value to set. + * @return void */ public function __set($offset, $value) { @@ -52,14 +53,10 @@ trait OverloadedPropertyTrait * Magic method to unset the attribute * * @param mixed $offset The name value to unset + * @return void */ public function __unset($offset) { $this->unsetProperty($offset); } - - abstract public function hasProperty($property); - abstract public function getProperty($property, $default = null); - abstract public function setProperty($property, $value); - abstract public function unsetProperty($property); } diff --git a/system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php b/system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php index 334a5015f..07179c6be 100644 --- a/system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php +++ b/system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php @@ -131,6 +131,7 @@ trait ObjectCollectionTrait /** * @param string $serialized + * @return void */ public function unserialize($serialized) { @@ -152,6 +153,7 @@ trait ObjectCollectionTrait /** * @param array $serialized + * @return void */ protected function doUnserialize(array $serialized) { @@ -210,7 +212,7 @@ trait ObjectCollectionTrait } /** - * @return array + * @return string[] */ public function getObjectKeys() { @@ -344,6 +346,7 @@ trait ObjectCollectionTrait { $collections = []; foreach ($this->group($property) as $id => $elements) { + /** @var static $collection */ $collection = $this->createFrom($elements); $collections[$id] = $collection; @@ -351,12 +354,4 @@ trait ObjectCollectionTrait return $collections; } - - /** - * @return \Traversable - */ - abstract public function getIterator(); - - abstract protected function getElements(); - abstract protected function setElements(array $elements); } diff --git a/system/src/Grav/Framework/Object/Base/ObjectTrait.php b/system/src/Grav/Framework/Object/Base/ObjectTrait.php index 0a883fcbb..388aad8b0 100644 --- a/system/src/Grav/Framework/Object/Base/ObjectTrait.php +++ b/system/src/Grav/Framework/Object/Base/ObjectTrait.php @@ -151,6 +151,7 @@ trait ObjectTrait /** * @param array $serialized + * @return void */ protected function doUnserialize(array $serialized) { @@ -192,11 +193,4 @@ trait ObjectTrait return $this; } - - abstract protected function doHasProperty($property); - abstract protected function &doGetProperty($property, $default = null, $doCreate = false); - abstract protected function doSetProperty($property, $value); - abstract protected function doUnsetProperty($property); - abstract protected function getElements(); - abstract protected function setElements(array $elements); } diff --git a/system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php b/system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php index 64234ccd2..25fce97b4 100644 --- a/system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php +++ b/system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php @@ -13,6 +13,10 @@ use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor; use Doctrine\Common\Collections\Expr\Comparison; use function is_callable; +/** + * Class ObjectExpressionVisitor + * @package Grav\Framework\Object\Collection + */ class ObjectExpressionVisitor extends ClosureExpressionVisitor { /** @@ -222,7 +226,6 @@ class ObjectExpressionVisitor extends ClosureExpressionVisitor return $value === substr(static::getObjectFieldValue($object, $field), -strlen($value)); }; - default: throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); } diff --git a/system/src/Grav/Framework/Object/ObjectCollection.php b/system/src/Grav/Framework/Object/ObjectCollection.php index 0910878a6..73ada6d7f 100644 --- a/system/src/Grav/Framework/Object/ObjectCollection.php +++ b/system/src/Grav/Framework/Object/ObjectCollection.php @@ -29,7 +29,7 @@ class ObjectCollection extends ArrayCollection implements NestedObjectCollection /** * @param array $elements - * @param string $key + * @param string|null $key * @throws \InvalidArgumentException */ public function __construct(array $elements = [], $key = null) @@ -41,7 +41,7 @@ class ObjectCollection extends ArrayCollection implements NestedObjectCollection /** * @param array $ordering - * @return Collection|static + * @return static */ public function orderBy(array $ordering) { @@ -61,7 +61,8 @@ class ObjectCollection extends ArrayCollection implements NestedObjectCollection } /** - * {@inheritDoc} + * @param Criteria $criteria + * @return static */ public function matching(Criteria $criteria) { diff --git a/system/src/Grav/Framework/Object/ObjectIndex.php b/system/src/Grav/Framework/Object/ObjectIndex.php index ffb0b39fb..d722eea76 100644 --- a/system/src/Grav/Framework/Object/ObjectIndex.php +++ b/system/src/Grav/Framework/Object/ObjectIndex.php @@ -114,7 +114,7 @@ abstract class ObjectIndex extends AbstractIndexCollection implements NestedObje /** * @param string $property Object property name. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return bool[] True if property has been defined (can be null). */ public function hasNestedProperty($property, $separator = null) @@ -125,7 +125,7 @@ abstract class ObjectIndex extends AbstractIndexCollection implements NestedObje /** * @param string $property Object property to be fetched. * @param mixed $default Default value if property has not been set. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return mixed[] Property values. */ public function getNestedProperty($property, $default = null, $separator = null) @@ -136,7 +136,7 @@ abstract class ObjectIndex extends AbstractIndexCollection implements NestedObje /** * @param string $property Object property to be updated. * @param mixed $value New value. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return ObjectCollectionInterface */ public function setNestedProperty($property, $value, $separator = null) @@ -147,7 +147,7 @@ abstract class ObjectIndex extends AbstractIndexCollection implements NestedObje /** * @param string $property Object property to be defined. * @param mixed $default Default value. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return ObjectCollectionInterface */ public function defNestedProperty($property, $default, $separator = null) @@ -157,7 +157,7 @@ abstract class ObjectIndex extends AbstractIndexCollection implements NestedObje /** * @param string $property Object property to be unset. - * @param string $separator Separator, defaults to '.' + * @param string|null $separator Separator, defaults to '.' * @return ObjectCollectionInterface */ public function unsetNestedProperty($property, $separator = null) diff --git a/system/src/Grav/Framework/Object/Property/ArrayPropertyTrait.php b/system/src/Grav/Framework/Object/Property/ArrayPropertyTrait.php index a1fc966c5..a17792daf 100644 --- a/system/src/Grav/Framework/Object/Property/ArrayPropertyTrait.php +++ b/system/src/Grav/Framework/Object/Property/ArrayPropertyTrait.php @@ -23,7 +23,7 @@ trait ArrayPropertyTrait /** * @param array $elements - * @param string $key + * @param string|null $key * @throws \InvalidArgumentException */ public function __construct(array $elements = [], $key = null) @@ -63,6 +63,7 @@ trait ArrayPropertyTrait /** * @param string $property Object property to be updated. * @param mixed $value New value. + * @return void */ protected function doSetProperty($property, $value) { @@ -71,6 +72,7 @@ trait ArrayPropertyTrait /** * @param string $property Object property to be unset. + * @return void */ protected function doUnsetProperty($property) { @@ -99,6 +101,7 @@ trait ArrayPropertyTrait /** * @param array $elements + * @return void */ protected function setElements(array $elements) { diff --git a/system/src/Grav/Framework/Object/Property/LazyPropertyTrait.php b/system/src/Grav/Framework/Object/Property/LazyPropertyTrait.php index 124891b7a..7d5b90cd9 100644 --- a/system/src/Grav/Framework/Object/Property/LazyPropertyTrait.php +++ b/system/src/Grav/Framework/Object/Property/LazyPropertyTrait.php @@ -53,6 +53,7 @@ trait LazyPropertyTrait /** * @param string $property Object property to be fetched. * @param mixed $default Default value if property has not been set. + * @param bool $doCreate * @return mixed Property value. */ protected function &doGetProperty($property, $default = null, $doCreate = false) @@ -69,6 +70,7 @@ trait LazyPropertyTrait /** * @param string $property Object property to be updated. * @param mixed $value New value. + * @return void */ protected function doSetProperty($property, $value) { @@ -81,6 +83,7 @@ trait LazyPropertyTrait /** * @param string $property Object property to be unset. + * @return void */ protected function doUnsetProperty($property) { diff --git a/system/src/Grav/Framework/Object/Property/MixedPropertyTrait.php b/system/src/Grav/Framework/Object/Property/MixedPropertyTrait.php index 9c7ffbfcf..eb2e791c5 100644 --- a/system/src/Grav/Framework/Object/Property/MixedPropertyTrait.php +++ b/system/src/Grav/Framework/Object/Property/MixedPropertyTrait.php @@ -54,6 +54,7 @@ trait MixedPropertyTrait /** * @param string $property Object property to be fetched. * @param mixed $default Default value if property has not been set. + * @param bool $doCreate * @return mixed Property value. */ protected function &doGetProperty($property, $default = null, $doCreate = false) @@ -68,6 +69,7 @@ trait MixedPropertyTrait /** * @param string $property Object property to be updated. * @param mixed $value New value. + * @return void */ protected function doSetProperty($property, $value) { @@ -77,6 +79,7 @@ trait MixedPropertyTrait /** * @param string $property Object property to be unset. + * @return void */ protected function doUnsetProperty($property) { @@ -108,6 +111,7 @@ trait MixedPropertyTrait /** * @param array $elements + * @return void */ protected function setElements(array $elements) { diff --git a/system/src/Grav/Framework/Object/Property/ObjectPropertyTrait.php b/system/src/Grav/Framework/Object/Property/ObjectPropertyTrait.php index 38bb1bd1a..cb07c7fda 100644 --- a/system/src/Grav/Framework/Object/Property/ObjectPropertyTrait.php +++ b/system/src/Grav/Framework/Object/Property/ObjectPropertyTrait.php @@ -123,6 +123,7 @@ trait ObjectPropertyTrait /** * @param string $property Object property to be updated. * @param mixed $value New value. + * @return void * @throws \InvalidArgumentException */ protected function doSetProperty($property, $value) @@ -137,6 +138,7 @@ trait ObjectPropertyTrait /** * @param string $property Object property to be unset. + * @return void */ protected function doUnsetProperty($property) { @@ -148,6 +150,9 @@ trait ObjectPropertyTrait $this->{$property} = null; } + /** + * @return void + */ protected function initObjectProperties() { $this->_definedProperties = []; @@ -192,6 +197,7 @@ trait ObjectPropertyTrait /** * @param array $elements + * @return void */ protected function setElements(array $elements) { @@ -199,7 +205,4 @@ trait ObjectPropertyTrait $this->setProperty($property, $value); } } - - abstract public function setProperty($property, $value); - abstract protected function setKey($key); } diff --git a/system/src/Grav/Framework/Pagination/AbstractPagination.php b/system/src/Grav/Framework/Pagination/AbstractPagination.php index 48caf1e05..a576bd5c9 100644 --- a/system/src/Grav/Framework/Pagination/AbstractPagination.php +++ b/system/src/Grav/Framework/Pagination/AbstractPagination.php @@ -12,38 +12,32 @@ namespace Grav\Framework\Pagination; use Grav\Framework\Pagination\Interfaces\PaginationInterface; use Grav\Framework\Route\Route; +/** + * Class AbstractPagination + * @package Grav\Framework\Pagination + */ class AbstractPagination implements PaginationInterface { /** @var Route Base rouse used for the pagination. */ protected $route; - /** @var int|null Current page. */ protected $page; - /** @var int|null The record number to start displaying from. */ protected $start; - /** @var int Number of records to display per page. */ protected $limit; - /** @var int Total number of records. */ protected $total; - /** @var array Pagination options */ protected $options; - /** @var bool View all flag. */ protected $viewAll; - /** @var int Total number of pages. */ protected $pages; - /** @var int Value pagination object begins at. */ protected $pagesStart; - /** @var int Value pagination object ends at .*/ protected $pagesStop; - /** @var array */ protected $defaultOptions = [ 'type' => 'page', @@ -53,7 +47,6 @@ class AbstractPagination implements PaginationInterface 'ending' => 0, 'url' => null ]; - /** @var array */ private $items; diff --git a/system/src/Grav/Framework/Pagination/AbstractPaginationPage.php b/system/src/Grav/Framework/Pagination/AbstractPaginationPage.php index b11ea26c9..e66cf8576 100644 --- a/system/src/Grav/Framework/Pagination/AbstractPaginationPage.php +++ b/system/src/Grav/Framework/Pagination/AbstractPaginationPage.php @@ -11,41 +11,66 @@ namespace Grav\Framework\Pagination; use Grav\Framework\Pagination\Interfaces\PaginationPageInterface; +/** + * Class AbstractPaginationPage + * @package Grav\Framework\Pagination + */ abstract class AbstractPaginationPage implements PaginationPageInterface { /** @var array */ protected $options; + /** + * @return bool + */ public function isActive(): bool { return $this->options['active'] ?? false; } + /** + * @return bool + */ public function isEnabled(): bool { return $this->options['enabled'] ?? false; } + /** + * @return array + */ public function getOptions(): array { return $this->options ?? []; } + /** + * @return int|null + */ public function getNumber(): ?int { return $this->options['number'] ?? null; } + /** + * @return string + */ public function getLabel(): string { return $this->options['label'] ?? (string)$this->getNumber(); } + /** + * @return string|null + */ public function getUrl(): ?string { return $this->options['route'] ? (string)$this->options['route']->getUri() : null; } + /** + * @param array $options + */ protected function setOptions(array $options): void { $this->options = $options; diff --git a/system/src/Grav/Framework/Pagination/Pagination.php b/system/src/Grav/Framework/Pagination/Pagination.php index 3c6a2b36e..e58527725 100644 --- a/system/src/Grav/Framework/Pagination/Pagination.php +++ b/system/src/Grav/Framework/Pagination/Pagination.php @@ -11,8 +11,20 @@ namespace Grav\Framework\Pagination; use Grav\Framework\Route\Route; +/** + * Class Pagination + * @package Grav\Framework\Pagination + */ class Pagination extends AbstractPagination { + /** + * Pagination constructor. + * @param Route $route + * @param int $total + * @param int|null $pos + * @param int|null $limit + * @param array|null $options + */ public function __construct(Route $route, int $total, int $pos = null, int $limit = null, array $options = null) { $this->initialize($route, $total, $pos, $limit, $options); diff --git a/system/src/Grav/Framework/Pagination/PaginationPage.php b/system/src/Grav/Framework/Pagination/PaginationPage.php index 0f5e8a266..27fadd2ac 100644 --- a/system/src/Grav/Framework/Pagination/PaginationPage.php +++ b/system/src/Grav/Framework/Pagination/PaginationPage.php @@ -9,8 +9,16 @@ namespace Grav\Framework\Pagination; +/** + * Class PaginationPage + * @package Grav\Framework\Pagination + */ class PaginationPage extends AbstractPaginationPage { + /** + * PaginationPage constructor. + * @param array $options + */ public function __construct(array $options = []) { $this->setOptions($options); diff --git a/system/src/Grav/Framework/Psr7/AbstractUri.php b/system/src/Grav/Framework/Psr7/AbstractUri.php index 166e9a24f..b3bb143cd 100644 --- a/system/src/Grav/Framework/Psr7/AbstractUri.php +++ b/system/src/Grav/Framework/Psr7/AbstractUri.php @@ -28,25 +28,18 @@ abstract class AbstractUri implements UriInterface /** @var string Uri scheme. */ private $scheme = ''; - /** @var string Uri user. */ private $user = ''; - /** @var string Uri password. */ private $password = ''; - /** @var string Uri host. */ private $host = ''; - /** @var int|null Uri port. */ private $port; - /** @var string Uri path. */ private $path = ''; - /** @var string Uri query string (without ?). */ private $query = ''; - /** @var string Uri fragment (without #). */ private $fragment = ''; diff --git a/system/src/Grav/Framework/Psr7/ServerRequest.php b/system/src/Grav/Framework/Psr7/ServerRequest.php index cae538466..7ef6ba481 100644 --- a/system/src/Grav/Framework/Psr7/ServerRequest.php +++ b/system/src/Grav/Framework/Psr7/ServerRequest.php @@ -159,7 +159,7 @@ class ServerRequest implements ServerRequestInterface * Note: This method is not part of the PSR-7 standard. * * @param string $key The parameter key. - * @param string $default The default value. + * @param string|null $default The default value. * * @return mixed The parameter value. */ diff --git a/system/src/Grav/Framework/Psr7/Stream.php b/system/src/Grav/Framework/Psr7/Stream.php index dd0656c52..c27191d4e 100644 --- a/system/src/Grav/Framework/Psr7/Stream.php +++ b/system/src/Grav/Framework/Psr7/Stream.php @@ -14,6 +14,10 @@ namespace Grav\Framework\Psr7; use Grav\Framework\Psr7\Traits\StreamDecoratorTrait; use Psr\Http\Message\StreamInterface; +/** + * Class Stream + * @package Grav\Framework\Psr7 + */ class Stream implements StreamInterface { use StreamDecoratorTrait; diff --git a/system/src/Grav/Framework/Psr7/Traits/ServerRequestDecoratorTrait.php b/system/src/Grav/Framework/Psr7/Traits/ServerRequestDecoratorTrait.php index 234795cd5..1d92ce9a4 100644 --- a/system/src/Grav/Framework/Psr7/Traits/ServerRequestDecoratorTrait.php +++ b/system/src/Grav/Framework/Psr7/Traits/ServerRequestDecoratorTrait.php @@ -13,6 +13,10 @@ namespace Grav\Framework\Psr7\Traits; use Psr\Http\Message\ServerRequestInterface; +/** + * Trait ServerRequestDecoratorTrait + * @package Grav\Framework\Psr7\Traits + */ trait ServerRequestDecoratorTrait { use RequestDecoratorTrait; @@ -101,6 +105,10 @@ trait ServerRequestDecoratorTrait return $new; } + /** + * @param array $attributes + * @return ServerRequestInterface + */ public function withAttributes(array $attributes) { $new = clone $this; diff --git a/system/src/Grav/Framework/Psr7/Traits/StreamDecoratorTrait.php b/system/src/Grav/Framework/Psr7/Traits/StreamDecoratorTrait.php index dbeb94f3f..d08375924 100644 --- a/system/src/Grav/Framework/Psr7/Traits/StreamDecoratorTrait.php +++ b/system/src/Grav/Framework/Psr7/Traits/StreamDecoratorTrait.php @@ -13,6 +13,10 @@ namespace Grav\Framework\Psr7\Traits; use Psr\Http\Message\StreamInterface; +/** + * Trait StreamDecoratorTrait + * @package Grav\Framework\Psr7\Traits + */ trait StreamDecoratorTrait { /** @var StreamInterface */ @@ -26,6 +30,9 @@ trait StreamDecoratorTrait return $this->stream->__toString(); } + /** + * @return void + */ public function __destruct() { $this->stream->close(); diff --git a/system/src/Grav/Framework/Psr7/Traits/UploadedFileDecoratorTrait.php b/system/src/Grav/Framework/Psr7/Traits/UploadedFileDecoratorTrait.php index 0c3fe3add..acb6aa66e 100644 --- a/system/src/Grav/Framework/Psr7/Traits/UploadedFileDecoratorTrait.php +++ b/system/src/Grav/Framework/Psr7/Traits/UploadedFileDecoratorTrait.php @@ -14,36 +14,58 @@ namespace Grav\Framework\Psr7\Traits; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UploadedFileInterface; +/** + * Trait UploadedFileDecoratorTrait + * @package Grav\Framework\Psr7\Traits + */ trait UploadedFileDecoratorTrait { /** @var UploadedFileInterface */ protected $uploadedFile; + /** + * @return StreamInterface + */ public function getStream(): StreamInterface { return $this->uploadedFile->getStream(); } + /** + * @param string $targetPath + */ public function moveTo($targetPath): void { $this->uploadedFile->moveTo($targetPath); } + /** + * @return int|null + */ public function getSize(): ?int { return $this->uploadedFile->getSize(); } + /** + * @return int + */ public function getError(): int { return $this->uploadedFile->getError(); } + /** + * @return string|null + */ public function getClientFilename(): ?string { return $this->uploadedFile->getClientFilename(); } + /** + * @return string|null + */ public function getClientMediaType(): ?string { return $this->uploadedFile->getClientMediaType(); diff --git a/system/src/Grav/Framework/Psr7/Traits/UriDecorationTrait.php b/system/src/Grav/Framework/Psr7/Traits/UriDecorationTrait.php index b106607b3..6f61fb338 100644 --- a/system/src/Grav/Framework/Psr7/Traits/UriDecorationTrait.php +++ b/system/src/Grav/Framework/Psr7/Traits/UriDecorationTrait.php @@ -13,56 +13,91 @@ namespace Grav\Framework\Psr7\Traits; use Psr\Http\Message\UriInterface; +/** + * Trait UriDecorationTrait + * @package Grav\Framework\Psr7\Traits + */ trait UriDecorationTrait { /** @var UriInterface */ protected $uri; + /** + * @return string + */ public function __toString(): string { return $this->uri->__toString(); } + /** + * @return string + */ public function getScheme(): string { return $this->uri->getScheme(); } + /** + * @return string + */ public function getAuthority(): string { return $this->uri->getAuthority(); } + /** + * @return string + */ public function getUserInfo(): string { return $this->uri->getUserInfo(); } + /** + * @return string + */ public function getHost(): string { return $this->uri->getHost(); } + /** + * @return int|null + */ public function getPort(): ?int { return $this->uri->getPort(); } + /** + * @return string + */ public function getPath(): string { return $this->uri->getPath(); } + /** + * @return string + */ public function getQuery(): string { return $this->uri->getQuery(); } + /** + * @return string + */ public function getFragment(): string { return $this->uri->getFragment(); } + /** + * @param string $scheme + * @return UriInterface + */ public function withScheme($scheme): UriInterface { $new = clone $this; @@ -72,6 +107,11 @@ trait UriDecorationTrait return $new; } + /** + * @param string $user + * @param string|null $password + * @return UriInterface + */ public function withUserInfo($user, $password = null): UriInterface { $new = clone $this; @@ -81,6 +121,10 @@ trait UriDecorationTrait return $new; } + /** + * @param string $host + * @return UriInterface + */ public function withHost($host): UriInterface { $new = clone $this; @@ -90,6 +134,10 @@ trait UriDecorationTrait return $new; } + /** + * @param int|null $port + * @return UriInterface + */ public function withPort($port): UriInterface { $new = clone $this; @@ -99,6 +147,10 @@ trait UriDecorationTrait return $new; } + /** + * @param string $path + * @return UriInterface + */ public function withPath($path): UriInterface { $new = clone $this; @@ -108,6 +160,10 @@ trait UriDecorationTrait return $new; } + /** + * @param string $query + * @return UriInterface + */ public function withQuery($query): UriInterface { $new = clone $this; @@ -117,6 +173,10 @@ trait UriDecorationTrait return $new; } + /** + * @param string $fragment + * @return UriInterface + */ public function withFragment($fragment): UriInterface { $new = clone $this; diff --git a/system/src/Grav/Framework/Psr7/UploadedFile.php b/system/src/Grav/Framework/Psr7/UploadedFile.php index fb223e747..d058f9a72 100644 --- a/system/src/Grav/Framework/Psr7/UploadedFile.php +++ b/system/src/Grav/Framework/Psr7/UploadedFile.php @@ -15,6 +15,10 @@ use Grav\Framework\Psr7\Traits\UploadedFileDecoratorTrait; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UploadedFileInterface; +/** + * Class UploadedFile + * @package Grav\Framework\Psr7 + */ class UploadedFile implements UploadedFileInterface { use UploadedFileDecoratorTrait; diff --git a/system/src/Grav/Framework/Psr7/Uri.php b/system/src/Grav/Framework/Psr7/Uri.php index f23171a63..95cafc751 100644 --- a/system/src/Grav/Framework/Psr7/Uri.php +++ b/system/src/Grav/Framework/Psr7/Uri.php @@ -16,6 +16,10 @@ use Grav\Framework\Uri\UriFactory; use GuzzleHttp\Psr7\Uri as GuzzleUri; use Psr\Http\Message\UriInterface; +/** + * Class Uri + * @package Grav\Framework\Psr7 + */ class Uri implements UriInterface { use UriDecorationTrait; diff --git a/system/src/Grav/Framework/RequestHandler/Exception/InvalidArgumentException.php b/system/src/Grav/Framework/RequestHandler/Exception/InvalidArgumentException.php index 99fa30b22..3ff8f2eed 100644 --- a/system/src/Grav/Framework/RequestHandler/Exception/InvalidArgumentException.php +++ b/system/src/Grav/Framework/RequestHandler/Exception/InvalidArgumentException.php @@ -13,6 +13,10 @@ namespace Grav\Framework\RequestHandler\Exception; use Throwable; +/** + * Class InvalidArgumentException + * @package Grav\Framework\RequestHandler\Exception + */ class InvalidArgumentException extends \InvalidArgumentException { /** @var mixed|null */ diff --git a/system/src/Grav/Framework/RequestHandler/Exception/NotFoundException.php b/system/src/Grav/Framework/RequestHandler/Exception/NotFoundException.php index adfbc889d..4736a0aec 100644 --- a/system/src/Grav/Framework/RequestHandler/Exception/NotFoundException.php +++ b/system/src/Grav/Framework/RequestHandler/Exception/NotFoundException.php @@ -13,6 +13,10 @@ namespace Grav\Framework\RequestHandler\Exception; use Psr\Http\Message\ServerRequestInterface; +/** + * Class NotFoundException + * @package Grav\Framework\RequestHandler\Exception + */ class NotFoundException extends RequestException { /** @var ServerRequestInterface */ diff --git a/system/src/Grav/Framework/RequestHandler/Exception/NotHandledException.php b/system/src/Grav/Framework/RequestHandler/Exception/NotHandledException.php index 8a7f54a82..8817ce594 100644 --- a/system/src/Grav/Framework/RequestHandler/Exception/NotHandledException.php +++ b/system/src/Grav/Framework/RequestHandler/Exception/NotHandledException.php @@ -11,6 +11,10 @@ declare(strict_types=1); namespace Grav\Framework\RequestHandler\Exception; +/** + * Class NotHandledException + * @package Grav\Framework\RequestHandler\Exception + */ class NotHandledException extends NotFoundException { } diff --git a/system/src/Grav/Framework/RequestHandler/Exception/PageExpiredException.php b/system/src/Grav/Framework/RequestHandler/Exception/PageExpiredException.php index 14d80a803..3d29379f1 100644 --- a/system/src/Grav/Framework/RequestHandler/Exception/PageExpiredException.php +++ b/system/src/Grav/Framework/RequestHandler/Exception/PageExpiredException.php @@ -13,6 +13,10 @@ namespace Grav\Framework\RequestHandler\Exception; use Psr\Http\Message\ServerRequestInterface; +/** + * Class PageExpiredException + * @package Grav\Framework\RequestHandler\Exception + */ class PageExpiredException extends RequestException { /** diff --git a/system/src/Grav/Framework/RequestHandler/Exception/RequestException.php b/system/src/Grav/Framework/RequestHandler/Exception/RequestException.php index fb956cdb8..6ec1ed90e 100644 --- a/system/src/Grav/Framework/RequestHandler/Exception/RequestException.php +++ b/system/src/Grav/Framework/RequestHandler/Exception/RequestException.php @@ -13,6 +13,10 @@ namespace Grav\Framework\RequestHandler\Exception; use Psr\Http\Message\ServerRequestInterface; +/** + * Class RequestException + * @package Grav\Framework\RequestHandler\Exception + */ class RequestException extends \RuntimeException { /** @var array Map of standard HTTP status code/reason phrases */ diff --git a/system/src/Grav/Framework/RequestHandler/Middlewares/Exceptions.php b/system/src/Grav/Framework/RequestHandler/Middlewares/Exceptions.php index 2cff41bec..c759ca7e3 100644 --- a/system/src/Grav/Framework/RequestHandler/Middlewares/Exceptions.php +++ b/system/src/Grav/Framework/RequestHandler/Middlewares/Exceptions.php @@ -19,6 +19,10 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; +/** + * Class Exceptions + * @package Grav\Framework\RequestHandler\Middlewares + */ class Exceptions implements MiddlewareInterface { public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface diff --git a/system/src/Grav/Framework/RequestHandler/RequestHandler.php b/system/src/Grav/Framework/RequestHandler/RequestHandler.php index 4546a6d0f..97d5c0c89 100644 --- a/system/src/Grav/Framework/RequestHandler/RequestHandler.php +++ b/system/src/Grav/Framework/RequestHandler/RequestHandler.php @@ -16,6 +16,10 @@ use Psr\Container\ContainerInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; +/** + * Class RequestHandler + * @package Grav\Framework\RequestHandler + */ class RequestHandler implements RequestHandlerInterface { use RequestHandlerTrait; diff --git a/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php b/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php index 81d02c161..9d67e609e 100644 --- a/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php +++ b/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php @@ -17,6 +17,10 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; +/** + * Trait RequestHandlerTrait + * @package Grav\Framework\RequestHandler\Traits + */ trait RequestHandlerTrait { /** @var array */ diff --git a/system/src/Grav/Framework/Route/Route.php b/system/src/Grav/Framework/Route/Route.php index 181969e38..24791ebca 100644 --- a/system/src/Grav/Framework/Route/Route.php +++ b/system/src/Grav/Framework/Route/Route.php @@ -20,19 +20,14 @@ class Route { /** @var string */ private $root = ''; - /** @var string */ private $language = ''; - /** @var string */ private $route = ''; - /** @var string */ private $extension = ''; - /** @var array */ private $gravParams = []; - /** @var array */ private $queryParams = []; @@ -235,7 +230,7 @@ class Route } /** - * @param string $language + * @param string|null $language * @return Route */ public function withLanguage($language) diff --git a/system/src/Grav/Framework/Route/RouteFactory.php b/system/src/Grav/Framework/Route/RouteFactory.php index 7ef7b21f5..c0ff2edca 100644 --- a/system/src/Grav/Framework/Route/RouteFactory.php +++ b/system/src/Grav/Framework/Route/RouteFactory.php @@ -19,10 +19,8 @@ class RouteFactory { /** @var string */ private static $root = ''; - /** @var string */ private static $language = ''; - /** @var string */ private static $delimiter = ':'; diff --git a/system/src/Grav/Framework/Session/Exceptions/SessionException.php b/system/src/Grav/Framework/Session/Exceptions/SessionException.php index 98b69ec7a..a946f1d53 100644 --- a/system/src/Grav/Framework/Session/Exceptions/SessionException.php +++ b/system/src/Grav/Framework/Session/Exceptions/SessionException.php @@ -9,6 +9,10 @@ namespace Grav\Framework\Session\Exceptions; +/** + * Class SessionException + * @package Grav\Framework\Session\Exceptions + */ class SessionException extends \RuntimeException { } diff --git a/system/src/Grav/Framework/Session/Session.php b/system/src/Grav/Framework/Session/Session.php index 20c41c04a..778966fb4 100644 --- a/system/src/Grav/Framework/Session/Session.php +++ b/system/src/Grav/Framework/Session/Session.php @@ -20,10 +20,8 @@ class Session implements SessionInterface { /** @var array */ protected $options = []; - /** @var bool */ protected $started = false; - /** @var Session */ protected static $instance;