| @@ 145-161 (lines=17) @@ | ||
| 142 | * @param bool $asString True will returns a comma separated string of rules |
|
| 143 | * @return array|string |
|
| 144 | */ |
|
| 145 | public function pass($asString = false) |
|
| 146 | { |
|
| 147 | if (!$this->_checked) { |
|
| 148 | $this->check(); |
|
| 149 | } |
|
| 150 | ||
| 151 | if (!$asString) { |
|
| 152 | return $this->_pass; |
|
| 153 | } |
|
| 154 | ||
| 155 | $items = []; |
|
| 156 | foreach ($this->_pass as $rule) { |
|
| 157 | $items[] = "{$rule}"; |
|
| 158 | } |
|
| 159 | ||
| 160 | return implode(', ', $items); |
|
| 161 | } |
|
| 162 | ||
| 163 | /** |
|
| 164 | * Gets all rules marked as FAIL. |
|
| @@ 169-185 (lines=17) @@ | ||
| 166 | * @param bool $asString True will returns a comma separated string of rules |
|
| 167 | * @return array|string |
|
| 168 | */ |
|
| 169 | public function fail($asString = false) |
|
| 170 | { |
|
| 171 | if (!$this->_checked) { |
|
| 172 | $this->check(); |
|
| 173 | } |
|
| 174 | ||
| 175 | if (!$asString) { |
|
| 176 | return $this->_fail; |
|
| 177 | } |
|
| 178 | ||
| 179 | $items = []; |
|
| 180 | foreach ($this->_fail as $rule) { |
|
| 181 | $items[] = "{$rule}"; |
|
| 182 | } |
|
| 183 | ||
| 184 | return implode(', ', $items); |
|
| 185 | } |
|
| 186 | ||
| 187 | /** |
|
| 188 | * Marks a rule as PASS. |
|