Completed
Pull Request — master (#1125)
by
unknown
09:00
created

Listener::onModelUpdatePost()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace FOS\ElasticaBundle\Propel;
4
5
use Glorpen\Propel\PropelBundle\Events\ModelEvent;
6
use FOS\ElasticaBundle\Doctrine\AbstractListenerBase;
7
use Glorpen\Propel\PropelBundle\Events\ConnectionEvent;
8
9
/**
10
 * Automatically update ElasticSearch based on changes to the Propel source
11
 * data. One listener is generated for each Propel entity / ElasticSearch type.
12
 */
13
class Listener extends AbstractListenerBase
14
{
15
    /**
16
     * Looks for new objects that should be indexed.
17
     *
18
     * @param ModelEvent $eventArgs
0 ignored issues
show
Bug introduced by
There is no parameter named $eventArgs. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
19
     */
20
    public function onModelInsertPost(ModelEvent $event)
21
    {
22
        $this->doPostPersist($event->getModel());
23
    }
24
25
    /**
26
     * Looks for objects being updated that should be indexed or removed from the index.
27
     *
28
     * @param ModelEvent $eventArgs
0 ignored issues
show
Bug introduced by
There is no parameter named $eventArgs. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
29
     */
30
    public function onModelUpdatePost(ModelEvent $event)
31
    {
32
        $this->doPostUpdate($event->getModel());
33
    }
34
35
    /**
36
     * @param ModelEvent $eventArgs
0 ignored issues
show
Bug introduced by
There is no parameter named $eventArgs. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
37
     */
38
    public function onModelDeletePre(ModelEvent $event)
39
    {
40
        $this->doPreRemove($event->getModel());
41
    }
42
    
43
    public function onConnectionCommitPost(ConnectionEvent $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
44
    {
45
        $this->doPostFlush();
46
    }
47
}
48