Code Duplication    Length = 13-13 lines in 2 locations

src/api/Congress.php 1 location

@@ 81-93 (lines=13) @@
78
     *
79
     * @return Response         API Response
80
     */
81
    public function legislators($search = [], $fields = [])
82
    {
83
        $url = 'legislators?';
84
        if (count($search) > 0) {
85
            $p = [];
86
            foreach ($search as $k => $v) {
87
                $p[] = "$k=$v";
88
            }
89
            $url .= implode("&", $p);
90
        }
91
92
        return $this->get($url, $fields);
93
    }
94
95
    /**
96
     * Find reps for a given zip

src/api/OpenStates.php 1 location

@@ 81-93 (lines=13) @@
78
     *
79
     * @return Response         Guzzle Response
80
     */
81
    public function legislators($search = [], $fields = [])
82
    {
83
        $url = 'legislators/?';
84
        if (count($search) > 0) {
85
            $p = [];
86
            foreach ($search as $k => $v) {
87
                $p[] = "$k=$v";
88
            }
89
            $url .= implode("&", $p);
90
        }
91
92
        return $this->get($url, $fields);
93
    }
94
95
    /**
96
     * Lookup legislators that serve districts containing a given point