Core
3.2
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
parseFamilyMethod.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @package FDL
5
*/
6
7
class
parseFamilyMethod
extends
parseFamilyFunction
8
{
9
10
public
$methodName
=
''
;
11
public
$className
=
''
;
12
/**
13
* @static
14
* @param $methCall
15
* @return parseFamilyMethod
16
*/
17
public
function
parse
($methCall, $noOut =
false
)
18
{
19
20
$this->
initParse
($methCall);
21
22
$methodName
= trim(substr($methCall, 0, $this->firstParenthesis));
23
if
($this->
checkParenthesis
()) {
24
if
(strpos(
$methodName
,
'::'
) ===
false
) {
25
$this->
setError
(
ErrorCode::getError
(
'ATTR1251'
, $methCall));
26
}
else
{
27
28
list(
$className
,
$methodName
) = explode(
'::'
,
$methodName
, 2);
29
$this->methodName =
$methodName
;
30
$this->className =
$className
;
31
32
if
(!$this->
isPHPName
(
$methodName
)) {
33
$this->
setError
(
ErrorCode::getError
(
'ATTR1252'
,
$methodName
));
34
} elseif (
$className
&& (!$this->
isPHPClassName
(
$className
))) {
35
$this->
setError
(
ErrorCode::getError
(
'ATTR1253'
,
$className
));
36
}
else
{
37
$inputString
= substr($methCall, $this->firstParenthesis + 1, ($this->lastParenthesis - $this->firstParenthesis - 1));
38
$this->inputString =
$inputString
;
39
40
$this->
parseArguments
();
41
$this->
parseOutput
();
42
if
($noOut) $this->
limitOutputToZero
();
43
else
$this->
limitOutputToOne
();
44
}
45
}
46
}
47
48
return
$this;
49
}
50
51
protected
function
limitOutputToOne
()
52
{
53
if
(count($this->outputs) > 1) {
54
$this->
setError
(
ErrorCode::getError
(
'ATTR1254'
, $this->funcCall));
55
}
56
}
57
58
protected
function
limitOutputToZero
()
59
{
60
if
(count($this->outputs) > 0) {
61
$this->
setError
(
ErrorCode::getError
(
'ATTR1255'
, $this->funcCall));
62
} elseif ($this->lastSemiColumn > $this->lastParenthesis) {
63
$this->
setError
(
ErrorCode::getError
(
'ATTR1255'
, $this->funcCall));
64
}
65
}
66
}
parseFamilyFunction
Definition:
parseFamilyFunction.php:7
parseFamilyMethod\$className
$className
Definition:
parseFamilyMethod.php:11
parseFamilyMethod\$methodName
$methodName
Definition:
parseFamilyMethod.php:10
parseFamilyFunction\setError
setError($error)
Definition:
parseFamilyFunction.php:30
ErrorCode\getError
static getError($code, $args=null)
Definition:
ErrorCode.php:27
parseFamilyMethod\limitOutputToZero
limitOutputToZero()
Definition:
parseFamilyMethod.php:58
parseFamilyFunction\checkParenthesis
checkParenthesis()
Definition:
parseFamilyFunction.php:47
parseFamilyMethod\limitOutputToOne
limitOutputToOne()
Definition:
parseFamilyMethod.php:51
parseFamilyMethod\parse
parse($methCall, $noOut=false)
Definition:
parseFamilyMethod.php:17
parseFamilyFunction\isPHPClassName
isPHPClassName($s)
Definition:
parseFamilyFunction.php:160
parseFamilyFunction\parseOutput
parseOutput()
Definition:
parseFamilyFunction.php:131
parseFamilyMethod
Definition:
parseFamilyMethod.php:7
parseFamilyFunction\parseArguments
parseArguments()
Definition:
parseFamilyFunction.php:108
parseFamilyFunction\initParse
initParse($funcCall)
Definition:
parseFamilyFunction.php:35
parseFamilyFunction\$inputString
$inputString
Definition:
parseFamilyFunction.php:13
parseFamilyFunction\isPHPName
isPHPName($s)
Definition:
parseFamilyFunction.php:156
← centre documentaire
© anakeen