-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypeAliasInterface.php
More file actions
114 lines (104 loc) · 3.15 KB
/
Copy pathTypeAliasInterface.php
File metadata and controls
114 lines (104 loc) · 3.15 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
namespace PHPShots\Common;
/**
* Interface TypeAliasInterface
*
* Defines the methods required for managing type-based aliases.
* Implementing classes should provide concrete functionality
* for alias registration, retrieval, and management.
*
* ## Methods
* - `isAlias(string $name): bool`
* - `removeAbstractAlias(string $searched): void`
* - `getAlias(string $abstract): string`
* - `alias(string $abstract, string $alias): void`
* - `aliasReverse(string $alias, string $abstract): void`
* - `getAllAliases(string $abstract): array`
* - `hasAbstract(string $abstract): bool`
* - `clearAliases(): void`
* - `getAliasMap(): array`
*
* ## Author Information
* - **Author**: Hakeem Shamavu
* - **Email**: shamavurasheed@gmail.com
*
* @version 0.1.1
*/
interface TypeAliasInterface
{
/**
* Check if a given name is registered as an alias.
*
* @param string $name The alias to check.
* @return bool True if it is an alias, false otherwise.
* @version 0.1.1
*/
public function isAlias(string $name): bool;
/**
* Remove an alias from the cache.
*
* @param string $searched The alias to remove.
* @return void
* @version 0.1.1
*/
public function removeAbstractAlias(string $searched): void;
/**
* Get the ultimate abstract type for a given alias.
*
* @param string $abstract The starting abstract or alias name.
* @return string The resolved abstract type.
*
* @version 0.1.1
*/
public function getAlias(string $abstract): string;
/**
* Register an alias for an abstract type.
*
* @param string $abstract The original type name.
* @param string $alias The alias to register for the type.
* @return void
*
* @version 0.1.1
*/
public function alias(string $abstract, string $alias): void;
/**
* Register an alias for an abstract type (reversed parameter order).
*
* @param string $alias The alias name.
* @param string $abstract The original type to alias.
* @return void
*
* @version 0.1.1
*/
public function aliasReverse(string $alias, string $abstract): void;
/**
* Get all aliases associated with a given abstract type.
*
* @param string $abstract The abstract type name.
* @return array An array of aliases, or an empty array if none.
* @version 0.1.1
*/
public function getAllAliases(string $abstract): array;
/**
* Check if an abstract type has any registered aliases.
*
* @param string $abstract The abstract type name.
* @return bool True if the type has aliases, false otherwise.
* @version 0.1.1
*/
public function hasAbstract(string $abstract): bool;
/**
* Clear all aliases.
*
* @return void
* @version 0.1.1
*/
public function clearAliases(): void;
/**
* Get the entire map of aliases and their associated abstract types.
*
* @return array A direct map of aliases to abstract types.
* @version 0.1.1
*/
public function getAliasMap(): array;
}