mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 14:58:42 +00:00
static analysis fixes
This commit is contained in:
parent
44a003b787
commit
93a972eb55
|
|
@ -83,16 +83,9 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
protected static $columns = [];
|
protected static $columns = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Relations.
|
|
||||||
*
|
|
||||||
* Relation is defined in a relation table
|
|
||||||
*
|
|
||||||
* @var string[]
|
|
||||||
* @since 1.0.0
|
|
||||||
*/ /**
|
|
||||||
* Has many relation.
|
* Has many relation.
|
||||||
*
|
*
|
||||||
* @var array<string, array<string, null|string>>
|
* @var array<string, array>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static $hasMany = [];
|
protected static $hasMany = [];
|
||||||
|
|
@ -102,7 +95,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
*
|
*
|
||||||
* Relation is defined in current mapper
|
* Relation is defined in current mapper
|
||||||
*
|
*
|
||||||
* @var string[]
|
* @var array<string, array>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static $ownsOne = [];
|
protected static $ownsOne = [];
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ final class Prime
|
||||||
*/
|
*/
|
||||||
public static function mersenne(int $p) : int
|
public static function mersenne(int $p) : int
|
||||||
{
|
{
|
||||||
return 2 ** $p - 1;
|
return (int) (2 ** $p) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -135,6 +135,10 @@ final class Prime
|
||||||
$range = \range(2, $n);
|
$range = \range(2, $n);
|
||||||
$primes = \array_combine($range, $range);
|
$primes = \array_combine($range, $range);
|
||||||
|
|
||||||
|
if ($primes === false) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
while ($number * $number < $n) {
|
while ($number * $number < $n) {
|
||||||
for ($i = $number; $i <= $n; $i += $number) {
|
for ($i = $number; $i <= $n; $i += $number) {
|
||||||
if ($i == $number) {
|
if ($i == $number) {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ final class Rest
|
||||||
*
|
*
|
||||||
* @param Request $request Request
|
* @param Request $request Request
|
||||||
*
|
*
|
||||||
* @return Request Returns the request result
|
* @return Response Returns the request result
|
||||||
*
|
*
|
||||||
* @throws \Exception this exception is thrown if an internal curl_init error occurs
|
* @throws \Exception this exception is thrown if an internal curl_init error occurs
|
||||||
*
|
*
|
||||||
|
|
@ -104,10 +104,11 @@ final class Rest
|
||||||
\curl_setopt($curl, \CURLOPT_RETURNTRANSFER, 1);
|
\curl_setopt($curl, \CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
|
||||||
$result = \curl_exec($curl);
|
$result = \curl_exec($curl);
|
||||||
|
$len = \strlen($cHeaderString);
|
||||||
|
|
||||||
\curl_close($curl);
|
\curl_close($curl);
|
||||||
|
|
||||||
$response->set('', \substr($result, \strlen($cHeaderString)));
|
$response->set('', \substr(\is_bool($result) ? '' : $result, $len === false ? 0 : $len));
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ final class ModuleManager
|
||||||
*
|
*
|
||||||
* This is important to inform other moduels what kind of information they can receive from other modules.
|
* This is important to inform other moduels what kind of information they can receive from other modules.
|
||||||
*
|
*
|
||||||
* @var \phpOMS\Module\ModuleAbstract[]
|
* @var array<string, array<int, string>>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $providing = [];
|
private $providing = [];
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ final class CreditCard extends ValidatorAbstract
|
||||||
// Loop through each digit and do the maths
|
// Loop through each digit and do the maths
|
||||||
$total = 0;
|
$total = 0;
|
||||||
for ($i = 0; $i < $numberLength; ++$i) {
|
for ($i = 0; $i < $numberLength; ++$i) {
|
||||||
$digit = $value[$i];
|
$digit = (int) $value[$i];
|
||||||
// Multiply alternate digits by two
|
// Multiply alternate digits by two
|
||||||
if ($i % 2 == $parity) {
|
if ($i % 2 == $parity) {
|
||||||
$digit *= 2;
|
$digit *= 2;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user