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

Variable-length argument lists for PropertyMappingConfiguration methods #1012

Closed
jdoubleu opened this issue Jul 7, 2017 · 3 comments
Closed

Comments

@jdoubleu
Copy link

jdoubleu commented Jul 7, 2017

Yet the allowProperties(), skipProperties() and allowAllPropertiesExcept() methods of the PropertyMappingConfiguration class don't have arguments defined but use the func_get_args() function to retrieve all arguments from this function's call.

PHP5.6+ supports variable-length argument lists'.

This argument list might also be strongly typed (e.g. with string for property names).

Example:

public function allowProperties(string ...$propertyNames)
{
    foreach ($propertyNames as $propertyName) {
        $this->propertiesToBeMapped[$propertyName] = $propertyName;
    }
    return $this;
}

This would improve the API docs, the readability and the IDE support.

Is there a good reason why this isn't implemented yet? Or should it be part of #999?

May I create a PR?

@kitsunet
Copy link
Member

kitsunet commented Jul 8, 2017

As we switched our minimum required version from 5.3 to 7.0 with the latest major a few months ago I am sure there are many places where we could improve like that. Please open a PR every of those improvements is welcome :)

@albe
Copy link
Member

albe commented Jul 23, 2017

What Christian said :)

@zaveryukha
Copy link
Contributor

I think this issue can be closed?
PR #1035 merged.

@kitsunet kitsunet closed this as completed Aug 8, 2017
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

4 participants