IndianCityProvider::findByStationCode()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Indian City finder
5
 *
6
 * (c) Nexuslink Services
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace IndianCityFinder\src\Services;
13
14
class IndianCityProvider {
15
    
16
    /**
17
     * @param type $stationCode
18
     * 
19
     * @return string $cityName
20
     */
21
    public static function findByStationCode($stationCode) {
22
        
23
        $cityList = array();
24
        include(__DIR__ . '/../../Resources/indianCityList.php');
25
        
26
        if(key_exists($stationCode, $cityList))
27
        {
28
            return $cityList[$stationCode];
29
        } else {
30
            
31
            return "City not found. Please check your station code.";
32
        }
33
    }
34
    
35
}