1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-19 03:54:42 +01:00
psalm/src/Psalm/FunctionLikeParameter.php

80 lines
1.4 KiB
PHP
Raw Normal View History

<?php
namespace Psalm;
class FunctionLikeParameter
{
2016-11-02 02:29:00 -04:00
/**
* @var string
*/
public $name;
2016-11-02 02:29:00 -04:00
/**
* @var bool
*/
public $by_ref;
2016-11-02 02:29:00 -04:00
/**
* @var Type\Union
*/
public $type;
2016-11-02 02:29:00 -04:00
/**
* @var Type\Union
*/
public $signature_type;
2016-11-02 02:29:00 -04:00
/**
* @var bool
*/
public $is_optional;
2016-11-02 02:29:00 -04:00
/**
* @var bool
*/
public $is_nullable;
2016-11-02 02:29:00 -04:00
/**
* @var CodeLocation|null
2016-11-02 02:29:00 -04:00
*/
2017-03-01 18:36:04 -05:00
public $location;
/**
* @var CodeLocation|null
*/
public $signature_location;
2016-10-15 00:12:57 -04:00
2016-11-02 02:29:00 -04:00
/**
* @var bool
*/
2016-10-23 01:57:11 -04:00
public $is_variadic;
2016-10-15 00:12:57 -04:00
/**
* @param string $name
* @param boolean $by_ref
* @param Type\Union $type
2017-03-01 18:36:04 -05:00
* @param CodeLocation $location
2016-10-15 00:12:57 -04:00
* @param boolean $is_optional
* @param boolean $is_nullable
* @param boolean $is_variadic
2016-10-15 00:12:57 -04:00
*/
2016-11-02 02:29:00 -04:00
public function __construct(
$name,
$by_ref,
Type\Union $type,
2017-03-01 18:36:04 -05:00
CodeLocation $location = null,
2016-11-02 02:29:00 -04:00
$is_optional = true,
$is_nullable = false,
$is_variadic = false
) {
$this->name = $name;
$this->by_ref = $by_ref;
$this->type = $type;
$this->signature_type = $type;
$this->is_optional = $is_optional;
$this->is_nullable = $is_nullable;
$this->is_variadic = $is_variadic;
2017-03-01 18:36:04 -05:00
$this->location = $location;
$this->signature_location = $location;
}
}