Remove whitespaces

This commit is contained in:
slawkens 2020-10-07 23:36:21 +02:00
parent 1992410a7b
commit 40b151b4c5
2 changed files with 47 additions and 47 deletions

View File

@ -15,7 +15,7 @@
/** /**
* Wrapper for monsters list. * Wrapper for monsters list.
* *
* @package POT * @package POT
* @version 0.1.3 * @version 0.1.3
* @tutorial POT/data_directory.pkg#monsters * @tutorial POT/data_directory.pkg#monsters
@ -24,14 +24,14 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
{ {
/** /**
* Monsters directory. * Monsters directory.
* *
* @var string * @var string
*/ */
private $monstersPath; private $monstersPath;
/** /**
* List of loaded monsters. * List of loaded monsters.
* *
* @var array * @var array
*/ */
private $monsters = array(); private $monsters = array();
@ -40,11 +40,11 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
private $hasErrors = false; private $hasErrors = false;
/** /**
* Loads monsters mapping file. * Loads monsters mapping file.
* *
* <p> * <p>
* Note: You pass directory path, not monsters.xml file name itself. * Note: You pass directory path, not monsters.xml file name itself.
* </p> * </p>
* *
* @param string $path Monsters directory. * @param string $path Monsters directory.
* @throws DOMException On DOM operation error. * @throws DOMException On DOM operation error.
*/ */
@ -64,7 +64,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
log_append('error.log', '[OTS_MonstersList.php] Fatal error: Cannot load monsters.xml. File does not exist. (' . $this->monstersPath . 'monsters.xml' . ').'); log_append('error.log', '[OTS_MonstersList.php] Fatal error: Cannot load monsters.xml. File does not exist. (' . $this->monstersPath . 'monsters.xml' . ').');
throw new Exception('Error: Cannot load monsters.xml. File not found.'); throw new Exception('Error: Cannot load monsters.xml. File not found.');
} }
// loads monsters mapping file // loads monsters mapping file
$monsters = new DOMDocument(); $monsters = new DOMDocument();
if(!@$monsters->load($this->monstersPath . 'monsters.xml')) { if(!@$monsters->load($this->monstersPath . 'monsters.xml')) {
@ -81,9 +81,9 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}. * Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}.
* *
* @param array $properties List of object properties. * @param array $properties List of object properties.
*/ */
public function __set_state($properties) public function __set_state($properties)
@ -101,7 +101,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
/** /**
* Checks if given monster ID exists on list. * Checks if given monster ID exists on list.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param string $name Monster name. * @param string $name Monster name.
@ -124,7 +124,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
} }
/** /**
* Returns loaded data of given monster. * Returns loaded data of given monster.
* *
* @version 0.1.3 * @version 0.1.3
* @param string $name Monster name. * @param string $name Monster name.
* @return OTS_Monster Monster data. * @return OTS_Monster Monster data.
@ -140,10 +140,10 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
// loads file // loads file
$monster = new OTS_Monster(); $monster = new OTS_Monster();
//echo $this->monstersPath . $this->monsters[$name]; //echo $this->monstersPath . $this->monsters[$name];
// check if monster file exist // check if monster file exist
if(file_exists($this->monstersPath . $this->monsters[$name])) { if(file_exists($this->monstersPath . $this->monsters[$name])) {
set_error_handler(array($this, 'xmlErrorHandler')); set_error_handler(array($this, 'xmlErrorHandler'));
$this->lastMonsterFile = $this->monstersPath . $this->monsters[$name]; $this->lastMonsterFile = $this->monstersPath . $this->monsters[$name];
@$monster->loadXML(trim(file_get_contents($this->monstersPath . $this->monsters[$name]))); @$monster->loadXML(trim(file_get_contents($this->monstersPath . $this->monsters[$name])));
restore_error_handler(); restore_error_handler();
@ -160,7 +160,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
} }
/** /**
* Returns amount of monsters loaded. * Returns amount of monsters loaded.
* *
* @return int Count of monsters. * @return int Count of monsters.
*/ */
public function count() public function count()
@ -170,7 +170,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
/** /**
* Returns monster at current position in iterator. * Returns monster at current position in iterator.
* *
* @return OTS_Monster Monster. * @return OTS_Monster Monster.
* @throws DOMException On DOM operation error. * @throws DOMException On DOM operation error.
*/ */
@ -178,7 +178,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
{ {
return $this->getMonster( key($this->monsters) ); return $this->getMonster( key($this->monsters) );
} }
public function currentFile() public function currentFile()
{ {
return $this->monsters[key($this->monsters)]; return $this->monsters[key($this->monsters)];
@ -194,7 +194,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
/** /**
* Returns name of current position. * Returns name of current position.
* *
* @return string Current position key. * @return string Current position key.
*/ */
public function key() public function key()
@ -204,7 +204,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
/** /**
* Checks if there is anything more in interator. * Checks if there is anything more in interator.
* *
* @return bool If iterator has anything more. * @return bool If iterator has anything more.
*/ */
public function valid() public function valid()
@ -222,7 +222,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
/** /**
* Checks if given element exists. * Checks if given element exists.
* *
* @param string $offset Array key. * @param string $offset Array key.
* @return bool True if it's set. * @return bool True if it's set.
*/ */
@ -233,7 +233,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
/** /**
* Returns item from given position. * Returns item from given position.
* *
* @version 0.1.3 * @version 0.1.3
* @param string $offset Array key. * @param string $offset Array key.
* @return OTS_Monster Monster instance. * @return OTS_Monster Monster instance.
@ -246,7 +246,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
/** /**
* This method is implemented for ArrayAccess interface. In fact you can't write/append to monsters list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise. * This method is implemented for ArrayAccess interface. In fact you can't write/append to monsters list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
* *
* @param string|int $offset Array key. * @param string|int $offset Array key.
* @param mixed $value Field value. * @param mixed $value Field value.
* @throws E_OTS_ReadOnly Always - this class is read-only. * @throws E_OTS_ReadOnly Always - this class is read-only.
@ -258,7 +258,7 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
/** /**
* This method is implemented for ArrayAccess interface. In fact you can't write/append to monsters list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise. * This method is implemented for ArrayAccess interface. In fact you can't write/append to monsters list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
* *
* @param string|int $offset Array key. * @param string|int $offset Array key.
* @throws E_OTS_ReadOnly Always - this class is read-only. * @throws E_OTS_ReadOnly Always - this class is read-only.
*/ */
@ -269,11 +269,11 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
/** /**
* Returns string representation of object. * Returns string representation of object.
* *
* <p> * <p>
* If any display driver is currently loaded then it uses it's method. * If any display driver is currently loaded then it uses it's method.
* </p> * </p>
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @return string String representation of object. * @return string String representation of object.

View File

@ -15,11 +15,11 @@
/** /**
* Wrapper for spells list. * Wrapper for spells list.
* *
* <p> * <p>
* Note: Unlike other lists classes this one doesn't implement ArrayAccess interface because it contains three kinds of spells grouped into pararell arrays. * Note: Unlike other lists classes this one doesn't implement ArrayAccess interface because it contains three kinds of spells grouped into pararell arrays.
* </p> * </p>
* *
* @package POT * @package POT
* @version 0.1.5 * @version 0.1.5
* @property-read array $runesList List of rune spells. * @property-read array $runesList List of rune spells.
@ -44,32 +44,32 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Rune spells. * Rune spells.
* *
* @var array * @var array
*/ */
private $runes = array(); private $runes = array();
/** /**
* Instant spells. * Instant spells.
* *
* @var array * @var array
*/ */
private $instants = array(); private $instants = array();
/** /**
* Conjure spells. * Conjure spells.
* *
* @var array * @var array
*/ */
private $conjures = array(); private $conjures = array();
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* <p> * <p>
* Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}. * Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}.
* </p> * </p>
* *
* @param array $properties List of object properties. * @param array $properties List of object properties.
*/ */
public function __set_state($properties) public function __set_state($properties)
@ -87,7 +87,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Loads spells list. * Loads spells list.
* *
* @param string $file Spells file name. * @param string $file Spells file name.
* @throws DOMException On DOM operation error. * @throws DOMException On DOM operation error.
*/ */
@ -98,7 +98,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
log_append('error.log', '[OTS_SpellsList.php] Fatal error: Cannot load spells.xml. File does not exist. (' . $file . ').'); log_append('error.log', '[OTS_SpellsList.php] Fatal error: Cannot load spells.xml. File does not exist. (' . $file . ').');
throw new Exception('Error: Cannot load spells.xml. File not found.'); throw new Exception('Error: Cannot load spells.xml. File not found.');
} }
// loads monsters mapping file // loads monsters mapping file
$spells = new DOMDocument(); $spells = new DOMDocument();
if(!@$spells->load($file)) { if(!@$spells->load($file)) {
@ -127,7 +127,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Returns list of runes. * Returns list of runes.
* *
* @return array List of rune names. * @return array List of rune names.
*/ */
public function getRunesList() public function getRunesList()
@ -137,7 +137,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Checks if rune exists. * Checks if rune exists.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param string $name Rune name. * @param string $name Rune name.
@ -150,7 +150,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Returns given rune spell. * Returns given rune spell.
* *
* @version 0.1.3 * @version 0.1.3
* @param string $name Rune name. * @param string $name Rune name.
* @return OTS_Spell Rune spell wrapper. * @return OTS_Spell Rune spell wrapper.
@ -168,7 +168,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Returns list of instants. * Returns list of instants.
* *
* @return array List of instant spells names. * @return array List of instant spells names.
*/ */
public function getInstantsList() public function getInstantsList()
@ -178,7 +178,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Checks if instant exists. * Checks if instant exists.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param string $name Instant name. * @param string $name Instant name.
@ -191,7 +191,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Returns given instant spell. * Returns given instant spell.
* *
* @version 0.1.3 * @version 0.1.3
* @param string $name Spell name. * @param string $name Spell name.
* @return OTS_Spell Instant spell wrapper. * @return OTS_Spell Instant spell wrapper.
@ -209,7 +209,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Returns list of conjure spells. * Returns list of conjure spells.
* *
* @return array List of conjure spells names. * @return array List of conjure spells names.
*/ */
public function getConjuresList() public function getConjuresList()
@ -219,7 +219,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Checks if conjure exists. * Checks if conjure exists.
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @param string $name Conjure name. * @param string $name Conjure name.
@ -232,7 +232,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Returns given conjure spell. * Returns given conjure spell.
* *
* @version 0.1.3 * @version 0.1.3
* @param string $name Spell name. * @param string $name Spell name.
* @return OTS_Spell Conjure spell wrapper. * @return OTS_Spell Conjure spell wrapper.
@ -250,7 +250,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* @param string $name Property name. * @param string $name Property name.
* @return mixed Property value. * @return mixed Property value.
* @throws OutOfBoundsException For non-supported properties. * @throws OutOfBoundsException For non-supported properties.
@ -275,11 +275,11 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Returns string representation of object. * Returns string representation of object.
* *
* <p> * <p>
* If any display driver is currently loaded then it uses it's method. * If any display driver is currently loaded then it uses it's method.
* </p> * </p>
* *
* @version 0.1.3 * @version 0.1.3
* @since 0.1.3 * @since 0.1.3
* @return string String representation of object. * @return string String representation of object.
@ -299,11 +299,11 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Iterator for all spells. * Iterator for all spells.
* *
* <p> * <p>
* Returned object will continousely iterate through all kind of spells. * Returned object will continousely iterate through all kind of spells.
* </p> * </p>
* *
* @version 0.1.5 * @version 0.1.5
* @since 0.1.5 * @since 0.1.5
* @return AppendIterator Iterator for all spells. * @return AppendIterator Iterator for all spells.
@ -319,7 +319,7 @@ class OTS_SpellsList implements IteratorAggregate, Countable
/** /**
* Number of all loaded spells. * Number of all loaded spells.
* *
* @version 0.1.5 * @version 0.1.5
* @since 0.1.5 * @since 0.1.5
* @return int Amount of all spells. * @return int Amount of all spells.