Skip to content

[TASK] Narrow the some type annotations in OutputFormatter #945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

oliverklee
Copy link
Collaborator

No description provided.

@coveralls
Copy link

coveralls commented Feb 16, 2025

Coverage Status

coverage: 50.801%. remained the same
when pulling eac45ae on task/formatter-annotations
into 17dd3cb on main.

@oliverklee oliverklee force-pushed the task/formatter-annotations branch from 6dfc13f to 7ad908d Compare February 16, 2025 21:19
Copy link
Collaborator

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

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

I think the list argument separators are necessarily non-empty strings, but the 'glue' for implode() doesn't have to be.

@@ -136,6 +136,7 @@ public function safely($cCode)
/**
* Clone of the `implode` function, but calls `render` with the current output format instead of `__toString()`.
*
* @param non-empty-string $sSeparator
Copy link
Collaborator

Choose a reason for hiding this comment

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

There might be use cases where this is an empty string, for example concatenating hex colour values ['r' => '00', 'g' => 'FF', 'b' => '00'].

Given that the inbuilt implode() that this is based on accepts an empty string as the $glue parameter, I would prefer not to change this. I note that the PHP docs have renamed this parameter since PHP 8 to $separator. However, IMO that is a misnomer, implying, um, separation, which an empty string (the default) does not achieve.

@oliverklee oliverklee force-pushed the task/formatter-annotations branch from 7ad908d to eac45ae Compare February 17, 2025 18:04
@oliverklee
Copy link
Collaborator Author

Good point! Changed and repushed.

@oliverklee oliverklee requested a review from JakeQZ February 17, 2025 18:04
@JakeQZ JakeQZ merged commit 8c770fb into main Feb 17, 2025
21 checks passed
@JakeQZ JakeQZ deleted the task/formatter-annotations branch February 17, 2025 18:13
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