Skip to content

Commit

Permalink
typos, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 7, 2011
1 parent 84fba77 commit 58215b8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Nette/Config/Configurator.php
Expand Up @@ -172,7 +172,7 @@ protected function createContainer($file = NULL, $section = NULL)
Nette\Utils\LimitedScope::evaluate('<?php ' . $this->buildContainer(array()));
}

$class = $this->formatContainerClassName();
$class = $this->formatContainerClass();
$this->container = new $class;
$this->container->initialize();
}
Expand All @@ -191,7 +191,7 @@ protected function buildContainer(array $config, array & $dependencies = array()
$compiler = $this->createCompiler();
$this->onCompile($this, $compiler);

$code = $compiler->compile($config, $this->formatContainerClassName());
$code = $compiler->compile($config, $this->formatContainerClass());
$dependencies = array_merge($dependencies, $compiler->getContainer()->getDependencies());
return $code;
}
Expand Down Expand Up @@ -232,7 +232,7 @@ protected function createCompiler()



public function formatContainerClassName()
public function formatContainerClass()
{
return 'SystemContainer';
}
Expand Down
6 changes: 3 additions & 3 deletions Nette/Config/Extensions/NetteExtension.php
Expand Up @@ -32,10 +32,10 @@ public function loadConfiguration(ContainerBuilder $container, array $config)
->setClass('Nette\Caching\Storages\FileJournal', array('%tempDir%'));

$container->addDefinition('cacheStorage')
->setClass('Nette\Caching\Storages\FileStorage', array('%tempDir%/cache'));
->setClass('Nette\Caching\Storages\FileStorage', array('%tempDir%'));

$container->addDefinition('templateCacheStorage')
->setClass('Nette\Caching\Storages\PhpFileStorage', array('%tempDir%/cache'))
->setClass('Nette\Caching\Storages\PhpFileStorage', array('%tempDir%'))
->setAutowired(FALSE);

// http
Expand Down Expand Up @@ -102,7 +102,7 @@ public function afterCompile(ContainerBuilder $container, Nette\Utils\PhpGenerat
$initialize = $class->methods['initialize'];

if (isset($container->parameters['tempDir'])) {
$initialize->addBody($this->checkTempDir($container->expand('%tempDir%/cache')));
$initialize->addBody($this->checkTempDir($container->expand($container->parameters['tempDir'])));
}
foreach ($container->findByTag('run') as $name => $foo) {
$initialize->addBody('$this->getService(?);', array($name));
Expand Down
2 changes: 1 addition & 1 deletion Nette/DI/Container.php
Expand Up @@ -256,7 +256,7 @@ public function createInstance($class, array $args = array())
return $rc->newInstanceArgs(Helpers::autowireArguments($constructor, $args, $this));

} elseif ($args) {
throw new Nette\InvalidArgumentException("Unable to pass arguments, class $class has not constructor.");
throw new Nette\InvalidArgumentException("Unable to pass arguments, class $class has no constructor.");
}
return new $class;
}
Expand Down
4 changes: 2 additions & 2 deletions Nette/DI/ContainerBuilder.php
Expand Up @@ -280,7 +280,7 @@ public function generateClass()
try {
$type = $definition->class ? $this->expand($definition->class) : 'object';
$class->addDocument("@property $type \$$name");
$class->addMethod('createService' . ucfirst($name))
$class->addMethod('createService' . preg_replace('#[^\w\x7f-\xff]#', '_', ucfirst($name)))
->addDocument("@return $type")
->setVisibility('protected')
->setBody($name === self::THIS_CONTAINER ? 'return $this;' : $this->generateService($name));
Expand Down Expand Up @@ -317,7 +317,7 @@ private function generateService($name)
$this->addDependency($constructor->getFileName());
$arguments = Helpers::autowireArguments($constructor, $arguments, $this);
} elseif ($arguments) {
throw new ServiceCreationException("Unable to pass arguments, class $class has not constructor.");
throw new ServiceCreationException("Unable to pass arguments, class $class has no constructor.");
}
$code = $this->formatPhp("\$service = new $class" . ($arguments ? '(?*);' : ';'), array($arguments));

Expand Down

0 comments on commit 58215b8

Please sign in to comment.