Code Duplication    Length = 10-10 lines in 2 locations

src/Request.php 2 locations

@@ 759-768 (lines=10) @@
756
     * @throws \InvalidArgumentException Throws an exception when {@link $key is invalid}.
757
     * @see Request::getQuery()
758
     */
759
    public function setQuery($key, $value = null) {
760
        if (is_string($key)) {
761
            $this->env['QUERY'][$key] = $value;
762
        } elseif (is_array($key)) {
763
            $this->env['QUERY'] = $key;
764
        } else {
765
            throw new \InvalidArgumentException("Argument 1 must be a string or array.", 422);
766
        }
767
        return $this;
768
    }
769
770
    /**
771
     * Get an item from the input array.
@@ 792-801 (lines=10) @@
789
     * @return Request Returns $this for fluent call.
790
     * @throws \InvalidArgumentException Throws an exception when {@link $key is invalid}.
791
     */
792
    public function setInput($key, $value = null) {
793
        if (is_string($key)) {
794
            $this->env['INPUT'][$key] = $value;
795
        } elseif (is_array($key)) {
796
            $this->env['INPUT'] = $key;
797
        } else {
798
            throw new \InvalidArgumentException("Argument 1 must be a string or array.", 422);
799
        }
800
        return $this;
801
    }
802
803
    /**
804
     * Gets the query on input depending on the http method.