PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.2.0
Kirki – Freeform Page Builder, Website Builder & Customizer v6.2.0
6.2.0 6.1.1 6.1.0 6.0.14 6.0.13 6.0.12 6.0.11 6.0.10 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.19 4.0.20 4.0.21 4.0.22 4.0.23 4.0.24 4.1 4.2.0 5.0.0 5.1.0 5.1.1 5.2.0 5.2.1 5.2.2 5.2.3 6.0.0 trunk 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.1.0 3.1.1 3.1.2
kirki / libraries / framework / Exceptions / InvalidCastException.php
kirki / libraries / framework / Exceptions Last commit date
AuthorizationException.php 1 month ago InvalidCastException.php 1 month ago InvalidDateFormatException.php 5 days ago InvalidMiddlewareException.php 1 month ago InvalidRoutActionException.php 1 month ago InvalidValidationRuleException.php 1 month ago MassAssignmentException.php 1 month ago ModelNotFoundException.php 1 month ago MultipleRecordsFoundException.php 1 month ago NotFoundException.php 1 month ago QueryException.php 1 month ago RecordNotFoundException.php 1 month ago UniqueConstraintViolationException.php 1 month ago ValidationException.php 1 month ago
InvalidCastException.php
60 lines
1 <?php
2
3 /**
4 * Exception thrown when an invalid cast type is used.
5 *
6 * @package Framework
7 * @subpackage Exceptions
8 * @since 1.0.0
9 */
10 namespace Kirki\Framework\Exceptions;
11
12 \defined('ABSPATH') || exit;
13 use RuntimeException;
14 class InvalidCastException extends RuntimeException
15 {
16 /**
17 * The model class name.
18 *
19 * @var string
20 *
21 * @since 1.0.0
22 */
23 protected $model;
24 /**
25 * The attribute key.
26 *
27 * @var string
28 *
29 * @since 1.0.0
30 */
31 protected $key;
32 /**
33 * The cast type.
34 *
35 * @var string
36 *
37 * @since 1.0.0
38 */
39 protected $cast_type;
40 /**
41 * Create a new InvalidCastException instance.
42 *
43 * @param object $model The model instance.
44 * @param string $key The attribute key.
45 * @param string $cast_type The cast type.
46 *
47 * @return void
48 *
49 * @since 1.0.0
50 */
51 public function __construct($model, $key, $cast_type)
52 {
53 $class_name = \get_class($model);
54 parent::__construct(\sprintf('Invalid cast type for attribute %s on model %s: %s', $key, $class_name, $cast_type));
55 $this->model = $class_name;
56 $this->key = $key;
57 $this->cast_type = $cast_type;
58 }
59 }
60