Completed
Push — master ( 155db8...3b1b7a )
by CodexShaper
24s queued 10s
created

PaymentMethod::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Codexshaper\WooCommerce\Models;
4
5
use Codexshaper\WooCommerce\Facades\WooCommerce;
6
7 View Code Duplication
class PaymentMethod extends BaseModel
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    protected $endpoint = 'payment_gateways';
10
11
    /**
12
     * Retrieve all Items.
13
     *
14
     * @param array $options
15
     *
16
     * @return array
17
     */
18
    protected function all($options = [])
19
    {
20
        return WooCommerce::all($this->endpoint, $options);
21
    }
22
23
    /**
24
     * Retrieve single Item.
25
     *
26
     * @param int   $id
27
     * @param array $options
28
     *
29
     * @return object
30
     */
31
    protected function find($id, $options = [])
32
    {
33
        return WooCommerce::find("{$this->endpoint}/{$id}", $options);
34
    }
35
}
36