Passed
Pull Request — master (#92)
by Fèvre
09:56 queued 04:55
created

ShopItemRepository::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 2
rs 10
1
<?php
2
namespace Xetaravel\Models\Repositories;
3
4
use Illuminate\Support\Collection;
5
use Xetaravel\Models\ShopItem;
6
7
class ShopItemRepository
8
{
9
    /**
10
     * Find the latest shop items for the sidebar.
11
     *
12
     * @return \Illuminate\Database\Eloquent\Collection
13
     */
14
    public static function sidebar(): Collection
15
    {
16
        return ShopItem::latest()->take(config('xetaravel.shop.items_sidebar'))->get();
17
    }
18
19
    /**
20
     * Create the new article and save it.
21
     *
22
     * @param array $data The data used to create the shop item.
23
     *
24
     * @return \Xetaravel\Models\ShopItem
25
     */
26
    public static function create(array $data): ShopItem
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    public static function create(/** @scrutinizer ignore-unused */ array $data): ShopItem

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

Loading history...
27
    {
28
    }
29
30
    /**
31
     * Update the shop item data and save it.
32
     *
33
     * @param array $data The data used to update the shop item.
34
     * @param \Xetaravel\Models\ShopItem $item The shop item to update.
35
     *
36
     * @return \Xetaravel\Models\ShopItem
37
     */
38
    public static function update(array $data, ShopItem $item): ShopItem
0 ignored issues
show
Unused Code introduced by
The parameter $item is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

38
    public static function update(array $data, /** @scrutinizer ignore-unused */ ShopItem $item): ShopItem

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

Loading history...
Unused Code introduced by
The parameter $data is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

38
    public static function update(/** @scrutinizer ignore-unused */ array $data, ShopItem $item): ShopItem

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

Loading history...
39
    {
40
    }
41
}
42