Skip to content

Commit

Permalink
add resturn type because of changes in interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
KBorm committed Mar 18, 2024
1 parent 898d186 commit 0bddb36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions classes/ProformaXMLElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* @author K.Borm <k.borm[at]ostfalia.de>
*/
class ProformaXMLElement /* extends SimpleXMLElement */
implements ArrayAccess, Countable, Iterator{
implements ArrayAccess, Countable, Iterator {
/** Simple XML element instance */
private $element = null;

Expand Down Expand Up @@ -91,7 +91,7 @@ public function __get($name) {
* @return bool|void
* @throws coding_exception
*/
public function offsetExists($offset) {
public function offsetExists($offset) : bool {
throw new coding_exception('not implemented offsetExists');
}

Expand All @@ -100,15 +100,15 @@ public function offsetExists($offset) {
* @param mixed $value
* @throws coding_exception
*/
public function offsetSet($offset, $value) {
public function offsetSet($offset, $value) : void {
throw new coding_exception('not implemented offsetSet');
}

/**
* @param mixed $offset
* @throws coding_exception
*/
public function offsetUnset($offset) {
public function offsetUnset($offset) : void {
throw new coding_exception('not implemented offsetUnset');
}

Expand All @@ -118,15 +118,15 @@ public function offsetUnset($offset) {
* @param mixed $offset
* @return mixed|SimpleXMLElement Either a named attribute or an element from a list of children
*/
public function offsetGet ($offset) {
public function offsetGet ($offset) : mixed {
return $this->element->attributes()->$offset;
}

/**
* return number of elements
* @return int
*/
public function count() {
public function count() : int {
return count($this->element);
}

Expand Down Expand Up @@ -162,14 +162,14 @@ public function __toString () {
* Iterator interface: return element at cursor position
* @return mixed|ProformaXMLElement
*/
public function current() {
public function current() : mixed {
return new ProformaXMLElement($this->cursor, $this->namespace);
}

/**
* Iterator interface: increment cursor
*/
public function next() {
public function next() : void {
$this->cursor = null;
}

Expand All @@ -178,7 +178,7 @@ public function next() {
* @return bool|float|int|string|void|null
* @throws coding_exception
*/
public function key() {
public function key() : mixed {
// TODO: Implement key() method.
throw new coding_exception('not implemented key');
}
Expand All @@ -187,14 +187,14 @@ public function key() {
* Iterator interface: is cursor valid?
* @return bool
*/
public function valid() {
public function valid() : bool {
return ($this->cursor != null);
}

/**
* Iterator interface: reset cursor
*/
public function rewind() {
public function rewind() : void {
$this->cursor = $this->element;
}

Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'qformat_proforma';
$plugin->version = 2023061500;
$plugin->version = 2024031800;
$plugin->requires = 2017111300;
$plugin->release = '1.3.0';
$plugin->release = '1.3.1';
$plugin->maturity = MATURITY_STABLE;

$plugin->dependencies = array(
Expand Down

0 comments on commit 0bddb36

Please sign in to comment.