When opening my development workspace that happens to have BackWPup in it (as it is a clone of a live site) I realized that VS Code is complaining about a use of $this in a static function in BackWPup. See the full error below:
{
"resource": "app/public/wp-content/plugins/backwpup/inc/class-job.php",
"owner": "_generated_diagnostic_collection_name_#0",
"code": "undefined",
"severity": 8,
"message": "$this can not be used in static methods.",
"source": "php",
"startLineNumber": 1165,
"startColumn": 5,
"endLineNumber": 1165,
"endColumn": 10
}
From my own experience I’m pretty sure that to fix this you need to make the log() function a static. Within static functions you simply cannot use $this, as those are two different scopes/modes of the code.
Anyhow, I thought that I’d mention this, in case it is a real problem that you want to fix.
When opening my development workspace that happens to have BackWPup in it (as it is a clone of a live site) I realized that VS Code is complaining about a use of
$this
in a static function in BackWPup. See the full error below:From my own experience I’m pretty sure that to fix this you need to make the
log()
function a static. Within static functions you simply cannot use$this
, as those are two different scopes/modes of the code.Anyhow, I thought that I’d mention this, in case it is a real problem that you want to fix.