Skip to content

Commit

Permalink
Reformat entire codebase for trailing comma that will make line dupli…
Browse files Browse the repository at this point in the history
…cation easier
  • Loading branch information
alextselegidis committed Dec 22, 2023
1 parent 1ee373a commit 2878d12
Show file tree
Hide file tree
Showing 218 changed files with 2,798 additions and 2,673 deletions.
4 changes: 2 additions & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"bracketSpacing": false,
"bracketSameLine": false,
"quoteProps": "preserve",
"trailingComma": "none",
"trailingCommaPHP": false,
"trailingComma": "all",
"trailingCommaPHP": true,
"phpVersion": "8.0",
"plugins": ["@prettier/plugin-php"]
}
25 changes: 13 additions & 12 deletions application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

$protocol =
(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ||
(isset($_SERVER['SERVER_PORT']) && (int) $_SERVER['SERVER_PORT'] === 443) ||
(isset($_SERVER['SERVER_PORT']) && (int)$_SERVER['SERVER_PORT'] === 443) ||
(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
? 'https://'
: 'http://';
Expand All @@ -26,7 +26,8 @@

$request_uri = dirname($_SERVER['SCRIPT_NAME']);

if ($request_uri === '.') {
if ($request_uri === '.')
{
$request_uri = '';
}

Expand Down Expand Up @@ -195,7 +196,7 @@
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = true;
$config['enable_hooks'] = TRUE;

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -255,8 +256,8 @@
| use segment based URLs.
|
*/
$config['allow_get_array'] = true;
$config['enable_query_strings'] = false;
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use
Expand Down Expand Up @@ -349,9 +350,9 @@
$config['sess_cookie_name'] = 'ea_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = __DIR__ . '/../../storage/sessions';
$config['sess_match_ip'] = false;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = false;
$config['sess_regenerate_destroy'] = FALSE;

/*
|--------------------------------------------------------------------------
Expand All @@ -367,7 +368,7 @@
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = strpos($config['base_url'], 'https') !== false;
$config['cookie_secure'] = strpos($config['base_url'], 'https') !== FALSE;

/*
|--------------------------------------------------------------------------
Expand All @@ -381,7 +382,7 @@
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
*/
$config['csrf_protection'] = true;
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_token';
$config['csrf_cookie_name'] = 'csrf_cookie';
$config['csrf_expire'] = 7200;
Expand All @@ -404,7 +405,7 @@
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = false;
$config['compress_output'] = FALSE;

/*
|--------------------------------------------------------------------------
Expand All @@ -429,7 +430,7 @@
| in your view files. Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = false;
$config['rewrite_short_tags'] = FALSE;

/*
|--------------------------------------------------------------------------
Expand All @@ -453,7 +454,7 @@
| will control the number of requests a client can sent to the app.
|
*/
$config['rate_limiting'] = true;
$config['rate_limiting'] = TRUE;

/* End of file config.php */
/* Location: ./application/config/config.php */
12 changes: 6 additions & 6 deletions application/config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@
*/

$active_group = 'default';
$query_builder = true;
$query_builder = TRUE;

$db['default']['hostname'] = Config::DB_HOST;
$db['default']['username'] = Config::DB_USERNAME;
$db['default']['password'] = Config::DB_PASSWORD;
$db['default']['database'] = Config::DB_NAME;
$db['default']['dbdriver'] = 'mysqli';
$db['default']['dbprefix'] = 'ea_';
$db['default']['pconnect'] = true;
$db['default']['db_debug'] = true;
$db['default']['cache_on'] = false;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8mb4';
$db['default']['dbcollat'] = 'utf8mb4_unicode_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = true;
$db['default']['stricton'] = false;
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

/* End of file database.php */
/* Location: ./application/config/database.php */
2 changes: 1 addition & 1 deletion application/config/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| whenever you intend to do a schema migration.
|
*/
$config['migration_enabled'] = true;
$config['migration_enabled'] = TRUE;

/*
|--------------------------------------------------------------------------
Expand Down
34 changes: 17 additions & 17 deletions application/config/mimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'application/mac-binhex40',
'application/mac-binhex',
'application/x-binhex40',
'application/x-mac-binhex40'
'application/x-mac-binhex40',
],
'cpt' => 'application/mac-compactpro',
'csv' => [
Expand All @@ -28,14 +28,14 @@
'application/csv',
'application/excel',
'application/vnd.msexcel',
'text/plain'
'text/plain',
],
'bin' => [
'application/macbinary',
'application/mac-binary',
'application/octet-stream',
'application/x-binary',
'application/x-macbinary'
'application/x-macbinary',
],
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
Expand Down Expand Up @@ -66,18 +66,18 @@
'application/excel',
'application/download',
'application/vnd.ms-office',
'application/msword'
'application/msword',
],
'ppt' => [
'application/powerpoint',
'application/vnd.ms-powerpoint',
'application/vnd.ms-office',
'application/msword'
'application/msword',
],
'pptx' => [
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/x-zip',
'application/zip'
'application/zip',
],
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
Expand All @@ -94,7 +94,7 @@
'application/x-php',
'text/php',
'text/x-php',
'application/x-httpd-php-source'
'application/x-httpd-php-source',
],
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
Expand All @@ -113,7 +113,7 @@
'application/zip',
'application/x-zip-compressed',
'application/s-compressed',
'multipart/x-zip'
'multipart/x-zip',
],
'rar' => ['application/x-rar', 'application/rar', 'application/x-rar-compressed'],
'mid' => 'audio/midi',
Expand Down Expand Up @@ -141,7 +141,7 @@
'image/x-ms-bmp',
'application/bmp',
'application/x-bmp',
'application/x-win-bitmap'
'application/x-win-bitmap',
],
'gif' => 'image/gif',
'jpeg' => ['image/jpeg', 'image/pjpeg'],
Expand Down Expand Up @@ -181,20 +181,20 @@
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/zip',
'application/msword',
'application/x-zip'
'application/x-zip',
],
'dot' => ['application/msword', 'application/vnd.ms-office'],
'dotx' => [
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/zip',
'application/msword'
'application/msword',
],
'xlsx' => [
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/zip',
'application/vnd.ms-excel',
'application/msword',
'application/x-zip'
'application/x-zip',
],
'word' => ['application/msword', 'application/octet-stream'],
'xl' => 'application/excel',
Expand Down Expand Up @@ -245,14 +245,14 @@
'application/x-compressed',
'application/x-zip-compressed',
'application/zip',
'multipart/x-zip'
'multipart/x-zip',
],
'7zip' => [
'application/x-7z-compressed',
'application/x-compressed',
'application/x-zip-compressed',
'application/zip',
'multipart/x-zip'
'multipart/x-zip',
],
'cdr' => [
'application/cdr',
Expand All @@ -261,14 +261,14 @@
'application/x-coreldraw',
'image/cdr',
'image/x-cdr',
'zz-application/zz-winassoc-cdr'
'zz-application/zz-winassoc-cdr',
],
'wma' => ['audio/x-ms-wma', 'video/x-ms-asf'],
'jar' => [
'application/java-archive',
'application/x-java-application',
'application/x-jar',
'application/x-compressed'
'application/x-compressed',
],
'svg' => ['image/svg+xml', 'application/xml', 'text/xml'],
'vcf' => 'text/x-vcard',
Expand All @@ -290,5 +290,5 @@
'odt' => 'application/vnd.oasis.opendocument.text',
'odm' => 'application/vnd.oasis.opendocument.text-master',
'ott' => 'application/vnd.oasis.opendocument.text-template',
'oth' => 'application/vnd.oasis.opendocument.text-web'
'oth' => 'application/vnd.oasis.opendocument.text-web',
];
11 changes: 7 additions & 4 deletions application/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

$route['404_override'] = '';

$route['translate_uri_dashes'] = false;
$route['translate_uri_dashes'] = FALSE;

/*
| -------------------------------------------------------------------------
Expand Down Expand Up @@ -86,16 +86,19 @@

header('Access-Control-Allow-Credentials: "true"');

if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) {
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))
{
// May also be using PUT, PATCH, HEAD etc
header('Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD');
}

if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))
{
header('Access-Control-Allow-Headers: ' . $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']);
}

if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'OPTIONS')
{
exit(0);
}

Expand Down
2 changes: 1 addition & 1 deletion application/config/testing/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

$route['default_controller'] = 'test/index';
$route['404_override'] = 'test/index'; // when in doubt, use the hammer
$route['translate_uri_dashes'] = false;
$route['translate_uri_dashes'] = FALSE;

/* End of file routes.php */
/* Location: ./application/config/testing/routes.php */
4 changes: 2 additions & 2 deletions application/controllers/About.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ public function index()

script_vars([
'user_id' => $user_id,
'role_slug' => $role_slug
'role_slug' => $role_slug,
]);

html_vars([
'page_title' => lang('settings'),
'active_menu' => PRIV_SYSTEM_SETTINGS,
'user_display_name' => $this->accounts->get_user_display_name($user_id),
'privileges' => $this->roles_model->get_permissions_by_slug($role_slug)
'privileges' => $this->roles_model->get_permissions_by_slug($role_slug),
]);

$this->load->view('pages/about');
Expand Down
10 changes: 5 additions & 5 deletions application/controllers/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ public function index()
$account = $this->users_model->find($user_id);

script_vars([
'account' => $account
'account' => $account,
]);

html_vars([
'page_title' => lang('settings'),
'active_menu' => PRIV_SYSTEM_SETTINGS,
'user_display_name' => $this->accounts->get_user_display_name($user_id),
'grouped_timezones' => $this->timezones->to_grouped_array()
'grouped_timezones' => $this->timezones->to_grouped_array(),
]);

$this->load->view('pages/account');
Expand Down Expand Up @@ -104,7 +104,7 @@ public function save()
'notes',
'timezone',
'language',
'settings'
'settings',
]);

$this->users_model->only($account['settings'], ['username', 'password', 'notifications', 'calendar_view']);
Expand All @@ -119,7 +119,7 @@ public function save()
'user_email' => $account['email'],
'username' => $account['settings']['username'],
'timezone' => $account['timezone'],
'language' => $account['language']
'language' => $account['language'],
]);

response();
Expand All @@ -141,7 +141,7 @@ public function validate_username()
$is_valid = $this->users_model->validate_username($username, $user_id);

json_response([
'is_valid' => $is_valid
'is_valid' => $is_valid,
]);
} catch (Throwable $e) {
json_exception($e);
Expand Down
Loading

0 comments on commit 2878d12

Please sign in to comment.