Update repository base code to be cleaner and make use of PHP 7 features
This commit is contained in:
parent
0ec5a4e08c
commit
60eb60013c
96 changed files with 1048 additions and 1785 deletions
|
@ -34,6 +34,7 @@ class DaemonAuthenticate
|
|||
* Create a new filter instance.
|
||||
*
|
||||
* @param \Pterodactyl\Contracts\Repository\NodeRepositoryInterface $repository
|
||||
* @deprecated
|
||||
*/
|
||||
public function __construct(NodeRepositoryInterface $repository)
|
||||
{
|
||||
|
@ -47,6 +48,7 @@ class DaemonAuthenticate
|
|||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
|
@ -59,7 +61,7 @@ class DaemonAuthenticate
|
|||
throw new AccessDeniedHttpException;
|
||||
}
|
||||
|
||||
$node = $this->repository->findWhere(['daemonSecret' => $request->header('X-Access-Node')]);
|
||||
$node = $this->repository->findFirstWhere(['daemonSecret' => $request->header('X-Access-Node')]);
|
||||
$request->attributes->set('node', $node);
|
||||
|
||||
return $next($request);
|
||||
|
|
Reference in a new issue