public function expect( $name, $filter, $options = null ) {
		$options = ( is_array( $options ) ) ? $options : [];
		$flags = null;
		$required = false;
		$validate = null;

		if ( isset( $options['flags'] ) ) {
			$flags = $options['flags'];
			unset( $options['flags'] );
		}

		if ( isset( $options['required'] ) ) {
			$required = $options['required'];
			unset( $options['required'] );
		}

		if ( isset( $options['validate'] ) ) {
			$validate = $options['validate'];
			unset( $options['validate'] );
		}

		if ( $filter === \FILTER_CALLBACK ) {
			if ( !isset( $options['callback'] ) ||
				!is_callable( $options['callback'] )
			) {
				throw new \InvalidArgumentException(
					'FILTER_CALLBACK requires a valid callback.'
				);
			}
			$options = $options['callback'];
		}

		$this->params[$name] = [
			'filter'   => $filter,
			'flags'    => $flags,
			'options'  => $options,
			'required' => $required,
			'validate' => $validate,
		];

		return $this;
	}