Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/Search/Torrent/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Gazelle\Search\Torrent;

use Gazelle\User;

class Report extends \Gazelle\Base {
protected string $orderBy;
protected string $title;
Expand Down Expand Up @@ -95,17 +97,19 @@ protected function configure(): void {
}
}

public function setReporterId(int $reporterId): void {
public function setReporter(User $reporter): static {
$this->configure();
$this->cond[] = "r.ReporterID = ?";
$this->args[] = $reporterId;
$this->args[] = $reporter->id;
return $this;
}

public function setOrderBy(string $orderBy): void {
public function setOrderBy(string $orderBy): static {
$this->orderBy = "ORDER BY $orderBy";
return $this;
}

public function canUnclaim(\Gazelle\User $user): bool {
public function canUnclaim(User $user): bool {
return $this->mode === 'staff' && $user->id === (int)$this->id;
}

Expand Down
8 changes: 4 additions & 4 deletions app/User/Friend.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public function isMutual(\Gazelle\User $friend): bool {
}

public function add(\Gazelle\User $friend): int {
if ($this->user->id === $friend->id()) {
if ($this->user->id === $friend->id) {
return -1;
}
self::$db->prepared_query("
INSERT IGNORE INTO friends
(UserID, FriendID)
VALUES (?, ?)
", $this->user->id, $friend->id()
", $this->user->id, $friend->id
);
return self::$db->affected_rows();
}
Expand All @@ -50,7 +50,7 @@ public function addComment(\Gazelle\User $friend, string $comment): int {
Comment = ?
WHERE UserID = ?
AND FriendID = ?
", $comment, $this->user->id, $friend->id()
", $comment, $this->user->id, $friend->id
);
return self::$db->affected_rows();
}
Expand All @@ -60,7 +60,7 @@ public function removeFriend(\Gazelle\User $friend): int {
DELETE FROM friends
WHERE UserID = ?
AND FriendID = ?
", $this->user->id, $friend->id()
", $this->user->id, $friend->id
);
return self::$db->affected_rows();
}
Expand Down
2 changes: 1 addition & 1 deletion app/User/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function lastActive(?string $sessionKey): ?array {
$info = $this->info();
if (count($info) > 1) {
foreach ($info as $id => $session) {
if ($id != $sessionKey) {
if ($id !== $sessionKey) {
return $session;
}
}
Expand Down
58 changes: 3 additions & 55 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading