Completed
Pull Request — master (#30)
by Márk
02:09
created

FactoryDiscovery   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A find() 0 12 2
1
<?php
2
3
namespace Http\Discovery;
4
5
/**
6
 * Finds a Factory.
7
 *
8
 * @author Márk Sági-Kazár <[email protected]>
9
 */
10
abstract class FactoryDiscovery extends ClassDiscovery
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public static function find()
16
    {
17
        try {
18
            return parent::find();
19
        } catch (NotFoundException $e) {
20
            throw new NotFoundException(
21
                'No factories found. Install php-http/utils >= 0.2 to use Guzzle or Diactoros factories.',
22
                0,
23
                $e
24
            );
25
        }
26
    }
27
}
28