Add PHPDocs and fix undefined constant