FakeCollection.php in Lightweight Directory Access Protocol (LDAP)  8.4        
                          
                  
                        
  
  
  
  
  
File
  ldap_servers/tests/modules/ldap_servers_dummy/src/FakeCollection.php
  
    View source  
  <?php
declare (strict_types=1);
namespace Drupal\ldap_servers_dummy;
use Symfony\Component\Ldap\Adapter\CollectionInterface;
class FakeCollection implements CollectionInterface {
  
  protected $result;
  
  public function __construct(array $result) {
    $this->result = new \ArrayObject($result);
  }
  
  public function toArray() : array {
    return (array) $this->result;
  }
  
  public function getIterator() {
    return $this->result
      ->getIterator();
  }
  
  public function offsetExists($offset) : bool {
    return $this->result
      ->offsetExists($offset);
  }
  
  public function offsetGet($offset) {
    return $this->result
      ->offsetGet($offset);
  }
  
  public function offsetSet($offset, $value) : void {
    $this->result
      ->offsetSet($offset, $value);
  }
  
  public function offsetUnset($offset) : void {
    $this->result
      ->offsetUnset($offset);
  }
  
  public function count() : int {
    return $this->result
      ->count();
  }
}