@@ -109,9 +109,8 @@ class PHP_CodeCoverage
109109 /**
110110 * Constructor.
111111 *
112- * @param PHP_CodeCoverage_Driver $driver
113- * @param PHP_CodeCoverage_Filter $filter
114- * @throws InvalidArgumentException
112+ * @param PHP_CodeCoverage_Driver $driver
113+ * @param PHP_CodeCoverage_Filter $filter
115114 */
116115 public function __construct (PHP_CodeCoverage_Driver $ driver = NULL , PHP_CodeCoverage_Filter $ filter = NULL )
117116 {
@@ -196,12 +195,14 @@ public function getTests()
196195 *
197196 * @param mixed $id
198197 * @param boolean $clear
199- * @throws InvalidArgumentException
198+ * @throws PHP_CodeCoverage_Exception
200199 */
201200 public function start ($ id , $ clear = FALSE )
202201 {
203202 if (!is_bool ($ clear )) {
204- throw new InvalidArgumentException ;
203+ throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory (
204+ 1 , 'boolean '
205+ );
205206 }
206207
207208 if ($ clear ) {
@@ -218,12 +219,14 @@ public function start($id, $clear = FALSE)
218219 *
219220 * @param boolean $append
220221 * @return array
221- * @throws InvalidArgumentException
222+ * @throws PHP_CodeCoverage_Exception
222223 */
223224 public function stop ($ append = TRUE )
224225 {
225226 if (!is_bool ($ append )) {
226- throw new InvalidArgumentException ;
227+ throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory (
228+ 1 , 'boolean '
229+ );
227230 }
228231
229232 $ data = $ this ->driver ->stop ();
@@ -248,7 +251,7 @@ public function append(array $data, $id = NULL, $append = TRUE)
248251 }
249252
250253 if ($ id === NULL ) {
251- throw new InvalidArgumentException ;
254+ throw new PHP_CodeCoverage_Exception ;
252255 }
253256
254257 $ this ->applyListsFilter ($ data );
@@ -326,22 +329,23 @@ public function merge(PHP_CodeCoverage $that)
326329
327330 /**
328331 * @param boolean $flag
329- * @throws InvalidArgumentException
332+ * @throws PHP_CodeCoverage_Exception
330333 * @since Method available since Release 1.1.0
331334 */
332335 public function setCacheTokens ($ flag )
333336 {
334337 if (!is_bool ($ flag )) {
335- throw new InvalidArgumentException ;
338+ throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory (
339+ 1 , 'boolean '
340+ );
336341 }
337342
338343 $ this ->cacheTokens = $ flag ;
339344 }
340345
341346 /**
342- * @param boolean $flag
343- * @throws InvalidArgumentException
344- * @since Method available since Release 1.1.0
347+ * @param boolean $flag
348+ * @since Method available since Release 1.1.0
345349 */
346350 public function getCacheTokens ()
347351 {
@@ -350,38 +354,44 @@ public function getCacheTokens()
350354
351355 /**
352356 * @param boolean $flag
353- * @throws InvalidArgumentException
357+ * @throws PHP_CodeCoverage_Exception
354358 */
355359 public function setForceCoversAnnotation ($ flag )
356360 {
357361 if (!is_bool ($ flag )) {
358- throw new InvalidArgumentException ;
362+ throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory (
363+ 1 , 'boolean '
364+ );
359365 }
360366
361367 $ this ->forceCoversAnnotation = $ flag ;
362368 }
363369
364370 /**
365371 * @param boolean $flag
366- * @throws InvalidArgumentException
372+ * @throws PHP_CodeCoverage_Exception
367373 */
368374 public function setMapTestClassNameToCoveredClassName ($ flag )
369375 {
370376 if (!is_bool ($ flag )) {
371- throw new InvalidArgumentException ;
377+ throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory (
378+ 1 , 'boolean '
379+ );
372380 }
373381
374382 $ this ->mapTestClassNameToCoveredClassName = $ flag ;
375383 }
376384
377385 /**
378386 * @param boolean $flag
379- * @throws InvalidArgumentException
387+ * @throws PHP_CodeCoverage_Exception
380388 */
381389 public function setProcessUncoveredFilesFromWhitelist ($ flag )
382390 {
383391 if (!is_bool ($ flag )) {
384- throw new InvalidArgumentException ;
392+ throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory (
393+ 1 , 'boolean '
394+ );
385395 }
386396
387397 $ this ->processUncoveredFilesFromWhitelist = $ flag ;
0 commit comments