{"id":1448,"date":"2018-01-19T19:22:51","date_gmt":"2018-01-19T19:22:51","guid":{"rendered":"http:\/\/goofy-trucks.flywheelsites.com\/how-to-document-your-php-classes\/"},"modified":"2018-01-19T19:24:47","modified_gmt":"2018-01-19T19:24:47","slug":"how-to-document-your-php-classes","status":"publish","type":"post","link":"https:\/\/phpbuilder.com\/how-to-document-your-php-classes\/","title":{"rendered":"How To Document Your PHP Classes"},"content":{"rendered":"<div class=\"phpbuilder-content\">\n<div class=\"phpbuilder-meta\">\n<div class=\"\">By Stefano Locati<\/div>\n<div class=\"\">on August 25, 2000<\/div>\n<\/p><\/div>\n<div id=\"overflow-content\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/phpbuilder.com\/wp-content\/uploads\/2018\/01\/stefano.jpg\" alt=\"picture of Stefano Locati\" class=\"articleAuthorImg\" height=\"117\" width=\"100\" align=\"left\"\/><\/p>\n<div class=\"articlePara\">\nSo you&#8217;ve read about how Object Oriented programming can help you with your<br \/>\nbig web projects and you&#8217;ve started it using with PHP? If you&#8217;ve already written a<br \/>\nhandful of classes to implement a site and you&#8217;re methodic, then you should have written<br \/>\nsome documentation about them. But If you&#8217;re just messy like me you&#8217;ve just written<br \/>\nsome comments within the classes&#8217; source and no other documentation.<br \/>\nWithout documentation it&#8217;s difficult to remember methods&#8217; names and the way<br \/>\nthey have to be used (parameters and meaning). The typical way to solve this<br \/>\nsituation is to have source code files open and to skim through hundreds or thousands of lines.<\/div>\n<h2>Javadoc Like Documentation<\/h2>\n<div class=\"articlePara\">\nThere must be a better way &#8212; if you are used to the Java language you<br \/>\nwill know the Javadoc documentation system. This tool allows you to<br \/>\ninsert tags within comments of your source files that are then parsed by<br \/>\nJavadoc tools in order to generate a set of HTML pages documenting your<br \/>\nclasses. So while you program you can keep your browser open and you&#8217;ll<br \/>\nhave a list of your classes and methods with descriptions. This will<br \/>\nbecome your reference to be more productive and fast while building your web application.<\/div>\n<div class=\"articlePara\">\nIn my opinion maintaining a documentation as a reference within source code<br \/>\nis easier and more practical than having to do it in a separated document<br \/>\nbecause in this way it&#8217;s easier to keep it updated. Otherwise it&#8217;s very<br \/>\neasy to become lazy and postpone updates in the documentation to a time that never comes. Instead with<br \/>\na tool like this there is the little burden to update a tag near the source code you&#8217;ve just modified<br \/>\nand to run the tool to generate again the updated html pages.<\/div>\n<\/div>\n<p><\/p>\n<div style=\"float: left; padding:15px; color:#17AAF3\">\n<div style=\"background-color:#B6E5FC; font-size:16px; margin-top:1px; padding:1px 4px 1px 4px; color:#000; font-style:bold; float:left;\">1<\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"stefano200008244658.html?page=2\">2<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"stefano200008249ba9.html?page=3\">3<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"stefano20000824fdb0.html?page=4\">4<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"stefano20000824af4d.html?page=5\">5<\/a> <\/div>\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"stefano200008244658.html?page=2\">Next Page \u00bb<\/a><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>By Stefano Locati on August 25, 2000 So you&#8217;ve read about how Object Oriented programming can help you with your big web projects and you&#8217;ve started it using with PHP? If you&#8217;ve already written a handful of classes to implement a site and you&#8217;re methodic, then you should have written&#8230; <a href=\"https:\/\/phpbuilder.com\/how-to-document-your-php-classes\/\" class=\"readmore\"><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1448","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/comments?post=1448"}],"version-history":[{"count":1,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1448\/revisions"}],"predecessor-version":[{"id":2236,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1448\/revisions\/2236"}],"wp:attachment":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/media?parent=1448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/categories?post=1448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/tags?post=1448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}