| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 59 | public function toUrl() |
||
| 60 | { |
||
| 61 | $credentials = null; |
||
| 62 | |||
| 63 | if ($this->hasCredentials()) { |
||
| 64 | $credentials = sprintf( |
||
| 65 | '%s:%s@', |
||
| 66 | $this->credentials->user, |
||
| 67 | $this->credentials->token |
||
| 68 | ); |
||
| 69 | } |
||
| 70 | |||
| 71 | return strtr( |
||
| 72 | '{protocol}://{credentials}{server}:{port}/job/{jobName}/lastBuild/api/json', |
||
| 73 | [ |
||
| 74 | '{protocol}' => $this->protocol, |
||
| 75 | '{server}' => $this->server, |
||
| 76 | '{port}' => $this->port, |
||
| 77 | '{jobName}' => $this->jobName, |
||
| 78 | '{credentials}' => $credentials |
||
| 79 | ] |
||
| 80 | ); |
||
| 81 | } |
||
| 82 | |||
| 98 |