Skip to content

#242 - Fix InputFileReaderTask: explicit exception when no file path is given as input - #250

Merged
njoubert-cleverage merged 2 commits into
mainfrom
242
Oct 9, 2026
Merged

njoubert-cleverage merged 2 commits into
mainfrom
242

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #242.

InputFileReaderTask::getOptions() only set filename when the input was not null, and the filename option is removed from the resolver: with a null (or non-string) input, FileReaderTask::execute() read an undefined key (PHP warning Undefined array key "filename") then file_exists(null) threw a TypeError.

PHPUnit (804 tests), PHPStan, PHP-CS-Fixer and Rector pass, and the changed files are valid PHP 8.2.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None: a null or non-string input currently ends with a TypeError. An empty string '' already threw an \UnexpectedValueException, only its message changes (No file path given as input instead of File does not exists: '').

🤖 Generated with Claude Code

njoubert-cleverage and others added 2 commits October 9, 2026 10:48
…pty string (e.g. `null`) throws an explicit `\UnexpectedValueException` (`No file path given as input`) instead of a PHP warning followed by a `TypeError`. Update documentation, add tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit e37556c into main Oct 9, 2026
17 checks passed
@njoubert-cleverage
njoubert-cleverage deleted the 242 branch October 9, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InputFileReaderTask: a null input raises a warning then a TypeError instead of an explicit exception

1 participant