@param $tagTextOrArray

@return self
336288
protected function addChild($tagTextOrArray)
    {
        // a list of arguments to be passed to builder->make()
        if (is_array($tagTextOrArray) && ! empty($tagTextOrArray)) {
            if (! isset($this->builder)) {
                throw new \InvalidArgumentException(sprintf('Builder not attached to tag `%s`', $this->tag));
            }

            $tagName        = $tagTextOrArray[0];
            $props          = isset($tagTextOrArray[1]) ? $tagTextOrArray[1] : [ ];
            $content        = isset($tagTextOrArray[2]) ? $tagTextOrArray[2] : [ ];
            $tagTextOrArray = $this->builder->make($tagName, $props, $content);
        }

        array_push($this->content, $tagTextOrArray);

        return $this;
    }
256738
public function setSpecialCaseTags(array $tags = array())
    {
        $this->specialCaseTags = $tags;
        $this->specialCaseOpeningTags = array();
        $this->specialCaseClosingTags = array();

        foreach ($this->specialCaseTags as $tag) {
            $this->addSpecialCaseTag($tag);
        }

        return $this;
    }
1373631
protected function see($text, $tag = 'body')
    {
        $this->assertContains($text, $this->getTextByTag($tag));

        return $this;
    }
206476
public function setReadPreference($readPreference, array $tags = null)
    {
        if ($tags !== null) {
            $this->riakCursor->setReadPreference($readPreference, $tags);
        } else {
            $this->riakCursor->setReadPreference($readPreference);
        }

        $this->readPreference = $readPreference;
        $this->readPreferenceTags = $tags;

        return $this;
    }
1163194
public static function create(string $ciphertext, string $iv, string $tag, ?string $aad = null, array $sharedHeader = [], array $sharedProtectedHeader = [], ?string $encodedSharedProtectedHeader = null, array $recipients = []): self
    {
        return new self($ciphertext, $iv, $tag, $aad, $sharedHeader, $sharedProtectedHeader, $encodedSharedProtectedHeader, $recipients);
    }
593450
public function syncTags($tags)
    {
        /** @var Tag $className */
        $className = static::getTagClassName();

        $tags = collect($className::findOrCreate($tags));

        $this->tags()->sync($tags->pluck('id')->toArray());

        return $this;
    }
1302484
public function addTags(array $tags)
    {
        $this->tagsChanges['added'] = array_unique(
            array_merge($this->tagsChanges['added'], $tags)
        );

        return $this;
    }
407743
public function removeSelfClosingTag($tag): Dom
    {
        if ( ! is_array($tag)) {
            $tag = [$tag];
        }
        $this->selfClosing = array_diff($this->selfClosing, $tag);

        return $this;
    }
618660
private function convertLinksToText(Element $topNode): self {
        if (!empty($topNode)) {
            $links = $topNode->find('a');

            foreach ($links as $item) {
                $images = $item->find('img');

                if ($images->count() == 0) {
                    $item->replaceWith(new Text(Helper::textNormalise($item->text())));
                }
            }
        }

        return $this;
    }
151623
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['id'])) {
            $self->setId($data['id']);
        }
        if (isset($data['name'])) {
            $self->setName($data['name']);
        }
        if (isset($data['plural'])) {
            $self->setPlural($data['plural']);
        }
        if (isset($data['data_type'])) {
            $self->setDataType($data['data_type']);
        }
        if (isset($data['tags'])) {
            $self->setTags($data['tags']);
        }

        return $self;
    }
3995
public function setTag($tag)
    {
        if (in_array($tag, $this->getParent()->allowed_tags)) {
            throw new \Exception($tag.' can not be changed as it is not allowed under '.$this->getParent()->getTag().'.');
        }

        $this->tag = $tag;

        return $this;
    }
319660
public function makeTagArray($tagNames)
    {
        if(is_array($tagNames) && count($tagNames) == 1) {
            $tagNames = reset($tagNames);
        }

        if(is_string($tagNames)) {
            $tagNames = explode(',', $tagNames);
        } elseif(!is_array($tagNames)) {
            $tagNames = array(null);
        }

        $tagNames = array_map('trim', $tagNames);

        return array_values($tagNames);
    }
801975
public function setReadPreference($readPreference, array $tags = null)
    {
        if ($tags !== null) {
            $this->mongoCursor->setReadPreference($readPreference, $tags);
        } else {
            $this->mongoCursor->setReadPreference($readPreference);
        }

        $this->readPreference = $readPreference;
        $this->readPreferenceTags = $tags;

        return $this;
    }
1015849
public function flush($tag) {
        $args = func_get_args();
        foreach ($args as $item) {
            if (in_array($item, $this->sequence)) {
                $this->$item = [];
            }
        }
        return $this;
    }
975678
public function set(array $tags)
    {
        if (!empty($tags)) {
            foreach ($tags as $_tag) {
                $this->add($_tag);
            }
        }
        return $this;
    }
177628
public function setTags(array $aEventTags)
    {
        $this->aTags = [];

        foreach ($aEventTags as $iTagId => $skeVentTag) {
            if (!$skeVentTag instanceof SkeVentTag) {
                $skeVentTag = new SkeVentTag([
                    'tag_id' => $iTagId,
                    'value' => $skeVentTag,
                ]);
            }
            $this->aTags[$skeVentTag->tag_id] = $skeVentTag;
        }

        return $this;
    }
756274
public function setTags($tags)
    {
        $this->tags = [];
        $this->ref = null;

        if (is_array($tags)) {
            foreach ($tags as $tag) {
                $this->addTag($tag);
            }
        } else {
            $this->addTag($tags);
        }

        return $this;
    }