PrimaryKey   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 10
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validate() 0 3 2
A __construct() 0 3 1
1
<?php
2
namespace Lepton\Boson\DataTypes;
3
4
#[\Attribute]
5
class PrimaryKey extends Field{
6
  public function __construct(mixed ...$options){
7
    $this->null = false;
8
    parent::__construct(...$options);
0 ignored issues
show
Bug introduced by
$options is expanded, but the parameter $null of Lepton\Boson\DataTypes\Field::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

8
    parent::__construct(/** @scrutinizer ignore-type */ ...$options);
Loading history...
9
  }
10
11
  public function validate($value){
12
    if(!is_numeric($value)) return false;
13
    return parent::validate($value);
14
}
15
}