Skip to content

Adds Arrays::implode - #65

Merged
frankdekker merged 6 commits into
masterfrom
Add-implode-with-support-for-enums
Apr 10, 2026
Merged

Adds Arrays::implode#65
frankdekker merged 6 commits into
masterfrom
Add-implode-with-support-for-enums

Conversation

@frankdekker

@frankdekker frankdekker commented Apr 7, 2026

Copy link
Copy Markdown
Member

Adds Arrays::implode to implode an array like normal, but with support for iterables and allows BackedEnum as value.

Example:

implode(BackedEnum::cases(), ':');

Copilot AI review requested due to automatic review settings April 7, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Arrays::implode() utility to join values into a string with support for iterable inputs and BackedEnum values, plus accompanying unit tests and documentation updates.

Changes:

  • Added Arrays::implode(iterable $items, string $separator = ','): string with BackedEnum handling.
  • Extended ArraysTest to cover basic implode cases (scalars, Stringable, enums).
  • Updated README to document the new implode helper and added a mock backed enum for tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/Arrays.php Introduces Arrays::implode() and related imports/PHPDoc.
tests/Unit/ArraysTest.php Adds a new testImplode() covering several value types.
tests/Mock/MockStringBackedEnum.php Adds a string backed enum fixture used by tests.
README.md Documents the new implode helper in the Arrays section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Arrays.php Outdated
Comment thread src/Arrays.php
Comment thread src/Arrays.php
Comment thread tests/Unit/ArraysTest.php
Comment thread README.md Outdated
frankdekker and others added 5 commits April 7, 2026 18:21
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@frankdekker
frankdekker requested a review from bram123 April 7, 2026 16:30
@frankdekker
frankdekker merged commit d451d39 into master Apr 10, 2026
12 checks passed
@frankdekker
frankdekker deleted the Add-implode-with-support-for-enums branch April 10, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants