Skip to content

Commit

Permalink
Misc: CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
satrun77 committed Jan 12, 2016
1 parent ae4f913 commit b5efc21
Show file tree
Hide file tree
Showing 81 changed files with 7,888 additions and 814 deletions.
71 changes: 36 additions & 35 deletions app/Console/Commands/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ class Install extends Command
* @var array
*/
protected $modules = [
'pdo' => 0,
'mcrypt' => 0,
'openssl' => 0,
'curl' => 0,
'json' => 0,
'pdo' => 0,
'mcrypt' => 0,
'openssl' => 0,
'curl' => 0,
'json' => 0,
'mbstring' => 0,
'xml' => 0,
'xml' => 0,
];

/**
Expand All @@ -72,8 +72,8 @@ class Install extends Command
*/
protected $dbDrivers = [
'pdo_sqlite' => 0,
'pdo_mysql' => 0,
'pdo_pgsql' => 0,
'pdo_mysql' => 0,
'pdo_pgsql' => 0,
'pdo_sqlsrv' => 0,
];

Expand All @@ -83,20 +83,20 @@ class Install extends Command
* @var array
*/
protected $data = [
'key' => '',
'timezone' => 'Pacific/Auckland',
'dbHost' => 'localhost',
'dbName' => 'tinyissue',
'dbUser' => 'root',
'dbPass' => self::EMPTY_VALUE,
'dbDriver' => 'mysql',
'dbPrefix' => '',
'sysEmail' => '',
'sysName' => '',
'adminEmail' => '',
'key' => '',
'timezone' => 'Pacific/Auckland',
'dbHost' => 'localhost',
'dbName' => 'tinyissue',
'dbUser' => 'root',
'dbPass' => self::EMPTY_VALUE,
'dbDriver' => 'mysql',
'dbPrefix' => '',
'sysEmail' => '',
'sysName' => '',
'adminEmail' => '',
'adminFirstName' => '',
'adminLastName' => '',
'adminPass' => '',
'adminLastName' => '',
'adminPass' => '',
];

/**
Expand Down Expand Up @@ -321,13 +321,13 @@ protected function stageOne()
$validDbDrivers = $this->getValidDbDrivers();
$this->askQuestions([
'dbDriver' => ['choice', ['Select a database driver', $validDbDrivers, 0]],
'dbHost' => 'Enter the database host',
'dbName' => 'Enter the database name',
'dbUser' => 'Enter the database username',
'dbPass' => 'Enter the database password',
'dbHost' => 'Enter the database host',
'dbName' => 'Enter the database name',
'dbUser' => 'Enter the database username',
'dbPass' => 'Enter the database password',
'dbPrefix' => 'Enter the tables prefix',
'sysEmail' => 'Email address used by the Tiny Issue to send emails from',
'sysName' => 'Email name used by the Tiny Issue for the email address above',
'sysName' => 'Email name used by the Tiny Issue for the email address above',
'timezone' => 'The application timezone. Find your timezone from: http://php.net/manual/en/timezones.php)',
]);
$this->data['key'] = md5(str_random(40));
Expand Down Expand Up @@ -434,20 +434,20 @@ protected function stageTwo()
$this->section('Setting up the admin account:');

$this->askQuestions([
'adminEmail' => 'Email address',
'adminEmail' => 'Email address',
'adminFirstName' => 'First Name',
'adminLastName' => 'Last Name',
'adminPass' => 'Password',
'adminLastName' => 'Last Name',
'adminPass' => 'Password',
]);

Model\User::updateOrCreate(['email' => $this->data['adminEmail']], [
'email' => $this->data['adminEmail'],
'email' => $this->data['adminEmail'],
'firstname' => $this->data['adminFirstName'],
'lastname' => $this->data['adminLastName'],
'password' => \Hash::make($this->data['adminPass']),
'deleted' => Model\User::NOT_DELETED_USERS,
'role_id' => 4,
'language' => 'en',
'lastname' => $this->data['adminLastName'],
'password' => \Hash::make($this->data['adminPass']),
'deleted' => Model\User::NOT_DELETED_USERS,
'role_id' => 4,
'language' => 'en',
]);

$this->info('Admin account created successfully.');
Expand All @@ -457,6 +457,7 @@ protected function stageTwo()
* Returns the actual value of user input
*
* @param $name
*
* @return string
*/
protected function getInputValue($name)
Expand Down
14 changes: 7 additions & 7 deletions app/Export/Project/Issue/CsvHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ class CsvHandler
* @var array
*/
protected $columns = [
'tinyissue.id' => 'id',
'tinyissue.project' => 'project',
'tinyissue.title' => 'title',
'tinyissue.time_quote' => 'time_quote',
'tinyissue.id' => 'id',
'tinyissue.project' => 'project',
'tinyissue.title' => 'title',
'tinyissue.time_quote' => 'time_quote',
'tinyissue.label_created' => 'created_at',
'tinyissue.updated' => 'updated_at',
'tinyissue.label_closed' => 'closed_at',
'tinyissue.status' => 'status',
'tinyissue.updated' => 'updated_at',
'tinyissue.label_closed' => 'closed_at',
'tinyissue.status' => 'status',
];

/**
Expand Down
8 changes: 4 additions & 4 deletions app/Export/Project/Issue/XlsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class XlsHandler
* @var array
*/
protected $columns = [
'id' => '',
'title' => '',
'id' => '',
'title' => '',
'time_quote' => '',
'created_at' => '',
'updated_at' => '',
'closed_at' => '',
'status' => '',
'closed_at' => '',
'status' => '',
];

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Extensions/Html/Traits/TabTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ trait TabTrait
public function tab(array $tabs, $active)
{
$defaultTab = [
'title' => '',
'title' => '',
'prefix' => '',
'active' => false,
'url' => '',
'url' => '',
];

$output = '<ul class="nav nav-tabs">';
Expand Down
12 changes: 6 additions & 6 deletions app/Form/ExportIssues.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public function actions()
{
return [
'export-issue' => [
'name' => 'export-issue',
'name' => 'export-issue',
'label' => 'export',
'type' => 'info_submit',
'type' => 'info_submit',
],
];
}
Expand All @@ -53,12 +53,12 @@ public function fields()

// Add extra fields
$fields['format'] = [
'type' => 'select',
'type' => 'select',
'placeholder' => trans('tinyissue.export_format'),
'options' => [
Exporter::TYPE_XLS => trans('tinyissue.xls'),
'options' => [
Exporter::TYPE_XLS => trans('tinyissue.xls'),
Exporter::TYPE_XLSX => trans('tinyissue.xlsx'),
Exporter::TYPE_CSV => trans('tinyissue.csv'),
Exporter::TYPE_CSV => trans('tinyissue.csv'),
],
];

Expand Down
38 changes: 19 additions & 19 deletions app/Form/FilterIssue.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public function actions()
{
return [
'filter' => [
'name' => 'filter',
'name' => 'filter',
'label' => 'filter',
'type' => 'info_submit',
'type' => 'info_submit',
],
];
}
Expand Down Expand Up @@ -75,39 +75,39 @@ public function fields()

$fields = [
'keyword' => [
'type' => 'text',
'placeholder' => trans('tinyissue.keywords'),
'type' => 'text',
'placeholder' => trans('tinyissue.keywords'),
'onGroupAddClass' => 'toolbar-item first',
],
'tags' => [
'type' => 'text',
'placeholder' => trans('tinyissue.tags'),
'multiple' => true,
'class' => 'tagit',
'data_tokens' => htmlentities($selectTags, ENT_QUOTES),
'type' => 'text',
'placeholder' => trans('tinyissue.tags'),
'multiple' => true,
'class' => 'tagit',
'data_tokens' => htmlentities($selectTags, ENT_QUOTES),
'onGroupAddClass' => 'toolbar-item',
],
'sort' => [
'type' => 'groupField',
'type' => 'groupField',
'onGroupAddClass' => 'toolbar-item',
'fields' => [
'fields' => [
'sortby' => [
'type' => 'select',
'placeholder' => trans('tinyissue.sortby'),
'options' => $sort,
'type' => 'select',
'placeholder' => trans('tinyissue.sortby'),
'options' => $sort,
'onGroupClass' => 'control-inline control-sortby',
],
'sortorder' => [
'type' => 'select',
'options' => ['asc' => trans('tinyissue.sort_asc'), 'desc' => trans('tinyissue.sort_desc')],
'type' => 'select',
'options' => ['asc' => trans('tinyissue.sort_asc'), 'desc' => trans('tinyissue.sort_desc')],
'onGroupClass' => 'control-inline control-sortorder',
],
],
],
'assignto' => [
'type' => 'select',
'placeholder' => trans('tinyissue.assigned_to'),
'options' => $assignTo,
'type' => 'select',
'placeholder' => trans('tinyissue.assigned_to'),
'options' => $assignTo,
'onGroupAddClass' => 'toolbar-item last',
],
];
Expand Down
8 changes: 4 additions & 4 deletions app/Form/FormAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ protected function projectUploadFields($name, Project $project, User $user)
{
return [
$name => [
'type' => 'FileUpload',
'type' => 'FileUpload',
'data_message_success' => trans('tinyissue.success_upload'),
'data_message_failed' => trans('tinyissue.error_uploadfailed'),
'multiple' => null,
'data_message_failed' => trans('tinyissue.error_uploadfailed'),
'multiple' => null,
],
$name . '_token' => [
'type' => 'hidden',
'type' => 'hidden',
'value' => md5($project->id . time() . $user->id . rand(1, 100)),
],
];
Expand Down
4 changes: 2 additions & 2 deletions app/Form/Issue.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected function fieldAssignedTo()
*/
protected function fieldUpload()
{
$user = \Auth::guest()? new Model\User : \Auth::user();
$user = \Auth::guest() ? new Model\User() : \Auth::user();
$fields = $this->projectUploadFields('upload', $this->project, $user);
$fields['upload']['label'] = 'attachments';

Expand Down Expand Up @@ -250,7 +250,7 @@ protected function extractQuoteValue($part)
}

if ($part === 'm') {
return (($seconds / 60) % 60);
return ($seconds / 60) % 60;
}

if ($part === 's') {
Expand Down
18 changes: 9 additions & 9 deletions app/Form/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@ public function fields()
{
$fields = [
'email' => [
'type' => 'text',
'type' => 'text',
'label' => 'email',
],
'password' => [
'type' => 'password',
'type' => 'password',
'label' => 'password',
],
'group' => [
'type' => 'group',
'type' => 'group',
'addClass' => 'form-actions',
'label' => '',
'label' => '',
'required' => false,
],
'login' => [
'type' => 'primary_submit',
'type' => 'primary_submit',
'value' => 'login',
],
'remember' => [
'type' => 'checkbox',
'type' => 'checkbox',
'required' => false,
'text' => 'remember_me',
'inline' => null,
'text' => 'remember_me',
'inline' => null,
],
'closeGroup' => [
'type' => 'closeGroup',
Expand All @@ -63,7 +63,7 @@ public function rules()
{
$rules = [
'password' => 'required',
'email' => 'required|email',
'email' => 'required|email',
];

return $rules;
Expand Down
Loading

0 comments on commit b5efc21

Please sign in to comment.