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

[NETBEANS-377] Add PSR-4 hints #2630

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

KacerCZ
Copy link
Contributor

@KacerCZ KacerCZ commented Jan 1, 2021

https://issues.apache.org/jira/browse/NETBEANS-377

  • Added hints for PSR-4 Autoloader standard.
  • Checks that class/interface/trait declaration matches file name.
  • Checks that namespace matches directory structure.
  • Highlights only non-matching part of namespace.

@junichi11 junichi11 added the PHP [ci] enable extra PHP tests (php/php.editor) label Jan 3, 2021
@junichi11 junichi11 added this to the 12.3 milestone Jan 3, 2021
@junichi11
Copy link
Member

junichi11 commented Jan 5, 2021

We should leave a comment for unsupported cases somewhere.

Add a test for the following case?

// file: Vendor/App/ClassName.php
namespace Vendor\App;

class classname {

}

@KacerCZ
Copy link
Contributor Author

KacerCZ commented Jan 5, 2021

I added tests where casing is different.

Also added note about case-sensitivity to hint descriptions:

  • "Namespace MUST match (case-sensitive) file directory."
  • "Type name MUST match (case-sensitive) file name."

https://issues.apache.org/jira/browse/NETBEANS-377

- Added hints for [PSR-4 Autoloader](https://www.php-fig.org/psr/psr-4/) standard.
- Checks that class/interface/trait declaration matches file name.
- Checks that namespace matches directory structure.
- Highlights only non-matching part of namespace.
@tmysik tmysik self-requested a review January 7, 2021 18:04
@junichi11
Copy link
Member

Will re-run jobs.

@junichi11 junichi11 merged commit e481dad into apache:master Jan 8, 2021
@KacerCZ KacerCZ deleted the netbeans-377-psr4-hints branch January 8, 2021 11:50
@KacerCZ
Copy link
Contributor Author

KacerCZ commented Jan 8, 2021

@junichi11 @tmysik Thanks for review.

@ahajzik-crido
Copy link

Does this feature support psr-4 declaration from composer.json?

@KacerCZ
Copy link
Contributor Author

KacerCZ commented May 18, 2021

@ahajzik-crido No, mapping from composer.json is separate task - https://issues.apache.org/jira/browse/NETBEANS-5341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants