Skip to content

Commit

Permalink
Use static keyword instead of self for using LSB
Browse files Browse the repository at this point in the history
  • Loading branch information
lisachenko committed Jan 4, 2013
1 parent 9a962dc commit 364a714
Show file tree
Hide file tree
Showing 28 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion library/Zend/Code/Generator/DocBlock/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function fromReflection(ReflectionDocBlockTag $reflectionTag)
{
$tagName = $reflectionTag->getName();

$codeGenDocBlockTag = new self();
$codeGenDocBlockTag = new static();
$codeGenDocBlockTag->setName($tagName);

// transport any properties via accessors and mutators from reflection to codegen object
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(array $options = array())
*/
public static function fromReflection(ReflectionDocBlockTag $reflectionTagLicense)
{
$returnTag = new self();
$returnTag = new static();

$returnTag->setName('license');
$returnTag->setUrl($reflectionTagLicense->getUrl());
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ParamTag extends Tag
*/
public static function fromReflection(ReflectionDocBlockTag $reflectionTagParam)
{
$paramTag = new self();
$paramTag = new static();

$paramTag->setName('param');
$paramTag->setDatatype($reflectionTagParam->getType()); // @todo rename
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ReturnTag extends Tag
*/
public static function fromReflection(ReflectionDocBlockTag $reflectionTagReturn)
{
$returnTag = new self();
$returnTag = new static();

$returnTag->setName('return');
$returnTag->setDatatype($reflectionTagReturn->getType()); // @todo rename
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Code/Generator/FileGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static function fromReflectedFileName($filePath, $includeIfNotAlreadyIncl
*/
public static function fromReflection(FileReflection $fileReflection)
{
$file = new self();
$file = new static();

$file->setSourceContent($fileReflection->getContents());
$file->setSourceDirty(false);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Code/Generator/MethodGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MethodGenerator extends AbstractMemberGenerator
*/
public static function fromReflection(MethodReflection $reflectionMethod)
{
$method = new self();
$method = new static();

$method->setSourceContent($reflectionMethod->getContents(false));
$method->setSourceDirty(false);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Code/Generator/PropertyGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PropertyGenerator extends AbstractMemberGenerator
*/
public static function fromReflection(PropertyReflection $reflectionProperty)
{
$property = new self();
$property = new static();

$property->setName($reflectionProperty->getName());

Expand Down
8 changes: 4 additions & 4 deletions library/Zend/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct(array $array, $allowModifications = false)

foreach ($array as $key => $value) {
if (is_array($value)) {
$this->data[$key] = new self($value, $this->allowModifications);
$this->data[$key] = new static($value, $this->allowModifications);
} else {
$this->data[$key] = $value;
}
Expand Down Expand Up @@ -123,7 +123,7 @@ public function __set($name, $value)
if ($this->allowModifications) {

if (is_array($value)) {
$value = new self($value, true);
$value = new static($value, true);
}

if (null === $name) {
Expand Down Expand Up @@ -354,14 +354,14 @@ public function merge(self $merge)
$this->data[$key]->merge($value);
} else {
if ($value instanceof self) {
$this->data[$key] = new self($value->toArray(), $this->allowModifications);
$this->data[$key] = new static($value->toArray(), $this->allowModifications);
} else {
$this->data[$key] = $value;
}
}
} else {
if ($value instanceof self) {
$this->data[$key] = new self($value->toArray(), $this->allowModifications);
$this->data[$key] = new static($value->toArray(), $this->allowModifications);
} else {
$this->data[$key] = $value;
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Crypt/BlockCipher.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static function factory($adapter, $options = array())
{
$plugins = static::getSymmetricPluginManager();
$adapter = $plugins->get($adapter, (array) $options);
return new self($adapter);
return new static($adapter);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Feed/Reader/FeedSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function addLinks(DOMNodeList $links, $uri)
} elseif (!isset($this->rdf) && $link->getAttribute('type') == 'application/rdf+xml') {
$this->rdf = $this->absolutiseUri(trim($link->getAttribute('href')), $uri);
}
$this[] = new self(array(
$this[] = new static(array(
'rel' => 'alternate',
'type' => $link->getAttribute('type'),
'href' => $this->absolutiseUri(trim($link->getAttribute('href')), $uri),
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Http/Client/Cookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ protected function _matchPath($domains, $path)
*/
public static function fromResponse(Response $response, $ref_uri)
{
$jar = new self();
$jar = new static();
$jar->addCookiesFromResponse($response, $ref_uri);
return $jar;
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Http/Cookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ protected function _matchPath($domains, $path)
*/
public static function fromResponse(Response $response, $ref_uri)
{
$jar = new self();
$jar = new static();
$jar->addCookiesFromResponse($response, $ref_uri);
return $jar;
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/I18n/Translator/Plural/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static function fromString($string)
$tree = static::$parser->parse($match['plural']);
$ast = static::createAst($tree);

return new self($numPlurals, $ast);
return new static($numPlurals, $ast);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Json/Decoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected function __construct($source, $decodeType)
*/
public static function decode($source, $objectDecodeType = Json::TYPE_OBJECT)
{
$decoder = new self($source, $objectDecodeType);
$decoder = new static($source, $objectDecodeType);
return $decoder->_decodeValue();
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Json/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected function __construct($cycleCheck = false, $options = array())
*/
public static function encode($value, $cycleCheck = false, $options = array())
{
$encoder = new self(($cycleCheck) ? true : false, $options);
$encoder = new static(($cycleCheck) ? true : false, $options);

return $encoder->_encodeValue($value);
}
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Ldap/Dn.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down
20 changes: 10 additions & 10 deletions library/Zend/Ldap/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand All @@ -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, '*');
}

/**
Expand All @@ -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);
}

/**
Expand All @@ -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, '*', '*');
}

/**
Expand All @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Ldap/Ldif/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Ldap/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Ldap/Node/RootDse.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static function create(Ldap\Ldap $ldap)
) {
return new RootDse\OpenLdap($dn, $data);
} else {
return new self($dn, $data);
return new static($dn, $data);
}
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Ldap/Node/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mail/Storage/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ protected function _cacheContent()
}
$counter = 1;
foreach ($parts as $part) {
$this->parts[$counter++] = new self(array('headers' => $part['header'], 'content' => $part['body']));
$this->parts[$counter++] = new static(array('headers' => $part['header'], 'content' => $part['body']));
}
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mail/Storage/Part/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function getPart($num)
throw new Exception\RuntimeException('part not found');
}

return new self(array('file' => $this->fh, 'startPos' => $this->partPos[$num][0],
return new static(array('file' => $this->fh, 'startPos' => $this->partPos[$num][0],
'endPos' => $this->partPos[$num][1]));
}
}
2 changes: 1 addition & 1 deletion library/Zend/Mime/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public static function createFromMessage($message, $boundary, $EOL = Mime::LINEE
{
$parts = Decode::splitMessageStruct($message, $boundary, $EOL);

$res = new self();
$res = new static();
foreach ($parts as $part) {
// now we build a new MimePart for the current Message Part:
$newPart = new Part($part['body']);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Server/Reflection/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function setParent(Node $node, $new = false)
*/
public function createChild($value)
{
$child = new self($value, $this);
$child = new static($value, $this);

return $child;
}
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Uri/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function setFragment($fragment)
*/
public static function fromUnixPath($path)
{
$url = new self('file:');
$url = new static('file:');
if (substr($path, 0, 1) == '/') {
$url->setHost('');
}
Expand All @@ -89,7 +89,7 @@ public static function fromUnixPath($path)
*/
public static function fromWindowsPath($path)
{
$url = new self('file:');
$url = new static('file:');

// Convert directory separators
$path = str_replace(array('/', '\\'), array('%2F', '/'), $path);
Expand Down
Loading

0 comments on commit 364a714

Please sign in to comment.