Code Duplication    Length = 3-3 lines in 3 locations

core/Container/Block_Container.php 3 locations

@@ 286-288 (lines=3) @@
283
	 * @return Block_Container
284
	 */
285
	public function set_parent( $parent = null ) {
286
		if ( ! is_array( $parent ) && ! is_string( $parent ) && ! is_null( $parent ) ) {
287
			throw new \Exception( __( "The parent must be 'array', 'string' or 'null'.", 'crb' ) );
288
		}
289
290
		$this->settings[ 'parent' ] = is_string( $parent ) ? array( $parent ) : $parent;
291
@@ 333-335 (lines=3) @@
330
	 * @return Block_Container
331
	 */
332
	public function set_inner_blocks_template( $template = null ) {
333
		if ( ! is_array( $template ) && ! is_null( $template ) ) {
334
			throw new \Exception( __( "The template must be an 'array' or 'null'.", 'crb' ) );
335
		}
336
337
		$this->settings[ 'inner_blocks' ][ 'template' ] = $template;
338
@@ 369-371 (lines=3) @@
366
	 * @return Block_Container
367
	 */
368
	public function set_allowed_inner_blocks( $blocks = null ) {
369
		if ( ! is_array( $blocks ) && ! is_null( $blocks ) ) {
370
			throw new \Exception( __( "The allowed blocks must be an 'array' or 'null'.", 'crb' ) );
371
		}
372
373
		if ( is_array( $blocks ) ) {
374
			$this->settings[ 'inner_blocks' ][ 'allowed_blocks' ] = array_map( function ( $block ) {