| Total Complexity | 9 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Coverage | 29.17% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class TeamHelper |
||
| 14 | { |
||
| 15 | private $ruleHelper; |
||
| 16 | |||
| 17 | public function __construct(RuleHelper $ruleHelper) |
||
| 18 | { |
||
| 19 | $this->ruleHelper = $ruleHelper; |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param Team $team |
||
| 24 | * @return RuleHelperInterface |
||
| 25 | * @throws \Exception |
||
| 26 | */ |
||
| 27 | public function getRuleHelper(Team $team):RuleHelperInterface |
||
| 33 | } |
||
| 34 | |||
| 35 | 1 | public static function getLastVersion(Team $team):TeamVersion |
|
| 36 | { |
||
| 37 | 1 | $versions = $team->getVersions(); |
|
| 38 | /** @var TeamVersion $last */ |
||
| 39 | 1 | $last = $versions->first(); |
|
| 40 | 1 | if ($last) { |
|
|
|
|||
| 41 | return $last; |
||
| 42 | } |
||
| 43 | 1 | $version = new TeamVersion(); |
|
| 44 | 1 | $team->addVersion($version); |
|
| 45 | 1 | return $version; |
|
| 46 | } |
||
| 47 | |||
| 48 | /********************** |
||
| 49 | * TEAM HELPER METHODS |
||
| 50 | **********************/ |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param Team $team |
||
| 54 | * @return TeamVersion |
||
| 55 | * @throws \Psr\Cache\InvalidArgumentException |
||
| 56 | */ |
||
| 57 | public function createNewTeamVersion(Team $team):TeamVersion |
||
| 61 | } |
||
| 62 | public function destructTeamVersion(Team $team):TeamVersion |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @param Team $team |
||
| 68 | * @return bool |
||
| 69 | * @throws \Exception |
||
| 70 | */ |
||
| 71 | public function couldHaveApothecary(Team $team):bool |
||
| 77 | } |
||
| 78 | } |
||
| 79 |