PHP App::bind Examples

PHP App::bind - 30 examples found. These are the top rated real world PHP examples of App::bind extracted from open source projects. You can rate examples to help us improve the quality of examples.
 /**
  * Отмена счёта
  */
 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']);
 }
Example #2
0
 public function registerBindings()
 {
     $bindings = \Config::get('lablog::bindings');
     foreach ($bindings as $interface => $binding) {
         \App::bind($interface, $binding);
     }
 }
Example #3
0
 /**
  * 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');
 }
 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"));
 }
 public function boot()
 {
     App::bind('form', function () {
         return new TwanooLib\FormPlus();
     });
     parent::boot();
 }
Example #6
0
 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');
 }
 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());
 }
 public function boot()
 {
     $this->package('dazza76/Laravel4Secureurl');
     \App::bind('url', function () {
         return new SecureUrlGenerator(\App::make('router')->getRoutes(), \App::make('request'));
     });
     parent::boot();
 }
 /**
  * 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';
 }
Example #10
0
 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'));
 }
 public function register()
 {
     foreach (glob(app_path() . '/Expert/Helpers/*.php') as $filename) {
         require_once $filename;
     }
     \App::bind('general', function () {
         return new General();
     });
 }
Example #12
0
 public function register()
 {
     \App::bind('reader', function () {
         return new Reader();
     });
     \App::bind('writer', function () {
         return new Writer();
     });
 }
 /**
  * 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;
     });
 }
 public function register()
 {
     \App::bind('MindOfMicah\\LaravelDatatables\\Datatable', function () {
         return new \MindOfMicah\LaravelDatatables\Datatable();
     });
     \App::bind('mindofmicah.datatables', function () {
         return new \MindOfMicah\LaravelDatatables\Datatable();
     });
 }
 public function register()
 {
     App::bind('resource.controller', function () {
         return new ControllerGenerator();
     });
     App::bind('resource.route', function () {
         return new RouteGenerator();
     });
 }
Example #16
0
 /**
  * Define environment setup.
  *
  * @param  \Illuminate\Foundation\Application  $app
  *
  * @return void
  */
 protected function getEnvironmentSetUp($app)
 {
     $app['path.base'] = __DIR__ . '/..';
     $app['config']->set('database.default', 'sqlite');
     $app['config']->set('database.connections.sqlite', ['driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '']);
     $app['config']->set('anavel.translation_languages', ['gl', 'en', 'es']);
     \App::bind('ANavallaSuiza\\Laravel\\Database\\Contracts\\Manager\\ModelManager', function ($app) {
         return \Mockery::mock('ANavallaSuiza\\Laravel\\Database\\Manager\\Eloquent\\ModelManager');
     });
 }
 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     \App::bind('admin', function () {
         // set debug mode!
         if (!\Configuration::has('debug')) {
             \Configuration::set('debug', true);
         }
         return new \App\Classes\Admin();
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->package('someguy123/proxmox');
     \App::bind('proxmox', function () {
         $credentials = Config::get('proxmox::server.server');
         var_dump($credentials);
         $proxmox = new \ProxmoxVE\Proxmox($credentials);
         return $proxmox;
     });
 }
 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     Artisan::call('db:seed');
     Mail::pretend(true);
     Route::enableFilters();
     App::bind('Helpers\\JsonRPCClientInterface', 'Helpers\\DummyJsonRPCClient');
     App::bind('Helpers\\DataParserInterface', 'Helpers\\DummyDataParser');
 }
 protected function mock($className)
 {
     $mock = m::mock($className);
     App::bind($className, function ($app, $parameters = []) use($mock) {
         if (is_array($parameters) && is_array($attributes = array_get($parameters, 0, [])) && respond_to($mock, "fill")) {
             $mock = $this->fillMock($mock, $attributes);
         }
         return $mock;
     });
     return $mock;
 }
 public function testGetRequest5()
 {
     $this->requestData = array('term' => 1, 'event' => 'im_hungry', 'data' => json_encode(array('time' => '13.30', 'have_money' => true)), 'sign' => $this->sign);
     App::bind('FintechFab\\ActionsCalc\\Components\\SendResults', function () {
         $this->mock->shouldReceive('sendHttp')->withArgs(['http://test', '1', $this->requestData]);
         $this->mock->shouldReceive('sendQueue')->withArgs(['queueTest', 'go_eat', $this->requestData]);
         return $this->mock;
     });
     $response = $this->call('POST', '/actions-calc/getRequest', $this->requestData);
     $this->assertContains(json_encode(['countFitRules' => 1]), $response->original);
 }
Example #22
0
 public function setUp()
 {
     parent::setup();
     $ingredient_repository = new CSVIngredientRepository();
     $recipe_repository = new JSONRecipeRepository();
     $ingredient_repository->setDatasource(app_path() . '/tests/data/ingredients.csv');
     $recipe_repository->setDatasource(app_path() . '/tests/data/recipes.json');
     App::bind('RecipeFinder\\Ingredient\\IngredientRepositoryInterface', 'RecipeFinder\\Ingredient\\CSVIngredientRepository');
     App::bind('RecipeFinder\\Recipe\\RecipeRepositoryInterface', 'RecipeFinder\\Recipe\\JSONRecipeRepository');
     $this->recipe_finder = new RecipeFinder($recipe_repository, $ingredient_repository);
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     \App::bind('route53', function () {
         return new Route53();
     });
     $this->app->singleton('aws_sdk', function ($app) {
         $config = $app->make('config')->get('aws_sdk');
         return new AWS_SDK($config);
     });
     $this->app->alias('aws_sdk', 'Lu1sSuarez\\SDK');
 }
Example #24
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     \App::bind('salty', function () {
         $masterHost = \Config::get('salt.host');
         $masterPort = \Config::get('salt.port');
         $credentials = \Config::get('salt.credentials');
         $authType = \Config::get('salt.auth_type');
         $validation = \Config::get('salt.api_certificate_path');
         $api = new SaltApi($masterHost, $masterPort, $authType, $credentials, $validation);
         return new SaltApiBuilder($api);
     });
 }
Example #25
0
 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('jlem/fields');
     \App::bind('field', function () {
         return \App::make('Jlem\\Fields\\FormField');
     });
     \Str::macro('spaceCase', function ($string) {
         return ucwords(str_replace('_', ' ', \snake_case($string)));
     });
     \App::bind('Jlem\\Fields\\Arguments\\LabelTranslator', \Config::get('fields::config.label_translator'));
     \App::bind('Jlem\\Fields\\Arguments\\ArgumentMerger', \Config::get('fields::config.argument_merger'));
 }
 /**
  * Получить новый счёт
  *
  * @return void
  */
 public function testGetBillSuccess()
 {
     App::bind('FintechFab\\QiwiSdk\\Curl', function () {
         $bill = array('user' => 'tel:+7123', 'amount' => 543.21, 'ccy' => 'RUB', 'comment' => 'without', 'lifetime' => date('Y-m-d\\TH:i:s', time() + 3600 * 24 * 3), 'prv_name' => Gateway::getConfig('provider.name'));
         $args = array(1, 'PUT', $bill);
         $this->mock->shouldReceive('request')->withArgs($args)->andReturn((object) array('response' => (object) array('result_code' => 0, 'bill' => (object) array('bill_id' => 123))));
         return $this->mock;
     });
     $order = new Order();
     $order->create(array('user_id' => 1, 'item' => 'New Lamp2', 'sum' => 543.21, 'tel' => '+7123', 'comment' => 'without', 'status' => 'new', 'lifetime' => date('Y-m-d H:i:s', time() + 3600 * 24 * 3)));
     $resp = $this->call('POST', Config::get('ff-qiwi-shop::testConfig.testUrl') . '/action/createBill', array('order_id' => '1'));
     $this->assertContains('Счёт выставлен', $resp->original['message']);
 }
 /**
  * Register any package services.
  *
  * @return void
  */
 public function register()
 {
     //Add the public disk for storing the scripts and styles cache
     if (!isset($this->app['config']["filesystems.disks.public"])) {
         $this->app['config']["filesystems.disks.public"] = ['driver' => 'local', 'root' => public_path()];
     }
     //Include the enqueuer class
     require_once 'enqueuer.php';
     //Add alias for the enqueuer facade.
     $loader = \Illuminate\Foundation\AliasLoader::getInstance();
     $loader->alias('Enqueuer', '\\morningtrain\\enqueuer\\enqueuer');
     \App::bind('Enqueuer', function () {
         return new \morningtrain\enqueuer\enqueuer();
     });
 }
 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     \App::bind('Owl\\Repositories\\CommentRepositoryInterface', 'Owl\\Repositories\\Eloquent\\CommentRepository');
     \App::bind('Owl\\Repositories\\ImageRepositoryInterface', 'Owl\\Repositories\\Eloquent\\ImageRepository');
     \App::bind('Owl\\Repositories\\LoginTokenRepositoryInterface', 'Owl\\Repositories\\Eloquent\\LoginTokenRepository');
     \App::bind('Owl\\Repositories\\LikeRepositoryInterface', 'Owl\\Repositories\\Eloquent\\LikeRepository');
     \App::bind('Owl\\Repositories\\StockRepositoryInterface', 'Owl\\Repositories\\Eloquent\\StockRepository');
     \App::bind('Owl\\Repositories\\TemplateRepositoryInterface', 'Owl\\Repositories\\Eloquent\\TemplateRepository');
     \App::bind('Owl\\Repositories\\UserRepositoryInterface', 'Owl\\Repositories\\Eloquent\\UserRepository');
     \App::bind('Owl\\Repositories\\TagRepositoryInterface', 'Owl\\Repositories\\Eloquent\\TagRepository');
     \App::bind('Owl\\Repositories\\TagFtsRepositoryInterface', 'Owl\\Repositories\\Eloquent\\TagFtsRepository');
     \App::bind('Owl\\Repositories\\ItemRepositoryInterface', 'Owl\\Repositories\\Eloquent\\ItemRepository');
     \App::bind('Owl\\Repositories\\ItemFtsRepositoryInterface', 'Owl\\Repositories\\Eloquent\\ItemFtsRepository');
     \App::bind('Owl\\Repositories\\ItemHistoryRepositoryInterface', 'Owl\\Repositories\\Eloquent\\ItemHistoryRepository');
 }
 /**
  * Проверка статуса возврата с несозданным возвратом
  */
 public function testShowStatusPayReturn()
 {
     App::bind('FintechFab\\QiwiSdk\\Curl', function () {
         $args = array(1, 'GET', null, 1);
         $this->mock->shouldReceive('request')->withArgs($args)->andReturn((object) array('response' => (object) array('result_code' => 0, 'refund' => (object) array('status' => 'processing'))));
         return $this->mock;
     });
     $order = Order::find(1);
     $order->idLastReturn = 1;
     $order->save();
     $payReturn = new PayReturn();
     $payReturn->create(array('order_id' => $order->id, 'sum' => 15, 'status' => 'onReturn'));
     $resp = $this->call('POST', Config::get('ff-qiwi-shop::testConfig.testUrl') . '/action/statusReturn', array('order_id' => '1'));
     $this->assertContains('Текущий статус возврата - на возврате', $resp->original['message']);
 }
 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     $app = parent::boot();
     $resolver = $this->app['view.engine.resolver'];
     $app = $this->app;
     $app->singleton('blade.compiler', function ($app) {
         $cache = $app['config']['view.compiled'];
         return new ModifiedBladeCompiler($app['files'], $cache);
     });
     $resolver->register('blade', function () use($app) {
         return new ModifiedCompilerEngine($app['blade.compiler']);
     });
     \App::bind('squeezer', function () {
         return new \Ardentic\Squeezer\Squeezer();
     });
     Squeezer::attach($this->app);
 }