1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 10:38:49 +01:00
psalm/src/Psalm/Aliases.php
Daniil Gentili d0be59e16e
Immutable unions (#8627)
* Immutable CodeLocation

* Remove excess clones

* Remove external clones

* Remove leftover clones

* Fix final clone issue

* Immutable storages

* Refactoring

* Fixes

* Fixes

* Fix

* Fix

* Fixes

* Simplify

* Fixes

* Fix

* Fixes

* Update

* Fix

* Cache global types

* Fix

* Update

* Update

* Fixes

* Fixes

* Refactor

* Fixes

* Fix

* Fix

* More caching

* Fix

* Fix

* Update

* Update

* Fix

* Fixes

* Update

* Refactor

* Update

* Fixes

* Break one more test

* Fix

* FIx

* Fix

* Fix

* Fix

* Fix

* Improve performance and readability

* Equivalent logic

* Fixes

* Revert

* Revert "Revert"

This reverts commit f9175100c8452c80559234200663fd4c4f4dd889.

* Fix

* Fix reference bug

* Make default TypeVisitor immutable

* Bugfix

* Remove clones

* Partial refactoring

* Refactoring

* Fixes

* Fix

* Fixes

* Fixes

* cs-fix

* Fix final bugs

* Add test

* Misc fixes

* Update

* Fixes

* Experiment with removing different property

* revert "Experiment with removing different property"

This reverts commit ac1156e077fc4ea633530d51096d27b6e88bfdf9.

* Uniform naming

* Uniform naming

* Hack hotfix

* Clean up $_FILES ref #8621

* Undo hack, try fixing properly

* Helper method

* Remove redundant call

* Partially fix bugs

* Cleanup

* Change defaults

* Fix bug

* Fix (?, hope this doesn't break anything else)

* cs-fix

* Review fixes

* Bugfix

* Bugfix

* Improve logic

* Update
2022-11-04 19:04:23 +01:00

78 lines
1.7 KiB
PHP

<?php
namespace Psalm;
final class Aliases
{
/**
* @var array<lowercase-string, string>
*/
public $uses;
/**
* @var array<lowercase-string, string>
*/
public $uses_flipped;
/**
* @var array<lowercase-string, non-empty-string>
*/
public $functions;
/**
* @var array<lowercase-string, string>
*/
public $functions_flipped;
/**
* @var array<string, string>
*/
public $constants;
/**
* @var array<string, string>
*/
public $constants_flipped;
/** @var string|null */
public $namespace;
/** @var ?int */
public $namespace_first_stmt_start;
/** @var ?int */
public $uses_start;
/** @var ?int */
public $uses_end;
/**
* @param array<lowercase-string, string> $uses
* @param array<lowercase-string, non-empty-string> $functions
* @param array<string, string> $constants
* @param array<lowercase-string, string> $uses_flipped
* @param array<lowercase-string, string> $functions_flipped
* @param array<string, string> $constants_flipped
* @internal
*
* @psalm-mutation-free
*/
public function __construct(
?string $namespace = null,
array $uses = [],
array $functions = [],
array $constants = [],
array $uses_flipped = [],
array $functions_flipped = [],
array $constants_flipped = []
) {
$this->namespace = $namespace;
$this->uses = $uses;
$this->functions = $functions;
$this->constants = $constants;
$this->uses_flipped = $uses_flipped;
$this->functions_flipped = $functions_flipped;
$this->constants_flipped = $constants_flipped;
}
}