Changeset c37741a


Ignore:
Timestamp:
12/07/11 21:42:41 (6 months ago)
Author:
mrook
Branches:
master
Children:
f47b545
Parents:
961ce15
git-author:
Michiel Rook <mrook@…> (12/07/11 21:42:41)
git-committer:
Michiel Rook <mrook@…> (12/07/11 21:42:41)
Message:

Fixes #709 - add a blurb about checking attribute values in setter methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/phing_guide/book/chapters/ExtendingPhing.html

    re547fab rc37741a  
    132132                <tbody> 
    133133                        <tr> 
    134                                 <td><p>bin</p> 
    135                                 </td> 
     134                                <td><p>bin</p></td> 
    136135                                <td> 
    137136                                        <p>The basic applications (phing, configure) as well as the 
    138137                                                wrapper scripts for different platforms (currently Unix and 
    139                                                 Windows).</p></td> 
     138                                                Windows).</p> 
     139                                </td> 
    140140                        </tr> 
    141141                        <tr> 
    142                                 <td><p>classes</p> 
    143                                 </td> 
     142                                <td><p>classes</p></td> 
    144143                                <td><p>Repository of all the classes used by Phing. This is 
    145144                                                the base directory that should be on the PHP include_path. In this 
    146145                                                directory you will find the subdirectory phing/ with all the Phing 
    147                                                 relevant classes.</p> 
     146                                                relevant classes.</p></td> 
     147                        </tr> 
     148                        <tr> 
     149                                <td><p>docs</p></td> 
     150                                <td> 
     151                                        <p>Documentation files. Generated books, online manuals as well 
     152                                                as the PHPDoc generated API documentation.</p> 
    148153                                </td> 
    149154                        </tr> 
    150155                        <tr> 
    151                                 <td><p>docs</p> 
    152                                 </td> 
    153                                 <td> 
    154                                         <p>Documentation files. Generated books, online manuals as well 
    155                                                 as the PHPDoc generated API documentation.</p></td> 
    156                         </tr> 
    157                         <tr> 
    158                                 <td><p>test</p> 
    159                                 </td> 
     156                                <td><p>test</p></td> 
    160157                                <td> 
    161158                                        <p>A set of testcases for different tasks, mappers and types. 
    162159                                                If you are developing in CVS you should add a testcase for each 
    163                                                 implementation you check in.</p></td> 
     160                                                implementation you check in.</p> 
     161                                </td> 
    164162                        </tr> 
    165163                </tbody> 
     
    484482                Always include/require all the classes needed for this task in full 
    485483                written notation. Furthermore you should always include <em>phing/Task.php</em> 
    486                 at the very top of your include block. Then include all other 
    487                 required system or proprietary classes.</p> 
     484                at the very top of your include block. Then include all other required 
     485                system or proprietary classes. 
     486        </p> 
    488487 
    489488        <h3> 
     
    522521 
    523522        <ul> 
    524 <!--            <li>Taskname. Always hard code the <em>taskname</em> property 
     523                <!--            <li>Taskname. Always hard code the <em>taskname</em> property 
    525524                        that equals the name of the XML element that your task claims. 
    526525                        Currently this information is not used - but it will be in the 
     
    566565                you have to define a method named exactly after the very attribute 
    567566                plus the string "set" prepended. This method accepts exactly one 
    568                 parameter that holds the value of the attribute. Now you can set the 
    569                 a class internal property to the value that is passed via the setter 
     567                parameter that holds the value of the attribute. Now you can set the a 
     568                class internal property to the value that is passed via the setter 
    570569                method.</p> 
     570 
     571        <p> 
     572                In the setter method you should also perform any casting operations 
     573                and/or check if the attribute value is a valid value. If this is not 
     574                the case, throw a <em>BuildException</em>. In some cases, such as when 
     575                you have three attributes and at least one of them should be set, you 
     576                may want to check the attribute values inside the <a 
     577                        href="#InitMethod">init()</a> or <a href="#MainMethod">main()</a> 
     578                method. 
     579        </p> 
    571580 
    572581        <p> 
Note: See TracChangeset for help on using the changeset viewer.