box icon indicating copy to clipboard operation
box copied to clipboard

Avoid errors in PHP 8.5

Open eiriksm opened this issue 1 month ago • 1 comments

In my builds on PHP 8.5 I am getting this error:

31.24 
31.24     ____
31.24    / __ )____  _  __
31.24   / __  / __ \| |/_/
31.24  / /_/ / /_/ />  <
31.24 /_____/\____/_/|_|
31.24 
31.24 
31.24 Box version 4.6.10@6dc6a13
31.24 
31.25  // Loading the configuration file "/usr/src/myapp/box.json".                   
31.25 
31.31 🔨  Building the PHAR "/usr/src/myapp/runner.phar"
31.31 
31.31 ? Removing the existing PHAR "/usr/src/myapp/runner.phar"
31.31 ? Checking Composer compatibility
31.42     > Supported version detected
31.42 ? No compactor to register
31.42 ? Adding main file: /usr/src/myapp/runner.php
31.42 ? Adding requirements checker
31.42 
31.43 In RequirementsBuilder.php line 62:
31.43                                                                             
31.43   Using null as an array offset is deprecated, use an empty string instead  

This simple fix avoids it for me

eiriksm avatar Nov 23 '25 13:11 eiriksm

same here, but wouldn't it be better to redeclare as follows?

    public function addRequiredExtension(Extension $extension, string $source = ''): void

maybe an adjustment will be needed for the array value as well

8ctopus avatar Dec 05 '25 07:12 8ctopus