Completed
Pull Request — staging (#840)
by
unknown
16:31
created

InvalidCommentID::from_id()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
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