本文整理汇总了PHP中App::bind方法的典型用法代码示例。如果您正苦于以下问题:PHP App::bind方法的具体用法?PHP App::bind怎么用?PHP App::bind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App
的用法示例。
在下文中一共展示了App::bind方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCancelBill
/**
* Отмена счёта
*/
public function testCancelBill()
{
App::bind('FintechFab\\QiwiSdk\\Curl', function () {
$reject = array('status' => 'rejected');
$args = array(1, 'PATCH', $reject);
$this->mock->shouldReceive('request')->withArgs($args)->andReturn((object) array('response' => (object) array('result_code' => 0)));
return $this->mock;
});
$resp = $this->call('POST', Config::get('ff-qiwi-shop::testConfig.testUrl') . '/action/cancelBill', array('order_id' => '1'));
$this->assertContains('Счёт отменён.', $resp->original['message']);
}
示例2: registerBindings
public function registerBindings()
{
$bindings = \Config::get('lablog::bindings');
foreach ($bindings as $interface => $binding) {
\App::bind($interface, $binding);
}
}
示例3: register
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->package('leeb/jsonrpc');
\App::bind('Leeb\\Jsonrpc\\Interfaces\\RequestInterface', function ($app, $data) {
return new \Leeb\Jsonrpc\Request($data[0]);
});
\App::bind('Leeb\\Jsonrpc\\JsonrpcResponse', function ($app, $data) {
return new \Leeb\Jsonrpc\JsonrpcResponse($data[0], $data[1], $data[2]);
});
\App::singleton('Leeb\\Jsonrpc\\Interfaces\\JsonrpcResponseBuilderInterface', 'Leeb\\Jsonrpc\\JsonrpcResponseBuilder');
\App::bind('Leeb\\Jsonrpc\\RoutableRequest', function ($app, $data) {
$resolver = \App::make('Leeb\\Jsonrpc\\Interfaces\\MethodResolverInterface');
$response_builder = \App::make('Leeb\\Jsonrpc\\Interfaces\\JsonrpcResponseBuilderInterface');
return new \Leeb\Jsonrpc\RoutableRequest($resolver, $response_builder, $data[0]);
});
\App::bind('Leeb\\Jsonrpc\\JsonrpcError', function ($app, $data) {
return new \Leeb\Jsonrpc\JsonrpcError($data[0], $data[1], $data[2], $data[3]);
});
\App::bind('Leeb\\Jsonrpc\\RoutableNotification', function ($app, $data) {
$resolver = \App::make('Leeb\\Jsonrpc\\Interfaces\\MethodResolverInterface');
return new \Leeb\Jsonrpc\RoutableNotification($resolver, $data[0]);
});
\App::bind('Leeb\\Jsonrpc\\RoutableBatch', function ($app, $data) {
return new \Leeb\Jsonrpc\RoutableBatch($data[0]);
});
\App::singleton('Leeb\\Jsonrpc\\Interfaces\\RouterInterface', 'Leeb\\Jsonrpc\\Router');
\App::singleton('Leeb\\Jsonrpc\\Interfaces\\MethodResolverInterface', 'Leeb\\Jsonrpc\\MethodResolver');
\App::singleton('Leeb\\Jsonrpc\\Interfaces\\JsonrpcConfigurationInterface', 'Leeb\\Jsonrpc\\JsonrpcConfiguration');
\App::singleton('Leeb\\Jsonrpc\\Interfaces\\RequestValidatorInterface', 'Leeb\\Jsonrpc\\RequestValidator');
\App::singleton('Leeb\\Jsonrpc\\Interfaces\\RawRequestInterpreterInterface', 'Leeb\\Jsonrpc\\RawRequestInterpreter');
}
示例4: setUp
public function setUp()
{
parent::setUp();
\App::bind("App\\Repositories\\RecipeRepositoryInterface", "App\\Tests\\StubRepositories\\RecipeRepository");
\App::bind("App\\Presenter\\FeedInterface", "App\\Presenter\\Feed");
$this->controller = new FeedController(\App::make("App\\Presenter\\FeedInterface"), \App::make("App\\Repositories\\RecipeRepositoryInterface"));
}
示例5: boot
public function boot()
{
App::bind('form', function () {
return new TwanooLib\FormPlus();
});
parent::boot();
}
示例6: register
public function register()
{
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\DefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\DefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\CsvDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\CsvDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\TabularColumnsRepositoryInterface', 'Tdt\\Core\\Repositories\\TabularColumnsRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\GeoPropertyRepositoryInterface', 'Tdt\\Core\\Repositories\\GeoPropertyRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\XlsDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\XlsDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\ShpDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\ShpDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\JsonDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\JsonDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\XmlDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\XmlDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\SparqlDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\SparqlDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\InstalledDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\InstalledDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\LanguageRepositoryInterface', 'Tdt\\Core\\Repositories\\LanguageRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\LicenseRepositoryInterface', 'Tdt\\Core\\Repositories\\LicenseRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\OntologyRepositoryInterface', 'Tdt\\Core\\Repositories\\OntologyRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\RdfDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\RdfDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\JsonldDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\JsonldDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\DcatRepositoryInterface', 'Tdt\\Core\\Repositories\\DcatRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\SettingsRepositoryInterface', 'Tdt\\Core\\Repositories\\SettingsRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\ThemeRepositoryInterface', 'Tdt\\Core\\Repositories\\ThemeRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\MysqlDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\MysqlDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\MongoDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\MongoDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\ElasticsearchDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\ElasticsearchDefinitionRepository');
\App::bind('Tdt\\Core\\Repositories\\Interfaces\\GeoprojectionRepositoryInterface', 'Tdt\\Core\\Repositories\\GeoprojectionRepository');
}
示例7: setUp
public function setUp()
{
parent::setUp();
\App::bind("App\\Repositories\\SectionRepositoryInterface", "App\\Tests\\StubRepositories\\SectionRepository");
\App::bind("App\\Repositories\\CategoryRepositoryInterface", "App\\Tests\\StubRepositories\\CategoryRepository");
\App::bind("App\\Repositories\\RecipeRepositoryInterface", "App\\Tests\\StubRepositories\\RecipeRepository");
$this->controller = new RecipeController(\App::make("App\\Repositories\\SectionRepositoryInterface"), \App::make("App\\Repositories\\CategoryRepositoryInterface"), \App::make("App\\Repositories\\RecipeRepositoryInterface"), new Hal());
}
示例8: boot
public function boot()
{
$this->package('dazza76/Laravel4Secureurl');
\App::bind('url', function () {
return new SecureUrlGenerator(\App::make('router')->getRoutes(), \App::make('request'));
});
parent::boot();
}
示例9: register
/**
* Register the application services.
*
* @return void
*/
public function register()
{
\App::bind('GoogleAPIWrapper', function () {
return new GoogleAPIWrapperClass();
});
$this->app->make('Brognara\\GoogleAPIWrapper\\GoogleAPIWrapperClass');
//include __DIR__.'/routes.php';
}
示例10: __construct
public function __construct()
{
App::bind('Pusher', function ($app) {
$keys = $app['config']->get('services.pusher');
return new Pusher($keys['public'], $keys['secret'], $keys['app_id']);
});
$this->beforeFilter('csrf', array('on' => 'post'));
}
示例11: register
public function register()
{
foreach (glob(app_path() . '/Expert/Helpers/*.php') as $filename) {
require_once $filename;
}
\App::bind('general', function () {
return new General();
});
}
示例12: register
public function register()
{
\App::bind('reader', function () {
return new Reader();
});
\App::bind('writer', function () {
return new Writer();
});
}
示例13: register
/**
* Register any application services.
*
* This service provider is a great spot to register your various container
* bindings with the application. As you can see, we are registering our
* "Registrar" implementation here. You can add your own bindings too!
*
* @return void
*/
public function register()
{
\App::bind('markdown', function () {
$parser = new \cebe\markdown\GithubMarkdown();
$parser->html5 = true;
$parser->keepListStartNumber = true;
return $parser;
});
}
示例14: register
public function register()
{
\App::bind('MindOfMicah\\LaravelDatatables\\Datatable', function () {
return new \MindOfMicah\LaravelDatatables\Datatable();
});
\App::bind('mindofmicah.datatables', function () {
return new \MindOfMicah\LaravelDatatables\Datatable();
});
}
示例15: register
public function register()
{
App::bind('resource.controller', function () {
return new ControllerGenerator();
});
App::bind('resource.route', function () {
return new RouteGenerator();
});
}