private function checkIfSet($key, array $data)
    {
        $keyExists = array_key_exists($key, $data);

        return $keyExists && $data[$key] !== null && $data[$key] !== '';
    }
private function checkIfSet($key, array $data)
    {
        $keyExists = array_key_exists($key, $data);

        return $keyExists && $data[$key] !== null && $data[$key] !== '';
    }
private function checkIfSet ( $ key , array $ data ) { $ keyExists = array_key_exists ( $ key , $ data ) ; return $ keyExists && $ data [ $ key ] !== null && $ data [ $ key ] !== '' ; }
Checks if data is set.

@param string $key
@param array $data

@return bool
Checks if data is set .