Skip to content

Adding per collection custom delimiter#36

Merged
adbario merged 3 commits intoadbario:2.xfrom
mattsah:2.x
Oct 14, 2022
Merged

Adding per collection custom delimiter#36
adbario merged 3 commits intoadbario:2.xfrom
mattsah:2.x

Conversation

@mattsah
Copy link

@mattsah mattsah commented Oct 14, 2022

This is a pull request for 2.x (for a v2.5) to add the custom delimiter at the constructor (per collection) level only per #35.

@adbario adbario self-requested a review October 14, 2022 20:05
@coveralls
Copy link

coveralls commented Oct 14, 2022

Coverage Status

Coverage remained the same at 100.0% when pulling c58b2fd on mattsah:2.x into 3bfe678 on adbario:2.x.

src/Dot.php Outdated
public function __construct($items = [], $delimiter = '.')
{
$this->items = $this->getArrayItems($items);
$this->delimiter = $delimiter;
Copy link
Owner

Choose a reason for hiding this comment

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

If the delimiter is an empty string, explode() will throw an error. So the delimiter must default to a dot if an empty string was passed to the constructor.

Copy link
Owner

@adbario adbario left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @mattsah 🔥

Can you also update the helpers.php file accordingly and add the delimiter to readme?

Thanks 🙏

@adbario
Copy link
Owner

adbario commented Oct 14, 2022

Thanks for the contribution @mattsah 🚀

@adbario adbario merged commit 081e2cc into adbario:2.x Oct 14, 2022
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