for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Vanderlee\Comprehend\Parser\Structure;
use Vanderlee\Comprehend\Core\ArgumentsTrait;
use Vanderlee\Comprehend\Core\Context;
use Vanderlee\Comprehend\Parser\Parser;
/**
* Classes implementing this can scan.
*
* @author Martijn
*/
trait SpacingTrait
{
use ArgumentsTrait;
* Parser used for scanning the text.
* @var Parser
private $spacer = false;
private function pushSpacer(Context $context)
if ($this->spacer !== false) {
$this->spacer !== false
true
$context->pushSpacer($this->spacer);
}
private function popSpacer(Context $context)
$context->popSpacer();
* Set a spacing parser for this parser or disable or enable (if a previous
* spacing parser is enabled) spacing parsing.
* @param Parser|bool|null $spacer
* @return $this
public function spacing($spacer = true)
if ($spacer === true) {
$this->spacer = true;
Vanderlee\Comprehend\Parser\Parser
$spacer
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
} elseif ($spacer === null || $spacer === false) {
$spacer === false
$this->spacer = null;
} else {
$this->spacer = self::getArgument($spacer);
return $this;