From d86eb8f8b94b454b6e6657ad3624f340c5823a4b Mon Sep 17 00:00:00 2001 From: dustinleblanc Date: Tue, 2 Mar 2021 12:31:02 -0500 Subject: [PATCH 1/2] Fix failing tests (on PHP 7.4) --- composer.json | 4 ++-- src/Document/Metadata.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 72e5568..2a9f73c 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ "php-curl-class/php-curl-class": "^4.6" }, "require-dev": { - "mikey179/vfsstream": "1.5.*", - "phpunit/phpunit": "4.7.*", + "mikey179/vfsstream": "1.6.*", + "phpunit/phpunit": "4.8.*", "phpdocumentor/phpdocumentor": "~2.8" }, "autoload": { diff --git a/src/Document/Metadata.php b/src/Document/Metadata.php index 44883da..ec7e4ed 100644 --- a/src/Document/Metadata.php +++ b/src/Document/Metadata.php @@ -335,7 +335,7 @@ public function setVideoURL($videoURL) { * Validates the keywords attribute. */ protected function validateKeywords($value) { - if (count($this->keywords) > 49) { + if ($this->keywords !== NULL && count($this->keywords) > 49) { $this->triggerError('number of keywords limited to 50.'); return FALSE; } From 6ddb5d7cf2e61d29193dce9463447e0b6578d724 Mon Sep 17 00:00:00 2001 From: dustinleblanc Date: Tue, 2 Mar 2021 12:36:12 -0500 Subject: [PATCH 2/2] Add setter/getter for plain targets --- src/Document/Anchor.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/Document/Anchor.php b/src/Document/Anchor.php index d30f3a5..62caf16 100644 --- a/src/Document/Anchor.php +++ b/src/Document/Anchor.php @@ -15,6 +15,7 @@ class Anchor extends Base { protected $targetAnchorPosition; protected $originAnchorPosition; protected $targetComponentIdentifier; + protected $target; protected $rangeStart; protected $rangeLength; @@ -37,6 +38,7 @@ protected function optional() { 'targetComponentIdentifier', 'rangeStart', 'rangeLength', + 'target' )); } @@ -102,6 +104,29 @@ public function setTargetComponentIdentifier($value) { return $this; } + /** + * Setter for target. + * + * @param mixed $value + * A target ID. + * + * @return $this + */ + public function setTarget($value) { + $this->target = (string) $value; + return $this; + } + + /** + * Getter for the target. + * + * @return string + * The Target identifier. + */ + public function getTarget() { + return $this->target; + } + /** * Getter for rangeStart. */