Skip to content

Commit

Permalink
update file
Browse files Browse the repository at this point in the history
  • Loading branch information
juancristobalgd1 authored Mar 27, 2024
1 parent e748239 commit 4c74012
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ private function loadEnv(): void

/**
* Configure error reporting and display settings based on the environment.
* @return void
*/
private function configureEnvironment()
private function configureEnvironment(): void
{
static $initialized = false;
if (!$initialized) {
Expand Down Expand Up @@ -86,7 +85,7 @@ private function configureEnvironment()
public function registerComponents()
{
$pathConfig = config('paths.providersPath') . DIRECTORY_SEPARATOR;
$providers = include $pathConfig . 'providers.php';
$providers = include $pathConfig . 'providers.php';
$this->components($providers);
}

Expand All @@ -103,7 +102,6 @@ public function bootServices()

/**
* Check if the application is in production mode.
* @return bool True if the application is in production mode, false otherwise.
*/
public function isProduction(): bool
{
Expand All @@ -123,7 +121,7 @@ public function getEnvironment()
*/
public function isLogged(): bool
{
return !empty ($this->user);
return !empty($this->user);
}

/**
Expand Down Expand Up @@ -163,7 +161,6 @@ public function login(): bool

/**
* Log out the user.
* @param string $path The optional path to redirect after logout.
*/
public function logout(string $path = '/'): void
{
Expand Down Expand Up @@ -198,7 +195,7 @@ public function getLocale(): string|false
throw new \Exception('The "Intl" extension is not enabled on this server');

$http = \Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '');
$locale = !empty ($http) ? $http : 'en_US';
$locale = !empty($http) ? $http : 'en_US';

return $locale;
}
Expand All @@ -222,12 +219,12 @@ public function setCsrfCookie(string $csrfToken): void
}

/**
* Get the CSRF token. If the token is not present in the cookie, generate and set a new one.
* @return string The generated or existing CSRF token.
* Get the CSRF token. If the token is not present in the cookie,
* generate and set a new one.
*/
public function getCsrfToken(): string
{
return isset ($_COOKIE['csrfToken']) ? $_COOKIE['csrfToken'] : $this->generateAndSetCsrfToken();
return isset($_COOKIE['csrfToken']) ? $_COOKIE['csrfToken'] : $this->generateAndSetCsrfToken();
}

/**
Expand Down Expand Up @@ -272,18 +269,16 @@ public function user(string $value = null)

/**
* Remove a service identified by its alias from the container.
* @param string $alias
*/
public function removeService(string $alias)
public function removeService(string $alias): void
{
return $this->remove($alias);
}

/**
* Magic method to dynamically retrieve properties.
* @return mixed The value of the retrieved property.
*/
public function __get(string $name)
public function get(string $name): object|false
{
if ($name == 'config') {
return config($name);
Expand Down

0 comments on commit 4c74012

Please sign in to comment.