@@ 86-109 (lines=24) @@ | ||
83 | * @param string $data Any data added after the command |
|
84 | * @return \SwaggerGen\Swagger\Type\AbstractType|boolean |
|
85 | */ |
|
86 | public function handleCommand($command, $data = null) |
|
87 | { |
|
88 | switch (strtolower($command)) { |
|
89 | case 'default': |
|
90 | $this->default = $this->validateDefault($data); |
|
91 | return $this; |
|
92 | ||
93 | case 'enum': |
|
94 | $words = self::wordSplit($data); |
|
95 | foreach ($words as &$word) { |
|
96 | $word = $this->validateDefault($word); |
|
97 | } |
|
98 | $this->enum = array_merge($this->enum, $words); |
|
99 | return $this; |
|
100 | ||
101 | case 'step': |
|
102 | if (($step = intval($data)) > 0) { |
|
103 | $this->multipleOf = $step; |
|
104 | } |
|
105 | return $this; |
|
106 | } |
|
107 | ||
108 | return parent::handleCommand($command, $data); |
|
109 | } |
|
110 | ||
111 | public function toArray() |
|
112 | { |
@@ 80-103 (lines=24) @@ | ||
77 | * @param string $data Any data added after the command |
|
78 | * @return \SwaggerGen\Swagger\Type\AbstractType|boolean |
|
79 | */ |
|
80 | public function handleCommand($command, $data = null) |
|
81 | { |
|
82 | switch (strtolower($command)) { |
|
83 | case 'default': |
|
84 | $this->default = $this->validateDefault($data); |
|
85 | return $this; |
|
86 | ||
87 | case 'enum': |
|
88 | $words = self::wordSplit($data); |
|
89 | foreach ($words as &$word) { |
|
90 | $word = $this->validateDefault($word); |
|
91 | } |
|
92 | $this->enum = array_merge($this->enum, $words); |
|
93 | return $this; |
|
94 | ||
95 | case 'step': |
|
96 | if (($step = doubleval($data)) > 0) { |
|
97 | $this->multipleOf = $step; |
|
98 | } |
|
99 | return $this; |
|
100 | } |
|
101 | ||
102 | return parent::handleCommand($command, $data); |
|
103 | } |
|
104 | ||
105 | public function toArray() |
|
106 | { |