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

ConvertTelListener   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 17
rs 10
c 2
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSubscribedEvents() 0 6 1
A onPreSubmit() 0 7 1
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