Template:Class

From Sunhill Framework Documentation
Revision as of 11:14, 24 September 2024 by Klaus (talk | contribs) (additional if statement for the case there are no member variables or methods)

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