Fix if for foreach while spacing

This commit is contained in:
Dennis Eichhorn 2017-10-27 17:56:33 +02:00
parent 6a4d6141ad
commit 828bc29023
31 changed files with 55 additions and 55 deletions

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Admin;
use phpOMS\DataStorage\Database\DatabasePool;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Admin;
use phpOMS\DataStorage\Database\DatabasePool;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Admin\Install;
use phpOMS\DataStorage\Database\DatabasePool;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Admin;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Admin;
use phpOMS\DataStorage\Database\DatabaseType;
@ -273,10 +273,10 @@ class Installer extends InstallerAbstract
public static function installExternal(DatabasePool $dbPool, array $data)
{
foreach($data as $type => $element) {
if($type === InstallType::PERMISSION) {
foreach ($data as $type => $element) {
if ($type === InstallType::PERMISSION) {
self::installPermission($dbPool, $element);
} elseif($type === InstallType::GROUP) {
} elseif ($type === InstallType::GROUP) {
self::installGroup($dbPool, $element);
}
}

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Admin;
use phpOMS\DataStorage\Database\DatabasePool;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Admin;
use phpOMS\DataStorage\Database\DatabasePool;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin;
use Model\Message\FormValidation;
@ -176,9 +176,9 @@ class Controller extends ModuleAbstract implements WebInterface
$permissions = AccountPermissionMapper::getFor((int) $request->getData('id'), 'account');
if(!isset($permissions) || $permissions instanceof NullAccountPermission) {
if (!isset($permissions) || $permissions instanceof NullAccountPermission) {
$permissions = [];
} elseif(!is_array($permissions)) {
} elseif (!is_array($permissions)) {
$permissions = [$permissions];
}
@ -247,9 +247,9 @@ class Controller extends ModuleAbstract implements WebInterface
$permissions = GroupPermissionMapper::getFor((int) $request->getData('id'), 'group');
if(!isset($permissions) || $permissions instanceof NullGroupPermission) {
if (!isset($permissions) || $permissions instanceof NullGroupPermission) {
$permissions = [];
} elseif(!is_array($permissions)) {
} elseif (!is_array($permissions)) {
$permissions = [$permissions];
}

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
/**

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
use Modules\Media\Models\MediaMapper;
@ -100,7 +100,7 @@ class AccountMapper extends DataMapperAbstract
try {
$objId = parent::create($obj, $relations);
if($objId === null || !is_scalar($objId)) {
if ($objId === null || !is_scalar($objId)) {
return $objId;
}
} catch (\Exception $e) {

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
use phpOMS\Account\PermissionAbstract;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
use phpOMS\DataStorage\Database\DataMapperAbstract;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models\Exceptions;
@ -31,7 +31,7 @@ class InvalidSignatureException extends \RuntimeException
*
* @param string $message Exception message
* @param int $code Exception code
* @param \Exception Previous exception
* @param \Exception $previous Previous exception
*
* @since 1.0.0
*/

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models\Exceptions;
@ -31,7 +31,7 @@ class InvalidVersionException extends \RuntimeException
*
* @param string $message Exception message
* @param int $code Exception code
* @param \Exception Previous exception
* @param \Exception $previous Previous exception
*
* @since 1.0.0
*/

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
/**

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
use phpOMS\DataStorage\Database\DataMapperAbstract;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
use phpOMS\Account\PermissionAbstract;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
use phpOMS\DataStorage\Database\DataMapperAbstract;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
/**

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
use phpOMS\DataStorage\Database\DataMapperAbstract;

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
class NullAccount extends Account

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
class NullAccountPermission extends AccountPermission

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
class NullGroup extends Group

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
class NullGroupPermission extends GroupPermission

View File

@ -11,7 +11,7 @@
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
declare(strict_types = 1);
namespace Modules\Admin\Models;
use phpOMS\System\File\PathException;

View File

@ -44,10 +44,10 @@ echo $this->getData('nav')->render();
<?php $c = 0; foreach ($this->getData('list:elements') as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/account/settings?{?}&id=' . $value->getId());
$color = 'darkred';
if($value->getStatus() === \phpOMS\Account\AccountStatus::ACTIVE) { $color = 'green'; }
elseif($value->getStatus() === \phpOMS\Account\AccountStatus::INACTIVE) { $color = 'darkblue'; }
elseif($value->getStatus() === \phpOMS\Account\AccountStatus::TIMEOUT) { $color = 'purple'; }
elseif($value->getStatus() === phpOMS\Account\AccountStatus::BANNED) { $color = 'red'; } ?>
if ($value->getStatus() === \phpOMS\Account\AccountStatus::ACTIVE) { $color = 'green'; }
elseif ($value->getStatus() === \phpOMS\Account\AccountStatus::INACTIVE) { $color = 'darkblue'; }
elseif ($value->getStatus() === \phpOMS\Account\AccountStatus::TIMEOUT) { $color = 'purple'; }
elseif ($value->getStatus() === phpOMS\Account\AccountStatus::BANNED) { $color = 'red'; } ?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><span class="tag <?= $color; ?>"><?= $this->getHtml('Status'. $value->getStatus()); ?></span></a>
@ -55,7 +55,7 @@ echo $this->getData('nav')->render();
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getLastActive()->format('Y-m-d H:i:s')); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedAt()->format('Y-m-d H:i:s')); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<?php if ($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>

View File

@ -75,7 +75,7 @@ echo $this->getData('nav')->render(); ?>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<?php if ($c === 0) : ?>
<tr><td colspan="2" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>
@ -125,7 +125,7 @@ echo $this->getData('nav')->render(); ?>
<?= (\phpOMS\Account\PermissionType::DELETE | $permission) === $permission ? 'D' : ''; ?>
<?= (\phpOMS\Account\PermissionType::PERMISSION | $permission) === $permission ? 'P' : ''; ?>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<?php if ($c === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>

View File

@ -42,9 +42,9 @@ echo $this->getData('nav')->render(); ?>
<?php $c = 0; foreach ($this->getData('list:elements') as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId());
$color = 'darkred';
if($value->getStatus() === \phpOMS\Account\GroupStatus::ACTIVE) { $color = 'green'; }
elseif($value->getStatus() === \phpOMS\Account\GroupStatus::INACTIVE) { $color = 'darkblue'; }
elseif($value->getStatus() === \phpOMS\Account\GroupStatus::HIDDEN) { $color = 'purple'; } ?>
if ($value->getStatus() === \phpOMS\Account\GroupStatus::ACTIVE) { $color = 'green'; }
elseif ($value->getStatus() === \phpOMS\Account\GroupStatus::INACTIVE) { $color = 'darkblue'; }
elseif ($value->getStatus() === \phpOMS\Account\GroupStatus::HIDDEN) { $color = 'purple'; } ?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><span class="tag <?= $color; ?>"><?= $this->getHtml('Status'. $value->getStatus()); ?></span></a>
@ -53,7 +53,7 @@ echo $this->getData('nav')->render(); ?>
<td>
<td>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<?php if ($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>

View File

@ -35,7 +35,7 @@ echo $this->getData('nav')->render(); ?>
<tr><td><input id="iGname" name="gname" type="text" placeholder="&#xf0c0; Guest" value="<?= $this->printHtml($group->getName()); ?>">
<tr><td><label for="iGstatus"><?= $this->getHtml('Status'); ?></label>
<tr><td><select id="iGstatus" status="gname">
<?php $status = \phpOMS\Account\GroupStatus::getConstants(); foreach($status as $stat) : ?>
<?php $status = \phpOMS\Account\GroupStatus::getConstants(); foreach ($status as $stat) : ?>
<option value="<?= $stat; ?>"<?= $stat === $group->getStatus() ? ' selected' : ''; ?>><?= $this->getHtml('GroupStatus' . $stat); ?>
<?php endforeach; ?>
</select>
@ -61,7 +61,7 @@ echo $this->getData('nav')->render(); ?>
<td>
<td>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<?php if ($c === 0) : ?>
<tr><td colspan="2" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>
@ -111,7 +111,7 @@ echo $this->getData('nav')->render(); ?>
<?= (\phpOMS\Account\PermissionType::DELETE | $permission) === $permission ? 'D' : ''; ?>
<?= (\phpOMS\Account\PermissionType::PERMISSION | $permission) === $permission ? 'P' : ''; ?>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<?php if ($c === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>

View File

@ -55,7 +55,7 @@ $footerView->setResults(count($modules));
else
echo strtolower($this->getHtml('Available')); ?></a>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<?php if ($count === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>

View File

@ -74,25 +74,25 @@ $currencies = \phpOMS\Localization\ISO4217Enum::getConstants();
<tbody>
<tr><td colspan="2"><label for="iCountries"><?= $this->getHtml('Country'); ?></label>
<tr><td colspan="2"><select id="iCountries" name="country">
<?php foreach($countries as $code => $country) : ?>
<?php foreach ($countries as $code => $country) : ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml(strtolower($code) == strtolower($_country) ? ' selected' : ''); ?>><?= $this->printHtml($country); ?>
<?php endforeach; ?>
</select>
<tr><td colspan="2"><label for="iTimezones"><?= $this->getHtml('Timezone'); ?></label>
<tr><td colspan="2"><select id="iTimezones" name="timezone">
<?php foreach($timezones as $code => $timezone) : ?>
<?php foreach ($timezones as $code => $timezone) : ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml($timezone == $_timezone ? ' selected' : ''); ?>><?= $this->printHtml($timezone); ?>
<?php endforeach; ?>
</select>
<tr><td colspan="2"><label for="iTimeformats"><?= $this->getHtml('Timeformat'); ?></label>
<tr><td colspan="2"><select id="iTimeformats" name="timeformat">
<?php foreach($timeformats as $code => $timeformat) : ?>
<?php foreach ($timeformats as $code => $timeformat) : ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml(strtolower($timeformat) == strtolower($_timeformat) ? ' selected' : ''); ?>><?= $this->printHtml($timeformat); ?>
<?php endforeach; ?>
</select>
<tr><td colspan="2"><label for="iLanguages"><?= $this->getHtml('Language'); ?></label>
<tr><td colspan="2"><select id="iLanguages" name="language">
<?php foreach($languages as $code => $language) : ?>
<?php foreach ($languages as $code => $language) : ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml(strtolower($code) == strtolower($_language) ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
<?php endforeach; ?>
</select>
@ -114,7 +114,7 @@ $currencies = \phpOMS\Localization\ISO4217Enum::getConstants();
<table class="layout wf-100">
<tr><td colspan="2"><label for="iCurrencies"><?= $this->getHtml('Currency'); ?></label>
<tr><td colspan="2"><select form="fLocalization" id="iCurrencies" name="currency">
<?php foreach($currencies as $code => $currency) : ?>
<?php foreach ($currencies as $code => $currency) : ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml(strtolower($code) == strtolower($_currency) ? ' selected' : ''); ?>><?= $this->printHtml($currency); ?>
<?php endforeach; ?>
</select>