You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Tomáš Procházka (Jira)" <ji...@apache.org> on 2021/01/01 10:47:00 UTC

[jira] [Commented] (NETBEANS-377) Only underline the non-matching part of namespace

    [ https://issues.apache.org/jira/browse/NETBEANS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17257169#comment-17257169 ] 

Tomáš Procházka commented on NETBEANS-377:
------------------------------------------

[PSR-4|https://www.php-fig.org/psr/psr-4/] standard is evolution of [PSR-0|https://www.php-fig.org/psr/psr-0/] where workarounds for absence of namespaces in PHP before 5.3 were removed.
 Most notable changes are:
 * Underscore character is no longer namespace separator in class name in PSR-4.
 * Namespace prefix can be mapped to base directory.
 * Directory of file must match namespace after prefix.

So I think best solution is to prepare separate PSR-4 validations. Current PSR-0 validations are good starting point. Future enhancements can add mapping from namespace prefix to base directory (manually defined or even read from composer.json).


> Only underline the non-matching part of namespace
> -------------------------------------------------
>
>                 Key: NETBEANS-377
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-377
>             Project: NetBeans
>          Issue Type: Improvement
>          Components: php - Editor
>    Affects Versions: 8.2
>            Reporter: Simon Heimberg
>            Priority: Minor
>
> When the namespace does not correspondent to the directory structure, the namespace is underlined. Fine!
> But with PSR4 structure, the start of the namespace is often different to the directory structure. But the end should match.
> I suppose to only underline the part of the namespace, which does not match the directory structure. Then the user can determine himself if this part is because of PSR-4 or because of a typo.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists