Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Config handler #722

Closed
wants to merge 2 commits into from

2 participants

@designermonkey

Missed an obvious two functions.

@designermonkey

I will have to rebase develop into this branch to pass tests :(

@codeguy
Owner

@designermonkey Is this PR still valid?

@designermonkey

Yeah, sorry, need to fix this up.

@designermonkey designermonkey deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 29, 2013
  1. @designermonkey
Commits on Dec 30, 2013
  1. @designermonkey
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 9 deletions.
  1. +15 −9 Slim/Configuration.php
View
24 Slim/Configuration.php
@@ -89,9 +89,7 @@ class Configuration implements ConfigurationInterface, \IteratorAggregate
*/
public function __construct(ConfigurationHandlerInterface $handler)
{
- $this->handler = $handler;
-
- $this->setDefaults();
+ $this->setHandler($handler);
}
/**
@@ -120,14 +118,22 @@ public function getDefaults()
}
/**
- * Call a method from the handler
- * @param string $method
- * @param array $params
- * @return mixed
+ * Set a configuration handler and provide it some defaults
+ * @param \Slim\Interfaces\ConfigurationHandlerInterface $handler
+ */
+ public function setHandler(ConfigurationHandlerInterface $handler)
+ {
+ $this->handler = $handler;
+ $this->setDefaults();
+ }
+
+ /**
+ * Get the configuration handler for access
+ * @return \Slim\Interfaces\ConfigurationHandlerInterface
*/
- public function callHandlerMethod($method, array $params = array())
+ public function getHandler()
{
- return call_user_func_array(array($this->handler, $method), $params);
+ return $this->handler;
}
/**
Something went wrong with that request. Please try again.