How to suppress (or fix) Intellij object function call warnings of objects that were declared in constructors
<p>I am using php and sql in Intellij, and I have about 30 warnings mostly pertaining to my functions that correspond to PDO object calls not being found. I do not understand why I am getting the warning: "Referenced method is not found in subject class". </p>

<p>It says that the method is not found in the subject class, which is understandable since the constructor needs to be called for the variable to be declared. It just seems that the intellij interpreter does not realize that the constructor declares this.</p>

<p>I do have an sql dialect set up and working, and a data source. These eliminated several warnings. </p>

<p>For example:</p>

<pre><code>public $conn;

function __construct(){

    try {
        global $conn;
        $conn = new PDO($dsn, $username, $password);
        //echo "Test";

    }
}

function project_load(){
    global $conn;
    try {
        $sth = $conn-&gt;prepare("SELECT `id`, `FROM projects");
    }
}
</code></pre>

<p>For example the prepare statement is highlighted with the warning. This code works perfectly, but the warnings are annoying and may cause issues in the future. Should I go and manually suppress them or are they solvable? Is this an issue with how intellij settings are set or is there an actual way to code this to avoid these warnings? Is it possible that this is a language issue? I believe Java handles this far better since it is natively object oriented. </p>