@@ -51,20 +51,20 @@ public function __construct(string $name, self $parent = null)
5151 $ this ->parent = $ parent ;
5252 }
5353
54- public function getName (): string
54+ public function name (): string
5555 {
5656 return $ this ->name ;
5757 }
5858
59- public function getId (): string
59+ public function id (): string
6060 {
6161 if ($ this ->id === null ) {
62- $ parent = $ this ->getParent ();
62+ $ parent = $ this ->parent ();
6363
6464 if ($ parent === null ) {
6565 $ this ->id = 'index ' ;
6666 } else {
67- $ parentId = $ parent ->getId ();
67+ $ parentId = $ parent ->id ();
6868
6969 if ($ parentId === 'index ' ) {
7070 $ this ->id = \str_replace (': ' , '_ ' , $ this ->name );
@@ -77,26 +77,26 @@ public function getId(): string
7777 return $ this ->id ;
7878 }
7979
80- public function getPath (): string
80+ public function pathAsString (): string
8181 {
8282 if ($ this ->path === null ) {
83- if ($ this ->parent === null || $ this ->parent ->getPath () === null || $ this ->parent ->getPath () === false ) {
83+ if ($ this ->parent === null || $ this ->parent ->pathAsString () === null || $ this ->parent ->pathAsString () === false ) {
8484 $ this ->path = $ this ->name ;
8585 } else {
86- $ this ->path = $ this ->parent ->getPath () . \DIRECTORY_SEPARATOR . $ this ->name ;
86+ $ this ->path = $ this ->parent ->pathAsString () . \DIRECTORY_SEPARATOR . $ this ->name ;
8787 }
8888 }
8989
9090 return $ this ->path ;
9191 }
9292
93- public function getPathAsArray (): array
93+ public function pathAsArray (): array
9494 {
9595 if ($ this ->pathArray === null ) {
9696 if ($ this ->parent === null ) {
9797 $ this ->pathArray = [];
9898 } else {
99- $ this ->pathArray = $ this ->parent ->getPathAsArray ();
99+ $ this ->pathArray = $ this ->parent ->pathAsArray ();
100100 }
101101
102102 $ this ->pathArray [] = $ this ;
@@ -105,218 +105,141 @@ public function getPathAsArray(): array
105105 return $ this ->pathArray ;
106106 }
107107
108- public function getParent (): ?self
108+ public function parent (): ?self
109109 {
110110 return $ this ->parent ;
111111 }
112112
113- public function getTestedClassesPercent (): Percentage
113+ public function percentageOfTestedClasses (): Percentage
114114 {
115115 return Percentage::fromFractionAndTotal (
116- $ this ->getNumTestedClasses (),
117- $ this ->getNumClasses (),
116+ $ this ->numberOfTestedClasses (),
117+ $ this ->numberOfClasses (),
118118 );
119119 }
120120
121- public function getTestedTraitsPercent (): Percentage
121+ public function percentageOfTestedTraits (): Percentage
122122 {
123123 return Percentage::fromFractionAndTotal (
124- $ this ->getNumTestedTraits (),
125- $ this ->getNumTraits (),
124+ $ this ->numberOfTestedTraits (),
125+ $ this ->numberOfTraits (),
126126 );
127127 }
128128
129- public function getTestedClassesAndTraitsPercent (): Percentage
129+ public function percentageOfTestedClassesAndTraits (): Percentage
130130 {
131131 return Percentage::fromFractionAndTotal (
132- $ this ->getNumTestedClassesAndTraits (),
133- $ this ->getNumClassesAndTraits (),
132+ $ this ->numberOfTestedClassesAndTraits (),
133+ $ this ->numberOfClassesAndTraits (),
134134 );
135135 }
136136
137- public function getTestedFunctionsPercent (): Percentage
137+ public function percentageOfTestedFunctions (): Percentage
138138 {
139139 return Percentage::fromFractionAndTotal (
140- $ this ->getNumTestedFunctions (),
141- $ this ->getNumFunctions (),
140+ $ this ->numberOfTestedFunctions (),
141+ $ this ->numberOfFunctions (),
142142 );
143143 }
144144
145- public function getTestedMethodsPercent (): Percentage
145+ public function percentageOfTestedMethods (): Percentage
146146 {
147147 return Percentage::fromFractionAndTotal (
148- $ this ->getNumTestedMethods (),
149- $ this ->getNumMethods (),
148+ $ this ->numberOfTestedMethods (),
149+ $ this ->numberOfMethods (),
150150 );
151151 }
152152
153- public function getTestedFunctionsAndMethodsPercent (): Percentage
153+ public function percentageOfTestedFunctionsAndMethods (): Percentage
154154 {
155155 return Percentage::fromFractionAndTotal (
156- $ this ->getNumTestedFunctionsAndMethods (),
157- $ this ->getNumFunctionsAndMethods (),
156+ $ this ->numberOfTestedFunctionsAndMethods (),
157+ $ this ->numberOfFunctionsAndMethods (),
158158 );
159159 }
160160
161- public function getLineExecutedPercent (): Percentage
161+ public function percentageOfExecutedLines (): Percentage
162162 {
163163 return Percentage::fromFractionAndTotal (
164- $ this ->getNumExecutedLines (),
165- $ this ->getNumExecutableLines (),
164+ $ this ->numberOfExecutedLines (),
165+ $ this ->numberOfExecutableLines (),
166166 );
167167 }
168168
169- public function getBranchExecutedPercent (): Percentage
169+ public function percentageOfExecutedBranches (): Percentage
170170 {
171171 return Percentage::fromFractionAndTotal (
172- $ this ->getNumExecutedBranches (),
173- $ this ->getNumExecutableBranches ()
172+ $ this ->numberOfExecutedBranches (),
173+ $ this ->numberOfExecutableBranches ()
174174 );
175175 }
176176
177- public function getPathExecutedPercent (): Percentage
177+ public function percentageOfExecutedPaths (): Percentage
178178 {
179179 return Percentage::fromFractionAndTotal (
180- $ this ->getNumExecutedPaths (),
181- $ this ->getNumExecutablePaths ()
180+ $ this ->numberOfExecutedPaths (),
181+ $ this ->numberOfExecutablePaths ()
182182 );
183183 }
184184
185- /**
186- * Returns the number of classes and traits.
187- */
188- public function getNumClassesAndTraits (): int
185+ public function numberOfClassesAndTraits (): int
189186 {
190- return $ this ->getNumClasses () + $ this ->getNumTraits ();
187+ return $ this ->numberOfClasses () + $ this ->numberOfTraits ();
191188 }
192189
193- /**
194- * Returns the number of tested classes and traits.
195- */
196- public function getNumTestedClassesAndTraits (): int
190+ public function numberOfTestedClassesAndTraits (): int
197191 {
198- return $ this ->getNumTestedClasses () + $ this ->getNumTestedTraits ();
192+ return $ this ->numberOfTestedClasses () + $ this ->numberOfTestedTraits ();
199193 }
200194
201- /**
202- * Returns the classes and traits of this node.
203- */
204- public function getClassesAndTraits (): array
195+ public function classesAndTraits (): array
205196 {
206- return \array_merge ($ this ->getClasses (), $ this ->getTraits ());
197+ return \array_merge ($ this ->classes (), $ this ->traits ());
207198 }
208199
209- /**
210- * Returns the number of functions and methods.
211- */
212- public function getNumFunctionsAndMethods (): int
200+ public function numberOfFunctionsAndMethods (): int
213201 {
214- return $ this ->getNumFunctions () + $ this ->getNumMethods ();
202+ return $ this ->numberOfFunctions () + $ this ->numberOfMethods ();
215203 }
216204
217- /**
218- * Returns the number of tested functions and methods.
219- */
220- public function getNumTestedFunctionsAndMethods (): int
205+ public function numberOfTestedFunctionsAndMethods (): int
221206 {
222- return $ this ->getNumTestedFunctions () + $ this ->getNumTestedMethods ();
207+ return $ this ->numberOfTestedFunctions () + $ this ->numberOfTestedMethods ();
223208 }
224209
225- /**
226- * Returns the functions and methods of this node.
227- */
228- public function getFunctionsAndMethods (): array
229- {
230- return \array_merge ($ this ->getFunctions (), $ this ->getMethods ());
231- }
210+ abstract public function classes (): array ;
232211
233- /**
234- * Returns the classes of this node.
235- */
236- abstract public function getClasses (): array ;
212+ abstract public function traits (): array ;
237213
238- /**
239- * Returns the traits of this node.
240- */
241- abstract public function getTraits (): array ;
214+ abstract public function functions (): array ;
242215
243- /**
244- * Returns the functions of this node.
245- */
246- abstract public function getFunctions (): array ;
216+ abstract public function linesOfCode (): array ;
247217
248- /**
249- * Returns the LOC/CLOC/NCLOC of this node.
250- */
251- abstract public function getLinesOfCode (): array ;
218+ abstract public function numberOfExecutableLines (): int ;
252219
253- /**
254- * Returns the number of executable lines.
255- */
256- abstract public function getNumExecutableLines (): int ;
220+ abstract public function numberOfExecutedLines (): int ;
257221
258- /**
259- * Returns the number of executed lines.
260- */
261- abstract public function getNumExecutedLines (): int ;
222+ abstract public function numberOfExecutableBranches (): int ;
262223
263- /**
264- * Returns the number of executable branches.
265- */
266- abstract public function getNumExecutableBranches (): int ;
224+ abstract public function numberOfExecutedBranches (): int ;
267225
268- /**
269- * Returns the number of executed branches.
270- */
271- abstract public function getNumExecutedBranches (): int ;
226+ abstract public function numberOfExecutablePaths (): int ;
272227
273- /**
274- * Returns the number of executable paths.
275- */
276- abstract public function getNumExecutablePaths (): int ;
228+ abstract public function numberOfExecutedPaths (): int ;
277229
278- /**
279- * Returns the number of executed paths.
280- */
281- abstract public function getNumExecutedPaths (): int ;
230+ abstract public function numberOfClasses (): int ;
282231
283- /**
284- * Returns the number of classes.
285- */
286- abstract public function getNumClasses (): int ;
232+ abstract public function numberOfTestedClasses (): int ;
287233
288- /**
289- * Returns the number of tested classes.
290- */
291- abstract public function getNumTestedClasses (): int ;
234+ abstract public function numberOfTraits (): int ;
292235
293- /**
294- * Returns the number of traits.
295- */
296- abstract public function getNumTraits (): int ;
297-
298- /**
299- * Returns the number of tested traits.
300- */
301- abstract public function getNumTestedTraits (): int ;
236+ abstract public function numberOfTestedTraits (): int ;
302237
303- /**
304- * Returns the number of methods.
305- */
306- abstract public function getNumMethods (): int ;
238+ abstract public function numberOfMethods (): int ;
307239
308- /**
309- * Returns the number of tested methods.
310- */
311- abstract public function getNumTestedMethods (): int ;
240+ abstract public function numberOfTestedMethods (): int ;
312241
313- /**
314- * Returns the number of functions.
315- */
316- abstract public function getNumFunctions (): int ;
242+ abstract public function numberOfFunctions (): int ;
317243
318- /**
319- * Returns the number of tested functions.
320- */
321- abstract public function getNumTestedFunctions (): int ;
244+ abstract public function numberOfTestedFunctions (): int ;
322245}
0 commit comments