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

落花浮王杯 提交于 2019-12-14 01:12:02

问题


I Write this code in my PHP file :

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 :

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


回答1:


You have a space at the end of your line. :)

It expects the line to end in ( but it ends in [space].



来源:https://stackoverflow.com/questions/22131095/opening-parenthesis-of-a-multi-line-function-call-must-be-the-last-content-on-th

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!