Skip to content

Commit f11a071

Browse files
authored
Merge pull request #312 from bowphp/refactor/code-base
feat: integrate the notification channel
2 parents 3458928 + 11b7aae commit f11a071

32 files changed

Lines changed: 149 additions & 112 deletions

CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ This method aims to execute an SQL transaction around a passed arrow function.
3939

4040
```php
4141
Database::transaction(fn() => $user->update(['name' => '']));
42-
43-
44-
45-
4642
```
4743
Ref: #255
4844

@@ -135,7 +131,7 @@ Release for 5.0.2
135131
## 5.0.0 - 2023-05-10
136132

137133
- [Add] Convert the project from PHP7 to PHP8
138-
- [Add] Multiconnection for storage system
134+
- [Add] Multi connection for storage system
139135
- [Fix] Fixes migrations errors [#176](https://github.com/bowphp/framework/pull/176)
140136
- [Fix] Fixes the column size [#165](https://github.com/bowphp/framework/pull/165)
141137
- [Fix] Add the fallback on old request method [#170](https://github.com/bowphp/framework/pull/170)

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"neitanod/forceutf8": "^2.0",
1818
"ramsey/uuid": "^4.7",
1919
"ext-ftp": "*",
20-
"ext-openssl": "*"
20+
"ext-openssl": "*",
21+
"ext-pcntl": "*"
2122
},
2223
"require-dev": {
2324
"pda/pheanstalk": "^5.0",

src/Application/Application.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ public function container(?string $name = null, ?callable $callable = null): mix
374374
);
375375
}
376376

377-
return $this->capsule->bind($name, $callable);
377+
$this->capsule->bind($name, $callable);
378+
379+
return $this;
378380
}
379381

380382
/**

src/Auth/Guards/JwtGuard.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Bow\Auth\Guards;
66

77
use Bow\Security\Hash;
8-
use Bow\Support\Log;
98
use Exception;
109
use Policier\Policier;
1110
use Bow\Auth\Authentication;

src/Auth/Guards/SessionGuard.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
namespace Bow\Auth\Guards;
66

77
use Bow\Security\Hash;
8+
use Bow\Session\Exception\SessionException;
89
use Bow\Session\Session;
910
use Bow\Auth\Authentication;
1011
use Bow\Auth\Exception\AuthenticationException;
11-
use Bow\Auth\Guards\GuardContract;
1212
use Bow\Auth\Traits\LoginUserTrait;
1313

1414
class SessionGuard extends GuardContract
@@ -25,7 +25,7 @@ class SessionGuard extends GuardContract
2525
/**
2626
* Defines the session_key
2727
*
28-
* @var array
28+
* @var string
2929
*/
3030
private string $session_key;
3131

@@ -44,10 +44,11 @@ public function __construct(array $provider, string $guard)
4444
}
4545

4646
/**
47-
* Check if user is authenticate
47+
* Check if user is authenticated
4848
*
4949
* @param array $credentials
5050
* @return bool
51+
* @throws AuthenticationException|SessionException
5152
*/
5253
public function attempts(array $credentials): bool
5354
{
@@ -72,6 +73,7 @@ public function attempts(array $credentials): bool
7273
* Get the session instance
7374
*
7475
* @return Session
76+
* @throws AuthenticationException
7577
*/
7678
private function getSession(): Session
7779
{
@@ -87,9 +89,10 @@ private function getSession(): Session
8789
}
8890

8991
/**
90-
* Check if user is authenticate
92+
* Check if user is authenticated
9193
*
9294
* @return bool
95+
* @throws AuthenticationException|SessionException
9396
*/
9497
public function check(): bool
9598
{
@@ -100,16 +103,18 @@ public function check(): bool
100103
* Check if user is guest
101104
*
102105
* @return bool
106+
* @throws AuthenticationException|SessionException
103107
*/
104108
public function guest(): bool
105109
{
106110
return !$this->check();
107111
}
108112

109113
/**
110-
* Check if user is authenticate
114+
* Check if user is authenticated
111115
*
112116
* @return ?Authentication
117+
* @throws AuthenticationException|SessionException
113118
*/
114119
public function user(): ?Authentication
115120
{
@@ -121,6 +126,7 @@ public function user(): ?Authentication
121126
*
122127
* @param mixed $user
123128
* @return bool
129+
* @throws AuthenticationException|SessionException
124130
*/
125131
public function login(Authentication $user): bool
126132
{
@@ -133,6 +139,7 @@ public function login(Authentication $user): bool
133139
* Make direct logout
134140
*
135141
* @return bool
142+
* @throws SessionException|AuthenticationException
136143
*/
137144
public function logout(): bool
138145
{
@@ -145,6 +152,7 @@ public function logout(): bool
145152
* Get the user id
146153
*
147154
* @return mixed
155+
* @throws AuthenticationException|SessionException
148156
*/
149157
public function id(): mixed
150158
{

src/Cache/CacheConfiguration.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Bow\Configuration\Configuration;
88
use Bow\Configuration\Loader;
9-
use Bow\Cache\Cache;
109

1110
class CacheConfiguration extends Configuration
1211
{

src/Configuration/LoggerConfiguration.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
namespace Bow\Configuration;
66

77
use Bow\View\View;
8+
use Exception;
89
use Monolog\Logger;
910
use Bow\Support\Collection;
1011
use Whoops\Handler\Handler;
11-
use Bow\Configuration\Loader;
1212
use Bow\Database\Barry\Model;
1313
use Monolog\Handler\StreamHandler;
1414
use Monolog\Handler\FirePHPHandler;
1515
use Whoops\Handler\CallbackHandler;
16-
use Bow\Configuration\Configuration;
1716
use Bow\Contracts\ResponseInterface;
1817
use Iterator;
1918
use Whoops\Handler\PrettyPageHandler;
@@ -99,7 +98,7 @@ function ($exception, $inspector, $run) use ($monolog, $error_handler) {
9998
* @param string $log_dir
10099
* @param string $name
101100
* @return Logger
102-
* @throws \Exception
101+
* @throws Exception
103102
*/
104103
private function loadFileLogger(string $log_dir, string $name): Logger
105104
{

src/Console/Command.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ class Command extends AbstractCommand
6060
*/
6161
public function call(string $command, string $action, ...$rest): mixed
6262
{
63-
$class = $this->command[$command] ?? null;
63+
$classes = $this->command[$command] ?? null;
6464

65-
if (is_null($class)) {
65+
if (is_null($classes)) {
6666
$this->throwFailsCommand("The command $command not found !");
6767
}
6868

@@ -74,8 +74,10 @@ public function call(string $command, string $action, ...$rest): mixed
7474
$method = Str::camel($action);
7575
}
7676

77-
if (is_array($class)) {
78-
$class = $class[$action];
77+
if (is_array($classes)) {
78+
$class = $classes[$action];
79+
} else {
80+
$class = $classes;
7981
}
8082

8183
$instance = new $class($this->setting, $this->arg);

src/Console/Command/ClearCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class ClearCommand extends AbstractCommand
1414
*
1515
* @param string $action
1616
* @return void
17-
* @throws \ErrorException
1817
*/
1918
public function make(string $action): void
2019
{

src/Console/Command/GenerateKeyCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class GenerateKeyCommand extends AbstractCommand
1414
* Generate Key
1515
*
1616
* @return void
17+
* @throws ConsoleException
1718
*/
1819
public function generate(): void
1920
{

0 commit comments

Comments
 (0)