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/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. */ 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; }