@@ -240,7 +240,7 @@ public static function create($dn, array $objectClass = array())
240240 {
241241 if (is_string ($ dn ) || is_array ($ dn )) {
242242 $ dn = Dn::factory ($ dn );
243- } else if ($ dn instanceof Dn) {
243+ } elseif ($ dn instanceof Dn) {
244244 $ dn = clone $ dn ;
245245 } else {
246246 throw new Exception \LdapException (null , '$dn is of a wrong data type. ' );
@@ -264,7 +264,7 @@ public static function fromLdap($dn, Ldap $ldap)
264264 {
265265 if (is_string ($ dn ) || is_array ($ dn )) {
266266 $ dn = Dn::factory ($ dn );
267- } else if ($ dn instanceof Dn) {
267+ } elseif ($ dn instanceof Dn) {
268268 $ dn = clone $ dn ;
269269 } else {
270270 throw new Exception \LdapException (null , '$dn is of a wrong data type. ' );
@@ -293,7 +293,7 @@ public static function fromArray(array $data, $fromDataSource = false)
293293 }
294294 if (is_string ($ data ['dn ' ]) || is_array ($ data ['dn ' ])) {
295295 $ dn = Dn::factory ($ data ['dn ' ]);
296- } else if ($ data ['dn ' ] instanceof Dn) {
296+ } elseif ($ data ['dn ' ] instanceof Dn) {
297297 $ dn = clone $ data ['dn ' ];
298298 } else {
299299 throw new Exception \LdapException (null , '\'dn \' key is of a wrong data type. ' );
@@ -316,7 +316,7 @@ protected function ensureRdnAttributeValues($overwrite = false)
316316 foreach ($ this ->getRdnArray () as $ key => $ value ) {
317317 if (!array_key_exists ($ key , $ this ->currentData ) || $ overwrite ) {
318318 Attribute::setAttribute ($ this ->currentData , $ key , $ value , false );
319- } else if (!in_array ($ value , $ this ->currentData [$ key ])) {
319+ } elseif (!in_array ($ value , $ this ->currentData [$ key ])) {
320320 Attribute::setAttribute ($ this ->currentData , $ key , $ value , true );
321321 }
322322 }
@@ -393,7 +393,7 @@ public function willBeMoved()
393393 {
394394 if ($ this ->isNew () || $ this ->willBeDeleted ()) {
395395 return false ;
396- } else if ($ this ->newDn !== null ) {
396+ } elseif ($ this ->newDn !== null ) {
397397 return ($ this ->dn != $ this ->newDn );
398398 } else {
399399 return false ;
@@ -605,7 +605,7 @@ public function getChangedData()
605605 foreach ($ this ->currentData as $ key => $ value ) {
606606 if (!array_key_exists ($ key , $ this ->originalData ) && !empty ($ value )) {
607607 $ changed [$ key ] = $ value ;
608- } else if ($ this ->originalData [$ key ] !== $ this ->currentData [$ key ]) {
608+ } elseif ($ this ->originalData [$ key ] !== $ this ->currentData [$ key ]) {
609609 $ changed [$ key ] = $ value ;
610610 }
611611 }
@@ -629,9 +629,9 @@ public function getChanges()
629629 foreach ($ this ->currentData as $ key => $ value ) {
630630 if (!array_key_exists ($ key , $ this ->originalData ) && !empty ($ value )) {
631631 $ changes ['add ' ][$ key ] = $ value ;
632- } else if (count ($ this ->originalData [$ key ]) === 0 && !empty ($ value )) {
632+ } elseif (count ($ this ->originalData [$ key ]) === 0 && !empty ($ value )) {
633633 $ changes ['add ' ][$ key ] = $ value ;
634- } else if ($ this ->originalData [$ key ] !== $ this ->currentData [$ key ]) {
634+ } elseif ($ this ->originalData [$ key ] !== $ this ->currentData [$ key ]) {
635635 if (empty ($ value )) {
636636 $ changes ['delete ' ][$ key ] = $ value ;
637637 } else {
@@ -812,10 +812,9 @@ protected function assertChangeableAttribute($name)
812812 $ rdn = $ this ->getRdnArray (Dn::ATTR_CASEFOLD_LOWER );
813813 if ($ name == 'dn ' ) {
814814 throw new Exception \LdapException (null , 'DN cannot be changed. ' );
815- }
816- else if (array_key_exists ($ name , $ rdn )) {
815+ } elseif (array_key_exists ($ name , $ rdn )) {
817816 throw new Exception \LdapException (null , 'Cannot change attribute because it \'s part of the RDN ' );
818- } else if (in_array ($ name , self ::$ systemAttributes )) {
817+ } elseif (in_array ($ name , self ::$ systemAttributes )) {
819818 throw new Exception \LdapException (null , 'Cannot change attribute because it \'s read-only ' );
820819 } else {
821820 return true ;
0 commit comments