| Conditions | 1 |
| Paths | 1 |
| Total Lines | 109 |
| 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 |
||
| 39 | public function bibtextProvider() { |
||
| 40 | |||
| 41 | $provider[] = [ |
||
| 42 | "@article{einstein1935can, |
||
| 43 | title={Can quantum-mechanical description of physical reality be considered complete?}, |
||
| 44 | author={Einstein, Albert and Podolsky, Boris and Rosen, Nathan}, |
||
| 45 | journal={Physical review}, |
||
| 46 | volume={47}, |
||
| 47 | number={10}, |
||
| 48 | pages={777}, |
||
| 49 | year={1935}, |
||
| 50 | publisher={APS} |
||
| 51 | }", |
||
| 52 | [ |
||
| 53 | 'type' => 'article', |
||
| 54 | 'reference' => 'einstein1935can', |
||
| 55 | 'title' => 'Can quantum-mechanical description of physical reality be considered complete?', |
||
| 56 | 'author' => 'Einstein, Albert and Podolsky, Boris and Rosen, Nathan', |
||
| 57 | 'journal' => 'Physical review', |
||
| 58 | 'volume' => '47', |
||
| 59 | 'number' => '10', |
||
| 60 | 'pages' => '777', |
||
| 61 | 'year' => '1935', |
||
| 62 | 'publisher' => 'APS' |
||
| 63 | ] |
||
| 64 | ]; |
||
| 65 | |||
| 66 | $provider[] = [ |
||
| 67 | "@book{marx2004capital, |
||
| 68 | title={Capital (Volume 1: A Critique of Political Economy): A Critique of Political Economy}, |
||
| 69 | author={Marx, Karl}, |
||
| 70 | year={2004}, |
||
| 71 | publisher={Digireads. com Publishing} |
||
| 72 | }", |
||
| 73 | [ |
||
| 74 | 'type' => 'book', |
||
| 75 | 'reference' => 'marx2004capital', |
||
| 76 | 'title' => 'Capital (Volume 1: A Critique of Political Economy): A Critique of Political Economy', |
||
| 77 | 'author' => 'Marx, Karl', |
||
| 78 | 'year' => '2004', |
||
| 79 | 'publisher' => 'Digireads. com Publishing' |
||
| 80 | ] |
||
| 81 | ]; |
||
| 82 | |||
| 83 | #2 No reference |
||
| 84 | $provider[] = [ |
||
| 85 | "@article{, |
||
| 86 | title={Vascular endothelial growth factor is a secreted angiogenic mitogen}, |
||
| 87 | author={Leung, David W and Cachianes, George and Kuang, Wun-Jing and Goeddel, David V and Ferrara, Napoleone}, |
||
| 88 | journal={Science}, |
||
| 89 | volume={246}, |
||
| 90 | number={4935}, |
||
| 91 | pages={1306--1309}, |
||
| 92 | year={1989}, |
||
| 93 | publisher={American Association for the Advancement of Science} |
||
| 94 | }", |
||
| 95 | [ |
||
| 96 | 'type' => 'article', |
||
| 97 | 'reference' => '', |
||
| 98 | 'title' => 'Vascular endothelial growth factor is a secreted angiogenic mitogen', |
||
| 99 | 'author' => 'Leung, David W and Cachianes, George and Kuang, Wun-Jing and Goeddel, David V and Ferrara, Napoleone', |
||
| 100 | 'journal' => 'Science', |
||
| 101 | 'volume' => '246', |
||
| 102 | 'number' => '4935', |
||
| 103 | 'pages' => '1306--1309', |
||
| 104 | 'year' => '1989', |
||
| 105 | 'publisher' => 'American Association for the Advancement of Science' |
||
| 106 | ] |
||
| 107 | ]; |
||
| 108 | |||
| 109 | #3 No reference |
||
| 110 | $provider[] = [ |
||
| 111 | "@inproceedings{clean, |
||
| 112 | author = {First Author and Author, Second}, |
||
| 113 | title = {Pr{\"a}diktive Teilbandcodierung mit Vektorquantisierung f{\"u}r hochqualitative Audiosignale}, |
||
| 114 | booktitle = {8. ITG-Fachtagung H{\"o}rrundfunk}, |
||
| 115 | year = {1988}, |
||
| 116 | month = nov, |
||
| 117 | pages = {252--256}, |
||
| 118 | abstract = {Some Abstract, across |
||
| 119 | two lines}, |
||
| 120 | }", |
||
| 121 | [ |
||
| 122 | 'type' => 'inproceedings', |
||
| 123 | 'reference' => 'clean', |
||
| 124 | 'author' => 'First Author and Author, Second', |
||
| 125 | 'title' => 'Pr{"a}diktive Teilbandcodierung mit Vektorquantisierung f{"u}r hochqualitative Audiosignale', |
||
| 126 | 'booktitle' => '8. ITG-Fachtagung H{"o}rrundfunk', |
||
| 127 | 'year' => '1988', |
||
| 128 | 'month' => 'nov', |
||
| 129 | 'pages' => '252--256', |
||
| 130 | 'abstract' => "Some Abstract, across |
||
| 131 | two lines" |
||
| 132 | ] |
||
| 133 | ]; |
||
| 134 | |||
| 135 | #4 invalid/unprocessable content format |
||
| 136 | $provider[] = [ |
||
| 137 | "foo", |
||
| 138 | [] |
||
| 139 | ]; |
||
| 140 | |||
| 141 | $provider[] = [ |
||
| 142 | "@article{}", |
||
| 143 | [] |
||
| 144 | ]; |
||
| 145 | |||
| 146 | return $provider; |
||
| 147 | } |
||
| 148 | |||
| 150 |