1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 01:09:38 +01:00

replace list()

This commit is contained in:
orklah 2021-09-26 23:11:26 +02:00
parent 2315316b17
commit 9170b0af8f
4 changed files with 4 additions and 4 deletions

View File

@ -222,7 +222,7 @@ class FunctionCallReturnTypeFetcher
$fake_call_factory = new BuilderFactory();
if (strpos($proxy_call['fqn'], '::') !== false) {
list($fqcn, $method) = explode('::', $proxy_call['fqn']);
[$fqcn, $method] = explode('::', $proxy_call['fqn']);
$fake_call = $fake_call_factory->staticCall($fqcn, $method, $fake_call_arguments);
} else {
$fake_call = $fake_call_factory->funcCall($proxy_call['fqn'], $fake_call_arguments);

View File

@ -987,7 +987,7 @@ class FunctionLikeDocblockScanner
if (isset($flow_parts[0]) && \strpos(trim($flow_parts[0]), 'proxy') === 0) {
$proxy_call = trim(substr($flow_parts[0], strlen('proxy')));
list($fully_qualified_name, $source_param_string) = explode('(', $proxy_call, 2);
[$fully_qualified_name, $source_param_string] = explode('(', $proxy_call, 2);
if (!empty($fully_qualified_name) && !empty($source_param_string)) {
$source_params = preg_split('/, ?/', substr($source_param_string, 0, -1)) ?: [];

View File

@ -1240,7 +1240,7 @@ class AssertionReconciler extends \Psalm\Type\Reconciler
}
}
} elseif ($scalar_type === 'enum') {
list($fq_enum_name, $case_name) = explode('::', $value);
[$fq_enum_name, $case_name] = explode('::', $value);
if ($existing_var_type->hasMixed()) {
if ($is_loose_equality) {

View File

@ -462,7 +462,7 @@ class NegatedAssertionReconciler extends Reconciler
$scalar_var_type = Type::getFloat((float) $scalar_value);
}
} elseif ($scalar_type === 'enum') {
list($fq_enum_name, $case_name) = explode('::', substr($assertion, $bracket_pos + 1, -1));
[$fq_enum_name, $case_name] = explode('::', substr($assertion, $bracket_pos + 1, -1));
foreach ($existing_var_type->getAtomicTypes() as $atomic_key => $atomic_type) {
if (get_class($atomic_type) === Type\Atomic\TNamedObject::class