Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
Yuml.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ubiquity\utils\yuml
;
4
5
class
Yuml
{
6
public
static
$classMask
=
'[{classContent}]'
;
7
public
static
$classSeparator
=
'|'
;
8
public
static
$memberSeparator
=
';'
;
9
public
static
$parameterSeparator
=
'‚'
;
10
public
static
$parameterTypeSeparator
=
':'
;
11
public
static
$groupeSeparator
=
","
;
12
public
static
$propertyMask
=
'{access}{primary}{name}{type}'
;
13
public
static
$methodMask
=
'{access}{name}({parameters}){type}'
;
14
public
static
$public
=
'+'
;
15
public
static
$protected
=
'#'
;
16
public
static
$private
=
'-'
;
17
public
static
$primary
=
'«pk» '
;
18
19
public
static
function
parseMask
($element,$variable,$value) {
20
$result=preg_replace(
'/(\{)'
.$variable.
'(\})/sim'
, $value, $element);
21
return
$result;
22
}
23
24
public
static
function
parseMaskArray
($element,$variables,$values) {
25
$result=$element;
26
$countValues=\count($values);
27
$maxVariables=\count($variables)-1;
28
for
($i=0;$i<$countValues;$i++){
29
$j=\min($maxVariables,$i);
30
$result=
self::parseMask
($result, $variables[$j], $values[$i]);
31
}
32
return
$result;
33
}
34
35
public
static
function
getNamesInMask
($mask){
36
\preg_match_all(
'@\{(.*?)\}@sim'
, $mask,$matches);
37
if
(isset($matches[1]))
38
return
$matches[1];
39
return
[];
40
}
41
42
private
static
function
replaceMaskValues
($mask,$values){
43
return
self::parseMaskArray
($mask, self::getNamesInMask($mask), $values);
44
}
45
46
public
static
function
setPropertyVariables
($values){
47
return
self::replaceMaskValues
(self::$propertyMask, $values);
48
}
49
50
public
static
function
setMethodVariables
($values){
51
return
self::replaceMaskValues
(self::$methodMask, $values);
52
}
53
54
public
static
function
setClassContent
($content){
55
return
self::parseMask
(self::$classMask,
'classContent'
, $content);
56
}
57
}
Ubiquity\utils\yuml\Yuml
Definition
Yuml.php:5
Ubiquity\utils\yuml\Yuml\$primary
static $primary
Definition
Yuml.php:17
Ubiquity\utils\yuml\Yuml\$groupeSeparator
static $groupeSeparator
Definition
Yuml.php:11
Ubiquity\utils\yuml\Yuml\$propertyMask
static $propertyMask
Definition
Yuml.php:12
Ubiquity\utils\yuml\Yuml\$methodMask
static $methodMask
Definition
Yuml.php:13
Ubiquity\utils\yuml\Yuml\setMethodVariables
static setMethodVariables($values)
Definition
Yuml.php:50
Ubiquity\utils\yuml\Yuml\setClassContent
static setClassContent($content)
Definition
Yuml.php:54
Ubiquity\utils\yuml\Yuml\$protected
static $protected
Definition
Yuml.php:15
Ubiquity\utils\yuml\Yuml\$private
static $private
Definition
Yuml.php:16
Ubiquity\utils\yuml\Yuml\getNamesInMask
static getNamesInMask($mask)
Definition
Yuml.php:35
Ubiquity\utils\yuml\Yuml\setPropertyVariables
static setPropertyVariables($values)
Definition
Yuml.php:46
Ubiquity\utils\yuml\Yuml\$public
static $public
Definition
Yuml.php:14
Ubiquity\utils\yuml\Yuml\$classSeparator
static $classSeparator
Definition
Yuml.php:7
Ubiquity\utils\yuml\Yuml\parseMaskArray
static parseMaskArray($element, $variables, $values)
Definition
Yuml.php:24
Ubiquity\utils\yuml\Yuml\parseMask
static parseMask($element, $variable, $value)
Definition
Yuml.php:19
Ubiquity\utils\yuml\Yuml\$classMask
static $classMask
Definition
Yuml.php:6
Ubiquity\utils\yuml\Yuml\replaceMaskValues
static replaceMaskValues($mask, $values)
Definition
Yuml.php:42
Ubiquity\utils\yuml\Yuml\$parameterSeparator
static $parameterSeparator
Definition
Yuml.php:9
Ubiquity\utils\yuml\Yuml\$parameterTypeSeparator
static $parameterTypeSeparator
Definition
Yuml.php:10
Ubiquity\utils\yuml\Yuml\$memberSeparator
static $memberSeparator
Definition
Yuml.php:8
Ubiquity\utils\yuml
Definition
ClassesToYuml.php:3
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity
src
Ubiquity
utils
yuml
Yuml.php
Generated on Sun Dec 10 2023 15:04:28 for
Ubiquity
by
doxygen
1.9.8