forked from doctrine/dbal
-
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.
* 4.2.x: Implement an EnumType for MySQL/MariaDB (doctrine#6536) Leverage the new PDO subclasses (doctrine#6532) PHPStan 1.12.6 (doctrine#6535)
- Loading branch information
Showing
23 changed files
with
410 additions
and
19 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
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver\PDO; | ||
|
||
use PDO; | ||
|
||
use const PHP_VERSION_ID; | ||
|
||
/** @internal */ | ||
trait PDOConnect | ||
{ | ||
/** @param array<int, mixed> $options */ | ||
private function doConnect( | ||
string $dsn, | ||
string $username, | ||
string $password, | ||
array $options, | ||
): PDO { | ||
// see https://github.com/php/php-src/issues/16314 | ||
if (PHP_VERSION_ID < 80400 || ($options[PDO::ATTR_PERSISTENT] ?? false) === true) { | ||
return new PDO($dsn, $username, $password, $options); | ||
} | ||
|
||
return PDO::connect($dsn, $username, $password, $options); | ||
} | ||
} |
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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Exception\InvalidColumnType; | ||
|
||
use Doctrine\DBAL\Exception\InvalidColumnType; | ||
use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
|
||
use function get_debug_type; | ||
use function sprintf; | ||
|
||
/** @psalm-immutable */ | ||
final class ColumnValuesRequired extends InvalidColumnType | ||
{ | ||
/** | ||
* @param AbstractPlatform $platform The target platform | ||
* @param string $type The SQL column type | ||
*/ | ||
public static function new(AbstractPlatform $platform, string $type): self | ||
{ | ||
return new self( | ||
sprintf( | ||
'%s requires the values of a %s column to be specified', | ||
get_debug_type($platform), | ||
$type, | ||
), | ||
); | ||
} | ||
} |
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
Oops, something went wrong.