Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/zend-acl/library/Zend/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -1080,9 +1080,9 @@ protected function _getRuleType(?Zend_Acl_Resource_Interface $resource = null, ?
return null;
} elseif (self::TYPE_ALLOW === $rule['type']) {
return self::TYPE_DENY;
} else {
return self::TYPE_ALLOW;
}

return self::TYPE_ALLOW;
}

/**
Expand Down
23 changes: 11 additions & 12 deletions packages/zend-cache/library/Zend/Cache/Backend/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,15 +499,14 @@ protected function _getMetadatas($id)
{
if (isset($this->_metadatasArray[$id])) {
return $this->_metadatasArray[$id];
} else {
$metadatas = $this->_loadMetadatas($id);
if (!$metadatas) {
return false;
}
$this->_setMetadatas($id, $metadatas, false);

return $metadatas;
}
$metadatas = $this->_loadMetadatas($id);
if (!$metadatas) {
return false;
}
$this->_setMetadatas($id, $metadatas, false);

return $metadatas;
}

/**
Expand Down Expand Up @@ -628,9 +627,9 @@ protected function _isMetadatasFile($fileName)
$id = $this->_fileNameToId($fileName);
if ('internal-metadatas---' == substr((string) $id, 0, 21)) {
return true;
} else {
return false;
}

return false;
}

/**
Expand Down Expand Up @@ -957,9 +956,9 @@ protected function _path($id, $parts = false)
}
if ($parts) {
return $partsArray;
} else {
return $root;
}

return $root;
}

/**
Expand Down
21 changes: 10 additions & 11 deletions packages/zend-cache/library/Zend/Cache/Backend/Sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@ public function touch($id, $extraLifetime)
$res = $this->_query('UPDATE cache SET lastModified='.time().", expire=$newExpire WHERE id='$id'");
if ($res) {
return true;
} else {
return false;
}

return false;
}

/**
Expand Down Expand Up @@ -492,14 +492,13 @@ private function _getConnection()
{
if (is_resource($this->_db)) {
return $this->_db;
} else {
$this->_db = @sqlite_open($this->_options['cache_db_complete_path']);
if (!is_resource($this->_db)) {
Zend_Cache::throwException('Impossible to open '.$this->_options['cache_db_complete_path'].' cache DB file');
}

return $this->_db;
}
$this->_db = @sqlite_open($this->_options['cache_db_complete_path']);
if (!is_resource($this->_db)) {
Zend_Cache::throwException('Impossible to open '.$this->_options['cache_db_complete_path'].' cache DB file');
}

return $this->_db;
}

/**
Expand All @@ -516,9 +515,9 @@ private function _query($query)
$res = @sqlite_query($db, $query);
if (false === $res) {
return false;
} else {
return $res;
}

return $res;
}

return false;
Expand Down
4 changes: 2 additions & 2 deletions packages/zend-cache/library/Zend/Cache/Backend/TwoLevels.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ public function test($id)
$fastTest = $this->_fastBackend->test($id);
if ($fastTest) {
return $fastTest;
} else {
return $this->_slowBackend->test($id);
}

return $this->_slowBackend->test($id);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public function load($id, $doNotTestCacheValidity = false)
$res = output_cache_get($id, $lifetime);
if ($res) {
return $res[0];
} else {
return false;
}

return false;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/zend-cache/library/Zend/Cache/Frontend/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public function start($id, $doNotTestCacheValidity = false, $echoData = true)
echo $data;

return true;
} else {
return $data;
}

return $data;
}
ob_start();
ob_implicit_flush(false);
Expand Down
5 changes: 2 additions & 3 deletions packages/zend-config/library/Zend/Config/Writer/Ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function render()
} else {
$config = $this->_sortRootElements($this->_config);
foreach ($config as $sectionName => $data) {
if (!($data instanceof Zend_Config)) {
if (!$data instanceof Zend_Config) {
$iniString .= $sectionName
.' = '
.$this->_prepareValue($data)
Expand Down Expand Up @@ -138,9 +138,8 @@ protected function _prepareValue($value)
return $value ? 'true' : 'false';
} elseif (false === strpos((string) $value, '"')) {
return '"'.$value.'"';
} else {
throw new Zend_Config_Exception('Value can not contain double quotes "');
}
throw new Zend_Config_Exception('Value can not contain double quotes "');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/zend-config/library/Zend/Config/Writer/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function render()
$this->_addBranch($this->_config, $child, $xml);
} else {
foreach ($this->_config as $sectionName => $data) {
if (!($data instanceof Zend_Config)) {
if (!$data instanceof Zend_Config) {
$xml->addChild($sectionName, (string) $data);
} else {
$child = $xml->addChild($sectionName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ public function getName()
$helperName = strrchr($fullClassName, '\\');

return ltrim((string) $helperName, '\\');
} else {
return $fullClassName;
}

return $fullClassName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1305,9 +1305,9 @@ public function getActionContexts($action = null)
$action = (string) $action;
if (isset($controller->{$contextKey}[$action])) {
return $controller->{$contextKey}[$action];
} else {
return [];
}

return [];
}

return $controller->$contextKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ public static function addPath($path, $prefix = 'Zend_Controller_Action_Helper')
public static function addHelper(Zend_Controller_Action_Helper_Abstract $helper)
{
self::getStack()->push($helper);

return;
}

/**
Expand All @@ -110,8 +108,6 @@ public static function addHelper(Zend_Controller_Action_Helper_Abstract $helper)
public static function resetHelpers()
{
self::$_stack = null;

return;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public function offsetExists($priorityOrHelperName)
{
if (is_string($priorityOrHelperName)) {
return array_key_exists($priorityOrHelperName, $this->_helpersByNameRef);
} else {
return array_key_exists($priorityOrHelperName, $this->_helpersByPriority);
}

return array_key_exists($priorityOrHelperName, $this->_helpersByPriority);
}

/**
Expand All @@ -115,9 +115,9 @@ public function offsetGet($priorityOrHelperName)

if (is_string($priorityOrHelperName)) {
return $this->_helpersByNameRef[$priorityOrHelperName];
} else {
return $this->_helpersByPriority[$priorityOrHelperName];
}

return $this->_helpersByPriority[$priorityOrHelperName];
}

/**
Expand Down
22 changes: 8 additions & 14 deletions packages/zend-controller/library/Zend/Controller/Plugin/Broker.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ public function routeStartup(Zend_Controller_Request_Abstract $request)
} catch (Throwable $e) {
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
throw new Zend_Controller_Exception($e->getMessage().$e->getTraceAsString(), $e->getCode(), $e);
} else {
$this->getResponse()->setException($e);
}
$this->getResponse()->setException($e);
}
}
}
Expand All @@ -236,9 +235,8 @@ public function routeShutdown(Zend_Controller_Request_Abstract $request)
} catch (Throwable $e) {
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
throw new Zend_Controller_Exception($e->getMessage().$e->getTraceAsString(), $e->getCode(), $e);
} else {
$this->getResponse()->setException($e);
}
$this->getResponse()->setException($e);
}
}
}
Expand All @@ -261,9 +259,8 @@ public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
} catch (Throwable $e) {
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
throw new Zend_Controller_Exception($e->getMessage().$e->getTraceAsString(), $e->getCode(), $e);
} else {
$this->getResponse()->setException($e);
}
$this->getResponse()->setException($e);
}
}
}
Expand All @@ -281,11 +278,10 @@ public function preDispatch(Zend_Controller_Request_Abstract $request)
} catch (Throwable $e) {
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
throw new Zend_Controller_Exception($e->getMessage().$e->getTraceAsString(), $e->getCode(), $e);
} else {
$this->getResponse()->setException($e);
// skip rendering of normal dispatch give the error handler a try
$this->getRequest()->setDispatched(false);
}
$this->getResponse()->setException($e);
// skip rendering of normal dispatch give the error handler a try
$this->getRequest()->setDispatched(false);
}
}
}
Expand All @@ -303,9 +299,8 @@ public function postDispatch(Zend_Controller_Request_Abstract $request)
} catch (Throwable $e) {
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
throw new Zend_Controller_Exception($e->getMessage().$e->getTraceAsString(), $e->getCode(), $e);
} else {
$this->getResponse()->setException($e);
}
$this->getResponse()->setException($e);
}
}
}
Expand All @@ -323,9 +318,8 @@ public function dispatchLoopShutdown()
} catch (Throwable $e) {
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
throw new Zend_Controller_Exception($e->getMessage().$e->getTraceAsString(), $e->getCode(), $e);
} else {
$this->getResponse()->setException($e);
}
$this->getResponse()->setException($e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1086,9 +1086,9 @@ public function getHttpHost()
return '';
} elseif ((self::SCHEME_HTTP == $scheme && 80 == $port) || (self::SCHEME_HTTPS == $scheme && 443 == $port)) {
return $name;
} else {
return $name.':'.$port;
}

return $name.':'.$port;
}

/**
Expand Down
52 changes: 24 additions & 28 deletions packages/zend-controller/library/Zend/Controller/Router/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ public function match($path, $partial = false)
if (!array_key_exists($pos, $this->_parts)) {
if ($partial) {
break;
} else {
return false;
}

return false;
}

$matchedPath .= $pathPart.$this->_urlDelimiter;
Expand Down Expand Up @@ -508,20 +508,18 @@ public function getTranslator()
{
if (null !== $this->_translator) {
return $this->_translator;
} else {
if (($translator = self::getDefaultTranslator()) !== null) {
return $translator;
} else {
try {
$translator = Zend_Registry::get('Zend_Translate');
} catch (Zend_Exception $e) {
$translator = null;
}
}
if (($translator = self::getDefaultTranslator()) !== null) {
return $translator;
}
try {
$translator = Zend_Registry::get('Zend_Translate');
} catch (Zend_Exception $e) {
$translator = null;
}

if ($translator instanceof Zend_Translate) {
return $translator;
}
}
if ($translator instanceof Zend_Translate) {
return $translator;
}

throw new Zend_Controller_Router_Exception('Could not find a translator');
Expand Down Expand Up @@ -562,20 +560,18 @@ public function getLocale()
{
if (null !== $this->_locale) {
return $this->_locale;
} else {
if (($locale = self::getDefaultLocale()) !== null) {
return $locale;
} else {
try {
$locale = Zend_Registry::get('Zend_Locale');
} catch (Zend_Exception $e) {
$locale = null;
}
}
if (($locale = self::getDefaultLocale()) !== null) {
return $locale;
}
try {
$locale = Zend_Registry::get('Zend_Locale');
} catch (Zend_Exception $e) {
$locale = null;
}

if (null !== $locale) {
return $locale;
}
}
if (null !== $locale) {
return $locale;
}

return null;
Expand Down
Loading
Loading