Jump to content

[SOLVED] OOP commenting


gevans

Recommended Posts

Hey guys,

 

I'm just writting some new classes, updating my old db script to mysqli, that sorta stuff. I'm about to go through and comment them all nicely for myself and other people that I share development jobs with. Is there an example somewhere of the 'correct syntax' for commenting in OOP?

 

I used to do something like this;

 

    /**
    * Connect to dbms and database
    * @param string c - main config array
    * @access public
    */
    public function __construct($C){
        $this->url = $C['URL'];
        $this->email = $C['ADMIN'];
        if(!$this->mysql = mysql_connect($C['DB']['HOST'],$C['DB']['USER'],$C['DB']['PASS'])) return $this->error('There was a problem loging in to the database.', mysql_errno($this->mysql).' - '.mysql_error($this->mysql));
        if(!$this->database = mysql_select_db($C['DB']['DB'], $this->mysql))return $this->error('There was a problem connecting to the database.', mysql_errno($this->mysql).' - '.mysql_error($this->mysql));
        return true;
    }

 

Just wanted to make sure I was sticking to some sort of standard.

Link to comment
https://forums.phpfreaks.com/topic/157475-solved-oop-commenting/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.