| @@ 147-150 (lines=4) @@ | ||
| 144 | $normalized_type = Helper::normalize_type( $raw_type ); |
|
| 145 | $class = Helper::type_to_class( $normalized_type, __NAMESPACE__, '_Container' ); |
|
| 146 | ||
| 147 | if ( ! class_exists( $class ) ) { |
|
| 148 | Incorrect_Syntax_Exception::raise( 'Unknown container "' . $raw_type . '".' ); |
|
| 149 | $class = __NAMESPACE__ . '\\Broken_Container'; |
|
| 150 | } |
|
| 151 | ||
| 152 | $repository = Carbon_Fields::resolve( 'container_repository' ); |
|
| 153 | $fulfillable_collection = Carbon_Fields::resolve( 'container_condition_fulfillable_collection' ); |
|
| @@ 224-227 (lines=4) @@ | ||
| 221 | ||
| 222 | // Fallback to class name-based resolution |
|
| 223 | $class = Helper::type_to_class( $type, __NAMESPACE__, '_Field' ); |
|
| 224 | if ( ! class_exists( $class ) ) { |
|
| 225 | Incorrect_Syntax_Exception::raise( 'Unknown field "' . $raw_type . '".' ); |
|
| 226 | $class = __NAMESPACE__ . '\\Broken_Field'; |
|
| 227 | } |
|
| 228 | ||
| 229 | $field = new $class( $type, $name, $label ); |
|
| 230 | return $field; |
|