We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 1 |
| Paths | 1 |
| Total Lines | 52 |
| Code Lines | 34 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 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 |
||
| 48 | public function canGetLogicalStructure() |
||
| 49 | { |
||
| 50 | $doc = $this->doc('av_beispiel.xml'); |
||
| 51 | |||
| 52 | $toc = $doc->tableOfContents[0] ?? []; |
||
| 53 | |||
| 54 | $this->assertArrayMatches([ |
||
| 55 | 'dmdId' => 'DMDLOG_0000', |
||
| 56 | 'admId' => 'AMD', |
||
| 57 | 'videoChapter' => [ |
||
| 58 | 'fileId' => 'FILE_0000_DEFAULT_MOV', |
||
| 59 | 'timecode' => 0, |
||
| 60 | ], |
||
| 61 | 'children' => [ |
||
| 62 | [ |
||
| 63 | 'id' => 'LOG_0001', |
||
| 64 | 'dmdId' => '', |
||
| 65 | 'admId' => '', |
||
| 66 | 'videoChapter' => [ |
||
| 67 | 'fileId' => 'FILE_0000_DEFAULT_MOV', |
||
| 68 | 'timecode' => 0, |
||
| 69 | ], |
||
| 70 | ], |
||
| 71 | [ |
||
| 72 | 'id' => 'LOG_0002', |
||
| 73 | 'dmdId' => '', |
||
| 74 | 'admId' => '', |
||
| 75 | 'videoChapter' => [ |
||
| 76 | 'fileId' => 'FILE_0000_DEFAULT_MOV', |
||
| 77 | 'timecode' => 20.5, |
||
| 78 | ], |
||
| 79 | ], |
||
| 80 | [ |
||
| 81 | 'id' => 'LOG_0003', |
||
| 82 | 'dmdId' => '', |
||
| 83 | 'admId' => '', |
||
| 84 | 'videoChapter' => [ |
||
| 85 | 'fileId' => 'FILE_0000_DEFAULT_MOV', |
||
| 86 | 'timecode' => 40, |
||
| 87 | ], |
||
| 88 | ], |
||
| 89 | [ |
||
| 90 | 'id' => 'LOG_0004', |
||
| 91 | 'dmdId' => '', |
||
| 92 | 'admId' => '', |
||
| 93 | 'videoChapter' => [ |
||
| 94 | 'fileId' => 'FILE_0000_DEFAULT_MOV', |
||
| 95 | 'timecode' => 60, |
||
| 96 | ], |
||
| 97 | ], |
||
| 98 | ], |
||
| 99 | ], $toc, 'Expected TOC to contain the specified values'); |
||
| 100 | } |
||
| 165 |