<commit_before><?php
require_once 'Handler.php';

class NotificationHandler implements Handler
{
  protected $node;
  protected $type;
  protected $parent;
  protected $phoneNumber;

  public function NotificationHandler($parent, $node)
  {
    $this->node         = $node;
    $this->type         = $node->getAttribute("type");
    $this->parent       = $parent;
    $this->phoneNumber  = $this->parent->getMyNumber();
  }

  public function Process()
  {
    switch($this->type)
    {
        case "status":
            $this->parent->eventManager()->fire("onGetStatus",
                array(
                    $this->phoneNumber, //my number
                    $this->node->getAttribute("from"),
                    $this->node->getChild(0)->getTag(),
                    $this->node->getAttribute("id"),
                    $this->node->getAttribute("t"),
                    $this->node->getChild(0)->getData()
                ));
            break;
        case "picture":
            if ($this->node->hasChild('set')) {
                $this->parent->eventManager()->fire("onProfilePictureChanged",<commit_msg>PHP7 support fixes<commit_after><?php
require_once 'Handler.php';

class NotificationHandler implements Handler
{
  protected $node;
  protected $type;
  protected $parent;
  protected $phoneNumber;

  public function __construct($parent, $node)
  {
    $this->node         = $node;
    $this->type         = $node->getAttribute("type");
    $this->parent       = $parent;
    $this->phoneNumber  = $this->parent->getMyNumber();
  }

  public function Process()
  {
    switch($this->type)
    {
        case "status":
            $this->parent->eventManager()->fire("onGetStatus",
                array(
                    $this->phoneNumber, //my number
                    $this->node->getAttribute("from"),
                    $this->node->getChild(0)->getTag(),
                    $this->node->getAttribute("id"),
                    $this->node->getAttribute("t"),
                    $this->node->getChild(0)->getData()
                ));
            break;
        case "picture":
            if ($this->node->hasChild('set')) {
                $this->parent->eventManager()->fire("onProfilePictureChanged",
{'fraction_non_alphanumeric': 0.15899955337204108, 'fraction_numerical': 0.0022331397945511387, 'mean_word_length': 1.9434954007884362, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 61, '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': '5547137', 'n_tokens_mistral': 608, 'n_tokens_neox': 591, 'n_words': 99}