Completed
Pull Request — staging (#840)
by
unknown
18:30
created

InvalidCommentID   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A from_id() 0 8 1
1
<?php
2
/**
3
 * YIKES Inc. Easy Mailchimp Forms Plugin.
4
 *
5
 * @package   YIKES\EasyForms
6
 * @author    Freddie Mixell
7
 * @license   GPL2
8
 */
9
10
namespace YIKES\EasyForms\Exception;
11
12
/**
13
 * Class InvalidPostID.
14
 *
15
 * @since   %VERSION%
16
 *
17
 * @package YIKES\EasyForms\Exception
18
 * @author  Freddie Mixell
19
 */
20
class InvalidCommentID extends \InvalidArgumentException implements Exception {
21
22
	/**
23
	 * Create a new instance of the exception for a comment ID that is not valid.
24
	 *
25
	 * @since %VERSION%
26
	 *
27
	 * @param int $id Post ID that is not valid.
28
	 *
29
	 * @return static
30
	 */
31
	public static function from_id( $id ) {
32
		$message = sprintf(
33
			'The comment ID "%d" is not valid.',
34
			$id
35
		);
36
37
		return new static( $message );
38
	}
39
}
40