Note that there are some explanatory texts on larger screens.

plurals
  1. PODocumentation of PHP methods in the abstract class
    primarykey
    data
    text
    <p>Is it possible to make a method documentation on the abstract method and whoever extends it inhered the documentation also? Example:</p> <pre><code>&lt;?php abstract class Math{ /** * Method that receive two values and return the result of some operation. * @param $a Number * @param $b Number */ abstract public function values($a, $b); } ?&gt; &lt;?php class Sum extends Math{ /** * @return $a+$b; */ public function values($a, $b){ return $a+$b; } } ?&gt; &lt;?php class Divide extends Math{ /** * @return $a/$b; * @throws Exception. */ public function values($a, $b){ if($b != 0){ return $a/$b; }else{ throw new Exception("Impossible to divide by 0."); } } } ?&gt; </code></pre> <p>How do I put all those informations about the method together? Currently, I work with Netbeans 7.1. Is it a IDE issue? Or is it just not how this works?</p> <pre><code>&lt;?php // Estabele conexão com o MySQL $connect = mysql_connect('localhost', 'root', '123456') or die('A conexão falhou.'); // Seleciona o banco de dados $database = mysql_select_db('monografia', $connect) or die('Falha ao tentar selecionar banco de dados.'); if ($database) echo 'Conectado atraves do driver nativo.'; ?&gt; &lt;br /&gt; &lt;?php class Conexao { protected $conexao; public function Conexao() { $this-&gt;conexao = new MySQLi('localhost', 'root', '123456', 'monografia', 3306); if (!$this-&gt;conexao-&gt;connect_error) echo 'Conectado atraves da extensao MySQLi.'; } } new Conexao(); ?&gt; &lt;br /&gt; &lt;?php class ConexaoPDO { protected $pdo; public function ConexaoPDO() { try { $this-&gt;pdo = new PDO('mysql:host=localhost:3306;dbname=monografia', 'root', '123456', array(PDO::ATTR_ERRMODE =&gt; PDO::ERRMODE_EXCEPTION)); echo 'Conectado atraves do PDO.'; } catch(PDOException $e) { echo $e-&gt;getMessage(); } } } new ConexaoPDO(); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload