Debian Codegraph @

tests/resources/userdiff/expected/driver/diff.php

raw
1 diff --git a/files/file.php b/files/file.php
2 index 63250ad..967d646 100644
3 --- a/files/file.php
4 +++ b/files/file.php
5 @@ -12,2 +12,3 @@ class UniqueGenerator
6 protected $maxRetries;
7 + protected $moreStuff;
8 protected $uniques = array();
9 @@ -17,3 +18,3 @@ public function __construct(Generator $generator, $maxRetries)
10 $this->generator = $generator;
11 - $this->maxRetries = $maxRetries;
12 + $this->maxRetries = $maxRetries + 1;
13 }
14 @@ -33,10 +34,10 @@ public function __call($name, $arguments)
15 {
16 + $i = 0;
17 if (!isset($this->uniques[$name])) {
18 $this->uniques[$name] = array();
19 }
20 - $i = 0;
21 do {
22 $res = call_user_func_array(array($this->generator, $name), $arguments);
23 $i++;
24 - if ($i > $this->maxRetries) {
25 + if ($i >= $this->maxRetries) {
26 throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries));