<commit_before><?php

namespace Contentacle\Responses;

class Hal extends \Tonic\Response
{
    private $links = array();
    private $embedded = array();

    public function __construct($code = null, $body = null, $headers = array())
    {
        parent::__construct($code, null, $headers);

        if (is_array($body)) {
            $this->body = $body;
        } elseif (is_object($body)) {
            $this->body = array();
            if (is_a($body, '\Contentacle\Models\Model')) {
                $this->body = $body->props();
            } else {
                foreach (get_object_vars($body) as $key => $value) {
                    $this->body[$key] = $value;
                }
            }
        } else {
            $this->body = array();
        }

        #$this->addCuries();
    }

    private function hasContent()
    {
        if ($this->code == self::NOCONTENT) {
            $this->code = self::OK;
        }
    }<commit_msg>Explicitly set HAL response type to application/hal+yaml<commit_after><?php

namespace Contentacle\Responses;

class Hal extends \Tonic\Response
{
    private $links = array();
    private $embedded = array();

    public function __construct($code = null, $body = null, $headers = array())
    {
        parent::__construct($code, null, $headers);

        $this->contentType = 'application/hal+yaml';

        if (is_array($body)) {
            $this->body = $body;
        } elseif (is_object($body)) {
            $this->body = array();
            if (is_a($body, '\Contentacle\Models\Model')) {
                $this->body = $body->props();
            } else {
                foreach (get_object_vars($body) as $key => $value) {
                    $this->body[$key] = $value;
                }
            }
        } else {
            $this->body = array();
        }

        #$this->addCuries();
    }

    private function hasContent()
    {
        if ($this->code == self::NOCONTENT) {
            $this->code = self::OK;
        }
    }
{'fraction_non_alphanumeric': 0.15778994524639123, 'fraction_numerical': 0.0, 'mean_word_length': 1.7309782608695652, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, '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': '7568562', 'n_tokens_mistral': 595, 'n_tokens_neox': 580, 'n_words': 122}