Skip to content

Commit

Permalink
style(Db,Search,Service): Fix the php files style
Browse files Browse the repository at this point in the history
I ran "yarn fix".

Signed-off-by: Baptiste Fotia <fotia.baptiste@hotmail.com>
  • Loading branch information
zak39 committed Apr 26, 2024
1 parent 18a4a4e commit a872bea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/Db/RoomMapper.php
Expand Up @@ -110,8 +110,8 @@ public function search(string $userId, string $query): array {
->from($this->tableName, 'r')
->where($qb->expr()->eq('r.user_id', $qb->createNamedParameter($userId)))
->andwhere($qb->expr()->ILike('name',
$qb->createNamedParameter('%' . $this->db->escapeLikeParameter($query) . '%', IQueryBuilder::PARAM_STR),
IQueryBuilder::PARAM_STR));
$qb->createNamedParameter('%' . $this->db->escapeLikeParameter($query) . '%', IQueryBuilder::PARAM_STR),
IQueryBuilder::PARAM_STR));

/** @var array<Room> */
return $this->findEntities($qb);
Expand Down
20 changes: 9 additions & 11 deletions lib/Search/Provider.php
Expand Up @@ -6,15 +6,13 @@

use OCA\BigBlueButton\AppInfo\Application;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Db\Room;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\Search\IProvider;
use OCP\Search\ISearchQuery;
use OCP\Search\SearchResult;
use OCP\Search\SearchResultEntry;
use function array_map;

class Provider implements IProvider {
/** @var RoomService */
Expand Down Expand Up @@ -42,14 +40,14 @@ public function getName(): string {

public function getOrder(string $route, array $routeParameters): int {
if (strpos($route, Application::ID . '.') === 0) {
return -1;
}
return -1;
}
return Application::ORDER;
}

private function getAccess(string $access): string {
switch ($access) {
case 'public':
case 'public':
$translatedAccess = $this->l10n->t('Public');
break;
case 'password':
Expand All @@ -71,15 +69,15 @@ private function getAccess(string $access): string {
return $translatedAccess;
}

public function search(IUser $user, ISearchQuery $query): SearchResult {
public function search(IUser $user, ISearchQuery $query): SearchResult {
$rooms = $this->service->search(
$user,
$query
);

$results = [];

foreach($rooms as $room) {
foreach ($rooms as $room) {
$results[] = new SearchResultEntry(
'',
$room->getName(),
Expand All @@ -89,9 +87,9 @@ public function search(IUser $user, ISearchQuery $query): SearchResult {
);
}

return SearchResult::complete(
return SearchResult::complete(
'BBB',
$results
$results
);
}
}
}
}
2 changes: 1 addition & 1 deletion lib/Service/RoomService.php
Expand Up @@ -14,8 +14,8 @@
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IUser;
use OCP\Security\ISecureRandom;
use OCP\Search\ISearchQuery;
use OCP\Security\ISecureRandom;

class RoomService {
/** @var RoomMapper */
Expand Down

0 comments on commit a872bea

Please sign in to comment.