Completed
Pull Request — master (#326)
by
unknown
01:39
created

DingoGenerator::getDomain()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Mpociot\ApiDoc\Generators;
4
5
class DingoGenerator extends AbstractGenerator
6
{
7
    /**
8
     * Prepares / Disables route middlewares.
9
     *
10
     * @param  bool $disable
11
     *
12
     * @return  void
13
     */
14
    public function prepareMiddleware($disable = true)
15
    {
16
        // Not needed by Dingo
17
        return false;
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function callRoute($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
24
    {
25
        $dispatcher = app('Dingo\Api\Dispatcher')->raw();
26
27
        collect($server)->map(function ($key, $value) use ($dispatcher) {
28
            $dispatcher->header($value, $key);
29
        });
30
31
        return call_user_func_array([$dispatcher, strtolower($method)], [$uri]);
32
    }
33
}
34