similar_topic_words   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 27
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A depends_on() 0 3 1
A update_data() 0 5 2
A effectively_installed() 0 5 1
1
<?php
2
/**
3
 *
4
 * Precise Similar Topics
5
 *
6
 * @copyright (c) 2019 Matt Friedman
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace vse\similartopics\migrations\release_1_5_x;
12
13
class similar_topic_words extends \phpbb\db\migration\container_aware_migration
0 ignored issues
show
Bug introduced by
The type phpbb\db\migration\container_aware_migration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
{
15
	public function effectively_installed()
16
	{
17
		$config_text = $this->container->get('config_text');
18
19
		return $config_text->get('similar_topics_words') !== null;
20
	}
21
22
	public static function depends_on()
23
	{
24
		return array('\vse\similartopics\migrations\release_1_1_6_data');
25
	}
26
27
	/**
28
	 * Create the new similar_topics_words field in the CONFIG_TEXT
29
	 * table and copy the contents of the old similar_topics_words
30
	 * CONFIG value to it (if there is any) and then delete the old
31
	 * CONFIG field.
32
	 *
33
	 * @return array
34
	 */
35
	public function update_data()
36
	{
37
		return array(
38
			array('config_text.add', array('similar_topics_words', $this->config['similar_topics_words'] ?: '')),
39
			array('config.remove', array('similar_topics_words')),
40
		);
41
	}
42
}
43