for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Containers\User\Services;
use App\Containers\User\Contracts\UserRepositoryInterface;
use App\Containers\User\Exceptions\UserNotFoundException;
use App\Port\Service\Abstracts\Service;
use Exception;
/**
* Class FindUserService.
*
* @author Mahmoud Zalt <[email protected]>
*/
class FindUserService extends Service
{
* @var \App\Containers\User\Contracts\UserRepositoryInterface
private $userRepository;
* FindUserService constructor.
* @param \App\Containers\User\Contracts\UserRepositoryInterface $userRepository
public function __construct(UserRepositoryInterface $userRepository)
$this->userRepository = $userRepository;
}
* @param $email
* @param $password
* @param $name
* @param bool|false $login
$login
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.
* @return mixed
public function byId($id)
try {
// find the user by its id
$user = $this->userRepository->find($id);
} catch (Exception $e) {
throw new UserNotFoundException;
return $user;
* @param $agentId
public function byAgentId($agentId)
$user = $this->userRepository->findByField('agent_id', $agentId)->first();
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
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.