From cf6f3489b0394e3443ab714c4cb4dd1af27c6d5a Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sat, 27 Jan 2024 22:05:34 +0100 Subject: [PATCH 01/43] Remove php cs fixer --- .gitattributes | 1 - .github/workflows/tests.yml | 3 -- .php_cs | 95 ------------------------------------- composer.json | 2 - 4 files changed, 101 deletions(-) delete mode 100644 .php_cs diff --git a/.gitattributes b/.gitattributes index d26dd985..4e93c2e4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,7 +5,6 @@ /tests export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/.php_cs export-ignore /.travis.yml export-ignore /Makefile export-ignore /phpunit.xml.dist export-ignore diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ff84ddde..a2a27168 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,6 +39,3 @@ jobs: run: composer install --prefer-dist --no-progress --no-suggest - run: composer run test - - - run: composer run lint -- --dry-run - if: ${{ matrix.php <= '8.0' }} diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 29d497ae..00000000 --- a/.php_cs +++ /dev/null @@ -1,95 +0,0 @@ -notPath('vendor') - ->in(__DIR__) - ->name('*.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); -; - -$config = PhpCsFixer\Config::create() - ->setFinder($finder) - ->setRiskyAllowed(true) - ->setRules([ - '@PSR1' => true, - '@PSR2' => true, - 'align_multiline_comment' => true, - 'array_syntax' => ['syntax' => 'short'], - 'blank_line_after_opening_tag' => true, - 'blank_line_before_return' => true, - 'blank_line_before_statement' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => true, - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'comment_to_phpdoc' => true, - 'compact_nullable_typehint' => true, - 'explicit_indirect_variable' => true, - 'explicit_string_variable' => true, - 'fully_qualified_strict_types' => true, - 'function_typehint_space' => true, - 'general_phpdoc_annotation_remove' => ['category', 'license'], - 'hash_to_slash_comment' => true, - 'heredoc_to_nowdoc' => true, - 'include' => true, - 'lowercase_cast' => true, - 'method_chaining_indentation' => true, - 'multiline_comment_opening_closing' => true, - 'native_function_casing' => true, - 'new_with_braces' => true, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_phpdoc' => true, - 'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'throw', 'use']], - 'no_extra_consecutive_blank_lines' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_superfluous_elseif' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => true, - 'ordered_imports' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_scalar' => true, - 'phpdoc_trim' => true, - 'phpdoc_types' => true, - 'phpdoc_var_without_name' => true, - 'psr4' => true, - 'self_accessor' => true, - 'semicolon_after_instruction' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_before_namespace' => true, - 'single_quote' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'string_line_ending' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - ]) -; - -return $config; diff --git a/composer.json b/composer.json index c74a3fd9..34f9f66e 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,6 @@ }, "require-dev": { "doctrine/cache": "^1.11", - "friendsofphp/php-cs-fixer": "^2.14", "nesbot/carbon": "*", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", "symfony/yaml": "^4.4 || ^5.3 || ^6.0", @@ -31,7 +30,6 @@ "sort-packages": true }, "scripts": { - "lint": "php-cs-fixer fix --ansi --diff --diff-format udiff --show-progress=none --verbose", "test": "phpunit --colors=always" } } From 157e4b4a8fb559101bfabd5e8a97cfd4c59d06f3 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sat, 27 Jan 2024 22:11:02 +0100 Subject: [PATCH 02/43] Add php_codesniffer, doctrine/coding-standard --- .gitattributes | 1 + .github/workflows/coding-standards.yml | 27 ++++++++++++++++++++++++++ .gitignore | 1 + composer.json | 7 ++++++- phpcs.xml.dist | 27 ++++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/coding-standards.yml create mode 100644 phpcs.xml.dist diff --git a/.gitattributes b/.gitattributes index 4e93c2e4..7fae8139 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,4 +7,5 @@ /.gitignore export-ignore /.travis.yml export-ignore /Makefile export-ignore +/phpcs.xml.dist export-ignore /phpunit.xml.dist export-ignore diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml new file mode 100644 index 00000000..02e836b4 --- /dev/null +++ b/.github/workflows/coding-standards.yml @@ -0,0 +1,27 @@ +name: "Coding Standards" + +on: + pull_request: + branches: + - "master" + paths: + - .github/workflows/coding-standards.yml + - bin/** + - composer.* + - src/** + - phpcs.xml.dist + - tests/** + push: + branches: + - "master" + paths: + - .github/workflows/coding-standards.yml + - bin/** + - composer.* + - src/** + - phpcs.xml.dist + - tests/** + +jobs: + coding-standards: + uses: "doctrine/.github/.github/workflows/coding-standards.yml@4.0.0" diff --git a/.gitignore b/.gitignore index f163a4c9..8f86d402 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.phpcs-cache .phpunit.result.cache /composer.lock /tests/phpunit.xml diff --git a/composer.json b/composer.json index 34f9f66e..4d7780d6 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,10 @@ }, "require-dev": { "doctrine/cache": "^1.11", + "doctrine/coding-standard": "^9.0.2 || ^12.0", "nesbot/carbon": "*", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.8", "symfony/yaml": "^4.4 || ^5.3 || ^6.0", "zf1/zend-date": "^1.12", "zf1/zend-registry": "^1.12" @@ -27,7 +29,10 @@ "psr-4": {"DoctrineExtensions\\Tests\\": "tests/"} }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } }, "scripts": { "test": "phpunit --colors=always" diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 00000000..eed8af93 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + src + tests + + + + + + + + + + + + From 04ef469dc8a5cd529fc4d86a825c239874b87a5c Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sat, 27 Jan 2024 22:22:54 +0100 Subject: [PATCH 03/43] Code Sniffer: apply rule SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing --- src/Query/Mysql/Acos.php | 2 ++ src/Query/Mysql/AddTime.php | 2 ++ src/Query/Mysql/AesDecrypt.php | 2 ++ src/Query/Mysql/AesEncrypt.php | 2 ++ src/Query/Mysql/AnyValue.php | 2 ++ src/Query/Mysql/Ascii.php | 2 ++ src/Query/Mysql/Asin.php | 2 ++ src/Query/Mysql/Atan.php | 2 ++ src/Query/Mysql/Atan2.php | 2 ++ src/Query/Mysql/Binary.php | 2 ++ src/Query/Mysql/BitCount.php | 2 ++ src/Query/Mysql/BitXor.php | 2 ++ src/Query/Mysql/Cast.php | 2 ++ src/Query/Mysql/Ceil.php | 2 ++ src/Query/Mysql/CharLength.php | 2 ++ src/Query/Mysql/Collate.php | 2 ++ src/Query/Mysql/ConcatWs.php | 2 ++ src/Query/Mysql/ConvertTz.php | 2 ++ src/Query/Mysql/Cos.php | 2 ++ src/Query/Mysql/Cot.php | 2 ++ src/Query/Mysql/CountIf.php | 2 ++ src/Query/Mysql/Crc32.php | 2 ++ src/Query/Mysql/Date.php | 2 ++ src/Query/Mysql/DateAdd.php | 2 ++ src/Query/Mysql/DateDiff.php | 2 ++ src/Query/Mysql/DateFormat.php | 2 ++ src/Query/Mysql/DateSub.php | 2 ++ src/Query/Mysql/Day.php | 2 ++ src/Query/Mysql/DayName.php | 2 ++ src/Query/Mysql/DayOfWeek.php | 2 ++ src/Query/Mysql/DayOfYear.php | 2 ++ src/Query/Mysql/Degrees.php | 2 ++ src/Query/Mysql/Div.php | 2 ++ src/Query/Mysql/Exp.php | 2 ++ src/Query/Mysql/Extract.php | 2 ++ src/Query/Mysql/Field.php | 2 ++ src/Query/Mysql/FindInSet.php | 2 ++ src/Query/Mysql/Floor.php | 2 ++ src/Query/Mysql/Format.php | 2 ++ src/Query/Mysql/FromBase64.php | 2 ++ src/Query/Mysql/FromUnixtime.php | 2 ++ src/Query/Mysql/Greatest.php | 2 ++ src/Query/Mysql/GroupConcat.php | 2 ++ src/Query/Mysql/Hex.php | 2 ++ src/Query/Mysql/Hour.php | 2 ++ src/Query/Mysql/IfElse.php | 2 ++ src/Query/Mysql/IfNull.php | 2 ++ src/Query/Mysql/Inet6Aton.php | 2 ++ src/Query/Mysql/Inet6Ntoa.php | 2 ++ src/Query/Mysql/InetAton.php | 2 ++ src/Query/Mysql/InetNtoa.php | 2 ++ src/Query/Mysql/Instr.php | 2 ++ src/Query/Mysql/IsIpv4.php | 2 ++ src/Query/Mysql/IsIpv4Compat.php | 2 ++ src/Query/Mysql/IsIpv4Mapped.php | 2 ++ src/Query/Mysql/IsIpv6.php | 2 ++ src/Query/Mysql/JsonContains.php | 2 ++ src/Query/Mysql/JsonDepth.php | 2 ++ src/Query/Mysql/JsonLength.php | 2 ++ src/Query/Mysql/Lag.php | 2 ++ src/Query/Mysql/LastDay.php | 2 ++ src/Query/Mysql/Lead.php | 2 ++ src/Query/Mysql/Least.php | 2 ++ src/Query/Mysql/Log.php | 2 ++ src/Query/Mysql/Log10.php | 2 ++ src/Query/Mysql/Log2.php | 2 ++ src/Query/Mysql/Lpad.php | 2 ++ src/Query/Mysql/MakeDate.php | 2 ++ src/Query/Mysql/MatchAgainst.php | 2 ++ src/Query/Mysql/Md5.php | 2 ++ src/Query/Mysql/Minute.php | 2 ++ src/Query/Mysql/Month.php | 2 ++ src/Query/Mysql/MonthName.php | 2 ++ src/Query/Mysql/Now.php | 2 ++ src/Query/Mysql/NullIf.php | 2 ++ src/Query/Mysql/Over.php | 2 ++ src/Query/Mysql/PeriodDiff.php | 2 ++ src/Query/Mysql/Pi.php | 2 ++ src/Query/Mysql/Power.php | 2 ++ src/Query/Mysql/Quarter.php | 2 ++ src/Query/Mysql/Radians.php | 2 ++ src/Query/Mysql/Rand.php | 2 ++ src/Query/Mysql/Regexp.php | 2 ++ src/Query/Mysql/Replace.php | 2 ++ src/Query/Mysql/Round.php | 2 ++ src/Query/Mysql/Rpad.php | 2 ++ src/Query/Mysql/SecToTime.php | 2 ++ src/Query/Mysql/Second.php | 2 ++ src/Query/Mysql/Sha1.php | 2 ++ src/Query/Mysql/Sha2.php | 2 ++ src/Query/Mysql/Sin.php | 2 ++ src/Query/Mysql/Soundex.php | 2 ++ src/Query/Mysql/Std.php | 2 ++ src/Query/Mysql/StdDev.php | 2 ++ src/Query/Mysql/StrToDate.php | 2 ++ src/Query/Mysql/SubstringIndex.php | 2 ++ src/Query/Mysql/Tan.php | 2 ++ src/Query/Mysql/Time.php | 2 ++ src/Query/Mysql/TimeDiff.php | 2 ++ src/Query/Mysql/TimeToSec.php | 2 ++ src/Query/Mysql/TimestampAdd.php | 2 ++ src/Query/Mysql/TimestampDiff.php | 2 ++ src/Query/Mysql/Truncate.php | 2 ++ src/Query/Mysql/Unhex.php | 2 ++ src/Query/Mysql/UnixTimestamp.php | 2 ++ src/Query/Mysql/UtcTimestamp.php | 2 ++ src/Query/Mysql/UuidShort.php | 2 ++ src/Query/Mysql/Variance.php | 2 ++ src/Query/Mysql/Week.php | 2 ++ src/Query/Mysql/WeekDay.php | 2 ++ src/Query/Mysql/WeekOfYear.php | 2 ++ src/Query/Mysql/Year.php | 2 ++ src/Query/Mysql/YearMonth.php | 2 ++ src/Query/Mysql/YearWeek.php | 2 ++ src/Query/MysqlWalker.php | 2 ++ src/Query/Oracle/Ceil.php | 2 ++ src/Query/Oracle/Day.php | 2 ++ src/Query/Oracle/Floor.php | 2 ++ src/Query/Oracle/Hour.php | 2 ++ src/Query/Oracle/Listagg.php | 2 ++ src/Query/Oracle/Minute.php | 2 ++ src/Query/Oracle/Month.php | 2 ++ src/Query/Oracle/Nvl.php | 2 ++ src/Query/Oracle/Second.php | 2 ++ src/Query/Oracle/ToChar.php | 2 ++ src/Query/Oracle/ToDate.php | 2 ++ src/Query/Oracle/Trunc.php | 2 ++ src/Query/Oracle/Year.php | 2 ++ src/Query/Postgresql/AtTimeZoneFunction.php | 2 ++ src/Query/Postgresql/CountFilterFunction.php | 2 ++ src/Query/Postgresql/Date.php | 2 ++ src/Query/Postgresql/DateFormat.php | 2 ++ src/Query/Postgresql/DatePart.php | 2 ++ src/Query/Postgresql/DateTrunc.php | 2 ++ src/Query/Postgresql/Day.php | 2 ++ src/Query/Postgresql/ExtractFunction.php | 2 ++ src/Query/Postgresql/Greatest.php | 2 ++ src/Query/Postgresql/Hour.php | 2 ++ src/Query/Postgresql/Least.php | 2 ++ src/Query/Postgresql/Minute.php | 2 ++ src/Query/Postgresql/Month.php | 2 ++ src/Query/Postgresql/RegexpReplace.php | 2 ++ src/Query/Postgresql/Second.php | 2 ++ src/Query/Postgresql/StrToDate.php | 2 ++ src/Query/Postgresql/StringAgg.php | 2 ++ src/Query/Postgresql/Year.php | 2 ++ src/Query/SortableNullsWalker.php | 2 ++ src/Query/Sqlite/AbstractStrfTime.php | 2 ++ src/Query/Sqlite/ConcatWs.php | 2 ++ src/Query/Sqlite/Date.php | 2 ++ src/Query/Sqlite/DateFormat.php | 2 ++ src/Query/Sqlite/Day.php | 2 ++ src/Query/Sqlite/Greatest.php | 2 ++ src/Query/Sqlite/Hour.php | 2 ++ src/Query/Sqlite/IfElse.php | 2 ++ src/Query/Sqlite/IfNull.php | 2 ++ src/Query/Sqlite/JulianDay.php | 2 ++ src/Query/Sqlite/Least.php | 2 ++ src/Query/Sqlite/Minute.php | 2 ++ src/Query/Sqlite/Month.php | 2 ++ src/Query/Sqlite/NumberFromStrfTime.php | 2 ++ src/Query/Sqlite/Random.php | 2 ++ src/Query/Sqlite/Replace.php | 2 ++ src/Query/Sqlite/Round.php | 2 ++ src/Query/Sqlite/Second.php | 2 ++ src/Query/Sqlite/StrfTime.php | 2 ++ src/Query/Sqlite/Week.php | 2 ++ src/Query/Sqlite/WeekDay.php | 2 ++ src/Query/Sqlite/Year.php | 2 ++ src/Types/CarbonDateTimeType.php | 2 ++ src/Types/CarbonDateTimeTzType.php | 2 ++ src/Types/CarbonDateType.php | 2 ++ src/Types/CarbonImmutableDateTimeType.php | 2 ++ src/Types/CarbonImmutableDateTimeTzType.php | 2 ++ src/Types/CarbonImmutableDateType.php | 2 ++ src/Types/CarbonImmutableTimeType.php | 2 ++ src/Types/CarbonTimeType.php | 2 ++ src/Types/PolygonType.php | 2 ++ src/Types/ZendDateType.php | 2 ++ tests/Config/MysqlYamlTest.php | 2 ++ tests/Entities/Blank.php | 2 ++ tests/Entities/BlogPost.php | 2 ++ tests/Entities/CarbonDate.php | 2 ++ tests/Entities/Date.php | 2 ++ tests/Entities/Product.php | 2 ++ tests/Entities/Set.php | 2 ++ tests/Entities/ZendDate.php | 2 ++ tests/Query/ConfigLoader.php | 2 ++ tests/Query/DbTestCase.php | 2 ++ tests/Query/Mysql/AcosTest.php | 2 ++ tests/Query/Mysql/AddTimeTest.php | 2 ++ tests/Query/Mysql/AsciiTest.php | 2 ++ tests/Query/Mysql/AsinTest.php | 2 ++ tests/Query/Mysql/Atan2Test.php | 2 ++ tests/Query/Mysql/AtanTest.php | 2 ++ tests/Query/Mysql/BinaryTest.php | 2 ++ tests/Query/Mysql/BitCountTest.php | 2 ++ tests/Query/Mysql/BitXorTest.php | 2 ++ tests/Query/Mysql/CastTest.php | 2 ++ tests/Query/Mysql/CeilTest.php | 2 ++ tests/Query/Mysql/CharLengthTest.php | 2 ++ tests/Query/Mysql/CollateTest.php | 2 ++ tests/Query/Mysql/ConcatWsTest.php | 2 ++ tests/Query/Mysql/ConvertTzTest.php | 2 ++ tests/Query/Mysql/CosTest.php | 2 ++ tests/Query/Mysql/CotTest.php | 2 ++ tests/Query/Mysql/CountIfTest.php | 2 ++ tests/Query/Mysql/Crc32Test.php | 2 ++ tests/Query/Mysql/DateAddTest.php | 2 ++ tests/Query/Mysql/DateDiffTest.php | 2 ++ tests/Query/Mysql/DateFormatTest.php | 2 ++ tests/Query/Mysql/DateSubTest.php | 2 ++ tests/Query/Mysql/DateTest.php | 2 ++ tests/Query/Mysql/DayNameTest.php | 2 ++ tests/Query/Mysql/DayOfWeekTest.php | 2 ++ tests/Query/Mysql/DayOfYearTest.php | 2 ++ tests/Query/Mysql/DayTest.php | 2 ++ tests/Query/Mysql/DegressTest.php | 2 ++ tests/Query/Mysql/DivTest.php | 2 ++ tests/Query/Mysql/ExpTest.php | 2 ++ tests/Query/Mysql/FieldTest.php | 2 ++ tests/Query/Mysql/FindInSetTest.php | 2 ++ tests/Query/Mysql/FloorTest.php | 2 ++ tests/Query/Mysql/FormatTest.php | 2 ++ tests/Query/Mysql/FromBase64.php | 2 ++ tests/Query/Mysql/FromUnixTimeTest.php | 2 ++ tests/Query/Mysql/GreatestTest.php | 2 ++ tests/Query/Mysql/GroupConcatTest.php | 2 ++ tests/Query/Mysql/HexTest.php | 2 ++ tests/Query/Mysql/HourTest.php | 2 ++ tests/Query/Mysql/IfElseTest.php | 2 ++ tests/Query/Mysql/IfNullTest.php | 2 ++ tests/Query/Mysql/Inet6AtonTest.php | 2 ++ tests/Query/Mysql/Inet6NtoaTest.php | 2 ++ tests/Query/Mysql/InetAtonTest.php | 2 ++ tests/Query/Mysql/InetNtoaTest.php | 2 ++ tests/Query/Mysql/IsIpv4CompatTest.php | 2 ++ tests/Query/Mysql/IsIpv4MappedTest.php | 2 ++ tests/Query/Mysql/IsIpv4Test.php | 2 ++ tests/Query/Mysql/IsIpv6Test.php | 2 ++ tests/Query/Mysql/JsonContainsTest.php | 2 ++ tests/Query/Mysql/JsonDepthTest.php | 2 ++ tests/Query/Mysql/JsonLengthTest.php | 2 ++ tests/Query/Mysql/LagTest.php | 2 ++ tests/Query/Mysql/LastDayTest.php | 2 ++ tests/Query/Mysql/LeadTest.php | 2 ++ tests/Query/Mysql/LeastTest.php | 2 ++ tests/Query/Mysql/Log10Test.php | 2 ++ tests/Query/Mysql/Log2Test.php | 2 ++ tests/Query/Mysql/LogTest.php | 2 ++ tests/Query/Mysql/LpadTest.php | 2 ++ tests/Query/Mysql/MakeDateTest.php | 2 ++ tests/Query/Mysql/MatchAgainstTest.php | 2 ++ tests/Query/Mysql/Md5Test.php | 2 ++ tests/Query/Mysql/MinuteTest.php | 2 ++ tests/Query/Mysql/MonthNameTest.php | 2 ++ tests/Query/Mysql/MonthTest.php | 2 ++ tests/Query/Mysql/NowTest.php | 2 ++ tests/Query/Mysql/NullIfTest.php | 2 ++ tests/Query/Mysql/PiTest.php | 2 ++ tests/Query/Mysql/PowerTest.php | 2 ++ tests/Query/Mysql/QuarterTest.php | 2 ++ tests/Query/Mysql/RadiansTest.php | 2 ++ tests/Query/Mysql/RandTest.php | 2 ++ tests/Query/Mysql/RegexpTest.php | 2 ++ tests/Query/Mysql/ReplaceTest.php | 2 ++ tests/Query/Mysql/RoundTest.php | 2 ++ tests/Query/Mysql/RpadTest.php | 2 ++ tests/Query/Mysql/SecondTest.php | 2 ++ tests/Query/Mysql/SetTest.php | 2 ++ tests/Query/Mysql/Sha1Test.php | 2 ++ tests/Query/Mysql/Sha2Test.php | 2 ++ tests/Query/Mysql/SinTest.php | 2 ++ tests/Query/Mysql/SoundexTest.php | 2 ++ tests/Query/Mysql/StdDevTest.php | 2 ++ tests/Query/Mysql/StdTest.php | 2 ++ tests/Query/Mysql/StrToDateTest.php | 2 ++ tests/Query/Mysql/StringTest.php | 2 ++ tests/Query/Mysql/SubstringIndexTest.php | 2 ++ tests/Query/Mysql/TanTest.php | 2 ++ tests/Query/Mysql/TimeDiffTest.php | 2 ++ tests/Query/Mysql/TimeTest.php | 2 ++ tests/Query/Mysql/TimeToSecTest.php | 2 ++ tests/Query/Mysql/TimestampAddTest.php | 2 ++ tests/Query/Mysql/TimestampDiffTest.php | 2 ++ tests/Query/Mysql/TrigTest.php | 2 ++ tests/Query/Mysql/UnhexTest.php | 2 ++ tests/Query/Mysql/UnixTimestampTest.php | 2 ++ tests/Query/Mysql/UtcTimestampTest.php | 2 ++ tests/Query/Mysql/UuidShortTest.php | 2 ++ tests/Query/Mysql/VarianceTest.php | 2 ++ tests/Query/Mysql/WeekDayTest.php | 2 ++ tests/Query/Mysql/WeekOfYearTest.php | 2 ++ tests/Query/Mysql/WeekTest.php | 2 ++ tests/Query/Mysql/YearTest.php | 2 ++ tests/Query/Mysql/YearWeekTest.php | 2 ++ tests/Query/MysqlTestCase.php | 2 ++ tests/Query/MysqlWalkerTest.php | 2 ++ tests/Query/Oracle/CeilTest.php | 2 ++ tests/Query/Oracle/DayTest.php | 2 ++ tests/Query/Oracle/FloorTest.php | 2 ++ tests/Query/Oracle/HourTest.php | 2 ++ tests/Query/Oracle/ListaggTest.php | 2 ++ tests/Query/Oracle/MinuteTest.php | 2 ++ tests/Query/Oracle/MonthTest.php | 2 ++ tests/Query/Oracle/SecondTest.php | 2 ++ tests/Query/Oracle/ToCharTest.php | 2 ++ tests/Query/Oracle/TruncTest.php | 2 ++ tests/Query/Oracle/YearTest.php | 2 ++ tests/Query/OracleTestCase.php | 2 ++ tests/Query/Postgresql/AtTimeZoneTest.php | 2 ++ tests/Query/Postgresql/CountFilterTest.php | 2 ++ tests/Query/Postgresql/DatePartTest.php | 2 ++ tests/Query/Postgresql/DateTest.php | 2 ++ tests/Query/Postgresql/DateTruncTest.php | 2 ++ tests/Query/Postgresql/DayTest.php | 2 ++ tests/Query/Postgresql/ExtractFunctionTest.php | 2 ++ tests/Query/Postgresql/GreatestTest.php | 2 ++ tests/Query/Postgresql/HourTest.php | 2 ++ tests/Query/Postgresql/LeastTest.php | 2 ++ tests/Query/Postgresql/MinuteTest.php | 2 ++ tests/Query/Postgresql/MonthTest.php | 2 ++ tests/Query/Postgresql/RegexpReplaceTest.php | 2 ++ tests/Query/Postgresql/SecondTest.php | 2 ++ tests/Query/Postgresql/StringAggTest.php | 2 ++ tests/Query/Postgresql/StringTest.php | 2 ++ tests/Query/Postgresql/YearTest.php | 2 ++ tests/Query/PostgresqlTestCase.php | 2 ++ tests/Query/Sqlite/ConcatWsTest.php | 2 ++ tests/Query/Sqlite/DateFormatTest.php | 2 ++ tests/Query/Sqlite/DayTest.php | 2 ++ tests/Query/Sqlite/GreatestTest.php | 2 ++ tests/Query/Sqlite/HourTest.php | 2 ++ tests/Query/Sqlite/IfElseTest.php | 2 ++ tests/Query/Sqlite/JulianDayTest.php | 2 ++ tests/Query/Sqlite/LeastTest.php | 2 ++ tests/Query/Sqlite/MinuteTest.php | 2 ++ tests/Query/Sqlite/MonthTest.php | 2 ++ tests/Query/Sqlite/NumericFunctionsTest.php | 2 ++ tests/Query/Sqlite/RandomTest.php | 2 ++ tests/Query/Sqlite/SecondTest.php | 2 ++ tests/Query/Sqlite/StrfTimeTest.php | 2 ++ tests/Query/Sqlite/StringFunctionsTest.php | 2 ++ tests/Query/Sqlite/WeekDayTest.php | 2 ++ tests/Query/Sqlite/WeekTest.php | 2 ++ tests/Query/Sqlite/YearTest.php | 2 ++ tests/Query/SqliteTestCase.php | 2 ++ tests/Types/CarbonDateTest.php | 2 ++ tests/Types/ZendDateTest.php | 2 ++ 349 files changed, 698 insertions(+) diff --git a/src/Query/Mysql/Acos.php b/src/Query/Mysql/Acos.php index 4e2f71b6..d10afcde 100644 --- a/src/Query/Mysql/Acos.php +++ b/src/Query/Mysql/Acos.php @@ -1,5 +1,7 @@ Date: Sat, 27 Jan 2024 22:59:29 +0100 Subject: [PATCH 04/43] Code Sniffer: apply rule SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName --- src/Query/Mysql/Acos.php | 6 ++-- src/Query/Mysql/AddTime.php | 6 ++-- src/Query/Mysql/AesDecrypt.php | 6 ++-- src/Query/Mysql/AesEncrypt.php | 6 ++-- src/Query/Mysql/AnyValue.php | 6 ++-- src/Query/Mysql/Ascii.php | 8 ++++-- src/Query/Mysql/Asin.php | 6 ++-- src/Query/Mysql/Atan.php | 6 ++-- src/Query/Mysql/Atan2.php | 6 ++-- src/Query/Mysql/Binary.php | 6 ++-- src/Query/Mysql/BitCount.php | 6 ++-- src/Query/Mysql/BitXor.php | 6 ++-- src/Query/Mysql/Ceil.php | 6 ++-- src/Query/Mysql/CharLength.php | 6 ++-- src/Query/Mysql/Collate.php | 6 ++-- src/Query/Mysql/ConcatWs.php | 6 ++-- src/Query/Mysql/Cos.php | 6 ++-- src/Query/Mysql/Cot.php | 6 ++-- src/Query/Mysql/CountIf.php | 6 ++-- src/Query/Mysql/Crc32.php | 6 ++-- src/Query/Mysql/Date.php | 6 ++-- src/Query/Mysql/DateAdd.php | 6 ++-- src/Query/Mysql/DateDiff.php | 6 ++-- src/Query/Mysql/DateFormat.php | 6 ++-- src/Query/Mysql/DateSub.php | 3 +- src/Query/Mysql/Day.php | 6 ++-- src/Query/Mysql/DayName.php | 6 ++-- src/Query/Mysql/DayOfWeek.php | 6 ++-- src/Query/Mysql/DayOfYear.php | 3 +- src/Query/Mysql/Degrees.php | 6 ++-- src/Query/Mysql/Div.php | 5 ++-- src/Query/Mysql/Exp.php | 6 ++-- src/Query/Mysql/Extract.php | 6 ++-- src/Query/Mysql/Field.php | 6 ++-- src/Query/Mysql/FindInSet.php | 6 ++-- src/Query/Mysql/Floor.php | 6 ++-- src/Query/Mysql/Format.php | 6 ++-- src/Query/Mysql/FromUnixtime.php | 6 ++-- src/Query/Mysql/GroupConcat.php | 6 ++-- src/Query/Mysql/Hex.php | 6 ++-- src/Query/Mysql/Hour.php | 6 ++-- src/Query/Mysql/IfElse.php | 6 ++-- src/Query/Mysql/IfNull.php | 6 ++-- src/Query/Mysql/LastDay.php | 6 ++-- src/Query/Mysql/Log.php | 6 ++-- src/Query/Mysql/Log10.php | 6 ++-- src/Query/Mysql/Log2.php | 6 ++-- src/Query/Mysql/Lpad.php | 6 ++-- src/Query/Mysql/MakeDate.php | 12 ++++---- src/Query/Mysql/MatchAgainst.php | 6 ++-- src/Query/Mysql/Md5.php | 6 ++-- src/Query/Mysql/Minute.php | 6 ++-- src/Query/Mysql/Month.php | 6 ++-- src/Query/Mysql/MonthName.php | 6 ++-- src/Query/Mysql/Now.php | 6 ++-- src/Query/Mysql/NullIf.php | 6 ++-- src/Query/Mysql/PeriodDiff.php | 6 ++-- src/Query/Mysql/Pi.php | 6 ++-- src/Query/Mysql/Power.php | 6 ++-- src/Query/Mysql/Quarter.php | 6 ++-- src/Query/Mysql/Radians.php | 6 ++-- src/Query/Mysql/Rand.php | 6 ++-- src/Query/Mysql/Regexp.php | 6 ++-- src/Query/Mysql/Replace.php | 6 ++-- src/Query/Mysql/Round.php | 6 ++-- src/Query/Mysql/Rpad.php | 6 ++-- src/Query/Mysql/SecToTime.php | 6 ++-- src/Query/Mysql/Second.php | 6 ++-- src/Query/Mysql/Sha1.php | 6 ++-- src/Query/Mysql/Sha2.php | 6 ++-- src/Query/Mysql/Sin.php | 6 ++-- src/Query/Mysql/Soundex.php | 6 ++-- src/Query/Mysql/Std.php | 6 ++-- src/Query/Mysql/StdDev.php | 8 ++++-- src/Query/Mysql/StrToDate.php | 6 ++-- src/Query/Mysql/Tan.php | 6 ++-- src/Query/Mysql/Time.php | 6 ++-- src/Query/Mysql/TimeDiff.php | 6 ++-- src/Query/Mysql/TimeToSec.php | 6 ++-- src/Query/Mysql/TimestampAdd.php | 6 ++-- src/Query/Mysql/TimestampDiff.php | 6 ++-- src/Query/Mysql/Truncate.php | 6 ++-- src/Query/Mysql/Unhex.php | 6 ++-- src/Query/Mysql/UnixTimestamp.php | 6 ++-- src/Query/Mysql/UtcTimestamp.php | 6 ++-- src/Query/Mysql/UuidShort.php | 6 ++-- src/Query/Mysql/Week.php | 6 ++-- src/Query/Mysql/WeekDay.php | 6 ++-- src/Query/Mysql/WeekOfYear.php | 6 ++-- src/Query/Mysql/Year.php | 6 ++-- src/Query/Mysql/YearMonth.php | 6 ++-- src/Query/Mysql/YearWeek.php | 6 ++-- src/Query/Oracle/Ceil.php | 6 ++-- src/Query/Oracle/Day.php | 6 ++-- src/Query/Oracle/Floor.php | 6 ++-- src/Query/Oracle/Hour.php | 6 ++-- src/Query/Oracle/Minute.php | 6 ++-- src/Query/Oracle/Month.php | 6 ++-- src/Query/Oracle/Nvl.php | 6 ++-- src/Query/Oracle/Second.php | 6 ++-- src/Query/Oracle/ToChar.php | 6 ++-- src/Query/Oracle/ToDate.php | 6 ++-- src/Query/Oracle/Trunc.php | 6 ++-- src/Query/Oracle/Year.php | 6 ++-- src/Query/Postgresql/Date.php | 6 ++-- src/Query/Postgresql/DateFormat.php | 6 ++-- src/Query/Postgresql/Day.php | 6 ++-- src/Query/Postgresql/Hour.php | 6 ++-- src/Query/Postgresql/Minute.php | 6 ++-- src/Query/Postgresql/Month.php | 6 ++-- src/Query/Postgresql/RegexpReplace.php | 6 ++-- src/Query/Postgresql/Second.php | 6 ++-- src/Query/Postgresql/StrToDate.php | 6 ++-- src/Query/Postgresql/Year.php | 6 ++-- src/Query/Sqlite/AbstractStrfTime.php | 6 ++-- src/Query/Sqlite/ConcatWs.php | 6 ++-- src/Query/Sqlite/DateFormat.php | 6 ++-- src/Query/Sqlite/IfElse.php | 6 ++-- src/Query/Sqlite/IfNull.php | 6 ++-- src/Query/Sqlite/NumberFromStrfTime.php | 4 ++- src/Query/Sqlite/Random.php | 6 ++-- src/Query/Sqlite/Replace.php | 6 ++-- src/Query/Sqlite/Round.php | 6 ++-- src/Query/Sqlite/StrfTime.php | 3 +- src/Query/Sqlite/Week.php | 5 ++-- src/Types/CarbonDateTimeType.php | 3 +- src/Types/CarbonDateTimeTzType.php | 3 +- src/Types/CarbonDateType.php | 3 +- src/Types/CarbonImmutableDateTimeType.php | 3 +- src/Types/CarbonImmutableDateTimeTzType.php | 3 +- src/Types/CarbonImmutableDateType.php | 3 +- src/Types/CarbonImmutableTimeType.php | 3 +- src/Types/CarbonTimeType.php | 3 +- src/Types/ZendDateType.php | 8 ++++-- tests/Config/MysqlYamlTest.php | 3 +- tests/Query/Mysql/ExpTest.php | 4 ++- tests/Query/Mysql/Log2Test.php | 4 ++- tests/Query/Mysql/LogTest.php | 4 ++- tests/Query/Mysql/SetTest.php | 4 ++- tests/Query/Mysql/StdDevTest.php | 4 ++- tests/Query/Mysql/StringTest.php | 9 ++++-- tests/Query/Mysql/TrigTest.php | 13 +++++---- tests/Query/Mysql/UtcTimestampTest.php | 4 ++- tests/Query/Oracle/DayTest.php | 4 ++- tests/Query/Oracle/HourTest.php | 4 ++- tests/Query/Oracle/MinuteTest.php | 4 ++- tests/Query/Oracle/MonthTest.php | 4 ++- tests/Query/Oracle/SecondTest.php | 4 ++- tests/Query/Oracle/YearTest.php | 4 ++- tests/Query/Postgresql/AtTimeZoneTest.php | 4 ++- tests/Query/Postgresql/CountFilterTest.php | 4 ++- tests/Query/Postgresql/DateTest.php | 4 ++- tests/Query/Postgresql/DayTest.php | 4 ++- tests/Query/Postgresql/GreatestTest.php | 4 ++- tests/Query/Postgresql/HourTest.php | 4 ++- tests/Query/Postgresql/LeastTest.php | 4 ++- tests/Query/Postgresql/MinuteTest.php | 4 ++- tests/Query/Postgresql/MonthTest.php | 4 ++- tests/Query/Postgresql/RegexpReplaceTest.php | 4 ++- tests/Query/Postgresql/SecondTest.php | 4 ++- tests/Query/Postgresql/StringTest.php | 4 ++- tests/Query/Postgresql/YearTest.php | 4 ++- tests/Query/Sqlite/DayTest.php | 4 ++- tests/Query/Sqlite/HourTest.php | 4 ++- tests/Query/Sqlite/MinuteTest.php | 4 ++- tests/Query/Sqlite/MonthTest.php | 4 ++- tests/Query/Sqlite/SecondTest.php | 4 ++- tests/Query/Sqlite/YearTest.php | 4 ++- tests/Types/CarbonDateTest.php | 14 ++++++---- tests/Types/ZendDateTest.php | 29 ++++++++++++-------- 170 files changed, 654 insertions(+), 317 deletions(-) diff --git a/src/Query/Mysql/Acos.php b/src/Query/Mysql/Acos.php index d10afcde..73e41072 100644 --- a/src/Query/Mysql/Acos.php +++ b/src/Query/Mysql/Acos.php @@ -6,19 +6,21 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Acos extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'ACOS(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression ) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/AddTime.php b/src/Query/Mysql/AddTime.php index d4f98c0d..6f73a81b 100644 --- a/src/Query/Mysql/AddTime.php +++ b/src/Query/Mysql/AddTime.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Pascal Wacker @@ -16,12 +18,12 @@ class AddTime extends FunctionNode public $time; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'ADDTIME(' . $sqlWalker->walkArithmeticPrimary($this->date) . ', ' . $sqlWalker->walkArithmeticPrimary($this->time) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/AesDecrypt.php b/src/Query/Mysql/AesDecrypt.php index 3f60e4cf..de789992 100644 --- a/src/Query/Mysql/AesDecrypt.php +++ b/src/Query/Mysql/AesDecrypt.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class AesDecrypt extends FunctionNode { @@ -13,7 +15,7 @@ class AesDecrypt extends FunctionNode public $key = ''; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -23,7 +25,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'AES_DECRYPT(%s, %s)', diff --git a/src/Query/Mysql/AesEncrypt.php b/src/Query/Mysql/AesEncrypt.php index 6579190b..7e9d3fe4 100644 --- a/src/Query/Mysql/AesEncrypt.php +++ b/src/Query/Mysql/AesEncrypt.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class AesEncrypt extends FunctionNode { @@ -13,7 +15,7 @@ class AesEncrypt extends FunctionNode public $key = ''; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -23,7 +25,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'AES_ENCRYPT(%s, %s)', diff --git a/src/Query/Mysql/AnyValue.php b/src/Query/Mysql/AnyValue.php index a6e7730b..e13a0d2f 100644 --- a/src/Query/Mysql/AnyValue.php +++ b/src/Query/Mysql/AnyValue.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class AnyValue extends FunctionNode { public $value; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -19,7 +21,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'ANY_VALUE(%s)', diff --git a/src/Query/Mysql/Ascii.php b/src/Query/Mysql/Ascii.php index 37941443..a0118a50 100644 --- a/src/Query/Mysql/Ascii.php +++ b/src/Query/Mysql/Ascii.php @@ -6,17 +6,19 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Ascii extends FunctionNode { private $string; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { - return 'ASCII('.$sqlWalker->walkArithmeticPrimary($this->string).')'; + return 'ASCII(' . $sqlWalker->walkArithmeticPrimary($this->string) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Asin.php b/src/Query/Mysql/Asin.php index c8f5730b..2edb7ef6 100644 --- a/src/Query/Mysql/Asin.php +++ b/src/Query/Mysql/Asin.php @@ -6,19 +6,21 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Asin extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'ASIN(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression ) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Atan.php b/src/Query/Mysql/Atan.php index 74eb423f..be8b7d00 100644 --- a/src/Query/Mysql/Atan.php +++ b/src/Query/Mysql/Atan.php @@ -6,7 +6,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\QueryException; +use Doctrine\ORM\Query\SqlWalker; class Atan extends FunctionNode { @@ -14,7 +16,7 @@ class Atan extends FunctionNode public $optionalSecondExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { $secondArgument = ''; @@ -30,7 +32,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Atan2.php b/src/Query/Mysql/Atan2.php index ce02e6fe..af8f9028 100644 --- a/src/Query/Mysql/Atan2.php +++ b/src/Query/Mysql/Atan2.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Atan2 extends FunctionNode { @@ -13,7 +15,7 @@ class Atan2 extends FunctionNode public $secondExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { $firstArgument = $sqlWalker->walkSimpleArithmeticExpression( $this->firstExpression @@ -26,7 +28,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string return 'ATAN2(' . $firstArgument . ', ' . $secondArgument . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Binary.php b/src/Query/Mysql/Binary.php index 76b74c8c..f93d110e 100644 --- a/src/Query/Mysql/Binary.php +++ b/src/Query/Mysql/Binary.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Sarjono Mukti Aji @@ -14,7 +16,7 @@ class Binary extends FunctionNode { private $stringPrimary; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -24,7 +26,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'BINARY('.$sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary).')'; } diff --git a/src/Query/Mysql/BitCount.php b/src/Query/Mysql/BitCount.php index da91ab36..58d197f3 100644 --- a/src/Query/Mysql/BitCount.php +++ b/src/Query/Mysql/BitCount.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class BitCount extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'BIT_COUNT(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression @@ -19,7 +21,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/BitXor.php b/src/Query/Mysql/BitXor.php index 3248242c..fdada64c 100644 --- a/src/Query/Mysql/BitXor.php +++ b/src/Query/Mysql/BitXor.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * "BIT_XOR" "(" ArithmeticPrimary "," ArithmeticPrimary ")" @@ -16,14 +18,14 @@ class BitXor extends FunctionNode public $secondArithmetic; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return $this->firstArithmetic->dispatch($sqlWalker) . ' ^ ' . $this->secondArithmetic->dispatch($sqlWalker); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Ceil.php b/src/Query/Mysql/Ceil.php index b558ea9f..c1f11d23 100644 --- a/src/Query/Mysql/Ceil.php +++ b/src/Query/Mysql/Ceil.php @@ -6,17 +6,19 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Ceil extends FunctionNode { private $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'CEIL(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/CharLength.php b/src/Query/Mysql/CharLength.php index 011cfee2..8b1eff10 100644 --- a/src/Query/Mysql/CharLength.php +++ b/src/Query/Mysql/CharLength.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Metod @@ -14,12 +16,12 @@ class CharLength extends FunctionNode { private $expr1; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'CHAR_LENGTH('.$sqlWalker->walkArithmeticPrimary($this->expr1).')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Collate.php b/src/Query/Mysql/Collate.php index 02e0740a..544014d2 100644 --- a/src/Query/Mysql/Collate.php +++ b/src/Query/Mysql/Collate.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @link https://dev.mysql.com/doc/refman/en/charset-collate.html @@ -26,7 +28,7 @@ class Collate extends FunctionNode /** * @param \Doctrine\ORM\Query\Parser $parser */ - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -47,7 +49,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker * @return string */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf('%s COLLATE %s', $sqlWalker->walkStringPrimary($this->stringPrimary), $this->collation); } diff --git a/src/Query/Mysql/ConcatWs.php b/src/Query/Mysql/ConcatWs.php index 9f2ef67a..a11dab3d 100644 --- a/src/Query/Mysql/ConcatWs.php +++ b/src/Query/Mysql/ConcatWs.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andrew Mackrodt @@ -16,7 +18,7 @@ class ConcatWs extends FunctionNode private $notEmpty = false; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -55,7 +57,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { // Create an array to hold the query elements. $queryBuilder = ['CONCAT_WS(']; diff --git a/src/Query/Mysql/Cos.php b/src/Query/Mysql/Cos.php index 0b6d10ab..d514c69a 100644 --- a/src/Query/Mysql/Cos.php +++ b/src/Query/Mysql/Cos.php @@ -6,19 +6,21 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Cos extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'COS(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression ) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Cot.php b/src/Query/Mysql/Cot.php index 057b9613..19802cc1 100644 --- a/src/Query/Mysql/Cot.php +++ b/src/Query/Mysql/Cot.php @@ -6,19 +6,21 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Cot extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'COT(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression ) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/CountIf.php b/src/Query/Mysql/CountIf.php index 75999b40..227831e3 100644 --- a/src/Query/Mysql/CountIf.php +++ b/src/Query/Mysql/CountIf.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andrew Mackrodt @@ -18,7 +20,7 @@ class CountIf extends FunctionNode private $inverse = false; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -45,7 +47,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'COUNT(CASE %s WHEN %s THEN %s END)', diff --git a/src/Query/Mysql/Crc32.php b/src/Query/Mysql/Crc32.php index e5db85c9..ce946b60 100644 --- a/src/Query/Mysql/Crc32.php +++ b/src/Query/Mysql/Crc32.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Igor Timoshenko @@ -14,14 +16,14 @@ class Crc32 extends FunctionNode { public $stringPrimary; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'CRC32(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Date.php b/src/Query/Mysql/Date.php index bb467af9..a5faf10a 100644 --- a/src/Query/Mysql/Date.php +++ b/src/Query/Mysql/Date.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Steve Lacey @@ -14,12 +16,12 @@ class Date extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'DATE(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/DateAdd.php b/src/Query/Mysql/DateAdd.php index f13c0768..e9da642c 100644 --- a/src/Query/Mysql/DateAdd.php +++ b/src/Query/Mysql/DateAdd.php @@ -6,7 +6,9 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\QueryException; +use Doctrine\ORM\Query\SqlWalker; class DateAdd extends FunctionNode { @@ -39,7 +41,7 @@ class DateAdd extends FunctionNode 'YEAR_MONTH', ]; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -55,7 +57,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { $unit = strtoupper(is_string($this->unit) ? $this->unit : $this->unit->value); diff --git a/src/Query/Mysql/DateDiff.php b/src/Query/Mysql/DateDiff.php index 6404325c..2c1961ef 100644 --- a/src/Query/Mysql/DateDiff.php +++ b/src/Query/Mysql/DateDiff.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class DateDiff extends FunctionNode { @@ -13,7 +15,7 @@ class DateDiff extends FunctionNode public $secondDateExpression = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -23,7 +25,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'DATEDIFF(' . $sqlWalker->walkArithmeticTerm($this->firstDateExpression) . ', ' . diff --git a/src/Query/Mysql/DateFormat.php b/src/Query/Mysql/DateFormat.php index 52d5ddaa..7ede6c29 100644 --- a/src/Query/Mysql/DateFormat.php +++ b/src/Query/Mysql/DateFormat.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Steve Lacey @@ -16,7 +18,7 @@ class DateFormat extends FunctionNode public $patternExpression = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -26,7 +28,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'DATE_FORMAT(' . $this->dateExpression->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Mysql/DateSub.php b/src/Query/Mysql/DateSub.php index 2fa851cd..22eade02 100644 --- a/src/Query/Mysql/DateSub.php +++ b/src/Query/Mysql/DateSub.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Query\Mysql; use Doctrine\ORM\Query\QueryException; +use Doctrine\ORM\Query\SqlWalker; /** * @author Vas N @@ -16,7 +17,7 @@ class DateSub extends DateAdd * @throws QueryException * @return string */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { $unit = strtoupper(is_string($this->unit) ? $this->unit : $this->unit->value); diff --git a/src/Query/Mysql/Day.php b/src/Query/Mysql/Day.php index f64a743c..662cd810 100644 --- a/src/Query/Mysql/Day.php +++ b/src/Query/Mysql/Day.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Rafael Kassner @@ -15,12 +17,12 @@ class Day extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'DAY(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/DayName.php b/src/Query/Mysql/DayName.php index 58065b31..e4df6092 100644 --- a/src/Query/Mysql/DayName.php +++ b/src/Query/Mysql/DayName.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Steve Lacey @@ -14,12 +16,12 @@ class DayName extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'DAYNAME(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/DayOfWeek.php b/src/Query/Mysql/DayOfWeek.php index 4fdb55ad..c0b8cb20 100644 --- a/src/Query/Mysql/DayOfWeek.php +++ b/src/Query/Mysql/DayOfWeek.php @@ -6,17 +6,19 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class DayOfWeek extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'DAYOFWEEK(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/DayOfYear.php b/src/Query/Mysql/DayOfYear.php index d54b530a..850cb30c 100644 --- a/src/Query/Mysql/DayOfYear.php +++ b/src/Query/Mysql/DayOfYear.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Query\Mysql; use Doctrine\ORM\Query\AST\Functions\FunctionNode; +use Doctrine\ORM\Query\AST\Node; use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; @@ -12,7 +13,7 @@ class DayOfYear extends FunctionNode { /** - * @var \Doctrine\ORM\Query\AST\Node + * @var Node */ public $date; diff --git a/src/Query/Mysql/Degrees.php b/src/Query/Mysql/Degrees.php index 5142f580..e718edb2 100644 --- a/src/Query/Mysql/Degrees.php +++ b/src/Query/Mysql/Degrees.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Degrees extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'DEGREES(' . $sqlWalker->walkSimpleArithmeticExpression( @@ -20,7 +22,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Div.php b/src/Query/Mysql/Div.php index ae3d00ce..4c1b0f1e 100644 --- a/src/Query/Mysql/Div.php +++ b/src/Query/Mysql/Div.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Query\Mysql; use Doctrine\ORM\Query\AST\Functions\FunctionNode; +use Doctrine\ORM\Query\AST\Node; use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; @@ -15,12 +16,12 @@ class Div extends FunctionNode { /** - * @var \Doctrine\ORM\Query\AST\Node + * @var Node */ private $dividend; /** - * @var \Doctrine\ORM\Query\AST\Node + * @var Node */ private $divisor; diff --git a/src/Query/Mysql/Exp.php b/src/Query/Mysql/Exp.php index 3d3e7b53..b67302a5 100644 --- a/src/Query/Mysql/Exp.php +++ b/src/Query/Mysql/Exp.php @@ -6,19 +6,21 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Exp extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'EXP(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression ) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Extract.php b/src/Query/Mysql/Extract.php index 90552cc4..4a654e0d 100644 --- a/src/Query/Mysql/Extract.php +++ b/src/Query/Mysql/Extract.php @@ -5,7 +5,9 @@ namespace DoctrineExtensions\Query\Mysql; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\QueryException; +use Doctrine\ORM\Query\SqlWalker; /** * @author Ahwalian Masykur @@ -16,7 +18,7 @@ class Extract extends DateAdd public $unit = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -31,7 +33,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { $unit = strtoupper($this->unit); if (!in_array($unit, self::$allowedUnits)) { diff --git a/src/Query/Mysql/Field.php b/src/Query/Mysql/Field.php index 4da575a8..dc00ada0 100644 --- a/src/Query/Mysql/Field.php +++ b/src/Query/Mysql/Field.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Jeremy Hicks @@ -16,7 +18,7 @@ class Field extends FunctionNode private $values = []; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -38,7 +40,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { $query = 'FIELD('; diff --git a/src/Query/Mysql/FindInSet.php b/src/Query/Mysql/FindInSet.php index 7bf2ce7e..9deb5152 100644 --- a/src/Query/Mysql/FindInSet.php +++ b/src/Query/Mysql/FindInSet.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class FindInSet extends FunctionNode { @@ -13,7 +15,7 @@ class FindInSet extends FunctionNode public $haystack = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -23,7 +25,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'FIND_IN_SET(' . $this->needle->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Mysql/Floor.php b/src/Query/Mysql/Floor.php index 2a950108..9f54e5b0 100644 --- a/src/Query/Mysql/Floor.php +++ b/src/Query/Mysql/Floor.php @@ -6,17 +6,19 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Floor extends FunctionNode { private $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'FLOOR(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Format.php b/src/Query/Mysql/Format.php index c17da444..266832b0 100644 --- a/src/Query/Mysql/Format.php +++ b/src/Query/Mysql/Format.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Wally Noveno @@ -16,7 +18,7 @@ class Format extends FunctionNode public $patternExpression = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -26,7 +28,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'FORMAT(' . $this->numberExpression->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Mysql/FromUnixtime.php b/src/Query/Mysql/FromUnixtime.php index 7083a383..879447b5 100644 --- a/src/Query/Mysql/FromUnixtime.php +++ b/src/Query/Mysql/FromUnixtime.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Nima S @@ -16,7 +18,7 @@ class FromUnixtime extends FunctionNode public $secondExpression = null; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { if (null !== $this->secondExpression) { return 'FROM_UNIXTIME(' @@ -29,7 +31,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string return 'FROM_UNIXTIME(' . $this->firstExpression->dispatch($sqlWalker) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $lexer = $parser->getLexer(); diff --git a/src/Query/Mysql/GroupConcat.php b/src/Query/Mysql/GroupConcat.php index 35c43bc0..32022d86 100644 --- a/src/Query/Mysql/GroupConcat.php +++ b/src/Query/Mysql/GroupConcat.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class GroupConcat extends FunctionNode { @@ -17,7 +19,7 @@ class GroupConcat extends FunctionNode public $orderBy = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -58,7 +60,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { $result = 'GROUP_CONCAT(' . ($this->isDistinct ? 'DISTINCT ' : ''); diff --git a/src/Query/Mysql/Hex.php b/src/Query/Mysql/Hex.php index cee96259..c293bd14 100644 --- a/src/Query/Mysql/Hex.php +++ b/src/Query/Mysql/Hex.php @@ -6,17 +6,19 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Hex extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'HEX(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Hour.php b/src/Query/Mysql/Hour.php index 3b19a2dd..f2dd2381 100644 --- a/src/Query/Mysql/Hour.php +++ b/src/Query/Mysql/Hour.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Dawid Nowak @@ -14,12 +16,12 @@ class Hour extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'HOUR('.$sqlWalker->walkArithmeticPrimary($this->date).')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/IfElse.php b/src/Query/Mysql/IfElse.php index 832f40c5..61c7024c 100644 --- a/src/Query/Mysql/IfElse.php +++ b/src/Query/Mysql/IfElse.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andrew Mackrodt @@ -14,7 +16,7 @@ class IfElse extends FunctionNode { private $expr = []; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -38,7 +40,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'IF(%s, %s, %s)', diff --git a/src/Query/Mysql/IfNull.php b/src/Query/Mysql/IfNull.php index 37d30458..02736bec 100644 --- a/src/Query/Mysql/IfNull.php +++ b/src/Query/Mysql/IfNull.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andrew Mackrodt @@ -16,7 +18,7 @@ class IfNull extends FunctionNode private $expr2; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -26,7 +28,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'IFNULL(' .$sqlWalker->walkArithmeticPrimary($this->expr1). ', ' diff --git a/src/Query/Mysql/LastDay.php b/src/Query/Mysql/LastDay.php index ef6a531a..80294507 100644 --- a/src/Query/Mysql/LastDay.php +++ b/src/Query/Mysql/LastDay.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Rafael Kassner @@ -15,12 +17,12 @@ class LastDay extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'LAST_DAY(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Log.php b/src/Query/Mysql/Log.php index eada7758..b6a2734e 100644 --- a/src/Query/Mysql/Log.php +++ b/src/Query/Mysql/Log.php @@ -6,19 +6,21 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Log extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'LOG(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression ) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Log10.php b/src/Query/Mysql/Log10.php index 9e078238..8abb6a37 100644 --- a/src/Query/Mysql/Log10.php +++ b/src/Query/Mysql/Log10.php @@ -6,19 +6,21 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Log10 extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'LOG10(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression ) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Log2.php b/src/Query/Mysql/Log2.php index 13b0abee..17bf48f1 100644 --- a/src/Query/Mysql/Log2.php +++ b/src/Query/Mysql/Log2.php @@ -6,19 +6,21 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Log2 extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'LOG2(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression ) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Lpad.php b/src/Query/Mysql/Lpad.php index 3deb5e19..c7111188 100644 --- a/src/Query/Mysql/Lpad.php +++ b/src/Query/Mysql/Lpad.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Giulia Santoiemma @@ -18,7 +20,7 @@ class Lpad extends FunctionNode public $padstring = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -30,7 +32,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'LPAD(' . $this->string->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Mysql/MakeDate.php b/src/Query/Mysql/MakeDate.php index 4dfa6db3..49ea4ccd 100644 --- a/src/Query/Mysql/MakeDate.php +++ b/src/Query/Mysql/MakeDate.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class MakeDate extends FunctionNode { @@ -13,7 +15,7 @@ class MakeDate extends FunctionNode public $dayOfYear = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -23,11 +25,11 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { - return 'MAKEDATE('. - $sqlWalker->walkArithmeticPrimary($this->year).', '. - $sqlWalker->walkArithmeticPrimary($this->dayOfYear). + return 'MAKEDATE(' . + $sqlWalker->walkArithmeticPrimary($this->year) . ', ' . + $sqlWalker->walkArithmeticPrimary($this->dayOfYear) . ')'; } } diff --git a/src/Query/Mysql/MatchAgainst.php b/src/Query/Mysql/MatchAgainst.php index 849f463b..13bf53e3 100644 --- a/src/Query/Mysql/MatchAgainst.php +++ b/src/Query/Mysql/MatchAgainst.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class MatchAgainst extends FunctionNode { @@ -21,7 +23,7 @@ class MatchAgainst extends FunctionNode /** @var bool */ protected $queryExpansion = false; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { // match $parser->match(Lexer::T_IDENTIFIER); @@ -90,7 +92,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $walker): string + public function getSql(SqlWalker $walker): string { $fields = []; diff --git a/src/Query/Mysql/Md5.php b/src/Query/Mysql/Md5.php index da57d8ca..57666f30 100644 --- a/src/Query/Mysql/Md5.php +++ b/src/Query/Mysql/Md5.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andreas Gallien @@ -14,12 +16,12 @@ class Md5 extends FunctionNode { public $stringPrimary; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'MD5(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Minute.php b/src/Query/Mysql/Minute.php index 7e14172f..d2de50ef 100644 --- a/src/Query/Mysql/Minute.php +++ b/src/Query/Mysql/Minute.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Martin Štekl @@ -14,12 +16,12 @@ class Minute extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'MINUTE('.$sqlWalker->walkArithmeticPrimary($this->date).')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Month.php b/src/Query/Mysql/Month.php index 6f4ddfda..db1b107b 100644 --- a/src/Query/Mysql/Month.php +++ b/src/Query/Mysql/Month.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Rafael Kassner @@ -15,12 +17,12 @@ class Month extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'MONTH(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/MonthName.php b/src/Query/Mysql/MonthName.php index ee558f4c..fea301f9 100644 --- a/src/Query/Mysql/MonthName.php +++ b/src/Query/Mysql/MonthName.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Steve Lacey @@ -14,12 +16,12 @@ class MonthName extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'MONTHNAME(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Now.php b/src/Query/Mysql/Now.php index 669de68a..ef851aa1 100644 --- a/src/Query/Mysql/Now.php +++ b/src/Query/Mysql/Now.php @@ -6,15 +6,17 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Now extends FunctionNode { - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'NOW()'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/NullIf.php b/src/Query/Mysql/NullIf.php index f94a623a..ade013c4 100644 --- a/src/Query/Mysql/NullIf.php +++ b/src/Query/Mysql/NullIf.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andrew Mackrodt @@ -16,7 +18,7 @@ class NullIf extends FunctionNode private $expr2; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -26,7 +28,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'NULLIF(%s, %s)', diff --git a/src/Query/Mysql/PeriodDiff.php b/src/Query/Mysql/PeriodDiff.php index 96b3599c..ea4a6c30 100644 --- a/src/Query/Mysql/PeriodDiff.php +++ b/src/Query/Mysql/PeriodDiff.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class PeriodDiff extends FunctionNode { @@ -13,7 +15,7 @@ class PeriodDiff extends FunctionNode public $secondDateExpression = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -23,7 +25,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'PERIOD_DIFF(' . $sqlWalker->walkArithmeticTerm($this->firstDateExpression) . ', ' . diff --git a/src/Query/Mysql/Pi.php b/src/Query/Mysql/Pi.php index ce6bc801..72618bf5 100644 --- a/src/Query/Mysql/Pi.php +++ b/src/Query/Mysql/Pi.php @@ -6,17 +6,19 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Pi extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'PI()'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Power.php b/src/Query/Mysql/Power.php index 37dd1cec..45bca6b1 100644 --- a/src/Query/Mysql/Power.php +++ b/src/Query/Mysql/Power.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Power extends FunctionNode { @@ -13,13 +15,13 @@ class Power extends FunctionNode public $power; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'POWER(' . $this->arithmeticExpression->dispatch($sqlWalker) . ', ' . $this->power->dispatch($sqlWalker) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Quarter.php b/src/Query/Mysql/Quarter.php index b93556a8..fbca0ee0 100644 --- a/src/Query/Mysql/Quarter.php +++ b/src/Query/Mysql/Quarter.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Martin Štekl @@ -14,12 +16,12 @@ class Quarter extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'QUARTER('.$sqlWalker->walkArithmeticPrimary($this->date).')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Radians.php b/src/Query/Mysql/Radians.php index 70ec1a59..7f174bad 100644 --- a/src/Query/Mysql/Radians.php +++ b/src/Query/Mysql/Radians.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Radians extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'RADIANS(' . $sqlWalker->walkSimpleArithmeticExpression( @@ -20,7 +22,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Rand.php b/src/Query/Mysql/Rand.php index b7dd044c..56ede20a 100644 --- a/src/Query/Mysql/Rand.php +++ b/src/Query/Mysql/Rand.php @@ -7,6 +7,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\SimpleArithmeticExpression; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Rand extends FunctionNode { @@ -15,7 +17,7 @@ class Rand extends FunctionNode */ private $expression = null; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { if ($this->expression) { return 'RAND(' . $this->expression->dispatch($sqlWalker) . ')'; @@ -24,7 +26,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string return 'RAND()'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $lexer = $parser->getLexer(); $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/Regexp.php b/src/Query/Mysql/Regexp.php index 1da0de99..60937686 100644 --- a/src/Query/Mysql/Regexp.php +++ b/src/Query/Mysql/Regexp.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Regexp extends FunctionNode { @@ -13,7 +15,7 @@ class Regexp extends FunctionNode public $regexp = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -23,7 +25,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return '(' . $this->value->dispatch($sqlWalker) . ' REGEXP ' . $this->regexp->dispatch($sqlWalker) . ')'; } diff --git a/src/Query/Mysql/Replace.php b/src/Query/Mysql/Replace.php index 2cfb586c..aa7be5bf 100644 --- a/src/Query/Mysql/Replace.php +++ b/src/Query/Mysql/Replace.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Jarek Kostrz @@ -18,7 +20,7 @@ class Replace extends FunctionNode public $subject = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -30,7 +32,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'REPLACE(' . $this->subject->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Mysql/Round.php b/src/Query/Mysql/Round.php index 47a35f69..ce87eccd 100644 --- a/src/Query/Mysql/Round.php +++ b/src/Query/Mysql/Round.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Round extends FunctionNode { @@ -13,7 +15,7 @@ class Round extends FunctionNode private $secondExpression = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $lexer = $parser->getLexer(); $parser->match(Lexer::T_IDENTIFIER); @@ -29,7 +31,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { // use second parameter if parsed if (null !== $this->secondExpression) { diff --git a/src/Query/Mysql/Rpad.php b/src/Query/Mysql/Rpad.php index 37f0ef3d..a3b4e44c 100644 --- a/src/Query/Mysql/Rpad.php +++ b/src/Query/Mysql/Rpad.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Giulia Santoiemma @@ -18,7 +20,7 @@ class Rpad extends FunctionNode public $padstring = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -30,7 +32,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'RPAD(' . $this->string->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Mysql/SecToTime.php b/src/Query/Mysql/SecToTime.php index 8fd6e1eb..9e4a4c8e 100644 --- a/src/Query/Mysql/SecToTime.php +++ b/src/Query/Mysql/SecToTime.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @example SELECT SEC_TO_TIME(2378); @@ -16,12 +18,12 @@ class SecToTime extends FunctionNode { public $time; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'SEC_TO_TIME('.$sqlWalker->walkArithmeticPrimary($this->time).')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Second.php b/src/Query/Mysql/Second.php index a22bfcad..9f48f764 100644 --- a/src/Query/Mysql/Second.php +++ b/src/Query/Mysql/Second.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Martin Štekl @@ -14,12 +16,12 @@ class Second extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'SECOND('.$sqlWalker->walkArithmeticPrimary($this->date).')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Sha1.php b/src/Query/Mysql/Sha1.php index 47f3f703..027d7f45 100644 --- a/src/Query/Mysql/Sha1.php +++ b/src/Query/Mysql/Sha1.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andreas Gallien @@ -14,14 +16,14 @@ class Sha1 extends FunctionNode { public $stringPrimary; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'SHA1(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Sha2.php b/src/Query/Mysql/Sha2.php index 55aeb511..205b669f 100644 --- a/src/Query/Mysql/Sha2.php +++ b/src/Query/Mysql/Sha2.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andreas Gallien @@ -16,7 +18,7 @@ class Sha2 extends FunctionNode public $simpleArithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'SHA2(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . @@ -25,7 +27,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Sin.php b/src/Query/Mysql/Sin.php index d40b4e9d..14413917 100644 --- a/src/Query/Mysql/Sin.php +++ b/src/Query/Mysql/Sin.php @@ -6,19 +6,21 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Sin extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'SIN(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression ) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Soundex.php b/src/Query/Mysql/Soundex.php index 68d7f907..e5b2c5cb 100644 --- a/src/Query/Mysql/Soundex.php +++ b/src/Query/Mysql/Soundex.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Steve Tauber @@ -14,12 +16,12 @@ class Soundex extends FunctionNode { public $stringPrimary; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'SOUNDEX('.$sqlWalker->walkStringPrimary($this->stringPrimary).')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Std.php b/src/Query/Mysql/Std.php index a874ad3e..66631f3e 100644 --- a/src/Query/Mysql/Std.php +++ b/src/Query/Mysql/Std.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Toni Uebernickel @@ -14,12 +16,12 @@ class Std extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf('STD(%s)', $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression)); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/StdDev.php b/src/Query/Mysql/StdDev.php index 3351cffb..66ae408f 100644 --- a/src/Query/Mysql/StdDev.php +++ b/src/Query/Mysql/StdDev.php @@ -6,6 +6,10 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; + +use function sprintf; /** * @author Joachim Schirrmacher @@ -14,12 +18,12 @@ class StdDev extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf('STDDEV(%s)', $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression)); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/StrToDate.php b/src/Query/Mysql/StrToDate.php index e6a57206..c434af93 100644 --- a/src/Query/Mysql/StrToDate.php +++ b/src/Query/Mysql/StrToDate.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class StrToDate extends FunctionNode { @@ -13,7 +15,7 @@ class StrToDate extends FunctionNode public $dateFormat = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -23,7 +25,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'STR_TO_DATE(' . $this->dateString->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Mysql/Tan.php b/src/Query/Mysql/Tan.php index 9f51e43b..bbc72f59 100644 --- a/src/Query/Mysql/Tan.php +++ b/src/Query/Mysql/Tan.php @@ -6,19 +6,21 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Tan extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'TAN(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression ) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Time.php b/src/Query/Mysql/Time.php index d237b320..962cffcb 100644 --- a/src/Query/Mysql/Time.php +++ b/src/Query/Mysql/Time.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Steve Lacey @@ -15,12 +17,12 @@ class Time extends FunctionNode { public $time; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'TIME(' . $sqlWalker->walkArithmeticPrimary($this->time) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/TimeDiff.php b/src/Query/Mysql/TimeDiff.php index 54900f3d..ba407fc5 100644 --- a/src/Query/Mysql/TimeDiff.php +++ b/src/Query/Mysql/TimeDiff.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class TimeDiff extends FunctionNode { @@ -13,7 +15,7 @@ class TimeDiff extends FunctionNode public $secondDateExpression = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -23,7 +25,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'TIMEDIFF(%s, %s)', diff --git a/src/Query/Mysql/TimeToSec.php b/src/Query/Mysql/TimeToSec.php index bb5cdf0e..68affb6d 100644 --- a/src/Query/Mysql/TimeToSec.php +++ b/src/Query/Mysql/TimeToSec.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @example SELECT TIME_TO_SEC('22:23:00'); @@ -16,12 +18,12 @@ class TimeToSec extends FunctionNode { public $time; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'TIME_TO_SEC('.$sqlWalker->walkArithmeticPrimary($this->time).')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/TimestampAdd.php b/src/Query/Mysql/TimestampAdd.php index d91296c0..10bb32a4 100644 --- a/src/Query/Mysql/TimestampAdd.php +++ b/src/Query/Mysql/TimestampAdd.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Alessandro Tagliapietra @@ -18,7 +20,7 @@ class TimestampAdd extends FunctionNode public $unit = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -32,7 +34,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sql_walker): string + public function getSql(SqlWalker $sql_walker): string { return sprintf( 'TIMESTAMPADD(%s, %s, %s)', diff --git a/src/Query/Mysql/TimestampDiff.php b/src/Query/Mysql/TimestampDiff.php index 51e22977..6da3af84 100644 --- a/src/Query/Mysql/TimestampDiff.php +++ b/src/Query/Mysql/TimestampDiff.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Przemek Sobstel @@ -18,7 +20,7 @@ class TimestampDiff extends FunctionNode public $unit = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -32,7 +34,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sql_walker): string + public function getSql(SqlWalker $sql_walker): string { return sprintf( 'TIMESTAMPDIFF(%s, %s, %s)', diff --git a/src/Query/Mysql/Truncate.php b/src/Query/Mysql/Truncate.php index f8d98180..64cf8717 100644 --- a/src/Query/Mysql/Truncate.php +++ b/src/Query/Mysql/Truncate.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Evgeny Savich @@ -16,7 +18,7 @@ class Truncate extends FunctionNode public $patternExpression = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -26,7 +28,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'TRUNCATE(' . $this->numberExpression->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Mysql/Unhex.php b/src/Query/Mysql/Unhex.php index b98324a9..5161219c 100644 --- a/src/Query/Mysql/Unhex.php +++ b/src/Query/Mysql/Unhex.php @@ -6,17 +6,19 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Unhex extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'UNHEX(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/UnixTimestamp.php b/src/Query/Mysql/UnixTimestamp.php index 16530760..4cede760 100644 --- a/src/Query/Mysql/UnixTimestamp.php +++ b/src/Query/Mysql/UnixTimestamp.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Rafael Kassner @@ -15,7 +17,7 @@ class UnixTimestamp extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'UNIX_TIMESTAMP(%s)', @@ -23,7 +25,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/UtcTimestamp.php b/src/Query/Mysql/UtcTimestamp.php index 1b8c10e9..6e671aac 100644 --- a/src/Query/Mysql/UtcTimestamp.php +++ b/src/Query/Mysql/UtcTimestamp.php @@ -6,18 +6,20 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Marius Krämer */ class UtcTimestamp extends FunctionNode { - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'UTC_TIMESTAMP()'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/UuidShort.php b/src/Query/Mysql/UuidShort.php index f625b694..b838f8db 100644 --- a/src/Query/Mysql/UuidShort.php +++ b/src/Query/Mysql/UuidShort.php @@ -6,17 +6,19 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class UuidShort extends FunctionNode { public $arithmeticExpression; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'UUID_SHORT()'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Week.php b/src/Query/Mysql/Week.php index 5a891aa1..a489cd5f 100644 --- a/src/Query/Mysql/Week.php +++ b/src/Query/Mysql/Week.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Rafael Kassner @@ -18,7 +20,7 @@ class Week extends FunctionNode public $mode; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { $sql = 'WEEK(' . $sqlWalker->walkArithmeticPrimary($this->date); if ($this->mode != null) { @@ -29,7 +31,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string return $sql; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/WeekDay.php b/src/Query/Mysql/WeekDay.php index 589a5377..347f5c0c 100644 --- a/src/Query/Mysql/WeekDay.php +++ b/src/Query/Mysql/WeekDay.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Pavlo Cherniavskyi @@ -14,12 +16,12 @@ class WeekDay extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'WEEKDAY(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/WeekOfYear.php b/src/Query/Mysql/WeekOfYear.php index 200903e2..c5f7f675 100644 --- a/src/Query/Mysql/WeekOfYear.php +++ b/src/Query/Mysql/WeekOfYear.php @@ -6,17 +6,19 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class WeekOfYear extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'WEEKOFYEAR(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/Year.php b/src/Query/Mysql/Year.php index 712055c5..9f6566b2 100644 --- a/src/Query/Mysql/Year.php +++ b/src/Query/Mysql/Year.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Rafael Kassner @@ -14,12 +16,12 @@ class Year extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'YEAR(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/YearMonth.php b/src/Query/Mysql/YearMonth.php index d5761583..426a15fe 100644 --- a/src/Query/Mysql/YearMonth.php +++ b/src/Query/Mysql/YearMonth.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class YearMonth extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(YEAR_MONTH FROM %s)', @@ -19,7 +21,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Mysql/YearWeek.php b/src/Query/Mysql/YearWeek.php index dae1e568..76b8a900 100644 --- a/src/Query/Mysql/YearWeek.php +++ b/src/Query/Mysql/YearWeek.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Michael Kimpton @@ -16,7 +18,7 @@ class YearWeek extends FunctionNode public $mode; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { $sql = 'YEARWEEK(' . $sqlWalker->walkArithmeticPrimary($this->date); if ($this->mode != null) { @@ -27,7 +29,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string return $sql; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Oracle/Ceil.php b/src/Query/Oracle/Ceil.php index 83b4925f..49ffc235 100755 --- a/src/Query/Oracle/Ceil.php +++ b/src/Query/Oracle/Ceil.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Jefferson Vantuir @@ -14,7 +16,7 @@ class Ceil extends FunctionNode { private $number; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'CEIL(%s)', @@ -22,7 +24,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Oracle/Day.php b/src/Query/Oracle/Day.php index 56956b2f..d5ac023f 100644 --- a/src/Query/Oracle/Day.php +++ b/src/Query/Oracle/Day.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andréia Bohner @@ -14,7 +16,7 @@ class Day extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(DAY FROM %s)', @@ -22,7 +24,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Oracle/Floor.php b/src/Query/Oracle/Floor.php index 22325274..56abc57a 100755 --- a/src/Query/Oracle/Floor.php +++ b/src/Query/Oracle/Floor.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Jefferson Vantuir @@ -14,7 +16,7 @@ class Floor extends FunctionNode { private $number; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'FLOOR(%s)', @@ -22,7 +24,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Oracle/Hour.php b/src/Query/Oracle/Hour.php index c93eff43..70123654 100644 --- a/src/Query/Oracle/Hour.php +++ b/src/Query/Oracle/Hour.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andréia Bohner @@ -14,7 +16,7 @@ class Hour extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(HOUR FROM %s)', @@ -22,7 +24,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Oracle/Minute.php b/src/Query/Oracle/Minute.php index cc5a90b8..d0c39589 100644 --- a/src/Query/Oracle/Minute.php +++ b/src/Query/Oracle/Minute.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andréia Bohner @@ -14,7 +16,7 @@ class Minute extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(MINUTE FROM %s)', @@ -22,7 +24,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Oracle/Month.php b/src/Query/Oracle/Month.php index 07d73f78..3eb0bc9a 100644 --- a/src/Query/Oracle/Month.php +++ b/src/Query/Oracle/Month.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andréia Bohner @@ -14,7 +16,7 @@ class Month extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(MONTH FROM %s)', @@ -22,7 +24,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Oracle/Nvl.php b/src/Query/Oracle/Nvl.php index 4fb567f8..68cdc4a6 100644 --- a/src/Query/Oracle/Nvl.php +++ b/src/Query/Oracle/Nvl.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andréia Bohner @@ -16,7 +18,7 @@ class Nvl extends FunctionNode private $expr2; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'NVL(%s, %s)', @@ -25,7 +27,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Oracle/Second.php b/src/Query/Oracle/Second.php index fd5408c4..56184e8e 100644 --- a/src/Query/Oracle/Second.php +++ b/src/Query/Oracle/Second.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andréia Bohner @@ -14,7 +16,7 @@ class Second extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'FLOOR(EXTRACT(SECOND FROM %s))', @@ -22,7 +24,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Oracle/ToChar.php b/src/Query/Oracle/ToChar.php index f019889b..588a3490 100755 --- a/src/Query/Oracle/ToChar.php +++ b/src/Query/Oracle/ToChar.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Cédric Bertolini @@ -18,7 +20,7 @@ class ToChar extends FunctionNode private $nls = null; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { if ($this->nls) { return sprintf( @@ -36,7 +38,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $lexer = $parser->getLexer(); diff --git a/src/Query/Oracle/ToDate.php b/src/Query/Oracle/ToDate.php index cdc466e4..8cb1cc07 100644 --- a/src/Query/Oracle/ToDate.php +++ b/src/Query/Oracle/ToDate.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Mohammad ZeinEddin @@ -16,7 +18,7 @@ class ToDate extends FunctionNode private $fmt; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'TO_DATE(%s, %s)', @@ -25,7 +27,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Oracle/Trunc.php b/src/Query/Oracle/Trunc.php index 1eccc823..8b8dbeff 100755 --- a/src/Query/Oracle/Trunc.php +++ b/src/Query/Oracle/Trunc.php @@ -7,6 +7,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Node; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Mohammad ZeinEddin @@ -23,7 +25,7 @@ class Trunc extends FunctionNode */ private $fmt; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { if ($this->fmt) { return sprintf( @@ -39,7 +41,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $lexer = $parser->getLexer(); diff --git a/src/Query/Oracle/Year.php b/src/Query/Oracle/Year.php index 1f61f396..15a4d746 100644 --- a/src/Query/Oracle/Year.php +++ b/src/Query/Oracle/Year.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Andréia Bohner @@ -14,7 +16,7 @@ class Year extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(YEAR FROM %s)', @@ -22,7 +24,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Postgresql/Date.php b/src/Query/Postgresql/Date.php index e3e442bf..1a1bab4f 100644 --- a/src/Query/Postgresql/Date.php +++ b/src/Query/Postgresql/Date.php @@ -6,17 +6,19 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Date extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'DATE(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Postgresql/DateFormat.php b/src/Query/Postgresql/DateFormat.php index 95aa7f82..2d25b4bc 100644 --- a/src/Query/Postgresql/DateFormat.php +++ b/src/Query/Postgresql/DateFormat.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Silvio @@ -16,7 +18,7 @@ class DateFormat extends FunctionNode public $patternExpression = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -26,7 +28,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'TO_CHAR(' . $this->dateExpression->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Postgresql/Day.php b/src/Query/Postgresql/Day.php index dcc1b217..0cb8c54c 100644 --- a/src/Query/Postgresql/Day.php +++ b/src/Query/Postgresql/Day.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Day extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(DAY FROM %s)', @@ -19,7 +21,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Postgresql/Hour.php b/src/Query/Postgresql/Hour.php index 03a09da3..ce8cb2dd 100644 --- a/src/Query/Postgresql/Hour.php +++ b/src/Query/Postgresql/Hour.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Hour extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(HOUR FROM %s)', @@ -19,7 +21,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Postgresql/Minute.php b/src/Query/Postgresql/Minute.php index 21cea9ea..4f082545 100644 --- a/src/Query/Postgresql/Minute.php +++ b/src/Query/Postgresql/Minute.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Minute extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(MINUTE FROM %s)', @@ -19,7 +21,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Postgresql/Month.php b/src/Query/Postgresql/Month.php index c2d790cb..2af1a935 100644 --- a/src/Query/Postgresql/Month.php +++ b/src/Query/Postgresql/Month.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Month extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(MONTH FROM %s)', @@ -19,7 +21,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Postgresql/RegexpReplace.php b/src/Query/Postgresql/RegexpReplace.php index 98088c08..8df2b38b 100644 --- a/src/Query/Postgresql/RegexpReplace.php +++ b/src/Query/Postgresql/RegexpReplace.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @example SELECT REGEXP_REPLACE(string, search, replace) @@ -19,12 +21,12 @@ class RegexpReplace extends FunctionNode private $replace; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'REGEXP_REPLACE('.$this->string->dispatch($sqlWalker).', '.$this->search->dispatch($sqlWalker).', '.$this->replace->dispatch($sqlWalker).')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Postgresql/Second.php b/src/Query/Postgresql/Second.php index be70cf3c..8e01b03f 100644 --- a/src/Query/Postgresql/Second.php +++ b/src/Query/Postgresql/Second.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Second extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'FLOOR(EXTRACT(SECOND FROM %s))', @@ -19,7 +21,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Postgresql/StrToDate.php b/src/Query/Postgresql/StrToDate.php index 735d6368..de1b012a 100644 --- a/src/Query/Postgresql/StrToDate.php +++ b/src/Query/Postgresql/StrToDate.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class StrToDate extends FunctionNode { @@ -13,7 +15,7 @@ class StrToDate extends FunctionNode public $dateFormat = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -23,7 +25,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'TO_DATE(' . $this->dateString->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Postgresql/Year.php b/src/Query/Postgresql/Year.php index 844f08fa..e6dad21b 100644 --- a/src/Query/Postgresql/Year.php +++ b/src/Query/Postgresql/Year.php @@ -6,12 +6,14 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Year extends FunctionNode { private $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(YEAR FROM %s)', @@ -19,7 +21,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string ); } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Sqlite/AbstractStrfTime.php b/src/Query/Sqlite/AbstractStrfTime.php index 919e5402..e25a48f8 100644 --- a/src/Query/Sqlite/AbstractStrfTime.php +++ b/src/Query/Sqlite/AbstractStrfTime.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Tarjei Huse @@ -14,7 +16,7 @@ abstract class AbstractStrfTime extends FunctionNode { public $date; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return "STRFTIME('" . $this->getFormat() @@ -23,7 +25,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string . ')'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Sqlite/ConcatWs.php b/src/Query/Sqlite/ConcatWs.php index 2177f599..3957eac2 100644 --- a/src/Query/Sqlite/ConcatWs.php +++ b/src/Query/Sqlite/ConcatWs.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Bas de Ruiter @@ -16,7 +18,7 @@ class ConcatWs extends FunctionNode private $notEmpty = false; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -55,7 +57,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { $separator = $this->values[0]->simpleArithmeticExpression->value; diff --git a/src/Query/Sqlite/DateFormat.php b/src/Query/Sqlite/DateFormat.php index 2ff9fb0e..d6ae7f1d 100644 --- a/src/Query/Sqlite/DateFormat.php +++ b/src/Query/Sqlite/DateFormat.php @@ -7,6 +7,8 @@ use Doctrine\ORM\Query\AST\ArithmeticExpression; use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * This class fakes a DATE_FORMAT method for SQLite, so that we can use sqlite as drop-in replacement @@ -24,7 +26,7 @@ class DateFormat extends FunctionNode * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker * @return string */ - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'STRFTIME(' . $sqlWalker->walkArithmeticPrimary($this->format) @@ -36,7 +38,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string /** * @param \Doctrine\ORM\Query\Parser $parser */ - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Sqlite/IfElse.php b/src/Query/Sqlite/IfElse.php index 87e21ec6..748231cb 100644 --- a/src/Query/Sqlite/IfElse.php +++ b/src/Query/Sqlite/IfElse.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author Mikhail Bubnov @@ -14,7 +16,7 @@ class IfElse extends FunctionNode { private $expr = []; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -28,7 +30,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'CASE WHEN %s THEN %s ELSE %s END', diff --git a/src/Query/Sqlite/IfNull.php b/src/Query/Sqlite/IfNull.php index a1fe9078..6b2db966 100644 --- a/src/Query/Sqlite/IfNull.php +++ b/src/Query/Sqlite/IfNull.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author winkbrace @@ -16,7 +18,7 @@ class IfNull extends FunctionNode private $expr2; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -26,7 +28,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'IFNULL(' . $sqlWalker->walkArithmeticPrimary($this->expr1) diff --git a/src/Query/Sqlite/NumberFromStrfTime.php b/src/Query/Sqlite/NumberFromStrfTime.php index 8cb59a8b..316fbd31 100644 --- a/src/Query/Sqlite/NumberFromStrfTime.php +++ b/src/Query/Sqlite/NumberFromStrfTime.php @@ -4,9 +4,11 @@ namespace DoctrineExtensions\Query\Sqlite; +use Doctrine\ORM\Query\SqlWalker; + abstract class NumberFromStrfTime extends AbstractStrfTime { - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return "CAST(STRFTIME('" . $this->getFormat() diff --git a/src/Query/Sqlite/Random.php b/src/Query/Sqlite/Random.php index dc6b43f4..d5618b06 100644 --- a/src/Query/Sqlite/Random.php +++ b/src/Query/Sqlite/Random.php @@ -6,15 +6,17 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; class Random extends FunctionNode { - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'RANDOM()'; } - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); diff --git a/src/Query/Sqlite/Replace.php b/src/Query/Sqlite/Replace.php index d126a235..302063ff 100644 --- a/src/Query/Sqlite/Replace.php +++ b/src/Query/Sqlite/Replace.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author winkbrace @@ -18,7 +20,7 @@ class Replace extends FunctionNode public $subject = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -30,7 +32,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { return 'REPLACE(' . $this->subject->dispatch($sqlWalker) . ', ' . diff --git a/src/Query/Sqlite/Round.php b/src/Query/Sqlite/Round.php index ec8d1b34..b695c4cd 100644 --- a/src/Query/Sqlite/Round.php +++ b/src/Query/Sqlite/Round.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\SqlWalker; /** * @author winkbrace @@ -16,7 +18,7 @@ class Round extends FunctionNode private $secondExpression = null; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $lexer = $parser->getLexer(); $parser->match(Lexer::T_IDENTIFIER); @@ -32,7 +34,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string + public function getSql(SqlWalker $sqlWalker): string { // use second parameter if parsed if (null !== $this->secondExpression) { diff --git a/src/Query/Sqlite/StrfTime.php b/src/Query/Sqlite/StrfTime.php index 8aadbce3..072531cc 100644 --- a/src/Query/Sqlite/StrfTime.php +++ b/src/Query/Sqlite/StrfTime.php @@ -7,6 +7,7 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; +use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; /** @@ -21,7 +22,7 @@ class StrfTime extends FunctionNode /** * @param SqlWalker $sqlWalker * - * @throws \Doctrine\ORM\Query\QueryException + * @throws QueryException * @return string */ public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Query/Sqlite/Week.php b/src/Query/Sqlite/Week.php index a5fa19a5..e2403434 100644 --- a/src/Query/Sqlite/Week.php +++ b/src/Query/Sqlite/Week.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Query\Sqlite; use Doctrine\ORM\Query\Lexer; +use Doctrine\ORM\Query\Parser; /** * @author Aleksandr Klimenkov @@ -17,14 +18,14 @@ class Week extends NumberFromStrfTime */ public $mode; - public function parse(\Doctrine\ORM\Query\Parser $parser): void + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->date = $parser->ArithmeticPrimary(); - if (Lexer::T_COMMA === $parser->getLexer()->lookahead->type) { + if ($parser->getLexer()->lookahead->type === Lexer::T_COMMA) { $parser->match(Lexer::T_COMMA); $this->mode = $parser->Literal(); } diff --git a/src/Types/CarbonDateTimeType.php b/src/Types/CarbonDateTimeType.php index 98dd326b..feeeb3b4 100644 --- a/src/Types/CarbonDateTimeType.php +++ b/src/Types/CarbonDateTimeType.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Types; use Carbon\Carbon; +use DateTime; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateTimeType; @@ -21,7 +22,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); - if ($result instanceof \DateTime) { + if ($result instanceof DateTime) { return Carbon::instance($result); } diff --git a/src/Types/CarbonDateTimeTzType.php b/src/Types/CarbonDateTimeTzType.php index ad14c0ab..ea2851f6 100644 --- a/src/Types/CarbonDateTimeTzType.php +++ b/src/Types/CarbonDateTimeTzType.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Types; use Carbon\Carbon; +use DateTime; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateTimeTzType; @@ -21,7 +22,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); - if ($result instanceof \DateTime) { + if ($result instanceof DateTime) { return Carbon::instance($result); } diff --git a/src/Types/CarbonDateType.php b/src/Types/CarbonDateType.php index fa6e0211..48bc7c15 100644 --- a/src/Types/CarbonDateType.php +++ b/src/Types/CarbonDateType.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Types; use Carbon\Carbon; +use DateTime; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateType; @@ -21,7 +22,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); - if ($result instanceof \DateTime) { + if ($result instanceof DateTime) { return Carbon::instance($result); } diff --git a/src/Types/CarbonImmutableDateTimeType.php b/src/Types/CarbonImmutableDateTimeType.php index fe1412e4..c894eb2a 100644 --- a/src/Types/CarbonImmutableDateTimeType.php +++ b/src/Types/CarbonImmutableDateTimeType.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Types; use Carbon\CarbonImmutable; +use DateTime; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateTimeType; @@ -21,7 +22,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); - if ($result instanceof \DateTime) { + if ($result instanceof DateTime) { return CarbonImmutable::instance($result); } diff --git a/src/Types/CarbonImmutableDateTimeTzType.php b/src/Types/CarbonImmutableDateTimeTzType.php index 460bce71..d3de1d33 100644 --- a/src/Types/CarbonImmutableDateTimeTzType.php +++ b/src/Types/CarbonImmutableDateTimeTzType.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Types; use Carbon\CarbonImmutable; +use DateTime; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateTimeTzType; @@ -21,7 +22,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); - if ($result instanceof \DateTime) { + if ($result instanceof DateTime) { return CarbonImmutable::instance($result); } diff --git a/src/Types/CarbonImmutableDateType.php b/src/Types/CarbonImmutableDateType.php index f3e51132..d781297e 100644 --- a/src/Types/CarbonImmutableDateType.php +++ b/src/Types/CarbonImmutableDateType.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Types; use Carbon\CarbonImmutable; +use DateTime; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateType; @@ -21,7 +22,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); - if ($result instanceof \DateTime) { + if ($result instanceof DateTime) { return CarbonImmutable::instance($result); } diff --git a/src/Types/CarbonImmutableTimeType.php b/src/Types/CarbonImmutableTimeType.php index 2c19aed2..bad6df72 100644 --- a/src/Types/CarbonImmutableTimeType.php +++ b/src/Types/CarbonImmutableTimeType.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Types; use Carbon\CarbonImmutable; +use DateTime; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\TimeType; @@ -21,7 +22,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); - if ($result instanceof \DateTime) { + if ($result instanceof DateTime) { return CarbonImmutable::instance($result); } diff --git a/src/Types/CarbonTimeType.php b/src/Types/CarbonTimeType.php index 42113006..12bb8340 100644 --- a/src/Types/CarbonTimeType.php +++ b/src/Types/CarbonTimeType.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Types; use Carbon\Carbon; +use DateTime; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\TimeType; @@ -21,7 +22,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); - if ($result instanceof \DateTime) { + if ($result instanceof DateTime) { return Carbon::instance($result); } diff --git a/src/Types/ZendDateType.php b/src/Types/ZendDateType.php index a2f2b54e..a9c9f1bb 100755 --- a/src/Types/ZendDateType.php +++ b/src/Types/ZendDateType.php @@ -7,6 +7,8 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\ConversionException; use Doctrine\DBAL\Types\Type; +use Zend_Date; +use Zend_Locale_Format; if (!class_exists('Zend_Date')) { require_once 'Zend/Date.php'; @@ -34,7 +36,7 @@ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $pla public function convertToDatabaseValue($value, AbstractPlatform $platform) { return ($value !== null) - ? $value->toString(\Zend_Locale_Format::convertPhpToIsoFormat( + ? $value->toString(Zend_Locale_Format::convertPhpToIsoFormat( $platform->getDateTimeFormatString() )) : null; @@ -46,11 +48,11 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return; } - $dateTimeFormatString = \Zend_Locale_Format::convertPhpToIsoFormat( + $dateTimeFormatString = Zend_Locale_Format::convertPhpToIsoFormat( $platform->getDateTimeFormatString() ); - $val = new \Zend_Date($value, $dateTimeFormatString); + $val = new Zend_Date($value, $dateTimeFormatString); if (!$val) { throw ConversionException::conversionFailed($value, $this->getName()); } diff --git a/tests/Config/MysqlYamlTest.php b/tests/Config/MysqlYamlTest.php index 9b15dbc1..fd98e04b 100755 --- a/tests/Config/MysqlYamlTest.php +++ b/tests/Config/MysqlYamlTest.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Tests\Config; use PHPUnit\Framework\TestCase; +use Symfony\Component\Yaml\Parser; /** * Test that checks the README describes all of the query types @@ -18,7 +19,7 @@ class MysqlYamlTest extends TestCase public function setUp(): void { - $yaml = new \Symfony\Component\Yaml\Parser(); + $yaml = new Parser(); $config = $yaml->parse(file_get_contents(__DIR__ . '/../../config/mysql.yml')); $this->functions = array_merge( diff --git a/tests/Query/Mysql/ExpTest.php b/tests/Query/Mysql/ExpTest.php index 66b01e49..06ccd255 100644 --- a/tests/Query/Mysql/ExpTest.php +++ b/tests/Query/Mysql/ExpTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Mysql; -class ExpTest extends \DoctrineExtensions\Tests\Query\MysqlTestCase +use DoctrineExtensions\Tests\Query\MysqlTestCase; + +class ExpTest extends MysqlTestCase { public function testExp() { diff --git a/tests/Query/Mysql/Log2Test.php b/tests/Query/Mysql/Log2Test.php index 81987b2c..1e75c9f3 100644 --- a/tests/Query/Mysql/Log2Test.php +++ b/tests/Query/Mysql/Log2Test.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Mysql; -class Log2Test extends \DoctrineExtensions\Tests\Query\MysqlTestCase +use DoctrineExtensions\Tests\Query\MysqlTestCase; + +class Log2Test extends MysqlTestCase { public function testLog2() { diff --git a/tests/Query/Mysql/LogTest.php b/tests/Query/Mysql/LogTest.php index c75a2725..172fff0b 100644 --- a/tests/Query/Mysql/LogTest.php +++ b/tests/Query/Mysql/LogTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Mysql; -class LogTest extends \DoctrineExtensions\Tests\Query\MysqlTestCase +use DoctrineExtensions\Tests\Query\MysqlTestCase; + +class LogTest extends MysqlTestCase { public function testLog() { diff --git a/tests/Query/Mysql/SetTest.php b/tests/Query/Mysql/SetTest.php index ee1a7f1d..e2eb363a 100644 --- a/tests/Query/Mysql/SetTest.php +++ b/tests/Query/Mysql/SetTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Mysql; -class SetTest extends \DoctrineExtensions\Tests\Query\MysqlTestCase +use DoctrineExtensions\Tests\Query\MysqlTestCase; + +class SetTest extends MysqlTestCase { public function testFindInSet() { diff --git a/tests/Query/Mysql/StdDevTest.php b/tests/Query/Mysql/StdDevTest.php index 2d87daf9..1d9ee150 100644 --- a/tests/Query/Mysql/StdDevTest.php +++ b/tests/Query/Mysql/StdDevTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Mysql; -class StdDevTest extends \DoctrineExtensions\Tests\Query\MysqlTestCase +use DoctrineExtensions\Tests\Query\MysqlTestCase; + +class StdDevTest extends MysqlTestCase { public function testStdDev() { diff --git a/tests/Query/Mysql/StringTest.php b/tests/Query/Mysql/StringTest.php index 55d37f8b..fef0fea4 100644 --- a/tests/Query/Mysql/StringTest.php +++ b/tests/Query/Mysql/StringTest.php @@ -4,7 +4,10 @@ namespace DoctrineExtensions\Tests\Query\Mysql; -class StringTest extends \DoctrineExtensions\Tests\Query\MysqlTestCase +use Doctrine\ORM\Query\QueryException; +use DoctrineExtensions\Tests\Query\MysqlTestCase; + +class StringTest extends MysqlTestCase { public function testAscii() { @@ -19,7 +22,7 @@ public function testAscii() */ public function testCharLength() { - $this->expectException(\Doctrine\ORM\Query\QueryException::class); + $this->expectException(QueryException::class); $this->assertDqlProducesSql( "SELECT CHAR_LENGTH(CHAR(0x65)), CHAR_LENGTH(CHAR(0x65 USING utf8)) from DoctrineExtensions\Tests\Entities\Blank b", @@ -40,7 +43,7 @@ public function testConcatWithSeparator() */ public function testConcatWithSeparatorWithNull() { - $this->expectException(\Doctrine\ORM\Query\QueryException::class); + $this->expectException(QueryException::class); $this->assertDqlProducesSql( "SELECT CONCAT_WS(',', 'First name', NULL, 'Last Name') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/TrigTest.php b/tests/Query/Mysql/TrigTest.php index 0a7901e3..dda4be01 100644 --- a/tests/Query/Mysql/TrigTest.php +++ b/tests/Query/Mysql/TrigTest.php @@ -4,7 +4,10 @@ namespace DoctrineExtensions\Tests\Query\Mysql; -class TrigTest extends \DoctrineExtensions\Tests\Query\MysqlTestCase +use Doctrine\ORM\Version; +use DoctrineExtensions\Tests\Query\MysqlTestCase; + +class TrigTest extends MysqlTestCase { private $entity; @@ -38,7 +41,7 @@ public function testSin() $sql = 'SELECT SIN(RADIANS(b0_.latitude) * RADIANS(b0_.longitude)) AS sclr_0 FROM BlogPost b0_'; $this->assertEquals($sql, $q->getSql()); - if (\Doctrine\ORM\Version::compare('2.4.0') <= 0) { + if (Version::compare('2.4.0') <= 0) { $dql = "SELECT p FROM {$this->entity} p WHERE p.longitude = SIN(RADIANS(p.latitude)) * RADIANS(p.longitude)"; } else { $dql = "SELECT p FROM {$this->entity} p WHERE p.longitude = (SIN(RADIANS(p.latitude)) * RADIANS(p.longitude))"; @@ -55,7 +58,7 @@ public function testSin() $sql = 'SELECT b0_.id AS id_0, b0_.created AS created_1, b0_.longitude AS longitude_2, b0_.latitude AS latitude_3 FROM BlogPost b0_ WHERE SIN(RADIANS(b0_.latitude)) * SIN(RADIANS(b0_.longitude)) = 1'; $this->assertEquals($sql, $q->getSql()); - if (\Doctrine\ORM\Version::compare('2.4.0') <= 0) { + if (Version::compare('2.4.0') <= 0) { $dql = "SELECT SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude)) FROM {$this->entity} p "; } else { $dql = "SELECT (SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude))) FROM {$this->entity} p "; @@ -78,7 +81,7 @@ public function testAcos() $this->_assertFirstQuery('ACOS'); $this->_assertSecondQuery('ACOS'); - if (\Doctrine\ORM\Version::compare('2.4.0') <= 0) { + if (Version::compare('2.4.0') <= 0) { $dql = "SELECT ACOS(SIN(RADIANS(p.latitude)) + SIN(RADIANS(p.longitude))) * 1 FROM {$this->entity} p"; } else { $dql = "SELECT (ACOS(SIN(RADIANS(p.latitude)) + SIN(RADIANS(p.longitude))) * 1) FROM {$this->entity} p"; @@ -154,7 +157,7 @@ public function testCosineLaw() . '* COS(RADIANS(p.longitude) - ' . deg2rad($lng) . ')' . ') * ' . $radiusOfEarth; - if (\Doctrine\ORM\Version::compare('2.4.0') <= 0) { + if (Version::compare('2.4.0') <= 0) { $dql = 'SELECT ' . $cosineLaw . " FROM {$this->entity} p"; } else { $dql = 'SELECT (' . $cosineLaw . ") FROM {$this->entity} p"; diff --git a/tests/Query/Mysql/UtcTimestampTest.php b/tests/Query/Mysql/UtcTimestampTest.php index 2aa62b7b..b2e6da97 100644 --- a/tests/Query/Mysql/UtcTimestampTest.php +++ b/tests/Query/Mysql/UtcTimestampTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Mysql; -class UtcTimestampTest extends \DoctrineExtensions\Tests\Query\MysqlTestCase +use DoctrineExtensions\Tests\Query\MysqlTestCase; + +class UtcTimestampTest extends MysqlTestCase { public function testUtcTimestamp() { diff --git a/tests/Query/Oracle/DayTest.php b/tests/Query/Oracle/DayTest.php index 58de1578..8cd4cfe9 100644 --- a/tests/Query/Oracle/DayTest.php +++ b/tests/Query/Oracle/DayTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Oracle; -class DayTest extends \DoctrineExtensions\Tests\Query\OracleTestCase +use DoctrineExtensions\Tests\Query\OracleTestCase; + +class DayTest extends OracleTestCase { public function testDay() { diff --git a/tests/Query/Oracle/HourTest.php b/tests/Query/Oracle/HourTest.php index c47100f2..26c3a645 100644 --- a/tests/Query/Oracle/HourTest.php +++ b/tests/Query/Oracle/HourTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Oracle; -class HourTest extends \DoctrineExtensions\Tests\Query\OracleTestCase +use DoctrineExtensions\Tests\Query\OracleTestCase; + +class HourTest extends OracleTestCase { public function testHour() { diff --git a/tests/Query/Oracle/MinuteTest.php b/tests/Query/Oracle/MinuteTest.php index 1f801bdc..e89998de 100644 --- a/tests/Query/Oracle/MinuteTest.php +++ b/tests/Query/Oracle/MinuteTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Oracle; -class MinuteTest extends \DoctrineExtensions\Tests\Query\OracleTestCase +use DoctrineExtensions\Tests\Query\OracleTestCase; + +class MinuteTest extends OracleTestCase { public function testMinute() { diff --git a/tests/Query/Oracle/MonthTest.php b/tests/Query/Oracle/MonthTest.php index 2794f972..8ce654c5 100644 --- a/tests/Query/Oracle/MonthTest.php +++ b/tests/Query/Oracle/MonthTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Oracle; -class MonthTest extends \DoctrineExtensions\Tests\Query\OracleTestCase +use DoctrineExtensions\Tests\Query\OracleTestCase; + +class MonthTest extends OracleTestCase { public function testMonth() { diff --git a/tests/Query/Oracle/SecondTest.php b/tests/Query/Oracle/SecondTest.php index aa4ab33a..62bca5f2 100644 --- a/tests/Query/Oracle/SecondTest.php +++ b/tests/Query/Oracle/SecondTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Oracle; -class SecondTest extends \DoctrineExtensions\Tests\Query\OracleTestCase +use DoctrineExtensions\Tests\Query\OracleTestCase; + +class SecondTest extends OracleTestCase { public function testSecond() { diff --git a/tests/Query/Oracle/YearTest.php b/tests/Query/Oracle/YearTest.php index 6f98e303..5bc289ad 100644 --- a/tests/Query/Oracle/YearTest.php +++ b/tests/Query/Oracle/YearTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Oracle; -class YearTest extends \DoctrineExtensions\Tests\Query\OracleTestCase +use DoctrineExtensions\Tests\Query\OracleTestCase; + +class YearTest extends OracleTestCase { public function testYear() { diff --git a/tests/Query/Postgresql/AtTimeZoneTest.php b/tests/Query/Postgresql/AtTimeZoneTest.php index ac73e27e..2f12ac77 100644 --- a/tests/Query/Postgresql/AtTimeZoneTest.php +++ b/tests/Query/Postgresql/AtTimeZoneTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class AtTimeZoneTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class AtTimeZoneTest extends PostgresqlTestCase { public function testAtTimeZone() { diff --git a/tests/Query/Postgresql/CountFilterTest.php b/tests/Query/Postgresql/CountFilterTest.php index c28d5ce8..6373fd7d 100644 --- a/tests/Query/Postgresql/CountFilterTest.php +++ b/tests/Query/Postgresql/CountFilterTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class CountFilterTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class CountFilterTest extends PostgresqlTestCase { public function testCountFilter() { diff --git a/tests/Query/Postgresql/DateTest.php b/tests/Query/Postgresql/DateTest.php index 6597ab7b..26d012c9 100644 --- a/tests/Query/Postgresql/DateTest.php +++ b/tests/Query/Postgresql/DateTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class DateTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class DateTest extends PostgresqlTestCase { public function testStrToDate() { diff --git a/tests/Query/Postgresql/DayTest.php b/tests/Query/Postgresql/DayTest.php index 68a20d09..dbf58ced 100644 --- a/tests/Query/Postgresql/DayTest.php +++ b/tests/Query/Postgresql/DayTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class DayTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class DayTest extends PostgresqlTestCase { public function testDay() { diff --git a/tests/Query/Postgresql/GreatestTest.php b/tests/Query/Postgresql/GreatestTest.php index 37c5399a..422f58c0 100644 --- a/tests/Query/Postgresql/GreatestTest.php +++ b/tests/Query/Postgresql/GreatestTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class GreatestTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class GreatestTest extends PostgresqlTestCase { public function testGreatest() { diff --git a/tests/Query/Postgresql/HourTest.php b/tests/Query/Postgresql/HourTest.php index ca6832e0..66fd1d7f 100644 --- a/tests/Query/Postgresql/HourTest.php +++ b/tests/Query/Postgresql/HourTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class HourTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class HourTest extends PostgresqlTestCase { public function testHour() { diff --git a/tests/Query/Postgresql/LeastTest.php b/tests/Query/Postgresql/LeastTest.php index 9ac81e2d..9783383f 100644 --- a/tests/Query/Postgresql/LeastTest.php +++ b/tests/Query/Postgresql/LeastTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class LeastTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class LeastTest extends PostgresqlTestCase { public function testLeast() { diff --git a/tests/Query/Postgresql/MinuteTest.php b/tests/Query/Postgresql/MinuteTest.php index 047d0ed0..9b468317 100644 --- a/tests/Query/Postgresql/MinuteTest.php +++ b/tests/Query/Postgresql/MinuteTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class MinuteTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class MinuteTest extends PostgresqlTestCase { public function testMinute() { diff --git a/tests/Query/Postgresql/MonthTest.php b/tests/Query/Postgresql/MonthTest.php index 8d50813c..218ef829 100644 --- a/tests/Query/Postgresql/MonthTest.php +++ b/tests/Query/Postgresql/MonthTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class MonthTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class MonthTest extends PostgresqlTestCase { public function testMonth() { diff --git a/tests/Query/Postgresql/RegexpReplaceTest.php b/tests/Query/Postgresql/RegexpReplaceTest.php index 3aa464cc..c1df16ce 100644 --- a/tests/Query/Postgresql/RegexpReplaceTest.php +++ b/tests/Query/Postgresql/RegexpReplaceTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class RegexpReplaceTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class RegexpReplaceTest extends PostgresqlTestCase { public function testRegexpReplace() { diff --git a/tests/Query/Postgresql/SecondTest.php b/tests/Query/Postgresql/SecondTest.php index 9fc9dfc7..6a12a8a5 100644 --- a/tests/Query/Postgresql/SecondTest.php +++ b/tests/Query/Postgresql/SecondTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class SecondTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class SecondTest extends PostgresqlTestCase { public function testSecond() { diff --git a/tests/Query/Postgresql/StringTest.php b/tests/Query/Postgresql/StringTest.php index 9b45a883..bb21d7fd 100644 --- a/tests/Query/Postgresql/StringTest.php +++ b/tests/Query/Postgresql/StringTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class StringTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class StringTest extends PostgresqlTestCase { public function testFormatDate() { diff --git a/tests/Query/Postgresql/YearTest.php b/tests/Query/Postgresql/YearTest.php index 1bdad4bc..019da6ae 100644 --- a/tests/Query/Postgresql/YearTest.php +++ b/tests/Query/Postgresql/YearTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Postgresql; -class YearTest extends \DoctrineExtensions\Tests\Query\PostgresqlTestCase +use DoctrineExtensions\Tests\Query\PostgresqlTestCase; + +class YearTest extends PostgresqlTestCase { public function testYear() { diff --git a/tests/Query/Sqlite/DayTest.php b/tests/Query/Sqlite/DayTest.php index 074e48b7..c837e64b 100644 --- a/tests/Query/Sqlite/DayTest.php +++ b/tests/Query/Sqlite/DayTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Sqlite; -class DayTest extends \DoctrineExtensions\Tests\Query\SqliteTestCase +use DoctrineExtensions\Tests\Query\SqliteTestCase; + +class DayTest extends SqliteTestCase { public function testDay() { diff --git a/tests/Query/Sqlite/HourTest.php b/tests/Query/Sqlite/HourTest.php index ae472db8..20c00a39 100644 --- a/tests/Query/Sqlite/HourTest.php +++ b/tests/Query/Sqlite/HourTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Sqlite; -class HourTest extends \DoctrineExtensions\Tests\Query\SqliteTestCase +use DoctrineExtensions\Tests\Query\SqliteTestCase; + +class HourTest extends SqliteTestCase { public function testHour() { diff --git a/tests/Query/Sqlite/MinuteTest.php b/tests/Query/Sqlite/MinuteTest.php index 1fc20c9b..1c8f40db 100644 --- a/tests/Query/Sqlite/MinuteTest.php +++ b/tests/Query/Sqlite/MinuteTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Sqlite; -class MinuteTest extends \DoctrineExtensions\Tests\Query\SqliteTestCase +use DoctrineExtensions\Tests\Query\SqliteTestCase; + +class MinuteTest extends SqliteTestCase { public function testMinute() { diff --git a/tests/Query/Sqlite/MonthTest.php b/tests/Query/Sqlite/MonthTest.php index c0fc591b..573aa83a 100644 --- a/tests/Query/Sqlite/MonthTest.php +++ b/tests/Query/Sqlite/MonthTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Sqlite; -class MonthTest extends \DoctrineExtensions\Tests\Query\SqliteTestCase +use DoctrineExtensions\Tests\Query\SqliteTestCase; + +class MonthTest extends SqliteTestCase { public function testMonth() { diff --git a/tests/Query/Sqlite/SecondTest.php b/tests/Query/Sqlite/SecondTest.php index da4b389e..0bdda0c4 100644 --- a/tests/Query/Sqlite/SecondTest.php +++ b/tests/Query/Sqlite/SecondTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Sqlite; -class SecondTest extends \DoctrineExtensions\Tests\Query\SqliteTestCase +use DoctrineExtensions\Tests\Query\SqliteTestCase; + +class SecondTest extends SqliteTestCase { public function testSecond() { diff --git a/tests/Query/Sqlite/YearTest.php b/tests/Query/Sqlite/YearTest.php index 3d202dda..2238911e 100644 --- a/tests/Query/Sqlite/YearTest.php +++ b/tests/Query/Sqlite/YearTest.php @@ -4,7 +4,9 @@ namespace DoctrineExtensions\Tests\Query\Sqlite; -class YearTest extends \DoctrineExtensions\Tests\Query\SqliteTestCase +use DoctrineExtensions\Tests\Query\SqliteTestCase; + +class YearTest extends SqliteTestCase { public function testYear() { diff --git a/tests/Types/CarbonDateTest.php b/tests/Types/CarbonDateTest.php index b6ee1946..ad5af028 100755 --- a/tests/Types/CarbonDateTest.php +++ b/tests/Types/CarbonDateTest.php @@ -6,7 +6,11 @@ use Carbon\Carbon; use Carbon\CarbonImmutable; +use Doctrine\Common\Cache\ArrayCache; +use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Type; +use Doctrine\ORM\Configuration; +use Doctrine\ORM\EntityManager; use Doctrine\ORM\Tools\SchemaTool; use DoctrineExtensions\Tests\Entities\CarbonDate as Entity; use PHPUnit\Framework\TestCase; @@ -34,15 +38,15 @@ public static function setUpBeforeClass(): void public function setUp(): void { - $config = new \Doctrine\ORM\Configuration(); - $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache()); - $config->setQueryCacheImpl(new \Doctrine\Common\Cache\ArrayCache()); + $config = new Configuration(); + $config->setMetadataCacheImpl(new ArrayCache()); + $config->setQueryCacheImpl(new ArrayCache()); $config->setProxyDir(__DIR__ . '/Proxies'); $config->setProxyNamespace('DoctrineExtensions\Tests\PHPUnit\Proxies'); $config->setAutoGenerateProxyClasses(true); $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver(__DIR__ . '/../../Entities')); - $this->em = \Doctrine\ORM\EntityManager::create( + $this->em = EntityManager::create( [ 'driver' => 'pdo_sqlite', 'memory' => true, @@ -225,7 +229,7 @@ public function testImmutableTimeSetter() */ public function testTypesThatMapToAlreadyMappedDatabaseTypesRequireCommentHint($type) { - /** @var \Doctrine\DBAL\Platforms\AbstractPlatform $platform */ + /** @var AbstractPlatform $platform */ $platform = $this->getMockForAbstractClass('Doctrine\DBAL\Platforms\AbstractPlatform'); $this->assertTrue(Type::getType($type)->requiresSQLCommentHint($platform)); diff --git a/tests/Types/ZendDateTest.php b/tests/Types/ZendDateTest.php index 7a4b0aa9..3374ef74 100755 --- a/tests/Types/ZendDateTest.php +++ b/tests/Types/ZendDateTest.php @@ -4,8 +4,15 @@ namespace DoctrineExtensions\Tests\Types; +use Doctrine\Common\Cache\ArrayCache; +use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\Type; +use Doctrine\ORM\Configuration; +use Doctrine\ORM\EntityManager; use Doctrine\ORM\Tools\SchemaTool; +use DoctrineExtensions\Tests\Entities\ZendDate; use PHPUnit\Framework\TestCase; +use Zend_Date; /** * Test type that maps an SQL DATETIME/TIMESTAMP to a Zend_Date object. @@ -18,7 +25,7 @@ class ZendDateTest extends TestCase public static function setUpBeforeClass(): void { - \Doctrine\DBAL\Types\Type::addType( + Type::addType( 'ZendDate', 'DoctrineExtensions\Types\ZendDateType' ); @@ -26,15 +33,15 @@ public static function setUpBeforeClass(): void public function setUp(): void { - $config = new \Doctrine\ORM\Configuration(); - $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache()); - $config->setQueryCacheImpl(new \Doctrine\Common\Cache\ArrayCache()); + $config = new Configuration(); + $config->setMetadataCacheImpl(new ArrayCache()); + $config->setQueryCacheImpl(new ArrayCache()); $config->setProxyDir(__DIR__ . '/Proxies'); $config->setProxyNamespace('DoctrineExtensions\Tests\PHPUnit\Proxies'); $config->setAutoGenerateProxyClasses(true); $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver(__DIR__ . '/../../Entities')); - $this->em = \Doctrine\ORM\EntityManager::create( + $this->em = EntityManager::create( [ 'driver' => 'pdo_sqlite', 'memory' => true, @@ -48,7 +55,7 @@ public function setUp(): void $this->em->getClassMetadata('DoctrineExtensions\Tests\Entities\ZendDate'), ]); - $this->em->persist(new \DoctrineExtensions\Tests\Entities\ZendDate(1, new \Zend_Date([ + $this->em->persist(new ZendDate(1, new Zend_Date([ 'year' => 2012, 'month' => 11, 'day' => 10, 'hour' => 9, 'minute' => 8, 'second' => 7, ]))); @@ -61,7 +68,7 @@ public function testGetZendDate() $entity = $this->em->find('DoctrineExtensions\Tests\Entities\ZendDate', 1); $this->assertInstanceOf('Zend_Date', $entity->date); - $this->assertTrue($entity->date->equals(new \Zend_Date([ + $this->assertTrue($entity->date->equals(new Zend_Date([ 'year' => 2012, 'month' => 11, 'day' => 10, 'hour' => 9, 'minute' => 8, 'second' => 7, ]))); @@ -69,12 +76,12 @@ public function testGetZendDate() public function testSetZendDate() { - $zendDate = new \Zend_Date([ + $zendDate = new Zend_Date([ 'year' => 2012, 'month' => 11, 'day' => 10, 'hour' => 9, 'minute' => 8, 'second' => 7, ]); - $entity = new \DoctrineExtensions\Tests\Entities\ZendDate(2, $zendDate); + $entity = new ZendDate(2, $zendDate); $this->em->persist($entity); $this->em->flush(); @@ -86,9 +93,9 @@ public function testSetZendDate() public function testTypesThatMapToAlreadyMappedDatabaseTypesRequireCommentHint() { - /** @var \Doctrine\DBAL\Platforms\AbstractPlatform $platform */ + /** @var AbstractPlatform $platform */ $platform = $this->getMockForAbstractClass('Doctrine\DBAL\Platforms\AbstractPlatform'); - $this->assertTrue(\Doctrine\DBAL\Types\Type::getType('ZendDate')->requiresSQLCommentHint($platform)); + $this->assertTrue(Type::getType('ZendDate')->requiresSQLCommentHint($platform)); } } From a457b6355ecac4113bfc3a54fa8c35754ed9d7f2 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sat, 27 Jan 2024 23:48:44 +0100 Subject: [PATCH 05/43] Code Sniffer: apply rule SlevomatCodingStandard.Commenting.ForbiddenAnnotations.AnnotationForbidden --- src/Query/Mysql/AddTime.php | 3 --- src/Query/Mysql/Binary.php | 3 --- src/Query/Mysql/CharLength.php | 3 --- src/Query/Mysql/Collate.php | 1 - src/Query/Mysql/ConcatWs.php | 3 --- src/Query/Mysql/CountIf.php | 3 --- src/Query/Mysql/Crc32.php | 3 --- src/Query/Mysql/Date.php | 3 --- src/Query/Mysql/DateFormat.php | 3 --- src/Query/Mysql/DateSub.php | 3 --- src/Query/Mysql/Day.php | 4 ---- src/Query/Mysql/DayName.php | 3 --- src/Query/Mysql/Extract.php | 3 --- src/Query/Mysql/Field.php | 3 --- src/Query/Mysql/Format.php | 3 --- src/Query/Mysql/FromUnixtime.php | 3 --- src/Query/Mysql/Greatest.php | 4 ---- src/Query/Mysql/Hour.php | 3 --- src/Query/Mysql/IfElse.php | 3 --- src/Query/Mysql/IfNull.php | 3 --- src/Query/Mysql/LastDay.php | 4 ---- src/Query/Mysql/Least.php | 3 --- src/Query/Mysql/Lpad.php | 3 --- src/Query/Mysql/Md5.php | 3 --- src/Query/Mysql/Minute.php | 3 --- src/Query/Mysql/Month.php | 4 ---- src/Query/Mysql/MonthName.php | 3 --- src/Query/Mysql/NullIf.php | 3 --- src/Query/Mysql/Quarter.php | 3 --- src/Query/Mysql/Replace.php | 3 --- src/Query/Mysql/Rpad.php | 3 --- src/Query/Mysql/SecToTime.php | 1 - src/Query/Mysql/Second.php | 3 --- src/Query/Mysql/Sha1.php | 3 --- src/Query/Mysql/Sha2.php | 3 --- src/Query/Mysql/Soundex.php | 3 --- src/Query/Mysql/Std.php | 3 --- src/Query/Mysql/StdDev.php | 3 --- src/Query/Mysql/Time.php | 4 ---- src/Query/Mysql/TimeToSec.php | 1 - src/Query/Mysql/TimestampAdd.php | 3 --- src/Query/Mysql/TimestampDiff.php | 3 --- src/Query/Mysql/Truncate.php | 3 --- src/Query/Mysql/UnixTimestamp.php | 4 ---- src/Query/Mysql/UtcTimestamp.php | 3 --- src/Query/Mysql/Week.php | 5 ----- src/Query/Mysql/WeekDay.php | 3 --- src/Query/Mysql/Year.php | 3 --- src/Query/Mysql/YearWeek.php | 3 --- src/Query/Oracle/Ceil.php | 3 --- src/Query/Oracle/Day.php | 3 --- src/Query/Oracle/Floor.php | 3 --- src/Query/Oracle/Hour.php | 3 --- src/Query/Oracle/Listagg.php | 3 --- src/Query/Oracle/Minute.php | 3 --- src/Query/Oracle/Month.php | 3 --- src/Query/Oracle/Nvl.php | 3 --- src/Query/Oracle/Second.php | 3 --- src/Query/Oracle/ToChar.php | 3 --- src/Query/Oracle/ToDate.php | 3 --- src/Query/Oracle/Trunc.php | 3 --- src/Query/Oracle/Year.php | 3 --- src/Query/Postgresql/DateFormat.php | 3 --- src/Query/Postgresql/DatePart.php | 3 --- src/Query/Postgresql/Greatest.php | 5 ----- src/Query/Postgresql/Least.php | 4 ---- src/Query/Postgresql/StringAgg.php | 4 ---- src/Query/Sqlite/AbstractStrfTime.php | 3 --- src/Query/Sqlite/ConcatWs.php | 3 --- src/Query/Sqlite/Date.php | 3 --- src/Query/Sqlite/DateFormat.php | 2 -- src/Query/Sqlite/Day.php | 3 --- src/Query/Sqlite/Greatest.php | 4 ---- src/Query/Sqlite/Hour.php | 3 --- src/Query/Sqlite/IfElse.php | 3 --- src/Query/Sqlite/IfNull.php | 3 --- src/Query/Sqlite/JulianDay.php | 3 --- src/Query/Sqlite/Least.php | 3 --- src/Query/Sqlite/Minute.php | 3 --- src/Query/Sqlite/Month.php | 3 --- src/Query/Sqlite/Replace.php | 3 --- src/Query/Sqlite/Round.php | 3 --- src/Query/Sqlite/StrfTime.php | 3 --- src/Query/Sqlite/Week.php | 3 --- src/Query/Sqlite/WeekDay.php | 3 --- src/Query/Sqlite/Year.php | 3 --- src/Types/ZendDateType.php | 2 -- tests/Query/Oracle/CeilTest.php | 3 --- tests/Query/Oracle/FloorTest.php | 3 --- tests/Query/Oracle/ListaggTest.php | 3 --- tests/Query/Oracle/ToCharTest.php | 3 --- tests/Query/Oracle/TruncTest.php | 3 --- tests/Query/Sqlite/NumericFunctionsTest.php | 2 -- tests/Query/Sqlite/StringFunctionsTest.php | 1 - tests/Types/CarbonDateTest.php | 2 -- tests/Types/ZendDateTest.php | 2 -- 96 files changed, 288 deletions(-) diff --git a/src/Query/Mysql/AddTime.php b/src/Query/Mysql/AddTime.php index 6f73a81b..9abfa54f 100644 --- a/src/Query/Mysql/AddTime.php +++ b/src/Query/Mysql/AddTime.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Pascal Wacker - */ class AddTime extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Binary.php b/src/Query/Mysql/Binary.php index f93d110e..8e97f1fb 100644 --- a/src/Query/Mysql/Binary.php +++ b/src/Query/Mysql/Binary.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Sarjono Mukti Aji - */ class Binary extends FunctionNode { private $stringPrimary; diff --git a/src/Query/Mysql/CharLength.php b/src/Query/Mysql/CharLength.php index 8b1eff10..284621f7 100644 --- a/src/Query/Mysql/CharLength.php +++ b/src/Query/Mysql/CharLength.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Metod - */ class CharLength extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Collate.php b/src/Query/Mysql/Collate.php index 544014d2..87ca0afd 100644 --- a/src/Query/Mysql/Collate.php +++ b/src/Query/Mysql/Collate.php @@ -11,7 +11,6 @@ /** * @link https://dev.mysql.com/doc/refman/en/charset-collate.html - * @author Peter Tanath */ class Collate extends FunctionNode { diff --git a/src/Query/Mysql/ConcatWs.php b/src/Query/Mysql/ConcatWs.php index a11dab3d..ba12f35a 100644 --- a/src/Query/Mysql/ConcatWs.php +++ b/src/Query/Mysql/ConcatWs.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andrew Mackrodt - */ class ConcatWs extends FunctionNode { private $values = []; diff --git a/src/Query/Mysql/CountIf.php b/src/Query/Mysql/CountIf.php index 227831e3..75897d29 100644 --- a/src/Query/Mysql/CountIf.php +++ b/src/Query/Mysql/CountIf.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andrew Mackrodt - */ class CountIf extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Crc32.php b/src/Query/Mysql/Crc32.php index ce946b60..58e5bd4a 100644 --- a/src/Query/Mysql/Crc32.php +++ b/src/Query/Mysql/Crc32.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Igor Timoshenko - */ class Crc32 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Date.php b/src/Query/Mysql/Date.php index a5faf10a..f2882469 100644 --- a/src/Query/Mysql/Date.php +++ b/src/Query/Mysql/Date.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Lacey - */ class Date extends FunctionNode { public $date; diff --git a/src/Query/Mysql/DateFormat.php b/src/Query/Mysql/DateFormat.php index 7ede6c29..88a03bd5 100644 --- a/src/Query/Mysql/DateFormat.php +++ b/src/Query/Mysql/DateFormat.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Lacey - */ class DateFormat extends FunctionNode { public $dateExpression = null; diff --git a/src/Query/Mysql/DateSub.php b/src/Query/Mysql/DateSub.php index 22eade02..7e517956 100644 --- a/src/Query/Mysql/DateSub.php +++ b/src/Query/Mysql/DateSub.php @@ -7,9 +7,6 @@ use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Vas N - */ class DateSub extends DateAdd { /** diff --git a/src/Query/Mysql/Day.php b/src/Query/Mysql/Day.php index 662cd810..b24b043f 100644 --- a/src/Query/Mysql/Day.php +++ b/src/Query/Mysql/Day.php @@ -9,10 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Rafael Kassner - * @author Sarjono Mukti Aji - */ class Day extends FunctionNode { public $date; diff --git a/src/Query/Mysql/DayName.php b/src/Query/Mysql/DayName.php index e4df6092..6c398dc1 100644 --- a/src/Query/Mysql/DayName.php +++ b/src/Query/Mysql/DayName.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Lacey - */ class DayName extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Extract.php b/src/Query/Mysql/Extract.php index 4a654e0d..31f0e80e 100644 --- a/src/Query/Mysql/Extract.php +++ b/src/Query/Mysql/Extract.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Ahwalian Masykur - */ class Extract extends DateAdd { public $date = null; diff --git a/src/Query/Mysql/Field.php b/src/Query/Mysql/Field.php index dc00ada0..41cfc59b 100644 --- a/src/Query/Mysql/Field.php +++ b/src/Query/Mysql/Field.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Jeremy Hicks - */ class Field extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/Format.php b/src/Query/Mysql/Format.php index 266832b0..2ff1e7ac 100644 --- a/src/Query/Mysql/Format.php +++ b/src/Query/Mysql/Format.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Wally Noveno - */ class Format extends FunctionNode { public $numberExpression = null; diff --git a/src/Query/Mysql/FromUnixtime.php b/src/Query/Mysql/FromUnixtime.php index 879447b5..2394ac4e 100644 --- a/src/Query/Mysql/FromUnixtime.php +++ b/src/Query/Mysql/FromUnixtime.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Nima S - */ class FromUnixtime extends FunctionNode { public $firstExpression = null; diff --git a/src/Query/Mysql/Greatest.php b/src/Query/Mysql/Greatest.php index f524c7f1..137f5982 100644 --- a/src/Query/Mysql/Greatest.php +++ b/src/Query/Mysql/Greatest.php @@ -9,10 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Vas N - * @author Guven Atbakan - */ class Greatest extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/Hour.php b/src/Query/Mysql/Hour.php index f2dd2381..9d78376d 100644 --- a/src/Query/Mysql/Hour.php +++ b/src/Query/Mysql/Hour.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Dawid Nowak - */ class Hour extends FunctionNode { public $date; diff --git a/src/Query/Mysql/IfElse.php b/src/Query/Mysql/IfElse.php index 61c7024c..cea8a3a8 100644 --- a/src/Query/Mysql/IfElse.php +++ b/src/Query/Mysql/IfElse.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andrew Mackrodt - */ class IfElse extends FunctionNode { private $expr = []; diff --git a/src/Query/Mysql/IfNull.php b/src/Query/Mysql/IfNull.php index 02736bec..9de0bfd9 100644 --- a/src/Query/Mysql/IfNull.php +++ b/src/Query/Mysql/IfNull.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andrew Mackrodt - */ class IfNull extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/LastDay.php b/src/Query/Mysql/LastDay.php index 80294507..528c8f99 100644 --- a/src/Query/Mysql/LastDay.php +++ b/src/Query/Mysql/LastDay.php @@ -9,10 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Rafael Kassner - * @author Sarjono Mukti Aji - */ class LastDay extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Least.php b/src/Query/Mysql/Least.php index 0f3462fd..a2af43bb 100644 --- a/src/Query/Mysql/Least.php +++ b/src/Query/Mysql/Least.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Vas N - */ class Least extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/Lpad.php b/src/Query/Mysql/Lpad.php index c7111188..a2880402 100644 --- a/src/Query/Mysql/Lpad.php +++ b/src/Query/Mysql/Lpad.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Giulia Santoiemma - */ class Lpad extends FunctionNode { public $string = null; diff --git a/src/Query/Mysql/Md5.php b/src/Query/Mysql/Md5.php index 57666f30..8dceddc3 100644 --- a/src/Query/Mysql/Md5.php +++ b/src/Query/Mysql/Md5.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andreas Gallien - */ class Md5 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Minute.php b/src/Query/Mysql/Minute.php index d2de50ef..f710d326 100644 --- a/src/Query/Mysql/Minute.php +++ b/src/Query/Mysql/Minute.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Martin Štekl - */ class Minute extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Month.php b/src/Query/Mysql/Month.php index db1b107b..3d17bdfe 100644 --- a/src/Query/Mysql/Month.php +++ b/src/Query/Mysql/Month.php @@ -9,10 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Rafael Kassner - * @author Sarjono Mukti Aji - */ class Month extends FunctionNode { public $date; diff --git a/src/Query/Mysql/MonthName.php b/src/Query/Mysql/MonthName.php index fea301f9..894f283f 100644 --- a/src/Query/Mysql/MonthName.php +++ b/src/Query/Mysql/MonthName.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Lacey - */ class MonthName extends FunctionNode { public $date; diff --git a/src/Query/Mysql/NullIf.php b/src/Query/Mysql/NullIf.php index ade013c4..d80942eb 100644 --- a/src/Query/Mysql/NullIf.php +++ b/src/Query/Mysql/NullIf.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andrew Mackrodt - */ class NullIf extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Quarter.php b/src/Query/Mysql/Quarter.php index fbca0ee0..0669a1fe 100644 --- a/src/Query/Mysql/Quarter.php +++ b/src/Query/Mysql/Quarter.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Martin Štekl - */ class Quarter extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Replace.php b/src/Query/Mysql/Replace.php index aa7be5bf..4f7de33e 100644 --- a/src/Query/Mysql/Replace.php +++ b/src/Query/Mysql/Replace.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Jarek Kostrz - */ class Replace extends FunctionNode { public $search = null; diff --git a/src/Query/Mysql/Rpad.php b/src/Query/Mysql/Rpad.php index a3b4e44c..1def0f9e 100644 --- a/src/Query/Mysql/Rpad.php +++ b/src/Query/Mysql/Rpad.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Giulia Santoiemma - */ class Rpad extends FunctionNode { public $string = null; diff --git a/src/Query/Mysql/SecToTime.php b/src/Query/Mysql/SecToTime.php index 9e4a4c8e..99c13a6d 100644 --- a/src/Query/Mysql/SecToTime.php +++ b/src/Query/Mysql/SecToTime.php @@ -12,7 +12,6 @@ /** * @example SELECT SEC_TO_TIME(2378); * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_sec-to-time - * @author Clemens Bastian */ class SecToTime extends FunctionNode { diff --git a/src/Query/Mysql/Second.php b/src/Query/Mysql/Second.php index 9f48f764..e8ad4597 100644 --- a/src/Query/Mysql/Second.php +++ b/src/Query/Mysql/Second.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Martin Štekl - */ class Second extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Sha1.php b/src/Query/Mysql/Sha1.php index 027d7f45..ef323a9d 100644 --- a/src/Query/Mysql/Sha1.php +++ b/src/Query/Mysql/Sha1.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andreas Gallien - */ class Sha1 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Sha2.php b/src/Query/Mysql/Sha2.php index 205b669f..a87f445c 100644 --- a/src/Query/Mysql/Sha2.php +++ b/src/Query/Mysql/Sha2.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andreas Gallien - */ class Sha2 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Soundex.php b/src/Query/Mysql/Soundex.php index e5b2c5cb..589927ac 100644 --- a/src/Query/Mysql/Soundex.php +++ b/src/Query/Mysql/Soundex.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Tauber - */ class Soundex extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Std.php b/src/Query/Mysql/Std.php index 66631f3e..9c539852 100644 --- a/src/Query/Mysql/Std.php +++ b/src/Query/Mysql/Std.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Toni Uebernickel - */ class Std extends FunctionNode { public $arithmeticExpression; diff --git a/src/Query/Mysql/StdDev.php b/src/Query/Mysql/StdDev.php index 66ae408f..f2dfb1f9 100644 --- a/src/Query/Mysql/StdDev.php +++ b/src/Query/Mysql/StdDev.php @@ -11,9 +11,6 @@ use function sprintf; -/** - * @author Joachim Schirrmacher - */ class StdDev extends FunctionNode { public $arithmeticExpression; diff --git a/src/Query/Mysql/Time.php b/src/Query/Mysql/Time.php index 962cffcb..fea32a63 100644 --- a/src/Query/Mysql/Time.php +++ b/src/Query/Mysql/Time.php @@ -9,10 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Lacey - * @author James Rohacik - */ class Time extends FunctionNode { public $time; diff --git a/src/Query/Mysql/TimeToSec.php b/src/Query/Mysql/TimeToSec.php index 68affb6d..f946c862 100644 --- a/src/Query/Mysql/TimeToSec.php +++ b/src/Query/Mysql/TimeToSec.php @@ -12,7 +12,6 @@ /** * @example SELECT TIME_TO_SEC('22:23:00'); * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_time-to-sec - * @author Pawel Stasicki */ class TimeToSec extends FunctionNode { diff --git a/src/Query/Mysql/TimestampAdd.php b/src/Query/Mysql/TimestampAdd.php index 10bb32a4..dc47b05c 100644 --- a/src/Query/Mysql/TimestampAdd.php +++ b/src/Query/Mysql/TimestampAdd.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Alessandro Tagliapietra - */ class TimestampAdd extends FunctionNode { public $firstDatetimeExpression = null; diff --git a/src/Query/Mysql/TimestampDiff.php b/src/Query/Mysql/TimestampDiff.php index 6da3af84..31fc9aca 100644 --- a/src/Query/Mysql/TimestampDiff.php +++ b/src/Query/Mysql/TimestampDiff.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Przemek Sobstel - */ class TimestampDiff extends FunctionNode { public $firstDatetimeExpression = null; diff --git a/src/Query/Mysql/Truncate.php b/src/Query/Mysql/Truncate.php index 64cf8717..7c90af6e 100644 --- a/src/Query/Mysql/Truncate.php +++ b/src/Query/Mysql/Truncate.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Evgeny Savich - */ class Truncate extends FunctionNode { public $numberExpression = null; diff --git a/src/Query/Mysql/UnixTimestamp.php b/src/Query/Mysql/UnixTimestamp.php index 4cede760..98f38f83 100644 --- a/src/Query/Mysql/UnixTimestamp.php +++ b/src/Query/Mysql/UnixTimestamp.php @@ -9,10 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Rafael Kassner - * @author Oleg Khussainov - */ class UnixTimestamp extends FunctionNode { public $date; diff --git a/src/Query/Mysql/UtcTimestamp.php b/src/Query/Mysql/UtcTimestamp.php index 6e671aac..5ab3806c 100644 --- a/src/Query/Mysql/UtcTimestamp.php +++ b/src/Query/Mysql/UtcTimestamp.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Marius Krämer - */ class UtcTimestamp extends FunctionNode { public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Query/Mysql/Week.php b/src/Query/Mysql/Week.php index a489cd5f..55047857 100644 --- a/src/Query/Mysql/Week.php +++ b/src/Query/Mysql/Week.php @@ -9,11 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Rafael Kassner - * @author Sarjono Mukti Aji - * @author Łukasz Nowicki - */ class Week extends FunctionNode { public $date; diff --git a/src/Query/Mysql/WeekDay.php b/src/Query/Mysql/WeekDay.php index 347f5c0c..b138fd7d 100644 --- a/src/Query/Mysql/WeekDay.php +++ b/src/Query/Mysql/WeekDay.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Pavlo Cherniavskyi - */ class WeekDay extends FunctionNode { private $date; diff --git a/src/Query/Mysql/Year.php b/src/Query/Mysql/Year.php index 9f6566b2..df037f50 100644 --- a/src/Query/Mysql/Year.php +++ b/src/Query/Mysql/Year.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Rafael Kassner - */ class Year extends FunctionNode { public $date; diff --git a/src/Query/Mysql/YearWeek.php b/src/Query/Mysql/YearWeek.php index 76b8a900..dc8a6ba6 100644 --- a/src/Query/Mysql/YearWeek.php +++ b/src/Query/Mysql/YearWeek.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Michael Kimpton - */ class YearWeek extends FunctionNode { public $date; diff --git a/src/Query/Oracle/Ceil.php b/src/Query/Oracle/Ceil.php index 49ffc235..fa0ebf36 100755 --- a/src/Query/Oracle/Ceil.php +++ b/src/Query/Oracle/Ceil.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Jefferson Vantuir - */ class Ceil extends FunctionNode { private $number; diff --git a/src/Query/Oracle/Day.php b/src/Query/Oracle/Day.php index d5ac023f..f78d4900 100644 --- a/src/Query/Oracle/Day.php +++ b/src/Query/Oracle/Day.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andréia Bohner - */ class Day extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Floor.php b/src/Query/Oracle/Floor.php index 56abc57a..54d4be1b 100755 --- a/src/Query/Oracle/Floor.php +++ b/src/Query/Oracle/Floor.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Jefferson Vantuir - */ class Floor extends FunctionNode { private $number; diff --git a/src/Query/Oracle/Hour.php b/src/Query/Oracle/Hour.php index 70123654..f36a522e 100644 --- a/src/Query/Oracle/Hour.php +++ b/src/Query/Oracle/Hour.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andréia Bohner - */ class Hour extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Listagg.php b/src/Query/Oracle/Listagg.php index e35c49ff..cc3846a6 100644 --- a/src/Query/Oracle/Listagg.php +++ b/src/Query/Oracle/Listagg.php @@ -11,9 +11,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Alexey Kalinin - */ class Listagg extends FunctionNode { /** diff --git a/src/Query/Oracle/Minute.php b/src/Query/Oracle/Minute.php index d0c39589..bd08d9cb 100644 --- a/src/Query/Oracle/Minute.php +++ b/src/Query/Oracle/Minute.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andréia Bohner - */ class Minute extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Month.php b/src/Query/Oracle/Month.php index 3eb0bc9a..0a46cc86 100644 --- a/src/Query/Oracle/Month.php +++ b/src/Query/Oracle/Month.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andréia Bohner - */ class Month extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Nvl.php b/src/Query/Oracle/Nvl.php index 68cdc4a6..3091956f 100644 --- a/src/Query/Oracle/Nvl.php +++ b/src/Query/Oracle/Nvl.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andréia Bohner - */ class Nvl extends FunctionNode { private $expr1; diff --git a/src/Query/Oracle/Second.php b/src/Query/Oracle/Second.php index 56184e8e..b3002faa 100644 --- a/src/Query/Oracle/Second.php +++ b/src/Query/Oracle/Second.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andréia Bohner - */ class Second extends FunctionNode { private $date; diff --git a/src/Query/Oracle/ToChar.php b/src/Query/Oracle/ToChar.php index 588a3490..0fc8e979 100755 --- a/src/Query/Oracle/ToChar.php +++ b/src/Query/Oracle/ToChar.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Cédric Bertolini - */ class ToChar extends FunctionNode { private $datetime; diff --git a/src/Query/Oracle/ToDate.php b/src/Query/Oracle/ToDate.php index 8cb1cc07..cd2b2fa0 100644 --- a/src/Query/Oracle/ToDate.php +++ b/src/Query/Oracle/ToDate.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Mohammad ZeinEddin - */ class ToDate extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Trunc.php b/src/Query/Oracle/Trunc.php index 8b8dbeff..87fc33c3 100755 --- a/src/Query/Oracle/Trunc.php +++ b/src/Query/Oracle/Trunc.php @@ -10,9 +10,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Mohammad ZeinEddin - */ class Trunc extends FunctionNode { /** diff --git a/src/Query/Oracle/Year.php b/src/Query/Oracle/Year.php index 15a4d746..eb47232e 100644 --- a/src/Query/Oracle/Year.php +++ b/src/Query/Oracle/Year.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andréia Bohner - */ class Year extends FunctionNode { private $date; diff --git a/src/Query/Postgresql/DateFormat.php b/src/Query/Postgresql/DateFormat.php index 2d25b4bc..8be16113 100644 --- a/src/Query/Postgresql/DateFormat.php +++ b/src/Query/Postgresql/DateFormat.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Silvio - */ class DateFormat extends FunctionNode { public $dateExpression = null; diff --git a/src/Query/Postgresql/DatePart.php b/src/Query/Postgresql/DatePart.php index 3090a066..e5dca16c 100644 --- a/src/Query/Postgresql/DatePart.php +++ b/src/Query/Postgresql/DatePart.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Geovani Roggeo - */ class DatePart extends FunctionNode { public $dateString = null; diff --git a/src/Query/Postgresql/Greatest.php b/src/Query/Postgresql/Greatest.php index 4112f72c..4b26aec1 100644 --- a/src/Query/Postgresql/Greatest.php +++ b/src/Query/Postgresql/Greatest.php @@ -9,11 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Vas N - * @author Guven Atbakan - * @author Leonardo B Motyczka - */ class Greatest extends FunctionNode { private $field = null; diff --git a/src/Query/Postgresql/Least.php b/src/Query/Postgresql/Least.php index 198af72c..63362dd8 100644 --- a/src/Query/Postgresql/Least.php +++ b/src/Query/Postgresql/Least.php @@ -9,10 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Vas N - * @author Leonardo B Motyczka - */ class Least extends FunctionNode { private $field = null; diff --git a/src/Query/Postgresql/StringAgg.php b/src/Query/Postgresql/StringAgg.php index eba26f90..576f5c8f 100644 --- a/src/Query/Postgresql/StringAgg.php +++ b/src/Query/Postgresql/StringAgg.php @@ -10,10 +10,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Roberto Júnior - * @author Vaskevich Eugeniy - */ class StringAgg extends FunctionNode { private $orderBy = null; diff --git a/src/Query/Sqlite/AbstractStrfTime.php b/src/Query/Sqlite/AbstractStrfTime.php index e25a48f8..df1cfb56 100644 --- a/src/Query/Sqlite/AbstractStrfTime.php +++ b/src/Query/Sqlite/AbstractStrfTime.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Tarjei Huse - */ abstract class AbstractStrfTime extends FunctionNode { public $date; diff --git a/src/Query/Sqlite/ConcatWs.php b/src/Query/Sqlite/ConcatWs.php index 3957eac2..9a7fb9d6 100644 --- a/src/Query/Sqlite/ConcatWs.php +++ b/src/Query/Sqlite/ConcatWs.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Bas de Ruiter - */ class ConcatWs extends FunctionNode { private $values = []; diff --git a/src/Query/Sqlite/Date.php b/src/Query/Sqlite/Date.php index 6132fcc2..8b175be9 100644 --- a/src/Query/Sqlite/Date.php +++ b/src/Query/Sqlite/Date.php @@ -4,9 +4,6 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ class Date extends AbstractStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/DateFormat.php b/src/Query/Sqlite/DateFormat.php index d6ae7f1d..3f7751a0 100644 --- a/src/Query/Sqlite/DateFormat.php +++ b/src/Query/Sqlite/DateFormat.php @@ -13,8 +13,6 @@ /** * This class fakes a DATE_FORMAT method for SQLite, so that we can use sqlite as drop-in replacement * database in our tests. - * - * @author Bas de Ruiter */ class DateFormat extends FunctionNode { diff --git a/src/Query/Sqlite/Day.php b/src/Query/Sqlite/Day.php index 95a1a140..c2388841 100644 --- a/src/Query/Sqlite/Day.php +++ b/src/Query/Sqlite/Day.php @@ -4,9 +4,6 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ class Day extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Greatest.php b/src/Query/Sqlite/Greatest.php index e43053ac..475ba437 100644 --- a/src/Query/Sqlite/Greatest.php +++ b/src/Query/Sqlite/Greatest.php @@ -9,10 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Vas N - * @author Guven Atbakan - */ class Greatest extends FunctionNode { private $field = null; diff --git a/src/Query/Sqlite/Hour.php b/src/Query/Sqlite/Hour.php index 7c002c2a..40db51b0 100644 --- a/src/Query/Sqlite/Hour.php +++ b/src/Query/Sqlite/Hour.php @@ -4,9 +4,6 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ class Hour extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/IfElse.php b/src/Query/Sqlite/IfElse.php index 748231cb..3c9f61f2 100644 --- a/src/Query/Sqlite/IfElse.php +++ b/src/Query/Sqlite/IfElse.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Mikhail Bubnov - */ class IfElse extends FunctionNode { private $expr = []; diff --git a/src/Query/Sqlite/IfNull.php b/src/Query/Sqlite/IfNull.php index 6b2db966..7f7aa606 100644 --- a/src/Query/Sqlite/IfNull.php +++ b/src/Query/Sqlite/IfNull.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author winkbrace - */ class IfNull extends FunctionNode { private $expr1; diff --git a/src/Query/Sqlite/JulianDay.php b/src/Query/Sqlite/JulianDay.php index 215619fa..2dbe6e4a 100644 --- a/src/Query/Sqlite/JulianDay.php +++ b/src/Query/Sqlite/JulianDay.php @@ -4,9 +4,6 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Einar Gangsø - */ class JulianDay extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Least.php b/src/Query/Sqlite/Least.php index b3fa8d57..ab1a6c3c 100644 --- a/src/Query/Sqlite/Least.php +++ b/src/Query/Sqlite/Least.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Vas N - */ class Least extends FunctionNode { private $field = null; diff --git a/src/Query/Sqlite/Minute.php b/src/Query/Sqlite/Minute.php index 94ca61f9..c574b154 100644 --- a/src/Query/Sqlite/Minute.php +++ b/src/Query/Sqlite/Minute.php @@ -4,9 +4,6 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ class Minute extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Month.php b/src/Query/Sqlite/Month.php index e44d81ac..819882f8 100644 --- a/src/Query/Sqlite/Month.php +++ b/src/Query/Sqlite/Month.php @@ -4,9 +4,6 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ class Month extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Replace.php b/src/Query/Sqlite/Replace.php index 302063ff..f30a2ba1 100644 --- a/src/Query/Sqlite/Replace.php +++ b/src/Query/Sqlite/Replace.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author winkbrace - */ class Replace extends FunctionNode { public $search = null; diff --git a/src/Query/Sqlite/Round.php b/src/Query/Sqlite/Round.php index b695c4cd..e19e4a96 100644 --- a/src/Query/Sqlite/Round.php +++ b/src/Query/Sqlite/Round.php @@ -9,9 +9,6 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author winkbrace - */ class Round extends FunctionNode { private $firstExpression = null; diff --git a/src/Query/Sqlite/StrfTime.php b/src/Query/Sqlite/StrfTime.php index 072531cc..5426e4e1 100644 --- a/src/Query/Sqlite/StrfTime.php +++ b/src/Query/Sqlite/StrfTime.php @@ -10,9 +10,6 @@ use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Tarjei Huse - */ class StrfTime extends FunctionNode { public $date; diff --git a/src/Query/Sqlite/Week.php b/src/Query/Sqlite/Week.php index e2403434..294dd52b 100644 --- a/src/Query/Sqlite/Week.php +++ b/src/Query/Sqlite/Week.php @@ -7,9 +7,6 @@ use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; -/** - * @author Aleksandr Klimenkov - */ class Week extends NumberFromStrfTime { /** diff --git a/src/Query/Sqlite/WeekDay.php b/src/Query/Sqlite/WeekDay.php index a3a71976..daa47e04 100644 --- a/src/Query/Sqlite/WeekDay.php +++ b/src/Query/Sqlite/WeekDay.php @@ -4,9 +4,6 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ class WeekDay extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Year.php b/src/Query/Sqlite/Year.php index d11755c6..21bbc9c8 100644 --- a/src/Query/Sqlite/Year.php +++ b/src/Query/Sqlite/Year.php @@ -4,9 +4,6 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ class Year extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Types/ZendDateType.php b/src/Types/ZendDateType.php index a9c9f1bb..b4f73171 100755 --- a/src/Types/ZendDateType.php +++ b/src/Types/ZendDateType.php @@ -16,8 +16,6 @@ /** * Type that maps an SQL DATETIME/TIMESTAMP to a Zend_Date object. - * - * @author Andreas Gallien */ class ZendDateType extends Type { diff --git a/tests/Query/Oracle/CeilTest.php b/tests/Query/Oracle/CeilTest.php index 7fc2a8ce..bc18b36c 100644 --- a/tests/Query/Oracle/CeilTest.php +++ b/tests/Query/Oracle/CeilTest.php @@ -8,9 +8,6 @@ use DoctrineExtensions\Tests\Entities\Product; use DoctrineExtensions\Tests\Query\OracleTestCase; -/** - * @author Jefferson Vantuir - */ class CeilTest extends OracleTestCase { public function testFullQuery() diff --git a/tests/Query/Oracle/FloorTest.php b/tests/Query/Oracle/FloorTest.php index 89aff10e..0a63e124 100644 --- a/tests/Query/Oracle/FloorTest.php +++ b/tests/Query/Oracle/FloorTest.php @@ -8,9 +8,6 @@ use DoctrineExtensions\Tests\Entities\Product; use DoctrineExtensions\Tests\Query\OracleTestCase; -/** - * @author Jefferson Vantuir - */ class FloorTest extends OracleTestCase { public function testFullQuery() diff --git a/tests/Query/Oracle/ListaggTest.php b/tests/Query/Oracle/ListaggTest.php index a9b22786..7b85fc7d 100644 --- a/tests/Query/Oracle/ListaggTest.php +++ b/tests/Query/Oracle/ListaggTest.php @@ -6,9 +6,6 @@ use DoctrineExtensions\Tests\Query\OracleTestCase; -/** - * @author Alexey Kalinin - */ class ListaggTest extends OracleTestCase { public function testFullQuery() diff --git a/tests/Query/Oracle/ToCharTest.php b/tests/Query/Oracle/ToCharTest.php index da1da8aa..b7941758 100644 --- a/tests/Query/Oracle/ToCharTest.php +++ b/tests/Query/Oracle/ToCharTest.php @@ -8,9 +8,6 @@ use DoctrineExtensions\Tests\Entities\Date; use DoctrineExtensions\Tests\Query\OracleTestCase; -/** - * @author Jefferson Vantuir - */ class ToCharTest extends OracleTestCase { public function testFullQuery() diff --git a/tests/Query/Oracle/TruncTest.php b/tests/Query/Oracle/TruncTest.php index 2b090893..d7e174fb 100755 --- a/tests/Query/Oracle/TruncTest.php +++ b/tests/Query/Oracle/TruncTest.php @@ -6,9 +6,6 @@ use DoctrineExtensions\Tests\Query\OracleTestCase; -/** - * @author Alexey Kalinin - */ class TruncTest extends OracleTestCase { public function testFullQuery() diff --git a/tests/Query/Sqlite/NumericFunctionsTest.php b/tests/Query/Sqlite/NumericFunctionsTest.php index 34b54aee..1960703b 100644 --- a/tests/Query/Sqlite/NumericFunctionsTest.php +++ b/tests/Query/Sqlite/NumericFunctionsTest.php @@ -8,8 +8,6 @@ /** * This class is responsible for testing the SQLite numeric functions - * - * @author winkbrace */ class NumericFunctionsTest extends SqliteTestCase { diff --git a/tests/Query/Sqlite/StringFunctionsTest.php b/tests/Query/Sqlite/StringFunctionsTest.php index eb53c0b8..4b19daf0 100644 --- a/tests/Query/Sqlite/StringFunctionsTest.php +++ b/tests/Query/Sqlite/StringFunctionsTest.php @@ -8,7 +8,6 @@ /** * This class is responsible for testing the Sqlite string functions - * @author winkbrace */ class StringFunctionsTest extends SqliteTestCase { diff --git a/tests/Types/CarbonDateTest.php b/tests/Types/CarbonDateTest.php index ad5af028..a71abb73 100755 --- a/tests/Types/CarbonDateTest.php +++ b/tests/Types/CarbonDateTest.php @@ -17,8 +17,6 @@ /** * Test type that maps an SQL DATETIME/TIMESTAMP to a Carbon/Carbon object. - * - * @author Steve Lacey */ class CarbonDateTest extends TestCase { diff --git a/tests/Types/ZendDateTest.php b/tests/Types/ZendDateTest.php index 3374ef74..831a479e 100755 --- a/tests/Types/ZendDateTest.php +++ b/tests/Types/ZendDateTest.php @@ -16,8 +16,6 @@ /** * Test type that maps an SQL DATETIME/TIMESTAMP to a Zend_Date object. - * - * @author Andreas Gallien */ class ZendDateTest extends TestCase { From 4a320b72b197218a688c604943be35cc7e988617 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 00:08:55 +0100 Subject: [PATCH 06/43] Code Sniffer: apply rule SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFallbackGlobalName --- src/Query/Mysql/AesDecrypt.php | 2 ++ src/Query/Mysql/AesEncrypt.php | 2 ++ src/Query/Mysql/AnyValue.php | 2 ++ src/Query/Mysql/Cast.php | 4 ++++ src/Query/Mysql/Collate.php | 2 ++ src/Query/Mysql/ConcatWs.php | 5 +++++ src/Query/Mysql/ConvertTz.php | 2 ++ src/Query/Mysql/CountIf.php | 3 +++ src/Query/Mysql/DateAdd.php | 4 ++++ src/Query/Mysql/DateSub.php | 4 ++++ src/Query/Mysql/Extract.php | 3 +++ src/Query/Mysql/Field.php | 2 ++ src/Query/Mysql/Greatest.php | 2 ++ src/Query/Mysql/GroupConcat.php | 4 ++++ src/Query/Mysql/IfElse.php | 2 ++ src/Query/Mysql/Instr.php | 2 ++ src/Query/Mysql/JsonContains.php | 2 ++ src/Query/Mysql/JsonDepth.php | 2 ++ src/Query/Mysql/JsonLength.php | 2 ++ src/Query/Mysql/Least.php | 2 ++ src/Query/Mysql/MatchAgainst.php | 4 ++++ src/Query/Mysql/NullIf.php | 2 ++ src/Query/Mysql/Over.php | 3 +++ src/Query/Mysql/Std.php | 2 ++ src/Query/Mysql/SubstringIndex.php | 2 ++ src/Query/Mysql/TimeDiff.php | 2 ++ src/Query/Mysql/TimestampAdd.php | 2 ++ src/Query/Mysql/TimestampDiff.php | 2 ++ src/Query/Mysql/UnixTimestamp.php | 2 ++ src/Query/Mysql/Variance.php | 2 ++ src/Query/Mysql/YearMonth.php | 2 ++ src/Query/MysqlWalker.php | 2 ++ src/Query/Oracle/Ceil.php | 2 ++ src/Query/Oracle/Day.php | 2 ++ src/Query/Oracle/Floor.php | 2 ++ src/Query/Oracle/Hour.php | 2 ++ src/Query/Oracle/Listagg.php | 4 ++++ src/Query/Oracle/Minute.php | 2 ++ src/Query/Oracle/Month.php | 2 ++ src/Query/Oracle/Nvl.php | 2 ++ src/Query/Oracle/Second.php | 2 ++ src/Query/Oracle/ToChar.php | 2 ++ src/Query/Oracle/ToDate.php | 2 ++ src/Query/Oracle/Trunc.php | 2 ++ src/Query/Oracle/Year.php | 2 ++ src/Query/Postgresql/AtTimeZoneFunction.php | 2 ++ src/Query/Postgresql/CountFilterFunction.php | 2 ++ src/Query/Postgresql/DateTrunc.php | 2 ++ src/Query/Postgresql/Day.php | 2 ++ src/Query/Postgresql/ExtractFunction.php | 2 ++ src/Query/Postgresql/Greatest.php | 2 ++ src/Query/Postgresql/Hour.php | 2 ++ src/Query/Postgresql/Least.php | 2 ++ src/Query/Postgresql/Minute.php | 2 ++ src/Query/Postgresql/Month.php | 2 ++ src/Query/Postgresql/Second.php | 2 ++ src/Query/Postgresql/StringAgg.php | 4 +++- src/Query/Postgresql/Year.php | 2 ++ src/Query/SortableNullsWalker.php | 5 +++++ src/Query/Sqlite/ConcatWs.php | 5 +++++ src/Query/Sqlite/DateFormat.php | 2 ++ src/Query/Sqlite/Greatest.php | 2 ++ src/Query/Sqlite/IfElse.php | 2 ++ src/Query/Sqlite/Least.php | 2 ++ src/Types/PolygonType.php | 3 +++ src/Types/ZendDateType.php | 2 ++ tests/Query/ConfigLoader.php | 5 +++++ tests/Query/Mysql/DateTest.php | 2 ++ tests/Query/Mysql/TrigTest.php | 2 ++ tests/Query/Postgresql/AtTimeZoneTest.php | 2 ++ tests/Query/Postgresql/DateTest.php | 2 ++ tests/Query/Sqlite/StrfTimeTest.php | 2 ++ tests/Query/SqliteTestCase.php | 2 ++ tests/Types/CarbonDateTest.php | 2 ++ tests/Types/ZendDateTest.php | 2 ++ 75 files changed, 179 insertions(+), 1 deletion(-) diff --git a/src/Query/Mysql/AesDecrypt.php b/src/Query/Mysql/AesDecrypt.php index de789992..3b15ba54 100644 --- a/src/Query/Mysql/AesDecrypt.php +++ b/src/Query/Mysql/AesDecrypt.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class AesDecrypt extends FunctionNode { public $field = ''; diff --git a/src/Query/Mysql/AesEncrypt.php b/src/Query/Mysql/AesEncrypt.php index 7e9d3fe4..955477b9 100644 --- a/src/Query/Mysql/AesEncrypt.php +++ b/src/Query/Mysql/AesEncrypt.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class AesEncrypt extends FunctionNode { public $field = ''; diff --git a/src/Query/Mysql/AnyValue.php b/src/Query/Mysql/AnyValue.php index e13a0d2f..bef7e779 100644 --- a/src/Query/Mysql/AnyValue.php +++ b/src/Query/Mysql/AnyValue.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class AnyValue extends FunctionNode { public $value; diff --git a/src/Query/Mysql/Cast.php b/src/Query/Mysql/Cast.php index 5d8292c1..71ecdc9a 100644 --- a/src/Query/Mysql/Cast.php +++ b/src/Query/Mysql/Cast.php @@ -12,6 +12,10 @@ use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; +use function assert; +use function implode; +use function sprintf; + /** * "CAST" "(" "$fieldIdentifierExpression" "AS" "$castingTypeExpression" ")" * diff --git a/src/Query/Mysql/Collate.php b/src/Query/Mysql/Collate.php index 87ca0afd..de5e2a5a 100644 --- a/src/Query/Mysql/Collate.php +++ b/src/Query/Mysql/Collate.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + /** * @link https://dev.mysql.com/doc/refman/en/charset-collate.html */ diff --git a/src/Query/Mysql/ConcatWs.php b/src/Query/Mysql/ConcatWs.php index ba12f35a..06071a41 100644 --- a/src/Query/Mysql/ConcatWs.php +++ b/src/Query/Mysql/ConcatWs.php @@ -9,6 +9,11 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; +use function implode; +use function sprintf; +use function strtolower; + class ConcatWs extends FunctionNode { private $values = []; diff --git a/src/Query/Mysql/ConvertTz.php b/src/Query/Mysql/ConvertTz.php index 967485ef..01d24022 100644 --- a/src/Query/Mysql/ConvertTz.php +++ b/src/Query/Mysql/ConvertTz.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + /** * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_convert-tz */ diff --git a/src/Query/Mysql/CountIf.php b/src/Query/Mysql/CountIf.php index 75897d29..20d98be9 100644 --- a/src/Query/Mysql/CountIf.php +++ b/src/Query/Mysql/CountIf.php @@ -9,6 +9,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; +use function strtolower; + class CountIf extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/DateAdd.php b/src/Query/Mysql/DateAdd.php index e9da642c..01581f80 100644 --- a/src/Query/Mysql/DateAdd.php +++ b/src/Query/Mysql/DateAdd.php @@ -10,6 +10,10 @@ use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; +use function in_array; +use function is_string; +use function strtoupper; + class DateAdd extends FunctionNode { public $firstDateExpression = null; diff --git a/src/Query/Mysql/DateSub.php b/src/Query/Mysql/DateSub.php index 7e517956..e6c87447 100644 --- a/src/Query/Mysql/DateSub.php +++ b/src/Query/Mysql/DateSub.php @@ -7,6 +7,10 @@ use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; +use function in_array; +use function is_string; +use function strtoupper; + class DateSub extends DateAdd { /** diff --git a/src/Query/Mysql/Extract.php b/src/Query/Mysql/Extract.php index 31f0e80e..471d4528 100644 --- a/src/Query/Mysql/Extract.php +++ b/src/Query/Mysql/Extract.php @@ -9,6 +9,9 @@ use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; +use function in_array; +use function strtoupper; + class Extract extends DateAdd { public $date = null; diff --git a/src/Query/Mysql/Field.php b/src/Query/Mysql/Field.php index 41cfc59b..c382fb2f 100644 --- a/src/Query/Mysql/Field.php +++ b/src/Query/Mysql/Field.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; + class Field extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/Greatest.php b/src/Query/Mysql/Greatest.php index 137f5982..c6533d40 100644 --- a/src/Query/Mysql/Greatest.php +++ b/src/Query/Mysql/Greatest.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; + class Greatest extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/GroupConcat.php b/src/Query/Mysql/GroupConcat.php index 32022d86..73786d3d 100644 --- a/src/Query/Mysql/GroupConcat.php +++ b/src/Query/Mysql/GroupConcat.php @@ -9,6 +9,10 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function implode; +use function sprintf; +use function strtolower; + class GroupConcat extends FunctionNode { public $isDistinct = false; diff --git a/src/Query/Mysql/IfElse.php b/src/Query/Mysql/IfElse.php index cea8a3a8..ee1ac636 100644 --- a/src/Query/Mysql/IfElse.php +++ b/src/Query/Mysql/IfElse.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class IfElse extends FunctionNode { private $expr = []; diff --git a/src/Query/Mysql/Instr.php b/src/Query/Mysql/Instr.php index 9aacf9ac..2f5a03e6 100644 --- a/src/Query/Mysql/Instr.php +++ b/src/Query/Mysql/Instr.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Instr extends FunctionNode { public $originalString = null; diff --git a/src/Query/Mysql/JsonContains.php b/src/Query/Mysql/JsonContains.php index 9c6e0a2a..bab6c1d1 100644 --- a/src/Query/Mysql/JsonContains.php +++ b/src/Query/Mysql/JsonContains.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class JsonContains extends FunctionNode { protected $target; diff --git a/src/Query/Mysql/JsonDepth.php b/src/Query/Mysql/JsonDepth.php index ff95c346..878c02b2 100644 --- a/src/Query/Mysql/JsonDepth.php +++ b/src/Query/Mysql/JsonDepth.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class JsonDepth extends FunctionNode { protected $target; diff --git a/src/Query/Mysql/JsonLength.php b/src/Query/Mysql/JsonLength.php index db1fd856..0153ad83 100644 --- a/src/Query/Mysql/JsonLength.php +++ b/src/Query/Mysql/JsonLength.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class JsonLength extends FunctionNode { protected $target; diff --git a/src/Query/Mysql/Least.php b/src/Query/Mysql/Least.php index a2af43bb..a302290a 100644 --- a/src/Query/Mysql/Least.php +++ b/src/Query/Mysql/Least.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; + class Least extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/MatchAgainst.php b/src/Query/Mysql/MatchAgainst.php index 13bf53e3..56c935fa 100644 --- a/src/Query/Mysql/MatchAgainst.php +++ b/src/Query/Mysql/MatchAgainst.php @@ -9,6 +9,10 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function implode; +use function sprintf; +use function strtolower; + class MatchAgainst extends FunctionNode { /** @var array list of \Doctrine\ORM\Query\AST\PathExpression */ diff --git a/src/Query/Mysql/NullIf.php b/src/Query/Mysql/NullIf.php index d80942eb..9c449d2b 100644 --- a/src/Query/Mysql/NullIf.php +++ b/src/Query/Mysql/NullIf.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class NullIf extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Over.php b/src/Query/Mysql/Over.php index f5b2d21e..c817fde5 100755 --- a/src/Query/Mysql/Over.php +++ b/src/Query/Mysql/Over.php @@ -11,6 +11,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; +use function trim; + class Over extends FunctionNode { /** @var ArithmeticExpression */ diff --git a/src/Query/Mysql/Std.php b/src/Query/Mysql/Std.php index 9c539852..6e140b85 100644 --- a/src/Query/Mysql/Std.php +++ b/src/Query/Mysql/Std.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Std extends FunctionNode { public $arithmeticExpression; diff --git a/src/Query/Mysql/SubstringIndex.php b/src/Query/Mysql/SubstringIndex.php index 32df6171..8b3e7414 100644 --- a/src/Query/Mysql/SubstringIndex.php +++ b/src/Query/Mysql/SubstringIndex.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class SubstringIndex extends FunctionNode { public $string = null; diff --git a/src/Query/Mysql/TimeDiff.php b/src/Query/Mysql/TimeDiff.php index ba407fc5..b7448e77 100644 --- a/src/Query/Mysql/TimeDiff.php +++ b/src/Query/Mysql/TimeDiff.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class TimeDiff extends FunctionNode { public $firstDateExpression = null; diff --git a/src/Query/Mysql/TimestampAdd.php b/src/Query/Mysql/TimestampAdd.php index dc47b05c..9e952cd4 100644 --- a/src/Query/Mysql/TimestampAdd.php +++ b/src/Query/Mysql/TimestampAdd.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class TimestampAdd extends FunctionNode { public $firstDatetimeExpression = null; diff --git a/src/Query/Mysql/TimestampDiff.php b/src/Query/Mysql/TimestampDiff.php index 31fc9aca..44ed0280 100644 --- a/src/Query/Mysql/TimestampDiff.php +++ b/src/Query/Mysql/TimestampDiff.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class TimestampDiff extends FunctionNode { public $firstDatetimeExpression = null; diff --git a/src/Query/Mysql/UnixTimestamp.php b/src/Query/Mysql/UnixTimestamp.php index 98f38f83..3a1becd1 100644 --- a/src/Query/Mysql/UnixTimestamp.php +++ b/src/Query/Mysql/UnixTimestamp.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class UnixTimestamp extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Variance.php b/src/Query/Mysql/Variance.php index 6de89953..811afc1e 100644 --- a/src/Query/Mysql/Variance.php +++ b/src/Query/Mysql/Variance.php @@ -10,6 +10,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Variance extends FunctionNode { /** @var SimpleArithmeticExpression */ diff --git a/src/Query/Mysql/YearMonth.php b/src/Query/Mysql/YearMonth.php index 426a15fe..b3f6246f 100644 --- a/src/Query/Mysql/YearMonth.php +++ b/src/Query/Mysql/YearMonth.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class YearMonth extends FunctionNode { public $date; diff --git a/src/Query/MysqlWalker.php b/src/Query/MysqlWalker.php index 0214d918..6ec15aaa 100644 --- a/src/Query/MysqlWalker.php +++ b/src/Query/MysqlWalker.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Query\SqlWalker; +use function str_replace; + class MysqlWalker extends SqlWalker { /** diff --git a/src/Query/Oracle/Ceil.php b/src/Query/Oracle/Ceil.php index fa0ebf36..4f51c632 100755 --- a/src/Query/Oracle/Ceil.php +++ b/src/Query/Oracle/Ceil.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Ceil extends FunctionNode { private $number; diff --git a/src/Query/Oracle/Day.php b/src/Query/Oracle/Day.php index f78d4900..b566f931 100644 --- a/src/Query/Oracle/Day.php +++ b/src/Query/Oracle/Day.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Day extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Floor.php b/src/Query/Oracle/Floor.php index 54d4be1b..5342f134 100755 --- a/src/Query/Oracle/Floor.php +++ b/src/Query/Oracle/Floor.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Floor extends FunctionNode { private $number; diff --git a/src/Query/Oracle/Hour.php b/src/Query/Oracle/Hour.php index f36a522e..93ab7892 100644 --- a/src/Query/Oracle/Hour.php +++ b/src/Query/Oracle/Hour.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Hour extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Listagg.php b/src/Query/Oracle/Listagg.php index cc3846a6..edaad355 100644 --- a/src/Query/Oracle/Listagg.php +++ b/src/Query/Oracle/Listagg.php @@ -11,6 +11,10 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; +use function implode; +use function strtolower; + class Listagg extends FunctionNode { /** diff --git a/src/Query/Oracle/Minute.php b/src/Query/Oracle/Minute.php index bd08d9cb..93214e7d 100644 --- a/src/Query/Oracle/Minute.php +++ b/src/Query/Oracle/Minute.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Minute extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Month.php b/src/Query/Oracle/Month.php index 0a46cc86..dbf029bc 100644 --- a/src/Query/Oracle/Month.php +++ b/src/Query/Oracle/Month.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Month extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Nvl.php b/src/Query/Oracle/Nvl.php index 3091956f..09eaf6df 100644 --- a/src/Query/Oracle/Nvl.php +++ b/src/Query/Oracle/Nvl.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Nvl extends FunctionNode { private $expr1; diff --git a/src/Query/Oracle/Second.php b/src/Query/Oracle/Second.php index b3002faa..7f6281f8 100644 --- a/src/Query/Oracle/Second.php +++ b/src/Query/Oracle/Second.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Second extends FunctionNode { private $date; diff --git a/src/Query/Oracle/ToChar.php b/src/Query/Oracle/ToChar.php index 0fc8e979..7d66e189 100755 --- a/src/Query/Oracle/ToChar.php +++ b/src/Query/Oracle/ToChar.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class ToChar extends FunctionNode { private $datetime; diff --git a/src/Query/Oracle/ToDate.php b/src/Query/Oracle/ToDate.php index cd2b2fa0..6b440ec7 100644 --- a/src/Query/Oracle/ToDate.php +++ b/src/Query/Oracle/ToDate.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class ToDate extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Trunc.php b/src/Query/Oracle/Trunc.php index 87fc33c3..882a8cf6 100755 --- a/src/Query/Oracle/Trunc.php +++ b/src/Query/Oracle/Trunc.php @@ -10,6 +10,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Trunc extends FunctionNode { /** diff --git a/src/Query/Oracle/Year.php b/src/Query/Oracle/Year.php index eb47232e..d67250c4 100644 --- a/src/Query/Oracle/Year.php +++ b/src/Query/Oracle/Year.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Year extends FunctionNode { private $date; diff --git a/src/Query/Postgresql/AtTimeZoneFunction.php b/src/Query/Postgresql/AtTimeZoneFunction.php index 30b3fe53..16570e6c 100644 --- a/src/Query/Postgresql/AtTimeZoneFunction.php +++ b/src/Query/Postgresql/AtTimeZoneFunction.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + /** * AtTimeZoneFunction ::= "AT_TIME_ZONE" "(" ArithmeticPrimary "," ArithmeticPrimary ")" */ diff --git a/src/Query/Postgresql/CountFilterFunction.php b/src/Query/Postgresql/CountFilterFunction.php index c14bf62f..2a3107a4 100644 --- a/src/Query/Postgresql/CountFilterFunction.php +++ b/src/Query/Postgresql/CountFilterFunction.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + /** * CountFilterFunction ::= "COUNT_FILTER" "(" ArithmeticPrimary "," ArithmeticPrimary ")" */ diff --git a/src/Query/Postgresql/DateTrunc.php b/src/Query/Postgresql/DateTrunc.php index 80885c5a..f5b48a03 100644 --- a/src/Query/Postgresql/DateTrunc.php +++ b/src/Query/Postgresql/DateTrunc.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class DateTrunc extends FunctionNode { public $fieldText = null; diff --git a/src/Query/Postgresql/Day.php b/src/Query/Postgresql/Day.php index 0cb8c54c..293f1fdd 100644 --- a/src/Query/Postgresql/Day.php +++ b/src/Query/Postgresql/Day.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Day extends FunctionNode { private $date; diff --git a/src/Query/Postgresql/ExtractFunction.php b/src/Query/Postgresql/ExtractFunction.php index a82c19f5..9bad0cd9 100644 --- a/src/Query/Postgresql/ExtractFunction.php +++ b/src/Query/Postgresql/ExtractFunction.php @@ -12,6 +12,8 @@ use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class ExtractFunction extends FunctionNode { /** @var string */ diff --git a/src/Query/Postgresql/Greatest.php b/src/Query/Postgresql/Greatest.php index 4b26aec1..3ba9cd95 100644 --- a/src/Query/Postgresql/Greatest.php +++ b/src/Query/Postgresql/Greatest.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; + class Greatest extends FunctionNode { private $field = null; diff --git a/src/Query/Postgresql/Hour.php b/src/Query/Postgresql/Hour.php index ce8cb2dd..e2d05011 100644 --- a/src/Query/Postgresql/Hour.php +++ b/src/Query/Postgresql/Hour.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Hour extends FunctionNode { private $date; diff --git a/src/Query/Postgresql/Least.php b/src/Query/Postgresql/Least.php index 63362dd8..cf048905 100644 --- a/src/Query/Postgresql/Least.php +++ b/src/Query/Postgresql/Least.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; + class Least extends FunctionNode { private $field = null; diff --git a/src/Query/Postgresql/Minute.php b/src/Query/Postgresql/Minute.php index 4f082545..6a199f77 100644 --- a/src/Query/Postgresql/Minute.php +++ b/src/Query/Postgresql/Minute.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Minute extends FunctionNode { private $date; diff --git a/src/Query/Postgresql/Month.php b/src/Query/Postgresql/Month.php index 2af1a935..aaf0633a 100644 --- a/src/Query/Postgresql/Month.php +++ b/src/Query/Postgresql/Month.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Month extends FunctionNode { private $date; diff --git a/src/Query/Postgresql/Second.php b/src/Query/Postgresql/Second.php index 8e01b03f..602348a5 100644 --- a/src/Query/Postgresql/Second.php +++ b/src/Query/Postgresql/Second.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Second extends FunctionNode { private $date; diff --git a/src/Query/Postgresql/StringAgg.php b/src/Query/Postgresql/StringAgg.php index 576f5c8f..0b859bb3 100644 --- a/src/Query/Postgresql/StringAgg.php +++ b/src/Query/Postgresql/StringAgg.php @@ -10,6 +10,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class StringAgg extends FunctionNode { private $orderBy = null; @@ -45,7 +47,7 @@ public function parse(Parser $parser): void public function getSql(SqlWalker $sqlWalker): string { - return \sprintf( + return sprintf( 'string_agg(%s%s, %s%s)', ($this->isDistinct ? 'DISTINCT ' : ''), $sqlWalker->walkPathExpression($this->expression), diff --git a/src/Query/Postgresql/Year.php b/src/Query/Postgresql/Year.php index e6dad21b..f9e8e5ce 100644 --- a/src/Query/Postgresql/Year.php +++ b/src/Query/Postgresql/Year.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class Year extends FunctionNode { private $date; diff --git a/src/Query/SortableNullsWalker.php b/src/Query/SortableNullsWalker.php index 44779dbd..94274725 100644 --- a/src/Query/SortableNullsWalker.php +++ b/src/Query/SortableNullsWalker.php @@ -6,6 +6,11 @@ use Doctrine\ORM\Query; +use function count; +use function is_array; +use function str_replace; +use function strtoupper; + /** * The SortableNullsWalker is a TreeWalker that walks over a DQL AST and constructs * the corresponding SQL to allow ORDER BY x ASC NULLS FIRST|LAST. diff --git a/src/Query/Sqlite/ConcatWs.php b/src/Query/Sqlite/ConcatWs.php index 9a7fb9d6..27827064 100644 --- a/src/Query/Sqlite/ConcatWs.php +++ b/src/Query/Sqlite/ConcatWs.php @@ -9,6 +9,11 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; +use function implode; +use function sprintf; +use function strtolower; + class ConcatWs extends FunctionNode { private $values = []; diff --git a/src/Query/Sqlite/DateFormat.php b/src/Query/Sqlite/DateFormat.php index 3f7751a0..4de882ed 100644 --- a/src/Query/Sqlite/DateFormat.php +++ b/src/Query/Sqlite/DateFormat.php @@ -10,6 +10,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function str_replace; + /** * This class fakes a DATE_FORMAT method for SQLite, so that we can use sqlite as drop-in replacement * database in our tests. diff --git a/src/Query/Sqlite/Greatest.php b/src/Query/Sqlite/Greatest.php index 475ba437..c8785e5e 100644 --- a/src/Query/Sqlite/Greatest.php +++ b/src/Query/Sqlite/Greatest.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; + class Greatest extends FunctionNode { private $field = null; diff --git a/src/Query/Sqlite/IfElse.php b/src/Query/Sqlite/IfElse.php index 3c9f61f2..0171e570 100644 --- a/src/Query/Sqlite/IfElse.php +++ b/src/Query/Sqlite/IfElse.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function sprintf; + class IfElse extends FunctionNode { private $expr = []; diff --git a/src/Query/Sqlite/Least.php b/src/Query/Sqlite/Least.php index ab1a6c3c..a850d732 100644 --- a/src/Query/Sqlite/Least.php +++ b/src/Query/Sqlite/Least.php @@ -9,6 +9,8 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +use function count; + class Least extends FunctionNode { private $field = null; diff --git a/src/Types/PolygonType.php b/src/Types/PolygonType.php index be5854d2..24a39cd7 100644 --- a/src/Types/PolygonType.php +++ b/src/Types/PolygonType.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Type; +use function preg_match; +use function sprintf; + class PolygonType extends Type { public const FIELD = 'polygon'; diff --git a/src/Types/ZendDateType.php b/src/Types/ZendDateType.php index b4f73171..7c228b76 100755 --- a/src/Types/ZendDateType.php +++ b/src/Types/ZendDateType.php @@ -10,6 +10,8 @@ use Zend_Date; use Zend_Locale_Format; +use function class_exists; + if (!class_exists('Zend_Date')) { require_once 'Zend/Date.php'; } diff --git a/tests/Query/ConfigLoader.php b/tests/Query/ConfigLoader.php index cc75373d..0c931a56 100644 --- a/tests/Query/ConfigLoader.php +++ b/tests/Query/ConfigLoader.php @@ -7,6 +7,11 @@ use Doctrine\ORM\Configuration; use Symfony\Component\Yaml\Parser; +use function array_key_exists; +use function file_get_contents; +use function realpath; +use function strtoupper; + class ConfigLoader { const MYSQL = 'mysql'; diff --git a/tests/Query/Mysql/DateTest.php b/tests/Query/Mysql/DateTest.php index 4a438ed9..4bcd3d45 100644 --- a/tests/Query/Mysql/DateTest.php +++ b/tests/Query/Mysql/DateTest.php @@ -7,6 +7,8 @@ use Doctrine\ORM\Version; use DoctrineExtensions\Tests\Query\MysqlTestCase; +use function date; + class DateTest extends MysqlTestCase { public function testDateDiff() diff --git a/tests/Query/Mysql/TrigTest.php b/tests/Query/Mysql/TrigTest.php index dda4be01..2fd2c6ac 100644 --- a/tests/Query/Mysql/TrigTest.php +++ b/tests/Query/Mysql/TrigTest.php @@ -7,6 +7,8 @@ use Doctrine\ORM\Version; use DoctrineExtensions\Tests\Query\MysqlTestCase; +use function deg2rad; + class TrigTest extends MysqlTestCase { private $entity; diff --git a/tests/Query/Postgresql/AtTimeZoneTest.php b/tests/Query/Postgresql/AtTimeZoneTest.php index 2f12ac77..ab9e4ae0 100644 --- a/tests/Query/Postgresql/AtTimeZoneTest.php +++ b/tests/Query/Postgresql/AtTimeZoneTest.php @@ -6,6 +6,8 @@ use DoctrineExtensions\Tests\Query\PostgresqlTestCase; +use function date; + class AtTimeZoneTest extends PostgresqlTestCase { public function testAtTimeZone() diff --git a/tests/Query/Postgresql/DateTest.php b/tests/Query/Postgresql/DateTest.php index 26d012c9..4a928bd7 100644 --- a/tests/Query/Postgresql/DateTest.php +++ b/tests/Query/Postgresql/DateTest.php @@ -6,6 +6,8 @@ use DoctrineExtensions\Tests\Query\PostgresqlTestCase; +use function date; + class DateTest extends PostgresqlTestCase { public function testStrToDate() diff --git a/tests/Query/Sqlite/StrfTimeTest.php b/tests/Query/Sqlite/StrfTimeTest.php index a738cf2d..46e6f9ad 100644 --- a/tests/Query/Sqlite/StrfTimeTest.php +++ b/tests/Query/Sqlite/StrfTimeTest.php @@ -6,6 +6,8 @@ use DoctrineExtensions\Tests\Query\SqliteTestCase; +use function sprintf; + class StrfTimeTest extends SqliteTestCase { public function getFunctionFormatters() diff --git a/tests/Query/SqliteTestCase.php b/tests/Query/SqliteTestCase.php index 141d2713..90babd5e 100644 --- a/tests/Query/SqliteTestCase.php +++ b/tests/Query/SqliteTestCase.php @@ -4,6 +4,8 @@ namespace DoctrineExtensions\Tests\Query; +use function method_exists; + class SqliteTestCase extends DbTestCase { /** diff --git a/tests/Types/CarbonDateTest.php b/tests/Types/CarbonDateTest.php index a71abb73..99892a22 100755 --- a/tests/Types/CarbonDateTest.php +++ b/tests/Types/CarbonDateTest.php @@ -15,6 +15,8 @@ use DoctrineExtensions\Tests\Entities\CarbonDate as Entity; use PHPUnit\Framework\TestCase; +use function assert; + /** * Test type that maps an SQL DATETIME/TIMESTAMP to a Carbon/Carbon object. */ diff --git a/tests/Types/ZendDateTest.php b/tests/Types/ZendDateTest.php index 831a479e..7968528e 100755 --- a/tests/Types/ZendDateTest.php +++ b/tests/Types/ZendDateTest.php @@ -14,6 +14,8 @@ use PHPUnit\Framework\TestCase; use Zend_Date; +use function assert; + /** * Test type that maps an SQL DATETIME/TIMESTAMP to a Zend_Date object. */ From d53710e13e4ec3724e17e77e50fdc170d97e2323 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 00:14:34 +0100 Subject: [PATCH 07/43] Code Sniffer: apply rule SlevomatCodingStandard.ControlStructures.DisallowYodaComparison.DisallowedYodaComparison --- src/Query/Mysql/FromUnixtime.php | 4 ++-- src/Query/Mysql/Rand.php | 2 +- src/Query/Mysql/Round.php | 4 ++-- src/Query/Mysql/Week.php | 2 +- src/Query/Mysql/YearWeek.php | 2 +- src/Query/Sqlite/Round.php | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Query/Mysql/FromUnixtime.php b/src/Query/Mysql/FromUnixtime.php index 2394ac4e..1d0c0cdc 100644 --- a/src/Query/Mysql/FromUnixtime.php +++ b/src/Query/Mysql/FromUnixtime.php @@ -17,7 +17,7 @@ class FromUnixtime extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - if (null !== $this->secondExpression) { + if ($this->secondExpression !== null) { return 'FROM_UNIXTIME(' . $this->firstExpression->dispatch($sqlWalker) . ',' @@ -38,7 +38,7 @@ public function parse(Parser $parser): void $this->firstExpression = $parser->ArithmeticPrimary(); // parse second parameter if available - if (Lexer::T_COMMA === $lexer->lookahead->type) { + if ($lexer->lookahead->type === Lexer::T_COMMA) { $parser->match(Lexer::T_COMMA); $this->secondExpression = $parser->ArithmeticPrimary(); } diff --git a/src/Query/Mysql/Rand.php b/src/Query/Mysql/Rand.php index 56ede20a..df436eb3 100644 --- a/src/Query/Mysql/Rand.php +++ b/src/Query/Mysql/Rand.php @@ -32,7 +32,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); - if (Lexer::T_CLOSE_PARENTHESIS !== $lexer->lookahead->type) { + if ($lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { $this->expression = $parser->SimpleArithmeticExpression(); } diff --git a/src/Query/Mysql/Round.php b/src/Query/Mysql/Round.php index ce87eccd..853415c1 100644 --- a/src/Query/Mysql/Round.php +++ b/src/Query/Mysql/Round.php @@ -23,7 +23,7 @@ public function parse(Parser $parser): void $this->firstExpression = $parser->SimpleArithmeticExpression(); // parse second parameter if available - if (Lexer::T_COMMA === $lexer->lookahead->type) { + if ($lexer->lookahead->type === Lexer::T_COMMA) { $parser->match(Lexer::T_COMMA); $this->secondExpression = $parser->ArithmeticPrimary(); } @@ -34,7 +34,7 @@ public function parse(Parser $parser): void public function getSql(SqlWalker $sqlWalker): string { // use second parameter if parsed - if (null !== $this->secondExpression) { + if ($this->secondExpression !== null) { return 'ROUND(' . $this->firstExpression->dispatch($sqlWalker) . ', ' diff --git a/src/Query/Mysql/Week.php b/src/Query/Mysql/Week.php index 55047857..c08c90b1 100644 --- a/src/Query/Mysql/Week.php +++ b/src/Query/Mysql/Week.php @@ -33,7 +33,7 @@ public function parse(Parser $parser): void $this->date = $parser->ArithmeticPrimary(); - if (Lexer::T_COMMA === $parser->getLexer()->lookahead->type) { + if ($parser->getLexer()->lookahead->type === Lexer::T_COMMA) { $parser->match(Lexer::T_COMMA); $this->mode = $parser->Literal(); } diff --git a/src/Query/Mysql/YearWeek.php b/src/Query/Mysql/YearWeek.php index dc8a6ba6..e89a8451 100644 --- a/src/Query/Mysql/YearWeek.php +++ b/src/Query/Mysql/YearWeek.php @@ -33,7 +33,7 @@ public function parse(Parser $parser): void $this->date = $parser->ArithmeticPrimary(); - if (Lexer::T_COMMA === $parser->getLexer()->lookahead->type) { + if ($parser->getLexer()->lookahead->type === Lexer::T_COMMA) { $parser->match(Lexer::T_COMMA); $this->mode = $parser->Literal(); } diff --git a/src/Query/Sqlite/Round.php b/src/Query/Sqlite/Round.php index e19e4a96..106d0372 100644 --- a/src/Query/Sqlite/Round.php +++ b/src/Query/Sqlite/Round.php @@ -23,7 +23,7 @@ public function parse(Parser $parser): void $this->firstExpression = $parser->SimpleArithmeticExpression(); // parse second parameter if available - if (Lexer::T_COMMA === $lexer->lookahead->type) { + if ($lexer->lookahead->type === Lexer::T_COMMA) { $parser->match(Lexer::T_COMMA); $this->secondExpression = $parser->ArithmeticPrimary(); } @@ -34,7 +34,7 @@ public function parse(Parser $parser): void public function getSql(SqlWalker $sqlWalker): string { // use second parameter if parsed - if (null !== $this->secondExpression) { + if ($this->secondExpression !== null) { return 'ROUND(' . $this->firstExpression->dispatch($sqlWalker) . ', ' From 4c1a7a796b500337142331abb352fb03b89be177 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 00:21:10 +0100 Subject: [PATCH 08/43] Code Sniffer: apply rule PSR12.Operators.OperatorSpacing.* --- src/Query/Mysql/Binary.php | 2 +- src/Query/Mysql/Cast.php | 2 +- src/Query/Mysql/CharLength.php | 2 +- src/Query/Mysql/Extract.php | 2 +- src/Query/Mysql/GroupConcat.php | 4 ++-- src/Query/Mysql/Hour.php | 2 +- src/Query/Mysql/IfNull.php | 4 ++-- src/Query/Mysql/Inet6Aton.php | 2 +- src/Query/Mysql/Inet6Ntoa.php | 2 +- src/Query/Mysql/InetAton.php | 2 +- src/Query/Mysql/InetNtoa.php | 2 +- src/Query/Mysql/IsIpv4.php | 2 +- src/Query/Mysql/IsIpv4Compat.php | 2 +- src/Query/Mysql/IsIpv4Mapped.php | 2 +- src/Query/Mysql/IsIpv6.php | 2 +- src/Query/Mysql/Minute.php | 2 +- src/Query/Mysql/Quarter.php | 2 +- src/Query/Mysql/SecToTime.php | 2 +- src/Query/Mysql/Second.php | 2 +- src/Query/Mysql/Soundex.php | 2 +- src/Query/Mysql/TimeToSec.php | 2 +- src/Query/Postgresql/RegexpReplace.php | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Query/Mysql/Binary.php b/src/Query/Mysql/Binary.php index 8e97f1fb..2908bd2f 100644 --- a/src/Query/Mysql/Binary.php +++ b/src/Query/Mysql/Binary.php @@ -25,6 +25,6 @@ public function parse(Parser $parser): void public function getSql(SqlWalker $sqlWalker): string { - return 'BINARY('.$sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary).')'; + return 'BINARY(' . $sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary) . ')'; } } diff --git a/src/Query/Mysql/Cast.php b/src/Query/Mysql/Cast.php index 71ecdc9a..16803a54 100644 --- a/src/Query/Mysql/Cast.php +++ b/src/Query/Mysql/Cast.php @@ -63,7 +63,7 @@ public function parse(Parser $parser): void } $parser->match(Lexer::T_CLOSE_PARENTHESIS); - $type .= '('.implode(', ', $parameters).')'; + $type .= '(' . implode(', ', $parameters) . ')'; } $this->castingTypeExpression = $type; diff --git a/src/Query/Mysql/CharLength.php b/src/Query/Mysql/CharLength.php index 284621f7..d28883ae 100644 --- a/src/Query/Mysql/CharLength.php +++ b/src/Query/Mysql/CharLength.php @@ -15,7 +15,7 @@ class CharLength extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - return 'CHAR_LENGTH('.$sqlWalker->walkArithmeticPrimary($this->expr1).')'; + return 'CHAR_LENGTH(' . $sqlWalker->walkArithmeticPrimary($this->expr1) . ')'; } public function parse(Parser $parser): void diff --git a/src/Query/Mysql/Extract.php b/src/Query/Mysql/Extract.php index 471d4528..9137d4b0 100644 --- a/src/Query/Mysql/Extract.php +++ b/src/Query/Mysql/Extract.php @@ -40,6 +40,6 @@ public function getSql(SqlWalker $sqlWalker): string throw QueryException::semanticalError('EXTRACT() does not support unit "' . $unit . '".'); } - return 'EXTRACT(' . $unit . ' FROM '. $this->date->dispatch($sqlWalker) . ')'; + return 'EXTRACT(' . $unit . ' FROM ' . $this->date->dispatch($sqlWalker) . ')'; } } diff --git a/src/Query/Mysql/GroupConcat.php b/src/Query/Mysql/GroupConcat.php index 73786d3d..f543157a 100644 --- a/src/Query/Mysql/GroupConcat.php +++ b/src/Query/Mysql/GroupConcat.php @@ -76,11 +76,11 @@ public function getSql(SqlWalker $sqlWalker): string $result .= sprintf('%s', implode(', ', $fields)); if ($this->orderBy) { - $result .= ' '.$sqlWalker->walkOrderByClause($this->orderBy); + $result .= ' ' . $sqlWalker->walkOrderByClause($this->orderBy); } if ($this->separator) { - $result .= ' SEPARATOR '.$sqlWalker->walkStringPrimary($this->separator); + $result .= ' SEPARATOR ' . $sqlWalker->walkStringPrimary($this->separator); } $result .= ')'; diff --git a/src/Query/Mysql/Hour.php b/src/Query/Mysql/Hour.php index 9d78376d..a64dcb82 100644 --- a/src/Query/Mysql/Hour.php +++ b/src/Query/Mysql/Hour.php @@ -15,7 +15,7 @@ class Hour extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - return 'HOUR('.$sqlWalker->walkArithmeticPrimary($this->date).')'; + return 'HOUR(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } public function parse(Parser $parser): void diff --git a/src/Query/Mysql/IfNull.php b/src/Query/Mysql/IfNull.php index 9de0bfd9..df498e7c 100644 --- a/src/Query/Mysql/IfNull.php +++ b/src/Query/Mysql/IfNull.php @@ -28,7 +28,7 @@ public function parse(Parser $parser): void public function getSql(SqlWalker $sqlWalker): string { return 'IFNULL(' - .$sqlWalker->walkArithmeticPrimary($this->expr1). ', ' - .$sqlWalker->walkArithmeticPrimary($this->expr2).')'; + . $sqlWalker->walkArithmeticPrimary($this->expr1) . ', ' + . $sqlWalker->walkArithmeticPrimary($this->expr2) . ')'; } } diff --git a/src/Query/Mysql/Inet6Aton.php b/src/Query/Mysql/Inet6Aton.php index c34d44c7..98ad44ff 100644 --- a/src/Query/Mysql/Inet6Aton.php +++ b/src/Query/Mysql/Inet6Aton.php @@ -41,6 +41,6 @@ public function getSql(SqlWalker $sqlWalker): string ? $this->valueExpression->dispatch($sqlWalker) : "'" . $this->valueExpression . "'" ) - .')'; + . ')'; } } diff --git a/src/Query/Mysql/Inet6Ntoa.php b/src/Query/Mysql/Inet6Ntoa.php index a742b1b5..6ff81e70 100644 --- a/src/Query/Mysql/Inet6Ntoa.php +++ b/src/Query/Mysql/Inet6Ntoa.php @@ -41,6 +41,6 @@ public function getSql(SqlWalker $sqlWalker): string ? $this->valueExpression->dispatch($sqlWalker) : "'" . $this->valueExpression . "'" ) - .')'; + . ')'; } } diff --git a/src/Query/Mysql/InetAton.php b/src/Query/Mysql/InetAton.php index d14bd4b6..55bd06f1 100644 --- a/src/Query/Mysql/InetAton.php +++ b/src/Query/Mysql/InetAton.php @@ -41,6 +41,6 @@ public function getSql(SqlWalker $sqlWalker): string ? $this->valueExpression->dispatch($sqlWalker) : "'" . $this->valueExpression . "'" ) - .')'; + . ')'; } } diff --git a/src/Query/Mysql/InetNtoa.php b/src/Query/Mysql/InetNtoa.php index 834d678c..1716a8c3 100644 --- a/src/Query/Mysql/InetNtoa.php +++ b/src/Query/Mysql/InetNtoa.php @@ -41,6 +41,6 @@ public function getSql(SqlWalker $sqlWalker): string ? $this->valueExpression->dispatch($sqlWalker) : "'" . $this->valueExpression . "'" ) - .')'; + . ')'; } } diff --git a/src/Query/Mysql/IsIpv4.php b/src/Query/Mysql/IsIpv4.php index 30287485..0325ff4a 100644 --- a/src/Query/Mysql/IsIpv4.php +++ b/src/Query/Mysql/IsIpv4.php @@ -41,6 +41,6 @@ public function getSql(SqlWalker $sqlWalker): string ? $this->valueExpression->dispatch($sqlWalker) : "'" . $this->valueExpression . "'" ) - .')'; + . ')'; } } diff --git a/src/Query/Mysql/IsIpv4Compat.php b/src/Query/Mysql/IsIpv4Compat.php index 2ab5b8e0..9aa34ba0 100644 --- a/src/Query/Mysql/IsIpv4Compat.php +++ b/src/Query/Mysql/IsIpv4Compat.php @@ -41,6 +41,6 @@ public function getSql(SqlWalker $sqlWalker): string ? $this->valueExpression->dispatch($sqlWalker) : "'" . $this->valueExpression . "'" ) - .')'; + . ')'; } } diff --git a/src/Query/Mysql/IsIpv4Mapped.php b/src/Query/Mysql/IsIpv4Mapped.php index ff7da943..b3b86a67 100644 --- a/src/Query/Mysql/IsIpv4Mapped.php +++ b/src/Query/Mysql/IsIpv4Mapped.php @@ -41,6 +41,6 @@ public function getSql(SqlWalker $sqlWalker): string ? $this->valueExpression->dispatch($sqlWalker) : "'" . $this->valueExpression . "'" ) - .')'; + . ')'; } } diff --git a/src/Query/Mysql/IsIpv6.php b/src/Query/Mysql/IsIpv6.php index 934bdf0d..21a3a554 100644 --- a/src/Query/Mysql/IsIpv6.php +++ b/src/Query/Mysql/IsIpv6.php @@ -41,6 +41,6 @@ public function getSql(SqlWalker $sqlWalker): string ? $this->valueExpression->dispatch($sqlWalker) : "'" . $this->valueExpression . "'" ) - .')'; + . ')'; } } diff --git a/src/Query/Mysql/Minute.php b/src/Query/Mysql/Minute.php index f710d326..973f443a 100644 --- a/src/Query/Mysql/Minute.php +++ b/src/Query/Mysql/Minute.php @@ -15,7 +15,7 @@ class Minute extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - return 'MINUTE('.$sqlWalker->walkArithmeticPrimary($this->date).')'; + return 'MINUTE(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } public function parse(Parser $parser): void diff --git a/src/Query/Mysql/Quarter.php b/src/Query/Mysql/Quarter.php index 0669a1fe..305cda43 100644 --- a/src/Query/Mysql/Quarter.php +++ b/src/Query/Mysql/Quarter.php @@ -15,7 +15,7 @@ class Quarter extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - return 'QUARTER('.$sqlWalker->walkArithmeticPrimary($this->date).')'; + return 'QUARTER(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } public function parse(Parser $parser): void diff --git a/src/Query/Mysql/SecToTime.php b/src/Query/Mysql/SecToTime.php index 99c13a6d..6fb766c5 100644 --- a/src/Query/Mysql/SecToTime.php +++ b/src/Query/Mysql/SecToTime.php @@ -19,7 +19,7 @@ class SecToTime extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - return 'SEC_TO_TIME('.$sqlWalker->walkArithmeticPrimary($this->time).')'; + return 'SEC_TO_TIME(' . $sqlWalker->walkArithmeticPrimary($this->time) . ')'; } public function parse(Parser $parser): void diff --git a/src/Query/Mysql/Second.php b/src/Query/Mysql/Second.php index e8ad4597..5bee626a 100644 --- a/src/Query/Mysql/Second.php +++ b/src/Query/Mysql/Second.php @@ -15,7 +15,7 @@ class Second extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - return 'SECOND('.$sqlWalker->walkArithmeticPrimary($this->date).')'; + return 'SECOND(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } public function parse(Parser $parser): void diff --git a/src/Query/Mysql/Soundex.php b/src/Query/Mysql/Soundex.php index 589927ac..79781e6f 100644 --- a/src/Query/Mysql/Soundex.php +++ b/src/Query/Mysql/Soundex.php @@ -15,7 +15,7 @@ class Soundex extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - return 'SOUNDEX('.$sqlWalker->walkStringPrimary($this->stringPrimary).')'; + return 'SOUNDEX(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')'; } public function parse(Parser $parser): void diff --git a/src/Query/Mysql/TimeToSec.php b/src/Query/Mysql/TimeToSec.php index f946c862..e827ceb5 100644 --- a/src/Query/Mysql/TimeToSec.php +++ b/src/Query/Mysql/TimeToSec.php @@ -19,7 +19,7 @@ class TimeToSec extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - return 'TIME_TO_SEC('.$sqlWalker->walkArithmeticPrimary($this->time).')'; + return 'TIME_TO_SEC(' . $sqlWalker->walkArithmeticPrimary($this->time) . ')'; } public function parse(Parser $parser): void diff --git a/src/Query/Postgresql/RegexpReplace.php b/src/Query/Postgresql/RegexpReplace.php index 8df2b38b..558de024 100644 --- a/src/Query/Postgresql/RegexpReplace.php +++ b/src/Query/Postgresql/RegexpReplace.php @@ -23,7 +23,7 @@ class RegexpReplace extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - return 'REGEXP_REPLACE('.$this->string->dispatch($sqlWalker).', '.$this->search->dispatch($sqlWalker).', '.$this->replace->dispatch($sqlWalker).')'; + return 'REGEXP_REPLACE(' . $this->string->dispatch($sqlWalker) . ', ' . $this->search->dispatch($sqlWalker) . ', ' . $this->replace->dispatch($sqlWalker) . ')'; } public function parse(Parser $parser): void From eaa93b5c8f3dc055bce3c65796cbc10c832aec3d Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 00:25:56 +0100 Subject: [PATCH 09/43] Code Sniffer: apply rule SlevomatCodingStandard.Commenting.RequireOneLineDocComment.MultiLineDocComment --- src/Query/Mysql/Cast.php | 6 +----- src/Query/Mysql/Collate.php | 12 +++--------- src/Query/Mysql/ConvertTz.php | 4 +--- src/Query/Mysql/DateSub.php | 6 +----- src/Query/Mysql/DayOfYear.php | 4 +--- src/Query/Mysql/Div.php | 12 +++--------- src/Query/Mysql/Inet6Aton.php | 6 +----- src/Query/Mysql/Inet6Ntoa.php | 6 +----- src/Query/Mysql/InetAton.php | 6 +----- src/Query/Mysql/InetNtoa.php | 6 +----- src/Query/Mysql/IsIpv4.php | 6 +----- src/Query/Mysql/IsIpv4Compat.php | 6 +----- src/Query/Mysql/IsIpv4Mapped.php | 6 +----- src/Query/Mysql/IsIpv6.php | 6 +----- src/Query/Mysql/Rand.php | 4 +--- src/Query/MysqlWalker.php | 4 +--- src/Query/Oracle/Listagg.php | 16 ++++------------ src/Query/Oracle/Trunc.php | 8 ++------ src/Query/Sqlite/StrfTime.php | 7 +------ tests/Query/Sqlite/StrfTimeTest.php | 6 ++---- tests/Types/CarbonDateTest.php | 6 ++---- 21 files changed, 31 insertions(+), 112 deletions(-) diff --git a/src/Query/Mysql/Cast.php b/src/Query/Mysql/Cast.php index 16803a54..dc7a2f34 100644 --- a/src/Query/Mysql/Cast.php +++ b/src/Query/Mysql/Cast.php @@ -31,11 +31,7 @@ class Cast extends FunctionNode /** @var string */ protected $castingTypeExpression; - /** - * @param Parser $parser - * - * @throws QueryException - */ + /** @throws QueryException */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/Collate.php b/src/Query/Mysql/Collate.php index de5e2a5a..e6223b0b 100644 --- a/src/Query/Mysql/Collate.php +++ b/src/Query/Mysql/Collate.php @@ -11,19 +11,13 @@ use function sprintf; -/** - * @link https://dev.mysql.com/doc/refman/en/charset-collate.html - */ +/** @link https://dev.mysql.com/doc/refman/en/charset-collate.html */ class Collate extends FunctionNode { - /** - * @var null - */ + /** @var null */ public $stringPrimary = null; - /** - * @var null - */ + /** @var null */ public $collation = null; /** diff --git a/src/Query/Mysql/ConvertTz.php b/src/Query/Mysql/ConvertTz.php index 01d24022..83597d76 100644 --- a/src/Query/Mysql/ConvertTz.php +++ b/src/Query/Mysql/ConvertTz.php @@ -11,9 +11,7 @@ use function sprintf; -/** - * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_convert-tz - */ +/** @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_convert-tz */ class ConvertTz extends FunctionNode { protected $dateExpression; diff --git a/src/Query/Mysql/DateSub.php b/src/Query/Mysql/DateSub.php index e6c87447..9f03d9a8 100644 --- a/src/Query/Mysql/DateSub.php +++ b/src/Query/Mysql/DateSub.php @@ -13,11 +13,7 @@ class DateSub extends DateAdd { - /** - * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker - * @throws QueryException - * @return string - */ + /** @throws QueryException */ public function getSql(SqlWalker $sqlWalker): string { $unit = strtoupper(is_string($this->unit) ? $this->unit : $this->unit->value); diff --git a/src/Query/Mysql/DayOfYear.php b/src/Query/Mysql/DayOfYear.php index 850cb30c..26a964cf 100644 --- a/src/Query/Mysql/DayOfYear.php +++ b/src/Query/Mysql/DayOfYear.php @@ -12,9 +12,7 @@ class DayOfYear extends FunctionNode { - /** - * @var Node - */ + /** @var Node */ public $date; /** diff --git a/src/Query/Mysql/Div.php b/src/Query/Mysql/Div.php index 4c1b0f1e..aef387e6 100644 --- a/src/Query/Mysql/Div.php +++ b/src/Query/Mysql/Div.php @@ -10,19 +10,13 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @link https://dev.mysql.com/doc/refman/en/arithmetic-functions.html#operator_div - */ +/** @link https://dev.mysql.com/doc/refman/en/arithmetic-functions.html#operator_div */ class Div extends FunctionNode { - /** - * @var Node - */ + /** @var Node */ private $dividend; - /** - * @var Node - */ + /** @var Node */ private $divisor; /** diff --git a/src/Query/Mysql/Inet6Aton.php b/src/Query/Mysql/Inet6Aton.php index 98ad44ff..7a77fb64 100644 --- a/src/Query/Mysql/Inet6Aton.php +++ b/src/Query/Mysql/Inet6Aton.php @@ -15,11 +15,7 @@ class Inet6Aton extends FunctionNode { public $valueExpression = null; - /** - * @param Parser $parser - * - * @throws QueryException - */ + /** @throws QueryException */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/Inet6Ntoa.php b/src/Query/Mysql/Inet6Ntoa.php index 6ff81e70..fdeb658c 100644 --- a/src/Query/Mysql/Inet6Ntoa.php +++ b/src/Query/Mysql/Inet6Ntoa.php @@ -15,11 +15,7 @@ class Inet6Ntoa extends FunctionNode { public $valueExpression = null; - /** - * @param Parser $parser - * - * @throws QueryException - */ + /** @throws QueryException */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/InetAton.php b/src/Query/Mysql/InetAton.php index 55bd06f1..f9ae1c08 100644 --- a/src/Query/Mysql/InetAton.php +++ b/src/Query/Mysql/InetAton.php @@ -15,11 +15,7 @@ class InetAton extends FunctionNode { public $valueExpression = null; - /** - * @param Parser $parser - * - * @throws QueryException - */ + /** @throws QueryException */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/InetNtoa.php b/src/Query/Mysql/InetNtoa.php index 1716a8c3..6781c8ea 100644 --- a/src/Query/Mysql/InetNtoa.php +++ b/src/Query/Mysql/InetNtoa.php @@ -15,11 +15,7 @@ class InetNtoa extends FunctionNode { public $valueExpression = null; - /** - * @param Parser $parser - * - * @throws QueryException - */ + /** @throws QueryException */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/IsIpv4.php b/src/Query/Mysql/IsIpv4.php index 0325ff4a..6e3d0600 100644 --- a/src/Query/Mysql/IsIpv4.php +++ b/src/Query/Mysql/IsIpv4.php @@ -15,11 +15,7 @@ class IsIpv4 extends FunctionNode { public $valueExpression = null; - /** - * @param Parser $parser - * - * @throws QueryException - */ + /** @throws QueryException */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/IsIpv4Compat.php b/src/Query/Mysql/IsIpv4Compat.php index 9aa34ba0..941dd961 100644 --- a/src/Query/Mysql/IsIpv4Compat.php +++ b/src/Query/Mysql/IsIpv4Compat.php @@ -15,11 +15,7 @@ class IsIpv4Compat extends FunctionNode { public $valueExpression = null; - /** - * @param Parser $parser - * - * @throws QueryException - */ + /** @throws QueryException */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/IsIpv4Mapped.php b/src/Query/Mysql/IsIpv4Mapped.php index b3b86a67..b0b7fbc9 100644 --- a/src/Query/Mysql/IsIpv4Mapped.php +++ b/src/Query/Mysql/IsIpv4Mapped.php @@ -15,11 +15,7 @@ class IsIpv4Mapped extends FunctionNode { public $valueExpression = null; - /** - * @param Parser $parser - * - * @throws QueryException - */ + /** @throws QueryException */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/IsIpv6.php b/src/Query/Mysql/IsIpv6.php index 21a3a554..07234a4b 100644 --- a/src/Query/Mysql/IsIpv6.php +++ b/src/Query/Mysql/IsIpv6.php @@ -15,11 +15,7 @@ class IsIpv6 extends FunctionNode { public $valueExpression = null; - /** - * @param Parser $parser - * - * @throws QueryException - */ + /** @throws QueryException */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/Rand.php b/src/Query/Mysql/Rand.php index df436eb3..6adad74e 100644 --- a/src/Query/Mysql/Rand.php +++ b/src/Query/Mysql/Rand.php @@ -12,9 +12,7 @@ class Rand extends FunctionNode { - /** - * @var SimpleArithmeticExpression - */ + /** @var SimpleArithmeticExpression */ private $expression = null; public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Query/MysqlWalker.php b/src/Query/MysqlWalker.php index 6ec15aaa..bd053112 100644 --- a/src/Query/MysqlWalker.php +++ b/src/Query/MysqlWalker.php @@ -32,9 +32,7 @@ public function walkSelectClause($selectClause) return $sql; } - /** - * @inheritdoc - */ + /** @inheritdoc */ public function walkGroupByClause($groupByClause): string { $sql = parent::walkGroupByClause($groupByClause); diff --git a/src/Query/Oracle/Listagg.php b/src/Query/Oracle/Listagg.php index edaad355..63af5ec6 100644 --- a/src/Query/Oracle/Listagg.php +++ b/src/Query/Oracle/Listagg.php @@ -17,24 +17,16 @@ class Listagg extends FunctionNode { - /** - * @var Node - */ + /** @var Node */ public $separator = null; - /** - * @var Node - */ + /** @var Node */ public $listaggField = null; - /** - * @var OrderByClause - */ + /** @var OrderByClause */ public $orderBy; - /** - * @var Node[] - */ + /** @var Node[] */ public $partitionBy = []; /** diff --git a/src/Query/Oracle/Trunc.php b/src/Query/Oracle/Trunc.php index 882a8cf6..cdc24a59 100755 --- a/src/Query/Oracle/Trunc.php +++ b/src/Query/Oracle/Trunc.php @@ -14,14 +14,10 @@ class Trunc extends FunctionNode { - /** - * @var Node - */ + /** @var Node */ private $date; - /** - * @var Node - */ + /** @var Node */ private $fmt; public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Query/Sqlite/StrfTime.php b/src/Query/Sqlite/StrfTime.php index 5426e4e1..d1a30a47 100644 --- a/src/Query/Sqlite/StrfTime.php +++ b/src/Query/Sqlite/StrfTime.php @@ -16,12 +16,7 @@ class StrfTime extends FunctionNode public $formatter; - /** - * @param SqlWalker $sqlWalker - * - * @throws QueryException - * @return string - */ + /** @throws QueryException */ public function getSql(SqlWalker $sqlWalker): string { return 'strftime(' diff --git a/tests/Query/Sqlite/StrfTimeTest.php b/tests/Query/Sqlite/StrfTimeTest.php index 46e6f9ad..409ccfc9 100644 --- a/tests/Query/Sqlite/StrfTimeTest.php +++ b/tests/Query/Sqlite/StrfTimeTest.php @@ -24,10 +24,8 @@ public function getFunctionFormatters() ]; } - /** - * @dataProvider getFunctionFormatters - */ - public function testStrfTimes($function, $formatter) + /** @dataProvider getFunctionFormatters */ + public function testStrfTimes($function, $formatter): void { $this->assertDqlProducesSql( sprintf('SELECT %s(p.created) as Year FROM DoctrineExtensions\Tests\Entities\Date p', $function), diff --git a/tests/Types/CarbonDateTest.php b/tests/Types/CarbonDateTest.php index 99892a22..f4f584c0 100755 --- a/tests/Types/CarbonDateTest.php +++ b/tests/Types/CarbonDateTest.php @@ -224,10 +224,8 @@ public function testImmutableTimeSetter() $this->assertNull($this->em->flush()); } - /** - * @dataProvider typeProvider - */ - public function testTypesThatMapToAlreadyMappedDatabaseTypesRequireCommentHint($type) + /** @dataProvider typeProvider */ + public function testTypesThatMapToAlreadyMappedDatabaseTypesRequireCommentHint($type): void { /** @var AbstractPlatform $platform */ $platform = $this->getMockForAbstractClass('Doctrine\DBAL\Platforms\AbstractPlatform'); From 7dd4ca381ab19b9d1feb4c40951e06806a748af8 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 00:29:24 +0100 Subject: [PATCH 10/43] Code Sniffer: apply rule SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation --- src/Query/Mysql/Cast.php | 5 ----- src/Query/Mysql/Collate.php | 7 ------- src/Query/Mysql/ConvertTz.php | 6 ------ src/Query/Mysql/DayOfYear.php | 6 ------ src/Query/Mysql/Div.php | 6 ------ src/Query/Mysql/Greatest.php | 7 ------- src/Query/Mysql/Inet6Aton.php | 5 ----- src/Query/Mysql/Inet6Ntoa.php | 5 ----- src/Query/Mysql/InetAton.php | 5 ----- src/Query/Mysql/InetNtoa.php | 5 ----- src/Query/Mysql/Instr.php | 7 ------- src/Query/Mysql/IsIpv4.php | 5 ----- src/Query/Mysql/IsIpv4Compat.php | 5 ----- src/Query/Mysql/IsIpv4Mapped.php | 5 ----- src/Query/Mysql/IsIpv6.php | 5 ----- src/Query/Mysql/Least.php | 7 ------- src/Query/Mysql/SubstringIndex.php | 7 ------- src/Query/Oracle/Listagg.php | 6 ------ src/Query/Postgresql/ExtractFunction.php | 13 ++----------- src/Query/Postgresql/Greatest.php | 7 ------- src/Query/Postgresql/Least.php | 7 ------- src/Query/Sqlite/DateFormat.php | 9 --------- src/Query/Sqlite/Greatest.php | 7 ------- src/Query/Sqlite/Least.php | 7 ------- 24 files changed, 2 insertions(+), 152 deletions(-) diff --git a/src/Query/Mysql/Cast.php b/src/Query/Mysql/Cast.php index dc7a2f34..03b916b3 100644 --- a/src/Query/Mysql/Cast.php +++ b/src/Query/Mysql/Cast.php @@ -67,11 +67,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return sprintf( diff --git a/src/Query/Mysql/Collate.php b/src/Query/Mysql/Collate.php index e6223b0b..8aa31b4c 100644 --- a/src/Query/Mysql/Collate.php +++ b/src/Query/Mysql/Collate.php @@ -20,9 +20,6 @@ class Collate extends FunctionNode /** @var null */ public $collation = null; - /** - * @param \Doctrine\ORM\Query\Parser $parser - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); @@ -40,10 +37,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return sprintf('%s COLLATE %s', $sqlWalker->walkStringPrimary($this->stringPrimary), $this->collation); diff --git a/src/Query/Mysql/ConvertTz.php b/src/Query/Mysql/ConvertTz.php index 83597d76..9b62e385 100644 --- a/src/Query/Mysql/ConvertTz.php +++ b/src/Query/Mysql/ConvertTz.php @@ -20,9 +20,6 @@ class ConvertTz extends FunctionNode protected $toTz; - /** - * @inheritdoc - */ public function getSql(SqlWalker $sqlWalker): string { return sprintf( @@ -33,9 +30,6 @@ public function getSql(SqlWalker $sqlWalker): string ); } - /** - * @inheritdoc - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/DayOfYear.php b/src/Query/Mysql/DayOfYear.php index 26a964cf..bfcea945 100644 --- a/src/Query/Mysql/DayOfYear.php +++ b/src/Query/Mysql/DayOfYear.php @@ -15,17 +15,11 @@ class DayOfYear extends FunctionNode /** @var Node */ public $date; - /** - * @inheritdoc - */ public function getSql(SqlWalker $sqlWalker): string { return 'DAYOFYEAR(' . $sqlWalker->walkArithmeticPrimary($this->date) . ')'; } - /** - * @inheritdoc - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/Div.php b/src/Query/Mysql/Div.php index aef387e6..67fbbda2 100644 --- a/src/Query/Mysql/Div.php +++ b/src/Query/Mysql/Div.php @@ -19,9 +19,6 @@ class Div extends FunctionNode /** @var Node */ private $divisor; - /** - * @inheritdoc - */ public function getSql(SqlWalker $sqlWalker): string { return @@ -29,9 +26,6 @@ public function getSql(SqlWalker $sqlWalker): string $sqlWalker->walkArithmeticPrimary($this->divisor); } - /** - * @inheritdoc - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/Greatest.php b/src/Query/Mysql/Greatest.php index c6533d40..c6c1fad7 100644 --- a/src/Query/Mysql/Greatest.php +++ b/src/Query/Mysql/Greatest.php @@ -17,9 +17,6 @@ class Greatest extends FunctionNode private $values = []; - /** - * @param Parser $parser - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); @@ -36,10 +33,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { $query = 'GREATEST('; diff --git a/src/Query/Mysql/Inet6Aton.php b/src/Query/Mysql/Inet6Aton.php index 7a77fb64..bb34dcbe 100644 --- a/src/Query/Mysql/Inet6Aton.php +++ b/src/Query/Mysql/Inet6Aton.php @@ -24,11 +24,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return 'INET6_ATON(' diff --git a/src/Query/Mysql/Inet6Ntoa.php b/src/Query/Mysql/Inet6Ntoa.php index fdeb658c..31bdc934 100644 --- a/src/Query/Mysql/Inet6Ntoa.php +++ b/src/Query/Mysql/Inet6Ntoa.php @@ -24,11 +24,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return 'INET6_NTOA(' diff --git a/src/Query/Mysql/InetAton.php b/src/Query/Mysql/InetAton.php index f9ae1c08..4596a66d 100644 --- a/src/Query/Mysql/InetAton.php +++ b/src/Query/Mysql/InetAton.php @@ -24,11 +24,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return 'INET_ATON(' diff --git a/src/Query/Mysql/InetNtoa.php b/src/Query/Mysql/InetNtoa.php index 6781c8ea..3bf5f183 100644 --- a/src/Query/Mysql/InetNtoa.php +++ b/src/Query/Mysql/InetNtoa.php @@ -24,11 +24,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return 'INET_NTOA(' diff --git a/src/Query/Mysql/Instr.php b/src/Query/Mysql/Instr.php index 2f5a03e6..5eb824bf 100644 --- a/src/Query/Mysql/Instr.php +++ b/src/Query/Mysql/Instr.php @@ -17,9 +17,6 @@ class Instr extends FunctionNode public $subString = null; - /** - * @param \Doctrine\ORM\Query\Parser $parser - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); @@ -30,10 +27,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return sprintf( diff --git a/src/Query/Mysql/IsIpv4.php b/src/Query/Mysql/IsIpv4.php index 6e3d0600..466fca5a 100644 --- a/src/Query/Mysql/IsIpv4.php +++ b/src/Query/Mysql/IsIpv4.php @@ -24,11 +24,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return 'IS_IPV4(' diff --git a/src/Query/Mysql/IsIpv4Compat.php b/src/Query/Mysql/IsIpv4Compat.php index 941dd961..229b0459 100644 --- a/src/Query/Mysql/IsIpv4Compat.php +++ b/src/Query/Mysql/IsIpv4Compat.php @@ -24,11 +24,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return 'IS_IPV4_COMPAT(' diff --git a/src/Query/Mysql/IsIpv4Mapped.php b/src/Query/Mysql/IsIpv4Mapped.php index b0b7fbc9..821e7b33 100644 --- a/src/Query/Mysql/IsIpv4Mapped.php +++ b/src/Query/Mysql/IsIpv4Mapped.php @@ -24,11 +24,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return 'IS_IPV4_MAPPED(' diff --git a/src/Query/Mysql/IsIpv6.php b/src/Query/Mysql/IsIpv6.php index 07234a4b..e59d8e46 100644 --- a/src/Query/Mysql/IsIpv6.php +++ b/src/Query/Mysql/IsIpv6.php @@ -24,11 +24,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return 'IS_IPV6(' diff --git a/src/Query/Mysql/Least.php b/src/Query/Mysql/Least.php index a302290a..b8e1424b 100644 --- a/src/Query/Mysql/Least.php +++ b/src/Query/Mysql/Least.php @@ -17,9 +17,6 @@ class Least extends FunctionNode private $values = []; - /** - * @param Parser $parser - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); @@ -36,10 +33,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { $query = 'LEAST('; diff --git a/src/Query/Mysql/SubstringIndex.php b/src/Query/Mysql/SubstringIndex.php index 8b3e7414..6baaa9bc 100644 --- a/src/Query/Mysql/SubstringIndex.php +++ b/src/Query/Mysql/SubstringIndex.php @@ -19,9 +19,6 @@ class SubstringIndex extends FunctionNode public $count = null; - /** - * @param \Doctrine\ORM\Query\Parser $parser - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); @@ -34,10 +31,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return sprintf( diff --git a/src/Query/Oracle/Listagg.php b/src/Query/Oracle/Listagg.php index 63af5ec6..70ff927a 100644 --- a/src/Query/Oracle/Listagg.php +++ b/src/Query/Oracle/Listagg.php @@ -29,9 +29,6 @@ class Listagg extends FunctionNode /** @var Node[] */ public $partitionBy = []; - /** - * @inheritdoc - */ public function parse(Parser $parser): void { $lexer = $parser->getLexer(); @@ -80,9 +77,6 @@ public function parse(Parser $parser): void } } - /** - * @inheritdoc - */ public function getSql(SqlWalker $sqlWalker): string { $result = 'LISTAGG(' . $this->listaggField->dispatch($sqlWalker); diff --git a/src/Query/Postgresql/ExtractFunction.php b/src/Query/Postgresql/ExtractFunction.php index 9bad0cd9..f30a0dcf 100644 --- a/src/Query/Postgresql/ExtractFunction.php +++ b/src/Query/Postgresql/ExtractFunction.php @@ -22,12 +22,7 @@ class ExtractFunction extends FunctionNode /** @var PathExpression */ private $value; - /** - * @param SqlWalker $sqlWalker - * - * @throws ASTException - * @return string - */ + /** @throws ASTException */ public function getSql(SqlWalker $sqlWalker): string { return sprintf( @@ -37,11 +32,7 @@ public function getSql(SqlWalker $sqlWalker): string ); } - /** - * @param Parser $parser - * - * @throws QueryException - */ + /** @throws QueryException */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Postgresql/Greatest.php b/src/Query/Postgresql/Greatest.php index 3ba9cd95..02dac5b6 100644 --- a/src/Query/Postgresql/Greatest.php +++ b/src/Query/Postgresql/Greatest.php @@ -17,9 +17,6 @@ class Greatest extends FunctionNode private $values = []; - /** - * @param Parser $parser - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); @@ -36,10 +33,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { $query = 'GREATEST('; diff --git a/src/Query/Postgresql/Least.php b/src/Query/Postgresql/Least.php index cf048905..e4de3ea8 100644 --- a/src/Query/Postgresql/Least.php +++ b/src/Query/Postgresql/Least.php @@ -17,9 +17,6 @@ class Least extends FunctionNode private $values = []; - /** - * @param Parser $parser - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); @@ -36,10 +33,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { $query = 'LEAST('; diff --git a/src/Query/Sqlite/DateFormat.php b/src/Query/Sqlite/DateFormat.php index 4de882ed..2f15c3f3 100644 --- a/src/Query/Sqlite/DateFormat.php +++ b/src/Query/Sqlite/DateFormat.php @@ -22,10 +22,6 @@ class DateFormat extends FunctionNode private $format; - /** - * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { return 'STRFTIME(' @@ -35,9 +31,6 @@ public function getSql(SqlWalker $sqlWalker): string . ')'; } - /** - * @param \Doctrine\ORM\Query\Parser $parser - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); @@ -50,8 +43,6 @@ public function parse(Parser $parser): void /** * Convert the MySql DATE_FORMAT() substitutions to Sqlite STRFTIME() substitutions - * @param ArithmeticExpression $expr - * @return ArithmeticExpression */ private function convertFormat(ArithmeticExpression $expr): ArithmeticExpression { diff --git a/src/Query/Sqlite/Greatest.php b/src/Query/Sqlite/Greatest.php index c8785e5e..52b2bc0f 100644 --- a/src/Query/Sqlite/Greatest.php +++ b/src/Query/Sqlite/Greatest.php @@ -17,9 +17,6 @@ class Greatest extends FunctionNode private $values = []; - /** - * @param Parser $parser - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); @@ -36,10 +33,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { $query = 'MAX('; diff --git a/src/Query/Sqlite/Least.php b/src/Query/Sqlite/Least.php index a850d732..f58a18c4 100644 --- a/src/Query/Sqlite/Least.php +++ b/src/Query/Sqlite/Least.php @@ -17,9 +17,6 @@ class Least extends FunctionNode private $values = []; - /** - * @param Parser $parser - */ public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); @@ -36,10 +33,6 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - /** - * @param SqlWalker $sqlWalker - * @return string - */ public function getSql(SqlWalker $sqlWalker): string { $query = 'MIN('; From 1519b513064886a93fee7b7b9f3e7f1c1c987abc Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 00:47:55 +0100 Subject: [PATCH 11/43] Code Sniffer: apply rule SlevomatCodingStandard.Operators.DisallowEqualOperators.* --- src/Query/Mysql/ConcatWs.php | 6 +++--- src/Query/Mysql/CountIf.php | 2 +- src/Query/Mysql/Field.php | 2 +- src/Query/Mysql/Greatest.php | 2 +- src/Query/Mysql/Least.php | 2 +- src/Query/Mysql/Week.php | 2 +- src/Query/Mysql/YearWeek.php | 2 +- src/Query/Oracle/Listagg.php | 6 +++--- src/Query/Postgresql/Greatest.php | 2 +- src/Query/Postgresql/Least.php | 2 +- src/Query/SortableNullsWalker.php | 2 +- src/Query/Sqlite/ConcatWs.php | 6 +++--- src/Query/Sqlite/Greatest.php | 2 +- src/Query/Sqlite/Least.php | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Query/Mysql/ConcatWs.php b/src/Query/Mysql/ConcatWs.php index 06071a41..a50185a4 100644 --- a/src/Query/Mysql/ConcatWs.php +++ b/src/Query/Mysql/ConcatWs.php @@ -33,16 +33,16 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); - while (count($this->values) < 3 || $lexer->lookahead->type == Lexer::T_COMMA) { + while (count($this->values) < 3 || $lexer->lookahead->type === Lexer::T_COMMA) { $parser->match(Lexer::T_COMMA); $peek = $lexer->glimpse(); - $this->values[] = $peek->value == '(' + $this->values[] = $peek->value === '(' ? $parser->FunctionDeclaration() : $parser->ArithmeticExpression(); } - while ($lexer->lookahead->type == Lexer::T_IDENTIFIER) { + while ($lexer->lookahead->type === Lexer::T_IDENTIFIER) { switch (strtolower($lexer->lookahead->value)) { case 'notempty': $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/CountIf.php b/src/Query/Mysql/CountIf.php index 20d98be9..be599834 100644 --- a/src/Query/Mysql/CountIf.php +++ b/src/Query/Mysql/CountIf.php @@ -30,7 +30,7 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); - while ($lexer->lookahead->type == Lexer::T_IDENTIFIER) { + while ($lexer->lookahead->type === Lexer::T_IDENTIFIER) { switch (strtolower($lexer->lookahead->value)) { case 'inverse': $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/Field.php b/src/Query/Mysql/Field.php index c382fb2f..a9a78dc9 100644 --- a/src/Query/Mysql/Field.php +++ b/src/Query/Mysql/Field.php @@ -31,7 +31,7 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); while (count($this->values) < 1 || - $lexer->lookahead->type != Lexer::T_CLOSE_PARENTHESIS) { + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticPrimary(); } diff --git a/src/Query/Mysql/Greatest.php b/src/Query/Mysql/Greatest.php index c6c1fad7..a1d6f50d 100644 --- a/src/Query/Mysql/Greatest.php +++ b/src/Query/Mysql/Greatest.php @@ -25,7 +25,7 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); while (count($this->values) < 1 || - $lexer->lookahead->type != Lexer::T_CLOSE_PARENTHESIS) { + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } diff --git a/src/Query/Mysql/Least.php b/src/Query/Mysql/Least.php index b8e1424b..104954a7 100644 --- a/src/Query/Mysql/Least.php +++ b/src/Query/Mysql/Least.php @@ -25,7 +25,7 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); while (count($this->values) < 1 || - $lexer->lookahead->type != Lexer::T_CLOSE_PARENTHESIS) { + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } diff --git a/src/Query/Mysql/Week.php b/src/Query/Mysql/Week.php index c08c90b1..de51a436 100644 --- a/src/Query/Mysql/Week.php +++ b/src/Query/Mysql/Week.php @@ -18,7 +18,7 @@ class Week extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { $sql = 'WEEK(' . $sqlWalker->walkArithmeticPrimary($this->date); - if ($this->mode != null) { + if ($this->mode !== null) { $sql .= ', ' . $sqlWalker->walkLiteral($this->mode); } $sql .= ')'; diff --git a/src/Query/Mysql/YearWeek.php b/src/Query/Mysql/YearWeek.php index e89a8451..05b07c74 100644 --- a/src/Query/Mysql/YearWeek.php +++ b/src/Query/Mysql/YearWeek.php @@ -18,7 +18,7 @@ class YearWeek extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { $sql = 'YEARWEEK(' . $sqlWalker->walkArithmeticPrimary($this->date); - if ($this->mode != null) { + if ($this->mode !== null) { $sql .= ', ' . $sqlWalker->walkLiteral($this->mode); } $sql .= ')'; diff --git a/src/Query/Oracle/Listagg.php b/src/Query/Oracle/Listagg.php index 70ff927a..30d9a225 100644 --- a/src/Query/Oracle/Listagg.php +++ b/src/Query/Oracle/Listagg.php @@ -43,7 +43,7 @@ public function parse(Parser $parser): void } $parser->match(Lexer::T_CLOSE_PARENTHESIS); - if (!$lexer->isNextToken(Lexer::T_IDENTIFIER) || strtolower($lexer->lookahead->value) != 'within') { + if (! $lexer->isNextToken(Lexer::T_IDENTIFIER) || strtolower($lexer->lookahead->value) !== 'within') { $parser->syntaxError('WITHIN GROUP'); } $parser->match(Lexer::T_IDENTIFIER); @@ -54,13 +54,13 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); if ($lexer->isNextToken(Lexer::T_IDENTIFIER)) { - if (strtolower($lexer->lookahead->value) != 'over') { + if (strtolower($lexer->lookahead->value) !== 'over') { $parser->syntaxError('OVER'); } $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); - if (!$lexer->isNextToken(Lexer::T_IDENTIFIER) || strtolower($lexer->lookahead->value) != 'partition') { + if (! $lexer->isNextToken(Lexer::T_IDENTIFIER) || strtolower($lexer->lookahead->value) !== 'partition') { $parser->syntaxError('PARTITION BY'); } $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Postgresql/Greatest.php b/src/Query/Postgresql/Greatest.php index 02dac5b6..091c206b 100644 --- a/src/Query/Postgresql/Greatest.php +++ b/src/Query/Postgresql/Greatest.php @@ -25,7 +25,7 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); while (count($this->values) < 1 || - $lexer->lookahead->type != Lexer::T_CLOSE_PARENTHESIS) { + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } diff --git a/src/Query/Postgresql/Least.php b/src/Query/Postgresql/Least.php index e4de3ea8..528f1456 100644 --- a/src/Query/Postgresql/Least.php +++ b/src/Query/Postgresql/Least.php @@ -25,7 +25,7 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); while (count($this->values) < 1 || - $lexer->lookahead->type != Lexer::T_CLOSE_PARENTHESIS) { + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } diff --git a/src/Query/SortableNullsWalker.php b/src/Query/SortableNullsWalker.php index 94274725..7352a436 100644 --- a/src/Query/SortableNullsWalker.php +++ b/src/Query/SortableNullsWalker.php @@ -54,7 +54,7 @@ public function walkOrderByItem($orderByItem) // check for a state field if ( $expr instanceof Query\AST\PathExpression && - $expr->type == Query\AST\PathExpression::TYPE_STATE_FIELD + $expr->type === Query\AST\PathExpression::TYPE_STATE_FIELD ) { $fieldName = $expr->field; $dqlAlias = $expr->identificationVariable; diff --git a/src/Query/Sqlite/ConcatWs.php b/src/Query/Sqlite/ConcatWs.php index 27827064..9bb57225 100644 --- a/src/Query/Sqlite/ConcatWs.php +++ b/src/Query/Sqlite/ConcatWs.php @@ -33,16 +33,16 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); - while (count($this->values) < 3 || $lexer->lookahead->type == Lexer::T_COMMA) { + while (count($this->values) < 3 || $lexer->lookahead->type === Lexer::T_COMMA) { $parser->match(Lexer::T_COMMA); $peek = $lexer->glimpse(); - $this->values[] = $peek->value == '(' + $this->values[] = $peek->value === '(' ? $parser->FunctionDeclaration() : $parser->ArithmeticExpression(); } - while ($lexer->lookahead->type == Lexer::T_IDENTIFIER) { + while ($lexer->lookahead->type === Lexer::T_IDENTIFIER) { switch (strtolower($lexer->lookahead->value)) { case 'notempty': $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Sqlite/Greatest.php b/src/Query/Sqlite/Greatest.php index 52b2bc0f..46f7be79 100644 --- a/src/Query/Sqlite/Greatest.php +++ b/src/Query/Sqlite/Greatest.php @@ -25,7 +25,7 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); while (count($this->values) < 1 || - $lexer->lookahead->type != Lexer::T_CLOSE_PARENTHESIS) { + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } diff --git a/src/Query/Sqlite/Least.php b/src/Query/Sqlite/Least.php index f58a18c4..375d3d94 100644 --- a/src/Query/Sqlite/Least.php +++ b/src/Query/Sqlite/Least.php @@ -25,7 +25,7 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); while (count($this->values) < 1 || - $lexer->lookahead->type != Lexer::T_CLOSE_PARENTHESIS) { + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } From 3294d9fac85e96aa927ab4e42aaae546bf4c4c90 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 00:48:52 +0100 Subject: [PATCH 12/43] Code Sniffer: apply rule PSR2.ControlStructures.SwitchDeclaration.BreakIndent --- src/Query/Mysql/ConcatWs.php | 4 ++-- src/Query/Mysql/CountIf.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Query/Mysql/ConcatWs.php b/src/Query/Mysql/ConcatWs.php index a50185a4..21455efb 100644 --- a/src/Query/Mysql/ConcatWs.php +++ b/src/Query/Mysql/ConcatWs.php @@ -48,11 +48,11 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $this->notEmpty = true; - break; + break; default: // Identifier not recognized (causes exception). $parser->match(Lexer::T_CLOSE_PARENTHESIS); - break; + break; } } diff --git a/src/Query/Mysql/CountIf.php b/src/Query/Mysql/CountIf.php index be599834..5bbe7740 100644 --- a/src/Query/Mysql/CountIf.php +++ b/src/Query/Mysql/CountIf.php @@ -36,11 +36,11 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $this->inverse = true; - break; + break; default: // Identifier not recognized (causes exception). $parser->match(Lexer::T_CLOSE_PARENTHESIS); - break; + break; } } From 9e8c0c364ee093c57dd7e8562d3120ef31aa3fbb Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 00:49:25 +0100 Subject: [PATCH 13/43] Code Sniffer: apply rule Generic.Formatting.SpaceAfterNot.Incorrect --- src/Query/Mysql/CountIf.php | 2 +- src/Query/Mysql/DateAdd.php | 2 +- src/Query/Mysql/DateSub.php | 2 +- src/Query/Mysql/Extract.php | 2 +- src/Query/Mysql/Lag.php | 4 ++-- src/Query/Mysql/Lead.php | 4 ++-- src/Query/Mysql/Over.php | 2 +- src/Query/Mysql/UnixTimestamp.php | 2 +- src/Types/PolygonType.php | 2 +- src/Types/ZendDateType.php | 4 ++-- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Query/Mysql/CountIf.php b/src/Query/Mysql/CountIf.php index 5bbe7740..77bb831f 100644 --- a/src/Query/Mysql/CountIf.php +++ b/src/Query/Mysql/CountIf.php @@ -53,7 +53,7 @@ public function getSql(SqlWalker $sqlWalker): string 'COUNT(CASE %s WHEN %s THEN %s END)', $sqlWalker->walkArithmeticPrimary($this->expr1), $sqlWalker->walkArithmeticPrimary($this->expr2), - !$this->inverse ? '1 ELSE NULL' : 'NULL ELSE 1' + ! $this->inverse ? '1 ELSE NULL' : 'NULL ELSE 1' ); } } diff --git a/src/Query/Mysql/DateAdd.php b/src/Query/Mysql/DateAdd.php index 01581f80..8dd121c2 100644 --- a/src/Query/Mysql/DateAdd.php +++ b/src/Query/Mysql/DateAdd.php @@ -65,7 +65,7 @@ public function getSql(SqlWalker $sqlWalker): string { $unit = strtoupper(is_string($this->unit) ? $this->unit : $this->unit->value); - if (!in_array($unit, self::$allowedUnits)) { + if (! in_array($unit, self::$allowedUnits)) { throw QueryException::semanticalError('DATE_ADD() does not support unit "' . $unit . '".'); } diff --git a/src/Query/Mysql/DateSub.php b/src/Query/Mysql/DateSub.php index 9f03d9a8..f4914036 100644 --- a/src/Query/Mysql/DateSub.php +++ b/src/Query/Mysql/DateSub.php @@ -18,7 +18,7 @@ public function getSql(SqlWalker $sqlWalker): string { $unit = strtoupper(is_string($this->unit) ? $this->unit : $this->unit->value); - if (!in_array($unit, self::$allowedUnits)) { + if (! in_array($unit, self::$allowedUnits)) { throw QueryException::semanticalError('DATE_SUB() does not support unit "' . $unit . '".'); } diff --git a/src/Query/Mysql/Extract.php b/src/Query/Mysql/Extract.php index 9137d4b0..7ad128e3 100644 --- a/src/Query/Mysql/Extract.php +++ b/src/Query/Mysql/Extract.php @@ -36,7 +36,7 @@ public function parse(Parser $parser): void public function getSql(SqlWalker $sqlWalker): string { $unit = strtoupper($this->unit); - if (!in_array($unit, self::$allowedUnits)) { + if (! in_array($unit, self::$allowedUnits)) { throw QueryException::semanticalError('EXTRACT() does not support unit "' . $unit . '".'); } diff --git a/src/Query/Mysql/Lag.php b/src/Query/Mysql/Lag.php index 9cafecca..3f1adbf1 100755 --- a/src/Query/Mysql/Lag.php +++ b/src/Query/Mysql/Lag.php @@ -42,11 +42,11 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->aggregateExpression = $parser->StringExpression(); - if (!$lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { + if (! $lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { $parser->match(Lexer::T_COMMA); $this->offset = $parser->ArithmeticPrimary(); } - if (!$lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { + if (! $lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { $parser->match(Lexer::T_COMMA); $this->defaultValue = $parser->SimpleArithmeticExpression(); } diff --git a/src/Query/Mysql/Lead.php b/src/Query/Mysql/Lead.php index 710339ce..52095f24 100755 --- a/src/Query/Mysql/Lead.php +++ b/src/Query/Mysql/Lead.php @@ -42,11 +42,11 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->aggregateExpression = $parser->StringExpression(); - if (!$lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { + if (! $lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { $parser->match(Lexer::T_COMMA); $this->offset = $parser->ArithmeticPrimary(); } - if (!$lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { + if (! $lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { $parser->match(Lexer::T_COMMA); $this->defaultValue = $parser->SimpleArithmeticExpression(); } diff --git a/src/Query/Mysql/Over.php b/src/Query/Mysql/Over.php index c817fde5..e10b42ea 100755 --- a/src/Query/Mysql/Over.php +++ b/src/Query/Mysql/Over.php @@ -36,7 +36,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->arithmeticExpression = $parser->ArithmeticExpression(); - if (!$lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { + if (! $lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { $parser->match(Lexer::T_COMMA); $this->orderByClause = $parser->OrderByClause(); } diff --git a/src/Query/Mysql/UnixTimestamp.php b/src/Query/Mysql/UnixTimestamp.php index 3a1becd1..83d7e2f5 100644 --- a/src/Query/Mysql/UnixTimestamp.php +++ b/src/Query/Mysql/UnixTimestamp.php @@ -28,7 +28,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); - if (!$parser->getLexer()->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { + if (! $parser->getLexer()->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { $this->date = $parser->ArithmeticPrimary(); } diff --git a/src/Types/PolygonType.php b/src/Types/PolygonType.php index 24a39cd7..584523e1 100644 --- a/src/Types/PolygonType.php +++ b/src/Types/PolygonType.php @@ -27,7 +27,7 @@ public function canRequireSQLConversion() public function convertToPHPValue($value, AbstractPlatform $platform) { preg_match('/POLYGON\(\((.*)\)\)/', $value, $matches); - if (!isset($matches[1])) { + if (! isset($matches[1])) { throw new Exception('No Polygon Points'); } diff --git a/src/Types/ZendDateType.php b/src/Types/ZendDateType.php index 7c228b76..bc9e01b5 100755 --- a/src/Types/ZendDateType.php +++ b/src/Types/ZendDateType.php @@ -12,7 +12,7 @@ use function class_exists; -if (!class_exists('Zend_Date')) { +if (! class_exists('Zend_Date')) { require_once 'Zend/Date.php'; } @@ -53,7 +53,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) ); $val = new Zend_Date($value, $dateTimeFormatString); - if (!$val) { + if (! $val) { throw ConversionException::conversionFailed($value, $this->getName()); } From 16a2f7eaf6f2b04e1214ce0548bf01d86555f36e Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:00:59 +0100 Subject: [PATCH 14/43] Code Sniffer: apply rule SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountAfterControlStructure --- src/Query/Mysql/GroupConcat.php | 1 + src/Query/Mysql/IfElse.php | 1 + src/Query/Mysql/Lag.php | 2 ++ src/Query/Mysql/Lead.php | 2 ++ src/Query/Mysql/MatchAgainst.php | 4 ++++ src/Query/Mysql/Over.php | 1 + src/Query/Mysql/Week.php | 1 + src/Query/Mysql/YearWeek.php | 1 + src/Query/Oracle/Listagg.php | 4 ++++ tests/Query/ConfigLoader.php | 2 ++ tests/Query/Mysql/TruncateTest.php | 2 +- tests/Query/Mysql/UnhexTest.php | 2 +- 12 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Query/Mysql/GroupConcat.php b/src/Query/Mysql/GroupConcat.php index f543157a..c9f90819 100644 --- a/src/Query/Mysql/GroupConcat.php +++ b/src/Query/Mysql/GroupConcat.php @@ -56,6 +56,7 @@ public function parse(Parser $parser): void if (strtolower($lexer->lookahead->value) !== 'separator') { $parser->syntaxError('separator'); } + $parser->match(Lexer::T_IDENTIFIER); $this->separator = $parser->StringPrimary(); diff --git a/src/Query/Mysql/IfElse.php b/src/Query/Mysql/IfElse.php index ee1ac636..44c10252 100644 --- a/src/Query/Mysql/IfElse.php +++ b/src/Query/Mysql/IfElse.php @@ -28,6 +28,7 @@ public function parse(Parser $parser): void } else { $this->expr[] = $parser->ArithmeticExpression(); } + $parser->match(Lexer::T_COMMA); if ($parser->getLexer()->isNextToken(Lexer::T_NULL)) { $parser->match(Lexer::T_NULL); diff --git a/src/Query/Mysql/Lag.php b/src/Query/Mysql/Lag.php index 3f1adbf1..9e95d8a2 100755 --- a/src/Query/Mysql/Lag.php +++ b/src/Query/Mysql/Lag.php @@ -28,6 +28,7 @@ public function getSql(SqlWalker $sqlWalker): string if (isset($this->offset, $this->defaultValue)) { return 'LAG(' . $sqlWalker->walkAggregateExpression($this->aggregateExpression) . ', ' . $sqlWalker->walkArithmeticPrimary($this->offset) . ', ' . $sqlWalker->walkSimpleArithmeticExpression($this->defaultValue) . ')'; } + if (isset($this->offset)) { return 'LAG(' . $sqlWalker->walkAggregateExpression($this->aggregateExpression) . ', ' . $sqlWalker->walkArithmeticPrimary($this->offset) . ')'; } @@ -46,6 +47,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_COMMA); $this->offset = $parser->ArithmeticPrimary(); } + if (! $lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { $parser->match(Lexer::T_COMMA); $this->defaultValue = $parser->SimpleArithmeticExpression(); diff --git a/src/Query/Mysql/Lead.php b/src/Query/Mysql/Lead.php index 52095f24..657ee785 100755 --- a/src/Query/Mysql/Lead.php +++ b/src/Query/Mysql/Lead.php @@ -28,6 +28,7 @@ public function getSql(SqlWalker $sqlWalker): string if (isset($this->offset, $this->defaultValue)) { return 'LEAD(' . $sqlWalker->walkAggregateExpression($this->aggregateExpression) . ', ' . $sqlWalker->walkArithmeticPrimary($this->offset) . ', ' . $sqlWalker->walkSimpleArithmeticExpression($this->defaultValue) . ')'; } + if (isset($this->offset)) { return 'LEAD(' . $sqlWalker->walkAggregateExpression($this->aggregateExpression) . ', ' . $sqlWalker->walkArithmeticPrimary($this->offset) . ')'; } @@ -46,6 +47,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_COMMA); $this->offset = $parser->ArithmeticPrimary(); } + if (! $lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { $parser->match(Lexer::T_COMMA); $this->defaultValue = $parser->SimpleArithmeticExpression(); diff --git a/src/Query/Mysql/MatchAgainst.php b/src/Query/Mysql/MatchAgainst.php index 56c935fa..0415f58a 100644 --- a/src/Query/Mysql/MatchAgainst.php +++ b/src/Query/Mysql/MatchAgainst.php @@ -64,11 +64,13 @@ public function parse(Parser $parser): void if (strtolower($lexer->lookahead->value) !== 'boolean') { $parser->syntaxError('boolean'); } + $parser->match(Lexer::T_IDENTIFIER); if (strtolower($lexer->lookahead->value) !== 'mode') { $parser->syntaxError('mode'); } + $parser->match(Lexer::T_IDENTIFIER); $this->booleanMode = true; @@ -83,11 +85,13 @@ public function parse(Parser $parser): void if (strtolower($lexer->lookahead->value) !== 'query') { $parser->syntaxError('query'); } + $parser->match(Lexer::T_IDENTIFIER); if (strtolower($lexer->lookahead->value) !== 'expansion') { $parser->syntaxError('expansion'); } + $parser->match(Lexer::T_IDENTIFIER); $this->queryExpansion = true; diff --git a/src/Query/Mysql/Over.php b/src/Query/Mysql/Over.php index e10b42ea..47c83134 100755 --- a/src/Query/Mysql/Over.php +++ b/src/Query/Mysql/Over.php @@ -40,6 +40,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_COMMA); $this->orderByClause = $parser->OrderByClause(); } + $parser->match(Lexer::T_CLOSE_PARENTHESIS); } } diff --git a/src/Query/Mysql/Week.php b/src/Query/Mysql/Week.php index de51a436..2f261403 100644 --- a/src/Query/Mysql/Week.php +++ b/src/Query/Mysql/Week.php @@ -21,6 +21,7 @@ public function getSql(SqlWalker $sqlWalker): string if ($this->mode !== null) { $sql .= ', ' . $sqlWalker->walkLiteral($this->mode); } + $sql .= ')'; return $sql; diff --git a/src/Query/Mysql/YearWeek.php b/src/Query/Mysql/YearWeek.php index 05b07c74..609430e3 100644 --- a/src/Query/Mysql/YearWeek.php +++ b/src/Query/Mysql/YearWeek.php @@ -21,6 +21,7 @@ public function getSql(SqlWalker $sqlWalker): string if ($this->mode !== null) { $sql .= ', ' . $sqlWalker->walkLiteral($this->mode); } + $sql .= ')'; return $sql; diff --git a/src/Query/Oracle/Listagg.php b/src/Query/Oracle/Listagg.php index 30d9a225..ded85ad8 100644 --- a/src/Query/Oracle/Listagg.php +++ b/src/Query/Oracle/Listagg.php @@ -41,11 +41,13 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_COMMA); $this->separator = $parser->StringExpression(); } + $parser->match(Lexer::T_CLOSE_PARENTHESIS); if (! $lexer->isNextToken(Lexer::T_IDENTIFIER) || strtolower($lexer->lookahead->value) !== 'within') { $parser->syntaxError('WITHIN GROUP'); } + $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_GROUP); @@ -57,12 +59,14 @@ public function parse(Parser $parser): void if (strtolower($lexer->lookahead->value) !== 'over') { $parser->syntaxError('OVER'); } + $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); if (! $lexer->isNextToken(Lexer::T_IDENTIFIER) || strtolower($lexer->lookahead->value) !== 'partition') { $parser->syntaxError('PARTITION BY'); } + $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_BY); diff --git a/tests/Query/ConfigLoader.php b/tests/Query/ConfigLoader.php index 0c931a56..4d90fa83 100644 --- a/tests/Query/ConfigLoader.php +++ b/tests/Query/ConfigLoader.php @@ -39,11 +39,13 @@ public static function load(Configuration $configuration, $database) $configuration->addCustomDatetimeFunction(strtoupper($key), $value); } } + if (array_key_exists('numeric_functions', $parsed)) { foreach ($parsed[ 'numeric_functions' ] as $key => $value) { $configuration->addCustomNumericFunction(strtoupper($key), $value); } } + if (array_key_exists('string_functions', $parsed)) { foreach ($parsed[ 'string_functions' ] as $key => $value) { $configuration->addCustomStringFunction(strtoupper($key), $value); diff --git a/tests/Query/Mysql/TruncateTest.php b/tests/Query/Mysql/TruncateTest.php index fedb7a91..52466e16 100644 --- a/tests/Query/Mysql/TruncateTest.php +++ b/tests/Query/Mysql/TruncateTest.php @@ -8,7 +8,7 @@ class TruncateTest extends MysqlTestCase { - public function testFormat() + public function testFormat(): void { $this->assertDqlProducesSql( "SELECT TRUNCATE(1000.00, 2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/UnhexTest.php b/tests/Query/Mysql/UnhexTest.php index c03dd77f..73f561b3 100644 --- a/tests/Query/Mysql/UnhexTest.php +++ b/tests/Query/Mysql/UnhexTest.php @@ -8,7 +8,7 @@ class UnhexTest extends MysqlTestCase { - public function testUnhex() + public function testUnhex(): void { $this->assertDqlProducesSql( "SELECT UNHEX(2) from DoctrineExtensions\Tests\Entities\Blank b", From a5c044b38081ae948e69610edf9a0f435a72d740 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:05:36 +0100 Subject: [PATCH 15/43] Code Sniffer: apply rule PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine & CloseParenthesisLine --- src/Query/Mysql/Field.php | 6 ++++-- src/Query/Mysql/Greatest.php | 6 ++++-- src/Query/Mysql/Least.php | 6 ++++-- src/Query/Postgresql/Greatest.php | 6 ++++-- src/Query/Postgresql/Least.php | 6 ++++-- src/Query/Sqlite/Greatest.php | 6 ++++-- src/Query/Sqlite/Least.php | 6 ++++-- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/Query/Mysql/Field.php b/src/Query/Mysql/Field.php index a9a78dc9..aa6f4ad6 100644 --- a/src/Query/Mysql/Field.php +++ b/src/Query/Mysql/Field.php @@ -30,8 +30,10 @@ public function parse(Parser $parser): void $lexer = $parser->getLexer(); - while (count($this->values) < 1 || - $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { + while ( + count($this->values) < 1 || + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS + ) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticPrimary(); } diff --git a/src/Query/Mysql/Greatest.php b/src/Query/Mysql/Greatest.php index a1d6f50d..a6eb98c8 100644 --- a/src/Query/Mysql/Greatest.php +++ b/src/Query/Mysql/Greatest.php @@ -24,8 +24,10 @@ public function parse(Parser $parser): void $this->field = $parser->ArithmeticExpression(); $lexer = $parser->getLexer(); - while (count($this->values) < 1 || - $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { + while ( + count($this->values) < 1 || + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS + ) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } diff --git a/src/Query/Mysql/Least.php b/src/Query/Mysql/Least.php index 104954a7..4d6c7ae0 100644 --- a/src/Query/Mysql/Least.php +++ b/src/Query/Mysql/Least.php @@ -24,8 +24,10 @@ public function parse(Parser $parser): void $this->field = $parser->ArithmeticExpression(); $lexer = $parser->getLexer(); - while (count($this->values) < 1 || - $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { + while ( + count($this->values) < 1 || + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS + ) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } diff --git a/src/Query/Postgresql/Greatest.php b/src/Query/Postgresql/Greatest.php index 091c206b..0ecc4a73 100644 --- a/src/Query/Postgresql/Greatest.php +++ b/src/Query/Postgresql/Greatest.php @@ -24,8 +24,10 @@ public function parse(Parser $parser): void $this->field = $parser->ArithmeticExpression(); $lexer = $parser->getLexer(); - while (count($this->values) < 1 || - $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { + while ( + count($this->values) < 1 || + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS + ) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } diff --git a/src/Query/Postgresql/Least.php b/src/Query/Postgresql/Least.php index 528f1456..88391626 100644 --- a/src/Query/Postgresql/Least.php +++ b/src/Query/Postgresql/Least.php @@ -24,8 +24,10 @@ public function parse(Parser $parser): void $this->field = $parser->ArithmeticExpression(); $lexer = $parser->getLexer(); - while (count($this->values) < 1 || - $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { + while ( + count($this->values) < 1 || + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS + ) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } diff --git a/src/Query/Sqlite/Greatest.php b/src/Query/Sqlite/Greatest.php index 46f7be79..7fd33d25 100644 --- a/src/Query/Sqlite/Greatest.php +++ b/src/Query/Sqlite/Greatest.php @@ -24,8 +24,10 @@ public function parse(Parser $parser): void $this->field = $parser->ArithmeticExpression(); $lexer = $parser->getLexer(); - while (count($this->values) < 1 || - $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { + while ( + count($this->values) < 1 || + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS + ) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } diff --git a/src/Query/Sqlite/Least.php b/src/Query/Sqlite/Least.php index 375d3d94..d9f2be42 100644 --- a/src/Query/Sqlite/Least.php +++ b/src/Query/Sqlite/Least.php @@ -24,8 +24,10 @@ public function parse(Parser $parser): void $this->field = $parser->ArithmeticExpression(); $lexer = $parser->getLexer(); - while (count($this->values) < 1 || - $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS) { + while ( + count($this->values) < 1 || + $lexer->lookahead->type !== Lexer::T_CLOSE_PARENTHESIS + ) { $parser->match(Lexer::T_COMMA); $this->values[] = $parser->ArithmeticExpression(); } From d77b1237becc1b9ddc2ccfda86fa8c8c035f2375 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:08:48 +0100 Subject: [PATCH 16/43] Code Sniffer: apply rule Generic.Formatting.MultipleStatementAlignment.NotSame --- src/Query/Mysql/Cast.php | 2 +- src/Query/Mysql/Extract.php | 2 +- src/Query/Mysql/Greatest.php | 2 +- src/Query/Mysql/JsonContains.php | 2 +- src/Query/Mysql/Least.php | 2 +- src/Query/Mysql/MakeDate.php | 2 +- src/Query/Mysql/MatchAgainst.php | 2 +- src/Query/Mysql/TimestampAdd.php | 2 +- src/Query/Mysql/TimestampDiff.php | 2 +- src/Query/Postgresql/Greatest.php | 2 +- src/Query/Postgresql/Least.php | 2 +- src/Query/SortableNullsWalker.php | 8 ++--- src/Query/Sqlite/Greatest.php | 2 +- src/Query/Sqlite/Least.php | 2 +- tests/Query/Mysql/TrigTest.php | 20 +++++------ tests/Query/MysqlWalkerTest.php | 6 ++-- tests/Query/Oracle/ListaggTest.php | 2 +- tests/Query/Oracle/TruncTest.php | 4 +-- tests/Query/Postgresql/DateTest.php | 2 +- tests/Query/Postgresql/RegexpReplaceTest.php | 2 +- tests/Query/Postgresql/StringTest.php | 2 +- tests/Query/Sqlite/NumericFunctionsTest.php | 4 +-- tests/Query/Sqlite/StringFunctionsTest.php | 4 +-- tests/Types/CarbonDateTest.php | 36 ++++++++++---------- 24 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/Query/Mysql/Cast.php b/src/Query/Mysql/Cast.php index 03b916b3..98089f60 100644 --- a/src/Query/Mysql/Cast.php +++ b/src/Query/Mysql/Cast.php @@ -53,7 +53,7 @@ public function parse(Parser $parser): void if ($parser->getLexer()->isNextToken(Lexer::T_COMMA)) { while ($parser->getLexer()->isNextToken(Lexer::T_COMMA)) { $parser->match(Lexer::T_COMMA); - $parameter = $parser->Literal(); + $parameter = $parser->Literal(); $parameters[] = $parameter->value; } } diff --git a/src/Query/Mysql/Extract.php b/src/Query/Mysql/Extract.php index 7ad128e3..45fb1260 100644 --- a/src/Query/Mysql/Extract.php +++ b/src/Query/Mysql/Extract.php @@ -24,7 +24,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_OPEN_PARENTHESIS); $parser->match(Lexer::T_IDENTIFIER); - $lexer = $parser->getLexer(); + $lexer = $parser->getLexer(); $this->unit = $lexer->token->value; $parser->match(Lexer::T_IDENTIFIER); diff --git a/src/Query/Mysql/Greatest.php b/src/Query/Mysql/Greatest.php index a6eb98c8..0cfbdb0c 100644 --- a/src/Query/Mysql/Greatest.php +++ b/src/Query/Mysql/Greatest.php @@ -22,7 +22,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->field = $parser->ArithmeticExpression(); - $lexer = $parser->getLexer(); + $lexer = $parser->getLexer(); while ( count($this->values) < 1 || diff --git a/src/Query/Mysql/JsonContains.php b/src/Query/Mysql/JsonContains.php index bab6c1d1..c94f894b 100644 --- a/src/Query/Mysql/JsonContains.php +++ b/src/Query/Mysql/JsonContains.php @@ -41,7 +41,7 @@ public function parse(Parser $parser): void public function getSql(SqlWalker $sqlWalker): string { - $target = $sqlWalker->walkStringPrimary($this->target); + $target = $sqlWalker->walkStringPrimary($this->target); $candidate = $sqlWalker->walkStringPrimary($this->candidate); if ($this->path !== null) { diff --git a/src/Query/Mysql/Least.php b/src/Query/Mysql/Least.php index 4d6c7ae0..5ebed164 100644 --- a/src/Query/Mysql/Least.php +++ b/src/Query/Mysql/Least.php @@ -22,7 +22,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->field = $parser->ArithmeticExpression(); - $lexer = $parser->getLexer(); + $lexer = $parser->getLexer(); while ( count($this->values) < 1 || diff --git a/src/Query/Mysql/MakeDate.php b/src/Query/Mysql/MakeDate.php index 49ea4ccd..800b4825 100644 --- a/src/Query/Mysql/MakeDate.php +++ b/src/Query/Mysql/MakeDate.php @@ -11,7 +11,7 @@ class MakeDate extends FunctionNode { - public $year = null; + public $year = null; public $dayOfYear = null; diff --git a/src/Query/Mysql/MatchAgainst.php b/src/Query/Mysql/MatchAgainst.php index 0415f58a..40642362 100644 --- a/src/Query/Mysql/MatchAgainst.php +++ b/src/Query/Mysql/MatchAgainst.php @@ -34,7 +34,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_OPEN_PARENTHESIS); // first Path Expression is mandatory - $this->pathExp = []; + $this->pathExp = []; $this->pathExp[] = $parser->StateFieldPathExpression(); // Subsequent Path Expressions are optional diff --git a/src/Query/Mysql/TimestampAdd.php b/src/Query/Mysql/TimestampAdd.php index 9e952cd4..a4f03d6a 100644 --- a/src/Query/Mysql/TimestampAdd.php +++ b/src/Query/Mysql/TimestampAdd.php @@ -24,7 +24,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $parser->match(Lexer::T_IDENTIFIER); - $lexer = $parser->getLexer(); + $lexer = $parser->getLexer(); $this->unit = $lexer->token->value; $parser->match(Lexer::T_COMMA); $this->firstDatetimeExpression = $parser->ArithmeticPrimary(); diff --git a/src/Query/Mysql/TimestampDiff.php b/src/Query/Mysql/TimestampDiff.php index 44ed0280..35eeb60e 100644 --- a/src/Query/Mysql/TimestampDiff.php +++ b/src/Query/Mysql/TimestampDiff.php @@ -24,7 +24,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $parser->match(Lexer::T_IDENTIFIER); - $lexer = $parser->getLexer(); + $lexer = $parser->getLexer(); $this->unit = $lexer->token->value; $parser->match(Lexer::T_COMMA); $this->firstDatetimeExpression = $parser->ArithmeticPrimary(); diff --git a/src/Query/Postgresql/Greatest.php b/src/Query/Postgresql/Greatest.php index 0ecc4a73..24b88cb4 100644 --- a/src/Query/Postgresql/Greatest.php +++ b/src/Query/Postgresql/Greatest.php @@ -22,7 +22,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->field = $parser->ArithmeticExpression(); - $lexer = $parser->getLexer(); + $lexer = $parser->getLexer(); while ( count($this->values) < 1 || diff --git a/src/Query/Postgresql/Least.php b/src/Query/Postgresql/Least.php index 88391626..6a275d9a 100644 --- a/src/Query/Postgresql/Least.php +++ b/src/Query/Postgresql/Least.php @@ -22,7 +22,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->field = $parser->ArithmeticExpression(); - $lexer = $parser->getLexer(); + $lexer = $parser->getLexer(); while ( count($this->values) < 1 || diff --git a/src/Query/SortableNullsWalker.php b/src/Query/SortableNullsWalker.php index 7352a436..b85e61a3 100644 --- a/src/Query/SortableNullsWalker.php +++ b/src/Query/SortableNullsWalker.php @@ -45,7 +45,7 @@ class SortableNullsWalker extends Query\SqlWalker */ public function walkOrderByItem($orderByItem) { - $sql = parent::walkOrderByItem($orderByItem); + $sql = parent::walkOrderByItem($orderByItem); $hint = $this->getQuery()->getHint('sortableNulls.fields'); $expr = $orderByItem->expression; $type = strtoupper($orderByItem->type); @@ -57,9 +57,9 @@ public function walkOrderByItem($orderByItem) $expr->type === Query\AST\PathExpression::TYPE_STATE_FIELD ) { $fieldName = $expr->field; - $dqlAlias = $expr->identificationVariable; - $search = $this->walkPathExpression($expr) . ' ' . $type; - $index = $dqlAlias . '.' . $fieldName; + $dqlAlias = $expr->identificationVariable; + $search = $this->walkPathExpression($expr) . ' ' . $type; + $index = $dqlAlias . '.' . $fieldName; if (isset($hint[$index])) { $sql = str_replace($search, $search . ' ' . $hint[$index], $sql); } diff --git a/src/Query/Sqlite/Greatest.php b/src/Query/Sqlite/Greatest.php index 7fd33d25..6721bc65 100644 --- a/src/Query/Sqlite/Greatest.php +++ b/src/Query/Sqlite/Greatest.php @@ -22,7 +22,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->field = $parser->ArithmeticExpression(); - $lexer = $parser->getLexer(); + $lexer = $parser->getLexer(); while ( count($this->values) < 1 || diff --git a/src/Query/Sqlite/Least.php b/src/Query/Sqlite/Least.php index d9f2be42..2be4b7a9 100644 --- a/src/Query/Sqlite/Least.php +++ b/src/Query/Sqlite/Least.php @@ -22,7 +22,7 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->field = $parser->ArithmeticExpression(); - $lexer = $parser->getLexer(); + $lexer = $parser->getLexer(); while ( count($this->values) < 1 || diff --git a/tests/Query/Mysql/TrigTest.php b/tests/Query/Mysql/TrigTest.php index 2fd2c6ac..b13aac29 100644 --- a/tests/Query/Mysql/TrigTest.php +++ b/tests/Query/Mysql/TrigTest.php @@ -26,19 +26,19 @@ public function testSin() $this->_assertSecondQuery('SIN'); $dql = "SELECT SIN(RADIANS(p.latitude)) FROM {$this->entity} p"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $sql = 'SELECT SIN(RADIANS(b0_.latitude)) AS sclr_0 FROM BlogPost b0_'; $this->assertEquals($sql, $q->getSql()); $dql = "SELECT SIN(p.latitude * p.longitude) FROM {$this->entity} p"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $sql = 'SELECT SIN(b0_.latitude * b0_.longitude) AS sclr_0 FROM BlogPost b0_'; $this->assertEquals($sql, $q->getSql()); $dql = "SELECT SIN(RADIANS(p.latitude) * RADIANS(p.longitude)) FROM {$this->entity} p"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $sql = 'SELECT SIN(RADIANS(b0_.latitude) * RADIANS(b0_.longitude)) AS sclr_0 FROM BlogPost b0_'; $this->assertEquals($sql, $q->getSql()); @@ -55,7 +55,7 @@ public function testSin() $this->assertEquals($sql, $q->getSql()); $dql = "SELECT p FROM {$this->entity} p WHERE SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude)) = 1"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $sql = 'SELECT b0_.id AS id_0, b0_.created AS created_1, b0_.longitude AS longitude_2, b0_.latitude AS latitude_3 FROM BlogPost b0_ WHERE SIN(RADIANS(b0_.latitude)) * SIN(RADIANS(b0_.longitude)) = 1'; $this->assertEquals($sql, $q->getSql()); @@ -133,7 +133,7 @@ public function testAtan() // test with 2 arguments $dql = "SELECT ATAN(p.latitude, p.longitude) FROM {$this->entity} p "; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $sql = 'SELECT ATAN(b0_.latitude, b0_.longitude) AS sclr_0 FROM BlogPost b0_'; $this->assertEquals($sql, $q->getSql()); @@ -142,7 +142,7 @@ public function testAtan() public function testAtan2() { $dql = "SELECT ATAN2(p.latitude, p.longitude) FROM {$this->entity} p"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $sql = 'SELECT ATAN2(b0_.latitude, b0_.longitude) AS sclr_0 FROM BlogPost b0_'; $this->assertEquals($sql, $q->getSql()); @@ -150,8 +150,8 @@ public function testAtan2() public function testCosineLaw() { - $lat = 0.0; - $lng = 0.0; + $lat = 0.0; + $lng = 0.0; $radiusOfEarth = 6371; $cosineLaw = 'ACOS(SIN(' . deg2rad($lat) . ') * SIN(RADIANS(p.latitude)) ' @@ -173,14 +173,14 @@ public function testCosineLaw() protected function _assertFirstQuery($func) { - $q = $this->_getFirstDqlQuery($func); + $q = $this->_getFirstDqlQuery($func); $sql = $this->_getFirstSqlQuery($func); $this->assertEquals($sql, $q->getSql()); } protected function _assertSecondQuery($func) { - $q = $this->_getSecondDqlQuery($func); + $q = $this->_getSecondDqlQuery($func); $sql = $this->_getSecondSqlQuery($func); $this->assertEquals($sql, $q->getSql()); } diff --git a/tests/Query/MysqlWalkerTest.php b/tests/Query/MysqlWalkerTest.php index 0a048ae5..ea3bab46 100644 --- a/tests/Query/MysqlWalkerTest.php +++ b/tests/Query/MysqlWalkerTest.php @@ -11,7 +11,7 @@ class MysqlWalkerTest extends MysqlTestCase public function testSelectSQLCalcFoundRows() { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $q->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'DoctrineExtensions\Query\MysqlWalker'); $q->setHint('mysqlWalker.sqlCalcFoundRows', true); $sql = 'SELECT SQL_CALC_FOUND_ROWS d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_'; @@ -22,7 +22,7 @@ public function testSelectSQLCalcFoundRows() public function testSelectSQLNoCache() { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $q->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'DoctrineExtensions\Query\MysqlWalker'); $q->setHint('mysqlWalker.sqlNoCache', true); $sql = 'SELECT SQL_NO_CACHE d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_'; @@ -33,7 +33,7 @@ public function testSelectSQLNoCache() public function testGroupByWithRollup() { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p GROUP BY p.id"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $q->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'DoctrineExtensions\Query\MysqlWalker'); $q->setHint('mysqlWalker.withRollup', true); $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ GROUP BY d0_.id WITH ROLLUP'; diff --git a/tests/Query/Oracle/ListaggTest.php b/tests/Query/Oracle/ListaggTest.php index 7b85fc7d..c1d27bfa 100644 --- a/tests/Query/Oracle/ListaggTest.php +++ b/tests/Query/Oracle/ListaggTest.php @@ -11,7 +11,7 @@ class ListaggTest extends OracleTestCase public function testFullQuery() { $dql = "SELECT LISTAGG(p.id, ',') WITHIN GROUP (ORDER BY p.created) OVER (PARTITION BY p.longitude, p.latitude) FROM DoctrineExtensions\Tests\Entities\BlogPost p"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $sql = "SELECT LISTAGG(b0_.id, ',') WITHIN GROUP ( ORDER BY b0_.created ASC) PARTITION BY (b0_.longitude,b0_.latitude) AS sclr_0 FROM BlogPost b0_"; $this->assertEquals($sql, $q->getSql()); diff --git a/tests/Query/Oracle/TruncTest.php b/tests/Query/Oracle/TruncTest.php index d7e174fb..c255c2a5 100755 --- a/tests/Query/Oracle/TruncTest.php +++ b/tests/Query/Oracle/TruncTest.php @@ -11,7 +11,7 @@ class TruncTest extends OracleTestCase public function testFullQuery() { $dql = 'SELECT TRUNC(d.created, \'YYYY\') FROM DoctrineExtensions\\Tests\\Entities\\Date d'; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $sql = 'SELECT TRUNC(d0_.created, \'YYYY\') AS sclr_0 FROM Date d0_'; $this->assertEquals($sql, $q->getSql()); @@ -20,7 +20,7 @@ public function testFullQuery() public function testShortQuery() { $dql = 'SELECT TRUNC(d.created) FROM DoctrineExtensions\\Tests\\Entities\\Date d'; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $sql = 'SELECT TRUNC(d0_.created) AS sclr_0 FROM Date d0_'; $this->assertEquals($sql, $q->getSql()); diff --git a/tests/Query/Postgresql/DateTest.php b/tests/Query/Postgresql/DateTest.php index 4a928bd7..76fa1326 100644 --- a/tests/Query/Postgresql/DateTest.php +++ b/tests/Query/Postgresql/DateTest.php @@ -13,7 +13,7 @@ class DateTest extends PostgresqlTestCase public function testStrToDate() { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE STR_TO_DATE(p.created, :dateFormat) < :currentTime"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $q->setParameter('dateFormat', '%Y-%m-%d %h:%i %p'); $q->setParameter('currentTime', date('Y-m-d H:i:s')); $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE TO_DATE(d0_.created, ?) < ?'; diff --git a/tests/Query/Postgresql/RegexpReplaceTest.php b/tests/Query/Postgresql/RegexpReplaceTest.php index c1df16ce..a6b7e163 100644 --- a/tests/Query/Postgresql/RegexpReplaceTest.php +++ b/tests/Query/Postgresql/RegexpReplaceTest.php @@ -11,7 +11,7 @@ class RegexpReplaceTest extends PostgresqlTestCase public function testRegexpReplace() { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Set p WHERE REGEXP_REPLACE(p.set, '\d', 'X') LIKE 'testXXX'"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $this->assertEquals( "SELECT s0_.id AS id_0, s0_.set AS set_1 FROM Set s0_ WHERE REGEXP_REPLACE(s0_.set, '\d', 'X') LIKE 'testXXX'", diff --git a/tests/Query/Postgresql/StringTest.php b/tests/Query/Postgresql/StringTest.php index bb21d7fd..3523ceaf 100644 --- a/tests/Query/Postgresql/StringTest.php +++ b/tests/Query/Postgresql/StringTest.php @@ -11,7 +11,7 @@ class StringTest extends PostgresqlTestCase public function testFormatDate() { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE DATE_FORMAT(p.created, :dateFormat) < :currentTime"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $q->setParameter('dateFormat', '%Y-%m-%d %h:%i %p'); $q->setParameter('currentTime', 'YYYY-MM-DD'); diff --git a/tests/Query/Sqlite/NumericFunctionsTest.php b/tests/Query/Sqlite/NumericFunctionsTest.php index 1960703b..1ca0e534 100644 --- a/tests/Query/Sqlite/NumericFunctionsTest.php +++ b/tests/Query/Sqlite/NumericFunctionsTest.php @@ -14,11 +14,11 @@ class NumericFunctionsTest extends SqliteTestCase public function testRound() { $dql = 'SELECT ROUND(1.2345, 2) as outcome FROM DoctrineExtensions\Tests\Entities\Blank p'; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $this->assertEquals("SELECT ROUND(1.2345, 2) AS {$this->columnAlias} FROM Blank b0_", $q->getSql()); $dql = 'SELECT ROUND(1.2345) as outcome FROM DoctrineExtensions\Tests\Entities\Blank p'; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $this->assertEquals("SELECT ROUND(1.2345) AS {$this->columnAlias} FROM Blank b0_", $q->getSql()); } } diff --git a/tests/Query/Sqlite/StringFunctionsTest.php b/tests/Query/Sqlite/StringFunctionsTest.php index 4b19daf0..7273f77d 100644 --- a/tests/Query/Sqlite/StringFunctionsTest.php +++ b/tests/Query/Sqlite/StringFunctionsTest.php @@ -14,14 +14,14 @@ class StringFunctionsTest extends SqliteTestCase public function testIfNull() { $dql = 'SELECT IFNULL(p.id, 0) as outcome FROM DoctrineExtensions\Tests\Entities\Blank p'; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $this->assertEquals("SELECT IFNULL(b0_.id, 0) AS {$this->columnAlias} FROM Blank b0_", $q->getSql()); } public function testReplace() { $dql = "SELECT REPLACE(p.id, '1', '2') as outcome FROM DoctrineExtensions\\Tests\\Entities\\Blank p"; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $this->assertEquals("SELECT REPLACE(b0_.id, '1', '2') AS {$this->columnAlias} FROM Blank b0_", $q->getSql()); } diff --git a/tests/Types/CarbonDateTest.php b/tests/Types/CarbonDateTest.php index f4f584c0..fe114680 100755 --- a/tests/Types/CarbonDateTest.php +++ b/tests/Types/CarbonDateTest.php @@ -60,8 +60,8 @@ public function setUp(): void $this->em->getClassMetadata('DoctrineExtensions\Tests\Entities\CarbonDate'), ]); - $entity = new Entity(); - $entity->id = 1; + $entity = new Entity(); + $entity->id = 1; $entity->date = Carbon::createFromDate(2015, 1, 1); $entity->datetime = Carbon::create(2015, 1, 1, 0, 0, 0); $entity->datetime_tz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); @@ -87,8 +87,8 @@ public function testDateGetter() public function testDateSetter() { - $entity = new Entity(); - $entity->id = 2; + $entity = new Entity(); + $entity->id = 2; $entity->date = Carbon::createFromDate(2015, 1, 1); $this->em->persist($entity); @@ -105,8 +105,8 @@ public function testDateTimeGetter() public function testDateTimeSetter() { - $entity = new Entity(); - $entity->id = 2; + $entity = new Entity(); + $entity->id = 2; $entity->datetime = Carbon::create(2015, 1, 1, 0, 0, 0); $this->em->persist($entity); @@ -123,8 +123,8 @@ public function testDateTimeTzGetter() public function testDateTimeTzSetter() { - $entity = new Entity(); - $entity->id = 2; + $entity = new Entity(); + $entity->id = 2; $entity->datetime_tz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); $this->em->persist($entity); @@ -141,8 +141,8 @@ public function testTimeGetter() public function testTimeSetter() { - $entity = new Entity(); - $entity->id = 2; + $entity = new Entity(); + $entity->id = 2; $entity->time = Carbon::createFromTime(12, 0, 0, 'Europe/London'); $this->em->persist($entity); @@ -162,8 +162,8 @@ public function testImmutableDateGetter() public function testImmutableDateSetter() { - $entity = new Entity(); - $entity->id = 2; + $entity = new Entity(); + $entity->id = 2; $entity->date = CarbonImmutable::createFromDate(2015, 1, 1); $this->em->persist($entity); @@ -180,8 +180,8 @@ public function testImmutableDateTimeGetter() public function testImmutableDateTimeSetter() { - $entity = new Entity(); - $entity->id = 2; + $entity = new Entity(); + $entity->id = 2; $entity->datetime = CarbonImmutable::create(2015, 1, 1, 0, 0, 0); $this->em->persist($entity); @@ -198,8 +198,8 @@ public function testImmutableDateTimeTzGetter() public function testImmutableDateTimeTzSetter() { - $entity = new Entity(); - $entity->id = 2; + $entity = new Entity(); + $entity->id = 2; $entity->datetime_tz = CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); $this->em->persist($entity); @@ -216,8 +216,8 @@ public function testImmutableTimeGetter() public function testImmutableTimeSetter() { - $entity = new Entity(); - $entity->id = 2; + $entity = new Entity(); + $entity->id = 2; $entity->time = CarbonImmutable::createFromTime(12, 0, 0, 'Europe/London'); $this->em->persist($entity); From f29d220bd78dc9fba2f92c0687250d958fc2019c Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:11:09 +0100 Subject: [PATCH 17/43] Code Sniffer: apply rule SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants.DisallowedLateStaticBindingForConstant --- src/Types/CarbonDateTimeType.php | 2 +- src/Types/CarbonDateTimeTzType.php | 2 +- src/Types/CarbonDateType.php | 2 +- src/Types/CarbonImmutableDateTimeType.php | 2 +- src/Types/CarbonImmutableDateTimeTzType.php | 2 +- src/Types/CarbonImmutableDateType.php | 2 +- src/Types/CarbonImmutableTimeType.php | 2 +- src/Types/CarbonTimeType.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Types/CarbonDateTimeType.php b/src/Types/CarbonDateTimeType.php index feeeb3b4..e772f47a 100644 --- a/src/Types/CarbonDateTimeType.php +++ b/src/Types/CarbonDateTimeType.php @@ -15,7 +15,7 @@ class CarbonDateTimeType extends DateTimeType public function getName() { - return static::CARBONDATETIME; + return self::CARBONDATETIME; } public function convertToPHPValue($value, AbstractPlatform $platform) diff --git a/src/Types/CarbonDateTimeTzType.php b/src/Types/CarbonDateTimeTzType.php index ea2851f6..4cb7650d 100644 --- a/src/Types/CarbonDateTimeTzType.php +++ b/src/Types/CarbonDateTimeTzType.php @@ -15,7 +15,7 @@ class CarbonDateTimeTzType extends DateTimeTzType public function getName() { - return static::CARBONDATETIMETZ; + return self::CARBONDATETIMETZ; } public function convertToPHPValue($value, AbstractPlatform $platform) diff --git a/src/Types/CarbonDateType.php b/src/Types/CarbonDateType.php index 48bc7c15..314875ca 100644 --- a/src/Types/CarbonDateType.php +++ b/src/Types/CarbonDateType.php @@ -15,7 +15,7 @@ class CarbonDateType extends DateType public function getName() { - return static::CARBONDATE; + return self::CARBONDATE; } public function convertToPHPValue($value, AbstractPlatform $platform) diff --git a/src/Types/CarbonImmutableDateTimeType.php b/src/Types/CarbonImmutableDateTimeType.php index c894eb2a..270ba339 100644 --- a/src/Types/CarbonImmutableDateTimeType.php +++ b/src/Types/CarbonImmutableDateTimeType.php @@ -15,7 +15,7 @@ class CarbonImmutableDateTimeType extends DateTimeType public function getName() { - return static::CARBONDATETIME; + return self::CARBONDATETIME; } public function convertToPHPValue($value, AbstractPlatform $platform) diff --git a/src/Types/CarbonImmutableDateTimeTzType.php b/src/Types/CarbonImmutableDateTimeTzType.php index d3de1d33..56a3235c 100644 --- a/src/Types/CarbonImmutableDateTimeTzType.php +++ b/src/Types/CarbonImmutableDateTimeTzType.php @@ -15,7 +15,7 @@ class CarbonImmutableDateTimeTzType extends DateTimeTzType public function getName() { - return static::CARBONDATETIMETZ; + return self::CARBONDATETIMETZ; } public function convertToPHPValue($value, AbstractPlatform $platform) diff --git a/src/Types/CarbonImmutableDateType.php b/src/Types/CarbonImmutableDateType.php index d781297e..d05ef69e 100644 --- a/src/Types/CarbonImmutableDateType.php +++ b/src/Types/CarbonImmutableDateType.php @@ -15,7 +15,7 @@ class CarbonImmutableDateType extends DateType public function getName() { - return static::CARBONDATE; + return self::CARBONDATE; } public function convertToPHPValue($value, AbstractPlatform $platform) diff --git a/src/Types/CarbonImmutableTimeType.php b/src/Types/CarbonImmutableTimeType.php index bad6df72..31757a5c 100644 --- a/src/Types/CarbonImmutableTimeType.php +++ b/src/Types/CarbonImmutableTimeType.php @@ -15,7 +15,7 @@ class CarbonImmutableTimeType extends TimeType public function getName() { - return static::CARBONTIME; + return self::CARBONTIME; } public function convertToPHPValue($value, AbstractPlatform $platform) diff --git a/src/Types/CarbonTimeType.php b/src/Types/CarbonTimeType.php index 12bb8340..7415b081 100644 --- a/src/Types/CarbonTimeType.php +++ b/src/Types/CarbonTimeType.php @@ -15,7 +15,7 @@ class CarbonTimeType extends TimeType public function getName() { - return static::CARBONTIME; + return self::CARBONTIME; } public function convertToPHPValue($value, AbstractPlatform $platform) From 949ead1a7e32b533fc652e449b62a7f0ac0e3fa1 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:14:53 +0100 Subject: [PATCH 18/43] Code Sniffer: apply rule SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectOrderOfAnnotationsGroup --- src/Query/Mysql/Cast.php | 4 ++-- src/Query/Mysql/FromBase64.php | 4 ++-- src/Query/Mysql/SecToTime.php | 3 ++- src/Query/Mysql/TimeToSec.php | 3 ++- src/Query/MysqlWalker.php | 4 ++-- src/Query/Postgresql/RegexpReplace.php | 3 ++- src/Query/SortableNullsWalker.php | 1 + src/Query/Sqlite/Week.php | 1 + 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Query/Mysql/Cast.php b/src/Query/Mysql/Cast.php index 98089f60..6d5f2975 100644 --- a/src/Query/Mysql/Cast.php +++ b/src/Query/Mysql/Cast.php @@ -19,9 +19,9 @@ /** * "CAST" "(" "$fieldIdentifierExpression" "AS" "$castingTypeExpression" ")" * - * @example SELECT CAST(foo.bar AS SIGNED) FROM dual; - * * @link https://dev.mysql.com/doc/refman/en/cast-functions.html#function_cast + * + * @example SELECT CAST(foo.bar AS SIGNED) FROM dual; */ class Cast extends FunctionNode { diff --git a/src/Query/Mysql/FromBase64.php b/src/Query/Mysql/FromBase64.php index 937e1f84..7360fb3b 100644 --- a/src/Query/Mysql/FromBase64.php +++ b/src/Query/Mysql/FromBase64.php @@ -12,9 +12,9 @@ /** * "FROM_BASE64" "(" "$fieldIdentifierExpression" ")" * - * @example SELECT FROM_BASE64(foo) FROM dual; - * * @link https://dev.mysql.com/doc/refman/en/string-functions.html#function_from-base64 + * + * @example SELECT FROM_BASE64(foo) FROM dual; */ class FromBase64 extends FunctionNode { diff --git a/src/Query/Mysql/SecToTime.php b/src/Query/Mysql/SecToTime.php index 6fb766c5..21151751 100644 --- a/src/Query/Mysql/SecToTime.php +++ b/src/Query/Mysql/SecToTime.php @@ -10,8 +10,9 @@ use Doctrine\ORM\Query\SqlWalker; /** - * @example SELECT SEC_TO_TIME(2378); * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_sec-to-time + * + * @example SELECT SEC_TO_TIME(2378); */ class SecToTime extends FunctionNode { diff --git a/src/Query/Mysql/TimeToSec.php b/src/Query/Mysql/TimeToSec.php index e827ceb5..b04e1403 100644 --- a/src/Query/Mysql/TimeToSec.php +++ b/src/Query/Mysql/TimeToSec.php @@ -10,8 +10,9 @@ use Doctrine\ORM\Query\SqlWalker; /** - * @example SELECT TIME_TO_SEC('22:23:00'); * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_time-to-sec + * + * @example SELECT TIME_TO_SEC('22:23:00'); */ class TimeToSec extends FunctionNode { diff --git a/src/Query/MysqlWalker.php b/src/Query/MysqlWalker.php index bd053112..12be5f71 100644 --- a/src/Query/MysqlWalker.php +++ b/src/Query/MysqlWalker.php @@ -11,9 +11,9 @@ class MysqlWalker extends SqlWalker { /** - * @inheritdoc - * * @return array|string + * + * @inheritdoc */ public function walkSelectClause($selectClause) { diff --git a/src/Query/Postgresql/RegexpReplace.php b/src/Query/Postgresql/RegexpReplace.php index 558de024..3b2255bc 100644 --- a/src/Query/Postgresql/RegexpReplace.php +++ b/src/Query/Postgresql/RegexpReplace.php @@ -10,8 +10,9 @@ use Doctrine\ORM\Query\SqlWalker; /** - * @example SELECT REGEXP_REPLACE(string, search, replace) * @link https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-TABLE + * + * @example SELECT REGEXP_REPLACE(string, search, replace) */ class RegexpReplace extends FunctionNode { diff --git a/src/Query/SortableNullsWalker.php b/src/Query/SortableNullsWalker.php index b85e61a3..f7536f62 100644 --- a/src/Query/SortableNullsWalker.php +++ b/src/Query/SortableNullsWalker.php @@ -41,6 +41,7 @@ class SortableNullsWalker extends Query\SqlWalker /** * @param $orderByItem + * * @return array|string */ public function walkOrderByItem($orderByItem) diff --git a/src/Query/Sqlite/Week.php b/src/Query/Sqlite/Week.php index 294dd52b..841a92fe 100644 --- a/src/Query/Sqlite/Week.php +++ b/src/Query/Sqlite/Week.php @@ -11,6 +11,7 @@ class Week extends NumberFromStrfTime { /** * Currently not in use + * * @var int */ public $mode; From 4814ea205ee30c351aa670c87305bf9d85f1afa5 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:16:02 +0100 Subject: [PATCH 19/43] Code Sniffer: apply rule SlevomatCodingStandard.PHP.UselessParentheses.UselessParentheses --- src/Query/Mysql/Atan.php | 2 +- src/Types/ZendDateType.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Query/Mysql/Atan.php b/src/Query/Mysql/Atan.php index be8b7d00..f22cdb2b 100644 --- a/src/Query/Mysql/Atan.php +++ b/src/Query/Mysql/Atan.php @@ -28,7 +28,7 @@ public function getSql(SqlWalker $sqlWalker): string return 'ATAN(' . $sqlWalker->walkSimpleArithmeticExpression( $this->arithmeticExpression - ) . (($secondArgument) ? ', ' . $secondArgument : '') + ) . ($secondArgument ? ', ' . $secondArgument : '') . ')'; } diff --git a/src/Types/ZendDateType.php b/src/Types/ZendDateType.php index bc9e01b5..56ff2ceb 100755 --- a/src/Types/ZendDateType.php +++ b/src/Types/ZendDateType.php @@ -35,7 +35,7 @@ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $pla public function convertToDatabaseValue($value, AbstractPlatform $platform) { - return ($value !== null) + return $value !== null ? $value->toString(Zend_Locale_Format::convertPhpToIsoFormat( $platform->getDateTimeFormatString() )) From 42c9f39a678fb42a5a4caaa2ca1fe404b383ed38 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:16:40 +0100 Subject: [PATCH 20/43] Code Sniffer: apply rule SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint --- src/Types/ZendDateType.php | 2 +- tests/Query/DbTestCase.php | 2 +- tests/Query/Mysql/AcosTest.php | 2 +- tests/Query/Mysql/AddTimeTest.php | 2 +- tests/Query/Mysql/AsciiTest.php | 2 +- tests/Query/Mysql/AsinTest.php | 2 +- tests/Query/Mysql/Atan2Test.php | 2 +- tests/Query/Mysql/AtanTest.php | 2 +- tests/Query/Mysql/BinaryTest.php | 2 +- tests/Query/Mysql/BitCountTest.php | 2 +- tests/Query/Mysql/BitXorTest.php | 2 +- tests/Query/Mysql/CastTest.php | 6 ++-- tests/Query/Mysql/CeilTest.php | 2 +- tests/Query/Mysql/CharLengthTest.php | 2 +- tests/Query/Mysql/CollateTest.php | 2 +- tests/Query/Mysql/ConcatWsTest.php | 2 +- tests/Query/Mysql/ConvertTzTest.php | 2 +- tests/Query/Mysql/CosTest.php | 2 +- tests/Query/Mysql/CotTest.php | 2 +- tests/Query/Mysql/CountIfTest.php | 4 +-- tests/Query/Mysql/Crc32Test.php | 2 +- tests/Query/Mysql/DateAddTest.php | 2 +- tests/Query/Mysql/DateDiffTest.php | 4 +-- tests/Query/Mysql/DateFormatTest.php | 2 +- tests/Query/Mysql/DateSubTest.php | 2 +- tests/Query/Mysql/DateTest.php | 20 ++++++------ tests/Query/Mysql/DayNameTest.php | 2 +- tests/Query/Mysql/DayOfWeekTest.php | 2 +- tests/Query/Mysql/DayOfYearTest.php | 2 +- tests/Query/Mysql/DayTest.php | 2 +- tests/Query/Mysql/DegressTest.php | 2 +- tests/Query/Mysql/DivTest.php | 2 +- tests/Query/Mysql/ExpTest.php | 2 +- tests/Query/Mysql/FieldTest.php | 2 +- tests/Query/Mysql/FindInSetTest.php | 2 +- tests/Query/Mysql/FloorTest.php | 2 +- tests/Query/Mysql/FormatTest.php | 2 +- tests/Query/Mysql/FromBase64.php | 2 +- tests/Query/Mysql/FromUnixTimeTest.php | 2 +- tests/Query/Mysql/GreatestTest.php | 2 +- tests/Query/Mysql/GroupConcatTest.php | 8 ++--- tests/Query/Mysql/HexTest.php | 2 +- tests/Query/Mysql/HourTest.php | 2 +- tests/Query/Mysql/IfElseTest.php | 4 +-- tests/Query/Mysql/IfNullTest.php | 2 +- tests/Query/Mysql/Inet6AtonTest.php | 2 +- tests/Query/Mysql/Inet6NtoaTest.php | 2 +- tests/Query/Mysql/InetAtonTest.php | 2 +- tests/Query/Mysql/InetNtoaTest.php | 2 +- tests/Query/Mysql/IsIpv4CompatTest.php | 2 +- tests/Query/Mysql/IsIpv4MappedTest.php | 2 +- tests/Query/Mysql/IsIpv4Test.php | 2 +- tests/Query/Mysql/IsIpv6Test.php | 2 +- tests/Query/Mysql/LagTest.php | 2 +- tests/Query/Mysql/LastDayTest.php | 2 +- tests/Query/Mysql/LeadTest.php | 2 +- tests/Query/Mysql/LeastTest.php | 2 +- tests/Query/Mysql/Log10Test.php | 2 +- tests/Query/Mysql/Log2Test.php | 2 +- tests/Query/Mysql/LogTest.php | 2 +- tests/Query/Mysql/LpadTest.php | 2 +- tests/Query/Mysql/MakeDateTest.php | 2 +- tests/Query/Mysql/MatchAgainstTest.php | 8 ++--- tests/Query/Mysql/Md5Test.php | 2 +- tests/Query/Mysql/MinuteTest.php | 2 +- tests/Query/Mysql/MonthNameTest.php | 2 +- tests/Query/Mysql/MonthTest.php | 2 +- tests/Query/Mysql/NowTest.php | 2 +- tests/Query/Mysql/NullIfTest.php | 2 +- tests/Query/Mysql/PiTest.php | 2 +- tests/Query/Mysql/PowerTest.php | 2 +- tests/Query/Mysql/QuarterTest.php | 2 +- tests/Query/Mysql/RadiansTest.php | 2 +- tests/Query/Mysql/RandTest.php | 4 +-- tests/Query/Mysql/RegexpTest.php | 2 +- tests/Query/Mysql/ReplaceTest.php | 2 +- tests/Query/Mysql/RoundTest.php | 4 +-- tests/Query/Mysql/RpadTest.php | 2 +- tests/Query/Mysql/SecondTest.php | 2 +- tests/Query/Mysql/SetTest.php | 2 +- tests/Query/Mysql/Sha1Test.php | 2 +- tests/Query/Mysql/Sha2Test.php | 2 +- tests/Query/Mysql/SinTest.php | 2 +- tests/Query/Mysql/SoundexTest.php | 2 +- tests/Query/Mysql/StdDevTest.php | 2 +- tests/Query/Mysql/StdTest.php | 2 +- tests/Query/Mysql/StrToDateTest.php | 2 +- tests/Query/Mysql/StringTest.php | 30 +++++++++--------- tests/Query/Mysql/SubstringIndexTest.php | 2 +- tests/Query/Mysql/TanTest.php | 2 +- tests/Query/Mysql/TimeDiffTest.php | 2 +- tests/Query/Mysql/TimeTest.php | 2 +- tests/Query/Mysql/TimeToSecTest.php | 2 +- tests/Query/Mysql/TimestampAddTest.php | 2 +- tests/Query/Mysql/TimestampDiffTest.php | 2 +- tests/Query/Mysql/TrigTest.php | 26 ++++++++-------- tests/Query/Mysql/UnixTimestampTest.php | 4 +-- tests/Query/Mysql/UtcTimestampTest.php | 2 +- tests/Query/Mysql/UuidShortTest.php | 2 +- tests/Query/Mysql/VarianceTest.php | 2 +- tests/Query/Mysql/WeekDayTest.php | 2 +- tests/Query/Mysql/WeekOfYearTest.php | 2 +- tests/Query/Mysql/WeekTest.php | 2 +- tests/Query/Mysql/YearTest.php | 2 +- tests/Query/Mysql/YearWeekTest.php | 2 +- tests/Query/MysqlWalkerTest.php | 6 ++-- tests/Query/Oracle/CeilTest.php | 2 +- tests/Query/Oracle/DayTest.php | 2 +- tests/Query/Oracle/FloorTest.php | 2 +- tests/Query/Oracle/HourTest.php | 2 +- tests/Query/Oracle/ListaggTest.php | 2 +- tests/Query/Oracle/MinuteTest.php | 2 +- tests/Query/Oracle/MonthTest.php | 2 +- tests/Query/Oracle/SecondTest.php | 2 +- tests/Query/Oracle/ToCharTest.php | 2 +- tests/Query/Oracle/TruncTest.php | 4 +-- tests/Query/Oracle/YearTest.php | 2 +- tests/Query/Postgresql/AtTimeZoneTest.php | 2 +- tests/Query/Postgresql/CountFilterTest.php | 2 +- tests/Query/Postgresql/DatePartTest.php | 2 +- tests/Query/Postgresql/DateTest.php | 4 +-- tests/Query/Postgresql/DateTruncTest.php | 2 +- tests/Query/Postgresql/DayTest.php | 2 +- tests/Query/Postgresql/GreatestTest.php | 2 +- tests/Query/Postgresql/HourTest.php | 2 +- tests/Query/Postgresql/LeastTest.php | 2 +- tests/Query/Postgresql/MinuteTest.php | 2 +- tests/Query/Postgresql/MonthTest.php | 2 +- tests/Query/Postgresql/RegexpReplaceTest.php | 2 +- tests/Query/Postgresql/SecondTest.php | 2 +- tests/Query/Postgresql/StringAggTest.php | 10 +++--- tests/Query/Postgresql/StringTest.php | 2 +- tests/Query/Postgresql/YearTest.php | 2 +- tests/Query/Sqlite/ConcatWsTest.php | 2 +- tests/Query/Sqlite/DateFormatTest.php | 4 +-- tests/Query/Sqlite/DayTest.php | 2 +- tests/Query/Sqlite/GreatestTest.php | 2 +- tests/Query/Sqlite/HourTest.php | 2 +- tests/Query/Sqlite/IfElseTest.php | 2 +- tests/Query/Sqlite/JulianDayTest.php | 2 +- tests/Query/Sqlite/LeastTest.php | 2 +- tests/Query/Sqlite/MinuteTest.php | 2 +- tests/Query/Sqlite/MonthTest.php | 2 +- tests/Query/Sqlite/NumericFunctionsTest.php | 2 +- tests/Query/Sqlite/RandomTest.php | 2 +- tests/Query/Sqlite/SecondTest.php | 2 +- tests/Query/Sqlite/StrfTimeTest.php | 2 +- tests/Query/Sqlite/StringFunctionsTest.php | 6 ++-- tests/Query/Sqlite/WeekDayTest.php | 2 +- tests/Query/Sqlite/WeekTest.php | 4 +-- tests/Query/Sqlite/YearTest.php | 2 +- tests/Types/CarbonDateTest.php | 32 ++++++++++---------- 152 files changed, 228 insertions(+), 228 deletions(-) diff --git a/src/Types/ZendDateType.php b/src/Types/ZendDateType.php index 56ff2ceb..b47b5737 100755 --- a/src/Types/ZendDateType.php +++ b/src/Types/ZendDateType.php @@ -42,7 +42,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) : null; } - public function convertToPHPValue($value, AbstractPlatform $platform) + public function convertToPHPValue($value, AbstractPlatform $platform): void { if ($value === null) { return; diff --git a/tests/Query/DbTestCase.php b/tests/Query/DbTestCase.php index 1d513f9b..2ad997ca 100644 --- a/tests/Query/DbTestCase.php +++ b/tests/Query/DbTestCase.php @@ -29,7 +29,7 @@ public function setUp(): void $this->entityManager = EntityManager::create(['driver' => 'pdo_sqlite', 'memory' => true ], $this->configuration); } - public function assertDqlProducesSql($actualDql, $expectedSql, $params = []) + public function assertDqlProducesSql($actualDql, $expectedSql, $params = []): void { $q = $this->entityManager->createQuery($actualDql); diff --git a/tests/Query/Mysql/AcosTest.php b/tests/Query/Mysql/AcosTest.php index d0ca0380..196f467f 100644 --- a/tests/Query/Mysql/AcosTest.php +++ b/tests/Query/Mysql/AcosTest.php @@ -8,7 +8,7 @@ class AcosTest extends MysqlTestCase { - public function testAcos() + public function testAcos(): void { $this->assertDqlProducesSql( "SELECT ACOS(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/AddTimeTest.php b/tests/Query/Mysql/AddTimeTest.php index 4c7eb4e2..169ab0dd 100644 --- a/tests/Query/Mysql/AddTimeTest.php +++ b/tests/Query/Mysql/AddTimeTest.php @@ -8,7 +8,7 @@ class AddTimeTest extends MysqlTestCase { - public function testDateAdd() + public function testDateAdd(): void { $this->assertDqlProducesSql( "SELECT ADDTIME('2019-03-01 14:35:00','01:02:03') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/AsciiTest.php b/tests/Query/Mysql/AsciiTest.php index cc863803..15505bac 100644 --- a/tests/Query/Mysql/AsciiTest.php +++ b/tests/Query/Mysql/AsciiTest.php @@ -8,7 +8,7 @@ class AsciiTest extends MysqlTestCase { - public function testAscii() + public function testAscii(): void { $this->assertDqlProducesSql( "SELECT ASCII(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/AsinTest.php b/tests/Query/Mysql/AsinTest.php index 48239e6a..50a8424a 100644 --- a/tests/Query/Mysql/AsinTest.php +++ b/tests/Query/Mysql/AsinTest.php @@ -8,7 +8,7 @@ class AsinTest extends MysqlTestCase { - public function testAsin() + public function testAsin(): void { $this->assertDqlProducesSql( "SELECT ASIN(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/Atan2Test.php b/tests/Query/Mysql/Atan2Test.php index a643a959..6c27b971 100644 --- a/tests/Query/Mysql/Atan2Test.php +++ b/tests/Query/Mysql/Atan2Test.php @@ -6,7 +6,7 @@ class Atan2Test { - public function testAtan2() + public function testAtan2(): void { $this->assertDqlProducesSql( "SELECT ATAN2(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/AtanTest.php b/tests/Query/Mysql/AtanTest.php index f8e061ce..f4ce6fd8 100644 --- a/tests/Query/Mysql/AtanTest.php +++ b/tests/Query/Mysql/AtanTest.php @@ -8,7 +8,7 @@ class AtanTest extends MysqlTestCase { - public function testAtan() + public function testAtan(): void { $this->assertDqlProducesSql( "SELECT ATAN(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/BinaryTest.php b/tests/Query/Mysql/BinaryTest.php index abbbfdcf..0a0c2972 100644 --- a/tests/Query/Mysql/BinaryTest.php +++ b/tests/Query/Mysql/BinaryTest.php @@ -8,7 +8,7 @@ class BinaryTest extends MysqlTestCase { - public function testBinary() + public function testBinary(): void { $this->assertDqlProducesSql( "SELECT BINARY('TEST') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/BitCountTest.php b/tests/Query/Mysql/BitCountTest.php index 3bc28e9c..e02fa240 100644 --- a/tests/Query/Mysql/BitCountTest.php +++ b/tests/Query/Mysql/BitCountTest.php @@ -8,7 +8,7 @@ class BitCountTest extends MysqlTestCase { - public function testBitCount() + public function testBitCount(): void { $this->assertDqlProducesSql( "SELECT BIT_COUNT(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/BitXorTest.php b/tests/Query/Mysql/BitXorTest.php index 662b39e5..e055ec86 100644 --- a/tests/Query/Mysql/BitXorTest.php +++ b/tests/Query/Mysql/BitXorTest.php @@ -8,7 +8,7 @@ class BitXorTest extends MysqlTestCase { - public function testBitCount() + public function testBitCount(): void { $this->assertDqlProducesSql( "SELECT BIT_XOR(2, 2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/CastTest.php b/tests/Query/Mysql/CastTest.php index cbebcaa2..5b69b2dd 100644 --- a/tests/Query/Mysql/CastTest.php +++ b/tests/Query/Mysql/CastTest.php @@ -12,7 +12,7 @@ class CastTest extends MysqlTestCase private $entityShort = 'BlogPost'; - public function testSimpleSqlQuery() + public function testSimpleSqlQuery(): void { $query = $this->entityManager->createQuery( "SELECT CAST(blog.latitude AS SIGNED) FROM {$this->entityLong} blog" @@ -24,7 +24,7 @@ public function testSimpleSqlQuery() ); } - public function testMultipleCastWithFieldAliasSqlQuery() + public function testMultipleCastWithFieldAliasSqlQuery(): void { $query = $this->entityManager->createQuery( "SELECT CAST(blog.latitude AS UNSIGNED), CAST(blog.latitude AS SIGNED) FROM {$this->entityLong} blog" @@ -36,7 +36,7 @@ public function testMultipleCastWithFieldAliasSqlQuery() ); } - public function testWithParametersSqlQuery() + public function testWithParametersSqlQuery(): void { $query = $this->entityManager->createQuery( "SELECT CAST(blog.latitude AS DECIMAL(10, 2)) FROM {$this->entityLong} blog" diff --git a/tests/Query/Mysql/CeilTest.php b/tests/Query/Mysql/CeilTest.php index e29bd7bc..70acffde 100644 --- a/tests/Query/Mysql/CeilTest.php +++ b/tests/Query/Mysql/CeilTest.php @@ -8,7 +8,7 @@ class CeilTest extends MysqlTestCase { - public function testCeil() + public function testCeil(): void { $this->assertDqlProducesSql( "SELECT CEIL(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/CharLengthTest.php b/tests/Query/Mysql/CharLengthTest.php index 6a09c481..c1873558 100644 --- a/tests/Query/Mysql/CharLengthTest.php +++ b/tests/Query/Mysql/CharLengthTest.php @@ -8,7 +8,7 @@ class CharLengthTest extends MysqlTestCase { - public function testCharLength() + public function testCharLength(): void { $this->assertDqlProducesSql( "SELECT CHAR_LENGTH(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/CollateTest.php b/tests/Query/Mysql/CollateTest.php index 267e80d4..fe964cad 100644 --- a/tests/Query/Mysql/CollateTest.php +++ b/tests/Query/Mysql/CollateTest.php @@ -8,7 +8,7 @@ class CollateTest extends MysqlTestCase { - public function testCollate() + public function testCollate(): void { $this->assertDqlProducesSql( "SELECT COLLATE('A',latin1_german2_ci) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/ConcatWsTest.php b/tests/Query/Mysql/ConcatWsTest.php index d4b6b633..6d774e33 100644 --- a/tests/Query/Mysql/ConcatWsTest.php +++ b/tests/Query/Mysql/ConcatWsTest.php @@ -8,7 +8,7 @@ class ConcatWsTest extends MysqlTestCase { - public function testConcatWs() + public function testConcatWs(): void { $this->assertDqlProducesSql( "SELECT CONCAT_WS(',', 'TEST', 'FOO') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/ConvertTzTest.php b/tests/Query/Mysql/ConvertTzTest.php index 1d8bab89..4201ed06 100644 --- a/tests/Query/Mysql/ConvertTzTest.php +++ b/tests/Query/Mysql/ConvertTzTest.php @@ -8,7 +8,7 @@ class ConvertTzTest extends MysqlTestCase { - public function testDefaultSql() + public function testDefaultSql(): void { $query = $this->entityManager->createQuery( "SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET') FROM DoctrineExtensions\Tests\Entities\Blank b" diff --git a/tests/Query/Mysql/CosTest.php b/tests/Query/Mysql/CosTest.php index b64c6631..f59bd01d 100644 --- a/tests/Query/Mysql/CosTest.php +++ b/tests/Query/Mysql/CosTest.php @@ -8,7 +8,7 @@ class CosTest extends MysqlTestCase { - public function testCos() + public function testCos(): void { $this->assertDqlProducesSql( "SELECT COS(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/CotTest.php b/tests/Query/Mysql/CotTest.php index 8e8aefba..78c49b37 100644 --- a/tests/Query/Mysql/CotTest.php +++ b/tests/Query/Mysql/CotTest.php @@ -8,7 +8,7 @@ class CotTest extends MysqlTestCase { - public function testCot() + public function testCot(): void { $this->assertDqlProducesSql( "SELECT COT(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/CountIfTest.php b/tests/Query/Mysql/CountIfTest.php index 57ce0d80..f82de7f6 100644 --- a/tests/Query/Mysql/CountIfTest.php +++ b/tests/Query/Mysql/CountIfTest.php @@ -8,7 +8,7 @@ class CountIfTest extends MysqlTestCase { - public function testCountIf() + public function testCountIf(): void { $this->assertDqlProducesSql( "SELECT COUNTIF(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", @@ -16,7 +16,7 @@ public function testCountIf() ); } - public function testCountIfInverse() + public function testCountIfInverse(): void { $this->assertDqlProducesSql( "SELECT COUNTIF(2, 3 INVERSE) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/Crc32Test.php b/tests/Query/Mysql/Crc32Test.php index 6bed1b18..148d1d69 100644 --- a/tests/Query/Mysql/Crc32Test.php +++ b/tests/Query/Mysql/Crc32Test.php @@ -8,7 +8,7 @@ class Crc32Test extends MysqlTestCase { - public function testCrc32() + public function testCrc32(): void { $this->assertDqlProducesSql( "SELECT CRC32('TEST') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/DateAddTest.php b/tests/Query/Mysql/DateAddTest.php index 0424dd1a..c5701871 100644 --- a/tests/Query/Mysql/DateAddTest.php +++ b/tests/Query/Mysql/DateAddTest.php @@ -8,7 +8,7 @@ class DateAddTest extends MysqlTestCase { - public function testDateAdd() + public function testDateAdd(): void { $this->assertDqlProducesSql( "SELECT DATEADD(2, 5, 'MINUTE') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/DateDiffTest.php b/tests/Query/Mysql/DateDiffTest.php index f3c98a91..654747dd 100644 --- a/tests/Query/Mysql/DateDiffTest.php +++ b/tests/Query/Mysql/DateDiffTest.php @@ -8,7 +8,7 @@ class DateDiffTest extends MysqlTestCase { - public function testDateDiff() + public function testDateDiff(): void { $this->assertDqlProducesSql( "SELECT DATEDIFF('2017-06-25', '2017-06-15') from DoctrineExtensions\Tests\Entities\Blank b", @@ -16,7 +16,7 @@ public function testDateDiff() ); } - public function testDateDiffWithColumnAlias() + public function testDateDiffWithColumnAlias(): void { $this->assertDqlProducesSql( "SELECT DATEADD(p.created, 1, 'DAY') as modified_date FROM DoctrineExtensions\Tests\Entities\Date as p WHERE DATEDIFF(CURRENT_TIME(), modified_date) < 7", diff --git a/tests/Query/Mysql/DateFormatTest.php b/tests/Query/Mysql/DateFormatTest.php index 8b85e542..b8c15297 100644 --- a/tests/Query/Mysql/DateFormatTest.php +++ b/tests/Query/Mysql/DateFormatTest.php @@ -8,7 +8,7 @@ class DateFormatTest extends MysqlTestCase { - public function testDateFormat() + public function testDateFormat(): void { $this->assertDqlProducesSql( "SELECT DATE_FORMAT(2, 'Y') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/DateSubTest.php b/tests/Query/Mysql/DateSubTest.php index 9e570c39..e97d37a9 100644 --- a/tests/Query/Mysql/DateSubTest.php +++ b/tests/Query/Mysql/DateSubTest.php @@ -8,7 +8,7 @@ class DateSubTest extends MysqlTestCase { - public function testDateSub() + public function testDateSub(): void { $this->assertDqlProducesSql( "SELECT DATESUB(2, 5, 'MINUTE') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/DateTest.php b/tests/Query/Mysql/DateTest.php index 4bcd3d45..7e5a848b 100644 --- a/tests/Query/Mysql/DateTest.php +++ b/tests/Query/Mysql/DateTest.php @@ -11,7 +11,7 @@ class DateTest extends MysqlTestCase { - public function testDateDiff() + public function testDateDiff(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE DATEDIFF(CURRENT_TIME(), p.created) < 7"; $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE DATEDIFF(CURRENT_TIME, d0_.created) < 7'; @@ -19,7 +19,7 @@ public function testDateDiff() $this->assertDqlProducesSql($dql, $sql); } - public function testDateAdd() + public function testDateAdd(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE DATEADD(CURRENT_TIME(), 4, 'MONTH') < 7"; $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE DATE_ADD(CURRENT_TIME, INTERVAL 4 MONTH) < 7'; @@ -27,7 +27,7 @@ public function testDateAdd() $this->assertDqlProducesSql($dql, $sql); } - public function testDateAddWithColumnAlias() + public function testDateAddWithColumnAlias(): void { if (Version::VERSION < 2.2) { $this->markTestSkipped('Alias is not supported in Doctrine 2.1 and lower'); @@ -39,7 +39,7 @@ public function testDateAddWithColumnAlias() $this->assertDqlProducesSql($dql, $sql); } - public function testDateAddWithNegative() + public function testDateAddWithNegative(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE DATEADD(CURRENT_TIME(), -4, 'MONTH') < 7"; $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE DATE_ADD(CURRENT_TIME, INTERVAL -4 MONTH) < 7'; @@ -47,7 +47,7 @@ public function testDateAddWithNegative() $this->assertDqlProducesSql($dql, $sql); } - public function testDateSub() + public function testDateSub(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE DATESUB(CURRENT_TIME(), 4, 'MONTH') < 7"; $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE DATE_SUB(CURRENT_TIME, INTERVAL 4 MONTH) < 7'; @@ -55,7 +55,7 @@ public function testDateSub() $this->assertDqlProducesSql($dql, $sql); } - public function testExtract() + public function testExtract(): void { $dql = 'SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE 201702 > EXTRACT(YEAR_MONTH FROM p.created)'; $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE 201702 > EXTRACT(YEAR_MONTH FROM d0_.created)'; @@ -63,7 +63,7 @@ public function testExtract() $this->assertDqlProducesSql($dql, $sql); } - public function testFromUnixtime() + public function testFromUnixtime(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE FROM_UNIXTIME(CURRENT_TIME()) = '2000-01-01 00:00:00'"; $sql = "SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE FROM_UNIXTIME(CURRENT_TIME) = '2000-01-01 00:00:00'"; @@ -71,7 +71,7 @@ public function testFromUnixtime() $this->assertDqlProducesSql($dql, $sql); } - public function testPeriodDiff() + public function testPeriodDiff(): void { if (Version::VERSION < 2.3) { $this->markTestSkipped('Doctrine 2.2 moans about something or other'); @@ -83,7 +83,7 @@ public function testPeriodDiff() $this->assertDqlProducesSql($dql, $sql); } - public function testStrToDate() + public function testStrToDate(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE STR_TO_DATE(p.created, :dateFormat) < :currentTime"; $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE STR_TO_DATE(d0_.created, ?) < ?'; @@ -94,7 +94,7 @@ public function testStrToDate() ]); } - public function testUnixTimpestamp() + public function testUnixTimpestamp(): void { $dql = "SELECT UNIX_TIMESTAMP(p.created) FROM DoctrineExtensions\Tests\Entities\Date p"; $sql = 'SELECT UNIX_TIMESTAMP(d0_.created) AS sclr_0 FROM Date d0_'; diff --git a/tests/Query/Mysql/DayNameTest.php b/tests/Query/Mysql/DayNameTest.php index 6be905c5..c846537f 100644 --- a/tests/Query/Mysql/DayNameTest.php +++ b/tests/Query/Mysql/DayNameTest.php @@ -8,7 +8,7 @@ class DayNameTest extends MysqlTestCase { - public function testDayName() + public function testDayName(): void { $this->assertDqlProducesSql( "SELECT DAYNAME(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/DayOfWeekTest.php b/tests/Query/Mysql/DayOfWeekTest.php index 8463bf82..6b5f3090 100644 --- a/tests/Query/Mysql/DayOfWeekTest.php +++ b/tests/Query/Mysql/DayOfWeekTest.php @@ -8,7 +8,7 @@ class DayOfWeekTest extends MysqlTestCase { - public function testDayOfWeek() + public function testDayOfWeek(): void { $this->assertDqlProducesSql( "SELECT DAYOFWEEK(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/DayOfYearTest.php b/tests/Query/Mysql/DayOfYearTest.php index c46a1d4d..128c8f98 100644 --- a/tests/Query/Mysql/DayOfYearTest.php +++ b/tests/Query/Mysql/DayOfYearTest.php @@ -8,7 +8,7 @@ class DayOfYearTest extends MysqlTestCase { - public function testDayOfYear() + public function testDayOfYear(): void { $this->assertDqlProducesSql( "SELECT DAYOFYEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/DayTest.php b/tests/Query/Mysql/DayTest.php index 574335e4..cf222623 100644 --- a/tests/Query/Mysql/DayTest.php +++ b/tests/Query/Mysql/DayTest.php @@ -8,7 +8,7 @@ class DayTest extends MysqlTestCase { - public function testDay() + public function testDay(): void { $this->assertDqlProducesSql( "SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/DegressTest.php b/tests/Query/Mysql/DegressTest.php index a2aaa412..c8debd6f 100644 --- a/tests/Query/Mysql/DegressTest.php +++ b/tests/Query/Mysql/DegressTest.php @@ -8,7 +8,7 @@ class DegressTest extends MysqlTestCase { - public function testDegrees() + public function testDegrees(): void { $this->assertDqlProducesSql( "SELECT DEGREES(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/DivTest.php b/tests/Query/Mysql/DivTest.php index ffa2a3bd..b1424484 100644 --- a/tests/Query/Mysql/DivTest.php +++ b/tests/Query/Mysql/DivTest.php @@ -8,7 +8,7 @@ class DivTest extends MysqlTestCase { - public function testDiv() + public function testDiv(): void { $this->assertDqlProducesSql( "SELECT DIV(2, 5) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/ExpTest.php b/tests/Query/Mysql/ExpTest.php index 06ccd255..e3ed42b4 100644 --- a/tests/Query/Mysql/ExpTest.php +++ b/tests/Query/Mysql/ExpTest.php @@ -8,7 +8,7 @@ class ExpTest extends MysqlTestCase { - public function testExp() + public function testExp(): void { $this->assertDqlProducesSql( "SELECT EXP(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/FieldTest.php b/tests/Query/Mysql/FieldTest.php index 77fa0e14..66e0d9ef 100644 --- a/tests/Query/Mysql/FieldTest.php +++ b/tests/Query/Mysql/FieldTest.php @@ -8,7 +8,7 @@ class FieldTest extends MysqlTestCase { - public function testField() + public function testField(): void { $this->assertDqlProducesSql( "SELECT FIELD(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/FindInSetTest.php b/tests/Query/Mysql/FindInSetTest.php index 0070dc62..bc35a657 100644 --- a/tests/Query/Mysql/FindInSetTest.php +++ b/tests/Query/Mysql/FindInSetTest.php @@ -8,7 +8,7 @@ class FindInSetTest extends MysqlTestCase { - public function testFindInSet() + public function testFindInSet(): void { $this->assertDqlProducesSql( "SELECT FIND_IN_SET(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/FloorTest.php b/tests/Query/Mysql/FloorTest.php index 387024c8..d3330888 100644 --- a/tests/Query/Mysql/FloorTest.php +++ b/tests/Query/Mysql/FloorTest.php @@ -8,7 +8,7 @@ class FloorTest extends MysqlTestCase { - public function testFloor() + public function testFloor(): void { $this->assertDqlProducesSql( "SELECT FLOOR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/FormatTest.php b/tests/Query/Mysql/FormatTest.php index 83b3d5ed..92897da3 100644 --- a/tests/Query/Mysql/FormatTest.php +++ b/tests/Query/Mysql/FormatTest.php @@ -8,7 +8,7 @@ class FormatTest extends MysqlTestCase { - public function testFormat() + public function testFormat(): void { $this->assertDqlProducesSql( "SELECT FORMAT(1000.00, 2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/FromBase64.php b/tests/Query/Mysql/FromBase64.php index 7e5f8cb5..c0b86195 100644 --- a/tests/Query/Mysql/FromBase64.php +++ b/tests/Query/Mysql/FromBase64.php @@ -8,7 +8,7 @@ class FromBase64 extends MysqlTestCase { - public function testFromBase64() + public function testFromBase64(): void { $this->assertDqlProducesSql( "SELECT FROM_BASE64(title) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/FromUnixTimeTest.php b/tests/Query/Mysql/FromUnixTimeTest.php index 4905ade2..89072eb8 100644 --- a/tests/Query/Mysql/FromUnixTimeTest.php +++ b/tests/Query/Mysql/FromUnixTimeTest.php @@ -8,7 +8,7 @@ class FromUnixTimeTest extends MysqlTestCase { - public function testFromUnixTime() + public function testFromUnixTime(): void { $this->assertDqlProducesSql( "SELECT FROM_UNIXTIME(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/GreatestTest.php b/tests/Query/Mysql/GreatestTest.php index 208fa987..66c5c47e 100644 --- a/tests/Query/Mysql/GreatestTest.php +++ b/tests/Query/Mysql/GreatestTest.php @@ -8,7 +8,7 @@ class GreatestTest extends MysqlTestCase { - public function testGreatest() + public function testGreatest(): void { $this->assertDqlProducesSql( "SELECT GREATEST(2, 5, 8) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/GroupConcatTest.php b/tests/Query/Mysql/GroupConcatTest.php index 30881c73..65bdf2c0 100644 --- a/tests/Query/Mysql/GroupConcatTest.php +++ b/tests/Query/Mysql/GroupConcatTest.php @@ -8,7 +8,7 @@ class GroupConcatTest extends MysqlTestCase { - public function testGroupConcat() + public function testGroupConcat(): void { $this->assertDqlProducesSql( "SELECT GROUP_CONCAT(blank.id) from DoctrineExtensions\Tests\Entities\Blank as blank", @@ -16,7 +16,7 @@ public function testGroupConcat() ); } - public function testGroupConcatWithDistinct() + public function testGroupConcatWithDistinct(): void { $this->assertDqlProducesSql( "SELECT GROUP_CONCAT(DISTINCT blank.id) from DoctrineExtensions\Tests\Entities\Blank as blank", @@ -24,7 +24,7 @@ public function testGroupConcatWithDistinct() ); } - public function testGroupConcatWithOrderBy() + public function testGroupConcatWithOrderBy(): void { $this->assertDqlProducesSql( "SELECT GROUP_CONCAT(blank.id ORDER BY blank.id) from DoctrineExtensions\Tests\Entities\Blank as blank", @@ -32,7 +32,7 @@ public function testGroupConcatWithOrderBy() ); } - public function testGroupConcatWithSeparator() + public function testGroupConcatWithSeparator(): void { $this->assertDqlProducesSql( "SELECT GROUP_CONCAT(blank.id SEPARATOR ' ') from DoctrineExtensions\Tests\Entities\Blank as blank", diff --git a/tests/Query/Mysql/HexTest.php b/tests/Query/Mysql/HexTest.php index 8893e351..f12ae835 100644 --- a/tests/Query/Mysql/HexTest.php +++ b/tests/Query/Mysql/HexTest.php @@ -8,7 +8,7 @@ class HexTest extends MysqlTestCase { - public function testHex() + public function testHex(): void { $this->assertDqlProducesSql( "SELECT HEX(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/HourTest.php b/tests/Query/Mysql/HourTest.php index 9e851b00..1e68540d 100644 --- a/tests/Query/Mysql/HourTest.php +++ b/tests/Query/Mysql/HourTest.php @@ -8,7 +8,7 @@ class HourTest extends MysqlTestCase { - public function testHour() + public function testHour(): void { $this->assertDqlProducesSql( "SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/IfElseTest.php b/tests/Query/Mysql/IfElseTest.php index 5c573fe2..7c328160 100644 --- a/tests/Query/Mysql/IfElseTest.php +++ b/tests/Query/Mysql/IfElseTest.php @@ -8,7 +8,7 @@ class IfElseTest extends MysqlTestCase { - public function testIfElseWithoutNullValue() + public function testIfElseWithoutNullValue(): void { $this->assertDqlProducesSql( "SELECT IFELSE(2 < 3, 4, 5) from DoctrineExtensions\Tests\Entities\Blank b", @@ -16,7 +16,7 @@ public function testIfElseWithoutNullValue() ); } - public function testIfElseWithNullValue() + public function testIfElseWithNullValue(): void { $this->assertDqlProducesSql( "SELECT IFELSE(2 < 3, NULL, 5) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/IfNullTest.php b/tests/Query/Mysql/IfNullTest.php index ca551851..0faa01a2 100644 --- a/tests/Query/Mysql/IfNullTest.php +++ b/tests/Query/Mysql/IfNullTest.php @@ -8,7 +8,7 @@ class IfNullTest extends MysqlTestCase { - public function testIfNull() + public function testIfNull(): void { $this->assertDqlProducesSql( "SELECT IFNULL(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/Inet6AtonTest.php b/tests/Query/Mysql/Inet6AtonTest.php index b2bc1d9c..4f2d14dd 100644 --- a/tests/Query/Mysql/Inet6AtonTest.php +++ b/tests/Query/Mysql/Inet6AtonTest.php @@ -8,7 +8,7 @@ class Inet6AtonTest extends MysqlTestCase { - public function testInet6Aton() + public function testInet6Aton(): void { $this->assertDqlProducesSql( "SELECT INET6_ATON('2001:db8::b33f') FROM DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/Inet6NtoaTest.php b/tests/Query/Mysql/Inet6NtoaTest.php index 47e725b2..2103e298 100644 --- a/tests/Query/Mysql/Inet6NtoaTest.php +++ b/tests/Query/Mysql/Inet6NtoaTest.php @@ -8,7 +8,7 @@ class Inet6NtoaTest extends MysqlTestCase { - public function testInet6Ntoa() + public function testInet6Ntoa(): void { $this->assertDqlProducesSql( "SELECT INET6_NTOA(INET6_ATON('2001:db8::b33f')) FROM DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/InetAtonTest.php b/tests/Query/Mysql/InetAtonTest.php index 476b5424..050662ce 100644 --- a/tests/Query/Mysql/InetAtonTest.php +++ b/tests/Query/Mysql/InetAtonTest.php @@ -8,7 +8,7 @@ class InetAtonTest extends MysqlTestCase { - public function testInetAton() + public function testInetAton(): void { $this->assertDqlProducesSql( "SELECT INET_ATON('127.0.0.1') FROM DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/InetNtoaTest.php b/tests/Query/Mysql/InetNtoaTest.php index 32a63064..98423186 100644 --- a/tests/Query/Mysql/InetNtoaTest.php +++ b/tests/Query/Mysql/InetNtoaTest.php @@ -8,7 +8,7 @@ class InetNtoaTest extends MysqlTestCase { - public function testInetNtoa() + public function testInetNtoa(): void { $this->assertDqlProducesSql( "SELECT INET_NTOA('3221225985') FROM DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/IsIpv4CompatTest.php b/tests/Query/Mysql/IsIpv4CompatTest.php index d0d922e3..b7513e5d 100644 --- a/tests/Query/Mysql/IsIpv4CompatTest.php +++ b/tests/Query/Mysql/IsIpv4CompatTest.php @@ -8,7 +8,7 @@ class IsIpv4CompatTest extends MysqlTestCase { - public function testIsIpv4Compat() + public function testIsIpv4Compat(): void { $this->assertDqlProducesSql( "SELECT IS_IPV4_COMPAT(INET6_ATON('::192.0.2.1')) FROM DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/IsIpv4MappedTest.php b/tests/Query/Mysql/IsIpv4MappedTest.php index 7c6d397c..c73487cf 100644 --- a/tests/Query/Mysql/IsIpv4MappedTest.php +++ b/tests/Query/Mysql/IsIpv4MappedTest.php @@ -8,7 +8,7 @@ class IsIpv4MappedTest extends MysqlTestCase { - public function testIsIpv4Mapped() + public function testIsIpv4Mapped(): void { $this->assertDqlProducesSql( "SELECT IS_IPV4_MAPPED(INET6_ATON('::ffff:192.0.2.1')) FROM DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/IsIpv4Test.php b/tests/Query/Mysql/IsIpv4Test.php index bbee0ede..0148c634 100644 --- a/tests/Query/Mysql/IsIpv4Test.php +++ b/tests/Query/Mysql/IsIpv4Test.php @@ -8,7 +8,7 @@ class IsIpv4Test extends MysqlTestCase { - public function testIsIpv4() + public function testIsIpv4(): void { $this->assertDqlProducesSql( "SELECT IS_IPV4('192.0.2.1') FROM DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/IsIpv6Test.php b/tests/Query/Mysql/IsIpv6Test.php index 646545c0..6be65a74 100644 --- a/tests/Query/Mysql/IsIpv6Test.php +++ b/tests/Query/Mysql/IsIpv6Test.php @@ -8,7 +8,7 @@ class IsIpv6Test extends MysqlTestCase { - public function testIsIpv6() + public function testIsIpv6(): void { $this->assertDqlProducesSql( "SELECT IS_IPV6('2001:db8::dead:b33f') FROM DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/LagTest.php b/tests/Query/Mysql/LagTest.php index 78b88d85..eecfcef8 100644 --- a/tests/Query/Mysql/LagTest.php +++ b/tests/Query/Mysql/LagTest.php @@ -8,7 +8,7 @@ class LagTest extends MysqlTestCase { - public function testLag() + public function testLag(): void { $this->assertDqlProducesSql( 'SELECT LAG(COUNT(b.id)) from DoctrineExtensions\Tests\Entities\Blank b', diff --git a/tests/Query/Mysql/LastDayTest.php b/tests/Query/Mysql/LastDayTest.php index 43073fe6..c97dc04d 100644 --- a/tests/Query/Mysql/LastDayTest.php +++ b/tests/Query/Mysql/LastDayTest.php @@ -8,7 +8,7 @@ class LastDayTest extends MysqlTestCase { - public function testLastDay() + public function testLastDay(): void { $this->assertDqlProducesSql( "SELECT LAST_DAY(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/LeadTest.php b/tests/Query/Mysql/LeadTest.php index d27aad48..f448f70f 100644 --- a/tests/Query/Mysql/LeadTest.php +++ b/tests/Query/Mysql/LeadTest.php @@ -8,7 +8,7 @@ class LeadTest extends MysqlTestCase { - public function testLag() + public function testLag(): void { $this->assertDqlProducesSql( 'SELECT LEAD(COUNT(b.id)) from DoctrineExtensions\Tests\Entities\Blank b', diff --git a/tests/Query/Mysql/LeastTest.php b/tests/Query/Mysql/LeastTest.php index df903db2..a331e798 100644 --- a/tests/Query/Mysql/LeastTest.php +++ b/tests/Query/Mysql/LeastTest.php @@ -8,7 +8,7 @@ class LeastTest extends MysqlTestCase { - public function testLeast() + public function testLeast(): void { $this->assertDqlProducesSql( "SELECT LEAST(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/Log10Test.php b/tests/Query/Mysql/Log10Test.php index 3ecae50b..94c1ee25 100644 --- a/tests/Query/Mysql/Log10Test.php +++ b/tests/Query/Mysql/Log10Test.php @@ -8,7 +8,7 @@ class Log10Test extends MysqlTestCase { - public function testLog10() + public function testLog10(): void { $this->assertDqlProducesSql( "SELECT LOG10(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/Log2Test.php b/tests/Query/Mysql/Log2Test.php index 1e75c9f3..8351fdca 100644 --- a/tests/Query/Mysql/Log2Test.php +++ b/tests/Query/Mysql/Log2Test.php @@ -8,7 +8,7 @@ class Log2Test extends MysqlTestCase { - public function testLog2() + public function testLog2(): void { $this->assertDqlProducesSql( "SELECT LOG2(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/LogTest.php b/tests/Query/Mysql/LogTest.php index 172fff0b..df342548 100644 --- a/tests/Query/Mysql/LogTest.php +++ b/tests/Query/Mysql/LogTest.php @@ -8,7 +8,7 @@ class LogTest extends MysqlTestCase { - public function testLog() + public function testLog(): void { $this->assertDqlProducesSql( "SELECT LOG(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/LpadTest.php b/tests/Query/Mysql/LpadTest.php index d49f39cb..2c4d066a 100644 --- a/tests/Query/Mysql/LpadTest.php +++ b/tests/Query/Mysql/LpadTest.php @@ -8,7 +8,7 @@ class LpadTest extends MysqlTestCase { - public function testLpad() + public function testLpad(): void { $this->assertDqlProducesSql( "SELECT LPAD(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/MakeDateTest.php b/tests/Query/Mysql/MakeDateTest.php index e3be281f..3941ab3c 100644 --- a/tests/Query/Mysql/MakeDateTest.php +++ b/tests/Query/Mysql/MakeDateTest.php @@ -8,7 +8,7 @@ class MakeDateTest extends MysqlTestCase { - public function testMakeDate() + public function testMakeDate(): void { $this->assertDqlProducesSql( "SELECT MAKEDATE(2019, 5) FROM DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/MatchAgainstTest.php b/tests/Query/Mysql/MatchAgainstTest.php index 2415038f..b762e713 100644 --- a/tests/Query/Mysql/MatchAgainstTest.php +++ b/tests/Query/Mysql/MatchAgainstTest.php @@ -8,7 +8,7 @@ class MatchAgainstTest extends MysqlTestCase { - public function testMatchAgainst() + public function testMatchAgainst(): void { $this->assertDqlProducesSql( "SELECT MATCH(blank.id) AGAINST ('3') from DoctrineExtensions\Tests\Entities\Blank AS blank", @@ -16,7 +16,7 @@ public function testMatchAgainst() ); } - public function testMatchAgainstMultipleFields() + public function testMatchAgainstMultipleFields(): void { $this->assertDqlProducesSql( "SELECT MATCH(post.longitude, post.latitude) AGAINST ('3') from DoctrineExtensions\Tests\Entities\BlogPost AS post", @@ -24,7 +24,7 @@ public function testMatchAgainstMultipleFields() ); } - public function testMatchAgainstInBooleanMode() + public function testMatchAgainstInBooleanMode(): void { $this->assertDqlProducesSql( "SELECT MATCH(blank.id) AGAINST ('+3 -4' BOOLEAN) from DoctrineExtensions\Tests\Entities\Blank AS blank", @@ -36,7 +36,7 @@ public function testMatchAgainstInBooleanMode() ); } - public function testMatchAgainstWithQueryExpansion() + public function testMatchAgainstWithQueryExpansion(): void { $this->assertDqlProducesSql( "SELECT MATCH(blank.id) AGAINST ('3' EXPAND) from DoctrineExtensions\Tests\Entities\Blank AS blank", diff --git a/tests/Query/Mysql/Md5Test.php b/tests/Query/Mysql/Md5Test.php index a9ac36b1..4b8843fc 100644 --- a/tests/Query/Mysql/Md5Test.php +++ b/tests/Query/Mysql/Md5Test.php @@ -8,7 +8,7 @@ class Md5Test extends MysqlTestCase { - public function testMd5() + public function testMd5(): void { $this->assertDqlProducesSql( "SELECT MD5('2') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/MinuteTest.php b/tests/Query/Mysql/MinuteTest.php index ec81080e..83404caf 100644 --- a/tests/Query/Mysql/MinuteTest.php +++ b/tests/Query/Mysql/MinuteTest.php @@ -8,7 +8,7 @@ class MinuteTest extends MysqlTestCase { - public function testMinute() + public function testMinute(): void { $this->assertDqlProducesSql( "SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/MonthNameTest.php b/tests/Query/Mysql/MonthNameTest.php index 1c1e5bfb..a4201551 100644 --- a/tests/Query/Mysql/MonthNameTest.php +++ b/tests/Query/Mysql/MonthNameTest.php @@ -8,7 +8,7 @@ class MonthNameTest extends MysqlTestCase { - public function testMonthName() + public function testMonthName(): void { $this->assertDqlProducesSql( "SELECT MONTHNAME(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/MonthTest.php b/tests/Query/Mysql/MonthTest.php index 5d122a1b..42f90f72 100644 --- a/tests/Query/Mysql/MonthTest.php +++ b/tests/Query/Mysql/MonthTest.php @@ -8,7 +8,7 @@ class MonthTest extends MysqlTestCase { - public function testMonth() + public function testMonth(): void { $this->assertDqlProducesSql( "SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/NowTest.php b/tests/Query/Mysql/NowTest.php index 43dcedde..2a04bb53 100644 --- a/tests/Query/Mysql/NowTest.php +++ b/tests/Query/Mysql/NowTest.php @@ -8,7 +8,7 @@ class NowTest extends MysqlTestCase { - public function testNow() + public function testNow(): void { $this->assertDqlProducesSql( "SELECT NOW() from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/NullIfTest.php b/tests/Query/Mysql/NullIfTest.php index babb2b6e..52bd1408 100644 --- a/tests/Query/Mysql/NullIfTest.php +++ b/tests/Query/Mysql/NullIfTest.php @@ -8,7 +8,7 @@ class NullIfTest extends MysqlTestCase { - public function testNullIf() + public function testNullIf(): void { $this->assertDqlProducesSql( "SELECT NULLIF(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/PiTest.php b/tests/Query/Mysql/PiTest.php index 2ce98bca..a894bcb8 100644 --- a/tests/Query/Mysql/PiTest.php +++ b/tests/Query/Mysql/PiTest.php @@ -8,7 +8,7 @@ class PiTest extends MysqlTestCase { - public function testPi() + public function testPi(): void { $this->assertDqlProducesSql( "SELECT PI() from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/PowerTest.php b/tests/Query/Mysql/PowerTest.php index a8829117..afa38a72 100644 --- a/tests/Query/Mysql/PowerTest.php +++ b/tests/Query/Mysql/PowerTest.php @@ -8,7 +8,7 @@ class PowerTest extends MysqlTestCase { - public function testPower() + public function testPower(): void { $this->assertDqlProducesSql( "SELECT POWER(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/QuarterTest.php b/tests/Query/Mysql/QuarterTest.php index 7f3e07eb..b4bf4a3a 100644 --- a/tests/Query/Mysql/QuarterTest.php +++ b/tests/Query/Mysql/QuarterTest.php @@ -8,7 +8,7 @@ class QuarterTest extends MysqlTestCase { - public function testQuarter() + public function testQuarter(): void { $this->assertDqlProducesSql( "SELECT QUARTER(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/RadiansTest.php b/tests/Query/Mysql/RadiansTest.php index 09ef282c..eed7535c 100644 --- a/tests/Query/Mysql/RadiansTest.php +++ b/tests/Query/Mysql/RadiansTest.php @@ -8,7 +8,7 @@ class RadiansTest extends MysqlTestCase { - public function testRadians() + public function testRadians(): void { $this->assertDqlProducesSql( "SELECT RADIANS(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/RandTest.php b/tests/Query/Mysql/RandTest.php index 3c828893..5491604a 100644 --- a/tests/Query/Mysql/RandTest.php +++ b/tests/Query/Mysql/RandTest.php @@ -8,7 +8,7 @@ class RandTest extends MysqlTestCase { - public function testRandWithParameter() + public function testRandWithParameter(): void { $this->assertDqlProducesSql( "SELECT RAND(2) from DoctrineExtensions\Tests\Entities\Blank b", @@ -16,7 +16,7 @@ public function testRandWithParameter() ); } - public function testRandWithoutParameter() + public function testRandWithoutParameter(): void { $this->assertDqlProducesSql( "SELECT RAND() from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/RegexpTest.php b/tests/Query/Mysql/RegexpTest.php index 86e8fd2c..0449e181 100644 --- a/tests/Query/Mysql/RegexpTest.php +++ b/tests/Query/Mysql/RegexpTest.php @@ -8,7 +8,7 @@ class RegexpTest extends MysqlTestCase { - public function testRegexp() + public function testRegexp(): void { $this->assertDqlProducesSql( "SELECT REGEXP('2', '3') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/ReplaceTest.php b/tests/Query/Mysql/ReplaceTest.php index 8b67a59d..e89f0956 100644 --- a/tests/Query/Mysql/ReplaceTest.php +++ b/tests/Query/Mysql/ReplaceTest.php @@ -8,7 +8,7 @@ class ReplaceTest extends MysqlTestCase { - public function testReplace() + public function testReplace(): void { $this->assertDqlProducesSql( "SELECT REPLACE(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/RoundTest.php b/tests/Query/Mysql/RoundTest.php index 7d1ede4e..6d009250 100644 --- a/tests/Query/Mysql/RoundTest.php +++ b/tests/Query/Mysql/RoundTest.php @@ -8,7 +8,7 @@ class RoundTest extends MysqlTestCase { - public function testRoundOneArgument() + public function testRoundOneArgument(): void { $this->assertDqlProducesSql( "SELECT ROUND(2) from DoctrineExtensions\Tests\Entities\Blank b", @@ -16,7 +16,7 @@ public function testRoundOneArgument() ); } - public function testRoundTwoArguments() + public function testRoundTwoArguments(): void { $this->assertDqlProducesSql( "SELECT ROUND(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/RpadTest.php b/tests/Query/Mysql/RpadTest.php index 31e854a3..ce5aa706 100644 --- a/tests/Query/Mysql/RpadTest.php +++ b/tests/Query/Mysql/RpadTest.php @@ -8,7 +8,7 @@ class RpadTest extends MysqlTestCase { - public function testRpad() + public function testRpad(): void { $this->assertDqlProducesSql( "SELECT RPAD(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/SecondTest.php b/tests/Query/Mysql/SecondTest.php index bd9262ba..7bffa512 100644 --- a/tests/Query/Mysql/SecondTest.php +++ b/tests/Query/Mysql/SecondTest.php @@ -8,7 +8,7 @@ class SecondTest extends MysqlTestCase { - public function testSecond() + public function testSecond(): void { $this->assertDqlProducesSql( "SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/SetTest.php b/tests/Query/Mysql/SetTest.php index e2eb363a..b8bc5cac 100644 --- a/tests/Query/Mysql/SetTest.php +++ b/tests/Query/Mysql/SetTest.php @@ -8,7 +8,7 @@ class SetTest extends MysqlTestCase { - public function testFindInSet() + public function testFindInSet(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Set p WHERE FIND_IN_SET(p.id, p.set) != 0"; $this->assertDqlProducesSql( diff --git a/tests/Query/Mysql/Sha1Test.php b/tests/Query/Mysql/Sha1Test.php index 83f868d7..9f5a1d15 100644 --- a/tests/Query/Mysql/Sha1Test.php +++ b/tests/Query/Mysql/Sha1Test.php @@ -8,7 +8,7 @@ class Sha1Test extends MysqlTestCase { - public function testSha1() + public function testSha1(): void { $this->assertDqlProducesSql( "SELECT SHA1('2') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/Sha2Test.php b/tests/Query/Mysql/Sha2Test.php index a07a2a0e..832e7a7a 100644 --- a/tests/Query/Mysql/Sha2Test.php +++ b/tests/Query/Mysql/Sha2Test.php @@ -8,7 +8,7 @@ class Sha2Test extends MysqlTestCase { - public function testSha2() + public function testSha2(): void { $this->assertDqlProducesSql( "SELECT SHA2('2', 2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/SinTest.php b/tests/Query/Mysql/SinTest.php index 5f1d6451..937e9cb9 100644 --- a/tests/Query/Mysql/SinTest.php +++ b/tests/Query/Mysql/SinTest.php @@ -8,7 +8,7 @@ class SinTest extends MysqlTestCase { - public function testSin() + public function testSin(): void { $this->assertDqlProducesSql( "SELECT SIN(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/SoundexTest.php b/tests/Query/Mysql/SoundexTest.php index 11fe28f2..73d5c7aa 100644 --- a/tests/Query/Mysql/SoundexTest.php +++ b/tests/Query/Mysql/SoundexTest.php @@ -8,7 +8,7 @@ class SoundexTest extends MysqlTestCase { - public function testSoundex() + public function testSoundex(): void { $this->assertDqlProducesSql( "SELECT SOUNDEX('2') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/StdDevTest.php b/tests/Query/Mysql/StdDevTest.php index 1d9ee150..27e276f6 100644 --- a/tests/Query/Mysql/StdDevTest.php +++ b/tests/Query/Mysql/StdDevTest.php @@ -8,7 +8,7 @@ class StdDevTest extends MysqlTestCase { - public function testStdDev() + public function testStdDev(): void { $this->assertDqlProducesSql( "SELECT STDDEV(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/StdTest.php b/tests/Query/Mysql/StdTest.php index 614fb635..550780bc 100644 --- a/tests/Query/Mysql/StdTest.php +++ b/tests/Query/Mysql/StdTest.php @@ -8,7 +8,7 @@ class StdTest extends MysqlTestCase { - public function testStd() + public function testStd(): void { $this->assertDqlProducesSql( "SELECT STD(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/StrToDateTest.php b/tests/Query/Mysql/StrToDateTest.php index 79971a09..f2399acb 100644 --- a/tests/Query/Mysql/StrToDateTest.php +++ b/tests/Query/Mysql/StrToDateTest.php @@ -8,7 +8,7 @@ class StrToDateTest extends MysqlTestCase { - public function testStrToDate() + public function testStrToDate(): void { $this->assertDqlProducesSql( "SELECT STR_TO_DATE(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/StringTest.php b/tests/Query/Mysql/StringTest.php index fef0fea4..41b991e3 100644 --- a/tests/Query/Mysql/StringTest.php +++ b/tests/Query/Mysql/StringTest.php @@ -9,7 +9,7 @@ class StringTest extends MysqlTestCase { - public function testAscii() + public function testAscii(): void { $this->assertDqlProducesSql( "SELECT ASCII('A') from DoctrineExtensions\Tests\Entities\Blank b", @@ -20,17 +20,17 @@ public function testAscii() /** * Not implemented */ - public function testCharLength() + public function testCharLength(): void { $this->expectException(QueryException::class); $this->assertDqlProducesSql( - "SELECT CHAR_LENGTH(CHAR(0x65)), CHAR_LENGTH(CHAR(0x65 USING utf8)) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT CHAR_LENGTH(CHAR(0x65)), CHAR_LENGTH(CHAR(0x65 USING utf8)) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT CHAR_LENGTH(CHAR(0x65)), CHAR_LENGTH(CHAR(0x65 USING utf8)) AS sclr_0 FROM Blank b0_' ); } - public function testConcatWithSeparator() + public function testConcatWithSeparator(): void { $this->assertDqlProducesSql( "SELECT CONCAT_WS(',', 'First name', 'Second name', 'Last Name') from DoctrineExtensions\Tests\Entities\Blank b", @@ -41,7 +41,7 @@ public function testConcatWithSeparator() /** * Not implemented */ - public function testConcatWithSeparatorWithNull() + public function testConcatWithSeparatorWithNull(): void { $this->expectException(QueryException::class); @@ -51,7 +51,7 @@ public function testConcatWithSeparatorWithNull() ); } - public function testField() + public function testField(): void { $this->assertDqlProducesSql( "SELECT FIELD('ej', 'Hej', 'ej', 'Heja', 'hej', 'foo') from DoctrineExtensions\Tests\Entities\Blank b", @@ -59,7 +59,7 @@ public function testField() ); } - public function testReplace() + public function testReplace(): void { $this->assertDqlProducesSql( "SELECT REPLACE('www.mysql.com', 'w', 'Ww') from DoctrineExtensions\Tests\Entities\Blank b", @@ -67,7 +67,7 @@ public function testReplace() ); } - public function testSoundex() + public function testSoundex(): void { $this->assertDqlProducesSql( "SELECT SOUNDEX('Hello') from DoctrineExtensions\Tests\Entities\Blank b", @@ -78,7 +78,7 @@ public function testSoundex() /** * Test cases for MYSQL SUBSTRING function. */ - public function testSubstring() + public function testSubstring(): void { $this->assertDqlProducesSql( "SELECT SUBSTRING('www.mysql.com', 1, 3) from DoctrineExtensions\Tests\Entities\Blank b", @@ -114,7 +114,7 @@ public function testSubstring() /** * Test cases for MYSQL SUBSTRING_INDEX function. */ - public function testSubstringIndex() + public function testSubstringIndex(): void { $this->assertDqlProducesSql( "SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2) from DoctrineExtensions\Tests\Entities\Blank b", @@ -138,7 +138,7 @@ public function testSubstringIndex() ); } - public function testLeast() + public function testLeast(): void { $this->assertDqlProducesSql( 'SELECT LEAST(10,1,-4,0.4,0.003) AS lest FROM DoctrineExtensions\Tests\Entities\Blank b', @@ -156,7 +156,7 @@ public function testLeast() ); } - public function testGreatest() + public function testGreatest(): void { $this->assertDqlProducesSql( "SELECT GREATEST(10,1,4,0.4,0.003) AS great FROM DoctrineExtensions\Tests\Entities\Blank b", @@ -173,7 +173,7 @@ public function testGreatest() ); } - public function testLpad() + public function testLpad(): void { $this->assertDqlProducesSql( "SELECT LPAD('Hellow', 10, '**') from DoctrineExtensions\Tests\Entities\Blank b", @@ -181,7 +181,7 @@ public function testLpad() ); } - public function testRpad() + public function testRpad(): void { $this->assertDqlProducesSql( "SELECT RPAD('Hellow', 10, '**') from DoctrineExtensions\Tests\Entities\Blank b", @@ -189,7 +189,7 @@ public function testRpad() ); } - public function testInstr() + public function testInstr(): void { $this->assertDqlProducesSql( "SELECT INSTR('www.mysql.com', 'mysql') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/SubstringIndexTest.php b/tests/Query/Mysql/SubstringIndexTest.php index 5de6301a..400bc8e6 100644 --- a/tests/Query/Mysql/SubstringIndexTest.php +++ b/tests/Query/Mysql/SubstringIndexTest.php @@ -8,7 +8,7 @@ class SubstringIndexTest extends MysqlTestCase { - public function testSubstringIndex() + public function testSubstringIndex(): void { $this->assertDqlProducesSql( "SELECT SUBSTRING_INDEX(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/TanTest.php b/tests/Query/Mysql/TanTest.php index 6f4f363e..33024ddc 100644 --- a/tests/Query/Mysql/TanTest.php +++ b/tests/Query/Mysql/TanTest.php @@ -8,7 +8,7 @@ class TanTest extends MysqlTestCase { - public function testTan() + public function testTan(): void { $this->assertDqlProducesSql( "SELECT TAN(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/TimeDiffTest.php b/tests/Query/Mysql/TimeDiffTest.php index 72ddbd19..bc6f866c 100644 --- a/tests/Query/Mysql/TimeDiffTest.php +++ b/tests/Query/Mysql/TimeDiffTest.php @@ -8,7 +8,7 @@ class TimeDiffTest extends MysqlTestCase { - public function testTimeDiff() + public function testTimeDiff(): void { $this->assertDqlProducesSql( "SELECT TIMEDIFF(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/TimeTest.php b/tests/Query/Mysql/TimeTest.php index a4a9dceb..063f67d1 100644 --- a/tests/Query/Mysql/TimeTest.php +++ b/tests/Query/Mysql/TimeTest.php @@ -8,7 +8,7 @@ class TimeTest extends MysqlTestCase { - public function testTime() + public function testTime(): void { $this->assertDqlProducesSql( "SELECT TIME(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/TimeToSecTest.php b/tests/Query/Mysql/TimeToSecTest.php index 601b5e1e..f14cc5e0 100644 --- a/tests/Query/Mysql/TimeToSecTest.php +++ b/tests/Query/Mysql/TimeToSecTest.php @@ -8,7 +8,7 @@ class TimeToSecTest extends MysqlTestCase { - public function testTimeToSec() + public function testTimeToSec(): void { $this->assertDqlProducesSql( "SELECT TIMETOSEC(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/TimestampAddTest.php b/tests/Query/Mysql/TimestampAddTest.php index ac8ec93e..2c079df2 100644 --- a/tests/Query/Mysql/TimestampAddTest.php +++ b/tests/Query/Mysql/TimestampAddTest.php @@ -8,7 +8,7 @@ class TimestampAddTest extends MysqlTestCase { - public function testTimestampAdd() + public function testTimestampAdd(): void { $this->assertDqlProducesSql( "SELECT TIMESTAMPADD(MINUTE, 1, '2003-01-02') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/TimestampDiffTest.php b/tests/Query/Mysql/TimestampDiffTest.php index 6f06d1d5..f408f4a2 100644 --- a/tests/Query/Mysql/TimestampDiffTest.php +++ b/tests/Query/Mysql/TimestampDiffTest.php @@ -8,7 +8,7 @@ class TimestampDiffTest extends MysqlTestCase { - public function testTimestampDiff() + public function testTimestampDiff(): void { $this->assertDqlProducesSql( "SELECT TIMESTAMPDIFF(MONTH, '2017-06-25', '2017-06-15') from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/TrigTest.php b/tests/Query/Mysql/TrigTest.php index b13aac29..0d3d5185 100644 --- a/tests/Query/Mysql/TrigTest.php +++ b/tests/Query/Mysql/TrigTest.php @@ -20,7 +20,7 @@ public function setUp(): void $this->entity = 'DoctrineExtensions\Tests\Entities\BlogPost'; } - public function testSin() + public function testSin(): void { $this->_assertFirstQuery('SIN'); $this->_assertSecondQuery('SIN'); @@ -72,13 +72,13 @@ public function testSin() $this->assertEquals($sql, $q->getSql()); } - public function testAsin() + public function testAsin(): void { $this->_assertFirstQuery('ASIN'); $this->_assertSecondQuery('ASIN'); } - public function testAcos() + public function testAcos(): void { $this->_assertFirstQuery('ACOS'); $this->_assertSecondQuery('ACOS'); @@ -95,37 +95,37 @@ public function testAcos() $this->assertEquals($sql, $q->getSql()); } - public function testCos() + public function testCos(): void { $this->_assertFirstQuery('COS'); $this->_assertSecondQuery('COS'); } - public function testCot() + public function testCot(): void { $this->_assertFirstQuery('COT'); $this->_assertSecondQuery('COT'); } - public function testDegrees() + public function testDegrees(): void { $this->_assertFirstQuery('DEGREES'); $this->_assertSecondQuery('DEGREES'); } - public function testRadians() + public function testRadians(): void { $this->_assertFirstQuery('RADIANS'); $this->_assertSecondQuery('RADIANS'); } - public function testTan() + public function testTan(): void { $this->_assertFirstQuery('TAN'); $this->_assertSecondQuery('TAN'); } - public function testAtan() + public function testAtan(): void { // test with 1 argument $this->_assertFirstQuery('ATAN'); @@ -139,7 +139,7 @@ public function testAtan() $this->assertEquals($sql, $q->getSql()); } - public function testAtan2() + public function testAtan2(): void { $dql = "SELECT ATAN2(p.latitude, p.longitude) FROM {$this->entity} p"; $q = $this->entityManager->createQuery($dql); @@ -148,7 +148,7 @@ public function testAtan2() $this->assertEquals($sql, $q->getSql()); } - public function testCosineLaw() + public function testCosineLaw(): void { $lat = 0.0; $lng = 0.0; @@ -171,14 +171,14 @@ public function testCosineLaw() $this->assertEquals($sql, $q->getSql()); } - protected function _assertFirstQuery($func) + protected function _assertFirstQuery($func): void { $q = $this->_getFirstDqlQuery($func); $sql = $this->_getFirstSqlQuery($func); $this->assertEquals($sql, $q->getSql()); } - protected function _assertSecondQuery($func) + protected function _assertSecondQuery($func): void { $q = $this->_getSecondDqlQuery($func); $sql = $this->_getSecondSqlQuery($func); diff --git a/tests/Query/Mysql/UnixTimestampTest.php b/tests/Query/Mysql/UnixTimestampTest.php index 809d5a1f..c569029c 100644 --- a/tests/Query/Mysql/UnixTimestampTest.php +++ b/tests/Query/Mysql/UnixTimestampTest.php @@ -8,7 +8,7 @@ class UnixTimestampTest extends MysqlTestCase { - public function testUnixTimeStampNoArguments() + public function testUnixTimeStampNoArguments(): void { $this->assertDqlProducesSql( "SELECT UNIX_TIMESTAMP() from DoctrineExtensions\Tests\Entities\Blank b", @@ -16,7 +16,7 @@ public function testUnixTimeStampNoArguments() ); } - public function testUnixTimeStampOneArgument() + public function testUnixTimeStampOneArgument(): void { $this->assertDqlProducesSql( "SELECT UNIX_TIMESTAMP(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/UtcTimestampTest.php b/tests/Query/Mysql/UtcTimestampTest.php index b2e6da97..6e221d30 100644 --- a/tests/Query/Mysql/UtcTimestampTest.php +++ b/tests/Query/Mysql/UtcTimestampTest.php @@ -8,7 +8,7 @@ class UtcTimestampTest extends MysqlTestCase { - public function testUtcTimestamp() + public function testUtcTimestamp(): void { $dql = "SELECT d FROM DoctrineExtensions\Tests\Entities\Date d WHERE d.created > utc_timestamp()"; $this->assertDqlProducesSql( diff --git a/tests/Query/Mysql/UuidShortTest.php b/tests/Query/Mysql/UuidShortTest.php index d50c033b..04e0946f 100644 --- a/tests/Query/Mysql/UuidShortTest.php +++ b/tests/Query/Mysql/UuidShortTest.php @@ -8,7 +8,7 @@ class UuidShortTest extends MysqlTestCase { - public function testUuidShort() + public function testUuidShort(): void { $this->assertDqlProducesSql( "SELECT UUID_SHORT() from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/VarianceTest.php b/tests/Query/Mysql/VarianceTest.php index 921b1017..15d85d1c 100644 --- a/tests/Query/Mysql/VarianceTest.php +++ b/tests/Query/Mysql/VarianceTest.php @@ -8,7 +8,7 @@ class VarianceTest extends MysqlTestCase { - public function testVariance() + public function testVariance(): void { $this->assertDqlProducesSql( "SELECT VARIANCE(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/WeekDayTest.php b/tests/Query/Mysql/WeekDayTest.php index 468e8c9b..d439ff78 100644 --- a/tests/Query/Mysql/WeekDayTest.php +++ b/tests/Query/Mysql/WeekDayTest.php @@ -8,7 +8,7 @@ class WeekDayTest extends MysqlTestCase { - public function testWeekDay() + public function testWeekDay(): void { $this->assertDqlProducesSql( "SELECT WEEKDAY(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/WeekOfYearTest.php b/tests/Query/Mysql/WeekOfYearTest.php index ce241d01..70204d75 100644 --- a/tests/Query/Mysql/WeekOfYearTest.php +++ b/tests/Query/Mysql/WeekOfYearTest.php @@ -8,7 +8,7 @@ class WeekOfYearTest extends MysqlTestCase { - public function testWeekOfYear() + public function testWeekOfYear(): void { $this->assertDqlProducesSql( "SELECT WEEKOFYEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/WeekTest.php b/tests/Query/Mysql/WeekTest.php index 063b3302..65a69937 100644 --- a/tests/Query/Mysql/WeekTest.php +++ b/tests/Query/Mysql/WeekTest.php @@ -8,7 +8,7 @@ class WeekTest extends MysqlTestCase { - public function testWeek() + public function testWeek(): void { $this->assertDqlProducesSql( "SELECT WEEK(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/YearTest.php b/tests/Query/Mysql/YearTest.php index afccff3c..81a56772 100644 --- a/tests/Query/Mysql/YearTest.php +++ b/tests/Query/Mysql/YearTest.php @@ -8,7 +8,7 @@ class YearTest extends MysqlTestCase { - public function testYear() + public function testYear(): void { $this->assertDqlProducesSql( "SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Mysql/YearWeekTest.php b/tests/Query/Mysql/YearWeekTest.php index 3e39002b..54afd9e8 100644 --- a/tests/Query/Mysql/YearWeekTest.php +++ b/tests/Query/Mysql/YearWeekTest.php @@ -8,7 +8,7 @@ class YearWeekTest extends MysqlTestCase { - public function testYearWeek() + public function testYearWeek(): void { $this->assertDqlProducesSql( "SELECT YEARWEEK(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/MysqlWalkerTest.php b/tests/Query/MysqlWalkerTest.php index ea3bab46..db318e0c 100644 --- a/tests/Query/MysqlWalkerTest.php +++ b/tests/Query/MysqlWalkerTest.php @@ -8,7 +8,7 @@ class MysqlWalkerTest extends MysqlTestCase { - public function testSelectSQLCalcFoundRows() + public function testSelectSQLCalcFoundRows(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p"; $q = $this->entityManager->createQuery($dql); @@ -19,7 +19,7 @@ public function testSelectSQLCalcFoundRows() $this->assertEquals($sql, $q->getSql()); } - public function testSelectSQLNoCache() + public function testSelectSQLNoCache(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p"; $q = $this->entityManager->createQuery($dql); @@ -30,7 +30,7 @@ public function testSelectSQLNoCache() $this->assertEquals($sql, $q->getSql()); } - public function testGroupByWithRollup() + public function testGroupByWithRollup(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p GROUP BY p.id"; $q = $this->entityManager->createQuery($dql); diff --git a/tests/Query/Oracle/CeilTest.php b/tests/Query/Oracle/CeilTest.php index bc18b36c..3147d96c 100644 --- a/tests/Query/Oracle/CeilTest.php +++ b/tests/Query/Oracle/CeilTest.php @@ -10,7 +10,7 @@ class CeilTest extends OracleTestCase { - public function testFullQuery() + public function testFullQuery(): void { $queryBuilder = new QueryBuilder($this->entityManager); $queryBuilder->select('CEIL(p.weight)') diff --git a/tests/Query/Oracle/DayTest.php b/tests/Query/Oracle/DayTest.php index 8cd4cfe9..ece23b51 100644 --- a/tests/Query/Oracle/DayTest.php +++ b/tests/Query/Oracle/DayTest.php @@ -8,7 +8,7 @@ class DayTest extends OracleTestCase { - public function testDay() + public function testDay(): void { $this->assertDqlProducesSql( "SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Oracle/FloorTest.php b/tests/Query/Oracle/FloorTest.php index 0a63e124..7076c517 100644 --- a/tests/Query/Oracle/FloorTest.php +++ b/tests/Query/Oracle/FloorTest.php @@ -10,7 +10,7 @@ class FloorTest extends OracleTestCase { - public function testFullQuery() + public function testFullQuery(): void { $queryBuilder = new QueryBuilder($this->entityManager); $queryBuilder->select('FLOOR(p.weight)') diff --git a/tests/Query/Oracle/HourTest.php b/tests/Query/Oracle/HourTest.php index 26c3a645..6f2ed372 100644 --- a/tests/Query/Oracle/HourTest.php +++ b/tests/Query/Oracle/HourTest.php @@ -8,7 +8,7 @@ class HourTest extends OracleTestCase { - public function testHour() + public function testHour(): void { $this->assertDqlProducesSql( "SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Oracle/ListaggTest.php b/tests/Query/Oracle/ListaggTest.php index c1d27bfa..d9a45ac6 100644 --- a/tests/Query/Oracle/ListaggTest.php +++ b/tests/Query/Oracle/ListaggTest.php @@ -8,7 +8,7 @@ class ListaggTest extends OracleTestCase { - public function testFullQuery() + public function testFullQuery(): void { $dql = "SELECT LISTAGG(p.id, ',') WITHIN GROUP (ORDER BY p.created) OVER (PARTITION BY p.longitude, p.latitude) FROM DoctrineExtensions\Tests\Entities\BlogPost p"; $q = $this->entityManager->createQuery($dql); diff --git a/tests/Query/Oracle/MinuteTest.php b/tests/Query/Oracle/MinuteTest.php index e89998de..5d2f9fc1 100644 --- a/tests/Query/Oracle/MinuteTest.php +++ b/tests/Query/Oracle/MinuteTest.php @@ -8,7 +8,7 @@ class MinuteTest extends OracleTestCase { - public function testMinute() + public function testMinute(): void { $this->assertDqlProducesSql( "SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Oracle/MonthTest.php b/tests/Query/Oracle/MonthTest.php index 8ce654c5..2cff3d22 100644 --- a/tests/Query/Oracle/MonthTest.php +++ b/tests/Query/Oracle/MonthTest.php @@ -8,7 +8,7 @@ class MonthTest extends OracleTestCase { - public function testMonth() + public function testMonth(): void { $this->assertDqlProducesSql( "SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Oracle/SecondTest.php b/tests/Query/Oracle/SecondTest.php index 62bca5f2..c018120c 100644 --- a/tests/Query/Oracle/SecondTest.php +++ b/tests/Query/Oracle/SecondTest.php @@ -8,7 +8,7 @@ class SecondTest extends OracleTestCase { - public function testSecond() + public function testSecond(): void { $this->assertDqlProducesSql( "SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Oracle/ToCharTest.php b/tests/Query/Oracle/ToCharTest.php index b7941758..6cfda980 100644 --- a/tests/Query/Oracle/ToCharTest.php +++ b/tests/Query/Oracle/ToCharTest.php @@ -10,7 +10,7 @@ class ToCharTest extends OracleTestCase { - public function testFullQuery() + public function testFullQuery(): void { $queryBuilder = new QueryBuilder($this->entityManager); $queryBuilder->select('TO_CHAR(d.created, \'DD-MON-YYYY HH24:MI:SSxFF\', \'german\')') diff --git a/tests/Query/Oracle/TruncTest.php b/tests/Query/Oracle/TruncTest.php index c255c2a5..2f3d0545 100755 --- a/tests/Query/Oracle/TruncTest.php +++ b/tests/Query/Oracle/TruncTest.php @@ -8,7 +8,7 @@ class TruncTest extends OracleTestCase { - public function testFullQuery() + public function testFullQuery(): void { $dql = 'SELECT TRUNC(d.created, \'YYYY\') FROM DoctrineExtensions\\Tests\\Entities\\Date d'; $q = $this->entityManager->createQuery($dql); @@ -17,7 +17,7 @@ public function testFullQuery() $this->assertEquals($sql, $q->getSql()); } - public function testShortQuery() + public function testShortQuery(): void { $dql = 'SELECT TRUNC(d.created) FROM DoctrineExtensions\\Tests\\Entities\\Date d'; $q = $this->entityManager->createQuery($dql); diff --git a/tests/Query/Oracle/YearTest.php b/tests/Query/Oracle/YearTest.php index 5bc289ad..726db14e 100644 --- a/tests/Query/Oracle/YearTest.php +++ b/tests/Query/Oracle/YearTest.php @@ -8,7 +8,7 @@ class YearTest extends OracleTestCase { - public function testYear() + public function testYear(): void { $this->assertDqlProducesSql( "SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Postgresql/AtTimeZoneTest.php b/tests/Query/Postgresql/AtTimeZoneTest.php index ab9e4ae0..b078b18c 100644 --- a/tests/Query/Postgresql/AtTimeZoneTest.php +++ b/tests/Query/Postgresql/AtTimeZoneTest.php @@ -10,7 +10,7 @@ class AtTimeZoneTest extends PostgresqlTestCase { - public function testAtTimeZone() + public function testAtTimeZone(): void { $dql = "SELECT d FROM DoctrineExtensions\Tests\Entities\Date d WHERE AT_TIME_ZONE(d.created, :timeZone) < :currentTime"; $q = $this->entityManager->createQuery($dql); diff --git a/tests/Query/Postgresql/CountFilterTest.php b/tests/Query/Postgresql/CountFilterTest.php index 6373fd7d..2db4d8e4 100644 --- a/tests/Query/Postgresql/CountFilterTest.php +++ b/tests/Query/Postgresql/CountFilterTest.php @@ -8,7 +8,7 @@ class CountFilterTest extends PostgresqlTestCase { - public function testCountFilter() + public function testCountFilter(): void { $dql = "SELECT COUNT_FILTER(b, WHERE b.id = :id) FROM DoctrineExtensions\Tests\Entities\Blank b"; $q = $this->entityManager->createQuery($dql); diff --git a/tests/Query/Postgresql/DatePartTest.php b/tests/Query/Postgresql/DatePartTest.php index 06ec9713..3174168e 100644 --- a/tests/Query/Postgresql/DatePartTest.php +++ b/tests/Query/Postgresql/DatePartTest.php @@ -9,7 +9,7 @@ class DatePartTest extends PostgresqlTestCase { - public function testDatePart() + public function testDatePart(): void { $queryBuilder = new QueryBuilder($this->entityManager); $queryBuilder diff --git a/tests/Query/Postgresql/DateTest.php b/tests/Query/Postgresql/DateTest.php index 76fa1326..909253c2 100644 --- a/tests/Query/Postgresql/DateTest.php +++ b/tests/Query/Postgresql/DateTest.php @@ -10,7 +10,7 @@ class DateTest extends PostgresqlTestCase { - public function testStrToDate() + public function testStrToDate(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE STR_TO_DATE(p.created, :dateFormat) < :currentTime"; $q = $this->entityManager->createQuery($dql); @@ -21,7 +21,7 @@ public function testStrToDate() $this->assertEquals($sql, $q->getSql()); } - public function testDateFunction() + public function testDateFunction(): void { $dql = "SELECT DATE(p.created) FROM DoctrineExtensions\Tests\Entities\Date p"; $sql = 'SELECT DATE(d0_.created) AS sclr_0 FROM Date d0_'; diff --git a/tests/Query/Postgresql/DateTruncTest.php b/tests/Query/Postgresql/DateTruncTest.php index c93245c9..af018070 100644 --- a/tests/Query/Postgresql/DateTruncTest.php +++ b/tests/Query/Postgresql/DateTruncTest.php @@ -9,7 +9,7 @@ class DateTruncTest extends PostgresqlTestCase { - public function testDateTrunc() + public function testDateTrunc(): void { $queryBuilder = new QueryBuilder($this->entityManager); $queryBuilder diff --git a/tests/Query/Postgresql/DayTest.php b/tests/Query/Postgresql/DayTest.php index dbf58ced..72dd54c3 100644 --- a/tests/Query/Postgresql/DayTest.php +++ b/tests/Query/Postgresql/DayTest.php @@ -8,7 +8,7 @@ class DayTest extends PostgresqlTestCase { - public function testDay() + public function testDay(): void { $this->assertDqlProducesSql( "SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Postgresql/GreatestTest.php b/tests/Query/Postgresql/GreatestTest.php index 422f58c0..f830e091 100644 --- a/tests/Query/Postgresql/GreatestTest.php +++ b/tests/Query/Postgresql/GreatestTest.php @@ -8,7 +8,7 @@ class GreatestTest extends PostgresqlTestCase { - public function testGreatest() + public function testGreatest(): void { $this->assertDqlProducesSql( "SELECT GREATEST(2, 5, 8) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Postgresql/HourTest.php b/tests/Query/Postgresql/HourTest.php index 66fd1d7f..c2a5bdb2 100644 --- a/tests/Query/Postgresql/HourTest.php +++ b/tests/Query/Postgresql/HourTest.php @@ -8,7 +8,7 @@ class HourTest extends PostgresqlTestCase { - public function testHour() + public function testHour(): void { $this->assertDqlProducesSql( "SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Postgresql/LeastTest.php b/tests/Query/Postgresql/LeastTest.php index 9783383f..a231d211 100644 --- a/tests/Query/Postgresql/LeastTest.php +++ b/tests/Query/Postgresql/LeastTest.php @@ -8,7 +8,7 @@ class LeastTest extends PostgresqlTestCase { - public function testLeast() + public function testLeast(): void { $this->assertDqlProducesSql( "SELECT LEAST(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Postgresql/MinuteTest.php b/tests/Query/Postgresql/MinuteTest.php index 9b468317..682ad1ee 100644 --- a/tests/Query/Postgresql/MinuteTest.php +++ b/tests/Query/Postgresql/MinuteTest.php @@ -8,7 +8,7 @@ class MinuteTest extends PostgresqlTestCase { - public function testMinute() + public function testMinute(): void { $this->assertDqlProducesSql( "SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Postgresql/MonthTest.php b/tests/Query/Postgresql/MonthTest.php index 218ef829..2b084173 100644 --- a/tests/Query/Postgresql/MonthTest.php +++ b/tests/Query/Postgresql/MonthTest.php @@ -8,7 +8,7 @@ class MonthTest extends PostgresqlTestCase { - public function testMonth() + public function testMonth(): void { $this->assertDqlProducesSql( "SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Postgresql/RegexpReplaceTest.php b/tests/Query/Postgresql/RegexpReplaceTest.php index a6b7e163..6f4a0084 100644 --- a/tests/Query/Postgresql/RegexpReplaceTest.php +++ b/tests/Query/Postgresql/RegexpReplaceTest.php @@ -8,7 +8,7 @@ class RegexpReplaceTest extends PostgresqlTestCase { - public function testRegexpReplace() + public function testRegexpReplace(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Set p WHERE REGEXP_REPLACE(p.set, '\d', 'X') LIKE 'testXXX'"; $q = $this->entityManager->createQuery($dql); diff --git a/tests/Query/Postgresql/SecondTest.php b/tests/Query/Postgresql/SecondTest.php index 6a12a8a5..cdac4433 100644 --- a/tests/Query/Postgresql/SecondTest.php +++ b/tests/Query/Postgresql/SecondTest.php @@ -8,7 +8,7 @@ class SecondTest extends PostgresqlTestCase { - public function testSecond() + public function testSecond(): void { $this->assertDqlProducesSql( "SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Postgresql/StringAggTest.php b/tests/Query/Postgresql/StringAggTest.php index 35cb1b93..dac1afa1 100644 --- a/tests/Query/Postgresql/StringAggTest.php +++ b/tests/Query/Postgresql/StringAggTest.php @@ -9,7 +9,7 @@ class StringAggTest extends PostgresqlTestCase { - public function testStringAgg() + public function testStringAgg(): void { $queryBuilder = new QueryBuilder($this->entityManager); $queryBuilder @@ -22,7 +22,7 @@ public function testStringAgg() $this->assertEquals($expected, $queryBuilder->getQuery()->getSQL()); } - public function testStringAggWithDistinct() + public function testStringAggWithDistinct(): void { $queryBuilder = new QueryBuilder($this->entityManager); $queryBuilder @@ -35,7 +35,7 @@ public function testStringAggWithDistinct() $this->assertEquals($expected, $queryBuilder->getQuery()->getSQL()); } - public function testStringAggWithOrderByClause() + public function testStringAggWithOrderByClause(): void { $queryBuilder = new QueryBuilder($this->entityManager); $queryBuilder @@ -48,7 +48,7 @@ public function testStringAggWithOrderByClause() $this->assertEquals($expected, $queryBuilder->getQuery()->getSQL()); } - public function testStringAggWithOrderByClauseAndPredefinedDirectory() + public function testStringAggWithOrderByClauseAndPredefinedDirectory(): void { $queryBuilder = new QueryBuilder($this->entityManager); $queryBuilder @@ -61,7 +61,7 @@ public function testStringAggWithOrderByClauseAndPredefinedDirectory() $this->assertEquals($expected, $queryBuilder->getQuery()->getSQL()); } - public function testStringAggFullDeclaration() + public function testStringAggFullDeclaration(): void { $queryBuilder = new QueryBuilder($this->entityManager); $queryBuilder diff --git a/tests/Query/Postgresql/StringTest.php b/tests/Query/Postgresql/StringTest.php index 3523ceaf..926a19a6 100644 --- a/tests/Query/Postgresql/StringTest.php +++ b/tests/Query/Postgresql/StringTest.php @@ -8,7 +8,7 @@ class StringTest extends PostgresqlTestCase { - public function testFormatDate() + public function testFormatDate(): void { $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE DATE_FORMAT(p.created, :dateFormat) < :currentTime"; $q = $this->entityManager->createQuery($dql); diff --git a/tests/Query/Postgresql/YearTest.php b/tests/Query/Postgresql/YearTest.php index 019da6ae..2f1e2c35 100644 --- a/tests/Query/Postgresql/YearTest.php +++ b/tests/Query/Postgresql/YearTest.php @@ -8,7 +8,7 @@ class YearTest extends PostgresqlTestCase { - public function testYear() + public function testYear(): void { $this->assertDqlProducesSql( "SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Sqlite/ConcatWsTest.php b/tests/Query/Sqlite/ConcatWsTest.php index c7d91489..15660e94 100644 --- a/tests/Query/Sqlite/ConcatWsTest.php +++ b/tests/Query/Sqlite/ConcatWsTest.php @@ -8,7 +8,7 @@ class ConcatWsTest extends SqliteTestCase { - public function testConcatWs() + public function testConcatWs(): void { $dql = "SELECT CONCAT_WS(',', p.id, p.name) FROM DoctrineExtensions\\Tests\\Entities\\Product p"; diff --git a/tests/Query/Sqlite/DateFormatTest.php b/tests/Query/Sqlite/DateFormatTest.php index f3f618eb..bea3f7d8 100644 --- a/tests/Query/Sqlite/DateFormatTest.php +++ b/tests/Query/Sqlite/DateFormatTest.php @@ -8,7 +8,7 @@ class DateFormatTest extends SqliteTestCase { - public function testCommonFormats() + public function testCommonFormats(): void { // Both result in '2015-12-30 14:23:40' $dql = "SELECT DATE_FORMAT(b.created, '%Y-%m-%d %H:%i:%S') FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b"; @@ -24,7 +24,7 @@ public function testCommonFormats() * they get converted to the closest sqlite substitutions. * In this test a few examples are listed: */ - public function testUnsupportedFormats() + public function testUnsupportedFormats(): void { // Sqlite does not support AM / PM // mysql: '10:15:22 PM' diff --git a/tests/Query/Sqlite/DayTest.php b/tests/Query/Sqlite/DayTest.php index c837e64b..77fef8a3 100644 --- a/tests/Query/Sqlite/DayTest.php +++ b/tests/Query/Sqlite/DayTest.php @@ -8,7 +8,7 @@ class DayTest extends SqliteTestCase { - public function testDay() + public function testDay(): void { $this->assertDqlProducesSql( "SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Sqlite/GreatestTest.php b/tests/Query/Sqlite/GreatestTest.php index d4551090..abcaa621 100644 --- a/tests/Query/Sqlite/GreatestTest.php +++ b/tests/Query/Sqlite/GreatestTest.php @@ -8,7 +8,7 @@ class GreatestTest extends SqliteTestCase { - public function testGreatest() + public function testGreatest(): void { $this->assertDqlProducesSql( "SELECT Greatest(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Sqlite/HourTest.php b/tests/Query/Sqlite/HourTest.php index 20c00a39..8a127539 100644 --- a/tests/Query/Sqlite/HourTest.php +++ b/tests/Query/Sqlite/HourTest.php @@ -8,7 +8,7 @@ class HourTest extends SqliteTestCase { - public function testHour() + public function testHour(): void { $this->assertDqlProducesSql( "SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Sqlite/IfElseTest.php b/tests/Query/Sqlite/IfElseTest.php index 0cfc6288..05899586 100644 --- a/tests/Query/Sqlite/IfElseTest.php +++ b/tests/Query/Sqlite/IfElseTest.php @@ -8,7 +8,7 @@ class IfElseTest extends SqliteTestCase { - public function testIfElse() + public function testIfElse(): void { $dql = 'SELECT ifelse(1 > 0, 1, 0) FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b'; diff --git a/tests/Query/Sqlite/JulianDayTest.php b/tests/Query/Sqlite/JulianDayTest.php index 38260f75..f253ba4b 100644 --- a/tests/Query/Sqlite/JulianDayTest.php +++ b/tests/Query/Sqlite/JulianDayTest.php @@ -8,7 +8,7 @@ class JulianDayTest extends SqliteTestCase { - public function testWithOneArgument() + public function testWithOneArgument(): void { $this->assertDqlProducesSql( "SELECT JULIANDAY(:date) FROM DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Sqlite/LeastTest.php b/tests/Query/Sqlite/LeastTest.php index 304c4a01..51504ffa 100644 --- a/tests/Query/Sqlite/LeastTest.php +++ b/tests/Query/Sqlite/LeastTest.php @@ -8,7 +8,7 @@ class LeastTest extends SqliteTestCase { - public function testLeast() + public function testLeast(): void { $this->assertDqlProducesSql( "SELECT LEAST(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Sqlite/MinuteTest.php b/tests/Query/Sqlite/MinuteTest.php index 1c8f40db..e6421a65 100644 --- a/tests/Query/Sqlite/MinuteTest.php +++ b/tests/Query/Sqlite/MinuteTest.php @@ -8,7 +8,7 @@ class MinuteTest extends SqliteTestCase { - public function testMinute() + public function testMinute(): void { $this->assertDqlProducesSql( "SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Sqlite/MonthTest.php b/tests/Query/Sqlite/MonthTest.php index 573aa83a..d3b04442 100644 --- a/tests/Query/Sqlite/MonthTest.php +++ b/tests/Query/Sqlite/MonthTest.php @@ -8,7 +8,7 @@ class MonthTest extends SqliteTestCase { - public function testMonth() + public function testMonth(): void { $this->assertDqlProducesSql( "SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Sqlite/NumericFunctionsTest.php b/tests/Query/Sqlite/NumericFunctionsTest.php index 1ca0e534..62b29290 100644 --- a/tests/Query/Sqlite/NumericFunctionsTest.php +++ b/tests/Query/Sqlite/NumericFunctionsTest.php @@ -11,7 +11,7 @@ */ class NumericFunctionsTest extends SqliteTestCase { - public function testRound() + public function testRound(): void { $dql = 'SELECT ROUND(1.2345, 2) as outcome FROM DoctrineExtensions\Tests\Entities\Blank p'; $q = $this->entityManager->createQuery($dql); diff --git a/tests/Query/Sqlite/RandomTest.php b/tests/Query/Sqlite/RandomTest.php index 0dc759aa..eb3d6b95 100644 --- a/tests/Query/Sqlite/RandomTest.php +++ b/tests/Query/Sqlite/RandomTest.php @@ -8,7 +8,7 @@ class RandomTest extends SqliteTestCase { - public function testRandom() + public function testRandom(): void { $this->assertDqlProducesSql( "SELECT RANDOM() from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Sqlite/SecondTest.php b/tests/Query/Sqlite/SecondTest.php index 0bdda0c4..85395d8d 100644 --- a/tests/Query/Sqlite/SecondTest.php +++ b/tests/Query/Sqlite/SecondTest.php @@ -8,7 +8,7 @@ class SecondTest extends SqliteTestCase { - public function testSecond() + public function testSecond(): void { $this->assertDqlProducesSql( "SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Query/Sqlite/StrfTimeTest.php b/tests/Query/Sqlite/StrfTimeTest.php index 409ccfc9..925f21e6 100644 --- a/tests/Query/Sqlite/StrfTimeTest.php +++ b/tests/Query/Sqlite/StrfTimeTest.php @@ -33,7 +33,7 @@ public function testStrfTimes($function, $formatter): void ); } - public function testStrfTime() + public function testStrfTime(): void { $this->assertDqlProducesSql( 'SELECT StrfTime(\'%s\', p.created) as Time FROM DoctrineExtensions\Tests\Entities\Date p', diff --git a/tests/Query/Sqlite/StringFunctionsTest.php b/tests/Query/Sqlite/StringFunctionsTest.php index 7273f77d..c6a1f319 100644 --- a/tests/Query/Sqlite/StringFunctionsTest.php +++ b/tests/Query/Sqlite/StringFunctionsTest.php @@ -11,21 +11,21 @@ */ class StringFunctionsTest extends SqliteTestCase { - public function testIfNull() + public function testIfNull(): void { $dql = 'SELECT IFNULL(p.id, 0) as outcome FROM DoctrineExtensions\Tests\Entities\Blank p'; $q = $this->entityManager->createQuery($dql); $this->assertEquals("SELECT IFNULL(b0_.id, 0) AS {$this->columnAlias} FROM Blank b0_", $q->getSql()); } - public function testReplace() + public function testReplace(): void { $dql = "SELECT REPLACE(p.id, '1', '2') as outcome FROM DoctrineExtensions\\Tests\\Entities\\Blank p"; $q = $this->entityManager->createQuery($dql); $this->assertEquals("SELECT REPLACE(b0_.id, '1', '2') AS {$this->columnAlias} FROM Blank b0_", $q->getSql()); } - public function testConcatWs() + public function testConcatWs(): void { $dql = "SELECT CONCAT_WS('-', 'foo', 'bar', 'baz') as out FROM DoctrineExtensions\\Tests\\Entities\\Blank p"; diff --git a/tests/Query/Sqlite/WeekDayTest.php b/tests/Query/Sqlite/WeekDayTest.php index a429efd6..174c3f08 100644 --- a/tests/Query/Sqlite/WeekDayTest.php +++ b/tests/Query/Sqlite/WeekDayTest.php @@ -8,7 +8,7 @@ class WeekDayTest extends SqliteTestCase { - public function testFormatWeekDay() + public function testFormatWeekDay(): void { $dql = 'SELECT WEEKDAY(b.created) FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b'; $this->assertEquals( diff --git a/tests/Query/Sqlite/WeekTest.php b/tests/Query/Sqlite/WeekTest.php index 1b1eaa15..fa6ab203 100644 --- a/tests/Query/Sqlite/WeekTest.php +++ b/tests/Query/Sqlite/WeekTest.php @@ -8,7 +8,7 @@ class WeekTest extends SqliteTestCase { - public function testFormatWeek() + public function testFormatWeek(): void { $dql = 'SELECT WEEK(b.created) FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b'; $this->assertEquals( @@ -17,7 +17,7 @@ public function testFormatWeek() ); } - public function testFormatWeekWithSecondArgument() + public function testFormatWeekWithSecondArgument(): void { $dql = 'SELECT WEEK(b.created, 1) FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b'; $this->assertEquals( diff --git a/tests/Query/Sqlite/YearTest.php b/tests/Query/Sqlite/YearTest.php index 2238911e..a8905714 100644 --- a/tests/Query/Sqlite/YearTest.php +++ b/tests/Query/Sqlite/YearTest.php @@ -8,7 +8,7 @@ class YearTest extends SqliteTestCase { - public function testYear() + public function testYear(): void { $this->assertDqlProducesSql( "SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", diff --git a/tests/Types/CarbonDateTest.php b/tests/Types/CarbonDateTest.php index fe114680..82229eba 100755 --- a/tests/Types/CarbonDateTest.php +++ b/tests/Types/CarbonDateTest.php @@ -74,7 +74,7 @@ public function setUp(): void $this->em->flush(); } - public function testDateGetter() + public function testDateGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); @@ -85,7 +85,7 @@ public function testDateGetter() ); } - public function testDateSetter() + public function testDateSetter(): void { $entity = new Entity(); $entity->id = 2; @@ -95,7 +95,7 @@ public function testDateSetter() $this->assertNull($this->em->flush()); } - public function testDateTimeGetter() + public function testDateTimeGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); @@ -103,7 +103,7 @@ public function testDateTimeGetter() $this->assertEquals(Carbon::create(2015, 1, 1, 0, 0, 0), $entity->datetime); } - public function testDateTimeSetter() + public function testDateTimeSetter(): void { $entity = new Entity(); $entity->id = 2; @@ -113,7 +113,7 @@ public function testDateTimeSetter() $this->assertNull($this->em->flush()); } - public function testDateTimeTzGetter() + public function testDateTimeTzGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); @@ -121,7 +121,7 @@ public function testDateTimeTzGetter() $this->assertEquals(Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'), $entity->datetime_tz); } - public function testDateTimeTzSetter() + public function testDateTimeTzSetter(): void { $entity = new Entity(); $entity->id = 2; @@ -131,7 +131,7 @@ public function testDateTimeTzSetter() $this->assertNull($this->em->flush()); } - public function testTimeGetter() + public function testTimeGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); @@ -139,7 +139,7 @@ public function testTimeGetter() $this->assertEquals(Carbon::createFromTime(12, 0, 0, 'Europe/London'), $entity->time); } - public function testTimeSetter() + public function testTimeSetter(): void { $entity = new Entity(); $entity->id = 2; @@ -149,7 +149,7 @@ public function testTimeSetter() $this->assertNull($this->em->flush()); } - public function testImmutableDateGetter() + public function testImmutableDateGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); @@ -160,7 +160,7 @@ public function testImmutableDateGetter() ); } - public function testImmutableDateSetter() + public function testImmutableDateSetter(): void { $entity = new Entity(); $entity->id = 2; @@ -170,7 +170,7 @@ public function testImmutableDateSetter() $this->assertNull($this->em->flush()); } - public function testImmutableDateTimeGetter() + public function testImmutableDateTimeGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); @@ -178,7 +178,7 @@ public function testImmutableDateTimeGetter() $this->assertEquals(CarbonImmutable::create(2015, 1, 1, 0, 0, 0), $entity->datetime); } - public function testImmutableDateTimeSetter() + public function testImmutableDateTimeSetter(): void { $entity = new Entity(); $entity->id = 2; @@ -188,7 +188,7 @@ public function testImmutableDateTimeSetter() $this->assertNull($this->em->flush()); } - public function testImmutableDateTimeTzGetter() + public function testImmutableDateTimeTzGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); @@ -196,7 +196,7 @@ public function testImmutableDateTimeTzGetter() $this->assertEquals(CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'), $entity->datetime_tz); } - public function testImmutableDateTimeTzSetter() + public function testImmutableDateTimeTzSetter(): void { $entity = new Entity(); $entity->id = 2; @@ -206,7 +206,7 @@ public function testImmutableDateTimeTzSetter() $this->assertNull($this->em->flush()); } - public function testImmutableTimeGetter() + public function testImmutableTimeGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); @@ -214,7 +214,7 @@ public function testImmutableTimeGetter() $this->assertEquals(CarbonImmutable::createFromTime(12, 0, 0, 'Europe/London'), $entity->time); } - public function testImmutableTimeSetter() + public function testImmutableTimeSetter(): void { $entity = new Entity(); $entity->id = 2; From 0466a63b6621ae99e549f3caa07b86612c0735f7 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:18:30 +0100 Subject: [PATCH 21/43] Code Sniffer: manual fix rule Squiz.NamingConventions.ValidVariableName.NotCamelCaps --- src/Query/Mysql/TimestampAdd.php | 6 +++--- src/Query/Mysql/TimestampDiff.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Query/Mysql/TimestampAdd.php b/src/Query/Mysql/TimestampAdd.php index a4f03d6a..db18dbc7 100644 --- a/src/Query/Mysql/TimestampAdd.php +++ b/src/Query/Mysql/TimestampAdd.php @@ -33,13 +33,13 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(SqlWalker $sql_walker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'TIMESTAMPADD(%s, %s, %s)', $this->unit, - $this->firstDatetimeExpression->dispatch($sql_walker), - $this->secondDatetimeExpression->dispatch($sql_walker) + $this->firstDatetimeExpression->dispatch($sqlWalker), + $this->secondDatetimeExpression->dispatch($sqlWalker) ); } } diff --git a/src/Query/Mysql/TimestampDiff.php b/src/Query/Mysql/TimestampDiff.php index 35eeb60e..df45a000 100644 --- a/src/Query/Mysql/TimestampDiff.php +++ b/src/Query/Mysql/TimestampDiff.php @@ -33,13 +33,13 @@ public function parse(Parser $parser): void $parser->match(Lexer::T_CLOSE_PARENTHESIS); } - public function getSql(SqlWalker $sql_walker): string + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'TIMESTAMPDIFF(%s, %s, %s)', $this->unit, - $this->firstDatetimeExpression->dispatch($sql_walker), - $this->secondDatetimeExpression->dispatch($sql_walker) + $this->firstDatetimeExpression->dispatch($sqlWalker), + $this->secondDatetimeExpression->dispatch($sqlWalker) ); } } From 1bc0c0309f56a2be4ea12f70ba6fe9246f6d313a Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:24:26 +0100 Subject: [PATCH 22/43] Code Sniffer: manual fix rule Squiz.Strings.DoubleQuoteUsage.ContainsVar --- src/Query/Sqlite/ConcatWs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Query/Sqlite/ConcatWs.php b/src/Query/Sqlite/ConcatWs.php index 9bb57225..6c36b855 100644 --- a/src/Query/Sqlite/ConcatWs.php +++ b/src/Query/Sqlite/ConcatWs.php @@ -69,7 +69,7 @@ public function getSql(SqlWalker $sqlWalker): string // Iterate over the captured expressions and add them to the query. for ($i = 1; $i < count($this->values); $i++) { if ($i > 1) { - $queryBuilder[] = " || '{$separator}' || "; + $queryBuilder[] = ' || \'' . $separator . '\' || '; } // Dispatch the walker on the current node. From 12914a28f9f9c0b3e7c7f988e46cf601dbea476c Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:27:00 +0100 Subject: [PATCH 23/43] Code Sniffer: manual fix rule Squiz.Commenting.FunctionComment.MissingParamName --- src/Query/SortableNullsWalker.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Query/SortableNullsWalker.php b/src/Query/SortableNullsWalker.php index f7536f62..53ff0ee1 100644 --- a/src/Query/SortableNullsWalker.php +++ b/src/Query/SortableNullsWalker.php @@ -40,9 +40,7 @@ class SortableNullsWalker extends Query\SqlWalker public const NULLS_LAST = 'NULLS LAST'; /** - * @param $orderByItem - * - * @return array|string + * {@inheritDoc} */ public function walkOrderByItem($orderByItem) { From a85ac5eab0df22d7415663dfb6f84aeb1d176130 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 01:47:06 +0100 Subject: [PATCH 24/43] Code Sniffer: manual fix rule SlevomatCodingStandard.TypeHints.ReturnTypeHint.* --- src/Types/CarbonDateTimeType.php | 12 ++++++++ src/Types/CarbonDateTimeTzType.php | 12 ++++++++ src/Types/CarbonDateType.php | 12 ++++++++ src/Types/CarbonImmutableDateTimeType.php | 12 ++++++++ src/Types/CarbonImmutableDateTimeTzType.php | 12 ++++++++ src/Types/CarbonImmutableDateType.php | 12 ++++++++ src/Types/CarbonImmutableTimeType.php | 12 ++++++++ src/Types/CarbonTimeType.php | 12 ++++++++ src/Types/PolygonType.php | 34 ++++++++++++++++++--- src/Types/ZendDateType.php | 21 +++++++++++-- 10 files changed, 144 insertions(+), 7 deletions(-) diff --git a/src/Types/CarbonDateTimeType.php b/src/Types/CarbonDateTimeType.php index e772f47a..6b58f176 100644 --- a/src/Types/CarbonDateTimeType.php +++ b/src/Types/CarbonDateTimeType.php @@ -6,6 +6,7 @@ use Carbon\Carbon; use DateTime; +use DateTimeInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateTimeType; @@ -13,11 +14,19 @@ class CarbonDateTimeType extends DateTimeType { public const CARBONDATETIME = 'carbondatetime'; + /** + * {@inheritDoc} + */ public function getName() { return self::CARBONDATETIME; } + /** + * {@inheritDoc} + * + * @return Carbon|DateTimeInterface + */ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); @@ -29,6 +38,9 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $result; } + /** + * {@inheritDoc} + */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; diff --git a/src/Types/CarbonDateTimeTzType.php b/src/Types/CarbonDateTimeTzType.php index 4cb7650d..b902f735 100644 --- a/src/Types/CarbonDateTimeTzType.php +++ b/src/Types/CarbonDateTimeTzType.php @@ -6,6 +6,7 @@ use Carbon\Carbon; use DateTime; +use DateTimeInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateTimeTzType; @@ -13,11 +14,19 @@ class CarbonDateTimeTzType extends DateTimeTzType { public const CARBONDATETIMETZ = 'carbondatetimetz'; + /** + * {@inheritDoc} + */ public function getName() { return self::CARBONDATETIMETZ; } + /** + * {@inheritDoc} + * + * @return Carbon|DateTimeInterface + */ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); @@ -29,6 +38,9 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $result; } + /** + * {@inheritDoc} + */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; diff --git a/src/Types/CarbonDateType.php b/src/Types/CarbonDateType.php index 314875ca..dfa120b2 100644 --- a/src/Types/CarbonDateType.php +++ b/src/Types/CarbonDateType.php @@ -6,6 +6,7 @@ use Carbon\Carbon; use DateTime; +use DateTimeInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateType; @@ -13,11 +14,19 @@ class CarbonDateType extends DateType { public const CARBONDATE = 'carbondate'; + /** + * {@inheritDoc} + */ public function getName() { return self::CARBONDATE; } + /** + * {@inheritDoc} + * + * @return Carbon|DateTimeInterface + */ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); @@ -29,6 +38,9 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $result; } + /** + * {@inheritDoc} + */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; diff --git a/src/Types/CarbonImmutableDateTimeType.php b/src/Types/CarbonImmutableDateTimeType.php index 270ba339..23ae9def 100644 --- a/src/Types/CarbonImmutableDateTimeType.php +++ b/src/Types/CarbonImmutableDateTimeType.php @@ -6,6 +6,7 @@ use Carbon\CarbonImmutable; use DateTime; +use DateTimeInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateTimeType; @@ -13,11 +14,19 @@ class CarbonImmutableDateTimeType extends DateTimeType { public const CARBONDATETIME = 'carbondatetime_immutable'; + /** + * {@inheritDoc} + */ public function getName() { return self::CARBONDATETIME; } + /** + * {@inheritDoc} + * + * @return CarbonImmutable|DateTimeInterface + */ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); @@ -29,6 +38,9 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $result; } + /** + * {@inheritDoc} + */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; diff --git a/src/Types/CarbonImmutableDateTimeTzType.php b/src/Types/CarbonImmutableDateTimeTzType.php index 56a3235c..9fb9ec21 100644 --- a/src/Types/CarbonImmutableDateTimeTzType.php +++ b/src/Types/CarbonImmutableDateTimeTzType.php @@ -6,6 +6,7 @@ use Carbon\CarbonImmutable; use DateTime; +use DateTimeInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateTimeTzType; @@ -13,11 +14,19 @@ class CarbonImmutableDateTimeTzType extends DateTimeTzType { public const CARBONDATETIMETZ = 'carbondatetimetz_immutable'; + /** + * {@inheritDoc} + */ public function getName() { return self::CARBONDATETIMETZ; } + /** + * {@inheritDoc} + * + * @return CarbonImmutable|DateTimeInterface + */ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); @@ -29,6 +38,9 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $result; } + /** + * {@inheritDoc} + */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; diff --git a/src/Types/CarbonImmutableDateType.php b/src/Types/CarbonImmutableDateType.php index d05ef69e..23c1089a 100644 --- a/src/Types/CarbonImmutableDateType.php +++ b/src/Types/CarbonImmutableDateType.php @@ -6,6 +6,7 @@ use Carbon\CarbonImmutable; use DateTime; +use DateTimeInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\DateType; @@ -13,11 +14,19 @@ class CarbonImmutableDateType extends DateType { public const CARBONDATE = 'carbondate_immutable'; + /** + * {@inheritDoc} + */ public function getName() { return self::CARBONDATE; } + /** + * {@inheritDoc} + * + * @return CarbonImmutable|DateTimeInterface + */ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); @@ -29,6 +38,9 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $result; } + /** + * {@inheritDoc} + */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; diff --git a/src/Types/CarbonImmutableTimeType.php b/src/Types/CarbonImmutableTimeType.php index 31757a5c..d1ab33f4 100644 --- a/src/Types/CarbonImmutableTimeType.php +++ b/src/Types/CarbonImmutableTimeType.php @@ -6,6 +6,7 @@ use Carbon\CarbonImmutable; use DateTime; +use DateTimeInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\TimeType; @@ -13,11 +14,19 @@ class CarbonImmutableTimeType extends TimeType { public const CARBONTIME = 'carbontime_immutable'; + /** + * {@inheritDoc} + */ public function getName() { return self::CARBONTIME; } + /** + * {@inheritDoc} + * + * @return CarbonImmutable|DateTimeInterface + */ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); @@ -29,6 +38,9 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $result; } + /** + * {@inheritDoc} + */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; diff --git a/src/Types/CarbonTimeType.php b/src/Types/CarbonTimeType.php index 7415b081..8b1191ff 100644 --- a/src/Types/CarbonTimeType.php +++ b/src/Types/CarbonTimeType.php @@ -6,6 +6,7 @@ use Carbon\Carbon; use DateTime; +use DateTimeInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\TimeType; @@ -13,11 +14,19 @@ class CarbonTimeType extends TimeType { public const CARBONTIME = 'carbontime'; + /** + * {@inheritDoc} + */ public function getName() { return self::CARBONTIME; } + /** + * {@inheritDoc} + * + * @return Carbon|DateTimeInterface + */ public function convertToPHPValue($value, AbstractPlatform $platform) { $result = parent::convertToPHPValue($value, $platform); @@ -29,6 +38,9 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $result; } + /** + * {@inheritDoc} + */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; diff --git a/src/Types/PolygonType.php b/src/Types/PolygonType.php index 584523e1..51fd5961 100644 --- a/src/Types/PolygonType.php +++ b/src/Types/PolygonType.php @@ -6,6 +6,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Type; +use Exception; use function preg_match; use function sprintf; @@ -14,16 +15,35 @@ class PolygonType extends Type { public const FIELD = 'polygon'; + /** + * {@inheritDoc} + */ + public function getName() + { + return self::FIELD; + } + + /** + * {@inheritDoc} + */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { return 'POLYGON'; } + /** + * {@inheritDoc} + */ public function canRequireSQLConversion() { return true; } + /** + * {@inheritDoc} + * + * @return string + */ public function convertToPHPValue($value, AbstractPlatform $platform) { preg_match('/POLYGON\(\((.*)\)\)/', $value, $matches); @@ -34,23 +54,27 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $matches[1]; } + /** + * {@inheritDoc} + */ public function convertToPHPValueSQL($sqlExpr, $platform) { return sprintf('AsText(%s)', $sqlExpr); } + /** + * {@inheritDoc} + */ public function convertToDatabaseValue($value, AbstractPlatform $platform) { return sprintf('POLYGON((%s))', $value); } + /** + * {@inheritDoc} + */ public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform) { return sprintf('ST_PolygonFromText(%s)', $sqlExpr); } - - public function getName() - { - return self::FIELD; - } } diff --git a/src/Types/ZendDateType.php b/src/Types/ZendDateType.php index b47b5737..20d22ee9 100755 --- a/src/Types/ZendDateType.php +++ b/src/Types/ZendDateType.php @@ -23,16 +23,25 @@ class ZendDateType extends Type { public const ZENDDATE = 'zenddate'; + /** + * {@inheritDoc} + */ public function getName() { return self::ZENDDATE; } + /** + * {@inheritDoc} + */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { return $platform->getDateTimeTypeDeclarationSQL($fieldDeclaration); } + /** + * {@inheritDoc} + */ public function convertToDatabaseValue($value, AbstractPlatform $platform) { return $value !== null @@ -42,10 +51,15 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) : null; } - public function convertToPHPValue($value, AbstractPlatform $platform): void + /** + * {@inheritDoc} + * + * @return Zend_Date + */ + public function convertToPHPValue($value, AbstractPlatform $platform) { if ($value === null) { - return; + return null; } $dateTimeFormatString = Zend_Locale_Format::convertPhpToIsoFormat( @@ -60,6 +74,9 @@ public function convertToPHPValue($value, AbstractPlatform $platform): void return $val; } + /** + * {@inheritDoc} + */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; From 06e39a6eec45cace56e5dba325eb468ced8ccace Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 02:33:40 +0100 Subject: [PATCH 25/43] Code Sniffer: apply rule Squiz.Strings.DoubleQuoteUsage.NotRequired --- tests/Query/Mysql/AcosTest.php | 2 +- tests/Query/Mysql/AsciiTest.php | 2 +- tests/Query/Mysql/AsinTest.php | 2 +- tests/Query/Mysql/Atan2Test.php | 2 +- tests/Query/Mysql/AtanTest.php | 2 +- tests/Query/Mysql/BitCountTest.php | 2 +- tests/Query/Mysql/BitXorTest.php | 2 +- tests/Query/Mysql/CeilTest.php | 2 +- tests/Query/Mysql/CharLengthTest.php | 2 +- tests/Query/Mysql/CosTest.php | 2 +- tests/Query/Mysql/CotTest.php | 2 +- tests/Query/Mysql/CountIfTest.php | 4 ++-- tests/Query/Mysql/DateTest.php | 6 +++--- tests/Query/Mysql/DayNameTest.php | 2 +- tests/Query/Mysql/DayOfWeekTest.php | 2 +- tests/Query/Mysql/DayOfYearTest.php | 2 +- tests/Query/Mysql/DayTest.php | 2 +- tests/Query/Mysql/DegressTest.php | 2 +- tests/Query/Mysql/DivTest.php | 2 +- tests/Query/Mysql/ExpTest.php | 2 +- tests/Query/Mysql/FieldTest.php | 2 +- tests/Query/Mysql/FindInSetTest.php | 2 +- tests/Query/Mysql/FloorTest.php | 2 +- tests/Query/Mysql/FormatTest.php | 2 +- tests/Query/Mysql/FromBase64.php | 2 +- tests/Query/Mysql/FromUnixTimeTest.php | 2 +- tests/Query/Mysql/GreatestTest.php | 2 +- tests/Query/Mysql/GroupConcatTest.php | 6 +++--- tests/Query/Mysql/HexTest.php | 2 +- tests/Query/Mysql/HourTest.php | 2 +- tests/Query/Mysql/IfElseTest.php | 4 ++-- tests/Query/Mysql/IfNullTest.php | 2 +- tests/Query/Mysql/JsonDepthTest.php | 2 +- tests/Query/Mysql/LastDayTest.php | 2 +- tests/Query/Mysql/LeastTest.php | 2 +- tests/Query/Mysql/Log10Test.php | 2 +- tests/Query/Mysql/Log2Test.php | 2 +- tests/Query/Mysql/LogTest.php | 2 +- tests/Query/Mysql/LpadTest.php | 2 +- tests/Query/Mysql/MakeDateTest.php | 2 +- tests/Query/Mysql/MinuteTest.php | 2 +- tests/Query/Mysql/MonthNameTest.php | 2 +- tests/Query/Mysql/MonthTest.php | 2 +- tests/Query/Mysql/NowTest.php | 2 +- tests/Query/Mysql/NullIfTest.php | 2 +- tests/Query/Mysql/PiTest.php | 2 +- tests/Query/Mysql/PowerTest.php | 2 +- tests/Query/Mysql/QuarterTest.php | 2 +- tests/Query/Mysql/RadiansTest.php | 2 +- tests/Query/Mysql/RandTest.php | 4 ++-- tests/Query/Mysql/ReplaceTest.php | 2 +- tests/Query/Mysql/RoundTest.php | 4 ++-- tests/Query/Mysql/RpadTest.php | 2 +- tests/Query/Mysql/SecondTest.php | 2 +- tests/Query/Mysql/SetTest.php | 2 +- tests/Query/Mysql/SinTest.php | 2 +- tests/Query/Mysql/StdDevTest.php | 2 +- tests/Query/Mysql/StdTest.php | 2 +- tests/Query/Mysql/StrToDateTest.php | 2 +- tests/Query/Mysql/StringTest.php | 10 +++++----- tests/Query/Mysql/SubstringIndexTest.php | 2 +- tests/Query/Mysql/TanTest.php | 2 +- tests/Query/Mysql/TimeDiffTest.php | 2 +- tests/Query/Mysql/TimeTest.php | 2 +- tests/Query/Mysql/TimeToSecTest.php | 2 +- tests/Query/Mysql/TruncateTest.php | 2 +- tests/Query/Mysql/UnhexTest.php | 2 +- tests/Query/Mysql/UnixTimestampTest.php | 4 ++-- tests/Query/Mysql/UtcTimestampTest.php | 2 +- tests/Query/Mysql/UuidShortTest.php | 2 +- tests/Query/Mysql/VarianceTest.php | 2 +- tests/Query/Mysql/WeekDayTest.php | 2 +- tests/Query/Mysql/WeekOfYearTest.php | 2 +- tests/Query/Mysql/WeekTest.php | 2 +- tests/Query/Mysql/YearTest.php | 2 +- tests/Query/Mysql/YearWeekTest.php | 2 +- tests/Query/MysqlWalkerTest.php | 6 +++--- tests/Query/Oracle/DayTest.php | 2 +- tests/Query/Oracle/HourTest.php | 2 +- tests/Query/Oracle/MinuteTest.php | 2 +- tests/Query/Oracle/MonthTest.php | 2 +- tests/Query/Oracle/SecondTest.php | 2 +- tests/Query/Oracle/YearTest.php | 2 +- tests/Query/Postgresql/AtTimeZoneTest.php | 2 +- tests/Query/Postgresql/CountFilterTest.php | 2 +- tests/Query/Postgresql/DateTest.php | 4 ++-- tests/Query/Postgresql/DayTest.php | 2 +- tests/Query/Postgresql/GreatestTest.php | 2 +- tests/Query/Postgresql/HourTest.php | 2 +- tests/Query/Postgresql/LeastTest.php | 2 +- tests/Query/Postgresql/MinuteTest.php | 2 +- tests/Query/Postgresql/MonthTest.php | 2 +- tests/Query/Postgresql/SecondTest.php | 2 +- tests/Query/Postgresql/StringTest.php | 2 +- tests/Query/Postgresql/YearTest.php | 2 +- tests/Query/Sqlite/DayTest.php | 2 +- tests/Query/Sqlite/GreatestTest.php | 2 +- tests/Query/Sqlite/HourTest.php | 2 +- tests/Query/Sqlite/JulianDayTest.php | 2 +- tests/Query/Sqlite/LeastTest.php | 2 +- tests/Query/Sqlite/MinuteTest.php | 2 +- tests/Query/Sqlite/MonthTest.php | 2 +- tests/Query/Sqlite/RandomTest.php | 2 +- tests/Query/Sqlite/SecondTest.php | 2 +- tests/Query/Sqlite/YearTest.php | 2 +- 105 files changed, 121 insertions(+), 121 deletions(-) diff --git a/tests/Query/Mysql/AcosTest.php b/tests/Query/Mysql/AcosTest.php index 196f467f..941a7f15 100644 --- a/tests/Query/Mysql/AcosTest.php +++ b/tests/Query/Mysql/AcosTest.php @@ -11,7 +11,7 @@ class AcosTest extends MysqlTestCase public function testAcos(): void { $this->assertDqlProducesSql( - "SELECT ACOS(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT ACOS(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT ACOS(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/AsciiTest.php b/tests/Query/Mysql/AsciiTest.php index 15505bac..fe8e1194 100644 --- a/tests/Query/Mysql/AsciiTest.php +++ b/tests/Query/Mysql/AsciiTest.php @@ -11,7 +11,7 @@ class AsciiTest extends MysqlTestCase public function testAscii(): void { $this->assertDqlProducesSql( - "SELECT ASCII(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT ASCII(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT ASCII(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/AsinTest.php b/tests/Query/Mysql/AsinTest.php index 50a8424a..491a809d 100644 --- a/tests/Query/Mysql/AsinTest.php +++ b/tests/Query/Mysql/AsinTest.php @@ -11,7 +11,7 @@ class AsinTest extends MysqlTestCase public function testAsin(): void { $this->assertDqlProducesSql( - "SELECT ASIN(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT ASIN(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT ASIN(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/Atan2Test.php b/tests/Query/Mysql/Atan2Test.php index 6c27b971..c593131f 100644 --- a/tests/Query/Mysql/Atan2Test.php +++ b/tests/Query/Mysql/Atan2Test.php @@ -9,7 +9,7 @@ class Atan2Test public function testAtan2(): void { $this->assertDqlProducesSql( - "SELECT ATAN2(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT ATAN2(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT ATAN2(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/AtanTest.php b/tests/Query/Mysql/AtanTest.php index f4ce6fd8..b584d37f 100644 --- a/tests/Query/Mysql/AtanTest.php +++ b/tests/Query/Mysql/AtanTest.php @@ -11,7 +11,7 @@ class AtanTest extends MysqlTestCase public function testAtan(): void { $this->assertDqlProducesSql( - "SELECT ATAN(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT ATAN(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT ATAN(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/BitCountTest.php b/tests/Query/Mysql/BitCountTest.php index e02fa240..00a79f8d 100644 --- a/tests/Query/Mysql/BitCountTest.php +++ b/tests/Query/Mysql/BitCountTest.php @@ -11,7 +11,7 @@ class BitCountTest extends MysqlTestCase public function testBitCount(): void { $this->assertDqlProducesSql( - "SELECT BIT_COUNT(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT BIT_COUNT(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT BIT_COUNT(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/BitXorTest.php b/tests/Query/Mysql/BitXorTest.php index e055ec86..e786285f 100644 --- a/tests/Query/Mysql/BitXorTest.php +++ b/tests/Query/Mysql/BitXorTest.php @@ -11,7 +11,7 @@ class BitXorTest extends MysqlTestCase public function testBitCount(): void { $this->assertDqlProducesSql( - "SELECT BIT_XOR(2, 2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT BIT_XOR(2, 2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT 2 ^ 2 AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/CeilTest.php b/tests/Query/Mysql/CeilTest.php index 70acffde..74dd2d76 100644 --- a/tests/Query/Mysql/CeilTest.php +++ b/tests/Query/Mysql/CeilTest.php @@ -11,7 +11,7 @@ class CeilTest extends MysqlTestCase public function testCeil(): void { $this->assertDqlProducesSql( - "SELECT CEIL(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT CEIL(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT CEIL(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/CharLengthTest.php b/tests/Query/Mysql/CharLengthTest.php index c1873558..39acc906 100644 --- a/tests/Query/Mysql/CharLengthTest.php +++ b/tests/Query/Mysql/CharLengthTest.php @@ -11,7 +11,7 @@ class CharLengthTest extends MysqlTestCase public function testCharLength(): void { $this->assertDqlProducesSql( - "SELECT CHAR_LENGTH(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT CHAR_LENGTH(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT CHAR_LENGTH(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/CosTest.php b/tests/Query/Mysql/CosTest.php index f59bd01d..0d02d469 100644 --- a/tests/Query/Mysql/CosTest.php +++ b/tests/Query/Mysql/CosTest.php @@ -11,7 +11,7 @@ class CosTest extends MysqlTestCase public function testCos(): void { $this->assertDqlProducesSql( - "SELECT COS(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT COS(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT COS(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/CotTest.php b/tests/Query/Mysql/CotTest.php index 78c49b37..b4e1eb7b 100644 --- a/tests/Query/Mysql/CotTest.php +++ b/tests/Query/Mysql/CotTest.php @@ -11,7 +11,7 @@ class CotTest extends MysqlTestCase public function testCot(): void { $this->assertDqlProducesSql( - "SELECT COT(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT COT(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT COT(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/CountIfTest.php b/tests/Query/Mysql/CountIfTest.php index f82de7f6..5dbe2379 100644 --- a/tests/Query/Mysql/CountIfTest.php +++ b/tests/Query/Mysql/CountIfTest.php @@ -11,7 +11,7 @@ class CountIfTest extends MysqlTestCase public function testCountIf(): void { $this->assertDqlProducesSql( - "SELECT COUNTIF(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT COUNTIF(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT COUNT(CASE 2 WHEN 3 THEN 1 ELSE NULL END) AS sclr_0 FROM Blank b0_' ); } @@ -19,7 +19,7 @@ public function testCountIf(): void public function testCountIfInverse(): void { $this->assertDqlProducesSql( - "SELECT COUNTIF(2, 3 INVERSE) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT COUNTIF(2, 3 INVERSE) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT COUNT(CASE 2 WHEN 3 THEN NULL ELSE 1 END) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/DateTest.php b/tests/Query/Mysql/DateTest.php index 7e5a848b..1a2984d9 100644 --- a/tests/Query/Mysql/DateTest.php +++ b/tests/Query/Mysql/DateTest.php @@ -13,7 +13,7 @@ class DateTest extends MysqlTestCase { public function testDateDiff(): void { - $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE DATEDIFF(CURRENT_TIME(), p.created) < 7"; + $dql = 'SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE DATEDIFF(CURRENT_TIME(), p.created) < 7'; $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE DATEDIFF(CURRENT_TIME, d0_.created) < 7'; $this->assertDqlProducesSql($dql, $sql); @@ -85,7 +85,7 @@ public function testPeriodDiff(): void public function testStrToDate(): void { - $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE STR_TO_DATE(p.created, :dateFormat) < :currentTime"; + $dql = 'SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE STR_TO_DATE(p.created, :dateFormat) < :currentTime'; $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE STR_TO_DATE(d0_.created, ?) < ?'; $this->assertDqlProducesSql($dql, $sql, [ @@ -96,7 +96,7 @@ public function testStrToDate(): void public function testUnixTimpestamp(): void { - $dql = "SELECT UNIX_TIMESTAMP(p.created) FROM DoctrineExtensions\Tests\Entities\Date p"; + $dql = 'SELECT UNIX_TIMESTAMP(p.created) FROM DoctrineExtensions\Tests\Entities\Date p'; $sql = 'SELECT UNIX_TIMESTAMP(d0_.created) AS sclr_0 FROM Date d0_'; $this->assertDqlProducesSql($dql, $sql); diff --git a/tests/Query/Mysql/DayNameTest.php b/tests/Query/Mysql/DayNameTest.php index c846537f..c9471073 100644 --- a/tests/Query/Mysql/DayNameTest.php +++ b/tests/Query/Mysql/DayNameTest.php @@ -11,7 +11,7 @@ class DayNameTest extends MysqlTestCase public function testDayName(): void { $this->assertDqlProducesSql( - "SELECT DAYNAME(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT DAYNAME(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT DAYNAME(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/DayOfWeekTest.php b/tests/Query/Mysql/DayOfWeekTest.php index 6b5f3090..d3603ff0 100644 --- a/tests/Query/Mysql/DayOfWeekTest.php +++ b/tests/Query/Mysql/DayOfWeekTest.php @@ -11,7 +11,7 @@ class DayOfWeekTest extends MysqlTestCase public function testDayOfWeek(): void { $this->assertDqlProducesSql( - "SELECT DAYOFWEEK(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT DAYOFWEEK(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT DAYOFWEEK(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/DayOfYearTest.php b/tests/Query/Mysql/DayOfYearTest.php index 128c8f98..6321925c 100644 --- a/tests/Query/Mysql/DayOfYearTest.php +++ b/tests/Query/Mysql/DayOfYearTest.php @@ -11,7 +11,7 @@ class DayOfYearTest extends MysqlTestCase public function testDayOfYear(): void { $this->assertDqlProducesSql( - "SELECT DAYOFYEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT DAYOFYEAR(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT DAYOFYEAR(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/DayTest.php b/tests/Query/Mysql/DayTest.php index cf222623..78c52959 100644 --- a/tests/Query/Mysql/DayTest.php +++ b/tests/Query/Mysql/DayTest.php @@ -11,7 +11,7 @@ class DayTest extends MysqlTestCase public function testDay(): void { $this->assertDqlProducesSql( - "SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT DAY(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/DegressTest.php b/tests/Query/Mysql/DegressTest.php index c8debd6f..6ec765bb 100644 --- a/tests/Query/Mysql/DegressTest.php +++ b/tests/Query/Mysql/DegressTest.php @@ -11,7 +11,7 @@ class DegressTest extends MysqlTestCase public function testDegrees(): void { $this->assertDqlProducesSql( - "SELECT DEGREES(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT DEGREES(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT DEGREES(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/DivTest.php b/tests/Query/Mysql/DivTest.php index b1424484..9a90e2da 100644 --- a/tests/Query/Mysql/DivTest.php +++ b/tests/Query/Mysql/DivTest.php @@ -11,7 +11,7 @@ class DivTest extends MysqlTestCase public function testDiv(): void { $this->assertDqlProducesSql( - "SELECT DIV(2, 5) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT DIV(2, 5) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT 2 DIV 5 AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/ExpTest.php b/tests/Query/Mysql/ExpTest.php index e3ed42b4..a14a3069 100644 --- a/tests/Query/Mysql/ExpTest.php +++ b/tests/Query/Mysql/ExpTest.php @@ -11,7 +11,7 @@ class ExpTest extends MysqlTestCase public function testExp(): void { $this->assertDqlProducesSql( - "SELECT EXP(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT EXP(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXP(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/FieldTest.php b/tests/Query/Mysql/FieldTest.php index 66e0d9ef..a9d838f0 100644 --- a/tests/Query/Mysql/FieldTest.php +++ b/tests/Query/Mysql/FieldTest.php @@ -11,7 +11,7 @@ class FieldTest extends MysqlTestCase public function testField(): void { $this->assertDqlProducesSql( - "SELECT FIELD(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT FIELD(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT FIELD(2, 3, 4) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/FindInSetTest.php b/tests/Query/Mysql/FindInSetTest.php index bc35a657..4d888579 100644 --- a/tests/Query/Mysql/FindInSetTest.php +++ b/tests/Query/Mysql/FindInSetTest.php @@ -11,7 +11,7 @@ class FindInSetTest extends MysqlTestCase public function testFindInSet(): void { $this->assertDqlProducesSql( - "SELECT FIND_IN_SET(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT FIND_IN_SET(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT FIND_IN_SET(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/FloorTest.php b/tests/Query/Mysql/FloorTest.php index d3330888..6dbda1e4 100644 --- a/tests/Query/Mysql/FloorTest.php +++ b/tests/Query/Mysql/FloorTest.php @@ -11,7 +11,7 @@ class FloorTest extends MysqlTestCase public function testFloor(): void { $this->assertDqlProducesSql( - "SELECT FLOOR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT FLOOR(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT FLOOR(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/FormatTest.php b/tests/Query/Mysql/FormatTest.php index 92897da3..3d74e816 100644 --- a/tests/Query/Mysql/FormatTest.php +++ b/tests/Query/Mysql/FormatTest.php @@ -11,7 +11,7 @@ class FormatTest extends MysqlTestCase public function testFormat(): void { $this->assertDqlProducesSql( - "SELECT FORMAT(1000.00, 2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT FORMAT(1000.00, 2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT FORMAT(1000.00, 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/FromBase64.php b/tests/Query/Mysql/FromBase64.php index c0b86195..7f803c94 100644 --- a/tests/Query/Mysql/FromBase64.php +++ b/tests/Query/Mysql/FromBase64.php @@ -11,7 +11,7 @@ class FromBase64 extends MysqlTestCase public function testFromBase64(): void { $this->assertDqlProducesSql( - "SELECT FROM_BASE64(title) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT FROM_BASE64(title) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT FROM_BASE64(title) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/FromUnixTimeTest.php b/tests/Query/Mysql/FromUnixTimeTest.php index 89072eb8..0613293f 100644 --- a/tests/Query/Mysql/FromUnixTimeTest.php +++ b/tests/Query/Mysql/FromUnixTimeTest.php @@ -11,7 +11,7 @@ class FromUnixTimeTest extends MysqlTestCase public function testFromUnixTime(): void { $this->assertDqlProducesSql( - "SELECT FROM_UNIXTIME(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT FROM_UNIXTIME(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT FROM_UNIXTIME(2) AS sclr_0 FROM Blank b0_' ); diff --git a/tests/Query/Mysql/GreatestTest.php b/tests/Query/Mysql/GreatestTest.php index 66c5c47e..573c6d22 100644 --- a/tests/Query/Mysql/GreatestTest.php +++ b/tests/Query/Mysql/GreatestTest.php @@ -11,7 +11,7 @@ class GreatestTest extends MysqlTestCase public function testGreatest(): void { $this->assertDqlProducesSql( - "SELECT GREATEST(2, 5, 8) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT GREATEST(2, 5, 8) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT GREATEST(2, 5, 8) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/GroupConcatTest.php b/tests/Query/Mysql/GroupConcatTest.php index 65bdf2c0..ea0123b4 100644 --- a/tests/Query/Mysql/GroupConcatTest.php +++ b/tests/Query/Mysql/GroupConcatTest.php @@ -11,7 +11,7 @@ class GroupConcatTest extends MysqlTestCase public function testGroupConcat(): void { $this->assertDqlProducesSql( - "SELECT GROUP_CONCAT(blank.id) from DoctrineExtensions\Tests\Entities\Blank as blank", + 'SELECT GROUP_CONCAT(blank.id) from DoctrineExtensions\Tests\Entities\Blank as blank', 'SELECT GROUP_CONCAT(b0_.id) AS sclr_0 FROM Blank b0_' ); } @@ -19,7 +19,7 @@ public function testGroupConcat(): void public function testGroupConcatWithDistinct(): void { $this->assertDqlProducesSql( - "SELECT GROUP_CONCAT(DISTINCT blank.id) from DoctrineExtensions\Tests\Entities\Blank as blank", + 'SELECT GROUP_CONCAT(DISTINCT blank.id) from DoctrineExtensions\Tests\Entities\Blank as blank', 'SELECT GROUP_CONCAT(DISTINCT b0_.id) AS sclr_0 FROM Blank b0_' ); } @@ -27,7 +27,7 @@ public function testGroupConcatWithDistinct(): void public function testGroupConcatWithOrderBy(): void { $this->assertDqlProducesSql( - "SELECT GROUP_CONCAT(blank.id ORDER BY blank.id) from DoctrineExtensions\Tests\Entities\Blank as blank", + 'SELECT GROUP_CONCAT(blank.id ORDER BY blank.id) from DoctrineExtensions\Tests\Entities\Blank as blank', 'SELECT GROUP_CONCAT(b0_.id ORDER BY b0_.id ASC) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/HexTest.php b/tests/Query/Mysql/HexTest.php index f12ae835..bdbc57a5 100644 --- a/tests/Query/Mysql/HexTest.php +++ b/tests/Query/Mysql/HexTest.php @@ -11,7 +11,7 @@ class HexTest extends MysqlTestCase public function testHex(): void { $this->assertDqlProducesSql( - "SELECT HEX(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT HEX(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT HEX(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/HourTest.php b/tests/Query/Mysql/HourTest.php index 1e68540d..fc690365 100644 --- a/tests/Query/Mysql/HourTest.php +++ b/tests/Query/Mysql/HourTest.php @@ -11,7 +11,7 @@ class HourTest extends MysqlTestCase public function testHour(): void { $this->assertDqlProducesSql( - "SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT HOUR(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/IfElseTest.php b/tests/Query/Mysql/IfElseTest.php index 7c328160..abe9d1f1 100644 --- a/tests/Query/Mysql/IfElseTest.php +++ b/tests/Query/Mysql/IfElseTest.php @@ -11,7 +11,7 @@ class IfElseTest extends MysqlTestCase public function testIfElseWithoutNullValue(): void { $this->assertDqlProducesSql( - "SELECT IFELSE(2 < 3, 4, 5) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT IFELSE(2 < 3, 4, 5) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT IF(2 < 3, 4, 5) AS sclr_0 FROM Blank b0_' ); } @@ -19,7 +19,7 @@ public function testIfElseWithoutNullValue(): void public function testIfElseWithNullValue(): void { $this->assertDqlProducesSql( - "SELECT IFELSE(2 < 3, NULL, 5) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT IFELSE(2 < 3, NULL, 5) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT IF(2 < 3, NULL, 5) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/IfNullTest.php b/tests/Query/Mysql/IfNullTest.php index 0faa01a2..6c77e447 100644 --- a/tests/Query/Mysql/IfNullTest.php +++ b/tests/Query/Mysql/IfNullTest.php @@ -11,7 +11,7 @@ class IfNullTest extends MysqlTestCase public function testIfNull(): void { $this->assertDqlProducesSql( - "SELECT IFNULL(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT IFNULL(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT IFNULL(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/JsonDepthTest.php b/tests/Query/Mysql/JsonDepthTest.php index 9f129a68..6ab025f1 100644 --- a/tests/Query/Mysql/JsonDepthTest.php +++ b/tests/Query/Mysql/JsonDepthTest.php @@ -19,7 +19,7 @@ public function testJsonDepthWithTargetExplicit(): void public function testJsonDepthWithTargetParam(): void { $this->assertDqlProducesSql( - "SELECT JSON_DEPTH(:param) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT JSON_DEPTH(:param) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT JSON_DEPTH(?) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/LastDayTest.php b/tests/Query/Mysql/LastDayTest.php index c97dc04d..16ac60fe 100644 --- a/tests/Query/Mysql/LastDayTest.php +++ b/tests/Query/Mysql/LastDayTest.php @@ -11,7 +11,7 @@ class LastDayTest extends MysqlTestCase public function testLastDay(): void { $this->assertDqlProducesSql( - "SELECT LAST_DAY(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT LAST_DAY(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT LAST_DAY(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/LeastTest.php b/tests/Query/Mysql/LeastTest.php index a331e798..4f448f40 100644 --- a/tests/Query/Mysql/LeastTest.php +++ b/tests/Query/Mysql/LeastTest.php @@ -11,7 +11,7 @@ class LeastTest extends MysqlTestCase public function testLeast(): void { $this->assertDqlProducesSql( - "SELECT LEAST(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT LEAST(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT LEAST(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/Log10Test.php b/tests/Query/Mysql/Log10Test.php index 94c1ee25..f9f2d4af 100644 --- a/tests/Query/Mysql/Log10Test.php +++ b/tests/Query/Mysql/Log10Test.php @@ -11,7 +11,7 @@ class Log10Test extends MysqlTestCase public function testLog10(): void { $this->assertDqlProducesSql( - "SELECT LOG10(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT LOG10(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT LOG10(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/Log2Test.php b/tests/Query/Mysql/Log2Test.php index 8351fdca..3f67a49d 100644 --- a/tests/Query/Mysql/Log2Test.php +++ b/tests/Query/Mysql/Log2Test.php @@ -11,7 +11,7 @@ class Log2Test extends MysqlTestCase public function testLog2(): void { $this->assertDqlProducesSql( - "SELECT LOG2(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT LOG2(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT LOG2(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/LogTest.php b/tests/Query/Mysql/LogTest.php index df342548..c0571881 100644 --- a/tests/Query/Mysql/LogTest.php +++ b/tests/Query/Mysql/LogTest.php @@ -11,7 +11,7 @@ class LogTest extends MysqlTestCase public function testLog(): void { $this->assertDqlProducesSql( - "SELECT LOG(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT LOG(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT LOG(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/LpadTest.php b/tests/Query/Mysql/LpadTest.php index 2c4d066a..bfbc3866 100644 --- a/tests/Query/Mysql/LpadTest.php +++ b/tests/Query/Mysql/LpadTest.php @@ -11,7 +11,7 @@ class LpadTest extends MysqlTestCase public function testLpad(): void { $this->assertDqlProducesSql( - "SELECT LPAD(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT LPAD(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT LPAD(2, 3, 4) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/MakeDateTest.php b/tests/Query/Mysql/MakeDateTest.php index 3941ab3c..dd31f1cc 100644 --- a/tests/Query/Mysql/MakeDateTest.php +++ b/tests/Query/Mysql/MakeDateTest.php @@ -11,7 +11,7 @@ class MakeDateTest extends MysqlTestCase public function testMakeDate(): void { $this->assertDqlProducesSql( - "SELECT MAKEDATE(2019, 5) FROM DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT MAKEDATE(2019, 5) FROM DoctrineExtensions\Tests\Entities\Blank b', 'SELECT MAKEDATE(2019, 5) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/MinuteTest.php b/tests/Query/Mysql/MinuteTest.php index 83404caf..6bac24a0 100644 --- a/tests/Query/Mysql/MinuteTest.php +++ b/tests/Query/Mysql/MinuteTest.php @@ -11,7 +11,7 @@ class MinuteTest extends MysqlTestCase public function testMinute(): void { $this->assertDqlProducesSql( - "SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT MINUTE(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/MonthNameTest.php b/tests/Query/Mysql/MonthNameTest.php index a4201551..6be48f78 100644 --- a/tests/Query/Mysql/MonthNameTest.php +++ b/tests/Query/Mysql/MonthNameTest.php @@ -11,7 +11,7 @@ class MonthNameTest extends MysqlTestCase public function testMonthName(): void { $this->assertDqlProducesSql( - "SELECT MONTHNAME(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT MONTHNAME(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT MONTHNAME(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/MonthTest.php b/tests/Query/Mysql/MonthTest.php index 42f90f72..fb3125a3 100644 --- a/tests/Query/Mysql/MonthTest.php +++ b/tests/Query/Mysql/MonthTest.php @@ -11,7 +11,7 @@ class MonthTest extends MysqlTestCase public function testMonth(): void { $this->assertDqlProducesSql( - "SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT MONTH(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/NowTest.php b/tests/Query/Mysql/NowTest.php index 2a04bb53..b6053866 100644 --- a/tests/Query/Mysql/NowTest.php +++ b/tests/Query/Mysql/NowTest.php @@ -11,7 +11,7 @@ class NowTest extends MysqlTestCase public function testNow(): void { $this->assertDqlProducesSql( - "SELECT NOW() from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT NOW() from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT NOW() AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/NullIfTest.php b/tests/Query/Mysql/NullIfTest.php index 52bd1408..aead0e28 100644 --- a/tests/Query/Mysql/NullIfTest.php +++ b/tests/Query/Mysql/NullIfTest.php @@ -11,7 +11,7 @@ class NullIfTest extends MysqlTestCase public function testNullIf(): void { $this->assertDqlProducesSql( - "SELECT NULLIF(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT NULLIF(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT NULLIF(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/PiTest.php b/tests/Query/Mysql/PiTest.php index a894bcb8..bf3ad3e6 100644 --- a/tests/Query/Mysql/PiTest.php +++ b/tests/Query/Mysql/PiTest.php @@ -11,7 +11,7 @@ class PiTest extends MysqlTestCase public function testPi(): void { $this->assertDqlProducesSql( - "SELECT PI() from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT PI() from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT PI() AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/PowerTest.php b/tests/Query/Mysql/PowerTest.php index afa38a72..55726942 100644 --- a/tests/Query/Mysql/PowerTest.php +++ b/tests/Query/Mysql/PowerTest.php @@ -11,7 +11,7 @@ class PowerTest extends MysqlTestCase public function testPower(): void { $this->assertDqlProducesSql( - "SELECT POWER(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT POWER(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT POWER(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/QuarterTest.php b/tests/Query/Mysql/QuarterTest.php index b4bf4a3a..c9b367c8 100644 --- a/tests/Query/Mysql/QuarterTest.php +++ b/tests/Query/Mysql/QuarterTest.php @@ -11,7 +11,7 @@ class QuarterTest extends MysqlTestCase public function testQuarter(): void { $this->assertDqlProducesSql( - "SELECT QUARTER(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT QUARTER(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT QUARTER(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/RadiansTest.php b/tests/Query/Mysql/RadiansTest.php index eed7535c..304989df 100644 --- a/tests/Query/Mysql/RadiansTest.php +++ b/tests/Query/Mysql/RadiansTest.php @@ -11,7 +11,7 @@ class RadiansTest extends MysqlTestCase public function testRadians(): void { $this->assertDqlProducesSql( - "SELECT RADIANS(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT RADIANS(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT RADIANS(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/RandTest.php b/tests/Query/Mysql/RandTest.php index 5491604a..f79a328d 100644 --- a/tests/Query/Mysql/RandTest.php +++ b/tests/Query/Mysql/RandTest.php @@ -11,7 +11,7 @@ class RandTest extends MysqlTestCase public function testRandWithParameter(): void { $this->assertDqlProducesSql( - "SELECT RAND(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT RAND(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT RAND(2) AS sclr_0 FROM Blank b0_' ); } @@ -19,7 +19,7 @@ public function testRandWithParameter(): void public function testRandWithoutParameter(): void { $this->assertDqlProducesSql( - "SELECT RAND() from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT RAND() from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT RAND() AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/ReplaceTest.php b/tests/Query/Mysql/ReplaceTest.php index e89f0956..fc280db6 100644 --- a/tests/Query/Mysql/ReplaceTest.php +++ b/tests/Query/Mysql/ReplaceTest.php @@ -11,7 +11,7 @@ class ReplaceTest extends MysqlTestCase public function testReplace(): void { $this->assertDqlProducesSql( - "SELECT REPLACE(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT REPLACE(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT REPLACE(2, 3, 4) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/RoundTest.php b/tests/Query/Mysql/RoundTest.php index 6d009250..a48c56a5 100644 --- a/tests/Query/Mysql/RoundTest.php +++ b/tests/Query/Mysql/RoundTest.php @@ -11,7 +11,7 @@ class RoundTest extends MysqlTestCase public function testRoundOneArgument(): void { $this->assertDqlProducesSql( - "SELECT ROUND(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT ROUND(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT ROUND(2) AS sclr_0 FROM Blank b0_' ); } @@ -19,7 +19,7 @@ public function testRoundOneArgument(): void public function testRoundTwoArguments(): void { $this->assertDqlProducesSql( - "SELECT ROUND(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT ROUND(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT ROUND(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/RpadTest.php b/tests/Query/Mysql/RpadTest.php index ce5aa706..59838893 100644 --- a/tests/Query/Mysql/RpadTest.php +++ b/tests/Query/Mysql/RpadTest.php @@ -11,7 +11,7 @@ class RpadTest extends MysqlTestCase public function testRpad(): void { $this->assertDqlProducesSql( - "SELECT RPAD(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT RPAD(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT RPAD(2, 3, 4) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/SecondTest.php b/tests/Query/Mysql/SecondTest.php index 7bffa512..ad22f61d 100644 --- a/tests/Query/Mysql/SecondTest.php +++ b/tests/Query/Mysql/SecondTest.php @@ -11,7 +11,7 @@ class SecondTest extends MysqlTestCase public function testSecond(): void { $this->assertDqlProducesSql( - "SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT SECOND(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/SetTest.php b/tests/Query/Mysql/SetTest.php index b8bc5cac..7952a400 100644 --- a/tests/Query/Mysql/SetTest.php +++ b/tests/Query/Mysql/SetTest.php @@ -10,7 +10,7 @@ class SetTest extends MysqlTestCase { public function testFindInSet(): void { - $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Set p WHERE FIND_IN_SET(p.id, p.set) != 0"; + $dql = 'SELECT p FROM DoctrineExtensions\Tests\Entities\Set p WHERE FIND_IN_SET(p.id, p.set) != 0'; $this->assertDqlProducesSql( $dql, 'SELECT s0_.id AS id_0, s0_.set AS set_1 FROM Set s0_ WHERE FIND_IN_SET(s0_.id, s0_.set) <> 0' diff --git a/tests/Query/Mysql/SinTest.php b/tests/Query/Mysql/SinTest.php index 937e9cb9..1d3b6cb9 100644 --- a/tests/Query/Mysql/SinTest.php +++ b/tests/Query/Mysql/SinTest.php @@ -11,7 +11,7 @@ class SinTest extends MysqlTestCase public function testSin(): void { $this->assertDqlProducesSql( - "SELECT SIN(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT SIN(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT SIN(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/StdDevTest.php b/tests/Query/Mysql/StdDevTest.php index 27e276f6..fb48f9ad 100644 --- a/tests/Query/Mysql/StdDevTest.php +++ b/tests/Query/Mysql/StdDevTest.php @@ -11,7 +11,7 @@ class StdDevTest extends MysqlTestCase public function testStdDev(): void { $this->assertDqlProducesSql( - "SELECT STDDEV(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT STDDEV(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT STDDEV(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/StdTest.php b/tests/Query/Mysql/StdTest.php index 550780bc..59caca55 100644 --- a/tests/Query/Mysql/StdTest.php +++ b/tests/Query/Mysql/StdTest.php @@ -11,7 +11,7 @@ class StdTest extends MysqlTestCase public function testStd(): void { $this->assertDqlProducesSql( - "SELECT STD(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT STD(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT STD(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/StrToDateTest.php b/tests/Query/Mysql/StrToDateTest.php index f2399acb..54c97360 100644 --- a/tests/Query/Mysql/StrToDateTest.php +++ b/tests/Query/Mysql/StrToDateTest.php @@ -11,7 +11,7 @@ class StrToDateTest extends MysqlTestCase public function testStrToDate(): void { $this->assertDqlProducesSql( - "SELECT STR_TO_DATE(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT STR_TO_DATE(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT STR_TO_DATE(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/StringTest.php b/tests/Query/Mysql/StringTest.php index 41b991e3..1d3a8086 100644 --- a/tests/Query/Mysql/StringTest.php +++ b/tests/Query/Mysql/StringTest.php @@ -96,17 +96,17 @@ public function testSubstring(): void ); $this->assertDqlProducesSql( - "SELECT SUBSTRING(b.id, 5, 5) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT SUBSTRING(b.id, 5, 5) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT SUBSTR(b0_.id, 5, 5) AS sclr_0 FROM Blank b0_' ); $this->assertDqlProducesSql( - "SELECT SUBSTRING(b.id, 5) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT SUBSTRING(b.id, 5) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT SUBSTR(b0_.id, 5, LENGTH(b0_.id)) AS sclr_0 FROM Blank b0_' ); $this->assertDqlProducesSql( - "SELECT SUBSTRING(b.id, -5, 2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT SUBSTRING(b.id, -5, 2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT SUBSTR(b0_.id, -5, 2) AS sclr_0 FROM Blank b0_' ); } @@ -159,7 +159,7 @@ public function testLeast(): void public function testGreatest(): void { $this->assertDqlProducesSql( - "SELECT GREATEST(10,1,4,0.4,0.003) AS great FROM DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT GREATEST(10,1,4,0.4,0.003) AS great FROM DoctrineExtensions\Tests\Entities\Blank b', 'SELECT GREATEST(10, 1, 4, 0.4, 0.003) AS sclr_0 FROM Blank b0_' ); @@ -168,7 +168,7 @@ public function testGreatest(): void "SELECT GREATEST('M', 'N', 'o', 'c', 'C') AS sclr_0 FROM Blank b0_" ); $this->assertDqlProducesSql( - "SELECT GREATEST(b.id, 15) AS great FROM DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT GREATEST(b.id, 15) AS great FROM DoctrineExtensions\Tests\Entities\Blank b', 'SELECT GREATEST(b0_.id, 15) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/SubstringIndexTest.php b/tests/Query/Mysql/SubstringIndexTest.php index 400bc8e6..26b39f86 100644 --- a/tests/Query/Mysql/SubstringIndexTest.php +++ b/tests/Query/Mysql/SubstringIndexTest.php @@ -11,7 +11,7 @@ class SubstringIndexTest extends MysqlTestCase public function testSubstringIndex(): void { $this->assertDqlProducesSql( - "SELECT SUBSTRING_INDEX(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT SUBSTRING_INDEX(2, 3, 4) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT SUBSTRING_INDEX(2, 3, 4) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/TanTest.php b/tests/Query/Mysql/TanTest.php index 33024ddc..fe998940 100644 --- a/tests/Query/Mysql/TanTest.php +++ b/tests/Query/Mysql/TanTest.php @@ -11,7 +11,7 @@ class TanTest extends MysqlTestCase public function testTan(): void { $this->assertDqlProducesSql( - "SELECT TAN(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT TAN(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT TAN(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/TimeDiffTest.php b/tests/Query/Mysql/TimeDiffTest.php index bc6f866c..1a7ec3f5 100644 --- a/tests/Query/Mysql/TimeDiffTest.php +++ b/tests/Query/Mysql/TimeDiffTest.php @@ -11,7 +11,7 @@ class TimeDiffTest extends MysqlTestCase public function testTimeDiff(): void { $this->assertDqlProducesSql( - "SELECT TIMEDIFF(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT TIMEDIFF(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT TIMEDIFF(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/TimeTest.php b/tests/Query/Mysql/TimeTest.php index 063f67d1..e7480525 100644 --- a/tests/Query/Mysql/TimeTest.php +++ b/tests/Query/Mysql/TimeTest.php @@ -11,7 +11,7 @@ class TimeTest extends MysqlTestCase public function testTime(): void { $this->assertDqlProducesSql( - "SELECT TIME(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT TIME(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT TIME(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/TimeToSecTest.php b/tests/Query/Mysql/TimeToSecTest.php index f14cc5e0..5cf74811 100644 --- a/tests/Query/Mysql/TimeToSecTest.php +++ b/tests/Query/Mysql/TimeToSecTest.php @@ -11,7 +11,7 @@ class TimeToSecTest extends MysqlTestCase public function testTimeToSec(): void { $this->assertDqlProducesSql( - "SELECT TIMETOSEC(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT TIMETOSEC(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT TIME_TO_SEC(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/TruncateTest.php b/tests/Query/Mysql/TruncateTest.php index 52466e16..4ead215a 100644 --- a/tests/Query/Mysql/TruncateTest.php +++ b/tests/Query/Mysql/TruncateTest.php @@ -11,7 +11,7 @@ class TruncateTest extends MysqlTestCase public function testFormat(): void { $this->assertDqlProducesSql( - "SELECT TRUNCATE(1000.00, 2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT TRUNCATE(1000.00, 2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT TRUNCATE(1000.00, 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/UnhexTest.php b/tests/Query/Mysql/UnhexTest.php index 73f561b3..6dbcd3a3 100644 --- a/tests/Query/Mysql/UnhexTest.php +++ b/tests/Query/Mysql/UnhexTest.php @@ -11,7 +11,7 @@ class UnhexTest extends MysqlTestCase public function testUnhex(): void { $this->assertDqlProducesSql( - "SELECT UNHEX(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT UNHEX(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT UNHEX(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/UnixTimestampTest.php b/tests/Query/Mysql/UnixTimestampTest.php index c569029c..410d2c53 100644 --- a/tests/Query/Mysql/UnixTimestampTest.php +++ b/tests/Query/Mysql/UnixTimestampTest.php @@ -11,7 +11,7 @@ class UnixTimestampTest extends MysqlTestCase public function testUnixTimeStampNoArguments(): void { $this->assertDqlProducesSql( - "SELECT UNIX_TIMESTAMP() from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT UNIX_TIMESTAMP() from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT UNIX_TIMESTAMP() AS sclr_0 FROM Blank b0_' ); } @@ -19,7 +19,7 @@ public function testUnixTimeStampNoArguments(): void public function testUnixTimeStampOneArgument(): void { $this->assertDqlProducesSql( - "SELECT UNIX_TIMESTAMP(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT UNIX_TIMESTAMP(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT UNIX_TIMESTAMP(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/UtcTimestampTest.php b/tests/Query/Mysql/UtcTimestampTest.php index 6e221d30..61e6517a 100644 --- a/tests/Query/Mysql/UtcTimestampTest.php +++ b/tests/Query/Mysql/UtcTimestampTest.php @@ -10,7 +10,7 @@ class UtcTimestampTest extends MysqlTestCase { public function testUtcTimestamp(): void { - $dql = "SELECT d FROM DoctrineExtensions\Tests\Entities\Date d WHERE d.created > utc_timestamp()"; + $dql = 'SELECT d FROM DoctrineExtensions\Tests\Entities\Date d WHERE d.created > utc_timestamp()'; $this->assertDqlProducesSql( $dql, 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE d0_.created > UTC_TIMESTAMP()' diff --git a/tests/Query/Mysql/UuidShortTest.php b/tests/Query/Mysql/UuidShortTest.php index 04e0946f..4678dd43 100644 --- a/tests/Query/Mysql/UuidShortTest.php +++ b/tests/Query/Mysql/UuidShortTest.php @@ -11,7 +11,7 @@ class UuidShortTest extends MysqlTestCase public function testUuidShort(): void { $this->assertDqlProducesSql( - "SELECT UUID_SHORT() from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT UUID_SHORT() from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT UUID_SHORT() AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/VarianceTest.php b/tests/Query/Mysql/VarianceTest.php index 15d85d1c..6f65a4ee 100644 --- a/tests/Query/Mysql/VarianceTest.php +++ b/tests/Query/Mysql/VarianceTest.php @@ -11,7 +11,7 @@ class VarianceTest extends MysqlTestCase public function testVariance(): void { $this->assertDqlProducesSql( - "SELECT VARIANCE(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT VARIANCE(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT VARIANCE(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/WeekDayTest.php b/tests/Query/Mysql/WeekDayTest.php index d439ff78..9c915c15 100644 --- a/tests/Query/Mysql/WeekDayTest.php +++ b/tests/Query/Mysql/WeekDayTest.php @@ -11,7 +11,7 @@ class WeekDayTest extends MysqlTestCase public function testWeekDay(): void { $this->assertDqlProducesSql( - "SELECT WEEKDAY(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT WEEKDAY(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT WEEKDAY(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/WeekOfYearTest.php b/tests/Query/Mysql/WeekOfYearTest.php index 70204d75..c67246ec 100644 --- a/tests/Query/Mysql/WeekOfYearTest.php +++ b/tests/Query/Mysql/WeekOfYearTest.php @@ -11,7 +11,7 @@ class WeekOfYearTest extends MysqlTestCase public function testWeekOfYear(): void { $this->assertDqlProducesSql( - "SELECT WEEKOFYEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT WEEKOFYEAR(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT WEEKOFYEAR(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/WeekTest.php b/tests/Query/Mysql/WeekTest.php index 65a69937..7fe862a8 100644 --- a/tests/Query/Mysql/WeekTest.php +++ b/tests/Query/Mysql/WeekTest.php @@ -11,7 +11,7 @@ class WeekTest extends MysqlTestCase public function testWeek(): void { $this->assertDqlProducesSql( - "SELECT WEEK(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT WEEK(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT WEEK(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/YearTest.php b/tests/Query/Mysql/YearTest.php index 81a56772..cd072c9b 100644 --- a/tests/Query/Mysql/YearTest.php +++ b/tests/Query/Mysql/YearTest.php @@ -11,7 +11,7 @@ class YearTest extends MysqlTestCase public function testYear(): void { $this->assertDqlProducesSql( - "SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT YEAR(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Mysql/YearWeekTest.php b/tests/Query/Mysql/YearWeekTest.php index 54afd9e8..491d62aa 100644 --- a/tests/Query/Mysql/YearWeekTest.php +++ b/tests/Query/Mysql/YearWeekTest.php @@ -11,7 +11,7 @@ class YearWeekTest extends MysqlTestCase public function testYearWeek(): void { $this->assertDqlProducesSql( - "SELECT YEARWEEK(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT YEARWEEK(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT YEARWEEK(2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/MysqlWalkerTest.php b/tests/Query/MysqlWalkerTest.php index db318e0c..fbecf233 100644 --- a/tests/Query/MysqlWalkerTest.php +++ b/tests/Query/MysqlWalkerTest.php @@ -10,7 +10,7 @@ class MysqlWalkerTest extends MysqlTestCase { public function testSelectSQLCalcFoundRows(): void { - $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p"; + $dql = 'SELECT p FROM DoctrineExtensions\Tests\Entities\Date p'; $q = $this->entityManager->createQuery($dql); $q->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'DoctrineExtensions\Query\MysqlWalker'); $q->setHint('mysqlWalker.sqlCalcFoundRows', true); @@ -21,7 +21,7 @@ public function testSelectSQLCalcFoundRows(): void public function testSelectSQLNoCache(): void { - $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p"; + $dql = 'SELECT p FROM DoctrineExtensions\Tests\Entities\Date p'; $q = $this->entityManager->createQuery($dql); $q->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'DoctrineExtensions\Query\MysqlWalker'); $q->setHint('mysqlWalker.sqlNoCache', true); @@ -32,7 +32,7 @@ public function testSelectSQLNoCache(): void public function testGroupByWithRollup(): void { - $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p GROUP BY p.id"; + $dql = 'SELECT p FROM DoctrineExtensions\Tests\Entities\Date p GROUP BY p.id'; $q = $this->entityManager->createQuery($dql); $q->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'DoctrineExtensions\Query\MysqlWalker'); $q->setHint('mysqlWalker.withRollup', true); diff --git a/tests/Query/Oracle/DayTest.php b/tests/Query/Oracle/DayTest.php index ece23b51..65f5af31 100644 --- a/tests/Query/Oracle/DayTest.php +++ b/tests/Query/Oracle/DayTest.php @@ -11,7 +11,7 @@ class DayTest extends OracleTestCase public function testDay(): void { $this->assertDqlProducesSql( - "SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXTRACT(DAY FROM 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Oracle/HourTest.php b/tests/Query/Oracle/HourTest.php index 6f2ed372..52a2911c 100644 --- a/tests/Query/Oracle/HourTest.php +++ b/tests/Query/Oracle/HourTest.php @@ -11,7 +11,7 @@ class HourTest extends OracleTestCase public function testHour(): void { $this->assertDqlProducesSql( - "SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXTRACT(HOUR FROM 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Oracle/MinuteTest.php b/tests/Query/Oracle/MinuteTest.php index 5d2f9fc1..3f5fb352 100644 --- a/tests/Query/Oracle/MinuteTest.php +++ b/tests/Query/Oracle/MinuteTest.php @@ -11,7 +11,7 @@ class MinuteTest extends OracleTestCase public function testMinute(): void { $this->assertDqlProducesSql( - "SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXTRACT(MINUTE FROM 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Oracle/MonthTest.php b/tests/Query/Oracle/MonthTest.php index 2cff3d22..604dfbaf 100644 --- a/tests/Query/Oracle/MonthTest.php +++ b/tests/Query/Oracle/MonthTest.php @@ -11,7 +11,7 @@ class MonthTest extends OracleTestCase public function testMonth(): void { $this->assertDqlProducesSql( - "SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXTRACT(MONTH FROM 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Oracle/SecondTest.php b/tests/Query/Oracle/SecondTest.php index c018120c..63ee8f84 100644 --- a/tests/Query/Oracle/SecondTest.php +++ b/tests/Query/Oracle/SecondTest.php @@ -11,7 +11,7 @@ class SecondTest extends OracleTestCase public function testSecond(): void { $this->assertDqlProducesSql( - "SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT FLOOR(EXTRACT(SECOND FROM 2)) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Oracle/YearTest.php b/tests/Query/Oracle/YearTest.php index 726db14e..69297012 100644 --- a/tests/Query/Oracle/YearTest.php +++ b/tests/Query/Oracle/YearTest.php @@ -11,7 +11,7 @@ class YearTest extends OracleTestCase public function testYear(): void { $this->assertDqlProducesSql( - "SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXTRACT(YEAR FROM 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Postgresql/AtTimeZoneTest.php b/tests/Query/Postgresql/AtTimeZoneTest.php index b078b18c..f080ac06 100644 --- a/tests/Query/Postgresql/AtTimeZoneTest.php +++ b/tests/Query/Postgresql/AtTimeZoneTest.php @@ -12,7 +12,7 @@ class AtTimeZoneTest extends PostgresqlTestCase { public function testAtTimeZone(): void { - $dql = "SELECT d FROM DoctrineExtensions\Tests\Entities\Date d WHERE AT_TIME_ZONE(d.created, :timeZone) < :currentTime"; + $dql = 'SELECT d FROM DoctrineExtensions\Tests\Entities\Date d WHERE AT_TIME_ZONE(d.created, :timeZone) < :currentTime'; $q = $this->entityManager->createQuery($dql); $q->setParameter('timeZone', 'UTC'); $q->setParameter('currentTime', date('Y-m-d H:i:s')); diff --git a/tests/Query/Postgresql/CountFilterTest.php b/tests/Query/Postgresql/CountFilterTest.php index 2db4d8e4..c880a96f 100644 --- a/tests/Query/Postgresql/CountFilterTest.php +++ b/tests/Query/Postgresql/CountFilterTest.php @@ -10,7 +10,7 @@ class CountFilterTest extends PostgresqlTestCase { public function testCountFilter(): void { - $dql = "SELECT COUNT_FILTER(b, WHERE b.id = :id) FROM DoctrineExtensions\Tests\Entities\Blank b"; + $dql = 'SELECT COUNT_FILTER(b, WHERE b.id = :id) FROM DoctrineExtensions\Tests\Entities\Blank b'; $q = $this->entityManager->createQuery($dql); $q->setParameter('id', 1); $sql = 'SELECT COUNT(b0_.id) FILTER( WHERE b0_.id = ?) AS sclr_0 FROM Blank b0_'; diff --git a/tests/Query/Postgresql/DateTest.php b/tests/Query/Postgresql/DateTest.php index 909253c2..7d3a4440 100644 --- a/tests/Query/Postgresql/DateTest.php +++ b/tests/Query/Postgresql/DateTest.php @@ -12,7 +12,7 @@ class DateTest extends PostgresqlTestCase { public function testStrToDate(): void { - $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE STR_TO_DATE(p.created, :dateFormat) < :currentTime"; + $dql = 'SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE STR_TO_DATE(p.created, :dateFormat) < :currentTime'; $q = $this->entityManager->createQuery($dql); $q->setParameter('dateFormat', '%Y-%m-%d %h:%i %p'); $q->setParameter('currentTime', date('Y-m-d H:i:s')); @@ -23,7 +23,7 @@ public function testStrToDate(): void public function testDateFunction(): void { - $dql = "SELECT DATE(p.created) FROM DoctrineExtensions\Tests\Entities\Date p"; + $dql = 'SELECT DATE(p.created) FROM DoctrineExtensions\Tests\Entities\Date p'; $sql = 'SELECT DATE(d0_.created) AS sclr_0 FROM Date d0_'; $this->assertDqlProducesSql($dql, $sql); diff --git a/tests/Query/Postgresql/DayTest.php b/tests/Query/Postgresql/DayTest.php index 72dd54c3..9297cec2 100644 --- a/tests/Query/Postgresql/DayTest.php +++ b/tests/Query/Postgresql/DayTest.php @@ -11,7 +11,7 @@ class DayTest extends PostgresqlTestCase public function testDay(): void { $this->assertDqlProducesSql( - "SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXTRACT(DAY FROM 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Postgresql/GreatestTest.php b/tests/Query/Postgresql/GreatestTest.php index f830e091..7e93fec2 100644 --- a/tests/Query/Postgresql/GreatestTest.php +++ b/tests/Query/Postgresql/GreatestTest.php @@ -11,7 +11,7 @@ class GreatestTest extends PostgresqlTestCase public function testGreatest(): void { $this->assertDqlProducesSql( - "SELECT GREATEST(2, 5, 8) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT GREATEST(2, 5, 8) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT GREATEST(2, 5, 8) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Postgresql/HourTest.php b/tests/Query/Postgresql/HourTest.php index c2a5bdb2..f4c981c2 100644 --- a/tests/Query/Postgresql/HourTest.php +++ b/tests/Query/Postgresql/HourTest.php @@ -11,7 +11,7 @@ class HourTest extends PostgresqlTestCase public function testHour(): void { $this->assertDqlProducesSql( - "SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXTRACT(HOUR FROM 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Postgresql/LeastTest.php b/tests/Query/Postgresql/LeastTest.php index a231d211..44da0180 100644 --- a/tests/Query/Postgresql/LeastTest.php +++ b/tests/Query/Postgresql/LeastTest.php @@ -11,7 +11,7 @@ class LeastTest extends PostgresqlTestCase public function testLeast(): void { $this->assertDqlProducesSql( - "SELECT LEAST(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT LEAST(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT LEAST(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Postgresql/MinuteTest.php b/tests/Query/Postgresql/MinuteTest.php index 682ad1ee..51d993ce 100644 --- a/tests/Query/Postgresql/MinuteTest.php +++ b/tests/Query/Postgresql/MinuteTest.php @@ -11,7 +11,7 @@ class MinuteTest extends PostgresqlTestCase public function testMinute(): void { $this->assertDqlProducesSql( - "SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXTRACT(MINUTE FROM 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Postgresql/MonthTest.php b/tests/Query/Postgresql/MonthTest.php index 2b084173..013c1082 100644 --- a/tests/Query/Postgresql/MonthTest.php +++ b/tests/Query/Postgresql/MonthTest.php @@ -11,7 +11,7 @@ class MonthTest extends PostgresqlTestCase public function testMonth(): void { $this->assertDqlProducesSql( - "SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXTRACT(MONTH FROM 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Postgresql/SecondTest.php b/tests/Query/Postgresql/SecondTest.php index cdac4433..b07b71f6 100644 --- a/tests/Query/Postgresql/SecondTest.php +++ b/tests/Query/Postgresql/SecondTest.php @@ -11,7 +11,7 @@ class SecondTest extends PostgresqlTestCase public function testSecond(): void { $this->assertDqlProducesSql( - "SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT FLOOR(EXTRACT(SECOND FROM 2)) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Postgresql/StringTest.php b/tests/Query/Postgresql/StringTest.php index 926a19a6..bb1bc3d0 100644 --- a/tests/Query/Postgresql/StringTest.php +++ b/tests/Query/Postgresql/StringTest.php @@ -10,7 +10,7 @@ class StringTest extends PostgresqlTestCase { public function testFormatDate(): void { - $dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE DATE_FORMAT(p.created, :dateFormat) < :currentTime"; + $dql = 'SELECT p FROM DoctrineExtensions\Tests\Entities\Date p WHERE DATE_FORMAT(p.created, :dateFormat) < :currentTime'; $q = $this->entityManager->createQuery($dql); $q->setParameter('dateFormat', '%Y-%m-%d %h:%i %p'); $q->setParameter('currentTime', 'YYYY-MM-DD'); diff --git a/tests/Query/Postgresql/YearTest.php b/tests/Query/Postgresql/YearTest.php index 2f1e2c35..c287ccb6 100644 --- a/tests/Query/Postgresql/YearTest.php +++ b/tests/Query/Postgresql/YearTest.php @@ -11,7 +11,7 @@ class YearTest extends PostgresqlTestCase public function testYear(): void { $this->assertDqlProducesSql( - "SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT EXTRACT(YEAR FROM 2) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Sqlite/DayTest.php b/tests/Query/Sqlite/DayTest.php index 77fef8a3..1d42ffd1 100644 --- a/tests/Query/Sqlite/DayTest.php +++ b/tests/Query/Sqlite/DayTest.php @@ -11,7 +11,7 @@ class DayTest extends SqliteTestCase public function testDay(): void { $this->assertDqlProducesSql( - "SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT DAY(2) from DoctrineExtensions\Tests\Entities\Blank b', "SELECT CAST(STRFTIME('%d', 2) AS NUMBER) AS sclr_0 FROM Blank b0_" ); } diff --git a/tests/Query/Sqlite/GreatestTest.php b/tests/Query/Sqlite/GreatestTest.php index abcaa621..e567c9c8 100644 --- a/tests/Query/Sqlite/GreatestTest.php +++ b/tests/Query/Sqlite/GreatestTest.php @@ -11,7 +11,7 @@ class GreatestTest extends SqliteTestCase public function testGreatest(): void { $this->assertDqlProducesSql( - "SELECT Greatest(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT Greatest(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT MAX(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Sqlite/HourTest.php b/tests/Query/Sqlite/HourTest.php index 8a127539..3152b8f9 100644 --- a/tests/Query/Sqlite/HourTest.php +++ b/tests/Query/Sqlite/HourTest.php @@ -11,7 +11,7 @@ class HourTest extends SqliteTestCase public function testHour(): void { $this->assertDqlProducesSql( - "SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT HOUR(2) from DoctrineExtensions\Tests\Entities\Blank b', "SELECT CAST(STRFTIME('%H', 2) AS NUMBER) AS sclr_0 FROM Blank b0_" ); } diff --git a/tests/Query/Sqlite/JulianDayTest.php b/tests/Query/Sqlite/JulianDayTest.php index f253ba4b..feb2ca6d 100644 --- a/tests/Query/Sqlite/JulianDayTest.php +++ b/tests/Query/Sqlite/JulianDayTest.php @@ -11,7 +11,7 @@ class JulianDayTest extends SqliteTestCase public function testWithOneArgument(): void { $this->assertDqlProducesSql( - "SELECT JULIANDAY(:date) FROM DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT JULIANDAY(:date) FROM DoctrineExtensions\Tests\Entities\Blank b', "SELECT CAST(STRFTIME('%J', ?) AS NUMBER) AS sclr_0 FROM Blank b0_" ); } diff --git a/tests/Query/Sqlite/LeastTest.php b/tests/Query/Sqlite/LeastTest.php index 51504ffa..ff9deb4c 100644 --- a/tests/Query/Sqlite/LeastTest.php +++ b/tests/Query/Sqlite/LeastTest.php @@ -11,7 +11,7 @@ class LeastTest extends SqliteTestCase public function testLeast(): void { $this->assertDqlProducesSql( - "SELECT LEAST(2, 3) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT LEAST(2, 3) from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT MIN(2, 3) AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Sqlite/MinuteTest.php b/tests/Query/Sqlite/MinuteTest.php index e6421a65..5d1176f6 100644 --- a/tests/Query/Sqlite/MinuteTest.php +++ b/tests/Query/Sqlite/MinuteTest.php @@ -11,7 +11,7 @@ class MinuteTest extends SqliteTestCase public function testMinute(): void { $this->assertDqlProducesSql( - "SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT MINUTE(2) from DoctrineExtensions\Tests\Entities\Blank b', "SELECT CAST(STRFTIME('%M', 2) AS NUMBER) AS sclr_0 FROM Blank b0_" ); } diff --git a/tests/Query/Sqlite/MonthTest.php b/tests/Query/Sqlite/MonthTest.php index d3b04442..9757c1b1 100644 --- a/tests/Query/Sqlite/MonthTest.php +++ b/tests/Query/Sqlite/MonthTest.php @@ -11,7 +11,7 @@ class MonthTest extends SqliteTestCase public function testMonth(): void { $this->assertDqlProducesSql( - "SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT MONTH(2) from DoctrineExtensions\Tests\Entities\Blank b', "SELECT CAST(STRFTIME('%m', 2) AS NUMBER) AS sclr_0 FROM Blank b0_" ); } diff --git a/tests/Query/Sqlite/RandomTest.php b/tests/Query/Sqlite/RandomTest.php index eb3d6b95..f4823df3 100644 --- a/tests/Query/Sqlite/RandomTest.php +++ b/tests/Query/Sqlite/RandomTest.php @@ -11,7 +11,7 @@ class RandomTest extends SqliteTestCase public function testRandom(): void { $this->assertDqlProducesSql( - "SELECT RANDOM() from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT RANDOM() from DoctrineExtensions\Tests\Entities\Blank b', 'SELECT RANDOM() AS sclr_0 FROM Blank b0_' ); } diff --git a/tests/Query/Sqlite/SecondTest.php b/tests/Query/Sqlite/SecondTest.php index 85395d8d..476b7ff4 100644 --- a/tests/Query/Sqlite/SecondTest.php +++ b/tests/Query/Sqlite/SecondTest.php @@ -11,7 +11,7 @@ class SecondTest extends SqliteTestCase public function testSecond(): void { $this->assertDqlProducesSql( - "SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT SECOND(2) from DoctrineExtensions\Tests\Entities\Blank b', "SELECT CAST(STRFTIME('%S', 2) AS NUMBER) AS sclr_0 FROM Blank b0_" ); } diff --git a/tests/Query/Sqlite/YearTest.php b/tests/Query/Sqlite/YearTest.php index a8905714..69abb89c 100644 --- a/tests/Query/Sqlite/YearTest.php +++ b/tests/Query/Sqlite/YearTest.php @@ -11,7 +11,7 @@ class YearTest extends SqliteTestCase public function testYear(): void { $this->assertDqlProducesSql( - "SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b", + 'SELECT YEAR(2) from DoctrineExtensions\Tests\Entities\Blank b', "SELECT CAST(STRFTIME('%Y', 2) AS NUMBER) AS sclr_0 FROM Blank b0_" ); } From ac2fad92120f1f90686d28dcdd417f53853efd68 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 02:42:26 +0100 Subject: [PATCH 26/43] Code Sniffer: manual fix visibility missing --- tests/Query/ConfigLoader.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Query/ConfigLoader.php b/tests/Query/ConfigLoader.php index 4d90fa83..3a74fb64 100644 --- a/tests/Query/ConfigLoader.php +++ b/tests/Query/ConfigLoader.php @@ -14,13 +14,13 @@ class ConfigLoader { - const MYSQL = 'mysql'; + public const MYSQL = 'mysql'; - const ORACLE = 'oracle'; + public const ORACLE = 'oracle'; - const POSTGRES = 'postgres'; + public const POSTGRES = 'postgres'; - const SQLITE = 'sqlite'; + public const SQLITE = 'sqlite'; /** * @param Configuration $configuration From 2145ae2492b2ea247987c3236a0db738b7ec8713 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 02:43:35 +0100 Subject: [PATCH 27/43] Code Sniffer: manual fix "Each index in a multi-line array must be on a new line" --- tests/Types/ZendDateTest.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/Types/ZendDateTest.php b/tests/Types/ZendDateTest.php index 7968528e..9335a0de 100755 --- a/tests/Types/ZendDateTest.php +++ b/tests/Types/ZendDateTest.php @@ -56,8 +56,12 @@ public function setUp(): void ]); $this->em->persist(new ZendDate(1, new Zend_Date([ - 'year' => 2012, 'month' => 11, 'day' => 10, - 'hour' => 9, 'minute' => 8, 'second' => 7, + 'year' => 2012, + 'month' => 11, + 'day' => 10, + 'hour' => 9, + 'minute' => 8, + 'second' => 7, ]))); $this->em->flush(); @@ -69,16 +73,24 @@ public function testGetZendDate() $this->assertInstanceOf('Zend_Date', $entity->date); $this->assertTrue($entity->date->equals(new Zend_Date([ - 'year' => 2012, 'month' => 11, 'day' => 10, - 'hour' => 9, 'minute' => 8, 'second' => 7, + 'year' => 2012, + 'month' => 11, + 'day' => 10, + 'hour' => 9, + 'minute' => 8, + 'second' => 7, ]))); } public function testSetZendDate() { $zendDate = new Zend_Date([ - 'year' => 2012, 'month' => 11, 'day' => 10, - 'hour' => 9, 'minute' => 8, 'second' => 7, + 'year' => 2012, + 'month' => 11, + 'day' => 10, + 'hour' => 9, + 'minute' => 8, + 'second' => 7, ]); $entity = new ZendDate(2, $zendDate); From 0630ea28f85efb0e32ea782863eea1b1996a2277 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 02:44:53 +0100 Subject: [PATCH 28/43] Code Sniffer: manual fix "Space found before/after square bracket" --- tests/Query/ConfigLoader.php | 6 +++--- tests/Query/DbTestCase.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Query/ConfigLoader.php b/tests/Query/ConfigLoader.php index 3a74fb64..f40e8b46 100644 --- a/tests/Query/ConfigLoader.php +++ b/tests/Query/ConfigLoader.php @@ -35,19 +35,19 @@ public static function load(Configuration $configuration, $database) // Load the existing function classes. if (array_key_exists('datetime_functions', $parsed)) { - foreach ($parsed[ 'datetime_functions' ] as $key => $value) { + foreach ($parsed['datetime_functions'] as $key => $value) { $configuration->addCustomDatetimeFunction(strtoupper($key), $value); } } if (array_key_exists('numeric_functions', $parsed)) { - foreach ($parsed[ 'numeric_functions' ] as $key => $value) { + foreach ($parsed['numeric_functions'] as $key => $value) { $configuration->addCustomNumericFunction(strtoupper($key), $value); } } if (array_key_exists('string_functions', $parsed)) { - foreach ($parsed[ 'string_functions' ] as $key => $value) { + foreach ($parsed['string_functions'] as $key => $value) { $configuration->addCustomStringFunction(strtoupper($key), $value); } } diff --git a/tests/Query/DbTestCase.php b/tests/Query/DbTestCase.php index 2ad997ca..529cb868 100644 --- a/tests/Query/DbTestCase.php +++ b/tests/Query/DbTestCase.php @@ -26,7 +26,7 @@ public function setUp(): void $this->configuration->setProxyNamespace('DoctrineExtensions\Tests\Proxies'); $this->configuration->setAutoGenerateProxyClasses(true); $this->configuration->setMetadataDriverImpl($this->configuration->newDefaultAnnotationDriver(__DIR__ . '/../Entities')); - $this->entityManager = EntityManager::create(['driver' => 'pdo_sqlite', 'memory' => true ], $this->configuration); + $this->entityManager = EntityManager::create(['driver' => 'pdo_sqlite', 'memory' => true], $this->configuration); } public function assertDqlProducesSql($actualDql, $expectedSql, $params = []): void From db1f5a0da2087dd1df4f96a0a79a8e891dd0a459 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 02:52:15 +0100 Subject: [PATCH 29/43] Code Sniffer: manual fix Squiz.Strings.DoubleQuoteUsage.ContainsVar --- tests/Query/Mysql/TrigTest.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/Query/Mysql/TrigTest.php b/tests/Query/Mysql/TrigTest.php index 0d3d5185..12dd7e04 100644 --- a/tests/Query/Mysql/TrigTest.php +++ b/tests/Query/Mysql/TrigTest.php @@ -25,28 +25,28 @@ public function testSin(): void $this->_assertFirstQuery('SIN'); $this->_assertSecondQuery('SIN'); - $dql = "SELECT SIN(RADIANS(p.latitude)) FROM {$this->entity} p"; + $dql = 'SELECT SIN(RADIANS(p.latitude)) FROM ' . $this->entity . ' p'; $q = $this->entityManager->createQuery($dql); $sql = 'SELECT SIN(RADIANS(b0_.latitude)) AS sclr_0 FROM BlogPost b0_'; $this->assertEquals($sql, $q->getSql()); - $dql = "SELECT SIN(p.latitude * p.longitude) FROM {$this->entity} p"; + $dql = 'SELECT SIN(p.latitude * p.longitude) FROM ' . $this->entity . ' p'; $q = $this->entityManager->createQuery($dql); $sql = 'SELECT SIN(b0_.latitude * b0_.longitude) AS sclr_0 FROM BlogPost b0_'; $this->assertEquals($sql, $q->getSql()); - $dql = "SELECT SIN(RADIANS(p.latitude) * RADIANS(p.longitude)) FROM {$this->entity} p"; + $dql = 'SELECT SIN(RADIANS(p.latitude) * RADIANS(p.longitude)) FROM ' . $this->entity . ' p'; $q = $this->entityManager->createQuery($dql); $sql = 'SELECT SIN(RADIANS(b0_.latitude) * RADIANS(b0_.longitude)) AS sclr_0 FROM BlogPost b0_'; $this->assertEquals($sql, $q->getSql()); if (Version::compare('2.4.0') <= 0) { - $dql = "SELECT p FROM {$this->entity} p WHERE p.longitude = SIN(RADIANS(p.latitude)) * RADIANS(p.longitude)"; + $dql = 'SELECT p FROM ' . $this->entity . ' p WHERE p.longitude = SIN(RADIANS(p.latitude)) * RADIANS(p.longitude)'; } else { - $dql = "SELECT p FROM {$this->entity} p WHERE p.longitude = (SIN(RADIANS(p.latitude)) * RADIANS(p.longitude))"; + $dql = 'SELECT p FROM ' . $this->entity . ' p WHERE p.longitude = (SIN(RADIANS(p.latitude)) * RADIANS(p.longitude))'; } $q = $this->entityManager->createQuery($dql); @@ -54,16 +54,16 @@ public function testSin(): void $sql = 'SELECT b0_.id AS id_0, b0_.created AS created_1, b0_.longitude AS longitude_2, b0_.latitude AS latitude_3 FROM BlogPost b0_ WHERE b0_.longitude = SIN(RADIANS(b0_.latitude)) * RADIANS(b0_.longitude)'; $this->assertEquals($sql, $q->getSql()); - $dql = "SELECT p FROM {$this->entity} p WHERE SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude)) = 1"; + $dql = 'SELECT p FROM ' . $this->entity . ' p WHERE SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude)) = 1'; $q = $this->entityManager->createQuery($dql); $sql = 'SELECT b0_.id AS id_0, b0_.created AS created_1, b0_.longitude AS longitude_2, b0_.latitude AS latitude_3 FROM BlogPost b0_ WHERE SIN(RADIANS(b0_.latitude)) * SIN(RADIANS(b0_.longitude)) = 1'; $this->assertEquals($sql, $q->getSql()); if (Version::compare('2.4.0') <= 0) { - $dql = "SELECT SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude)) FROM {$this->entity} p "; + $dql = 'SELECT SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude)) FROM ' . $this->entity . ' p '; } else { - $dql = "SELECT (SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude))) FROM {$this->entity} p "; + $dql = 'SELECT (SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude))) FROM ' . $this->entity . ' p '; } $q = $this->entityManager->createQuery($dql); @@ -84,9 +84,9 @@ public function testAcos(): void $this->_assertSecondQuery('ACOS'); if (Version::compare('2.4.0') <= 0) { - $dql = "SELECT ACOS(SIN(RADIANS(p.latitude)) + SIN(RADIANS(p.longitude))) * 1 FROM {$this->entity} p"; + $dql = 'SELECT ACOS(SIN(RADIANS(p.latitude)) + SIN(RADIANS(p.longitude))) * 1 FROM ' . $this->entity . ' p'; } else { - $dql = "SELECT (ACOS(SIN(RADIANS(p.latitude)) + SIN(RADIANS(p.longitude))) * 1) FROM {$this->entity} p"; + $dql = 'SELECT (ACOS(SIN(RADIANS(p.latitude)) + SIN(RADIANS(p.longitude))) * 1) FROM ' . $this->entity . ' p'; } $q = $this->entityManager->createQuery($dql); @@ -132,7 +132,7 @@ public function testAtan(): void $this->_assertSecondQuery('ATAN'); // test with 2 arguments - $dql = "SELECT ATAN(p.latitude, p.longitude) FROM {$this->entity} p "; + $dql = 'SELECT ATAN(p.latitude, p.longitude) FROM ' . $this->entity . ' p '; $q = $this->entityManager->createQuery($dql); $sql = 'SELECT ATAN(b0_.latitude, b0_.longitude) AS sclr_0 FROM BlogPost b0_'; @@ -141,7 +141,7 @@ public function testAtan(): void public function testAtan2(): void { - $dql = "SELECT ATAN2(p.latitude, p.longitude) FROM {$this->entity} p"; + $dql = 'SELECT ATAN2(p.latitude, p.longitude) FROM ' . $this->entity . ' p'; $q = $this->entityManager->createQuery($dql); $sql = 'SELECT ATAN2(b0_.latitude, b0_.longitude) AS sclr_0 FROM BlogPost b0_'; @@ -160,9 +160,9 @@ public function testCosineLaw(): void . ') * ' . $radiusOfEarth; if (Version::compare('2.4.0') <= 0) { - $dql = 'SELECT ' . $cosineLaw . " FROM {$this->entity} p"; + $dql = 'SELECT ' . $cosineLaw . ' FROM ' . $this->entity . ' p'; } else { - $dql = 'SELECT (' . $cosineLaw . ") FROM {$this->entity} p"; + $dql = 'SELECT (' . $cosineLaw . ') FROM ' . $this->entity . ' p'; } $q = $this->entityManager->createQuery($dql); @@ -187,7 +187,7 @@ protected function _assertSecondQuery($func): void protected function _getFirstDqlQuery($func) { - $dql = "SELECT p FROM {$this->entity} p WHERE " . $func . '(p.latitude) = 1'; + $dql = 'SELECT p FROM ' . $this->entity . ' p WHERE ' . $func . '(p.latitude) = 1'; return $this->entityManager->createQuery($dql); } @@ -201,7 +201,7 @@ protected function _getFirstSqlQuery($func) protected function _getSecondDqlQuery($func) { - $dql = 'SELECT ' . $func . "(p.latitude) FROM {$this->entity} p"; + $dql = 'SELECT ' . $func . '(p.latitude) FROM ' . $this->entity . ' p'; return $this->entityManager->createQuery($dql); } From 5371b089416b3e89164ed206fcc2280f3d00a509 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 02:54:05 +0100 Subject: [PATCH 30/43] Code Sniffer: manual fix PSR2.Methods.MethodDeclaration.Underscore --- tests/Query/Mysql/TrigTest.php | 56 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/Query/Mysql/TrigTest.php b/tests/Query/Mysql/TrigTest.php index 12dd7e04..8b0e072a 100644 --- a/tests/Query/Mysql/TrigTest.php +++ b/tests/Query/Mysql/TrigTest.php @@ -22,8 +22,8 @@ public function setUp(): void public function testSin(): void { - $this->_assertFirstQuery('SIN'); - $this->_assertSecondQuery('SIN'); + $this->assertFirstQuery('SIN'); + $this->assertSecondQuery('SIN'); $dql = 'SELECT SIN(RADIANS(p.latitude)) FROM ' . $this->entity . ' p'; $q = $this->entityManager->createQuery($dql); @@ -74,14 +74,14 @@ public function testSin(): void public function testAsin(): void { - $this->_assertFirstQuery('ASIN'); - $this->_assertSecondQuery('ASIN'); + $this->assertFirstQuery('ASIN'); + $this->assertSecondQuery('ASIN'); } public function testAcos(): void { - $this->_assertFirstQuery('ACOS'); - $this->_assertSecondQuery('ACOS'); + $this->assertFirstQuery('ACOS'); + $this->assertSecondQuery('ACOS'); if (Version::compare('2.4.0') <= 0) { $dql = 'SELECT ACOS(SIN(RADIANS(p.latitude)) + SIN(RADIANS(p.longitude))) * 1 FROM ' . $this->entity . ' p'; @@ -97,39 +97,39 @@ public function testAcos(): void public function testCos(): void { - $this->_assertFirstQuery('COS'); - $this->_assertSecondQuery('COS'); + $this->assertFirstQuery('COS'); + $this->assertSecondQuery('COS'); } public function testCot(): void { - $this->_assertFirstQuery('COT'); - $this->_assertSecondQuery('COT'); + $this->assertFirstQuery('COT'); + $this->assertSecondQuery('COT'); } public function testDegrees(): void { - $this->_assertFirstQuery('DEGREES'); - $this->_assertSecondQuery('DEGREES'); + $this->assertFirstQuery('DEGREES'); + $this->assertSecondQuery('DEGREES'); } public function testRadians(): void { - $this->_assertFirstQuery('RADIANS'); - $this->_assertSecondQuery('RADIANS'); + $this->assertFirstQuery('RADIANS'); + $this->assertSecondQuery('RADIANS'); } public function testTan(): void { - $this->_assertFirstQuery('TAN'); - $this->_assertSecondQuery('TAN'); + $this->assertFirstQuery('TAN'); + $this->assertSecondQuery('TAN'); } public function testAtan(): void { // test with 1 argument - $this->_assertFirstQuery('ATAN'); - $this->_assertSecondQuery('ATAN'); + $this->assertFirstQuery('ATAN'); + $this->assertSecondQuery('ATAN'); // test with 2 arguments $dql = 'SELECT ATAN(p.latitude, p.longitude) FROM ' . $this->entity . ' p '; @@ -171,42 +171,42 @@ public function testCosineLaw(): void $this->assertEquals($sql, $q->getSql()); } - protected function _assertFirstQuery($func): void + protected function assertFirstQuery($func): void { - $q = $this->_getFirstDqlQuery($func); - $sql = $this->_getFirstSqlQuery($func); + $q = $this->getFirstDqlQuery($func); + $sql = $this->getFirstSqlQuery($func); $this->assertEquals($sql, $q->getSql()); } - protected function _assertSecondQuery($func): void + protected function assertSecondQuery($func): void { - $q = $this->_getSecondDqlQuery($func); - $sql = $this->_getSecondSqlQuery($func); + $q = $this->getSecondDqlQuery($func); + $sql = $this->getSecondSqlQuery($func); $this->assertEquals($sql, $q->getSql()); } - protected function _getFirstDqlQuery($func) + protected function getFirstDqlQuery($func) { $dql = 'SELECT p FROM ' . $this->entity . ' p WHERE ' . $func . '(p.latitude) = 1'; return $this->entityManager->createQuery($dql); } - protected function _getFirstSqlQuery($func) + protected function getFirstSqlQuery($func) { return 'SELECT b0_.id AS id_0, b0_.created AS created_1, ' . 'b0_.longitude AS longitude_2, b0_.latitude AS latitude_3 ' . 'FROM BlogPost b0_ WHERE ' . $func . '(b0_.latitude) = 1'; } - protected function _getSecondDqlQuery($func) + protected function getSecondDqlQuery($func) { $dql = 'SELECT ' . $func . '(p.latitude) FROM ' . $this->entity . ' p'; return $this->entityManager->createQuery($dql); } - protected function _getSecondSqlQuery($func) + protected function getSecondSqlQuery($func) { return 'SELECT ' . $func . '(b0_.latitude) AS sclr_0 FROM BlogPost b0_'; } From c0ff1c17e839d08c665a73dd28806ebcf6790249 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 02:55:22 +0100 Subject: [PATCH 31/43] Code Sniffer: manual fix SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint --- tests/Query/Mysql/TrigTest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Query/Mysql/TrigTest.php b/tests/Query/Mysql/TrigTest.php index 8b0e072a..044841a6 100644 --- a/tests/Query/Mysql/TrigTest.php +++ b/tests/Query/Mysql/TrigTest.php @@ -4,6 +4,7 @@ namespace DoctrineExtensions\Tests\Query\Mysql; +use Doctrine\ORM\Query; use Doctrine\ORM\Version; use DoctrineExtensions\Tests\Query\MysqlTestCase; @@ -185,28 +186,28 @@ protected function assertSecondQuery($func): void $this->assertEquals($sql, $q->getSql()); } - protected function getFirstDqlQuery($func) + protected function getFirstDqlQuery($func): Query { $dql = 'SELECT p FROM ' . $this->entity . ' p WHERE ' . $func . '(p.latitude) = 1'; return $this->entityManager->createQuery($dql); } - protected function getFirstSqlQuery($func) + protected function getFirstSqlQuery($func): string { return 'SELECT b0_.id AS id_0, b0_.created AS created_1, ' . 'b0_.longitude AS longitude_2, b0_.latitude AS latitude_3 ' . 'FROM BlogPost b0_ WHERE ' . $func . '(b0_.latitude) = 1'; } - protected function getSecondDqlQuery($func) + protected function getSecondDqlQuery($func): Query { $dql = 'SELECT ' . $func . '(p.latitude) FROM ' . $this->entity . ' p'; return $this->entityManager->createQuery($dql); } - protected function getSecondSqlQuery($func) + protected function getSecondSqlQuery($func): string { return 'SELECT ' . $func . '(b0_.latitude) AS sclr_0 FROM BlogPost b0_'; } From 4aa592bc37d84ab62b073149fc1bdac8c05346e8 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 02:58:23 +0100 Subject: [PATCH 32/43] Code Sniffer: manual fix Squiz.Strings.DoubleQuoteUsage.ContainsVar --- tests/Query/Mysql/CastTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Query/Mysql/CastTest.php b/tests/Query/Mysql/CastTest.php index 5b69b2dd..157da816 100644 --- a/tests/Query/Mysql/CastTest.php +++ b/tests/Query/Mysql/CastTest.php @@ -15,11 +15,11 @@ class CastTest extends MysqlTestCase public function testSimpleSqlQuery(): void { $query = $this->entityManager->createQuery( - "SELECT CAST(blog.latitude AS SIGNED) FROM {$this->entityLong} blog" + 'SELECT CAST(blog.latitude AS SIGNED) FROM ' . $this->entityLong . ' blog' ); static::assertEquals( - "SELECT CAST(b0_.latitude AS SIGNED) AS sclr_0 FROM {$this->entityShort} b0_", + 'SELECT CAST(b0_.latitude AS SIGNED) AS sclr_0 FROM ' . $this->entityShort . ' b0_', $query->getSQL() ); } @@ -27,11 +27,11 @@ public function testSimpleSqlQuery(): void public function testMultipleCastWithFieldAliasSqlQuery(): void { $query = $this->entityManager->createQuery( - "SELECT CAST(blog.latitude AS UNSIGNED), CAST(blog.latitude AS SIGNED) FROM {$this->entityLong} blog" + 'SELECT CAST(blog.latitude AS UNSIGNED), CAST(blog.latitude AS SIGNED) FROM ' . $this->entityLong . ' blog' ); static::assertEquals( - "SELECT CAST(b0_.latitude AS UNSIGNED) AS sclr_0, CAST(b0_.latitude AS SIGNED) AS sclr_1 FROM {$this->entityShort} b0_", + 'SELECT CAST(b0_.latitude AS UNSIGNED) AS sclr_0, CAST(b0_.latitude AS SIGNED) AS sclr_1 FROM ' . $this->entityShort . ' b0_', $query->getSQL() ); } @@ -39,11 +39,11 @@ public function testMultipleCastWithFieldAliasSqlQuery(): void public function testWithParametersSqlQuery(): void { $query = $this->entityManager->createQuery( - "SELECT CAST(blog.latitude AS DECIMAL(10, 2)) FROM {$this->entityLong} blog" + 'SELECT CAST(blog.latitude AS DECIMAL(10, 2)) FROM ' . $this->entityLong . ' blog' ); static::assertEquals( - "SELECT CAST(b0_.latitude AS DECIMAL(10, 2)) AS sclr_0 FROM {$this->entityShort} b0_", + 'SELECT CAST(b0_.latitude AS DECIMAL(10, 2)) AS sclr_0 FROM ' . $this->entityShort . ' b0_', $query->getSQL() ); } From 2ff2d11708929e2430bdfd7b6e5031594bb6a5b9 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 02:59:35 +0100 Subject: [PATCH 33/43] Code Sniffer: apply rule Generic.Formatting.MultipleStatementAlignment.NotSame --- tests/Query/Postgresql/AtTimeZoneTest.php | 2 +- tests/Query/Postgresql/CountFilterTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Query/Postgresql/AtTimeZoneTest.php b/tests/Query/Postgresql/AtTimeZoneTest.php index f080ac06..4a0bae1c 100644 --- a/tests/Query/Postgresql/AtTimeZoneTest.php +++ b/tests/Query/Postgresql/AtTimeZoneTest.php @@ -13,7 +13,7 @@ class AtTimeZoneTest extends PostgresqlTestCase public function testAtTimeZone(): void { $dql = 'SELECT d FROM DoctrineExtensions\Tests\Entities\Date d WHERE AT_TIME_ZONE(d.created, :timeZone) < :currentTime'; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $q->setParameter('timeZone', 'UTC'); $q->setParameter('currentTime', date('Y-m-d H:i:s')); $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE d0_.created AT TIME ZONE ? < ?'; diff --git a/tests/Query/Postgresql/CountFilterTest.php b/tests/Query/Postgresql/CountFilterTest.php index c880a96f..bdb94f3c 100644 --- a/tests/Query/Postgresql/CountFilterTest.php +++ b/tests/Query/Postgresql/CountFilterTest.php @@ -11,7 +11,7 @@ class CountFilterTest extends PostgresqlTestCase public function testCountFilter(): void { $dql = 'SELECT COUNT_FILTER(b, WHERE b.id = :id) FROM DoctrineExtensions\Tests\Entities\Blank b'; - $q = $this->entityManager->createQuery($dql); + $q = $this->entityManager->createQuery($dql); $q->setParameter('id', 1); $sql = 'SELECT COUNT(b0_.id) FILTER( WHERE b0_.id = ?) AS sclr_0 FROM Blank b0_'; $this->assertEquals($sql, $q->getSql()); From 6b4fd1ebb59297393eb215513d634efb567a0f5d Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 03:11:10 +0100 Subject: [PATCH 34/43] Code Sniffer: manual fix Squiz.Strings.DoubleQuoteUsage.ContainsVar --- tests/Query/Sqlite/ConcatWsTest.php | 2 +- tests/Query/Sqlite/DateFormatTest.php | 8 ++++---- tests/Query/Sqlite/IfElseTest.php | 2 +- tests/Query/Sqlite/NumericFunctionsTest.php | 4 ++-- tests/Query/Sqlite/StrfTimeTest.php | 2 +- tests/Query/Sqlite/StringFunctionsTest.php | 6 +++--- tests/Query/Sqlite/WeekDayTest.php | 2 +- tests/Query/Sqlite/WeekTest.php | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/Query/Sqlite/ConcatWsTest.php b/tests/Query/Sqlite/ConcatWsTest.php index 15660e94..a627987d 100644 --- a/tests/Query/Sqlite/ConcatWsTest.php +++ b/tests/Query/Sqlite/ConcatWsTest.php @@ -13,7 +13,7 @@ public function testConcatWs(): void $dql = "SELECT CONCAT_WS(',', p.id, p.name) FROM DoctrineExtensions\\Tests\\Entities\\Product p"; $this->assertEquals( - "SELECT (IFNULL(p0_.id, '') || ',' || IFNULL(p0_.name, '')) AS {$this->columnAlias} FROM Product p0_", + 'SELECT (IFNULL(p0_.id, \'\') || \',\' || IFNULL(p0_.name, \'\')) AS ' . $this->columnAlias . ' FROM Product p0_', $this->entityManager->createQuery($dql)->getSql() ); } diff --git a/tests/Query/Sqlite/DateFormatTest.php b/tests/Query/Sqlite/DateFormatTest.php index bea3f7d8..3ee4f585 100644 --- a/tests/Query/Sqlite/DateFormatTest.php +++ b/tests/Query/Sqlite/DateFormatTest.php @@ -14,7 +14,7 @@ public function testCommonFormats(): void $dql = "SELECT DATE_FORMAT(b.created, '%Y-%m-%d %H:%i:%S') FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b"; $this->assertEquals( - "SELECT STRFTIME('%Y-%m-%d %H:%M:%S', b0_.created) AS {$this->columnAlias} FROM BlogPost b0_", + 'SELECT STRFTIME(\'%Y-%m-%d %H:%M:%S\', b0_.created) AS ' . $this->columnAlias . ' FROM BlogPost b0_', $this->entityManager->createQuery($dql)->getSql() ); } @@ -32,7 +32,7 @@ public function testUnsupportedFormats(): void $dql = "SELECT DATE_FORMAT(b.created, '%r') FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b"; $this->assertEquals( - "SELECT STRFTIME('%H:%M:%S', b0_.created) AS {$this->columnAlias} FROM BlogPost b0_", + 'SELECT STRFTIME(\'%H:%M:%S\', b0_.created) AS ' . $this->columnAlias . ' FROM BlogPost b0_', $this->entityManager->createQuery($dql)->getSql() ); @@ -42,7 +42,7 @@ public function testUnsupportedFormats(): void $dql = "SELECT DATE_FORMAT(b.created, '%x-%v') FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b"; $this->assertEquals( - "SELECT STRFTIME('%Y-%W', b0_.created) AS {$this->columnAlias} FROM BlogPost b0_", + 'SELECT STRFTIME(\'%Y-%W\', b0_.created) AS ' . $this->columnAlias . ' FROM BlogPost b0_', $this->entityManager->createQuery($dql)->getSql() ); @@ -53,7 +53,7 @@ public function testUnsupportedFormats(): void $dql = "SELECT DATE_FORMAT(b.created, '%W, %M %D, %Y') FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b"; $this->assertEquals( - "SELECT STRFTIME('%w, %m %d, %Y', b0_.created) AS {$this->columnAlias} FROM BlogPost b0_", + 'SELECT STRFTIME(\'%w, %m %d, %Y\', b0_.created) AS ' . $this->columnAlias . ' FROM BlogPost b0_', $this->entityManager->createQuery($dql)->getSql() ); } diff --git a/tests/Query/Sqlite/IfElseTest.php b/tests/Query/Sqlite/IfElseTest.php index 05899586..6c76eca6 100644 --- a/tests/Query/Sqlite/IfElseTest.php +++ b/tests/Query/Sqlite/IfElseTest.php @@ -13,7 +13,7 @@ public function testIfElse(): void $dql = 'SELECT ifelse(1 > 0, 1, 0) FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b'; $this->assertEquals( - "SELECT CASE WHEN 1 > 0 THEN 1 ELSE 0 END AS {$this->columnAlias} FROM BlogPost b0_", + 'SELECT CASE WHEN 1 > 0 THEN 1 ELSE 0 END AS ' . $this->columnAlias . ' FROM BlogPost b0_', $this->entityManager->createQuery($dql)->getSql() ); } diff --git a/tests/Query/Sqlite/NumericFunctionsTest.php b/tests/Query/Sqlite/NumericFunctionsTest.php index 62b29290..1fed2179 100644 --- a/tests/Query/Sqlite/NumericFunctionsTest.php +++ b/tests/Query/Sqlite/NumericFunctionsTest.php @@ -15,10 +15,10 @@ public function testRound(): void { $dql = 'SELECT ROUND(1.2345, 2) as outcome FROM DoctrineExtensions\Tests\Entities\Blank p'; $q = $this->entityManager->createQuery($dql); - $this->assertEquals("SELECT ROUND(1.2345, 2) AS {$this->columnAlias} FROM Blank b0_", $q->getSql()); + $this->assertEquals('SELECT ROUND(1.2345, 2) AS ' . $this->columnAlias . ' FROM Blank b0_', $q->getSql()); $dql = 'SELECT ROUND(1.2345) as outcome FROM DoctrineExtensions\Tests\Entities\Blank p'; $q = $this->entityManager->createQuery($dql); - $this->assertEquals("SELECT ROUND(1.2345) AS {$this->columnAlias} FROM Blank b0_", $q->getSql()); + $this->assertEquals('SELECT ROUND(1.2345) AS ' . $this->columnAlias . ' FROM Blank b0_', $q->getSql()); } } diff --git a/tests/Query/Sqlite/StrfTimeTest.php b/tests/Query/Sqlite/StrfTimeTest.php index 925f21e6..eb8523bb 100644 --- a/tests/Query/Sqlite/StrfTimeTest.php +++ b/tests/Query/Sqlite/StrfTimeTest.php @@ -37,7 +37,7 @@ public function testStrfTime(): void { $this->assertDqlProducesSql( 'SELECT StrfTime(\'%s\', p.created) as Time FROM DoctrineExtensions\Tests\Entities\Date p', - "SELECT strftime('%s', d0_.created) AS {$this->columnAlias} FROM Date d0_" + 'SELECT strftime(\'%s\', d0_.created) AS ' . $this->columnAlias . ' FROM Date d0_' ); } } diff --git a/tests/Query/Sqlite/StringFunctionsTest.php b/tests/Query/Sqlite/StringFunctionsTest.php index c6a1f319..c4388713 100644 --- a/tests/Query/Sqlite/StringFunctionsTest.php +++ b/tests/Query/Sqlite/StringFunctionsTest.php @@ -15,14 +15,14 @@ public function testIfNull(): void { $dql = 'SELECT IFNULL(p.id, 0) as outcome FROM DoctrineExtensions\Tests\Entities\Blank p'; $q = $this->entityManager->createQuery($dql); - $this->assertEquals("SELECT IFNULL(b0_.id, 0) AS {$this->columnAlias} FROM Blank b0_", $q->getSql()); + $this->assertEquals('SELECT IFNULL(b0_.id, 0) AS ' . $this->columnAlias . ' FROM Blank b0_', $q->getSql()); } public function testReplace(): void { $dql = "SELECT REPLACE(p.id, '1', '2') as outcome FROM DoctrineExtensions\\Tests\\Entities\\Blank p"; $q = $this->entityManager->createQuery($dql); - $this->assertEquals("SELECT REPLACE(b0_.id, '1', '2') AS {$this->columnAlias} FROM Blank b0_", $q->getSql()); + $this->assertEquals('SELECT REPLACE(b0_.id, \'1\', \'2\') AS ' . $this->columnAlias . ' FROM Blank b0_', $q->getSql()); } public function testConcatWs(): void @@ -30,7 +30,7 @@ public function testConcatWs(): void $dql = "SELECT CONCAT_WS('-', 'foo', 'bar', 'baz') as out FROM DoctrineExtensions\\Tests\\Entities\\Blank p"; $expected = "SELECT (IFNULL('foo', '') || '-' || IFNULL('bar', '') || '-' || IFNULL('baz', ''))" - . " AS {$this->columnAlias} FROM Blank b0_"; + . ' AS ' . $this->columnAlias . ' FROM Blank b0_'; $this->assertEquals($expected, $this->entityManager->createQuery($dql)->getSql()); } diff --git a/tests/Query/Sqlite/WeekDayTest.php b/tests/Query/Sqlite/WeekDayTest.php index 174c3f08..2881dada 100644 --- a/tests/Query/Sqlite/WeekDayTest.php +++ b/tests/Query/Sqlite/WeekDayTest.php @@ -12,7 +12,7 @@ public function testFormatWeekDay(): void { $dql = 'SELECT WEEKDAY(b.created) FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b'; $this->assertEquals( - "SELECT CAST(STRFTIME('%w', b0_.created) AS NUMBER) AS {$this->columnAlias} FROM BlogPost b0_", + 'SELECT CAST(STRFTIME(\'%w\', b0_.created) AS NUMBER) AS ' . $this->columnAlias . ' FROM BlogPost b0_', $this->entityManager->createQuery($dql)->getSql() ); } diff --git a/tests/Query/Sqlite/WeekTest.php b/tests/Query/Sqlite/WeekTest.php index fa6ab203..f0b28f06 100644 --- a/tests/Query/Sqlite/WeekTest.php +++ b/tests/Query/Sqlite/WeekTest.php @@ -12,7 +12,7 @@ public function testFormatWeek(): void { $dql = 'SELECT WEEK(b.created) FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b'; $this->assertEquals( - "SELECT CAST(STRFTIME('%W', b0_.created) AS NUMBER) AS {$this->columnAlias} FROM BlogPost b0_", + 'SELECT CAST(STRFTIME(\'%W\', b0_.created) AS NUMBER) AS ' . $this->columnAlias . ' FROM BlogPost b0_', $this->entityManager->createQuery($dql)->getSql() ); } @@ -21,7 +21,7 @@ public function testFormatWeekWithSecondArgument(): void { $dql = 'SELECT WEEK(b.created, 1) FROM DoctrineExtensions\\Tests\\Entities\\BlogPost b'; $this->assertEquals( - "SELECT CAST(STRFTIME('%W', b0_.created) AS NUMBER) AS {$this->columnAlias} FROM BlogPost b0_", + 'SELECT CAST(STRFTIME(\'%W\', b0_.created) AS NUMBER) AS ' . $this->columnAlias . ' FROM BlogPost b0_', $this->entityManager->createQuery($dql)->getSql() ); } From 9116b6b3b985ffdde7e2cf54576bd71abc65acc3 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 03:11:28 +0100 Subject: [PATCH 35/43] Code Sniffer: manual fix SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification --- tests/Query/Sqlite/StrfTimeTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Query/Sqlite/StrfTimeTest.php b/tests/Query/Sqlite/StrfTimeTest.php index eb8523bb..3aa38a7e 100644 --- a/tests/Query/Sqlite/StrfTimeTest.php +++ b/tests/Query/Sqlite/StrfTimeTest.php @@ -10,7 +10,8 @@ class StrfTimeTest extends SqliteTestCase { - public function getFunctionFormatters() + /** @return array> */ + public function getFunctionFormatters(): array { return [ ['Year', '%Y'], From 87a013d4ef013e109d157b71cfe03cb434caa954 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 03:13:55 +0100 Subject: [PATCH 36/43] Code Sniffer: apply rule 'Expected 1 line after "parent", found 0.' --- tests/Query/MysqlTestCase.php | 1 + tests/Query/OracleTestCase.php | 1 + tests/Query/PostgresqlTestCase.php | 1 + tests/Query/SqliteTestCase.php | 1 + 4 files changed, 4 insertions(+) diff --git a/tests/Query/MysqlTestCase.php b/tests/Query/MysqlTestCase.php index 24739963..44a9e510 100644 --- a/tests/Query/MysqlTestCase.php +++ b/tests/Query/MysqlTestCase.php @@ -9,6 +9,7 @@ class MysqlTestCase extends DbTestCase public function setUp(): void { parent::setUp(); + ConfigLoader::load($this->configuration, ConfigLoader::MYSQL); } } diff --git a/tests/Query/OracleTestCase.php b/tests/Query/OracleTestCase.php index 38158e2f..f51f0286 100644 --- a/tests/Query/OracleTestCase.php +++ b/tests/Query/OracleTestCase.php @@ -9,6 +9,7 @@ class OracleTestCase extends DbTestCase public function setUp(): void { parent::setUp(); + ConfigLoader::load($this->configuration, ConfigLoader::ORACLE); } } diff --git a/tests/Query/PostgresqlTestCase.php b/tests/Query/PostgresqlTestCase.php index a07dc2e0..f054cf11 100644 --- a/tests/Query/PostgresqlTestCase.php +++ b/tests/Query/PostgresqlTestCase.php @@ -9,6 +9,7 @@ class PostgresqlTestCase extends DbTestCase public function setUp(): void { parent::setUp(); + ConfigLoader::load($this->configuration, ConfigLoader::POSTGRES); } } diff --git a/tests/Query/SqliteTestCase.php b/tests/Query/SqliteTestCase.php index 90babd5e..90fb7512 100644 --- a/tests/Query/SqliteTestCase.php +++ b/tests/Query/SqliteTestCase.php @@ -16,6 +16,7 @@ class SqliteTestCase extends DbTestCase public function setUp(): void { parent::setUp(); + ConfigLoader::load($this->configuration, ConfigLoader::SQLITE); $emConfiguration = $this->entityManager->getConfiguration(); From 57b9c474c7418379b894be5f084758286e89332a Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 03:15:13 +0100 Subject: [PATCH 37/43] Code Sniffer: misc fixes --- src/Query/Mysql/Cast.php | 2 +- src/Query/Mysql/Div.php | 3 +- src/Query/Mysql/MatchAgainst.php | 3 +- tests/Config/MysqlYamlTest.php | 26 +++++++++++----- tests/Entities/Blank.php | 6 +++- tests/Entities/BlogPost.php | 6 +++- tests/Entities/Date.php | 6 +++- tests/Entities/Product.php | 24 ++++++--------- tests/Entities/Set.php | 6 +++- tests/Entities/ZendDate.php | 2 +- tests/Query/ConfigLoader.php | 6 +--- tests/Query/SqliteTestCase.php | 4 +-- tests/Types/CarbonDateTest.php | 51 ++++++++++++++++---------------- tests/Types/ZendDateTest.php | 8 ++--- 14 files changed, 85 insertions(+), 68 deletions(-) diff --git a/src/Query/Mysql/Cast.php b/src/Query/Mysql/Cast.php index 6d5f2975..29e0f180 100644 --- a/src/Query/Mysql/Cast.php +++ b/src/Query/Mysql/Cast.php @@ -46,8 +46,8 @@ public function parse(Parser $parser): void if ($parser->getLexer()->isNextToken(Lexer::T_OPEN_PARENTHESIS)) { $parser->match(Lexer::T_OPEN_PARENTHESIS); - /** @var Literal $parameter */ $parameter = $parser->Literal(); + assert($parameter instanceof Literal); $parameters = [$parameter->value]; if ($parser->getLexer()->isNextToken(Lexer::T_COMMA)) { diff --git a/src/Query/Mysql/Div.php b/src/Query/Mysql/Div.php index 67fbbda2..f708a040 100644 --- a/src/Query/Mysql/Div.php +++ b/src/Query/Mysql/Div.php @@ -21,8 +21,7 @@ class Div extends FunctionNode public function getSql(SqlWalker $sqlWalker): string { - return - $sqlWalker->walkArithmeticPrimary($this->dividend) . ' DIV ' . + return $sqlWalker->walkArithmeticPrimary($this->dividend) . ' DIV ' . $sqlWalker->walkArithmeticPrimary($this->divisor); } diff --git a/src/Query/Mysql/MatchAgainst.php b/src/Query/Mysql/MatchAgainst.php index 40642362..1c5bd25c 100644 --- a/src/Query/Mysql/MatchAgainst.php +++ b/src/Query/Mysql/MatchAgainst.php @@ -5,6 +5,7 @@ namespace DoctrineExtensions\Query\Mysql; use Doctrine\ORM\Query\AST\Functions\FunctionNode; +use Doctrine\ORM\Query\AST\PathExpression; use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; @@ -15,7 +16,7 @@ class MatchAgainst extends FunctionNode { - /** @var array list of \Doctrine\ORM\Query\AST\PathExpression */ + /** @var array */ protected $pathExp = null; /** @var string */ diff --git a/tests/Config/MysqlYamlTest.php b/tests/Config/MysqlYamlTest.php index fd98e04b..65abe9ba 100755 --- a/tests/Config/MysqlYamlTest.php +++ b/tests/Config/MysqlYamlTest.php @@ -7,21 +7,33 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Yaml\Parser; +use function array_diff; +use function array_keys; +use function array_map; +use function array_merge; +use function basename; +use function explode; +use function file_get_contents; +use function glob; +use function implode; +use function preg_match; +use function sort; +use function str_replace; +use function strtolower; + /** * Test that checks the README describes all of the query types - * - * @author Steve Lacey */ class MysqlYamlTest extends TestCase { - /** @var array */ + /** @var array */ protected $functions; public function setUp(): void { $yaml = new Parser(); - $config = $yaml->parse(file_get_contents(__DIR__ . '/../../config/mysql.yml')); + $config = $yaml->parse(file_get_contents(__DIR__ . '/../../config/mysql.yml')); $this->functions = array_merge( $config['doctrine']['orm']['dql']['datetime_functions'], $config['doctrine']['orm']['dql']['numeric_functions'], @@ -29,12 +41,12 @@ public function setUp(): void ); } - public function testFunctions() + public function testFunctions(): void { $documented = $this->functions; $available = array_map( - function ($path) { + static function ($path) { return 'DoctrineExtensions\\Query\\Mysql\\' . str_replace('.php', '', basename($path)); }, glob(__DIR__ . '/../../src/Query/Mysql/*') @@ -52,7 +64,7 @@ function ($path) { } } - public function testReadme() + public function testReadme(): void { preg_match('#\| MySQL \| `(.*)` \|#', file_get_contents(__DIR__ . '/../../README.md'), $matches); diff --git a/tests/Entities/Blank.php b/tests/Entities/Blank.php index 3ebe3712..a96e9fd1 100644 --- a/tests/Entities/Blank.php +++ b/tests/Entities/Blank.php @@ -9,6 +9,10 @@ */ class Blank { - /** @Id @Column(type="string") @GeneratedValue */ + /** + * @Id + * @Column(type="string") + * @GeneratedValue + */ public $id; } diff --git a/tests/Entities/BlogPost.php b/tests/Entities/BlogPost.php index bef17f35..f9aaacd8 100644 --- a/tests/Entities/BlogPost.php +++ b/tests/Entities/BlogPost.php @@ -9,7 +9,11 @@ */ class BlogPost { - /** @Id @Column(type="string") @GeneratedValue */ + /** + * @Id + * @Column(type="string") + * @GeneratedValue + */ public $id; /** diff --git a/tests/Entities/Date.php b/tests/Entities/Date.php index 75453c48..10337f82 100644 --- a/tests/Entities/Date.php +++ b/tests/Entities/Date.php @@ -9,7 +9,11 @@ */ class Date { - /** @Id @Column(type="string") @GeneratedValue */ + /** + * @Id + * @Column(type="string") + * @GeneratedValue + */ public $id; /** diff --git a/tests/Entities/Product.php b/tests/Entities/Product.php index 1b5aff1f..579cc3bb 100644 --- a/tests/Entities/Product.php +++ b/tests/Entities/Product.php @@ -4,31 +4,25 @@ namespace DoctrineExtensions\Tests\Entities; -/** - * @Entity - */ +/** @Entity */ class Product { - /** @Id @Column(type="string") @GeneratedValue */ - public $id; - /** + * @Id * @Column(type="string") + * @GeneratedValue */ + public $id; + + /** @Column(type="string") */ public $name; - /** - * @Column(type="DateTime") - */ + /** @Column(type="DateTime") */ public $created; - /** - * @Column(type="decimal", precision=10, scale=2) - */ + /** @Column(type="decimal", precision=10, scale=2) */ public $price; - /** - * @Column(type="decimal", precision=5, scale=2) - */ + /** @Column(type="decimal", precision=5, scale=2) */ public $weight; } diff --git a/tests/Entities/Set.php b/tests/Entities/Set.php index 50771db0..3d2703a5 100644 --- a/tests/Entities/Set.php +++ b/tests/Entities/Set.php @@ -9,7 +9,11 @@ */ class Set { - /** @Id @Column(type="string") @GeneratedValue */ + /** + * @Id + * @Column(type="string") + * @GeneratedValue + */ public $id; /** diff --git a/tests/Entities/ZendDate.php b/tests/Entities/ZendDate.php index 119356c6..9b12924c 100644 --- a/tests/Entities/ZendDate.php +++ b/tests/Entities/ZendDate.php @@ -23,7 +23,7 @@ class ZendDate public function __construct($id, $date) { - $this->id = $id; + $this->id = $id; $this->date = $date; } } diff --git a/tests/Query/ConfigLoader.php b/tests/Query/ConfigLoader.php index f40e8b46..bd6a3b7c 100644 --- a/tests/Query/ConfigLoader.php +++ b/tests/Query/ConfigLoader.php @@ -22,11 +22,7 @@ class ConfigLoader public const SQLITE = 'sqlite'; - /** - * @param Configuration $configuration - * @param string $database - */ - public static function load(Configuration $configuration, $database) + public static function load(Configuration $configuration, string $database): void { $parser = new Parser(); // Load the corresponding config file. diff --git a/tests/Query/SqliteTestCase.php b/tests/Query/SqliteTestCase.php index 90fb7512..fbb80836 100644 --- a/tests/Query/SqliteTestCase.php +++ b/tests/Query/SqliteTestCase.php @@ -8,9 +8,7 @@ class SqliteTestCase extends DbTestCase { - /** - * @var string name of Date - */ + /** @var string name of Date */ protected $columnAlias; public function setUp(): void diff --git a/tests/Types/CarbonDateTest.php b/tests/Types/CarbonDateTest.php index 82229eba..7c5783eb 100755 --- a/tests/Types/CarbonDateTest.php +++ b/tests/Types/CarbonDateTest.php @@ -60,16 +60,16 @@ public function setUp(): void $this->em->getClassMetadata('DoctrineExtensions\Tests\Entities\CarbonDate'), ]); - $entity = new Entity(); - $entity->id = 1; - $entity->date = Carbon::createFromDate(2015, 1, 1); - $entity->datetime = Carbon::create(2015, 1, 1, 0, 0, 0); - $entity->datetime_tz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); - $entity->time = Carbon::createFromTime(12, 0, 0, 'Europe/London'); - $entity->date_immutable = CarbonImmutable::createFromDate(2015, 1, 1); - $entity->datetime_immutable = CarbonImmutable::create(2015, 1, 1, 0, 0, 0); - $entity->datetime_tz_immutable = CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); - $entity->time_immutable = CarbonImmutable::createFromTime(12, 0, 0, 'Europe/London'); + $entity = new Entity(); + $entity->id = 1; + $entity->date = Carbon::createFromDate(2015, 1, 1); + $entity->datetime = Carbon::create(2015, 1, 1, 0, 0, 0); + $entity->datetimeTz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); + $entity->time = Carbon::createFromTime(12, 0, 0, 'Europe/London'); + $entity->dateImmutable = CarbonImmutable::createFromDate(2015, 1, 1); + $entity->datetimeImmutable = CarbonImmutable::create(2015, 1, 1, 0, 0, 0); + $entity->datetimeTzImmutable = CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); + $entity->timeImmutable = CarbonImmutable::createFromTime(12, 0, 0, 'Europe/London'); $this->em->persist($entity); $this->em->flush(); } @@ -117,15 +117,15 @@ public function testDateTimeTzGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); - $this->assertInstanceOf('Carbon\Carbon', $entity->datetime_tz); - $this->assertEquals(Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'), $entity->datetime_tz); + $this->assertInstanceOf('Carbon\Carbon', $entity->datetimeTz); + $this->assertEquals(Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'), $entity->datetimeTz); } public function testDateTimeTzSetter(): void { - $entity = new Entity(); - $entity->id = 2; - $entity->datetime_tz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); + $entity = new Entity(); + $entity->id = 2; + $entity->datetimeTz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); $this->em->persist($entity); $this->assertNull($this->em->flush()); @@ -153,7 +153,7 @@ public function testImmutableDateGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); - $this->assertInstanceOf('Carbon\CarbonImmutable', $entity->date_immutable); + $this->assertInstanceOf('Carbon\CarbonImmutable', $entity->dateImmutable); $this->assertEquals( CarbonImmutable::createFromDate(2015, 1, 1, $entity->date->timezone)->format('Y-m-d'), $entity->date->format('Y-m-d') @@ -174,7 +174,7 @@ public function testImmutableDateTimeGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); - $this->assertInstanceOf('Carbon\CarbonImmutable', $entity->datetime_immutable); + $this->assertInstanceOf('Carbon\CarbonImmutable', $entity->datetimeImmutable); $this->assertEquals(CarbonImmutable::create(2015, 1, 1, 0, 0, 0), $entity->datetime); } @@ -192,15 +192,15 @@ public function testImmutableDateTimeTzGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); - $this->assertInstanceOf('Carbon\CarbonImmutable', $entity->datetime_tz_immutable); - $this->assertEquals(CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'), $entity->datetime_tz); + $this->assertInstanceOf('Carbon\CarbonImmutable', $entity->datetimeTzImmutable); + $this->assertEquals(CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'), $entity->datetimeTz); } public function testImmutableDateTimeTzSetter(): void { - $entity = new Entity(); - $entity->id = 2; - $entity->datetime_tz = CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); + $entity = new Entity(); + $entity->id = 2; + $entity->datetimeTz = CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'); $this->em->persist($entity); $this->assertNull($this->em->flush()); @@ -210,7 +210,7 @@ public function testImmutableTimeGetter(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1); - $this->assertInstanceOf('Carbon\CarbonImmutable', $entity->time_immutable); + $this->assertInstanceOf('Carbon\CarbonImmutable', $entity->timeImmutable); $this->assertEquals(CarbonImmutable::createFromTime(12, 0, 0, 'Europe/London'), $entity->time); } @@ -227,13 +227,14 @@ public function testImmutableTimeSetter(): void /** @dataProvider typeProvider */ public function testTypesThatMapToAlreadyMappedDatabaseTypesRequireCommentHint($type): void { - /** @var AbstractPlatform $platform */ $platform = $this->getMockForAbstractClass('Doctrine\DBAL\Platforms\AbstractPlatform'); + assert($platform instanceof AbstractPlatform); $this->assertTrue(Type::getType($type)->requiresSQLCommentHint($platform)); } - public function typeProvider() + /** @return array> */ + public function typeProvider(): array { return [ ['CarbonDate'], diff --git a/tests/Types/ZendDateTest.php b/tests/Types/ZendDateTest.php index 9335a0de..9bcc8746 100755 --- a/tests/Types/ZendDateTest.php +++ b/tests/Types/ZendDateTest.php @@ -67,7 +67,7 @@ public function setUp(): void $this->em->flush(); } - public function testGetZendDate() + public function testGetZendDate(): void { $entity = $this->em->find('DoctrineExtensions\Tests\Entities\ZendDate', 1); @@ -82,7 +82,7 @@ public function testGetZendDate() ]))); } - public function testSetZendDate() + public function testSetZendDate(): void { $zendDate = new Zend_Date([ 'year' => 2012, @@ -103,10 +103,10 @@ public function testSetZendDate() $this->assertTrue($entity->date->equals($zendDate)); } - public function testTypesThatMapToAlreadyMappedDatabaseTypesRequireCommentHint() + public function testTypesThatMapToAlreadyMappedDatabaseTypesRequireCommentHint(): void { - /** @var AbstractPlatform $platform */ $platform = $this->getMockForAbstractClass('Doctrine\DBAL\Platforms\AbstractPlatform'); + assert($platform instanceof AbstractPlatform); $this->assertTrue(Type::getType('ZendDate')->requiresSQLCommentHint($platform)); } From cc9cdaf01110922333f3a7a078bdf78080400f3b Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 03:22:34 +0100 Subject: [PATCH 38/43] Code Sniffer: fix "Found multi-line doc comment with single line content" --- tests/Entities/Blank.php | 4 +--- tests/Entities/BlogPost.php | 16 ++++---------- tests/Entities/CarbonDate.php | 41 +++++++++-------------------------- tests/Entities/Date.php | 8 ++----- tests/Entities/Set.php | 8 ++----- tests/Entities/ZendDate.php | 14 +++--------- 6 files changed, 22 insertions(+), 69 deletions(-) diff --git a/tests/Entities/Blank.php b/tests/Entities/Blank.php index a96e9fd1..dc366420 100644 --- a/tests/Entities/Blank.php +++ b/tests/Entities/Blank.php @@ -4,9 +4,7 @@ namespace DoctrineExtensions\Tests\Entities; -/** - * @Entity - */ +/** @Entity */ class Blank { /** diff --git a/tests/Entities/BlogPost.php b/tests/Entities/BlogPost.php index f9aaacd8..04322413 100644 --- a/tests/Entities/BlogPost.php +++ b/tests/Entities/BlogPost.php @@ -4,9 +4,7 @@ namespace DoctrineExtensions\Tests\Entities; -/** - * @Entity - */ +/** @Entity */ class BlogPost { /** @@ -16,18 +14,12 @@ class BlogPost */ public $id; - /** - * @Column(type="DateTime") - */ + /** @Column(type="DateTime") */ public $created; - /** - * @Column(type="decimal", precision=12, scale=8) - */ + /** @Column(type="decimal", precision=12, scale=8) */ public $longitude; - /** - * @Column(type="decimal", precision=12, scale=8) - */ + /** @Column(type="decimal", precision=12, scale=8) */ public $latitude; } diff --git a/tests/Entities/CarbonDate.php b/tests/Entities/CarbonDate.php index 7e518e71..42b66e24 100644 --- a/tests/Entities/CarbonDate.php +++ b/tests/Entities/CarbonDate.php @@ -4,55 +4,34 @@ namespace DoctrineExtensions\Tests\Entities; -/** - * @Entity - * @Table - */ +/** @Entity @Table */ class CarbonDate { /** - * @Id - * @Column(type="integer") - */ + * @Id @Column(type="integer") */ public $id; - /** - * @Column(type="CarbonDate", nullable=true) - */ + /** @Column(type="CarbonDate", nullable=true) */ public $date; - /** - * @Column(type="CarbonDateTime", nullable=true) - */ + /** @Column(type="CarbonDateTime", nullable=true) */ public $datetime; - /** - * @Column(type="CarbonDateTimeTz", nullable=true) - */ + /** @Column(type="CarbonDateTimeTz", nullable=true) */ public $datetime_tz; - /** - * @Column(type="CarbonTime", nullable=true) - */ + /** @Column(type="CarbonTime", nullable=true) */ public $time; - /** - * @Column(type="CarbonImmutableDate", nullable=true) - */ + /** @Column(type="CarbonImmutableDate", nullable=true) */ public $date_immutable; - /** - * @Column(type="CarbonImmutableDateTime", nullable=true) - */ + /** @Column(type="CarbonImmutableDateTime", nullable=true) */ public $datetime_immutable; - /** - * @Column(type="CarbonImmutableDateTimeTz", nullable=true) - */ + /** @Column(type="CarbonImmutableDateTimeTz", nullable=true) */ public $datetime_tz_immutable; - /** - * @Column(type="CarbonImmutableTime", nullable=true) - */ + /** @Column(type="CarbonImmutableTime", nullable=true) */ public $time_immutable; } diff --git a/tests/Entities/Date.php b/tests/Entities/Date.php index 10337f82..7239eeb2 100644 --- a/tests/Entities/Date.php +++ b/tests/Entities/Date.php @@ -4,9 +4,7 @@ namespace DoctrineExtensions\Tests\Entities; -/** - * @Entity - */ +/** @Entity */ class Date { /** @@ -16,8 +14,6 @@ class Date */ public $id; - /** - * @Column(type="datetime") - */ + /** @Column(type="datetime") */ public $created; } diff --git a/tests/Entities/Set.php b/tests/Entities/Set.php index 3d2703a5..4751d94a 100644 --- a/tests/Entities/Set.php +++ b/tests/Entities/Set.php @@ -4,9 +4,7 @@ namespace DoctrineExtensions\Tests\Entities; -/** - * @Entity - */ +/** @Entity */ class Set { /** @@ -16,8 +14,6 @@ class Set */ public $id; - /** - * @Column(type="String") - */ + /** @Column(type="String") */ public $set; } diff --git a/tests/Entities/ZendDate.php b/tests/Entities/ZendDate.php index 9b12924c..785f2a9f 100644 --- a/tests/Entities/ZendDate.php +++ b/tests/Entities/ZendDate.php @@ -4,21 +4,13 @@ namespace DoctrineExtensions\Tests\Entities; -/** - * @Entity - * @Table - */ +/** @Entity @Table */ class ZendDate { - /** - * @Id - * @Column(type="integer") - */ + /** @Id @Column(type="integer") */ public $id; - /** - * @Column(type="ZendDate") - */ + /** @Column(type="ZendDate") */ public $date; public function __construct($id, $date) From bdebe1ccd8919d3d007059887ebf05754060a86f Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 03:28:35 +0100 Subject: [PATCH 39/43] Code Sniffer: fix "Member variable ... is not in valid camel caps format" --- tests/Entities/CarbonDate.php | 19 ++++++++++++------- tests/Entities/ZendDate.php | 10 ++++++++-- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/tests/Entities/CarbonDate.php b/tests/Entities/CarbonDate.php index 42b66e24..80e4db4f 100644 --- a/tests/Entities/CarbonDate.php +++ b/tests/Entities/CarbonDate.php @@ -4,11 +4,16 @@ namespace DoctrineExtensions\Tests\Entities; -/** @Entity @Table */ +/** + * @Entity + * @Table + */ class CarbonDate { /** - * @Id @Column(type="integer") */ + * @Id + * @Column(type="integer") + */ public $id; /** @Column(type="CarbonDate", nullable=true) */ @@ -18,20 +23,20 @@ class CarbonDate public $datetime; /** @Column(type="CarbonDateTimeTz", nullable=true) */ - public $datetime_tz; + public $datetimeTz; /** @Column(type="CarbonTime", nullable=true) */ public $time; /** @Column(type="CarbonImmutableDate", nullable=true) */ - public $date_immutable; + public $dateImmutable; /** @Column(type="CarbonImmutableDateTime", nullable=true) */ - public $datetime_immutable; + public $datetimeImmutable; /** @Column(type="CarbonImmutableDateTimeTz", nullable=true) */ - public $datetime_tz_immutable; + public $datetimeTzImmutable; /** @Column(type="CarbonImmutableTime", nullable=true) */ - public $time_immutable; + public $timeImmutable; } diff --git a/tests/Entities/ZendDate.php b/tests/Entities/ZendDate.php index 785f2a9f..ac7ea839 100644 --- a/tests/Entities/ZendDate.php +++ b/tests/Entities/ZendDate.php @@ -4,10 +4,16 @@ namespace DoctrineExtensions\Tests\Entities; -/** @Entity @Table */ +/** + * @Entity + * @Table + */ class ZendDate { - /** @Id @Column(type="integer") */ + /** + * @Id + * @Column(type="integer") + */ public $id; /** @Column(type="ZendDate") */ From cb46fd77124ea9549069eeb8639161c5f108146c Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 08:44:41 +0100 Subject: [PATCH 40/43] Revert "Code Sniffer: apply rule SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing" This reverts commit 0308030ae99209581291d4eca9ed5a67200427e1. --- src/Query/Mysql/Acos.php | 2 -- src/Query/Mysql/AddTime.php | 2 -- src/Query/Mysql/AesDecrypt.php | 2 -- src/Query/Mysql/AesEncrypt.php | 2 -- src/Query/Mysql/AnyValue.php | 2 -- src/Query/Mysql/Ascii.php | 2 -- src/Query/Mysql/Asin.php | 2 -- src/Query/Mysql/Atan.php | 2 -- src/Query/Mysql/Atan2.php | 2 -- src/Query/Mysql/Binary.php | 2 -- src/Query/Mysql/BitCount.php | 2 -- src/Query/Mysql/BitXor.php | 2 -- src/Query/Mysql/Cast.php | 2 -- src/Query/Mysql/Ceil.php | 2 -- src/Query/Mysql/CharLength.php | 2 -- src/Query/Mysql/Collate.php | 2 -- src/Query/Mysql/ConcatWs.php | 2 -- src/Query/Mysql/ConvertTz.php | 2 -- src/Query/Mysql/Cos.php | 2 -- src/Query/Mysql/Cot.php | 2 -- src/Query/Mysql/CountIf.php | 2 -- src/Query/Mysql/Crc32.php | 2 -- src/Query/Mysql/Date.php | 2 -- src/Query/Mysql/DateAdd.php | 2 -- src/Query/Mysql/DateDiff.php | 2 -- src/Query/Mysql/DateFormat.php | 2 -- src/Query/Mysql/DateSub.php | 2 -- src/Query/Mysql/Day.php | 2 -- src/Query/Mysql/DayName.php | 2 -- src/Query/Mysql/DayOfWeek.php | 2 -- src/Query/Mysql/DayOfYear.php | 2 -- src/Query/Mysql/Degrees.php | 2 -- src/Query/Mysql/Div.php | 2 -- src/Query/Mysql/Exp.php | 2 -- src/Query/Mysql/Extract.php | 2 -- src/Query/Mysql/Field.php | 2 -- src/Query/Mysql/FindInSet.php | 2 -- src/Query/Mysql/Floor.php | 2 -- src/Query/Mysql/Format.php | 2 -- src/Query/Mysql/FromBase64.php | 2 -- src/Query/Mysql/FromUnixtime.php | 2 -- src/Query/Mysql/Greatest.php | 2 -- src/Query/Mysql/GroupConcat.php | 2 -- src/Query/Mysql/Hex.php | 2 -- src/Query/Mysql/Hour.php | 2 -- src/Query/Mysql/IfElse.php | 2 -- src/Query/Mysql/IfNull.php | 2 -- src/Query/Mysql/Inet6Aton.php | 2 -- src/Query/Mysql/Inet6Ntoa.php | 2 -- src/Query/Mysql/InetAton.php | 2 -- src/Query/Mysql/InetNtoa.php | 2 -- src/Query/Mysql/Instr.php | 2 -- src/Query/Mysql/IsIpv4.php | 2 -- src/Query/Mysql/IsIpv4Compat.php | 2 -- src/Query/Mysql/IsIpv4Mapped.php | 2 -- src/Query/Mysql/IsIpv6.php | 2 -- src/Query/Mysql/JsonContains.php | 2 -- src/Query/Mysql/JsonDepth.php | 2 -- src/Query/Mysql/JsonLength.php | 2 -- src/Query/Mysql/Lag.php | 2 -- src/Query/Mysql/LastDay.php | 2 -- src/Query/Mysql/Lead.php | 2 -- src/Query/Mysql/Least.php | 2 -- src/Query/Mysql/Log.php | 2 -- src/Query/Mysql/Log10.php | 2 -- src/Query/Mysql/Log2.php | 2 -- src/Query/Mysql/Lpad.php | 2 -- src/Query/Mysql/MakeDate.php | 2 -- src/Query/Mysql/MatchAgainst.php | 2 -- src/Query/Mysql/Md5.php | 2 -- src/Query/Mysql/Minute.php | 2 -- src/Query/Mysql/Month.php | 2 -- src/Query/Mysql/MonthName.php | 2 -- src/Query/Mysql/Now.php | 2 -- src/Query/Mysql/NullIf.php | 2 -- src/Query/Mysql/Over.php | 2 -- src/Query/Mysql/PeriodDiff.php | 2 -- src/Query/Mysql/Pi.php | 2 -- src/Query/Mysql/Power.php | 2 -- src/Query/Mysql/Quarter.php | 2 -- src/Query/Mysql/Radians.php | 2 -- src/Query/Mysql/Rand.php | 2 -- src/Query/Mysql/Regexp.php | 2 -- src/Query/Mysql/Replace.php | 2 -- src/Query/Mysql/Round.php | 2 -- src/Query/Mysql/Rpad.php | 2 -- src/Query/Mysql/SecToTime.php | 2 -- src/Query/Mysql/Second.php | 2 -- src/Query/Mysql/Sha1.php | 2 -- src/Query/Mysql/Sha2.php | 2 -- src/Query/Mysql/Sin.php | 2 -- src/Query/Mysql/Soundex.php | 2 -- src/Query/Mysql/Std.php | 2 -- src/Query/Mysql/StdDev.php | 2 -- src/Query/Mysql/StrToDate.php | 2 -- src/Query/Mysql/SubstringIndex.php | 2 -- src/Query/Mysql/Tan.php | 2 -- src/Query/Mysql/Time.php | 2 -- src/Query/Mysql/TimeDiff.php | 2 -- src/Query/Mysql/TimeToSec.php | 2 -- src/Query/Mysql/TimestampAdd.php | 2 -- src/Query/Mysql/TimestampDiff.php | 2 -- src/Query/Mysql/Truncate.php | 2 -- src/Query/Mysql/Unhex.php | 2 -- src/Query/Mysql/UnixTimestamp.php | 2 -- src/Query/Mysql/UtcTimestamp.php | 2 -- src/Query/Mysql/UuidShort.php | 2 -- src/Query/Mysql/Variance.php | 2 -- src/Query/Mysql/Week.php | 2 -- src/Query/Mysql/WeekDay.php | 2 -- src/Query/Mysql/WeekOfYear.php | 2 -- src/Query/Mysql/Year.php | 2 -- src/Query/Mysql/YearMonth.php | 2 -- src/Query/Mysql/YearWeek.php | 2 -- src/Query/MysqlWalker.php | 2 -- src/Query/Oracle/Ceil.php | 2 -- src/Query/Oracle/Day.php | 2 -- src/Query/Oracle/Floor.php | 2 -- src/Query/Oracle/Hour.php | 2 -- src/Query/Oracle/Listagg.php | 2 -- src/Query/Oracle/Minute.php | 2 -- src/Query/Oracle/Month.php | 2 -- src/Query/Oracle/Nvl.php | 2 -- src/Query/Oracle/Second.php | 2 -- src/Query/Oracle/ToChar.php | 2 -- src/Query/Oracle/ToDate.php | 2 -- src/Query/Oracle/Trunc.php | 2 -- src/Query/Oracle/Year.php | 2 -- src/Query/Postgresql/AtTimeZoneFunction.php | 2 -- src/Query/Postgresql/CountFilterFunction.php | 2 -- src/Query/Postgresql/Date.php | 2 -- src/Query/Postgresql/DateFormat.php | 2 -- src/Query/Postgresql/DatePart.php | 2 -- src/Query/Postgresql/DateTrunc.php | 2 -- src/Query/Postgresql/Day.php | 2 -- src/Query/Postgresql/ExtractFunction.php | 2 -- src/Query/Postgresql/Greatest.php | 2 -- src/Query/Postgresql/Hour.php | 2 -- src/Query/Postgresql/Least.php | 2 -- src/Query/Postgresql/Minute.php | 2 -- src/Query/Postgresql/Month.php | 2 -- src/Query/Postgresql/RegexpReplace.php | 2 -- src/Query/Postgresql/Second.php | 2 -- src/Query/Postgresql/StrToDate.php | 2 -- src/Query/Postgresql/StringAgg.php | 2 -- src/Query/Postgresql/Year.php | 2 -- src/Query/SortableNullsWalker.php | 2 -- src/Query/Sqlite/AbstractStrfTime.php | 2 -- src/Query/Sqlite/ConcatWs.php | 2 -- src/Query/Sqlite/Date.php | 2 -- src/Query/Sqlite/DateFormat.php | 2 -- src/Query/Sqlite/Day.php | 2 -- src/Query/Sqlite/Greatest.php | 2 -- src/Query/Sqlite/Hour.php | 2 -- src/Query/Sqlite/IfElse.php | 2 -- src/Query/Sqlite/IfNull.php | 2 -- src/Query/Sqlite/JulianDay.php | 2 -- src/Query/Sqlite/Least.php | 2 -- src/Query/Sqlite/Minute.php | 2 -- src/Query/Sqlite/Month.php | 2 -- src/Query/Sqlite/NumberFromStrfTime.php | 2 -- src/Query/Sqlite/Random.php | 2 -- src/Query/Sqlite/Replace.php | 2 -- src/Query/Sqlite/Round.php | 2 -- src/Query/Sqlite/Second.php | 2 -- src/Query/Sqlite/StrfTime.php | 2 -- src/Query/Sqlite/Week.php | 2 -- src/Query/Sqlite/WeekDay.php | 2 -- src/Query/Sqlite/Year.php | 2 -- src/Types/CarbonDateTimeType.php | 2 -- src/Types/CarbonDateTimeTzType.php | 2 -- src/Types/CarbonDateType.php | 2 -- src/Types/CarbonImmutableDateTimeType.php | 2 -- src/Types/CarbonImmutableDateTimeTzType.php | 2 -- src/Types/CarbonImmutableDateType.php | 2 -- src/Types/CarbonImmutableTimeType.php | 2 -- src/Types/CarbonTimeType.php | 2 -- src/Types/PolygonType.php | 2 -- src/Types/ZendDateType.php | 2 -- tests/Config/MysqlYamlTest.php | 2 -- tests/Entities/Blank.php | 2 -- tests/Entities/BlogPost.php | 2 -- tests/Entities/CarbonDate.php | 2 -- tests/Entities/Date.php | 2 -- tests/Entities/Product.php | 2 -- tests/Entities/Set.php | 2 -- tests/Entities/ZendDate.php | 2 -- tests/Query/ConfigLoader.php | 2 -- tests/Query/DbTestCase.php | 2 -- tests/Query/Mysql/AcosTest.php | 2 -- tests/Query/Mysql/AddTimeTest.php | 2 -- tests/Query/Mysql/AsciiTest.php | 2 -- tests/Query/Mysql/AsinTest.php | 2 -- tests/Query/Mysql/Atan2Test.php | 2 -- tests/Query/Mysql/AtanTest.php | 2 -- tests/Query/Mysql/BinaryTest.php | 2 -- tests/Query/Mysql/BitCountTest.php | 2 -- tests/Query/Mysql/BitXorTest.php | 2 -- tests/Query/Mysql/CastTest.php | 2 -- tests/Query/Mysql/CeilTest.php | 2 -- tests/Query/Mysql/CharLengthTest.php | 2 -- tests/Query/Mysql/CollateTest.php | 2 -- tests/Query/Mysql/ConcatWsTest.php | 2 -- tests/Query/Mysql/ConvertTzTest.php | 2 -- tests/Query/Mysql/CosTest.php | 2 -- tests/Query/Mysql/CotTest.php | 2 -- tests/Query/Mysql/CountIfTest.php | 2 -- tests/Query/Mysql/Crc32Test.php | 2 -- tests/Query/Mysql/DateAddTest.php | 2 -- tests/Query/Mysql/DateDiffTest.php | 2 -- tests/Query/Mysql/DateFormatTest.php | 2 -- tests/Query/Mysql/DateSubTest.php | 2 -- tests/Query/Mysql/DateTest.php | 2 -- tests/Query/Mysql/DayNameTest.php | 2 -- tests/Query/Mysql/DayOfWeekTest.php | 2 -- tests/Query/Mysql/DayOfYearTest.php | 2 -- tests/Query/Mysql/DayTest.php | 2 -- tests/Query/Mysql/DegressTest.php | 2 -- tests/Query/Mysql/DivTest.php | 2 -- tests/Query/Mysql/ExpTest.php | 2 -- tests/Query/Mysql/FieldTest.php | 2 -- tests/Query/Mysql/FindInSetTest.php | 2 -- tests/Query/Mysql/FloorTest.php | 2 -- tests/Query/Mysql/FormatTest.php | 2 -- tests/Query/Mysql/FromBase64.php | 2 -- tests/Query/Mysql/FromUnixTimeTest.php | 2 -- tests/Query/Mysql/GreatestTest.php | 2 -- tests/Query/Mysql/GroupConcatTest.php | 2 -- tests/Query/Mysql/HexTest.php | 2 -- tests/Query/Mysql/HourTest.php | 2 -- tests/Query/Mysql/IfElseTest.php | 2 -- tests/Query/Mysql/IfNullTest.php | 2 -- tests/Query/Mysql/Inet6AtonTest.php | 2 -- tests/Query/Mysql/Inet6NtoaTest.php | 2 -- tests/Query/Mysql/InetAtonTest.php | 2 -- tests/Query/Mysql/InetNtoaTest.php | 2 -- tests/Query/Mysql/IsIpv4CompatTest.php | 2 -- tests/Query/Mysql/IsIpv4MappedTest.php | 2 -- tests/Query/Mysql/IsIpv4Test.php | 2 -- tests/Query/Mysql/IsIpv6Test.php | 2 -- tests/Query/Mysql/JsonContainsTest.php | 2 -- tests/Query/Mysql/JsonDepthTest.php | 2 -- tests/Query/Mysql/JsonLengthTest.php | 2 -- tests/Query/Mysql/LagTest.php | 2 -- tests/Query/Mysql/LastDayTest.php | 2 -- tests/Query/Mysql/LeadTest.php | 2 -- tests/Query/Mysql/LeastTest.php | 2 -- tests/Query/Mysql/Log10Test.php | 2 -- tests/Query/Mysql/Log2Test.php | 2 -- tests/Query/Mysql/LogTest.php | 2 -- tests/Query/Mysql/LpadTest.php | 2 -- tests/Query/Mysql/MakeDateTest.php | 2 -- tests/Query/Mysql/MatchAgainstTest.php | 2 -- tests/Query/Mysql/Md5Test.php | 2 -- tests/Query/Mysql/MinuteTest.php | 2 -- tests/Query/Mysql/MonthNameTest.php | 2 -- tests/Query/Mysql/MonthTest.php | 2 -- tests/Query/Mysql/NowTest.php | 2 -- tests/Query/Mysql/NullIfTest.php | 2 -- tests/Query/Mysql/PiTest.php | 2 -- tests/Query/Mysql/PowerTest.php | 2 -- tests/Query/Mysql/QuarterTest.php | 2 -- tests/Query/Mysql/RadiansTest.php | 2 -- tests/Query/Mysql/RandTest.php | 2 -- tests/Query/Mysql/RegexpTest.php | 2 -- tests/Query/Mysql/ReplaceTest.php | 2 -- tests/Query/Mysql/RoundTest.php | 2 -- tests/Query/Mysql/RpadTest.php | 2 -- tests/Query/Mysql/SecondTest.php | 2 -- tests/Query/Mysql/SetTest.php | 2 -- tests/Query/Mysql/Sha1Test.php | 2 -- tests/Query/Mysql/Sha2Test.php | 2 -- tests/Query/Mysql/SinTest.php | 2 -- tests/Query/Mysql/SoundexTest.php | 2 -- tests/Query/Mysql/StdDevTest.php | 2 -- tests/Query/Mysql/StdTest.php | 2 -- tests/Query/Mysql/StrToDateTest.php | 2 -- tests/Query/Mysql/StringTest.php | 2 -- tests/Query/Mysql/SubstringIndexTest.php | 2 -- tests/Query/Mysql/TanTest.php | 2 -- tests/Query/Mysql/TimeDiffTest.php | 2 -- tests/Query/Mysql/TimeTest.php | 2 -- tests/Query/Mysql/TimeToSecTest.php | 2 -- tests/Query/Mysql/TimestampAddTest.php | 2 -- tests/Query/Mysql/TimestampDiffTest.php | 2 -- tests/Query/Mysql/TrigTest.php | 2 -- tests/Query/Mysql/UnhexTest.php | 2 -- tests/Query/Mysql/UnixTimestampTest.php | 2 -- tests/Query/Mysql/UtcTimestampTest.php | 2 -- tests/Query/Mysql/UuidShortTest.php | 2 -- tests/Query/Mysql/VarianceTest.php | 2 -- tests/Query/Mysql/WeekDayTest.php | 2 -- tests/Query/Mysql/WeekOfYearTest.php | 2 -- tests/Query/Mysql/WeekTest.php | 2 -- tests/Query/Mysql/YearTest.php | 2 -- tests/Query/Mysql/YearWeekTest.php | 2 -- tests/Query/MysqlTestCase.php | 2 -- tests/Query/MysqlWalkerTest.php | 2 -- tests/Query/Oracle/CeilTest.php | 2 -- tests/Query/Oracle/DayTest.php | 2 -- tests/Query/Oracle/FloorTest.php | 2 -- tests/Query/Oracle/HourTest.php | 2 -- tests/Query/Oracle/ListaggTest.php | 2 -- tests/Query/Oracle/MinuteTest.php | 2 -- tests/Query/Oracle/MonthTest.php | 2 -- tests/Query/Oracle/SecondTest.php | 2 -- tests/Query/Oracle/ToCharTest.php | 2 -- tests/Query/Oracle/TruncTest.php | 2 -- tests/Query/Oracle/YearTest.php | 2 -- tests/Query/OracleTestCase.php | 2 -- tests/Query/Postgresql/AtTimeZoneTest.php | 2 -- tests/Query/Postgresql/CountFilterTest.php | 2 -- tests/Query/Postgresql/DatePartTest.php | 2 -- tests/Query/Postgresql/DateTest.php | 2 -- tests/Query/Postgresql/DateTruncTest.php | 2 -- tests/Query/Postgresql/DayTest.php | 2 -- tests/Query/Postgresql/ExtractFunctionTest.php | 2 -- tests/Query/Postgresql/GreatestTest.php | 2 -- tests/Query/Postgresql/HourTest.php | 2 -- tests/Query/Postgresql/LeastTest.php | 2 -- tests/Query/Postgresql/MinuteTest.php | 2 -- tests/Query/Postgresql/MonthTest.php | 2 -- tests/Query/Postgresql/RegexpReplaceTest.php | 2 -- tests/Query/Postgresql/SecondTest.php | 2 -- tests/Query/Postgresql/StringAggTest.php | 2 -- tests/Query/Postgresql/StringTest.php | 2 -- tests/Query/Postgresql/YearTest.php | 2 -- tests/Query/PostgresqlTestCase.php | 2 -- tests/Query/Sqlite/ConcatWsTest.php | 2 -- tests/Query/Sqlite/DateFormatTest.php | 2 -- tests/Query/Sqlite/DayTest.php | 2 -- tests/Query/Sqlite/GreatestTest.php | 2 -- tests/Query/Sqlite/HourTest.php | 2 -- tests/Query/Sqlite/IfElseTest.php | 2 -- tests/Query/Sqlite/JulianDayTest.php | 2 -- tests/Query/Sqlite/LeastTest.php | 2 -- tests/Query/Sqlite/MinuteTest.php | 2 -- tests/Query/Sqlite/MonthTest.php | 2 -- tests/Query/Sqlite/NumericFunctionsTest.php | 2 -- tests/Query/Sqlite/RandomTest.php | 2 -- tests/Query/Sqlite/SecondTest.php | 2 -- tests/Query/Sqlite/StrfTimeTest.php | 2 -- tests/Query/Sqlite/StringFunctionsTest.php | 2 -- tests/Query/Sqlite/WeekDayTest.php | 2 -- tests/Query/Sqlite/WeekTest.php | 2 -- tests/Query/Sqlite/YearTest.php | 2 -- tests/Query/SqliteTestCase.php | 2 -- tests/Types/CarbonDateTest.php | 2 -- tests/Types/ZendDateTest.php | 2 -- 349 files changed, 698 deletions(-) diff --git a/src/Query/Mysql/Acos.php b/src/Query/Mysql/Acos.php index 73e41072..46a5b795 100644 --- a/src/Query/Mysql/Acos.php +++ b/src/Query/Mysql/Acos.php @@ -1,7 +1,5 @@ Date: Sun, 28 Jan 2024 08:58:03 +0100 Subject: [PATCH 41/43] Revert "Code Sniffer: apply rule SlevomatCodingStandard.Commenting.ForbiddenAnnotations.AnnotationForbidden" --- src/Query/Mysql/AddTime.php | 3 +++ src/Query/Mysql/Binary.php | 3 +++ src/Query/Mysql/CharLength.php | 3 +++ src/Query/Mysql/Collate.php | 5 ++++- src/Query/Mysql/ConcatWs.php | 3 +++ src/Query/Mysql/CountIf.php | 3 +++ src/Query/Mysql/Crc32.php | 3 +++ src/Query/Mysql/Date.php | 3 +++ src/Query/Mysql/DateFormat.php | 3 +++ src/Query/Mysql/DateSub.php | 3 +++ src/Query/Mysql/Day.php | 4 ++++ src/Query/Mysql/DayName.php | 3 +++ src/Query/Mysql/Extract.php | 3 +++ src/Query/Mysql/Field.php | 3 +++ src/Query/Mysql/Format.php | 3 +++ src/Query/Mysql/FromUnixtime.php | 3 +++ src/Query/Mysql/Greatest.php | 4 ++++ src/Query/Mysql/Hour.php | 3 +++ src/Query/Mysql/IfElse.php | 3 +++ src/Query/Mysql/IfNull.php | 3 +++ src/Query/Mysql/LastDay.php | 4 ++++ src/Query/Mysql/Least.php | 3 +++ src/Query/Mysql/Lpad.php | 3 +++ src/Query/Mysql/Md5.php | 3 +++ src/Query/Mysql/Minute.php | 3 +++ src/Query/Mysql/Month.php | 4 ++++ src/Query/Mysql/MonthName.php | 3 +++ src/Query/Mysql/NullIf.php | 3 +++ src/Query/Mysql/Quarter.php | 3 +++ src/Query/Mysql/Replace.php | 3 +++ src/Query/Mysql/Rpad.php | 3 +++ src/Query/Mysql/SecToTime.php | 1 + src/Query/Mysql/Second.php | 3 +++ src/Query/Mysql/Sha1.php | 3 +++ src/Query/Mysql/Sha2.php | 3 +++ src/Query/Mysql/Soundex.php | 3 +++ src/Query/Mysql/Std.php | 3 +++ src/Query/Mysql/StdDev.php | 3 +++ src/Query/Mysql/Time.php | 4 ++++ src/Query/Mysql/TimeToSec.php | 1 + src/Query/Mysql/TimestampAdd.php | 3 +++ src/Query/Mysql/TimestampDiff.php | 3 +++ src/Query/Mysql/Truncate.php | 3 +++ src/Query/Mysql/UnixTimestamp.php | 4 ++++ src/Query/Mysql/UtcTimestamp.php | 3 +++ src/Query/Mysql/Week.php | 5 +++++ src/Query/Mysql/WeekDay.php | 3 +++ src/Query/Mysql/Year.php | 3 +++ src/Query/Mysql/YearWeek.php | 3 +++ src/Query/Oracle/Ceil.php | 3 +++ src/Query/Oracle/Day.php | 3 +++ src/Query/Oracle/Floor.php | 3 +++ src/Query/Oracle/Hour.php | 3 +++ src/Query/Oracle/Listagg.php | 3 +++ src/Query/Oracle/Minute.php | 3 +++ src/Query/Oracle/Month.php | 3 +++ src/Query/Oracle/Nvl.php | 3 +++ src/Query/Oracle/Second.php | 3 +++ src/Query/Oracle/ToChar.php | 3 +++ src/Query/Oracle/ToDate.php | 3 +++ src/Query/Oracle/Trunc.php | 3 +++ src/Query/Oracle/Year.php | 3 +++ src/Query/Postgresql/DateFormat.php | 3 +++ src/Query/Postgresql/DatePart.php | 3 +++ src/Query/Postgresql/Greatest.php | 5 +++++ src/Query/Postgresql/Least.php | 4 ++++ src/Query/Postgresql/StringAgg.php | 4 ++++ src/Query/Sqlite/AbstractStrfTime.php | 3 +++ src/Query/Sqlite/ConcatWs.php | 3 +++ src/Query/Sqlite/Date.php | 3 +++ src/Query/Sqlite/DateFormat.php | 2 ++ src/Query/Sqlite/Day.php | 3 +++ src/Query/Sqlite/Greatest.php | 4 ++++ src/Query/Sqlite/Hour.php | 3 +++ src/Query/Sqlite/IfElse.php | 3 +++ src/Query/Sqlite/IfNull.php | 3 +++ src/Query/Sqlite/JulianDay.php | 3 +++ src/Query/Sqlite/Least.php | 3 +++ src/Query/Sqlite/Minute.php | 3 +++ src/Query/Sqlite/Month.php | 3 +++ src/Query/Sqlite/Replace.php | 3 +++ src/Query/Sqlite/Round.php | 3 +++ src/Query/Sqlite/StrfTime.php | 3 +++ src/Query/Sqlite/Week.php | 3 +++ src/Query/Sqlite/WeekDay.php | 3 +++ src/Query/Sqlite/Year.php | 3 +++ src/Types/ZendDateType.php | 2 ++ tests/Query/Oracle/CeilTest.php | 3 +++ tests/Query/Oracle/FloorTest.php | 3 +++ tests/Query/Oracle/ListaggTest.php | 3 +++ tests/Query/Oracle/ToCharTest.php | 3 +++ tests/Query/Oracle/TruncTest.php | 3 +++ tests/Query/Sqlite/NumericFunctionsTest.php | 2 ++ tests/Query/Sqlite/StringFunctionsTest.php | 1 + tests/Types/CarbonDateTest.php | 2 ++ tests/Types/ZendDateTest.php | 2 ++ 96 files changed, 291 insertions(+), 1 deletion(-) diff --git a/src/Query/Mysql/AddTime.php b/src/Query/Mysql/AddTime.php index 1ab88d7d..3356cbca 100644 --- a/src/Query/Mysql/AddTime.php +++ b/src/Query/Mysql/AddTime.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Pascal Wacker + */ class AddTime extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Binary.php b/src/Query/Mysql/Binary.php index f224ca50..dfd52822 100644 --- a/src/Query/Mysql/Binary.php +++ b/src/Query/Mysql/Binary.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Sarjono Mukti Aji + */ class Binary extends FunctionNode { private $stringPrimary; diff --git a/src/Query/Mysql/CharLength.php b/src/Query/Mysql/CharLength.php index f0ab82e8..fb320811 100644 --- a/src/Query/Mysql/CharLength.php +++ b/src/Query/Mysql/CharLength.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Metod + */ class CharLength extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Collate.php b/src/Query/Mysql/Collate.php index e1581039..ba730dba 100644 --- a/src/Query/Mysql/Collate.php +++ b/src/Query/Mysql/Collate.php @@ -9,7 +9,10 @@ use function sprintf; -/** @link https://dev.mysql.com/doc/refman/en/charset-collate.html */ +/** + * @link https://dev.mysql.com/doc/refman/en/charset-collate.html + * @author Peter Tanath + */ class Collate extends FunctionNode { /** @var null */ diff --git a/src/Query/Mysql/ConcatWs.php b/src/Query/Mysql/ConcatWs.php index 0ca54710..12d61008 100644 --- a/src/Query/Mysql/ConcatWs.php +++ b/src/Query/Mysql/ConcatWs.php @@ -12,6 +12,9 @@ use function sprintf; use function strtolower; +/** + * @author Andrew Mackrodt + */ class ConcatWs extends FunctionNode { private $values = []; diff --git a/src/Query/Mysql/CountIf.php b/src/Query/Mysql/CountIf.php index daa616d3..fc3dd472 100644 --- a/src/Query/Mysql/CountIf.php +++ b/src/Query/Mysql/CountIf.php @@ -10,6 +10,9 @@ use function sprintf; use function strtolower; +/** + * @author Andrew Mackrodt + */ class CountIf extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Crc32.php b/src/Query/Mysql/Crc32.php index cb6342d1..b7cf9506 100644 --- a/src/Query/Mysql/Crc32.php +++ b/src/Query/Mysql/Crc32.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Igor Timoshenko + */ class Crc32 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Date.php b/src/Query/Mysql/Date.php index 750e5d3d..e650b29e 100644 --- a/src/Query/Mysql/Date.php +++ b/src/Query/Mysql/Date.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Steve Lacey + */ class Date extends FunctionNode { public $date; diff --git a/src/Query/Mysql/DateFormat.php b/src/Query/Mysql/DateFormat.php index 10d5b11d..acc36068 100644 --- a/src/Query/Mysql/DateFormat.php +++ b/src/Query/Mysql/DateFormat.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Steve Lacey + */ class DateFormat extends FunctionNode { public $dateExpression = null; diff --git a/src/Query/Mysql/DateSub.php b/src/Query/Mysql/DateSub.php index e6c48351..0cbfe39d 100644 --- a/src/Query/Mysql/DateSub.php +++ b/src/Query/Mysql/DateSub.php @@ -9,6 +9,9 @@ use function is_string; use function strtoupper; +/** + * @author Vas N + */ class DateSub extends DateAdd { /** @throws QueryException */ diff --git a/src/Query/Mysql/Day.php b/src/Query/Mysql/Day.php index 8500caa4..237f4c46 100644 --- a/src/Query/Mysql/Day.php +++ b/src/Query/Mysql/Day.php @@ -7,6 +7,10 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Rafael Kassner + * @author Sarjono Mukti Aji + */ class Day extends FunctionNode { public $date; diff --git a/src/Query/Mysql/DayName.php b/src/Query/Mysql/DayName.php index c9b446c0..542b2cb2 100644 --- a/src/Query/Mysql/DayName.php +++ b/src/Query/Mysql/DayName.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Steve Lacey + */ class DayName extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Extract.php b/src/Query/Mysql/Extract.php index a916b5e8..070d0890 100644 --- a/src/Query/Mysql/Extract.php +++ b/src/Query/Mysql/Extract.php @@ -10,6 +10,9 @@ use function in_array; use function strtoupper; +/** + * @author Ahwalian Masykur + */ class Extract extends DateAdd { public $date = null; diff --git a/src/Query/Mysql/Field.php b/src/Query/Mysql/Field.php index ac99afd8..a90fb499 100644 --- a/src/Query/Mysql/Field.php +++ b/src/Query/Mysql/Field.php @@ -9,6 +9,9 @@ use function count; +/** + * @author Jeremy Hicks + */ class Field extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/Format.php b/src/Query/Mysql/Format.php index 59d0429e..cd4843c9 100644 --- a/src/Query/Mysql/Format.php +++ b/src/Query/Mysql/Format.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Wally Noveno + */ class Format extends FunctionNode { public $numberExpression = null; diff --git a/src/Query/Mysql/FromUnixtime.php b/src/Query/Mysql/FromUnixtime.php index 4f6f6205..f150cee0 100644 --- a/src/Query/Mysql/FromUnixtime.php +++ b/src/Query/Mysql/FromUnixtime.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Nima S + */ class FromUnixtime extends FunctionNode { public $firstExpression = null; diff --git a/src/Query/Mysql/Greatest.php b/src/Query/Mysql/Greatest.php index de8c9620..97c4e450 100644 --- a/src/Query/Mysql/Greatest.php +++ b/src/Query/Mysql/Greatest.php @@ -9,6 +9,10 @@ use function count; +/** + * @author Vas N + * @author Guven Atbakan + */ class Greatest extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/Hour.php b/src/Query/Mysql/Hour.php index 3789de94..6fd990ed 100644 --- a/src/Query/Mysql/Hour.php +++ b/src/Query/Mysql/Hour.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Dawid Nowak + */ class Hour extends FunctionNode { public $date; diff --git a/src/Query/Mysql/IfElse.php b/src/Query/Mysql/IfElse.php index 4d5de30d..f20b6dc4 100644 --- a/src/Query/Mysql/IfElse.php +++ b/src/Query/Mysql/IfElse.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Andrew Mackrodt + */ class IfElse extends FunctionNode { private $expr = []; diff --git a/src/Query/Mysql/IfNull.php b/src/Query/Mysql/IfNull.php index 4b3b8639..55b4a4e9 100644 --- a/src/Query/Mysql/IfNull.php +++ b/src/Query/Mysql/IfNull.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Andrew Mackrodt + */ class IfNull extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/LastDay.php b/src/Query/Mysql/LastDay.php index 164738f0..c62c7a38 100644 --- a/src/Query/Mysql/LastDay.php +++ b/src/Query/Mysql/LastDay.php @@ -7,6 +7,10 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Rafael Kassner + * @author Sarjono Mukti Aji + */ class LastDay extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Least.php b/src/Query/Mysql/Least.php index 867c62a1..e8626dcb 100644 --- a/src/Query/Mysql/Least.php +++ b/src/Query/Mysql/Least.php @@ -9,6 +9,9 @@ use function count; +/** + * @author Vas N + */ class Least extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/Lpad.php b/src/Query/Mysql/Lpad.php index 3b734578..46eb256a 100644 --- a/src/Query/Mysql/Lpad.php +++ b/src/Query/Mysql/Lpad.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Giulia Santoiemma + */ class Lpad extends FunctionNode { public $string = null; diff --git a/src/Query/Mysql/Md5.php b/src/Query/Mysql/Md5.php index ff3663c7..a43b4ee1 100644 --- a/src/Query/Mysql/Md5.php +++ b/src/Query/Mysql/Md5.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Andreas Gallien + */ class Md5 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Minute.php b/src/Query/Mysql/Minute.php index c31027e7..a21dec0f 100644 --- a/src/Query/Mysql/Minute.php +++ b/src/Query/Mysql/Minute.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Martin Štekl + */ class Minute extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Month.php b/src/Query/Mysql/Month.php index da87b645..eac0d3a6 100644 --- a/src/Query/Mysql/Month.php +++ b/src/Query/Mysql/Month.php @@ -7,6 +7,10 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Rafael Kassner + * @author Sarjono Mukti Aji + */ class Month extends FunctionNode { public $date; diff --git a/src/Query/Mysql/MonthName.php b/src/Query/Mysql/MonthName.php index b99a4694..4ca32b2e 100644 --- a/src/Query/Mysql/MonthName.php +++ b/src/Query/Mysql/MonthName.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Steve Lacey + */ class MonthName extends FunctionNode { public $date; diff --git a/src/Query/Mysql/NullIf.php b/src/Query/Mysql/NullIf.php index 6ff581be..2a9191c5 100644 --- a/src/Query/Mysql/NullIf.php +++ b/src/Query/Mysql/NullIf.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Andrew Mackrodt + */ class NullIf extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Quarter.php b/src/Query/Mysql/Quarter.php index fa9dee33..85417b4d 100644 --- a/src/Query/Mysql/Quarter.php +++ b/src/Query/Mysql/Quarter.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Martin Štekl + */ class Quarter extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Replace.php b/src/Query/Mysql/Replace.php index 45b8cf4a..fd7607d2 100644 --- a/src/Query/Mysql/Replace.php +++ b/src/Query/Mysql/Replace.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Jarek Kostrz + */ class Replace extends FunctionNode { public $search = null; diff --git a/src/Query/Mysql/Rpad.php b/src/Query/Mysql/Rpad.php index 0925b7db..816f617a 100644 --- a/src/Query/Mysql/Rpad.php +++ b/src/Query/Mysql/Rpad.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Giulia Santoiemma + */ class Rpad extends FunctionNode { public $string = null; diff --git a/src/Query/Mysql/SecToTime.php b/src/Query/Mysql/SecToTime.php index 19e43d75..7a4e4c8c 100644 --- a/src/Query/Mysql/SecToTime.php +++ b/src/Query/Mysql/SecToTime.php @@ -11,6 +11,7 @@ * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_sec-to-time * * @example SELECT SEC_TO_TIME(2378); + * @author Clemens Bastian */ class SecToTime extends FunctionNode { diff --git a/src/Query/Mysql/Second.php b/src/Query/Mysql/Second.php index 2559d701..81f4aff4 100644 --- a/src/Query/Mysql/Second.php +++ b/src/Query/Mysql/Second.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Martin Štekl + */ class Second extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Sha1.php b/src/Query/Mysql/Sha1.php index 1c67852f..c166863f 100644 --- a/src/Query/Mysql/Sha1.php +++ b/src/Query/Mysql/Sha1.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Andreas Gallien + */ class Sha1 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Sha2.php b/src/Query/Mysql/Sha2.php index e828a35f..0a0a3196 100644 --- a/src/Query/Mysql/Sha2.php +++ b/src/Query/Mysql/Sha2.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Andreas Gallien + */ class Sha2 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Soundex.php b/src/Query/Mysql/Soundex.php index a541aba8..76227c6c 100644 --- a/src/Query/Mysql/Soundex.php +++ b/src/Query/Mysql/Soundex.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Steve Tauber + */ class Soundex extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Std.php b/src/Query/Mysql/Std.php index 1853d9de..c693d881 100644 --- a/src/Query/Mysql/Std.php +++ b/src/Query/Mysql/Std.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Toni Uebernickel + */ class Std extends FunctionNode { public $arithmeticExpression; diff --git a/src/Query/Mysql/StdDev.php b/src/Query/Mysql/StdDev.php index 7efccb15..e3613020 100644 --- a/src/Query/Mysql/StdDev.php +++ b/src/Query/Mysql/StdDev.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Joachim Schirrmacher + */ class StdDev extends FunctionNode { public $arithmeticExpression; diff --git a/src/Query/Mysql/Time.php b/src/Query/Mysql/Time.php index 7010612e..76753db5 100644 --- a/src/Query/Mysql/Time.php +++ b/src/Query/Mysql/Time.php @@ -7,6 +7,10 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Steve Lacey + * @author James Rohacik + */ class Time extends FunctionNode { public $time; diff --git a/src/Query/Mysql/TimeToSec.php b/src/Query/Mysql/TimeToSec.php index b158a13d..70af6ecf 100644 --- a/src/Query/Mysql/TimeToSec.php +++ b/src/Query/Mysql/TimeToSec.php @@ -11,6 +11,7 @@ * @link https://dev.mysql.com/doc/refman/en/date-and-time-functions.html#function_time-to-sec * * @example SELECT TIME_TO_SEC('22:23:00'); + * @author Pawel Stasicki */ class TimeToSec extends FunctionNode { diff --git a/src/Query/Mysql/TimestampAdd.php b/src/Query/Mysql/TimestampAdd.php index 72a97a14..cd9e2801 100644 --- a/src/Query/Mysql/TimestampAdd.php +++ b/src/Query/Mysql/TimestampAdd.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Alessandro Tagliapietra + */ class TimestampAdd extends FunctionNode { public $firstDatetimeExpression = null; diff --git a/src/Query/Mysql/TimestampDiff.php b/src/Query/Mysql/TimestampDiff.php index f736910d..efd376a9 100644 --- a/src/Query/Mysql/TimestampDiff.php +++ b/src/Query/Mysql/TimestampDiff.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Przemek Sobstel + */ class TimestampDiff extends FunctionNode { public $firstDatetimeExpression = null; diff --git a/src/Query/Mysql/Truncate.php b/src/Query/Mysql/Truncate.php index 4d0651cf..21e84120 100644 --- a/src/Query/Mysql/Truncate.php +++ b/src/Query/Mysql/Truncate.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Evgeny Savich + */ class Truncate extends FunctionNode { public $numberExpression = null; diff --git a/src/Query/Mysql/UnixTimestamp.php b/src/Query/Mysql/UnixTimestamp.php index 38f54776..16b23a84 100644 --- a/src/Query/Mysql/UnixTimestamp.php +++ b/src/Query/Mysql/UnixTimestamp.php @@ -9,6 +9,10 @@ use function sprintf; +/** + * @author Rafael Kassner + * @author Oleg Khussainov + */ class UnixTimestamp extends FunctionNode { public $date; diff --git a/src/Query/Mysql/UtcTimestamp.php b/src/Query/Mysql/UtcTimestamp.php index 502d83d2..e7d85a1a 100644 --- a/src/Query/Mysql/UtcTimestamp.php +++ b/src/Query/Mysql/UtcTimestamp.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Marius Krämer + */ class UtcTimestamp extends FunctionNode { public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Query/Mysql/Week.php b/src/Query/Mysql/Week.php index 5d2341fa..e34eeb2a 100644 --- a/src/Query/Mysql/Week.php +++ b/src/Query/Mysql/Week.php @@ -7,6 +7,11 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Rafael Kassner + * @author Sarjono Mukti Aji + * @author Łukasz Nowicki + */ class Week extends FunctionNode { public $date; diff --git a/src/Query/Mysql/WeekDay.php b/src/Query/Mysql/WeekDay.php index db47c45d..97e02db8 100644 --- a/src/Query/Mysql/WeekDay.php +++ b/src/Query/Mysql/WeekDay.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Pavlo Cherniavskyi + */ class WeekDay extends FunctionNode { private $date; diff --git a/src/Query/Mysql/Year.php b/src/Query/Mysql/Year.php index 2fb30f32..ce4907a5 100644 --- a/src/Query/Mysql/Year.php +++ b/src/Query/Mysql/Year.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Rafael Kassner + */ class Year extends FunctionNode { public $date; diff --git a/src/Query/Mysql/YearWeek.php b/src/Query/Mysql/YearWeek.php index c64324c7..2a41fe7f 100644 --- a/src/Query/Mysql/YearWeek.php +++ b/src/Query/Mysql/YearWeek.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Michael Kimpton + */ class YearWeek extends FunctionNode { public $date; diff --git a/src/Query/Oracle/Ceil.php b/src/Query/Oracle/Ceil.php index 4df4c2a9..716019b0 100755 --- a/src/Query/Oracle/Ceil.php +++ b/src/Query/Oracle/Ceil.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Jefferson Vantuir + */ class Ceil extends FunctionNode { private $number; diff --git a/src/Query/Oracle/Day.php b/src/Query/Oracle/Day.php index fa38da79..fb14ac0f 100644 --- a/src/Query/Oracle/Day.php +++ b/src/Query/Oracle/Day.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Andréia Bohner + */ class Day extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Floor.php b/src/Query/Oracle/Floor.php index beac1468..9783a2dc 100755 --- a/src/Query/Oracle/Floor.php +++ b/src/Query/Oracle/Floor.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Jefferson Vantuir + */ class Floor extends FunctionNode { private $number; diff --git a/src/Query/Oracle/Hour.php b/src/Query/Oracle/Hour.php index a4433a79..3a3e5b6d 100644 --- a/src/Query/Oracle/Hour.php +++ b/src/Query/Oracle/Hour.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Andréia Bohner + */ class Hour extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Listagg.php b/src/Query/Oracle/Listagg.php index 41a5b0c9..2fd17ee7 100644 --- a/src/Query/Oracle/Listagg.php +++ b/src/Query/Oracle/Listagg.php @@ -13,6 +13,9 @@ use function implode; use function strtolower; +/** + * @author Alexey Kalinin + */ class Listagg extends FunctionNode { /** @var Node */ diff --git a/src/Query/Oracle/Minute.php b/src/Query/Oracle/Minute.php index ce32cef1..a87691d6 100644 --- a/src/Query/Oracle/Minute.php +++ b/src/Query/Oracle/Minute.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Andréia Bohner + */ class Minute extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Month.php b/src/Query/Oracle/Month.php index 801033c8..76d30716 100644 --- a/src/Query/Oracle/Month.php +++ b/src/Query/Oracle/Month.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Andréia Bohner + */ class Month extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Nvl.php b/src/Query/Oracle/Nvl.php index 8481ee3e..97b4ec04 100644 --- a/src/Query/Oracle/Nvl.php +++ b/src/Query/Oracle/Nvl.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Andréia Bohner + */ class Nvl extends FunctionNode { private $expr1; diff --git a/src/Query/Oracle/Second.php b/src/Query/Oracle/Second.php index 08ebf46e..0c9bb208 100644 --- a/src/Query/Oracle/Second.php +++ b/src/Query/Oracle/Second.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Andréia Bohner + */ class Second extends FunctionNode { private $date; diff --git a/src/Query/Oracle/ToChar.php b/src/Query/Oracle/ToChar.php index 29b4a4f7..d4171c53 100755 --- a/src/Query/Oracle/ToChar.php +++ b/src/Query/Oracle/ToChar.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Cédric Bertolini + */ class ToChar extends FunctionNode { private $datetime; diff --git a/src/Query/Oracle/ToDate.php b/src/Query/Oracle/ToDate.php index a1b86adc..ebba7213 100644 --- a/src/Query/Oracle/ToDate.php +++ b/src/Query/Oracle/ToDate.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Mohammad ZeinEddin + */ class ToDate extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Trunc.php b/src/Query/Oracle/Trunc.php index 2f7a8180..d79492a8 100755 --- a/src/Query/Oracle/Trunc.php +++ b/src/Query/Oracle/Trunc.php @@ -10,6 +10,9 @@ use function sprintf; +/** + * @author Mohammad ZeinEddin + */ class Trunc extends FunctionNode { /** @var Node */ diff --git a/src/Query/Oracle/Year.php b/src/Query/Oracle/Year.php index 2625b0b6..7e04a49d 100644 --- a/src/Query/Oracle/Year.php +++ b/src/Query/Oracle/Year.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Andréia Bohner + */ class Year extends FunctionNode { private $date; diff --git a/src/Query/Postgresql/DateFormat.php b/src/Query/Postgresql/DateFormat.php index 8b000403..2afa9bbc 100644 --- a/src/Query/Postgresql/DateFormat.php +++ b/src/Query/Postgresql/DateFormat.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Silvio + */ class DateFormat extends FunctionNode { public $dateExpression = null; diff --git a/src/Query/Postgresql/DatePart.php b/src/Query/Postgresql/DatePart.php index 70ec1a03..faba0a80 100644 --- a/src/Query/Postgresql/DatePart.php +++ b/src/Query/Postgresql/DatePart.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Geovani Roggeo + */ class DatePart extends FunctionNode { public $dateString = null; diff --git a/src/Query/Postgresql/Greatest.php b/src/Query/Postgresql/Greatest.php index c245871a..f3d5950b 100644 --- a/src/Query/Postgresql/Greatest.php +++ b/src/Query/Postgresql/Greatest.php @@ -9,6 +9,11 @@ use function count; +/** + * @author Vas N + * @author Guven Atbakan + * @author Leonardo B Motyczka + */ class Greatest extends FunctionNode { private $field = null; diff --git a/src/Query/Postgresql/Least.php b/src/Query/Postgresql/Least.php index 9046630d..6190452e 100644 --- a/src/Query/Postgresql/Least.php +++ b/src/Query/Postgresql/Least.php @@ -9,6 +9,10 @@ use function count; +/** + * @author Vas N + * @author Leonardo B Motyczka + */ class Least extends FunctionNode { private $field = null; diff --git a/src/Query/Postgresql/StringAgg.php b/src/Query/Postgresql/StringAgg.php index 49915439..73d34d6d 100644 --- a/src/Query/Postgresql/StringAgg.php +++ b/src/Query/Postgresql/StringAgg.php @@ -10,6 +10,10 @@ use function sprintf; +/** + * @author Roberto Júnior + * @author Vaskevich Eugeniy + */ class StringAgg extends FunctionNode { private $orderBy = null; diff --git a/src/Query/Sqlite/AbstractStrfTime.php b/src/Query/Sqlite/AbstractStrfTime.php index cb2a3bbd..2a5e59c4 100644 --- a/src/Query/Sqlite/AbstractStrfTime.php +++ b/src/Query/Sqlite/AbstractStrfTime.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Tarjei Huse + */ abstract class AbstractStrfTime extends FunctionNode { public $date; diff --git a/src/Query/Sqlite/ConcatWs.php b/src/Query/Sqlite/ConcatWs.php index 53d000ef..915e763d 100644 --- a/src/Query/Sqlite/ConcatWs.php +++ b/src/Query/Sqlite/ConcatWs.php @@ -12,6 +12,9 @@ use function sprintf; use function strtolower; +/** + * @author Bas de Ruiter + */ class ConcatWs extends FunctionNode { private $values = []; diff --git a/src/Query/Sqlite/Date.php b/src/Query/Sqlite/Date.php index be56beaf..f6173545 100644 --- a/src/Query/Sqlite/Date.php +++ b/src/Query/Sqlite/Date.php @@ -2,6 +2,9 @@ namespace DoctrineExtensions\Query\Sqlite; +/** + * @author Tarjei Huse + */ class Date extends AbstractStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/DateFormat.php b/src/Query/Sqlite/DateFormat.php index db9e6ada..b700c823 100644 --- a/src/Query/Sqlite/DateFormat.php +++ b/src/Query/Sqlite/DateFormat.php @@ -13,6 +13,8 @@ /** * This class fakes a DATE_FORMAT method for SQLite, so that we can use sqlite as drop-in replacement * database in our tests. + * + * @author Bas de Ruiter */ class DateFormat extends FunctionNode { diff --git a/src/Query/Sqlite/Day.php b/src/Query/Sqlite/Day.php index 91b71572..0c316829 100644 --- a/src/Query/Sqlite/Day.php +++ b/src/Query/Sqlite/Day.php @@ -2,6 +2,9 @@ namespace DoctrineExtensions\Query\Sqlite; +/** + * @author Tarjei Huse + */ class Day extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Greatest.php b/src/Query/Sqlite/Greatest.php index 7a8fe588..7d820203 100644 --- a/src/Query/Sqlite/Greatest.php +++ b/src/Query/Sqlite/Greatest.php @@ -9,6 +9,10 @@ use function count; +/** + * @author Vas N + * @author Guven Atbakan + */ class Greatest extends FunctionNode { private $field = null; diff --git a/src/Query/Sqlite/Hour.php b/src/Query/Sqlite/Hour.php index 34c5207a..230d07e1 100644 --- a/src/Query/Sqlite/Hour.php +++ b/src/Query/Sqlite/Hour.php @@ -2,6 +2,9 @@ namespace DoctrineExtensions\Query\Sqlite; +/** + * @author Tarjei Huse + */ class Hour extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/IfElse.php b/src/Query/Sqlite/IfElse.php index 877b0429..6904f41d 100644 --- a/src/Query/Sqlite/IfElse.php +++ b/src/Query/Sqlite/IfElse.php @@ -9,6 +9,9 @@ use function sprintf; +/** + * @author Mikhail Bubnov + */ class IfElse extends FunctionNode { private $expr = []; diff --git a/src/Query/Sqlite/IfNull.php b/src/Query/Sqlite/IfNull.php index 4c10c8a5..ea612fd0 100644 --- a/src/Query/Sqlite/IfNull.php +++ b/src/Query/Sqlite/IfNull.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author winkbrace + */ class IfNull extends FunctionNode { private $expr1; diff --git a/src/Query/Sqlite/JulianDay.php b/src/Query/Sqlite/JulianDay.php index 032bbce0..4341b732 100644 --- a/src/Query/Sqlite/JulianDay.php +++ b/src/Query/Sqlite/JulianDay.php @@ -2,6 +2,9 @@ namespace DoctrineExtensions\Query\Sqlite; +/** + * @author Einar Gangsø + */ class JulianDay extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Least.php b/src/Query/Sqlite/Least.php index 9e178721..96a4922f 100644 --- a/src/Query/Sqlite/Least.php +++ b/src/Query/Sqlite/Least.php @@ -9,6 +9,9 @@ use function count; +/** + * @author Vas N + */ class Least extends FunctionNode { private $field = null; diff --git a/src/Query/Sqlite/Minute.php b/src/Query/Sqlite/Minute.php index dd579c11..c787b743 100644 --- a/src/Query/Sqlite/Minute.php +++ b/src/Query/Sqlite/Minute.php @@ -2,6 +2,9 @@ namespace DoctrineExtensions\Query\Sqlite; +/** + * @author Tarjei Huse + */ class Minute extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Month.php b/src/Query/Sqlite/Month.php index 2bf5def3..49dfcbb7 100644 --- a/src/Query/Sqlite/Month.php +++ b/src/Query/Sqlite/Month.php @@ -2,6 +2,9 @@ namespace DoctrineExtensions\Query\Sqlite; +/** + * @author Tarjei Huse + */ class Month extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Replace.php b/src/Query/Sqlite/Replace.php index f19dc3c7..f3a64295 100644 --- a/src/Query/Sqlite/Replace.php +++ b/src/Query/Sqlite/Replace.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author winkbrace + */ class Replace extends FunctionNode { public $search = null; diff --git a/src/Query/Sqlite/Round.php b/src/Query/Sqlite/Round.php index 54546da7..eadcf2b6 100644 --- a/src/Query/Sqlite/Round.php +++ b/src/Query/Sqlite/Round.php @@ -7,6 +7,9 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; +/** + * @author winkbrace + */ class Round extends FunctionNode { private $firstExpression = null; diff --git a/src/Query/Sqlite/StrfTime.php b/src/Query/Sqlite/StrfTime.php index edd6eec9..2e06a58b 100644 --- a/src/Query/Sqlite/StrfTime.php +++ b/src/Query/Sqlite/StrfTime.php @@ -8,6 +8,9 @@ use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; +/** + * @author Tarjei Huse + */ class StrfTime extends FunctionNode { public $date; diff --git a/src/Query/Sqlite/Week.php b/src/Query/Sqlite/Week.php index 25078b9c..ba8d7fe2 100644 --- a/src/Query/Sqlite/Week.php +++ b/src/Query/Sqlite/Week.php @@ -5,6 +5,9 @@ use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; +/** + * @author Aleksandr Klimenkov + */ class Week extends NumberFromStrfTime { /** diff --git a/src/Query/Sqlite/WeekDay.php b/src/Query/Sqlite/WeekDay.php index 001c9e9b..99635afd 100644 --- a/src/Query/Sqlite/WeekDay.php +++ b/src/Query/Sqlite/WeekDay.php @@ -2,6 +2,9 @@ namespace DoctrineExtensions\Query\Sqlite; +/** + * @author Tarjei Huse + */ class WeekDay extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Year.php b/src/Query/Sqlite/Year.php index 7b33d81a..1cd4ae5c 100644 --- a/src/Query/Sqlite/Year.php +++ b/src/Query/Sqlite/Year.php @@ -2,6 +2,9 @@ namespace DoctrineExtensions\Query\Sqlite; +/** + * @author Tarjei Huse + */ class Year extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Types/ZendDateType.php b/src/Types/ZendDateType.php index 6fb20fde..4a1e4cef 100755 --- a/src/Types/ZendDateType.php +++ b/src/Types/ZendDateType.php @@ -16,6 +16,8 @@ /** * Type that maps an SQL DATETIME/TIMESTAMP to a Zend_Date object. + * + * @author Andreas Gallien */ class ZendDateType extends Type { diff --git a/tests/Query/Oracle/CeilTest.php b/tests/Query/Oracle/CeilTest.php index 04a852e2..444bf45d 100644 --- a/tests/Query/Oracle/CeilTest.php +++ b/tests/Query/Oracle/CeilTest.php @@ -6,6 +6,9 @@ use DoctrineExtensions\Tests\Entities\Product; use DoctrineExtensions\Tests\Query\OracleTestCase; +/** + * @author Jefferson Vantuir + */ class CeilTest extends OracleTestCase { public function testFullQuery(): void diff --git a/tests/Query/Oracle/FloorTest.php b/tests/Query/Oracle/FloorTest.php index e6ce2968..93f7f10f 100644 --- a/tests/Query/Oracle/FloorTest.php +++ b/tests/Query/Oracle/FloorTest.php @@ -6,6 +6,9 @@ use DoctrineExtensions\Tests\Entities\Product; use DoctrineExtensions\Tests\Query\OracleTestCase; +/** + * @author Jefferson Vantuir + */ class FloorTest extends OracleTestCase { public function testFullQuery(): void diff --git a/tests/Query/Oracle/ListaggTest.php b/tests/Query/Oracle/ListaggTest.php index 18820327..c3cdc942 100644 --- a/tests/Query/Oracle/ListaggTest.php +++ b/tests/Query/Oracle/ListaggTest.php @@ -4,6 +4,9 @@ use DoctrineExtensions\Tests\Query\OracleTestCase; +/** + * @author Alexey Kalinin + */ class ListaggTest extends OracleTestCase { public function testFullQuery(): void diff --git a/tests/Query/Oracle/ToCharTest.php b/tests/Query/Oracle/ToCharTest.php index c41cb6ed..0f6f47a7 100644 --- a/tests/Query/Oracle/ToCharTest.php +++ b/tests/Query/Oracle/ToCharTest.php @@ -6,6 +6,9 @@ use DoctrineExtensions\Tests\Entities\Date; use DoctrineExtensions\Tests\Query\OracleTestCase; +/** + * @author Jefferson Vantuir + */ class ToCharTest extends OracleTestCase { public function testFullQuery(): void diff --git a/tests/Query/Oracle/TruncTest.php b/tests/Query/Oracle/TruncTest.php index 0ed379f9..fa1f01b0 100755 --- a/tests/Query/Oracle/TruncTest.php +++ b/tests/Query/Oracle/TruncTest.php @@ -4,6 +4,9 @@ use DoctrineExtensions\Tests\Query\OracleTestCase; +/** + * @author Alexey Kalinin + */ class TruncTest extends OracleTestCase { public function testFullQuery(): void diff --git a/tests/Query/Sqlite/NumericFunctionsTest.php b/tests/Query/Sqlite/NumericFunctionsTest.php index d6ddbbb4..78e63dd8 100644 --- a/tests/Query/Sqlite/NumericFunctionsTest.php +++ b/tests/Query/Sqlite/NumericFunctionsTest.php @@ -6,6 +6,8 @@ /** * This class is responsible for testing the SQLite numeric functions + * + * @author winkbrace */ class NumericFunctionsTest extends SqliteTestCase { diff --git a/tests/Query/Sqlite/StringFunctionsTest.php b/tests/Query/Sqlite/StringFunctionsTest.php index 3356bc7f..2d13513b 100644 --- a/tests/Query/Sqlite/StringFunctionsTest.php +++ b/tests/Query/Sqlite/StringFunctionsTest.php @@ -6,6 +6,7 @@ /** * This class is responsible for testing the Sqlite string functions + * @author winkbrace */ class StringFunctionsTest extends SqliteTestCase { diff --git a/tests/Types/CarbonDateTest.php b/tests/Types/CarbonDateTest.php index 250b769d..996fa8b8 100755 --- a/tests/Types/CarbonDateTest.php +++ b/tests/Types/CarbonDateTest.php @@ -17,6 +17,8 @@ /** * Test type that maps an SQL DATETIME/TIMESTAMP to a Carbon/Carbon object. + * + * @author Steve Lacey */ class CarbonDateTest extends TestCase { diff --git a/tests/Types/ZendDateTest.php b/tests/Types/ZendDateTest.php index 2a7ef34f..b5107fc7 100755 --- a/tests/Types/ZendDateTest.php +++ b/tests/Types/ZendDateTest.php @@ -16,6 +16,8 @@ /** * Test type that maps an SQL DATETIME/TIMESTAMP to a Zend_Date object. + * + * @author Andreas Gallien */ class ZendDateTest extends TestCase { From ea294bf23cd5ad670948a251db0045fcf677b52d Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 11:18:27 +0100 Subject: [PATCH 42/43] add two exluded rules: forbidden annotation and strict types --- phpcs.xml.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index eed8af93..560e2b53 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -23,5 +23,7 @@ + + From 8cb11a5fbd17c06c61d27ca08219cdb80d2a72d4 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Sun, 28 Jan 2024 11:19:41 +0100 Subject: [PATCH 43/43] convert phpdoc to one-liner --- src/Query/Mysql/AddTime.php | 4 +--- src/Query/Mysql/Binary.php | 4 +--- src/Query/Mysql/CharLength.php | 4 +--- src/Query/Mysql/Collate.php | 1 + src/Query/Mysql/ConcatWs.php | 4 +--- src/Query/Mysql/CountIf.php | 4 +--- src/Query/Mysql/Crc32.php | 4 +--- src/Query/Mysql/Date.php | 4 +--- src/Query/Mysql/DateFormat.php | 4 +--- src/Query/Mysql/DateSub.php | 4 +--- src/Query/Mysql/DayName.php | 4 +--- src/Query/Mysql/Extract.php | 4 +--- src/Query/Mysql/Field.php | 4 +--- src/Query/Mysql/Format.php | 4 +--- src/Query/Mysql/FromUnixtime.php | 4 +--- src/Query/Mysql/Hour.php | 4 +--- src/Query/Mysql/IfElse.php | 4 +--- src/Query/Mysql/IfNull.php | 4 +--- src/Query/Mysql/Least.php | 4 +--- src/Query/Mysql/Lpad.php | 4 +--- src/Query/Mysql/Md5.php | 4 +--- src/Query/Mysql/Minute.php | 4 +--- src/Query/Mysql/MonthName.php | 4 +--- src/Query/Mysql/NullIf.php | 4 +--- src/Query/Mysql/Quarter.php | 4 +--- src/Query/Mysql/Replace.php | 4 +--- src/Query/Mysql/Rpad.php | 4 +--- src/Query/Mysql/Second.php | 4 +--- src/Query/Mysql/Sha1.php | 4 +--- src/Query/Mysql/Sha2.php | 4 +--- src/Query/Mysql/Soundex.php | 4 +--- src/Query/Mysql/Std.php | 4 +--- src/Query/Mysql/StdDev.php | 4 +--- src/Query/Mysql/TimestampAdd.php | 4 +--- src/Query/Mysql/TimestampDiff.php | 4 +--- src/Query/Mysql/Truncate.php | 4 +--- src/Query/Mysql/UtcTimestamp.php | 4 +--- src/Query/Mysql/WeekDay.php | 4 +--- src/Query/Mysql/Year.php | 4 +--- src/Query/Mysql/YearWeek.php | 4 +--- src/Query/Oracle/Ceil.php | 4 +--- src/Query/Oracle/Day.php | 4 +--- src/Query/Oracle/Floor.php | 4 +--- src/Query/Oracle/Hour.php | 4 +--- src/Query/Oracle/Listagg.php | 4 +--- src/Query/Oracle/Minute.php | 4 +--- src/Query/Oracle/Month.php | 4 +--- src/Query/Oracle/Nvl.php | 4 +--- src/Query/Oracle/Second.php | 4 +--- src/Query/Oracle/ToChar.php | 4 +--- src/Query/Oracle/ToDate.php | 4 +--- src/Query/Oracle/Trunc.php | 4 +--- src/Query/Oracle/Year.php | 4 +--- src/Query/Postgresql/DateFormat.php | 4 +--- src/Query/Postgresql/DatePart.php | 4 +--- src/Query/Sqlite/AbstractStrfTime.php | 4 +--- src/Query/Sqlite/ConcatWs.php | 4 +--- src/Query/Sqlite/Date.php | 4 +--- src/Query/Sqlite/Day.php | 4 +--- src/Query/Sqlite/Hour.php | 4 +--- src/Query/Sqlite/IfElse.php | 4 +--- src/Query/Sqlite/IfNull.php | 4 +--- src/Query/Sqlite/JulianDay.php | 4 +--- src/Query/Sqlite/Least.php | 4 +--- src/Query/Sqlite/Minute.php | 4 +--- src/Query/Sqlite/Month.php | 4 +--- src/Query/Sqlite/Replace.php | 4 +--- src/Query/Sqlite/Round.php | 4 +--- src/Query/Sqlite/StrfTime.php | 4 +--- src/Query/Sqlite/Week.php | 4 +--- src/Query/Sqlite/WeekDay.php | 4 +--- src/Query/Sqlite/Year.php | 4 +--- tests/Query/Oracle/CeilTest.php | 4 +--- tests/Query/Oracle/FloorTest.php | 4 +--- tests/Query/Oracle/ListaggTest.php | 4 +--- tests/Query/Oracle/ToCharTest.php | 4 +--- tests/Query/Oracle/TruncTest.php | 4 +--- tests/Query/Sqlite/StringFunctionsTest.php | 1 + 78 files changed, 78 insertions(+), 228 deletions(-) diff --git a/src/Query/Mysql/AddTime.php b/src/Query/Mysql/AddTime.php index 3356cbca..37d9a037 100644 --- a/src/Query/Mysql/AddTime.php +++ b/src/Query/Mysql/AddTime.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Pascal Wacker - */ +/** @author Pascal Wacker */ class AddTime extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Binary.php b/src/Query/Mysql/Binary.php index dfd52822..8d9db224 100644 --- a/src/Query/Mysql/Binary.php +++ b/src/Query/Mysql/Binary.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Sarjono Mukti Aji - */ +/** @author Sarjono Mukti Aji */ class Binary extends FunctionNode { private $stringPrimary; diff --git a/src/Query/Mysql/CharLength.php b/src/Query/Mysql/CharLength.php index fb320811..58a755f4 100644 --- a/src/Query/Mysql/CharLength.php +++ b/src/Query/Mysql/CharLength.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Metod - */ +/** @author Metod */ class CharLength extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Collate.php b/src/Query/Mysql/Collate.php index ba730dba..88d4f841 100644 --- a/src/Query/Mysql/Collate.php +++ b/src/Query/Mysql/Collate.php @@ -11,6 +11,7 @@ /** * @link https://dev.mysql.com/doc/refman/en/charset-collate.html + * * @author Peter Tanath */ class Collate extends FunctionNode diff --git a/src/Query/Mysql/ConcatWs.php b/src/Query/Mysql/ConcatWs.php index 12d61008..fb86097a 100644 --- a/src/Query/Mysql/ConcatWs.php +++ b/src/Query/Mysql/ConcatWs.php @@ -12,9 +12,7 @@ use function sprintf; use function strtolower; -/** - * @author Andrew Mackrodt - */ +/** @author Andrew Mackrodt */ class ConcatWs extends FunctionNode { private $values = []; diff --git a/src/Query/Mysql/CountIf.php b/src/Query/Mysql/CountIf.php index fc3dd472..88475e36 100644 --- a/src/Query/Mysql/CountIf.php +++ b/src/Query/Mysql/CountIf.php @@ -10,9 +10,7 @@ use function sprintf; use function strtolower; -/** - * @author Andrew Mackrodt - */ +/** @author Andrew Mackrodt */ class CountIf extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Crc32.php b/src/Query/Mysql/Crc32.php index b7cf9506..23b42002 100644 --- a/src/Query/Mysql/Crc32.php +++ b/src/Query/Mysql/Crc32.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Igor Timoshenko - */ +/** @author Igor Timoshenko */ class Crc32 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Date.php b/src/Query/Mysql/Date.php index e650b29e..4ad78ffb 100644 --- a/src/Query/Mysql/Date.php +++ b/src/Query/Mysql/Date.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Lacey - */ +/** @author Steve Lacey */ class Date extends FunctionNode { public $date; diff --git a/src/Query/Mysql/DateFormat.php b/src/Query/Mysql/DateFormat.php index acc36068..951f7d09 100644 --- a/src/Query/Mysql/DateFormat.php +++ b/src/Query/Mysql/DateFormat.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Lacey - */ +/** @author Steve Lacey */ class DateFormat extends FunctionNode { public $dateExpression = null; diff --git a/src/Query/Mysql/DateSub.php b/src/Query/Mysql/DateSub.php index 0cbfe39d..795e10c4 100644 --- a/src/Query/Mysql/DateSub.php +++ b/src/Query/Mysql/DateSub.php @@ -9,9 +9,7 @@ use function is_string; use function strtoupper; -/** - * @author Vas N - */ +/** @author Vas N */ class DateSub extends DateAdd { /** @throws QueryException */ diff --git a/src/Query/Mysql/DayName.php b/src/Query/Mysql/DayName.php index 542b2cb2..e7958a3d 100644 --- a/src/Query/Mysql/DayName.php +++ b/src/Query/Mysql/DayName.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Lacey - */ +/** @author Steve Lacey */ class DayName extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Extract.php b/src/Query/Mysql/Extract.php index 070d0890..ff6af97a 100644 --- a/src/Query/Mysql/Extract.php +++ b/src/Query/Mysql/Extract.php @@ -10,9 +10,7 @@ use function in_array; use function strtoupper; -/** - * @author Ahwalian Masykur - */ +/** @author Ahwalian Masykur */ class Extract extends DateAdd { public $date = null; diff --git a/src/Query/Mysql/Field.php b/src/Query/Mysql/Field.php index a90fb499..849ca9ac 100644 --- a/src/Query/Mysql/Field.php +++ b/src/Query/Mysql/Field.php @@ -9,9 +9,7 @@ use function count; -/** - * @author Jeremy Hicks - */ +/** @author Jeremy Hicks */ class Field extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/Format.php b/src/Query/Mysql/Format.php index cd4843c9..f42f48ad 100644 --- a/src/Query/Mysql/Format.php +++ b/src/Query/Mysql/Format.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Wally Noveno - */ +/** @author Wally Noveno */ class Format extends FunctionNode { public $numberExpression = null; diff --git a/src/Query/Mysql/FromUnixtime.php b/src/Query/Mysql/FromUnixtime.php index f150cee0..be8fda18 100644 --- a/src/Query/Mysql/FromUnixtime.php +++ b/src/Query/Mysql/FromUnixtime.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Nima S - */ +/** @author Nima S */ class FromUnixtime extends FunctionNode { public $firstExpression = null; diff --git a/src/Query/Mysql/Hour.php b/src/Query/Mysql/Hour.php index 6fd990ed..e7f23595 100644 --- a/src/Query/Mysql/Hour.php +++ b/src/Query/Mysql/Hour.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Dawid Nowak - */ +/** @author Dawid Nowak */ class Hour extends FunctionNode { public $date; diff --git a/src/Query/Mysql/IfElse.php b/src/Query/Mysql/IfElse.php index f20b6dc4..aa17e75b 100644 --- a/src/Query/Mysql/IfElse.php +++ b/src/Query/Mysql/IfElse.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Andrew Mackrodt - */ +/** @author Andrew Mackrodt */ class IfElse extends FunctionNode { private $expr = []; diff --git a/src/Query/Mysql/IfNull.php b/src/Query/Mysql/IfNull.php index 55b4a4e9..a563222e 100644 --- a/src/Query/Mysql/IfNull.php +++ b/src/Query/Mysql/IfNull.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andrew Mackrodt - */ +/** @author Andrew Mackrodt */ class IfNull extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Least.php b/src/Query/Mysql/Least.php index e8626dcb..4547a9b5 100644 --- a/src/Query/Mysql/Least.php +++ b/src/Query/Mysql/Least.php @@ -9,9 +9,7 @@ use function count; -/** - * @author Vas N - */ +/** @author Vas N */ class Least extends FunctionNode { private $field = null; diff --git a/src/Query/Mysql/Lpad.php b/src/Query/Mysql/Lpad.php index 46eb256a..ffc47eb1 100644 --- a/src/Query/Mysql/Lpad.php +++ b/src/Query/Mysql/Lpad.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Giulia Santoiemma - */ +/** @author Giulia Santoiemma */ class Lpad extends FunctionNode { public $string = null; diff --git a/src/Query/Mysql/Md5.php b/src/Query/Mysql/Md5.php index a43b4ee1..3ebcd663 100644 --- a/src/Query/Mysql/Md5.php +++ b/src/Query/Mysql/Md5.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andreas Gallien - */ +/** @author Andreas Gallien */ class Md5 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Minute.php b/src/Query/Mysql/Minute.php index a21dec0f..28a3118f 100644 --- a/src/Query/Mysql/Minute.php +++ b/src/Query/Mysql/Minute.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Martin Štekl - */ +/** @author Martin Štekl */ class Minute extends FunctionNode { public $date; diff --git a/src/Query/Mysql/MonthName.php b/src/Query/Mysql/MonthName.php index 4ca32b2e..d369b969 100644 --- a/src/Query/Mysql/MonthName.php +++ b/src/Query/Mysql/MonthName.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Lacey - */ +/** @author Steve Lacey */ class MonthName extends FunctionNode { public $date; diff --git a/src/Query/Mysql/NullIf.php b/src/Query/Mysql/NullIf.php index 2a9191c5..330213c9 100644 --- a/src/Query/Mysql/NullIf.php +++ b/src/Query/Mysql/NullIf.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Andrew Mackrodt - */ +/** @author Andrew Mackrodt */ class NullIf extends FunctionNode { private $expr1; diff --git a/src/Query/Mysql/Quarter.php b/src/Query/Mysql/Quarter.php index 85417b4d..9a5b8875 100644 --- a/src/Query/Mysql/Quarter.php +++ b/src/Query/Mysql/Quarter.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Martin Štekl - */ +/** @author Martin Štekl */ class Quarter extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Replace.php b/src/Query/Mysql/Replace.php index fd7607d2..33321c9c 100644 --- a/src/Query/Mysql/Replace.php +++ b/src/Query/Mysql/Replace.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Jarek Kostrz - */ +/** @author Jarek Kostrz */ class Replace extends FunctionNode { public $search = null; diff --git a/src/Query/Mysql/Rpad.php b/src/Query/Mysql/Rpad.php index 816f617a..4b94f097 100644 --- a/src/Query/Mysql/Rpad.php +++ b/src/Query/Mysql/Rpad.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Giulia Santoiemma - */ +/** @author Giulia Santoiemma */ class Rpad extends FunctionNode { public $string = null; diff --git a/src/Query/Mysql/Second.php b/src/Query/Mysql/Second.php index 81f4aff4..98b225a5 100644 --- a/src/Query/Mysql/Second.php +++ b/src/Query/Mysql/Second.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Martin Štekl - */ +/** @author Martin Štekl */ class Second extends FunctionNode { public $date; diff --git a/src/Query/Mysql/Sha1.php b/src/Query/Mysql/Sha1.php index c166863f..9948b755 100644 --- a/src/Query/Mysql/Sha1.php +++ b/src/Query/Mysql/Sha1.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andreas Gallien - */ +/** @author Andreas Gallien */ class Sha1 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Sha2.php b/src/Query/Mysql/Sha2.php index 0a0a3196..a512f8bd 100644 --- a/src/Query/Mysql/Sha2.php +++ b/src/Query/Mysql/Sha2.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Andreas Gallien - */ +/** @author Andreas Gallien */ class Sha2 extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Soundex.php b/src/Query/Mysql/Soundex.php index 76227c6c..ec37adc9 100644 --- a/src/Query/Mysql/Soundex.php +++ b/src/Query/Mysql/Soundex.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Steve Tauber - */ +/** @author Steve Tauber */ class Soundex extends FunctionNode { public $stringPrimary; diff --git a/src/Query/Mysql/Std.php b/src/Query/Mysql/Std.php index c693d881..a7825053 100644 --- a/src/Query/Mysql/Std.php +++ b/src/Query/Mysql/Std.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Toni Uebernickel - */ +/** @author Toni Uebernickel */ class Std extends FunctionNode { public $arithmeticExpression; diff --git a/src/Query/Mysql/StdDev.php b/src/Query/Mysql/StdDev.php index e3613020..e5429df7 100644 --- a/src/Query/Mysql/StdDev.php +++ b/src/Query/Mysql/StdDev.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Joachim Schirrmacher - */ +/** @author Joachim Schirrmacher */ class StdDev extends FunctionNode { public $arithmeticExpression; diff --git a/src/Query/Mysql/TimestampAdd.php b/src/Query/Mysql/TimestampAdd.php index cd9e2801..97062048 100644 --- a/src/Query/Mysql/TimestampAdd.php +++ b/src/Query/Mysql/TimestampAdd.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Alessandro Tagliapietra - */ +/** @author Alessandro Tagliapietra */ class TimestampAdd extends FunctionNode { public $firstDatetimeExpression = null; diff --git a/src/Query/Mysql/TimestampDiff.php b/src/Query/Mysql/TimestampDiff.php index efd376a9..49697f69 100644 --- a/src/Query/Mysql/TimestampDiff.php +++ b/src/Query/Mysql/TimestampDiff.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Przemek Sobstel - */ +/** @author Przemek Sobstel */ class TimestampDiff extends FunctionNode { public $firstDatetimeExpression = null; diff --git a/src/Query/Mysql/Truncate.php b/src/Query/Mysql/Truncate.php index 21e84120..487f7a35 100644 --- a/src/Query/Mysql/Truncate.php +++ b/src/Query/Mysql/Truncate.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Evgeny Savich - */ +/** @author Evgeny Savich */ class Truncate extends FunctionNode { public $numberExpression = null; diff --git a/src/Query/Mysql/UtcTimestamp.php b/src/Query/Mysql/UtcTimestamp.php index e7d85a1a..096918eb 100644 --- a/src/Query/Mysql/UtcTimestamp.php +++ b/src/Query/Mysql/UtcTimestamp.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Marius Krämer - */ +/** @author Marius Krämer */ class UtcTimestamp extends FunctionNode { public function getSql(SqlWalker $sqlWalker): string diff --git a/src/Query/Mysql/WeekDay.php b/src/Query/Mysql/WeekDay.php index 97e02db8..e16e7dba 100644 --- a/src/Query/Mysql/WeekDay.php +++ b/src/Query/Mysql/WeekDay.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Pavlo Cherniavskyi - */ +/** @author Pavlo Cherniavskyi */ class WeekDay extends FunctionNode { private $date; diff --git a/src/Query/Mysql/Year.php b/src/Query/Mysql/Year.php index ce4907a5..2464743d 100644 --- a/src/Query/Mysql/Year.php +++ b/src/Query/Mysql/Year.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Rafael Kassner - */ +/** @author Rafael Kassner */ class Year extends FunctionNode { public $date; diff --git a/src/Query/Mysql/YearWeek.php b/src/Query/Mysql/YearWeek.php index 2a41fe7f..04f2e136 100644 --- a/src/Query/Mysql/YearWeek.php +++ b/src/Query/Mysql/YearWeek.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Michael Kimpton - */ +/** @author Michael Kimpton */ class YearWeek extends FunctionNode { public $date; diff --git a/src/Query/Oracle/Ceil.php b/src/Query/Oracle/Ceil.php index 716019b0..5af8c3b2 100755 --- a/src/Query/Oracle/Ceil.php +++ b/src/Query/Oracle/Ceil.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Jefferson Vantuir - */ +/** @author Jefferson Vantuir */ class Ceil extends FunctionNode { private $number; diff --git a/src/Query/Oracle/Day.php b/src/Query/Oracle/Day.php index fb14ac0f..9fa2e6c2 100644 --- a/src/Query/Oracle/Day.php +++ b/src/Query/Oracle/Day.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Andréia Bohner - */ +/** @author Andréia Bohner */ class Day extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Floor.php b/src/Query/Oracle/Floor.php index 9783a2dc..ddfe1ba5 100755 --- a/src/Query/Oracle/Floor.php +++ b/src/Query/Oracle/Floor.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Jefferson Vantuir - */ +/** @author Jefferson Vantuir */ class Floor extends FunctionNode { private $number; diff --git a/src/Query/Oracle/Hour.php b/src/Query/Oracle/Hour.php index 3a3e5b6d..f308cd38 100644 --- a/src/Query/Oracle/Hour.php +++ b/src/Query/Oracle/Hour.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Andréia Bohner - */ +/** @author Andréia Bohner */ class Hour extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Listagg.php b/src/Query/Oracle/Listagg.php index 2fd17ee7..562849fb 100644 --- a/src/Query/Oracle/Listagg.php +++ b/src/Query/Oracle/Listagg.php @@ -13,9 +13,7 @@ use function implode; use function strtolower; -/** - * @author Alexey Kalinin - */ +/** @author Alexey Kalinin */ class Listagg extends FunctionNode { /** @var Node */ diff --git a/src/Query/Oracle/Minute.php b/src/Query/Oracle/Minute.php index a87691d6..4af5a515 100644 --- a/src/Query/Oracle/Minute.php +++ b/src/Query/Oracle/Minute.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Andréia Bohner - */ +/** @author Andréia Bohner */ class Minute extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Month.php b/src/Query/Oracle/Month.php index 76d30716..f0752111 100644 --- a/src/Query/Oracle/Month.php +++ b/src/Query/Oracle/Month.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Andréia Bohner - */ +/** @author Andréia Bohner */ class Month extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Nvl.php b/src/Query/Oracle/Nvl.php index 97b4ec04..967d0c9b 100644 --- a/src/Query/Oracle/Nvl.php +++ b/src/Query/Oracle/Nvl.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Andréia Bohner - */ +/** @author Andréia Bohner */ class Nvl extends FunctionNode { private $expr1; diff --git a/src/Query/Oracle/Second.php b/src/Query/Oracle/Second.php index 0c9bb208..49e629df 100644 --- a/src/Query/Oracle/Second.php +++ b/src/Query/Oracle/Second.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Andréia Bohner - */ +/** @author Andréia Bohner */ class Second extends FunctionNode { private $date; diff --git a/src/Query/Oracle/ToChar.php b/src/Query/Oracle/ToChar.php index d4171c53..d9963f74 100755 --- a/src/Query/Oracle/ToChar.php +++ b/src/Query/Oracle/ToChar.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Cédric Bertolini - */ +/** @author Cédric Bertolini */ class ToChar extends FunctionNode { private $datetime; diff --git a/src/Query/Oracle/ToDate.php b/src/Query/Oracle/ToDate.php index ebba7213..f5782f4e 100644 --- a/src/Query/Oracle/ToDate.php +++ b/src/Query/Oracle/ToDate.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Mohammad ZeinEddin - */ +/** @author Mohammad ZeinEddin */ class ToDate extends FunctionNode { private $date; diff --git a/src/Query/Oracle/Trunc.php b/src/Query/Oracle/Trunc.php index d79492a8..a32aa689 100755 --- a/src/Query/Oracle/Trunc.php +++ b/src/Query/Oracle/Trunc.php @@ -10,9 +10,7 @@ use function sprintf; -/** - * @author Mohammad ZeinEddin - */ +/** @author Mohammad ZeinEddin */ class Trunc extends FunctionNode { /** @var Node */ diff --git a/src/Query/Oracle/Year.php b/src/Query/Oracle/Year.php index 7e04a49d..2a54076f 100644 --- a/src/Query/Oracle/Year.php +++ b/src/Query/Oracle/Year.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Andréia Bohner - */ +/** @author Andréia Bohner */ class Year extends FunctionNode { private $date; diff --git a/src/Query/Postgresql/DateFormat.php b/src/Query/Postgresql/DateFormat.php index 2afa9bbc..59031420 100644 --- a/src/Query/Postgresql/DateFormat.php +++ b/src/Query/Postgresql/DateFormat.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Silvio - */ +/** @author Silvio */ class DateFormat extends FunctionNode { public $dateExpression = null; diff --git a/src/Query/Postgresql/DatePart.php b/src/Query/Postgresql/DatePart.php index faba0a80..f162aa6e 100644 --- a/src/Query/Postgresql/DatePart.php +++ b/src/Query/Postgresql/DatePart.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Geovani Roggeo - */ +/** @author Geovani Roggeo */ class DatePart extends FunctionNode { public $dateString = null; diff --git a/src/Query/Sqlite/AbstractStrfTime.php b/src/Query/Sqlite/AbstractStrfTime.php index 2a5e59c4..c8ce727d 100644 --- a/src/Query/Sqlite/AbstractStrfTime.php +++ b/src/Query/Sqlite/AbstractStrfTime.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Tarjei Huse - */ +/** @author Tarjei Huse */ abstract class AbstractStrfTime extends FunctionNode { public $date; diff --git a/src/Query/Sqlite/ConcatWs.php b/src/Query/Sqlite/ConcatWs.php index 915e763d..62b474ac 100644 --- a/src/Query/Sqlite/ConcatWs.php +++ b/src/Query/Sqlite/ConcatWs.php @@ -12,9 +12,7 @@ use function sprintf; use function strtolower; -/** - * @author Bas de Ruiter - */ +/** @author Bas de Ruiter */ class ConcatWs extends FunctionNode { private $values = []; diff --git a/src/Query/Sqlite/Date.php b/src/Query/Sqlite/Date.php index f6173545..f1efdfa8 100644 --- a/src/Query/Sqlite/Date.php +++ b/src/Query/Sqlite/Date.php @@ -2,9 +2,7 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ +/** @author Tarjei Huse */ class Date extends AbstractStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Day.php b/src/Query/Sqlite/Day.php index 0c316829..61942c57 100644 --- a/src/Query/Sqlite/Day.php +++ b/src/Query/Sqlite/Day.php @@ -2,9 +2,7 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ +/** @author Tarjei Huse */ class Day extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Hour.php b/src/Query/Sqlite/Hour.php index 230d07e1..60893137 100644 --- a/src/Query/Sqlite/Hour.php +++ b/src/Query/Sqlite/Hour.php @@ -2,9 +2,7 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ +/** @author Tarjei Huse */ class Hour extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/IfElse.php b/src/Query/Sqlite/IfElse.php index 6904f41d..f57fe325 100644 --- a/src/Query/Sqlite/IfElse.php +++ b/src/Query/Sqlite/IfElse.php @@ -9,9 +9,7 @@ use function sprintf; -/** - * @author Mikhail Bubnov - */ +/** @author Mikhail Bubnov */ class IfElse extends FunctionNode { private $expr = []; diff --git a/src/Query/Sqlite/IfNull.php b/src/Query/Sqlite/IfNull.php index ea612fd0..11cb6eb9 100644 --- a/src/Query/Sqlite/IfNull.php +++ b/src/Query/Sqlite/IfNull.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author winkbrace - */ +/** @author winkbrace */ class IfNull extends FunctionNode { private $expr1; diff --git a/src/Query/Sqlite/JulianDay.php b/src/Query/Sqlite/JulianDay.php index 4341b732..3d50ee5f 100644 --- a/src/Query/Sqlite/JulianDay.php +++ b/src/Query/Sqlite/JulianDay.php @@ -2,9 +2,7 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Einar Gangsø - */ +/** @author Einar Gangsø */ class JulianDay extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Least.php b/src/Query/Sqlite/Least.php index 96a4922f..0ce11c0e 100644 --- a/src/Query/Sqlite/Least.php +++ b/src/Query/Sqlite/Least.php @@ -9,9 +9,7 @@ use function count; -/** - * @author Vas N - */ +/** @author Vas N */ class Least extends FunctionNode { private $field = null; diff --git a/src/Query/Sqlite/Minute.php b/src/Query/Sqlite/Minute.php index c787b743..d6686a1c 100644 --- a/src/Query/Sqlite/Minute.php +++ b/src/Query/Sqlite/Minute.php @@ -2,9 +2,7 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ +/** @author Tarjei Huse */ class Minute extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Month.php b/src/Query/Sqlite/Month.php index 49dfcbb7..7cecd9eb 100644 --- a/src/Query/Sqlite/Month.php +++ b/src/Query/Sqlite/Month.php @@ -2,9 +2,7 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ +/** @author Tarjei Huse */ class Month extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Replace.php b/src/Query/Sqlite/Replace.php index f3a64295..cbbfd36d 100644 --- a/src/Query/Sqlite/Replace.php +++ b/src/Query/Sqlite/Replace.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author winkbrace - */ +/** @author winkbrace */ class Replace extends FunctionNode { public $search = null; diff --git a/src/Query/Sqlite/Round.php b/src/Query/Sqlite/Round.php index eadcf2b6..658ff4fa 100644 --- a/src/Query/Sqlite/Round.php +++ b/src/Query/Sqlite/Round.php @@ -7,9 +7,7 @@ use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; -/** - * @author winkbrace - */ +/** @author winkbrace */ class Round extends FunctionNode { private $firstExpression = null; diff --git a/src/Query/Sqlite/StrfTime.php b/src/Query/Sqlite/StrfTime.php index 2e06a58b..280bb32a 100644 --- a/src/Query/Sqlite/StrfTime.php +++ b/src/Query/Sqlite/StrfTime.php @@ -8,9 +8,7 @@ use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\Query\SqlWalker; -/** - * @author Tarjei Huse - */ +/** @author Tarjei Huse */ class StrfTime extends FunctionNode { public $date; diff --git a/src/Query/Sqlite/Week.php b/src/Query/Sqlite/Week.php index ba8d7fe2..5d48a2bb 100644 --- a/src/Query/Sqlite/Week.php +++ b/src/Query/Sqlite/Week.php @@ -5,9 +5,7 @@ use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; -/** - * @author Aleksandr Klimenkov - */ +/** @author Aleksandr Klimenkov */ class Week extends NumberFromStrfTime { /** diff --git a/src/Query/Sqlite/WeekDay.php b/src/Query/Sqlite/WeekDay.php index 99635afd..fe860885 100644 --- a/src/Query/Sqlite/WeekDay.php +++ b/src/Query/Sqlite/WeekDay.php @@ -2,9 +2,7 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ +/** @author Tarjei Huse */ class WeekDay extends NumberFromStrfTime { protected function getFormat(): string diff --git a/src/Query/Sqlite/Year.php b/src/Query/Sqlite/Year.php index 1cd4ae5c..8807ab4c 100644 --- a/src/Query/Sqlite/Year.php +++ b/src/Query/Sqlite/Year.php @@ -2,9 +2,7 @@ namespace DoctrineExtensions\Query\Sqlite; -/** - * @author Tarjei Huse - */ +/** @author Tarjei Huse */ class Year extends NumberFromStrfTime { protected function getFormat(): string diff --git a/tests/Query/Oracle/CeilTest.php b/tests/Query/Oracle/CeilTest.php index 444bf45d..c9661158 100644 --- a/tests/Query/Oracle/CeilTest.php +++ b/tests/Query/Oracle/CeilTest.php @@ -6,9 +6,7 @@ use DoctrineExtensions\Tests\Entities\Product; use DoctrineExtensions\Tests\Query\OracleTestCase; -/** - * @author Jefferson Vantuir - */ +/** @author Jefferson Vantuir */ class CeilTest extends OracleTestCase { public function testFullQuery(): void diff --git a/tests/Query/Oracle/FloorTest.php b/tests/Query/Oracle/FloorTest.php index 93f7f10f..c45abb8b 100644 --- a/tests/Query/Oracle/FloorTest.php +++ b/tests/Query/Oracle/FloorTest.php @@ -6,9 +6,7 @@ use DoctrineExtensions\Tests\Entities\Product; use DoctrineExtensions\Tests\Query\OracleTestCase; -/** - * @author Jefferson Vantuir - */ +/** @author Jefferson Vantuir */ class FloorTest extends OracleTestCase { public function testFullQuery(): void diff --git a/tests/Query/Oracle/ListaggTest.php b/tests/Query/Oracle/ListaggTest.php index c3cdc942..3592388b 100644 --- a/tests/Query/Oracle/ListaggTest.php +++ b/tests/Query/Oracle/ListaggTest.php @@ -4,9 +4,7 @@ use DoctrineExtensions\Tests\Query\OracleTestCase; -/** - * @author Alexey Kalinin - */ +/** @author Alexey Kalinin */ class ListaggTest extends OracleTestCase { public function testFullQuery(): void diff --git a/tests/Query/Oracle/ToCharTest.php b/tests/Query/Oracle/ToCharTest.php index 0f6f47a7..bd84bc0a 100644 --- a/tests/Query/Oracle/ToCharTest.php +++ b/tests/Query/Oracle/ToCharTest.php @@ -6,9 +6,7 @@ use DoctrineExtensions\Tests\Entities\Date; use DoctrineExtensions\Tests\Query\OracleTestCase; -/** - * @author Jefferson Vantuir - */ +/** @author Jefferson Vantuir */ class ToCharTest extends OracleTestCase { public function testFullQuery(): void diff --git a/tests/Query/Oracle/TruncTest.php b/tests/Query/Oracle/TruncTest.php index fa1f01b0..a4da200d 100755 --- a/tests/Query/Oracle/TruncTest.php +++ b/tests/Query/Oracle/TruncTest.php @@ -4,9 +4,7 @@ use DoctrineExtensions\Tests\Query\OracleTestCase; -/** - * @author Alexey Kalinin - */ +/** @author Alexey Kalinin */ class TruncTest extends OracleTestCase { public function testFullQuery(): void diff --git a/tests/Query/Sqlite/StringFunctionsTest.php b/tests/Query/Sqlite/StringFunctionsTest.php index 2d13513b..d8017c70 100644 --- a/tests/Query/Sqlite/StringFunctionsTest.php +++ b/tests/Query/Sqlite/StringFunctionsTest.php @@ -6,6 +6,7 @@ /** * This class is responsible for testing the Sqlite string functions + * * @author winkbrace */ class StringFunctionsTest extends SqliteTestCase