Skip to content

fix: accept any callable of the correct shape as a format reader#29

Merged
ramsey merged 1 commit intomainfrom
fix/message-loader-formatter
Dec 16, 2021
Merged

fix: accept any callable of the correct shape as a format reader#29
ramsey merged 1 commit intomainfrom
fix/message-loader-formatter

Conversation

@ramsey
Copy link
Copy Markdown
Contributor

@ramsey ramsey commented Dec 16, 2021

Description

This is a slight change I decided to make while I was updating the README and noticed this oversight.

This PR allows the message loader to accept the following values for the custom format reader:

  • Fully-qualified class name
  • An already-instantiated instance object of FormatPHP\Format\ReaderInterface
  • A callable with the shape callable(mixed[]): FormatPHP\MessageCollection
  • The path to a script that returns a callable with this shape

Product requirements and context

How has this been tested?

PR Checklist

  • I have added tests to cover my changes.

@ramsey ramsey requested review from a team, jrode and maccath December 16, 2021 18:49
@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit e4e61c9 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 96.9% (0.0% change).

View more on Code Climate.

@ramsey ramsey requested review from jmauerhan and xiian December 16, 2021 19:44
@ramsey ramsey merged commit 31ff399 into main Dec 16, 2021
@ramsey ramsey deleted the fix/message-loader-formatter branch December 16, 2021 19:52
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