Skip to content

Commit

Permalink
Import the classes instead of using them by namspace. (bunq#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
OGKevin committed Apr 7, 2018
1 parent 7972a37 commit 5beefbf
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions bin/bunq-install
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env php
<?php

use bunq\Util\BunqEnumApiEnvironmentType;
use bunq\Util\InstallationUtil;
use bunq\Exception\BunqException;

$filenameAutoloadLocal = __DIR__ . '/../vendor/autoload.php';
$filenameAutoloadVendor = __DIR__ . '/../../../autoload.php';

Expand All @@ -17,16 +21,16 @@ $allOption = getopt('', ['environment:', 'config-file:', 'api-key:']);

try {
if (empty($allOption)) {
\bunq\Util\InstallationUtil::interactiveInstall();
InstallationUtil::interactiveInstall();
} else {
\bunq\Util\InstallationUtil::automaticInstall(
new \bunq\Util\BunqEnumApiEnvironmentType($allOption['environment']),
InstallationUtil::automaticInstall(
new BunqEnumApiEnvironmentType($allOption['environment']),
$allOption['config-file'],
$allOption['api-key'] ?? null
);
}
} catch (bunq\Exception\BunqException $exception) {
echo sprintf(\bunq\Util\InstallationUtil::ERROR_BUNQ_EXCEPTION, $exception->getMessage());
} catch (BunqException $exception) {
echo sprintf(InstallationUtil::ERROR_BUNQ_EXCEPTION, $exception->getMessage());
} catch (Exception $exception) {
echo sprintf(\bunq\Util\InstallationUtil::ERROR_EXCEPTION, $exception->getMessage());
echo sprintf(InstallationUtil::ERROR_EXCEPTION, $exception->getMessage());
}

0 comments on commit 5beefbf

Please sign in to comment.