Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Phalcon\DiInterface #2034

Merged
merged 3 commits into from Feb 12, 2014
Merged

Clean up Phalcon\DiInterface #2034

merged 3 commits into from Feb 12, 2014

Conversation

ghost
Copy link

@ghost ghost commented Feb 12, 2014

!!! The below affects only Phalcon\DiInterface, no changes were made to Phalcon\DI itself.

  • Remove setShared() method because it is a shorthand for set($name, $definition, true);
  • Remove attempt() method because it is a shorthand for has() + set()
  • Rename setRaw() to setService() because getRaw() is actually getService() + $service->getDefinition()
  • Remove getRaw() because it is getService() + $service->getDefinition()
  • Modify setService($name, $raw_definition) to setService($raw_definition) because service name can be retrieved from the definition.

This results in

interface DiInterface
{
    public function set($name, $definiton, $shared = null);
    public function remove($name);
    public function get($name, $parameters = null);
    public function getShared($name, $parameters = null);
    public function getService($name);
    public function setService($raw_definition);
    public function has($name);
    public function wasFreshInstance();
    public function getServices();
    public static function setDefault($dependency_injector);
    public static function getDefault();
    public static function reset();
}

* Remove `setShared()` method because it is a shorthand for
  `set($name, $definition, true)`;
* Remove `attempt()` method because it is a shorthand for
  `has()` + `set()`
* Rename `setRaw()` to `setService()` because `getRaw()`
  is actually `getService()` + `$service->getDefinition()`
* Remove `getRaw()` because it is `getService()` +
  `$service->getDefinition()`
* Modify `setService($name, $raw_definition)` to
  `setService($raw_definition)` because service name
  can be retrieved from the definition.
phalcon pushed a commit that referenced this pull request Feb 12, 2014
@phalcon phalcon merged commit 17f7315 into phalcon:1.3.0 Feb 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants