public function isValidDataArray(array $data)
    {
        if (count($data) === 0)
        {
            return true;
        }

        $result = true;
        foreach ($data as $object)
        {
            if (!is_array($object))
            {
                $result = false;
                break;
            }
            if (count($object) < 2)
            {
                $result = false;
                break;
            }
            $name = current($object);
            if (empty($name))
            {
                $result = false;
                break;
            }
            next($object);
            $value = current($object);
            if (!is_string($value)
                && !is_int($value)
                && !is_double($value)
                && !is_array($value)
                && !is_bool($value)
                && !is_null($value)
                && !is_object($value)
            )
            {
                $result = false;
                break;
            }
        }

        return $result;
    }
public function isValidDataArray(array $data)
    {
        if (count($data) === 0)
        {
            return true;
        }

        $result = true;
        foreach ($data as $object)
        {
            if (!is_array($object))
            {
                $result = false;
                break;
            }
            if (count($object) < 2)
            {
                $result = false;
                break;
            }
            $name = current($object);
            if (empty($name))
            {
                $result = false;
                break;
            }
            next($object);
            $value = current($object);
            if (!is_string($value)
                && !is_int($value)
                && !is_double($value)
                && !is_array($value)
                && !is_bool($value)
                && !is_null($value)
                && !is_object($value)
            )
            {
                $result = false;
                break;
            }
        }

        return $result;
    }
public function isValidDataArray ( array $ data ) { if ( count ( $ data ) === 0 ) { return true ; } $ result = true ; foreach ( $ data as $ object ) { if ( ! is_array ( $ object ) ) { $ result = false ; break ; } if ( count ( $ object ) < 2 ) { $ result = false ; break ; } $ name = current ( $ object ) ; if ( empty ( $ name ) ) { $ result = false ; break ; } next ( $ object ) ; $ value = current ( $ object ) ; if ( ! is_string ( $ value ) && ! is_int ( $ value ) && ! is_double ( $ value ) && ! is_array ( $ value ) && ! is_bool ( $ value ) && ! is_null ( $ value ) && ! is_object ( $ value ) ) { $ result = false ; break ; } } return $ result ; }
Checks if the data for a given item is correct

@param array $data

@return bool
Checks if the data for a given item is correct