Skip to content
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

Comments #8

Open
hiqsol opened this issue Aug 24, 2018 · 2 comments
Open

Comments #8

hiqsol opened this issue Aug 24, 2018 · 2 comments

Comments

@hiqsol
Copy link

hiqsol commented Aug 24, 2018

I have a specific need, can it be implemented in this library?

I want to have dumped array with comments like this:

return [
    'a' => [
        'a1' => 'one', /// from file-a
    ],
    'b' => [
        'b2' => 'two', /// from file-b
    ],    
];

It could be implemented with providing callback:

public function commentsCallback(array $keys, $value) {
    /// example, actual logic will be other
    if ($keys == ['a','a1'] and $value === 'one') return 'from file a';
    /// ....
    return null;
}

Thanks in advance!

@Riimu
Copy link
Owner

Riimu commented Oct 10, 2018

I don't think this is necessarily a bad idea, but the implementation could be a bit tricky.

I will look into implementing this, if I end up doing a bigger refactoring once PHP 5.6 and 7.0 goes EOL (and I will most likely bump the minimum requirement to 7.1).

@hiqsol
Copy link
Author

hiqsol commented Oct 10, 2018

Cool. Thank you!

Going 7.1 is a good idea in any case!

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

No branches or pull requests

2 participants