Skip to content

Commit 437215c

Browse files
committed
Rename variables to use camel case format
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 40cc4a0 commit 437215c

224 files changed

Lines changed: 7103 additions & 7103 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/openid.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
}
2020

2121
/* Change this to true if using phpMyAdmin over https */
22-
$secure_cookie = false;
22+
$secureCookie = false;
2323

2424
/**
2525
* Map of authenticated users to MySQL user/password pairs.
2626
*/
27-
$AUTH_MAP = [
27+
$authMap = [
2828
'https://launchpad.net/~username' => [
2929
'user' => 'root',
3030
'password' => '',
@@ -79,10 +79,10 @@ function Die_error($e): void
7979
// phpcs:enable
8080

8181
/* Need to have cookie visible from parent directory */
82-
session_set_cookie_params(0, '/', '', $secure_cookie, true);
82+
session_set_cookie_params(0, '/', '', $secureCookie, true);
8383
/* Create signon session */
84-
$session_name = 'SignonSession';
85-
session_name($session_name);
84+
$sessionName = 'SignonSession';
85+
session_name($sessionName);
8686
@session_start();
8787

8888
// Determine realm and return_to
@@ -158,13 +158,13 @@ function Die_error($e): void
158158

159159
$id = $message->get('openid.claimed_id');
160160

161-
if (empty($id) || ! isset($AUTH_MAP[$id])) {
161+
if (empty($id) || ! isset($authMap[$id])) {
162162
Show_page('<p>User not allowed!</p>');
163163
exit;
164164
}
165165

166-
$_SESSION['PMA_single_signon_user'] = $AUTH_MAP[$id]['user'];
167-
$_SESSION['PMA_single_signon_password'] = $AUTH_MAP[$id]['password'];
166+
$_SESSION['PMA_single_signon_user'] = $authMap[$id]['user'];
167+
$_SESSION['PMA_single_signon_password'] = $authMap[$id]['password'];
168168
$_SESSION['PMA_single_signon_HMAC_secret'] = hash('sha1', uniqid(strval(random_int(0, mt_getrandmax())), true));
169169
session_write_close();
170170
/* Redirect to phpMyAdmin (should use absolute URL here!) */

examples/signon.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
/* Use cookies for session */
1313
ini_set('session.use_cookies', 'true');
1414
/* Change this to true if using phpMyAdmin over https */
15-
$secure_cookie = false;
15+
$secureCookie = false;
1616
/* Need to have cookie visible from parent directory */
17-
session_set_cookie_params(0, '/', '', $secure_cookie, true);
17+
session_set_cookie_params(0, '/', '', $secureCookie, true);
1818
/* Create signon session */
19-
$session_name = 'SignonSession';
20-
session_name($session_name);
19+
$sessionName = 'SignonSession';
20+
session_name($sessionName);
2121
// Uncomment and change the following line to match your $cfg['SessionSavePath']
2222
//session_save_path('/foobar');
2323
@session_start();

libraries/classes/Bookmark.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ public function applyVariables(array $variables): string
153153
// remove comments that encloses a variable placeholder
154154
$query = (string) preg_replace('|/\*(.*\[VARIABLE[0-9]*\].*)\*/|imsU', '${1}', $this->query);
155155
// replace variable placeholders with values
156-
$number_of_variables = $this->getVariableCount();
157-
for ($i = 1; $i <= $number_of_variables; $i++) {
156+
$numberOfVariables = $this->getVariableCount();
157+
for ($i = 1; $i <= $numberOfVariables; $i++) {
158158
$var = '';
159159
if (! empty($variables[$i])) {
160160
$var = $this->dbi->escapeString($variables[$i]);
@@ -175,27 +175,27 @@ public function applyVariables(array $variables): string
175175
/**
176176
* Creates a Bookmark object from the parameters
177177
*
178-
* @param array $bkm_fields the properties of the bookmark to add; here, $bkm_fields['bkm_sql_query'] is urlencoded
179-
* @param bool $all_users whether to make the bookmark available for all users
178+
* @param array $bkmFields the properties of the bookmark to add; here, $bkm_fields['bkm_sql_query'] is urlencoded
179+
* @param bool $allUsers whether to make the bookmark available for all users
180180
*/
181181
public static function createBookmark(
182182
DatabaseInterface $dbi,
183-
array $bkm_fields,
184-
bool $all_users = false,
183+
array $bkmFields,
184+
bool $allUsers = false,
185185
): Bookmark|false {
186186
if (
187-
! (isset($bkm_fields['bkm_sql_query'], $bkm_fields['bkm_label'])
188-
&& strlen($bkm_fields['bkm_sql_query']) > 0
189-
&& strlen($bkm_fields['bkm_label']) > 0)
187+
! (isset($bkmFields['bkm_sql_query'], $bkmFields['bkm_label'])
188+
&& strlen($bkmFields['bkm_sql_query']) > 0
189+
&& strlen($bkmFields['bkm_label']) > 0)
190190
) {
191191
return false;
192192
}
193193

194194
$bookmark = new Bookmark($dbi, new Relation($dbi));
195-
$bookmark->database = $bkm_fields['bkm_database'];
196-
$bookmark->label = $bkm_fields['bkm_label'];
197-
$bookmark->query = $bkm_fields['bkm_sql_query'];
198-
$bookmark->currentUser = $all_users ? '' : $bkm_fields['bkm_user'];
195+
$bookmark->database = $bkmFields['bkm_database'];
196+
$bookmark->label = $bkmFields['bkm_label'];
197+
$bookmark->query = $bkmFields['bkm_sql_query'];
198+
$bookmark->currentUser = $allUsers ? '' : $bkmFields['bkm_user'];
199199

200200
return $bookmark;
201201
}
@@ -255,13 +255,13 @@ public static function getList(
255255
/**
256256
* Retrieve a specific bookmark
257257
*
258-
* @param string $user Current user
259-
* @param DatabaseName $db the current database name
260-
* @param int|string $id an identifier of the bookmark to get
261-
* @param string $id_field which field to look up the identifier
262-
* @param bool $action_bookmark_all true: get all bookmarks regardless
258+
* @param string $user Current user
259+
* @param DatabaseName $db the current database name
260+
* @param int|string $id an identifier of the bookmark to get
261+
* @param string $idField which field to look up the identifier
262+
* @param bool $actionBookmarkAll true: get all bookmarks regardless
263263
* of the owning user
264-
* @param bool $exact_user_match whether to ignore bookmarks with no user
264+
* @param bool $exactUserMatch whether to ignore bookmarks with no user
265265
*
266266
* @return Bookmark|null the bookmark
267267
*/
@@ -270,9 +270,9 @@ public static function get(
270270
string $user,
271271
DatabaseName $db,
272272
int|string $id,
273-
string $id_field = 'id',
274-
bool $action_bookmark_all = false,
275-
bool $exact_user_match = false,
273+
string $idField = 'id',
274+
bool $actionBookmarkAll = false,
275+
bool $exactUserMatch = false,
276276
): self|null {
277277
$relation = new Relation($dbi);
278278
$bookmarkFeature = $relation->getRelationParameters()->bookmarkFeature;
@@ -283,16 +283,16 @@ public static function get(
283283
$query = 'SELECT * FROM ' . Util::backquote($bookmarkFeature->database)
284284
. '.' . Util::backquote($bookmarkFeature->bookmark)
285285
. ' WHERE dbase = ' . $dbi->quoteString($db->getName());
286-
if (! $action_bookmark_all) {
286+
if (! $actionBookmarkAll) {
287287
$query .= ' AND (user = ' . $dbi->quoteString($user);
288-
if (! $exact_user_match) {
288+
if (! $exactUserMatch) {
289289
$query .= " OR user = ''";
290290
}
291291

292292
$query .= ')';
293293
}
294294

295-
$query .= ' AND ' . Util::backquote($id_field)
295+
$query .= ' AND ' . Util::backquote($idField)
296296
. ' = ' . $dbi->quoteString((string) $id) . ' LIMIT 1';
297297

298298
$result = $dbi->fetchSingleRow($query, DatabaseInterface::FETCH_ASSOC, Connection::TYPE_CONTROL);

libraries/classes/Command/CacheWarmupCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ private function warmUpTwigCache(
168168
// Generate line map
169169
/** @psalm-suppress InternalMethod */
170170
$cacheFilename = $twigCache->generateKey($name, $twig->getTemplateClass($name));
171-
$template_file = 'templates/' . $name;
172-
$cache_file = str_replace($tmpDir, 'twig-templates', $cacheFilename);
171+
$templateFile = 'templates/' . $name;
172+
$cacheFile = str_replace($tmpDir, 'twig-templates', $cacheFilename);
173173
/** @psalm-suppress InternalMethod */
174-
$replacements[$cache_file] = [$template_file, $template->getDebugInfo()];
174+
$replacements[$cacheFile] = [$templateFile, $template->getDebugInfo()];
175175
}
176176

177177
if (! $writeReplacements) {

0 commit comments

Comments
 (0)