Completed
Pull Request — master (#25)
by Matt
02:07
created

fulltext_support::set_engine()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 21
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 21
rs 9.0534
cc 4
eloc 9
nc 4
nop 0
1
<?php
2
/**
3
 *
4
 * Precise Similar Topics
5
 *
6
 * @copyright (c) 2014 Matt Friedman
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace vse\similartopics\core;
12
13
/**
14
 * Class is now a wrapper for use by old migrations,
15
 * to avoid having to edit the old migrations too much.
16
 */
17
class fulltext_support extends \vse\similartopics\driver\mysqli
18
{
19
	/**
20
	 * Check if a column is a FULLTEXT index in topics table
21
	 *
22
	 * @access public
23
	 * @param string $column Name of the column
24
	 * @return bool True if column is a FULLTEXT index, false otherwise
25
	 * @deprecated 1.5.0, replace by is_fulltext()
26
	 */
27
	public function is_index($column = 'topic_title')
28
	{
29
		return parent::is_fulltext($column);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (is_fulltext() instead of is_index()). Are you sure this is correct? If so, you might want to change this to $this->is_fulltext().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
30
	}
31
}
32