Code Duplication    Length = 9-9 lines in 2 locations

src/Snidel/Token.php 1 location

@@ 55-63 (lines=9) @@
52
     *
53
     * @return  int
54
     */
55
    private function genId()
56
    {
57
        $pathname = '/tmp/' . sha1($this->getKey());
58
        if (!file_exists($pathname)) {
59
            touch($pathname);
60
        }
61
62
        return ftok($pathname, 'S');
63
    }
64
65
    private function getKey()
66
    {

src/Snidel/SharedMemory.php 1 location

@@ 100-108 (lines=9) @@
97
     *
98
     * @return  int
99
     */
100
    private function generateKey($pid)
101
    {
102
        $pathname = '/tmp/' . sha1($pid);
103
        if (!file_exists($pathname)) {
104
            touch($pathname);
105
        }
106
107
        return ftok($pathname, 'S');
108
    }
109
}
110