@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

PHP 8.5: Fix null array key in DivinerJavelinAtomizer::executeAtomize()

Summary:
Setting null as an array key is deprecated since PHP 8.5 per https://www.php.net/releases/8.5/en.php: "Using null as an array offset or when calling array_key_exists() is now deprecated. Use an empty string instead."

```
ERROR 8192: Using null as an array offset is deprecated, use an empty string instead at [/var/www/html/phorge/phorge/src/applications/diviner/atomizer/DivinerJavelinAtomizer.php:70]
```

Closes T16526

Test Plan:
* PHP 8.5
* Build Peast
* `./bin/diviner generate --book webroot/rsrc/externals/javelin/docs/javelin.book`

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16526

Differential Revision: https://we.phorge.it/D26797

+1 -1
+1 -1
src/applications/diviner/atomizer/DivinerJavelinAtomizer.php
··· 67 67 /** @var DivinerAtom $atom */ 68 68 foreach ($atoms as $atom) { 69 69 $block_id = $block_map[$atom->getLine()]; 70 - if (isset($map[$block_id])) { 70 + if ($block_id !== null && isset($map[$block_id])) { 71 71 $atom->setDocblockRaw($map[$block_id]); 72 72 unset($map[$block_id]); 73 73 } else {