RawDataGetter::getBanks()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 5
c 1
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the IndoBank package.
5
 *
6
 * (c) Andri Desmana <andridesmana.pw | [email protected]>
7
 *
8
 */
9
10
namespace Andes2912\IndoBank;
11
12
use ParseCsv\Csv;
13
14
/**
15
 * Get raw data from CSV Files on /src/data/csv.
16
 */
17
class RawDataGetter
18
{
19
    /**
20
     * Raw Data file path.
21
     *
22
     * @return string
23
     */
24
    protected static $path = __DIR__.'/data/csv';
25
26
    /**
27
     * Get banks data.
28
     *
29
     * @return array
30
     */
31
    public static function getBanks()
32
    {
33
        $result = self::getCsvData(self::$path.'/bank.csv');
34
35
        return $result;
36
    }
37
38
39
    /**
40
     * Get Data from CSV.
41
     *
42
     * @param string $path File Path.
43
     *
44
     * @return array
45
     */
46
    public static function getCsvData($path = '')
47
    {
48
        $csv = new Csv();
49
        $csv->auto($path);
50
51
        return $csv->data;
52
    }
53
}