protected function validate() { $number = $this->format(); if (Modulus11::calculate(substr($number, 0, 9), [2, 5, 4, 9, 8, 1, 6, 7, 3]) != $number[9]) { return false; } return Modulus11::validate($number); }
protected function validate() { $number = $this->format(); return Modulus11::validate($number); }
public function testCustomFactors() { $this->assertTrue(Modulus11::validate('11223346')); $this->assertTrue(Modulus11::validate('1705833214', [2, 5, 4, 9, 8, 1, 6, 7, 3])); $this->assertSame(3, Modulus11::calculate('1705833214')); }