public static function requireParameters($parameters, $required)
    {
        //Work with arrays
        if (is_object($parameters)) {
            $parameters = (array)$parameters;
        }

        $missing = [];

        if (!is_array($required)) {
            $required = [$required];
        }

        foreach ($required as $key) {
            if (!isset($parameters[$key])) {
                array_push($missing, $key);
            }
        }

        if (count($missing)) {
            throw new MissingParametersException($missing);
        }
    }
public static function requireParameters($parameters, $required)
    {
        //Work with arrays
        if (is_object($parameters)) {
            $parameters = (array)$parameters;
        }

        $missing = [];

        if (!is_array($required)) {
            $required = [$required];
        }

        foreach ($required as $key) {
            if (!isset($parameters[$key])) {
                array_push($missing, $key);
            }
        }

        if (count($missing)) {
            throw new MissingParametersException($missing);
        }
    }
public static function requireParameters ( $ parameters , $ required ) { //Work with arrays if ( is_object ( $ parameters ) ) { $ parameters = ( array ) $ parameters ; } $ missing = [ ] ; if ( ! is_array ( $ required ) ) { $ required = [ $ required ] ; } foreach ( $ required as $ key ) { if ( ! isset ( $ parameters [ $ key ] ) ) { array_push ( $ missing , $ key ) ; } } if ( count ( $ missing ) ) { throw new MissingParametersException ( $ missing ) ; } }
Check if required parameters are set
@param  array|object $parameters Request's parameters
@param  string|array $required The required parameters
@throws \Phramework\Exceptions\MissingParametersException
Check if required parameters are set