Conditions | 3 |
Paths | 5 |
Total Lines | 29 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 3.4326 |
Changes | 0 |
1 | <?php |
||
36 | 1 | public function createFormForClass($className) |
|
37 | { |
||
38 | 1 | $form = $this->factory->create(); |
|
39 | |||
40 | try { |
||
41 | 1 | foreach ($this->mapper->getApiProperties($className) as $apiProperty) { |
|
42 | 1 | $form->add( |
|
43 | 1 | $this->factory->createForProperty( |
|
44 | 1 | $className, |
|
45 | 1 | $this->mapper->getEntityProperty($className, $apiProperty), |
|
46 | 1 | null, |
|
47 | 1 | ['auto_initialize' => false] |
|
48 | 1 | ) |
|
49 | 1 | ); |
|
50 | 1 | } |
|
51 | 1 | } catch (\Exception $exception) { |
|
52 | throw new EntityProcessingException( |
||
53 | sprintf( |
||
54 | 'Cannot create form for class %s: %s', |
||
55 | $className, |
||
56 | $exception->getMessage() |
||
57 | ), |
||
58 | $exception->getCode(), |
||
59 | $exception |
||
60 | ); |
||
61 | } |
||
62 | |||
63 | 1 | return $form; |
|
64 | } |
||
65 | } |
||
66 |