Code Duplication    Length = 10-10 lines in 2 locations

src/Endpoints/People.php 1 location

@@ 113-122 (lines=10) @@
110
     *
111
     * @return stdClass
112
     */
113
    public function save(PersonData $data)
114
    {
115
        $id = $data->getId();
116
117
        return $this->run(
118
            $id == null ? 'POST' : 'PUT',
119
            'pedidovenda-rest/pessoas'.($id > 0 ? '/'.$id : null),
120
            ['json' => $data->toArray()]
121
        );
122
    }
123
}
124

src/Endpoints/Products.php 1 location

@@ 63-72 (lines=10) @@
60
     *
61
     * @return stdClass
62
     */
63
    public function save(ProductData $data)
64
    {
65
        $id = $data->getId();
66
67
        return $this->run(
68
            $id == null ? 'POST' : 'PUT',
69
            'operacional/produtos'.($id > 0 ? '/'.$id : null),
70
            ['json' => $data->toArray()]
71
        );
72
    }
73
74
    /**
75
     * Delete a product.