for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Xetaravel\Models\Repositories;
use Illuminate\Support\Collection;
use Xetaravel\Models\ShopItem;
class ShopItemRepository
{
/**
* Find the latest shop items for the sidebar.
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public static function sidebar(): Collection
return ShopItem::latest()->take(config('xetaravel.shop.items_sidebar'))->get();
}
* Create the new article and save it.
* @param array $data The data used to create the shop item.
* @return \Xetaravel\Models\ShopItem
public static function create(array $data): ShopItem
$data
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
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.
* Update the shop item data and save it.
* @param array $data The data used to update the shop item.
* @param \Xetaravel\Models\ShopItem $item The shop item to update.
public static function update(array $data, ShopItem $item): ShopItem
$item
public static function update(array $data, /** @scrutinizer ignore-unused */ ShopItem $item): ShopItem
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.