Passed
Branch master (130303)
by DeGracia
02:26
created

BaseOccurence::parse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
namespace DeGraciaMathieu\Riddler\Occurences;
4
    
5
abstract class BaseOccurence
6
{
7
    public function parse(array $dictionary)
8
    {
9
        $tmp = [];
10
11
        for ($i=0; $i < $this->size; $i++) {
0 ignored issues
show
Bug introduced by
The property size does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
12
13
            shuffle($dictionary);
14
15
            $tmp[] = $dictionary[0];
16
        }
17
18
       return $tmp;
19
    }
20
}
21