Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHP 8.2 compatibility #398

Merged
merged 1 commit into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- 7.4
- 8.0
- 8.1
- 8.2

steps:
- uses: actions/checkout@v2
Expand All @@ -39,3 +40,4 @@ jobs:
- run: composer run test

- run: composer run lint -- --dry-run
if: ${{ matrix.php <= '8.0' }}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"doctrine/orm": "^2.7"
},
"require-dev": {
"doctrine/cache": "^1.11",
"friendsofphp/php-cs-fixer": "^2.14",
"nesbot/carbon": "*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Mysql/CharLength.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
class CharLength extends FunctionNode
{
private $expr;
private $expr1;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
Expand Down
2 changes: 2 additions & 0 deletions src/Query/Mysql/Power.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class Power extends FunctionNode
{
public $arithmeticExpression;

public $power;

public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
{
return 'POWER(' . $this->arithmeticExpression->dispatch($sqlWalker) . ', '
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Sqlite/ConcatWs.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getSql(\Doctrine\ORM\Query\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.
Expand Down
20 changes: 20 additions & 0 deletions tests/Entities/CarbonDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,24 @@ class CarbonDate
* @Column(type="CarbonTime", nullable=true)
*/
public $time;

/**
* @Column(type="CarbonImmutableDate", nullable=true)
*/
public $date_immutable;

/**
* @Column(type="CarbonImmutableDateTime", nullable=true)
*/
public $datetime_immutable;

/**
* @Column(type="CarbonImmutableDateTimeTz", nullable=true)
*/
public $datetime_tz_immutable;

/**
* @Column(type="CarbonImmutableTime", nullable=true)
*/
public $time_immutable;
}
2 changes: 2 additions & 0 deletions tests/Query/Mysql/TrigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

class TrigTest extends \DoctrineExtensions\Tests\Query\MysqlTestCase
{
private $entity;

public function setUp(): void
{
parent::setUp();
Expand Down
2 changes: 1 addition & 1 deletion tests/Types/CarbonDateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
class CarbonDateTest extends TestCase
{
public $entityManager = null;
private $em;

public static function setUpBeforeClass(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Types/ZendDateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class ZendDateTest extends TestCase
{
public $entityManager = null;
private $em;

public static function setUpBeforeClass(): void
{
Expand Down