2016-10-09 23:54:58 +02:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Issue;
|
|
|
|
|
2021-03-17 06:10:42 +01:00
|
|
|
use Psalm\CodeLocation;
|
|
|
|
|
2018-01-07 21:15:38 +01:00
|
|
|
class MixedAssignment extends CodeIssue
|
2016-10-09 23:54:58 +02:00
|
|
|
{
|
2020-09-20 18:54:46 +02:00
|
|
|
public const ERROR_LEVEL = 1;
|
|
|
|
public const SHORTCODE = 32;
|
2021-03-17 06:10:42 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var ?CodeLocation
|
|
|
|
* @readonly
|
|
|
|
*/
|
|
|
|
public $origin_location;
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
string $message,
|
|
|
|
CodeLocation $code_location,
|
|
|
|
?CodeLocation $origin_location = null
|
|
|
|
) {
|
|
|
|
$this->code_location = $code_location;
|
|
|
|
$this->message = $message;
|
|
|
|
$this->origin_location = $origin_location;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getMessage() : string
|
|
|
|
{
|
|
|
|
return $this->message
|
|
|
|
. ($this->origin_location
|
|
|
|
? ', derived from expression at ' . $this->origin_location->getShortSummary()
|
|
|
|
: '');
|
|
|
|
}
|
2016-10-09 23:54:58 +02:00
|
|
|
}
|