Code Duplication    Length = 3-3 lines in 3 locations

core/Container/Block_Container.php 3 locations

@@ 241-243 (lines=3) @@
238
	 * @return Block_Container
239
	 */
240
	public function set_parent( $parent = null ) {
241
		if ( ! is_array( $parent ) && ! is_string( $parent ) && ! is_null( $parent ) ) {
242
			throw new \Exception( __( "The parent must be 'array', 'string' or 'null'.", 'crb' ) );
243
		}
244
245
		$this->settings[ 'parent' ] = is_string( $parent ) ? array( $parent ) : $parent;
246
@@ 288-290 (lines=3) @@
285
	 * @return Block_Container
286
	 */
287
	public function set_inner_blocks_template( $template = null ) {
288
		if ( ! is_array( $template ) && ! is_null( $template ) ) {
289
			throw new \Exception( __( "The template must be an 'array' or 'null'.", 'crb' ) );
290
		}
291
292
		$this->settings[ 'inner_blocks' ][ 'template' ] = $template;
293
@@ 324-326 (lines=3) @@
321
	 * @return Block_Container
322
	 */
323
	public function set_allowed_inner_blocks( $blocks = null ) {
324
		if ( ! is_array( $blocks ) && ! is_null( $blocks ) ) {
325
			throw new \Exception( __( "The allowed blocks must be an 'array' or 'null'.", 'crb' ) );
326
		}
327
328
		if ( is_array( $blocks ) ) {
329
			$this->settings[ 'inner_blocks' ][ 'allowed_blocks' ] = array_map( function ( $block ) {