Permalink
Browse files

added better error message for when non-injectable parameter is encou…

…ntered
  • Loading branch information...
1 parent 62e75d2 commit 9b581c2f52e9423347a07a158d43991ebe304ebb @rodnaph rodnaph committed Jan 4, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/BoxUK/Inject/Standard.class.php
@@ -239,6 +239,14 @@ protected function getMethodParams( $className, $methodName ) {
$createClass = $this->getParamClass(
$className, $methodName, $paramName, $paramClass
);
+ if ( !$createClass ) {
+ throw new \Exception(sprintf(
+ 'Non-injectable parameter found in method marked for injection: %s->%s( %s )',
+ $className,
+ $methodName,
+ $paramName
+ ));
+ }
$params[] = $this->getClass( $createClass );
}

0 comments on commit 9b581c2

Please sign in to comment.