nette/di 3.2 – zapis parametrov a ich vychodzich hodnot v getConfigSchema() rozsirenia

Matúš Matula
Člen | 256
+
0
-

Po commite https://github.com/…4453f8aefa16 prestal fungovat nasledovny kod, kde si v ramci getConfigSchema() rozsirenia nastavujem defaultne hodnoty parametrov a v loadConfiguration() ich nastavujem spat do parametrov Container-a.. tieto sa uz po commite nenastavia vcas pre sluzby a Tracy zahlasi Missing parameter 'hasher'. pri snahe pouzit ten parameter v config.neon definicii sluzby napr. takto:

services:
		Service(%hasher%)
use Models\Hashers\Base;
use Nette\DI\CompilerExtension;
use Nette\Schema\Expect;
use Nette\Schema\Schema;

final class HasherExtension extends CompilerExtension
{
	public function getConfigSchema(): Schema
	{
		return Expect::structure([
			'type' => Expect::string(Base::HASHER_NATIVE),
			'cost' => Expect::int(10),
			'usePortableHashes' => Expect::bool(false),
			'algo' => Expect::int(PASSWORD_DEFAULT),
		]);
	}


	public function loadConfiguration(): void
	{
		$container = $this->getContainerBuilder();
		$container->parameters['hasher'] = $this->config;
	}
}

@DavidGrudl Je toto ziaduce spravanie a nemam to takto pouzivat a musim si nastavit parametre v config.neon explicitne? Kazdopadne je to BC break