1313 *
1414 * @package modx
1515 */
16- class modSessionHandler {
16+ class modSessionHandler implements SessionHandlerInterface {
1717 /**
1818 * @var modX A reference to the modX instance controlling this session
1919 * handler.
@@ -60,11 +60,14 @@ function __construct(modX &$modx) {
6060 /**
6161 * Opens the connection for the session handler.
6262 *
63+ * @param $path
64+ * @param $name
6365 * @access public
6466 * @return boolean Always returns true; actual connection is managed by
6567 * {@link modX}.
6668 */
67- public function open () {
69+ #[\ReturnTypeWillChange]
70+ public function open ($ path , $ name ) {
6871 return true ;
6972 }
7073
@@ -75,6 +78,7 @@ public function open() {
7578 * @return boolean Always returns true; actual connection is managed by
7679 * {@link modX}
7780 */
81+ #[\ReturnTypeWillChange]
7882 public function close () {
7983 return true ;
8084 }
@@ -86,6 +90,7 @@ public function close() {
8690 * @param integer $id The pk of the {@link modSession} object.
8791 * @return string The data read from the {@link modSession} object.
8892 */
93+ #[\ReturnTypeWillChange]
8994 public function read ($ id ) {
9095 if ($ this ->_getSession ($ id )) {
9196 $ data = $ this ->session ->get ('data ' );
@@ -103,6 +108,7 @@ public function read($id) {
103108 * @param mixed $data The data to write to the session.
104109 * @return boolean True if successfully written.
105110 */
111+ #[\ReturnTypeWillChange]
106112 public function write ($ id , $ data ) {
107113 $ written = false ;
108114 if ($ this ->_getSession ($ id , true )) {
@@ -122,6 +128,7 @@ public function write($id, $data) {
122128 * @param integer $id
123129 * @return boolean True if the session record was destroyed.
124130 */
131+ #[\ReturnTypeWillChange]
125132 public function destroy ($ id ) {
126133 if ($ this ->_getSession ($ id )) {
127134 $ destroyed = $ this ->session ->remove ();
@@ -139,6 +146,7 @@ public function destroy($id) {
139146 * longer than.
140147 * @return boolean True if session records were removed.
141148 */
149+ #[\ReturnTypeWillChange]
142150 public function gc ($ max ) {
143151 $ maxtime = time () - $ this ->gcMaxLifetime ;
144152 return $ this ->modx ->removeCollection ('modSession ' , array ("{$ this ->modx ->escape ('access ' )} < {$ maxtime }" ));
0 commit comments