@@ -25,10 +25,18 @@ |
||
25 | 25 | "writeRecordId"=>false, |
26 | 26 | ); |
27 | 27 | } else { |
28 | - if (isset($values['name'])) $this->name = $values['name']; |
|
28 | + if (isset($values['name'])) { |
|
29 | + $this->name = $values['name']; |
|
30 | + } |
|
31 | + } |
|
32 | + if (isset($values['option'])) { |
|
33 | + $this->option = array_merge($this->option, $values['option']); |
|
34 | + } |
|
35 | + if (isset($values['writer'])) { |
|
36 | + $this->writer = array_merge($this->writer, $values['writer']); |
|
37 | + } |
|
38 | + if (isset($values['reader'])) { |
|
39 | + $this->reader = $values['reader']; |
|
29 | 40 | } |
30 | - if (isset($values['option'])) $this->option = array_merge($this->option, $values['option']); |
|
31 | - if (isset($values['writer'])) $this->writer = array_merge($this->writer, $values['writer']); |
|
32 | - if (isset($values['reader'])) $this->reader = $values['reader']; |
|
33 | 41 | } |
34 | 42 | } |
35 | 43 | \ No newline at end of file |
@@ -8,5 +8,5 @@ |
||
8 | 8 | * @Target("PROPERTY") |
9 | 9 | */ |
10 | 10 | class Field implements Annotation { |
11 | - public $type="string"; |
|
11 | + public $type = "string"; |
|
12 | 12 | } |
13 | 13 | \ No newline at end of file |
@@ -18,11 +18,11 @@ |
||
18 | 18 | public function visitProperty(PropertyMetadata $metadata, $data, Context $context) { |
19 | 19 | $name = $this->namingStrategy->translateName($metadata); |
20 | 20 | |
21 | - if (null === $data || ! is_array($data) || ! array_key_exists($name, $data)) { |
|
21 | + if (null === $data || !is_array($data) || !array_key_exists($name, $data)) { |
|
22 | 22 | return; |
23 | 23 | } |
24 | 24 | |
25 | - if ( ! $metadata->type) { |
|
25 | + if (!$metadata->type) { |
|
26 | 26 | throw new RuntimeException(sprintf('You must define a type for %s::$%s.', $metadata->reflection->class, $metadata->name)); |
27 | 27 | } |
28 | 28 |