/** * @param string $algorithm * @param string $salt */ public function __construct($algorithm = 'HS256', $salt = null) { if (is_null($salt)) { $salt = Local::get()->getSecurity()->getSalt(); } $this->setAlgorithm($algorithm)->setSalt($salt); }
/** * @return Pdo */ public function getDatabase() { return Local::get()->getDatabase()->getTestInstance(); }
<?php ini_set('display_errors', true); error_reporting(E_ALL); include __DIR__ . "/../../vendor/autoload.php"; (new \Phalcon\DI\FactoryDefault())->set('db', function () { return \PhRest\Config\Local::get()->getDatabase()->getTestInstance(); });