Template:Class: Difference between revisions
From Sunhill Framework Documentation
Parses methods now |
additional if statement for the case there are no member variables or methods |
||
Line 48: | Line 48: | ||
* '''Namespace''': {{{Namespace}}} | * '''Namespace''': {{{Namespace}}} | ||
* '''Sub-module''': [[{{{Submodule|}}}]] | * '''Sub-module''': [[{{{Submodule|}}}]] | ||
{{#if: {{{Members}}}| | |||
== Member variables == | == Member variables == | ||
{|class="wikitable sortable" | {|class="wikitable sortable" | ||
!Name !! Type !! class="unsortable"| Description | !Name !! Type !! class="unsortable"| Description | ||
{{{Members}}} | {{{Members}}} | ||
|} | |}|No member variables}} | ||
{{#if: {{{Methods}}}| | |||
== Methods == | == Methods == | ||
{{{Methods}}} | {{{Methods}}}|No methods}} | ||
</includeonly> | </includeonly> |
Revision as of 11:14, 24 September 2024
The class template gives an unified way to describe the intention, member variables and methods of a sunhill framework class.
Example:
{{Class |Purpose=This is a test class for demonstration this template |Name=TestClass |Dir=/src/some/dir |Namespace=Sunhill/Test |Submodule=Example |Members= {{Member|Name=MemberA|Type=Integer|Description=This is memberA}} {{Member|Name=MemberB|Type=String|Description=This is memberB}} }}
creates
Purpose
This is a test class for demonstration this template
General information
- Name: TestClass
- Directory: /src/some/dir
- Namespace: Sunhill/Test
- Sub-module: Example
Member variables
{
Methods
TestMethod
Description
This method does something wonderful
Parameters
Name | Type | Default | Description |
---|---|---|---|
ParameterA | String | An string parameter | |
ParameterB | Integer | 10 | An integer parameter with default of 10 |
Return type
Integer
Test
/tests/Unit/Some/TestTest.php