for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Groundskeeper\Tokens;
use Groundskeeper\Configuration;
class DocType extends AbstractValuedToken
{
/**
* Constructor
*/
public function __construct(Token $parent = null, $value = null)
parent::__construct(Token::DOCTYPE, $parent, $value);
}
public function validate(Configuration $configuration)
parent::validate($configuration);
if ($this->isValid === true) {
$this->isValid = $this->getParent() === null;
$isValid
integer
$this->getParent() === null
boolean
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;
public function toString(Configuration $configuration, $prefix = '', $suffix = '')
if (!$this->isValid) {
return '';
return $prefix . '<!DOCTYPE ' . $this->getValue() . '>' . $suffix;
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.