aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/mikespub/php-epub-meta/src/Contents
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/mikespub/php-epub-meta/src/Contents')
-rw-r--r--vendor/mikespub/php-epub-meta/src/Contents/Nav.php63
-rw-r--r--vendor/mikespub/php-epub-meta/src/Contents/NavPoint.php109
-rw-r--r--vendor/mikespub/php-epub-meta/src/Contents/NavPointList.php65
-rw-r--r--vendor/mikespub/php-epub-meta/src/Contents/Spine.php198
-rw-r--r--vendor/mikespub/php-epub-meta/src/Contents/Toc.php63
5 files changed, 0 insertions, 498 deletions
diff --git a/vendor/mikespub/php-epub-meta/src/Contents/Nav.php b/vendor/mikespub/php-epub-meta/src/Contents/Nav.php
deleted file mode 100644
index e8eb980a6..000000000
--- a/vendor/mikespub/php-epub-meta/src/Contents/Nav.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-namespace SebLucas\EPubMeta\Contents;
-
-/**
- * EPUB NAV structure for EPUB 3
- *
- * @author Simon Schrape <simon@epubli.com>
- */
-class Nav
-{
- /** @var string from main document */
- protected $docTitle;
- /** @var string from main document */
- protected $docAuthor;
- /** @var NavPointList */
- protected $navMap;
-
- /**
- * Summary of __construct
- * @param string $title
- * @param string $author
- */
- public function __construct($title, $author)
- {
- $this->docTitle = $title;
- $this->docAuthor = $author;
- $this->navMap = new NavPointList();
- }
-
- /**
- * @return string
- */
- public function getDocTitle()
- {
- return $this->docTitle;
- }
-
- /**
- * @return string
- */
- public function getDocAuthor()
- {
- return $this->docAuthor;
- }
-
- /**
- * @return NavPointList
- */
- public function getNavMap()
- {
- return $this->navMap;
- }
-
- /**
- * @param string $file
- * @return array|NavPoint[]
- */
- public function findNavPointsForFile($file)
- {
- return $this->getNavMap()->findNavPointsForFile($file);
- }
-}
diff --git a/vendor/mikespub/php-epub-meta/src/Contents/NavPoint.php b/vendor/mikespub/php-epub-meta/src/Contents/NavPoint.php
deleted file mode 100644
index 7ffb29dca..000000000
--- a/vendor/mikespub/php-epub-meta/src/Contents/NavPoint.php
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-
-namespace SebLucas\EPubMeta\Contents;
-
-/**
- * An EPUB TOC navigation point.
- *
- * @author Simon Schrape <simon@epubli.com>
- */
-class NavPoint
-{
- /** @var string */
- protected $id;
- /** @var string */
- protected $class;
- /** @var int */
- protected $playOrder;
- /** @var string */
- protected $navLabel;
- /** @var string */
- protected $contentSourceFile;
- /** @var string */
- protected $contentSourceFragment;
- /** @var NavPointList */
- protected $children;
-
- /**
- * @param string $id
- * @param string $class
- * @param int $playOrder
- * @param string $label
- * @param string $contentSource
- */
- public function __construct($id, $class, $playOrder, $label, $contentSource)
- {
- $this->id = $id;
- $this->class = $class;
- $this->playOrder = $playOrder;
- $this->navLabel = $label;
- $contentSourceParts = explode('#', $contentSource, 2);
- $this->contentSourceFile = $contentSourceParts[0];
- $this->contentSourceFragment = $contentSourceParts[1] ?? null;
- $this->children = new NavPointList();
- }
-
- /**
- * @return string
- */
- public function getId()
- {
- return $this->id;
- }
-
- /**
- * @return string
- */
- public function getClass()
- {
- return $this->class;
- }
-
- /**
- * @return int
- */
- public function getPlayOrder()
- {
- return $this->playOrder;
- }
-
- /**
- * @return string
- */
- public function getNavLabel()
- {
- return $this->navLabel;
- }
-
- /**
- * @return string
- */
- public function getContentSource()
- {
- return $this->contentSourceFile . ($this->contentSourceFragment ? '#' . $this->contentSourceFragment : '');
- }
-
- /**
- * @return string
- */
- public function getContentSourceFile()
- {
- return $this->contentSourceFile;
- }
-
- /**
- * @return string
- */
- public function getContentSourceFragment()
- {
- return $this->contentSourceFragment;
- }
-
- /**
- * @return NavPointList
- */
- public function getChildren()
- {
- return $this->children;
- }
-}
diff --git a/vendor/mikespub/php-epub-meta/src/Contents/NavPointList.php b/vendor/mikespub/php-epub-meta/src/Contents/NavPointList.php
deleted file mode 100644
index 540d2f876..000000000
--- a/vendor/mikespub/php-epub-meta/src/Contents/NavPointList.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-namespace SebLucas\EPubMeta\Contents;
-
-use ArrayIterator;
-
-/**
- * A list of EPUB TOC navigation points.
- *
- * @author Simon Schrape <simon@epubli.com>
- * @author mikespub
- * @extends ArrayIterator<int, NavPoint>
- */
-class NavPointList extends ArrayIterator
-{
- public function __construct() {}
-
- /**
- * @return NavPoint
- */
- public function first()
- {
- $this->rewind();
- return $this->current();
- }
-
- /**
- * @return NavPoint
- */
- public function last()
- {
- $this->seek($this->count() - 1);
- return $this->current();
- }
-
- /**
- * @param NavPoint $navPoint
- * @return void
- * @deprecated 2.1.0 use normal append() instead
- */
- public function addNavPoint(NavPoint $navPoint)
- {
- $this->append($navPoint);
- }
-
- /**
- * @param string $file
- *
- * @return array|NavPoint[]
- */
- public function findNavPointsForFile($file)
- {
- $matches = [];
- foreach ($this as $navPoint) {
- if ($navPoint->getContentSourceFile() == $file) {
- $matches[] = $navPoint;
- }
- $childMatches = $navPoint->getChildren()->findNavPointsForFile($file);
- if (count($childMatches)) {
- $matches = array_merge($matches, $childMatches);
- }
- }
- return $matches;
- }
-}
diff --git a/vendor/mikespub/php-epub-meta/src/Contents/Spine.php b/vendor/mikespub/php-epub-meta/src/Contents/Spine.php
deleted file mode 100644
index e6dfc2a84..000000000
--- a/vendor/mikespub/php-epub-meta/src/Contents/Spine.php
+++ /dev/null
@@ -1,198 +0,0 @@
-<?php
-
-namespace SebLucas\EPubMeta\Contents;
-
-use SebLucas\EPubMeta\Data\Item;
-use ArrayAccess;
-use Countable;
-use Iterator;
-use BadMethodCallException;
-
-/**
- * EPUB spine structure
- *
- * @author Simon Schrape <simon@epubli.com>
- * @implements \Iterator<int, Item>
- * @implements \ArrayAccess<int, Item>
- */
-class Spine implements Iterator, Countable, ArrayAccess
-{
- /** @var Item */
- protected $tocItem;
- protected string $tocFormat;
- /** @var array|Item[] The ordered list of all Items in this Spine. */
- protected $items = [];
-
- /**
- * Spine Constructor.
- *
- * @param Item $tocItem The TOC Item of this Spine.
- * @param string $tocFormat The TOC Format of this Spine (Toc or Nav).
- */
- public function __construct(Item $tocItem, string $tocFormat)
- {
- $this->tocItem = $tocItem;
- $this->tocFormat = $tocFormat;
- }
-
- /**
- * Get the TOC Item of this Spine.
- *
- * @return Item
- */
- public function getTocItem()
- {
- return $this->tocItem;
- }
-
- /**
- * Get the TOC Format of this Spine.
- *
- * @return string
- */
- public function getTocFormat()
- {
- return $this->tocFormat;
- }
-
- /**
- * Append an Item to this Spine.
- *
- * @param Item $item The Item to append to this Spine.
- * @return void
- */
- public function appendItem(Item $item)
- {
- $this->items[] = $item;
- }
-
- /**
- * Return the current Item while iterating this Spine.
- *
- * @link http://php.net/manual/en/iterator.current.php
- * @return Item
- */
- public function current(): Item
- {
- return current($this->items);
- }
-
- /**
- * Move forward to next Item while iterating this Spine.
- * @link http://php.net/manual/en/iterator.next.php
- * @return void Any returned value is ignored.
- */
- public function next(): void
- {
- next($this->items);
- }
-
- /**
- * Return the index of the current Item while iterating this Spine.
- *
- * @link http://php.net/manual/en/iterator.key.php
- * @return int|null on success, or null on failure.
- */
- public function key(): ?int
- {
- return key($this->items);
- }
-
- /**
- * Checks if current Iterator position is valid.
- *
- * @link http://php.net/manual/en/iterator.valid.php
- * @return boolean true on success or false on failure.
- */
- public function valid(): bool
- {
- return (bool) current($this->items);
- }
-
- /**
- * Rewind the Iterator to the first element.
- *
- * @link http://php.net/manual/en/iterator.rewind.php
- * @return void Any returned value is ignored.
- */
- public function rewind(): void
- {
- reset($this->items);
- }
-
- /**
- * Get the first Item of this Spine.
- *
- * @return Item
- */
- public function first()
- {
- return reset($this->items);
- }
-
- /**
- * Get the last Item of this Spine.
- *
- * @return Item
- */
- public function last()
- {
- return end($this->items);
- }
-
- /**
- * Count items of this Spine.
- *
- * @link https://php.net/manual/en/countable.count.php
- * @return int The number of Items contained in this Spine.
- */
- public function count(): int
- {
- return count($this->items);
- }
-
- /**
- * Whether a offset exists
- * @link https://php.net/manual/en/arrayaccess.offsetexists.php
- * @param int $offset An offset to check for.
- * @return boolean true on success or false on failure.
- */
- public function offsetExists($offset): bool
- {
- return isset($this->items[$offset]);
- }
-
- /**
- * Offset to retrieve
- * @link https://php.net/manual/en/arrayaccess.offsetget.php
- * @param int $offset The offset to retrieve.
- * @return Item
- */
- public function offsetGet($offset): Item
- {
- return $this->items[$offset];
- }
-
- /**
- * Offset to set
- * @link https://php.net/manual/en/arrayaccess.offsetset.php
- * @param mixed $offset The offset to assign the value to.
- * @param mixed $value The value to set.
- * @throws BadMethodCallException
- */
- public function offsetSet($offset, $value): void
- {
- throw new BadMethodCallException("Only reading array access is supported!");
- }
-
- /**
- * Offset to unset
- * @link https://php.net/manual/en/arrayaccess.offsetunset.php
- * @param mixed $offset The offset to unset.
- * @throws BadMethodCallException
- */
- public function offsetUnset($offset): void
- {
- throw new BadMethodCallException("Only reading array access is supported!");
- }
-}
diff --git a/vendor/mikespub/php-epub-meta/src/Contents/Toc.php b/vendor/mikespub/php-epub-meta/src/Contents/Toc.php
deleted file mode 100644
index 7992c4a8e..000000000
--- a/vendor/mikespub/php-epub-meta/src/Contents/Toc.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-namespace SebLucas\EPubMeta\Contents;
-
-/**
- * EPUB TOC structure for EPUB 2
- *
- * @author Simon Schrape <simon@epubli.com>
- */
-class Toc
-{
- /** @var string */
- protected $docTitle;
- /** @var string */
- protected $docAuthor;
- /** @var NavPointList */
- protected $navMap;
-
- /**
- * Summary of __construct
- * @param string $title
- * @param string $author
- */
- public function __construct($title, $author)
- {
- $this->docTitle = $title;
- $this->docAuthor = $author;
- $this->navMap = new NavPointList();
- }
-
- /**
- * @return string
- */
- public function getDocTitle()
- {
- return $this->docTitle;
- }
-
- /**
- * @return string
- */
- public function getDocAuthor()
- {
- return $this->docAuthor;
- }
-
- /**
- * @return NavPointList
- */
- public function getNavMap()
- {
- return $this->navMap;
- }
-
- /**
- * @param string $file
- * @return array|NavPoint[]
- */
- public function findNavPointsForFile($file)
- {
- return $this->getNavMap()->findNavPointsForFile($file);
- }
-}