for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace KriKrixs\object\beatmap;
class BeatMapStats
{
private object $stats;
/**
* Create a new BeatMapStats object
* @param object $stats
*/
public function __construct(object $stats)
$this->stats = $stats;
}
* Return raw data
* @return object
public function toJson(): object
return $this->stats;
* Return array data
* @return array
public function toArray(): array
return json_decode($this->stats, true);
$this->stats
object
string
$json
json_decode()
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
return json_decode(/** @scrutinizer ignore-type */ $this->stats, true);
* Get map plays number
* @return int
public function getPlaysNumber(): int
return $this->stats->plays;
* Get map download number
public function getDownloadsNumber(): int
return $this->stats->downloads;
* Get map upvotes number
public function getUpvotesNumber(): int
return $this->stats->upvotes;
* Get map downvotes number
public function getDownvotesNumber(): int
return $this->stats->downvotes;
* Get votes ratio
public function getVotesRatio(): float
return $this->stats->score;