| Total Complexity | 10 |
| Total Lines | 101 |
| Duplicated Lines | 0 % |
| Coverage | 50% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class Life |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * World object acts as an info card. |
||
| 13 | * |
||
| 14 | * @var World |
||
| 15 | */ |
||
| 16 | private $world; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * DAO of organisms |
||
| 20 | * |
||
| 21 | * @var Organisms |
||
| 22 | */ |
||
| 23 | private $organisms; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Keeps the number of current generation. |
||
| 27 | * |
||
| 28 | * @var int |
||
| 29 | */ |
||
| 30 | private $generations = 0; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Life constructor. |
||
| 34 | * @param World $world |
||
| 35 | * @param Organisms $organisms |
||
| 36 | */ |
||
| 37 | 7 | public function __construct(World $world, Organisms $organisms) |
|
| 38 | { |
||
| 39 | 7 | $this->world = $world; |
|
| 40 | 7 | $this->organisms = $organisms; |
|
| 41 | 7 | } |
|
| 42 | |||
| 43 | /** |
||
| 44 | * Initializes the game |
||
| 45 | * |
||
| 46 | * @param bool $verbose |
||
| 47 | */ |
||
| 48 | 3 | public function start($verbose = true) |
|
| 57 | } |
||
| 58 | } |
||
| 59 | 3 | } |
|
| 60 | |||
| 61 | /** |
||
| 62 | * Shows if the game reached max iteration |
||
| 63 | * |
||
| 64 | * @return bool |
||
| 65 | */ |
||
| 66 | 2 | public function isEnded() |
|
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * Helper method to print organisms to CLI. |
||
| 73 | * |
||
| 74 | * @param $matrix |
||
| 75 | */ |
||
| 76 | private static function printMatrixCli($matrix) |
||
| 112 | } |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.