-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectExtensionInterface.php
More file actions
58 lines (52 loc) · 1.66 KB
/
ObjectExtensionInterface.php
File metadata and controls
58 lines (52 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/*
* This file is part of the Klipper package.
*
* (c) François Pluchino <francois.pluchino@klipper.dev>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Klipper\Component\DefaultValue;
/**
* Interface for extensions which provide types and type extensions.
*
* @author François Pluchino <francois.pluchino@klipper.dev>
*/
interface ObjectExtensionInterface
{
/**
* Returns a type by class name.
*
* @param string $classname The class name of the type
*
* @return ObjectTypeInterface The type
*
* @throws Exception\InvalidArgumentException if the given type is not supported by this extension
*/
public function getType(string $classname): ObjectTypeInterface;
/**
* Returns whether the given type is supported.
*
* @param string $classname The class name of the type
*
* @return bool Whether the type is supported by this extension
*/
public function hasType(string $classname): bool;
/**
* Returns the extensions for the given type.
*
* @param string $classname The class name of the type
*
* @return ObjectTypeExtensionInterface[] An array of extensions as ObjectTypeExtensionInterface instances
*/
public function getTypeExtensions(string $classname): array;
/**
* Returns whether this extension provides type extensions for the given type.
*
* @param string $classname The class name of the type
*
* @return bool Whether the given type has extensions
*/
public function hasTypeExtensions(string $classname): bool;
}