forked from spiral/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
40 lines (37 loc) · 852 Bytes
/
Copy pathfunctions.php
File metadata and controls
40 lines (37 loc) · 852 Bytes
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
<?php
/**
* Spiral Framework.
*
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
declare(strict_types=1);
use Spiral\Debug\Dumper;
if (!function_exists('bind')) {
/**
* Shortcut to container Autowire definition.
*
* Example:
* 'name' => bind(SomeClass::name, [...])
*
* @param string $alias Class name or alias.
* @param array $parameters
*
* @return \Spiral\Core\Container\Autowire
*/
function bind(string $alias, array $parameters = [])
{
return new \Spiral\Core\Container\Autowire($alias, $parameters);
}
}
if (!function_exists('dumprr')) {
/**
* Dumprr is similar to Dump function but always redirect output to STDERR.
*
* @param mixed $value
*/
function dumprr($value): void
{
dump($value, Dumper::ERROR_LOG);
}
}