I might not have a good understanding of this, but since the "username" variable is private. Shouldn't this not be a part of the return? How do I make it so the $username is private and not outputed, but the public member is?
class MyClass
{
private $username = "api";
public function create_issue()
{
$this->public = "Joe";
return $this;
}
}
$test = new MyClass();
$test->create_issue();
var_dump($test);
class MyClass#1 (2) {
private $username =>
string(3) "api"
public $public =>
string(3) "Joe"
}
var_dump. That thing just spits out all info it can and should be used for debugging or logging. Also, you can't directly access the private property so try doing it, like others have suggested.