ReviewsApi
in package
Table of Contents
Constants
- REVIEWS_APP_API_POSSIBLE_PATH_PARAMS = ['getReviewsBySource' => 'domain', 'filterByStars' => 'stars']
- API path parameters for different endpoints
Properties
- $getReviewsApi : string
- $reviewsAppDomain : string
- $token : string
- $logService : LogService
Methods
- __construct() : mixed
- filterByStars() : array<string|int, mixed>|null
- Filter reviews by star rating
- getReviewsBySource() : array<string|int, mixed>|null
- Get reviews by source with proper authentication
- logMessage() : mixed
- Helper method to log messages using the available LogService methods
Constants
REVIEWS_APP_API_POSSIBLE_PATH_PARAMS
API path parameters for different endpoints
public
mixed
REVIEWS_APP_API_POSSIBLE_PATH_PARAMS
= ['getReviewsBySource' => 'domain', 'filterByStars' => 'stars']
Properties
$getReviewsApi
protected
string
$getReviewsApi
$reviewsAppDomain
protected
string
$reviewsAppDomain
$token
protected
string
$token
$logService
private
LogService
$logService
Methods
__construct()
public
__construct(ContainerInterface $container, LogService $logService) : mixed
Parameters
- $container : ContainerInterface
- $logService : LogService
filterByStars()
Filter reviews by star rating
public
filterByStars(string $source, int $stars) : array<string|int, mixed>|null
Parameters
- $source : string
-
The source domain
- $stars : int
-
Number of stars to filter by (1-5)
Return values
array<string|int, mixed>|null —The filtered reviews
getReviewsBySource()
Get reviews by source with proper authentication
public
getReviewsBySource(string $source[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>|null
Parameters
- $source : string
-
The source domain to get reviews from
- $params : array<string|int, mixed> = []
-
Additional query parameters
Return values
array<string|int, mixed>|null —The parsed JSON response or null on error
logMessage()
Helper method to log messages using the available LogService methods
private
logMessage(string $message[, string $level = 'info' ]) : mixed
Parameters
- $message : string
-
The message to log
- $level : string = 'info'
-
The log level (error, info, etc.)