| Conditions | 2 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function register() |
||
| 30 | { |
||
| 31 | $container = $this->getContainer(); |
||
| 32 | |||
| 33 | // Get the adapter instance from the factory |
||
| 34 | $container->add(Adapter::class, function(AdapterFactory $factory, Site $site) { |
||
| 35 | return $factory->fromSite($site); |
||
| 36 | })->withArgument(AdapterFactory::class)->withArgument(Site::class); |
||
| 37 | |||
| 38 | // Connect to concrete5 |
||
| 39 | $container->add(Connection::class, function(Concrete5 $client, Console $console) { |
||
| 40 | if ($result = $client->connect()) { |
||
| 41 | $console->registerErrorHandler(); |
||
| 42 | return $result; |
||
| 43 | } |
||
| 44 | })->withArguments([Concrete5::class, Console::class]); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |