Просмотр исходного кода

Remove magic handling for undefined members

Andreas Braun 10 лет назад
Родитель
Сommit
29f9414aa0
3 измененных файлов с 2 добавлено и 12 удалено
  1. 0 2
      lib/Mongo/MongoCollection.php
  2. 0 2
      lib/Mongo/MongoDB.php
  3. 2 8
      lib/Mongo/MongoId.php

+ 0 - 2
lib/Mongo/MongoCollection.php

@@ -108,8 +108,6 @@ class MongoCollection
         if ($name === 'w' || $name === 'wtimeout') {
             $this->setWriteConcernFromArray([$name => $value] + $this->getWriteConcern());
             $this->createCollectionObject();
-        } else {
-            $this->$name = $value;
         }
     }
 

+ 0 - 2
lib/Mongo/MongoDB.php

@@ -100,8 +100,6 @@ class MongoDB
         if ($name === 'w' || $name === 'wtimeout') {
             $this->setWriteConcernFromArray([$name => $value] + $this->getWriteConcern());
             $this->createDatabaseObject();
-        } else {
-            $this->$name = $value;
         }
     }
 

+ 2 - 8
lib/Mongo/MongoId.php

@@ -23,8 +23,6 @@ class MongoId implements Serializable, TypeInterface
      */
     private $objectID;
 
-    private $attributes = [];
-
     /**
      * Creates a new id
      *
@@ -88,7 +86,7 @@ class MongoId implements Serializable, TypeInterface
             return (string) $this->objectID;
         }
 
-        return $this->attributes[$name];
+        return null;
     }
 
     /**
@@ -101,8 +99,6 @@ class MongoId implements Serializable, TypeInterface
             trigger_error("The '\$id' property is read-only", E_DEPRECATED);
             return;
         }
-
-        $this->attributes[$name] = $value;
     }
 
     /**
@@ -111,7 +107,7 @@ class MongoId implements Serializable, TypeInterface
      */
     public function __isset($name)
     {
-        return $name === 'id' || array_key_exists($name, $this->attributes);
+        return $name === 'id';
     }
 
     /**
@@ -123,8 +119,6 @@ class MongoId implements Serializable, TypeInterface
             trigger_error("The '\$id' property is read-only", E_DEPRECATED);
             return;
         }
-
-        unset($this->attributes[$name]);
     }
 
     /**