| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function trustCertificate($crt) |
||
| 34 | { |
||
| 35 | $this->consoleWriter->info('Auto Trust Certificate, needs sudo privilege. Please provide your sudo password.'); |
||
| 36 | |||
| 37 | $command = "sudo security add-trusted-cert -d -r trustAsRoot -k /Library/Keychains/System.keychain {$crt}"; |
||
| 38 | |||
| 39 | if($this->isTesting()) { |
||
| 40 | $this->consoleWriter->info("Did not trust Certificate during testing."); |
||
| 41 | return; |
||
| 42 | } |
||
| 43 | |||
| 44 | $this->cli->passthru($command); |
||
| 45 | } |
||
| 68 |