KS5005
A value is the wrong type for what is done with it. For example ->upper() on a number. Convert it first: $n->to_string()->upper().
A callback parameter declared action: fn needs a function. Passing action: null produces an error on the argument. Pass a reference such as action: @on_connect or a lambda such as action: fn(session) => @read_status($session). In a script function, action: fn? = null explicitly accepts a missing or null callback.
The same code warns about arithmetic and arguments that can only fail when the script runs:
<let name="name" value="'Joan'" />
<let name="total" value="$name - 1" /> <!-- warning: '-' needs a number here, but $name holds the text 'Joan' -->
<set name="total" value="[1, 2] + 3" /> <!-- warning: + joins two lists. Use ->push(3) -->
<echo value="'ab'->repeat('x')" /> <!-- warning: the 'count' argument needs a number -->$name = 'Joan'
$total = $name - 1 // warning: '-' needs a number here, but $name holds the text 'Joan'
$total = [1, 2] + 3 // warning: + joins two lists. Use ->push(3)
echo 'ab'->repeat('x') // warning: the 'count' argument needs a numberText that reads as a number is converted ('5' - 1 is 4), + joins text and 'ab' * 3 repeats it, so none of those warn. The check only speaks up when the value is certain: text written in the code, or a variable that only ever holds it.