From 551539aea36538cc39cde53d9d19994a21aeb77d Mon Sep 17 00:00:00 2001 From: Giuseppe Criscione Date: Fri, 24 May 2019 20:27:56 +0200 Subject: [PATCH] Remove `Metadatum::__call()` --- formwork/Metadata/Metadatum.php | 38 ++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/formwork/Metadata/Metadatum.php b/formwork/Metadata/Metadatum.php index 6273d505..cfa46ff4 100644 --- a/formwork/Metadata/Metadatum.php +++ b/formwork/Metadata/Metadatum.php @@ -43,6 +43,16 @@ class Metadatum } } + /** + * Return metadatum name + * + * @return string + */ + public function name() + { + return $this->name; + } + /** * Return whether the metadatum is a charset declaration * @@ -63,6 +73,26 @@ class Metadatum return in_array($this->name, self::HTTP_EQUIV_NAMES, true); } + /** + * Return metadatum content + * + * @return string + */ + public function content() + { + return $this->content; + } + + /** + * Return metadatum prefix + * + * @return string + */ + public function prefix() + { + return $this->prefix; + } + /** * Return whether the metadatum has a prefix (e.g. 'twitter' for 'twitter:card', 'og' for 'og:image') * @@ -72,12 +102,4 @@ class Metadatum { return !is_null($this->prefix); } - - public function __call($name, $arguments) - { - if (property_exists($this, $name)) { - return $this->$name; - } - throw new LogicException('Invalid method ' . static::class . '::' . $name); - } }