Client   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 12.5%

Importance

Changes 3
Bugs 1 Features 2
Metric Value
wmc 8
c 3
b 1
f 2
lcom 0
cbo 0
dl 0
loc 57
ccs 2
cts 16
cp 0.125
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A clientUsersAdd() 0 4 1
A clientUsersDelete() 0 4 1
A clientUsersSave() 0 4 1
A clientUsersImport() 0 4 1
A clientUsersExport() 0 4 1
A clientUsersGet() 0 4 1
A clientUsersGetAll() 0 4 1
A clientGetAll() 0 4 1
1
<?php
2
namespace Xigen\Shortcuts;
3
4
trait Client
5
{
6
    // Client.php
7
8
    // Users.php
9
    /**
10
     * TODO: Add POST options
11
     */
12
    public function clientUsersAdd()
13
    {
14
        return $this->get('client/users/add/');
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
15
    }
16
17
    public function clientUsersDelete($Hash)
18
    {
19
        return $this->get('client/users/delete/' . $Hash);
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
20
    }
21
22
    /**
23
     * TODO: Add POST options
24
     */
25
    public function clientUsersSave($Hash)
0 ignored issues
show
Unused Code introduced by
The parameter $Hash is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
    {
27
        return $this->get('client/users/save/');
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
28
    }
29
30
    /**
31
     * TODO: Add POST options
32
     */
33
    public function clientUsersImport($Hash)
0 ignored issues
show
Unused Code introduced by
The parameter $Hash is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
    {
35
        return $this->get('client/users/import/');
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
36
    }
37
38
    public function clientUsersExport($Hash)
39
    {
40
        return $this->get('client/users/export/' . $Hash);
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
41
    }
42
43
    public function clientUsersGet($Hash)
44
    {
45
        return $this->get('client/users/getall/' . $Hash);
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
46
    }
47
48 2
    public function clientUsersGetAll($start = 0, $limit = 25)
49
    {
50 2
        return $this->get('client/users/getall/null/' . $start . '/ ' . $limit);
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
51
    }
52
53
    /**
54
     * Keeping backwords compatibility of clientUsersGetAll() function
55
     */
56
    public function clientGetAll($start = 0, $limit = 25)
57
    {
58
        return $this->clientUsersGetAll($start, $limit);
59
    }
60
}
61