Completed
Push — develop ( 8632b6...107510 )
by Alex
02:03
created

JsonApiControllerActions::store()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
nc 1
cc 1
eloc 2
nop 1
1
<?php
2
3
namespace Huntie\JsonApi\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
7
/**
8
 * Add default resource controller methods for JsonApiController actions.
9
 *
10
 * @method indexAction()
11
 * @method storeAction()
12
 * @method showAction()
13
 * @method updateAction()
14
 * @method destroyAction()
15
 */
16
trait JsonApiControllerActions
17
{
18
    /**
19
     * Return a listing of the resource.
20
     *
21
     * @param Request $request
22
     *
23
     * @return \Huntie\JsonApi\Http\JsonApiResponse
24
     */
25
    public function index(Request $request)
26
    {
27
        return parent::indexAction($request);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (indexAction() instead of index()). Are you sure this is correct? If so, you might want to change this to $this->indexAction().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
28
    }
29
30
    /**
31
     * Store a new record.
32
     *
33
     * @param Request $request
34
     *
35
     * @return \Huntie\JsonApi\Http\JsonApiResponse
36
     */
37
    public function store(Request $request)
38
    {
39
        return parent::storeAction($request);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (storeAction() instead of store()). Are you sure this is correct? If so, you might want to change this to $this->storeAction().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
40
    }
41
42
    /**
43
     * Return a specified record.
44
     *
45
     * @param Request $request
46
     * @param int     $id
47
     *
48
     * @return \Huntie\JsonApi\Http\JsonApiResponse
49
     */
50
    public function show(Request $request, $id)
51
    {
52
        return parent::showAction($request, $id);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (showAction() instead of show()). Are you sure this is correct? If so, you might want to change this to $this->showAction().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
53
    }
54
55
    /**
56
     * Update a specified record.
57
     *
58
     * @param Request $request
59
     * @param int     $id
60
     *
61
     * @return \Huntie\JsonApi\Http\JsonApiResponse
62
     */
63
    public function update(Request $request, $id)
64
    {
65
        return parent::updateAction($request, $id);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (updateAction() instead of update()). Are you sure this is correct? If so, you might want to change this to $this->updateAction().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
66
    }
67
68
    /**
69
     * Destroy a specified record.
70
     *
71
     * @param Request $request
72
     * @param int     $id
73
     *
74
     * @return \Huntie\JsonApi\Http\JsonApiResponse
75
     */
76
    public function destroy(Request $request, $id)
77
    {
78
        return parent::destroyAction($request, $id);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (destroyAction() instead of destroy()). Are you sure this is correct? If so, you might want to change this to $this->destroyAction().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
79
    }
80
}
81