@@ -24,6 +24,12 @@ class ScripturNumArray implements ArrayAccess, Iterator, Countable
2424 protected $ hasMultiplePassagesFromAChapter = false ;
2525
2626
27+ /**
28+ * Constructor
29+ *
30+ * @param array $initialValues An array of initial values to add to the container. These can be ScripturNum objects
31+ * or strings/integers that can be parsed into ScripturNum objects.
32+ */
2733 public function __construct ($ initialValues = [])
2834 {
2935 foreach ($ initialValues as $ k => $ i ) {
@@ -61,7 +67,8 @@ protected function sort()
6167
6268 /**
6369 * @return void
64- */
70+ * @noinspection PhpDocMissingThrowsInspection
71+ */
6572 protected function combineAdjacents ()
6673 {
6774 $ prev = null ;
@@ -103,15 +110,15 @@ protected function sortAndCombineIfNeeded()
103110 }
104111
105112 /**
106- * Whether a offset exists
113+ * Whether an offset exists
107114 * @link https://php.net/manual/en/arrayaccess.offsetexists.php
108115 *
109116 * @param mixed $offset
110117 * An offset to check for.
111118 *
112119 * @return bool true on success or false on failure.
113120 *
114- * The return value will be casted to boolean if non-boolean was returned.
121+ * The return value will be cast to boolean if non-boolean was returned.
115122 */
116123 public function offsetExists ($ offset ): bool
117124 {
@@ -220,7 +227,7 @@ public function key()
220227 /**
221228 * Checks if current position is valid
222229 * @link https://php.net/manual/en/iterator.valid.php
223- * @return bool The return value will be casted to boolean and then evaluated.
230+ * @return bool The return value will be cast to boolean and then evaluated.
224231 * Returns true on success or false on failure.
225232 */
226233 public function valid (): bool
@@ -260,6 +267,15 @@ public function count(): int
260267 return count ($ this ->container );
261268 }
262269
270+ /**
271+ * Subtract a passage from this array of passages.
272+ *
273+ * @since 2.1.0
274+ *
275+ * @param ScripturNum $other
276+ * @return ScripturNumArray
277+ * @throws ScripturNumException
278+ */
263279 public function remove (ScripturNum $ other ): ScripturNumArray
264280 {
265281 $ result = new ScripturNumArray ();
@@ -278,6 +294,15 @@ public function remove(ScripturNum $other): ScripturNumArray
278294 return $ result ;
279295 }
280296
297+ /**
298+ * Subtract all passages in another ScripturNumArray from this array of passages.
299+ *
300+ * @since 2.1.0
301+ *
302+ * @param ScripturNumArray $others
303+ * @return ScripturNumArray
304+ * @throws ScripturNumException
305+ */
281306 public function removeAll (ScripturNumArray $ others ): ScripturNumArray
282307 {
283308 $ this ->sortAndCombineIfNeeded ();
0 commit comments