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

Commit

Permalink
Browse files Browse the repository at this point in the history
Use static keyword instead of self for using LSB
  • 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
Expand Up @@ -70,7 +70,7 @@ public static function fromReflection(ReflectionDocBlockTag $reflectionTag)
{ {
$tagName = $reflectionTag->getName(); $tagName = $reflectionTag->getName();


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


// transport any properties via accessors and mutators from reflection to codegen object // 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
Expand Up @@ -48,7 +48,7 @@ public function __construct(array $options = array())
*/ */
public static function fromReflection(ReflectionDocBlockTag $reflectionTagLicense) public static function fromReflection(ReflectionDocBlockTag $reflectionTagLicense)
{ {
$returnTag = new self(); $returnTag = new static();


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


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


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


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


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


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


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


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


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


if (null === $name) { if (null === $name) {
Expand Down Expand Up @@ -354,14 +354,14 @@ public function merge(self $merge)
$this->data[$key]->merge($value); $this->data[$key]->merge($value);
} else { } else {
if ($value instanceof self) { if ($value instanceof self) {
$this->data[$key] = new self($value->toArray(), $this->allowModifications); $this->data[$key] = new static($value->toArray(), $this->allowModifications);
} else { } else {
$this->data[$key] = $value; $this->data[$key] = $value;
} }
} }
} else { } else {
if ($value instanceof self) { if ($value instanceof self) {
$this->data[$key] = new self($value->toArray(), $this->allowModifications); $this->data[$key] = new static($value->toArray(), $this->allowModifications);
} else { } else {
$this->data[$key] = $value; $this->data[$key] = $value;
} }
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Crypt/BlockCipher.php
Expand Up @@ -96,7 +96,7 @@ public static function factory($adapter, $options = array())
{ {
$plugins = static::getSymmetricPluginManager(); $plugins = static::getSymmetricPluginManager();
$adapter = $plugins->get($adapter, (array) $options); $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
Expand Up @@ -57,7 +57,7 @@ public function addLinks(DOMNodeList $links, $uri)
} elseif (!isset($this->rdf) && $link->getAttribute('type') == 'application/rdf+xml') { } elseif (!isset($this->rdf) && $link->getAttribute('type') == 'application/rdf+xml') {
$this->rdf = $this->absolutiseUri(trim($link->getAttribute('href')), $uri); $this->rdf = $this->absolutiseUri(trim($link->getAttribute('href')), $uri);
} }
$this[] = new self(array( $this[] = new static(array(
'rel' => 'alternate', 'rel' => 'alternate',
'type' => $link->getAttribute('type'), 'type' => $link->getAttribute('type'),
'href' => $this->absolutiseUri(trim($link->getAttribute('href')), $uri), 'href' => $this->absolutiseUri(trim($link->getAttribute('href')), $uri),
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Http/Client/Cookies.php
Expand Up @@ -340,7 +340,7 @@ protected function _matchPath($domains, $path)
*/ */
public static function fromResponse(Response $response, $ref_uri) public static function fromResponse(Response $response, $ref_uri)
{ {
$jar = new self(); $jar = new static();
$jar->addCookiesFromResponse($response, $ref_uri); $jar->addCookiesFromResponse($response, $ref_uri);
return $jar; return $jar;
} }
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Http/Cookies.php
Expand Up @@ -317,7 +317,7 @@ protected function _matchPath($domains, $path)
*/ */
public static function fromResponse(Response $response, $ref_uri) public static function fromResponse(Response $response, $ref_uri)
{ {
$jar = new self(); $jar = new static();
$jar->addCookiesFromResponse($response, $ref_uri); $jar->addCookiesFromResponse($response, $ref_uri);
return $jar; return $jar;
} }
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/I18n/Translator/Plural/Rule.php
Expand Up @@ -205,7 +205,7 @@ public static function fromString($string)
$tree = static::$parser->parse($match['plural']); $tree = static::$parser->parse($match['plural']);
$ast = static::createAst($tree); $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
Expand Up @@ -137,7 +137,7 @@ protected function __construct($source, $decodeType)
*/ */
public static function decode($source, $objectDecodeType = Json::TYPE_OBJECT) public static function decode($source, $objectDecodeType = Json::TYPE_OBJECT)
{ {
$decoder = new self($source, $objectDecodeType); $decoder = new static($source, $objectDecodeType);
return $decoder->_decodeValue(); return $decoder->_decodeValue();
} }


Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Json/Encoder.php
Expand Up @@ -68,7 +68,7 @@ protected function __construct($cycleCheck = false, $options = array())
*/ */
public static function encode($value, $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); return $encoder->_encodeValue($value);
} }
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Ldap/Dn.php
Expand Up @@ -77,7 +77,7 @@ public static function fromString($dn, $caseFold = null)
} else { } else {
$dnArray = static::explodeDn((string) $dn); $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) 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'); throw new Exception\LdapException(null, 'Cannot retrieve parent DN with given $levelUp');
} }
$newDn = array_slice($this->dn, $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
Expand Up @@ -36,7 +36,7 @@ class Filter extends Filter\StringFilter
*/ */
public static function equals($attr, $value) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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
Expand Up @@ -55,7 +55,7 @@ protected function __construct(array $options = array())
*/ */
public static function decode($string) public static function decode($string)
{ {
$encoder = new self(array()); $encoder = new static(array());
return $encoder->_decode($string); 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()) public static function encode($value, array $options = array())
{ {
$encoder = new self($options); $encoder = new static($options);


return $encoder->_encode($value); return $encoder->_encode($value);
} }
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Ldap/Node.php
Expand Up @@ -245,7 +245,7 @@ public static function create($dn, array $objectClass = array())
} else { } else {
throw new Exception\LdapException(null, '$dn is of a wrong data type.'); 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->ensureRdnAttributeValues();
$new->setAttribute('objectClass', $objectClass); $new->setAttribute('objectClass', $objectClass);


Expand Down Expand Up @@ -273,7 +273,7 @@ public static function fromLdap($dn, Ldap $ldap)
if ($data === null) { if ($data === null) {
return null; return null;
} }
$entry = new self($dn, $data, true, $ldap); $entry = new static($dn, $data, true, $ldap);


return $entry; 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.'); throw new Exception\LdapException(null, '\'dn\' key is of a wrong data type.');
} }
$fromDataSource = ($fromDataSource === true) ? true : false; $fromDataSource = ($fromDataSource === true) ? true : false;
$new = new self($dn, $data, $fromDataSource, null); $new = new static($dn, $data, $fromDataSource, null);
$new->ensureRdnAttributeValues(); $new->ensureRdnAttributeValues();


return $new; return $new;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Ldap/Node/RootDse.php
Expand Up @@ -45,7 +45,7 @@ public static function create(Ldap\Ldap $ldap)
) { ) {
return new RootDse\OpenLdap($dn, $data); return new RootDse\OpenLdap($dn, $data);
} else { } 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
Expand Up @@ -43,7 +43,7 @@ public static function create(Ldap\Ldap $ldap)
return new Schema\OpenLdap($dn, $data, $ldap); return new Schema\OpenLdap($dn, $data, $ldap);
case RootDse::SERVER_TYPE_EDIRECTORY: case RootDse::SERVER_TYPE_EDIRECTORY:
default: 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
Expand Up @@ -198,7 +198,7 @@ protected function _cacheContent()
} }
$counter = 1; $counter = 1;
foreach ($parts as $part) { 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
Expand Up @@ -155,7 +155,7 @@ public function getPart($num)
throw new Exception\RuntimeException('part not found'); 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])); 'endPos' => $this->partPos[$num][1]));
} }
} }
2 changes: 1 addition & 1 deletion library/Zend/Mime/Message.php
Expand Up @@ -225,7 +225,7 @@ public static function createFromMessage($message, $boundary, $EOL = Mime::LINEE
{ {
$parts = Decode::splitMessageStruct($message, $boundary, $EOL); $parts = Decode::splitMessageStruct($message, $boundary, $EOL);


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


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


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

0 comments on commit 364a714

Please sign in to comment.