for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Germania\Users;
class Users implements UsersInterface
{
/**
* @var array
*/
public $users = array();
public function __debugInfo() {
return [
'NumberOfUsers' => $this->count()
];
}
* @return UserInterface
* @throws UserNotFoundException
* @uses $users
public function get( $id )
if ($this->has( $id )) {
return $this->users[ $id ];
throw new UserNotFoundException("Could not find User with ID '$id'");
* @return boolean
public function has ($id )
return array_key_exists( $id, $this->users);
* @return ArrayIterator
Germania\Users\ArrayIterator
ArrayIterator
\
public function getIterator()
return new \ArrayIterator( $this->users );
return new ArrayIterator($this->users)
* @return int
public function count()
return count($this->users);