fix formatting

This commit is contained in:
Antonio Ramirez
2016-12-14 02:50:12 +01:00
parent f3f4b31bb4
commit 3ba01b4674
140 changed files with 512 additions and 523 deletions

View File

@ -1,4 +1,5 @@
<?php
namespace Da\User\Command;
use Da\User\Query\UserQuery;
@ -26,16 +27,13 @@ class ConfirmController extends Controller
{
$user = $this->userQuery->whereUsernameOrEmail($usernameOrEmail)->one();
if ($user === null) {
$this->stdout(Yii::t('user', 'User is not found') . "\n", Console::FG_RED);
$this->stdout(Yii::t('user', 'User is not found')."\n", Console::FG_RED);
} else {
if ($this->make(UserConfirmationService::class, [$user])->run()) {
$this->stdout(Yii::t('user', 'User has been confirmed') . "\n", Console::FG_GREEN);
$this->stdout(Yii::t('user', 'User has been confirmed')."\n", Console::FG_GREEN);
} else {
$this->stdout(Yii::t('user', 'Error occurred while confirming user') . "\n", Console::FG_RED);
$this->stdout(Yii::t('user', 'Error occurred while confirming user')."\n", Console::FG_RED);
}
}
}
}

View File

@ -1,4 +1,5 @@
<?php
namespace Da\User\Command;
use Da\User\Factory\MailFactory;
@ -22,15 +23,14 @@ class CreateController extends Controller
$mailService = MailFactory::makeWelcomeMailerService($user);
if ($this->make(UserCreateService::class, [$user, $mailService])->run()) {
$this->stdout(Yii::t('user', 'User has been created') . "!\n", Console::FG_GREEN);
$this->stdout(Yii::t('user', 'User has been created')."!\n", Console::FG_GREEN);
} else {
$this->stdout(Yii::t('user', 'Please fix following errors:') . "\n", Console::FG_RED);
$this->stdout(Yii::t('user', 'Please fix following errors:')."\n", Console::FG_RED);
foreach ($user->errors as $errors) {
foreach ($errors as $error) {
$this->stdout(' - ' . $error . "\n", Console::FG_RED);
$this->stdout(' - '.$error."\n", Console::FG_RED);
}
}
}
}
}

View File

@ -1,4 +1,5 @@
<?php
namespace Da\User\Command;
use Da\User\Query\UserQuery;
@ -22,12 +23,12 @@ class DeleteController extends Controller
if ($this->confirm(Yii::t('user', 'Are you sure? Deleted user can not be restored'))) {
$user = $this->userQuery->whereUsernameOrEmail($usernameOrEmail)->one();
if ($user === null) {
$this->stdout(Yii::t('user', 'User is not found') . "\n", Console::FG_RED);
$this->stdout(Yii::t('user', 'User is not found')."\n", Console::FG_RED);
} else {
if ($user->delete()) {
$this->stdout(Yii::t('user', 'User has been deleted') . "\n", Console::FG_GREEN);
$this->stdout(Yii::t('user', 'User has been deleted')."\n", Console::FG_GREEN);
} else {
$this->stdout(Yii::t('user', 'Error occurred while deleting user') . "\n", Console::FG_RED);
$this->stdout(Yii::t('user', 'Error occurred while deleting user')."\n", Console::FG_RED);
}
}
}

View File

@ -1,4 +1,5 @@
<?php
namespace Da\User\Command;
use Da\User\Model\User;
@ -28,12 +29,12 @@ class PasswordController extends Controller
$user = $this->userQuery->whereUsernameOrEmail($usernameOrEmail)->one();
if ($user === null) {
$this->stdout(Yii::t('user', 'User is not found') . "\n", Console::FG_RED);
$this->stdout(Yii::t('user', 'User is not found')."\n", Console::FG_RED);
} else {
if ($this->make(ResetPasswordService::class, [$password, $user])->run()) {
$this->stdout(Yii::t('user', 'Password has been changed') . "\n", Console::FG_GREEN);
$this->stdout(Yii::t('user', 'Password has been changed')."\n", Console::FG_GREEN);
} else {
$this->stdout(Yii::t('user', 'Error occurred while changing password') . "\n", Console::FG_RED);
$this->stdout(Yii::t('user', 'Error occurred while changing password')."\n", Console::FG_RED);
}
}
}