有没有办法记录某个类对另一个类中定义的每个方法都有魔术方法?
我正在使用 PhpStorm,所以我会对任何可以让自动完成功能正常工作的解决方案感到满意。
class A
{
// a bunch of functions go here...
}
/**
* Class B
* What should go here to make it work???
*/
class B
{
private $aInstance;
public function __construct() {
$this->aInstance = new A();
}
public function __call($name, $arguments) {
// TODO: Implement __call() method.
if(method_exists($this->aInstance, $name)) {
return $this->aInstance->{$name}(...$arguments);
}
throw new BadMethodCallException();
}
// a bunch more functions go here...
}
Run Code Online (Sandbox Code Playgroud) 我的眼球因亮度而流血有没有办法在 JetBrains (IntelliJ IDEA、PhpStorm、WebStorm、PyCharm、Android Studio)中获得一个看起来不错或需要数小时配置的黑暗主题?
我下载了一个主题,但是当我尝试将其导入 JetBrains 时,我收到一条错误消息
“导入失败:主题不是有效的方案”
当前主题
提前致谢。
我正在编辑一些 3rd 方代码(Shopify 主题),但代码绝对不可读。
理想情况下,我希望能够自动格式化.liquid-files,但似乎无法做到。
我在 PhpStorm 中的尝试
我试过在 PhpStorm 中插入代码并按下CMD + Option + l(在执行此操作后),这会执行某些操作,但会在随机位置生成换行符,如下所示:
{% unless current_tags %}<h1
class="text-center text-uppercase title-under">{{ 'blogs.general.title_main' | t }}</h1>{% else %}<h1
Run Code Online (Sandbox Code Playgroud)
我在 Atom 中的尝试
在 Atom 中,我尝试安装atom-beautify,但无法识别文件类型。我可以看到其他人也有我的问题。由于.liquid有相当多的份额.blade.php的话,我想看看是否有该格式,这导致了一个解决方案开放的线程也。
我尝试研究添加对新语言的支持(使用 atom-beautify),但它非常耗时。
这有点接近了。但是如果我有一个完整的 Shopify 主题,在将代码移动到我的编辑器之前将代码复制到该网站仍然很麻烦。如果PrettyDiff可以绝对钉自动格式化,那么,我就会住它, -但它仍然是这样的:
{% if settings.show_blog_sidebar %}
<div class="col-xl-8 col-lg-8 col-md-12" id="centerColumn">
{% endif %}
Run Code Online (Sandbox Code Playgroud)
我想达到的目标
为了制造这个废话: …
我正在努力使代码接收与 PhpStorm 一起工作。
我已经设置了 CLI 解释器:
我还设置了 Codeception:
这是 Codeception 的配置:
当我从 PhpStorm 运行测试时,我收到以下信息:
在左边:
和右边的文字:
Testing started at 00:06 ...
/Applications/MAMP/bin/php/php7.2.1/bin/php /private/var/folders/3g/xng_tnzj6797frqqk20r69mw0000gn/T/ide-codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-ansi --no-interaction unit
Process finished with exit code 255
Run Code Online (Sandbox Code Playgroud)
但是当我concept run在终端上的项目文件夹中运行时,它工作正常,我收到了这个:
我究竟做错了什么?我真的在这里阅读了 PhpStorm 的手册和 youtube视频,但我无法让它工作:/
谢谢!
在进一步的调查中,我发现了以下内容:
$ /usr/bin/env php --version
PHP 7.2.1 (cli) (built: Jan 15 2018 12:20:50) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend …Run Code Online (Sandbox Code Playgroud) 我们有很多路线,例如:
Route::get('/','WebController@index');
Run Code Online (Sandbox Code Playgroud)
当我想跳转到函数时,我必须:
WebController index()是否可以一步从路由定义跳转到函数?
我曾经在 PhpStorm 中获取任何未使用的常量或类常量的突出显示。
现在我不能让它再工作了。也许这是一个插件,我不确定。
我试过的:
未使用的常量的声明/突出显示用于自动显示而无需运行任何检查或命令。
为什么我无法在 PhpStorm 中保存数据?
发生了:
“无法保存设置:无法保存设置。请重新启动 PhpStorm”。
我刚刚安装了 PhpStorm 2020.2,注意到所有 php 基类,如 Closure 或 mysqli 都没有被 IDE 识别。
查看左侧 PHP 基本文件所在的位置,它只显示文件夹,就像您在第一张图片中看到的那样,另一方面,我的旧版 PhpStorm 2017 包含其中包含文件的文件夹,无法识别所有 php 基类
将 Xdebug 版本3与 PhpStorm 版本2020.2.4一起使用时出现此错误:
Connection was not established.
Cannot start debugger session with 'Xdebug 3.0.0' Validate installation
Run Code Online (Sandbox Code Playgroud)
php.ini 配置:
Connection was not established.
Cannot start debugger session with 'Xdebug 3.0.0' Validate installation
Run Code Online (Sandbox Code Playgroud)