src/Configurator.php
public function consumeOption(string $name)
    {
        $this->validateName($name);

        if (!array_key_exists($name, $this->config)) {
            return null;
        }
        $value = $this->config[$name];

        $this->flushOption($name);

        return $value;
    }
public function consumeOption(string $name)
    {
        $this->validateName($name);

        if (!array_key_exists($name, $this->config)) {
            return null;
        }
        $value = $this->config[$name];

        $this->flushOption($name);

        return $value;
    }
public function consumeOption ( string $ name ) { $ this -> validateName ( $ name ) ; if ( ! array_key_exists ( $ name , $ this -> config ) ) { return null ; } $ value = $ this -> config [ $ name ] ; $ this -> flushOption ( $ name ) ; return $ value ; }
Read then flush an option.

Exemple:

Config:
```php
$config = [
'key1' => 'value1'
];
```
Usage:
```php
$result = $this->consumeOption('key1');
```
Result:
```php
echo $result; // value1
var_dump($config); // []
```

@param string $name The name of the option to read then flush.

@return mixed
Read then flush an option .