From c113b7f038e75c1d2d368c64046e9bfe390e4397 Mon Sep 17 00:00:00 2001 From: alphayax Date: Sat, 2 Jul 2016 18:00:35 +0200 Subject: [PATCH 01/11] Add Class documentation --- docs/MdGen.md | 149 +++++++++ docs/__NAMESPACE__.md | 3 +- "docs/alphayax\\mdGen\\MdGen.md" | 10 + docs/models/ClassMd.md | 240 +++++++++++++++ docs/models/MethodMd.md | 199 ++++++++++++ docs/models/NamespaceMd.md | 285 ++++++++++++++++++ docs/models/ParamMd.md | 133 ++++++++ docs/models/__NAMESPACE__.md | 20 +- .../alphayax\\mdGen\\models\\ClassMd.md" | 10 + .../alphayax\\mdGen\\models\\MethodMd.md" | 10 + .../alphayax\\mdGen\\models\\NamespaceMd.md" | 10 + docs/utils/__NAMESPACE__.md | 2 +- ...x\\mdGen\\utils\\arrayAccessProperties.md" | 10 + docs/utils/arrayAccessProperties.md | 108 +++++++ src/MdGen.php | 14 +- src/models/ClassMd.php | 15 +- src/models/MethodMd.php | 58 +++- src/models/NamespaceMd.php | 24 +- src/models/ParamMd.php | 28 ++ src/views/Class.mustache | 35 +++ src/views/MethodMd/Param.mustache | 12 + src/views/MethodMd/Return.mustache | 5 + src/views/MethodMd/Signature.mustache | 5 + src/views/Page.mustache | 6 +- 24 files changed, 1371 insertions(+), 20 deletions(-) create mode 100644 docs/MdGen.md create mode 100644 "docs/alphayax\\mdGen\\MdGen.md" create mode 100644 docs/models/ClassMd.md create mode 100644 docs/models/MethodMd.md create mode 100644 docs/models/NamespaceMd.md create mode 100644 docs/models/ParamMd.md create mode 100644 "docs/models/alphayax\\mdGen\\models\\ClassMd.md" create mode 100644 "docs/models/alphayax\\mdGen\\models\\MethodMd.md" create mode 100644 "docs/models/alphayax\\mdGen\\models\\NamespaceMd.md" create mode 100644 "docs/utils/alphayax\\mdGen\\utils\\arrayAccessProperties.md" create mode 100644 docs/utils/arrayAccessProperties.md create mode 100644 src/models/ParamMd.php create mode 100644 src/views/Class.mustache create mode 100644 src/views/MethodMd/Param.mustache create mode 100644 src/views/MethodMd/Return.mustache create mode 100644 src/views/MethodMd/Signature.mustache diff --git a/docs/MdGen.md b/docs/MdGen.md new file mode 100644 index 0000000..e3d9e4f --- /dev/null +++ b/docs/MdGen.md @@ -0,0 +1,149 @@ + +# **Class** MdGen + +Full name : `alphayax\mdGen\MdGen` + +## Properties + +- srcDirectory +- loadedClasses +- chapters +- rootPage + +## Methods summary + +| Method | Description | +|---|---| +| `__construct` | MdGen constructor. | +| `loadClasses` | Load class in the source directory | +| `filterNamespace` | Filter class who are in a specific namespace | +| `filterSubClasses` | Filter class who are sub-classes of a specific class | +| `generateClassMdFromLoadedClasses` | Create a chapter form loaded classes | +| `generate` | Generate markdown files | + +## Methods details + +### `__construct` + +__MdGen constructor.__ + + +#### Signature + +```php + public function __construct(, ); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `` | $srcDirectory | | +| `` | $rootNamespace | | + +#### Return + + + +### `loadClasses` + +__Load class in the source directory__ + + +#### Signature + +```php + protected function loadClasses(); +``` + +#### Parameters + + No parameters + +#### Return + + + +### `filterNamespace` + +__Filter class who are in a specific namespace__ + + +#### Signature + +```php + public function filterNamespace($namespaceName); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$namespaceName` | string | Namespace Name to filter | + +#### Return + + + +### `filterSubClasses` + +__Filter class who are sub-classes of a specific class__ + + +#### Signature + +```php + public function filterSubClasses($className); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$className` | string | Super class name to filter | + +#### Return + + + +### `generateClassMdFromLoadedClasses` + +__Create a chapter form loaded classes__ + + +#### Signature + +```php + protected function generateClassMdFromLoadedClasses(); +``` + +#### Parameters + + No parameters + +#### Return + + ClassMd[] + + +### `generate` + +__Generate markdown files__ + + +#### Signature + +```php + public function generate($directory); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$directory` | string | Path to generated files | + +#### Return + + + diff --git a/docs/__NAMESPACE__.md b/docs/__NAMESPACE__.md index b1c6f01..1b91149 100644 --- a/docs/__NAMESPACE__.md +++ b/docs/__NAMESPACE__.md @@ -9,12 +9,13 @@ - [NamespaceMd](models/__NAMESPACE__.md#NamespaceMd) - [ClassMd](models/__NAMESPACE__.md#ClassMd) - [MethodMd](models/__NAMESPACE__.md#MethodMd) + - [ParamMd](models/__NAMESPACE__.md#ParamMd) - [utils](./utils/__NAMESPACE__.md) - [arrayAccessProperties](utils/__NAMESPACE__.md#arrayAccessProperties) - [MdGen](__NAMESPACE__.md#MdGen) - --- + ## MdGen diff --git "a/docs/alphayax\\mdGen\\MdGen.md" "b/docs/alphayax\\mdGen\\MdGen.md" new file mode 100644 index 0000000..59e2d0f --- /dev/null +++ "b/docs/alphayax\\mdGen\\MdGen.md" @@ -0,0 +1,10 @@ + +# + +**Namespace** : + +# Overview + + + +--- diff --git a/docs/models/ClassMd.md b/docs/models/ClassMd.md new file mode 100644 index 0000000..a6c2708 --- /dev/null +++ b/docs/models/ClassMd.md @@ -0,0 +1,240 @@ + +# **Class** ClassMd + +Full name : `alphayax\mdGen\models\ClassMd` + +## Properties + +- class +- reflexion +- publicMethods +- methods +- type +- properties + +## Methods summary + +| Method | Description | +|---|---| +| `__construct` | ClassChapter constructor. | +| `computeType` | Determine the type of class | +| `getNextComponent` | Get the next namespace component (according the NS given) | +| `getNamespace` | Get the namespace of the current reflected class | +| `getReflexion` | Get the reflected class | +| `getType` | Return the real kind of class (Trait, Interface, Class) | +| `offsetExists` | Whether a offset exists | +| `offsetGet` | Offset to retrieve | +| `offsetSet` | Offset to set | +| `offsetUnset` | Offset to unset | + +## Methods details + +### `__construct` + +__ClassChapter constructor.__ + + +#### Signature + +```php + public function __construct($class); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$class` | string | | + +#### Return + + + +### `computeType` + +__Determine the type of class__ + + +#### Signature + +```php + protected function computeType(); +``` + +#### Parameters + + No parameters + +#### Return + + + +### `getNextComponent` + +__Get the next namespace component (according the NS given)__ + + +#### Signature + +```php + public function getNextComponent($namespace); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$namespace` | string | | + +#### Return + + string + + +### `getNamespace` + +__Get the namespace of the current reflected class__ + + +#### Signature + +```php + public function getNamespace(); +``` + +#### Parameters + + No parameters + +#### Return + + + +### `getReflexion` + +__Get the reflected class__ + + +#### Signature + +```php + public function getReflexion(); +``` + +#### Parameters + + No parameters + +#### Return + + \ReflectionClass + + +### `getType` + +__Return the real kind of class (Trait, Interface, Class)__ + + +#### Signature + +```php + public function getType(); +``` + +#### Parameters + + No parameters + +#### Return + + + +### `offsetExists` + +__Whether a offset exists__ + + +#### Signature + +```php + public function offsetExists($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> An offset to check for. </p> | + +#### Return + + boolean true on success or false on failure. + + +### `offsetGet` + +__Offset to retrieve__ + + +#### Signature + +```php + public function offsetGet($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to retrieve. </p> | + +#### Return + + mixed Can return all value types. + + +### `offsetSet` + +__Offset to set__ + + +#### Signature + +```php + public function offsetSet($offset, $value); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to assign the value to. </p> | +| `$value` | mixed | <p> The value to set. </p> | + +#### Return + + void + + +### `offsetUnset` + +__Offset to unset__ + + +#### Signature + +```php + public function offsetUnset($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to unset. </p> | + +#### Return + + void + + diff --git a/docs/models/MethodMd.md b/docs/models/MethodMd.md new file mode 100644 index 0000000..480cf04 --- /dev/null +++ b/docs/models/MethodMd.md @@ -0,0 +1,199 @@ + +# **Class** MethodMd + +Full name : `alphayax\mdGen\models\MethodMd` + +## Properties + +- reflexion +- name +- description +- params +- return + +## Methods summary + +| Method | Description | +|---|---| +| `__construct` | MethodMd constructor. | +| `hasParams` | | +| `getParams` | | +| `getModifiers` | | +| `offsetExists` | Whether a offset exists | +| `offsetGet` | Offset to retrieve | +| `offsetSet` | Offset to set | +| `offsetUnset` | Offset to unset | + +## Methods details + +### `__construct` + +__MethodMd constructor.__ + + +#### Signature + +```php + public function __construct(, ); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `` | $className | | +| `` | $methodName | | + +#### Return + + + +### `hasParams` + +____ + + +#### Signature + +```php + public function hasParams(); +``` + +#### Parameters + + No parameters + +#### Return + + bool + + +### `getParams` + +____ + + +#### Signature + +```php + public function getParams(); +``` + +#### Parameters + + No parameters + +#### Return + + string + + +### `getModifiers` + +____ + + +#### Signature + +```php + public function getModifiers(); +``` + +#### Parameters + + No parameters + +#### Return + + string + + +### `offsetExists` + +__Whether a offset exists__ + + +#### Signature + +```php + public function offsetExists($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> An offset to check for. </p> | + +#### Return + + boolean true on success or false on failure. + + +### `offsetGet` + +__Offset to retrieve__ + + +#### Signature + +```php + public function offsetGet($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to retrieve. </p> | + +#### Return + + mixed Can return all value types. + + +### `offsetSet` + +__Offset to set__ + + +#### Signature + +```php + public function offsetSet($offset, $value); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to assign the value to. </p> | +| `$value` | mixed | <p> The value to set. </p> | + +#### Return + + void + + +### `offsetUnset` + +__Offset to unset__ + + +#### Signature + +```php + public function offsetUnset($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to unset. </p> | + +#### Return + + void + + diff --git a/docs/models/NamespaceMd.md b/docs/models/NamespaceMd.md new file mode 100644 index 0000000..1b1156f --- /dev/null +++ b/docs/models/NamespaceMd.md @@ -0,0 +1,285 @@ + +# **Class** NamespaceMd + +Full name : `alphayax\mdGen\models\NamespaceMd` + +## Properties + +- classMds +- subPages +- namespace +- page_bfe +- page_rd +- pageName + +## Methods summary + +| Method | Description | +|---|---| +| `__construct` | Page constructor | +| `computePageName` | Compute the page name (according to the page namespace) | +| `generateTree` | Generate overview markdown tree | +| `write` | Write markdown file | +| `writeMdClasses` | | +| `writeSubPages` | Write sub pages of this page | +| `setDirectory` | Define the current page directory | +| `getPageBfe` | Return the page basename file with extension | +| `offsetExists` | Whether a offset exists | +| `offsetGet` | Offset to retrieve | +| `offsetSet` | Offset to set | +| `offsetUnset` | Offset to unset | + +## Methods details + +### `__construct` + +__Page constructor__ + + +#### Signature + +```php + public function __construct($pageNamespace, $chapters); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$pageNamespace` | string | | +| `$chapters` | ClassMd[] | | + +#### Return + + + +### `computePageName` + +__Compute the page name (according to the page namespace)__ + + +#### Signature + +```php + protected function computePageName(); +``` + +#### Parameters + + No parameters + +#### Return + + string + + +### `generateTree` + +__Generate overview markdown tree__ + + +#### Signature + +```php + public function generateTree($pad, $relativePath); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$pad` | string | | +| `$relativePath` | string | | + +#### Return + + string + + +### `write` + +__Write markdown file__ + + +#### Signature + +```php + public function write(); +``` + +#### Parameters + + No parameters + +#### Return + + + +### `writeMdClasses` + +____ + + +#### Signature + +```php + protected function writeMdClasses(); +``` + +#### Parameters + + No parameters + +#### Return + + + +### `writeSubPages` + +__Write sub pages of this page__ + + +#### Signature + +```php + public function writeSubPages(); +``` + +#### Parameters + + No parameters + +#### Return + + + +### `setDirectory` + +__Define the current page directory__ + + +#### Signature + +```php + public function setDirectory(); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `` | $string | | + +#### Return + + + +### `getPageBfe` + +__Return the page basename file with extension__ + + +#### Signature + +```php + public function getPageBfe(); +``` + +#### Parameters + + No parameters + +#### Return + + string The page base name + + +### `offsetExists` + +__Whether a offset exists__ + + +#### Signature + +```php + public function offsetExists($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> An offset to check for. </p> | + +#### Return + + boolean true on success or false on failure. + + +### `offsetGet` + +__Offset to retrieve__ + + +#### Signature + +```php + public function offsetGet($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to retrieve. </p> | + +#### Return + + mixed Can return all value types. + + +### `offsetSet` + +__Offset to set__ + + +#### Signature + +```php + public function offsetSet($offset, $value); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to assign the value to. </p> | +| `$value` | mixed | <p> The value to set. </p> | + +#### Return + + void + + +### `offsetUnset` + +__Offset to unset__ + + +#### Signature + +```php + public function offsetUnset($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to unset. </p> | + +#### Return + + void + + diff --git a/docs/models/ParamMd.md b/docs/models/ParamMd.md new file mode 100644 index 0000000..6c52d6b --- /dev/null +++ b/docs/models/ParamMd.md @@ -0,0 +1,133 @@ + +# **Class** ParamMd + +Full name : `alphayax\mdGen\models\ParamMd` + +## Properties + +- type +- description +- variableName + +## Methods summary + +| Method | Description | +|---|---| +| `__construct` | ParamMd constructor. | +| `offsetExists` | Whether a offset exists | +| `offsetGet` | Offset to retrieve | +| `offsetSet` | Offset to set | +| `offsetUnset` | Offset to unset | + +## Methods details + +### `__construct` + +__ParamMd constructor.__ + + +#### Signature + +```php + public function __construct($param); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$param` | \Zend_Reflection_Docblock_Tag_Param | | + +#### Return + + + +### `offsetExists` + +__Whether a offset exists__ + + +#### Signature + +```php + public function offsetExists($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> An offset to check for. </p> | + +#### Return + + boolean true on success or false on failure. + + +### `offsetGet` + +__Offset to retrieve__ + + +#### Signature + +```php + public function offsetGet($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to retrieve. </p> | + +#### Return + + mixed Can return all value types. + + +### `offsetSet` + +__Offset to set__ + + +#### Signature + +```php + public function offsetSet($offset, $value); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to assign the value to. </p> | +| `$value` | mixed | <p> The value to set. </p> | + +#### Return + + void + + +### `offsetUnset` + +__Offset to unset__ + + +#### Signature + +```php + public function offsetUnset($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to unset. </p> | + +#### Return + + void + + diff --git a/docs/models/__NAMESPACE__.md b/docs/models/__NAMESPACE__.md index 4fda077..67958b6 100644 --- a/docs/models/__NAMESPACE__.md +++ b/docs/models/__NAMESPACE__.md @@ -8,9 +8,10 @@ - [NamespaceMd](__NAMESPACE__.md#NamespaceMd) - [ClassMd](__NAMESPACE__.md#ClassMd) - [MethodMd](__NAMESPACE__.md#MethodMd) - +- [ParamMd](__NAMESPACE__.md#ParamMd) --- + ## NamespaceMd @@ -55,6 +56,23 @@ ### Public methods +| Method | Description | +|---|---| +| `hasParams` | | +| `getParams` | | +| `getModifiers` | | +| `offsetExists` | Whether a offset exists | +| `offsetGet` | Offset to retrieve | +| `offsetSet` | Offset to set | +| `offsetUnset` | Offset to unset | + + +## ParamMd + +**Class** : alphayax\mdGen\models\ParamMd + +### Public methods + | Method | Description | |---|---| | `offsetExists` | Whether a offset exists | diff --git "a/docs/models/alphayax\\mdGen\\models\\ClassMd.md" "b/docs/models/alphayax\\mdGen\\models\\ClassMd.md" new file mode 100644 index 0000000..59e2d0f --- /dev/null +++ "b/docs/models/alphayax\\mdGen\\models\\ClassMd.md" @@ -0,0 +1,10 @@ + +# + +**Namespace** : + +# Overview + + + +--- diff --git "a/docs/models/alphayax\\mdGen\\models\\MethodMd.md" "b/docs/models/alphayax\\mdGen\\models\\MethodMd.md" new file mode 100644 index 0000000..59e2d0f --- /dev/null +++ "b/docs/models/alphayax\\mdGen\\models\\MethodMd.md" @@ -0,0 +1,10 @@ + +# + +**Namespace** : + +# Overview + + + +--- diff --git "a/docs/models/alphayax\\mdGen\\models\\NamespaceMd.md" "b/docs/models/alphayax\\mdGen\\models\\NamespaceMd.md" new file mode 100644 index 0000000..59e2d0f --- /dev/null +++ "b/docs/models/alphayax\\mdGen\\models\\NamespaceMd.md" @@ -0,0 +1,10 @@ + +# + +**Namespace** : + +# Overview + + + +--- diff --git a/docs/utils/__NAMESPACE__.md b/docs/utils/__NAMESPACE__.md index 892e0de..a3ffb0b 100644 --- a/docs/utils/__NAMESPACE__.md +++ b/docs/utils/__NAMESPACE__.md @@ -7,8 +7,8 @@ - [arrayAccessProperties](__NAMESPACE__.md#arrayAccessProperties) - --- + ## arrayAccessProperties diff --git "a/docs/utils/alphayax\\mdGen\\utils\\arrayAccessProperties.md" "b/docs/utils/alphayax\\mdGen\\utils\\arrayAccessProperties.md" new file mode 100644 index 0000000..59e2d0f --- /dev/null +++ "b/docs/utils/alphayax\\mdGen\\utils\\arrayAccessProperties.md" @@ -0,0 +1,10 @@ + +# + +**Namespace** : + +# Overview + + + +--- diff --git a/docs/utils/arrayAccessProperties.md b/docs/utils/arrayAccessProperties.md new file mode 100644 index 0000000..c5dad46 --- /dev/null +++ b/docs/utils/arrayAccessProperties.md @@ -0,0 +1,108 @@ + +# **Trait** arrayAccessProperties + +Full name : `alphayax\mdGen\utils\arrayAccessProperties` + +## Properties + + +## Methods summary + +| Method | Description | +|---|---| +| `offsetExists` | Whether a offset exists | +| `offsetGet` | Offset to retrieve | +| `offsetSet` | Offset to set | +| `offsetUnset` | Offset to unset | + +## Methods details + +### `offsetExists` + +__Whether a offset exists__ + + +#### Signature + +```php + public function offsetExists($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> An offset to check for. </p> | + +#### Return + + boolean true on success or false on failure. + + +### `offsetGet` + +__Offset to retrieve__ + + +#### Signature + +```php + public function offsetGet($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to retrieve. </p> | + +#### Return + + mixed Can return all value types. + + +### `offsetSet` + +__Offset to set__ + + +#### Signature + +```php + public function offsetSet($offset, $value); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to assign the value to. </p> | +| `$value` | mixed | <p> The value to set. </p> | + +#### Return + + void + + +### `offsetUnset` + +__Offset to unset__ + + +#### Signature + +```php + public function offsetUnset($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to unset. </p> | + +#### Return + + void + + diff --git a/src/MdGen.php b/src/MdGen.php index b65a418..b9bda03 100644 --- a/src/MdGen.php +++ b/src/MdGen.php @@ -57,7 +57,7 @@ protected function loadClasses(){ /** * Filter class who are in a specific namespace - * @param $namespaceName + * @param string $namespaceName Namespace Name to filter */ public function filterNamespace( $namespaceName) { $FilteredClasses = []; @@ -71,7 +71,7 @@ public function filterNamespace( $namespaceName) { /** * Filter class who are sub-classes of a specific class - * @param $className + * @param string $className Super class name to filter */ public function filterSubClasses( $className) { $FilteredClasses = []; @@ -85,19 +85,19 @@ public function filterSubClasses( $className) { /** * Create a chapter form loaded classes - * @return array + * @return ClassMd[] */ protected function generateClassMdFromLoadedClasses(){ - $chapters = []; + $classMds = []; foreach( $this->loadedClasses as $class){ - $chapters[] = new ClassMd( $class); + $classMds[] = new ClassMd( $class); } - return $chapters; + return $classMds; } /** * Generate markdown files - * @param string $directory + * @param string $directory Path to generated files */ public function generate( $directory = '.'){ $chapters = $this->generateClassMdFromLoadedClasses(); diff --git a/src/models/ClassMd.php b/src/models/ClassMd.php index b405f9a..74103ff 100644 --- a/src/models/ClassMd.php +++ b/src/models/ClassMd.php @@ -15,12 +15,18 @@ class ClassMd implements \ArrayAccess { /** @var \ReflectionClass */ protected $reflexion; + /** @var MethodMd[] */ + protected $publicMethods; + /** @var MethodMd[] */ protected $methods; /** @var string Class type (Interface, Trait or Class) */ protected $type; + /** @var array */ + protected $properties = []; + /** * ClassChapter constructor. * @param string $class @@ -29,10 +35,17 @@ public function __construct( $class){ $this->class = $class; $this->reflexion = new \ReflectionClass( $class); $this->computeType(); + $properties = $this->reflexion->getProperties(); + foreach ($properties as $property){ + $this->properties[] = $property->getName(); + } $methods = $this->reflexion->getMethods(); foreach ( $methods as $method){ + $methodMd = new MethodMd( $this->reflexion->getName(), $method->getName()); + $this->methods[] = $methodMd; + /// Filter only public and non constructor methods if( ! $method->isPublic() || $method->isConstructor()){ continue; @@ -43,7 +56,7 @@ public function __construct( $class){ continue; } - $this->methods[] = new MethodMd( $this->reflexion->getName(), $method->getName()); + $this->publicMethods[] = $methodMd; } } diff --git a/src/models/MethodMd.php b/src/models/MethodMd.php index 0a2f6ac..44642a9 100644 --- a/src/models/MethodMd.php +++ b/src/models/MethodMd.php @@ -9,6 +9,9 @@ class MethodMd implements \ArrayAccess { use utils\arrayAccessProperties; + /** @var \Zend_Reflection_Method */ + protected $reflexion; + /** @var string Method Name */ protected $name; @@ -30,16 +33,65 @@ public function __construct($className, $methodName) { try { - $method2 = new \Zend_Reflection_Method( $className, $methodName); + $this->reflexion = new \Zend_Reflection_Method( $className, $methodName); + + $this->name = $this->reflexion->getName(); + $docBlock = $this->reflexion->getDocblock(); - $this->name = $method2->getName(); - $docBlock = $method2->getDocblock(); + /// Desc $shortDesc = str_replace(PHP_EOL, ' ', $docBlock->getShortDescription()); $this->description = str_replace(PHP_EOL, ' ', $shortDesc); + /// Params + /** @var \Zend_Reflection_Docblock_Tag_Param[] $params */ + $params = $docBlock->getTags( 'param'); + foreach ( $params as $param){ + $this->params[] = new ParamMd( $param); + } + + /** @var \Zend_Reflection_Docblock_Tag_Return $return */ + $return = $docBlock->getTag( 'return'); + if( $return){ + $this->return = $return->getType() . ' ' . $return->getDescription(); + } + + + } catch (\Exception $e) { // Unable to parse PHPDoc Block... Skip it :( } } + /** + * @return bool + */ + public function hasParams() { + return ! empty( $this->params); + } + + /** + * @return string + */ + public function getParams(){ + $variablesNames = []; + foreach( $this->params as $param){ + $variablesNames[] = $param['variableName']; + } + return implode(', ', $variablesNames); + } + + /** + * @return string + */ + public function getModifiers() { + return + ($this->reflexion->isFinal() ? ' final' : ''). + ($this->reflexion->isAbstract() ? ' abstract' : ''). + ($this->reflexion->isPublic() ? ' public' : ''). + ($this->reflexion->isProtected() ? ' protected' : ''). + ($this->reflexion->isPrivate() ? ' private' : ''). + ($this->reflexion->isStatic() ? ' static' : ''); + + } + } diff --git a/src/models/NamespaceMd.php b/src/models/NamespaceMd.php index 1fe44e4..566662c 100644 --- a/src/models/NamespaceMd.php +++ b/src/models/NamespaceMd.php @@ -107,11 +107,29 @@ public function write(){ $generatedMd = $template->render( $this); - $this->writeSubPages(); - /// Write page @mkdir( $this->page_rd, 0777, true); file_put_contents( $this->page_rd . DIRECTORY_SEPARATOR . $this->page_bfe, $generatedMd); + + + $this->writeMdClasses(); + $this->writeSubPages(); + } + + /** + * + */ + protected function writeMdClasses() { + + $m = new \Mustache_Engine([ + 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views'), + 'partials_loader' => new \Mustache_Loader_FilesystemLoader(__DIR__ . '/../views/MethodMd'), + + ]); + foreach( $this->classMds as $classMd){ + $generatedMd = $m->loadTemplate('Class')->render( $classMd); + file_put_contents( $this->page_rd . DIRECTORY_SEPARATOR . $classMd->getReflexion()->getShortName() . '.md', $generatedMd); + } } /** @@ -135,7 +153,7 @@ public function setDirectory( $string) { /** * Return the page basename file with extension - * @return string + * @return string The page base name */ public function getPageBfe() { return $this->page_bfe; diff --git a/src/models/ParamMd.php b/src/models/ParamMd.php new file mode 100644 index 0000000..feb00e4 --- /dev/null +++ b/src/models/ParamMd.php @@ -0,0 +1,28 @@ +type = $param->getType(); + $this->description = $param->getDescription(); + $this->variableName = $param->getVariableName(); + } + +} diff --git a/src/views/Class.mustache b/src/views/Class.mustache new file mode 100644 index 0000000..a192405 --- /dev/null +++ b/src/views/Class.mustache @@ -0,0 +1,35 @@ + +# **{{ type }}** {{ reflexion.getShortName }} + +Full name : `{{ class }}` + +## Properties + +{{# properties}} +- {{.}} +{{/ properties}} + +## Methods summary + +| Method | Description | +|---|---| +{{# methods }} +| `{{name}}` | {{description}} | +{{/ methods }} + +## Methods details + +{{# methods }} +### `{{name}}` + +__{{description}}__ + + +{{> Signature}} + +{{> Param}} + +{{> Return}} + + +{{/ methods }} diff --git a/src/views/MethodMd/Param.mustache b/src/views/MethodMd/Param.mustache new file mode 100644 index 0000000..b826e6d --- /dev/null +++ b/src/views/MethodMd/Param.mustache @@ -0,0 +1,12 @@ +#### Parameters + +{{# hasParams}} +| Name | Type | Description | +|---|---|---| +{{# params }} +| `{{variableName}}` | {{type}} | {{description}} | +{{/ params }} +{{/ hasParams }} +{{^ hasParams }} + No parameters +{{/ hasParams }} diff --git a/src/views/MethodMd/Return.mustache b/src/views/MethodMd/Return.mustache new file mode 100644 index 0000000..11f2f6e --- /dev/null +++ b/src/views/MethodMd/Return.mustache @@ -0,0 +1,5 @@ +#### Return + +{{# return }} + {{.}} +{{/ return }} diff --git a/src/views/MethodMd/Signature.mustache b/src/views/MethodMd/Signature.mustache new file mode 100644 index 0000000..bbd3c9b --- /dev/null +++ b/src/views/MethodMd/Signature.mustache @@ -0,0 +1,5 @@ +#### Signature + +```php +{{getModifiers}} function {{name}}({{getParams}}); +``` diff --git a/src/views/Page.mustache b/src/views/Page.mustache index a9f8eab..294e53a 100644 --- a/src/views/Page.mustache +++ b/src/views/Page.mustache @@ -6,8 +6,8 @@ # Overview {{ generateTree }} - --- + {{# classMds }} ## {{getReflexion.getShortName}} @@ -18,8 +18,8 @@ | Method | Description | |---|---| -{{# methods }} +{{# publicMethods }} | `{{name}}` | {{description}} | -{{/ methods }} +{{/ publicMethods }} {{/ classMds }} From 86d989a59cce6f32ef9d3388b5e2b233ab0f7592 Mon Sep 17 00:00:00 2001 From: alphayax Date: Mon, 4 Jul 2016 14:06:12 +0200 Subject: [PATCH 02/11] Add Method documentation --- docs/MdGen.md | 149 --------- "docs/alphayax\\mdGen\\MdGen.md" | 10 - docs/models/ClassMd.md | 240 --------------- docs/models/MethodMd.md | 199 ------------ docs/models/NamespaceMd.md | 285 ------------------ docs/models/ParamMd.md | 133 -------- docs/models/__NAMESPACE__.md | 3 +- .../alphayax\\mdGen\\models\\ClassMd.md" | 10 - .../alphayax\\mdGen\\models\\MethodMd.md" | 10 - .../alphayax\\mdGen\\models\\NamespaceMd.md" | 10 - ...x\\mdGen\\utils\\arrayAccessProperties.md" | 10 - docs/utils/arrayAccessProperties.md | 108 ------- src/models/ClassMd.php | 25 +- src/models/MethodMd.php | 34 ++- src/models/NamespaceMd.php | 9 +- src/views/Class.mustache | 21 +- src/views/Method.mustache | 21 ++ 17 files changed, 80 insertions(+), 1197 deletions(-) delete mode 100644 docs/MdGen.md delete mode 100644 "docs/alphayax\\mdGen\\MdGen.md" delete mode 100644 docs/models/ClassMd.md delete mode 100644 docs/models/MethodMd.md delete mode 100644 docs/models/NamespaceMd.md delete mode 100644 docs/models/ParamMd.md delete mode 100644 "docs/models/alphayax\\mdGen\\models\\ClassMd.md" delete mode 100644 "docs/models/alphayax\\mdGen\\models\\MethodMd.md" delete mode 100644 "docs/models/alphayax\\mdGen\\models\\NamespaceMd.md" delete mode 100644 "docs/utils/alphayax\\mdGen\\utils\\arrayAccessProperties.md" delete mode 100644 docs/utils/arrayAccessProperties.md create mode 100644 src/views/Method.mustache diff --git a/docs/MdGen.md b/docs/MdGen.md deleted file mode 100644 index e3d9e4f..0000000 --- a/docs/MdGen.md +++ /dev/null @@ -1,149 +0,0 @@ - -# **Class** MdGen - -Full name : `alphayax\mdGen\MdGen` - -## Properties - -- srcDirectory -- loadedClasses -- chapters -- rootPage - -## Methods summary - -| Method | Description | -|---|---| -| `__construct` | MdGen constructor. | -| `loadClasses` | Load class in the source directory | -| `filterNamespace` | Filter class who are in a specific namespace | -| `filterSubClasses` | Filter class who are sub-classes of a specific class | -| `generateClassMdFromLoadedClasses` | Create a chapter form loaded classes | -| `generate` | Generate markdown files | - -## Methods details - -### `__construct` - -__MdGen constructor.__ - - -#### Signature - -```php - public function __construct(, ); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `` | $srcDirectory | | -| `` | $rootNamespace | | - -#### Return - - - -### `loadClasses` - -__Load class in the source directory__ - - -#### Signature - -```php - protected function loadClasses(); -``` - -#### Parameters - - No parameters - -#### Return - - - -### `filterNamespace` - -__Filter class who are in a specific namespace__ - - -#### Signature - -```php - public function filterNamespace($namespaceName); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$namespaceName` | string | Namespace Name to filter | - -#### Return - - - -### `filterSubClasses` - -__Filter class who are sub-classes of a specific class__ - - -#### Signature - -```php - public function filterSubClasses($className); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$className` | string | Super class name to filter | - -#### Return - - - -### `generateClassMdFromLoadedClasses` - -__Create a chapter form loaded classes__ - - -#### Signature - -```php - protected function generateClassMdFromLoadedClasses(); -``` - -#### Parameters - - No parameters - -#### Return - - ClassMd[] - - -### `generate` - -__Generate markdown files__ - - -#### Signature - -```php - public function generate($directory); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$directory` | string | Path to generated files | - -#### Return - - - diff --git "a/docs/alphayax\\mdGen\\MdGen.md" "b/docs/alphayax\\mdGen\\MdGen.md" deleted file mode 100644 index 59e2d0f..0000000 --- "a/docs/alphayax\\mdGen\\MdGen.md" +++ /dev/null @@ -1,10 +0,0 @@ - -# - -**Namespace** : - -# Overview - - - ---- diff --git a/docs/models/ClassMd.md b/docs/models/ClassMd.md deleted file mode 100644 index a6c2708..0000000 --- a/docs/models/ClassMd.md +++ /dev/null @@ -1,240 +0,0 @@ - -# **Class** ClassMd - -Full name : `alphayax\mdGen\models\ClassMd` - -## Properties - -- class -- reflexion -- publicMethods -- methods -- type -- properties - -## Methods summary - -| Method | Description | -|---|---| -| `__construct` | ClassChapter constructor. | -| `computeType` | Determine the type of class | -| `getNextComponent` | Get the next namespace component (according the NS given) | -| `getNamespace` | Get the namespace of the current reflected class | -| `getReflexion` | Get the reflected class | -| `getType` | Return the real kind of class (Trait, Interface, Class) | -| `offsetExists` | Whether a offset exists | -| `offsetGet` | Offset to retrieve | -| `offsetSet` | Offset to set | -| `offsetUnset` | Offset to unset | - -## Methods details - -### `__construct` - -__ClassChapter constructor.__ - - -#### Signature - -```php - public function __construct($class); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$class` | string | | - -#### Return - - - -### `computeType` - -__Determine the type of class__ - - -#### Signature - -```php - protected function computeType(); -``` - -#### Parameters - - No parameters - -#### Return - - - -### `getNextComponent` - -__Get the next namespace component (according the NS given)__ - - -#### Signature - -```php - public function getNextComponent($namespace); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$namespace` | string | | - -#### Return - - string - - -### `getNamespace` - -__Get the namespace of the current reflected class__ - - -#### Signature - -```php - public function getNamespace(); -``` - -#### Parameters - - No parameters - -#### Return - - - -### `getReflexion` - -__Get the reflected class__ - - -#### Signature - -```php - public function getReflexion(); -``` - -#### Parameters - - No parameters - -#### Return - - \ReflectionClass - - -### `getType` - -__Return the real kind of class (Trait, Interface, Class)__ - - -#### Signature - -```php - public function getType(); -``` - -#### Parameters - - No parameters - -#### Return - - - -### `offsetExists` - -__Whether a offset exists__ - - -#### Signature - -```php - public function offsetExists($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> An offset to check for. </p> | - -#### Return - - boolean true on success or false on failure. - - -### `offsetGet` - -__Offset to retrieve__ - - -#### Signature - -```php - public function offsetGet($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to retrieve. </p> | - -#### Return - - mixed Can return all value types. - - -### `offsetSet` - -__Offset to set__ - - -#### Signature - -```php - public function offsetSet($offset, $value); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to assign the value to. </p> | -| `$value` | mixed | <p> The value to set. </p> | - -#### Return - - void - - -### `offsetUnset` - -__Offset to unset__ - - -#### Signature - -```php - public function offsetUnset($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to unset. </p> | - -#### Return - - void - - diff --git a/docs/models/MethodMd.md b/docs/models/MethodMd.md deleted file mode 100644 index 480cf04..0000000 --- a/docs/models/MethodMd.md +++ /dev/null @@ -1,199 +0,0 @@ - -# **Class** MethodMd - -Full name : `alphayax\mdGen\models\MethodMd` - -## Properties - -- reflexion -- name -- description -- params -- return - -## Methods summary - -| Method | Description | -|---|---| -| `__construct` | MethodMd constructor. | -| `hasParams` | | -| `getParams` | | -| `getModifiers` | | -| `offsetExists` | Whether a offset exists | -| `offsetGet` | Offset to retrieve | -| `offsetSet` | Offset to set | -| `offsetUnset` | Offset to unset | - -## Methods details - -### `__construct` - -__MethodMd constructor.__ - - -#### Signature - -```php - public function __construct(, ); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `` | $className | | -| `` | $methodName | | - -#### Return - - - -### `hasParams` - -____ - - -#### Signature - -```php - public function hasParams(); -``` - -#### Parameters - - No parameters - -#### Return - - bool - - -### `getParams` - -____ - - -#### Signature - -```php - public function getParams(); -``` - -#### Parameters - - No parameters - -#### Return - - string - - -### `getModifiers` - -____ - - -#### Signature - -```php - public function getModifiers(); -``` - -#### Parameters - - No parameters - -#### Return - - string - - -### `offsetExists` - -__Whether a offset exists__ - - -#### Signature - -```php - public function offsetExists($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> An offset to check for. </p> | - -#### Return - - boolean true on success or false on failure. - - -### `offsetGet` - -__Offset to retrieve__ - - -#### Signature - -```php - public function offsetGet($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to retrieve. </p> | - -#### Return - - mixed Can return all value types. - - -### `offsetSet` - -__Offset to set__ - - -#### Signature - -```php - public function offsetSet($offset, $value); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to assign the value to. </p> | -| `$value` | mixed | <p> The value to set. </p> | - -#### Return - - void - - -### `offsetUnset` - -__Offset to unset__ - - -#### Signature - -```php - public function offsetUnset($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to unset. </p> | - -#### Return - - void - - diff --git a/docs/models/NamespaceMd.md b/docs/models/NamespaceMd.md deleted file mode 100644 index 1b1156f..0000000 --- a/docs/models/NamespaceMd.md +++ /dev/null @@ -1,285 +0,0 @@ - -# **Class** NamespaceMd - -Full name : `alphayax\mdGen\models\NamespaceMd` - -## Properties - -- classMds -- subPages -- namespace -- page_bfe -- page_rd -- pageName - -## Methods summary - -| Method | Description | -|---|---| -| `__construct` | Page constructor | -| `computePageName` | Compute the page name (according to the page namespace) | -| `generateTree` | Generate overview markdown tree | -| `write` | Write markdown file | -| `writeMdClasses` | | -| `writeSubPages` | Write sub pages of this page | -| `setDirectory` | Define the current page directory | -| `getPageBfe` | Return the page basename file with extension | -| `offsetExists` | Whether a offset exists | -| `offsetGet` | Offset to retrieve | -| `offsetSet` | Offset to set | -| `offsetUnset` | Offset to unset | - -## Methods details - -### `__construct` - -__Page constructor__ - - -#### Signature - -```php - public function __construct($pageNamespace, $chapters); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$pageNamespace` | string | | -| `$chapters` | ClassMd[] | | - -#### Return - - - -### `computePageName` - -__Compute the page name (according to the page namespace)__ - - -#### Signature - -```php - protected function computePageName(); -``` - -#### Parameters - - No parameters - -#### Return - - string - - -### `generateTree` - -__Generate overview markdown tree__ - - -#### Signature - -```php - public function generateTree($pad, $relativePath); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$pad` | string | | -| `$relativePath` | string | | - -#### Return - - string - - -### `write` - -__Write markdown file__ - - -#### Signature - -```php - public function write(); -``` - -#### Parameters - - No parameters - -#### Return - - - -### `writeMdClasses` - -____ - - -#### Signature - -```php - protected function writeMdClasses(); -``` - -#### Parameters - - No parameters - -#### Return - - - -### `writeSubPages` - -__Write sub pages of this page__ - - -#### Signature - -```php - public function writeSubPages(); -``` - -#### Parameters - - No parameters - -#### Return - - - -### `setDirectory` - -__Define the current page directory__ - - -#### Signature - -```php - public function setDirectory(); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `` | $string | | - -#### Return - - - -### `getPageBfe` - -__Return the page basename file with extension__ - - -#### Signature - -```php - public function getPageBfe(); -``` - -#### Parameters - - No parameters - -#### Return - - string The page base name - - -### `offsetExists` - -__Whether a offset exists__ - - -#### Signature - -```php - public function offsetExists($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> An offset to check for. </p> | - -#### Return - - boolean true on success or false on failure. - - -### `offsetGet` - -__Offset to retrieve__ - - -#### Signature - -```php - public function offsetGet($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to retrieve. </p> | - -#### Return - - mixed Can return all value types. - - -### `offsetSet` - -__Offset to set__ - - -#### Signature - -```php - public function offsetSet($offset, $value); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to assign the value to. </p> | -| `$value` | mixed | <p> The value to set. </p> | - -#### Return - - void - - -### `offsetUnset` - -__Offset to unset__ - - -#### Signature - -```php - public function offsetUnset($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to unset. </p> | - -#### Return - - void - - diff --git a/docs/models/ParamMd.md b/docs/models/ParamMd.md deleted file mode 100644 index 6c52d6b..0000000 --- a/docs/models/ParamMd.md +++ /dev/null @@ -1,133 +0,0 @@ - -# **Class** ParamMd - -Full name : `alphayax\mdGen\models\ParamMd` - -## Properties - -- type -- description -- variableName - -## Methods summary - -| Method | Description | -|---|---| -| `__construct` | ParamMd constructor. | -| `offsetExists` | Whether a offset exists | -| `offsetGet` | Offset to retrieve | -| `offsetSet` | Offset to set | -| `offsetUnset` | Offset to unset | - -## Methods details - -### `__construct` - -__ParamMd constructor.__ - - -#### Signature - -```php - public function __construct($param); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$param` | \Zend_Reflection_Docblock_Tag_Param | | - -#### Return - - - -### `offsetExists` - -__Whether a offset exists__ - - -#### Signature - -```php - public function offsetExists($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> An offset to check for. </p> | - -#### Return - - boolean true on success or false on failure. - - -### `offsetGet` - -__Offset to retrieve__ - - -#### Signature - -```php - public function offsetGet($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to retrieve. </p> | - -#### Return - - mixed Can return all value types. - - -### `offsetSet` - -__Offset to set__ - - -#### Signature - -```php - public function offsetSet($offset, $value); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to assign the value to. </p> | -| `$value` | mixed | <p> The value to set. </p> | - -#### Return - - void - - -### `offsetUnset` - -__Offset to unset__ - - -#### Signature - -```php - public function offsetUnset($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to unset. </p> | - -#### Return - - void - - diff --git a/docs/models/__NAMESPACE__.md b/docs/models/__NAMESPACE__.md index 67958b6..16ef7e5 100644 --- a/docs/models/__NAMESPACE__.md +++ b/docs/models/__NAMESPACE__.md @@ -43,7 +43,7 @@ | `getNextComponent` | Get the next namespace component (according the NS given) | | `getNamespace` | Get the namespace of the current reflected class | | `getReflexion` | Get the reflected class | -| `getType` | Return the real kind of class (Trait, Interface, Class) | +| `write` | | | `offsetExists` | Whether a offset exists | | `offsetGet` | Offset to retrieve | | `offsetSet` | Offset to set | @@ -61,6 +61,7 @@ | `hasParams` | | | `getParams` | | | `getModifiers` | | +| `write` | | | `offsetExists` | Whether a offset exists | | `offsetGet` | Offset to retrieve | | `offsetSet` | Offset to set | diff --git "a/docs/models/alphayax\\mdGen\\models\\ClassMd.md" "b/docs/models/alphayax\\mdGen\\models\\ClassMd.md" deleted file mode 100644 index 59e2d0f..0000000 --- "a/docs/models/alphayax\\mdGen\\models\\ClassMd.md" +++ /dev/null @@ -1,10 +0,0 @@ - -# - -**Namespace** : - -# Overview - - - ---- diff --git "a/docs/models/alphayax\\mdGen\\models\\MethodMd.md" "b/docs/models/alphayax\\mdGen\\models\\MethodMd.md" deleted file mode 100644 index 59e2d0f..0000000 --- "a/docs/models/alphayax\\mdGen\\models\\MethodMd.md" +++ /dev/null @@ -1,10 +0,0 @@ - -# - -**Namespace** : - -# Overview - - - ---- diff --git "a/docs/models/alphayax\\mdGen\\models\\NamespaceMd.md" "b/docs/models/alphayax\\mdGen\\models\\NamespaceMd.md" deleted file mode 100644 index 59e2d0f..0000000 --- "a/docs/models/alphayax\\mdGen\\models\\NamespaceMd.md" +++ /dev/null @@ -1,10 +0,0 @@ - -# - -**Namespace** : - -# Overview - - - ---- diff --git "a/docs/utils/alphayax\\mdGen\\utils\\arrayAccessProperties.md" "b/docs/utils/alphayax\\mdGen\\utils\\arrayAccessProperties.md" deleted file mode 100644 index 59e2d0f..0000000 --- "a/docs/utils/alphayax\\mdGen\\utils\\arrayAccessProperties.md" +++ /dev/null @@ -1,10 +0,0 @@ - -# - -**Namespace** : - -# Overview - - - ---- diff --git a/docs/utils/arrayAccessProperties.md b/docs/utils/arrayAccessProperties.md deleted file mode 100644 index c5dad46..0000000 --- a/docs/utils/arrayAccessProperties.md +++ /dev/null @@ -1,108 +0,0 @@ - -# **Trait** arrayAccessProperties - -Full name : `alphayax\mdGen\utils\arrayAccessProperties` - -## Properties - - -## Methods summary - -| Method | Description | -|---|---| -| `offsetExists` | Whether a offset exists | -| `offsetGet` | Offset to retrieve | -| `offsetSet` | Offset to set | -| `offsetUnset` | Offset to unset | - -## Methods details - -### `offsetExists` - -__Whether a offset exists__ - - -#### Signature - -```php - public function offsetExists($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> An offset to check for. </p> | - -#### Return - - boolean true on success or false on failure. - - -### `offsetGet` - -__Offset to retrieve__ - - -#### Signature - -```php - public function offsetGet($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to retrieve. </p> | - -#### Return - - mixed Can return all value types. - - -### `offsetSet` - -__Offset to set__ - - -#### Signature - -```php - public function offsetSet($offset, $value); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to assign the value to. </p> | -| `$value` | mixed | <p> The value to set. </p> | - -#### Return - - void - - -### `offsetUnset` - -__Offset to unset__ - - -#### Signature - -```php - public function offsetUnset($offset); -``` - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| `$offset` | mixed | <p> The offset to unset. </p> | - -#### Return - - void - - diff --git a/src/models/ClassMd.php b/src/models/ClassMd.php index 74103ff..289cdbf 100644 --- a/src/models/ClassMd.php +++ b/src/models/ClassMd.php @@ -106,10 +106,27 @@ public function getReflexion(){ return $this->reflexion; } - /** - * Return the real kind of class (Trait, Interface, Class) - */ - public function getType(){ + public function write( $path) { + + $m = new \Mustache_Engine([ + 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views'), + 'partials_loader' => new \Mustache_Loader_FilesystemLoader( __DIR__. '/../views/MethodMd'), + + ]); + + $generatedMd = $m->loadTemplate('Class')->render( $this); + $page_rd = $path . DIRECTORY_SEPARATOR . $this->getReflexion()->getShortName(); + /// Write page + @mkdir( $page_rd, 0777, true); + file_put_contents( $page_rd . DIRECTORY_SEPARATOR . '__CLASS__.md', $generatedMd); + + $this->writeMethods( $page_rd); + } + + private function writeMethods( $path) { + foreach( $this->methods as $method){ + $method->write( $path); + } } } diff --git a/src/models/MethodMd.php b/src/models/MethodMd.php index 44642a9..0dc2ee5 100644 --- a/src/models/MethodMd.php +++ b/src/models/MethodMd.php @@ -24,12 +24,14 @@ class MethodMd implements \ArrayAccess { /** @var mixed Method Return */ protected $return; + protected $impl; + /** * MethodMd constructor. * @param $className * @param $methodName */ - public function __construct($className, $methodName) { + public function __construct( $className, $methodName) { try { @@ -38,6 +40,22 @@ public function __construct($className, $methodName) { $this->name = $this->reflexion->getName(); $docBlock = $this->reflexion->getDocblock(); + /// Implementation + $this->impl = ''; + $f = fopen( $this->reflexion->getFileName(), 'r'); + $lineNo = 0; + while ($line = fgets($f)) { + $lineNo++; + if ($lineNo >= $this->reflexion->getStartLine()) { + $this->impl .= $line; + } + if ($lineNo == $this->reflexion->getEndLine()) { + break; + } + } + fclose($f); + + /// Desc $shortDesc = str_replace(PHP_EOL, ' ', $docBlock->getShortDescription()); $this->description = str_replace(PHP_EOL, ' ', $shortDesc); @@ -94,4 +112,18 @@ public function getModifiers() { } + /** + * @param $path + */ + public function write( $path) { + $m = new \Mustache_Engine([ + 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views'), + 'partials_loader' => new \Mustache_Loader_FilesystemLoader(__DIR__ . '/../views/MethodMd'), + + ]); + + $generatedMd = $m->loadTemplate('Method')->render( $this); + file_put_contents( $path . DIRECTORY_SEPARATOR . $this->name . '.md', $generatedMd); + } + } diff --git a/src/models/NamespaceMd.php b/src/models/NamespaceMd.php index 566662c..9204cb3 100644 --- a/src/models/NamespaceMd.php +++ b/src/models/NamespaceMd.php @@ -120,15 +120,8 @@ public function write(){ * */ protected function writeMdClasses() { - - $m = new \Mustache_Engine([ - 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views'), - 'partials_loader' => new \Mustache_Loader_FilesystemLoader(__DIR__ . '/../views/MethodMd'), - - ]); foreach( $this->classMds as $classMd){ - $generatedMd = $m->loadTemplate('Class')->render( $classMd); - file_put_contents( $this->page_rd . DIRECTORY_SEPARATOR . $classMd->getReflexion()->getShortName() . '.md', $generatedMd); + $classMd->write( $this->page_rd); } } diff --git a/src/views/Class.mustache b/src/views/Class.mustache index a192405..de93889 100644 --- a/src/views/Class.mustache +++ b/src/views/Class.mustache @@ -6,7 +6,7 @@ Full name : `{{ class }}` ## Properties {{# properties}} -- {{.}} +- `{{.}}` {{/ properties}} ## Methods summary @@ -14,22 +14,5 @@ Full name : `{{ class }}` | Method | Description | |---|---| {{# methods }} -| `{{name}}` | {{description}} | -{{/ methods }} - -## Methods details - -{{# methods }} -### `{{name}}` - -__{{description}}__ - - -{{> Signature}} - -{{> Param}} - -{{> Return}} - - +| [{{name}}]({{name}}.md) | {{description}} | {{/ methods }} diff --git a/src/views/Method.mustache b/src/views/Method.mustache new file mode 100644 index 0000000..62bb3b9 --- /dev/null +++ b/src/views/Method.mustache @@ -0,0 +1,21 @@ + +# {{ name }} + +**Class** : {{ reflexion.getDeclaringClass.getShortName }} +**Namespace** : {{ reflexion.getDeclaringClass.getNamespaceName }} + + +> {{description}} + + +{{> Signature}} + +{{> Param}} + +{{> Return}} + +## Implementation + +```php +{{{ impl }}} +``` From 7e449a5e714fbd92c616081395281fb69368439c Mon Sep 17 00:00:00 2001 From: alphayax Date: Mon, 4 Jul 2016 14:07:40 +0200 Subject: [PATCH 03/11] Add Method documentation --- docs/MdGen/__CLASS__.md | 22 ++++++ docs/MdGen/__construct.md | 37 +++++++++ docs/MdGen/filterNamespace.md | 39 +++++++++ docs/MdGen/filterSubClasses.md | 39 +++++++++ docs/MdGen/generate.md | 36 +++++++++ .../MdGen/generateClassMdFromLoadedClasses.md | 36 +++++++++ docs/MdGen/loadClasses.md | 46 +++++++++++ docs/models/ClassMd/__CLASS__.md | 29 +++++++ docs/models/ClassMd/__construct.md | 58 ++++++++++++++ docs/models/ClassMd/computeType.md | 39 +++++++++ docs/models/ClassMd/getNamespace.md | 31 ++++++++ docs/models/ClassMd/getNextComponent.md | 41 ++++++++++ docs/models/ClassMd/getReflexion.md | 32 ++++++++ docs/models/ClassMd/offsetExists.md | 34 ++++++++ docs/models/ClassMd/offsetGet.md | 34 ++++++++ docs/models/ClassMd/offsetSet.md | 35 ++++++++ docs/models/ClassMd/offsetUnset.md | 34 ++++++++ docs/models/ClassMd/write.md | 28 +++++++ docs/models/ClassMd/writeMethods.md | 28 +++++++ docs/models/MethodMd/__CLASS__.md | 27 +++++++ docs/models/MethodMd/__construct.md | 79 +++++++++++++++++++ docs/models/MethodMd/getModifiers.md | 39 +++++++++ docs/models/MethodMd/getParams.md | 36 +++++++++ docs/models/MethodMd/hasParams.md | 32 ++++++++ docs/models/MethodMd/offsetExists.md | 34 ++++++++ docs/models/MethodMd/offsetGet.md | 34 ++++++++ docs/models/MethodMd/offsetSet.md | 35 ++++++++ docs/models/MethodMd/offsetUnset.md | 34 ++++++++ docs/models/MethodMd/write.md | 40 ++++++++++ docs/models/NamespaceMd/__CLASS__.md | 30 +++++++ docs/models/NamespaceMd/__construct.md | 53 +++++++++++++ docs/models/NamespaceMd/computePageName.md | 33 ++++++++ docs/models/NamespaceMd/generateTree.md | 56 +++++++++++++ docs/models/NamespaceMd/getPageBfe.md | 32 ++++++++ docs/models/NamespaceMd/offsetExists.md | 34 ++++++++ docs/models/NamespaceMd/offsetGet.md | 34 ++++++++ docs/models/NamespaceMd/offsetSet.md | 35 ++++++++ docs/models/NamespaceMd/offsetUnset.md | 34 ++++++++ docs/models/NamespaceMd/setDirectory.md | 33 ++++++++ docs/models/NamespaceMd/write.md | 45 +++++++++++ docs/models/NamespaceMd/writeMdClasses.md | 33 ++++++++ docs/models/NamespaceMd/writeSubPages.md | 35 ++++++++ docs/models/ParamMd/__CLASS__.md | 20 +++++ docs/models/ParamMd/__construct.md | 35 ++++++++ docs/models/ParamMd/offsetExists.md | 34 ++++++++ docs/models/ParamMd/offsetGet.md | 34 ++++++++ docs/models/ParamMd/offsetSet.md | 35 ++++++++ docs/models/ParamMd/offsetUnset.md | 34 ++++++++ docs/utils/arrayAccessProperties/__CLASS__.md | 16 ++++ .../arrayAccessProperties/offsetExists.md | 34 ++++++++ docs/utils/arrayAccessProperties/offsetGet.md | 34 ++++++++ docs/utils/arrayAccessProperties/offsetSet.md | 35 ++++++++ .../arrayAccessProperties/offsetUnset.md | 34 ++++++++ 53 files changed, 1900 insertions(+) create mode 100644 docs/MdGen/__CLASS__.md create mode 100644 docs/MdGen/__construct.md create mode 100644 docs/MdGen/filterNamespace.md create mode 100644 docs/MdGen/filterSubClasses.md create mode 100644 docs/MdGen/generate.md create mode 100644 docs/MdGen/generateClassMdFromLoadedClasses.md create mode 100644 docs/MdGen/loadClasses.md create mode 100644 docs/models/ClassMd/__CLASS__.md create mode 100644 docs/models/ClassMd/__construct.md create mode 100644 docs/models/ClassMd/computeType.md create mode 100644 docs/models/ClassMd/getNamespace.md create mode 100644 docs/models/ClassMd/getNextComponent.md create mode 100644 docs/models/ClassMd/getReflexion.md create mode 100644 docs/models/ClassMd/offsetExists.md create mode 100644 docs/models/ClassMd/offsetGet.md create mode 100644 docs/models/ClassMd/offsetSet.md create mode 100644 docs/models/ClassMd/offsetUnset.md create mode 100644 docs/models/ClassMd/write.md create mode 100644 docs/models/ClassMd/writeMethods.md create mode 100644 docs/models/MethodMd/__CLASS__.md create mode 100644 docs/models/MethodMd/__construct.md create mode 100644 docs/models/MethodMd/getModifiers.md create mode 100644 docs/models/MethodMd/getParams.md create mode 100644 docs/models/MethodMd/hasParams.md create mode 100644 docs/models/MethodMd/offsetExists.md create mode 100644 docs/models/MethodMd/offsetGet.md create mode 100644 docs/models/MethodMd/offsetSet.md create mode 100644 docs/models/MethodMd/offsetUnset.md create mode 100644 docs/models/MethodMd/write.md create mode 100644 docs/models/NamespaceMd/__CLASS__.md create mode 100644 docs/models/NamespaceMd/__construct.md create mode 100644 docs/models/NamespaceMd/computePageName.md create mode 100644 docs/models/NamespaceMd/generateTree.md create mode 100644 docs/models/NamespaceMd/getPageBfe.md create mode 100644 docs/models/NamespaceMd/offsetExists.md create mode 100644 docs/models/NamespaceMd/offsetGet.md create mode 100644 docs/models/NamespaceMd/offsetSet.md create mode 100644 docs/models/NamespaceMd/offsetUnset.md create mode 100644 docs/models/NamespaceMd/setDirectory.md create mode 100644 docs/models/NamespaceMd/write.md create mode 100644 docs/models/NamespaceMd/writeMdClasses.md create mode 100644 docs/models/NamespaceMd/writeSubPages.md create mode 100644 docs/models/ParamMd/__CLASS__.md create mode 100644 docs/models/ParamMd/__construct.md create mode 100644 docs/models/ParamMd/offsetExists.md create mode 100644 docs/models/ParamMd/offsetGet.md create mode 100644 docs/models/ParamMd/offsetSet.md create mode 100644 docs/models/ParamMd/offsetUnset.md create mode 100644 docs/utils/arrayAccessProperties/__CLASS__.md create mode 100644 docs/utils/arrayAccessProperties/offsetExists.md create mode 100644 docs/utils/arrayAccessProperties/offsetGet.md create mode 100644 docs/utils/arrayAccessProperties/offsetSet.md create mode 100644 docs/utils/arrayAccessProperties/offsetUnset.md diff --git a/docs/MdGen/__CLASS__.md b/docs/MdGen/__CLASS__.md new file mode 100644 index 0000000..1748a13 --- /dev/null +++ b/docs/MdGen/__CLASS__.md @@ -0,0 +1,22 @@ + +# **Class** MdGen + +Full name : `alphayax\mdGen\MdGen` + +## Properties + +- `srcDirectory` +- `loadedClasses` +- `chapters` +- `rootPage` + +## Methods summary + +| Method | Description | +|---|---| +| [__construct](__construct.md) | MdGen constructor. | +| [loadClasses](loadClasses.md) | Load class in the source directory | +| [filterNamespace](filterNamespace.md) | Filter class who are in a specific namespace | +| [filterSubClasses](filterSubClasses.md) | Filter class who are sub-classes of a specific class | +| [generateClassMdFromLoadedClasses](generateClassMdFromLoadedClasses.md) | Create a chapter form loaded classes | +| [generate](generate.md) | Generate markdown files | diff --git a/docs/MdGen/__construct.md b/docs/MdGen/__construct.md new file mode 100644 index 0000000..a59f70b --- /dev/null +++ b/docs/MdGen/__construct.md @@ -0,0 +1,37 @@ + +# __construct + +**Class** : MdGen +**Namespace** : alphayax\mdGen + + +> MdGen constructor. + + +#### Signature + +```php + public function __construct(, ); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `` | $srcDirectory | | +| `` | $rootNamespace | | + +#### Return + + +## Implementation + +```php + public function __construct( $srcDirectory, $rootNamespace){ + $this->rootNamespace = $rootNamespace; + $this->srcDirectory = $srcDirectory; + $this->loadClasses(); + $this->filterNamespace( $rootNamespace); + } + +``` diff --git a/docs/MdGen/filterNamespace.md b/docs/MdGen/filterNamespace.md new file mode 100644 index 0000000..a65516d --- /dev/null +++ b/docs/MdGen/filterNamespace.md @@ -0,0 +1,39 @@ + +# filterNamespace + +**Class** : MdGen +**Namespace** : alphayax\mdGen + + +> Filter class who are in a specific namespace + + +#### Signature + +```php + public function filterNamespace($namespaceName); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$namespaceName` | string | Namespace Name to filter | + +#### Return + + +## Implementation + +```php + public function filterNamespace( $namespaceName) { + $FilteredClasses = []; + foreach( $this->loadedClasses as $loadedClass){ + if( 0 == substr_compare( $loadedClass, $namespaceName, 0, strlen( $namespaceName))){ + $FilteredClasses[] = $loadedClass; + } + } + $this->loadedClasses = $FilteredClasses; + } + +``` diff --git a/docs/MdGen/filterSubClasses.md b/docs/MdGen/filterSubClasses.md new file mode 100644 index 0000000..c336476 --- /dev/null +++ b/docs/MdGen/filterSubClasses.md @@ -0,0 +1,39 @@ + +# filterSubClasses + +**Class** : MdGen +**Namespace** : alphayax\mdGen + + +> Filter class who are sub-classes of a specific class + + +#### Signature + +```php + public function filterSubClasses($className); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$className` | string | Super class name to filter | + +#### Return + + +## Implementation + +```php + public function filterSubClasses( $className) { + $FilteredClasses = []; + foreach( $this->loadedClasses as $loadedClass){ + if( is_subclass_of( $loadedClass, $className)){ + $FilteredClasses[] = $loadedClass; + } + } + $this->loadedClasses = $FilteredClasses; + } + +``` diff --git a/docs/MdGen/generate.md b/docs/MdGen/generate.md new file mode 100644 index 0000000..bc76693 --- /dev/null +++ b/docs/MdGen/generate.md @@ -0,0 +1,36 @@ + +# generate + +**Class** : MdGen +**Namespace** : alphayax\mdGen + + +> Generate markdown files + + +#### Signature + +```php + public function generate($directory); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$directory` | string | Path to generated files | + +#### Return + + +## Implementation + +```php + public function generate( $directory = '.'){ + $chapters = $this->generateClassMdFromLoadedClasses(); + $this->rootPage = new models\NamespaceMd( $this->rootNamespace, $chapters); + $this->rootPage->setDirectory( $directory); + $this->rootPage->write(); + } + +``` diff --git a/docs/MdGen/generateClassMdFromLoadedClasses.md b/docs/MdGen/generateClassMdFromLoadedClasses.md new file mode 100644 index 0000000..c88084a --- /dev/null +++ b/docs/MdGen/generateClassMdFromLoadedClasses.md @@ -0,0 +1,36 @@ + +# generateClassMdFromLoadedClasses + +**Class** : MdGen +**Namespace** : alphayax\mdGen + + +> Create a chapter form loaded classes + + +#### Signature + +```php + protected function generateClassMdFromLoadedClasses(); +``` + +#### Parameters + + No parameters + +#### Return + + ClassMd[] + +## Implementation + +```php + protected function generateClassMdFromLoadedClasses(){ + $classMds = []; + foreach( $this->loadedClasses as $class){ + $classMds[] = new ClassMd( $class); + } + return $classMds; + } + +``` diff --git a/docs/MdGen/loadClasses.md b/docs/MdGen/loadClasses.md new file mode 100644 index 0000000..7bb1c16 --- /dev/null +++ b/docs/MdGen/loadClasses.md @@ -0,0 +1,46 @@ + +# loadClasses + +**Class** : MdGen +**Namespace** : alphayax\mdGen + + +> Load class in the source directory + + +#### Signature + +```php + protected function loadClasses(); +``` + +#### Parameters + + No parameters + +#### Return + + +## Implementation + +```php + protected function loadClasses(){ + if( ! is_dir( $this->srcDirectory)){ + throw new \Exception( 'Source directory not found : '. $this->srcDirectory); + } + + $objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator( $this->srcDirectory), \RecursiveIteratorIterator::SELF_FIRST); + $Regex = new \RegexIterator( $objects, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH); + foreach( $Regex as $name => $object){ + if ( ! empty( $name)) { + require_once $name; + } + } + + $classes = get_declared_classes(); + $traits = get_declared_traits(); + $interfaces = get_declared_interfaces(); + $this->loadedClasses = array_merge( $classes, $traits, $interfaces); + } + +``` diff --git a/docs/models/ClassMd/__CLASS__.md b/docs/models/ClassMd/__CLASS__.md new file mode 100644 index 0000000..5f538b9 --- /dev/null +++ b/docs/models/ClassMd/__CLASS__.md @@ -0,0 +1,29 @@ + +# **Class** ClassMd + +Full name : `alphayax\mdGen\models\ClassMd` + +## Properties + +- `class` +- `reflexion` +- `publicMethods` +- `methods` +- `type` +- `properties` + +## Methods summary + +| Method | Description | +|---|---| +| [__construct](__construct.md) | ClassChapter constructor. | +| [computeType](computeType.md) | Determine the type of class | +| [getNextComponent](getNextComponent.md) | Get the next namespace component (according the NS given) | +| [getNamespace](getNamespace.md) | Get the namespace of the current reflected class | +| [getReflexion](getReflexion.md) | Get the reflected class | +| [write](write.md) | | +| [writeMethods](writeMethods.md) | | +| [offsetExists](offsetExists.md) | Whether a offset exists | +| [offsetGet](offsetGet.md) | Offset to retrieve | +| [offsetSet](offsetSet.md) | Offset to set | +| [offsetUnset](offsetUnset.md) | Offset to unset | diff --git a/docs/models/ClassMd/__construct.md b/docs/models/ClassMd/__construct.md new file mode 100644 index 0000000..ec41208 --- /dev/null +++ b/docs/models/ClassMd/__construct.md @@ -0,0 +1,58 @@ + +# __construct + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> ClassChapter constructor. + + +#### Signature + +```php + public function __construct($class); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$class` | string | | + +#### Return + + +## Implementation + +```php + public function __construct( $class){ + $this->class = $class; + $this->reflexion = new \ReflectionClass( $class); + $this->computeType(); + $properties = $this->reflexion->getProperties(); + foreach ($properties as $property){ + $this->properties[] = $property->getName(); + } + + $methods = $this->reflexion->getMethods(); + foreach ( $methods as $method){ + + $methodMd = new MethodMd( $this->reflexion->getName(), $method->getName()); + $this->methods[] = $methodMd; + + /// Filter only public and non constructor methods + if( ! $method->isPublic() || $method->isConstructor()){ + continue; + } + + /// Filter only methods inside class (not derived) + if( $method->getDeclaringClass()->getName() != $this->reflexion->getName()){ + continue; + } + + $this->publicMethods[] = $methodMd; + } + } + +``` diff --git a/docs/models/ClassMd/computeType.md b/docs/models/ClassMd/computeType.md new file mode 100644 index 0000000..27c0c8f --- /dev/null +++ b/docs/models/ClassMd/computeType.md @@ -0,0 +1,39 @@ + +# computeType + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> Determine the type of class + + +#### Signature + +```php + protected function computeType(); +``` + +#### Parameters + + No parameters + +#### Return + + +## Implementation + +```php + protected function computeType(){ + if( interface_exists( $this->class, false)){ + $this->type = 'Interface'; + return; + } + if( trait_exists( $this->class, false)){ + $this->type = 'Trait'; + return; + } + $this->type = 'Class'; + } + +``` diff --git a/docs/models/ClassMd/getNamespace.md b/docs/models/ClassMd/getNamespace.md new file mode 100644 index 0000000..8d9ae0c --- /dev/null +++ b/docs/models/ClassMd/getNamespace.md @@ -0,0 +1,31 @@ + +# getNamespace + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> Get the namespace of the current reflected class + + +#### Signature + +```php + public function getNamespace(); +``` + +#### Parameters + + No parameters + +#### Return + + +## Implementation + +```php + public function getNamespace() { + return $this->reflexion->getNamespaceName(); + } + +``` diff --git a/docs/models/ClassMd/getNextComponent.md b/docs/models/ClassMd/getNextComponent.md new file mode 100644 index 0000000..c52fe54 --- /dev/null +++ b/docs/models/ClassMd/getNextComponent.md @@ -0,0 +1,41 @@ + +# getNextComponent + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> Get the next namespace component (according the NS given) + + +#### Signature + +```php + public function getNextComponent($namespace); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$namespace` | string | | + +#### Return + + string + +## Implementation + +```php + public function getNextComponent( $namespace) { + $namespaceComponents = explode( '\\', $namespace); + $class_x = explode( '\\', $this->class); + + while( array_shift( $namespaceComponents)){ + array_shift( $class_x); + } + + return array_shift( $class_x); + } + +``` diff --git a/docs/models/ClassMd/getReflexion.md b/docs/models/ClassMd/getReflexion.md new file mode 100644 index 0000000..ab7c978 --- /dev/null +++ b/docs/models/ClassMd/getReflexion.md @@ -0,0 +1,32 @@ + +# getReflexion + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> Get the reflected class + + +#### Signature + +```php + public function getReflexion(); +``` + +#### Parameters + + No parameters + +#### Return + + \ReflectionClass + +## Implementation + +```php + public function getReflexion(){ + return $this->reflexion; + } + +``` diff --git a/docs/models/ClassMd/offsetExists.md b/docs/models/ClassMd/offsetExists.md new file mode 100644 index 0000000..ec92b46 --- /dev/null +++ b/docs/models/ClassMd/offsetExists.md @@ -0,0 +1,34 @@ + +# offsetExists + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> Whether a offset exists + + +#### Signature + +```php + public function offsetExists($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> An offset to check for. </p> | + +#### Return + + boolean true on success or false on failure. + +## Implementation + +```php + public function offsetExists($offset) { + return property_exists( static::class, $offset); + } + +``` diff --git a/docs/models/ClassMd/offsetGet.md b/docs/models/ClassMd/offsetGet.md new file mode 100644 index 0000000..f5d14fe --- /dev/null +++ b/docs/models/ClassMd/offsetGet.md @@ -0,0 +1,34 @@ + +# offsetGet + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> Offset to retrieve + + +#### Signature + +```php + public function offsetGet($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to retrieve. </p> | + +#### Return + + mixed Can return all value types. + +## Implementation + +```php + public function offsetGet( $offset) { + return $this->$offset; + } + +``` diff --git a/docs/models/ClassMd/offsetSet.md b/docs/models/ClassMd/offsetSet.md new file mode 100644 index 0000000..88d63c8 --- /dev/null +++ b/docs/models/ClassMd/offsetSet.md @@ -0,0 +1,35 @@ + +# offsetSet + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> Offset to set + + +#### Signature + +```php + public function offsetSet($offset, $value); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to assign the value to. </p> | +| `$value` | mixed | <p> The value to set. </p> | + +#### Return + + void + +## Implementation + +```php + public function offsetSet( $offset, $value) { + $this->$offset = $value; + } + +``` diff --git a/docs/models/ClassMd/offsetUnset.md b/docs/models/ClassMd/offsetUnset.md new file mode 100644 index 0000000..e53d3bb --- /dev/null +++ b/docs/models/ClassMd/offsetUnset.md @@ -0,0 +1,34 @@ + +# offsetUnset + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> Offset to unset + + +#### Signature + +```php + public function offsetUnset($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to unset. </p> | + +#### Return + + void + +## Implementation + +```php + public function offsetUnset($offset) { + $this->$offset = null; + } + +``` diff --git a/docs/models/ClassMd/write.md b/docs/models/ClassMd/write.md new file mode 100644 index 0000000..7631307 --- /dev/null +++ b/docs/models/ClassMd/write.md @@ -0,0 +1,28 @@ + +# write + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> + + +#### Signature + +```php + public function write(); +``` + +#### Parameters + + No parameters + +#### Return + + +## Implementation + +```php + +``` diff --git a/docs/models/ClassMd/writeMethods.md b/docs/models/ClassMd/writeMethods.md new file mode 100644 index 0000000..b5b3b7e --- /dev/null +++ b/docs/models/ClassMd/writeMethods.md @@ -0,0 +1,28 @@ + +# writeMethods + +**Class** : ClassMd +**Namespace** : alphayax\mdGen\models + + +> + + +#### Signature + +```php + private function writeMethods(); +``` + +#### Parameters + + No parameters + +#### Return + + +## Implementation + +```php + +``` diff --git a/docs/models/MethodMd/__CLASS__.md b/docs/models/MethodMd/__CLASS__.md new file mode 100644 index 0000000..2fa44f8 --- /dev/null +++ b/docs/models/MethodMd/__CLASS__.md @@ -0,0 +1,27 @@ + +# **Class** MethodMd + +Full name : `alphayax\mdGen\models\MethodMd` + +## Properties + +- `reflexion` +- `name` +- `description` +- `params` +- `return` +- `impl` + +## Methods summary + +| Method | Description | +|---|---| +| [__construct](__construct.md) | MethodMd constructor. | +| [hasParams](hasParams.md) | | +| [getParams](getParams.md) | | +| [getModifiers](getModifiers.md) | | +| [write](write.md) | | +| [offsetExists](offsetExists.md) | Whether a offset exists | +| [offsetGet](offsetGet.md) | Offset to retrieve | +| [offsetSet](offsetSet.md) | Offset to set | +| [offsetUnset](offsetUnset.md) | Offset to unset | diff --git a/docs/models/MethodMd/__construct.md b/docs/models/MethodMd/__construct.md new file mode 100644 index 0000000..ef6e700 --- /dev/null +++ b/docs/models/MethodMd/__construct.md @@ -0,0 +1,79 @@ + +# __construct + +**Class** : MethodMd +**Namespace** : alphayax\mdGen\models + + +> MethodMd constructor. + + +#### Signature + +```php + public function __construct(, ); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `` | $className | | +| `` | $methodName | | + +#### Return + + +## Implementation + +```php + public function __construct( $className, $methodName) { + + try { + + $this->reflexion = new \Zend_Reflection_Method( $className, $methodName); + + $this->name = $this->reflexion->getName(); + $docBlock = $this->reflexion->getDocblock(); + + /// Implementation + $this->impl = ''; + $f = fopen( $this->reflexion->getFileName(), 'r'); + $lineNo = 0; + while ($line = fgets($f)) { + $lineNo++; + if ($lineNo >= $this->reflexion->getStartLine()) { + $this->impl .= $line; + } + if ($lineNo == $this->reflexion->getEndLine()) { + break; + } + } + fclose($f); + + + /// Desc + $shortDesc = str_replace(PHP_EOL, ' ', $docBlock->getShortDescription()); + $this->description = str_replace(PHP_EOL, ' ', $shortDesc); + + /// Params + /** @var \Zend_Reflection_Docblock_Tag_Param[] $params */ + $params = $docBlock->getTags( 'param'); + foreach ( $params as $param){ + $this->params[] = new ParamMd( $param); + } + + /** @var \Zend_Reflection_Docblock_Tag_Return $return */ + $return = $docBlock->getTag( 'return'); + if( $return){ + $this->return = $return->getType() . ' ' . $return->getDescription(); + } + + + + } catch (\Exception $e) { + // Unable to parse PHPDoc Block... Skip it :( + } + } + +``` diff --git a/docs/models/MethodMd/getModifiers.md b/docs/models/MethodMd/getModifiers.md new file mode 100644 index 0000000..b44d77b --- /dev/null +++ b/docs/models/MethodMd/getModifiers.md @@ -0,0 +1,39 @@ + +# getModifiers + +**Class** : MethodMd +**Namespace** : alphayax\mdGen\models + + +> + + +#### Signature + +```php + public function getModifiers(); +``` + +#### Parameters + + No parameters + +#### Return + + string + +## Implementation + +```php + public function getModifiers() { + return + ($this->reflexion->isFinal() ? ' final' : ''). + ($this->reflexion->isAbstract() ? ' abstract' : ''). + ($this->reflexion->isPublic() ? ' public' : ''). + ($this->reflexion->isProtected() ? ' protected' : ''). + ($this->reflexion->isPrivate() ? ' private' : ''). + ($this->reflexion->isStatic() ? ' static' : ''); + + } + +``` diff --git a/docs/models/MethodMd/getParams.md b/docs/models/MethodMd/getParams.md new file mode 100644 index 0000000..fe16df1 --- /dev/null +++ b/docs/models/MethodMd/getParams.md @@ -0,0 +1,36 @@ + +# getParams + +**Class** : MethodMd +**Namespace** : alphayax\mdGen\models + + +> + + +#### Signature + +```php + public function getParams(); +``` + +#### Parameters + + No parameters + +#### Return + + string + +## Implementation + +```php + public function getParams(){ + $variablesNames = []; + foreach( $this->params as $param){ + $variablesNames[] = $param['variableName']; + } + return implode(', ', $variablesNames); + } + +``` diff --git a/docs/models/MethodMd/hasParams.md b/docs/models/MethodMd/hasParams.md new file mode 100644 index 0000000..d959ef5 --- /dev/null +++ b/docs/models/MethodMd/hasParams.md @@ -0,0 +1,32 @@ + +# hasParams + +**Class** : MethodMd +**Namespace** : alphayax\mdGen\models + + +> + + +#### Signature + +```php + public function hasParams(); +``` + +#### Parameters + + No parameters + +#### Return + + bool + +## Implementation + +```php + public function hasParams() { + return ! empty( $this->params); + } + +``` diff --git a/docs/models/MethodMd/offsetExists.md b/docs/models/MethodMd/offsetExists.md new file mode 100644 index 0000000..77a702e --- /dev/null +++ b/docs/models/MethodMd/offsetExists.md @@ -0,0 +1,34 @@ + +# offsetExists + +**Class** : MethodMd +**Namespace** : alphayax\mdGen\models + + +> Whether a offset exists + + +#### Signature + +```php + public function offsetExists($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> An offset to check for. </p> | + +#### Return + + boolean true on success or false on failure. + +## Implementation + +```php + public function offsetExists($offset) { + return property_exists( static::class, $offset); + } + +``` diff --git a/docs/models/MethodMd/offsetGet.md b/docs/models/MethodMd/offsetGet.md new file mode 100644 index 0000000..bdcc059 --- /dev/null +++ b/docs/models/MethodMd/offsetGet.md @@ -0,0 +1,34 @@ + +# offsetGet + +**Class** : MethodMd +**Namespace** : alphayax\mdGen\models + + +> Offset to retrieve + + +#### Signature + +```php + public function offsetGet($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to retrieve. </p> | + +#### Return + + mixed Can return all value types. + +## Implementation + +```php + public function offsetGet( $offset) { + return $this->$offset; + } + +``` diff --git a/docs/models/MethodMd/offsetSet.md b/docs/models/MethodMd/offsetSet.md new file mode 100644 index 0000000..1068836 --- /dev/null +++ b/docs/models/MethodMd/offsetSet.md @@ -0,0 +1,35 @@ + +# offsetSet + +**Class** : MethodMd +**Namespace** : alphayax\mdGen\models + + +> Offset to set + + +#### Signature + +```php + public function offsetSet($offset, $value); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to assign the value to. </p> | +| `$value` | mixed | <p> The value to set. </p> | + +#### Return + + void + +## Implementation + +```php + public function offsetSet( $offset, $value) { + $this->$offset = $value; + } + +``` diff --git a/docs/models/MethodMd/offsetUnset.md b/docs/models/MethodMd/offsetUnset.md new file mode 100644 index 0000000..d59ca15 --- /dev/null +++ b/docs/models/MethodMd/offsetUnset.md @@ -0,0 +1,34 @@ + +# offsetUnset + +**Class** : MethodMd +**Namespace** : alphayax\mdGen\models + + +> Offset to unset + + +#### Signature + +```php + public function offsetUnset($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to unset. </p> | + +#### Return + + void + +## Implementation + +```php + public function offsetUnset($offset) { + $this->$offset = null; + } + +``` diff --git a/docs/models/MethodMd/write.md b/docs/models/MethodMd/write.md new file mode 100644 index 0000000..a1399ff --- /dev/null +++ b/docs/models/MethodMd/write.md @@ -0,0 +1,40 @@ + +# write + +**Class** : MethodMd +**Namespace** : alphayax\mdGen\models + + +> + + +#### Signature + +```php + public function write(); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `` | $path | | + +#### Return + + +## Implementation + +```php + public function write( $path) { + $m = new \Mustache_Engine([ + 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views'), + 'partials_loader' => new \Mustache_Loader_FilesystemLoader(__DIR__ . '/../views/MethodMd'), + + ]); + + $generatedMd = $m->loadTemplate('Method')->render( $this); + file_put_contents( $path . DIRECTORY_SEPARATOR . $this->name . '.md', $generatedMd); + } + +``` diff --git a/docs/models/NamespaceMd/__CLASS__.md b/docs/models/NamespaceMd/__CLASS__.md new file mode 100644 index 0000000..4113452 --- /dev/null +++ b/docs/models/NamespaceMd/__CLASS__.md @@ -0,0 +1,30 @@ + +# **Class** NamespaceMd + +Full name : `alphayax\mdGen\models\NamespaceMd` + +## Properties + +- `classMds` +- `subPages` +- `namespace` +- `page_bfe` +- `page_rd` +- `pageName` + +## Methods summary + +| Method | Description | +|---|---| +| [__construct](__construct.md) | Page constructor | +| [computePageName](computePageName.md) | Compute the page name (according to the page namespace) | +| [generateTree](generateTree.md) | Generate overview markdown tree | +| [write](write.md) | Write markdown file | +| [writeMdClasses](writeMdClasses.md) | | +| [writeSubPages](writeSubPages.md) | Write sub pages of this page | +| [setDirectory](setDirectory.md) | Define the current page directory | +| [getPageBfe](getPageBfe.md) | Return the page basename file with extension | +| [offsetExists](offsetExists.md) | Whether a offset exists | +| [offsetGet](offsetGet.md) | Offset to retrieve | +| [offsetSet](offsetSet.md) | Offset to set | +| [offsetUnset](offsetUnset.md) | Offset to unset | diff --git a/docs/models/NamespaceMd/__construct.md b/docs/models/NamespaceMd/__construct.md new file mode 100644 index 0000000..c70c8c6 --- /dev/null +++ b/docs/models/NamespaceMd/__construct.md @@ -0,0 +1,53 @@ + +# __construct + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Page constructor + + +#### Signature + +```php + public function __construct($pageNamespace, $chapters); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$pageNamespace` | string | | +| `$chapters` | ClassMd[] | | + +#### Return + + +## Implementation + +```php + public function __construct( $pageNamespace, array $chapters) { + $this->namespace = $pageNamespace; + $this->pageName = $this->computePageName(); + $this->page_bfe = '__NAMESPACE__.md'; + + $pagesBtComponents = []; + foreach( $chapters as $chapter){ + + if( $chapter->getNamespace() == $pageNamespace){ + $this->classMds[] = $chapter; + continue; + } + + $component = $chapter->getNextComponent( $pageNamespace); + $pagesBtComponents[ $component][] = $chapter; + } + + $subPages = array_keys( $pagesBtComponents); + foreach( $subPages as $subPage){ + $this->subPages[$subPage] = new NamespaceMd( $pageNamespace . '\\'. $subPage, $pagesBtComponents[$subPage]); + } + } + +``` diff --git a/docs/models/NamespaceMd/computePageName.md b/docs/models/NamespaceMd/computePageName.md new file mode 100644 index 0000000..d0c39e8 --- /dev/null +++ b/docs/models/NamespaceMd/computePageName.md @@ -0,0 +1,33 @@ + +# computePageName + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Compute the page name (according to the page namespace) + + +#### Signature + +```php + protected function computePageName(); +``` + +#### Parameters + + No parameters + +#### Return + + string + +## Implementation + +```php + protected function computePageName(){ + $namespaceComponents = explode( '\\', $this->namespace); + return array_pop( $namespaceComponents); + } + +``` diff --git a/docs/models/NamespaceMd/generateTree.md b/docs/models/NamespaceMd/generateTree.md new file mode 100644 index 0000000..06ae1e5 --- /dev/null +++ b/docs/models/NamespaceMd/generateTree.md @@ -0,0 +1,56 @@ + +# generateTree + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Generate overview markdown tree + + +#### Signature + +```php + public function generateTree($pad, $relativePath); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$pad` | string | | +| `$relativePath` | string | | + +#### Return + + string + +## Implementation + +```php + public function generateTree( $pad = '', $relativePath = '') { + $generatedMd = ''; + + /// SubPages + if( ! empty( $this->subPages)){ + foreach( $this->subPages as $subPageName => $subPage){ + $subPageFile = './' . $relativePath . $subPageName . DIRECTORY_SEPARATOR . $subPage->getPageBfe(); + $generatedMd .= "$pad- [$subPageName]($subPageFile)". PHP_EOL; + $generatedMd .= $subPage->generateTree( $pad . ' ', $relativePath . $subPageName . DIRECTORY_SEPARATOR); + } + } + + /// Chapters + if( ! empty( $this->classMds)){ + foreach($this->classMds as $chapter){ + $chapterName = $chapter->getReflexion()->getShortName(); + $chapterFile = $relativePath . $this->getPageBfe(); + $chapterAnchor = $chapterFile .'#'. $chapter->getReflexion()->getShortName(); + $generatedMd .= "$pad- [$chapterName]($chapterAnchor)" . PHP_EOL; + } + } + + return $generatedMd; + } + +``` diff --git a/docs/models/NamespaceMd/getPageBfe.md b/docs/models/NamespaceMd/getPageBfe.md new file mode 100644 index 0000000..40e00c7 --- /dev/null +++ b/docs/models/NamespaceMd/getPageBfe.md @@ -0,0 +1,32 @@ + +# getPageBfe + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Return the page basename file with extension + + +#### Signature + +```php + public function getPageBfe(); +``` + +#### Parameters + + No parameters + +#### Return + + string The page base name + +## Implementation + +```php + public function getPageBfe() { + return $this->page_bfe; + } + +``` diff --git a/docs/models/NamespaceMd/offsetExists.md b/docs/models/NamespaceMd/offsetExists.md new file mode 100644 index 0000000..a6a1b1d --- /dev/null +++ b/docs/models/NamespaceMd/offsetExists.md @@ -0,0 +1,34 @@ + +# offsetExists + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Whether a offset exists + + +#### Signature + +```php + public function offsetExists($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> An offset to check for. </p> | + +#### Return + + boolean true on success or false on failure. + +## Implementation + +```php + public function offsetExists($offset) { + return property_exists( static::class, $offset); + } + +``` diff --git a/docs/models/NamespaceMd/offsetGet.md b/docs/models/NamespaceMd/offsetGet.md new file mode 100644 index 0000000..9a19c2f --- /dev/null +++ b/docs/models/NamespaceMd/offsetGet.md @@ -0,0 +1,34 @@ + +# offsetGet + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Offset to retrieve + + +#### Signature + +```php + public function offsetGet($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to retrieve. </p> | + +#### Return + + mixed Can return all value types. + +## Implementation + +```php + public function offsetGet( $offset) { + return $this->$offset; + } + +``` diff --git a/docs/models/NamespaceMd/offsetSet.md b/docs/models/NamespaceMd/offsetSet.md new file mode 100644 index 0000000..fd9e0d6 --- /dev/null +++ b/docs/models/NamespaceMd/offsetSet.md @@ -0,0 +1,35 @@ + +# offsetSet + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Offset to set + + +#### Signature + +```php + public function offsetSet($offset, $value); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to assign the value to. </p> | +| `$value` | mixed | <p> The value to set. </p> | + +#### Return + + void + +## Implementation + +```php + public function offsetSet( $offset, $value) { + $this->$offset = $value; + } + +``` diff --git a/docs/models/NamespaceMd/offsetUnset.md b/docs/models/NamespaceMd/offsetUnset.md new file mode 100644 index 0000000..3ad10fe --- /dev/null +++ b/docs/models/NamespaceMd/offsetUnset.md @@ -0,0 +1,34 @@ + +# offsetUnset + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Offset to unset + + +#### Signature + +```php + public function offsetUnset($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to unset. </p> | + +#### Return + + void + +## Implementation + +```php + public function offsetUnset($offset) { + $this->$offset = null; + } + +``` diff --git a/docs/models/NamespaceMd/setDirectory.md b/docs/models/NamespaceMd/setDirectory.md new file mode 100644 index 0000000..b5382e6 --- /dev/null +++ b/docs/models/NamespaceMd/setDirectory.md @@ -0,0 +1,33 @@ + +# setDirectory + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Define the current page directory + + +#### Signature + +```php + public function setDirectory(); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `` | $string | | + +#### Return + + +## Implementation + +```php + public function setDirectory( $string) { + $this->page_rd = $string; + } + +``` diff --git a/docs/models/NamespaceMd/write.md b/docs/models/NamespaceMd/write.md new file mode 100644 index 0000000..8759349 --- /dev/null +++ b/docs/models/NamespaceMd/write.md @@ -0,0 +1,45 @@ + +# write + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Write markdown file + + +#### Signature + +```php + public function write(); +``` + +#### Parameters + + No parameters + +#### Return + + +## Implementation + +```php + public function write(){ + + $m = new \Mustache_Engine([ + 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views') + ]); + $template = $m->loadTemplate('Page'); + + $generatedMd = $template->render( $this); + + /// Write page + @mkdir( $this->page_rd, 0777, true); + file_put_contents( $this->page_rd . DIRECTORY_SEPARATOR . $this->page_bfe, $generatedMd); + + + $this->writeMdClasses(); + $this->writeSubPages(); + } + +``` diff --git a/docs/models/NamespaceMd/writeMdClasses.md b/docs/models/NamespaceMd/writeMdClasses.md new file mode 100644 index 0000000..8b91931 --- /dev/null +++ b/docs/models/NamespaceMd/writeMdClasses.md @@ -0,0 +1,33 @@ + +# writeMdClasses + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> + + +#### Signature + +```php + protected function writeMdClasses(); +``` + +#### Parameters + + No parameters + +#### Return + + +## Implementation + +```php + protected function writeMdClasses() { + foreach( $this->classMds as $classMd){ + $classMd->write( $this->page_rd); + } + } + +``` diff --git a/docs/models/NamespaceMd/writeSubPages.md b/docs/models/NamespaceMd/writeSubPages.md new file mode 100644 index 0000000..8a59b48 --- /dev/null +++ b/docs/models/NamespaceMd/writeSubPages.md @@ -0,0 +1,35 @@ + +# writeSubPages + +**Class** : NamespaceMd +**Namespace** : alphayax\mdGen\models + + +> Write sub pages of this page + + +#### Signature + +```php + public function writeSubPages(); +``` + +#### Parameters + + No parameters + +#### Return + + +## Implementation + +```php + public function writeSubPages() { + foreach( $this->subPages as $subPageName => $subPage) { + $subPageDirectory = $this->page_rd . DIRECTORY_SEPARATOR . $subPageName; + $subPage->setDirectory( $subPageDirectory); + $subPage->write(); + } + } + +``` diff --git a/docs/models/ParamMd/__CLASS__.md b/docs/models/ParamMd/__CLASS__.md new file mode 100644 index 0000000..1ae7d49 --- /dev/null +++ b/docs/models/ParamMd/__CLASS__.md @@ -0,0 +1,20 @@ + +# **Class** ParamMd + +Full name : `alphayax\mdGen\models\ParamMd` + +## Properties + +- `type` +- `description` +- `variableName` + +## Methods summary + +| Method | Description | +|---|---| +| [__construct](__construct.md) | ParamMd constructor. | +| [offsetExists](offsetExists.md) | Whether a offset exists | +| [offsetGet](offsetGet.md) | Offset to retrieve | +| [offsetSet](offsetSet.md) | Offset to set | +| [offsetUnset](offsetUnset.md) | Offset to unset | diff --git a/docs/models/ParamMd/__construct.md b/docs/models/ParamMd/__construct.md new file mode 100644 index 0000000..c74e75f --- /dev/null +++ b/docs/models/ParamMd/__construct.md @@ -0,0 +1,35 @@ + +# __construct + +**Class** : ParamMd +**Namespace** : alphayax\mdGen\models + + +> ParamMd constructor. + + +#### Signature + +```php + public function __construct($param); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$param` | \Zend_Reflection_Docblock_Tag_Param | | + +#### Return + + +## Implementation + +```php + public function __construct( \Zend_Reflection_Docblock_Tag_Param $param){ + $this->type = $param->getType(); + $this->description = $param->getDescription(); + $this->variableName = $param->getVariableName(); + } + +``` diff --git a/docs/models/ParamMd/offsetExists.md b/docs/models/ParamMd/offsetExists.md new file mode 100644 index 0000000..b21ab7a --- /dev/null +++ b/docs/models/ParamMd/offsetExists.md @@ -0,0 +1,34 @@ + +# offsetExists + +**Class** : ParamMd +**Namespace** : alphayax\mdGen\models + + +> Whether a offset exists + + +#### Signature + +```php + public function offsetExists($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> An offset to check for. </p> | + +#### Return + + boolean true on success or false on failure. + +## Implementation + +```php + public function offsetExists($offset) { + return property_exists( static::class, $offset); + } + +``` diff --git a/docs/models/ParamMd/offsetGet.md b/docs/models/ParamMd/offsetGet.md new file mode 100644 index 0000000..f32a1df --- /dev/null +++ b/docs/models/ParamMd/offsetGet.md @@ -0,0 +1,34 @@ + +# offsetGet + +**Class** : ParamMd +**Namespace** : alphayax\mdGen\models + + +> Offset to retrieve + + +#### Signature + +```php + public function offsetGet($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to retrieve. </p> | + +#### Return + + mixed Can return all value types. + +## Implementation + +```php + public function offsetGet( $offset) { + return $this->$offset; + } + +``` diff --git a/docs/models/ParamMd/offsetSet.md b/docs/models/ParamMd/offsetSet.md new file mode 100644 index 0000000..96153b3 --- /dev/null +++ b/docs/models/ParamMd/offsetSet.md @@ -0,0 +1,35 @@ + +# offsetSet + +**Class** : ParamMd +**Namespace** : alphayax\mdGen\models + + +> Offset to set + + +#### Signature + +```php + public function offsetSet($offset, $value); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to assign the value to. </p> | +| `$value` | mixed | <p> The value to set. </p> | + +#### Return + + void + +## Implementation + +```php + public function offsetSet( $offset, $value) { + $this->$offset = $value; + } + +``` diff --git a/docs/models/ParamMd/offsetUnset.md b/docs/models/ParamMd/offsetUnset.md new file mode 100644 index 0000000..67816de --- /dev/null +++ b/docs/models/ParamMd/offsetUnset.md @@ -0,0 +1,34 @@ + +# offsetUnset + +**Class** : ParamMd +**Namespace** : alphayax\mdGen\models + + +> Offset to unset + + +#### Signature + +```php + public function offsetUnset($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to unset. </p> | + +#### Return + + void + +## Implementation + +```php + public function offsetUnset($offset) { + $this->$offset = null; + } + +``` diff --git a/docs/utils/arrayAccessProperties/__CLASS__.md b/docs/utils/arrayAccessProperties/__CLASS__.md new file mode 100644 index 0000000..aa282ae --- /dev/null +++ b/docs/utils/arrayAccessProperties/__CLASS__.md @@ -0,0 +1,16 @@ + +# **Trait** arrayAccessProperties + +Full name : `alphayax\mdGen\utils\arrayAccessProperties` + +## Properties + + +## Methods summary + +| Method | Description | +|---|---| +| [offsetExists](offsetExists.md) | Whether a offset exists | +| [offsetGet](offsetGet.md) | Offset to retrieve | +| [offsetSet](offsetSet.md) | Offset to set | +| [offsetUnset](offsetUnset.md) | Offset to unset | diff --git a/docs/utils/arrayAccessProperties/offsetExists.md b/docs/utils/arrayAccessProperties/offsetExists.md new file mode 100644 index 0000000..7ff7757 --- /dev/null +++ b/docs/utils/arrayAccessProperties/offsetExists.md @@ -0,0 +1,34 @@ + +# offsetExists + +**Class** : arrayAccessProperties +**Namespace** : alphayax\mdGen\utils + + +> Whether a offset exists + + +#### Signature + +```php + public function offsetExists($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> An offset to check for. </p> | + +#### Return + + boolean true on success or false on failure. + +## Implementation + +```php + public function offsetExists($offset) { + return property_exists( static::class, $offset); + } + +``` diff --git a/docs/utils/arrayAccessProperties/offsetGet.md b/docs/utils/arrayAccessProperties/offsetGet.md new file mode 100644 index 0000000..cd3f0a9 --- /dev/null +++ b/docs/utils/arrayAccessProperties/offsetGet.md @@ -0,0 +1,34 @@ + +# offsetGet + +**Class** : arrayAccessProperties +**Namespace** : alphayax\mdGen\utils + + +> Offset to retrieve + + +#### Signature + +```php + public function offsetGet($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to retrieve. </p> | + +#### Return + + mixed Can return all value types. + +## Implementation + +```php + public function offsetGet( $offset) { + return $this->$offset; + } + +``` diff --git a/docs/utils/arrayAccessProperties/offsetSet.md b/docs/utils/arrayAccessProperties/offsetSet.md new file mode 100644 index 0000000..ea8222c --- /dev/null +++ b/docs/utils/arrayAccessProperties/offsetSet.md @@ -0,0 +1,35 @@ + +# offsetSet + +**Class** : arrayAccessProperties +**Namespace** : alphayax\mdGen\utils + + +> Offset to set + + +#### Signature + +```php + public function offsetSet($offset, $value); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to assign the value to. </p> | +| `$value` | mixed | <p> The value to set. </p> | + +#### Return + + void + +## Implementation + +```php + public function offsetSet( $offset, $value) { + $this->$offset = $value; + } + +``` diff --git a/docs/utils/arrayAccessProperties/offsetUnset.md b/docs/utils/arrayAccessProperties/offsetUnset.md new file mode 100644 index 0000000..0be563d --- /dev/null +++ b/docs/utils/arrayAccessProperties/offsetUnset.md @@ -0,0 +1,34 @@ + +# offsetUnset + +**Class** : arrayAccessProperties +**Namespace** : alphayax\mdGen\utils + + +> Offset to unset + + +#### Signature + +```php + public function offsetUnset($offset); +``` + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| `$offset` | mixed | <p> The offset to unset. </p> | + +#### Return + + void + +## Implementation + +```php + public function offsetUnset($offset) { + $this->$offset = null; + } + +``` From 3f4df99a3606209b2b63ded9b9bf559422f2130c Mon Sep 17 00:00:00 2001 From: alphayax Date: Mon, 4 Jul 2016 14:18:30 +0200 Subject: [PATCH 04/11] Update namespace page --- docs/__NAMESPACE__.md | 31 +++------ docs/models/NamespaceMd/generateTree.md | 9 ++- docs/models/__NAMESPACE__.md | 83 ++----------------------- docs/utils/__NAMESPACE__.md | 22 +------ src/models/NamespaceMd.php | 13 ++-- src/views/Page.mustache | 21 +------ 6 files changed, 29 insertions(+), 150 deletions(-) diff --git a/docs/__NAMESPACE__.md b/docs/__NAMESPACE__.md index 1b91149..33d2df4 100644 --- a/docs/__NAMESPACE__.md +++ b/docs/__NAMESPACE__.md @@ -1,31 +1,16 @@ -# mdGen +# Namespace mdGen -**Namespace** : alphayax\mdGen +**Full name** : `alphayax\mdGen` # Overview - [models](./models/__NAMESPACE__.md) - - [NamespaceMd](models/__NAMESPACE__.md#NamespaceMd) - - [ClassMd](models/__NAMESPACE__.md#ClassMd) - - [MethodMd](models/__NAMESPACE__.md#MethodMd) - - [ParamMd](models/__NAMESPACE__.md#ParamMd) + - [NamespaceMd](models/NamespaceMd/__CLASS__.md) + - [ClassMd](models/ClassMd/__CLASS__.md) + - [MethodMd](models/MethodMd/__CLASS__.md) + - [ParamMd](models/ParamMd/__CLASS__.md) - [utils](./utils/__NAMESPACE__.md) - - [arrayAccessProperties](utils/__NAMESPACE__.md#arrayAccessProperties) -- [MdGen](__NAMESPACE__.md#MdGen) - ---- - - -## MdGen - -**Class** : alphayax\mdGen\MdGen - -### Public methods - -| Method | Description | -|---|---| -| `filterNamespace` | Filter class who are in a specific namespace | -| `filterSubClasses` | Filter class who are sub-classes of a specific class | -| `generate` | Generate markdown files | + - [arrayAccessProperties](utils/arrayAccessProperties/__CLASS__.md) +- [MdGen](MdGen/__CLASS__.md) diff --git a/docs/models/NamespaceMd/generateTree.md b/docs/models/NamespaceMd/generateTree.md index 06ae1e5..4898e7b 100644 --- a/docs/models/NamespaceMd/generateTree.md +++ b/docs/models/NamespaceMd/generateTree.md @@ -42,11 +42,10 @@ /// Chapters if( ! empty( $this->classMds)){ - foreach($this->classMds as $chapter){ - $chapterName = $chapter->getReflexion()->getShortName(); - $chapterFile = $relativePath . $this->getPageBfe(); - $chapterAnchor = $chapterFile .'#'. $chapter->getReflexion()->getShortName(); - $generatedMd .= "$pad- [$chapterName]($chapterAnchor)" . PHP_EOL; + foreach($this->classMds as $classMd){ + $className = $classMd->getReflexion()->getShortName(); + $classFile = $relativePath . $className . DIRECTORY_SEPARATOR . '__CLASS__.md'; + $generatedMd .= "$pad- [$className]($classFile)" . PHP_EOL; } } diff --git a/docs/models/__NAMESPACE__.md b/docs/models/__NAMESPACE__.md index 16ef7e5..f79b3b6 100644 --- a/docs/models/__NAMESPACE__.md +++ b/docs/models/__NAMESPACE__.md @@ -1,83 +1,12 @@ -# models +# Namespace models -**Namespace** : alphayax\mdGen\models +**Full name** : `alphayax\mdGen\models` # Overview -- [NamespaceMd](__NAMESPACE__.md#NamespaceMd) -- [ClassMd](__NAMESPACE__.md#ClassMd) -- [MethodMd](__NAMESPACE__.md#MethodMd) -- [ParamMd](__NAMESPACE__.md#ParamMd) - ---- - - -## NamespaceMd - -**Class** : alphayax\mdGen\models\NamespaceMd - -### Public methods - -| Method | Description | -|---|---| -| `generateTree` | Generate overview markdown tree | -| `write` | Write markdown file | -| `writeSubPages` | Write sub pages of this page | -| `setDirectory` | Define the current page directory | -| `getPageBfe` | Return the page basename file with extension | -| `offsetExists` | Whether a offset exists | -| `offsetGet` | Offset to retrieve | -| `offsetSet` | Offset to set | -| `offsetUnset` | Offset to unset | - - -## ClassMd - -**Class** : alphayax\mdGen\models\ClassMd - -### Public methods - -| Method | Description | -|---|---| -| `getNextComponent` | Get the next namespace component (according the NS given) | -| `getNamespace` | Get the namespace of the current reflected class | -| `getReflexion` | Get the reflected class | -| `write` | | -| `offsetExists` | Whether a offset exists | -| `offsetGet` | Offset to retrieve | -| `offsetSet` | Offset to set | -| `offsetUnset` | Offset to unset | - - -## MethodMd - -**Class** : alphayax\mdGen\models\MethodMd - -### Public methods - -| Method | Description | -|---|---| -| `hasParams` | | -| `getParams` | | -| `getModifiers` | | -| `write` | | -| `offsetExists` | Whether a offset exists | -| `offsetGet` | Offset to retrieve | -| `offsetSet` | Offset to set | -| `offsetUnset` | Offset to unset | - - -## ParamMd - -**Class** : alphayax\mdGen\models\ParamMd - -### Public methods - -| Method | Description | -|---|---| -| `offsetExists` | Whether a offset exists | -| `offsetGet` | Offset to retrieve | -| `offsetSet` | Offset to set | -| `offsetUnset` | Offset to unset | +- [NamespaceMd](NamespaceMd/__CLASS__.md) +- [ClassMd](ClassMd/__CLASS__.md) +- [MethodMd](MethodMd/__CLASS__.md) +- [ParamMd](ParamMd/__CLASS__.md) diff --git a/docs/utils/__NAMESPACE__.md b/docs/utils/__NAMESPACE__.md index a3ffb0b..0a5a4a5 100644 --- a/docs/utils/__NAMESPACE__.md +++ b/docs/utils/__NAMESPACE__.md @@ -1,25 +1,9 @@ -# utils +# Namespace utils -**Namespace** : alphayax\mdGen\utils +**Full name** : `alphayax\mdGen\utils` # Overview -- [arrayAccessProperties](__NAMESPACE__.md#arrayAccessProperties) - ---- - - -## arrayAccessProperties - -**Trait** : alphayax\mdGen\utils\arrayAccessProperties - -### Public methods - -| Method | Description | -|---|---| -| `offsetExists` | Whether a offset exists | -| `offsetGet` | Offset to retrieve | -| `offsetSet` | Offset to set | -| `offsetUnset` | Offset to unset | +- [arrayAccessProperties](arrayAccessProperties/__CLASS__.md) diff --git a/src/models/NamespaceMd.php b/src/models/NamespaceMd.php index 9204cb3..a8d4725 100644 --- a/src/models/NamespaceMd.php +++ b/src/models/NamespaceMd.php @@ -73,7 +73,7 @@ protected function computePageName(){ public function generateTree( $pad = '', $relativePath = '') { $generatedMd = ''; - /// SubPages + /// SubNamespaces if( ! empty( $this->subPages)){ foreach( $this->subPages as $subPageName => $subPage){ $subPageFile = './' . $relativePath . $subPageName . DIRECTORY_SEPARATOR . $subPage->getPageBfe(); @@ -82,13 +82,12 @@ public function generateTree( $pad = '', $relativePath = '') { } } - /// Chapters + /// Classes if( ! empty( $this->classMds)){ - foreach($this->classMds as $chapter){ - $chapterName = $chapter->getReflexion()->getShortName(); - $chapterFile = $relativePath . $this->getPageBfe(); - $chapterAnchor = $chapterFile .'#'. $chapter->getReflexion()->getShortName(); - $generatedMd .= "$pad- [$chapterName]($chapterAnchor)" . PHP_EOL; + foreach($this->classMds as $classMd){ + $className = $classMd->getReflexion()->getShortName(); + $classFile = $relativePath . $className . DIRECTORY_SEPARATOR . '__CLASS__.md'; + $generatedMd .= "$pad- [$className]($classFile)" . PHP_EOL; } } diff --git a/src/views/Page.mustache b/src/views/Page.mustache index 294e53a..e491178 100644 --- a/src/views/Page.mustache +++ b/src/views/Page.mustache @@ -1,25 +1,8 @@ -# {{ pageName }} +# Namespace {{ pageName }} -**Namespace** : {{ namespace }} +**Full name** : `{{ namespace }}` # Overview {{ generateTree }} ---- - -{{# classMds }} - -## {{getReflexion.getShortName}} - -**{{type}}** : {{getReflexion.getName}} - -### Public methods - -| Method | Description | -|---|---| -{{# publicMethods }} -| `{{name}}` | {{description}} | -{{/ publicMethods }} - -{{/ classMds }} From a6ce271c531bc364bff563095db6f0b846637533 Mon Sep 17 00:00:00 2001 From: alphayax Date: Mon, 4 Jul 2016 14:19:35 +0200 Subject: [PATCH 05/11] Rename page into Namespace --- docs/models/NamespaceMd/generateTree.md | 4 ++-- docs/models/NamespaceMd/write.md | 2 +- src/models/NamespaceMd.php | 2 +- src/views/{Page.mustache => Namespace.mustache} | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename src/views/{Page.mustache => Namespace.mustache} (100%) diff --git a/docs/models/NamespaceMd/generateTree.md b/docs/models/NamespaceMd/generateTree.md index 4898e7b..24278bf 100644 --- a/docs/models/NamespaceMd/generateTree.md +++ b/docs/models/NamespaceMd/generateTree.md @@ -31,7 +31,7 @@ public function generateTree( $pad = '', $relativePath = '') { $generatedMd = ''; - /// SubPages + /// SubNamespaces if( ! empty( $this->subPages)){ foreach( $this->subPages as $subPageName => $subPage){ $subPageFile = './' . $relativePath . $subPageName . DIRECTORY_SEPARATOR . $subPage->getPageBfe(); @@ -40,7 +40,7 @@ } } - /// Chapters + /// Classes if( ! empty( $this->classMds)){ foreach($this->classMds as $classMd){ $className = $classMd->getReflexion()->getShortName(); diff --git a/docs/models/NamespaceMd/write.md b/docs/models/NamespaceMd/write.md index 8759349..c9ccc69 100644 --- a/docs/models/NamespaceMd/write.md +++ b/docs/models/NamespaceMd/write.md @@ -29,7 +29,7 @@ $m = new \Mustache_Engine([ 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views') ]); - $template = $m->loadTemplate('Page'); + $template = $m->loadTemplate('Namespace'); $generatedMd = $template->render( $this); diff --git a/src/models/NamespaceMd.php b/src/models/NamespaceMd.php index a8d4725..65fafd0 100644 --- a/src/models/NamespaceMd.php +++ b/src/models/NamespaceMd.php @@ -102,7 +102,7 @@ public function write(){ $m = new \Mustache_Engine([ 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views') ]); - $template = $m->loadTemplate('Page'); + $template = $m->loadTemplate('Namespace'); $generatedMd = $template->render( $this); diff --git a/src/views/Page.mustache b/src/views/Namespace.mustache similarity index 100% rename from src/views/Page.mustache rename to src/views/Namespace.mustache From 3c2139201830b5139b2229e2d3e189656e2060f9 Mon Sep 17 00:00:00 2001 From: alphayax Date: Mon, 4 Jul 2016 14:22:25 +0200 Subject: [PATCH 06/11] Update methode style --- docs/MdGen/__construct.md | 5 +++-- docs/MdGen/filterNamespace.md | 5 +++-- docs/MdGen/filterSubClasses.md | 5 +++-- docs/MdGen/generate.md | 5 +++-- docs/MdGen/generateClassMdFromLoadedClasses.md | 5 +++-- docs/MdGen/loadClasses.md | 5 +++-- docs/models/ClassMd/__construct.md | 5 +++-- docs/models/ClassMd/computeType.md | 5 +++-- docs/models/ClassMd/getNamespace.md | 5 +++-- docs/models/ClassMd/getNextComponent.md | 5 +++-- docs/models/ClassMd/getReflexion.md | 5 +++-- docs/models/ClassMd/offsetExists.md | 5 +++-- docs/models/ClassMd/offsetGet.md | 5 +++-- docs/models/ClassMd/offsetSet.md | 5 +++-- docs/models/ClassMd/offsetUnset.md | 5 +++-- docs/models/ClassMd/write.md | 5 +++-- docs/models/ClassMd/writeMethods.md | 5 +++-- docs/models/MethodMd/__construct.md | 5 +++-- docs/models/MethodMd/getModifiers.md | 5 +++-- docs/models/MethodMd/getParams.md | 5 +++-- docs/models/MethodMd/hasParams.md | 5 +++-- docs/models/MethodMd/offsetExists.md | 5 +++-- docs/models/MethodMd/offsetGet.md | 5 +++-- docs/models/MethodMd/offsetSet.md | 5 +++-- docs/models/MethodMd/offsetUnset.md | 5 +++-- docs/models/MethodMd/write.md | 5 +++-- docs/models/NamespaceMd/__construct.md | 5 +++-- docs/models/NamespaceMd/computePageName.md | 5 +++-- docs/models/NamespaceMd/generateTree.md | 5 +++-- docs/models/NamespaceMd/getPageBfe.md | 5 +++-- docs/models/NamespaceMd/offsetExists.md | 5 +++-- docs/models/NamespaceMd/offsetGet.md | 5 +++-- docs/models/NamespaceMd/offsetSet.md | 5 +++-- docs/models/NamespaceMd/offsetUnset.md | 5 +++-- docs/models/NamespaceMd/setDirectory.md | 5 +++-- docs/models/NamespaceMd/write.md | 5 +++-- docs/models/NamespaceMd/writeMdClasses.md | 5 +++-- docs/models/NamespaceMd/writeSubPages.md | 5 +++-- docs/models/ParamMd/__construct.md | 5 +++-- docs/models/ParamMd/offsetExists.md | 5 +++-- docs/models/ParamMd/offsetGet.md | 5 +++-- docs/models/ParamMd/offsetSet.md | 5 +++-- docs/models/ParamMd/offsetUnset.md | 5 +++-- docs/utils/arrayAccessProperties/offsetExists.md | 5 +++-- docs/utils/arrayAccessProperties/offsetGet.md | 5 +++-- docs/utils/arrayAccessProperties/offsetSet.md | 5 +++-- docs/utils/arrayAccessProperties/offsetUnset.md | 5 +++-- src/views/Method.mustache | 9 +++------ src/views/MethodMd/Implementation.mustache | 5 +++++ 49 files changed, 149 insertions(+), 100 deletions(-) create mode 100644 src/views/MethodMd/Implementation.mustache diff --git a/docs/MdGen/__construct.md b/docs/MdGen/__construct.md index a59f70b..9481bd0 100644 --- a/docs/MdGen/__construct.md +++ b/docs/MdGen/__construct.md @@ -1,9 +1,10 @@ # __construct -**Class** : MdGen **Namespace** : alphayax\mdGen +**Class** : MdGen + > MdGen constructor. @@ -24,7 +25,7 @@ #### Return -## Implementation +#### Implementation ```php public function __construct( $srcDirectory, $rootNamespace){ diff --git a/docs/MdGen/filterNamespace.md b/docs/MdGen/filterNamespace.md index a65516d..415fb30 100644 --- a/docs/MdGen/filterNamespace.md +++ b/docs/MdGen/filterNamespace.md @@ -1,9 +1,10 @@ # filterNamespace -**Class** : MdGen **Namespace** : alphayax\mdGen +**Class** : MdGen + > Filter class who are in a specific namespace @@ -23,7 +24,7 @@ #### Return -## Implementation +#### Implementation ```php public function filterNamespace( $namespaceName) { diff --git a/docs/MdGen/filterSubClasses.md b/docs/MdGen/filterSubClasses.md index c336476..fb0c544 100644 --- a/docs/MdGen/filterSubClasses.md +++ b/docs/MdGen/filterSubClasses.md @@ -1,9 +1,10 @@ # filterSubClasses -**Class** : MdGen **Namespace** : alphayax\mdGen +**Class** : MdGen + > Filter class who are sub-classes of a specific class @@ -23,7 +24,7 @@ #### Return -## Implementation +#### Implementation ```php public function filterSubClasses( $className) { diff --git a/docs/MdGen/generate.md b/docs/MdGen/generate.md index bc76693..9edc874 100644 --- a/docs/MdGen/generate.md +++ b/docs/MdGen/generate.md @@ -1,9 +1,10 @@ # generate -**Class** : MdGen **Namespace** : alphayax\mdGen +**Class** : MdGen + > Generate markdown files @@ -23,7 +24,7 @@ #### Return -## Implementation +#### Implementation ```php public function generate( $directory = '.'){ diff --git a/docs/MdGen/generateClassMdFromLoadedClasses.md b/docs/MdGen/generateClassMdFromLoadedClasses.md index c88084a..102c475 100644 --- a/docs/MdGen/generateClassMdFromLoadedClasses.md +++ b/docs/MdGen/generateClassMdFromLoadedClasses.md @@ -1,9 +1,10 @@ # generateClassMdFromLoadedClasses -**Class** : MdGen **Namespace** : alphayax\mdGen +**Class** : MdGen + > Create a chapter form loaded classes @@ -22,7 +23,7 @@ ClassMd[] -## Implementation +#### Implementation ```php protected function generateClassMdFromLoadedClasses(){ diff --git a/docs/MdGen/loadClasses.md b/docs/MdGen/loadClasses.md index 7bb1c16..704ef28 100644 --- a/docs/MdGen/loadClasses.md +++ b/docs/MdGen/loadClasses.md @@ -1,9 +1,10 @@ # loadClasses -**Class** : MdGen **Namespace** : alphayax\mdGen +**Class** : MdGen + > Load class in the source directory @@ -21,7 +22,7 @@ #### Return -## Implementation +#### Implementation ```php protected function loadClasses(){ diff --git a/docs/models/ClassMd/__construct.md b/docs/models/ClassMd/__construct.md index ec41208..990f0f9 100644 --- a/docs/models/ClassMd/__construct.md +++ b/docs/models/ClassMd/__construct.md @@ -1,9 +1,10 @@ # __construct -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > ClassChapter constructor. @@ -23,7 +24,7 @@ #### Return -## Implementation +#### Implementation ```php public function __construct( $class){ diff --git a/docs/models/ClassMd/computeType.md b/docs/models/ClassMd/computeType.md index 27c0c8f..4d36035 100644 --- a/docs/models/ClassMd/computeType.md +++ b/docs/models/ClassMd/computeType.md @@ -1,9 +1,10 @@ # computeType -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > Determine the type of class @@ -21,7 +22,7 @@ #### Return -## Implementation +#### Implementation ```php protected function computeType(){ diff --git a/docs/models/ClassMd/getNamespace.md b/docs/models/ClassMd/getNamespace.md index 8d9ae0c..431f37c 100644 --- a/docs/models/ClassMd/getNamespace.md +++ b/docs/models/ClassMd/getNamespace.md @@ -1,9 +1,10 @@ # getNamespace -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > Get the namespace of the current reflected class @@ -21,7 +22,7 @@ #### Return -## Implementation +#### Implementation ```php public function getNamespace() { diff --git a/docs/models/ClassMd/getNextComponent.md b/docs/models/ClassMd/getNextComponent.md index c52fe54..16e03f3 100644 --- a/docs/models/ClassMd/getNextComponent.md +++ b/docs/models/ClassMd/getNextComponent.md @@ -1,9 +1,10 @@ # getNextComponent -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > Get the next namespace component (according the NS given) @@ -24,7 +25,7 @@ string -## Implementation +#### Implementation ```php public function getNextComponent( $namespace) { diff --git a/docs/models/ClassMd/getReflexion.md b/docs/models/ClassMd/getReflexion.md index ab7c978..459e280 100644 --- a/docs/models/ClassMd/getReflexion.md +++ b/docs/models/ClassMd/getReflexion.md @@ -1,9 +1,10 @@ # getReflexion -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > Get the reflected class @@ -22,7 +23,7 @@ \ReflectionClass -## Implementation +#### Implementation ```php public function getReflexion(){ diff --git a/docs/models/ClassMd/offsetExists.md b/docs/models/ClassMd/offsetExists.md index ec92b46..551f4fe 100644 --- a/docs/models/ClassMd/offsetExists.md +++ b/docs/models/ClassMd/offsetExists.md @@ -1,9 +1,10 @@ # offsetExists -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > Whether a offset exists @@ -24,7 +25,7 @@ boolean true on success or false on failure. -## Implementation +#### Implementation ```php public function offsetExists($offset) { diff --git a/docs/models/ClassMd/offsetGet.md b/docs/models/ClassMd/offsetGet.md index f5d14fe..0391cfb 100644 --- a/docs/models/ClassMd/offsetGet.md +++ b/docs/models/ClassMd/offsetGet.md @@ -1,9 +1,10 @@ # offsetGet -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > Offset to retrieve @@ -24,7 +25,7 @@ mixed Can return all value types. -## Implementation +#### Implementation ```php public function offsetGet( $offset) { diff --git a/docs/models/ClassMd/offsetSet.md b/docs/models/ClassMd/offsetSet.md index 88d63c8..41e1ae3 100644 --- a/docs/models/ClassMd/offsetSet.md +++ b/docs/models/ClassMd/offsetSet.md @@ -1,9 +1,10 @@ # offsetSet -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > Offset to set @@ -25,7 +26,7 @@ void -## Implementation +#### Implementation ```php public function offsetSet( $offset, $value) { diff --git a/docs/models/ClassMd/offsetUnset.md b/docs/models/ClassMd/offsetUnset.md index e53d3bb..29ddba0 100644 --- a/docs/models/ClassMd/offsetUnset.md +++ b/docs/models/ClassMd/offsetUnset.md @@ -1,9 +1,10 @@ # offsetUnset -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > Offset to unset @@ -24,7 +25,7 @@ void -## Implementation +#### Implementation ```php public function offsetUnset($offset) { diff --git a/docs/models/ClassMd/write.md b/docs/models/ClassMd/write.md index 7631307..f9a5594 100644 --- a/docs/models/ClassMd/write.md +++ b/docs/models/ClassMd/write.md @@ -1,9 +1,10 @@ # write -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > @@ -21,7 +22,7 @@ #### Return -## Implementation +#### Implementation ```php diff --git a/docs/models/ClassMd/writeMethods.md b/docs/models/ClassMd/writeMethods.md index b5b3b7e..ec5cc59 100644 --- a/docs/models/ClassMd/writeMethods.md +++ b/docs/models/ClassMd/writeMethods.md @@ -1,9 +1,10 @@ # writeMethods -**Class** : ClassMd **Namespace** : alphayax\mdGen\models +**Class** : ClassMd + > @@ -21,7 +22,7 @@ #### Return -## Implementation +#### Implementation ```php diff --git a/docs/models/MethodMd/__construct.md b/docs/models/MethodMd/__construct.md index ef6e700..d302337 100644 --- a/docs/models/MethodMd/__construct.md +++ b/docs/models/MethodMd/__construct.md @@ -1,9 +1,10 @@ # __construct -**Class** : MethodMd **Namespace** : alphayax\mdGen\models +**Class** : MethodMd + > MethodMd constructor. @@ -24,7 +25,7 @@ #### Return -## Implementation +#### Implementation ```php public function __construct( $className, $methodName) { diff --git a/docs/models/MethodMd/getModifiers.md b/docs/models/MethodMd/getModifiers.md index b44d77b..5288d74 100644 --- a/docs/models/MethodMd/getModifiers.md +++ b/docs/models/MethodMd/getModifiers.md @@ -1,9 +1,10 @@ # getModifiers -**Class** : MethodMd **Namespace** : alphayax\mdGen\models +**Class** : MethodMd + > @@ -22,7 +23,7 @@ string -## Implementation +#### Implementation ```php public function getModifiers() { diff --git a/docs/models/MethodMd/getParams.md b/docs/models/MethodMd/getParams.md index fe16df1..1730d16 100644 --- a/docs/models/MethodMd/getParams.md +++ b/docs/models/MethodMd/getParams.md @@ -1,9 +1,10 @@ # getParams -**Class** : MethodMd **Namespace** : alphayax\mdGen\models +**Class** : MethodMd + > @@ -22,7 +23,7 @@ string -## Implementation +#### Implementation ```php public function getParams(){ diff --git a/docs/models/MethodMd/hasParams.md b/docs/models/MethodMd/hasParams.md index d959ef5..e58819e 100644 --- a/docs/models/MethodMd/hasParams.md +++ b/docs/models/MethodMd/hasParams.md @@ -1,9 +1,10 @@ # hasParams -**Class** : MethodMd **Namespace** : alphayax\mdGen\models +**Class** : MethodMd + > @@ -22,7 +23,7 @@ bool -## Implementation +#### Implementation ```php public function hasParams() { diff --git a/docs/models/MethodMd/offsetExists.md b/docs/models/MethodMd/offsetExists.md index 77a702e..f1c69b1 100644 --- a/docs/models/MethodMd/offsetExists.md +++ b/docs/models/MethodMd/offsetExists.md @@ -1,9 +1,10 @@ # offsetExists -**Class** : MethodMd **Namespace** : alphayax\mdGen\models +**Class** : MethodMd + > Whether a offset exists @@ -24,7 +25,7 @@ boolean true on success or false on failure. -## Implementation +#### Implementation ```php public function offsetExists($offset) { diff --git a/docs/models/MethodMd/offsetGet.md b/docs/models/MethodMd/offsetGet.md index bdcc059..8490995 100644 --- a/docs/models/MethodMd/offsetGet.md +++ b/docs/models/MethodMd/offsetGet.md @@ -1,9 +1,10 @@ # offsetGet -**Class** : MethodMd **Namespace** : alphayax\mdGen\models +**Class** : MethodMd + > Offset to retrieve @@ -24,7 +25,7 @@ mixed Can return all value types. -## Implementation +#### Implementation ```php public function offsetGet( $offset) { diff --git a/docs/models/MethodMd/offsetSet.md b/docs/models/MethodMd/offsetSet.md index 1068836..304f872 100644 --- a/docs/models/MethodMd/offsetSet.md +++ b/docs/models/MethodMd/offsetSet.md @@ -1,9 +1,10 @@ # offsetSet -**Class** : MethodMd **Namespace** : alphayax\mdGen\models +**Class** : MethodMd + > Offset to set @@ -25,7 +26,7 @@ void -## Implementation +#### Implementation ```php public function offsetSet( $offset, $value) { diff --git a/docs/models/MethodMd/offsetUnset.md b/docs/models/MethodMd/offsetUnset.md index d59ca15..e6d33c8 100644 --- a/docs/models/MethodMd/offsetUnset.md +++ b/docs/models/MethodMd/offsetUnset.md @@ -1,9 +1,10 @@ # offsetUnset -**Class** : MethodMd **Namespace** : alphayax\mdGen\models +**Class** : MethodMd + > Offset to unset @@ -24,7 +25,7 @@ void -## Implementation +#### Implementation ```php public function offsetUnset($offset) { diff --git a/docs/models/MethodMd/write.md b/docs/models/MethodMd/write.md index a1399ff..e03ae53 100644 --- a/docs/models/MethodMd/write.md +++ b/docs/models/MethodMd/write.md @@ -1,9 +1,10 @@ # write -**Class** : MethodMd **Namespace** : alphayax\mdGen\models +**Class** : MethodMd + > @@ -23,7 +24,7 @@ #### Return -## Implementation +#### Implementation ```php public function write( $path) { diff --git a/docs/models/NamespaceMd/__construct.md b/docs/models/NamespaceMd/__construct.md index c70c8c6..e6d8445 100644 --- a/docs/models/NamespaceMd/__construct.md +++ b/docs/models/NamespaceMd/__construct.md @@ -1,9 +1,10 @@ # __construct -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Page constructor @@ -24,7 +25,7 @@ #### Return -## Implementation +#### Implementation ```php public function __construct( $pageNamespace, array $chapters) { diff --git a/docs/models/NamespaceMd/computePageName.md b/docs/models/NamespaceMd/computePageName.md index d0c39e8..c9ebba5 100644 --- a/docs/models/NamespaceMd/computePageName.md +++ b/docs/models/NamespaceMd/computePageName.md @@ -1,9 +1,10 @@ # computePageName -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Compute the page name (according to the page namespace) @@ -22,7 +23,7 @@ string -## Implementation +#### Implementation ```php protected function computePageName(){ diff --git a/docs/models/NamespaceMd/generateTree.md b/docs/models/NamespaceMd/generateTree.md index 24278bf..adc2cf5 100644 --- a/docs/models/NamespaceMd/generateTree.md +++ b/docs/models/NamespaceMd/generateTree.md @@ -1,9 +1,10 @@ # generateTree -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Generate overview markdown tree @@ -25,7 +26,7 @@ string -## Implementation +#### Implementation ```php public function generateTree( $pad = '', $relativePath = '') { diff --git a/docs/models/NamespaceMd/getPageBfe.md b/docs/models/NamespaceMd/getPageBfe.md index 40e00c7..aded05f 100644 --- a/docs/models/NamespaceMd/getPageBfe.md +++ b/docs/models/NamespaceMd/getPageBfe.md @@ -1,9 +1,10 @@ # getPageBfe -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Return the page basename file with extension @@ -22,7 +23,7 @@ string The page base name -## Implementation +#### Implementation ```php public function getPageBfe() { diff --git a/docs/models/NamespaceMd/offsetExists.md b/docs/models/NamespaceMd/offsetExists.md index a6a1b1d..1d3e186 100644 --- a/docs/models/NamespaceMd/offsetExists.md +++ b/docs/models/NamespaceMd/offsetExists.md @@ -1,9 +1,10 @@ # offsetExists -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Whether a offset exists @@ -24,7 +25,7 @@ boolean true on success or false on failure. -## Implementation +#### Implementation ```php public function offsetExists($offset) { diff --git a/docs/models/NamespaceMd/offsetGet.md b/docs/models/NamespaceMd/offsetGet.md index 9a19c2f..50a4751 100644 --- a/docs/models/NamespaceMd/offsetGet.md +++ b/docs/models/NamespaceMd/offsetGet.md @@ -1,9 +1,10 @@ # offsetGet -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Offset to retrieve @@ -24,7 +25,7 @@ mixed Can return all value types. -## Implementation +#### Implementation ```php public function offsetGet( $offset) { diff --git a/docs/models/NamespaceMd/offsetSet.md b/docs/models/NamespaceMd/offsetSet.md index fd9e0d6..ac23681 100644 --- a/docs/models/NamespaceMd/offsetSet.md +++ b/docs/models/NamespaceMd/offsetSet.md @@ -1,9 +1,10 @@ # offsetSet -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Offset to set @@ -25,7 +26,7 @@ void -## Implementation +#### Implementation ```php public function offsetSet( $offset, $value) { diff --git a/docs/models/NamespaceMd/offsetUnset.md b/docs/models/NamespaceMd/offsetUnset.md index 3ad10fe..09826ad 100644 --- a/docs/models/NamespaceMd/offsetUnset.md +++ b/docs/models/NamespaceMd/offsetUnset.md @@ -1,9 +1,10 @@ # offsetUnset -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Offset to unset @@ -24,7 +25,7 @@ void -## Implementation +#### Implementation ```php public function offsetUnset($offset) { diff --git a/docs/models/NamespaceMd/setDirectory.md b/docs/models/NamespaceMd/setDirectory.md index b5382e6..a4883e1 100644 --- a/docs/models/NamespaceMd/setDirectory.md +++ b/docs/models/NamespaceMd/setDirectory.md @@ -1,9 +1,10 @@ # setDirectory -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Define the current page directory @@ -23,7 +24,7 @@ #### Return -## Implementation +#### Implementation ```php public function setDirectory( $string) { diff --git a/docs/models/NamespaceMd/write.md b/docs/models/NamespaceMd/write.md index c9ccc69..ca4a36d 100644 --- a/docs/models/NamespaceMd/write.md +++ b/docs/models/NamespaceMd/write.md @@ -1,9 +1,10 @@ # write -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Write markdown file @@ -21,7 +22,7 @@ #### Return -## Implementation +#### Implementation ```php public function write(){ diff --git a/docs/models/NamespaceMd/writeMdClasses.md b/docs/models/NamespaceMd/writeMdClasses.md index 8b91931..7a14433 100644 --- a/docs/models/NamespaceMd/writeMdClasses.md +++ b/docs/models/NamespaceMd/writeMdClasses.md @@ -1,9 +1,10 @@ # writeMdClasses -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > @@ -21,7 +22,7 @@ #### Return -## Implementation +#### Implementation ```php protected function writeMdClasses() { diff --git a/docs/models/NamespaceMd/writeSubPages.md b/docs/models/NamespaceMd/writeSubPages.md index 8a59b48..eabe137 100644 --- a/docs/models/NamespaceMd/writeSubPages.md +++ b/docs/models/NamespaceMd/writeSubPages.md @@ -1,9 +1,10 @@ # writeSubPages -**Class** : NamespaceMd **Namespace** : alphayax\mdGen\models +**Class** : NamespaceMd + > Write sub pages of this page @@ -21,7 +22,7 @@ #### Return -## Implementation +#### Implementation ```php public function writeSubPages() { diff --git a/docs/models/ParamMd/__construct.md b/docs/models/ParamMd/__construct.md index c74e75f..a75013f 100644 --- a/docs/models/ParamMd/__construct.md +++ b/docs/models/ParamMd/__construct.md @@ -1,9 +1,10 @@ # __construct -**Class** : ParamMd **Namespace** : alphayax\mdGen\models +**Class** : ParamMd + > ParamMd constructor. @@ -23,7 +24,7 @@ #### Return -## Implementation +#### Implementation ```php public function __construct( \Zend_Reflection_Docblock_Tag_Param $param){ diff --git a/docs/models/ParamMd/offsetExists.md b/docs/models/ParamMd/offsetExists.md index b21ab7a..85c8165 100644 --- a/docs/models/ParamMd/offsetExists.md +++ b/docs/models/ParamMd/offsetExists.md @@ -1,9 +1,10 @@ # offsetExists -**Class** : ParamMd **Namespace** : alphayax\mdGen\models +**Class** : ParamMd + > Whether a offset exists @@ -24,7 +25,7 @@ boolean true on success or false on failure. -## Implementation +#### Implementation ```php public function offsetExists($offset) { diff --git a/docs/models/ParamMd/offsetGet.md b/docs/models/ParamMd/offsetGet.md index f32a1df..639f5c7 100644 --- a/docs/models/ParamMd/offsetGet.md +++ b/docs/models/ParamMd/offsetGet.md @@ -1,9 +1,10 @@ # offsetGet -**Class** : ParamMd **Namespace** : alphayax\mdGen\models +**Class** : ParamMd + > Offset to retrieve @@ -24,7 +25,7 @@ mixed Can return all value types. -## Implementation +#### Implementation ```php public function offsetGet( $offset) { diff --git a/docs/models/ParamMd/offsetSet.md b/docs/models/ParamMd/offsetSet.md index 96153b3..d9c4a00 100644 --- a/docs/models/ParamMd/offsetSet.md +++ b/docs/models/ParamMd/offsetSet.md @@ -1,9 +1,10 @@ # offsetSet -**Class** : ParamMd **Namespace** : alphayax\mdGen\models +**Class** : ParamMd + > Offset to set @@ -25,7 +26,7 @@ void -## Implementation +#### Implementation ```php public function offsetSet( $offset, $value) { diff --git a/docs/models/ParamMd/offsetUnset.md b/docs/models/ParamMd/offsetUnset.md index 67816de..c19b11f 100644 --- a/docs/models/ParamMd/offsetUnset.md +++ b/docs/models/ParamMd/offsetUnset.md @@ -1,9 +1,10 @@ # offsetUnset -**Class** : ParamMd **Namespace** : alphayax\mdGen\models +**Class** : ParamMd + > Offset to unset @@ -24,7 +25,7 @@ void -## Implementation +#### Implementation ```php public function offsetUnset($offset) { diff --git a/docs/utils/arrayAccessProperties/offsetExists.md b/docs/utils/arrayAccessProperties/offsetExists.md index 7ff7757..3420272 100644 --- a/docs/utils/arrayAccessProperties/offsetExists.md +++ b/docs/utils/arrayAccessProperties/offsetExists.md @@ -1,9 +1,10 @@ # offsetExists -**Class** : arrayAccessProperties **Namespace** : alphayax\mdGen\utils +**Class** : arrayAccessProperties + > Whether a offset exists @@ -24,7 +25,7 @@ boolean true on success or false on failure. -## Implementation +#### Implementation ```php public function offsetExists($offset) { diff --git a/docs/utils/arrayAccessProperties/offsetGet.md b/docs/utils/arrayAccessProperties/offsetGet.md index cd3f0a9..5c913f2 100644 --- a/docs/utils/arrayAccessProperties/offsetGet.md +++ b/docs/utils/arrayAccessProperties/offsetGet.md @@ -1,9 +1,10 @@ # offsetGet -**Class** : arrayAccessProperties **Namespace** : alphayax\mdGen\utils +**Class** : arrayAccessProperties + > Offset to retrieve @@ -24,7 +25,7 @@ mixed Can return all value types. -## Implementation +#### Implementation ```php public function offsetGet( $offset) { diff --git a/docs/utils/arrayAccessProperties/offsetSet.md b/docs/utils/arrayAccessProperties/offsetSet.md index ea8222c..b5caf14 100644 --- a/docs/utils/arrayAccessProperties/offsetSet.md +++ b/docs/utils/arrayAccessProperties/offsetSet.md @@ -1,9 +1,10 @@ # offsetSet -**Class** : arrayAccessProperties **Namespace** : alphayax\mdGen\utils +**Class** : arrayAccessProperties + > Offset to set @@ -25,7 +26,7 @@ void -## Implementation +#### Implementation ```php public function offsetSet( $offset, $value) { diff --git a/docs/utils/arrayAccessProperties/offsetUnset.md b/docs/utils/arrayAccessProperties/offsetUnset.md index 0be563d..9b7787d 100644 --- a/docs/utils/arrayAccessProperties/offsetUnset.md +++ b/docs/utils/arrayAccessProperties/offsetUnset.md @@ -1,9 +1,10 @@ # offsetUnset -**Class** : arrayAccessProperties **Namespace** : alphayax\mdGen\utils +**Class** : arrayAccessProperties + > Offset to unset @@ -24,7 +25,7 @@ void -## Implementation +#### Implementation ```php public function offsetUnset($offset) { diff --git a/src/views/Method.mustache b/src/views/Method.mustache index 62bb3b9..0cd083a 100644 --- a/src/views/Method.mustache +++ b/src/views/Method.mustache @@ -1,9 +1,10 @@ # {{ name }} -**Class** : {{ reflexion.getDeclaringClass.getShortName }} **Namespace** : {{ reflexion.getDeclaringClass.getNamespaceName }} +**Class** : {{ reflexion.getDeclaringClass.getShortName }} + > {{description}} @@ -14,8 +15,4 @@ {{> Return}} -## Implementation - -```php -{{{ impl }}} -``` +{{> Implementation}} diff --git a/src/views/MethodMd/Implementation.mustache b/src/views/MethodMd/Implementation.mustache new file mode 100644 index 0000000..0bc7820 --- /dev/null +++ b/src/views/MethodMd/Implementation.mustache @@ -0,0 +1,5 @@ +#### Implementation + +```php +{{{ impl }}} +``` From 466b0ab805ac16654e86baa4ee9425fe9920185e Mon Sep 17 00:00:00 2001 From: alphayax Date: Mon, 4 Jul 2016 14:27:43 +0200 Subject: [PATCH 07/11] Update method style --- docs/MdGen/__construct.md | 8 +++----- docs/MdGen/filterNamespace.md | 8 +++----- docs/MdGen/filterSubClasses.md | 8 +++----- docs/MdGen/generate.md | 8 +++----- docs/MdGen/generateClassMdFromLoadedClasses.md | 8 +++----- docs/MdGen/loadClasses.md | 8 +++----- docs/models/ClassMd/__construct.md | 8 +++----- docs/models/ClassMd/computeType.md | 8 +++----- docs/models/ClassMd/getNamespace.md | 8 +++----- docs/models/ClassMd/getNextComponent.md | 8 +++----- docs/models/ClassMd/getReflexion.md | 8 +++----- docs/models/ClassMd/offsetExists.md | 8 +++----- docs/models/ClassMd/offsetGet.md | 8 +++----- docs/models/ClassMd/offsetSet.md | 8 +++----- docs/models/ClassMd/offsetUnset.md | 8 +++----- docs/models/ClassMd/write.md | 8 +++----- docs/models/ClassMd/writeMethods.md | 8 +++----- docs/models/MethodMd/__construct.md | 8 +++----- docs/models/MethodMd/getModifiers.md | 8 +++----- docs/models/MethodMd/getParams.md | 8 +++----- docs/models/MethodMd/hasParams.md | 8 +++----- docs/models/MethodMd/offsetExists.md | 8 +++----- docs/models/MethodMd/offsetGet.md | 8 +++----- docs/models/MethodMd/offsetSet.md | 8 +++----- docs/models/MethodMd/offsetUnset.md | 8 +++----- docs/models/MethodMd/write.md | 8 +++----- docs/models/NamespaceMd/__construct.md | 8 +++----- docs/models/NamespaceMd/computePageName.md | 8 +++----- docs/models/NamespaceMd/generateTree.md | 8 +++----- docs/models/NamespaceMd/getPageBfe.md | 8 +++----- docs/models/NamespaceMd/offsetExists.md | 8 +++----- docs/models/NamespaceMd/offsetGet.md | 8 +++----- docs/models/NamespaceMd/offsetSet.md | 8 +++----- docs/models/NamespaceMd/offsetUnset.md | 8 +++----- docs/models/NamespaceMd/setDirectory.md | 8 +++----- docs/models/NamespaceMd/write.md | 8 +++----- docs/models/NamespaceMd/writeMdClasses.md | 8 +++----- docs/models/NamespaceMd/writeSubPages.md | 8 +++----- docs/models/ParamMd/__construct.md | 8 +++----- docs/models/ParamMd/offsetExists.md | 8 +++----- docs/models/ParamMd/offsetGet.md | 8 +++----- docs/models/ParamMd/offsetSet.md | 8 +++----- docs/models/ParamMd/offsetUnset.md | 8 +++----- docs/utils/arrayAccessProperties/offsetExists.md | 8 +++----- docs/utils/arrayAccessProperties/offsetGet.md | 8 +++----- docs/utils/arrayAccessProperties/offsetSet.md | 8 +++----- docs/utils/arrayAccessProperties/offsetUnset.md | 8 +++----- src/views/Method.mustache | 8 +++----- 48 files changed, 144 insertions(+), 240 deletions(-) diff --git a/docs/MdGen/__construct.md b/docs/MdGen/__construct.md index 9481bd0..b143450 100644 --- a/docs/MdGen/__construct.md +++ b/docs/MdGen/__construct.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen - **Class** : MdGen -# __construct - -**Namespace** : alphayax\mdGen - -**Class** : MdGen +## `MdGen::__construct` +#### Description > MdGen constructor. diff --git a/docs/MdGen/filterNamespace.md b/docs/MdGen/filterNamespace.md index 415fb30..a34a1ad 100644 --- a/docs/MdGen/filterNamespace.md +++ b/docs/MdGen/filterNamespace.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen - **Class** : MdGen -# filterNamespace - -**Namespace** : alphayax\mdGen - -**Class** : MdGen +## `MdGen::filterNamespace` +#### Description > Filter class who are in a specific namespace diff --git a/docs/MdGen/filterSubClasses.md b/docs/MdGen/filterSubClasses.md index fb0c544..37f49bc 100644 --- a/docs/MdGen/filterSubClasses.md +++ b/docs/MdGen/filterSubClasses.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen - **Class** : MdGen -# filterSubClasses - -**Namespace** : alphayax\mdGen - -**Class** : MdGen +## `MdGen::filterSubClasses` +#### Description > Filter class who are sub-classes of a specific class diff --git a/docs/MdGen/generate.md b/docs/MdGen/generate.md index 9edc874..6c444f6 100644 --- a/docs/MdGen/generate.md +++ b/docs/MdGen/generate.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen - **Class** : MdGen -# generate - -**Namespace** : alphayax\mdGen - -**Class** : MdGen +## `MdGen::generate` +#### Description > Generate markdown files diff --git a/docs/MdGen/generateClassMdFromLoadedClasses.md b/docs/MdGen/generateClassMdFromLoadedClasses.md index 102c475..fad06e8 100644 --- a/docs/MdGen/generateClassMdFromLoadedClasses.md +++ b/docs/MdGen/generateClassMdFromLoadedClasses.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen - **Class** : MdGen -# generateClassMdFromLoadedClasses - -**Namespace** : alphayax\mdGen - -**Class** : MdGen +## `MdGen::generateClassMdFromLoadedClasses` +#### Description > Create a chapter form loaded classes diff --git a/docs/MdGen/loadClasses.md b/docs/MdGen/loadClasses.md index 704ef28..b5df8df 100644 --- a/docs/MdGen/loadClasses.md +++ b/docs/MdGen/loadClasses.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen - **Class** : MdGen -# loadClasses - -**Namespace** : alphayax\mdGen - -**Class** : MdGen +## `MdGen::loadClasses` +#### Description > Load class in the source directory diff --git a/docs/models/ClassMd/__construct.md b/docs/models/ClassMd/__construct.md index 990f0f9..c5f9480 100644 --- a/docs/models/ClassMd/__construct.md +++ b/docs/models/ClassMd/__construct.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# __construct - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::__construct` +#### Description > ClassChapter constructor. diff --git a/docs/models/ClassMd/computeType.md b/docs/models/ClassMd/computeType.md index 4d36035..1dceca2 100644 --- a/docs/models/ClassMd/computeType.md +++ b/docs/models/ClassMd/computeType.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# computeType - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::computeType` +#### Description > Determine the type of class diff --git a/docs/models/ClassMd/getNamespace.md b/docs/models/ClassMd/getNamespace.md index 431f37c..384b9f4 100644 --- a/docs/models/ClassMd/getNamespace.md +++ b/docs/models/ClassMd/getNamespace.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# getNamespace - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::getNamespace` +#### Description > Get the namespace of the current reflected class diff --git a/docs/models/ClassMd/getNextComponent.md b/docs/models/ClassMd/getNextComponent.md index 16e03f3..b1b13a1 100644 --- a/docs/models/ClassMd/getNextComponent.md +++ b/docs/models/ClassMd/getNextComponent.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# getNextComponent - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::getNextComponent` +#### Description > Get the next namespace component (according the NS given) diff --git a/docs/models/ClassMd/getReflexion.md b/docs/models/ClassMd/getReflexion.md index 459e280..baf56fd 100644 --- a/docs/models/ClassMd/getReflexion.md +++ b/docs/models/ClassMd/getReflexion.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# getReflexion - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::getReflexion` +#### Description > Get the reflected class diff --git a/docs/models/ClassMd/offsetExists.md b/docs/models/ClassMd/offsetExists.md index 551f4fe..a06b6e6 100644 --- a/docs/models/ClassMd/offsetExists.md +++ b/docs/models/ClassMd/offsetExists.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# offsetExists - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::offsetExists` +#### Description > Whether a offset exists diff --git a/docs/models/ClassMd/offsetGet.md b/docs/models/ClassMd/offsetGet.md index 0391cfb..3cc38ec 100644 --- a/docs/models/ClassMd/offsetGet.md +++ b/docs/models/ClassMd/offsetGet.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# offsetGet - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::offsetGet` +#### Description > Offset to retrieve diff --git a/docs/models/ClassMd/offsetSet.md b/docs/models/ClassMd/offsetSet.md index 41e1ae3..30324ab 100644 --- a/docs/models/ClassMd/offsetSet.md +++ b/docs/models/ClassMd/offsetSet.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# offsetSet - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::offsetSet` +#### Description > Offset to set diff --git a/docs/models/ClassMd/offsetUnset.md b/docs/models/ClassMd/offsetUnset.md index 29ddba0..6e0e41f 100644 --- a/docs/models/ClassMd/offsetUnset.md +++ b/docs/models/ClassMd/offsetUnset.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# offsetUnset - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::offsetUnset` +#### Description > Offset to unset diff --git a/docs/models/ClassMd/write.md b/docs/models/ClassMd/write.md index f9a5594..68d99f7 100644 --- a/docs/models/ClassMd/write.md +++ b/docs/models/ClassMd/write.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# write - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::write` +#### Description > diff --git a/docs/models/ClassMd/writeMethods.md b/docs/models/ClassMd/writeMethods.md index ec5cc59..4e728b9 100644 --- a/docs/models/ClassMd/writeMethods.md +++ b/docs/models/ClassMd/writeMethods.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ClassMd -# writeMethods - -**Namespace** : alphayax\mdGen\models - -**Class** : ClassMd +## `ClassMd::writeMethods` +#### Description > diff --git a/docs/models/MethodMd/__construct.md b/docs/models/MethodMd/__construct.md index d302337..9fb7530 100644 --- a/docs/models/MethodMd/__construct.md +++ b/docs/models/MethodMd/__construct.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : MethodMd -# __construct - -**Namespace** : alphayax\mdGen\models - -**Class** : MethodMd +## `MethodMd::__construct` +#### Description > MethodMd constructor. diff --git a/docs/models/MethodMd/getModifiers.md b/docs/models/MethodMd/getModifiers.md index 5288d74..f6a6c61 100644 --- a/docs/models/MethodMd/getModifiers.md +++ b/docs/models/MethodMd/getModifiers.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : MethodMd -# getModifiers - -**Namespace** : alphayax\mdGen\models - -**Class** : MethodMd +## `MethodMd::getModifiers` +#### Description > diff --git a/docs/models/MethodMd/getParams.md b/docs/models/MethodMd/getParams.md index 1730d16..d95305e 100644 --- a/docs/models/MethodMd/getParams.md +++ b/docs/models/MethodMd/getParams.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : MethodMd -# getParams - -**Namespace** : alphayax\mdGen\models - -**Class** : MethodMd +## `MethodMd::getParams` +#### Description > diff --git a/docs/models/MethodMd/hasParams.md b/docs/models/MethodMd/hasParams.md index e58819e..141c4c3 100644 --- a/docs/models/MethodMd/hasParams.md +++ b/docs/models/MethodMd/hasParams.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : MethodMd -# hasParams - -**Namespace** : alphayax\mdGen\models - -**Class** : MethodMd +## `MethodMd::hasParams` +#### Description > diff --git a/docs/models/MethodMd/offsetExists.md b/docs/models/MethodMd/offsetExists.md index f1c69b1..92882ba 100644 --- a/docs/models/MethodMd/offsetExists.md +++ b/docs/models/MethodMd/offsetExists.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : MethodMd -# offsetExists - -**Namespace** : alphayax\mdGen\models - -**Class** : MethodMd +## `MethodMd::offsetExists` +#### Description > Whether a offset exists diff --git a/docs/models/MethodMd/offsetGet.md b/docs/models/MethodMd/offsetGet.md index 8490995..d44c1c7 100644 --- a/docs/models/MethodMd/offsetGet.md +++ b/docs/models/MethodMd/offsetGet.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : MethodMd -# offsetGet - -**Namespace** : alphayax\mdGen\models - -**Class** : MethodMd +## `MethodMd::offsetGet` +#### Description > Offset to retrieve diff --git a/docs/models/MethodMd/offsetSet.md b/docs/models/MethodMd/offsetSet.md index 304f872..6fc0062 100644 --- a/docs/models/MethodMd/offsetSet.md +++ b/docs/models/MethodMd/offsetSet.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : MethodMd -# offsetSet - -**Namespace** : alphayax\mdGen\models - -**Class** : MethodMd +## `MethodMd::offsetSet` +#### Description > Offset to set diff --git a/docs/models/MethodMd/offsetUnset.md b/docs/models/MethodMd/offsetUnset.md index e6d33c8..b470d49 100644 --- a/docs/models/MethodMd/offsetUnset.md +++ b/docs/models/MethodMd/offsetUnset.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : MethodMd -# offsetUnset - -**Namespace** : alphayax\mdGen\models - -**Class** : MethodMd +## `MethodMd::offsetUnset` +#### Description > Offset to unset diff --git a/docs/models/MethodMd/write.md b/docs/models/MethodMd/write.md index e03ae53..10c7a90 100644 --- a/docs/models/MethodMd/write.md +++ b/docs/models/MethodMd/write.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : MethodMd -# write - -**Namespace** : alphayax\mdGen\models - -**Class** : MethodMd +## `MethodMd::write` +#### Description > diff --git a/docs/models/NamespaceMd/__construct.md b/docs/models/NamespaceMd/__construct.md index e6d8445..7132e90 100644 --- a/docs/models/NamespaceMd/__construct.md +++ b/docs/models/NamespaceMd/__construct.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# __construct - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::__construct` +#### Description > Page constructor diff --git a/docs/models/NamespaceMd/computePageName.md b/docs/models/NamespaceMd/computePageName.md index c9ebba5..3334536 100644 --- a/docs/models/NamespaceMd/computePageName.md +++ b/docs/models/NamespaceMd/computePageName.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# computePageName - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::computePageName` +#### Description > Compute the page name (according to the page namespace) diff --git a/docs/models/NamespaceMd/generateTree.md b/docs/models/NamespaceMd/generateTree.md index adc2cf5..4d55174 100644 --- a/docs/models/NamespaceMd/generateTree.md +++ b/docs/models/NamespaceMd/generateTree.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# generateTree - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::generateTree` +#### Description > Generate overview markdown tree diff --git a/docs/models/NamespaceMd/getPageBfe.md b/docs/models/NamespaceMd/getPageBfe.md index aded05f..0c42358 100644 --- a/docs/models/NamespaceMd/getPageBfe.md +++ b/docs/models/NamespaceMd/getPageBfe.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# getPageBfe - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::getPageBfe` +#### Description > Return the page basename file with extension diff --git a/docs/models/NamespaceMd/offsetExists.md b/docs/models/NamespaceMd/offsetExists.md index 1d3e186..3ee3ebe 100644 --- a/docs/models/NamespaceMd/offsetExists.md +++ b/docs/models/NamespaceMd/offsetExists.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# offsetExists - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::offsetExists` +#### Description > Whether a offset exists diff --git a/docs/models/NamespaceMd/offsetGet.md b/docs/models/NamespaceMd/offsetGet.md index 50a4751..15132d5 100644 --- a/docs/models/NamespaceMd/offsetGet.md +++ b/docs/models/NamespaceMd/offsetGet.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# offsetGet - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::offsetGet` +#### Description > Offset to retrieve diff --git a/docs/models/NamespaceMd/offsetSet.md b/docs/models/NamespaceMd/offsetSet.md index ac23681..55d60b4 100644 --- a/docs/models/NamespaceMd/offsetSet.md +++ b/docs/models/NamespaceMd/offsetSet.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# offsetSet - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::offsetSet` +#### Description > Offset to set diff --git a/docs/models/NamespaceMd/offsetUnset.md b/docs/models/NamespaceMd/offsetUnset.md index 09826ad..b7f5f02 100644 --- a/docs/models/NamespaceMd/offsetUnset.md +++ b/docs/models/NamespaceMd/offsetUnset.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# offsetUnset - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::offsetUnset` +#### Description > Offset to unset diff --git a/docs/models/NamespaceMd/setDirectory.md b/docs/models/NamespaceMd/setDirectory.md index a4883e1..f475eec 100644 --- a/docs/models/NamespaceMd/setDirectory.md +++ b/docs/models/NamespaceMd/setDirectory.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# setDirectory - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::setDirectory` +#### Description > Define the current page directory diff --git a/docs/models/NamespaceMd/write.md b/docs/models/NamespaceMd/write.md index ca4a36d..ed452c8 100644 --- a/docs/models/NamespaceMd/write.md +++ b/docs/models/NamespaceMd/write.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# write - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::write` +#### Description > Write markdown file diff --git a/docs/models/NamespaceMd/writeMdClasses.md b/docs/models/NamespaceMd/writeMdClasses.md index 7a14433..d078e7d 100644 --- a/docs/models/NamespaceMd/writeMdClasses.md +++ b/docs/models/NamespaceMd/writeMdClasses.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# writeMdClasses - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::writeMdClasses` +#### Description > diff --git a/docs/models/NamespaceMd/writeSubPages.md b/docs/models/NamespaceMd/writeSubPages.md index eabe137..bd311e7 100644 --- a/docs/models/NamespaceMd/writeSubPages.md +++ b/docs/models/NamespaceMd/writeSubPages.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd -# writeSubPages - -**Namespace** : alphayax\mdGen\models - -**Class** : NamespaceMd +## `NamespaceMd::writeSubPages` +#### Description > Write sub pages of this page diff --git a/docs/models/ParamMd/__construct.md b/docs/models/ParamMd/__construct.md index a75013f..a9625db 100644 --- a/docs/models/ParamMd/__construct.md +++ b/docs/models/ParamMd/__construct.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ParamMd -# __construct - -**Namespace** : alphayax\mdGen\models - -**Class** : ParamMd +## `ParamMd::__construct` +#### Description > ParamMd constructor. diff --git a/docs/models/ParamMd/offsetExists.md b/docs/models/ParamMd/offsetExists.md index 85c8165..01b30e0 100644 --- a/docs/models/ParamMd/offsetExists.md +++ b/docs/models/ParamMd/offsetExists.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ParamMd -# offsetExists - -**Namespace** : alphayax\mdGen\models - -**Class** : ParamMd +## `ParamMd::offsetExists` +#### Description > Whether a offset exists diff --git a/docs/models/ParamMd/offsetGet.md b/docs/models/ParamMd/offsetGet.md index 639f5c7..dbb94b4 100644 --- a/docs/models/ParamMd/offsetGet.md +++ b/docs/models/ParamMd/offsetGet.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ParamMd -# offsetGet - -**Namespace** : alphayax\mdGen\models - -**Class** : ParamMd +## `ParamMd::offsetGet` +#### Description > Offset to retrieve diff --git a/docs/models/ParamMd/offsetSet.md b/docs/models/ParamMd/offsetSet.md index d9c4a00..073c36c 100644 --- a/docs/models/ParamMd/offsetSet.md +++ b/docs/models/ParamMd/offsetSet.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ParamMd -# offsetSet - -**Namespace** : alphayax\mdGen\models - -**Class** : ParamMd +## `ParamMd::offsetSet` +#### Description > Offset to set diff --git a/docs/models/ParamMd/offsetUnset.md b/docs/models/ParamMd/offsetUnset.md index c19b11f..554cb85 100644 --- a/docs/models/ParamMd/offsetUnset.md +++ b/docs/models/ParamMd/offsetUnset.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\models - **Class** : ParamMd -# offsetUnset - -**Namespace** : alphayax\mdGen\models - -**Class** : ParamMd +## `ParamMd::offsetUnset` +#### Description > Offset to unset diff --git a/docs/utils/arrayAccessProperties/offsetExists.md b/docs/utils/arrayAccessProperties/offsetExists.md index 3420272..522f0c0 100644 --- a/docs/utils/arrayAccessProperties/offsetExists.md +++ b/docs/utils/arrayAccessProperties/offsetExists.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\utils - **Class** : arrayAccessProperties -# offsetExists - -**Namespace** : alphayax\mdGen\utils - -**Class** : arrayAccessProperties +## `arrayAccessProperties::offsetExists` +#### Description > Whether a offset exists diff --git a/docs/utils/arrayAccessProperties/offsetGet.md b/docs/utils/arrayAccessProperties/offsetGet.md index 5c913f2..1e79264 100644 --- a/docs/utils/arrayAccessProperties/offsetGet.md +++ b/docs/utils/arrayAccessProperties/offsetGet.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\utils - **Class** : arrayAccessProperties -# offsetGet - -**Namespace** : alphayax\mdGen\utils - -**Class** : arrayAccessProperties +## `arrayAccessProperties::offsetGet` +#### Description > Offset to retrieve diff --git a/docs/utils/arrayAccessProperties/offsetSet.md b/docs/utils/arrayAccessProperties/offsetSet.md index b5caf14..9f102bf 100644 --- a/docs/utils/arrayAccessProperties/offsetSet.md +++ b/docs/utils/arrayAccessProperties/offsetSet.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\utils - **Class** : arrayAccessProperties -# offsetSet - -**Namespace** : alphayax\mdGen\utils - -**Class** : arrayAccessProperties +## `arrayAccessProperties::offsetSet` +#### Description > Offset to set diff --git a/docs/utils/arrayAccessProperties/offsetUnset.md b/docs/utils/arrayAccessProperties/offsetUnset.md index 9b7787d..eacdeb8 100644 --- a/docs/utils/arrayAccessProperties/offsetUnset.md +++ b/docs/utils/arrayAccessProperties/offsetUnset.md @@ -1,10 +1,8 @@ +**Namespace** : alphayax\mdGen\utils - **Class** : arrayAccessProperties -# offsetUnset - -**Namespace** : alphayax\mdGen\utils - -**Class** : arrayAccessProperties +## `arrayAccessProperties::offsetUnset` +#### Description > Offset to unset diff --git a/src/views/Method.mustache b/src/views/Method.mustache index 0cd083a..0ee48a8 100644 --- a/src/views/Method.mustache +++ b/src/views/Method.mustache @@ -1,10 +1,8 @@ +**Namespace** : {{ reflexion.getDeclaringClass.getNamespaceName }} - **Class** : {{ reflexion.getDeclaringClass.getShortName }} -# {{ name }} - -**Namespace** : {{ reflexion.getDeclaringClass.getNamespaceName }} - -**Class** : {{ reflexion.getDeclaringClass.getShortName }} +## `{{ reflexion.getDeclaringClass.getShortName }}::{{ name }}` +#### Description > {{description}} From 52869142fe3b4d67706519e8d3e8ae1bd84f1584 Mon Sep 17 00:00:00 2001 From: alphayax Date: Mon, 4 Jul 2016 14:31:17 +0200 Subject: [PATCH 08/11] Update method style (Add links) --- docs/MdGen/__construct.md | 4 ++-- docs/MdGen/filterNamespace.md | 4 ++-- docs/MdGen/filterSubClasses.md | 4 ++-- docs/MdGen/generate.md | 4 ++-- docs/MdGen/generateClassMdFromLoadedClasses.md | 4 ++-- docs/MdGen/loadClasses.md | 4 ++-- docs/models/ClassMd/__construct.md | 4 ++-- docs/models/ClassMd/computeType.md | 4 ++-- docs/models/ClassMd/getNamespace.md | 4 ++-- docs/models/ClassMd/getNextComponent.md | 4 ++-- docs/models/ClassMd/getReflexion.md | 4 ++-- docs/models/ClassMd/offsetExists.md | 4 ++-- docs/models/ClassMd/offsetGet.md | 4 ++-- docs/models/ClassMd/offsetSet.md | 4 ++-- docs/models/ClassMd/offsetUnset.md | 4 ++-- docs/models/ClassMd/write.md | 4 ++-- docs/models/ClassMd/writeMethods.md | 4 ++-- docs/models/MethodMd/__construct.md | 4 ++-- docs/models/MethodMd/getModifiers.md | 4 ++-- docs/models/MethodMd/getParams.md | 4 ++-- docs/models/MethodMd/hasParams.md | 4 ++-- docs/models/MethodMd/offsetExists.md | 4 ++-- docs/models/MethodMd/offsetGet.md | 4 ++-- docs/models/MethodMd/offsetSet.md | 4 ++-- docs/models/MethodMd/offsetUnset.md | 4 ++-- docs/models/MethodMd/write.md | 4 ++-- docs/models/NamespaceMd/__construct.md | 4 ++-- docs/models/NamespaceMd/computePageName.md | 4 ++-- docs/models/NamespaceMd/generateTree.md | 4 ++-- docs/models/NamespaceMd/getPageBfe.md | 4 ++-- docs/models/NamespaceMd/offsetExists.md | 4 ++-- docs/models/NamespaceMd/offsetGet.md | 4 ++-- docs/models/NamespaceMd/offsetSet.md | 4 ++-- docs/models/NamespaceMd/offsetUnset.md | 4 ++-- docs/models/NamespaceMd/setDirectory.md | 4 ++-- docs/models/NamespaceMd/write.md | 4 ++-- docs/models/NamespaceMd/writeMdClasses.md | 4 ++-- docs/models/NamespaceMd/writeSubPages.md | 4 ++-- docs/models/ParamMd/__construct.md | 4 ++-- docs/models/ParamMd/offsetExists.md | 4 ++-- docs/models/ParamMd/offsetGet.md | 4 ++-- docs/models/ParamMd/offsetSet.md | 4 ++-- docs/models/ParamMd/offsetUnset.md | 4 ++-- docs/utils/arrayAccessProperties/offsetExists.md | 4 ++-- docs/utils/arrayAccessProperties/offsetGet.md | 4 ++-- docs/utils/arrayAccessProperties/offsetSet.md | 4 ++-- docs/utils/arrayAccessProperties/offsetUnset.md | 4 ++-- src/views/Method.mustache | 8 +++----- src/views/MethodMd/Description.mustache | 3 +++ 49 files changed, 100 insertions(+), 99 deletions(-) create mode 100644 src/views/MethodMd/Description.mustache diff --git a/docs/MdGen/__construct.md b/docs/MdGen/__construct.md index b143450..382ba76 100644 --- a/docs/MdGen/__construct.md +++ b/docs/MdGen/__construct.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen - **Class** : MdGen +**Namespace** : [alphayax\mdGen](../__NAMESPACE__.md) - +**Class** : [MdGen](__CLASS__.md) ## `MdGen::__construct` @@ -6,7 +7,6 @@ > MdGen constructor. - #### Signature ```php diff --git a/docs/MdGen/filterNamespace.md b/docs/MdGen/filterNamespace.md index a34a1ad..eb2fafe 100644 --- a/docs/MdGen/filterNamespace.md +++ b/docs/MdGen/filterNamespace.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen - **Class** : MdGen +**Namespace** : [alphayax\mdGen](../__NAMESPACE__.md) - +**Class** : [MdGen](__CLASS__.md) ## `MdGen::filterNamespace` @@ -6,7 +7,6 @@ > Filter class who are in a specific namespace - #### Signature ```php diff --git a/docs/MdGen/filterSubClasses.md b/docs/MdGen/filterSubClasses.md index 37f49bc..d782dbd 100644 --- a/docs/MdGen/filterSubClasses.md +++ b/docs/MdGen/filterSubClasses.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen - **Class** : MdGen +**Namespace** : [alphayax\mdGen](../__NAMESPACE__.md) - +**Class** : [MdGen](__CLASS__.md) ## `MdGen::filterSubClasses` @@ -6,7 +7,6 @@ > Filter class who are sub-classes of a specific class - #### Signature ```php diff --git a/docs/MdGen/generate.md b/docs/MdGen/generate.md index 6c444f6..7c62808 100644 --- a/docs/MdGen/generate.md +++ b/docs/MdGen/generate.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen - **Class** : MdGen +**Namespace** : [alphayax\mdGen](../__NAMESPACE__.md) - +**Class** : [MdGen](__CLASS__.md) ## `MdGen::generate` @@ -6,7 +7,6 @@ > Generate markdown files - #### Signature ```php diff --git a/docs/MdGen/generateClassMdFromLoadedClasses.md b/docs/MdGen/generateClassMdFromLoadedClasses.md index fad06e8..eb42034 100644 --- a/docs/MdGen/generateClassMdFromLoadedClasses.md +++ b/docs/MdGen/generateClassMdFromLoadedClasses.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen - **Class** : MdGen +**Namespace** : [alphayax\mdGen](../__NAMESPACE__.md) - +**Class** : [MdGen](__CLASS__.md) ## `MdGen::generateClassMdFromLoadedClasses` @@ -6,7 +7,6 @@ > Create a chapter form loaded classes - #### Signature ```php diff --git a/docs/MdGen/loadClasses.md b/docs/MdGen/loadClasses.md index b5df8df..6b661b6 100644 --- a/docs/MdGen/loadClasses.md +++ b/docs/MdGen/loadClasses.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen - **Class** : MdGen +**Namespace** : [alphayax\mdGen](../__NAMESPACE__.md) - +**Class** : [MdGen](__CLASS__.md) ## `MdGen::loadClasses` @@ -6,7 +7,6 @@ > Load class in the source directory - #### Signature ```php diff --git a/docs/models/ClassMd/__construct.md b/docs/models/ClassMd/__construct.md index c5f9480..6ae5333 100644 --- a/docs/models/ClassMd/__construct.md +++ b/docs/models/ClassMd/__construct.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::__construct` @@ -6,7 +7,6 @@ > ClassChapter constructor. - #### Signature ```php diff --git a/docs/models/ClassMd/computeType.md b/docs/models/ClassMd/computeType.md index 1dceca2..154e806 100644 --- a/docs/models/ClassMd/computeType.md +++ b/docs/models/ClassMd/computeType.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::computeType` @@ -6,7 +7,6 @@ > Determine the type of class - #### Signature ```php diff --git a/docs/models/ClassMd/getNamespace.md b/docs/models/ClassMd/getNamespace.md index 384b9f4..876c09e 100644 --- a/docs/models/ClassMd/getNamespace.md +++ b/docs/models/ClassMd/getNamespace.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::getNamespace` @@ -6,7 +7,6 @@ > Get the namespace of the current reflected class - #### Signature ```php diff --git a/docs/models/ClassMd/getNextComponent.md b/docs/models/ClassMd/getNextComponent.md index b1b13a1..750294c 100644 --- a/docs/models/ClassMd/getNextComponent.md +++ b/docs/models/ClassMd/getNextComponent.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::getNextComponent` @@ -6,7 +7,6 @@ > Get the next namespace component (according the NS given) - #### Signature ```php diff --git a/docs/models/ClassMd/getReflexion.md b/docs/models/ClassMd/getReflexion.md index baf56fd..c533e7b 100644 --- a/docs/models/ClassMd/getReflexion.md +++ b/docs/models/ClassMd/getReflexion.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::getReflexion` @@ -6,7 +7,6 @@ > Get the reflected class - #### Signature ```php diff --git a/docs/models/ClassMd/offsetExists.md b/docs/models/ClassMd/offsetExists.md index a06b6e6..c9e39b6 100644 --- a/docs/models/ClassMd/offsetExists.md +++ b/docs/models/ClassMd/offsetExists.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::offsetExists` @@ -6,7 +7,6 @@ > Whether a offset exists - #### Signature ```php diff --git a/docs/models/ClassMd/offsetGet.md b/docs/models/ClassMd/offsetGet.md index 3cc38ec..d0f5d51 100644 --- a/docs/models/ClassMd/offsetGet.md +++ b/docs/models/ClassMd/offsetGet.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::offsetGet` @@ -6,7 +7,6 @@ > Offset to retrieve - #### Signature ```php diff --git a/docs/models/ClassMd/offsetSet.md b/docs/models/ClassMd/offsetSet.md index 30324ab..6543982 100644 --- a/docs/models/ClassMd/offsetSet.md +++ b/docs/models/ClassMd/offsetSet.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::offsetSet` @@ -6,7 +7,6 @@ > Offset to set - #### Signature ```php diff --git a/docs/models/ClassMd/offsetUnset.md b/docs/models/ClassMd/offsetUnset.md index 6e0e41f..bb10e2c 100644 --- a/docs/models/ClassMd/offsetUnset.md +++ b/docs/models/ClassMd/offsetUnset.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::offsetUnset` @@ -6,7 +7,6 @@ > Offset to unset - #### Signature ```php diff --git a/docs/models/ClassMd/write.md b/docs/models/ClassMd/write.md index 68d99f7..5001fee 100644 --- a/docs/models/ClassMd/write.md +++ b/docs/models/ClassMd/write.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::write` @@ -6,7 +7,6 @@ > - #### Signature ```php diff --git a/docs/models/ClassMd/writeMethods.md b/docs/models/ClassMd/writeMethods.md index 4e728b9..2daccd9 100644 --- a/docs/models/ClassMd/writeMethods.md +++ b/docs/models/ClassMd/writeMethods.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ClassMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ClassMd](__CLASS__.md) ## `ClassMd::writeMethods` @@ -6,7 +7,6 @@ > - #### Signature ```php diff --git a/docs/models/MethodMd/__construct.md b/docs/models/MethodMd/__construct.md index 9fb7530..2e3aaa7 100644 --- a/docs/models/MethodMd/__construct.md +++ b/docs/models/MethodMd/__construct.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : MethodMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [MethodMd](__CLASS__.md) ## `MethodMd::__construct` @@ -6,7 +7,6 @@ > MethodMd constructor. - #### Signature ```php diff --git a/docs/models/MethodMd/getModifiers.md b/docs/models/MethodMd/getModifiers.md index f6a6c61..95254e2 100644 --- a/docs/models/MethodMd/getModifiers.md +++ b/docs/models/MethodMd/getModifiers.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : MethodMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [MethodMd](__CLASS__.md) ## `MethodMd::getModifiers` @@ -6,7 +7,6 @@ > - #### Signature ```php diff --git a/docs/models/MethodMd/getParams.md b/docs/models/MethodMd/getParams.md index d95305e..b00c82e 100644 --- a/docs/models/MethodMd/getParams.md +++ b/docs/models/MethodMd/getParams.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : MethodMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [MethodMd](__CLASS__.md) ## `MethodMd::getParams` @@ -6,7 +7,6 @@ > - #### Signature ```php diff --git a/docs/models/MethodMd/hasParams.md b/docs/models/MethodMd/hasParams.md index 141c4c3..61280d4 100644 --- a/docs/models/MethodMd/hasParams.md +++ b/docs/models/MethodMd/hasParams.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : MethodMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [MethodMd](__CLASS__.md) ## `MethodMd::hasParams` @@ -6,7 +7,6 @@ > - #### Signature ```php diff --git a/docs/models/MethodMd/offsetExists.md b/docs/models/MethodMd/offsetExists.md index 92882ba..7fa8682 100644 --- a/docs/models/MethodMd/offsetExists.md +++ b/docs/models/MethodMd/offsetExists.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : MethodMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [MethodMd](__CLASS__.md) ## `MethodMd::offsetExists` @@ -6,7 +7,6 @@ > Whether a offset exists - #### Signature ```php diff --git a/docs/models/MethodMd/offsetGet.md b/docs/models/MethodMd/offsetGet.md index d44c1c7..fcf45c9 100644 --- a/docs/models/MethodMd/offsetGet.md +++ b/docs/models/MethodMd/offsetGet.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : MethodMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [MethodMd](__CLASS__.md) ## `MethodMd::offsetGet` @@ -6,7 +7,6 @@ > Offset to retrieve - #### Signature ```php diff --git a/docs/models/MethodMd/offsetSet.md b/docs/models/MethodMd/offsetSet.md index 6fc0062..4251cdb 100644 --- a/docs/models/MethodMd/offsetSet.md +++ b/docs/models/MethodMd/offsetSet.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : MethodMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [MethodMd](__CLASS__.md) ## `MethodMd::offsetSet` @@ -6,7 +7,6 @@ > Offset to set - #### Signature ```php diff --git a/docs/models/MethodMd/offsetUnset.md b/docs/models/MethodMd/offsetUnset.md index b470d49..f6e48c0 100644 --- a/docs/models/MethodMd/offsetUnset.md +++ b/docs/models/MethodMd/offsetUnset.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : MethodMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [MethodMd](__CLASS__.md) ## `MethodMd::offsetUnset` @@ -6,7 +7,6 @@ > Offset to unset - #### Signature ```php diff --git a/docs/models/MethodMd/write.md b/docs/models/MethodMd/write.md index 10c7a90..a7c977c 100644 --- a/docs/models/MethodMd/write.md +++ b/docs/models/MethodMd/write.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : MethodMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [MethodMd](__CLASS__.md) ## `MethodMd::write` @@ -6,7 +7,6 @@ > - #### Signature ```php diff --git a/docs/models/NamespaceMd/__construct.md b/docs/models/NamespaceMd/__construct.md index 7132e90..f1d09cb 100644 --- a/docs/models/NamespaceMd/__construct.md +++ b/docs/models/NamespaceMd/__construct.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::__construct` @@ -6,7 +7,6 @@ > Page constructor - #### Signature ```php diff --git a/docs/models/NamespaceMd/computePageName.md b/docs/models/NamespaceMd/computePageName.md index 3334536..97d08c7 100644 --- a/docs/models/NamespaceMd/computePageName.md +++ b/docs/models/NamespaceMd/computePageName.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::computePageName` @@ -6,7 +7,6 @@ > Compute the page name (according to the page namespace) - #### Signature ```php diff --git a/docs/models/NamespaceMd/generateTree.md b/docs/models/NamespaceMd/generateTree.md index 4d55174..13906d6 100644 --- a/docs/models/NamespaceMd/generateTree.md +++ b/docs/models/NamespaceMd/generateTree.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::generateTree` @@ -6,7 +7,6 @@ > Generate overview markdown tree - #### Signature ```php diff --git a/docs/models/NamespaceMd/getPageBfe.md b/docs/models/NamespaceMd/getPageBfe.md index 0c42358..b7dcdb8 100644 --- a/docs/models/NamespaceMd/getPageBfe.md +++ b/docs/models/NamespaceMd/getPageBfe.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::getPageBfe` @@ -6,7 +7,6 @@ > Return the page basename file with extension - #### Signature ```php diff --git a/docs/models/NamespaceMd/offsetExists.md b/docs/models/NamespaceMd/offsetExists.md index 3ee3ebe..a2af2a5 100644 --- a/docs/models/NamespaceMd/offsetExists.md +++ b/docs/models/NamespaceMd/offsetExists.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::offsetExists` @@ -6,7 +7,6 @@ > Whether a offset exists - #### Signature ```php diff --git a/docs/models/NamespaceMd/offsetGet.md b/docs/models/NamespaceMd/offsetGet.md index 15132d5..d497762 100644 --- a/docs/models/NamespaceMd/offsetGet.md +++ b/docs/models/NamespaceMd/offsetGet.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::offsetGet` @@ -6,7 +7,6 @@ > Offset to retrieve - #### Signature ```php diff --git a/docs/models/NamespaceMd/offsetSet.md b/docs/models/NamespaceMd/offsetSet.md index 55d60b4..3b62549 100644 --- a/docs/models/NamespaceMd/offsetSet.md +++ b/docs/models/NamespaceMd/offsetSet.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::offsetSet` @@ -6,7 +7,6 @@ > Offset to set - #### Signature ```php diff --git a/docs/models/NamespaceMd/offsetUnset.md b/docs/models/NamespaceMd/offsetUnset.md index b7f5f02..9694dd1 100644 --- a/docs/models/NamespaceMd/offsetUnset.md +++ b/docs/models/NamespaceMd/offsetUnset.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::offsetUnset` @@ -6,7 +7,6 @@ > Offset to unset - #### Signature ```php diff --git a/docs/models/NamespaceMd/setDirectory.md b/docs/models/NamespaceMd/setDirectory.md index f475eec..bd08c1c 100644 --- a/docs/models/NamespaceMd/setDirectory.md +++ b/docs/models/NamespaceMd/setDirectory.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::setDirectory` @@ -6,7 +7,6 @@ > Define the current page directory - #### Signature ```php diff --git a/docs/models/NamespaceMd/write.md b/docs/models/NamespaceMd/write.md index ed452c8..4e700b7 100644 --- a/docs/models/NamespaceMd/write.md +++ b/docs/models/NamespaceMd/write.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::write` @@ -6,7 +7,6 @@ > Write markdown file - #### Signature ```php diff --git a/docs/models/NamespaceMd/writeMdClasses.md b/docs/models/NamespaceMd/writeMdClasses.md index d078e7d..c432a9f 100644 --- a/docs/models/NamespaceMd/writeMdClasses.md +++ b/docs/models/NamespaceMd/writeMdClasses.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::writeMdClasses` @@ -6,7 +7,6 @@ > - #### Signature ```php diff --git a/docs/models/NamespaceMd/writeSubPages.md b/docs/models/NamespaceMd/writeSubPages.md index bd311e7..56d9c19 100644 --- a/docs/models/NamespaceMd/writeSubPages.md +++ b/docs/models/NamespaceMd/writeSubPages.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : NamespaceMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [NamespaceMd](__CLASS__.md) ## `NamespaceMd::writeSubPages` @@ -6,7 +7,6 @@ > Write sub pages of this page - #### Signature ```php diff --git a/docs/models/ParamMd/__construct.md b/docs/models/ParamMd/__construct.md index a9625db..6f330a1 100644 --- a/docs/models/ParamMd/__construct.md +++ b/docs/models/ParamMd/__construct.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ParamMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ParamMd](__CLASS__.md) ## `ParamMd::__construct` @@ -6,7 +7,6 @@ > ParamMd constructor. - #### Signature ```php diff --git a/docs/models/ParamMd/offsetExists.md b/docs/models/ParamMd/offsetExists.md index 01b30e0..549a9c7 100644 --- a/docs/models/ParamMd/offsetExists.md +++ b/docs/models/ParamMd/offsetExists.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ParamMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ParamMd](__CLASS__.md) ## `ParamMd::offsetExists` @@ -6,7 +7,6 @@ > Whether a offset exists - #### Signature ```php diff --git a/docs/models/ParamMd/offsetGet.md b/docs/models/ParamMd/offsetGet.md index dbb94b4..077e6b5 100644 --- a/docs/models/ParamMd/offsetGet.md +++ b/docs/models/ParamMd/offsetGet.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ParamMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ParamMd](__CLASS__.md) ## `ParamMd::offsetGet` @@ -6,7 +7,6 @@ > Offset to retrieve - #### Signature ```php diff --git a/docs/models/ParamMd/offsetSet.md b/docs/models/ParamMd/offsetSet.md index 073c36c..d24b9b3 100644 --- a/docs/models/ParamMd/offsetSet.md +++ b/docs/models/ParamMd/offsetSet.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ParamMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ParamMd](__CLASS__.md) ## `ParamMd::offsetSet` @@ -6,7 +7,6 @@ > Offset to set - #### Signature ```php diff --git a/docs/models/ParamMd/offsetUnset.md b/docs/models/ParamMd/offsetUnset.md index 554cb85..6ed3ff5 100644 --- a/docs/models/ParamMd/offsetUnset.md +++ b/docs/models/ParamMd/offsetUnset.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\models - **Class** : ParamMd +**Namespace** : [alphayax\mdGen\models](../__NAMESPACE__.md) - +**Class** : [ParamMd](__CLASS__.md) ## `ParamMd::offsetUnset` @@ -6,7 +7,6 @@ > Offset to unset - #### Signature ```php diff --git a/docs/utils/arrayAccessProperties/offsetExists.md b/docs/utils/arrayAccessProperties/offsetExists.md index 522f0c0..a6525e6 100644 --- a/docs/utils/arrayAccessProperties/offsetExists.md +++ b/docs/utils/arrayAccessProperties/offsetExists.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\utils - **Class** : arrayAccessProperties +**Namespace** : [alphayax\mdGen\utils](../__NAMESPACE__.md) - +**Class** : [arrayAccessProperties](__CLASS__.md) ## `arrayAccessProperties::offsetExists` @@ -6,7 +7,6 @@ > Whether a offset exists - #### Signature ```php diff --git a/docs/utils/arrayAccessProperties/offsetGet.md b/docs/utils/arrayAccessProperties/offsetGet.md index 1e79264..d7a8fab 100644 --- a/docs/utils/arrayAccessProperties/offsetGet.md +++ b/docs/utils/arrayAccessProperties/offsetGet.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\utils - **Class** : arrayAccessProperties +**Namespace** : [alphayax\mdGen\utils](../__NAMESPACE__.md) - +**Class** : [arrayAccessProperties](__CLASS__.md) ## `arrayAccessProperties::offsetGet` @@ -6,7 +7,6 @@ > Offset to retrieve - #### Signature ```php diff --git a/docs/utils/arrayAccessProperties/offsetSet.md b/docs/utils/arrayAccessProperties/offsetSet.md index 9f102bf..1457db6 100644 --- a/docs/utils/arrayAccessProperties/offsetSet.md +++ b/docs/utils/arrayAccessProperties/offsetSet.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\utils - **Class** : arrayAccessProperties +**Namespace** : [alphayax\mdGen\utils](../__NAMESPACE__.md) - +**Class** : [arrayAccessProperties](__CLASS__.md) ## `arrayAccessProperties::offsetSet` @@ -6,7 +7,6 @@ > Offset to set - #### Signature ```php diff --git a/docs/utils/arrayAccessProperties/offsetUnset.md b/docs/utils/arrayAccessProperties/offsetUnset.md index eacdeb8..5a748ac 100644 --- a/docs/utils/arrayAccessProperties/offsetUnset.md +++ b/docs/utils/arrayAccessProperties/offsetUnset.md @@ -1,4 +1,5 @@ -**Namespace** : alphayax\mdGen\utils - **Class** : arrayAccessProperties +**Namespace** : [alphayax\mdGen\utils](../__NAMESPACE__.md) - +**Class** : [arrayAccessProperties](__CLASS__.md) ## `arrayAccessProperties::offsetUnset` @@ -6,7 +7,6 @@ > Offset to unset - #### Signature ```php diff --git a/src/views/Method.mustache b/src/views/Method.mustache index 0ee48a8..45e348d 100644 --- a/src/views/Method.mustache +++ b/src/views/Method.mustache @@ -1,11 +1,9 @@ -**Namespace** : {{ reflexion.getDeclaringClass.getNamespaceName }} - **Class** : {{ reflexion.getDeclaringClass.getShortName }} +**Namespace** : [{{ reflexion.getDeclaringClass.getNamespaceName }}](../__NAMESPACE__.md) - +**Class** : [{{ reflexion.getDeclaringClass.getShortName }}](__CLASS__.md) ## `{{ reflexion.getDeclaringClass.getShortName }}::{{ name }}` -#### Description - -> {{description}} - +{{> Description}} {{> Signature}} diff --git a/src/views/MethodMd/Description.mustache b/src/views/MethodMd/Description.mustache new file mode 100644 index 0000000..1f0569a --- /dev/null +++ b/src/views/MethodMd/Description.mustache @@ -0,0 +1,3 @@ +#### Description + +> {{description}} From 9e35865a89b3b6160784dedc8b7d179fd44058c9 Mon Sep 17 00:00:00 2001 From: alphayax Date: Mon, 4 Jul 2016 14:42:34 +0200 Subject: [PATCH 09/11] Fix unknown types --- docs/MdGen/__CLASS__.md | 13 +++++----- docs/MdGen/__construct.md | 6 ++--- docs/__NAMESPACE__.md | 1 - docs/models/ClassMd/__CLASS__.md | 23 ++++++++--------- docs/models/MethodMd/__CLASS__.md | 19 +++++++------- docs/models/MethodMd/__construct.md | 6 ++--- docs/models/MethodMd/write.md | 4 +-- docs/models/NamespaceMd/__CLASS__.md | 25 +++++++++---------- docs/models/NamespaceMd/setDirectory.md | 4 +-- docs/models/ParamMd/__CLASS__.md | 11 ++++---- docs/models/ParamMd/__construct.md | 5 ++++ docs/models/__NAMESPACE__.md | 1 - docs/utils/__NAMESPACE__.md | 1 - docs/utils/arrayAccessProperties/__CLASS__.md | 9 +++---- src/models/ParamMd.php | 5 ++++ src/views/Class.mustache | 3 +-- src/views/Namespace.mustache | 1 - 17 files changed, 68 insertions(+), 69 deletions(-) diff --git a/docs/MdGen/__CLASS__.md b/docs/MdGen/__CLASS__.md index 1748a13..221fa51 100644 --- a/docs/MdGen/__CLASS__.md +++ b/docs/MdGen/__CLASS__.md @@ -1,4 +1,3 @@ - # **Class** MdGen Full name : `alphayax\mdGen\MdGen` @@ -14,9 +13,9 @@ Full name : `alphayax\mdGen\MdGen` | Method | Description | |---|---| -| [__construct](__construct.md) | MdGen constructor. | -| [loadClasses](loadClasses.md) | Load class in the source directory | -| [filterNamespace](filterNamespace.md) | Filter class who are in a specific namespace | -| [filterSubClasses](filterSubClasses.md) | Filter class who are sub-classes of a specific class | -| [generateClassMdFromLoadedClasses](generateClassMdFromLoadedClasses.md) | Create a chapter form loaded classes | -| [generate](generate.md) | Generate markdown files | +| [`__construct`](__construct.md) | MdGen constructor. | +| [`loadClasses`](loadClasses.md) | Load class in the source directory | +| [`filterNamespace`](filterNamespace.md) | Filter class who are in a specific namespace | +| [`filterSubClasses`](filterSubClasses.md) | Filter class who are sub-classes of a specific class | +| [`generateClassMdFromLoadedClasses`](generateClassMdFromLoadedClasses.md) | Create a chapter form loaded classes | +| [`generate`](generate.md) | Generate markdown files | diff --git a/docs/MdGen/__construct.md b/docs/MdGen/__construct.md index 382ba76..f135079 100644 --- a/docs/MdGen/__construct.md +++ b/docs/MdGen/__construct.md @@ -10,15 +10,15 @@ #### Signature ```php - public function __construct(, ); + public function __construct($srcDirectory, $rootNamespace); ``` #### Parameters | Name | Type | Description | |---|---|---| -| `` | $srcDirectory | | -| `` | $rootNamespace | | +| `$srcDirectory` | unknown | | +| `$rootNamespace` | unknown | | #### Return diff --git a/docs/__NAMESPACE__.md b/docs/__NAMESPACE__.md index 33d2df4..5cf1815 100644 --- a/docs/__NAMESPACE__.md +++ b/docs/__NAMESPACE__.md @@ -1,4 +1,3 @@ - # Namespace mdGen **Full name** : `alphayax\mdGen` diff --git a/docs/models/ClassMd/__CLASS__.md b/docs/models/ClassMd/__CLASS__.md index 5f538b9..6818b3d 100644 --- a/docs/models/ClassMd/__CLASS__.md +++ b/docs/models/ClassMd/__CLASS__.md @@ -1,4 +1,3 @@ - # **Class** ClassMd Full name : `alphayax\mdGen\models\ClassMd` @@ -16,14 +15,14 @@ Full name : `alphayax\mdGen\models\ClassMd` | Method | Description | |---|---| -| [__construct](__construct.md) | ClassChapter constructor. | -| [computeType](computeType.md) | Determine the type of class | -| [getNextComponent](getNextComponent.md) | Get the next namespace component (according the NS given) | -| [getNamespace](getNamespace.md) | Get the namespace of the current reflected class | -| [getReflexion](getReflexion.md) | Get the reflected class | -| [write](write.md) | | -| [writeMethods](writeMethods.md) | | -| [offsetExists](offsetExists.md) | Whether a offset exists | -| [offsetGet](offsetGet.md) | Offset to retrieve | -| [offsetSet](offsetSet.md) | Offset to set | -| [offsetUnset](offsetUnset.md) | Offset to unset | +| [`__construct`](__construct.md) | ClassChapter constructor. | +| [`computeType`](computeType.md) | Determine the type of class | +| [`getNextComponent`](getNextComponent.md) | Get the next namespace component (according the NS given) | +| [`getNamespace`](getNamespace.md) | Get the namespace of the current reflected class | +| [`getReflexion`](getReflexion.md) | Get the reflected class | +| [`write`](write.md) | | +| [`writeMethods`](writeMethods.md) | | +| [`offsetExists`](offsetExists.md) | Whether a offset exists | +| [`offsetGet`](offsetGet.md) | Offset to retrieve | +| [`offsetSet`](offsetSet.md) | Offset to set | +| [`offsetUnset`](offsetUnset.md) | Offset to unset | diff --git a/docs/models/MethodMd/__CLASS__.md b/docs/models/MethodMd/__CLASS__.md index 2fa44f8..82aa09a 100644 --- a/docs/models/MethodMd/__CLASS__.md +++ b/docs/models/MethodMd/__CLASS__.md @@ -1,4 +1,3 @@ - # **Class** MethodMd Full name : `alphayax\mdGen\models\MethodMd` @@ -16,12 +15,12 @@ Full name : `alphayax\mdGen\models\MethodMd` | Method | Description | |---|---| -| [__construct](__construct.md) | MethodMd constructor. | -| [hasParams](hasParams.md) | | -| [getParams](getParams.md) | | -| [getModifiers](getModifiers.md) | | -| [write](write.md) | | -| [offsetExists](offsetExists.md) | Whether a offset exists | -| [offsetGet](offsetGet.md) | Offset to retrieve | -| [offsetSet](offsetSet.md) | Offset to set | -| [offsetUnset](offsetUnset.md) | Offset to unset | +| [`__construct`](__construct.md) | MethodMd constructor. | +| [`hasParams`](hasParams.md) | | +| [`getParams`](getParams.md) | | +| [`getModifiers`](getModifiers.md) | | +| [`write`](write.md) | | +| [`offsetExists`](offsetExists.md) | Whether a offset exists | +| [`offsetGet`](offsetGet.md) | Offset to retrieve | +| [`offsetSet`](offsetSet.md) | Offset to set | +| [`offsetUnset`](offsetUnset.md) | Offset to unset | diff --git a/docs/models/MethodMd/__construct.md b/docs/models/MethodMd/__construct.md index 2e3aaa7..22b972c 100644 --- a/docs/models/MethodMd/__construct.md +++ b/docs/models/MethodMd/__construct.md @@ -10,15 +10,15 @@ #### Signature ```php - public function __construct(, ); + public function __construct($className, $methodName); ``` #### Parameters | Name | Type | Description | |---|---|---| -| `` | $className | | -| `` | $methodName | | +| `$className` | unknown | | +| `$methodName` | unknown | | #### Return diff --git a/docs/models/MethodMd/write.md b/docs/models/MethodMd/write.md index a7c977c..41d70c2 100644 --- a/docs/models/MethodMd/write.md +++ b/docs/models/MethodMd/write.md @@ -10,14 +10,14 @@ #### Signature ```php - public function write(); + public function write($path); ``` #### Parameters | Name | Type | Description | |---|---|---| -| `` | $path | | +| `$path` | unknown | | #### Return diff --git a/docs/models/NamespaceMd/__CLASS__.md b/docs/models/NamespaceMd/__CLASS__.md index 4113452..ee379aa 100644 --- a/docs/models/NamespaceMd/__CLASS__.md +++ b/docs/models/NamespaceMd/__CLASS__.md @@ -1,4 +1,3 @@ - # **Class** NamespaceMd Full name : `alphayax\mdGen\models\NamespaceMd` @@ -16,15 +15,15 @@ Full name : `alphayax\mdGen\models\NamespaceMd` | Method | Description | |---|---| -| [__construct](__construct.md) | Page constructor | -| [computePageName](computePageName.md) | Compute the page name (according to the page namespace) | -| [generateTree](generateTree.md) | Generate overview markdown tree | -| [write](write.md) | Write markdown file | -| [writeMdClasses](writeMdClasses.md) | | -| [writeSubPages](writeSubPages.md) | Write sub pages of this page | -| [setDirectory](setDirectory.md) | Define the current page directory | -| [getPageBfe](getPageBfe.md) | Return the page basename file with extension | -| [offsetExists](offsetExists.md) | Whether a offset exists | -| [offsetGet](offsetGet.md) | Offset to retrieve | -| [offsetSet](offsetSet.md) | Offset to set | -| [offsetUnset](offsetUnset.md) | Offset to unset | +| [`__construct`](__construct.md) | Page constructor | +| [`computePageName`](computePageName.md) | Compute the page name (according to the page namespace) | +| [`generateTree`](generateTree.md) | Generate overview markdown tree | +| [`write`](write.md) | Write markdown file | +| [`writeMdClasses`](writeMdClasses.md) | | +| [`writeSubPages`](writeSubPages.md) | Write sub pages of this page | +| [`setDirectory`](setDirectory.md) | Define the current page directory | +| [`getPageBfe`](getPageBfe.md) | Return the page basename file with extension | +| [`offsetExists`](offsetExists.md) | Whether a offset exists | +| [`offsetGet`](offsetGet.md) | Offset to retrieve | +| [`offsetSet`](offsetSet.md) | Offset to set | +| [`offsetUnset`](offsetUnset.md) | Offset to unset | diff --git a/docs/models/NamespaceMd/setDirectory.md b/docs/models/NamespaceMd/setDirectory.md index bd08c1c..74f2756 100644 --- a/docs/models/NamespaceMd/setDirectory.md +++ b/docs/models/NamespaceMd/setDirectory.md @@ -10,14 +10,14 @@ #### Signature ```php - public function setDirectory(); + public function setDirectory($string); ``` #### Parameters | Name | Type | Description | |---|---|---| -| `` | $string | | +| `$string` | unknown | | #### Return diff --git a/docs/models/ParamMd/__CLASS__.md b/docs/models/ParamMd/__CLASS__.md index 1ae7d49..fb09717 100644 --- a/docs/models/ParamMd/__CLASS__.md +++ b/docs/models/ParamMd/__CLASS__.md @@ -1,4 +1,3 @@ - # **Class** ParamMd Full name : `alphayax\mdGen\models\ParamMd` @@ -13,8 +12,8 @@ Full name : `alphayax\mdGen\models\ParamMd` | Method | Description | |---|---| -| [__construct](__construct.md) | ParamMd constructor. | -| [offsetExists](offsetExists.md) | Whether a offset exists | -| [offsetGet](offsetGet.md) | Offset to retrieve | -| [offsetSet](offsetSet.md) | Offset to set | -| [offsetUnset](offsetUnset.md) | Offset to unset | +| [`__construct`](__construct.md) | ParamMd constructor. | +| [`offsetExists`](offsetExists.md) | Whether a offset exists | +| [`offsetGet`](offsetGet.md) | Offset to retrieve | +| [`offsetSet`](offsetSet.md) | Offset to set | +| [`offsetUnset`](offsetUnset.md) | Offset to unset | diff --git a/docs/models/ParamMd/__construct.md b/docs/models/ParamMd/__construct.md index 6f330a1..e81f07c 100644 --- a/docs/models/ParamMd/__construct.md +++ b/docs/models/ParamMd/__construct.md @@ -29,6 +29,11 @@ $this->type = $param->getType(); $this->description = $param->getDescription(); $this->variableName = $param->getVariableName(); + + if( empty( $this->variableName) && 0 === strpos( $this->type, '$')){ + $this->variableName = $this->type; + $this->type = 'unknown'; + } } ``` diff --git a/docs/models/__NAMESPACE__.md b/docs/models/__NAMESPACE__.md index f79b3b6..4fd5668 100644 --- a/docs/models/__NAMESPACE__.md +++ b/docs/models/__NAMESPACE__.md @@ -1,4 +1,3 @@ - # Namespace models **Full name** : `alphayax\mdGen\models` diff --git a/docs/utils/__NAMESPACE__.md b/docs/utils/__NAMESPACE__.md index 0a5a4a5..06a2f4e 100644 --- a/docs/utils/__NAMESPACE__.md +++ b/docs/utils/__NAMESPACE__.md @@ -1,4 +1,3 @@ - # Namespace utils **Full name** : `alphayax\mdGen\utils` diff --git a/docs/utils/arrayAccessProperties/__CLASS__.md b/docs/utils/arrayAccessProperties/__CLASS__.md index aa282ae..5eb8c9d 100644 --- a/docs/utils/arrayAccessProperties/__CLASS__.md +++ b/docs/utils/arrayAccessProperties/__CLASS__.md @@ -1,4 +1,3 @@ - # **Trait** arrayAccessProperties Full name : `alphayax\mdGen\utils\arrayAccessProperties` @@ -10,7 +9,7 @@ Full name : `alphayax\mdGen\utils\arrayAccessProperties` | Method | Description | |---|---| -| [offsetExists](offsetExists.md) | Whether a offset exists | -| [offsetGet](offsetGet.md) | Offset to retrieve | -| [offsetSet](offsetSet.md) | Offset to set | -| [offsetUnset](offsetUnset.md) | Offset to unset | +| [`offsetExists`](offsetExists.md) | Whether a offset exists | +| [`offsetGet`](offsetGet.md) | Offset to retrieve | +| [`offsetSet`](offsetSet.md) | Offset to set | +| [`offsetUnset`](offsetUnset.md) | Offset to unset | diff --git a/src/models/ParamMd.php b/src/models/ParamMd.php index feb00e4..b1b6c1f 100644 --- a/src/models/ParamMd.php +++ b/src/models/ParamMd.php @@ -23,6 +23,11 @@ public function __construct( \Zend_Reflection_Docblock_Tag_Param $param){ $this->type = $param->getType(); $this->description = $param->getDescription(); $this->variableName = $param->getVariableName(); + + if( empty( $this->variableName) && 0 === strpos( $this->type, '$')){ + $this->variableName = $this->type; + $this->type = 'unknown'; + } } } diff --git a/src/views/Class.mustache b/src/views/Class.mustache index de93889..a351466 100644 --- a/src/views/Class.mustache +++ b/src/views/Class.mustache @@ -1,4 +1,3 @@ - # **{{ type }}** {{ reflexion.getShortName }} Full name : `{{ class }}` @@ -14,5 +13,5 @@ Full name : `{{ class }}` | Method | Description | |---|---| {{# methods }} -| [{{name}}]({{name}}.md) | {{description}} | +| [`{{name}}`]({{name}}.md) | {{description}} | {{/ methods }} diff --git a/src/views/Namespace.mustache b/src/views/Namespace.mustache index e491178..0bf82c9 100644 --- a/src/views/Namespace.mustache +++ b/src/views/Namespace.mustache @@ -1,4 +1,3 @@ - # Namespace {{ pageName }} **Full name** : `{{ namespace }}` From 5e1c5e2b473de568f570419edec2e5d6678a90b4 Mon Sep 17 00:00:00 2001 From: alphayax Date: Mon, 4 Jul 2016 14:44:40 +0200 Subject: [PATCH 10/11] Manage no return --- docs/MdGen/__construct.md | 1 + docs/MdGen/filterNamespace.md | 1 + docs/MdGen/filterSubClasses.md | 1 + docs/MdGen/generate.md | 1 + docs/MdGen/generateClassMdFromLoadedClasses.md | 2 +- docs/MdGen/loadClasses.md | 3 ++- docs/models/ClassMd/__construct.md | 1 + docs/models/ClassMd/computeType.md | 3 ++- docs/models/ClassMd/getNamespace.md | 3 ++- docs/models/ClassMd/getReflexion.md | 2 +- docs/models/ClassMd/write.md | 3 ++- docs/models/ClassMd/writeMethods.md | 3 ++- docs/models/MethodMd/__construct.md | 1 + docs/models/MethodMd/getModifiers.md | 2 +- docs/models/MethodMd/getParams.md | 2 +- docs/models/MethodMd/hasParams.md | 2 +- docs/models/MethodMd/write.md | 1 + docs/models/NamespaceMd/__construct.md | 1 + docs/models/NamespaceMd/computePageName.md | 2 +- docs/models/NamespaceMd/getPageBfe.md | 2 +- docs/models/NamespaceMd/setDirectory.md | 1 + docs/models/NamespaceMd/write.md | 3 ++- docs/models/NamespaceMd/writeMdClasses.md | 3 ++- docs/models/NamespaceMd/writeSubPages.md | 3 ++- docs/models/ParamMd/__construct.md | 1 + src/views/MethodMd/Param.mustache | 2 +- src/views/MethodMd/Return.mustache | 3 +++ 27 files changed, 37 insertions(+), 16 deletions(-) diff --git a/docs/MdGen/__construct.md b/docs/MdGen/__construct.md index f135079..78e77c9 100644 --- a/docs/MdGen/__construct.md +++ b/docs/MdGen/__construct.md @@ -22,6 +22,7 @@ #### Return +> No Return #### Implementation diff --git a/docs/MdGen/filterNamespace.md b/docs/MdGen/filterNamespace.md index eb2fafe..a1ef5dd 100644 --- a/docs/MdGen/filterNamespace.md +++ b/docs/MdGen/filterNamespace.md @@ -21,6 +21,7 @@ #### Return +> No Return #### Implementation diff --git a/docs/MdGen/filterSubClasses.md b/docs/MdGen/filterSubClasses.md index d782dbd..117411e 100644 --- a/docs/MdGen/filterSubClasses.md +++ b/docs/MdGen/filterSubClasses.md @@ -21,6 +21,7 @@ #### Return +> No Return #### Implementation diff --git a/docs/MdGen/generate.md b/docs/MdGen/generate.md index 7c62808..5ef2afb 100644 --- a/docs/MdGen/generate.md +++ b/docs/MdGen/generate.md @@ -21,6 +21,7 @@ #### Return +> No Return #### Implementation diff --git a/docs/MdGen/generateClassMdFromLoadedClasses.md b/docs/MdGen/generateClassMdFromLoadedClasses.md index eb42034..aa029a7 100644 --- a/docs/MdGen/generateClassMdFromLoadedClasses.md +++ b/docs/MdGen/generateClassMdFromLoadedClasses.md @@ -15,7 +15,7 @@ #### Parameters - No parameters +> No parameters #### Return diff --git a/docs/MdGen/loadClasses.md b/docs/MdGen/loadClasses.md index 6b661b6..2f06c5f 100644 --- a/docs/MdGen/loadClasses.md +++ b/docs/MdGen/loadClasses.md @@ -15,10 +15,11 @@ #### Parameters - No parameters +> No parameters #### Return +> No Return #### Implementation diff --git a/docs/models/ClassMd/__construct.md b/docs/models/ClassMd/__construct.md index 6ae5333..ad81080 100644 --- a/docs/models/ClassMd/__construct.md +++ b/docs/models/ClassMd/__construct.md @@ -21,6 +21,7 @@ #### Return +> No Return #### Implementation diff --git a/docs/models/ClassMd/computeType.md b/docs/models/ClassMd/computeType.md index 154e806..657af49 100644 --- a/docs/models/ClassMd/computeType.md +++ b/docs/models/ClassMd/computeType.md @@ -15,10 +15,11 @@ #### Parameters - No parameters +> No parameters #### Return +> No Return #### Implementation diff --git a/docs/models/ClassMd/getNamespace.md b/docs/models/ClassMd/getNamespace.md index 876c09e..1beeccf 100644 --- a/docs/models/ClassMd/getNamespace.md +++ b/docs/models/ClassMd/getNamespace.md @@ -15,10 +15,11 @@ #### Parameters - No parameters +> No parameters #### Return +> No Return #### Implementation diff --git a/docs/models/ClassMd/getReflexion.md b/docs/models/ClassMd/getReflexion.md index c533e7b..7286b28 100644 --- a/docs/models/ClassMd/getReflexion.md +++ b/docs/models/ClassMd/getReflexion.md @@ -15,7 +15,7 @@ #### Parameters - No parameters +> No parameters #### Return diff --git a/docs/models/ClassMd/write.md b/docs/models/ClassMd/write.md index 5001fee..361a257 100644 --- a/docs/models/ClassMd/write.md +++ b/docs/models/ClassMd/write.md @@ -15,10 +15,11 @@ #### Parameters - No parameters +> No parameters #### Return +> No Return #### Implementation diff --git a/docs/models/ClassMd/writeMethods.md b/docs/models/ClassMd/writeMethods.md index 2daccd9..98eddce 100644 --- a/docs/models/ClassMd/writeMethods.md +++ b/docs/models/ClassMd/writeMethods.md @@ -15,10 +15,11 @@ #### Parameters - No parameters +> No parameters #### Return +> No Return #### Implementation diff --git a/docs/models/MethodMd/__construct.md b/docs/models/MethodMd/__construct.md index 22b972c..59a21f0 100644 --- a/docs/models/MethodMd/__construct.md +++ b/docs/models/MethodMd/__construct.md @@ -22,6 +22,7 @@ #### Return +> No Return #### Implementation diff --git a/docs/models/MethodMd/getModifiers.md b/docs/models/MethodMd/getModifiers.md index 95254e2..a928063 100644 --- a/docs/models/MethodMd/getModifiers.md +++ b/docs/models/MethodMd/getModifiers.md @@ -15,7 +15,7 @@ #### Parameters - No parameters +> No parameters #### Return diff --git a/docs/models/MethodMd/getParams.md b/docs/models/MethodMd/getParams.md index b00c82e..1a713be 100644 --- a/docs/models/MethodMd/getParams.md +++ b/docs/models/MethodMd/getParams.md @@ -15,7 +15,7 @@ #### Parameters - No parameters +> No parameters #### Return diff --git a/docs/models/MethodMd/hasParams.md b/docs/models/MethodMd/hasParams.md index 61280d4..e3c7656 100644 --- a/docs/models/MethodMd/hasParams.md +++ b/docs/models/MethodMd/hasParams.md @@ -15,7 +15,7 @@ #### Parameters - No parameters +> No parameters #### Return diff --git a/docs/models/MethodMd/write.md b/docs/models/MethodMd/write.md index 41d70c2..e7dd622 100644 --- a/docs/models/MethodMd/write.md +++ b/docs/models/MethodMd/write.md @@ -21,6 +21,7 @@ #### Return +> No Return #### Implementation diff --git a/docs/models/NamespaceMd/__construct.md b/docs/models/NamespaceMd/__construct.md index f1d09cb..39bcecb 100644 --- a/docs/models/NamespaceMd/__construct.md +++ b/docs/models/NamespaceMd/__construct.md @@ -22,6 +22,7 @@ #### Return +> No Return #### Implementation diff --git a/docs/models/NamespaceMd/computePageName.md b/docs/models/NamespaceMd/computePageName.md index 97d08c7..2636d45 100644 --- a/docs/models/NamespaceMd/computePageName.md +++ b/docs/models/NamespaceMd/computePageName.md @@ -15,7 +15,7 @@ #### Parameters - No parameters +> No parameters #### Return diff --git a/docs/models/NamespaceMd/getPageBfe.md b/docs/models/NamespaceMd/getPageBfe.md index b7dcdb8..407758f 100644 --- a/docs/models/NamespaceMd/getPageBfe.md +++ b/docs/models/NamespaceMd/getPageBfe.md @@ -15,7 +15,7 @@ #### Parameters - No parameters +> No parameters #### Return diff --git a/docs/models/NamespaceMd/setDirectory.md b/docs/models/NamespaceMd/setDirectory.md index 74f2756..c1b880b 100644 --- a/docs/models/NamespaceMd/setDirectory.md +++ b/docs/models/NamespaceMd/setDirectory.md @@ -21,6 +21,7 @@ #### Return +> No Return #### Implementation diff --git a/docs/models/NamespaceMd/write.md b/docs/models/NamespaceMd/write.md index 4e700b7..4d9856e 100644 --- a/docs/models/NamespaceMd/write.md +++ b/docs/models/NamespaceMd/write.md @@ -15,10 +15,11 @@ #### Parameters - No parameters +> No parameters #### Return +> No Return #### Implementation diff --git a/docs/models/NamespaceMd/writeMdClasses.md b/docs/models/NamespaceMd/writeMdClasses.md index c432a9f..25ad939 100644 --- a/docs/models/NamespaceMd/writeMdClasses.md +++ b/docs/models/NamespaceMd/writeMdClasses.md @@ -15,10 +15,11 @@ #### Parameters - No parameters +> No parameters #### Return +> No Return #### Implementation diff --git a/docs/models/NamespaceMd/writeSubPages.md b/docs/models/NamespaceMd/writeSubPages.md index 56d9c19..93c80a3 100644 --- a/docs/models/NamespaceMd/writeSubPages.md +++ b/docs/models/NamespaceMd/writeSubPages.md @@ -15,10 +15,11 @@ #### Parameters - No parameters +> No parameters #### Return +> No Return #### Implementation diff --git a/docs/models/ParamMd/__construct.md b/docs/models/ParamMd/__construct.md index e81f07c..5527abf 100644 --- a/docs/models/ParamMd/__construct.md +++ b/docs/models/ParamMd/__construct.md @@ -21,6 +21,7 @@ #### Return +> No Return #### Implementation diff --git a/src/views/MethodMd/Param.mustache b/src/views/MethodMd/Param.mustache index b826e6d..5d798d7 100644 --- a/src/views/MethodMd/Param.mustache +++ b/src/views/MethodMd/Param.mustache @@ -8,5 +8,5 @@ {{/ params }} {{/ hasParams }} {{^ hasParams }} - No parameters +> No parameters {{/ hasParams }} diff --git a/src/views/MethodMd/Return.mustache b/src/views/MethodMd/Return.mustache index 11f2f6e..6a0eb2a 100644 --- a/src/views/MethodMd/Return.mustache +++ b/src/views/MethodMd/Return.mustache @@ -3,3 +3,6 @@ {{# return }} {{.}} {{/ return }} +{{^ return }} +> No Return +{{/ return }} From 5f2598f7ac23a49370caaff2e6aa152ea68514e2 Mon Sep 17 00:00:00 2001 From: alphayax Date: Mon, 4 Jul 2016 15:08:24 +0200 Subject: [PATCH 11/11] Add constants --- docs/MdGen/__CLASS__.md | 4 ++ docs/MdGen/__construct.md | 2 +- docs/MdGen/loadClasses.md | 2 + docs/models/ClassMd/__CLASS__.md | 5 +++ docs/models/ClassMd/__construct.md | 11 ++++++ docs/models/MethodMd/__CLASS__.md | 5 +++ docs/models/MethodMd/__construct.md | 22 ++--------- docs/models/NamespaceMd/__CLASS__.md | 4 ++ docs/models/ParamMd/__CLASS__.md | 4 ++ docs/utils/arrayAccessProperties/__CLASS__.md | 5 +++ src/MdGen.php | 15 +++++--- src/models/ClassMd.php | 14 +++++++ src/models/MethodMd.php | 38 ++++++++++--------- src/views/Class.mustache | 12 ++++++ 14 files changed, 100 insertions(+), 43 deletions(-) diff --git a/docs/MdGen/__CLASS__.md b/docs/MdGen/__CLASS__.md index 221fa51..c9c19e4 100644 --- a/docs/MdGen/__CLASS__.md +++ b/docs/MdGen/__CLASS__.md @@ -9,6 +9,10 @@ Full name : `alphayax\mdGen\MdGen` - `chapters` - `rootPage` +## Constants + +- `DEFAULT_SRC_DIRECTORY = ''` + ## Methods summary | Method | Description | diff --git a/docs/MdGen/__construct.md b/docs/MdGen/__construct.md index 78e77c9..c4d3590 100644 --- a/docs/MdGen/__construct.md +++ b/docs/MdGen/__construct.md @@ -27,7 +27,7 @@ #### Implementation ```php - public function __construct( $srcDirectory, $rootNamespace){ + public function __construct( $srcDirectory = self::DEFAULT_SRC_DIRECTORY, $rootNamespace){ $this->rootNamespace = $rootNamespace; $this->srcDirectory = $srcDirectory; $this->loadClasses(); diff --git a/docs/MdGen/loadClasses.md b/docs/MdGen/loadClasses.md index 2f06c5f..a6d88b6 100644 --- a/docs/MdGen/loadClasses.md +++ b/docs/MdGen/loadClasses.md @@ -29,6 +29,7 @@ throw new \Exception( 'Source directory not found : '. $this->srcDirectory); } + /// Recursively scan PHP Files $objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator( $this->srcDirectory), \RecursiveIteratorIterator::SELF_FIRST); $Regex = new \RegexIterator( $objects, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH); foreach( $Regex as $name => $object){ @@ -37,6 +38,7 @@ } } + /// Extract data from loaded classes $classes = get_declared_classes(); $traits = get_declared_traits(); $interfaces = get_declared_interfaces(); diff --git a/docs/models/ClassMd/__CLASS__.md b/docs/models/ClassMd/__CLASS__.md index 6818b3d..8c4506e 100644 --- a/docs/models/ClassMd/__CLASS__.md +++ b/docs/models/ClassMd/__CLASS__.md @@ -10,6 +10,11 @@ Full name : `alphayax\mdGen\models\ClassMd` - `methods` - `type` - `properties` +- `constants` + +## Constants + +> No constants ## Methods summary diff --git a/docs/models/ClassMd/__construct.md b/docs/models/ClassMd/__construct.md index ad81080..405537a 100644 --- a/docs/models/ClassMd/__construct.md +++ b/docs/models/ClassMd/__construct.md @@ -30,11 +30,14 @@ $this->class = $class; $this->reflexion = new \ReflectionClass( $class); $this->computeType(); + + /// Properties $properties = $this->reflexion->getProperties(); foreach ($properties as $property){ $this->properties[] = $property->getName(); } + /// Methods $methods = $this->reflexion->getMethods(); foreach ( $methods as $method){ @@ -53,6 +56,14 @@ $this->publicMethods[] = $methodMd; } + + /// Constants + foreach ( $this->reflexion->getConstants() as $constantName => $constantValue){ + $this->constants[] = [ + 'name' => $constantName, + 'value' => $constantValue, + ]; + } } ``` diff --git a/docs/models/MethodMd/__CLASS__.md b/docs/models/MethodMd/__CLASS__.md index 82aa09a..0ec6be6 100644 --- a/docs/models/MethodMd/__CLASS__.md +++ b/docs/models/MethodMd/__CLASS__.md @@ -11,11 +11,16 @@ Full name : `alphayax\mdGen\models\MethodMd` - `return` - `impl` +## Constants + +> No constants + ## Methods summary | Method | Description | |---|---| | [`__construct`](__construct.md) | MethodMd constructor. | +| [`extractImplementation`](extractImplementation.md) | | | [`hasParams`](hasParams.md) | | | [`getParams`](getParams.md) | | | [`getModifiers`](getModifiers.md) | | diff --git a/docs/models/MethodMd/__construct.md b/docs/models/MethodMd/__construct.md index 59a21f0..88ddbba 100644 --- a/docs/models/MethodMd/__construct.md +++ b/docs/models/MethodMd/__construct.md @@ -36,21 +36,7 @@ $this->name = $this->reflexion->getName(); $docBlock = $this->reflexion->getDocblock(); - /// Implementation - $this->impl = ''; - $f = fopen( $this->reflexion->getFileName(), 'r'); - $lineNo = 0; - while ($line = fgets($f)) { - $lineNo++; - if ($lineNo >= $this->reflexion->getStartLine()) { - $this->impl .= $line; - } - if ($lineNo == $this->reflexion->getEndLine()) { - break; - } - } - fclose($f); - + $this->extractImplementation(); /// Desc $shortDesc = str_replace(PHP_EOL, ' ', $docBlock->getShortDescription()); @@ -68,10 +54,8 @@ if( $return){ $this->return = $return->getType() . ' ' . $return->getDescription(); } - - - - } catch (\Exception $e) { + } + catch( \Exception $e) { // Unable to parse PHPDoc Block... Skip it :( } } diff --git a/docs/models/NamespaceMd/__CLASS__.md b/docs/models/NamespaceMd/__CLASS__.md index ee379aa..382ffdf 100644 --- a/docs/models/NamespaceMd/__CLASS__.md +++ b/docs/models/NamespaceMd/__CLASS__.md @@ -11,6 +11,10 @@ Full name : `alphayax\mdGen\models\NamespaceMd` - `page_rd` - `pageName` +## Constants + +> No constants + ## Methods summary | Method | Description | diff --git a/docs/models/ParamMd/__CLASS__.md b/docs/models/ParamMd/__CLASS__.md index fb09717..a1f1c48 100644 --- a/docs/models/ParamMd/__CLASS__.md +++ b/docs/models/ParamMd/__CLASS__.md @@ -8,6 +8,10 @@ Full name : `alphayax\mdGen\models\ParamMd` - `description` - `variableName` +## Constants + +> No constants + ## Methods summary | Method | Description | diff --git a/docs/utils/arrayAccessProperties/__CLASS__.md b/docs/utils/arrayAccessProperties/__CLASS__.md index 5eb8c9d..854d068 100644 --- a/docs/utils/arrayAccessProperties/__CLASS__.md +++ b/docs/utils/arrayAccessProperties/__CLASS__.md @@ -4,6 +4,11 @@ Full name : `alphayax\mdGen\utils\arrayAccessProperties` ## Properties +> No properties + +## Constants + +> No constants ## Methods summary diff --git a/src/MdGen.php b/src/MdGen.php index b9bda03..f9252e0 100644 --- a/src/MdGen.php +++ b/src/MdGen.php @@ -8,16 +8,19 @@ */ class MdGen { - /** @var string */ + /// Default values + const DEFAULT_SRC_DIRECTORY = ''; + + /** @var string Source directory. PHP Files will be scanned in this folder */ protected $srcDirectory = ''; - /** @var string[] */ + /** @var string[] List of all founded PHP Classes, Interfaces and Traits */ protected $loadedClasses; - /** @var models\ClassMd[] */ + /** @var models\ClassMd[] Filtered list of PHP Classes, Interfaces and Traits */ protected $chapters = []; - /** @var models\NamespaceMd */ + /** @var models\NamespaceMd Root Namespace */ protected $rootPage; @@ -26,7 +29,7 @@ class MdGen { * @param $srcDirectory * @param $rootNamespace */ - public function __construct( $srcDirectory, $rootNamespace){ + public function __construct( $srcDirectory = self::DEFAULT_SRC_DIRECTORY, $rootNamespace){ $this->rootNamespace = $rootNamespace; $this->srcDirectory = $srcDirectory; $this->loadClasses(); @@ -41,6 +44,7 @@ protected function loadClasses(){ throw new \Exception( 'Source directory not found : '. $this->srcDirectory); } + /// Recursively scan PHP Files $objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator( $this->srcDirectory), \RecursiveIteratorIterator::SELF_FIRST); $Regex = new \RegexIterator( $objects, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH); foreach( $Regex as $name => $object){ @@ -49,6 +53,7 @@ protected function loadClasses(){ } } + /// Extract data from loaded classes $classes = get_declared_classes(); $traits = get_declared_traits(); $interfaces = get_declared_interfaces(); diff --git a/src/models/ClassMd.php b/src/models/ClassMd.php index 289cdbf..951af8a 100644 --- a/src/models/ClassMd.php +++ b/src/models/ClassMd.php @@ -27,6 +27,9 @@ class ClassMd implements \ArrayAccess { /** @var array */ protected $properties = []; + /** @var array */ + protected $constants = []; + /** * ClassChapter constructor. * @param string $class @@ -35,11 +38,14 @@ public function __construct( $class){ $this->class = $class; $this->reflexion = new \ReflectionClass( $class); $this->computeType(); + + /// Properties $properties = $this->reflexion->getProperties(); foreach ($properties as $property){ $this->properties[] = $property->getName(); } + /// Methods $methods = $this->reflexion->getMethods(); foreach ( $methods as $method){ @@ -58,6 +64,14 @@ public function __construct( $class){ $this->publicMethods[] = $methodMd; } + + /// Constants + foreach ( $this->reflexion->getConstants() as $constantName => $constantValue){ + $this->constants[] = [ + 'name' => $constantName, + 'value' => $constantValue, + ]; + } } /** diff --git a/src/models/MethodMd.php b/src/models/MethodMd.php index 0dc2ee5..acf1256 100644 --- a/src/models/MethodMd.php +++ b/src/models/MethodMd.php @@ -40,21 +40,7 @@ public function __construct( $className, $methodName) { $this->name = $this->reflexion->getName(); $docBlock = $this->reflexion->getDocblock(); - /// Implementation - $this->impl = ''; - $f = fopen( $this->reflexion->getFileName(), 'r'); - $lineNo = 0; - while ($line = fgets($f)) { - $lineNo++; - if ($lineNo >= $this->reflexion->getStartLine()) { - $this->impl .= $line; - } - if ($lineNo == $this->reflexion->getEndLine()) { - break; - } - } - fclose($f); - + $this->extractImplementation(); /// Desc $shortDesc = str_replace(PHP_EOL, ' ', $docBlock->getShortDescription()); @@ -72,12 +58,28 @@ public function __construct( $className, $methodName) { if( $return){ $this->return = $return->getType() . ' ' . $return->getDescription(); } + } + catch( \Exception $e) { + // Unable to parse PHPDoc Block... Skip it :( + } + } + protected function extractImplementation(){ - - } catch (\Exception $e) { - // Unable to parse PHPDoc Block... Skip it :( + /// Implementation + $this->impl = ''; + $f = fopen( $this->reflexion->getFileName(), 'r'); + $lineNo = 0; + while ($line = fgets($f)) { + $lineNo++; + if ($lineNo >= $this->reflexion->getStartLine()) { + $this->impl .= $line; + } + if ($lineNo == $this->reflexion->getEndLine()) { + break; + } } + fclose($f); } /** diff --git a/src/views/Class.mustache b/src/views/Class.mustache index a351466..57b8c37 100644 --- a/src/views/Class.mustache +++ b/src/views/Class.mustache @@ -7,6 +7,18 @@ Full name : `{{ class }}` {{# properties}} - `{{.}}` {{/ properties}} +{{^ properties}} +> No properties +{{/ properties}} + +## Constants + +{{# constants}} +- `{{name}} = '{{{value}}}'` +{{/ constants}} +{{^ constants}} +> No constants +{{/ constants}} ## Methods summary