Skip to content

Commit

Permalink
fix unset accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
zegenie committed Jan 17, 2022
1 parent a792e82 commit fb7bde4
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Core
*/
protected static array $tables = [];

protected static bool $debug_mode = true;
protected static bool $debug_mode = false;

protected static ?bool $debug_logging;

Expand Down Expand Up @@ -531,7 +531,7 @@ public static function setHostname(string $hostname): void
*/
public static function getHostname(): string
{
return self::$hostname;
return self::$hostname ?? '';
}

/**
Expand Down Expand Up @@ -571,7 +571,7 @@ public static function setUsername(string $username): void
*/
public static function getUsername(): string
{
return self::$username;
return self::$username ?? '';
}

/**
Expand Down Expand Up @@ -611,7 +611,7 @@ public static function setPassword(string $password): void
*/
public static function getPassword(): string
{
return self::$password;
return self::$password ?? '';
}

/**
Expand All @@ -632,7 +632,7 @@ public static function setDatabaseName(string $database_name): void
*/
public static function getDatabaseName(): string
{
return self::$database_name;
return self::$database_name ?? '';
}

/**
Expand All @@ -655,7 +655,7 @@ public static function setDriver(string $driver): void
*/
public static function getDriver(): string
{
return self::$driver;
return self::$driver ?? '';
}

public static function hasDriver(): bool
Expand Down Expand Up @@ -689,8 +689,6 @@ public static function doConnect(): void
}
} catch (PDOException $e) {
throw new Exception("Could not connect to the database [" . $e->getMessage() . "], dsn: ".self::getDSN());
} catch (Exception $e) {
throw $e;
}
}

Expand Down Expand Up @@ -719,8 +717,8 @@ public static function setCacheEntities(bool $caching): void
*
* @param string $strategy
*
* @see self::CACHE_TYPE_INTERNAL
* @see self::CACHE_TYPE_MEMCACHED
* @see CACHE_TYPE_INTERNAL
* @see CACHE_TYPE_MEMCACHED
*/
public static function setCacheEntitiesStrategy(string $strategy): void
{
Expand All @@ -732,8 +730,8 @@ public static function setCacheEntitiesStrategy(string $strategy): void
*
* @return string
*
* @see self::CACHE_TYPE_INTERNAL
* @see self::CACHE_TYPE_MEMCACHED
* @see CACHE_TYPE_INTERNAL
* @see CACHE_TYPE_MEMCACHED
*/
public static function getCacheEntitiesStrategy(): string
{
Expand Down

0 comments on commit fb7bde4

Please sign in to comment.