<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Tom
 * Date: 14/01/2016
 * Time: 0:18
 */

namespace TomCan\SoundTouch\Response;


class SoundTouchNowPlayingResponse extends SoundTouchResponse
{

    private $deviceID;

    private $track;
    private $album;
    private $stationName;
    private $playStatus;
    private $description;
    private $stationLocation;
    private $art;
    private $artImageStatus;

    private $contentItem;

    public function parseResponse() {

        parent::parseResponse();

        $this->deviceID = (string)$this->getResponseObject()->attributes()->deviceID;

        $this->contentItem = new \stdClass();
        if ($this->getResponseObject()->ContentItem) {
            $this->contentItem->source = (string)$this->getResponseObject()->ContentItem->attributes()->source;
            $this->contentItem->location = (string)$this->getResponseObject()->ContentItem->attributes()->location;
            $this->contentItem->sourceAccount = (string)$this->getResponseObject()->ContentItem->attributes()->sourceAccount;
            $this->contentItem->isPresetable = (string)$this->getResponseObject()->ContentItem->attributes()->isPresetable;
            $this->contentItem->name = (string)$this->getResponseObject()->ContentItem->itemName;
        }

        $this->track = (string)$this->getResponseObject()->track;
        $this->album = (string)$this->getResponseObject()->album;
        $this->stationName = (string)$this->getResponseObject()->stationName;
        $this->stationLocation = (string)$this->getResponseObject()->stationLocation;
        $this->playStatus = (string)$this->getResponseObject()->playStatus;
        $this->description = (string)$this->getResponseObject()->description;

        $this->art = (string)$this->getResponseObject()->art;
        $this->artImageStatus = (string)$this->getResponseObject()->art->attributes()->artImageStatus;

    }

}<commit_msg>Error when art node not present<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Tom
 * Date: 14/01/2016
 * Time: 0:18
 */

namespace TomCan\SoundTouch\Response;


class SoundTouchNowPlayingResponse extends SoundTouchResponse
{

    private $deviceID;

    private $track;
    private $album;
    private $stationName;
    private $playStatus;
    private $description;
    private $stationLocation;
    private $art;
    private $artImageStatus;

    private $contentItem;

    public function parseResponse() {

        parent::parseResponse();

        $this->deviceID = (string)$this->getResponseObject()->attributes()->deviceID;

        $this->contentItem = new \stdClass();
        if ($this->getResponseObject()->ContentItem) {
            $this->contentItem->source = (string)$this->getResponseObject()->ContentItem->attributes()->source;
            $this->contentItem->location = (string)$this->getResponseObject()->ContentItem->attributes()->location;
            $this->contentItem->sourceAccount = (string)$this->getResponseObject()->ContentItem->attributes()->sourceAccount;
            $this->contentItem->isPresetable = (string)$this->getResponseObject()->ContentItem->attributes()->isPresetable;
            $this->contentItem->name = (string)$this->getResponseObject()->ContentItem->itemName;
        }

        $this->track = (string)$this->getResponseObject()->track;
        $this->album = (string)$this->getResponseObject()->album;
        $this->stationName = (string)$this->getResponseObject()->stationName;
        $this->stationLocation = (string)$this->getResponseObject()->stationLocation;
        $this->playStatus = (string)$this->getResponseObject()->playStatus;
        $this->description = (string)$this->getResponseObject()->description;

        if ($this->getResponseObject()->art) {
            $this->art = (string)$this->getResponseObject()->art;
            $this->artImageStatus = (string)$this->getResponseObject()->art->attributes()->artImageStatus;
        }

    }

}
{'fraction_non_alphanumeric': 0.16249684104119283, 'fraction_numerical': 0.005559767500631791, 'mean_word_length': 3.7344497607655502, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 129, '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': '1451240', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1024, 'n_words': 153}