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

Correct namespace containing hyphen #327

Closed
wants to merge 1 commit into from

Conversation

harmenjanssen
Copy link

@harmenjanssen harmenjanssen commented Jun 22, 2018

To allow vendors with dashes in their name, such as "grrr-amsterdam".

Right now, this fails silently, the plugin just isn't recognized by the PluginManager.

@LukeTowers
Copy link
Contributor

This pull request has been made to the wrong branch. Please review the contributing guidelines as all PRs need to be made to the develop branch.

I'll fix it for you this time, but please ensure you make any future PRs to the develop branch, not the master branch.

@LukeTowers
Copy link
Contributor

@harmenjanssen can you provide an example of a plugin that causes this issue to occur?

@harmenjanssen
Copy link
Author

Certainly, it's this one: https://packagist.org/packages/grrr-amsterdam/oc-styleguide-plugin

(note that it's WIP)

@LukeTowers
Copy link
Contributor

@harmenjanssen ah, I see. The more robust fix to apply here is to add a filter to $vars['name'] in https://github.com/composer/installers/blob/master/src/Composer/Installers/OctoberInstaller.php#L35 to remove all non-alphanumeric characters, or at the very least hyphens.

@harmenjanssen
Copy link
Author

@LukeTowers Ah, right, that would be the better solution.

It's $vars['vendor'] in my case, right?
I'll add my PR to Composer Installers, thanks!

@LukeTowers
Copy link
Contributor

@harmenjanssen I'm not sure tbh, play around with it and see if you can figure it out.

@harmenjanssen
Copy link
Author

I finally got around to proposing a pull request over at Composer Installers, see composer/installers#397.

So I'm closing this one, hopefully the issue will be resolved soon.

@harmenjanssen
Copy link
Author

harmenjanssen commented Sep 11, 2018

@LukeTowers Composer Installers has merged the PR, but I still also need this feature to ensure the PHP namespace resolves correctly. 🙂
The files are loaded correctly and Grrr-Amsterdam will end up in the plugins directory, but the hyphen still ends up in generated namespaces.

Will you consider reopening reconsider this?

@harmenjanssen harmenjanssen reopened this Sep 11, 2018
@LukeTowers
Copy link
Contributor

@harmenjanssen then you've done your PR wrong. Your PR was supposed to remove the - entirely so I don't see how you have a hyphen involved at all anymore.

@harmenjanssen
Copy link
Author

Argh, you're absolutely right, I misinterpreted a colleague's bug report.
The problem is my fix in Composer/Installers hasn't been tagged yet, so new October installations won't include the latest version. Something we can overcome for now by manually requiring a later version in composer.json.

Anyways, sorry for bothering, I will close this for good now. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants