Fixed a few type hints

This commit is contained in:
Matias Griese
2019-11-15 09:00:48 +02:00
parent 741934b1da
commit f0c12e6246
39 changed files with 145 additions and 89 deletions

View File

@@ -60,7 +60,7 @@ class Pipeline extends PropertyObject
* The closure will receive as the only parameter a string with the path/URL of the asset and
* it should return the content of the asset file as a string.
*
* @var \Closure
* @var \Closure|null
*/
protected $fetch_command;

View File

@@ -20,12 +20,13 @@ class Blueprint extends BlueprintForm
/** @var string */
protected $context = 'blueprints://';
/** @var string|null */
protected $scope;
/** @var BlueprintSchema */
/** @var BlueprintSchema|null */
protected $blueprintSchema;
/** @var object */
/** @var object|null */
protected $object;
/** @var array|null */
@@ -40,11 +41,17 @@ class Blueprint extends BlueprintForm
}
}
/**
* @param string $scope
*/
public function setScope($scope)
{
$this->scope = $scope;
}
/**
* @param object $object
*/
public function setObject($object)
{
$this->object = $object;
@@ -232,6 +239,10 @@ class Blueprint extends BlueprintForm
return $this->blueprintSchema;
}
/**
* @param string $name
* @param callable $callable
*/
public function addDynamicHandler(string $name, callable $callable): void
{
$this->handlers[$name] = $callable;
@@ -259,7 +270,7 @@ class Blueprint extends BlueprintForm
/**
* @param string $filename
* @return string
* @return array
*/
protected function loadFile($filename)
{
@@ -420,6 +431,11 @@ class Blueprint extends BlueprintForm
}
}
/**
* @param array $field
* @param string $property
* @param mixed $value
*/
protected function addPropertyRecursive(array &$field, $property, $value)
{
if (\is_array($value) && isset($field[$property]) && \is_array($field[$property])) {

View File

@@ -13,7 +13,6 @@ use RocketTheme\Toolbox\ArrayTraits\Countable;
use RocketTheme\Toolbox\ArrayTraits\Export;
use RocketTheme\Toolbox\ArrayTraits\ExportInterface;
use RocketTheme\Toolbox\ArrayTraits\NestedArrayAccessWithGetters;
use RocketTheme\Toolbox\File\File;
use RocketTheme\Toolbox\File\FileInterface;
class Data implements DataInterface, \ArrayAccess, \Countable, \JsonSerializable, ExportInterface
@@ -26,10 +25,10 @@ class Data implements DataInterface, \ArrayAccess, \Countable, \JsonSerializable
/** @var array */
protected $items;
/** @var Blueprint */
/** @var Blueprint|null */
protected $blueprints;
/** @var File */
/** @var FileInterface|null */
protected $storage;
/**
@@ -281,7 +280,7 @@ class Data implements DataInterface, \ArrayAccess, \Countable, \JsonSerializable
* Set or get the data storage.
*
* @param FileInterface|null $storage Optionally enter a new storage.
* @return FileInterface
* @return FileInterface|null
*/
public function file(FileInterface $storage = null)
{

View File

@@ -26,7 +26,6 @@ use DebugBar\DataCollector\RequestDataCollector;
use DebugBar\DataCollector\TimeDataCollector;
use DebugBar\DebugBar;
use DebugBar\JavascriptRenderer;
use DebugBar\StandardDebugBar;
use Grav\Common\Config\Config;
use Grav\Common\Processors\ProcessorInterface;
use Grav\Common\Twig\TwigClockworkDataSource;
@@ -45,19 +44,19 @@ class Debugger
/** @var static */
protected static $instance;
/** @var Grav $grav */
/** @var Grav|null */
protected $grav;
/** @var Config $config */
/** @var Config|null */
protected $config;
/** @var JavascriptRenderer $renderer */
/** @var JavascriptRenderer|null */
protected $renderer;
/** @var StandardDebugBar $debugbar */
/** @var DebugBar|null */
protected $debugbar;
/** @var Clockwork */
/** @var Clockwork|null */
protected $clockwork;
/** @var bool */
@@ -68,18 +67,22 @@ class Debugger
/** @var array */
protected $timers = [];
/** @var array $deprecations */
/** @var array */
protected $deprecations = [];
/** @var callable|null */
protected $errorHandler;
/** @var float */
protected $requestTime;
/** @var float */
protected $currentTime;
/** @var int */
protected $profiling = 0;
/** @var bool */
protected $censored = false;
/**
@@ -447,7 +450,7 @@ class Debugger
*
* @param string $name
*
* @return DataCollectorInterface
* @return DataCollectorInterface|null
* @throws \DebugBar\DebugBarException
*/
public function getCollector($name)

View File

@@ -17,7 +17,7 @@ trait CompiledFile
* Get/set parsed file contents.
*
* @param mixed $var
* @return string
* @return string|array
*/
public function content($var = null)
{

View File

@@ -20,7 +20,7 @@ class CompiledJsonFile extends JsonFile
*
* @param string $var
* @param bool $assoc
* @return array mixed
* @return array
*/
protected function decode($var, $assoc = true)
{

View File

@@ -128,7 +128,7 @@ class GPM extends Iterator
/**
* Return the instance of a specific Plugin
* @param string $slug The slug of the Plugin
* @return Local\Package The instance of the Plugin
* @return Local\Package|null The instance of the Plugin
*/
public function getInstalledPlugin($slug)
{
@@ -162,7 +162,7 @@ class GPM extends Iterator
/**
* Return the instance of a specific Theme
* @param string $slug The slug of the Theme
* @return Local\Package The instance of the Theme
* @return Local\Package|null The instance of the Theme
*/
public function getInstalledTheme($slug)
{

View File

@@ -41,6 +41,7 @@ class Licenses
public static function set($slug, $license)
{
$licenses = self::getLicenseFile();
/** @var array $data */
$data = (array)$licenses->content();
$slug = strtolower($slug);
@@ -74,6 +75,7 @@ class Licenses
public static function get($slug = null)
{
$licenses = self::getLicenseFile();
/** @var array $data */
$data = (array)$licenses->content();
$licenses->free();
$slug = strtolower($slug);

View File

@@ -162,6 +162,7 @@ class Truncator
*/
private static function removeProceedingNodes($domNode, $topNode)
{
/** @var DOMNode|null $nextNode */
$nextNode = $domNode->nextSibling;
if ($nextNode !== null) {

View File

@@ -42,7 +42,7 @@ class Inflector
* @param string $word English noun to pluralize
* @param int $count The count
*
* @return string Plural noun
* @return string|false Plural noun
*/
public static function pluralize($word, $count = 2)
{

View File

@@ -133,7 +133,7 @@ class Iterator implements \ArrayAccess, \Iterator, \Countable, \Serializable
/**
* @param mixed $needle Searched value.
*
* @return string|bool Key if found, otherwise false.
* @return string|int|false Key if found, otherwise false.
*/
public function indexOf($needle)
{

View File

@@ -149,7 +149,7 @@ class Language
*
* @param string $lang
*
* @return bool
* @return string|bool
*/
public function setDefault($lang)
{

View File

@@ -12,6 +12,7 @@ namespace Grav\Common\Page\Markdown;
use Grav\Common\Grav;
use Grav\Common\Page\Interfaces\PageInterface;
use Grav\Common\Page\Medium\Link;
use Grav\Common\Page\Pages;
use Grav\Common\Uri;
use Grav\Common\Page\Medium\Medium;
use Grav\Common\Utils;
@@ -20,7 +21,7 @@ use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
class Excerpts
{
/** @var PageInterface */
/** @var PageInterface|null */
protected $page;
/** @var array */
protected $config;

View File

@@ -28,6 +28,7 @@ abstract class AbstractMedia implements ExportInterface, MediaCollectionInterfac
use Export;
protected $items = [];
/** @var string */
protected $path;
protected $images = [];
protected $videos = [];
@@ -150,7 +151,7 @@ abstract class AbstractMedia implements ExportInterface, MediaCollectionInterfac
/**
* @param string $name
* @param MediaObjectInterface $file
* @param MediaObjectInterface|null $file
*/
public function add($name, $file)
{

View File

@@ -22,7 +22,7 @@ class ImageMedium extends Medium
protected $thumbnailTypes = ['page', 'media', 'default'];
/**
* @var ImageFile
* @var ImageFile|null
*/
protected $image;
@@ -643,7 +643,7 @@ class ImageMedium extends Medium
/**
* Return the image higher quality version
*
* @return ImageMedium the alternative version with higher quality
* @return Medium|ImageMedium the alternative version with higher quality
*/
public function higherQualityAlternative()
{

View File

@@ -479,7 +479,7 @@ class Medium extends Data implements RenderableInterface, MediaObjectInterface
*
* @param string $mode
*
* @return $this|null
* @return self|null
*/
public function display($mode = 'source')
{
@@ -648,7 +648,7 @@ class Medium extends Data implements RenderableInterface, MediaObjectInterface
/**
* Get the thumbnail Medium object
*
* @return ThumbnailImageMedium
* @return ThumbnailImageMedium|null
*/
protected function getThumbnail()
{

View File

@@ -15,7 +15,7 @@ use Grav\Common\Page\Markdown\Excerpts;
trait ParsedownHtmlTrait
{
/**
* @var \Grav\Common\Markdown\Parsedown
* @var \Grav\Common\Markdown\Parsedown|null
*/
protected $parsedown;

View File

@@ -12,7 +12,7 @@ namespace Grav\Common\Page\Medium;
class ThumbnailImageMedium extends ImageMedium
{
/**
* @var Medium
* @var Medium|null
*/
public $parent = null;
@@ -67,7 +67,7 @@ class ThumbnailImageMedium extends ImageMedium
*
* @param string $mode
*
* @return $this
* @return array|Link|Medium
*/
public function display($mode = 'source')
{
@@ -79,7 +79,7 @@ class ThumbnailImageMedium extends ImageMedium
*
* @param string $type
*
* @return $this
* @return array|Link|Medium
*/
public function thumbnail($type = 'auto')
{
@@ -119,7 +119,7 @@ class ThumbnailImageMedium extends ImageMedium
* @param string $method
* @param array $arguments
* @param bool $testLinked
* @return Medium|Link|array
* @return array|Link|Medium
*/
protected function bubble($method, array $arguments = [], $testLinked = true)
{

View File

@@ -98,7 +98,7 @@ class VideoMedium extends Medium
/**
* Allows ability to set the preload option
*
* @param null $status
* @param string|null $status
* @return $this
*/
public function preload($status = null)

View File

@@ -19,6 +19,7 @@ use Grav\Common\Language\Language;
use Grav\Common\Markdown\Parsedown;
use Grav\Common\Markdown\ParsedownExtra;
use Grav\Common\Media\Interfaces\MediaCollectionInterface;
use Grav\Common\Page\Interfaces\PageCollectionInterface;
use Grav\Common\Page\Interfaces\PageInterface;
use Grav\Common\Media\Traits\MediaTrait;
use Grav\Common\Page\Markdown\Excerpts;
@@ -64,7 +65,7 @@ class Page implements PageInterface
protected $redirect;
protected $external_url;
protected $items;
/** @var \stdClass */
/** @var object|null */
protected $header;
protected $frontmatter;
protected $language;
@@ -1216,8 +1217,8 @@ class Page implements PageInterface
/**
* Gets and sets the associated media as found in the page folder.
*
* @param Media $var Representation of associated media.
* @return Media Representation of associated media.
* @param MediaCollectionInterface|Media $var Representation of associated media.
* @return MediaCollectionInterface|Media Representation of associated media.
*/
public function media($var = null)
{
@@ -1376,8 +1377,8 @@ class Page implements PageInterface
* Gets and sets the cache-control property. If not set it will return the default value (null)
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control for more details on valid options
*
* @param null $var
* @return null
* @param string|null $var
* @return string|null
*/
public function cacheControl($var = null)
{
@@ -1829,7 +1830,7 @@ class Page implements PageInterface
/**
* Gets and Sets the page raw route
*
* @param null $var
* @param string|null $var
*
* @return null|string
*/
@@ -1875,7 +1876,7 @@ class Page implements PageInterface
* Gets the canonical route for this page if its set. If provided it will use
* that value, else if it's `true` it will use the default route.
*
* @param null $var
* @param string|null $var
*
* @return bool|string
*/
@@ -2309,7 +2310,7 @@ class Page implements PageInterface
/**
* Returns children of this page.
*
* @return Collection
* @return PageCollectionInterface|Collection
*/
public function children()
{
@@ -2433,7 +2434,7 @@ class Page implements PageInterface
$routes = Grav::instance()['pages']->routes();
if (isset($routes[$uri_path])) {
/** @var PageInterface $child_page */
/** @var PageInterface|null $child_page */
$child_page = $pages->find($uri->route())->parent();
if ($child_page) {
while (!$child_page->root()) {
@@ -2561,7 +2562,7 @@ class Page implements PageInterface
* @param string|array $params
* @param bool $pagination
*
* @return Collection
* @return PageCollectionInterface|Collection
* @throws \InvalidArgumentException
*/
public function collection($params = 'content', $pagination = true)
@@ -2590,7 +2591,7 @@ class Page implements PageInterface
/**
* @param string|array $value
* @param bool $only_published
* @return Collection
* @return PageCollectionInterface|Collection
*/
public function evaluate($value, $only_published = true)
{

View File

@@ -374,7 +374,7 @@ trait IntervalTrait
/**
* Validate sequence of cron expression.
*
* @param int|string $value
* @param int|string|null $value
* @param int $min
* @param int $max
* @return mixed

View File

@@ -37,6 +37,7 @@ class Job
private $after;
private $whenOverlapping;
private $outputMode;
/** @var Process|null $process */
private $process;
private $successful = false;
private $backlink;
@@ -73,7 +74,7 @@ class Job
/**
* Get the command
*
* @return string
* @return \Closure|string
*/
public function getCommand()
{
@@ -322,7 +323,6 @@ class Job
*/
public function finalize()
{
/** @var Process $process */
$process = $this->process;
if ($process) {

View File

@@ -126,7 +126,7 @@ class Scheduler
/**
* Get a specific Job based on id
*
* @param $jobid
* @param string $jobid
* @return Job|null
*/
public function getJob($jobid)

View File

@@ -116,7 +116,7 @@ class Security
* return false positives because of it tags all potentially dangerous HTML tags and attributes without looking into
* their content.
*
* @param string $string The string to run XSS detection logic on
* @param string|null $string The string to run XSS detection logic on
* @return bool|string Type of XSS vector if the given `$string` may contain XSS, false otherwise.
*
* Copies the code from: https://github.com/symphonycms/xssfilter/blob/master/extension.driver.php#L138

View File

@@ -118,12 +118,12 @@ class Session extends \Grav\Framework\Session\Session
/** @var Uri $uri */
$uri = $grav['uri'];
/** @var Grav\Plugin\Form\Forms $form */
/** @var Grav\Plugin\Form\Forms|null $form */
$form = $grav['forms']->getActiveForm();
$sessionField = base64_encode($uri->url);
/** @var FormFlash $flash */
/** @var FormFlash|null $flash */
$flash = $form ? $form->getFlash() : null;
$object = $flash && method_exists($flash, 'getLegacyFiles') ? [$sessionField => $flash->getLegacyFiles()] : null;
}

View File

@@ -251,7 +251,7 @@ class TwigExtension extends AbstractExtension implements GlobalsInterface
/**
* Returns array in a random order.
*
* @param array $original
* @param array|\Traversable $original
* @param int $offset Can be used to return only slice of the array.
*
* @return array
@@ -421,7 +421,7 @@ class TwigExtension extends AbstractExtension implements GlobalsInterface
/**
* Return ksorted collection.
*
* @param array $array
* @param array|null $array
*
* @return array
*/
@@ -979,9 +979,9 @@ class TwigExtension extends AbstractExtension implements GlobalsInterface
/**
* Wrapper for array_intersect() method
*
* @param array $array1
* @param array $array2
* @return array
* @param array|Collection $array1
* @param array|Collection $array2
* @return array|Collection
*/
public function arrayIntersectFunc($array1, $array2)
{

View File

@@ -22,10 +22,10 @@ class Uri
{
const HOSTNAME_REGEX = '/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/';
/** @var \Grav\Framework\Uri\Uri */
/** @var \Grav\Framework\Uri\Uri|null */
protected static $currentUri;
/** @var \Grav\Framework\Route\Route */
/** @var \Grav\Framework\Route\Route|null */
protected static $currentRoute;
public $url;
@@ -953,7 +953,7 @@ class Uri
* @param PageInterface $page the current page to use as reference
* @param string $markdown_url the URL as it was written in the markdown
* @param string $type the type of URL, image | link
* @param null $relative if null, will use system default, if true will use relative links internally
* @param bool|null $relative if null, will use system default, if true will use relative links internally
*
* @return string the more friendly formatted url
*/
@@ -1109,7 +1109,7 @@ class Uri
/**
* Filters the user info string.
*
* @param string $info The raw user or password.
* @param string|null $info The raw user or password.
* @return string The percent-encoded user or password string.
*/
public static function filterUserInfo($info)
@@ -1125,7 +1125,7 @@ class Uri
* will NOT double-encode characters that are already
* percent-encoded.
*
* @param string $path The raw uri path.
* @param string|null $path The raw uri path.
* @return string The RFC 3986 percent-encoded uri path.
* @link http://www.faqs.org/rfcs/rfc3986.html
*/
@@ -1137,7 +1137,7 @@ class Uri
/**
* Filters the query string or fragment of a URI.
*
* @param string $query The raw uri query string.
* @param string|null $query The raw uri query string.
* @return string The percent-encoded query string.
*/
public static function filterQuery($query)

View File

@@ -103,7 +103,7 @@ class User extends Data implements UserInterface
*/
public function save()
{
/** @var CompiledYamlFile $file */
/** @var CompiledYamlFile|null $file */
$file = $this->file();
if (!$file || !$file->filename()) {
user_error(__CLASS__ . ': calling \$user = new ' . __CLASS__ . "() is deprecated since Grav 1.6, use \$grav['accounts']->load(\$username) or \$grav['accounts']->load('') instead", E_USER_DEPRECATED);

View File

@@ -97,7 +97,7 @@ class Group extends FlexObject
/**
* @param mixed $value
* @return Access
* @return array
*/
protected function offsetPrepare_access($value): array
{
@@ -105,7 +105,7 @@ class Group extends FlexObject
}
/**
* @param Access|null $value
* @param array|null $value
* @return array|null
*/
protected function offsetSerialize_access(?array $value): ?array

View File

@@ -11,6 +11,12 @@ namespace Grav\Common\User\FlexUser;
use Grav\Framework\Flex\FlexIndex;
/**
* Class GroupIndex
* @package Grav\Common\User\FlexUser
*
* @method bool|null authorize(string $action, string $scope = null)
*/
class GroupIndex extends FlexIndex
{
}

View File

@@ -15,8 +15,10 @@ use Grav\Common\Page\Media;
use Grav\Common\Page\Medium\ImageMedium;
use Grav\Common\Page\Medium\Medium;
use Grav\Common\Page\Medium\MediumFactory;
use Grav\Common\Page\Medium\StaticImageMedium;
use Grav\Common\User\Access;
use Grav\Common\User\Authentication;
use Grav\Common\User\Interfaces\UserCollectionInterface;
use Grav\Common\User\Interfaces\UserInterface;
use Grav\Common\User\Traits\UserTrait;
use Grav\Common\Utils;
@@ -465,7 +467,7 @@ class User extends FlexObject implements UserInterface, MediaManipulationInterfa
* Set or get the data storage.
*
* @param FileInterface|null $storage Optionally enter a new storage.
* @return FileInterface
* @return FileInterface|null
*/
public function file(FileInterface $storage = null)
{
@@ -552,7 +554,7 @@ class User extends FlexObject implements UserInterface, MediaManipulationInterfa
/**
* Return media object for the User's avatar.
*
* @return ImageMedium|null
* @return ImageMedium|StaticImageMedium|null
* @deprecated 1.6 Use ->getAvatarImage() method instead.
*/
public function getAvatarMedia()
@@ -644,7 +646,7 @@ class User extends FlexObject implements UserInterface, MediaManipulationInterfa
/**
* @param mixed $value
* @return Access
* @return array
*/
protected function offsetPrepare_access($value): array
{
@@ -652,7 +654,7 @@ class User extends FlexObject implements UserInterface, MediaManipulationInterfa
}
/**
* @param Access|null $value
* @param array|null $value
* @return array|null
*/
protected function offsetSerialize_access(?array $value): ?array
@@ -786,7 +788,7 @@ class User extends FlexObject implements UserInterface, MediaManipulationInterfa
protected function saveUpdatedMedia(): void
{
// Upload/delete original sized images.
/** @var FormFlashFile $file */
/** @var FormFlashFile|null $file */
foreach ($this->_uploads_original ?? [] as $name => $file) {
$name = 'original/' . $name;
if ($file) {
@@ -798,7 +800,7 @@ class User extends FlexObject implements UserInterface, MediaManipulationInterfa
/**
* @var string $filename
* @var UploadedFileInterface $file
* @var UploadedFileInterface|null $file
*/
foreach ($this->getUpdatedMedia() as $filename => $file) {
if ($file) {
@@ -830,9 +832,9 @@ class User extends FlexObject implements UserInterface, MediaManipulationInterfa
continue;
}
/** @var Medium $thumbFile */
/** @var Medium|null $thumbFile */
$thumbFile = $resizedMedia[$filename];
/** @var Medium $imageFile */
/** @var Medium|null $imageFile */
$imageFile = $originalMedia[$filename] ?? $thumbFile;
if ($thumbFile) {
$list[$filename] = [
@@ -890,14 +892,14 @@ class User extends FlexObject implements UserInterface, MediaManipulationInterfa
}
/**
* @return GroupCollection
* @return GroupCollection|GroupIndex
*/
protected function getUserGroups()
{
$grav = Grav::instance();
$flex = $grav['flex_objects'] ?? null;
/** @var GroupCollection $groups */
/** @var GroupCollection|null $groups */
$groups = $flex ? $flex->getDirectory('grav-user-groups') : null;
if ($groups) {

View File

@@ -116,7 +116,7 @@ trait UserTrait
*
* Note: if there's no local avatar image for the user, you should call getAvatarUrl() to get the external avatar URL.
*
* @return Medium|null
* @return ImageMedium|StaticImageMedium|null
*/
public function getAvatarImage(): ?Medium
{

View File

@@ -1298,7 +1298,7 @@ abstract class Utils
* Get a portion of an array (passed by reference) with dot-notation key
*
* @param array $array
* @param string|int $key
* @param string|int|null $key
* @param null $default
* @return mixed
*/
@@ -1327,10 +1327,10 @@ abstract class Utils
* Set portion of array (passed by reference) for a dot-notation key
* and set the value
*
* @param array $array
* @param string|int $key
* @param mixed $value
* @param bool $merge
* @param array $array
* @param string|int|null $key
* @param mixed $value
* @param bool $merge
*
* @return mixed
*/

View File

@@ -159,7 +159,6 @@ class SchedulerCommand extends ConsoleCommand
} elseif ($jobid = $this->input->getOption('run')) {
$io->title('Force Run Job: ' . $jobid);
/** @var Job $job */
$job = $scheduler->getJob($jobid);
if ($job) {

View File

@@ -320,7 +320,7 @@ class InstallCommand extends ConsoleCommand
}
/**
* @param Package $package
* @param Package|null $package
* @param bool $is_update True if the package is an update
*/
private function processPackage($package, $is_update = false)
@@ -447,7 +447,7 @@ class InstallCommand extends ConsoleCommand
} else {
$repo_dir = $matches[2];
}
$paths = (array) $paths;
foreach ($paths as $repo) {
$path = rtrim($repo, '/') . '/' . $repo_dir;

View File

@@ -106,7 +106,7 @@ class FlexPageCollection extends FlexCollection
*
* @param string $path
*
* @return PageInterface|null The next item.
* @return PageInterface|false The next item.
*/
public function nextSibling($path)
{
@@ -119,7 +119,7 @@ class FlexPageCollection extends FlexCollection
* @param string $path
* @param int $direction either -1 or +1
*
* @return PageInterface|null The sibling item.
* @return PageInterface|false The sibling item.
*/
public function adjacentSibling($path, $direction = 1)
{

View File

@@ -1098,9 +1098,27 @@ trait PageLegacyTrait
* @return CacheInterface
*/
abstract public function getCache(string $namespace = null);
/**
* @param PageInterface|null $var
* @return PageInterface|FlexObjectInterface|null
*/
abstract public function parent(PageInterface $var = null);
abstract public function getFlexDirectory(): FlexDirectory;
abstract protected function exists(): bool;
/**
* @return string|null
*/
abstract protected function getStorageFolder();
/**
* @param string $property
* @param mixed $var
* @param callable $filter
* @return mixed|null
*/
abstract protected function loadHeaderProperty(string $property, $var, callable $filter);
}

View File

@@ -15,6 +15,7 @@ use Grav\Common\Page\Interfaces\PageCollectionInterface;
use Grav\Common\Page\Interfaces\PageInterface;
use Grav\Common\Page\Pages;
use Grav\Common\Uri;
use Grav\Framework\Flex\Interfaces\FlexObjectInterface;
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
/**
@@ -377,7 +378,7 @@ trait PageRoutableTrait
* Gets and Sets the parent object for this page
*
* @param PageInterface|null $var the parent page object
* @return PageInterface|null the parent page object if it exists.
* @return PageInterface|FlexObjectInterface|null the parent page object if it exists.
*/
public function parent(PageInterface $var = null)
{

View File

@@ -115,3 +115,9 @@ parameters:
-
message: '#deprecated class#'
path: 'system/src/Grav/Framework/Uri/Uri.php'
-
message: '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch#'
path: 'system/src/Grav/Common/Grav.php'
- '#Call to deprecated method stopPropagation\(\) of class Symfony\\Component\\EventDispatcher\\Event#'
- '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::addListener\(\)#'
- '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::removeListener\(\)#'