Skip to content

Conversation

@ddevsr
Copy link
Collaborator

@ddevsr ddevsr commented Dec 19, 2025

Description
Reference : https://github.com/codeigniter4/CodeIgniter4/actions/runs/20359640614/job/58502356892?pr=9847

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@ddevsr ddevsr added breaking change Pull requests that may break existing functionalities 4.7 labels Dec 19, 2025
@michalsn
Copy link
Member

While I agree with the approach taken in RulesTest.php, I'm not in favor of the proposed changes to FileLocator.

In FileLocator, null has a semantic meaning and should be preserved. The issue exists only in the caching layer (FileLocatorCached), not in the core logic (FileLocator) itself.

Given that, I would limit the fix to the caching layer and simply change the FileLocatorCached::locateFile() method:

$folderKey = $folder ?? '';

if (isset($this->cache['locateFile'][$file][$folderKey][$ext])) {
    return $this->cache['locateFile'][$file][$folderKey][$ext];
}

$files = $this->locator->locateFile($file, $folder, $ext);

$this->cache['locateFile'][$file][$folderKey][$ext] = $files;
$this->cacheUpdated                                 = true;

return $files;

@ddevsr ddevsr force-pushed the deprecated-null-array-offset branch from 6a573b2 to 5ed5f12 Compare December 19, 2025 13:32
@michalsn
Copy link
Member

Hmm... I'm not sure what's happening with the Sanity Tests. Everything works fine locally, and the tests also pass on GitHub Actions: https://github.com/michalsn/CodeIgniter4/actions/runs/20376659038/job/58556861626

Maybe try to rebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.7 breaking change Pull requests that may break existing functionalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants