NPM Build failing all of the sudden due to PHPCS sniff violation #466
|
All of the sudden my NPM Build is failing and the error it gives is for a line of code that has worked fine on several builds until now. Here is line 16 of the NavigationMain/functions.php: $data['menu'] = new Timber\Menu('navigation_main'); and below is the error message I am now getting. FILE: /data/Components/NavigationMain/functions.phpFOUND 1 ERROR AFFECTING 1 LINE16 | ERROR | [x] Parentheses must be used when instantiating a new I suppose I could disable the PHPCS or add a rule, but I am stumped as to why I am getting this error when it shouldn't be happening. Thoughts? Thanks, |
Replies: 1 comment
|
Hi @munts, do you use the current version of the functions.php of this component? Instead of should be: And then you should also add: You can find the full source code here: |
Hi @munts, do you use the current version of the functions.php of this component?
Instead of
$data['menu'] = new Timber\Menu('navigation_main');should be:
$data['menu'] = new Menu('navigation_main');And then you should also add:
use Timber\Menu;You can find the full source code here:
Components/NavigationMain/functions.php