Skip to content

Commit

Permalink
PSR-2, spaces after control structures
Browse files Browse the repository at this point in the history
  • Loading branch information
RWOverdijk committed Aug 10, 2012
1 parent 22808d1 commit bb51ce0
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion library/Zend/Cache/Pattern/PatternOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ protected function storageFactory($storage)
$storage = StorageFactory::factory($storage);
} elseif (is_string($storage)) {
$storage = StorageFactory::adapterFactory($storage);
} elseif ( !($storage instanceof Storage) ) {
} elseif (($storage instanceof Storage) !== true) {
throw new Exception\InvalidArgumentException(
'The storage must be an instanceof Zend\Cache\Storage\StorageInterface '
. 'or an array passed to Zend\Cache\Storage::factory '
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cache/Storage/Plugin/ClearExpiredByFactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function detach(EventManagerInterface $events)
public function clearExpiredByFactor(PostEvent $event)
{
$storage = $event->getStorage();
if ( !($storage instanceof ClearExpiredInterface) ) {
if (($storage instanceof ClearExpiredInterface) !== true) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cache/Storage/Plugin/OptimizeByFactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function detach(EventManagerInterface $events)
public function optimizeByFactor(PostEvent $event)
{
$storage = $event->getStorage();
if ( !($storage instanceof OptimizableInterface) ) {
if (($storage instanceof OptimizableInterface) !== true) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Json/Decoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public static function decodeUnicodeString($chrs)
$utf8 = '';
$strlen_chrs = strlen($chrs);

for($i = 0; $i < $strlen_chrs; $i++) {
for ($i = 0; $i < $strlen_chrs; $i++) {

$substr_chrs_c_2 = substr($chrs, $i, 2);
$ord_chrs_c = ord($chrs[$i]);
Expand Down Expand Up @@ -531,7 +531,7 @@ public static function decodeUnicodeString($chrs)
protected static function _utf162utf8($utf16)
{
// Check for mb extension otherwise do by hand.
if( function_exists('mb_convert_encoding') ) {
if (function_exists('mb_convert_encoding')) {
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
}

Expand Down
8 changes: 4 additions & 4 deletions library/Zend/Json/Server/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ protected function _handle()
}

//Make sure named parameters are passed in correct order
if ( is_string( key( $params ) ) ) {
if (is_string( key( $params ) )) {

$callback = $invocable->getCallback();
if ('function' == $callback->getType()) {
Expand All @@ -522,10 +522,10 @@ protected function _handle()
}

$orderedParams = array();
foreach( $reflection->getParameters() as $refParam ) {
if( isset( $params[ $refParam->getName() ] ) ) {
foreach($reflection->getParameters() as $refParam) {
if(isset( $params[ $refParam->getName() ] )) {
$orderedParams[ $refParam->getName() ] = $params[ $refParam->getName() ];
} elseif( $refParam->isOptional() ) {
} elseif($refParam->isOptional()) {
$orderedParams[ $refParam->getName() ] = null;
} else {
return $this->fault('Invalid params', Error::ERROR_INVALID_PARAMS);
Expand Down
8 changes: 4 additions & 4 deletions library/Zend/Memory/Container/Movable.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(Memory\MemoryManager $memoryManager, $id, $value)
*/
public function lock()
{
if ( !($this->state & self::LOADED) ) {
if (($this->state & self::LOADED) !== true) {
$this->memManager->load($this, $this->id);
$this->state |= self::LOADED;
}
Expand Down Expand Up @@ -125,7 +125,7 @@ public function __get($property)
throw new Exception\InvalidArgumentException('Unknown property: \Zend\Memory\Container\Movable::$' . $property);
}

if ( !($this->state & self::LOADED) ) {
if (($this->state & self::LOADED) !== true) {
$this->memManager->load($this, $this->id);
$this->state |= self::LOADED;
}
Expand Down Expand Up @@ -163,7 +163,7 @@ public function __set($property, $value)
*/
public function &getRef()
{
if ( !($this->state & self::LOADED) ) {
if (($this->state & self::LOADED) !== true) {
$this->memManager->load($this, $this->id);
$this->state |= self::LOADED;
}
Expand Down Expand Up @@ -202,7 +202,7 @@ public function processUpdate()
*/
public function startTrace()
{
if ( !($this->state & self::LOADED) ) {
if (($this->state & self::LOADED) !== true) {
$this->memManager->load($this, $this->id);
$this->state |= self::LOADED;
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Soap/Server/DocumentLiteralWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected function _getResultMessage($method, $ret)

protected function _assertServiceDelegateHasMethod($method)
{
if ( !$this->reflection->hasMethod($method) ) {
if ($this->reflection->hasMethod($method) !== true) {
throw new BadMethodCallException(sprintf(
"Method %s does not exist on delegate object %s",
$method, get_class($this->object)
Expand Down
12 changes: 6 additions & 6 deletions tests/ZendTest/Cache/Storage/Adapter/CommonAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ public function testTouchItemsReturnsGivenKeysIfNonWritable()

public function testOptimize()
{
if ( !($this->_storage instanceof OptimizableInterface) ) {
if (($this->_storage instanceof OptimizableInterface) !== true) {
$this->markTestSkipped("Storage doesn't implement OptimizableInterface");
}

Expand Down Expand Up @@ -897,7 +897,7 @@ public function testIterator()

public function testFlush()
{
if ( !($this->_storage instanceof FlushableInterface) ) {
if (($this->_storage instanceof FlushableInterface) !== true) {
$this->markTestSkipped("Storage doesn't implement OptimizableInterface");
}

Expand All @@ -913,7 +913,7 @@ public function testFlush()

public function testClearByPrefix()
{
if ( !($this->_storage instanceof ClearByPrefixInterface) ) {
if (($this->_storage instanceof ClearByPrefixInterface) !== true) {
$this->markTestSkipped("Storage doesn't implement ClearByPrefixInterface");
}

Expand All @@ -931,7 +931,7 @@ public function testClearByPrefix()

public function testClearByNamespace()
{
if ( !($this->_storage instanceof ClearByNamespaceInterface) ) {
if (($this->_storage instanceof ClearByNamespaceInterface) !== true) {
$this->markTestSkipped("Storage doesn't implement ClearByNamespaceInterface");
}

Expand Down Expand Up @@ -965,7 +965,7 @@ public function testClearByNamespace()

public function testClearExpired()
{
if ( !($this->_storage instanceof ClearExpiredInterface) ) {
if (($this->_storage instanceof ClearExpiredInterface) !== true) {
$this->markTestSkipped("Storage doesn't implement ClearExpiredInterface");
}

Expand Down Expand Up @@ -994,7 +994,7 @@ public function testClearExpired()

public function testTagable()
{
if ( !($this->_storage instanceof TaggableInterface) ) {
if (($this->_storage instanceof TaggableInterface) !== true) {
$this->markTestSkipped("Storage doesn't implement TaggableInterface");
}

Expand Down

0 comments on commit bb51ce0

Please sign in to comment.