Code Duplication    Length = 10-13 lines in 4 locations

src/includes/class-wordlift-content-filter-service.php 1 location

@@ 94-104 (lines=11) @@
91
	 * @since 3.8.0
92
	 *
93
	 */
94
	public function __construct( $entity_service, $configuration_service, $entity_uri_service ) {
95
96
		$this->log = Wordlift_Log_Service::get_logger( get_class() );
97
98
		$this->entity_service        = $entity_service;
99
		$this->configuration_service = $configuration_service;
100
		$this->entity_uri_service    = $entity_uri_service;
101
102
		self::$instance = $this;
103
104
	}
105
106
	/**
107
	 * Get the {@link Wordlift_Content_Filter_Service} singleton instance.

src/includes/class-wordlift-entity-post-type-service.php 1 location

@@ 64-76 (lines=13) @@
61
	 * @since 3.6.0
62
	 *
63
	 */
64
	public function __construct( $post_type, $slug ) {
65
66
		$this->log = Wordlift_Log_Service::get_logger( get_class() );
67
68
		$this->post_type = $post_type;
69
70
		// We cannot assign an empty slug to the register_post_type function, therefore if the slug is empty we default
71
		// to the type name.
72
		$this->slug = $slug ?: $post_type;
73
74
		self::$instance = $this;
75
76
	}
77
78
	/**
79
	 * Get the entity type service singleton instance.

src/includes/class-wordlift-entity-service.php 1 location

@@ 100-110 (lines=11) @@
97
	 * @since 3.2.0
98
	 *
99
	 */
100
	public function __construct( $ui_service, $relation_service, $entity_uri_service ) {
101
102
		$this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Entity_Service' );
103
104
		$this->ui_service         = $ui_service;
105
		$this->relation_service   = $relation_service;
106
		$this->entity_uri_service = $entity_uri_service;
107
108
		// Set the singleton instance.
109
		self::$instance = $this;
110
	}
111
112
	/**
113
	 * Get the singleton instance of the Entity service.

src/wordlift/autocomplete/class-linked-data-autocomplete-service.php 1 location

@@ 52-61 (lines=10) @@
49
	 *
50
	 * @since 3.15.0
51
	 */
52
	public function __construct( $configuration_service, $entity_helper, $entity_uri_service, $entity_service ) {
53
54
		$this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Autocomplete_Service' );
55
56
		$this->configuration_service = $configuration_service;
57
		$this->entity_helper         = $entity_helper;
58
		$this->entity_uri_service    = $entity_uri_service;
59
		$this->entity_service        = $entity_service;
60
61
	}
62
63
	/**
64
	 * Make request to external API and return the response.