IndianCityProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A findByStationCode() 0 13 2
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
}