Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
19 | class MediaRecord extends Record |
||
20 | { |
||
21 | /** |
||
22 | * @param \Nip\Records\AbstractModels\Record $model |
||
23 | */ |
||
24 | public function populateFromFile(File $file) |
||
25 | { |
||
26 | $this->file_name = $file->getName(); |
||
27 | $this->path = $file->getPath(); |
||
|
|||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param \Nip\Records\AbstractModels\Record $model |
||
32 | */ |
||
33 | public function populateFromModel(Record $model) |
||
34 | { |
||
35 | $this->model = $model->getManager()->getMorphName(); |
||
36 | $this->model_id = $model->getPrimaryKey(); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @param $collection |
||
41 | */ |
||
42 | public function populateFromCollection($collection) |
||
46 | } |
||
47 | } |
||
48 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.