Code Duplication    Length = 21-21 lines in 2 locations

src/CacheSessionHandler.php 2 locations

@@ 84-104 (lines=21) @@
81
    /**
82
     * {@inheritdoc}
83
     */
84
    public function read($session_id)
85
    {
86
        try {
87
            $item = $this->pool->getItem($session_id);
88
89
            if ($item->isHit()) {
90
                return $item->get();
91
            }
92
        } catch (InvalidArgumentException $e) {
93
            $this->logger->error(
94
                $e->getMessage(),
95
                [
96
                    'exception' => $e,
97
                    'session_id' => is_scalar($session_id) ? $session_id : '** Non scalar session ID **',
98
                    'operation' => 'read',
99
                ]
100
            );
101
        }
102
103
        return '';
104
    }
105
106
    /**
107
     * {@inheritdoc}
@@ 109-129 (lines=21) @@
106
    /**
107
     * {@inheritdoc}
108
     */
109
    public function write($session_id, $session_data)
110
    {
111
        try {
112
            $item = $this->pool->getItem($session_id);
113
114
            $item->set($session_data);
115
116
            return $this->pool->save($item);
117
        } catch (InvalidArgumentException $e) {
118
            $this->logger->error(
119
                $e->getMessage(),
120
                [
121
                    'exception' => $e,
122
                    'session_id' => is_scalar($session_id) ? $session_id : '** Non scalar session ID **',
123
                    'operation' => 'write',
124
                ]
125
            );
126
127
            return false;
128
        }
129
    }
130
}
131