Code cleanup

This commit is contained in:
Björn Fromme
2018-10-04 11:47:31 +02:00
parent 5c2e7619d0
commit 2b8312c32c
9 changed files with 17 additions and 16 deletions
@@ -50,7 +50,7 @@ class ConfigurationService
$config = []; $config = [];
foreach (explode(';', $configArray[$itemName]['value']) as $item) foreach (explode(';', $configArray[$itemName]['value']) as $item)
{ {
list ($value, $label) = explode(':', $item); [ $value, $label ] = explode(':', $item);
$config[$value] = $label; $config[$value] = $label;
} }
@@ -139,7 +139,7 @@ class SearchController extends ActionController
{ {
$ignoreIps = GeneralUtility::trimExplode(',', $this->settings['searchLogIgnoreIps'], true); $ignoreIps = GeneralUtility::trimExplode(',', $this->settings['searchLogIgnoreIps'], true);
$remoteIp = GeneralUtility::getIndpEnv('REMOTE_ADDR'); $remoteIp = GeneralUtility::getIndpEnv('REMOTE_ADDR');
if (in_array($remoteIp, $ignoreIps)) { if (\in_array($remoteIp, $ignoreIps, false)) {
return; return;
} }
/** @var $logger \TYPO3\CMS\Core\Log\Logger */ /** @var $logger \TYPO3\CMS\Core\Log\Logger */
@@ -126,7 +126,7 @@ class FilterService implements SingletonInterface
// Nights // Nights
$duration = (int) $row['nights'] <= 4 ? FilterSettings::DURATION_SHORT : FilterSettings::DURATION_LONG; $duration = (int) $row['nights'] <= 4 ? FilterSettings::DURATION_SHORT : FilterSettings::DURATION_LONG;
if (!in_array($duration, $nights)) { if (!\in_array($duration, $nights, false)) {
$nights[] = $duration; $nights[] = $duration;
} }
@@ -247,11 +247,11 @@ class HotelDataService implements SingletonInterface
$hotel['available'] += $row['available']; $hotel['available'] += $row['available'];
if (!in_array($row['nights'], $hotel['nights'])) { if (!\in_array($row['nights'], $hotel['nights'], false)) {
$hotel['nights'][] = $row['nights']; $hotel['nights'][] = $row['nights'];
} }
if (!in_array($row['dateStart'], $hotel['dates'])) { if (!\in_array($row['dateStart'], $hotel['dates'], false)) {
$hotel['dates'][] = $row['dateStart']; $hotel['dates'][] = $row['dateStart'];
} }
@@ -125,11 +125,11 @@ class ProductDataService implements SingletonInterface
$teaser =& $data[$row['productUid']]; $teaser =& $data[$row['productUid']];
if (!in_array($row['nights'], $teaser['nights'])) { if (!\in_array($row['nights'], $teaser['nights'], false)) {
$teaser['nights'][] = $row['nights']; $teaser['nights'][] = $row['nights'];
} }
if (!in_array($row['dateStart'], $teaser['dates'])) { if (!\in_array($row['dateStart'], $teaser['dates'], false)) {
$teaser['dates'][] = $row['dateStart']; $teaser['dates'][] = $row['dateStart'];
} }
@@ -167,7 +167,7 @@ class ProductDataService implements SingletonInterface
} }
if ($limit > 0) { if ($limit > 0) {
return array_slice($data, 0, $limit); return \array_slice($data, 0, $limit);
} }
return $data; return $data;
@@ -156,11 +156,11 @@ class SearchResultService implements SingletonInterface
$item =& $items[$key]; $item =& $items[$key];
if (!in_array($row['nights'], $item['nights'])) { if (!\in_array($row['nights'], $item['nights'], false)) {
$item['nights'][] = $row['nights']; $item['nights'][] = $row['nights'];
} }
if (!in_array($row['dateStart'], $item['dates'])) { if (!\in_array($row['dateStart'], $item['dates'], false)) {
$item['dates'][] = $row['dateStart']; $item['dates'][] = $row['dateStart'];
} }
@@ -95,7 +95,7 @@ trait RequestArgumentTypeConversionTrait
$filterSettings['dateTo'] = !empty($filterSettings['dateTo']) ? new \DateTime($filterSettings['dateTo']) : null; $filterSettings['dateTo'] = !empty($filterSettings['dateTo']) ? new \DateTime($filterSettings['dateTo']) : null;
if (!empty($filterSettings['bus'])) { if (!empty($filterSettings['bus'])) {
$filterSettings['bus'] = in_array($filterSettings['bus'], [ 'true', '1' ], true); $filterSettings['bus'] = \in_array($filterSettings['bus'], [ 'true', '1' ], true);
} else { } else {
$filterSettings['bus'] = null; $filterSettings['bus'] = null;
} }
@@ -40,11 +40,12 @@ class AjaxFormController extends ActionController
protected $emailService; protected $emailService;
/** /**
* @param EmailService $service * @param EmailService $emailService
*/ */
public function injectEmailService(EmailService $service) public function __construct(EmailService $emailService)
{ {
$this->emailService = $service; parent::__construct();
$this->emailService = $emailService;
} }
/** /**
@@ -73,7 +74,7 @@ class AjaxFormController extends ActionController
if ($this->arguments->getValidationResults()->hasErrors()) { if ($this->arguments->getValidationResults()->hasErrors()) {
foreach ($this->arguments->getValidationResults()->getFlattenedErrors() as $key => $errors) foreach ($this->arguments->getValidationResults()->getFlattenedErrors() as $key => $errors)
{ {
list($formName, $fieldName) = explode('.', $key); [ $formName, $fieldName ] = explode('.', $key);
$errorsRaw = []; $errorsRaw = [];
foreach ($errors as $error) foreach ($errors as $error)
{ {
@@ -73,7 +73,7 @@ class ContainerViewHelper extends AbstractViewHelper
} }
$classes = []; $classes = [];
if (in_array($arguments['data']['colPos'], static::$columnsWithoutContainers, false)) { if (\in_array($arguments['data']['colPos'], static::$columnsWithoutContainers, false)) {
$classes[] = 'container'; $classes[] = 'container';
} else { } else {
$classes[] = 'in-column'; $classes[] = 'in-column';