Completed
Pull Request — master (#5)
by
unknown
02:04
created

ModelCleanedEvent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 19
rs 10
c 1
b 0
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
namespace Spatie\ModelCleanup;
4
5
use App\Events\Event;
6
use Illuminate\Queue\SerializesModels;
7
8
class ModelCleanedEvent extends Event
9
{
10
11
    public $modelName;
12
    public $numberOfDeletedRecords;
13
14
    /**
15
     * Create a new event instance.
16
     *
17
     * @param  string  $modelName
18
     * @param  int  $deletedRecords
0 ignored issues
show
Documentation introduced by
There is no parameter named $deletedRecords. Did you maybe mean $numberOfDeletedRecords?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
19
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
20
     */
21
    public function __construct(string $modelName, int $numberOfDeletedRecords)
22
    {
23
        $this->modelName = $modelName;
24
        $this->numberOfDeletedRecords = $numberOfDeletedRecords;
25
    }
26
}