mirror of
https://github.com/openvk/openvk
synced 2025-03-14 13:35:33 +03:00
* feat: add phpstan for static analysis * ci(actions): add phpstan action * ci(actions): do analysing inside docker container * fix(FetchToncoinTransactions): add var declaration * fix(ServiceAPI/Wall): add var declaration * fix(bootstrap): remove case-insensitive false vars * fix(VKAPI/Handlers/Board): change parameters order * fix(VKAPIRequestHandler): set fail's return type as never * fix(VKAPI/Handlers/Groups): add array declaration * fix(VKAPI/Handlers/Newsfeed): add return_banned declaration * fix(VKAPI/Handlers/Notes): move $nodez declaration up * fix(phpstan): most of the things and stupid lines of code * fix(lint) * fix(phpstan): less errors * fix(lint): again. cuz i forgot about it * fix(stan): all errors are gone now =3 --------- Co-authored-by: veselcraft <veselcraft@icloud.com>
26 lines
574 B
PHP
26 lines
574 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace openvk\Web\Presenters;
|
|
|
|
use openvk\Web\Models\Repositories\ContentSearchRepository;
|
|
|
|
final class ContentSearchPresenter extends OpenVKPresenter
|
|
{
|
|
protected $repo;
|
|
|
|
public function __construct(ContentSearchRepository $repository)
|
|
{
|
|
$this->repo = $repository;
|
|
}
|
|
|
|
public function renderIndex(): void
|
|
{
|
|
if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
|
$this->template->results = $this->repo->find([
|
|
"query" => $this->postParam("query"),
|
|
]);
|
|
}
|
|
}
|
|
}
|