PHPixie/Project

Hardcoded class names

philsturgeon opened this issue · 2 comments

In modules/orm/classes/orm.php (and many of your classes) you reference methods from the current class with the fully qualified name:

$rel_model = ORM::factory($rel['model']);

This destroys any ability for people to extend classes and override methods. You really should use this:

$rel_model = static::factory($rel['model']);

If it's an instance, you should do:

$rel_model = $this->factory($rel['model']);

But calling the class name from the class is unnecessary and restrictive.

yup, will place static:: there.

To sum it all up the real issue were:
using strtolower twice in a conditional statement
using count isnide a loop
using a class name instead of static twice

While those are things that need fixing, do they really qualify as "bad code"?

Yep, this is all bad code. I figure you can get the little stuff right before moving on to the big stuff.

Phil Sturgeon

On Tuesday, 9 April 2013 at 04:39, dracony wrote:

yup, will place static:: there.
To sum it all up the real issue were:
using strtolower twice in a conditional statement
using count isnide a loop
using a class name instead of static twice
While those are things that need fixing, do they really qualify as "bad code"?


Reply to this email directly or view it on GitHub (#9 (comment)).