Skip to content

[TASK] Remove thecodingmachine/safe dependency (part 3) - #1616

Merged
oliverklee merged 2 commits into
MyIntervals:mainfrom
SjorsO:drop-dependency-part-3
Aug 20, 2026
Merged

[TASK] Remove thecodingmachine/safe dependency (part 3)#1616
oliverklee merged 2 commits into
MyIntervals:mainfrom
SjorsO:drop-dependency-part-3

Conversation

@SjorsO

@SjorsO SjorsO commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

All calls in ParserState that can return false now throw an exception instead, each with its own unit test that checks for the unique exception code.

@coveralls

coveralls commented Aug 19, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 74.597% (+2.0%) from 72.604% — SjorsO:drop-dependency-part-3 into MyIntervals:main

}
return iconv('utf-32le', $this->charset, $utf32EncodedCharacter);
// The suppression is needed because `\iconv` emits a notice, as well as returning `false`, on failure.
$convertedCharacter = @\iconv('utf-32le', $this->charset, $utf32EncodedCharacter);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppressing this notice seems like a smart move. We're already handling the error, no reason to emit a notice too

PHPUnit fails if a test emits a notice, so we either have to handle this with a @ or add a small error handling hack in the unit test

@oliverklee oliverklee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great tests! I particularly like the test names, and I also love that we now have tests for the error cases.

I've added a comment on making the tests a bit tighter.

Comment thread tests/Unit/Parsing/ParserStateTest.php

@oliverklee oliverklee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@oliverklee
oliverklee merged commit 09baae0 into MyIntervals:main Aug 20, 2026
24 checks passed
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.

3 participants