Code Duplication    Length = 7-7 lines in 5 locations

core/Container/Comment_Meta_Container.php 1 location

@@ 18-24 (lines=7) @@
15
	/**
16
	 * {@inheritDoc}
17
	 */
18
	public function __construct( $unique_id, $title, $type, $condition_collection, $condition_translator ) {
19
		parent::__construct( $unique_id, $title, $type, $condition_collection, $condition_translator );
20
21
		if ( ! $this->get_datastore() ) {
22
			$this->set_datastore( Datastore::make( 'comment_meta' ), $this->has_default_datastore() );
23
		}
24
	}
25
26
	/**
27
	 * Perform instance initialization

core/Container/Post_Meta_Container.php 1 location

@@ 36-42 (lines=7) @@
33
	/**
34
	 * {@inheritDoc}
35
	 */
36
	public function __construct( $unique_id, $title, $type, $condition_collection, $condition_translator ) {
37
		parent::__construct( $unique_id, $title, $type, $condition_collection, $condition_translator );
38
39
		if ( ! $this->get_datastore() ) {
40
			$this->set_datastore( Datastore::make( 'post_meta' ), $this->has_default_datastore() );
41
		}
42
	}
43
44
	/**
45
	 * Create DataStore instance, set post ID to operate with (if such exists).

core/Container/Term_Meta_Container.php 1 location

@@ 19-25 (lines=7) @@
16
	/**
17
	 * {@inheritDoc}
18
	 */
19
	public function __construct( $unique_id, $title, $type, $condition_collection, $condition_translator ) {
20
		parent::__construct( $unique_id, $title, $type, $condition_collection, $condition_translator );
21
22
		if ( ! $this->get_datastore() ) {
23
			$this->set_datastore( Datastore::make( 'term_meta' ), $this->has_default_datastore() );
24
		}
25
	}
26
27
	/**
28
	 * Bind attach() and save() to the appropriate WordPress actions.

core/Container/Theme_Options_Container.php 1 location

@@ 35-41 (lines=7) @@
32
	/**
33
	 * {@inheritDoc}
34
	 */
35
	public function __construct( $unique_id, $title, $type, $condition_collection, $condition_translator ) {
36
		parent::__construct( $unique_id, $title, $type, $condition_collection, $condition_translator );
37
38
		if ( ! $this->get_datastore() ) {
39
			$this->set_datastore( Datastore::make( 'theme_options' ), $this->has_default_datastore() );
40
		}
41
	}
42
43
	/**
44
	 * Sanitize the container title for use in

core/Container/User_Meta_Container.php 1 location

@@ 17-23 (lines=7) @@
14
	/**
15
	 * {@inheritDoc}
16
	 */
17
	public function __construct( $unique_id, $title, $type, $condition_collection, $condition_translator ) {
18
		parent::__construct( $unique_id, $title, $type, $condition_collection, $condition_translator );
19
20
		if ( ! $this->get_datastore() ) {
21
			$this->set_datastore( Datastore::make( 'user_meta' ), $this->has_default_datastore() );
22
		}
23
	}
24
25
	/**
26
	 * Bind attach() and save() to the appropriate WordPress actions.