diff --git a/src/Dn.php b/src/Dn.php index 34f01609b..e4c411d6b 100644 --- a/src/Dn.php +++ b/src/Dn.php @@ -77,7 +77,7 @@ public static function fromString($dn, $caseFold = null) } else { $dnArray = static::explodeDn((string) $dn); } - return new self($dnArray, $caseFold); + return new static($dnArray, $caseFold); } /** @@ -90,7 +90,7 @@ public static function fromString($dn, $caseFold = null) */ public static function fromArray(array $dn, $caseFold = null) { - return new self($dn, $caseFold); + return new static($dn, $caseFold); } /** @@ -145,7 +145,7 @@ public function getParentDn($levelUp = 1) throw new Exception\LdapException(null, 'Cannot retrieve parent DN with given $levelUp'); } $newDn = array_slice($this->dn, $levelUp); - return new self($newDn, $this->caseFold); + return new static($newDn, $this->caseFold); } /** diff --git a/src/Filter.php b/src/Filter.php index ecc3af798..09712afdf 100644 --- a/src/Filter.php +++ b/src/Filter.php @@ -36,7 +36,7 @@ class Filter extends Filter\StringFilter */ public static function equals($attr, $value) { - return new self($attr, $value, self::TYPE_EQUALS, null, null); + return new static($attr, $value, self::TYPE_EQUALS, null, null); } /** @@ -49,7 +49,7 @@ public static function equals($attr, $value) */ public static function begins($attr, $value) { - return new self($attr, $value, self::TYPE_EQUALS, null, '*'); + return new static($attr, $value, self::TYPE_EQUALS, null, '*'); } /** @@ -62,7 +62,7 @@ public static function begins($attr, $value) */ public static function ends($attr, $value) { - return new self($attr, $value, self::TYPE_EQUALS, '*', null); + return new static($attr, $value, self::TYPE_EQUALS, '*', null); } /** @@ -75,7 +75,7 @@ public static function ends($attr, $value) */ public static function contains($attr, $value) { - return new self($attr, $value, self::TYPE_EQUALS, '*', '*'); + return new static($attr, $value, self::TYPE_EQUALS, '*', '*'); } /** @@ -88,7 +88,7 @@ public static function contains($attr, $value) */ public static function greater($attr, $value) { - return new self($attr, $value, self::TYPE_GREATER, null, null); + return new static($attr, $value, self::TYPE_GREATER, null, null); } /** @@ -101,7 +101,7 @@ public static function greater($attr, $value) */ public static function greaterOrEqual($attr, $value) { - return new self($attr, $value, self::TYPE_GREATEROREQUAL, null, null); + return new static($attr, $value, self::TYPE_GREATEROREQUAL, null, null); } /** @@ -114,7 +114,7 @@ public static function greaterOrEqual($attr, $value) */ public static function less($attr, $value) { - return new self($attr, $value, self::TYPE_LESS, null, null); + return new static($attr, $value, self::TYPE_LESS, null, null); } /** @@ -127,7 +127,7 @@ public static function less($attr, $value) */ public static function lessOrEqual($attr, $value) { - return new self($attr, $value, self::TYPE_LESSOREQUAL, null, null); + return new static($attr, $value, self::TYPE_LESSOREQUAL, null, null); } /** @@ -140,7 +140,7 @@ public static function lessOrEqual($attr, $value) */ public static function approx($attr, $value) { - return new self($attr, $value, self::TYPE_APPROX, null, null); + return new static($attr, $value, self::TYPE_APPROX, null, null); } /** @@ -152,7 +152,7 @@ public static function approx($attr, $value) */ public static function any($attr) { - return new self($attr, '', self::TYPE_EQUALS, '*', null); + return new static($attr, '', self::TYPE_EQUALS, '*', null); } /** diff --git a/src/Ldif/Encoder.php b/src/Ldif/Encoder.php index a0d0593a6..57f9838ca 100644 --- a/src/Ldif/Encoder.php +++ b/src/Ldif/Encoder.php @@ -55,7 +55,7 @@ protected function __construct(array $options = array()) */ public static function decode($string) { - $encoder = new self(array()); + $encoder = new static(array()); return $encoder->_decode($string); } @@ -136,7 +136,7 @@ protected function pushAttribute(array $attribute, array &$entry) */ public static function encode($value, array $options = array()) { - $encoder = new self($options); + $encoder = new static($options); return $encoder->_encode($value); } diff --git a/src/Node.php b/src/Node.php index 95f128936..9803e0a60 100644 --- a/src/Node.php +++ b/src/Node.php @@ -245,7 +245,7 @@ public static function create($dn, array $objectClass = array()) } else { throw new Exception\LdapException(null, '$dn is of a wrong data type.'); } - $new = new self($dn, array(), false, null); + $new = new static($dn, array(), false, null); $new->ensureRdnAttributeValues(); $new->setAttribute('objectClass', $objectClass); @@ -273,7 +273,7 @@ public static function fromLdap($dn, Ldap $ldap) if ($data === null) { return null; } - $entry = new self($dn, $data, true, $ldap); + $entry = new static($dn, $data, true, $ldap); return $entry; } @@ -299,7 +299,7 @@ public static function fromArray(array $data, $fromDataSource = false) throw new Exception\LdapException(null, '\'dn\' key is of a wrong data type.'); } $fromDataSource = ($fromDataSource === true) ? true : false; - $new = new self($dn, $data, $fromDataSource, null); + $new = new static($dn, $data, $fromDataSource, null); $new->ensureRdnAttributeValues(); return $new; diff --git a/src/Node/RootDse.php b/src/Node/RootDse.php index df8f96c54..828d4a997 100644 --- a/src/Node/RootDse.php +++ b/src/Node/RootDse.php @@ -46,7 +46,7 @@ public static function create(Ldap\Ldap $ldap) return new RootDse\OpenLdap($dn, $data); } - return new self($dn, $data); + return new static($dn, $data); } /** diff --git a/src/Node/Schema.php b/src/Node/Schema.php index 203037ed9..c28a5cf98 100644 --- a/src/Node/Schema.php +++ b/src/Node/Schema.php @@ -43,7 +43,7 @@ public static function create(Ldap\Ldap $ldap) return new Schema\OpenLdap($dn, $data, $ldap); case RootDse::SERVER_TYPE_EDIRECTORY: default: - return new self($dn, $data, $ldap); + return new static($dn, $data, $ldap); } }