Skip to content

Commit 0a52c25

Browse files
Update functions.php
1 parent 40a21ff commit 0a52c25

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/functions.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
*/
1515
function config(string $key = null, mixed $value = null)
1616
{
17-
if (null === $key) {
17+
if (null === $key)
1818
return new Config;
19-
}
2019

2120
if (null !== $value) {
2221
Config::set($key, $value);
@@ -36,13 +35,11 @@ function app(string $alias = null, mixed $value = null): object
3635
{
3736
$axmInstance = Axm::getApp();
3837

39-
if (null === $alias) {
38+
if (null === $alias)
4039
return $axmInstance;
41-
}
4240

43-
if (null !== $value) {
41+
if (null !== $value)
4442
$axmInstance->$alias = $value;
45-
}
4643

4744
return $axmInstance->$alias;
4845
}
@@ -234,9 +231,8 @@ function lang(string $key, array $args = []): string
234231
{
235232
// Get an instance of Lang
236233
$lang = Lang::make();
237-
if (empty($args)) {
234+
if (empty($args))
238235
return $lang->trans($key);
239-
}
240236

241237
return $lang->trans($key, $args);
242238
}
@@ -263,9 +259,8 @@ function setFlash(string $type, string $message): void
263259
function generateUrl(string $dir = ''): string
264260
{
265261
$url = baseUrl($dir);
266-
if (!filter_var($url, FILTER_VALIDATE_URL)) {
262+
if (!filter_var($url, FILTER_VALIDATE_URL))
267263
throw new RuntimeException(sprintf('Invalid URL: %s', $url));
268-
}
269264

270265
return $url;
271266
}
@@ -370,9 +365,8 @@ function post($key = null)
370365
if (!($post = app()->request->post()))
371366
return false;
372367

373-
if ($key !== null) {
368+
if ($key !== null)
374369
return htmlspecialchars($post[$key], ENT_QUOTES, 'UTF-8');
375-
}
376370

377371
return htmlspecialchars($post, ENT_QUOTES, 'UTF-8');
378372
}
@@ -611,4 +605,4 @@ function csrf(): string
611605
return '<input type="hidden" name="csrfToken" value="' . app()->getCsrfToken() . '">';
612606
}
613607

614-
}
608+
}

0 commit comments

Comments
 (0)