Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warnings #77

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="./vendor/autoload.php">

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
>
<testsuites>
<testsuite name="Codice Fiscale test suite">
<directory>./test</directory>
Expand Down
14 changes: 7 additions & 7 deletions src/AbstractCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class AbstractCalculator
);

/**
* Array of all avaialable odd characters.
* Array of all available odd characters.
*/
protected $odd = array(
'0' => 1,
Expand Down Expand Up @@ -77,7 +77,7 @@ abstract class AbstractCalculator
);

/**
* Array of all avaialable even characters.
* Array of all available even characters.
*/
protected $even = array(
'0' => 0,
Expand Down Expand Up @@ -120,7 +120,7 @@ abstract class AbstractCalculator


/**
* Array of all avaialable omocodia characters.
* Array of all available omocodia characters.
*/
protected $omocodiaCodes = array(
'0' => 'L',
Expand All @@ -136,7 +136,7 @@ abstract class AbstractCalculator
);

/**
* Array of all avaialable omocodia positions.
* Array of all available omocodia positions.
*/
protected $omocodiaPositions = array(14, 13, 12, 10, 9, 7, 6);

Expand All @@ -151,9 +151,9 @@ abstract class AbstractCalculator
protected function calculateSumByDictionary($temporaryCodiceFiscale, $dictionaryArray, $i)
{
$sum = 0;
for (; $i < 15; $i = $i + 2) {
$k = $temporaryCodiceFiscale[$i];
$sum = $sum + $dictionaryArray[$k];
for (; $i < 15; $i += 2) {
$k = $temporaryCodiceFiscale[$i] ?? '';
$sum += $dictionaryArray[$k] ?? 0;
}

return $sum;
Expand Down
Loading
Loading