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

Vendor Namespace and Package Name should be StudlyCased in the namespace #36

Closed
deweller opened this issue Jun 2, 2017 · 8 comments
Closed

Comments

@deweller
Copy link

deweller commented Jun 2, 2017

The vendor namespace and package name should be lowercased in the directory tree, but they should be StudlyCased in the class definition.

When I run:

$ artisan packager:new tokenly fluentd-logger

The Expected result is:

Should create a namespace of namespace definition of Tokenly\FluentdLogger;

The actual Result is:

Creates namespace tokenly\fluentd-logger;

Here is an example of capitilization in a Laravel vendor package:

skeletonclass_php_ _tokenly-dashboard
command_php_ _tokenly-dashboard

@Jeroen-G
Copy link
Owner

Jeroen-G commented Jun 3, 2017

I have seen Laravel packages work without studlycases. It is not programmatically required, and that is why I leave it up to you to define the capitals. Or at least it was that way when I designed Packager. That is also why all examples in the readme have capitals.

@deweller
Copy link
Author

deweller commented Jun 3, 2017

I guess the problem is that there is no way to generate both a lowercase directory name with a corresponding StudlyCased namespace. I have to manually edit the namespace in all the generated files.

The nice thing to have here would be the ability to specify the directory name and the namespace separately (with sane defaults).

@Jeroen-G
Copy link
Owner

Jeroen-G commented Jun 3, 2017

Changing the directory to lowercase would only require changing the app composer.json I think.

However, I would accept a PR that fixes this.

@Jeroen-G
Copy link
Owner

Closed, waiting for Pull Request.

@judgej
Copy link

judgej commented Sep 7, 2017

The namespace may be StudyCap cased, but the vendor name and package name and their directories should be lower case. You can call the directories whatever you like in the packages directory, but the convention for composer is a lower case vendor (e.g. "laraval") and lower case package name (e.g. "framework").

Namespaces and vendor/package names, are two completely different things. For example, the "laravel/framework" vendor/package name provides the "\Illuminate" namespace.

@Jeroen-G
Copy link
Owner

Jeroen-G commented Sep 7, 2017

I would welcome a Pull Request.

@omitobi
Copy link

omitobi commented Nov 16, 2018

I was trying this package today 17th November, 2018 and I seriously couldn't create a package with - between the names and also when I use lower case it doesn't change the namespace to use UpperCase. Its a great job done to provide this package but this issue is quite annoying as I had to change the name of my package to StudlyCase.

@Jeroen-G
Copy link
Owner

And still no one makes a PR.

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

No branches or pull requests

4 participants