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

Closed
hhamon opened this Issue May 7, 2012 · 5 comments

Comments

Projects
None yet
3 participants
@hhamon
Member

hhamon commented May 7, 2012

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

This comment has been minimized.

Show comment Hide comment
@willdurand

willdurand May 7, 2012

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.

Owner

willdurand commented May 7, 2012

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

This comment has been minimized.

Show comment Hide comment
@hhamon

hhamon May 7, 2012

Member

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

Member

hhamon commented May 7, 2012

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

@jaugustin

This comment has been minimized.

Show comment Hide comment
@jaugustin

jaugustin May 7, 2012

Member

I am ok with that.

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

Member

jaugustin commented May 7, 2012

I am ok with that.

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

@hhamon

This comment has been minimized.

Show comment Hide comment
@hhamon

hhamon May 7, 2012

Member

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

Member

hhamon commented May 7, 2012

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

@willdurand

This comment has been minimized.

Show comment Hide comment
@willdurand

willdurand May 7, 2012

Owner

IMO just for lib classes.

Owner

willdurand commented May 7, 2012

IMO just for lib classes.

@willdurand willdurand closed this Sep 30, 2013

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