Lines Matching refs:note
51 private function calcVotePriority(UserNote $note):float { argument
52 return ($note->upvotes - $note->downvotes - $this->minVote) * $this->voteFactor + .3;
55 private function calcRatingPriority(UserNote $note):float { argument
56 return $note->upvotes + $note->downvotes <= 2 ? 0.5 : $this->calcRating($note);
59 private function calcRating(UserNote $note):float { argument
60 $totalVotes = $note->upvotes + $note->downvotes;
61 return $totalVotes > 0 ? $note->upvotes / $totalVotes : .5;
69 foreach ($notes as $note) {
70 $prio[$note->id] = ($this->calcVotePriority($note) * $this->voteWeight)
71 + ($this->calcRatingPriority($note) * $this->ratingWeight)
72 + (($note->ts - $this->minAge) * $this->ageFactor);
90 foreach ($notes as $note) {
91 $this->maxVote = max($this->maxVote, ($note->upvotes - $note->downvotes));
92 $this->minVote = min($this->minVote, ($note->upvotes - $note->downvotes));
93 $this->maxAge = max($this->maxAge, $note->ts);
94 $this->minAge = min($this->minAge, $note->ts);