laravel-ide-helper
laravel-ide-helper copied to clipboard
Improve formatting, readability and size of generated files.
Versions:
- ide-helper Version: v2.12.3
- Laravel Version: v9.34.0
- PHP Version: 8.1.11
Summary:
The generated _ide_helper.php file has inconsistent indentation among other things that both reduce readability and increase filesize. I would like to recommend enabling the rendering of whitespaces when working on this enhancement.
Examples from the generated _ide_helper.php file:
line 15 t/m 32
namespace Illuminate\Support\Facades {
/**
*
*
* @see \Illuminate\Contracts\Foundation\Application
*/
class App {
/**
* Get the version number of the application.
*
* @return string
* @static
*/
public static function version()
{
/** @var \Illuminate\Foundation\Application $instance */
return $instance->version();
}
Line 15031 t/m 15033
public static function prepend($path, $data, $separator = '
')
{
Line 17217 t/m 17240
namespace Illuminate\Support {
/**
*
*
*/
class Arr {
}
/**
*
*
*/
class Js {
}
/**
*
*
*/
class Str {
}
}
Potential improvements:
- Ensure proper indentation
- Render special characters in parameters as an escaped character (
' '->"\t") or their predefined constant. (PHP_EOL) - Remove empty docblocks
- Prune trailing whitespaces
- Convert spaces to tabs
- Remove the
@statictag as the functions themselves are already marked in their definition as apublic static function - Remove double spaces in, and spaces that can interfere with, definitions (
@param \Illuminate\Foundation\(callable(string, string, ?array, ?array): array)|array $attributesis incorrectly proccessed as type\Illuminate\Foundation\ (callable(string,with commentstring, ?array, ?array): array)|array $attributes)