Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/FontLib/TrueType/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Collection extends BinaryStream implements Iterator, Countable {
protected $version;
protected $numFonts;

function parse() {
function parse() : void {
if (isset($this->numFonts)) {
return;
}
Expand All @@ -51,7 +51,7 @@ function parse() {
* @throws OutOfBoundsException
* @return File
*/
function getFont($fontId) {
function getFont($fontId) : File {
$this->parse();

if (!isset($this->collectionOffsets[$fontId])) {
Expand All @@ -69,29 +69,29 @@ function getFont($fontId) {
return $this->collection[$fontId] = $font;
}

function current() {
function current() : File {
return $this->getFont($this->position);
}

function key() {
function key() : int {
return $this->position;
}

function next() {
return ++$this->position;
function next() : void {
++$this->position;
}

function rewind() {
function rewind() : void {
$this->position = 0;
}

function valid() {
function valid() : bool {
$this->parse();

return isset($this->collectionOffsets[$this->position]);
}

function count() {
function count(): int {
$this->parse();

return $this->numFonts;
Expand Down