Skip to content

Commit

Permalink
Fixed missing parameter notice
Browse files Browse the repository at this point in the history
  • Loading branch information
fprochazka committed Mar 30, 2014
1 parent 578f923 commit fbbcd50
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Kdyby/DoctrineCache/DI/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ class Helpers extends Nette\Object
* @param \Nette\DI\CompilerExtension $extension
* @param string|\stdClass $cache
* @param string $suffix
* @param bool $debug
* @return string
*/
public static function processCache(Nette\DI\CompilerExtension $extension, $cache, $suffix)
public static function processCache(Nette\DI\CompilerExtension $extension, $cache, $suffix, $debug = NULL)
{
$builder = $extension->getContainerBuilder();

Expand All @@ -54,7 +55,7 @@ public static function processCache(Nette\DI\CompilerExtension $extension, $cach
}

if ($impl === 'default') {
$cache->arguments[1] = 'Doctrine.' . $suffix;
$cache->arguments[1] = 'Doctrine.' . ucfirst($suffix);
}

$def = $builder->addDefinition($serviceName = $extension->prefix('cache.' . $suffix))
Expand All @@ -64,7 +65,11 @@ public static function processCache(Nette\DI\CompilerExtension $extension, $cach
->setInject(FALSE);

if ($impl === 'default') {
$def->factory->arguments[2] = $builder->parameters[$extension->prefix('debug')];
if ($debug === NULL) {
$debug = $builder->parameters['debugMode'];
}

$def->factory->arguments[2] = $debug;
}

return '@' . $serviceName;
Expand Down

0 comments on commit fbbcd50

Please sign in to comment.