1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-10 06:58:41 +01:00
psalm/src/Psalm/Issue/MixedAssignment.php

35 lines
784 B
PHP
Raw Normal View History

<?php
namespace Psalm\Issue;
2021-03-17 06:10:42 +01:00
use Psalm\CodeLocation;
class MixedAssignment extends CodeIssue
{
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()
: '');
}
}