SitemapDataService   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 30
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A mapTimeout2Period() 0 19 6
1
<?php
2
3
/**
4
 * Sitemap data service
5
 */
6
7
namespace FRUIT\GoogleServices\Service;
8
9
/**
10
 * Sitemap data service
11
 */
12
class SitemapDataService
13
{
14
15
    /**
16
     * Map timestamp to period
17
     *
18
     * @param integer $sec
19
     *
20
     * @return string
21
     */
22
    public static function mapTimeout2Period($sec)
23
    {
24
        if ($sec <= 0) {
25
            return 'monthly';
26
        }
27
        if ($sec <= 1800) {
28
            return 'always';
29
        }
30
        if ($sec <= 14400) {
31
            return 'hourly';
32
        }
33
        if ($sec <= 172800) {
34
            return 'daily';
35
        }
36
        if ($sec <= 604800) {
37
            return 'weekly';
38
        }
39
        return 'monthly';
40
    }
41
}
42