Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
CheckReset.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 
7 class CheckReset extends CheckData
8 {
9  protected $value;
10  /**
11  * @var Doc
12  */
13  protected $doc;
14 
15  protected $authorizedKeys = array(
16  "attributes",
17  "default",
18  "properties",
19  "parameters",
20  "structure",
21  "enums"
22  );
23  /**
24  * @param array $data
25  * @param Doc $doc
26  * @return CheckReset
27  */
28  function check(array $data, &$doc = null)
29  {
30 
31  $this->value = strtolower($data[1]);
32  $this->doc = $doc;
33  $this->checkValue();
34  return $this;
35  }
36  /**
37  * check reset values
38  * @return void
39  */
40  protected function checkValue()
41  {
42  if ($this->value) {
43  if (!in_array($this->value, $this->authorizedKeys)) {
44  $this->addError(ErrorCode::getError('RESE0001', $this->value, $this->doc->name));
45  }
46  }
47  }
48 }
check(array $data, &$doc=null)
Definition: CheckReset.php:28
static getError($code, $args=null)
Definition: ErrorCode.php:27
addError($msg)
Definition: CheckData.php:29
$data
← centre documentaire © anakeen