We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 4 | class AbstractGroupedException extends AbstractNestedException |
||
| 5 | { |
||
| 6 | const NONE = 0; |
||
| 7 | const SOME = 1; |
||
| 8 | public static $defaultTemplates = array( |
||
| 9 | self::MODE_DEFAULT => array( |
||
| 10 | self::NONE => 'All of the required rules must pass for {{name}}', |
||
| 11 | self::SOME => 'These rules must pass for {{name}}', |
||
| 12 | ), |
||
| 13 | self::MODE_NEGATIVE => array( |
||
| 14 | self::NONE => 'None of there rules must pass for {{name}}', |
||
| 15 | self::SOME => 'These rules must not pass for {{name}}', |
||
| 16 | ), |
||
| 17 | ); |
||
| 18 | |||
| 19 | 36 | public function chooseTemplate() |
|
| 20 | { |
||
| 21 | 36 | $numRules = $this->getParam('passed'); |
|
| 22 | 36 | $numFailed = count($this->getRelated()); |
|
| 23 | |||
| 24 | 36 | return $numRules === $numFailed ? static::NONE : static::SOME; |
|
| 25 | } |
||
| 26 | |||
| 27 | 36 | public function getParams() |
|
| 28 | { |
||
| 29 | 36 | if (1 === count($this->related)) { |
|
| 30 | 3 | return current($this->related)->getParams(); |
|
| 31 | } else { |
||
| 32 | 36 | return parent::getParams(); |
|
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | 36 | public function getTemplate() |
|
| 50 | } |
||
| 51 |