for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace DataStructures\Lists;
use DataStructures\Lists\Interfaces\ListInterface;
abstract class ListAbstract implements ListInterface {
protected $size;
/**
* Binds to count() method. This is equal to make $this->tree->size().
*
* @return integer the tree size. 0 if it is empty.
*/
public function count() {
return $this->size;
}
* Returns the array size.
* @return int the length
public function size() : int {
* Checks if the list is empty.
* @return boolean true if is empty, else false.
public function empty() : bool {
return $this->size === 0;