for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Containers\Authorization\Actions;
use App\Containers\Authorization\Tasks\GetRoleTask;
use App\Containers\Authorization\Tasks\RevokeUserFromRoleTask;
use App\Containers\User\Models\User;
use App\Containers\User\Tasks\FindUserByIdTask;
use App\Ship\Parents\Actions\Action;
use Illuminate\Database\Eloquent\Collection;
/**
* Class RevokeUserFromRoleAction.
*
* @author Mahmoud Zalt <[email protected]>
*/
class RevokeUserFromRoleAction extends Action
{
* @param User|integer $userId
$userId
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @param integer|array $rolesIds
* @return \App\Containers\User\Models\User
public function run($user, $rolesIds)
if (!$user instanceof User) {
$user = $this->call(FindUserByIdTask::class, [$user]);
}
if (!is_array($rolesIds)) {
$rolesIds = [$rolesIds];
$roles = new Collection();
foreach ($rolesIds as $roleId) {
$role = $this->call(GetRoleTask::class, [$roleId]);
$roles->add($role);
return $this->call(revokeUserFromRoleTask::class, [$user, $roles->pluck('name')->toArray()]);
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.