refactor(webstatement): ubah konstanta CSV_FILENAME menjadi properti dinamis
- Mengubah `CSV_FILENAME` dari konstanta menjadi properti untuk memungkinkan konfigurasi lebih fleksibel. - Menambahkan `csvFilename` yang diinisialisasi melalui nilai environment `BIAYA_KARTU_CSV_FILENAME` dengan default `biaya_kartu_atm.csv`. - Memperbarui referensi dari `self::CSV_FILENAME` menjadi `$this->csvFilename` pada proses penulisan file CSV. Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
@@ -24,14 +24,15 @@
|
|||||||
'SILV' => 5000,
|
'SILV' => 5000,
|
||||||
'GOLD' => 10000
|
'GOLD' => 10000
|
||||||
];
|
];
|
||||||
private const CSV_FILENAME = 'atmcards.csv';
|
// Changed from const to property
|
||||||
|
private $csvFilename;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
//
|
$this->csvFilename = env('BIAYA_KARTU_CSV_FILENAME', 'biaya_kartu_atm.csv');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,7 +72,7 @@
|
|||||||
: array
|
: array
|
||||||
{
|
{
|
||||||
$cards = $this->getEligibleAtmCards();
|
$cards = $this->getEligibleAtmCards();
|
||||||
$filename = storage_path('app/' . self::CSV_FILENAME);
|
$filename = storage_path('app/' . $this->csvFilename);
|
||||||
|
|
||||||
$handle = fopen($filename, 'w+');
|
$handle = fopen($filename, 'w+');
|
||||||
if (!$handle) {
|
if (!$handle) {
|
||||||
|
|||||||
Reference in New Issue
Block a user