FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
validation/src/ValidatorFactoryFactory.php at master · hyperf/validation · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
hyperf
/
validation
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
10
Star
12
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
validation
/
src
/
ValidatorFactoryFactory.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
43 lines (34 loc) · 1.37 KB
Breadcrumbs
validation
/
src
/
ValidatorFactoryFactory.php
Copy path
File metadata and controls
executable file
·
43 lines (34 loc) · 1.37 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<?php
declare
(strict_types=
1
);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace
Hyperf
\
Validation
;
use
Hyperf
\
Contract
\
TranslatorInterface
;
use
Hyperf
\
Database
\
ConnectionResolverInterface
;
use
Hyperf
\
Validation
\
Contract
\
PresenceVerifierInterface
;
use
Hyperf
\
Validation
\
Event
\
ValidatorFactoryResolved
;
use
Psr
\
Container
\
ContainerInterface
;
use
Psr
\
EventDispatcher
\
EventDispatcherInterface
;
use
function
Hyperf
\
Support
\
make
;
class
ValidatorFactoryFactory
{
public
function
__invoke
(
ContainerInterface
$
container
)
{
$
translator
=
$
container
->
get
(TranslatorInterface::class);
/** @var ValidatorFactory $validatorFactory */
$
validatorFactory
=
make
(ValidatorFactory::class,
compact
(
'
translator
'
,
'
container
'
));
if
(
$
container
->
has
(ConnectionResolverInterface::class) &&
$
container
->
has
(PresenceVerifierInterface::class)) {
$
presenceVerifier
=
$
container
->
get
(PresenceVerifierInterface::class);
$
validatorFactory
->
setPresenceVerifier
(
$
presenceVerifier
);
}
$
eventDispatcher
=
$
container
->
get
(EventDispatcherInterface::class);
$
eventDispatcher
->
dispatch
(
new
ValidatorFactoryResolved
(
$
validatorFactory
));
return
$
validatorFactory
;
}
}
Back
|
FazBrowse Home
|
New Git URL