Skip to content

Fix strftime global call#4

Merged
sunkan merged 5 commits into
sunkan:mainfrom
bix0r:fix-strftime-global-call
Jun 3, 2025
Merged

Fix strftime global call#4
sunkan merged 5 commits into
sunkan:mainfrom
bix0r:fix-strftime-global-call

Conversation

@bix0r
Copy link
Copy Markdown
Collaborator

@bix0r bix0r commented Jun 2, 2025

Fix for Issue #3 .

bix0r added 3 commits June 2, 2025 17:58
Because we provide all the callables, and no replacement contains an array,
we can safely say that all callables are not strings.
@sunkan
Copy link
Copy Markdown
Owner

sunkan commented Jun 2, 2025

The phpstan error is kinda fascinating.

Due to fixing the callable check you narrowed the phpstan $result typehint to string and all of a sunden preg_replace gets improved type checking.

Comment thread src/LocalizedStrftimeFormatter.php Outdated
bix0r added 2 commits June 3, 2025 07:32
This solves the phpstan problem by forcing the return type of the lambda function to a string.
@sunkan sunkan merged commit 45b1c15 into sunkan:main Jun 3, 2025
8 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.

2 participants