Failed Conditions
Push — master ( 660616...b19e2b )
by Kentaro
48:07
created

ConvertTelListener::getSubscribedEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 2
b 0
f 0
1
<?php
2
3
namespace Eccube\EventListener;
4
5
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
6
use Symfony\Component\Form\FormEvent;
7
use Symfony\Component\Form\FormEvents;
8
9
class ConvertTelListener implements EventSubscriberInterface
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
10
{
11
    public static function getSubscribedEvents()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
12
    {
13
        return array(
14
            FormEvents::PRE_SUBMIT   => 'onPreSubmit',
15
        );
16
    }
17
18
    public function onPreSubmit(FormEvent $event)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
19
    {
20
        $data = $event->getData();
21
        $data = mb_convert_kana($data,"an","UTF-8");
0 ignored issues
show
introduced by
Add a single space after each comma delimiter
Loading history...
22
        $data = str_replace("-","",$data);
0 ignored issues
show
introduced by
Add a single space after each comma delimiter
Loading history...
23
        $event->setData($data);
24
    }
25
}
26