for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PHPSemVerChecker\Operation;
use PhpParser\Node\Stmt\Trait_;
use PHPSemVerChecker\Node\Statement\Trait_ as PTrait;
class TraitAdded extends Operation {
/**
* @var string
*/
protected $code = 'V046';
protected $reason = 'Trait was added.';
protected $fileAfter;
* @var \PhpParser\Node\Stmt\Trait_
protected $traitAfter;
* @param string $fileAfter
* @param \PhpParser\Node\Stmt\Trait_ $traitAfter
public function __construct($fileAfter, Trait_ $traitAfter)
{
$this->fileAfter = $fileAfter;
$this->traitAfter = $traitAfter;
}
* @return string
public function getLocation()
return $this->fileAfter;
* @return int
public function getLine()
return $this->traitAfter->getLine();
public function getTarget()
return PTrait::getFullyQualifiedName($this->traitAfter);