for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Install GitHub App
<?php
namespace App\Model;
use Carbon\Carbon;
use App\Classes\Interfaces\AuditInterface;
use OwenIt\Auditing\Models\Audit as Auditing;
/**
* Class Audit.
*
* @property int $id
* @property int $user_id
* @property string $event
* @property int $auditable_id
* @property string $auditable_type
* @property array $old_values
* @property array $new_values
* @property string $url
* @property string $ip_address
* @property string $user_agent
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Account $user
* @property AuditInterface $auditable
*/
class Audit extends Auditing
{
public function afterActionVerb()
switch ($this->event) {
case 'created': return 'created the'; break;
break
The break statement is not necessary if it is preceded for example by a return statement:
return
switch ($x) { case 1: return 'foo'; break; // This break is not necessary and can be left off. }
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.
case
case 'deleted': return 'deleted the'; break;
case 'updated': return 'updated the'; break;
}
return false;
public function beforeActionVerb()
case 'created': return 'was generated'; break;
case 'deleted': return 'was destroyed'; break;
case 'updated': return 'was modified'; break;
public function model()
return explode('\\', $this->auditable_type)[2];
The
breakstatement is not necessary if it is preceded for example by areturnstatement:If you would like to keep this construct to be consistent with other
casestatements, you can safely mark this issue as a false-positive.