Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
HasUsesTrait.php
Go to the documentation of this file.
1
<?php
2
namespace
Ubiquity\creator
;
3
4
class
HasUsesTrait
{
5
protected
$uses
=[];
6
public
function
getUses
(){
7
return \array_keys($this->uses);
8
}
9
10
public
function
addUse
($classname){
11
$this->uses[$classname]=
true
;
12
}
13
14
public
function
addUses
(...$classnames){
15
foreach
($classnames as $classname){
16
$this->uses[$classname]=
true
;
17
}
18
}
19
20
public
function
getUsesStr
(){
21
$uses
=$this->
getUses
();
22
$r=[];
23
foreach
(
$uses
as $use){
24
$r[]=
'use '
.\ltrim($use,
'\\'
).
';'
;
25
}
26
return \implode(
"\n"
,$r);
27
}
28
}
29
Ubiquity\creator\HasUsesTrait
Definition
HasUsesTrait.php:4
Ubiquity\creator\HasUsesTrait\getUsesStr
getUsesStr()
Definition
HasUsesTrait.php:20
Ubiquity\creator\HasUsesTrait\getUses
getUses()
Definition
HasUsesTrait.php:6
Ubiquity\creator\HasUsesTrait\addUse
addUse($classname)
Definition
HasUsesTrait.php:10
Ubiquity\creator\HasUsesTrait\addUses
addUses(... $classnames)
Definition
HasUsesTrait.php:14
Ubiquity\creator\HasUsesTrait\$uses
$uses
Definition
HasUsesTrait.php:5
Ubiquity\creator
Definition
HasUsesTrait.php:2
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity-dev
src
Ubiquity
creator
HasUsesTrait.php
Generated on Sun Dec 10 2023 15:04:07 for
Ubiquity
by
doxygen
1.9.8