Intellisense Not Picking Up Class Members
Posted: August 19th, 2012, 6:41 pm
The IntelliSense picks up my variable and function declarations within a project, but it doesn't display the class members after I type the -> operator.
Below is a simple class that I created in a blank project--that is, there are no other files or code that would create any interference. After declaring an instance of the TestMailMessage class into the $msg variable, I tried accessing that object's members with no success.
Within the class, the object members are displayed when using $this->
Below is a simple class that I created in a blank project--that is, there are no other files or code that would create any interference. After declaring an instance of the TestMailMessage class into the $msg variable, I tried accessing that object's members with no success.
- Code: Select all
<?php
/**
* TestMailMessage Class
*/
class TestMailMessage{
public $Sender;
private $Recipients;
public $ReplyTo;
public $Body;
public $Subject;
public $IsBodyHTML;
function __construct($from, $to, $body, $subject, $reply_to, $is_html = true){
$this->IsBodyHTML = $is_html;
$this->Recipients = array();
$this->Recipients[] = $to;
$this->ReplyTo = $reply_to;
$this->Sender = $from;
$this->Subject = $subject;
$this->Body = $body;
}
function AddRecipient($email_address){
$this->Recipients[] = $email_address;
}
function SendMessage(){
$result = 0;
$headers = "";
if(strlen($this->ReplyTo)){
$headers = "Reply-To: ".$this->ReplyTo."\r\n";
}
$headers .= "From: ".$this->Sender."\r\n";
if($this->IsBodyHTML){
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
}
else{
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
}
$headers .= "MIME-Version: 1.0\r\n";
//Currently, this function only supports a single recipient
if(strlen(trim($this->Recipients[0])) && strlen(trim($this->Sender))){
if(mail($this->Recipients[0], stripslashes($this->Subject), stripslashes($this->Body), $headers)){
$result = -1;
}
}
return $result;
}
}
$msg = new TestMailMessage("test@test.com", "test2@test.com", "", "", "");
//IntelliSense doesn't seem to work when typing $msg->
?>
Within the class, the object members are displayed when using $this->