| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | public function convertToPem() : string |
||
| 46 | { |
||
| 47 | $prefix = "-----BEGIN CERTIFICATE-----\n"; |
||
| 48 | $suffix = "-----END CERTIFICATE-----\n"; |
||
| 49 | |||
| 50 | $pem = base64_encode($this->file); |
||
| 51 | $pem = chunk_split($pem, $this->chunklen, "\n") ; |
||
| 52 | $pem = $prefix.$pem.$suffix; |
||
| 53 | |||
| 54 | return $pem; |
||
| 55 | } |
||
| 56 | |||
| 80 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: