Home » Database » DB_DataObject » Bug #6016
Generated classes violate coding standart
Details
| Submitted | 2005-11-20 13:47 UTC |
|---|---|
| From | cckramer at gmail dot com |
| Status | Duplicate |
| Package | DB_DataObject |
| PHP Version | 5.1.0 |
| OS | Any |
| Roadmaps | (Not assigned) |
Comments
[2005-11-20 13:47 UTC] cckramer at gmail dot com
Description:
------------
Class produced by autogeneration script (createTables.php)
have no closing php tag ?> at the and of file. There is "<?php" in the beginnig of file, but no "?>" at the end of file.
While PHP scripts will work without closing tag, it's still violation of coding standarts and HTML standart.
If DB_Dataobject is part of PEAR, it should follow the coding standart of PEAR.
There is no mention in PEAR coding standarts that absence of php closing tag is allowed: http://pear.php.net/manual/en/standards.tags.php
At least please include option to generate closing tags for those who need it!
Expected result:
----------------
<?php
/**
* Table Definition for user
*/
require_once 'DB/DataObject.php';
class User extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'user'; // table name
public $user_id; // bigint(0) not_null primary_key unique_key auto_increment group_by
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('User',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}
?>
Actual result:
--------------
<?php
/**
* Table Definition for user
*/
require_once 'DB/DataObject.php';
class User extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'user'; // table name
public $user_id; // bigint(0) not_null primary_key unique_key auto_increment group_by
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('User',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}