diff --git a/lib/BadFaith/AcceptCharset.php b/lib/BadFaith/AcceptCharset.php index 63c06c0..e5f8634 100644 --- a/lib/BadFaith/AcceptCharset.php +++ b/lib/BadFaith/AcceptCharset.php @@ -48,24 +48,6 @@ function __construct($headerStr = null) $this->init(); } - /** - * @param array $properties the array this method always gets - * @return Accept the object version of that array - */ - static function __set_state(array $properties) - { - parent::__set_state($properties); - $accept = new AcceptCharset(); - foreach ($properties as $key=>$prop) { - if (!property_exists('AcceptLike', $key)) { - if (property_exists($accept, $key)) { - $accept->$key = $prop; - } - } - } - return $accept; - } - /** * Initializes attributes unique to this subclass. */ diff --git a/lib/BadFaith/AcceptEncoding.php b/lib/BadFaith/AcceptEncoding.php index c55f7eb..2a2a751 100644 --- a/lib/BadFaith/AcceptEncoding.php +++ b/lib/BadFaith/AcceptEncoding.php @@ -48,24 +48,6 @@ function __construct($headerStr = NULL) $this->init(); } - /** - * @param array $properties the array this method always gets - * @return Accept the object version of that array - */ - static function __set_state(array $properties) - { - parent::__set_state($properties); - $accept = new AcceptEncoding(); - foreach ($properties as $key=>$prop) { - if (!property_exists('AcceptLike', $key)) { - if (property_exists($accept, $key)) { - $accept->$key = $prop; - } - } - } - return $accept; - } - /** * Initializes attributes unique to this subclass. */ diff --git a/lib/BadFaith/AcceptLanguage.php b/lib/BadFaith/AcceptLanguage.php index 0a0585b..46bc74b 100644 --- a/lib/BadFaith/AcceptLanguage.php +++ b/lib/BadFaith/AcceptLanguage.php @@ -49,24 +49,6 @@ function __construct($headerStr = NULL) $this->init(); } - /** - * @param array $properties the array this method always gets - * @return Accept the object version of that array - */ - static function __set_state(array $properties) - { - parent::__set_state($properties); - $accept = new AcceptLanguage(); - foreach ($properties as $key => $prop) { - if (!property_exists('AcceptLike', $key)) { - if (property_exists($accept, $key)) { - $accept->$key = $prop; - } - } - } - return $accept; - } - /** * Initializes attributes unique to this subclass. */ diff --git a/lib/BadFaith/AcceptLike.php b/lib/BadFaith/AcceptLike.php index 5efe81e..76c58b0 100644 --- a/lib/BadFaith/AcceptLike.php +++ b/lib/BadFaith/AcceptLike.php @@ -53,12 +53,13 @@ function __construct($headerStr = NULL) */ static function __set_state(array $properties) { - $acceptLike = new AcceptLike(); + $acceptLike = new static(); foreach ($properties as $key=>$prop) { if (property_exists($acceptLike, $key)) { $acceptLike->$key = $prop; } } + return $acceptLike; }