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

ModelCleanedEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 1
cc 1
eloc 3
nc 1
nop 2
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
}