Skip to content

Commit fc404d6

Browse files
committed
update code to remove deprecated warning in php7.4
1 parent 3c37fc1 commit fc404d6

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
language: php
22
php:
33
- 7.1
4+
- 7.2
5+
- 7.3
6+
- 7.4
47

58
before_script:
69
- travis_retry composer self-update

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
],
1111
"require": {
12-
"php" : ">=5.6 "
12+
"php" : ">=7.1"
1313
},
1414
"require-dev": {
1515
"phpunit/phpunit": "5.5.*"

src/CPF.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ private function validateDigits ($cpf)
9898
for ($t = 9; $t < 11; $t++) {
9999

100100
for ($d = 0, $c = 0; $c < $t; $c++) {
101-
$d += $cpf{$c} * (($t + 1) - $c);
101+
$d += $cpf[$c] * (($t + 1) - $c);
102102
}
103103
$d = ((10 * $d) % 11) % 10;
104-
if ($cpf{$c} != $d) {
104+
if ($cpf[$c] != $d) {
105105
return false;
106106
}
107107
}

0 commit comments

Comments
 (0)