Skip to content

Commit

Permalink
strip_tags()/$allowed_tags can accept arrays since 7.4
Browse files Browse the repository at this point in the history
Fixes #4317
  • Loading branch information
weirdan committed Aug 17, 2023
1 parent 57f6359 commit 3244502
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Psalm/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2258,6 +2258,10 @@ public function visitStubFiles(Codebase $codebase, ?Progress $progress = null):
$stubsDir . 'SPL.phpstub',
];

if ($codebase->analysis_php_version_id >= 7_04_00) {
$this->internal_stubs[] = $stubsDir . 'Php74.phpstub';
}

if ($codebase->analysis_php_version_id >= 8_00_00) {
$this->internal_stubs[] = $stubsDir . 'CoreGenericAttributes.phpstub';
$this->internal_stubs[] = $stubsDir . 'Php80.phpstub';
Expand Down
11 changes: 11 additions & 0 deletions stubs/Php74.phpstub
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

/**
* @psalm-pure
*
* @psalm-taint-escape html
* @psalm-flow ($string) -> return
*
* @param null|string|array<array-key,string> $allowed_tags
*/
function strip_tags(string $string, null|string|array $allowed_tags = null) : string {}

0 comments on commit 3244502

Please sign in to comment.