Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix cs: add space after casting #3127

Closed
wants to merge 1 commit into from

4 participants

@samsonasik

No description provided.

@Maks3w
Collaborator

Do we have a CS rule for this?

@samsonasik

i've looked from phpmanual http://php.net/manual/en/language.types.type-juggling.php in type casting section

@prolic

why not? +1 for consistency

@weierophinney weierophinney referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port #3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
5cc7edc
@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/3127'
Close #3127
214c41c
@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port #3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
89e824a
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-mail
@weierophinney weierophinney Merge branch 'hotfix/3127' d3605c7
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-mail
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
d2c581d
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-xmlrpc
@weierophinney weierophinney Merge branch 'hotfix/3127' b0e12bf
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-xmlrpc
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
e95ddeb
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-http
@weierophinney weierophinney Merge branch 'hotfix/3127' a842084
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-http
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
5c7d358
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-console
@weierophinney weierophinney Merge branch 'hotfix/3127' c9cb3b1
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-console
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
4e20f70
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-ldap
@weierophinney weierophinney Merge branch 'hotfix/3127' c20864d
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-ldap
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
259e4ac
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-json
@weierophinney weierophinney Merge branch 'hotfix/3127' fb9734f
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-json
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
7b9adef
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-validator
@weierophinney weierophinney Merge branch 'hotfix/3127' dd9e4ea
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-validator
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
7f35af5
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-log
@weierophinney weierophinney Merge branch 'hotfix/3127' fb156fb
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-log
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
d0711aa
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-cache
@weierophinney weierophinney Merge branch 'hotfix/3127' a1e2d7e
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-cache
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
23b5ee7
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-soap
@weierophinney weierophinney Merge branch 'hotfix/3127' 5475adb
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-soap
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
f43fbf1
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-view
@weierophinney weierophinney Merge branch 'hotfix/3127' acb1f50
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-view
@weierophinney weierophinney Merge branch 'hotfix/3127' into develop
Forward port zendframework/zf2#3127

Conflicts:
	library/Zend/Cache/Storage/Adapter/Memcached.php
	library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
cc3e7e3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 2, 2012
  1. @samsonasik
This page is out of date. Refresh to see the latest.
Showing with 40 additions and 40 deletions.
  1. +2 −2 library/Zend/Cache/Storage/Adapter/Memcached.php
  2. +3 −3 library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
  3. +1 −1  library/Zend/Cache/Storage/Adapter/MemoryOptions.php
  4. +4 −4 library/Zend/Cache/Storage/Capabilities.php
  5. +1 −1  library/Zend/Console/Adapter/Windows.php
  6. +1 −1  library/Zend/Console/Response.php
  7. +2 −2 library/Zend/Db/Metadata/Source/SqliteMetadata.php
  8. +1 −1  library/Zend/Form/Fieldset.php
  9. +1 −1  library/Zend/Http/Client/Adapter/Curl.php
  10. +1 −1  library/Zend/Http/Header/Connection.php
  11. +1 −1  library/Zend/Json/Decoder.php
  12. +1 −1  library/Zend/Ldap/Converter/Converter.php
  13. +1 −1  library/Zend/Ldap/Dn.php
  14. +3 −3 library/Zend/Ldap/Ldap.php
  15. +1 −1  library/Zend/Ldap/Ldif/Encoder.php
  16. +1 −1  library/Zend/Log/Formatter/Xml.php
  17. +1 −1  library/Zend/Mail/Protocol/Imap.php
  18. +1 −1  library/Zend/Mail/Protocol/Pop3.php
  19. +4 −4 library/Zend/Soap/Client.php
  20. +1 −1  library/Zend/Validator/Csrf.php
  21. +2 −2 library/Zend/Validator/Db/AbstractDb.php
  22. +2 −2 library/Zend/Validator/InArray.php
  23. +2 −2 library/Zend/View/Model/ViewModel.php
  24. +1 −1  library/Zend/XmlRpc/AbstractValue.php
  25. +1 −1  library/Zend/XmlRpc/Value/Base64.php
View
4 library/Zend/Cache/Storage/Adapter/Memcached.php
@@ -53,7 +53,7 @@ public function __construct($options = null)
{
if (static::$extMemcachedMajorVersion === null) {
$v = (string) phpversion('memcached');
- static::$extMemcachedMajorVersion = ($v !== '') ? (int)$v[0] : 0;
+ static::$extMemcachedMajorVersion = ($v !== '') ? (int) $v[0] : 0;
}
if (static::$extMemcachedMajorVersion < 1) {
@@ -525,7 +525,7 @@ protected function internalIncrementItem(& $normalizedKey, & $value)
protected function internalDecrementItem(& $normalizedKey, & $value)
{
$memc = $this->getMemcachedResource();
- $value = (int)$value;
+ $value = (int) $value;
$newValue = $memc->decrement($normalizedKey, $value);
if ($newValue === false) {
View
6 library/Zend/Cache/Storage/Adapter/MemcachedOptions.php
@@ -164,7 +164,7 @@ public function setServers($servers)
// array(array('host' => <host>[, 'port' => <port>[, 'weight' => <weight>]])[, ...])
if (!isset($server[0]) && isset($server['host'])) {
- $host = (string)$server['host'];
+ $host = (string) $server['host'];
$port = isset($server['port']) ? (int) $server['port'] : $port;
$weight = isset($server['weight']) ? (int) $server['weight'] : $weight;
}
@@ -183,13 +183,13 @@ public function setServers($servers)
}
$host = $server['host'];
- $port = isset($server['port']) ? (int)$server['port'] : $port;
+ $port = isset($server['port']) ? (int) $server['port'] : $port;
if (isset($server['query'])) {
$query = null;
parse_str($server['query'], $query);
if (isset($query['weight'])) {
- $weight = (int)$query['weight'];
+ $weight = (int) $query['weight'];
}
}
}
View
2  library/Zend/Cache/Storage/Adapter/MemoryOptions.php
@@ -93,7 +93,7 @@ protected function normalizeMemoryLimit($value)
throw new Exception\InvalidArgumentException("Invalid memory limit '{$value}'");
}
- $value = (int)$matches[1];
+ $value = (int) $matches[1];
if ($value <= 0) {
return 0;
}
View
8 library/Zend/Cache/Storage/Capabilities.php
@@ -353,7 +353,7 @@ public function getStaticTtl()
*/
public function setStaticTtl(stdClass $marker, $flag)
{
- return $this->setCapability($marker, 'staticTtl', (bool)$flag);
+ return $this->setCapability($marker, 'staticTtl', (bool) $flag);
}
/**
@@ -402,7 +402,7 @@ public function getUseRequestTime()
*/
public function setUseRequestTime(stdClass $marker, $flag)
{
- return $this->setCapability($marker, 'useRequestTime', (bool)$flag);
+ return $this->setCapability($marker, 'useRequestTime', (bool) $flag);
}
/**
@@ -424,7 +424,7 @@ public function getExpiredRead()
*/
public function setExpiredRead(stdClass $marker, $flag)
{
- return $this->setCapability($marker, 'expiredRead', (bool)$flag);
+ return $this->setCapability($marker, 'expiredRead', (bool) $flag);
}
/**
@@ -473,7 +473,7 @@ public function getNamespaceIsPrefix()
*/
public function setNamespaceIsPrefix(stdClass $marker, $flag)
{
- return $this->setCapability($marker, 'namespaceIsPrefix', (bool)$flag);
+ return $this->setCapability($marker, 'namespaceIsPrefix', (bool) $flag);
}
/**
View
2  library/Zend/Console/Adapter/Windows.php
@@ -59,7 +59,7 @@ public function getWidth()
}
if (count($this->probeResult) && (int) $this->probeResult[0]) {
- $width = (int)$this->probeResult[0];
+ $width = (int) $this->probeResult[0];
} else {
$width = parent::getWidth();
}
View
2  library/Zend/Console/Response.php
@@ -61,7 +61,7 @@ public function sendContent()
public function send()
{
$this->sendContent();
- $errorLevel = (int)$this->getMetadata('errorLevel',0);
+ $errorLevel = (int) $this->getMetadata('errorLevel',0);
exit($errorLevel);
}
}
View
4 library/Zend/Db/Metadata/Source/SqliteMetadata.php
@@ -124,7 +124,7 @@ protected function loadConstraintData($table, $schema)
$primaryKey = array();
foreach ($this->data['sqlite_columns'][$schema][$table] as $col) {
- if ((bool)$col['pk']) {
+ if ((bool) $col['pk']) {
$primaryKey[] = $col['name'];
}
}
@@ -135,7 +135,7 @@ protected function loadConstraintData($table, $schema)
$constraints = array();
$indexes = $this->fetchPragma('index_list', $table, $schema);
foreach ($indexes as $index) {
- if (!((bool)$index['unique'])) {
+ if (!((bool) $index['unique'])) {
continue;
}
$constraint = array(
View
2  library/Zend/Form/Fieldset.php
@@ -547,7 +547,7 @@ public function bindValues(array $values = array())
*/
public function setUseAsBaseFieldset($useAsBaseFieldset)
{
- $this->useAsBaseFieldset = (bool)$useAsBaseFieldset;
+ $this->useAsBaseFieldset = (bool) $useAsBaseFieldset;
return $this;
}
View
2  library/Zend/Http/Client/Adapter/Curl.php
@@ -283,7 +283,7 @@ public function write($method, $uri, $httpVersion = 1.1, $headers = array(), $bo
foreach ($headers AS $k => $header) {
if (preg_match('/Content-Length:\s*(\d+)/i', $header, $m)) {
if (is_resource($body)) {
- $this->config['curloptions'][CURLOPT_INFILESIZE] = (int)$m[1];
+ $this->config['curloptions'][CURLOPT_INFILESIZE] = (int) $m[1];
}
unset($headers[$k]);
}
View
2  library/Zend/Http/Header/Connection.php
@@ -60,7 +60,7 @@ public static function fromString($headerLine)
*/
public function setPersistent($flag)
{
- if ((bool)$flag === true) {
+ if ((bool) $flag === true) {
$this->value = self::CONNECTION_KEEP_ALIVE;
} else {
$this->value = self::CONNECTION_CLOSE;
View
2  library/Zend/Json/Decoder.php
@@ -454,7 +454,7 @@ protected function _getNextToken()
*/
public static function decodeUnicodeString($chrs)
{
- $chrs = (string)$chrs;
+ $chrs = (string) $chrs;
$delim = substr($chrs, 0, 1);
$utf8 = '';
$strlen_chrs = strlen($chrs);
View
2  library/Zend/Ldap/Converter/Converter.php
@@ -96,7 +96,7 @@ public static function toLdap($value, $type = self::STANDARD)
if (is_string($value)) {
return $value;
} elseif (is_int($value) || is_float($value)) {
- return (string)$value;
+ return (string) $value;
} elseif (is_bool($value)) {
return static::toldapBoolean($value);
} elseif (is_object($value)) {
View
2  library/Zend/Ldap/Dn.php
@@ -75,7 +75,7 @@ public static function fromString($dn, $caseFold = null)
if (empty($dn)) {
$dnArray = array();
} else {
- $dnArray = static::explodeDn((string)$dn);
+ $dnArray = static::explodeDn((string) $dn);
}
return new self($dnArray, $caseFold);
}
View
6 library/Zend/Ldap/Ldap.php
@@ -952,7 +952,7 @@ protected function createCollection(Collection\DefaultIterator $iterator, $colle
if ($collectionClass === null) {
return new Collection($iterator);
} else {
- $collectionClass = (string)$collectionClass;
+ $collectionClass = (string) $collectionClass;
if (!class_exists($collectionClass)) {
throw new Exception\LdapException(null,
"Class '$collectionClass' can not be found");
@@ -1108,7 +1108,7 @@ public static function prepareLdapEntryArray(array &$entry)
} elseif (!is_scalar($v)) {
throw new Exception\InvalidArgumentException('Only scalar values allowed in LDAP data');
} else {
- $v = (string)$v;
+ $v = (string) $v;
if (strlen($v) == 0) {
unset($value[$i]);
} else {
@@ -1123,7 +1123,7 @@ public static function prepareLdapEntryArray(array &$entry)
} elseif (!is_scalar($value)) {
throw new Exception\InvalidArgumentException('Only scalar values allowed in LDAP data');
} else {
- $value = (string)$value;
+ $value = (string) $value;
if (strlen($value) == 0) {
$entry[$key] = array();
} else {
View
2  library/Zend/Ldap/Ldif/Encoder.php
@@ -172,7 +172,7 @@ protected function _encode($value)
*/
protected function encodeString($string, &$base64 = null)
{
- $string = (string)$string;
+ $string = (string) $string;
if (!is_numeric($string) && empty($string)) {
return '';
}
View
2  library/Zend/Log/Formatter/Xml.php
@@ -190,7 +190,7 @@ public function format($event)
} elseif ($key == "extra" && empty($value)) {
continue;
}
- $elt->appendChild(new DOMElement($key, (string)$value));
+ $elt->appendChild(new DOMElement($key, (string) $value));
}
}
View
2  library/Zend/Mail/Protocol/Imap.php
@@ -533,7 +533,7 @@ public function fetch($items, $from, $to = null)
} elseif ($to === INF) {
$set = (int) $from . ':*';
} else {
- $set = (int) $from . ':' . (int)$to;
+ $set = (int) $from . ':' . (int) $to;
}
$items = (array) $items;
View
2  library/Zend/Mail/Protocol/Pop3.php
@@ -283,7 +283,7 @@ public function getList($msgno = null)
$line = strtok($result, "\n");
while ($line) {
list($no, $size) = explode(' ', trim($line));
- $messages[(int)$no] = (int) $size;
+ $messages[(int) $no] = (int) $size;
$line = strtok("\n");
}
View
8 library/Zend/Soap/Client.php
@@ -622,7 +622,7 @@ public function getProxyHost()
*/
public function setProxyPort($proxyPort)
{
- $this->proxy_port = (int)$proxyPort;
+ $this->proxy_port = (int) $proxyPort;
$this->soapClient = null;
@@ -745,7 +745,7 @@ public function setCompressionOptions($compressionOptions)
if ($compressionOptions === null) {
$this->compression = null;
} else {
- $this->compression = (int)$compressionOptions;
+ $this->compression = (int) $compressionOptions;
}
$this->soapClient = null;
@@ -833,7 +833,7 @@ public function setWSDLCache($caching)
if ($caching === null) {
$this->cache_wsdl = null;
} else {
- $this->cache_wsdl = (int)$caching;
+ $this->cache_wsdl = (int) $caching;
}
return $this;
}
@@ -859,7 +859,7 @@ public function setUserAgent($userAgent)
if ($userAgent === null) {
$this->user_agent = null;
} else {
- $this->user_agent = (string)$userAgent;
+ $this->user_agent = (string) $userAgent;
}
return $this;
}
View
2  library/Zend/Validator/Csrf.php
@@ -248,7 +248,7 @@ public function getSessionName()
*/
public function setTimeout($ttl)
{
- $this->timeout = ($ttl !== null) ? (int)$ttl : null;
+ $this->timeout = ($ttl !== null) ? (int) $ttl : null;
return $this;
}
View
4 library/Zend/Validator/Db/AbstractDb.php
@@ -214,7 +214,7 @@ public function getField()
*/
public function setField($field)
{
- $this->field = (string)$field;
+ $this->field = (string) $field;
return $this;
}
@@ -236,7 +236,7 @@ public function getTable()
*/
public function setTable($table)
{
- $this->table = (string)$table;
+ $this->table = (string) $table;
return $this;
}
View
4 library/Zend/Validator/InArray.php
@@ -199,7 +199,7 @@ public function isValid($value)
if (self::COMPARE_NOT_STRICT_AND_PREVENT_STR_TO_INT_VULNERABILITY == $this->strict
&& is_string($value) && (is_int($el) || is_float($el))
) {
- $el = (string)$el;
+ $el = (string) $el;
}
if ($el == $value) {
@@ -223,7 +223,7 @@ public function isValid($value)
) {
foreach ($haystack as &$h) {
if (is_int($h) || is_float($h)) {
- $h = (string)$h;
+ $h = (string) $h;
}
}
}
View
4 library/Zend/View/Model/ViewModel.php
@@ -169,7 +169,7 @@ public function setOption($name, $value)
*/
public function getOption($name, $default = null)
{
- $name = (string)$name;
+ $name = (string) $name;
return array_key_exists($name, $this->options) ? $this->options[$name] : $default;
}
@@ -219,7 +219,7 @@ public function getOptions()
*/
public function getVariable($name, $default = null)
{
- $name = (string)$name;
+ $name = (string) $name;
if (array_key_exists($name, $this->variables)) {
return $this->variables[$name];
} else {
View
2  library/Zend/XmlRpc/AbstractValue.php
@@ -405,7 +405,7 @@ protected static function _xmlStringToNativeXmlRpc($xml)
continue;
//throw new Value_Exception('Member of the '. self::XMLRPC_TYPE_STRUCT .' XML-RPC native type must contain a VALUE tag');
}
- $values[(string)$member->name] = static::_xmlStringToNativeXmlRpc($member->value);
+ $values[(string) $member->name] = static::_xmlStringToNativeXmlRpc($member->value);
}
$xmlrpcValue = new Value\Struct($values);
break;
View
2  library/Zend/XmlRpc/Value/Base64.php
@@ -29,7 +29,7 @@ public function __construct($value, $alreadyEncoded = false)
{
$this->type = self::XMLRPC_TYPE_BASE64;
- $value = (string)$value; // Make sure this value is string
+ $value = (string) $value; // Make sure this value is string
if (!$alreadyEncoded) {
$value = base64_encode($value); // We encode it in base64
}
Something went wrong with that request. Please try again.