gpt4 book ai didi

php - Symfony 编码标准在类型转换后是否需要保留空间?

转载 作者:可可西里 更新时间:2023-10-31 22:52:01 25 4
gpt4 key购买 nike

我在 the official documentation 中找不到答案.所以 PHP 代码嗅探器说它是必需的(编码标准包 escapestudios/symfony2-coding-standard)。

示例应该是:

$result = (bool) foo();

反之亦然:

$result = (bool)foo();

最佳答案

是的,it is :

enter image description here

如何应用?

  • 在 CodeSniffer 中,您正在寻找 PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff

  • 在 PHP-CS-Fixer 中,它将是 PhpCsFixer\Fixer\CastNotation\CastSpacesFixer

enter image description here

这里使用的工具是EasyCodingStandard - 你可以read intro post about it .

关于php - Symfony 编码标准在类型转换后是否需要保留空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38953635/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com