Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/2808' into develop
Browse files Browse the repository at this point in the history
Forward port #2808
  • Loading branch information
weierophinney committed Oct 30, 2012
2 parents 7cb4526 + 8bef45a commit 4467123
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions library/Zend/Serializer/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static function factory($adapterName, $adapterOptions = null)
return $adapterName; // $adapterName is already an adapter object
}

return self::getAdapterPluginManager()->get($adapterName, $adapterOptions);
return static::getAdapterPluginManager()->get($adapterName, $adapterOptions);
}

/**
Expand All @@ -56,7 +56,7 @@ public static function factory($adapterName, $adapterOptions = null)
*/
public static function setAdapterPluginManager(AdapterPluginManager $adapters)
{
self::$adapters = $adapters;
static::$adapters = $adapters;
}

/**
Expand All @@ -66,10 +66,10 @@ public static function setAdapterPluginManager(AdapterPluginManager $adapters)
*/
public static function getAdapterPluginManager()
{
if (self::$adapters === null) {
self::$adapters = new AdapterPluginManager();
if (static::$adapters === null) {
static::$adapters = new AdapterPluginManager();
}
return self::$adapters;
return static::$adapters;
}

/**
Expand All @@ -79,8 +79,8 @@ public static function getAdapterPluginManager()
*/
public static function resetAdapterPluginManager()
{
self::$adapters = new AdapterPluginManager();
return self::$adapters;
static::$adapters = new AdapterPluginManager();
return static::$adapters;
}

/**
Expand All @@ -91,7 +91,7 @@ public static function resetAdapterPluginManager()
*/
public static function setDefaultAdapter($adapter, $adapterOptions = null)
{
self::$defaultAdapter = self::factory($adapter, $adapterOptions);
static::$defaultAdapter = static::factory($adapter, $adapterOptions);
}

/**
Expand All @@ -101,10 +101,10 @@ public static function setDefaultAdapter($adapter, $adapterOptions = null)
*/
public static function getDefaultAdapter()
{
if (!self::$defaultAdapter instanceof Adapter) {
self::setDefaultAdapter(self::$defaultAdapter);
if (!static::$defaultAdapter instanceof Adapter) {
static::setDefaultAdapter(static::$defaultAdapter);
}
return self::$defaultAdapter;
return static::$defaultAdapter;
}

/**
Expand All @@ -120,9 +120,9 @@ public static function getDefaultAdapter()
public static function serialize($value, $adapter = null, $adapterOptions = null)
{
if ($adapter !== null) {
$adapter = self::factory($adapter, $adapterOptions);
$adapter = static::factory($adapter, $adapterOptions);
} else {
$adapter = self::getDefaultAdapter();
$adapter = static::getDefaultAdapter();
}

return $adapter->serialize($value);
Expand All @@ -141,9 +141,9 @@ public static function serialize($value, $adapter = null, $adapterOptions = null
public static function unserialize($serialized, $adapter = null, $adapterOptions = null)
{
if ($adapter !== null) {
$adapter = self::factory($adapter, $adapterOptions);
$adapter = static::factory($adapter, $adapterOptions);
} else {
$adapter = self::getDefaultAdapter();
$adapter = static::getDefaultAdapter();
}

return $adapter->unserialize($serialized);
Expand Down

0 comments on commit 4467123

Please sign in to comment.