Skip to content

Commit

Permalink
chore: fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Oct 31, 2024
1 parent 3df88c6 commit 09eb3ed
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function autoConnect(array $pdoOptions = [])

/**
* Pass in db connection instance directly
*
*
* @param \PDO $connection A connection instance of your db
* @return $this;
*/
Expand All @@ -81,7 +81,7 @@ public function dbConnection(\PDO $connection)

/**
* Get/Set Leaf Auth config
*
*
* @param string|array $config The auth config key or array of config
* @param mixed $value The value if $config is a string
*/
Expand All @@ -102,7 +102,7 @@ public function config($config, $value = null)
* Sign a user in
* ---
* Verify user credentials and sign them in with token or session
*
*
* @param array $credentials User credentials
* @return bool
*/
Expand Down Expand Up @@ -152,7 +152,7 @@ public function login(array $credentials): bool
* Register a new user
* ---
* Save a new user to the database
*
*
* @param array $userData User data
* @return bool
*/
Expand Down Expand Up @@ -208,7 +208,7 @@ public function register(array $userData): bool
* Update user data
* ---
* Update user data in the database
*
*
* @param array $userData User data
* @return bool
*/
Expand Down Expand Up @@ -273,7 +273,7 @@ public function update(array $userData): bool
* Update user password
* ---
* Update user password in the database
*
*
* @param string $oldPassword Old password
* @param string $newPassword New password
* @return bool
Expand Down Expand Up @@ -330,7 +330,7 @@ public function updatePassword(string $oldPassword, string $newPassword): bool
* Sign a user out
* ---
* Sign out the currently authenticated user
*
*
* @param string|array|callable|null $redirectUrl Redirect to this url after logout
* @return bool
*/
Expand Down Expand Up @@ -465,7 +465,7 @@ public function middleware(string $middleware, callable $callback)
}
});
}

app()->registerMiddleware($middleware, $callback);
}

Expand All @@ -488,7 +488,7 @@ public function parseToken()

/**
* Return the current db instance
*
*
* @return Db
*/
public function db()
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Config for Leaf Auth
* --------
* Set/Get config to match your app
*
*
* @since 3.0.0
* @version 0.1.0
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Auth/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Auth User
* ----
* Class representing a user
*
*
* @since 3.0.0
* @version 1.0.0
*/
Expand Down Expand Up @@ -192,14 +192,14 @@ public function __unset($name)

/**
* Get a "user to many" table relation
*
*
* <code>
* auth()->user()->orders()->all();
* auth()->user()->transactions()->where('amount', '>', 100)->get();
* auth()->user()->notes()->where('title', 'like', '%important%')->get();
* auth()->user()->posts()->where('published', true)->all();
* </code>
*
*
* @param mixed $method The table to relate to
* @param mixed $args
* @throws \Exception
Expand Down
6 changes: 3 additions & 3 deletions src/Auth/UsesRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* Functionality for user permissions
* ----
* Addition to user class
*
*
* @version 0.1.0
* @since 3.0.0
*/
trait UsesRoles {

trait UsesRoles
{
/**
* User Permissions
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function deleteUser(string $username, $table = 'users')
function createTableForUsers($table = 'users'): void
{
$db = dbInstance();

try {
$db
->query("CREATE TABLE IF NOT EXISTS $table (
Expand All @@ -60,6 +60,6 @@ function createTableForUsers($table = 'users'): void
)")
->execute();
} catch (\Throwable $th) {
throw new \Exception("Failed to create table for users: " . $th->getMessage());
throw new \Exception('Failed to create table for users: ' . $th->getMessage());
}
}

0 comments on commit 09eb3ed

Please sign in to comment.