You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue
When one writes PHP code, he/she shouldn't use php core keywords.
Take a look at those files- codeigniter4\framework\system\View\Filters.php (Line 114) public static function default codeigniter4\framework\system\View\View.php (Line 523) public function include codeigniter4\framework\system\CLI\CLI.php (Line 308) public static function print codeigniter4\framework\system\RESTful\ResourcePresenter.php (Line 107) public function new codeigniter4\framework\system\RESTful\ResourcePresenter.php (Line 104) public function new
CodeIgniter 4 version
Release: 4.0.3
Describe the bug
PHP has some reserved keywords like newdefaultincludeclass, array etc. If you use these reserved keywords it will make troubles to IDE parsers who has autocomplete features. So a developer avoids the conflicts at any cost.
Expected behavior, and steps to reproduce if appropriate
You can add underscore before function name like public static function default should be public static function _default
Context
PHP version [7.2]
The text was updated successfully, but these errors were encountered:
fujael
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
May 31, 2020
As of PHP 7.0.0 these keywords are allowed as property, constant, and method names of classes, interfaces and traits, except that class may not be used as constant name.
Taking that into consideration there is no problem with the code you reference.
The issue
When one writes PHP code, he/she shouldn't use php core keywords.
Take a look at those files-
codeigniter4\framework\system\View\Filters.php
(Line 114)public static function default
codeigniter4\framework\system\View\View.php
(Line 523)public function include
codeigniter4\framework\system\CLI\CLI.php
(Line 308)public static function print
codeigniter4\framework\system\RESTful\ResourcePresenter.php
(Line 107)public function new
codeigniter4\framework\system\RESTful\ResourcePresenter.php
(Line 104)public function new
CodeIgniter 4 version
Release: 4.0.3
Describe the bug
PHP has some reserved keywords like
new
default
include
class
,array
etc. If you use these reserved keywords it will make troubles to IDE parsers who has autocomplete features. So a developer avoids the conflicts at any cost.Affected module(s)
codeigniter4\framework\system\View\Filters.php
codeigniter4\framework\system\View\View.php
codeigniter4\framework\system\CLI\CLI.php
codeigniter4\framework\system\RESTful\ResourcePresenter.php
Expected behavior, and steps to reproduce if appropriate
You can add underscore before function name like
public static function default
should bepublic static function _default
Context
The text was updated successfully, but these errors were encountered: