Csat.php
2 weeks ago
CsatCode.php
2 weeks ago
CsatCodeFromFile.php
2 weeks ago
CsatCodeFromString.php
2 weeks ago
CsatOption.php
2 weeks ago
CsatOptionDependedOnShippingMethod.php
2 weeks ago
CsatCodeFromFile.php
20 lines
| 1 | <?php |
| 2 | |
| 3 | namespace FSVendor\Octolize\Csat; |
| 4 | |
| 5 | class CsatCodeFromFile implements CsatCode |
| 6 | { |
| 7 | private string $file_path; |
| 8 | public function __construct(string $file_path) |
| 9 | { |
| 10 | $this->file_path = $file_path; |
| 11 | } |
| 12 | public function get_csat_code(): string |
| 13 | { |
| 14 | if (!file_exists($this->file_path)) { |
| 15 | throw new \RuntimeException('The file does not exist: ' . $this->file_path); |
| 16 | } |
| 17 | return file_get_contents($this->file_path); |
| 18 | } |
| 19 | } |
| 20 |