Passed
Push — master ( 92224a...b0c10d )
by nguereza
03:55 queued 01:47
created

ProductCategoriesSeed   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 28
c 1
b 0
f 0
dl 0
loc 39
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 36 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 ProductCategoriesSeed 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' => 'Computer',
19
        'description' => NULL,
20
        'created_at' => '2023-12-07 05:54:51',
21
        'updated_at' => '2023-12-07 05:57:41',
22
    ],
23
    1 => [
24
        'id' => 2,
25
        'name' => 'Cars',
26
        'description' => NULL,
27
        'created_at' => '2023-12-07 05:55:06',
28
        'updated_at' => NULL,
29
    ],
30
    2 => [
31
        'id' => 3,
32
        'name' => 'Medicaments ',
33
        'description' => NULL,
34
        'created_at' => '2023-12-07 05:55:19',
35
        'updated_at' => NULL,
36
    ],
37
    3 => [
38
        'id' => 4,
39
        'name' => 'Others',
40
        'description' => NULL,
41
        'created_at' => '2023-12-07 05:55:28',
42
        'updated_at' => NULL,
43
    ],
44
];
45
        foreach ($data as $row) {
46
            $this->insert($row)->into('product_categories');
47
        }
48
        
49
    }
50
}