<commit_before><?php

namespace OpenConext\Component\EngineBlockFixtures;

/**
 * A 'frame' of ids, as in a set of ids for use in a single step of the EngineBlock flow.
 * @package OpenConext\Component\EngineBlockFixtures
 */
class IdFrame
{
    const ID_USAGE_SAML2_RESPONSE   = 'saml2-response';
    const ID_USAGE_SAML2_REQUEST    = 'saml2-request';
    const ID_USAGE_SAML2_ASSERTION  = 'saml2-assertion';
    const ID_USAGE_SAML2_METADATA   = 'saml2-metadata';
    const ID_USAGE_OTHER            = 'other';

    protected $ids;

    /**
     * @param array $ids
     */
    public function __construct($ids = array())
    {
        $this->ids = $ids;
    }

    /**
     * @param $usage
     * @param $id
     * @return $this
     */
    public function set($usage, $id)
    {
        $this->ids[$usage] = $id;
        return $this;
    }

    /**
     * @param $usage
     * @return mixed
     */
    public function get($usage)
    {
        if (!isset($this->ids[$usage])) {
            throw new \RuntimeException('Current frame has no id set for ' . $usage);
        }
        return $this->ids[$usage];
    }
}<commit_msg>Added IdFrame->has<commit_after><?php

namespace OpenConext\Component\EngineBlockFixtures;

/**
 * A 'frame' of ids, as in a set of ids for use in a single step of the EngineBlock flow.
 * @package OpenConext\Component\EngineBlockFixtures
 */
class IdFrame
{
    const ID_USAGE_SAML2_RESPONSE   = 'saml2-response';
    const ID_USAGE_SAML2_REQUEST    = 'saml2-request';
    const ID_USAGE_SAML2_ASSERTION  = 'saml2-assertion';
    const ID_USAGE_SAML2_METADATA   = 'saml2-metadata';
    const ID_USAGE_OTHER            = 'other';

    protected $ids;

    /**
     * @param array $ids
     */
    public function __construct($ids = array())
    {
        $this->ids = $ids;
    }

    /**
     * @param $usage
     * @param $id
     * @return $this
     */
    public function set($usage, $id)
    {
        $this->ids[$usage] = $id;
        return $this;
    }

    /**
     * @param $usage
     * @return mixed
     * @throws \RuntimeException
     */
    public function get($usage)
    {
        if (!isset($this->ids[$usage])) {
            throw new \RuntimeException('Current frame has no id set for ' . $usage);
        }
        return $this->ids[$usage];
    }

    /**
     * @param $usage
     * @return bool
     */
    public function has($usage)
    {
        return isset($this->ids[$usage]);
    }
}
{'fraction_non_alphanumeric': 0.13183673469387755, 'fraction_numerical': 0.006530612244897959, 'mean_word_length': 2.1748704663212437, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2797459', 'n_tokens_mistral': 832, 'n_tokens_neox': 812, 'n_words': 188}