Conditions | 1 |
Paths | 1 |
Total Lines | 79 |
Code Lines | 58 |
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 provideMappingFromFile() |
||
40 | { |
||
41 | return [ |
||
42 | [ |
||
43 | __DIR__.'/fixture_lemonde.html', |
||
44 | [ |
||
45 | 'DATA-TYPE' => 'JSON-LD', |
||
46 | 'DATA-ARTICLE' => true, |
||
47 | 'périodique' => 'Le Monde', |
||
48 | 'titre' => 'Coronavirus : la Californie placée à son tour en confinement', |
||
49 | 'url' => 'https://www.lemonde.fr/planete/article/2020/03/20/coronavirus-la-californie-placee-en-confinement_6033754_3244.html', |
||
50 | 'date' => '20-03-2020', |
||
51 | ], |
||
52 | ], |
||
53 | [ |
||
54 | __DIR__.'/fixture_journalsOpenEdition.html', |
||
55 | [ |
||
56 | |||
57 | 'DATA-TYPE' => 'Open Graph/Dublin Core', |
||
58 | 'DATA-ARTICLE' => true, |
||
59 | 'titre' => 'Alger', |
||
60 | 'url' => 'http://journals.openedition.org/encyclopedieberbere/2434', |
||
61 | 'consulté le' => '11-04-2020', |
||
62 | 'date' => '01-07-1986', |
||
63 | 'url-access' => 'limité', |
||
64 | 'périodique' => 'Encyclopédie berbère', |
||
65 | 'et al.' => 'oui', |
||
66 | 'auteur1' => 'Camps, G.; Leglay, M.', |
||
67 | 'numéro' => '4', |
||
68 | 'page' => '447–472', |
||
69 | 'éditeur' => 'Éditions Peeters', |
||
70 | 'issn' => '1015-7344', |
||
71 | 'isbn' => '2-85744-282-3', |
||
72 | ], |
||
73 | ], |
||
74 | [ |
||
75 | __DIR__.'/fixture_pubmed.html', |
||
76 | [ |
||
77 | 'DATA-TYPE' => 'Open Graph/Dublin Core', |
||
78 | 'DATA-ARTICLE' => true, |
||
79 | 'site' => 'PubMed Central (PMC)', |
||
80 | 'titre' => 'The Diesel Exhaust in Miners Study: A Nested Case–Control Study of Lung Cancer and Diesel Exhaust', |
||
81 | 'url' => 'https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3369553/', |
||
82 | 'consulté le' => '11-04-2020', |
||
83 | 'date' => '06-06-2012', |
||
84 | 'périodique' => 'JNCI Journal of the National Cancer Institute', |
||
85 | 'et al.' => 'oui', |
||
86 | 'auteur1' => 'Debra T. Silverman, Claudine M. Samanic', |
||
87 | 'volume' => '104', |
||
88 | 'numéro' => '11', |
||
89 | 'page' => '855', |
||
90 | 'doi' => '10.1093/jnci/djs034', |
||
91 | 'pmid' => '22393209', |
||
92 | ], |
||
93 | ], |
||
94 | [ |
||
95 | __DIR__.'/fixture_figaro.html', |
||
96 | [ |
||
97 | 'DATA-TYPE' => 'JSON-LD', |
||
98 | 'DATA-ARTICLE' => true, |
||
99 | 'périodique' => 'Le Figaro', |
||
100 | 'titre' => 'Face au Covid-19, les cliniques privées mobilisées… mais en manque de masques', |
||
101 | 'url' => 'http://www.lefigaro.fr/sciences/face-au-covid-19-les-cliniques-privees-mobilisees-mais-en-manque-de-masques-20200318', |
||
102 | 'date' => '18-03-2020', |
||
103 | 'auteur1' => 'Marie-Cécile Renault', |
||
104 | 'url-access' => 'limité', |
||
105 | ], |
||
106 | ], |
||
107 | [ |
||
108 | __DIR__.'/fixture_liberation.html', |
||
109 | [ |
||
110 | 'DATA-TYPE' => 'JSON-LD', |
||
111 | 'DATA-ARTICLE' => true, |
||
112 | 'périodique' => 'Libération', |
||
113 | 'titre' => 'En Bretagne, le Parisiens-bashing guette', |
||
114 | 'url' => 'https://www.liberation.fr/france/2020/03/20/en-bretagne-le-parisiens-bashing-guette_1782471', |
||
115 | 'date' => '20-03-2020', |
||
116 | 'auteur1' => 'Pierre-Henri Allain', |
||
117 | 'url-access' => 'ouvert', |
||
118 | ], |
||
125 |