Skip to content
Merged
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
31 changes: 15 additions & 16 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,15 @@
'yield',
],
],
'braces' => [
'position_after_anonymous_constructs' => 'next',
'single_space_around_construct' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'declare_parentheses' => true,
'no_multiple_statements_per_line' => true,
'braces_position' => [
'anonymous_classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'statement_indentation' => true,
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
Expand All @@ -77,7 +83,7 @@
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'combine_nested_dirname' => true,
'compact_nullable_typehint' => true,
'compact_nullable_type_declaration' => true,
'concat_space' => ['spacing' => 'one'],
'constant_case' => true,
'declare_equal_normalize' => ['space' => 'none'],
Expand Down Expand Up @@ -126,12 +132,12 @@
'native_constant_invocation' => false,
'native_function_casing' => false,
'native_function_invocation' => false,
'native_function_type_declaration_casing' => true,
'native_type_declaration_casing' => true,
'no_alias_functions' => true,
'no_alias_language_construct_call' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_blank_lines_before_namespace' => true,
'blank_lines_before_namespace' => true,
'no_break_comment' => true,
'no_closing_tag' => true,
'no_empty_comment' => true,
Expand All @@ -146,18 +152,17 @@
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'spaces_inside_parentheses' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_trailing_whitespace_in_string' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_braces' => true,
'no_unneeded_final_method' => true,
'no_unreachable_default_argument_value' => true,
'no_unset_cast' => true,
Expand Down Expand Up @@ -270,13 +275,7 @@
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => [
'const',
'method',
'property',
],
],
'modifier_keywords' => true,
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => [
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ The format is based on [Keep a Changelog], and this project adheres to

## 7.0.0 - T.B.D.

### Added

- Added support for operator chaining (e.g. `a > b > c`).

### Changed

- Changed the minimum required PHP version to 8.1.
- Changed the signature of many functions to use PHP 8 union types.
- Changed the `Relationship::DIR_*` to the `Direction` enum.
- Remove `$insertParentheses` from all methods, and automatically insert them based on precedence.
- No longer insert parentheses when chaining comparison operators.

### Removed

Expand Down
1 change: 1 addition & 0 deletions src/Clauses/CallClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Expressions\Variable;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/CallProcedureClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Expressions\Procedures\Procedure;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/Clause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\QueryConvertible;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/CreateClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Patterns\CompletePattern;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/DeleteClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Patterns\Pattern;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/LimitClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Query;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/MatchClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Patterns\CompletePattern;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/MergeClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Patterns\CompletePattern;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/OptionalMatchClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Patterns\CompletePattern;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/OrderByClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Expressions\Property;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/RawClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/RemoveClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Expressions\Label;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/ReturnClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Patterns\Pattern;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/SetClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Expressions\Label;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/SkipClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Types\PropertyTypes\IntegerType;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/UnionClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Query;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/WhereClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use InvalidArgumentException;
Expand Down
1 change: 1 addition & 0 deletions src/Clauses/WithClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Clauses;

use WikibaseSolutions\CypherDSL\Expressions\Variable;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Exists.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions;

use WikibaseSolutions\CypherDSL\Clauses\MatchClause;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions;

use WikibaseSolutions\CypherDSL\Traits\TypeTraits\PropertyTypeTraits\BooleanTypeTrait;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Literals/Boolean.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Literals;

use WikibaseSolutions\CypherDSL\Traits\TypeTraits\PropertyTypeTraits\BooleanTypeTrait;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Literals/Float_.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Literals;

use WikibaseSolutions\CypherDSL\Traits\TypeTraits\PropertyTypeTraits\FloatTypeTrait;
Expand Down Expand Up @@ -49,7 +50,7 @@
{
$value = (string) $this->value;

if (ctype_digit($value) || ($value[0] === '-' && ctype_digit(substr($value, 1)))) {

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.3)

Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && !ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.3)

Escaped Mutant for Mutator "LogicalAnd": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || ($value[0] === '-' || ctype_digit(substr($value, 1)))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.3)

Escaped Mutant for Mutator "UnwrapSubstr": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit($value)) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.3)

Escaped Mutant for Mutator "IncrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 2))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.3)

Escaped Mutant for Mutator "DecrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 0))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.3)

Escaped Mutant for Mutator "Identical": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] !== '-' && ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.3)

Escaped Mutant for Mutator "IncrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[1] === '-' && ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.1)

Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && !ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.1)

Escaped Mutant for Mutator "LogicalAnd": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || ($value[0] === '-' || ctype_digit(substr($value, 1)))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.1)

Escaped Mutant for Mutator "UnwrapSubstr": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit($value)) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.1)

Escaped Mutant for Mutator "IncrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 2))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.1)

Escaped Mutant for Mutator "DecrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 0))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.1)

Escaped Mutant for Mutator "Identical": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] !== '-' && ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.1)

Escaped Mutant for Mutator "IncrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[1] === '-' && ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.5)

Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && !ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.5)

Escaped Mutant for Mutator "LogicalAnd": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || ($value[0] === '-' || ctype_digit(substr($value, 1)))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.5)

Escaped Mutant for Mutator "UnwrapSubstr": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit($value)) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.5)

Escaped Mutant for Mutator "IncrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 2))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.5)

Escaped Mutant for Mutator "DecrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 0))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.5)

Escaped Mutant for Mutator "Identical": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] !== '-' && ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.5)

Escaped Mutant for Mutator "IncrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[1] === '-' && ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.2)

Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && !ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.2)

Escaped Mutant for Mutator "LogicalAnd": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || ($value[0] === '-' || ctype_digit(substr($value, 1)))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.2)

Escaped Mutant for Mutator "UnwrapSubstr": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit($value)) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.2)

Escaped Mutant for Mutator "IncrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 2))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.2)

Escaped Mutant for Mutator "DecrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 0))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.2)

Escaped Mutant for Mutator "Identical": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] !== '-' && ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.2)

Escaped Mutant for Mutator "IncrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[1] === '-' && ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.4)

Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && !ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.4)

Escaped Mutant for Mutator "LogicalAnd": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || ($value[0] === '-' || ctype_digit(substr($value, 1)))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.4)

Escaped Mutant for Mutator "UnwrapSubstr": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit($value)) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.4)

Escaped Mutant for Mutator "IncrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 2))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.4)

Escaped Mutant for Mutator "DecrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 0))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.4)

Escaped Mutant for Mutator "Identical": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[0] !== '-' && ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }

Check warning on line 53 in src/Expressions/Literals/Float_.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.4)

Escaped Mutant for Mutator "IncrementInteger": @@ @@ public function toQuery(): string { $value = (string) $this->value; - if (ctype_digit($value) || $value[0] === '-' && ctype_digit(substr($value, 1))) { + if (ctype_digit($value) || $value[1] === '-' && ctype_digit(substr($value, 1))) { $value .= '.0'; } return $value; } }
$value .= '.0';
}

Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Literals/Integer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Literals;

use TypeError;
Expand Down Expand Up @@ -34,12 +35,12 @@
{
$parsedValue = filter_var($value, FILTER_SANITIZE_NUMBER_INT);

if ($parsedValue === false) {

Check warning on line 38 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.3)

Escaped Mutant for Mutator "FalseValue": @@ @@ public function __construct(int|string $value) { $parsedValue = filter_var($value, FILTER_SANITIZE_NUMBER_INT); - if ($parsedValue === false) { + if ($parsedValue === true) { throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) {

Check warning on line 38 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.1)

Escaped Mutant for Mutator "FalseValue": @@ @@ public function __construct(int|string $value) { $parsedValue = filter_var($value, FILTER_SANITIZE_NUMBER_INT); - if ($parsedValue === false) { + if ($parsedValue === true) { throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) {

Check warning on line 38 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.5)

Escaped Mutant for Mutator "FalseValue": @@ @@ public function __construct(int|string $value) { $parsedValue = filter_var($value, FILTER_SANITIZE_NUMBER_INT); - if ($parsedValue === false) { + if ($parsedValue === true) { throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) {

Check warning on line 38 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.2)

Escaped Mutant for Mutator "FalseValue": @@ @@ public function __construct(int|string $value) { $parsedValue = filter_var($value, FILTER_SANITIZE_NUMBER_INT); - if ($parsedValue === false) { + if ($parsedValue === true) { throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) {

Check warning on line 38 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.4)

Escaped Mutant for Mutator "FalseValue": @@ @@ public function __construct(int|string $value) { $parsedValue = filter_var($value, FILTER_SANITIZE_NUMBER_INT); - if ($parsedValue === false) { + if ($parsedValue === true) { throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) {
throw new TypeError('A non-integer string has been provided: "' . $value . '".');
}

if (is_string($value) && $parsedValue !== $value) {
throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".');

Check warning on line 43 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.3)

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) { - throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".'); + throw new TypeError($value . '", should be something like "' . $parsedValue . '".'); } $this->value = $parsedValue; }

Check warning on line 43 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.3)

Escaped Mutant for Mutator "Concat": @@ @@ throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) { - throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".'); + throw new TypeError($value . 'A non-integer string has been provided: "' . '", should be something like "' . $parsedValue . '".'); } $this->value = $parsedValue; }

Check warning on line 43 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.1)

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) { - throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".'); + throw new TypeError($value . '", should be something like "' . $parsedValue . '".'); } $this->value = $parsedValue; }

Check warning on line 43 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.1)

Escaped Mutant for Mutator "Concat": @@ @@ throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) { - throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".'); + throw new TypeError($value . 'A non-integer string has been provided: "' . '", should be something like "' . $parsedValue . '".'); } $this->value = $parsedValue; }

Check warning on line 43 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.5)

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) { - throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".'); + throw new TypeError($value . '", should be something like "' . $parsedValue . '".'); } $this->value = $parsedValue; }

Check warning on line 43 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.5)

Escaped Mutant for Mutator "Concat": @@ @@ throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) { - throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".'); + throw new TypeError($value . 'A non-integer string has been provided: "' . '", should be something like "' . $parsedValue . '".'); } $this->value = $parsedValue; }

Check warning on line 43 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.2)

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) { - throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".'); + throw new TypeError($value . '", should be something like "' . $parsedValue . '".'); } $this->value = $parsedValue; }

Check warning on line 43 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.2)

Escaped Mutant for Mutator "Concat": @@ @@ throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) { - throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".'); + throw new TypeError($value . 'A non-integer string has been provided: "' . '", should be something like "' . $parsedValue . '".'); } $this->value = $parsedValue; }

Check warning on line 43 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.4)

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) { - throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".'); + throw new TypeError($value . '", should be something like "' . $parsedValue . '".'); } $this->value = $parsedValue; }

Check warning on line 43 in src/Expressions/Literals/Integer.php

View workflow job for this annotation

GitHub Actions / Unit and mutation testing (PHP 8.4)

Escaped Mutant for Mutator "Concat": @@ @@ throw new TypeError('A non-integer string has been provided: "' . $value . '".'); } if (is_string($value) && $parsedValue !== $value) { - throw new TypeError('A non-integer string has been provided: "' . $value . '", should be something like "' . $parsedValue . '".'); + throw new TypeError($value . 'A non-integer string has been provided: "' . '", should be something like "' . $parsedValue . '".'); } $this->value = $parsedValue; }
}

$this->value = $parsedValue;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Literals/List_.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Literals;

use WikibaseSolutions\CypherDSL\Patterns\Pattern;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Literals/Literal.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Literals;

use LogicException;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Literals/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Literals;

use Stringable;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Literals/String_.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Literals;

use WikibaseSolutions\CypherDSL\Traits\TypeTraits\PropertyTypeTraits\StringTypeTrait;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Operators/Addition.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Operators;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Operators/BinaryOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Operators;

use WikibaseSolutions\CypherDSL\Types\AnyType;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Operators/BooleanBinaryOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Operators;

use WikibaseSolutions\CypherDSL\Traits\TypeTraits\PropertyTypeTraits\BooleanTypeTrait;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Operators/BooleanUnaryOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Operators;

use WikibaseSolutions\CypherDSL\Traits\TypeTraits\PropertyTypeTraits\BooleanTypeTrait;
Expand Down
13 changes: 13 additions & 0 deletions src/Expressions/Operators/ComparisonBinaryOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Operators;

use WikibaseSolutions\CypherDSL\Traits\TypeTraits\PropertyTypeTraits\BooleanTypeTrait;
Expand Down Expand Up @@ -45,4 +46,16 @@ public function __construct(AnyType $left, AnyType $right)
{
parent::__construct($left, $right);
}

/**
* @inheritDoc
*/
protected function shouldInsertParentheses(AnyType $expression): bool
{
if ($expression instanceof self) {
return false;
}

return parent::shouldInsertParentheses($expression);
}
}
1 change: 1 addition & 0 deletions src/Expressions/Operators/ComparisonUnaryOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Operators;

use WikibaseSolutions\CypherDSL\Traits\TypeTraits\PropertyTypeTraits\BooleanTypeTrait;
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Operators/Conjunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Operators;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Expressions/Operators/Contains.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WikibaseSolutions\CypherDSL\Expressions\Operators;

/**
Expand Down
Loading