PHP Classes
elePHPant
Icontem

File: functions.php

Recommend this page to a friend!
  Classes of Wolfy-J  >  spiral  >  functions.php  >  Download  
File: functions.php
Role: Example script
Content type: text/plain
Description: Example script
Class: spiral
Modular Web application development framework
Author: By
Last change: Update functions.php
dumprr
Date: 1 month ago
Size: 846 bytes
 

 

Contents

Class file image Download
<?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)
    {
       
dump($value, Dumper::ERROR_LOG);
    }
}