Skip to content

Add Range types #372

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
54 changes: 54 additions & 0 deletions src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

declare(strict_types=1);

namespace MartinGeorgiev\Doctrine\DBAL\Types;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type;
use MartinGeorgiev\Model\ArithmeticRange;

/**
* Implementation of PostgreSQL NUMRANGE data type.
*
* @see https://www.postgresql.org/docs/current/rangetypes.html
* @since 3.1
*
* @author Jan Klan <jan@klan.com.au>
*/
class NumRange extends BaseType
{
protected const TYPE_NAME = 'numrange';

public function convertToPHPValue($value, AbstractPlatform $platform): ?ArithmeticRange
{
if (null === $value || 'empty' === $value) {
return null;
}

if (!\is_string($value)) {
throw new \RuntimeException('NumRange expects only string. Unexpected value from DB: '.$value);

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Binary operation "." between 'NumRange expects…' and mixed results in an error.

Check failure on line 30 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Binary operation "." between 'NumRange expects…' and mixed results in an error.
}

if (!\preg_match('/(\[|\()(.*)\,(.*)(\]|\))/', $value, $matches)) {
throw new \RuntimeException('unexpected value from DB: '.$value);
}

return ArithmeticRange::createFromString($value);
}
Comment on lines +23 to +38
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix mixed type handling to resolve static analysis errors

The static analysis tools are reporting errors in this method. The issue occurs when concatenating $value with a string, as $value is treated as mixed by the analyzer. You should use explicit type casting or checking.

    public function convertToPHPValue($value, AbstractPlatform $platform): ?ArithmeticRange
    {
        if (null === $value || 'empty' === $value) {
            return null;
        }

        if (!\is_string($value)) {
-            throw new \RuntimeException('NumRange expects only string. Unexpected value from DB: '.$value);
+            throw new \RuntimeException(sprintf('NumRange expects only string. Unexpected value from DB: %s', var_export($value, true)));
        }

        if (!\preg_match('/(\[|\()(.*)\,(.*)(\]|\))/', $value, $matches)) {
-            throw new \RuntimeException('unexpected value from DB: '.$value);
+            throw new \RuntimeException(sprintf('unexpected value from DB: %s', $value));
        }

        return ArithmeticRange::createFromString($value);
    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public function convertToPHPValue($value, AbstractPlatform $platform): ?ArithmeticRange
{
if (null === $value || 'empty' === $value) {
return null;
}
if (!\is_string($value)) {
throw new \RuntimeException('NumRange expects only string. Unexpected value from DB: '.$value);
}
if (!\preg_match('/(\[|\()(.*)\,(.*)(\]|\))/', $value, $matches)) {
throw new \RuntimeException('unexpected value from DB: '.$value);
}
return ArithmeticRange::createFromString($value);
}
public function convertToPHPValue($value, AbstractPlatform $platform): ?ArithmeticRange
{
if (null === $value || 'empty' === $value) {
return null;
}
if (!\is_string($value)) {
throw new \RuntimeException(
sprintf(
'NumRange expects only string. Unexpected value from DB: %s',
var_export($value, true)
)
);
}
if (!\preg_match('/(\[|\()(.*)\,(.*)(\]|\))/', $value, $matches)) {
throw new \RuntimeException(
sprintf(
'unexpected value from DB: %s',
$value
)
);
}
return ArithmeticRange::createFromString($value);
}
🧰 Tools
🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 30-30:
Binary operation "." between 'NumRange expects…' and mixed results in an error.

🤖 Prompt for AI Agents (early access)
In src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php lines 23 to 38, the method concatenates $value with strings in exception messages, but static analysis reports errors because $value is treated as mixed. To fix this, explicitly cast $value to string when concatenating in the RuntimeException messages or ensure $value is a string before concatenation by adding appropriate type checks or casting.


public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
{
if (empty($value)) {
return null;
}

$stringValue = (string) $value;

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Cannot cast mixed to string.

Check failure on line 46 in src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Cannot cast mixed to string.

if ('(,)' === $stringValue) {
return null;
}

return $stringValue;
}
Comment on lines +40 to +53
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix mixed type handling in string conversion

The static analysis tools are reporting an error on line 46 when casting $value to string. Since $value is of mixed type, you need to handle type conversion more explicitly.

    public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
    {
        if (empty($value)) {
            return null;
        }

-        $stringValue = (string) $value;
+        $stringValue = \is_object($value) && method_exists($value, '__toString') 
+            ? (string) $value 
+            : (\is_scalar($value) ? (string) $value : '');

        if ('(,)' === $stringValue) {
            return null;
        }

        return $stringValue;
    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
{
if (empty($value)) {
return null;
}
$stringValue = (string) $value;
if ('(,)' === $stringValue) {
return null;
}
return $stringValue;
}
public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
{
if (empty($value)) {
return null;
}
$stringValue = \is_object($value) && method_exists($value, '__toString')
? (string) $value
: (\is_scalar($value) ? (string) $value : '');
if ('(,)' === $stringValue) {
return null;
}
return $stringValue;
}
🧰 Tools
🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 46-46:
Cannot cast mixed to string.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 46-46:
Cannot cast mixed to string.

🤖 Prompt for AI Agents (early access)
In src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php between lines 40 and 53, the code casts a mixed type $value directly to string, causing static analysis errors. To fix this, explicitly check the type of $value before conversion: if it's already a string, use it as is; if it's an object with a __toString method, cast it to string; otherwise, handle other types appropriately or throw an error. This explicit handling will satisfy static analysis and ensure correct string conversion.

}
74 changes: 74 additions & 0 deletions src/MartinGeorgiev/Model/ArithmeticRange.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

declare(strict_types=0);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix strict types declaration.

The strict_types declaration should be set to 1, not 0, to prevent type coercion and ensure consistent type checking.

-declare(strict_types=0);
+declare(strict_types=1);
🤖 Prompt for AI Agents (early access)
In src/MartinGeorgiev/Model/ArithmeticRange.php at line 3, the strict_types declaration is incorrectly set to 0. Change the declaration to declare(strict_types=1); to enable strict type checking and prevent type coercion.


namespace MartinGeorgiev\Model;

use MartinGeorgiev\Utils\MathUtils;

/**
* @implements RangeInterface<float|int>
*/
class ArithmeticRange extends BaseRange

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

Check failure on line 12 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.
Comment on lines +9 to +12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix class annotation and implementation.

While the @implements annotation is correctly used, the static analyzer reports an error because the class extends BaseRange which already implements RangeInterface. Consider adjusting the annotation.

/**
- * @implements RangeInterface<float|int>
+ * @extends BaseRange<float|int>
 */
class ArithmeticRange extends BaseRange
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* @implements RangeInterface<float|int>
*/
class ArithmeticRange extends BaseRange
/**
* @extends BaseRange<float|int>
*/
class ArithmeticRange extends BaseRange
🧰 Tools
🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 12-12:
Class MartinGeorgiev\Model\ArithmeticRange has @implements tag, but does not implement any interface.

🤖 Prompt for AI Agents (early access)
In src/MartinGeorgiev/Model/ArithmeticRange.php around lines 9 to 12, the @implements annotation on the ArithmeticRange class causes a static analyzer error because BaseRange already implements RangeInterface. Remove the @implements annotation from ArithmeticRange to avoid redundant interface implementation declaration and resolve the static analyzer error.

{
public function __construct(
public null|float|int $lower,
public null|float|int $upper,
public bool $lowerInclusive = true,
public bool $upperInclusive = false,
) {
// Void
}

public function __toString(): string
{
if (null !== $this->lower && $this->lower === $this->upper && !$this->lowerInclusive && !$this->upperInclusive) {
return 'empty';
}

return \sprintf(
'%s%s,%s%s',
$this->lowerInclusive ? '[' : '(',
$this->lower,
$this->upper,
$this->upperInclusive ? ']' : ')',
);
}

public function contains(mixed $target): bool
{
return MathUtils::inRange($target, $this->lower, $this->upper, $this->lowerInclusive, $this->upperInclusive);

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

Check failure on line 40 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.
}
Comment on lines +38 to +41
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Type compatibility issue in contains method.

The static analyzer is detecting a potential type compatibility issue when passing values to MathUtils::inRange().

Consider explicitly casting or validating the input parameter:

    public function contains(mixed $target): bool
    {
-        return MathUtils::inRange($target, $this->lower, $this->upper, $this->lowerInclusive, $this->upperInclusive);
+        if (!is_numeric($target)) {
+            return false;
+        }
+        return MathUtils::inRange(
+            is_numeric($target) ? (float)$target : null,
+            $this->lower, 
+            $this->upper, 
+            $this->lowerInclusive, 
+            $this->upperInclusive
+        );
    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public function contains(mixed $target): bool
{
return MathUtils::inRange($target, $this->lower, $this->upper, $this->lowerInclusive, $this->upperInclusive);
}
public function contains(mixed $target): bool
{
if (!is_numeric($target)) {
return false;
}
return MathUtils::inRange(
is_numeric($target) ? (float)$target : null,
$this->lower,
$this->upper,
$this->lowerInclusive,
$this->upperInclusive
);
}
🧰 Tools
🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 40-40:
Parameter #1 $value of static method MartinGeorgiev\Utils\MathUtils::inRange() expects float|int|null, DateTimeInterface|float|int given.

🤖 Prompt for AI Agents (early access)
In src/MartinGeorgiev/Model/ArithmeticRange.php around lines 38 to 41, the contains method passes a mixed type parameter directly to MathUtils::inRange, causing a type compatibility issue. To fix this, add explicit type validation or casting for the $target parameter before passing it to inRange, ensuring it matches the expected type that inRange accepts.


/**
* @see https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-INFINITE
*/
public static function createFromString(string $value): self
{
if (!\preg_match('/([\[(])(.*),(.*)([])])/', $value, $matches)) {
throw new \RuntimeException('Unexpected value: '.$value);
}

$startParenthesis = $matches[1];
$startsAtString = \trim($matches[2], '"');
$endsAtString = \trim($matches[3], '"');
$endParenthesis = $matches[4];

if (\in_array($startsAtString, ['infinity', '-infinity', ''], true)) {
$startsAt = null;
} else {
$startsAt = MathUtils::stringToNumber($startsAtString);
}

if (\in_array($endsAtString, ['infinity', '-infinity', ''], true)) {
$endsAt = null;
} else {
$endsAt = MathUtils::stringToNumber($endsAtString);
}

$startInclusive = '[' === $startParenthesis;
$endInclusive = ']' === $endParenthesis;

return new NumRange($startsAt, $endsAt, $startInclusive, $endInclusive);

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Instantiated class MartinGeorgiev\Model\NumRange not found.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.

Check failure on line 72 in src/MartinGeorgiev/Model/ArithmeticRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Instantiated class MartinGeorgiev\Model\NumRange not found.
Copy link

@coderabbitai coderabbitai bot May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix incorrect class instantiation in createFromString.

The method returns self but instantiates a non-existent NumRange class. This is causing static analysis failures in all test environments.

-        return new NumRange($startsAt, $endsAt, $startInclusive, $endInclusive);
+        return new self($startsAt, $endsAt, $startInclusive, $endInclusive);
🧰 Tools
🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 72-72:
Method MartinGeorgiev\Model\ArithmeticRange::createFromString() should return MartinGeorgiev\Model\ArithmeticRange but returns MartinGeorgiev\Model\NumRange.


[failure] 72-72:
Instantiated class MartinGeorgiev\Model\NumRange not found.

🤖 Prompt for AI Agents (early access)
In src/MartinGeorgiev/Model/ArithmeticRange.php at line 72, the createFromString method incorrectly instantiates a non-existent NumRange class instead of the current class. Replace the instantiation of NumRange with self or static to correctly return an instance of the current class and resolve static analysis errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, the class was first called NumRange.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janklan Thanks for the explanation! That makes sense - the class was renamed from NumRange to ArithmeticRange, but the instantiation wasn't updated. The suggested fix (changing new NumRange(...) to new self(...)) should resolve all those static analysis failures.

}
}
38 changes: 38 additions & 0 deletions src/MartinGeorgiev/Model/BaseRange.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=0);
Copy link

@coderabbitai coderabbitai bot May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix strict types declaration.

The strict_types declaration should be set to 1, not 0, to prevent type coercion and ensure consistent type checking.

-declare(strict_types=0);
+declare(strict_types=1);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
declare(strict_types=0);
-declare(strict_types=0);
+declare(strict_types=1);
🤖 Prompt for AI Agents (early access)
In src/MartinGeorgiev/Model/BaseRange.php at line 3, the strict_types declaration is incorrectly set to 0. Change the declaration to strict_types=1 to enable strict type checking and prevent type coercion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CS Fixer added non-strict types because the strictness can't be guaranteed. I guess the strictness can be introduced by addressing the underlying reasons (highlighted below by the AI), but the question is, "do we care"?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the overall pattern of strict_types declarations in the project
echo "Files with strict_types=1:"
rg "declare\(strict_types=1\)" -l | wc -l

echo "Files with strict_types=0:"
rg "declare\(strict_types=0\)" -l | wc -l

# Look at CS Fixer configuration if it exists
echo "CS Fixer configuration:"
find . -name ".php-cs-fixer.php" -o -name ".php-cs-fixer.dist.php" -o -name ".php_cs" -o -name ".php_cs.dist" | xargs cat 2>/dev/null || echo "No CS Fixer config found"

# Check range-related files for type handling
echo "Range-related files:"
rg "Range" --files-with-matches src/

# Check the RangeInterface implementation
echo "RangeInterface.php content:"
cat src/MartinGeorgiev/Model/RangeInterface.php

Length of output: 1593


🏁 Script executed:

#!/bin/bash
# Let's look at the ArithmeticRange implementation and MathUtils
echo "ArithmeticRange.php content:"
cat src/MartinGeorgiev/Model/ArithmeticRange.php

# Let's also check the strict types in other range-related files
echo "NumRange.php strict_types declaration:"
head -5 src/MartinGeorgiev/Doctrine/DBAL/Types/NumRange.php | grep strict_types

# Let's find the other file with strict_types=0
echo "Other files with strict_types=0:"
rg "declare\(strict_types=0\)" -l

Length of output: 2637


@janklan I see why CS Fixer added declare(strict_types=0) - there's a critical issue in ArithmeticRange::createFromString() where it promises to return self (ArithmeticRange) but actually returns a NumRange instance:

public static function createFromString(string $value): self
{
    // ...
    return new NumRange($startsAt, $endsAt, $startInclusive, $endInclusive);
}

This would throw a type error with strict typing. The rest of your codebase (339 files) uses strict_types=1 with only these two range files as exceptions.

Do you care? It depends on how much you value type safety and codebase consistency. If you want to fix it, you could either:

  1. Change the return type to match the actual return value (NumRange instead of self)
  2. Change the implementation to return an ArithmeticRange instance
  3. Keep strict_types=0 for these files as an exception

What approach would you prefer?


🧬 Code Graph Analysis Results

Relevant snippets from src/MartinGeorgiev/Model/RangeInterface.php (lines 17-27)

public function isLowerInfinite(): bool;
public function isUpperInfinite(): bool;
public function isEmpty(): bool;
public function isInfinite(): bool;
public function hasSingleBoundary(): bool;
public function hasBothBoundaries(): bool;

These are the interface method declarations implemented by BaseRange. They specify the return type bool for each method, matching the implementation in BaseRange.php. This is relevant to understanding the type declarations and strictness in the BaseRange class.


namespace MartinGeorgiev\Model;

abstract class BaseRange implements RangeInterface

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

Check failure on line 7 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T
Copy link

@coderabbitai coderabbitai bot May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add generic type parameters to the class definition.

The class implements the generic RangeInterface but doesn't specify its type parameter, which is causing static analysis errors across all PHP versions.

-abstract class BaseRange implements RangeInterface
+/**
+ * @template T of int|float|\DateTimeInterface
+ * @implements RangeInterface<T>
+ */
+abstract class BaseRange implements RangeInterface
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
abstract class BaseRange implements RangeInterface
/**
* @template T of int|float|\DateTimeInterface
* @implements RangeInterface<T>
*/
abstract class BaseRange implements RangeInterface
🧰 Tools
🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 7-7:
Class MartinGeorgiev\Model\BaseRange implements generic interface MartinGeorgiev\Model\RangeInterface but does not specify its types: T

🤖 Prompt for AI Agents (early access)
In src/MartinGeorgiev/Model/BaseRange.php at line 7, the BaseRange class implements the generic RangeInterface but does not specify the required generic type parameter. To fix the static analysis errors, update the class definition to include the appropriate generic type parameter matching the RangeInterface's definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO superfluous, but "why not"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janklan I understand your view! While it might seem superfluous since PHP doesn't enforce generic type parameters at runtime, it helps static analysis tools properly validate type safety and provides better code documentation. Thanks for being open to the improvement - it'll resolve those static analysis errors across all PHP versions.

{
public function isLowerInfinite(): bool
{
return null === $this->lower;

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 11 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.
}
Comment on lines +9 to +12
Copy link

@coderabbitai coderabbitai bot May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Define the lower and upper boundary properties or accessor methods.

The class accesses undefined properties $lower and $upper. Since this is an abstract class, you should either:

  1. Declare abstract protected properties/methods to ensure implementations provide them, or
  2. Define protected properties in the base class

Static analysis fails on all PHP and Doctrine versions for this reason.

abstract class BaseRange implements RangeInterface
{
+    /**
+     * @var T|null
+     */
+    protected $lower;
+
+    /**
+     * @var T|null
+     */
+    protected $upper;
+
+    /**
+     * @return T|null
+     */
+    protected function getLower()
+    {
+        return $this->lower;
+    }
+
+    /**
+     * @return T|null
+     */
+    protected function getUpper()
+    {
+        return $this->upper;
+    }

    public function isLowerInfinite(): bool
    {
        return null === $this->lower;
    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public function isLowerInfinite(): bool
{
return null === $this->lower;
}
abstract class BaseRange implements RangeInterface
{
/**
* @var T|null
*/
protected $lower;
/**
* @var T|null
*/
protected $upper;
/**
* @return T|null
*/
protected function getLower()
{
return $this->lower;
}
/**
* @return T|null
*/
protected function getUpper()
{
return $this->upper;
}
public function isLowerInfinite(): bool
{
return null === $this->lower;
}
// ... rest of class ...
}
🧰 Tools
🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🪛 GitHub Check: PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

[failure] 11-11:
Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

🤖 Prompt for AI Agents (early access)
In src/MartinGeorgiev/Model/BaseRange.php around lines 9 to 12, the class uses undefined properties $lower and $upper, causing static analysis errors. To fix this, declare these properties as protected in the base class or define abstract protected getter methods for them, ensuring all subclasses implement or inherit these members. This will make the properties explicitly defined and resolve the static analysis issues.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janklan I see your point. You're right that more sophisticated static analysis tools like PHPStan (with appropriate configuration) can understand this inheritance pattern and recognize that child classes define these properties.

The issue is that the GitHub checks appear to be using a tool or configuration that analyzes the BaseRange class in isolation, without considering implementations. This explains why all builds are failing with the same error.

If you're comfortable with the current approach and PHPStan is fine with it locally, you have a few options:

  1. Keep the code as is and configure the CI tool to ignore these specific warnings
  2. Add the properties to the base class as I suggested
  3. Use PHP 8's @property annotations in the class docblock to help other tools

Ultimately it's your decision based on your team's preferences for explicitness vs. conciseness.


public function isUpperInfinite(): bool
{
return null === $this->upper;

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.

Check failure on line 16 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$upper.
}

public function isEmpty(): bool
{
return null !== $this->lower && $this->lower === $this->upper;

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.

Check failure on line 21 in src/MartinGeorgiev/Model/BaseRange.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Access to an undefined property MartinGeorgiev\Model\BaseRange::$lower.
}

public function isInfinite(): bool
{
return $this->isLowerInfinite() && $this->isUpperInfinite();
}

public function hasSingleBoundary(): bool
{
return !$this->isLowerInfinite() xor !$this->isUpperInfinite();
}

public function hasBothBoundaries(): bool
{
return !$this->isLowerInfinite() && !$this->isUpperInfinite();
}
}
28 changes: 28 additions & 0 deletions src/MartinGeorgiev/Model/RangeInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace MartinGeorgiev\Model;

/**
* @template T of int|float|\DateTimeInterface
*/
interface RangeInterface extends \Stringable
{
/**
* @param T $target
*/
public function contains(mixed $target): bool;

public function isLowerInfinite(): bool;

public function isUpperInfinite(): bool;

public function isEmpty(): bool;

public function isInfinite(): bool;

public function hasSingleBoundary(): bool;

public function hasBothBoundaries(): bool;
}
56 changes: 56 additions & 0 deletions src/MartinGeorgiev/Utils/MathUtils.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

declare(strict_types=1);

namespace MartinGeorgiev\Utils;

class MathUtils
{
/**
* Decides whether the provided $value is in a range delimited by $start and $end values.
*
* - If $start is null, then the comparison is "lesser than $end" only
* - If $end is null, the comparison is "greater than $start" only
* - The $(start|end)Inclusive determine whether the comparison is "lesser/greater than", or "lesser/greater or equal than"
*/
public static function inRange(
null|float|int $value,
null|float|int $start = null,
null|float|int $end = null,
bool $startInclusive = true,
bool $endInclusive = false,
): bool {
if (null === $value) {
return false;
}

if (null !== $start && null !== $end && (float) $start === (float) $end) {
return (float) $value === (float) $start;
}

if (null === $start) {
$startInclusive = true;
}

if (null === $end) {
$endInclusive = true;
}

// Depending on this->range[Start/End]Inclusive, we will use (>= or >) and (<= or <) to work out where the value is
$isGreater = $startInclusive ? $value >= $start : $value > $start;
$isLesser = $endInclusive ? $value <= $end : $value < $end;

return
(null === $start || $isGreater)
&& (null === $end || $isLesser);
}

public static function stringToNumber(?string $number): null|float|int
{
if (!\is_numeric($number)) {
return null;
}

return ((float) $number == (int) $number) ? (int) $number : (float) $number;
}
}
Loading
Loading