Run Rector on your code to see what it can do for you:

             return 'Todo not found';
         }
   
-        if (!array_key_exists($this->todos[$index]['unique_key'], $this->selectedTodos)) {
+        if (!array_key_exists((string) $this->todos[$index]['unique_key'], $this->selectedTodos)) {
             $this->selectedTodos[$this->todos[$index]['unique_key']] = $this->todos[$index]['label'];
             return 'Todo selected !';
         }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 40d87a - released at 2025-12-24 10:28