Passed
Push — master ( 566a3a...fbef46 )
by 世昌
02:19
created

ObjectMiddlewareTrait::createMiddleware()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace suda\database\middleware;
3
4
use ReflectionException;
5
use suda\database\struct\TableStruct;
6
7
/**
8
 * 感知表结构
9
 */
10
trait ObjectMiddlewareTrait
11
{
12
    /**
13
     * @param TableStruct $struct
14
     * @return Middleware
15
     * @throws ReflectionException
16
     */
17
    public static function createMiddleware(TableStruct $struct):Middleware
18
    {
19
        return new ObjectMiddleware(static::class);
20
    }
21
}
22