| 1 | <?php |
||
| 14 | class CerStrategy |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * File to decode. |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | protected $file; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Chunk length. |
||
| 25 | * |
||
| 26 | * @var integer |
||
| 27 | */ |
||
| 28 | protected $chunklen = 64; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Create a new cer strategy instance. |
||
| 32 | * |
||
| 33 | * @param $file |
||
| 34 | */ |
||
| 35 | public function __construct($file) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Convert .cer to .pem |
||
| 42 | * |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | public function convertToPem() : string |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | public function getNoCertificado() |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @return array |
||
| 74 | */ |
||
| 75 | protected function parseCertificate() |
||
| 79 | } |
||
| 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: