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

phpcbf breaks interface matching #47

Closed
autowp opened this issue Oct 25, 2020 · 1 comment · Fixed by #48
Closed

phpcbf breaks interface matching #47

autowp opened this issue Oct 25, 2020 · 1 comment · Fixed by #48
Assignees
Labels
Bug Something isn't working
Milestone

Comments

@autowp
Copy link
Contributor

autowp commented Oct 25, 2020

Bug Report

Q A
Version(s) 2.1.0

Summary

phpcbf breaks interface matching.
All Laminas\ServiceManager\Factory\FactoryInterface implementations is broken after autofix because of $requestedName parameter typed with phpdoc

Current behavior

<?php

namespace Test;

class Test implements ITest
{
    /**
     * @param string $string
     */
    public function doIt($string): void
    {
        print $string;
    }
}

converted to

<?php

namespace Test;

class Test implements ITest
{
    public function doIt(string $string): void
    {
        print $string;
    }
}

regadless of interface method definition: Declaration must be compatible with ITest->doIt(string: string)

Expected behavior

Don't convert phpdoc type hints automatically

Workaround

Exclude SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint

@geerteltink geerteltink linked a pull request Oct 25, 2020 that will close this issue
@geerteltink geerteltink added this to the 2.1.2 milestone Oct 25, 2020
@geerteltink geerteltink self-assigned this Oct 25, 2020
@geerteltink geerteltink added the Bug Something isn't working label Oct 25, 2020
@geerteltink
Copy link
Member

Fixed in #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants