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

Allow suppress for NullableTypeForNullDefaultValue sniff #862

Merged
merged 1 commit into from
Jan 23, 2020
Merged

Allow suppress for NullableTypeForNullDefaultValue sniff #862

merged 1 commit into from
Jan 23, 2020

Conversation

simPod
Copy link
Contributor

@simPod simPod commented Jan 23, 2020

Eg. Symfony still supports ancient PHP 7.1 so type hints are often declared as

    /**
     * Gets the listeners of a specific event or all listeners sorted by descending priority.
     *
     * @return array The event listeners for the specified event, or all event listeners by event name
     */
    public function getListeners(string $eventName = null);

with missing ? for nullable types. It is not possible to type hint implementations as

    public function getListeners(?string $eventName = null) {}

Therefore there's need for suppressing the SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilitySymbolRequired

@kukulich kukulich merged commit 3973ee8 into slevomat:master Jan 23, 2020
@kukulich
Copy link
Contributor

Thanks.

@simPod simPod deleted the allow-NullabilitySymbolRequired-suppress branch January 23, 2020 14:40
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.

None yet

2 participants