Skip to content

Commit b323634

Browse files
lindyhopchrisEkman
authored andcommitted
Fix doc blocks and typo in tests (#5)
1 parent 7c4df68 commit b323634

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/LuhnAlgorithm.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class LuhnAlgorithm {
4040

4141
/**
4242
* Set number that the instance should handle.
43-
* @param sting|int $number Number in string or int format
43+
* @param string|int $number Number in string or int format
4444
* @param bool $withCheckDigit [Defaults to true] <br> Is the check digit
4545
* included in $number?
4646
*/
@@ -51,7 +51,7 @@ function __construct($number, $withCheckDigit = true) {
5151
/**
5252
* Validate according to the Luhn Algorithm
5353
* @return bool true if valid
54-
* @throws InvalidArgumentException If value is null
54+
* @throws \InvalidArgumentException If value is null
5555
*/
5656
public function isValid() {
5757
$checksum = self::calculateChecksum($this->number . $this->checkDigit, $this->nDigits + 1);
@@ -100,8 +100,8 @@ public static function calculateChecksum($number, $length = 0) {
100100

101101
/**
102102
* Calculate the checkdigit from a number
103-
* @param type $number
104-
* @return type
103+
* @param string $number
104+
* @return int
105105
*/
106106
public static function calculateCheckDigit($number) {
107107
// Get the checksum
@@ -160,7 +160,7 @@ public static function toInteger($string) {
160160

161161
/**
162162
* Set number that the instance should handle.
163-
* @param sting|int $number Number in string or int format
163+
* @param string|int $number Number in string or int format
164164
* @param bool $withCheckDigit [Defaults to true] <br> Is the check digit
165165
* included in $number?
166166
*/

tests/LuhnAlgorithmTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ public function testCalculateChecksum($number) {
5656
}
5757

5858
/**
59-
* @covers LuhnAlgorithm::calculcateCheckDigit
59+
* @covers LuhnAlgorithm::calculateCheckDigit
6060
* @dataProvider provider
6161
*/
62-
public function testCalculcateCheckDigit($number) {
62+
public function testCalculateCheckDigit($number) {
6363
$number = strval(LuhnAlgorithm::toInteger($number));
6464
$last = strlen($number) - 1;
6565

0 commit comments

Comments
 (0)