PhpStorm – List files with Warnings on specific php version
I have a bigger PHP project and it runs on production server with PHP 8.1.
To check the compatibility with 8.2 I switch to version 8.2 in PhpStorm.
PhpStorm inspections on __call magic methods without knowing the name of the dynamic functions
The short version of this is, I want phpstorm to know the datatype returned by a dynamic function call that is handled by __call. There is no way to know the name of the dynamic functions reasonably because __call is in my code, a “framework” of sorts, and the dynamic function names are created at runtime by developers using my class. My class will not have access to those names so adding @method wont work. I understand the other developers can add their own annotations, but my question is how to do this without requiring them to do that.
A php script I wrote to produce a CSV file is giving an error – PHP Fatal error: fputcsv(): Argument #2 ($fields) must be of type array
<?php use someapiconnectionPersons; try { require_once(‘autoload.php’); $PersonsAPI = new Persons(); $data = $PersonsAPI->get(); if (!empty($data)) { header(‘Content-Type: text/csv’); header(‘Content-Disposition: attachment;filename=offline_persons.csv’); $fp = fopen(‘php://output’, ‘wb’); fputcsv($fp, array_keys($data)); foreach ($data as $line) { $val = explode(“,”,$line); fputcsv($fp, $line); } fclose($fp); } else { echo “No data found”; } } catch (Exception $e) { echo “Error fetching data: […]
How do you use @deprecated on a script file using PHPStorm?
Currently you can use the @deprecated
namespace in classes, but how do i get my files to show a strikethrough for script files that aren’t attached to a class at all?