Code Duplication    Length = 31-31 lines in 2 locations

src/Models/Loyalty.php 1 location

@@ 8-38 (lines=31) @@
5
use FLAIRUK\GoodTillSystem\API;
6
use Illuminate\Support\Facades\Config;
7
8
class Loyalty extends API {
9
10
    protected $url;
11
12
    const LOYALTY = 'reward_rules';
13
14
    /**
15
     * Create a new GoodTill instance.
16
     *
17
     * @return void
18
     */
19
    public function __construct($user)
20
    {
21
        parent::__construct($user, $this->url);
22
    }
23
24
    public function setURL(): void {
25
        $this->url = Config::get('goodtill.routes.api') . self::LOYALTY . '/';
26
    }
27
    
28
    /**
29
     * Set Product Outlet ID
30
     * 
31
     * @param string $id
32
     * @return object
33
     */
34
    public function setID(string $id): object {
35
        $this->id = $id;
36
        return $this;
37
    }
38
}
39

src/Models/Voucher.php 1 location

@@ 8-38 (lines=31) @@
5
use FLAIRUK\GoodTillSystem\API;
6
use Illuminate\Support\Facades\Config;
7
8
class Voucher extends API {
9
10
    protected $url;
11
12
    const VOUCHERS = 'vouchers';
13
14
    /**
15
     * Create a new GoodTill instance.
16
     *
17
     * @return void
18
     */
19
    public function __construct($user)
20
    {
21
        parent::__construct($user, $this->url);
22
    }
23
24
    public function setURL(): void {
25
        $this->url = Config::get('goodtill.routes.api') . self::VOUCHERS . '/';
26
    }
27
    
28
    /**
29
     * Set Product Outlet ID
30
     * 
31
     * @param string $id
32
     * @return object
33
     */
34
    public function setID(string $id): object {
35
        $this->id = $id;
36
        return $this;
37
    }
38
}
39