From 85df4728e0c8668e8fa4c5784ff6d51e90a83874 Mon Sep 17 00:00:00 2001 From: Markus Lanthaler Date: Wed, 3 Oct 2012 20:25:24 +0200 Subject: [PATCH] Fix various DocBlocks --- Document.php | 2 +- Exception/ParseException.php | 12 ++++++++++++ Exception/ProcessException.php | 18 ++++++++++++++++++ Exception/SyntaxException.php | 18 ++++++++++++++++++ LanguageTaggedString.php | 10 +++------- NQuads.php | 2 +- Node.php | 2 +- Processor.php | 4 +--- QuadSerializer.php | 2 +- Test/DocumentTest.php | 5 +++++ Test/JsonLDTestSuiteTest.php | 7 +++++++ TypedValue.php | 6 +----- Value.php | 6 +++--- 13 files changed, 72 insertions(+), 22 deletions(-) diff --git a/Document.php b/Document.php index c9dcccb..9664386 100644 --- a/Document.php +++ b/Document.php @@ -69,7 +69,7 @@ class Document * * - base The base IRI of the input document. * - * @param string|array|object $input The JSON-LD document to process. + * @param string|array|object $document The JSON-LD document to process. * @param null|array|object $options Options to configure the processing. * * @return Document The parsed JSON-LD document. diff --git a/Exception/ParseException.php b/Exception/ParseException.php index 1027c59..82ac064 100644 --- a/Exception/ParseException.php +++ b/Exception/ParseException.php @@ -18,9 +18,21 @@ */ class ParseException extends \RuntimeException { + /** + * The file being parsed + * + * @var string + */ private $parsedFile; + + /** + * The raw error message (containing place-holders) + * + * @var string + */ private $rawMessage; + /** * Constructor. * diff --git a/Exception/ProcessException.php b/Exception/ProcessException.php index 7a29785..d0dde1a 100644 --- a/Exception/ProcessException.php +++ b/Exception/ProcessException.php @@ -21,10 +21,28 @@ */ class ProcessException extends \RuntimeException { + /** + * The file being processed + * + * @var string + */ private $parsedFile; + + /** + * The code snippet that triggered this exception + * + * @var mixed + */ private $snippet; + + /** + * The raw error message (containing place-holders) + * + * @var string + */ private $rawMessage; + /** * Constructor. * diff --git a/Exception/SyntaxException.php b/Exception/SyntaxException.php index dc374ef..882181a 100644 --- a/Exception/SyntaxException.php +++ b/Exception/SyntaxException.php @@ -21,10 +21,28 @@ */ class SyntaxException extends \RuntimeException { + /** + * The file being parsed + * + * @var string + */ private $parsedFile; + + /** + * The code snippet that triggered this exception + * + * @var mixed + */ private $snippet; + + /** + * The raw error message (containing place-holders) + * + * @var string + */ private $rawMessage; + /** * Constructor. * diff --git a/LanguageTaggedString.php b/LanguageTaggedString.php index ea4338f..4cc5009 100644 --- a/LanguageTaggedString.php +++ b/LanguageTaggedString.php @@ -29,8 +29,8 @@ final class LanguageTaggedString extends Value /** * Constructor * - * @param string $value The string's value. - * @param string $type The string's language. + * @param string $value The string's value. + * @param string $language The string's language. */ public function __construct($value, $language) { @@ -67,11 +67,7 @@ public function getLanguage() } /** - * Compares this language-tagged string object to the specified value. - * - * @param mixed $value - * @return bool Returns true if the passed value is the same as this - * instance; false otherwise. + * {@inheritdoc} */ public function equals($other) { diff --git a/NQuads.php b/NQuads.php index 8f2d6da..8afe58a 100644 --- a/NQuads.php +++ b/NQuads.php @@ -21,7 +21,7 @@ class NQuads implements QuadSerializer { /** - * {@inheritDoc} + * {@inheritdoc} */ public function serialize(array $quads) { diff --git a/Node.php b/Node.php index 0ed21b4..13cc22b 100644 --- a/Node.php +++ b/Node.php @@ -473,7 +473,7 @@ public function getReverseProperty($property) /** * Compares this Node object to the specified value. * - * @param mixed $value + * @param mixed $other The value this instance should be compared to. * @return bool Returns true if the passed value is the same as this * instance; false otherwise. */ diff --git a/Processor.php b/Processor.php index 2dd8308..044b8d3 100644 --- a/Processor.php +++ b/Processor.php @@ -697,8 +697,6 @@ private function expandIri($value, $activectx, $relativeIri = false, $vocabRelat * @param mixed $element A JSON-LD element to be compacted. * @param array $activectx The active context. * @param string $activeprty The active property. - * @param bool $optimize If set to true, the JSON-LD processor is allowed optimize - * the passed context to produce even compacter representations. * * @return mixed The compacted JSON-LD document. */ @@ -2312,7 +2310,7 @@ private static function mergeIntoProperty(&$object, $property, $value, $alwaysAr * are compared lexicographically. * * @param mixed $a Value A. - * @param mixed $a Value B. + * @param mixed $b Value B. * * @return int If value A is shorter than value B, -1 will be returned; if it's * longer 1 will be returned. If both values have the same lenght diff --git a/QuadSerializer.php b/QuadSerializer.php index c08c1f2..3f69b3a 100644 --- a/QuadSerializer.php +++ b/QuadSerializer.php @@ -21,7 +21,7 @@ interface QuadSerializer /** * Serializes quads to a string. * - * @param array $quads Array of {@link Quad Quads} to be serialized + * @param Quad[] $quads Array of quads to be serialized. * * @return string The serialized quads. */ diff --git a/Test/DocumentTest.php b/Test/DocumentTest.php index c23f857..6328cba 100644 --- a/Test/DocumentTest.php +++ b/Test/DocumentTest.php @@ -24,6 +24,11 @@ */ class DocumentTest extends \PHPUnit_Framework_TestCase { + /** + * The document instance being used throughout the tests. + * + * @var Document + */ protected $document; /** diff --git a/Test/JsonLDTestSuiteTest.php b/Test/JsonLDTestSuiteTest.php index ac820e8..49db75e 100644 --- a/Test/JsonLDTestSuiteTest.php +++ b/Test/JsonLDTestSuiteTest.php @@ -28,6 +28,13 @@ class JsonLDTestSuiteTest extends \PHPUnit_Framework_TestCase private $basedir; + /** + * Constructs a test case with the given name. + * + * @param string $name + * @param array $data + * @param string $dataName + */ public function __construct($name = null, array $data = array(), $dataName = '') { parent::__construct($name, $data, $dataName); diff --git a/TypedValue.php b/TypedValue.php index 47c5fad..7ac52d0 100644 --- a/TypedValue.php +++ b/TypedValue.php @@ -74,11 +74,7 @@ public function getType() } /** - * Compares this Value object to the specified value. - * - * @param mixed $value - * @return bool Returns true if the passed value is the same as this - * instance; false otherwise. + * {@inheritdoc} */ public function equals($other) { diff --git a/Value.php b/Value.php index 5439740..28b7b79 100644 --- a/Value.php +++ b/Value.php @@ -32,7 +32,7 @@ abstract class Value * If the passed value element can't be transformed to a language-tagged * string or a typed value null is returned. * - * @param object $element The JSON-LD element + * @param \stdClass $element The JSON-LD element * * @return null|LanguageTaggedString|TypedValue The parsed object */ @@ -111,9 +111,9 @@ public function getValue() } /** - * Compares this Value object to the specified value. + * Compares this instance to the specified value. * - * @param mixed $value + * @param mixed $other The value this instance should be compared to. * @return bool Returns true if the passed value is the same as this * instance; false otherwise. */