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

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