ProductsSeed20240616000002   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 22
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 28 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Platine\Framework\Migration\Seed;
5
6
use Platine\Framework\Migration\Seed\AbstractSeed;
7
8
class ProductsSeed20240616000002 extends AbstractSeed
9
{
10
11
    public function run(): void
12
    {
13
      //Action when run the seed
14
      
15
        $data = [
16
    0 => [
17
        'id' => 1,
18
        'name' => 'Toyota Corolla Verso 1.8',
19
        'description' => NULL,
20
        'price' => 3467.0,
21
        'quantity' => 2.0,
22
        'product_category_id' => 2,
23
        'created_at' => '2023-12-07 06:21:59',
24
        'updated_at' => NULL,
25
    ],
26
    1 => [
27
        'id' => 2,
28
        'name' => 'HP 840',
29
        'description' => NULL,
30
        'price' => 890.0,
31
        'quantity' => 14.0,
32
        'product_category_id' => 1,
33
        'created_at' => '2023-12-07 06:26:46',
34
        'updated_at' => '2023-12-07 14:18:29',
35
    ],
36
];
37
        foreach ($data as $row) {
38
            $this->insert($row)->into('products');
39
        }
40
        
41
    }
42
}