<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$
 */

  /**
   * A session provides a way of identifying users across a website
   * and having data associated to this person available on every page.
   * Since HTTP is a stateless protocol, sessions where implemented
   * to persist across more than one connection and request. A session
   * usually corresponds to exactly one user, "identifying" him/her
   * to the web pages displayed.
   *
   * Sessions may also be used to "cache" data from an RDBMS underlying
   * the web site. E.g., a user logs on to his service provider's 
   * administration site where he/she is allowed to configure a number
   * of - say - server settings. In this case, in the login site, we
   * read all of his/her contracts from the database and store these
   * objects to the session. On preceding pages displayed, these objects
   * are simply read from the session, saving time and database load.
   * Of course, in any case the data may have changed, we must unset
   * it from the session and reread it from the database.
   *
   * @see     php://session                                                 
   * @see     xp://scriptlet.HttpScriptlet                                  
   * @see     http://httpd.apache.org/docs/mod/mod_rewrite.html#RewriteRule 
   * @see     http://www.engelschall.com/pw/apache/rewriteguide/            
   */
  interface Session {

    /**
     * Initializes the session
     *
     * @param   string id session id
     * @return  bool
     */
    public function initialize($id);
    
    /**
     * Returns if this session is valid
     *
     * @return  bool valid
     */
    public function isValid();
    
    /**
     * Returns if this session is a new session
     *
     * @return  bool new
     */
    public function isNew();
    
    /**
     * Returns this session's Id
     *
     * @return  string id
     */
    public function getId();
    
    /**
     * Retrieves the time when this session was created, as Unix-
     * timestamp
     *
     * @return  int Unix-timestamp
     * @throws  lang.IllegalStateException when session is invalid
     */
    public function getCreationTime();
    
    /**
     * Resets the session and deletes all variables. The number of deleted
     * session variables is being returned
     *
     * @return  int
     * @throws  lang.IllegalStateException when session is invalid
     */
    public function reset();

    /**
     * Registers a variable. If another variable is already registered
     * under the specified name, it is replaced
     *
     * @param   string name
     * @param   var value
     * @throws  lang.IllegalStateException when session is invalid
     */
    public function putValue($name, $value);
    
    /**
     * Retrieves a value previously registered with the specified name
     * or the default value in case this name does not exist
     *
     * @param   string name
     * @param   mixed default default NULL 
     * @return  mixed value
     * @throws  lang.IllegalStateException when session is invalid
     */
    public function getValue($name, $default= NULL);
    
    /**
     * Checks whether a value by specified name exists
     *
     * @param   string name 
     * @return  bool TRUE if the value exists, FALSE otherwiese
     */
    public function hasValue($name);
    
    /**
     * Removes a value from the session. If no value is found for
     * the specified name, nothing happens
     *
     * @param   name The name of the value to delete
     */
    public function removeValue($name);<commit_msg>- QA: Fix @param w/o type in removeValue()<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$
 */

  /**
   * A session provides a way of identifying users across a website
   * and having data associated to this person available on every page.
   * Since HTTP is a stateless protocol, sessions where implemented
   * to persist across more than one connection and request. A session
   * usually corresponds to exactly one user, "identifying" him/her
   * to the web pages displayed.
   *
   * Sessions may also be used to "cache" data from an RDBMS underlying
   * the web site. E.g., a user logs on to his service provider's 
   * administration site where he/she is allowed to configure a number
   * of - say - server settings. In this case, in the login site, we
   * read all of his/her contracts from the database and store these
   * objects to the session. On preceding pages displayed, these objects
   * are simply read from the session, saving time and database load.
   * Of course, in any case the data may have changed, we must unset
   * it from the session and reread it from the database.
   *
   * @see     php://session                                                 
   * @see     xp://scriptlet.HttpScriptlet                                  
   * @see     http://httpd.apache.org/docs/mod/mod_rewrite.html#RewriteRule 
   * @see     http://www.engelschall.com/pw/apache/rewriteguide/            
   */
  interface Session {

    /**
     * Initializes the session
     *
     * @param   string id session id
     * @return  bool
     */
    public function initialize($id);
    
    /**
     * Returns if this session is valid
     *
     * @return  bool valid
     */
    public function isValid();
    
    /**
     * Returns if this session is a new session
     *
     * @return  bool new
     */
    public function isNew();
    
    /**
     * Returns this session's Id
     *
     * @return  string id
     */
    public function getId();
    
    /**
     * Retrieves the time when this session was created, as Unix-
     * timestamp
     *
     * @return  int Unix-timestamp
     * @throws  lang.IllegalStateException when session is invalid
     */
    public function getCreationTime();
    
    /**
     * Resets the session and deletes all variables. The number of deleted
     * session variables is being returned
     *
     * @return  int
     * @throws  lang.IllegalStateException when session is invalid
     */
    public function reset();

    /**
     * Registers a variable. If another variable is already registered
     * under the specified name, it is replaced
     *
     * @param   string name
     * @param   var value
     * @throws  lang.IllegalStateException when session is invalid
     */
    public function putValue($name, $value);
    
    /**
     * Retrieves a value previously registered with the specified name
     * or the default value in case this name does not exist
     *
     * @param   string name
     * @param   mixed default default NULL 
     * @return  mixed value
     * @throws  lang.IllegalStateException when session is invalid
     */
    public function getValue($name, $default= NULL);
    
    /**
     * Checks whether a value by specified name exists
     *
     * @param   string name 
     * @return  bool TRUE if the value exists, FALSE otherwiese
     */
    public function hasValue($name);
    
    /**
     * Removes a value from the session. If no value is found for
     * the specified name, nothing happens
     *
     * @param   string name The name of the value to delete
     */
    public function removeValue($name);
{'fraction_non_alphanumeric': 0.07418643132928847, 'fraction_numerical': 0.0, 'mean_word_length': 2.085070182900893, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5199727', 'n_tokens_mistral': 1924, 'n_tokens_neox': 1880, 'n_words': 809}