Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Replace factory in provider by something better #13

Closed
bakura10 opened this issue Oct 26, 2012 · 4 comments
Closed

Replace factory in provider by something better #13

bakura10 opened this issue Oct 26, 2012 · 4 comments

Comments

@bakura10
Copy link
Member

My IDE (PHPStorm) complains about an abstract static function. It does not throw an error but says this is not a recommanded practice. I think we should follow ZF pattern and have a Factory class instead.

What do you think ?

@ghost
Copy link

ghost commented Oct 26, 2012

What exactly are you referring to? I'm ashamed if I have an abstract static function somewhere...

@bakura10
Copy link
Member Author

You had a static function in an interface, PHPStorm considered it as "abstract".

Either way, I'm also modified your code, I have removed your ProviderInterface and replaced it by making the AbstractProvider implementing the ListenerAggregateInterface from ZF 2.

@bakura10
Copy link
Member Author

But we'd better have a Factory class, so we do Factory::factory($config) instead of the $class::factory($config). It looks cleaner to me.

@ghost
Copy link

ghost commented Oct 29, 2012

+1

@ghost ghost self-assigned this Nov 1, 2012
@jmleroux
Copy link
Contributor

You had a static function in an interface, PHPStorm considered it as "abstract".

Maybe it's because the abstract class AbstractProvider implements ProviderInterface without providing factory implementation.
Indeed, a bit strange...

bakura10 added a commit that referenced this issue Nov 26, 2013
PHP 5.4 array syntax seriously everywhere *
@bakura10
Copy link
Member Author

Everything's been fixed by refactor.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants