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() |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getExpirationDate() |
||
83 | |||
84 | /** |
||
85 | * @return array |
||
86 | */ |
||
87 | protected function parseCertificate() |
||
91 | |||
92 | /** |
||
93 | * @param string $date |
||
94 | */ |
||
95 | protected function dateFormat(string $date) |
||
99 | } |
||
100 |
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: