Skip to content

Commit

Permalink
Merge pull request zendframework#3826 branch 'hotfix/cs'
Browse files Browse the repository at this point in the history
  • Loading branch information
Maks3w committed Feb 22, 2013
2 parents b0c7026 + 8d93c58 commit 346a834
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 40 deletions.
2 changes: 1 addition & 1 deletion library/Zend/Config/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static function toFile($filename, $config)
);
}

if(!isset(self::$writerExtensions[$extension])) {
if (!isset(self::$writerExtensions[$extension])) {
throw new Exception\RuntimeException(
"Unsupported config file extension: '.{$extension}' for writing."
);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Config/Reader/Ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected function process(array $data)
*/
private function buildNestedSection($sections, $value)
{
if(count($sections) == 0) {
if (count($sections) == 0) {
return $this->processSection($value);
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Db/Sql/AbstractSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function processExpression(ExpressionInterface $expression, PlatformIn
// initialize variables
$parts = $expression->getExpressionData();

if(!isset($this->instanceParameterIndex[$namedParameterPrefix])) {
if (!isset($this->instanceParameterIndex[$namedParameterPrefix])) {
$this->instanceParameterIndex[$namedParameterPrefix] = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Form/Fieldset.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public function bindValues(array $values = array())

$element = $this->byName[$name];

if($element instanceof FieldsetInterface && $element->allowValueBinding()) {
if ($element instanceof FieldsetInterface && $element->allowValueBinding()) {
$value = $element->bindValues($value);
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Form/View/Helper/FormRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function __invoke(ElementInterface $element = null, $labelPosition = null
$this->setLabelPosition($labelPosition);
}

if($renderErrors !== null){
if ($renderErrors !== null){
$this->setRenderErrors($renderErrors);
}

Expand Down
13 changes: 6 additions & 7 deletions library/Zend/Log/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ public function __construct(array $options = null)
}

if (is_array($options)) {
if (isset($options['writers']) && is_array($options['writers'])) {
foreach ($options['writers'] as $writer) {

if(isset($options['writers']) && is_array($options['writers'])) {
foreach($options['writers'] as $writer) {

if(!isset($writer['name'])) {
if (!isset($writer['name'])) {
throw new Exception\InvalidArgumentException('Options must contain a name for the writer');
}

Expand All @@ -147,11 +146,11 @@ public function __construct(array $options = null)
}
}

if(isset($options['exceptionhandler']) && $options['exceptionhandler'] === true) {
if (isset($options['exceptionhandler']) && $options['exceptionhandler'] === true) {
self::registerExceptionHandler($this);
}

if(isset($options['errorhandler']) && $options['errorhandler'] === true) {
if (isset($options['errorhandler']) && $options['errorhandler'] === true) {
self::registerErrorHandler($this);
}

Expand Down Expand Up @@ -410,7 +409,7 @@ public function log($priority, $message, $extra = array())
'extra' => $extra
);

foreach($this->processors->toArray() as $processor) {
foreach ($this->processors->toArray() as $processor) {
$event = $processor->process($event);
}

Expand Down
23 changes: 11 additions & 12 deletions library/Zend/Log/Writer/AbstractWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,16 @@ public function __construct($options = null)
}

if (is_array($options)) {

if(isset($options['filters'])) {
if (isset($options['filters'])) {
$filters = $options['filters'];
if(is_string($filters) || $filters instanceof Filter\FilterInterface) {
if (is_string($filters) || $filters instanceof Filter\FilterInterface) {
$this->addFilter($filters);
} elseif(is_array($filters)) {
foreach($filters as $filter) {
if(is_string($filter) || $filter instanceof Filter\FilterInterface) {
} elseif (is_array($filters)) {
foreach ($filters as $filter) {
if (is_string($filter) || $filter instanceof Filter\FilterInterface) {
$this->addFilter($filter);
} elseif(is_array($filter)) {
if(!isset($filter['name'])) {
} elseif (is_array($filter)) {
if (!isset($filter['name'])) {
throw new Exception\InvalidArgumentException('Options must contain a name for the filter');
}
$filterOptions = (isset($filter['options'])) ? $filter['options'] : null;
Expand All @@ -97,12 +96,12 @@ public function __construct($options = null)
}
}

if(isset($options['formatter'])) {
if (isset($options['formatter'])) {
$formatter = $options['formatter'];
if(is_string($formatter) || $formatter instanceof Formatter\FormatterInterface) {
if (is_string($formatter) || $formatter instanceof Formatter\FormatterInterface) {
$this->setFormatter($formatter);
} elseif(is_array($formatter)) {
if(!isset($formatter['name'])) {
} else if(is_array($formatter)) {
if (!isset($formatter['name'])) {
throw new Exception\InvalidArgumentException('Options must contain a name for the formatter');
}
$formatterOptions = (isset($formatter['options'])) ? $formatter['options'] : null;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Log/Writer/ChromePhp.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct($instance = null)
$instance = isset($instance['instance']) ? $instance['instance'] : null;
}

if(!($instance instanceof ChromePhpInterface || $instance === null)) {
if (!($instance instanceof ChromePhpInterface || $instance === null)) {
throw new Exception\InvalidArgumentException('You must pass a valid Zend\Log\Writer\ChromePhp\ChromePhpInterface');
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Log/Writer/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function __construct($mail, Transport\TransportInterface $transport = nul
}
$this->setTransport($transport);

if($this->formatter === null) {
if ($this->formatter === null) {
$this->formatter = new SimpleFormatter();
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Log/Writer/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function __construct($streamOrUrl, $mode = null, $logSeparator = null)
$this->setLogSeparator($logSeparator);
}

if($this->formatter === null) {
if ($this->formatter === null) {
$this->formatter = new SimpleFormatter();
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Log/Writer/Syslog.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function __construct($params = null)
$this->initializeSyslog();
}

if($this->formatter === null) {
if ($this->formatter === null) {
$this->setFormatter(new SimpleFormatter('%message%'));
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Permissions/Acl/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ protected function getChildResources(Resource\ResourceInterface $resource)
$id = $resource->getResourceId();

$children = $this->resources[$id]['children'];
foreach($children as $child) {
foreach ($children as $child) {
$child_return = $this->getChildResources($child);
$child_return[$child->getResourceId()] = $child;

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/ServiceManager/ServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function get($name, $usePeeringServiceManagers = true)
if ($usePeeringServiceManagers && $retrieveFromPeeringManagerFirst) {
$instance = $this->retrieveFromPeeringManager($name);

if(null !== $instance) {
if (null !== $instance) {
return $instance;
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Soap/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ public function getLastSoapOutputHeaderObjects()
*/
public function __call($name, $arguments)
{
if(!is_array($arguments)) {
if (!is_array($arguments)) {
$arguments = array($arguments);
}
$soapClient = $this->getSoapClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SerializableStrategy implements StrategyInterface
public function __construct($serializer, $serializerOptions = null)
{
$this->setSerializer($serializer);
if($serializerOptions) {
if ($serializerOptions) {
$this->setSerializerOptions($serializerOptions);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function getApplication()
$this->application = Application::init($appConfig);

$events = $this->application->getEventManager();
foreach($events->getListeners(MvcEvent::EVENT_FINISH) as $listener) {
foreach ($events->getListeners(MvcEvent::EVENT_FINISH) as $listener) {
$callback = $listener->getCallback();
if (is_array($callback) && $callback[0] instanceof SendResponseListener) {
$events->detach($listener);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Version/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static function getLatest($service = self::VERSION_SERVICE_GITHUB)
static::$latestVersion = array_reduce($tags, function ($a, $b) {
return version_compare($a, $b, '>') ? $a : $b;
});
} elseif($service == self::VERSION_SERVICE_ZEND) {
} elseif ($service == self::VERSION_SERVICE_ZEND) {
$handle = fopen('http://framework.zend.com/api/zf-version?v=2', 'r');
if (false !== $handle) {
static::$latestVersion = stream_get_contents($handle);
Expand Down
2 changes: 1 addition & 1 deletion tests/ZendTest/Config/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function getTestAssetFileName($ext)

public function tearDown()
{
foreach($this->tmpFiles as $file) {
foreach ($this->tmpFiles as $file) {
if (file_exists($file)) {
if (!is_writable($file)) {
chmod($file, 0777);
Expand Down
2 changes: 1 addition & 1 deletion tests/ZendTest/Stdlib/HydratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public function testHydratorClassMethodsWithCustomFilter()
function($property) {
list($class, $method) = explode('::', $property);

if($method == 'getHasFoo') {
if ($method == 'getHasFoo') {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/ZendTest/Stdlib/TestAsset/FilterCompositeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ public function testConstructorInjection()
{
$andCondition = array(
'servicelocator' => function($property) {
if($property === 'getServiceLocator') {
if ($property === 'getServiceLocator') {
return false;
}
return true;
},
'foobar' => function($property) {
if($property === 'getFooBar') {
if ($property === 'getFooBar') {
return false;
}
return true;
Expand Down
4 changes: 2 additions & 2 deletions tests/ZendTest/Test/_files/Baz/view/baz/index/unittests.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<div class="top"></div>
<div class="top"></div>

<?php for($i = 0; $i < $num_get; $i++): ?>
<?php for ($i = 0; $i < $num_get; $i++): ?>
<div class="get"></div>
<?php endfor; ?>

<?php for($i = 0; $i < $num_post; $i++): ?>
<?php for ($i = 0; $i < $num_post; $i++): ?>
<div class="post"></div>
<?php endfor; ?>

0 comments on commit 346a834

Please sign in to comment.