<commit_before><?php

namespace limenet\Deploy\Strategies;

class TravisStrategy extends AbstractWebhookPayloadStrategy
{
    public function checkValidRequest() : bool
    {
        return (int) $this->payload['status'] === 0;
    }

    public function isBranch(string $branch) : bool
    {
        if (in_array($branch, ['tag', 'master'], true)) {
            return $this->isTag();
        }

        if ($branch === 'dev-master') {
            return $this->payload['branch'] === 'master';
        }

        return $this->payload['branch'] === $branch;
    }

    public function isTag() : bool
    {
        // currently no support
        return false;
    }

    public function getCommitHash() : string
    {
        return $this->payload['commit'] ?? '';
    }

    public function getCommitUrl() : string
    {
        return $this->payload['compare_url'] ?? '';
    }

    public function getCommitMessage() : string
    {
        return $this->payload['message'] ?? '';
    }

    public function getCommitUsername() : string
    {<commit_msg>proper support for tags in Travis payload<commit_after><?php

namespace limenet\Deploy\Strategies;

class TravisStrategy extends AbstractWebhookPayloadStrategy
{
    public function checkValidRequest() : bool
    {
        return (int) $this->payload['status'] === 0;
    }

    public function isBranch(string $branch) : bool
    {
        if (in_array($branch, ['tag', 'master'], true)) {
            return $this->isTag();
        }

        if ($branch === 'dev-master') {
            return $this->payload['branch'] === 'master';
        }

        return $this->payload['branch'] === $branch;
    }

    public function isTag() : bool
    {
        return array_key_exists('tag', $this->payload);
    }

    public function getCommitHash() : string
    {
        return $this->payload['commit'] ?? '';
    }

    public function getCommitUrl() : string
    {
        return $this->payload['compare_url'] ?? '';
    }

    public function getCommitMessage() : string
    {
        return $this->payload['message'] ?? '';
    }

    public function getCommitUsername() : string
    {
{'fraction_non_alphanumeric': 0.146455223880597, 'fraction_numerical': 0.0009328358208955224, 'mean_word_length': 2.4210526315789473, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '5706522', 'n_tokens_mistral': 606, 'n_tokens_neox': 595, 'n_words': 138}