Skip to content

Commit

Permalink
More patches for Doctrine bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 9, 2024
1 parent 87d961b commit ce17b0e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
- php-version: "8.3"
dependencies: "highest"
update-packages: |
composer config extra.patches.doctrine/orm --json --merge '["compatibility/patches/Column.patch", "compatibility/patches/DiscriminatorColumn.patch", "compatibility/patches/DiscriminatorMap.patch", "compatibility/patches/Embeddable.patch", "compatibility/patches/Embedded.patch", "compatibility/patches/Entity.patch", "compatibility/patches/GeneratedValue.patch", "compatibility/patches/Id.patch", "compatibility/patches/InheritanceType.patch", "compatibility/patches/JoinColumn.patch", "compatibility/patches/JoinColumns.patch", "compatibility/patches/ManyToMany.patch", "compatibility/patches/ManyToOne.patch", "compatibility/patches/MappedSuperclass.patch", "compatibility/patches/OneToMany.patch", "compatibility/patches/OneToOne.patch", "compatibility/patches/OrderBy.patch", "compatibility/patches/UniqueConstraint.patch", "compatibility/patches/Version.patch"]'
composer config extra.patches.doctrine/orm --json --merge '["compatibility/patches/Base.patch", "compatibility/patches/Column.patch", "compatibility/patches/DateAddFunction.patch", "compatibility/patches/DateSubFunction.patch", "compatibility/patches/DiscriminatorColumn.patch", "compatibility/patches/DiscriminatorMap.patch", "compatibility/patches/Embeddable.patch", "compatibility/patches/Embedded.patch", "compatibility/patches/Entity.patch", "compatibility/patches/GeneratedValue.patch", "compatibility/patches/Id.patch", "compatibility/patches/InheritanceType.patch", "compatibility/patches/JoinColumn.patch", "compatibility/patches/JoinColumns.patch", "compatibility/patches/ManyToMany.patch", "compatibility/patches/ManyToOne.patch", "compatibility/patches/MappedSuperclass.patch", "compatibility/patches/OneToMany.patch", "compatibility/patches/OneToOne.patch", "compatibility/patches/OrderBy.patch", "compatibility/patches/UniqueConstraint.patch", "compatibility/patches/Version.patch"]'
composer config extra.patches.carbonphp/carbon-doctrine-types --json --merge '["compatibility/patches/DateTimeImmutableType.patch", "compatibility/patches/DateTimeType.patch"]'
composer require --dev doctrine/orm:^3.0 doctrine/dbal:^4.0 carbonphp/carbon-doctrine-types:^3 -W
Expand Down
13 changes: 13 additions & 0 deletions compatibility/patches/Base.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- src/Query/Expr/Base.php 2024-02-09 14:21:17
+++ src/Query/Expr/Base.php 2024-02-09 14:21:24
@@ -33,6 +33,10 @@

public function __construct(mixed $args = [])
{
+ if (is_array($args) && array_key_exists(0, $args) && is_array($args[0])) {
+ $args = $args[0];
+ }
+
$this->addMultiple($args);
}

10 changes: 10 additions & 0 deletions compatibility/patches/DateAddFunction.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- src/Query/AST/Functions/DateAddFunction.php 2024-02-09 14:22:59
+++ src/Query/AST/Functions/DateAddFunction.php 2024-02-09 14:23:02
@@ -71,7 +71,6 @@
private function dispatchIntervalExpression(SqlWalker $sqlWalker): string
{
$sql = $this->intervalExpression->dispatch($sqlWalker);
- assert(is_numeric($sql));

return $sql;
}
10 changes: 10 additions & 0 deletions compatibility/patches/DateSubFunction.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- src/Query/AST/Functions/DateSubFunction.php 2024-02-09 14:22:31
+++ src/Query/AST/Functions/DateSubFunction.php 2024-02-09 14:22:50
@@ -64,7 +64,6 @@
private function dispatchIntervalExpression(SqlWalker $sqlWalker): string
{
$sql = $this->intervalExpression->dispatch($sqlWalker);
- assert(is_numeric($sql));

return $sql;
}

0 comments on commit ce17b0e

Please sign in to comment.