找回密码
 新建账号

undefined class SessionIdInterface in PHPStorm

[复制链接]
php 发表于 2018/5/21 09:42 | 显示全部楼层 |阅读模式
The SessionIdInterface interface of PHP is introduced in PHP 5.5.1, which contains one abstract public method create_sid().

SessionIdInterface::create_sid() is called to create a new session ID when necessary, for example, when session_regenerate_id() is invoked.

PHPStorm recognize SessionIdInterface as an undefined class. This is a bug of PhpStorm.

To avoid warning of PhpStorm, you can simply omit SessionIdInterface after the implements keyword.
  1. <?php
  2.         class SessionXHandler implements SessionHandlerInterface, SessionIdInterface, SessionUpdateTimestampHandlerInterface{
  3.                 /**
  4.                  * @return bool
  5.                  */
  6.                 public function close(){
  7.                         // TODO: Implement close() method.
  8.                 }

  9.                 /**
  10.                  * @param string $session_id
  11.                  * @return bool
  12.                  */
  13.                 public function destroy($session_id){
  14.                         // TODO: Implement destroy() method.
  15.                 }

  16.                 /**
  17.                  * @param int $maxlifetime
  18.                  * @return bool
  19.                  */
  20.                 public function gc($maxlifetime){
  21.                         // TODO: Implement gc() method.
  22.                 }

  23.                 /**
  24.                  * @param string $save_path
  25.                  * @param string $name
  26.                  * @return bool
  27.                  */
  28.                 public function open($save_path, $name){
  29.                         // TODO: Implement open() method.
  30.                 }

  31.                 /**
  32.                  * @param string $session_id
  33.                  * @return string
  34.                  */
  35.                 public function read($session_id){
  36.                         // TODO: Implement read() method.
  37.                 }

  38.                 /**
  39.                  * @param string $session_id
  40.                  * @param string $session_data
  41.                  * @return bool
  42.                  */
  43.                 public function write($session_id, $session_data){
  44.                         // TODO: Implement write() method.
  45.                 }

  46.                 /**
  47.                  * @return string
  48.                  */
  49.                 public function create_sid(){
  50.                         // TODO: Implement create_sid() method.
  51.                 }

  52.                 /**
  53.                  * @param string $session_id
  54.                  * @return bool
  55.                  */
  56.                 public function validateId($session_id){
  57.                         // TODO: Implement validateId() method.
  58.                 }

  59.                 /**
  60.                  * @param string $session_id
  61.                  * @param string $session_data
  62.                  * @return bool
  63.                  */
  64.                 public function updateTimestamp($session_id, $session_data){
  65.                         // TODO: Implement updateTimestamp() method.
  66.                 }
  67.         }
复制代码
  1. <?php
  2.         class SessionXHandler implements SessionHandlerInterface, SessionUpdateTimestampHandlerInterface{
  3.                 /**
  4.                  * @return bool
  5.                  */
  6.                 public function close(){
  7.                         // TODO: Implement close() method.
  8.                 }

  9.                 /**
  10.                  * @param string $session_id
  11.                  * @return bool
  12.                  */
  13.                 public function destroy($session_id){
  14.                         // TODO: Implement destroy() method.
  15.                 }

  16.                 /**
  17.                  * @param int $maxlifetime
  18.                  * @return bool
  19.                  */
  20.                 public function gc($maxlifetime){
  21.                         // TODO: Implement gc() method.
  22.                 }

  23.                 /**
  24.                  * @param string $save_path
  25.                  * @param string $name
  26.                  * @return bool
  27.                  */
  28.                 public function open($save_path, $name){
  29.                         // TODO: Implement open() method.
  30.                 }

  31.                 /**
  32.                  * @param string $session_id
  33.                  * @return string
  34.                  */
  35.                 public function read($session_id){
  36.                         // TODO: Implement read() method.
  37.                 }

  38.                 /**
  39.                  * @param string $session_id
  40.                  * @param string $session_data
  41.                  * @return bool
  42.                  */
  43.                 public function write($session_id, $session_data){
  44.                         // TODO: Implement write() method.
  45.                 }

  46.                 /**
  47.                  * @return string
  48.                  */
  49.                 public function create_sid(){
  50.                         // TODO: Implement create_sid() method.
  51.                 }

  52.                 /**
  53.                  * @param string $session_id
  54.                  * @return bool
  55.                  */
  56.                 public function validateId($session_id){
  57.                         // TODO: Implement validateId() method.
  58.                 }

  59.                 /**
  60.                  * @param string $session_id
  61.                  * @param string $session_data
  62.                  * @return bool
  63.                  */
  64.                 public function updateTimestamp($session_id, $session_data){
  65.                         // TODO: Implement updateTimestamp() method.
  66.                 }
  67.         }
复制代码

手机版|轻松E站

GMT+8, 2024/4/25 23:55

快速回复 返回顶部 返回列表