From 691501a5305078e595571b471b96fad1066db030 Mon Sep 17 00:00:00 2001 From: Pascal Borreli Date: Mon, 14 Apr 2014 22:03:02 +0100 Subject: [PATCH] Fixed typos --- README.md | 2 +- src/Input.php | 4 +--- src/Validator.php | 1 - src/Validator/In.php | 4 ++-- src/Validator/RangeMaxExclusive.php | 2 +- src/Validator/RangeMaxInclusive.php | 2 +- src/Validator/RangeMinExclusive.php | 2 +- src/Validator/RangeMinInclusive.php | 2 +- tests/Validator/EmailTest.php | 2 +- tests/Validator/RangeMaxExclusiveTest.php | 2 +- tests/Validator/RangeMaxInclusiveTest.php | 2 +- tests/Validator/RangeMinExclusiveTest.php | 2 +- tests/Validator/RangeMinInclusiveTest.php | 2 +- 13 files changed, 13 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 061763f..fec7fbd 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Input validation library, that has inbuilt error messages that are translatable, validators that are easy to extend, and that has easy to understand test declaration syntax. -## Succint Test Declaration +## Succinct Test Declaration Test is composed of assertions about the input. diff --git a/src/Input.php b/src/Input.php index b7f37e9..e3c5abd 100644 --- a/src/Input.php +++ b/src/Input.php @@ -24,15 +24,13 @@ public function __construct (array $input) { */ public function getValue (\Gajus\Vlad\Selector $selector) { $value = $this->input; - $found = true; foreach ($selector->getPath() as $crumb) { if (array_key_exists($crumb, $value)) { $value = $value[$crumb]; } else { $value = null; - $found = false; - + break; } } diff --git a/src/Validator.php b/src/Validator.php index 9e0bc70..4a39c51 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -35,7 +35,6 @@ public function getOptions () { } /** - * @param string $error_name * @return string */ static public function getMessage () { diff --git a/src/Validator/In.php b/src/Validator/In.php index 399fc5a..b8a9df4 100644 --- a/src/Validator/In.php +++ b/src/Validator/In.php @@ -13,9 +13,9 @@ class In extends \Gajus\Vlad\Validator { 'haystack' => null, 'strict' => true, /** - * This option is relavent only with strict option true and input type string. + * This option is relevant only with strict option true and input type string. * Performers quasi-strict comparison: haystack members are casted to string to avoid 'abc' == 0 false/positive - * that would otherwise occur using non-strict comparison, but '123' input will match 123 haystact member. + * that would otherwise occur using non-strict comparison, but '123' input will match 123 haystack member. * * @param boolean */ diff --git a/src/Validator/RangeMaxExclusive.php b/src/Validator/RangeMaxExclusive.php index 30b79d1..8f3fcb4 100644 --- a/src/Validator/RangeMaxExclusive.php +++ b/src/Validator/RangeMaxExclusive.php @@ -24,7 +24,7 @@ public function __construct (array $options = []) { } if (!is_numeric($options['range'])) { - throw new \Gajus\Vlad\Exception\InvalidArgumentException('Minimum boundry option must be numeric.'); + throw new \Gajus\Vlad\Exception\InvalidArgumentException('Minimum boundary option must be numeric.'); } } diff --git a/src/Validator/RangeMaxInclusive.php b/src/Validator/RangeMaxInclusive.php index 223e548..26eec63 100644 --- a/src/Validator/RangeMaxInclusive.php +++ b/src/Validator/RangeMaxInclusive.php @@ -24,7 +24,7 @@ public function __construct (array $options = []) { } if (!is_numeric($options['range'])) { - throw new \Gajus\Vlad\Exception\InvalidArgumentException('Minimum boundry option must be numeric.'); + throw new \Gajus\Vlad\Exception\InvalidArgumentException('Minimum boundary option must be numeric.'); } } diff --git a/src/Validator/RangeMinExclusive.php b/src/Validator/RangeMinExclusive.php index 6923acb..69537d4 100644 --- a/src/Validator/RangeMinExclusive.php +++ b/src/Validator/RangeMinExclusive.php @@ -24,7 +24,7 @@ public function __construct (array $options = []) { } if (!is_numeric($options['range'])) { - throw new \Gajus\Vlad\Exception\InvalidArgumentException('Minimum boundry option must be numeric.'); + throw new \Gajus\Vlad\Exception\InvalidArgumentException('Minimum boundary option must be numeric.'); } } diff --git a/src/Validator/RangeMinInclusive.php b/src/Validator/RangeMinInclusive.php index a46f396..d0f4cd5 100644 --- a/src/Validator/RangeMinInclusive.php +++ b/src/Validator/RangeMinInclusive.php @@ -24,7 +24,7 @@ public function __construct (array $options = []) { } if (!is_numeric($options['range'])) { - throw new \Gajus\Vlad\Exception\InvalidArgumentException('Minimum boundry option must be numeric.'); + throw new \Gajus\Vlad\Exception\InvalidArgumentException('Minimum boundary option must be numeric.'); } } diff --git a/tests/Validator/EmailTest.php b/tests/Validator/EmailTest.php index 548d6fd..e9cd47f 100644 --- a/tests/Validator/EmailTest.php +++ b/tests/Validator/EmailTest.php @@ -10,7 +10,7 @@ public function testValidSyntax () { /** * Since the underlying implementation is using PHP filter_var, there - * is no reason to extensively test different (in)valid email addressses. + * is no reason to extensively test different (in)valid email addresses. */ public function testInvalidSyntax () { $validator = new \Gajus\Vlad\Validator\Email(); diff --git a/tests/Validator/RangeMaxExclusiveTest.php b/tests/Validator/RangeMaxExclusiveTest.php index 64ad3c2..2af53e9 100644 --- a/tests/Validator/RangeMaxExclusiveTest.php +++ b/tests/Validator/RangeMaxExclusiveTest.php @@ -10,7 +10,7 @@ public function testMissingParameter () { /** * @expectedException Gajus\Vlad\Exception\InvalidArgumentException - * @expectedExceptionMessage Minimum boundry option must be numeric. + * @expectedExceptionMessage Minimum boundary option must be numeric. */ public function testInvalidRangeParameter () { new \Gajus\Vlad\Validator\RangeMaxExclusive(['range' => 'test']); diff --git a/tests/Validator/RangeMaxInclusiveTest.php b/tests/Validator/RangeMaxInclusiveTest.php index 575b7b3..d49452c 100644 --- a/tests/Validator/RangeMaxInclusiveTest.php +++ b/tests/Validator/RangeMaxInclusiveTest.php @@ -10,7 +10,7 @@ public function testMissingParameter () { /** * @expectedException Gajus\Vlad\Exception\InvalidArgumentException - * @expectedExceptionMessage Minimum boundry option must be numeric. + * @expectedExceptionMessage Minimum boundary option must be numeric. */ public function testInvalidRangeParameter () { new \Gajus\Vlad\Validator\RangeMaxInclusive(['range' => 'test']); diff --git a/tests/Validator/RangeMinExclusiveTest.php b/tests/Validator/RangeMinExclusiveTest.php index 984005b..2e327ad 100644 --- a/tests/Validator/RangeMinExclusiveTest.php +++ b/tests/Validator/RangeMinExclusiveTest.php @@ -10,7 +10,7 @@ public function testMissingParameter () { /** * @expectedException Gajus\Vlad\Exception\InvalidArgumentException - * @expectedExceptionMessage Minimum boundry option must be numeric. + * @expectedExceptionMessage Minimum boundary option must be numeric. */ public function testInvalidRangeParameter () { new \Gajus\Vlad\Validator\RangeMinExclusive(['range' => 'test']); diff --git a/tests/Validator/RangeMinInclusiveTest.php b/tests/Validator/RangeMinInclusiveTest.php index 1d81c9f..9f5aa1e 100644 --- a/tests/Validator/RangeMinInclusiveTest.php +++ b/tests/Validator/RangeMinInclusiveTest.php @@ -10,7 +10,7 @@ public function testMissingParameter () { /** * @expectedException Gajus\Vlad\Exception\InvalidArgumentException - * @expectedExceptionMessage Minimum boundry option must be numeric. + * @expectedExceptionMessage Minimum boundary option must be numeric. */ public function testInvalidRangeParameter () { new \Gajus\Vlad\Validator\RangeMinInclusive(['range' => 'test']);