Skip to content

Commit

Permalink
Merge branch 'alfredbez-task-fixPhpcsErrors'
Browse files Browse the repository at this point in the history
  • Loading branch information
MantasVaitkunas committed Oct 19, 2016
2 parents 3d3509d + 00a19ab commit 2d5697b
Show file tree
Hide file tree
Showing 26 changed files with 85 additions and 108 deletions.
4 changes: 2 additions & 2 deletions source/Core/Edition/EditionRootPathProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class EditionRootPathProvider
private $editionSelector;

/**
* @param $editionSelector
* @param EditionSelector $editionSelector
*/
public function __construct($editionSelector)
{
Expand All @@ -67,7 +67,7 @@ public function getDirectoryPath()
$path = getShopBasePath();
if ($this->getEditionSelector()->isEnterprise()) {
$path = $editionsPath .'/'. static::ENTERPRISE_DIRECTORY;
} else if ($this->getEditionSelector()->isProfessional()) {
} elseif ($this->getEditionSelector()->isProfessional()) {
$path = $editionsPath .'/'. static::PROFESSIONAL_DIRECTORY;
}

Expand Down
2 changes: 1 addition & 1 deletion source/Core/InputValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public function getFirstValidationError()
* Validates payment input data for credit card and debit note
*
* @param string $sPaymentId the payment id of current payment
* @param array &$aDynValue values of payment
* @param array $aDynValue values of payment
*
* @return bool
*/
Expand Down
13 changes: 6 additions & 7 deletions source/Core/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,9 @@ protected function _recodeLangArray($aLangArray, $sCharset, $blRecodeKeys = fals
/**
* Goes through language array and recodes its values.
*
* @param array $aLangArray language data
* @param string $sCharset charset which was used while making file
* @param string $newEncoding charset which was used while making file
* @param array $aLangArray language data
* @param string $sCharset charset which was used while making file
* @param string $newEncoding charset which was used while making file
*
*/
protected function _recodeLangArrayValues(&$aLangArray, $sCharset, $newEncoding)
Expand All @@ -671,9 +671,9 @@ protected function _recodeLangArrayValues(&$aLangArray, $sCharset, $newEncoding)
/**
* Goes through language array and recodes its values and keys. Returns recoded data
*
* @param array $aLangArray language data
* @param string $sCharset charset which was used while making file
* @param string $newEncoding charset which was used while making file
* @param array $aLangArray language data
* @param string $sCharset charset which was used while making file
* @param string $newEncoding charset which was used while making file
*
* @return array
*/
Expand Down Expand Up @@ -1008,7 +1008,6 @@ protected function _getLanguageMap($iLang, $blAdmin = null)
include $sMapFile;
$this->_aLangMap[$sKey] = $aMap;
}

}

return $this->_aLangMap[$sKey];
Expand Down
11 changes: 4 additions & 7 deletions source/Core/Module/ModuleTemplatePathCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ModuleTemplatePathCalculator
* Sets required dependencies
*
* @param oxModuleList $moduleList
* @param oxTheme $theme
* @param oxTheme $theme
* @param FileSystem $fileSystem
*/
public function __construct($moduleList = null, $theme = null, $fileSystem = null)
Expand Down Expand Up @@ -107,18 +107,15 @@ public function calculateModuleTemplatePath($templateName)

if (is_array($moduleTemplates) && is_array($activeModules)) {
foreach ($moduleTemplates as $sModuleId => $aTemplates) {

// check if module is active
if (isset($activeModules[$sModuleId])) {
$foundTemplate = null;
$fileSystem = $this->getFileSystem();

// check if template for our active themes exists
if ($activeThemes = $theme->getActiveThemesList()) {
foreach ($activeThemes as $oneActiveThemeId) {
if (isset($aTemplates[$oneActiveThemeId], $aTemplates[$oneActiveThemeId][$templateName])) {
$foundTemplate = $fileSystem->combinePaths($this->getModulesPath(), $aTemplates[$oneActiveThemeId][$templateName]);
}
foreach ((array) $theme->getActiveThemesList() as $oneActiveThemeId) {
if (isset($aTemplates[$oneActiveThemeId], $aTemplates[$oneActiveThemeId][$templateName])) {
$foundTemplate = $fileSystem->combinePaths($this->getModulesPath(), $aTemplates[$oneActiveThemeId][$templateName]);
}
}

Expand Down
1 change: 0 additions & 1 deletion source/Core/ModuleInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ public function diffModuleArrays($aAllModuleArray, $aRemModuleArray)
$aAllModuleArray[$sClass] = $aModuleChain;
}
}

}

return $aAllModuleArray;
Expand Down
2 changes: 1 addition & 1 deletion source/Core/ModuleList.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public function diffModuleArrays($aAllModuleArray, $aRemModuleArray)
}
}
if (!count($aAllModuleArray[$sClass])) {
unset ($aAllModuleArray[$sClass]);
unset($aAllModuleArray[$sClass]);
}
} else {
$aAllModuleArray[$sClass] = $aModuleChain;
Expand Down
2 changes: 1 addition & 1 deletion source/Core/OnlineCaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function call(oxOnlineRequest $oRequest)
return $sOutputXml;
}

/*
/**
* Depending on the type of exception, first cast the exception and then write it to log.
*
* @param Exception $oEx
Expand Down
5 changes: 2 additions & 3 deletions source/Core/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,12 @@ public function processViewArray($aViewData, $sClassName)
/**
* This function is called from index.php
*
* @param object &$oEmail email object
* @param object $oEmail email object
*/
public function processEmail(& $oEmail)
public function processEmail(&$oEmail)
{
// #669 PHP5 claims that you cant pas full this but should instead pass reference what is anyway a much better idea
// removed "return" as by reference you dont need any return

}


Expand Down
1 change: 0 additions & 1 deletion source/Core/PictureHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public function deleteArticleMasterPicture($oObject, $iIndex, $blDeleteMasterPic
$this->deleteZoomPicture($oObject, $iIndex);
}
}

}

/**
Expand Down
1 change: 0 additions & 1 deletion source/Core/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ public function calculateDiscount()

if ($aDiscounts) {
foreach ($aDiscounts as $aDiscount) {

if ($aDiscount['type'] == 'abs') {
$dPrice = $dPrice - $aDiscount['value'];
} else {
Expand Down
7 changes: 3 additions & 4 deletions source/Core/PriceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
* @version OXID eShop CE
*/


namespace OxidEsales\Eshop\Core;

/**
* Price list class. Deals with a list of oxPrice object.
* The main reason why we can't just sum oxPrice objects is that they have different VAT percents.
*/

namespace OxidEsales\Eshop\Core;

class PriceList
{

/**
* Array containing oxPrice objects
*
Expand Down
8 changes: 3 additions & 5 deletions source/Core/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function getRequestUrl($sParams = '', $blReturnUrl = false)
{
$requestUrl = '';
if ($_SERVER["REQUEST_METHOD"] != "POST") {

if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI']) {
$rawRequestUrl = $_SERVER['REQUEST_URI'];
} else {
Expand All @@ -89,7 +88,6 @@ public function getRequestUrl($sParams = '', $blReturnUrl = false)

// trying to resolve controller file name
if ($rawRequestUrl && ($iPos = stripos($rawRequestUrl, '?')) !== false) {

$string = getStr();
// formatting request url
$requestUrl = 'index.php' . $string->substr($rawRequestUrl, $iPos);
Expand All @@ -109,8 +107,8 @@ public function getRequestUrl($sParams = '', $blReturnUrl = false)
* Checks if passed parameter has special chars and replaces them.
* Returns checked value.
*
* @param mixed &$sValue value to process escaping
* @param array $aRaw keys of unescaped values
* @param mixed $sValue value to process escaping
* @param array $aRaw keys of unescaped values
*
* @return mixed
*/
Expand All @@ -128,7 +126,7 @@ public function checkParamSpecialChars(& $sValue, $aRaw = null)
$this->checkParamSpecialChars($sValidKey);
$this->checkParamSpecialChars($sVal);
if ($sValidKey != $sKey) {
unset ($sValue[$sKey]);
unset($sValue[$sKey]);
}
}
$newValue[$sValidKey] = $sVal;
Expand Down
3 changes: 2 additions & 1 deletion source/Core/SeoEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,8 @@ protected function _prepareUri($sUri, $iLang = false)

return $oStr->preg_replace(
array('|//+|', '/' . $sQuotedSeparator . $sQuotedSeparator . '+/'),
array('/', self::$_sSeparator), $sUri
array('/', self::$_sSeparator),
$sUri
);
}

Expand Down
1 change: 0 additions & 1 deletion source/Core/SepaIBANValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ protected function _isEachCodeLengthValid($aCodeLengths)
$blValid = false;
break;
}

}

return $blValid;
Expand Down
12 changes: 4 additions & 8 deletions source/Core/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,6 @@ public function hasVariable($name)
*
* @param string $name Name of parameter to store
* @param mixed $value Value of parameter
*
* @return null
*/
public function setVariable($name, $value)
{
Expand Down Expand Up @@ -657,13 +655,11 @@ public function isSidNeeded($sUrl = null)
// no cookie, so must check session
if ($blSidNeeded = $this->getVariable('blSidNeeded')) {
$this->_blSidNeeded = true;
} elseif ($this->_isSessionRequiredAction()) {
if (!count($_COOKIE)) {
$this->_blSidNeeded = true;
} elseif ($this->_isSessionRequiredAction() && !count($_COOKIE)) {
$this->_blSidNeeded = true;

// storing to session, performance..
$this->setVariable('blSidNeeded', $this->_blSidNeeded);
}
// storing to session, performance..
$this->setVariable('blSidNeeded', $this->_blSidNeeded);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion source/Core/StandardList.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public function offsetSet($offset, $oBase)
$this->_aArray[] = & $oBase;
}
}

}

/**
Expand Down
20 changes: 10 additions & 10 deletions source/Core/StrMb.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,11 @@ public function preg_replace_callback($pattern, $callback, $subject, $limit = -1
/**
* PHP preg_match() function wrapper
*
* @param string $sPattern pattern to search for, as a string
* @param string $sSubject input string
* @param array &$aMatches is filled with the results of search
* @param int $iFlags flags
* @param int $iOffset place from which to start the search
* @param string $sPattern pattern to search for, as a string
* @param string $sSubject input string
* @param array $aMatches is filled with the results of search
* @param int $iFlags flags
* @param int $iOffset place from which to start the search
*
* @return string
*/
Expand All @@ -267,11 +267,11 @@ public function preg_match($sPattern, $sSubject, &$aMatches = null, $iFlags = nu
/**
* PHP preg_match_all() function wrapper
*
* @param string $sPattern pattern to search for, as a string
* @param string $sSubject input string
* @param array &$aMatches is filled with the results of search
* @param int $iFlags flags
* @param int $iOffset place from which to start the search
* @param string $sPattern pattern to search for, as a string
* @param string $sSubject input string
* @param array $aMatches is filled with the results of search
* @param int $iFlags flags
* @param int $iOffset place from which to start the search
*
* @return string
*/
Expand Down
20 changes: 10 additions & 10 deletions source/Core/StrRegular.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ public function preg_replace_callback($pattern, $callback, $subject, $limit = -1
/**
* PHP preg_match() function wrapper
*
* @param string $sPattern pattern to search for, as a string
* @param string $sSubject input string
* @param array &$aMatches is filled with the results of search
* @param int $iFlags flags
* @param int $iOffset place from which to start the search
* @param string $sPattern pattern to search for, as a string
* @param string $sSubject input string
* @param array $aMatches is filled with the results of search
* @param int $iFlags flags
* @param int $iOffset place from which to start the search
*
* @return string
*/
Expand All @@ -252,11 +252,11 @@ public function preg_match($sPattern, $sSubject, &$aMatches = null, $iFlags = nu
/**
* PHP preg_match_all() function wrapper
*
* @param string $sPattern pattern to search for, as a string
* @param string $sSubject input string
* @param array &$aMatches is filled with the results of search
* @param int $iFlags flags
* @param int $iOffset place from which to start the search
* @param string $sPattern pattern to search for, as a string
* @param string $sSubject input string
* @param array $aMatches is filled with the results of search
* @param int $iFlags flags
* @param int $iOffset place from which to start the search
*
* @return string
*/
Expand Down
10 changes: 2 additions & 8 deletions source/Core/SuperConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class SuperConfig
* Only used for convenience in UNIT tests by doing so we avoid
* writing extended classes for testing protected or private methods
*
* @param string $method Methods name
* @param array $arguments Argument array
* @param string $method Methods name
* @param array $arguments Argument array
*
* @throws oxSystemComponentException Throws an exception if the called method does not exist or is not accessable in current class
*
Expand Down Expand Up @@ -121,8 +121,6 @@ public function getConfig()
* oxConfig instance setter
*
* @param oxConfig $config config object
*
* @return null
*/
public function setConfig($config)
{
Expand All @@ -147,8 +145,6 @@ public function getSession()
* oxSession instance setter
*
* @param oxsession $session session object
*
* @return null
*/
public function setSession($session)
{
Expand Down Expand Up @@ -177,8 +173,6 @@ public function getUser()
* Active oxuser object setter
*
* @param oxuser $user user object
*
* @return null
*/
public function setUser($user)
{
Expand Down
2 changes: 1 addition & 1 deletion source/Core/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ public function showOfflinePage()
$offline = file_get_contents($offlineMessageFile);
$this->showMessageAndExit($offline);
}

/**
* redirect user to the specified URL
*
Expand Down
4 changes: 2 additions & 2 deletions source/Core/UtilsDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ public function convertDBDateTime($oObject, $blToTimeStamp = false, $blOnlyDate
*
* @return string
*/

public function convertDBTimestamp($oObject, $blToTimeStamp = false)
{
// on this case usually means that we gonna save value, and value is formatted, not plain
Expand Down Expand Up @@ -560,7 +559,8 @@ public function getRequestTime()

/**
* Returns the the timestamp formatted as date string for the database
* @param $iTimestamp the timestamp to be formatted
*
* @param int $iTimestamp the timestamp to be formatted
*
* @return bool|string timestamp formatted as date string for the database, false on error
*/
Expand Down
Loading

0 comments on commit 2d5697b

Please sign in to comment.