gabordemooij / redbean

ORM layer that creates models, config and database on the fly
https://www.redbeanphp.com
2.31k stars 279 forks source link

Preference for class_alias vs use? #568

Closed benmajor closed 7 years ago

benmajor commented 7 years ago

Is there a specific reason the Readme suggests the use of class_alias() when installing RB via Composer, as opposed to the use statement? For example, the following works just as well:

use \RedBeanPHP\R as R;

As far as I can tell, there is no requirement for back-scoping of R in this instance.

gabordemooij commented 7 years ago

I have no idea, I do not actively maintain Composer packages, I only focus on the tarballs. Do you recommend a change?

benmajor commented 7 years ago

Well it may be largely academic for a lot of projects, but using use-as may have some advantages, especially when a project requires its own namespace.

gabordemooij commented 7 years ago

Feel free to send a pull request for the README, I'm looking forward to it ;) To be honest I never use Composer.

benmajor commented 7 years ago

Please see https://github.com/gabordemooij/redbean/pull/571