LoggingDispatcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A dispatch() 0 6 1
A log() 0 6 1
1
<?php
2
/**
3
 * @author stev leibelt <[email protected]>
4
 * @since 2015-12-21
5
 */
6
7
namespace Net\Bazzline\Component\Curl\Dispatcher;
8
9
use Net\Bazzline\Component\Curl\Response\Response;
10
11
class LoggingDispatcher extends Dispatcher
12
{
13
    /**
14
     * @param string $url
15
     * @param array $options
16
     * @return Response
17
     */
18
    public function dispatch($url, array $options = [])
19
    {
20
        $this->log($url, $options);
21
22
        return parent::dispatch($url, $options);
23
    }
24
25
    /**
26
     * @param $url
27
     * @param array $options
28
     */
29
    protected function log($url, array $options)
30
    {
31
        echo 'url: ' . $url . PHP_EOL;
32
        echo 'options: ' . PHP_EOL;
33
        echo var_export($options, true) . PHP_EOL;
34
    }
35
}
36