gitIssue-374 Fix remaining deprecated ${var} string interpolation in sources - #375
gitIssue-374 Fix remaining deprecated ${var} string interpolation in sources#375BradKollmyer wants to merge 1 commit into
Conversation
…sources
PHP 8.2 deprecates "${var}" inside double-quoted strings, and the
deprecation fires at compile time when the source file is included.
Under the FreePBX Whoops error handler that escalates to an
ErrorException, so an affected source (notably LDAP) throws before it
can run at all. Completes the sweep started in #988/#989 (PR FreePBX#371).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Gentle nudge on this one — it's been open a couple of weeks with no review. Still reproducible on 177: $dn = "ou=${ou},${dc}";
185: $dn = "${dc}";On PHP 8.2 — which is what FreePBX 17 ships on for Debian 12 — that deprecation The change is 5 lines across 4 files ( Happy to split the LDAP fix out into its own PR if bundling the other three |
Fixes FreePBX/issue-tracker#1313.
PHP 8.2 deprecates
"${var}"inside double-quoted strings. The deprecation is raised at compile time when the file is included, and the FreePBX bootstrap's Whoops error handler escalates it to anErrorException— so a source file containing the syntax throws oninclude, before its class can be instantiated. In practice this makes the LDAP source unusable on FreePBX 17 no matter how it is configured.The sweep from #988/#989 (PR #371, shipped in 17.0.6) removed most occurrences; this completes it. Mechanical
${var}→{$var}on the five remaining lines:sources/source-LDAP.modulesources/source-CapsuleCRM.modulesources/source-Send_to_MythTV.modulesources/source-Send_to_YAC.moduleNo behavior change —
{$var}produces identical output on all supported PHP versions.Tested: all four files pass
php -lon PHP 8.2.28 (Debian 12). The LDAP source fix is additionally verified end-to-end on a production FreePBX 17.0 / superfecta 17.0.7 install: with the patched file, a scheme debug run returns the correct CNAM from an LDAP phonebook in ~13 ms; unpatched, the include throwsWhoops\Exception\ErrorException: Using ${var} in strings is deprecated.🤖 Generated with Claude Code