Skip to content

Commit

Permalink
Add PHP 8.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
javer committed Dec 14, 2022
1 parent c2a6096 commit 7cfeb9c
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
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
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
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
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
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
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
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
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
Expand Up @@ -12,7 +12,7 @@
*/
class ZendDateTest extends TestCase
{
public $entityManager = null;
private $em;

public static function setUpBeforeClass(): void
{
Expand Down

0 comments on commit 7cfeb9c

Please sign in to comment.