src/Command/CommandBase.php
protected function checkKeyExists($data, $key)
    {
        if (!$data->has($key)) {
            $this->output->writeln("<error>The key $key does not exist.");

            return false;
        }

        return true;
    }
protected function checkKeyExists($data, $key)
    {
        if (!$data->has($key)) {
            $this->output->writeln("<error>The key $key does not exist.");

            return false;
        }

        return true;
    }
protected function checkKeyExists ( $ data , $ key ) { if ( ! $ data -> has ( $ key ) ) { $ this -> output -> writeln ( "<error>The key $key does not exist." ) ; return false ; } return true ; }
Checks if a key exists in an array.

Supports dot notation for keys. E.g., first.second.parts.

@param array $data
The array of data that may contain key.
@param string $key
The array key, optionally in dot notation format.

@return bool
Checks if a key exists in an array .