Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
garak committed Jul 26, 2024
1 parent 6579cce commit 35cc5e9
Show file tree
Hide file tree
Showing 6 changed files with 272 additions and 264 deletions.
9 changes: 5 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?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="The project's test suite">
<testsuite name="codice-fiscale test suite">
<directory>./test</directory>
</testsuite>
</testsuites>
Expand All @@ -11,4 +12,4 @@
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
</phpunit>
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

0 comments on commit 35cc5e9

Please sign in to comment.