-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: support dbal 4, orm 3, phpcr-odm 2
- Loading branch information
Showing
40 changed files
with
748 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Refugis\DoctrineExtra\DBAL; | ||
|
||
use Composer\InstalledVersions; | ||
|
||
use function version_compare; | ||
|
||
if (version_compare((string) InstalledVersions::getVersion('doctrine/dbal'), '4.0.0', '>=')) { | ||
trait DummyResultCompatTrait | ||
{ | ||
use DummyResultCompatTraitV4; | ||
} | ||
} else { | ||
trait DummyResultCompatTrait // phpcs:ignore PSR1.Classes.ClassDeclaration.MultipleClasses | ||
{ | ||
use DummyResultCompatTraitV2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Refugis\DoctrineExtra\DBAL; | ||
|
||
use function array_values; | ||
use function reset; | ||
|
||
trait DummyResultCompatTraitV2 | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function fetchNumeric() | ||
{ | ||
$row = $this->doFetch(); | ||
|
||
if ($row === false) { | ||
return false; | ||
} | ||
|
||
return array_values($row); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function fetchAssociative() | ||
{ | ||
return $this->doFetch(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function fetchOne() | ||
{ | ||
$row = $this->doFetch(); | ||
|
||
if ($row === false) { | ||
return false; | ||
} | ||
|
||
return reset($row); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Refugis\DoctrineExtra\DBAL; | ||
|
||
use function array_values; | ||
use function reset; | ||
|
||
trait DummyResultCompatTraitV4 | ||
{ | ||
public function fetchNumeric(): array|false | ||
{ | ||
$row = $this->doFetch(); | ||
|
||
if ($row === false) { | ||
return false; | ||
} | ||
|
||
return array_values($row); | ||
} | ||
|
||
public function fetchAssociative(): array|false | ||
{ | ||
return $this->doFetch(); | ||
} | ||
|
||
public function fetchOne(): mixed | ||
{ | ||
$row = $this->doFetch(); | ||
|
||
if ($row === false) { | ||
return false; | ||
} | ||
|
||
return reset($row); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Refugis\DoctrineExtra\DBAL; | ||
|
||
use Composer\InstalledVersions; | ||
|
||
use function version_compare; | ||
|
||
if (version_compare((string) InstalledVersions::getVersion('doctrine/dbal'), '4.0.0', '>=')) { | ||
trait DummyStatementCompatTrait | ||
{ | ||
use DummyResultCompatTraitV4; | ||
use DummyStatementCompatTraitV4; | ||
} | ||
} else { | ||
trait DummyStatementCompatTrait // phpcs:ignore PSR1.Classes.ClassDeclaration.MultipleClasses | ||
{ | ||
use DummyResultCompatTraitV2; | ||
use DummyStatementCompatTraitV2; | ||
} | ||
} |
Oops, something went wrong.