| Conditions | 1 |
| Paths | 1 |
| Total Lines | 60 |
| Code Lines | 39 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 59 | protected function initializeMappings() |
||
| 60 | { |
||
| 61 | $this->mappings['category'] = function ($value) { |
||
| 62 | $this->object->getProperties()->setCategory($value); |
||
| 63 | }; |
||
| 64 | $this->mappings['company'] = function ($value) { |
||
| 65 | $this->object->getProperties()->setCompany($value); |
||
| 66 | }; |
||
| 67 | $this->mappings['created'] = function ($value) { |
||
| 68 | $this->object->getProperties()->setCreated($value); |
||
| 69 | }; |
||
| 70 | $this->mappings['creator'] = function ($value) { |
||
| 71 | $this->object->getProperties()->setCreator($value); |
||
| 72 | }; |
||
| 73 | $this->mappings['defaultStyle'] = function ($value) { |
||
| 74 | $this->object->getDefaultStyle()->applyFromArray($value); |
||
| 75 | }; |
||
| 76 | $this->mappings['description'] = function ($value) { |
||
| 77 | $this->object->getProperties()->setDescription($value); |
||
| 78 | }; |
||
| 79 | $this->mappings['format'] = function ($value) { |
||
| 80 | $this->attributes['format'] = $value; |
||
| 81 | }; |
||
| 82 | $this->mappings['keywords'] = function ($value) { |
||
| 83 | $this->object->getProperties()->setKeywords($value); |
||
| 84 | }; |
||
| 85 | $this->mappings['lastModifiedBy'] = function ($value) { |
||
| 86 | $this->object->getProperties()->setLastModifiedBy($value); |
||
| 87 | }; |
||
| 88 | $this->mappings['manager'] = function ($value) { |
||
| 89 | $this->object->getProperties()->setManager($value); |
||
| 90 | }; |
||
| 91 | $this->mappings['modified'] = function ($value) { |
||
| 92 | $this->object->getProperties()->setModified($value); |
||
| 93 | }; |
||
| 94 | $this->mappings['security']['lockRevision'] = function ($value) { |
||
| 95 | $this->object->getSecurity()->setLockRevision($value); |
||
| 96 | }; |
||
| 97 | $this->mappings['security']['lockStructure'] = function ($value) { |
||
| 98 | $this->object->getSecurity()->setLockStructure($value); |
||
| 99 | }; |
||
| 100 | $this->mappings['security']['lockWindows'] = function ($value) { |
||
| 101 | $this->object->getSecurity()->setLockWindows($value); |
||
| 102 | }; |
||
| 103 | $this->mappings['security']['revisionsPassword'] = function ($value) { |
||
| 104 | $this->object->getSecurity()->setRevisionsPassword($value); |
||
| 105 | }; |
||
| 106 | $this->mappings['security']['workbookPassword'] = function ($value) { |
||
| 107 | $this->object->getSecurity()->setWorkbookPassword($value); |
||
| 108 | }; |
||
| 109 | $this->mappings['subject'] = function ($value) { |
||
| 110 | $this->object->getProperties()->setSubject($value); |
||
| 111 | }; |
||
| 112 | $this->mappings['template'] = function ($value) { |
||
| 113 | $this->attributes['template'] = $value; |
||
| 114 | }; |
||
| 115 | $this->mappings['title'] = function ($value) { |
||
| 116 | $this->object->getProperties()->setTitle($value); |
||
| 117 | }; |
||
| 118 | } |
||
| 119 | |||
| 303 |