Completed
Pull Request — staging (#840)
by
unknown
19:58
created

InvalidAssetHandle::from_handle()   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 InvalidAssetHandle.
14
 *
15
 * @since   %VERSION%
16
 *
17
 * @package YIKES\EasyForms\Exception
18
 * @author  Freddie Mixell
19
 */
20
class InvalidAssetHandle extends \InvalidArgumentException implements Exception {
21
22
	/**
23
	 * Create a new instance of the exception for a asset handle that is not
24
	 * valid.
25
	 *
26
	 * @since %VERSION%
27
	 *
28
	 * @param int $handle Asset handle that is not valid.
29
	 *
30
	 * @return static
31
	 */
32
	public static function from_handle( $handle ) {
33
		$message = sprintf(
34
			'The asset handle "%s" is not valid.',
35
			$handle
36
		);
37
38
		return new static( $message );
39
	}
40
}
41