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

Match valid classname in php-get-current-class #7

Merged
merged 2 commits into from
Aug 21, 2015

Conversation

muddletoes
Copy link
Contributor

php-get-current-class currently matches the name of a class by dropping any *.php suffix from the specified file or the current buffer name. This only works if the full suffix of the file is limited to *.php, unnecessarily enforcing an unstated convention.

A better method of determining the name of the current class would be to seek a valid PHP class name in the filename. This would obviate any consideration of suffixing practices.

`php-get-current-class` had been dropping any ".php" suffix from the file/buffer name and assuming that the remainder was the name of the class.  This was not the best method of seeking the class name.  As the syntax of valid PHP class names is known[1], a more flexible method was to seek such a class name in the filename.  `php-get-current-class` now returns the first matching regexp in the filename as the name of the class.

[1] http://www.php.net/manual/en/language.variables.basics.php
Best-guess approximation of how the function would be typeset if you had written it.
nlamirault added a commit that referenced this pull request Aug 21, 2015
Match valid classname in `php-get-current-class`
@nlamirault nlamirault merged commit 17b8bbc into nlamirault:master Aug 21, 2015
@muddletoes muddletoes deleted the match-valid-classname branch August 25, 2015 01:04
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