<commit_before><?php
namespace DreamFactory\Samples\Events;

use DreamFactory\Platform\Events\EventDispatcher;
use DreamFactory\Platform\Events\RestServiceEvent;
use DreamFactory\Platform\Utility\Platform;
use DreamFactory\Yii\Utility\Pii;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * SessionEventSubscriber.php
 * An example class that listens for session logouts
 */
class SessionEventSubscriber implements EventSubscriberInterface
{
    /**
     * Constructor
     */
    public function __construct()
    {
        //  Register with the event dispatcher
        Pii::app()->getDispatcher()->addSubscriber( $this );
    }

    /**
     * Return the list of events to which we wish to subscribe
     *
     * @return array
     */
    public static function getSubscribedEvents()
    {
        return array(
            'session.login'  => array( 'onSessionLogin', 0 ),
            'session.logout' => array( 'onSessionLogout', 0 ),
        );
    }

    /**
     * Called on 'session.login'
     *
     * @param RestServiceEvent $event
     * @param string           $eventName
     * @param EventDispatcher  $dispatcher
     */
    public function onSessionLogin( RestServiceEvent $event, $eventName, $dispatcher )
    {
        //  Do something useful        
    }

    /**
     * Called on 'session.logout'
     *
     * @param RestServiceEvent $event
     * @param string           $eventName
     * @param EventDispatcher  $dispatcher
     */
    public function onSessionLogout( RestServiceEvent $event, $eventName, $dispatcher )
    {
        //  Do something useful        
    }
}<commit_msg>Updated sample event handler<commit_after><?php
namespace DreamFactory\Samples\Events;

use DreamFactory\Platform\Events\EventDispatcher;
use DreamFactory\Platform\Events\RestServiceEvent;
use DreamFactory\Platform\Utility\Platform;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * SessionEventSubscriber.php
 * An example class that listens for session logouts
 */
class SessionEventSubscriber implements EventSubscriberInterface
{
    /**
     * Constructor
     */
    public function __construct()
    {
        //  Register with the event dispatcher
        Platform::getDispatcher()->addSubscriber( $this );
    }

    /**
     * Return the list of events to which we wish to subscribe
     *
     * @return array
     */
    public static function getSubscribedEvents()
    {
        return array(
            'session.login'  => array( 'onSessionLogin', 0 ),
            'session.logout' => array( 'onSessionLogout', 0 ),
        );
    }

    /**
     * Called on 'session.login'
     *
     * @param RestServiceEvent $event
     * @param string           $eventName
     * @param EventDispatcher  $dispatcher
     */
    public function onSessionLogin( RestServiceEvent $event, $eventName, $dispatcher )
    {
        //  Do something useful
    }

    /**
     * Called on 'session.logout'
     *
     * @param RestServiceEvent $event
     * @param string           $eventName
     * @param EventDispatcher  $dispatcher
     */
    public function onSessionLogout( RestServiceEvent $event, $eventName, $dispatcher )
    {
        //  Do something useful
    }
}
{'fraction_non_alphanumeric': 0.09792376820576387, 'fraction_numerical': 0.0012395413696932136, 'mean_word_length': 2.5010845986984815, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4883650', 'n_tokens_mistral': 890, 'n_tokens_neox': 865, 'n_words': 217}