Conditions | 1 |
Paths | 1 |
Total Lines | 83 |
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 |
||
52 | public function provideInvalidConfiguration() |
||
53 | { |
||
54 | return array( |
||
55 | 'yml: no file' => array( |
||
56 | array(), |
||
57 | 'The extra.incenteev-parameters.file setting is required to use this script handler.', |
||
58 | ), |
||
59 | 'yml: no file type' => array( |
||
60 | array( |
||
61 | 'file' => 'fixtures/existent/yml/dist.yml', |
||
62 | ), |
||
63 | 'The extra.incenteev-parameters.file-type setting is required to use this script handler.', |
||
64 | ), |
||
65 | 'yml: missing default dist file' => array( |
||
66 | array( |
||
67 | 'file' => 'fixtures/invalid/yml/missing.yml', |
||
68 | 'file-type' => 'yml', |
||
69 | ), |
||
70 | 'The dist file "fixtures/invalid/yml/missing.yml.dist" does not exist. Check your dist-file config or create it.', |
||
71 | ), |
||
72 | 'yml: missing custom dist file' => array( |
||
73 | array( |
||
74 | 'file' => 'fixtures/invalid/yml/missing.yml', |
||
75 | 'dist-file' => 'fixtures/invalid/yml/non-existent.dist.yml', |
||
76 | 'file-type' => 'yml', |
||
77 | ), |
||
78 | 'The dist file "fixtures/invalid/yml/non-existent.dist.yml" does not exist. Check your dist-file config or create it.', |
||
79 | ), |
||
80 | 'yml: missing top level key in dist file' => array( |
||
81 | array( |
||
82 | 'file' => 'fixtures/invalid/yml/missing_top_level.yml', |
||
83 | 'file-type' => 'yml', |
||
84 | ), |
||
85 | 'The top-level key parameters is missing.', |
||
86 | ), |
||
87 | 'yml: invalid values in the existing file' => array( |
||
88 | array( |
||
89 | 'file' => 'fixtures/invalid/yml/invalid_existing_values.yml', |
||
90 | 'file-type' => 'yml', |
||
91 | ), |
||
92 | 'The existing "fixtures/invalid/yml/invalid_existing_values.yml" file does not contain an array', |
||
93 | ), |
||
94 | 'php: no file' => array( |
||
95 | array(), |
||
96 | 'The extra.incenteev-parameters.file setting is required to use this script handler.', |
||
97 | ), |
||
98 | 'php: no file type' => array( |
||
99 | array( |
||
100 | 'file' => 'fixtures/existent/php/dist.php', |
||
101 | ), |
||
102 | 'The extra.incenteev-parameters.file-type setting is required to use this script handler.', |
||
103 | ), |
||
104 | 'php: missing default dist file' => array( |
||
105 | array( |
||
106 | 'file' => 'fixtures/invalid/php/missing.php', |
||
107 | 'file-type' => 'php', |
||
108 | ), |
||
109 | 'The dist file "fixtures/invalid/php/missing.php.dist" does not exist. Check your dist-file config or create it.', |
||
110 | ), |
||
111 | 'php: missing custom dist file' => array( |
||
112 | array( |
||
113 | 'file' => 'fixtures/invalid/php/missing.php', |
||
114 | 'dist-file' => 'fixtures/invalid/php/non-existent.dist.php', |
||
115 | 'file-type' => 'php', |
||
116 | ), |
||
117 | 'The dist file "fixtures/invalid/php/non-existent.dist.php" does not exist. Check your dist-file config or create it.', |
||
118 | ), |
||
119 | 'php: missing top level key in dist file' => array( |
||
120 | array( |
||
121 | 'file' => 'fixtures/invalid/php/missing_top_level.php', |
||
122 | 'file-type' => 'php', |
||
123 | ), |
||
124 | 'The top-level key parameters is missing.', |
||
125 | ), |
||
126 | 'php: invalid values in the existing file' => array( |
||
127 | array( |
||
128 | 'file' => 'fixtures/invalid/php/invalid_existing_values.php', |
||
129 | 'file-type' => 'php', |
||
130 | ), |
||
131 | 'The existing "fixtures/invalid/php/invalid_existing_values.php" file does not contain an array', |
||
132 | ), |
||
133 | ); |
||
134 | } |
||
135 | |||
228 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.