for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Model\Repository;
use Nymfonya\Component\Container;
use App\Component\Model\Orm\IOrm;
use App\Component\Model\Orm\Orm;
class Users extends Orm implements IOrm
{
/**
* table name
* @var string
*/
protected $tablename = 'users';
* table primary key
protected $primary = 'id';
* database name
protected $database = 'nymfonya';
* pool name
protected $slot = 'test';
* instanciate
*
* @param Container $container
* @return self
public function __construct(Container $container)
parent::__construct($container);
}
* find a user for a given id
* @param integer $uid
* @return Users
public function getById(int $uid): Users
$this->find(['*'], ['id' => $uid]);
return $this;
* find a user for a given email
public function getByEmail(string $email): Users
$this->find(['*'], ['email' => $email]);
* auth from username and password
* @param string $email
* @param string $password
* @return array
public function auth(string $email, string $password): Users
$password
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function auth(string $email, /** @scrutinizer ignore-unused */ string $password): Users
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$where = ['email' => $email];
$this->find(['*'], $where);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.