Code Duplication    Length = 9-10 lines in 2 locations

src/Phossa2/Middleware/Utility.php 2 locations

@@ 97-106 (lines=10) @@
94
     * @return ResponseInterface
95
     * @access public
96
     */
97
    public static function publicCache(
98
        ResponseInterface $response,
99
        /*# int */ $cacheTime = 120
100
    )/*# : ResponseInterface */ {
101
        $maxAge = $cacheTime * 60;
102
        return $response
103
            ->withAddedHeader('Expires', self::timeStamp($maxAge))
104
            ->withAddedHeader('Cache-Control', "public, max-age={$maxAge}")
105
            ->withAddedHeader('Last-Modified', self::timeStamp());
106
    }
107
108
    /**
109
     * Set private_no_expire cache header
@@ 116-124 (lines=9) @@
113
     * @return ResponseInterface
114
     * @access public
115
     */
116
    public static function privateNoExpireCache(
117
        ResponseInterface $response,
118
        /*# int */ $cacheTime = 120
119
    )/*# : ResponseInterface */ {
120
        $maxAge = $cacheTime * 60;
121
        return $response
122
            ->withAddedHeader('Cache-Control', "private, max-age={$maxAge}, pre-check={$maxAge}")
123
            ->withAddedHeader('Last-Modified', self::timeStamp());
124
    }
125
126
    /**
127
     * Set private cache header