renoki-co/php-k8s

View on GitHub
src/Instances/Webhook.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace RenokiCo\PhpK8s\Instances;

class Webhook extends Instance
{
    /**
     * Add a new rule to the webook.
     *
     * @param  array  $rule
     * @return $this
     */
    public function addRule(array $rule)
    {
        return $this->addToAttribute('rules', $rule);
    }

    /**
     * Batch-add multiple rules to the webook.
     *
     * @param  array  $rules
     * @return $this
     */
    public function addRules(array $rules)
    {
        foreach ($rules as $rule) {
            $this->addRule($rule);
        }

        return $this;
    }
}