for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace BenTools\SimpleDBAL\Model;
use BenTools\SimpleDBAL\Contract\CredentialsInterface;
class Credentials implements CredentialsInterface
{
/**
* @var string
*/
private $hostname;
private $user;
private $password;
private $database;
private $platform;
private $port;
* Credentials constructor.
* @param string $hostname
* @param string $user
* @param string|null $password
* @param string|null $database
* @param string $platform
* @param int $port
public function __construct(string $hostname, string $user, string $password = null, string $database = null, string $platform = 'mysql', int $port = 3306)
$this->hostname = $hostname;
$this->user = $user;
$this->password = $password;
$this->database = $database;
$this->platform = $platform;
$this->port = $port;
$port
string
integer
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.
$answer = 42; $correct = false; $correct = (bool) $answer;
}
* @inheritdoc
public function getHostname(): string
return $this->hostname;
public function getUser(): string
return $this->user;
public function getPassword(): ?string
return $this->password;
public function getDatabase(): ?string
return $this->database;
public function getPlatform(): string
return $this->platform;
public function getPort(): int
return $this->port;
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.