Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Push — main ( cf8535...d81b4d )
by Pedro
20:46 queued 05:46
created

Table.php$0 ➔ getName()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Backpack\CRUD\app\Library\Database;
4
5
final class Table
6
{
7
    private array $columns;
8
9
    public function __construct(array $columns = [])
10
    {
11
        foreach ($columns as $column) {
12
            $this->columns[$column['name']] = new class($column)
13
            {
14
                public function __construct(private array $column)
15
                {
16
                }
17
18
                public function getName()
19
                {
20
                    return $this->column['name'];
21
                }
22
23
                public function getNotnull()
24
                {
25
                    return ! $this->column['nullable'];
26
                }
27
28
                public function getDefault()
29
                {
30
                    return $this->column['default'];
31
                }
32
33
                public function getType()
34
                {
35
                    return new class($this->column)
36
                    {
37
                        public function __construct(private array $column)
38
                        {
39
                        }
40
41
                        public function getName()
42
                        {
43
                            return $this->column['type_name'];
44
                        }
45
                    };
46
                }
47
            };
48
        }
49
    }
50
51
    public function getColumns()
52
    {
53
        return $this->columns;
54
    }
55
56
    public function hasColumn(string $columnName)
57
    {
58
        return isset($this->columns[$columnName]);
59
    }
60
61
    public function getColumn(string $columnName)
62
    {
63
        return $this->columns[$columnName];
64
    }
65
}
66