PhpCsFixer\Console\ConfigurationResolver::setOption PHP Méthode

setOption() private méthode

Set option that will be resolved.
private setOption ( string $name, mixed $value )
$name string
$value mixed
    private function setOption($name, $value)
    {
        if (!array_key_exists($name, $this->options)) {
            throw new InvalidConfigurationException(sprintf('Unknown option name: "%s".', $name));
        }
        $this->options[$name] = $value;
    }

Usage Example

 public function testResolveRulesWithConfigAndOption()
 {
     $this->config->setRules(array('braces' => true, 'strict_comparison' => false));
     $this->resolver->setOption('rules', 'blank_line_before_return');
     $this->resolver->resolve();
     $this->assertSameRules(array('blank_line_before_return' => true), $this->resolver->getRules());
 }