The ratings service contained a PHP 4 style code. This change introduces a framework for processing the http-requests so we dont have to do it on our own. It'll also showcase how Instana is usable with modern PHP.
26 lines
377 B
PHP
26 lines
377 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Instana\RobotShop\Ratings\Service;
|
|
|
|
use PDO;
|
|
|
|
class HealthCheckService
|
|
{
|
|
/**
|
|
* @var PDO
|
|
*/
|
|
private $pdo;
|
|
|
|
public function __construct(PDO $pdo)
|
|
{
|
|
$this->pdo = $pdo;
|
|
}
|
|
|
|
public function checkConnectivity()
|
|
{
|
|
return $this->pdo->prepare('SELECT 1 + 1 FROM DUAL;')->execute();
|
|
}
|
|
}
|