Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[RFC] Removing use statements for PHP scoped classes #210

Closed
hhamon opened this Issue · 5 comments

3 participants

@hhamon
Collaborator

Hi all,

I would be in favor to remove use statements for global PHP classes. There is no need to write use \Exception or use Exception when we can simply write throw new \Exception in the code. It doesn't add any real meaning and it adds more code to type and maintain.

I suggest we just use Propel's and third party classes and keep the use of the \ character in the code when dealing with global PHP classes.

What are your thoughts?

@willdurand
Owner

Yes I agree.

By the way, all exceptions should be the Propel ones, not the PHP exceptions. We have named exceptions in both the Runtime, and the Generator parts, and it's better to use them.

@hhamon
Collaborator

I'm in favor too for using Propel typed exception classes in favor of PHP global exception classes.

@jaugustin
Collaborator

I am ok with that.

Does it apply to Propel lib classes and generated model or only lib classes ?

@hhamon
Collaborator

At least lib classes but it could be also applied to generated code.

@willdurand
Owner

IMO just for lib classes.

@willdurand willdurand closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.