From c2177031f900308829c4c099f5847a44edf5882e Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen.haas@lakedrops.com>
Date: Thu, 18 Apr 2024 13:01:38 +0200
Subject: [PATCH] composer/plugin/docker4drupal#77 Skip assert_options for
 PHP>=8.3

---
 src/Handler.php                   | 1 +
 templates/settings.local.php.twig | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/src/Handler.php b/src/Handler.php
index 1df307d..a55ee3a 100644
--- a/src/Handler.php
+++ b/src/Handler.php
@@ -84,6 +84,7 @@ class Handler extends BaseHandler {
       }
     }
     $this->config->setValue('hash', $hash, FALSE);
+    $this->config->setValue('php', ['version' => PHP_VERSION], FALSE);
   }
 
   /**
diff --git a/templates/settings.local.php.twig b/templates/settings.local.php.twig
index ff744c3..8caeb7a 100644
--- a/templates/settings.local.php.twig
+++ b/templates/settings.local.php.twig
@@ -13,8 +13,13 @@ $settings['rebuild_access'] = {{ live ? 'FALSE' : 'TRUE' }};
 $settings['skip_permissions_hardening'] = {{ live ? 'FALSE' : 'TRUE' }};
 {% if not live %}
 
+{% set v = php.version|split('.') %}
+{% if (v[0] == 8 and v[1] >= 3) or v[0] > 8 %}
+// Skipping assert options
+{% else %}
 assert_options(ASSERT_ACTIVE, TRUE);
 assert_options(ASSERT_EXCEPTION, TRUE);
+{% endif %}
 $settings['container_yamls'][] = __DIR__ . '/development.services.yml';
 $settings['cache']['bins']['render'] = 'cache.backend.null';
 $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
-- 
GitLab