Crell/HtmlModel

View on GitHub
src/ContentElementInterface.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Crell\HtmlModel;

/**
 * Classes with this interface can contain content.
 *
 * @todo There's a fancy name in the spec for such elements; rename this interface
 * accordingly once we look it up.
 */
interface ContentElementInterface
{
    /**
     * Returns the body of the element.
     *
     * @return string
     *   The body of the element.
     */
    public function getContent() : string;

    /**
     * Returns a copy of the element with the body content set.
     *
     * @param string $content
     *   The body of the element to set, that is, everything inside the tag.
     * @return self
     */
    public function withContent(string $content);
}