Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
PageContent | n/a |
0 / 0 |
n/a |
0 / 0 |
7 | n/a |
0 / 0 |
|||
getRoles | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
hasRole | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getModel | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getFormat | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getContent | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getRedirectTarget | n/a |
0 / 0 |
2 | n/a |
0 / 0 |
<?php | |
declare( strict_types = 1 ); | |
namespace Wikimedia\Parsoid\Config; | |
use InvalidArgumentException; | |
/** | |
* Page content data object | |
*/ | |
abstract class PageContent { | |
/** | |
* Return the roles available in this page | |
* @return string[] | |
*/ | |
abstract public function getRoles(): array; | |
/** | |
* Determine whether the page contains a role | |
* @param string $role | |
* @return bool | |
*/ | |
abstract public function hasRole( string $role ): bool; | |
/** | |
* Fetch the content model for a role | |
* @param string $role | |
* @return string | |
* @throws InvalidArgumentException if the role doesn't exist | |
*/ | |
abstract public function getModel( string $role ): string; | |
/** | |
* Fetch the content format for a role | |
* @param string $role | |
* @return string | |
* @throws InvalidArgumentException if the role doesn't exist | |
*/ | |
abstract public function getFormat( string $role ): string; | |
/** | |
* Fetch the content for a role | |
* @param string $role | |
* @return string | |
* @throws InvalidArgumentException if the role doesn't exist | |
*/ | |
abstract public function getContent( string $role ): string; | |
/** | |
* If the PageContent represents a redirect, return the target | |
* of that redirect as a title string. Otherwise return null. | |
* @return string|null | |
*/ | |
abstract public function getRedirectTarget(): ?string; | |
} |