简体   繁体   English

多行函数调用的左括号必须是该行的最后一个内容

[英]Opening parenthesis of a multi-line function call must be the last content on the line

I Write this code in my PHP file : 我在我的PHP文件中写下这段代码:

public function ScriptsStyles()
    {
        wp_enqueue_style( 
            'fontawesome', 
            plugins_url("/css/font-awesome.css", __FILE__), 
            array(),
            'null' 
        );

        wp_enqueue_style( 
            'base', 
            plugins_url("/css/base.css", __FILE__), 
            array('fontawesome'), 
            'null' 
        );

        wp_enqueue_script(
            'main', 
            plugins_url("/js/main.js", __FILE__), 
            array('test') 
        );

        wp_enqueue_script(
            'test', 
            plugins_url("/js/test.js", __FILE__), 
            array('jquery') 
        );

    }

And when I checked it, using PHP Code Sniffer I get this Errors : 当我检查它时,使用PHP Code Sniffer我得到了这个错误:

Opening parenthesis of a multi-line function call must be the last content on the line 多行函数调用的左括号必须是该行的最后一个内容

those errors comes from this lines: 这些错误来自这条线:

    wp_enqueue_style( 
                    'fontawesome', 
                    plugins_url("/css/font-awesome.css", __FILE__), 
                    array(),
                    'null' 
                );

  wp_enqueue_style( 
                    'base', 
                    plugins_url("/css/base.css", __FILE__), 
                    array('fontawesome'), 
                    'null' 
                );

How to fix that ? 如何解决? And thanks 谢谢

You have a space at the end of your line. 你的行尾有一个空格。 :) :)

It expects the line to end in ( but it ends in [space] . 它期望该行结束(但它以[space]结尾。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM