Conditions | 11 |
Paths | 6 |
Total Lines | 25 |
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 |
||
42 | protected function readNext() |
||
43 | { |
||
44 | $xml = $this->getXMLReader(); |
||
45 | while ($xml->read()) { |
||
46 | if (\XMLReader::END_ELEMENT === $xml->nodeType && 'cellXfs' === $xml->name) { |
||
47 | break; |
||
48 | } elseif (\XMLReader::ELEMENT === $xml->nodeType && 'cellXfs' === $xml->name) { |
||
49 | $this->inXfs = true; |
||
50 | } elseif ($this->inXfs && \XMLReader::ELEMENT === $xml->nodeType && 'xf' === $xml->name) { |
||
51 | $fmtId = $xml->getAttribute('numFmtId'); |
||
52 | if (isset($this->numberFormats[$fmtId])) { |
||
53 | $value = $this->numberFormats[$fmtId]; |
||
54 | } elseif (in_array($fmtId, $this->nativeDateFormats)) { |
||
55 | $value = static::FORMAT_DATE; |
||
56 | } else { |
||
57 | $value = static::FORMAT_DEFAULT; |
||
58 | } |
||
59 | $this->values[] = $value; |
||
60 | |||
61 | return; |
||
62 | } |
||
63 | } |
||
64 | $this->valid = false; |
||
65 | $this->closeXMLReader(); |
||
66 | } |
||
67 | |||
100 |