serp-spider/core

View on GitHub
src/Core/Dom/NullDomNode.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
/**
 * @license see LICENSE
 */

namespace Serps\Core\Dom;

class NullDomNode extends \DOMNode implements DomNodeInterface
{
    /**
     * @inheritdoc
     */
    public function hasClass($className)
    {
        return false;
    }

    /**
     * @inheritdoc
     */
    public function hasClasses(array $className)
    {
        return false;
    }

    /**
     * @inheritdoc
     */
    public function hasAnyClass(array $classNames)
    {
        return false;
    }

    /**
     * @inheritdoc
     */
    public function getAttribute($name)
    {
        return null;
    }

    /**
     * @inheritdoc
     */
    public function getTagName()
    {
        return '';
    }

    /**
     * @inheritdoc
     */
    public function getNodeValue()
    {
        return '';
    }

    /**
     * @inheritdoc
     */
    public function getChildren()
    {
        return new EmptyDomNodeList();
    }

    /**
     * @inheritdoc
     */
    public function getLastChild()
    {
        return new NullDomNode();
    }
}