2017 © Pedro Peláez
 

library facade

Pseudo-static accessors for Phi bindings

image

bapcat/facade

Pseudo-static accessors for Phi bindings

  • Monday, June 11, 2018
  • by LordMonoxide
  • Repository
  • 3 Watchers
  • 0 Stars
  • 65 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 7 Versions
  • 3 % Grown

The README.md

Build Status Coverage Status License, (*1)

Phi Facades

Facades are a way to make Phi bindings feel more natural., (*2)

Installation

Composer

Composer is the recommended method of installation for Facade., (*3)

$ composer require bapcat/facade

GitHub

Facade may be downloaded from GitHub., (*4)

Features

Pseudo-Static Access To Phi Singletons

A common use-case for Phi Facades is logging:, (*5)

namespace Vendor\Package\Logging;

class Logger {
  public function warning($text) {
    // ...
  }
}
$logger = new Vendor\Package\Logging\Logger;

$phi = BapCat\Phi\Phi::instance();
$phi->bind('core.log', $logger);
use BapCat\Facade\Facade;

class Log extends Facade {
  protected static $_binding = 'core.log';
}

Once the facade is set up, the Vendor\Package\Logging singleton can be accessed like this:, (*6)

Log::warning('Something bad happened!');

Phi Facades can even be used to create a facade for Phi:, (*7)

$phi = BapCat\Phi\Phi::instance();
$phi->bind('phi', $phi);
use BapCat\Facade\Facade;

class Phi extends Facade {
  protected static $_binding = 'phi';
}

This will allow Phi to be accessed as such:, (*8)

Phi::bind('Bar', 'Foo');
$foo = Phi::make('Bar');

Phi Custom Resolvers

If you are using Phi 1.2.0 or greater, Phi facades will work seamlessly with custom resolvers., (*9)

The Versions

11/06 2018

dev-master

9999999-dev http://github.com/BapCat/Facade

Pseudo-static accessors for Phi bindings

  Sources   Download

GPLv3

The Requires

 

The Development Requires

by Corey Frenette

dependency injection ioc inversion of control di facade

11/06 2018

2.0.3

2.0.3.0 http://github.com/BapCat/Facade

Pseudo-static accessors for Phi bindings

  Sources   Download

GPLv3

The Requires

 

The Development Requires

by Corey Frenette

dependency injection ioc inversion of control di facade

07/05 2017

2.0.2

2.0.2.0 http://github.com/BapCat/Facade

Pseudo-static accessors for Phi bindings

  Sources   Download

GPLv3

The Requires

 

The Development Requires

by Corey Frenette

dependency injection ioc inversion of control di facade

31/03 2017

2.0.1

2.0.1.0 http://github.com/BapCat/Facade

Pseudo-static accessors for Phi bindings

  Sources   Download

GPLv3

The Requires

 

The Development Requires

by Corey Frenette

dependency injection ioc inversion of control di facade

31/03 2017

2.0.0

2.0.0.0 http://github.com/BapCat/Facade

Pseudo-static accessors for Phi bindings

  Sources   Download

GPLv3

The Requires

 

The Development Requires

by Corey Frenette

dependency injection ioc inversion of control di facade

13/08 2015

1.0.1

1.0.1.0 http://github.com/BapCat/Facade

Pseudo-static accessors for Phi bindings

  Sources   Download

GPLv3

The Requires

 

The Development Requires

by Corey Frenette

dependency injection ioc inversion of control di facade

15/06 2015

1.0.0

1.0.0.0 http://github.com/BapCat/Facade

Pseudo-static accessors for Phi bindings

  Sources   Download

GPLv3

The Requires

 

The Development Requires

by Corey Frenette

dependency injection ioc inversion of control di facade