Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 7 |
CRAP | |
0.00% |
0 / 1 |
| PageContent | |
0.00% |
0 / 7 |
|
0.00% |
0 / 7 |
0 | |
0.00% |
0 / 1 |
| getLinkTarget | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
0 | |||
| getRevisionId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
0 | |||
| getRoles | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
0 | |||
| hasRole | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
0 | |||
| getModel | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
0 | |||
| getFormat | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
0 | |||
| getContent | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
0 | |||
| 1 | <?php |
| 2 | declare( strict_types = 1 ); |
| 3 | |
| 4 | namespace Wikimedia\Parsoid\Config; |
| 5 | |
| 6 | use InvalidArgumentException; |
| 7 | use Wikimedia\Parsoid\Core\LinkTarget; |
| 8 | |
| 9 | /** |
| 10 | * Page content data object |
| 11 | */ |
| 12 | abstract class PageContent { |
| 13 | /** |
| 14 | * Return the title of this page. |
| 15 | */ |
| 16 | abstract public function getLinkTarget(): LinkTarget; |
| 17 | |
| 18 | /** |
| 19 | * Return the revision ID of this page, or null if it is unknown. |
| 20 | */ |
| 21 | abstract public function getRevisionId(): ?int; |
| 22 | |
| 23 | /** |
| 24 | * Return the roles available in this page |
| 25 | * @return string[] |
| 26 | */ |
| 27 | abstract public function getRoles(): array; |
| 28 | |
| 29 | /** |
| 30 | * Determine whether the page contains a role |
| 31 | * @param string $role |
| 32 | * @return bool |
| 33 | */ |
| 34 | abstract public function hasRole( string $role ): bool; |
| 35 | |
| 36 | /** |
| 37 | * Fetch the content model for a role |
| 38 | * @param string $role |
| 39 | * @return string |
| 40 | * @throws InvalidArgumentException if the role doesn't exist |
| 41 | */ |
| 42 | abstract public function getModel( string $role ): string; |
| 43 | |
| 44 | /** |
| 45 | * Fetch the content format for a role |
| 46 | * @param string $role |
| 47 | * @return string |
| 48 | * @throws InvalidArgumentException if the role doesn't exist |
| 49 | */ |
| 50 | abstract public function getFormat( string $role ): string; |
| 51 | |
| 52 | /** |
| 53 | * Fetch the content for a role |
| 54 | * @param string $role |
| 55 | * @return string |
| 56 | * @throws InvalidArgumentException if the role doesn't exist |
| 57 | */ |
| 58 | abstract public function getContent( string $role ): string; |
| 59 | |
| 60 | } |