Skip to content

Commit

Permalink
fix: minor
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jan 4, 2025
1 parent 974ac1c commit 1cbb73a
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 15 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"laravel/pint": "^1.2",
"larastan/larastan": "^2.4.0",
"sampoyigi/testbench": "dev-main as 1.0",
"pestphp/pest-plugin-laravel": "^2.0"
"pestphp/pest-plugin-laravel": "^3.0"
},
"autoload": {
"psr-4": {
Expand All @@ -42,7 +42,7 @@
}
},
"scripts": {
"test": "vendor/bin/pest",
"test": "vendor/bin/pest --coverage --exactly=100",
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/pint",
"static": "vendor/bin/phpstan analyse --ansi --memory-limit 1056M"
Expand Down
22 changes: 11 additions & 11 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,18 @@ parameters:
path: src/Http/Actions/AssigneeController.php

-
message: "#^Call to an undefined method Igniter\\\\User\\\\Http\\\\Controllers\\\\CustomerGroups\\:\\:refreshList\\(\\)\\.$#"
message: "#^Access to an undefined property Igniter\\\\Flame\\\\Database\\\\Model\\:\\:\\$full_name\\.$#"
count: 1
path: src/Http/Controllers/CustomerGroups.php
path: src/Http/Controllers/Customers.php

-
message: "#^Call to an undefined method Igniter\\\\User\\\\Http\\\\Controllers\\\\Customers\\:\\:formFindModelObject\\(\\)\\.$#"
count: 2
message: "#^Call to an undefined method Igniter\\\\Flame\\\\Database\\\\Model\\:\\:completeActivation\\(\\)\\.$#"
count: 1
path: src/Http/Controllers/Customers.php

-
message: "#^Call to an undefined method Igniter\\\\Flame\\\\Database\\\\Model\\:\\:getActivationCode\\(\\)\\.$#"
count: 1
path: src/Http/Controllers/Customers.php

-
Expand All @@ -246,12 +251,12 @@ parameters:
path: src/Http/Controllers/Users.php

-
message: "#^Call to an undefined method Igniter\\\\User\\\\Http\\\\Controllers\\\\Users\\:\\:formFindModelObject\\(\\)\\.$#"
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:reloadRelations\\(\\)\\.$#"
count: 1
path: src/Http/Controllers/Users.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:reloadRelations\\(\\)\\.$#"
message: "#^Variable \\$user in PHPDoc tag @var does not exist\\.$#"
count: 1
path: src/Http/Controllers/Users.php

Expand All @@ -260,11 +265,6 @@ parameters:
count: 1
path: src/Http/Middleware/InjectImpersonateBanner.php

-
message: "#^Call to an undefined static method Illuminate\\\\Support\\\\Facades\\\\Event\\:\\:fire\\(\\)\\.$#"
count: 1
path: src/Http/Middleware/ThrottleRequests.php

-
message: "#^Access to an undefined property Igniter\\\\User\\\\Models\\\\AssignableLog\\:\\:\\$assignable\\.$#"
count: 2
Expand Down
4 changes: 4 additions & 0 deletions src/Http/Controllers/CustomerGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use Igniter\Admin\Facades\AdminMenu;
use Igniter\User\Models\CustomerGroup;

/**
* @mixin \Igniter\Admin\Http\Actions\ListController
* @mixin \Igniter\Admin\Http\Actions\FormController
*/
class CustomerGroups extends \Igniter\Admin\Classes\AdminController
{
public array $implement = [
Expand Down
5 changes: 4 additions & 1 deletion src/Http/Controllers/Customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
use Igniter\Admin\Facades\Template;
use Igniter\Flame\Exception\FlashException;
use Igniter\User\Facades\Auth;

use function flash;
use function lang;
use function post;

/**
* @mixin \Igniter\Admin\Http\Actions\ListController
* @mixin \Igniter\Admin\Http\Actions\FormController
*/
class Customers extends \Igniter\Admin\Classes\AdminController
{
public array $implement = [
Expand Down
3 changes: 3 additions & 0 deletions src/Http/Controllers/Notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Igniter\User\Http\Controllers;

/**
* @mixin \Igniter\Admin\Http\Actions\ListController
*/
class Notifications extends \Igniter\Admin\Classes\AdminController
{
public array $implement = [
Expand Down
4 changes: 4 additions & 0 deletions src/Http/Controllers/UserGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use Igniter\Admin\Facades\AdminMenu;
use Igniter\User\Models\UserGroup;

/**
* @mixin \Igniter\Admin\Http\Actions\ListController
* @mixin \Igniter\Admin\Http\Actions\FormController
*/
class UserGroups extends \Igniter\Admin\Classes\AdminController
{
public array $implement = [
Expand Down
4 changes: 4 additions & 0 deletions src/Http/Controllers/UserRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

use Igniter\Admin\Facades\AdminMenu;

/**
* @mixin \Igniter\Admin\Http\Actions\ListController
* @mixin \Igniter\Admin\Http\Actions\FormController
*/
class UserRoles extends \Igniter\Admin\Classes\AdminController
{
public array $implement = [
Expand Down
6 changes: 6 additions & 0 deletions src/Http/Controllers/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
use Igniter\Admin\Facades\AdminMenu;
use Igniter\Flame\Exception\FlashException;
use Igniter\User\Facades\AdminAuth;
use Igniter\User\Models\User;

/**
* @mixin \Igniter\Admin\Http\Actions\ListController
* @mixin \Igniter\Admin\Http\Actions\FormController
*/
class Users extends \Igniter\Admin\Classes\AdminController
{
public array $implement = [
Expand Down Expand Up @@ -130,6 +135,7 @@ public function onImpersonate($context, $recordId = null)
);

$id = post('recordId', $recordId);
/** @var User $user */
if ($user = $this->formFindModelObject((int)$id)) {
AdminAuth::stopImpersonate();
AdminAuth::impersonate($user);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Middleware/ThrottleRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes

protected function shouldThrottleRequest($request, $params)
{
return Event::fire('igniter.user.beforeThrottleRequest', [$request, $params], true);
return Event::dispatch('igniter.user.beforeThrottleRequest', [$request, $params], true);
}
}

0 comments on commit 1cbb73a

Please sign in to comment.